diff -Nru xpsb-glx-0.19/COPYING xpsb-glx-0.19/COPYING --- xpsb-glx-0.19/COPYING 2009-05-26 18:25:54.000000000 +0100 +++ xpsb-glx-0.19/COPYING 2010-06-24 06:42:04.000000000 +0100 @@ -1,3 +1,7 @@ +Copyright: + + Copyright (C) 2007-2008 Intel Coporation, INTEL CONFIDENTIAL, All rights reserved. + License: Copyright (c) 2008, Intel Corporation. @@ -8,62 +12,34 @@ Redistribution and Use *********************** -Redistribution and use in binary form, without modification, of the -software code provided with this license (“Software?, are permitted -provided that the following conditions are met: - -* Redistributions must reproduce the above copyright notice and this -license in the documentation and/or other materials provided with the -Software. - -* Neither the name of Intel Corporation nor the name of Imagination -Technologies, Ltd may be used to endorse or promote products derived -from the Software without specific prior written permission. - -* The Software can only be used in connection with the Intel hardware -designed to use the Software as outlined in the documentation. No -other use is authorized. +Redistribution and use in binary form, without modification, of the software code provided with this license (“Software?, are permitted provided that the following conditions are met: + +* Redistributions must reproduce the above copyright notice and this license in the documentation and/or other materials provided with the Software. -* No reverse engineering, decompilation, or disassembly of the -Software is permitted. +* Neither the name of Intel Corporation nor the name of Imagination Technologies, Ltd may be used to endorse or promote products derived from the Software without specific prior written permission. -* The Software may not be distributed under terms different than this -license. +* The Software can only be used in connection with the Intel hardware designed to use the Software as outlined in the documentation. No other use is authorized. + +* No reverse engineering, decompilation, or disassembly of the Software is permitted. + +* The Software may not be distributed under terms different than this license. *********************** Limited Patent License *********************** -Intel Corporation grants a world-wide, royalty-free, non-exclusive -license under patents it now or hereafter owns or controls to make, -have made, use, import, offer to sell and sell (“Utilize? the -Software, but solely to the extent that any such patent is necessary -to Utilize the Software alone. The patent license shall not apply to -any combinations which include the Software. No hardware per se is -licensed hereunder. +Intel Corporation grants a world-wide, royalty-free, non-exclusive license under patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell (“Utilize? the Software, but solely to the extent that any such patent is necessary to Utilize the Software alone. The patent license shall not apply to any combinations which include the Software. No hardware per se is licensed hereunder. ************************************** Ownership of Software and Copyrights ************************************** -Title to all copies of the Software remains with the copyright -holders. The Software is copyrighted and protected by the laws of the -United States and other countries, and international treaty -provisions. +Title to all copies of the Software remains with the copyright holders. The Software is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. *********** DISCLAIMER *********** -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *** + diff -Nru xpsb-glx-0.19/debian/changelog xpsb-glx-0.19/debian/changelog --- xpsb-glx-0.19/debian/changelog 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/changelog 2010-06-24 06:54:19.000000000 +0100 @@ -1,19 +1,69 @@ -xpsb-glx (0.19-0ubuntu1ppa9.10+1) karmic; urgency=low +xpsb-glx (0.19-0ubuntu1ppa10.04) karmic; urgency=low - * Merge from Lucazade PPA to mine. + * version bump to force install on karmic, and to align to ppa format - -- Nicolas Derive Tue, 27 Oct 2009 13:27:36 +0100 + -- JosĂ© Bernardo Bandos Rodrigues Thu, 24 Jun 2010 07:42:56 +0200 -xpsb-glx (0.19-0ubuntu1~910um1) karmic; urgency=low +xpsb-glx (0.18-0ubuntu1netbook2~1004um1) lucid; urgency=low - * Karmic release + * Non-maintainer upload. + * Changed prefix + * Disabled mesa compilation for now, as it seems no longer necessary - -- Luca Forina Wed, 13 Sep 2009 03:28:23 +1000 - -xpsb-glx (0.18-0ubuntu1~904um1) jaunty; urgency=low + -- Jose Bernardo Bandos Tue, 11 May 2010 16:11:04 +0200 - * Initial package for Jaunty. +xpsb-glx (0.18-0ubuntu1netbook2) lucid; urgency=low - -- Steve Kowalik Wed, 27 May 2009 03:28:23 +1000 + * Updated to use libdrm-poulsbo new structure (pkg-config and dir changes) + -- Jose Bernardo Bandos Sun, 09 May 2010 07:59:10 +0200 + +xpsb-glx (0.18-0ubuntu1netbook1) jaunty; urgency=low + + * Add new mesa code from 0046_Jaunty: + - D2_Build_26 + - Fixed Quads w/ or w/o GL_BLEND performance regression issue + - Fixed the glxdemo bug when dragging window on X server 1.6.x + * debian/rules: + - Build libGl.so* + * debian/{preinst|postrm}: + - Add and remove diversions on libGL.so*. + + -- Alberto Milone Fri, 24 Jul 2009 19:57:30 +0200 + +xpsb-glx (0.13-0ubuntu3netbook2) jaunty; urgency=low + + * Rebuild for PPA. + + -- Alberto Milone Tue, 26 May 2009 14:19:05 +0200 + +xpsb-glx (0.13-0ubuntu3netbook1) netbook-jaunty; urgency=low + + * Bump revision for upload to netbook-jaunty. + + -- Alberto Milone Fri, 15 May 2009 11:45:18 +0200 + +xpsb-glx (0.13-0ubuntu2) jaunty; urgency=low + + * debian/control: + - Set architecture to i386 lpia + - Add build dependency on cdbs + * debian/rules: + - Switch back to CDBS + * debian/copyright: + - Mention Canonical Ltd (for the packaging) and Intel for the software + + -- Alberto Milone Wed, 06 May 2009 11:37:53 +0200 + +xpsb-glx (0.13-0ubuntu1) jaunty; urgency=low + + * Update the version for 5.0.0.0045 + + -- Alberto Milone Thu, 30 Apr 2009 15:41:32 +0200 + +xpsb-glx (0.12-0ubuntu1) jaunty; urgency=low + + * Initial package for Intrepid. + + -- Alberto Milone Thu, 16 Apr 2009 12:30:20 +0200 diff -Nru xpsb-glx-0.19/debian/control xpsb-glx-0.19/debian/control --- xpsb-glx-0.19/debian/control 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/control 2010-06-24 06:41:59.000000000 +0100 @@ -2,14 +2,24 @@ Section: misc Priority: optional Maintainer: Ubuntu Mobile Developers -XSBC-Original-Maintainer: Waldo Bastian -Build-Depends: debhelper (>= 7), libdrm-poulsbo-dev, libva-dev, libexpat1-dev +XSBC-Original-Maintainer: Intel +Build-Depends: debhelper (>= 7), cdbs, libtool, libdrm-poulsbo-dev, libva-dev, libexpat1-dev, pkg-config, xserver-xorg-dev (>= 2:1.3), xutils-dev, x11proto-gl-dev, x11proto-video-dev, libgl1-mesa-dev | libgl-dev, libxvmc-dev (>= 1:1.0.1-1), x11proto-core-dev, x11proto-fonts-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-xinerama-dev, x11proto-xf86dri-dev, x11proto-xf86dga-dev, x11proto-xf86misc-dev, libxfixes-dev, libxdamage-dev, libxxf86vm-dev, libxmu-dev, libxi-dev, flex, bison Standards-Version: 3.8.0 Package: xpsb-glx -Architecture: any -Depends: ${shlibs:Depends}, psb-firmware +Architecture: i386 +Depends: ${shlibs:Depends} Description: X11 drivers for Poulsbo (psb) 3D acceleration This package contains the 3D X11 drivers for the Poulsbo (psb) graphics subsystem. +Package: xpsb-glx-dbg +Section: debug +Priority: extra +Architecture: i386 +Depends: xpsb-glx (= ${binary:Version}) ${shlibs:Depends} +Description: X11 drivers for Poulsbo (psb) 3D acceleration + This package provides debugging symbols for the + 3D X11 drivers for the Poulsbo (psb) graphics + subsystem. + diff -Nru xpsb-glx-0.19/debian/copyright xpsb-glx-0.19/debian/copyright --- xpsb-glx-0.19/debian/copyright 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/copyright 2010-06-24 06:41:59.000000000 +0100 @@ -1,64 +1,88 @@ -This code was extracted from the Poulsbo driver posted to the Intel(R) -Validation Internet Portal at https://platformsw.intel.com/. See -README.Source for details. +This package was debianized by Steve Kowalik on +Wed, 01 Apr 2009 13:58:46 +1100 -Copyright: Copyright (c) 2007-2008 Intel Corporation +It was downloaded from + +Upstream Author: + +Copyright: Copyright (c) 2007 Intel Corporation Copyright (c) 2005-2007 Imagination Technologies Limited, UK - All rights reserved. + Copyright (c) 2007-2008 Intel Corporation License: +Copyright (c) 2008, Intel Corporation. +Portions (c), Imagination Technologies, Ltd. +All rights reserved. *********************** Redistribution and Use *********************** -Redistribution and use in binary form, without modification, of the software code provided with this license (żSoftware?, are permitted provided that the following conditions are met: - -* Redistributions must reproduce the above copyright notice and this license in the documentation and/or other materials provided with the Software. +Redistribution and use in binary form, without modification, of the +software code provided with this license (“Software?, are permitted +provided that the following conditions are met: + +* Redistributions must reproduce the above copyright notice and this +license in the documentation and/or other materials provided with the +Software. + +* Neither the name of Intel Corporation nor the name of Imagination +Technologies, Ltd may be used to endorse or promote products derived +from the Software without specific prior written permission. + +* The Software can only be used in connection with the Intel hardware +designed to use the Software as outlined in the documentation. No +other use is authorized. -* Neither the name of Intel Corporation nor the name of Imagination Technologies, Ltd may be used to endorse or promote products derived from the Software without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of the +Software is permitted. -* The Software can only be used in connection with the Intel hardware designed to use the Software as outlined in the documentation. No other use is authorized. - -* No reverse engineering, decompilation, or disassembly of the Software is permitted. - -* The Software may not be distributed under terms different than this license. +* The Software may not be distributed under terms different than this +license. *********************** Limited Patent License *********************** -Intel Corporation grants a world-wide, royalty-free, non-exclusive license under patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell (żUtilize? the Software, but solely to the extent that any such patent is necessary to Utilize the Software alone. The patent license shall not apply to any combinations which include the Software. No hardware per se is licensed hereunder. +Intel Corporation grants a world-wide, royalty-free, non-exclusive +license under patents it now or hereafter owns or controls to make, +have made, use, import, offer to sell and sell (“Utilize? the +Software, but solely to the extent that any such patent is necessary +to Utilize the Software alone. The patent license shall not apply to +any combinations which include the Software. No hardware per se is +licensed hereunder. ************************************** Ownership of Software and Copyrights ************************************** -Title to all copies of the Software remains with the copyright holders. The Software is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. +Title to all copies of the Software remains with the copyright +holders. The Software is copyrighted and protected by the laws of the +United States and other countries, and international treaty +provisions. *********** DISCLAIMER *********** -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *** -The Debian packaging is Copyright 2009 Canonical Ltd, and is covered by the -following license: -GPL version 2 (only), see /usr/share/common-licenses/GPL-2 on Ubuntu/Debian -systems. +The Debian packaging is (C) 2009, Canonical Ltd and +is licensed under the GPL, version 3 + - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff -Nru xpsb-glx-0.19/debian/install xpsb-glx-0.19/debian/install --- xpsb-glx-0.19/debian/install 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/install 2010-06-24 06:41:59.000000000 +0100 @@ -1,3 +1,4 @@ +#mesa/lib/libGL.so.* usr/lib/ drivers/* usr/lib/xorg/modules/drivers -dri/psb_drv_video.* usr/X11R6/lib/modules/dri +dri/psb_drv_video.* usr/lib/va/drivers dri/psb_dri.so usr/lib/dri diff -Nru xpsb-glx-0.19/debian/postrm xpsb-glx-0.19/debian/postrm --- xpsb-glx-0.19/debian/postrm 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/debian/postrm 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,53 @@ +#! /bin/sh +# postrm script for xpsb-glx +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + remove|purge) + if [ "$(dpkg-divert --list /usr/lib/libGL.so.1 | awk '{ print $7 }')" = "xpsb-glx" ]; then + dpkg-divert --remove --rename --package xpsb-glx --divert /usr/lib/psb/libGL.so.1.xlibmesa /usr/lib/libGL.so.1 > /dev/null + fi + + if [ "$(dpkg-divert --list /usr/lib/libGL.so.1.2 | awk '{ print $7 }')" = "xpsb-glx" ]; then + dpkg-divert --remove --rename --package xpsb-glx --divert /usr/lib/psb/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2 > /dev/null + fi + + + if [ -d /usr/lib/psb ]; then + rmdir --ignore-fail-on-non-empty /usr/lib/psb/ > /dev/null || true; + fi + + ldconfig + + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + +esac + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -Nru xpsb-glx-0.19/debian/preinst xpsb-glx-0.19/debian/preinst --- xpsb-glx-0.19/debian/preinst 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/debian/preinst 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,56 @@ +#! /bin/sh +# preinst script for xpsb-glx +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# For details see /usr/share/doc/packaging-manual/ + + + +case "$1" in + install|upgrade) + + # Remove previous diversions + if dpkg-divert --list /usr/lib/libGL.so.1 | grep 'xpsb-glx' > /dev/null ; then + dpkg-divert --remove --rename --package xpsb-glx --divert /usr/lib/psb/libGL.so.1.xlibmesa /usr/lib/libGL.so.1 > /dev/null || true + fi + + if dpkg-divert --list /usr/lib/libGL.so.1.2 | grep 'xpsb-glx' > /dev/null ; then + dpkg-divert --remove --rename --package xpsb-glx --divert /usr/lib/psb/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2 > /dev/null || true + fi + + # Create the directory which will contain the original libraries + if ! [ -d /usr/lib/psb ]; then + mkdir -p /usr/lib/psb + fi + + # Add new diversions +# dpkg-divert --add --rename --package xpsb-glx --divert /usr/lib/psb/libGL.so.1.xlibmesa /usr/lib/libGL.so.1 > /dev/null +# dpkg-divert --add --rename --package xpsb-glx --divert /usr/lib/psb/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2 > /dev/null + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -Nru xpsb-glx-0.19/debian/README.source xpsb-glx-0.19/debian/README.source --- xpsb-glx-0.19/debian/README.source 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/README.source 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -The unpacked source for this package is the preferred form of modification, -but be sure to check the copyright file regarding what data may be modified -under the license. - -The orig tarball is transformed using files from -Intel-GMA500_5.0.0.0045_Jaunty_PV.zip which is downloaded -from the Intel(R) Validation Internet Portal, located at -https://platformsw.intel.com/ - -After downloading the original software, run `debian/rules get-orig-source` -from the base package directory to synthesize the orig.tar.gz file. - -To upgrade the software, the debian/repack script must be edited to reference -the correct file name for the download, and may need additional modification -to ensure correct extraction of the library objects. - diff -Nru xpsb-glx-0.19/debian/repack xpsb-glx-0.19/debian/repack --- xpsb-glx-0.19/debian/repack 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/repack 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ -#!/bin/sh - -set -e - -if [ ! -e Intel-GMA500-5.0.1.0046_Jaunty_PV_HF.zip ]; then - echo "Please have Intel-GMA500-5.0.1.0046_Jaunty_PV_HF.zip first" - exit 1 -fi - -EXT=$(mktemp -d) -CURDIR=$(pwd) -cd $EXT -unzip -qq $CURDIR/Intel-GMA500-5.0.1.0046_Jaunty_PV_HF.zip -cd 0046_Jaunty_HF -dpkg -x psb-video*deb . -dpkg -x libgl1-mesa-dri-psb*deb . -dpkg -x xorg-modules-xpsb*deb . -for dir in dri drivers ; do - mkdir -p $EXT/xpsb-glx/$dir -done -cp usr/X11R6/lib/modules/dri/* $EXT/xpsb-glx/dri -cp usr/lib/dri/psb_dri.so $EXT/xpsb-glx/dri -cp usr/lib/xorg/modules/drivers/* $EXT/xpsb-glx/drivers -sed -n 16,84p < usr/share/doc/psb-video/copyright > $EXT/xpsb-glx/COPYING -cd $EXT -tar zcf $CURDIR/xpsb-glx.orig.tar.gz xpsb-glx -cd $CURDIR -rm -rf $EXT - diff -Nru xpsb-glx-0.19/debian/rules xpsb-glx-0.19/debian/rules --- xpsb-glx-0.19/debian/rules 2010-06-24 07:12:16.000000000 +0100 +++ xpsb-glx-0.19/debian/rules 2010-06-24 06:41:59.000000000 +0100 @@ -1,24 +1,80 @@ #!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk -build: build-stamp -build-stamp: - touch $@ +# Add here any variable or target overrides you need. -clean: - dh clean +# Don't check dependencies, big hammer +#DEB_DH_SHLIBDEPS_ARGS_ALL=-X* + +DEB_NAME=xpsb-glx +MESA_DIR=mesa + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# shared library versions, option 1 +version=2.0.5 +major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +#version=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +#major=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +configure: +## chmod +x $(MESA_DIR)/autogen.sh +## cd $(MESA_DIR) && ./autogen.sh +## cd $(MESA_DIR) && ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" + + +build: configure +## cd $(MESA_DIR) && $(MAKE) realclean +## cd $(MESA_DIR) && $(MAKE) linux-dri-x86 install DESTDIR=$(CURDIR)/../debian/xpsb-glx-dbg install: build install-stamp install-stamp: - dh_clean -k - touch $@ - -binary-arch: install - dh binary-arch - -binary-indep: install - dh binary-indep - -binary: binary-arch binary-indep + dh_testdir + dh_testroot + touch install-stamp + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdirs + dh_installchangelogs + dh_installdocs + dh_installexamples + dh install --sourcedir=debian/tmp/ --fail-missing + dh_link + dh_strip -pxserver-xorg-video-psb --dbg-package=xpsb-glx-dbg + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +clean/$(DEB_NAME):: + # Add here commands to clean up after the build process. +# cd $(MESA_DIR) && $(MAKE) clean || true +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub $(MESA_DIR)/config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess $(MESA_DIR)/config.guess +endif -get-orig-source: - chmod +x debian/repack && cd .. && psb-firmware-0.24/debian/repack diff -Nru xpsb-glx-0.19/mesa/acinclude.m4 xpsb-glx-0.19/mesa/acinclude.m4 --- xpsb-glx-0.19/mesa/acinclude.m4 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/acinclude.m4 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,119 @@ +# A few convenience macros for Mesa, mostly to keep all the platform +# specifics out of configure.ac. + +# MESA_PIC_FLAGS() +# +# Find out whether to build PIC code using the option --enable-pic and +# the configure enable_static/enable_shared settings. If PIC is needed, +# figure out the necessary flags for the platform and compiler. +# +# The platform checks have been shamelessly taken from libtool and +# stripped down to just what's needed for Mesa. See _LT_COMPILER_PIC in +# /usr/share/aclocal/libtool.m4 or +# http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=blob;f=libltdl/m4/libtool.m4;hb=HEAD +# +AC_DEFUN([MESA_PIC_FLAGS], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_ARG_VAR([PIC_FLAGS], [compiler flags for PIC code]) +AC_ARG_ENABLE([pic], + [AS_HELP_STRING([--disable-pic], + [compile PIC objects @<:@default=enabled for shared builds + on supported platforms@:>@])], + [enable_pic="$enableval" + test "x$enable_pic" = x && enable_pic=auto], + [enable_pic=auto]) +# disable PIC by default for static builds +if test "$enable_pic" = auto && test "$enable_static" = yes; then + enable_pic=no +fi +# if PIC hasn't been explicitly disabled, try to figure out the flags +if test "$enable_pic" != no; then + AC_MSG_CHECKING([for $CC option to produce PIC]) + # allow the user's flags to override + if test "x$PIC_FLAGS" = x; then + # see if we're using GCC + if test "x$GCC" = xyes; then + case "$host_os" in + aix*|beos*|cygwin*|irix5*|irix6*|osf3*|osf4*|osf5*) + # PIC is the default for these OSes. + ;; + mingw*|os2*|pw32*) + # This hack is so that the source file can tell whether + # it is being built for inclusion in a dll (and should + # export symbols for example). + PIC_FLAGS="-DDLL_EXPORT" + ;; + darwin*|rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + PIC_FLAGS="-fno-common" + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, + # but not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + PIC_FLAGS="-fPIC" + ;; + esac + ;; + *) + # Everyone else on GCC uses -fPIC + PIC_FLAGS="-fPIC" + ;; + esac + else # !GCC + case "$host_os" in + hpux9*|hpux10*|hpux11*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, + # but not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + PIC_FLAGS="+Z" + ;; + esac + ;; + linux*|k*bsd*-gnu) + case `basename "$CC"` in + icc*|ecc*|ifort*) + PIC_FLAGS="-KPIC" + ;; + pgcc*|pgf77*|pgf90*|pgf95*) + # Portland Group compilers (*not* the Pentium gcc + # compiler, which looks to be a dead project) + PIC_FLAGS="-fpic" + ;; + ccc*) + # All Alpha code is PIC. + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + PIC_FLAGS="-qpic" + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*|*Sun\ F*) + # Sun C 5.9 or Sun Fortran + PIC_FLAGS="-KPIC" + ;; + esac + esac + ;; + solaris*) + PIC_FLAGS="-KPIC" + ;; + sunos4*) + PIC_FLAGS="-PIC" + ;; + esac + fi # GCC + fi # PIC_FLAGS + AC_MSG_RESULT([$PIC_FLAGS]) +fi +AC_SUBST([PIC_FLAGS]) +])# MESA_PIC_FLAGS diff -Nru xpsb-glx-0.19/mesa/autogen.sh xpsb-glx-0.19/mesa/autogen.sh --- xpsb-glx-0.19/mesa/autogen.sh 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/autogen.sh 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,16 @@ +#! /bin/sh + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +SRCDIR=`(cd "$srcdir" && pwd)` +ORIGDIR=`pwd` + +if test "x$SRCDIR" != "x$ORIGDIR"; then + echo "Mesa cannot be built when srcdir != builddir" 1>&2 + exit 1 +fi + +autoreconf -v --install || exit 1 + +"$srcdir"/configure "$@" diff -Nru xpsb-glx-0.19/mesa/bin/confdiff.sh xpsb-glx-0.19/mesa/bin/confdiff.sh --- xpsb-glx-0.19/mesa/bin/confdiff.sh 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/confdiff.sh 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,48 @@ +#!/bin/bash -e + +usage() +{ + echo "Usage: $0 " + echo "Highlight differences between Mesa configs" + echo "Example:" + echo " $0 linux linux-x86" +} + +die() +{ + echo "$@" >&2 + return 1 +} + +case "$1" in +-h|--help) usage; exit 0;; +esac + +[ $# -lt 2 ] && die 2 targets needed. See $0 --help +target1=$1 +target2=$2 + +topdir=$(cd "`dirname $0`"/..; pwd) +cd "$topdir" + +[ -f "./configs/$target1" ] || die Missing configs/$target1 +[ -f "./configs/$target2" ] || die Missing configs/$target2 + +trap 'rm -f "$t1" "$t2"' 0 + +t1=$(mktemp) +t2=$(mktemp) + +make -f- -n -p < $t1 +TOP = . +include \$(TOP)/configs/$target1 +default: +EOF + +make -f- -n -p < $t2 +TOP = . +include \$(TOP)/configs/$target2 +default: +EOF + +diff -pu -I'^#' $t1 $t2 diff -Nru xpsb-glx-0.19/mesa/bin/config.guess xpsb-glx-0.19/mesa/bin/config.guess --- xpsb-glx-0.19/mesa/bin/config.guess 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/config.guess 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1516 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-07-22' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru xpsb-glx-0.19/mesa/bin/config.sub xpsb-glx-0.19/mesa/bin/config.sub --- xpsb-glx-0.19/mesa/bin/config.sub 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/config.sub 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1626 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-06-28' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru xpsb-glx-0.19/mesa/bin/installmesa xpsb-glx-0.19/mesa/bin/installmesa --- xpsb-glx-0.19/mesa/bin/installmesa 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/installmesa 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,74 @@ +#!/bin/sh + +# +# Simple shell script for installing Mesa's header and library files. +# If the copy commands below don't work on a particular system (i.e. the +# -f or -d flags), we may need to branch on `uname` to do the right thing. +# + + +TOP=. + +INCLUDE_DIR="/usr/local/include" +LIB_DIR="/usr/local/lib" + +if [ "x$#" = "x0" ] ; then +echo +echo "***** Mesa installation - You may need root privileges to do this *****" +echo +echo "Default directory for header files is:" ${INCLUDE_DIR} +echo "Enter new directory or press to accept this default." + +read INPUT +if [ "x${INPUT}" != "x" ] ; then + INCLUDE_DIR=${INPUT} +fi + +echo +echo "Default directory for library files is:" ${LIB_DIR} +echo "Enter new directory or press to accept this default." + +read INPUT +if [ "x${INPUT}" != "x" ] ; then + LIB_DIR=${INPUT} +fi + +echo +echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL +echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR} +echo "Press to continue, or -C to abort." + +read INPUT + +else +INCLUDE_DIR=$1/include +LIB_DIR=$1/lib +fi + +# flags: +# -f = force +# -d = preserve symlinks (does not work on BSD) + +if [ `uname` = "FreeBSD" ] ; then + CP_FLAGS="-f" +elif [ `uname` = "Darwin" ] ; then + CP_FLAGS="-f" +elif [ `uname` = "AIX" ] ; then + CP_FLAGS="-fh" +else + CP_FLAGS="-fd" +fi + + +set -v + +mkdir -p ${INCLUDE_DIR} +mkdir -p ${INCLUDE_DIR}/GL +# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES +mkdir -p ${LIB_DIR} +cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL +cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL +# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES +cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR} + +echo "Done." diff -Nru xpsb-glx-0.19/mesa/bin/install-sh xpsb-glx-0.19/mesa/bin/install-sh --- xpsb-glx-0.19/mesa/bin/install-sh 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/install-sh 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,90 @@ +#!/bin/sh + + +# A minimal replacement for 'install' that supports installing symbolic links. +# Only a limited number of options are supported: +# -d dir Create a directory +# -m mode Sets a file's mode when installing + + +# If these commands aren't portable, we'll need some "if (arch)" type stuff +SYMLINK="ln -s" +MKDIR="mkdir -p" +RM="rm -f" + +MODE="" + +if [ "$1" = "-d" ] ; then + # make a directory path + $MKDIR "$2" + exit 0 +fi + +if [ "$1" = "-m" ] ; then + # set file mode + MODE=$2 + shift 2 +fi + +# install file(s) into destination +if [ $# -ge 2 ] ; then + + # Last cmd line arg is the dest dir + for FILE in $@ ; do + DEST="$FILE" + done + + # Loop over args, moving them to DEST directory + I=1 + for FILE in $@ ; do + if [ $I = $# ] ; then + # stop, don't want to install $DEST into $DEST + exit 0 + fi + + PWDSAVE=`pwd` + + # determine file's type + if [ -h "$FILE" ] ; then + #echo $FILE is a symlink + # Unfortunately, cp -d isn't universal so we have to + # use a work-around. + + # Use ls -l to find the target that the link points to + LL=`ls -l "$FILE"` + for L in $LL ; do + TARGET=$L + done + #echo $FILE is a symlink pointing to $TARGET + + FILE=`basename "$FILE"` + # Go to $DEST and make the link + cd "$DEST" # pushd + $RM "$FILE" + $SYMLINK "$TARGET" "$FILE" + cd "$PWDSAVE" # popd + + elif [ -f "$FILE" ] ; then + #echo "$FILE" is a regular file + $RM "$DEST/`basename $FILE`" + cp "$FILE" "$DEST" + if [ $MODE ] ; then + FILE=`basename "$FILE"` + chmod $MODE "$DEST/$FILE" + fi + else + echo "Unknown type of argument: " "$FILE" + exit 1 + fi + + I=`expr $I + 1` + done + + exit 0 +fi + +# If we get here, we didn't find anything to do +echo "Usage:" +echo " install -d dir Create named directory" +echo " install [-m mode] file [...] dest Install files in destination" + diff -Nru xpsb-glx-0.19/mesa/bin/minstall xpsb-glx-0.19/mesa/bin/minstall --- xpsb-glx-0.19/mesa/bin/minstall 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/minstall 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,90 @@ +#!/bin/sh + + +# A minimal replacement for 'install' that supports installing symbolic links. +# Only a limited number of options are supported: +# -d dir Create a directory +# -m mode Sets a file's mode when installing + + +# If these commands aren't portable, we'll need some "if (arch)" type stuff +SYMLINK="ln -s" +MKDIR="mkdir -p" +RM="rm -f" + +MODE="" + +if [ "$1" = "-d" ] ; then + # make a directory path + $MKDIR "$2" + exit 0 +fi + +if [ "$1" = "-m" ] ; then + # set file mode + MODE=$2 + shift 2 +fi + +# install file(s) into destination +if [ $# -ge 2 ] ; then + + # Last cmd line arg is the dest dir + for FILE in $@ ; do + DEST="$FILE" + done + + # Loop over args, moving them to DEST directory + I=1 + for FILE in $@ ; do + if [ $I = $# ] ; then + # stop, don't want to install $DEST into $DEST + exit 0 + fi + + PWDSAVE=`pwd` + + # determine file's type + if [ -h "$FILE" ] ; then + #echo $FILE is a symlink + # Unfortunately, cp -d isn't universal so we have to + # use a work-around. + + # Use ls -l to find the target that the link points to + LL=`ls -l "$FILE"` + for L in $LL ; do + TARGET=$L + done + #echo $FILE is a symlink pointing to $TARGET + + FILE=`basename "$FILE"` + # Go to $DEST and make the link + cd "$DEST" # pushd + $RM "$FILE" + $SYMLINK "$TARGET" "$FILE" + cd "$PWDSAVE" # popd + + elif [ -f "$FILE" ] ; then + #echo "$FILE" is a regular file + $RM "$DEST/`basename $FILE`" + cp "$FILE" "$DEST" + if [ $MODE ] ; then + FILE=`basename "$FILE"` + chmod $MODE "$DEST/$FILE" + fi + else + echo "Unknown type of argument: " "$FILE" + exit 1 + fi + + I=`expr $I + 1` + done + + exit 0 +fi + +# If we get here, we didn't find anything to do +echo "Usage:" +echo " install -d dir Create named directory" +echo " install [-m mode] file [...] dest Install files in destination" + diff -Nru xpsb-glx-0.19/mesa/bin/mklib xpsb-glx-0.19/mesa/bin/mklib --- xpsb-glx-0.19/mesa/bin/mklib 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/mklib 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,942 @@ +#!/bin/sh + +# Make a shared library. +# This script should be useful for projects other than Mesa. +# Improvements/fixes are welcome. + + +# 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. + + +# +# Option defaults +# +LIBNAME="" +MAJOR=1 +MINOR=0 +PATCH="" +DEPS="" +LINK="" +LDFLAGS="" +CPLUSPLUS=0 +STATIC=0 +DLOPEN=0 +INSTALLDIR="." +ARCH="auto" +ARCHOPT="" +NOPREFIX=0 +EXPORTS="" +ID="" + +# +# Parse arguments +# +while true +do + case $1 in + '-h' | '--help') + echo 'Usage: mklib [options] objects' + echo 'Create a shared library from object files.' + echo ' -o LIBRARY specifies the name of the resulting library, without' + echo ' the leading "lib" or any suffix.' + echo ' (eg: "-o GL" might result in "libGL.so" being made)' + echo ' -major N specifies major version number (default is 1)' + echo ' -minor N specifies minor version number (default is 0)' + echo ' -patch N specifies patch version number (default is 0)' + echo ' -lLIBRARY specifies a dependency on LIBRARY' + echo ' -LDIR search in DIR for library dependencies at build time' + echo ' -RDIR search in DIR for library dependencies at run time' + echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)' + echo ' Not observed on all systems at this time.' + echo ' -ldflags OPT specify any additional linker flags in OPT' + echo ' -cplusplus link with C++ runtime' + echo ' -static make a static library (default is dynamic/shared)' + echo ' -dlopen make a shared library suitable for dynamic loading' + echo ' -install DIR put resulting library file(s) in DIR' + echo ' -arch ARCH override using `uname` to determine host system' + echo ' -archopt OPT specify an extra achitecture-specific option OPT' + echo ' -altopts OPTS alternate options to override all others' + echo " -noprefix don't prefix library name with 'lib' nor add any suffix" + echo ' -exports FILE only export the symbols listed in FILE' + echo ' -id NAME Sets the id of the dylib (Darwin)' + echo ' -h, --help display this information and exit' + exit 1 + ;; + '-o') + shift 1; + LIBNAME=$1 + ;; + '-major') + shift 1; + MAJOR=$1 + ;; + '-minor') + shift 1; + MINOR=$1 + ;; + '-patch') + shift 1; + PATCH=$1 + ;; + '-linker') + shift 1; + LINK=$1 + ;; + '-ldflags') + shift 1; + LDFLAGS=$1 + ;; + -l*) + DEPS="$DEPS $1" + ;; + -L*) + DEPS="$DEPS $1" + ;; + -R*) + DEPS="$DEPS $1" + ;; + -Wl*) + DEPS="$DEPS $1" + ;; + -pthread) + # this is a special case (see bugzilla 10876) + DEPS="$DEPS $1" + ;; + '-pthread') + DEPS="$DEPS -pthread" + ;; + '-cplusplus') + CPLUSPLUS=1 + ;; + '-static') + STATIC=1 + ;; + '-dlopen') + DLOPEN=1 + ;; + '-install') + shift 1; + INSTALLDIR=$1 + ;; + '-arch') + shift 1; + ARCH=$1 + ;; + '-archopt') + shift 1; + ARCHOPT=$1 + ;; + '-altopts') + shift 1; + ALTOPTS=$1 + ;; + '-noprefix') + NOPREFIX=1 + ;; + '-exports') + shift 1; + EXPORTS=$1 + ;; + '-id') + shift 1; + ID=$1 + ;; + -*) + echo "mklib: Unknown option: " $1 ; + exit 1 + ;; + *) + # This should be the first object file, stop parsing + break + esac + shift 1 +done +OBJECTS=$@ + + +if [ ${ARCH} = "auto" ] ; then + ARCH=`uname` +fi + + +# +# Error checking +# +if [ "x${LIBNAME}" = "x" ] ; then + echo "mklib: Error: no library name specified" + exit 1 +fi +if [ "x${OBJECTS}" = "x" ] ; then + echo "mklib: Error: no object files specified" + exit 1 +fi + + +# +# Debugging info +# +if [ ] ; then + echo "-----------------" + echo ARCH is $ARCH + echo LIBNAME is $LIBNAME + echo MAJOR is $MAJOR + echo MINOR is $MINOR + echo PATCH is $PATCH + echo DEPS are $DEPS + echo "EXPORTS in" $EXPORTS + echo ID is $ID + echo "-----------------" +fi + + +# +# OK, make the library now +# +case $ARCH in + + 'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*) + # we assume gcc + + if [ "x$LINK" = "x" ] ; then + # -linker was not specified so set default link command now + if [ $CPLUSPLUS = 1 ] ; then + LINK=g++ + else + LINK=gcc + fi + fi + + if [ $NOPREFIX = 1 ] ; then + # No "lib" or ".so" part + echo "mklib: Making" $ARCH "shared library: " ${LIBNAME} + case $ARCH in 'Linux' | 'GNU' | GNU/*) + OPTS="-Xlinker -Bsymbolic -shared" + ;; + *) + OPTS="-shared" + ;; + esac + + # Check if objects are 32-bit and we're running in 64-bit + # environment. If so, pass -m32 flag to linker. + set ${OBJECTS} + ABI32=`file $1 | grep 32-bit` + if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then + OPTS="-m32 ${OPTS}" + fi + + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + + rm -f ${LIBNAME} + # make lib + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + # finish up + FINAL_LIBS="${LIBNAME}" + elif [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a" + echo "mklib: Making" $ARCH "static library: " ${LIBNAME} + LINK="ar" + OPTS="-ru" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + rm -f ${LIBNAME} + + # expand any .a objects into constituent .o files. + NEWOBJECTS="" + DELETIA="" + for OBJ in ${OBJECTS} ; do + if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then + # extract the .o files from this .a archive + FILES=`ar t $OBJ` + ar x $OBJ + NEWOBJECTS="$NEWOBJECTS $FILES" + # keep track of temporary .o files and delete them below + DELETIA="$DELETIA $FILES" + else + # ordinary .o file + NEWOBJECTS="$NEWOBJECTS $OBJ" + fi + done + + # make lib + ${LINK} ${OPTS} ${LIBNAME} ${NEWOBJECTS} + ranlib ${LIBNAME} + + # remove temporary extracted .o files + rm -f ${DELETIA} + + # finish up + FINAL_LIBS=${LIBNAME} + else + LIBNAME="lib${LIBNAME}" # prefix with "lib" + case $ARCH in 'Linux' | 'GNU' | GNU/*) + OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" + ;; + *) + OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" + ;; + esac + if [ $EXPORTS ] ; then + #OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}" + # Make the 'exptmp' file for --version-script option + echo "{" > exptmp + echo "global:" >> exptmp + sed 's/$/;/' ${EXPORTS} >> exptmp + echo "local:" >> exptmp + echo "*;" >> exptmp + echo "};" >> exptmp + OPTS="${OPTS} -Xlinker --version-script=exptmp" + # exptmp is removed below + fi + + # Check if objects are 32-bit and we're running in 64-bit + # environment. If so, pass -m32 flag to linker. + set ${OBJECTS} + ABI32=`file $1 | grep 32-bit` + if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then + OPTS="-m32 ${OPTS}" + fi + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + + if [ x${PATCH} = "x" ] ; then + VERSION="${MAJOR}.${MINOR}" + else + VERSION="${MAJOR}.${MINOR}.${PATCH}" + fi + + echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}.so.${VERSION} + + # rm any old libs + rm -f ${LIBNAME}.so.${VERSION} + rm -f ${LIBNAME}.so.${MAJOR} + rm -f ${LIBNAME}.so + + # make lib + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} + # make usual symlinks + ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} + ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so + # finish up + FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so" +# rm -f exptmp + fi + ;; + + 'SunOS') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making SunOS static library: " ${LIBNAME} + rm -f ${LIBNAME} + ar -ruv ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + if [ $NOPREFIX = 0 ] ; then + LIBNAME="lib${LIBNAME}.so" + fi + echo "mklib: Making SunOS shared library: " ${LIBNAME} + + if [ "x$LINK" = "x" ] ; then + # -linker was not specified, choose default linker now + if [ $CPLUSPLUS = 1 ] ; then + # determine linker and options for C++ code + if [ `which c++` ] ; then + # use Sun c++ + LINK="c++" + elif [ `type g++` ] ; then + # use g++ + LINK="g++" + else + echo "mklib: warning: can't find C++ compiler, trying CC." + LINK="CC" + fi + else + # use native Sun linker for C code + LINK="ld" + fi + fi + + # linker options + if [ ${LINK} = "ld" -o ${LINK} = "cc" -o ${LINK} = "CC" ] ; then + # SunOS tools, -G to make shared libs + OPTS="-G" + else + # gcc linker + # Check if objects are 32-bit and we're running in 64-bit + # environment. If so, pass -m32 flag to linker. + set ${OBJECTS} + ABI32=`file $1 | grep 32-bit` + if [ "${ABI32}" ] ; then + OPTS="-m32 -shared -Wl,-Bdynamic" + else + OPTS="-m64 -shared -Wl,-Bdynamic" + fi + fi + + # If using Sun C++ compiler, need to tell it not to add runpaths + # that are specific to the build machine + if [ ${LINK} = "CC" ] ; then + OPTS="${OPTS} -norunpath" + fi + + # Solaris linker requires explicitly listing the Standard C & C++ + # libraries in the link path when building shared objects + if [ ${LINK} = "CC" ] ; then + DEPS="${DEPS} -lCrun" + fi + DEPS="${DEPS} -lc" + + if [ $EXPORTS ] ; then + # Make the 'mapfile.scope' linker mapfile + echo "{" > mapfile.scope + echo "global:" >> mapfile.scope + sed 's/$/;/' ${EXPORTS} >> mapfile.scope + echo "local:" >> mapfile.scope + echo " *;" >> mapfile.scope + echo "};" >> mapfile.scope + OPTS="${OPTS} -Wl,-Mmapfile.scope" + fi + + # Check if objects are SPARC v9 + # file says: ELF 64-bit MSB relocatable SPARCV9 Version 1 + set ${OBJECTS} + if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then + SPARCV9=`file $1 | grep SPARCV9` + if [ "${SPARCV9}" ] ; then + OPTS="${OPTS} -xarch=v9" + fi + fi + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + + # for debug: + #echo "mklib: linker is" ${LINK} ${OPTS} + if [ $NOPREFIX = 1 ] ; then + rm -f ${LIBNAME} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + FINAL_LIBS="${LIBNAME}" + else + rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} + ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} + FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" + fi + fi + ;; + + 'FreeBSD') + # we assume gcc + + if [ "x$LINK" = "x" ] ; then + # -linker was not specified so set default link command now + if [ $CPLUSPLUS = 1 ] ; then + LINK=g++ + else + LINK=gcc + fi + fi + + if [ $NOPREFIX = 1 ] ; then + # No "lib" or ".so" part + echo "mklib: Making FreeBSD shared library: " ${LIBNAME} + OPTS="-shared" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + rm -f ${LIBNAME} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + FINAL_LIBS=${LIBNAME} + elif [ $STATIC = 1 ] ; then + STLIB="lib${LIBNAME}.a" + echo "mklib: Making FreeBSD static library: " ${STLIB} + rm -f ${STLIB} + ar cq ${STLIB} ${OBJECTS} + ranlib ${STLIB} + FINAL_LIBS=${STLIB} + else + SHLIB="lib${LIBNAME}.so.${MAJOR}" + OPTS="-shared -Wl,-soname,${SHLIB}" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + echo "mklib: Making FreeBSD shared library: " ${SHLIB} + rm -f ${SHLIB} + ${LINK} ${OPTS} ${LDFLAGS} -o ${SHLIB} ${OBJECTS} ${DEPS} + ln -sf ${SHLIB} "lib${LIBNAME}.so" + FINAL_LIBS="${SHLIB} lib${LIBNAME}.so" + fi + ;; + + 'NetBSD') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}_pic.a" + echo "mklib: Making NetBSD PIC static library: " ${LIBNAME} + rm -f ${LIBNAME} + ar cq ${LIBNAME} ${OBJECTS} + ranlib ${LIBNAME} + FINAL_LIBS=${LIBNAME} + else + LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}" + echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME} + rm -f ${LIBNAME} + ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + fi + ;; + + 'IRIX' | 'IRIX64') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + rm -f ${LIBNAME} + ar rc ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so" + + # examine first object to determine ABI + set ${OBJECTS} + ABI_O32=`file $1 | grep 'ELF 32-bit'` + ABI_N32=`file $1 | grep 'ELF N32'` + ABI_N64=`file $1 | grep 'ELF 64-bit'` + if [ "${ABI_O32}" ] ; then + OPTS="-32 -shared -all" + ABI="o32-bit" + elif [ "${ABI_N32}" ] ; then + OPTS="-n32 -shared -all" + ABI="n32-bit" + elif [ "${ABI_N64}" ] ; then + OPTS="-64 -shared -all" + ABI="64-bit" + else + echo "Error: Unexpected IRIX ABI!" + exit 1 + fi + + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + + if [ $CPLUSPLUS = 1 ] ; then + LINK="CC" + else + LINK="ld" + fi + + echo "mklib: Making IRIX " ${ABI} " shared library: " ${LIBNAME} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + FINAL_LIBS=${LIBNAME} + fi + ;; + + 'linux-cygwin') + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making linux-cygwin library: " ${LIBNAME} + rm -f ${LIBNAME} + gnuwin32ar ruv ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + ;; + + 'HP-UX') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making HP-UX static library: " ${LIBNAME} + rm -f ${LIBNAME} + ar -ruv ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + # HP uses a .2 for their current GL/GLU libraries + if [ ${LIBNAME} = "GL" -o ${LIBNAME} = "GLU" ] ; then + MAJOR=2 + fi + RUNLIB="lib${LIBNAME}.${MAJOR}" + DEVLIB="lib${LIBNAME}.sl" + echo "mklib: Making HP-UX shared library: " ${RUNLIB} ${DEVLIB} + ld -b -o ${RUNLIB} +b ${RUNLIB} ${OBJECTS} ${DEPS} + ln -s ${RUNLIB} ${DEVLIB} + FINAL_LIBS="${RUNLIB} ${DEVLIB}" + fi + ;; + + 'AIX' ) + # examine first object to determine ABI + set ${OBJECTS} + ABI_64=`file $1 | grep '64-bit'` + if [ "${ABI_64}" ] ; then + X64="-X64" + Q64="-q64" + OFILE=shr_64.o + else + OFILE=shr.o #Want to be consistent with the IBM libGL.a + fi + + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making AIX static library: " ${LIBNAME} + ar -ruv ${X64} ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + EXPFILE="lib${LIBNAME}.exp" + LIBNAME="lib${LIBNAME}.a" # shared objects are still stored in the .a libraries + OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry ${Q64}" + rm -f ${EXPFILE} ${OFILE} + NM="/bin/nm -eC ${X64}" + echo "#! /usr/lib/${LIBNAME}" > ${EXPFILE} + ${NM} ${OBJECTS} | awk '{ + if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \ + && ( substr($1,1,1) != ".")) { + if (substr ($1, 1, 7) != "__sinit" && + substr ($1, 1, 7) != "__sterm") { + if (substr ($1, 1, 5) == "__tf1") + print (substr ($1, 7)) + else if (substr ($1, 1, 5) == "__tf9") + print (substr ($1, 15)) + else + print $1 + } + } + }' | sort -u >> ${EXPFILE} + + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + + # On AIX a shared library is linked differently when + # you want to dlopen the file + if [ $DLOPEN = "1" ] ; then + cc -G ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + else + cc ${OPTS} ${LDFLAGS} -o ${OFILE} ${OBJECTS} ${DEPS} + ar ${X64} -r ${LIBNAME} ${OFILE} + fi + + FINAL_LIBS="${LIBNAME}" + fi + ;; + + 'OpenSTEP') + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making OpenSTEP static library: " ${LIBNAME} + libtool -static -o ${LIBNAME} - ${OBJECTS} + FINAL_LIBS=${LIBNAME} + ;; + + 'OSF1') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making OSF/1 static library: " ${LIBNAME} + rm -f ${LIBNAME} + ar -ruv ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + VERSION="${MAJOR}.${MINOR}" + LIBNAME="lib${LIBNAME}.so" + echo "mklib: Making OSF/1 shared library: " ${LIBNAME} + if [ "x$LINK" = "x" ] ; then + if [ $CPLUSPLUS = 1 ] ; then + LINK=cxx + else + LINK=cc + fi + fi + rm -f ${LIBNAME}.${VERSION} + ${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS} + ln -sf ${LIBNAME}.${VERSION} ${LIBNAME} + FINAL_LIBS="${LIBNAME} ${LIBNAME}.${VERSION}" + fi + ;; + + 'Darwin') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making Darwin static library: " ${LIBNAME} + LINK="ar" + OPTS="-ruvs" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + # On Darwin a .bundle is used for a library that you want to dlopen + if [ $DLOPEN = "1" ] ; then + LIBSUFFIX="bundle" + OPTS="${ARCHOPT} -bundle -multiply_defined suppress" + else + LIBSUFFIX="dylib" + if [ -z "$ID" ] ; then + ID="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" + fi + OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name ${ID}" + fi + + if [ ${EXPORTS} ] ; then + if [ -f ${EXPORTS}".darwin" ] ; then + EXPORTS=$EXPORTS".darwin" + fi + OPTS="${OPTS} -exported_symbols_list ${EXPORTS}" + fi + + LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" + LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}" + LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}" + + # examine first object to determine ABI + set ${OBJECTS} + ABI_PPC=`file $1 | grep ' ppc'` + ABI_I386=`file $1 | grep ' i386'` + ABI_PPC64=`file $1 | grep ' ppc64'` + ABI_X86_64=`file $1 | grep ' x86_64'` + if [ "${ABI_PPC}" ] ; then + OPTS="${OPTS} -arch ppc" + fi + if [ "${ABI_I386}" ] ; then + OPTS="${OPTS} -arch i386" + fi + if [ "${ABI_PPC64}" ] ; then + OPTS="${OPTS} -arch ppc64" + fi + if [ "${ABI_X86_64}" ] ; then + OPTS="${OPTS} -arch x86_64" + fi + + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + + # XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk + # to OPTS here? + + # determine linker + if [ $CPLUSPLUS = 1 ] ; then + LINK="g++" + else + LINK="cc" + fi + + echo "mklib: Making Darwin shared library: " ${LIBNAME} + + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + ln -s ${LIBNAME} ${LINKNAME} + ln -s ${LIBNAME} ${LINKNAME2} + FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}" + fi + ;; + + 'LynxOS') + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making LynxOS static library: " ${LIBNAME} + rm -f ${LIBNAME} + ar ru ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + ;; + + 'BeOS') + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making BeOS static library: " ${LIBNAME} + ar -cru "${LIBNAME}" ${OBJECTS} + else + LIBNAME="lib${LIBNAME}.so" + echo "mklib: Making BeOS shared library: " ${LIBNAME} + gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}" + mimeset -f "${LIBNAME}" + # XXX remove the Mesa3D stuff here since mklib isn't mesa-specific. + setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!" + fi + FINAL_LIBS=${LIBNAME} + ;; + + 'QNX') + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making QNX library: " ${LIBNAME} + wlib ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + ;; + + 'MorphOS') + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making MorphOS library: " ${LIBNAME} + ppc-morphos-ar rc ${LIBNAME} ${OBJECTS} + FINAL_LIBS="${LIBNAME}" + ;; + + 'icc' | 'icc-istatic') + # Intel C compiler + # This should get merged into the Linux code, above, since this isn't + # really a different architecture. + LIBNAME="lib${LIBNAME}" # prefix with "lib" + + if [ $STATIC = 1 ] ; then + echo "mklib: Making Intel ICC static library: " ${LIBNAME}.a + LINK="ar" + OPTS="-ruv" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + # make lib + ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS} + # finish up + FINAL_LIBS="${LIBNAME}.a" + else + if [ $ARCH = icc-istatic ] ; then + OPTS="-shared -i-static -cxxlib-icc" + else + OPTS="-shared" + fi + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + VERSION="${MAJOR}.${MINOR}.${PATCH}" + echo "mklib: Making Intel ICC shared library: " ${LIBNAME}.so.${VERSION} + + if [ $CPLUSPLUS = 1 ] ; then + LINK="icpc" + else + LINK="icc" + fi + # rm any old libs + rm -f ${LIBNAME}.so.${VERSION} + rm -f ${LIBNAME}.so.${MAJOR} + rm -f ${LIBNAME}.so + # make lib + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} + # make usual symlinks + ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} + ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so + # finish up + FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so" + fi + ;; + + 'aix-gcc') + # AIX with gcc + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making AIX GCC static library: " ${LIBNAME} + rm -f ${LIBNAME} + ar ru ${LIBNAME} ${OBJECTS} + FINAL_LIBS=${LIBNAME} + else + LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so" + echo "mklib: Making AIX GCC shared library: " ${LIBNAME} + # remove old lib + rm -f ${LIBNAME} + # make the lib + gcc -shared -Wl,-G ${OBJECTS} ${DEPS} -o ${LIBNAME} + # NOTE: the application linking with this library must specify + # the -Wl,-brtl flags to gcc + FINAL_LIBS=${LIBNAME} + fi + ;; + + 'ultrix') + # XXX untested + if [ $STATIC = 0 ] ; then + echo "mklib: Warning shared libs not supported on Ultrix" + fi + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making static library for Ultrix: " ${LIBNAME} + rm -f ${LIBNAME} + ar ru ${LIBNAME} ${OBJECTS} + FINAL_LIBS="${LIBNAME}" + ;; + + CYGWIN*) + # GCC-based environment + CYGNAME="cyg${LIBNAME}" # prefix with "cyg" + LIBNAME="lib${LIBNAME}" # prefix with "lib" + + if [ $STATIC = 1 ] ; then + echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a + LINK="ar" + OPTS="-ru" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + # make lib + ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS} + ranlib ${LIBNAME}.a + # finish up + FINAL_LIBS=${LIBNAME}.a + else + OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi + echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll + + if [ $CPLUSPLUS = 1 ] ; then + LINK="g++" + else + LINK="gcc" + fi + + # rm any old libs + rm -f ${LIBNAME}-${MAJOR}.dll + rm -f ${LIBNAME}.dll.a + rm -f ${LIBNAME}.a + + # make lib + ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} + # make usual symlinks + ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a + # finish up + FINAL_LIBS="${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a" + # special case for installing in bin + FINAL_BINS="${CYGNAME}-${MAJOR}.dll" + fi + ;; + + 'example') + # If you're adding support for a new architecture, you can + # start with this: + if [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}.a" + echo "mklib: Making static library for example arch: " ${LIBNAME} + rm -f ${LIBNAME} + ar rv ${LIBNAME} ${OBJECTS} + FINAL_LIBS="${LIBNAME}" + else + LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so" + echo "mklib: Making shared library for example arch: " ${LIBNAME} + ld -o ${LIBNAME} ${OBJECTS} ${DEPS} + FINAL_LIBS="${LIBNAME}" + fi + ;; + + *) + echo "mklib: ERROR: Don't know how to make a static/shared library for" ${ARCH} + echo "mklib: Please add necessary commands to mklib script." + ;; +esac + + +# +# Put library files into installation directory if specified. +# +if [ ${INSTALLDIR} != "." ] ; then + echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR} + mv ${FINAL_LIBS} ${INSTALLDIR}/ +fi diff -Nru xpsb-glx-0.19/mesa/bin/version.mk xpsb-glx-0.19/mesa/bin/version.mk --- xpsb-glx-0.19/mesa/bin/version.mk 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/bin/version.mk 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,17 @@ +#!/usr/bin/make -sf +# Print the various Mesa version fields. This is mostly used to add the +# version to configure. + +# This reflects that this script is usually called from the toplevel +TOP = . + +include $(TOP)/configs/default + +version: + @echo $(MESA_VERSION) +major: + @echo $(MESA_MAJOR) +minor: + @echo $(MESA_MINOR) +tiny: + @echo $(MESA_TINY) diff -Nru xpsb-glx-0.19/mesa/config.guess xpsb-glx-0.19/mesa/config.guess --- xpsb-glx-0.19/mesa/config.guess 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/config.guess 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1526 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-01-23' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru xpsb-glx-0.19/mesa/configs/aix xpsb-glx-0.19/mesa/configs/aix --- xpsb-glx-0.19/mesa/configs/aix 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/aix 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,30 @@ +# Configuration for AIX, dynamic libs + +include $(TOP)/configs/default + +CONFIG_NAME = aix + +# Compiler and flags +CC = cc +CXX = xlC + +CFLAGS = -O -DAIXV3 -DPTHREADS +CXXFLAGS = -O -DAIXV3 -DPTHREADS + +# Misc tools and flags +MKLIB_OPTIONS = + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +GL_LIB_DEPS = -lX11 -lXext -lpthread -lm +GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC +GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm +GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXm -lXt -lX11 +OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) +APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC + diff -Nru xpsb-glx-0.19/mesa/configs/aix-64 xpsb-glx-0.19/mesa/configs/aix-64 --- xpsb-glx-0.19/mesa/configs/aix-64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/aix-64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ +# Configuration for AIX 64-bit, dynamic libs + +include $(TOP)/configs/default + +CONFIG_NAME = aix-64 + +# Compiler and flags +CC = xlc +CXX = xlC + +CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS +CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS +LIB_DIR = lib64 + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +GL_LIB_DEPS = -lX11 -lXext -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lC +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXm -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/lib64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lpthread -lC + diff -Nru xpsb-glx-0.19/mesa/configs/aix-64-static xpsb-glx-0.19/mesa/configs/aix-64-static --- xpsb-glx-0.19/mesa/configs/aix-64-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/aix-64-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +# Configuration for AIX, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = aix-64-static + +# Compiler and flags +CC = cc +CXX = xlC + +CFLAGS = -q64 -O -DAIXV3 -DPTHREADS +CXXFLAGS = -q64 -O -DAIXV3 -DPTHREADS +MKLIB_OPTIONS = -static +LIB_DIR = lib64 + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +APP_LIB_DEPS = -q64 -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \ + -lX11 -lXext -lXmu -lXi -lm -lpthread -lC + diff -Nru xpsb-glx-0.19/mesa/configs/aix-gcc xpsb-glx-0.19/mesa/configs/aix-gcc --- xpsb-glx-0.19/mesa/configs/aix-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/aix-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,23 @@ +# Configuration for AIX with gcc + +include $(TOP)/configs/default + +CONFIG_NAME = aix-gcc + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -O2 -DAIXV3 +CXXFLAGS = -O2 -DAIXV3 + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +MKLIB_OPTIONS = -arch aix-gcc +GL_LIB_DEPS = -lX11 -lXext -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi + diff -Nru xpsb-glx-0.19/mesa/configs/aix-static xpsb-glx-0.19/mesa/configs/aix-static --- xpsb-glx-0.19/mesa/configs/aix-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/aix-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +# Configuration for AIX, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = aix-static + +# Compiler and flags +CC = cc +CXX = xlC + +CFLAGS = -O -DAIXV3 -DPTHREADS +CXXFLAGS = -O -DAIXV3 -DPTHREADS +MKLIB_OPTIONS = -static + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \ + -lX11 -lXext -lXmu -lXi -lm -lpthread -lC + + diff -Nru xpsb-glx-0.19/mesa/configs/autoconf.in xpsb-glx-0.19/mesa/configs/autoconf.in --- xpsb-glx-0.19/mesa/configs/autoconf.in 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/autoconf.in 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,125 @@ +# Autoconf configuration + +# Pull in the defaults +include $(TOP)/configs/default + +# This is generated by configure +CONFIG_NAME = autoconf + +# Compiler and flags +CC = @CC@ +CXX = @CXX@ +OPT_FLAGS = @OPT_FLAGS@ +ARCH_FLAGS = @ARCH_FLAGS@ +ASM_FLAGS = @ASM_FLAGS@ +PIC_FLAGS = @PIC_FLAGS@ +DEFINES = @DEFINES@ +CFLAGS = @CPPFLAGS@ @CFLAGS@ \ + $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) +CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \ + $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) +LDFLAGS = @LDFLAGS@ +EXTRA_LIB_PATH = @EXTRA_LIB_PATH@ + +# Assembler +ASM_SOURCES = @ASM_SOURCES@ +ASM_API = @ASM_API@ + +# Misc tools and flags +MAKE = @MAKE@ +SHELL = @SHELL@ +MKLIB_OPTIONS = @MKLIB_OPTIONS@ +MKDEP = @MKDEP@ +MKDEP_OPTIONS = @MKDEP_OPTIONS@ + +# Python and flags (generally only needed by the developers) +PYTHON2 = python +PYTHON_FLAGS = -t -O -O + +# Library names (base name) +GL_LIB = GL +GLU_LIB = GLU +GLUT_LIB = glut +GLW_LIB = GLw +OSMESA_LIB = @OSMESA_LIB@ + +# Library names (actual file names) +GL_LIB_NAME = @GL_LIB_NAME@ +GLU_LIB_NAME = @GLU_LIB_NAME@ +GLUT_LIB_NAME = @GLUT_LIB_NAME@ +GLW_LIB_NAME = @GLW_LIB_NAME@ +OSMESA_LIB_NAME = @OSMESA_LIB_NAME@ + +# Directories to build +LIB_DIR = @LIB_DIR@ +SRC_DIRS = @SRC_DIRS@ +GLU_DIRS = @GLU_DIRS@ +DRIVER_DIRS = @DRIVER_DIRS@ +# Which subdirs under $(TOP)/progs/ to enter: +PROGRAM_DIRS = @PROGRAM_DIRS@ + +# Driver specific build vars +DRI_DIRS = @DRI_DIRS@ +WINDOW_SYSTEM = @WINDOW_SYSTEM@ +USING_EGL = @USING_EGL@ + +# Dependencies +X11_INCLUDES = @X11_INCLUDES@ + +# GLw motif setup +GLW_SOURCES = @GLW_SOURCES@ +MOTIF_CFLAGS = @MOTIF_CFLAGS@ + +# Library/program dependencies +GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@ +OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \ + $(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@ +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \ + $(EXTRA_LIB_PATH) @GLU_LIB_DEPS@ +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \ + $(EXTRA_LIB_PATH) @GLUT_LIB_DEPS@ +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \ + $(EXTRA_LIB_PATH) @GLW_LIB_DEPS@ +APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@ + +# DRI dependencies +DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIB = @LIBDRM_LIBS@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +EXPAT_INCLUDES = @EXPAT_INCLUDES@ + +# Autoconf directories +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + +# Installation directories (for make install) +INSTALL_DIR = $(prefix) +INSTALL_LIB_DIR = $(libdir) +INSTALL_INC_DIR = $(includedir) + +# DRI installation directories +DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@ + +# Where libGL will look for DRI hardware drivers +DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR) + +# pkg-config substitutions +GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@ +GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@ +GL_PC_CFLAGS = @GL_PC_CFLAGS@ +DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@ +GLU_PC_REQ = @GLU_PC_REQ@ +GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@ +GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@ +GLU_PC_CFLAGS = @GLU_PC_CFLAGS@ +GLUT_PC_REQ_PRIV = @GLUT_PC_REQ_PRIV@ +GLUT_PC_LIB_PRIV = @GLUT_PC_LIB_PRIV@ +GLUT_PC_CFLAGS = @GLUT_PC_CFLAGS@ +GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@ +GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@ +GLW_PC_CFLAGS = @GLW_PC_CFLAGS@ +OSMESA_PC_REQ = @OSMESA_PC_REQ@ +OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@ diff -Nru xpsb-glx-0.19/mesa/configs/beos xpsb-glx-0.19/mesa/configs/beos --- xpsb-glx-0.19/mesa/configs/beos 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/beos 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,104 @@ +# Configuration for BeOS +# Written by Philippe Houdoin + +include $(TOP)/configs/default + +CONFIG_NAME = beos + + +DEFINES = \ + -DBEOS_THREADS + +MACHINE=$(shell uname -m) +ifeq ($(MACHINE), BePC) + CPU = x86 +else + CPU = ppc +endif + +ifeq ($(CPU), x86) + # BeOS x86 settings + + DEFINES += \ + -DGNU_ASSEMBLER \ + -DUSE_X86_ASM \ + -DUSE_MMX_ASM \ + -DUSE_3DNOW_ASM \ + -DUSE_SSE_ASM + + ASM_SOURCES = $(X86_SOURCES) + ASM_API = $(X86_API) + + CC = gcc + CXX = g++ + LD = gcc + + CFLAGS = \ + -Wall -Wno-multichar -Wno-ctor-dtor-privacy \ + $(DEFINES) + + CXXFLAGS = $(CFLAGS) + + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing + + LDFLAGS += -Xlinker + + ifdef DEBUG + CFLAGS += -g -O0 + LDFLAGS += -g + DEFINES += -DDEBUG + else + CFLAGS += -O3 + endif + + GLUT_CFLAGS = -fexceptions + +else + # BeOS PPC settings + + CC = mwcc + CXX = $(CC) + LD = mwldppc + + CFLAGS = \ + -w on -requireprotos \ + $(DEFINES) + + CXXFLAGS = $(CFLAGS) + + LDFLAGS += \ + -export pragma \ + -init _init_routine_ \ + -term _term_routine_ \ + -lroot \ + /boot/develop/lib/ppc/glue-noinit.a \ + /boot/develop/lib/ppc/init_term_dyn.o \ + /boot/develop/lib/ppc/start_dyn.o + + ifdef DEBUG + CFLAGS += -g -O0 + CXXFLAGS += -g -O0 + LDFLAGS += -g + else + CFLAGS += -O7 + CXXFLAGS += -O7 + endif + + GLUT_CFLAGS = -fexceptions +endif + +# Directories +SRC_DIRS = mesa glu glut/beos +GLU_DIRS = sgi +DRIVER_DIRS = beos +PROGRAM_DIRS = beos samples redbook demos tests + +# Library/program dependencies +GL_LIB_DEPS = +OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = +GLUT_LIB_DEPS = -lgame -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB) + diff -Nru xpsb-glx-0.19/mesa/configs/bluegene-osmesa xpsb-glx-0.19/mesa/configs/bluegene-osmesa --- xpsb-glx-0.19/mesa/configs/bluegene-osmesa 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/bluegene-osmesa 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,33 @@ +# Configuration for building only libOSMesa on BlueGene, no Xlib driver +# This doesn't really have a lot of dependencies, so it should be usable +# on other (gcc-based) systems too. +# It uses static linking and disables multithreading. + +include $(TOP)/configs/default + +CONFIG_NAME = bluegene-osmesa + +# Compiler and flags +CC = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-gcc +CXX = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-g++ +CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURC + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +MKLIB_OPTIONS = -static + +OSMESA_LIB_NAME = libOSMesa.a + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = osdemos + + +# Dependencies +OSMESA_LIB_DEPS = -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +APP_LIB_DEPS = -lOSMesa -lGLU -lm diff -Nru xpsb-glx-0.19/mesa/configs/bluegene-xlc-osmesa xpsb-glx-0.19/mesa/configs/bluegene-xlc-osmesa --- xpsb-glx-0.19/mesa/configs/bluegene-xlc-osmesa 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/bluegene-xlc-osmesa 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,29 @@ +# Configuration for building only libOSMesa on BlueGene using the IBM xlc compiler +# This doesn't really have a lot of dependencies, so it should be usable +# on similar systems too. +# It uses static linking and disables multithreading. + +include $(TOP)/configs/default + +CONFIG_NAME = bluegene-osmesa + +# Compiler and flags +CC = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlc +CXX = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlC +CFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +CXXFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +MKLIB_OPTIONS = -static + +OSMESA_LIB_NAME = libOSMesa.a + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = osdemos + + +# Dependencies +OSMESA_LIB_DEPS = -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +APP_LIB_DEPS = -lOSMesa -lGLU -lm diff -Nru xpsb-glx-0.19/mesa/configs/catamount-osmesa-pgi xpsb-glx-0.19/mesa/configs/catamount-osmesa-pgi --- xpsb-glx-0.19/mesa/configs/catamount-osmesa-pgi 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/catamount-osmesa-pgi 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,32 @@ +# Configuration for building only libOSMesa on Cray Xt3 +# for the compute nodes running Catamount using the +# Portland Group compiler. The Portland Group toolchain has to be +# enabled before using "module switch PrgEnv-gnu PrgEnv-pgi" . +# This doesn't really have a lot of dependencies, so it should be usable +# on other similar systems too. +# It uses static linking and disables multithreading. + +include $(TOP)/configs/default + +CONFIG_NAME = catamount-osmesa-pgi + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +CXXFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +MKLIB_OPTIONS = -static + +OSMESA_LIB_NAME = libOSMesa.a + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = osdemos + + +# Dependencies +OSMESA_LIB_DEPS = -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +APP_LIB_DEPS = -lOSMesa -lGLU -lm diff -Nru xpsb-glx-0.19/mesa/configs/config.mgw xpsb-glx-0.19/mesa/configs/config.mgw --- xpsb-glx-0.19/mesa/configs/config.mgw 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/config.mgw 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,42 @@ +# MinGW config include file updated for Mesa 7.0 +# +# Updated : by Heromyth, on 2007-7-21 +# Email : zxpmyth@yahoo.com.cn +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# The others havn't been tested yet. +# 2) The generated DLLs are *not* compatible with the ones built +# with the other compilers like VC8, especially for GLUT. +# 3) Although more tests are needed, it can be used individually! + +# The generated DLLs by MingW with STDCALL are not totally compatible +# with the ones linked by Microsoft's compilers. +# +# xxx_USING_STDCALL = 1 Compiling MESA with __stdcall. This is default! +# +# xxx_USING_STDCALL = 0 Compiling MESA without __stdcall. I like this:) +# + +# In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be +# different. For example: +# +# GL_USING_STDCALL = 0 +# GLUT_USING_STDCALL = 1 +# +# Suggested setting: +# +# ALL_USING_STDCALL = 1 +# +# That's default! +# + + +ALL_USING_STDCALL = 1 + + +ifeq ($(ALL_USING_STDCALL),1) + GL_USING_STDCALL = 1 + GLUT_USING_STDCALL = 1 +else + GL_USING_STDCALL = 0 + GLUT_USING_STDCALL = 0 +endif diff -Nru xpsb-glx-0.19/mesa/configs/current xpsb-glx-0.19/mesa/configs/current --- xpsb-glx-0.19/mesa/configs/current 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/current 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,14 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/linux-dri + +CONFIG_NAME = linux-dri-x86 + +# Add -m32 to CFLAGS: +ARCH_FLAGS = -m32 + +ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) + diff -Nru xpsb-glx-0.19/mesa/configs/darwin xpsb-glx-0.19/mesa/configs/darwin --- xpsb-glx-0.19/mesa/configs/darwin 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/darwin 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,57 @@ +# Configuration for Darwin / MacOS X, making dynamic libs + +include $(TOP)/configs/default + +CONFIG_NAME = darwin + +INSTALL_DIR = /usr/X11 + +X11_DIR = $(INSTALL_DIR) + +# Compiler and flags +CC = gcc +CXX = gcc +PIC_FLAGS = -fPIC +DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \ + -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \ + -DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING + +# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11 +# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile +# -DIN_DRI_DRIVER + +ARCH_FLAGS += $(RC_CFLAGS) + +CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \ + -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) +CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \ + -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) + +# Library names (actual file names) +GL_LIB_NAME = libGL.dylib +GLU_LIB_NAME = libGLU.dylib +GLUT_LIB_NAME = libglut.dylib +GLW_LIB_NAME = libGLw.dylib +OSMESA_LIB_NAME = libOSMesa.dylib + +# globs used to install the lib and all symlinks +GL_LIB_GLOB = libGL.*dylib +GLU_LIB_GLOB = libGLU.*dylib +GLUT_LIB_GLOB = libglut.*dylib +GLW_LIB_GLOB = libGLw.*dylib +OSMESA_LIB_GLOB = libOSMesa.*dylib + +GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread +OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm + +# omit glw lib for now: +SRC_DIRS = glx/x11 mesa glu glut/glx +GLU_DIRS = sgi +DRIVER_DIRS = osmesa +#DRIVER_DIRS = dri +DRI_DIRS = swrast +PROGRAM_DIRS = xdemos diff -Nru xpsb-glx-0.19/mesa/configs/darwin-fat-32bit xpsb-glx-0.19/mesa/configs/darwin-fat-32bit --- xpsb-glx-0.19/mesa/configs/darwin-fat-32bit 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/darwin-fat-32bit 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# Configuration for Darwin / MacOS X, making 32bit fat dynamic libs + +RC_CFLAGS=-arch ppc -arch i386 + +include $(TOP)/configs/darwin + +CONFIG_NAME = darwin-fat-32bit diff -Nru xpsb-glx-0.19/mesa/configs/darwin-fat-all xpsb-glx-0.19/mesa/configs/darwin-fat-all --- xpsb-glx-0.19/mesa/configs/darwin-fat-all 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/darwin-fat-all 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs + +RC_CFLAGS=-arch ppc -arch i386 -arch ppc64 -arch x86_64 + +include $(TOP)/configs/darwin + +CONFIG_NAME = darwin-fat-all diff -Nru xpsb-glx-0.19/mesa/configs/default xpsb-glx-0.19/mesa/configs/default --- xpsb-glx-0.19/mesa/configs/default 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/default 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,119 @@ +# Default/template configuration + +# This is included by other config files which may override some +# of these variables. +# Think of this as a base class from which configs are derived. + + +CONFIG_NAME = default + +# Version info +MESA_MAJOR=7 +MESA_MINOR=3 +MESA_TINY=0 +MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) + +# external projects. This should be useless now that we use libdrm. +DRM_SOURCE_PATH=$(TOP)/../drm + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -O +CXXFLAGS = -O +LDFLAGS = +GLU_CFLAGS = + +# Misc tools and flags +SHELL = /bin/sh +MKLIB = $(SHELL) $(TOP)/bin/mklib +MKLIB_OPTIONS = +MKDEP = makedepend +MKDEP_OPTIONS = -fdepend +MAKE = make +INSTALL = $(SHELL) $(TOP)/bin/minstall + +# Tools for regenerating glapi (generally only needed by the developers) +PYTHON2 = python +PYTHON_FLAGS = -t -O -O +INDENT = indent +INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool + +# Library names (base name) +GL_LIB = GL +GLU_LIB = GLU +GLUT_LIB = glut +GLW_LIB = GLw +OSMESA_LIB = OSMesa + + +# Library names (actual file names) +GL_LIB_NAME = lib$(GL_LIB).so +GLU_LIB_NAME = lib$(GLU_LIB).so +GLUT_LIB_NAME = lib$(GLUT_LIB).so +GLW_LIB_NAME = lib$(GLW_LIB).so +OSMESA_LIB_NAME = lib$(OSMESA_LIB).so + +# globs used to install the lib and all symlinks +GL_LIB_GLOB = $(GL_LIB_NAME)* +GLU_LIB_GLOB = $(GLU_LIB_NAME)* +GLUT_LIB_GLOB = $(GLUT_LIB_NAME)* +GLW_LIB_GLOB = $(GLW_LIB_NAME)* +OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)* + +# Optional assembly language optimization files for libGL +ASM_SOURCES = + +# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in +# order to build the Motif widget too) +GLW_SOURCES = GLwDrawA.c +MOTIF_CFLAGS = -I/usr/include/Motif1.2 + + +# Directories to build +LIB_DIR = lib +SRC_DIRS = mesa glu glut/glx glw +GLU_DIRS = sgi +DRIVER_DIRS = x11 osmesa +# Which subdirs under $(TOP)/progs/ to enter: +PROGRAM_DIRS = demos redbook samples glsl xdemos + + +# Library dependencies +#EXTRA_LIB_PATH ?= +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread +OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11 + +# Program dependencies - specific GL/glut libraries added in Makefiles +APP_LIB_DEPS = -lm + + +# Installation directories (for make install) +INSTALL_DIR = /usr +INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR) +INSTALL_INC_DIR = $(INSTALL_DIR)/include +DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri + +# Where libGL will look for DRI hardware drivers +DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR) + +# pkg-config substitutions +GL_PC_REQ_PRIV = +GL_PC_LIB_PRIV = +GL_PC_CFLAGS = +DRI_PC_REQ_PRIV = +GLU_PC_REQ = gl +GLU_PC_REQ_PRIV = +GLU_PC_LIB_PRIV = +GLU_PC_CFLAGS = +GLUT_PC_REQ_PRIV = +GLUT_PC_LIB_PRIV = +GLUT_PC_CFLAGS = +GLW_PC_REQ_PRIV = +GLW_PC_LIB_PRIV = +GLW_PC_CFLAGS = +OSMESA_PC_REQ = +OSMESA_PC_LIB_PRIV = diff -Nru xpsb-glx-0.19/mesa/configs/freebsd xpsb-glx-0.19/mesa/configs/freebsd --- xpsb-glx-0.19/mesa/configs/freebsd 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/freebsd 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,31 @@ +# Configuration for FreeBSD + +include $(TOP)/configs/default + +CONFIG_NAME = FreeBSD + +# Compiler and flags +CC = cc +CXX = c++ +MAKE = gmake + +OPT_FLAGS = -O2 +PIC_FLAGS = -fPIC + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM \ + -DHZ=100 + +X11_INCLUDES = -I/usr/local/include + +CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic + +CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) + +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +EXTRA_LIB_PATH = -L/usr/local/lib +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm diff -Nru xpsb-glx-0.19/mesa/configs/freebsd-dri xpsb-glx-0.19/mesa/configs/freebsd-dri --- xpsb-glx-0.19/mesa/configs/freebsd-dri 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/freebsd-dri 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,54 @@ +# -*-makefile-*- +# Configuration for freebsd-dri: FreeBSD DRI hardware drivers + +include $(TOP)/configs/freebsd + +CONFIG_NAME = freebsd-dri + +# Compiler and flags +CC = gcc +CXX = g++ +WARN_FLAGS = -Wall +OPT_FLAGS = -O -g + +EXPAT_INCLUDES = -I/usr/local/include +X11_INCLUDES = -I/usr/local/include +DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \ + $(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES) + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES) + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +ASM_SOURCES = + +# Library/program dependencies +LIBDRM_CFLAGS = `pkg-config --cflags libdrm` +LIBDRM_LIB = `pkg-config --libs libdrm` +DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB) +GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ + -lm -pthread $(LIBDRM_LIB) + +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11 + + +# Directories +SRC_DIRS = glx/x11 mesa glu glut/glx glw +DRIVER_DIRS = dri +PROGRAM_DIRS = +WINDOW_SYSTEM=dri + +DRM_SOURCE_PATH=$(TOP)/../drm + +# ffb and gamma are missing because they have not been converted to use the new +# interface. +DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \ + unichrome savage sis + diff -Nru xpsb-glx-0.19/mesa/configs/freebsd-dri-amd64 xpsb-glx-0.19/mesa/configs/freebsd-dri-amd64 --- xpsb-glx-0.19/mesa/configs/freebsd-dri-amd64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/freebsd-dri-amd64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,10 @@ +# -*-makefile-*- +# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers + +include $(TOP)/configs/freebsd-dri + +CONFIG_NAME = freebsd-dri-x86-64 + +ASM_FLAGS = -DUSE_X86_64_ASM +ASM_SOURCES = $(X86-64_SOURCES) +ASM_API = $(X86-64_API) diff -Nru xpsb-glx-0.19/mesa/configs/freebsd-dri-x86 xpsb-glx-0.19/mesa/configs/freebsd-dri-x86 --- xpsb-glx-0.19/mesa/configs/freebsd-dri-x86 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/freebsd-dri-x86 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,13 @@ +# -*-makefile-*- +# Configuration for freebsd-dri: FreeBSD DRI hardware drivers + +include $(TOP)/configs/freebsd-dri + +CONFIG_NAME = freebsd-dri-x86 + +# Unnecessary on x86, generally. +PIC_FLAGS = + +ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) diff -Nru xpsb-glx-0.19/mesa/configs/.gitignore xpsb-glx-0.19/mesa/configs/.gitignore --- xpsb-glx-0.19/mesa/configs/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/.gitignore 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,2 @@ +current +autoconf diff -Nru xpsb-glx-0.19/mesa/configs/hpux10 xpsb-glx-0.19/mesa/configs/hpux10 --- xpsb-glx-0.19/mesa/configs/hpux10 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux10 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,14 @@ +# Configuration for HPUX v10, shared libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux10 + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM +CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE + +APP_LIB_DEPS = -$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm diff -Nru xpsb-glx-0.19/mesa/configs/hpux10-gcc xpsb-glx-0.19/mesa/configs/hpux10-gcc --- xpsb-glx-0.19/mesa/configs/hpux10-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux10-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,20 @@ +# Configuration for HPUX v10, with gcc + +include $(TOP)/configs/default + +CONFIG_NAME = hpux10-gcc + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM +CXXFLAGS = -ansi -O3 -D_HPUX_SOURCE +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm + diff -Nru xpsb-glx-0.19/mesa/configs/hpux10-static xpsb-glx-0.19/mesa/configs/hpux10-static --- xpsb-glx-0.19/mesa/configs/hpux10-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux10-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,30 @@ +# Configuration for HPUX v10, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux10-static + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM +CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE + +MKLIB_OPTIONS = -static + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies (static libs don't have dependencies) +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++ +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm -lstdc++ diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-32 xpsb-glx-0.19/mesa/configs/hpux11-32 --- xpsb-glx-0.19/mesa/configs/hpux11-32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,30 @@ +# Configuration for HPUX v11 + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-32 + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS + +CXXFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS + +MKLIB_OPTIONS = + + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) +GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXt -lXi -lX11 -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS) +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS) diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-32-static xpsb-glx-0.19/mesa/configs/hpux11-32-static --- xpsb-glx-0.19/mesa/configs/hpux11-32-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-32-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ +# Configuration for HPUX v11, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-32-static + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS + +CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS + +MKLIB_OPTIONS = -static + + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread -lCsup -lcl + diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-32-static-nothreads xpsb-glx-0.19/mesa/configs/hpux11-32-static-nothreads --- xpsb-glx-0.19/mesa/configs/hpux11-32-static-nothreads 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-32-static-nothreads 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,26 @@ +# Configuration for HPUX v11, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-32-static + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM + +CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include + +MKLIB_OPTIONS = -static + + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies +APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-64 xpsb-glx-0.19/mesa/configs/hpux11-64 --- xpsb-glx-0.19/mesa/configs/hpux11-64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,31 @@ +# Configuration for HPUX v11, 64-bit + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-64 + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS + +CXXFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS + +MKLIB_OPTIONS = + +LIB_DIR = lib64 + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) +GL_LIB_DEPS = -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS) +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS) diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-64-static xpsb-glx-0.19/mesa/configs/hpux11-64-static --- xpsb-glx-0.19/mesa/configs/hpux11-64-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-64-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ +# Configuration for HPUX v11, 64-bit, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-64-static + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS + +CXXFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS + +MKLIB_OPTIONS = -static + +LIB_DIR = lib64 + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread -lCsup -lcl diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-ia64 xpsb-glx-0.19/mesa/configs/hpux11-ia64 --- xpsb-glx-0.19/mesa/configs/hpux11-ia64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-ia64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,30 @@ +# Configuration for HPUX IA64 v11, 64-bit + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-ia64 + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS + +CXXFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS + +MKLIB_OPTIONS = + +LIB_DIR = lib64 + +# Library names (actual file names) +GL_LIB_NAME = libGL.so +GLU_LIB_NAME = libGLU.so +GLUT_LIB_NAME = libglut.so +GLW_LIB_NAME = libGLw.so +OSMESA_LIB_NAME = libOSMesa.so + +# Library/program dependencies +GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS) +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS) diff -Nru xpsb-glx-0.19/mesa/configs/hpux11-ia64-static xpsb-glx-0.19/mesa/configs/hpux11-ia64-static --- xpsb-glx-0.19/mesa/configs/hpux11-ia64-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux11-ia64-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ +# Configuration for HPUX v11, 64-bit, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux11-ia64-static + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS + +CXXFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS + +MKLIB_OPTIONS = -static + +LIB_DIR = lib64 + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lXt -lX11 -lpthread -lm -lCsup -lcl diff -Nru xpsb-glx-0.19/mesa/configs/hpux9 xpsb-glx-0.19/mesa/configs/hpux9 --- xpsb-glx-0.19/mesa/configs/hpux9 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux9 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,16 @@ +# Configuration for HPUX v9, shared libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux9 + +# Compiler and flags +CC = cc +# XXX fix this +CXX = c++ + +CFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM +CXXFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm + diff -Nru xpsb-glx-0.19/mesa/configs/hpux9-gcc xpsb-glx-0.19/mesa/configs/hpux9-gcc --- xpsb-glx-0.19/mesa/configs/hpux9-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/hpux9-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,14 @@ +# Configuration for HPUX v10, shared libs + +include $(TOP)/configs/default + +CONFIG_NAME = hpux9-gcc + +# Compiler and flags +CC = cc +CXX = aCC + +CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM +CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm diff -Nru xpsb-glx-0.19/mesa/configs/irix6-64 xpsb-glx-0.19/mesa/configs/irix6-64 --- xpsb-glx-0.19/mesa/configs/irix6-64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/irix6-64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +# Configuration for IRIX 6.x, make n64 DSOs + +include $(TOP)/configs/default + +CONFIG_NAME = irix6-64 + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS +CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS + +GLW_SOURCES = GLwDrawA.c GLwMDrawA.c + +LIB_DIR = lib64 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lpthread -lm diff -Nru xpsb-glx-0.19/mesa/configs/irix6-64-static xpsb-glx-0.19/mesa/configs/irix6-64-static --- xpsb-glx-0.19/mesa/configs/irix6-64-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/irix6-64-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,26 @@ +# Configuration for IRIX 6.x, make n64 static libs + +include $(TOP)/configs/default + +CONFIG_NAME = irix6-64-static + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS +CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS +MKLIB_OPTIONS = -static + +GLW_SOURCES = GLwDrawA.c GLwMDrawA.c + +LIB_DIR = lib64 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC + +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + + diff -Nru xpsb-glx-0.19/mesa/configs/irix6-n32 xpsb-glx-0.19/mesa/configs/irix6-n32 --- xpsb-glx-0.19/mesa/configs/irix6-n32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/irix6-n32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +# Configuration for IRIX 6.x, make n32 DSOs + +include $(TOP)/configs/default + +CONFIG_NAME = irix6-n32 + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM -DPTHREADS +CXXFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552 -DPTHREADS + +GLW_SOURCES = GLwDrawA.c GLwMDrawA.c + +LIB_DIR = lib32 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lfpe -lpthread -lm diff -Nru xpsb-glx-0.19/mesa/configs/irix6-n32-static xpsb-glx-0.19/mesa/configs/irix6-n32-static --- xpsb-glx-0.19/mesa/configs/irix6-n32-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/irix6-n32-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +# Configuration for IRIX 6.x, make n32 static libs + +include $(TOP)/configs/default + +CONFIG_NAME = irix6-n32-static + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -n32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM -DPTHREADS +CXXFLAGS = -n32 -mips2 -O2 -ansi -woff 3262,3666 -DPTHREADS +MKLIB_OPTIONS = -static + +GLW_SOURCES = GLwDrawA.c GLwMDrawA.c + +LIB_DIR = lib32 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC + +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + diff -Nru xpsb-glx-0.19/mesa/configs/irix6-o32 xpsb-glx-0.19/mesa/configs/irix6-o32 --- xpsb-glx-0.19/mesa/configs/irix6-o32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/irix6-o32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,18 @@ +# Configuration for IRIX 6.x, make o32 DSOs + +include $(TOP)/configs/default + +CONFIG_NAME = irix6-o32 + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM +CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666 + +GLW_SOURCES = GLwDrawA.c GLwMDrawA.c + +LIB_DIR = lib32 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm + diff -Nru xpsb-glx-0.19/mesa/configs/irix6-o32-static xpsb-glx-0.19/mesa/configs/irix6-o32-static --- xpsb-glx-0.19/mesa/configs/irix6-o32-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/irix6-o32-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +# Configuration for IRIX 6.x, make o32 static libs + +include $(TOP)/configs/default + +CONFIG_NAME = irix6-o32-static + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM +CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666 +MKLIB_OPTIONS = -static + +GLW_SOURCES = GLwDrawA.c GLwMDrawA.c + +LIB_DIR = lib32 + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC + +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + diff -Nru xpsb-glx-0.19/mesa/configs/linux xpsb-glx-0.19/mesa/configs/linux --- xpsb-glx-0.19/mesa/configs/linux 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,37 @@ +# Configuration for generic Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux + +# Compiler and flags +CC = gcc +CXX = g++ + +OPT_FLAGS = -O3 -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32 +# to build properly on 64-bit platforms. + +ARCH_FLAGS ?= + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN + +X11_INCLUDES = -I/usr/X11R6/include + +CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \ + $(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math + +CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(X11_INCLUDES) + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +GLUT_CFLAGS = -fexceptions + +EXTRA_LIB_PATH = -L/usr/X11R6/lib diff -Nru xpsb-glx-0.19/mesa/configs/linux-alpha xpsb-glx-0.19/mesa/configs/linux-alpha --- xpsb-glx-0.19/mesa/configs/linux-alpha 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-alpha 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,22 @@ +# Configuration for Linux on Alpha + +include $(TOP)/configs/default + +CONFIG_NAME = linux-alpha + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM +CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm + diff -Nru xpsb-glx-0.19/mesa/configs/linux-alpha-static xpsb-glx-0.19/mesa/configs/linux-alpha-static --- xpsb-glx-0.19/mesa/configs/linux-alpha-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-alpha-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,31 @@ +# Configuration for Linux on Alpha, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = linux-alpha-static + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM +CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -static +PIC_FLAGS = + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + + +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -L/usr/X11R6/lib -lX11 -lm diff -Nru xpsb-glx-0.19/mesa/configs/linux-debug xpsb-glx-0.19/mesa/configs/linux-debug --- xpsb-glx-0.19/mesa/configs/linux-debug 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-debug 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,8 @@ +# Configuration for debugging on Linux + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-debug + +OPT_FLAGS = -g -ansi -pedantic +DEFINES += -DDEBUG -DDEBUG_MATH diff -Nru xpsb-glx-0.19/mesa/configs/linux-directfb xpsb-glx-0.19/mesa/configs/linux-directfb --- xpsb-glx-0.19/mesa/configs/linux-directfb 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-directfb 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,38 @@ +# Configuration for DirectFB + +include $(TOP)/configs/default + +CONFIG_NAME = linux-directfb + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -Wall -O3 -ffast-math -fPIC -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -D_SVID_SOURCE \ + -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DPTHREADS + +CXXFLAGS = -Wall -O3 -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +HAVE_X86 = $(shell uname -m | grep 'i[3-6]86' >/dev/null && echo yes) +ifeq ($(HAVE_X86), yes) + CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM + CXXFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM + ASM_SOURCES = $(X86_SOURCES) + ASM_API = $(X86_API) +endif + +# Directories +SRC_DIRS = mesa glu glut/directfb +GLU_DIRS = sgi +DRIVER_DIRS = directfb +PROGRAM_DIRS = demos directfb + +# Library/program dependencies +GL_LIB_DEPS = -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLU_LIB) +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLU_LIB) -l$(GLUT_LIB) + diff -Nru xpsb-glx-0.19/mesa/configs/linux-dri xpsb-glx-0.19/mesa/configs/linux-dri --- xpsb-glx-0.19/mesa/configs/linux-dri 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-dri 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,75 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/default + +CONFIG_NAME = linux-dri + +# Compiler and flags +CC = gcc +CXX = g++ + +#MKDEP = /usr/X11R6/bin/makedepend +#MKDEP = gcc -M +#MKDEP_OPTIONS = -MF depend + +OPT_FLAGS = -O -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. +ARCH_FLAGS ?= + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN + +X11_INCLUDES = -I/usr/X11R6/include + +CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \ + $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS) + +CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +ASM_SOURCES = + +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/X11R6/lib + +LIBDRM_CFLAGS = `pkg-config --cflags libdrm-poulsbo` +LIBDRM_LIB = `pkg-config --libs libdrm-poulsbo` +DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB) +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ + -lm -lpthread -ldl $(LIBDRM_LIB) + + +# This is now 0 by default since it seems to confuse the hell out of people +# and generate a lot of extra noise on bugzilla. If you need to build with +# EGL, do 'make linux-dri USING_EGL=1' + +USING_EGL=0 + +# Directories +ifeq ($(USING_EGL), 1) +SRC_DIRS = egl glx/x11 mesa glu glut/glx glw +PROGRAM_DIRS = egl xdemos +else +SRC_DIRS = glx/x11 mesa glu glut/glx glw +PROGRAM_DIRS = xdemos +endif + +DRIVER_DIRS = dri +WINDOW_SYSTEM=dri + +# gamma are missing because they have not been converted to use the new +# interface. +#DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ +# savage sis tdfx trident unichrome ffb +DRI_DIRS = psb diff -Nru xpsb-glx-0.19/mesa/configs/linux-dri-debug xpsb-glx-0.19/mesa/configs/linux-dri-debug --- xpsb-glx-0.19/mesa/configs/linux-dri-debug 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-dri-debug 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +# -*-makefile-*- +# Configuration for linux-dri-debug: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/linux-dri + +CONFIG_NAME = linux-dri-debug +OPT_FLAGS = -O0 -g +ARCH_FLAGS = -DDEBUG +DEBUG = t +# Helpful to reduce the amount of stuff that gets built sometimes: +#DRI_DIRS = i915tex i915 +#DRI_DIRS = i965 +#DRI_DIRS = radeon r200 r300 +#DRI_DIRS = unichrome sis trident +#DRI_DIRS = i810 mga r128 tdfx +DRI_DIRS = psb + diff -Nru xpsb-glx-0.19/mesa/configs/linux-dri-ppc xpsb-glx-0.19/mesa/configs/linux-dri-ppc --- xpsb-glx-0.19/mesa/configs/linux-dri-ppc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-dri-ppc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/linux-dri + +CONFIG_NAME = linux-dri-ppc + +OPT_FLAGS = -Os -mcpu=603 +PIC_FLAGS = -fPIC + +ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM +ASM_SOURCES = $(PPC_SOURCES) + +# Build only the drivers for cards that exist on PowerPC. At some point MGA +# will be added, but not yet. +DRI_DIRS = mach64 r128 r200 r300 radeon tdfx + diff -Nru xpsb-glx-0.19/mesa/configs/linux-dri-x86 xpsb-glx-0.19/mesa/configs/linux-dri-x86 --- xpsb-glx-0.19/mesa/configs/linux-dri-x86 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-dri-x86 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,14 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/linux-dri + +CONFIG_NAME = linux-dri-x86 + +# Add -m32 to CFLAGS: +ARCH_FLAGS = -m32 + +ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) + diff -Nru xpsb-glx-0.19/mesa/configs/linux-dri-x86-64 xpsb-glx-0.19/mesa/configs/linux-dri-x86-64 --- xpsb-glx-0.19/mesa/configs/linux-dri-x86-64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-dri-x86-64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,24 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/linux-dri + +CONFIG_NAME = linux-dri-x86-64 + +ARCH_FLAGS = -m64 + +ASM_FLAGS = -DUSE_X86_64_ASM +ASM_SOURCES = $(X86-64_SOURCES) +ASM_API = $(X86-64_API) + +LIB_DIR = lib64 + +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/X11R6/lib64 + +# ffb, gamma, and sis are missing because they have not be converted to use +# the new interface. i810 are missing because there is no x86-64 +# system where they could *ever* be used. +# +DRI_DIRS = i915 i965 mach64 mga r128 r200 r300 radeon savage tdfx unichrome + diff -Nru xpsb-glx-0.19/mesa/configs/linux-dri-xcb xpsb-glx-0.19/mesa/configs/linux-dri-xcb --- xpsb-glx-0.19/mesa/configs/linux-dri-xcb 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-dri-xcb 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,73 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/default + +CONFIG_NAME = linux-dri-xcb + +# Compiler and flags +CC = gcc +CXX = g++ + +#MKDEP = /usr/X11R6/bin/makedepend +#MKDEP = gcc -M +#MKDEP_OPTIONS = -MF depend + +OPT_FLAGS = -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. +ARCH_FLAGS ?= + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN + +X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx` + +CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \ + $(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math + +CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +ASM_SOURCES = + +# Library/program dependencies +EXTRA_LIB_PATH=`pkg-config --libs-only-L x11` + +LIBDRM_CFLAGS = `pkg-config --cflags libdrm-poulsbo` +LIBDRM_LIB = `pkg-config --libs libdrm-poulsbo` +DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB) +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ + -lm -lpthread -ldl $(LIBDRM_LIB) `pkg-config --libs xcb` \ + `pkg-config --libs x11-xcb` `pkg-config --libs xcb-glx` + + +# This is now 0 by default since it seems to confuse the hell out of people +# and generate a lot of extra noise on bugzilla. If you need to build with +# EGL, do 'make linux-dri USING_EGL=1' + +USING_EGL=0 + +# Directories +ifeq ($(USING_EGL), 1) +SRC_DIRS = egl glx/x11 mesa glu glut/glx glw +PROGRAM_DIRS = egl xdemos +else +SRC_DIRS = glx/x11 mesa glu glut/glx glw +PROGRAM_DIRS = xdemos +endif + +DRIVER_DIRS = dri +WINDOW_SYSTEM=dri + +# gamma are missing because they have not been converted to use the new +# interface. +DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \ + savage sis tdfx trident unichrome ffb diff -Nru xpsb-glx-0.19/mesa/configs/linux-fbdev xpsb-glx-0.19/mesa/configs/linux-fbdev --- xpsb-glx-0.19/mesa/configs/linux-fbdev 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-fbdev 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,19 @@ +# Configuration for Linux fbdev interface + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-fbdev + +CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing + +SRC_DIRS = mesa glu glut/fbdev +DRIVER_DIRS = fbdev osmesa +PROGRAM_DIRS = fbdev demos redbook samples + +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread +OSMESA_LIB_DEPS = -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm + diff -Nru xpsb-glx-0.19/mesa/configs/linux-glide xpsb-glx-0.19/mesa/configs/linux-glide --- xpsb-glx-0.19/mesa/configs/linux-glide 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-glide 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,23 @@ +# Configuration for generic Linux with 3Dfx Glide driver + +include $(TOP)/configs/default + +CONFIG_NAME = linux-glide + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include +CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Library/program dependencies +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm diff -Nru xpsb-glx-0.19/mesa/configs/linux-ia64-icc xpsb-glx-0.19/mesa/configs/linux-ia64-icc --- xpsb-glx-0.19/mesa/configs/linux-ia64-icc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-ia64-icc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,21 @@ +# Configuration for Linux with Intel C compiler + +include $(TOP)/configs/default + +CONFIG_NAME = linux-icc + +# Compiler and flags +CC = icc +CXX = icpc +CFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include +CXXFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -arch icc-istatic + +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS) +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) + + diff -Nru xpsb-glx-0.19/mesa/configs/linux-ia64-icc-static xpsb-glx-0.19/mesa/configs/linux-ia64-icc-static --- xpsb-glx-0.19/mesa/configs/linux-ia64-icc-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-ia64-icc-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ +# Configuration for Linux with Intel C compiler, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = linux-icc-static + +# Compiler and flags +CC = icc +CXX = icpc +CFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include +CXXFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -static -arch icc-istatic + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +GL_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = +APP_LIB_DEPS = -i-static -cxxlib-icc -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lpthread -lm -lcxa -lunwind + diff -Nru xpsb-glx-0.19/mesa/configs/linux-icc xpsb-glx-0.19/mesa/configs/linux-icc --- xpsb-glx-0.19/mesa/configs/linux-icc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-icc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,22 @@ +# Configuration for Linux with Intel C compiler + +include $(TOP)/configs/default + +CONFIG_NAME = linux-icc + +# Compiler and flags +CC = icc +CXX = g++ +CFLAGS = -O3 -tpp6 -axK -KPIC -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include +CXXFLAGS = -O3 +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -arch icc + +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm + +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) + + diff -Nru xpsb-glx-0.19/mesa/configs/linux-icc-static xpsb-glx-0.19/mesa/configs/linux-icc-static --- xpsb-glx-0.19/mesa/configs/linux-icc-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-icc-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ +# Configuration for Linux with Intel C compiler, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = linux-icc-static + +# Compiler and flags +CC = icc +CXX = icpc +CFLAGS = -O3 -tpp6 -axK -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include +CXXFLAGS = -O3 -tpp6 -axK -DPTHREADS +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -static -arch icc + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +GL_LIB_DEPS = +GLUT_LIB_DEPS = +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -lpthread -lcxa -lunwind + +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) diff -Nru xpsb-glx-0.19/mesa/configs/linux-indirect xpsb-glx-0.19/mesa/configs/linux-indirect --- xpsb-glx-0.19/mesa/configs/linux-indirect 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-indirect 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,53 @@ +# -*-makefile-*- +# Configuration for linux-indirect: Builds a libGL capable of indirect +# rendering, but *NOT* capable of direct rendering. + +include $(TOP)/configs/default + +CONFIG_NAME = linux-dri + +# Compiler and flags +CC = gcc +CXX = g++ + +#MKDEP = /usr/X11R6/bin/makedepend +#MKDEP = gcc -M +#MKDEP_OPTIONS = -MF depend + +WARN_FLAGS = -Wall +OPT_FLAGS = -O -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. +ARCH_FLAGS ?= + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DGLX_INDIRECT_RENDERING \ + -DPTHREADS -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN + +X11_INCLUDES = -I/usr/X11R6/include + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +ASM_SOURCES = + +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/X11R6/lib + +DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl + + +# Directories +SRC_DIRS = glx/x11 glu glut/glx glw +DRIVER_DIRS = +PROGRAM_DIRS = +WINDOW_SYSTEM=dri diff -Nru xpsb-glx-0.19/mesa/configs/linux-osmesa xpsb-glx-0.19/mesa/configs/linux-osmesa --- xpsb-glx-0.19/mesa/configs/linux-osmesa 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-osmesa 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,28 @@ +# Configuration for building only libOSMesa on Linux, no Xlib driver +# This doesn't really have any Linux dependencies, so it should be usable +# on other (gcc-based) systems. + +include $(TOP)/configs/default + +CONFIG_NAME = linux-osmesa + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS +CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = osdemos + + +# Dependencies +OSMESA_LIB_DEPS = -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +APP_LIB_DEPS = -lm -lpthread diff -Nru xpsb-glx-0.19/mesa/configs/linux-osmesa16 xpsb-glx-0.19/mesa/configs/linux-osmesa16 --- xpsb-glx-0.19/mesa/configs/linux-osmesa16 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-osmesa16 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,31 @@ +# Configuration for 16 bits/channel OSMesa library on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-osmesa16 + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Library names +OSMESA_LIB = OSMesa16 +OSMESA_LIB_NAME = libOSMesa16.so + + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = + + +# Dependencies +OSMESA_LIB_DEPS = -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +APP_LIB_DEPS = -lm -lpthread diff -Nru xpsb-glx-0.19/mesa/configs/linux-osmesa16-static xpsb-glx-0.19/mesa/configs/linux-osmesa16-static --- xpsb-glx-0.19/mesa/configs/linux-osmesa16-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-osmesa16-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,32 @@ +# Configuration for 16 bits/channel OSMesa library on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-osmesa16-static + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +MKLIB_OPTIONS = -static +PIC_FLAGS = + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Library names +OSMESA_LIB = OSMesa16 +OSMESA_LIB_NAME = libOSMesa16.a + + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = + + +# Dependencies +OSMESA_LIB_DEPS = -lm -lpthread +APP_LIB_DEPS = -lm -lpthread diff -Nru xpsb-glx-0.19/mesa/configs/linux-osmesa32 xpsb-glx-0.19/mesa/configs/linux-osmesa32 --- xpsb-glx-0.19/mesa/configs/linux-osmesa32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-osmesa32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,31 @@ +# Configuration for 32 bits/channel OSMesa library on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-osmesa32 + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Library names +OSMESA_LIB = OSMesa32 +OSMESA_LIB_NAME = libOSMesa32.so + + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = + + +# Dependencies +OSMESA_LIB_DEPS = -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +APP_LIB_DEPS = -lm -lpthread diff -Nru xpsb-glx-0.19/mesa/configs/linux-ppc xpsb-glx-0.19/mesa/configs/linux-ppc --- xpsb-glx-0.19/mesa/configs/linux-ppc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-ppc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,9 @@ +# Configuration for Linux on PPC + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-ppc + +OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops + +# FIXME: Use of PowerPC assembly should be enabled here. \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/configs/linux-ppc-static xpsb-glx-0.19/mesa/configs/linux-ppc-static --- xpsb-glx-0.19/mesa/configs/linux-ppc-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-ppc-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,15 @@ +# Configuration for Linux on PPC, static libs + +include $(TOP)/configs/linux-ppc + +CONFIG_NAME = linux-ppc-static + +MKLIB_OPTIONS = -static +PIC_FLAGS = + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a diff -Nru xpsb-glx-0.19/mesa/configs/linux-profile xpsb-glx-0.19/mesa/configs/linux-profile --- xpsb-glx-0.19/mesa/configs/linux-profile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-profile 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,29 @@ +# Configuration for profiling on Linux with gprof + +include $(TOP)/configs/default + +CONFIG_NAME = linux-profile + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -pg -O -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG + +CXXFLAGS = -pg -O -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG + +GLUT_CFLAGS = -fexceptions + +# Need to have -L/usr/X11R6/lib in these: +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11 + +# Need to make static libs for profiling: +MKLIB_OPTIONS = -static +GL_LIB_NAME = lib$(GL_LIB).a +GLU_LIB_NAME = lib$(GLU_LIB).a +GLUT_LIB_NAME = lib$(GLUT_LIB).a +GLW_LIB_NAME = lib$(GLW_LIB).a +OSMESA_LIB_NAME = lib$(OSMesa).a +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread diff -Nru xpsb-glx-0.19/mesa/configs/linux-solo xpsb-glx-0.19/mesa/configs/linux-solo --- xpsb-glx-0.19/mesa/configs/linux-solo 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-solo 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,54 @@ +# Configuration for linux-solo: Linux DRI hardware drivers for fbdev + +include $(TOP)/configs/default + +CONFIG_NAME = linux-solo + +# Compiler and flags +CC = gcc +CXX = g++ + +WARN_FLAGS = -Wall -Wundef +OPT_FLAGS = -O3 -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. +ARCH_FLAGS ?= + +# DRM and pciaccess +LIBDRM_CFLAGS = `pkg-config --cflags libdrm-poulsbo` +LIBDRM_LIB = `pkg-config --libs libdrm-poulsbo` +PCIACCESS_CFLAGS = `pkg-config --cflags pciaccess` +PCIACCESS_LIB = `pkg-config --libs pciaccess` + + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE -DHAVE_POSIX_MEMALIGN \ + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ + -DHAVE_ALIAS + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +ASM_SOURCES = + +# Library/program dependencies +DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR) $(PCIACCESS_LIB) +GL_LIB_DEPS = -lm -lpthread -ldl +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread + +# Directories +SRC_DIRS = glx/mini mesa glu glut/mini +DRIVER_DIRS = dri +PROGRAM_DIRS = miniglx + +#DRI_DIRS = ffb gamma sis savage tdfx unichrome fb +DRI_DIRS = i810 i915tex i915 mach64 mga r128 r200 radeon diff -Nru xpsb-glx-0.19/mesa/configs/linux-solo-ia64 xpsb-glx-0.19/mesa/configs/linux-solo-ia64 --- xpsb-glx-0.19/mesa/configs/linux-solo-ia64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-solo-ia64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# Configuration for linux-solo-ia64: Linux DRI hardware drivers for fbdev + +include $(TOP)/configs/linux-solo + +CONFIG_NAME = linux-solo-ia64 + +DRI_DIRS = fb mach64 mga r128 r200 radeon sis tdfx unichrome diff -Nru xpsb-glx-0.19/mesa/configs/linux-solo-x86 xpsb-glx-0.19/mesa/configs/linux-solo-x86 --- xpsb-glx-0.19/mesa/configs/linux-solo-x86 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-solo-x86 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,10 @@ +# -*-makefile-*- +# Configuration for linux-solo-x86: Linux hardware drivers for fbdev for x86 + +include $(TOP)/configs/linux-solo + +CONFIG_NAME = linux-solo-x86 + +ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) diff -Nru xpsb-glx-0.19/mesa/configs/linux-sparc xpsb-glx-0.19/mesa/configs/linux-sparc --- xpsb-glx-0.19/mesa/configs/linux-sparc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-sparc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,9 @@ +# Configuration for Linux on Sparc + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-sparc + +#ASM_FLAGS = -DUSE_SPARC_ASM +#ASM_SOURCES = $(SPARC_SOURCES) +#ASM_API = $(SPARC_API) diff -Nru xpsb-glx-0.19/mesa/configs/linux-sparc5 xpsb-glx-0.19/mesa/configs/linux-sparc5 --- xpsb-glx-0.19/mesa/configs/linux-sparc5 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-sparc5 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# Configuration for Linux on Sparc5 + +include $(TOP)/configs/linux-sparc + +CONFIG_NAME = linux-sparc5 + +ARCH_FLAGS += -mcpu=ultrasparc diff -Nru xpsb-glx-0.19/mesa/configs/linux-static xpsb-glx-0.19/mesa/configs/linux-static --- xpsb-glx-0.19/mesa/configs/linux-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,26 @@ +# Configuration for generic Linux, making static libs + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-static + +MKLIB_OPTIONS = -static +PIC_FLAGS = + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies (static libs don't have dependencies) +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = + +# Need to specify all libraries we may need +APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \ + -lstdc++ -lm diff -Nru xpsb-glx-0.19/mesa/configs/linux-ultrasparc xpsb-glx-0.19/mesa/configs/linux-ultrasparc --- xpsb-glx-0.19/mesa/configs/linux-ultrasparc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-ultrasparc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# Configuration for Linux on UltraSparc + +include $(TOP)/configs/linux-sparc + +CONFIG_NAME = linux-ultrasparc + +ARCH_FLAGS += -mv8 -mtune=ultrasparc diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86 xpsb-glx-0.19/mesa/configs/linux-x86 --- xpsb-glx-0.19/mesa/configs/linux-x86 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,9 @@ +# Configuration for Linux with x86 optimizations + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-x86 + +ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-32 xpsb-glx-0.19/mesa/configs/linux-x86-32 --- xpsb-glx-0.19/mesa/configs/linux-x86-32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# To build Linux x86 32-bit in an x86-64 environment + +include $(TOP)/configs/linux-x86 + +CONFIG_NAME = linux-x86-32 + +ARCH_FLAGS += -m32 diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-64 xpsb-glx-0.19/mesa/configs/linux-x86-64 --- xpsb-glx-0.19/mesa/configs/linux-x86-64 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-64 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,14 @@ +# Configuration for Linux for 64-bit X86 (Opteron) + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-x86-64 + +ARCH_FLAGS = -m64 + +ASM_SOURCES = $(X86-64_SOURCES) +ASM_API = $(X86-64_API) +ASM_FLAGS = -DUSE_X86_64_ASM + +LIB_DIR = lib64 +EXTRA_LIB_PATH = -L/usr/X11R6/lib64 diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-64-debug xpsb-glx-0.19/mesa/configs/linux-x86-64-debug --- xpsb-glx-0.19/mesa/configs/linux-x86-64-debug 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-64-debug 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,7 @@ +# Configuration for Linux for 64-bit X86 (Opteron) + +include $(TOP)/configs/linux-x86-64 + +CONFIG_NAME = linux-x86-64-debug + +DEFINES += -DDEBUG -DDEBUG_MATH diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-64-static xpsb-glx-0.19/mesa/configs/linux-x86-64-static --- xpsb-glx-0.19/mesa/configs/linux-x86-64-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-64-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,24 @@ +# Configuration for Linux for 64-bit X86 (Opteron), static libs + +include $(TOP)/configs/linux-x86-64 + +CONFIG_NAME = linux-x86-64-static + +MKLIB_OPTIONS = -static +PIC_FLAGS = + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies (static libs don't have dependencies) +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = +APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \ + -lstdc++ -lm diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-debug xpsb-glx-0.19/mesa/configs/linux-x86-debug --- xpsb-glx-0.19/mesa/configs/linux-x86-debug 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-debug 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,9 @@ +# Configuration for Linux with x86 code, but no gcc optimizations and +# debugging enabled. + +include $(TOP)/configs/linux-x86 + +CONFIG_NAME = linux-x86-debug + +OPT_FLAGS = -g +DEFINES += -DDEBUG -DDEBUG_MATH diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-glide xpsb-glx-0.19/mesa/configs/linux-x86-glide --- xpsb-glx-0.19/mesa/configs/linux-x86-glide 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-glide 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,28 @@ +# Configuration for Linux with 3Dfx Glide driver and x86 optimizations + +include $(TOP)/configs/default + +CONFIG_NAME = linux-x86-glide + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include + +CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) + +# Library/program dependencies +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm diff -Nru xpsb-glx-0.19/mesa/configs/linux-x86-static xpsb-glx-0.19/mesa/configs/linux-x86-static --- xpsb-glx-0.19/mesa/configs/linux-x86-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/linux-x86-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,24 @@ +# Configuration for Linux with x86 optimizations, static libs + +include $(TOP)/configs/linux-x86 + +CONFIG_NAME = linux-x86-static + +MKLIB_OPTIONS = -static +PIC_FLAGS = + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies (static libs don't have dependencies) +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = +APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \ + -lstdc++ -lm diff -Nru xpsb-glx-0.19/mesa/configs/netbsd xpsb-glx-0.19/mesa/configs/netbsd --- xpsb-glx-0.19/mesa/configs/netbsd 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/netbsd 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +# Configuration for NetBSD + +include $(TOP)/configs/default + +CONFIG_NAME = netbsd + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100 +CXXFLAGS = -O2 -fPIC +GLUT_CFLAGS = -fexceptions +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing diff -Nru xpsb-glx-0.19/mesa/configs/openbsd xpsb-glx-0.19/mesa/configs/openbsd --- xpsb-glx-0.19/mesa/configs/openbsd 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/openbsd 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,22 @@ +# Configuration for OpenBSD + +include $(TOP)/configs/default + +CONFIG_NAME = openbsd + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 +CXXFLAGS = -O2 -fPIC -I/usr/X11R6/include -DHZ=100 + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm +OSMESA_LIB_DEPS = -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm + diff -Nru xpsb-glx-0.19/mesa/configs/osf1 xpsb-glx-0.19/mesa/configs/osf1 --- xpsb-glx-0.19/mesa/configs/osf1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/osf1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,16 @@ +# Configuration for OSF/1 + +include $(TOP)/configs/default + +CONFIG_NAME = osf1 + +# Compiler and flags +CC = cc +CXX = cxx +CFLAGS = -O0 -std1 -ieee_with_no_inexact -DUSE_XSHM -DPTHREADS -D_REENTRANT +CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT + +GL_LIB_DEPS = -lX11 -lXext -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm diff -Nru xpsb-glx-0.19/mesa/configs/osf1-static xpsb-glx-0.19/mesa/configs/osf1-static --- xpsb-glx-0.19/mesa/configs/osf1-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/osf1-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +# Configuration for OSF/1 + +include $(TOP)/configs/default + +CONFIG_NAME = osf1 + +# Compiler and flags +CC = cc +CXX = cxx +CFLAGS = -O2 -std1 -ieee_with_no_inexact -DUSE_XSHM -DPTHREADS -D_REENTRANT +CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT +MKLIB_OPTIONS = -static + +GL_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +APP_LIB_DEPS = -noso -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -so_archive -lX11 -lXext -lXmu -lXi -lpthread -lm -lcxx diff -Nru xpsb-glx-0.19/mesa/configs/solaris-x86 xpsb-glx-0.19/mesa/configs/solaris-x86 --- xpsb-glx-0.19/mesa/configs/solaris-x86 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/solaris-x86 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,18 @@ +# Configuration for Solaris on x86 + +include $(TOP)/configs/default + +CONFIG_NAME = solaris-x86 + +# Compiler and flags +CC = cc +CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM +MKLIB_OPTIONS = -static + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -lglut -lGLU -lGL + +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a diff -Nru xpsb-glx-0.19/mesa/configs/solaris-x86-gcc xpsb-glx-0.19/mesa/configs/solaris-x86-gcc --- xpsb-glx-0.19/mesa/configs/solaris-x86-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/solaris-x86-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,21 @@ +# Configuration for Solaris on x86 with gcc, dynamic libs + +include $(TOP)/configs/default + +CONFIG_NAME = solaris-x86-gcc + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -march=i486 -fPIC -I/usr/openwin/include -DUSE_XSHM +CXXFLAGS = -O3 -march=i486 -fPIC +GLUT_CFLAGS = -fexceptions + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lX11 -lXmu -lXt -lXi -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXi -lXmu diff -Nru xpsb-glx-0.19/mesa/configs/solaris-x86-gcc-static xpsb-glx-0.19/mesa/configs/solaris-x86-gcc-static --- xpsb-glx-0.19/mesa/configs/solaris-x86-gcc-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/solaris-x86-gcc-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,28 @@ +# Configuration for Solaris on x86 with gcc, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = solaris-x86-gcc + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -march=i486 -fPIC -I/usr/openwin/include -DUSE_XSHM +CXXFLAGS = -O3 -march=i486 -fPIC +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -static + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lX11 -lXmu -lXt -lXi -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXi -lXmu + +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a diff -Nru xpsb-glx-0.19/mesa/configs/sunos4 xpsb-glx-0.19/mesa/configs/sunos4 --- xpsb-glx-0.19/mesa/configs/sunos4 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos4 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,12 @@ +# Configuration for SunOS 4, shared libs + +include $(TOP)/configs/default + +CONFIG_NAME = sunos4 + +# Compiler and flags +CC = acc +CFLAGS = -Kpic -O -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R5 -lX11 -lXext -lXmu -lXi -lm + + diff -Nru xpsb-glx-0.19/mesa/configs/sunos4-gcc xpsb-glx-0.19/mesa/configs/sunos4-gcc --- xpsb-glx-0.19/mesa/configs/sunos4-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos4-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,19 @@ +# Configuration for SunOS 4, with gcc, shared libs + +include $(TOP)/configs/default + +CONFIG_NAME = sunos4-gcc + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4 +CXXFLAGS = -fPIC -O3 -I/usr/openwin/include -DSUNOS4 +GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm + diff -Nru xpsb-glx-0.19/mesa/configs/sunos4-static xpsb-glx-0.19/mesa/configs/sunos4-static --- xpsb-glx-0.19/mesa/configs/sunos4-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos4-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +# Configuration for SunOS 4, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = sunos4-static + +# Compiler and flags +CC = acc +CFLAGS = -O -DUSE_XSHM -DSUNOS4 +MKLIB_OPTIONS = -static + +# Library names (actual file names) +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +# Library/program dependencies (static libs don't have dependencies) +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm diff -Nru xpsb-glx-0.19/mesa/configs/sunos5 xpsb-glx-0.19/mesa/configs/sunos5 --- xpsb-glx-0.19/mesa/configs/sunos5 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,18 @@ +# Configuration for SunOS 5 + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5 + +# Compiler and flags +CC = cc +CXX = c++ +CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM +CXXFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lCrun -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-64-gcc xpsb-glx-0.19/mesa/configs/sunos5-64-gcc --- xpsb-glx-0.19/mesa/configs/sunos5-64-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-64-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,11 @@ +# Configuration for 64-bit SunOS 5, with gcc + +include $(TOP)/configs/sunos5-gcc + +CONFIG_NAME = sunos5-64-gcc + +# only set vars that differ from sunos5-gcc config + +OPT_FLAGS = -O3 -m64 -mcpu=ultrasparc -mv8plus -mvis -g -fomit-frame-pointer -pipe + +ARCH_FLAGS = -m64 diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-gcc xpsb-glx-0.19/mesa/configs/sunos5-gcc --- xpsb-glx-0.19/mesa/configs/sunos5-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,40 @@ +# Configuration for SunOS 5, with gcc + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-gcc + +# Compiler and flags +CC = gcc +CXX = g++ + +WARN_FLAGS = -Wall +OPT_FLAGS = -O3 -g -fomit-frame-pointer -pipe +PIC_FLAGS = -fPIC + +ARCH_FLAGS ?= + +DEFINES = -D_REENTRANT -DUSE_XSHM + +ASM_SOURCES = $(SPARC_SOURCES) +ASM_API = $(SPARC_API) +ASM_FLAGS = -DUSE_SPARC_ASM + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math -I/usr/openwin/include + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + -I/usr/openwin/include + +GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/openwin/lib + +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXi -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-smp xpsb-glx-0.19/mesa/configs/sunos5-smp --- xpsb-glx-0.19/mesa/configs/sunos5-smp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-smp 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,19 @@ +# Configuration for SunOS 5, SMP systems + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-smp + +# Compiler and flags +CC = cc +CXX = c++ +CFLAGS = -KPIC -Xa -native -fast -xO5 -xlibmil -xsafe=mem -xdepend -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG +CXXFLAGS = -KPIC -Xa -native -fast -xO5 -xlibmil -xsafe=mem -xdepend -I/usr/openwin/include -I/usr/dt/include +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lCrun + diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-v8 xpsb-glx-0.19/mesa/configs/sunos5-v8 --- xpsb-glx-0.19/mesa/configs/sunos5-v8 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-v8 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,18 @@ +# Configuration for SunOS 5 + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-v8 + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS +CXXFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-v8-static xpsb-glx-0.19/mesa/configs/sunos5-v8-static --- xpsb-glx-0.19/mesa/configs/sunos5-v8-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-v8-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,16 @@ +# Configuration for SunOS 5 + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-v8-static + +MKLIB_OPTIONS = -static + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS +CXXFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 -lXext -lXmu -lXi -lpthread -lm -lCstd -lCrun diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-v9 xpsb-glx-0.19/mesa/configs/sunos5-v9 --- xpsb-glx-0.19/mesa/configs/sunos5-v9 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-v9 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,23 @@ +# Configuration for SunOS 5, SPARC V9 + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-v9 + +MKLIB_OPTIONS = -cplusplus + +LIB_DIR = lib64 + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS +CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm + diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-v9-cc-g++ xpsb-glx-0.19/mesa/configs/sunos5-v9-cc-g++ --- xpsb-glx-0.19/mesa/configs/sunos5-v9-cc-g++ 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-v9-cc-g++ 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,35 @@ +# Configuration for SunOS 5, SPARC V9 and cc/g++ (for C and C++ sources) + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-v9-cc-g++ + +MKLIB_OPTIONS = -cplusplus + +LIB_DIR = lib64 + +# Compiler and flags +CC = cc +CXX = g++ + +CXX_WARN_FLAGS = -Wall +CXX_PIC_FLAGS = -fPIC +CXX_OPT_FLAGS = -O3 -m64 -mcpu=ultrasparc -mv8plus -mvis -g -fomit-frame-pointer -pipe +CXX_ARCH_FLAGS = -m64 + + +CXXFLAGS = $(CXX_WARN_FLAGS) $(CXX_OPT_FLAGS) $(CXX_PIC_FLAGS) $(CXX_ARCH_FLAGS) $(DEFINES) \ + -I/usr/openwin/include + +# Work around aliasing bugs - developers should comment this out +CXXFLAGS += -fno-strict-aliasing + +CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS +#CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm diff -Nru xpsb-glx-0.19/mesa/configs/sunos5-v9-static xpsb-glx-0.19/mesa/configs/sunos5-v9-static --- xpsb-glx-0.19/mesa/configs/sunos5-v9-static 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/sunos5-v9-static 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,18 @@ +# Configuration for SunOS 5, SPARC V9, static libs + +include $(TOP)/configs/default + +CONFIG_NAME = sunos5-v9-static + +MKLIB_OPTIONS = -static -cplusplus + +LIB_DIR = lib64 + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS +CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS +GLUT_CFLAGS = -DSOLARIS_2_4_BUG + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 -lXext -lXmu -lXi -lpthread -lm -lCstd -lCrun diff -Nru xpsb-glx-0.19/mesa/configs/ultrix-gcc xpsb-glx-0.19/mesa/configs/ultrix-gcc --- xpsb-glx-0.19/mesa/configs/ultrix-gcc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configs/ultrix-gcc 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +# Configuration for Ultrix, with gcc + +include $(TOP)/configs/default + +CONFIG_NAME = ultrix-gcc + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -pedantic -O2 +CXXFLAGS = -pedantic -O2 +GLUT_CFLAGS = -fexceptions +MKLIB_OPTIONS = -static + +# Work around aliasing bugs - developers should comment this out +CFLAGS += -fno-strict-aliasing +CXXFLAGS += -fno-strict-aliasing + +GL_LIB_NAME = libGL.a +GLU_LIB_NAME = libGLU.a +GLUT_LIB_NAME = libglut.a +GLW_LIB_NAME = libGLw.a +OSMESA_LIB_NAME = libOSMesa.a + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXmu -lX11 -lXi -lm diff -Nru xpsb-glx-0.19/mesa/config.sub xpsb-glx-0.19/mesa/config.sub --- xpsb-glx-0.19/mesa/config.sub 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/config.sub 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1658 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-01-16' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru xpsb-glx-0.19/mesa/configure.ac xpsb-glx-0.19/mesa/configure.ac --- xpsb-glx-0.19/mesa/configure.ac 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/configure.ac 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1103 @@ +dnl Process this file with autoconf to create configure. + +AC_PREREQ([2.59]) + +dnl Versioning - scrape the version from configs/default +m4_define([mesa_version], + [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])]) +m4_ifval(mesa_version,[],[ + m4_errprint([Error: Failed to get the Mesa version from the output of + running `make -f bin/version.mk version' +]) + m4_exit([1]) +]) + +dnl Tell the user about autoconf.html in the --help output +m4_divert_once([HELP_END], [ +See docs/autoconf.html for more details on the options for Mesa.]) + +AC_INIT([Mesa],[mesa_version], + [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa]) +AC_CONFIG_AUX_DIR([bin]) +AC_CANONICAL_HOST + +dnl Versions for external dependencies +LIBDRM_REQUIRED=2.3.1 +DRI2PROTO_REQUIRED=1.99.3 + +dnl Check for progs +AC_PROG_CPP +AC_PROG_CC +AC_PROG_CXX +AC_CHECK_PROGS([MAKE], [gmake make]) +AC_PATH_PROG([MKDEP], [makedepend]) +AC_PATH_PROG([SED], [sed]) + +dnl We need a POSIX shell for parts of the build. Assume we have one +dnl in most cases. +case "$host_os" in +solaris*) + # Solaris /bin/sh is too old/non-POSIX compliant + AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh]) + SHELL="$POSIX_SHELL" + ;; +esac + +MKDEP_OPTIONS=-fdepend +dnl Ask gcc where it's keeping its secret headers +if test "x$GCC" = xyes; then + for dir in include include-fixed; do + GCC_INCLUDES=`$CC -print-file-name=$dir` + if test "x$GCC_INCLUDES" != x && \ + test "$GCC_INCLUDES" != "$dir" && \ + test -d "$GCC_INCLUDES"; then + MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" + fi + done +fi +AC_SUBST([MKDEP_OPTIONS]) + +dnl Make sure the pkg-config macros are defined +m4_ifdef([PKG_PROG_PKG_CONFIG],[],[ + m4_errprint([Error: Could not locate the pkg-config autoconf macros. + These are usually located in /usr/share/aclocal/pkg.m4. If your + macros are in a different location, try setting the environment + variable ACLOCAL="aclocal -I/other/macro/dir" before running + autoreconf. +]) + m4_exit([1]) +]) +PKG_PROG_PKG_CONFIG() + +dnl LIB_DIR - library basename +LIB_DIR=`echo $libdir | $SED 's%.*/%%'` +AC_SUBST([LIB_DIR]) + +dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later +_SAVE_LDFLAGS="$LDFLAGS" +AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker]) +AC_SUBST([EXTRA_LIB_PATH]) + +dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later +_SAVE_CPPFLAGS="$CPPFLAGS" +AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers]) +AC_SUBST([X11_INCLUDES]) + +dnl Compiler macros +DEFINES="" +AC_SUBST([DEFINES]) +case "$host_os" in +linux*|*-gnu*) + DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS" + ;; +solaris*) + DEFINES="$DEFINES -DPTHREADS -DSVR4" + ;; +esac + +dnl Add flags for gcc and g++ +if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math" + + # Work around aliasing bugs - developers should comment this out + CFLAGS="$CFLAGS -fno-strict-aliasing" +fi +if test "x$GXX" = xyes; then + CXXFLAGS="$CXXFLAGS -Wall" + + # Work around aliasing bugs - developers should comment this out + CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" +fi + +dnl These should be unnecessary, but let the user set them if they want +AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler. + Default is to use CFLAGS.]) +AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the + compiler. Default is to use CFLAGS.]) +AC_SUBST([OPT_FLAGS]) +AC_SUBST([ARCH_FLAGS]) + +dnl +dnl Hacks to enable 32 or 64 bit build +dnl +AC_ARG_ENABLE([32-bit], + [AS_HELP_STRING([--enable-32-bit], + [build 32-bit libraries @<:@default=auto@:>@])], + [enable_32bit="$enableval"], + [enable_32bit=auto] +) +if test "x$enable_32bit" = xyes; then + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -m32" + fi + if test "x$GXX" = xyes; then + CXXFLAGS="$CXXFLAGS -m32" + fi +fi +AC_ARG_ENABLE([64-bit], + [AS_HELP_STRING([--enable-64-bit], + [build 64-bit libraries @<:@default=auto@:>@])], + [enable_64bit="$enableval"], + [enable_64bit=auto] +) +if test "x$enable_64bit" = xyes; then + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -m64" + fi + if test "x$GXX" = xyes; then + CXXFLAGS="$CXXFLAGS -m64" + fi +fi + +dnl +dnl shared/static libraries, mimic libtool options +dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static], + [build static libraries @<:@default=disabled@:>@])], + [enable_static="$enableval"], + [enable_static=no] +) +case "x$enable_static" in +xyes|xno ) ;; +x ) enable_static=no ;; +* ) + AC_MSG_ERROR([Static library option '$enable_static' is not a valid]) + ;; +esac +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--disable-shared], + [build shared libraries @<:@default=enabled@:>@])], + [enable_shared="$enableval"], + [enable_shared=yes] +) +case "x$enable_shared" in +xyes|xno ) ;; +x ) enable_shared=yes ;; +* ) + AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid]) + ;; +esac + +dnl Can't have static and shared libraries, default to static if user +dnl explicitly requested. If both disabled, set to static since shared +dnl was explicitly requirested. +case "x$enable_static$enable_shared" in +xyesyes ) + AC_MSG_WARN([Can't build static and shared libraries, disabling shared]) + enable_shared=no + ;; +xnono ) + AC_MSG_WARN([Can't disable both static and shared libraries, enabling static]) + enable_static=yes + ;; +esac + +dnl +dnl mklib options +dnl +AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib]) +if test "$enable_static" = yes; then + MKLIB_OPTIONS="$MKLIB_OPTIONS -static" +fi +AC_SUBST([MKLIB_OPTIONS]) + +dnl +dnl other compiler options +dnl +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [use debug compiler flags and macros @<:@default=disabled@:>@])], + [enable_debug="$enableval"], + [enable_debug=no] +) +if test "x$enable_debug" = xyes; then + DEFINES="$DEFINES -DDEBUG" + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -g" + fi + if test "x$GXX" = xyes; then + CXXFLAGS="$CXXFLAGS -g" + fi +fi + +dnl +dnl library names +dnl +if test "$enable_static" = yes; then + GL_LIB_NAME='lib$(GL_LIB).a' + GLU_LIB_NAME='lib$(GLU_LIB).a' + GLUT_LIB_NAME='lib$(GLUT_LIB).a' + GLW_LIB_NAME='lib$(GLW_LIB).a' + OSMESA_LIB_NAME='lib$(OSMESA_LIB).a' +else + GL_LIB_NAME='lib$(GL_LIB).so' + GLU_LIB_NAME='lib$(GLU_LIB).so' + GLUT_LIB_NAME='lib$(GLUT_LIB).so' + GLW_LIB_NAME='lib$(GLW_LIB).so' + OSMESA_LIB_NAME='lib$(OSMESA_LIB).so' +fi +AC_SUBST([GL_LIB_NAME]) +AC_SUBST([GLU_LIB_NAME]) +AC_SUBST([GLUT_LIB_NAME]) +AC_SUBST([GLW_LIB_NAME]) +AC_SUBST([OSMESA_LIB_NAME]) + +dnl +dnl Arch/platform-specific settings +dnl +AC_ARG_ENABLE([asm], + [AS_HELP_STRING([--disable-asm], + [disable assembly usage @<:@default=enabled on supported plaforms@:>@])], + [enable_asm="$enableval"], + [enable_asm=yes] +) +asm_arch="" +ASM_FLAGS="" +ASM_SOURCES="" +ASM_API="" +AC_MSG_CHECKING([whether to enable assembly]) +test "x$enable_asm" = xno && AC_MSG_RESULT([no]) +# disable if cross compiling on x86/x86_64 since we must run gen_matypes +if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then + case "$host_cpu" in + i?86 | x86_64) + enable_asm=no + AC_MSG_RESULT([no, cross compiling]) + ;; + esac +fi +# check for supported arches +if test "x$enable_asm" = xyes; then + case "$host_cpu" in + i?86) + case "$host_os" in + linux* | *freebsd* | dragonfly*) + test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86 + ;; + esac + ;; + x86_64) + case "$host_os" in + linux* | *freebsd* | dragonfly*) + test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64 + ;; + esac + ;; + powerpc) + case "$host_os" in + linux*) + asm_arch=ppc + ;; + esac + ;; + esac + + case "$asm_arch" in + x86) + ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" + ASM_SOURCES='$(X86_SOURCES)' + ASM_API='$(X86_API)' + AC_MSG_RESULT([yes, x86]) + ;; + x86_64) + ASM_FLAGS="-DUSE_X86_64_ASM" + ASM_SOURCES='$(X86-64_SOURCES)' + ASM_API='$(X86-64_API)' + AC_MSG_RESULT([yes, x86_64]) + ;; + ppc) + ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM" + ASM_SOURCES='$(PPC_SOURCES)' + AC_MSG_RESULT([yes, ppc]) + ;; + *) + AC_MSG_RESULT([no, platform not supported]) + ;; + esac +fi +AC_SUBST([ASM_FLAGS]) +AC_SUBST([ASM_SOURCES]) +AC_SUBST([ASM_API]) + +dnl PIC code macro +MESA_PIC_FLAGS + +dnl Check to see if dlopen is in default libraries (like Solaris, which +dnl has it in libc), or if libdl is needed to get it. +AC_CHECK_FUNC([dlopen], [], + [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])]) + +dnl See if posix_memalign is available +AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"]) + +dnl SELinux awareness. +AC_ARG_ENABLE([selinux], + [AS_HELP_STRING([--enable-selinux], + [Build SELinux-aware Mesa @<:@default=disabled@:>@])], + [MESA_SELINUX="$enableval"], + [MESA_SELINUX=no]) +if test "x$enable_selinux" = "xyes"; then + AC_CHECK_HEADER([selinux/selinux.h],[], + [AC_MSG_ERROR([SELinux headers not found])]) + AC_CHECK_LIB([selinux],[is_selinux_enabled],[], + [AC_MSG_ERROR([SELinux library not found])]) + SELINUX_LIBS="-lselinux" + DEFINES="$DEFINES -DMESA_SELINUX" +fi + +dnl +dnl Driver configuration. Options are xlib, dri and osmesa right now. +dnl More later: directfb, fbdev, ... +dnl +default_driver="xlib" + +case "$host_os" in +linux*) + case "$host_cpu" in + i*86|x86_64|powerpc*|sparc*) default_driver="dri";; + esac + ;; +*freebsd* | dragonfly*) + case "$host_cpu" in + i*86|x86_64) default_driver="dri";; + esac + ;; +esac + +AC_ARG_WITH([driver], + [AS_HELP_STRING([--with-driver=DRIVER], + [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])], + [mesa_driver="$withval"], + [mesa_driver="$default_driver"]) +dnl Check for valid option +case "x$mesa_driver" in +xxlib|xdri|xosmesa) + ;; +*) + AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option]) + ;; +esac + +dnl +dnl Driver specific build directories +dnl +SRC_DIRS="mesa" +GLU_DIRS="sgi" +WINDOW_SYSTEM="" +case "$mesa_driver" in +xlib) + DRIVER_DIRS="x11" + ;; +dri) + SRC_DIRS="glx/x11 $SRC_DIRS" + DRIVER_DIRS="dri" + WINDOW_SYSTEM="dri" + ;; +osmesa) + DRIVER_DIRS="osmesa" + ;; +esac +AC_SUBST([SRC_DIRS]) +AC_SUBST([GLU_DIRS]) +AC_SUBST([DRIVER_DIRS]) +AC_SUBST([WINDOW_SYSTEM]) + +dnl +dnl User supplied program configuration +dnl +if test -d "$srcdir/progs/demos"; then + default_demos=yes +else + default_demos=no +fi +AC_ARG_WITH([demos], + [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@], + [optional comma delimited demo directories to build + @<:@default=auto if source available@:>@])], + [with_demos="$withval"], + [with_demos="$default_demos"]) +if test "x$with_demos" = x; then + with_demos=no +fi + +dnl If $with_demos is yes, directories will be added as libs available +PROGRAM_DIRS="" +case "$with_demos" in +no) ;; +yes) + # If the driver isn't osmesa, we have libGL and can build xdemos + if test "$mesa_driver" != osmesa; then + PROGRAM_DIRS="xdemos" + fi + ;; +*) + # verify the requested demos directories exist + demos=`IFS=,; echo $with_demos` + for demo in $demos; do + test -d "$srcdir/progs/$demo" || \ + AC_MSG_ERROR([Program directory '$demo' doesn't exist]) + done + PROGRAM_DIRS="$demos" + ;; +esac + +dnl +dnl Find out if X is available. The variable have_x is set if libX11 is +dnl found to mimic AC_PATH_XTRA. +dnl +if test -n "$PKG_CONFIG"; then + AC_MSG_CHECKING([pkg-config files for X11 are available]) + PKG_CHECK_EXISTS([x11],[ + x11_pkgconfig=yes + have_x=yes + ],[ + x11_pkgconfig=no + ]) + AC_MSG_RESULT([$x11_pkgconfig]) +else + x11_pkgconfig=no +fi +dnl Use the autoconf macro if no pkg-config files +if test "$x11_pkgconfig" = no; then + AC_PATH_XTRA +fi + +dnl Try to tell the user that the --x-* options are only used when +dnl pkg-config is not available. This must be right after AC_PATH_XTRA. +m4_divert_once([HELP_BEGIN], +[These options are only used when the X libraries cannot be found by the +pkg-config utility.]) + +dnl We need X for xlib and dri, so bomb now if it's not found +case "$mesa_driver" in +xlib|dri) + if test "$no_x" = yes; then + AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver]) + fi + ;; +esac + +dnl XCB - this is only used for GLX right now +AC_ARG_ENABLE([xcb], + [AS_HELP_STRING([--enable-xcb], + [use XCB for GLX @<:@default=disabled@:>@])], + [enable_xcb="$enableval"], + [enable_xcb=no]) +if test "x$enable_xcb" = xyes; then + DEFINES="$DEFINES -DUSE_XCB" +else + enable_xcb=no +fi + +dnl +dnl libGL configuration per driver +dnl +case "$mesa_driver" in +xlib) + if test "$x11_pkgconfig" = yes; then + PKG_CHECK_MODULES([XLIBGL], [x11 xext]) + GL_PC_REQ_PRIV="x11 xext" + X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" + GL_LIB_DEPS="$XLIBGL_LIBS" + else + # should check these... + X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" + GL_LIB_DEPS="$X_LIBS -lX11 -lXext" + GL_PC_LIB_PRIV="$GL_LIB_DEPS" + GL_PC_CFLAGS="$X11_INCLUDES" + fi + GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread" + GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread" + + # if static, move the external libraries to the programs + # and empty the libraries for libGL + if test "$enable_static" = yes; then + APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS" + GL_LIB_DEPS="" + fi + ;; +dri) + # DRI must be shared, I think + if test "$enable_static" = yes; then + AC_MSG_ERROR([Can't use static libraries for DRI drivers]) + fi + + # Check for libdrm + PKG_CHECK_MODULES([LIBDRM], [libdrm-poulsbo >= $LIBDRM_REQUIRED]) + PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) + GL_PC_REQ_PRIV="libdrm-poulsbo >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED" + DRI_PC_REQ_PRIV="libdrm-poulsbo >= $LIBDRM_REQUIRED" + + # find the DRI deps for libGL + if test "$x11_pkgconfig" = yes; then + # add xcb modules if necessary + dri_modules="x11 xext xxf86vm xdamage xfixes" + if test "$enable_xcb" = yes; then + dri_modules="$dri_modules x11-xcb xcb-glx" + fi + + PKG_CHECK_MODULES([DRIGL], [$dri_modules]) + GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" + X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" + GL_LIB_DEPS="$DRIGL_LIBS" + else + # should check these... + X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" + GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes" + GL_PC_LIB_PRIV="$GL_LIB_DEPS" + GL_PC_CFLAGS="$X11_INCLUDES" + + # XCB can only be used from pkg-config + if test "$enable_xcb" = yes; then + PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx]) + GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx" + X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS" + GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS" + fi + fi + + # need DRM libs, -lpthread, etc. + GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" + GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" + ;; +osmesa) + # No libGL for osmesa + GL_LIB_DEPS="" + ;; +esac +AC_SUBST([GL_LIB_DEPS]) +AC_SUBST([GL_PC_REQ_PRIV]) +AC_SUBST([GL_PC_LIB_PRIV]) +AC_SUBST([GL_PC_CFLAGS]) +AC_SUBST([DRI_PC_REQ_PRIV]) + +dnl +dnl More X11 setup +dnl +if test "$mesa_driver" = xlib; then + DEFINES="$DEFINES -DUSE_XSHM" +fi + +dnl +dnl More DRI setup +dnl +AC_ARG_ENABLE([glx-tls], + [AS_HELP_STRING([--enable-glx-tls], + [enable TLS support in GLX @<:@default=disabled@:>@])], + [GLX_USE_TLS="$enableval"], + [GLX_USE_TLS=no]) +dnl Directory for DRI drivers +AC_ARG_WITH([dri-driverdir], + [AS_HELP_STRING([--with-dri-driverdir=DIR], + [directory for the DRI drivers @<:@${libdir}/dri@:>@])], + [DRI_DRIVER_INSTALL_DIR="$withval"], + [DRI_DRIVER_INSTALL_DIR='${libdir}/dri']) +AC_SUBST([DRI_DRIVER_INSTALL_DIR]) +dnl Direct rendering or just indirect rendering +AC_ARG_ENABLE([driglx-direct], + [AS_HELP_STRING([--disable-driglx-direct], + [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])], + [driglx_direct="$enableval"], + [driglx_direct="yes"]) +dnl Which drivers to build - default is chosen by platform +AC_ARG_WITH([dri-drivers], + [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], + [comma delimited DRI drivers list, e.g. + "swrast,i965,radeon,nouveau" @<:@default=auto@:>@])], + [with_dri_drivers="$withval"], + [with_dri_drivers=yes]) +if test "x$with_dri_drivers" = x; then + with_dri_drivers=no +fi + +dnl If $with_dri_drivers is yes, directories will be added through +dnl platform checks +DRI_DIRS="" +case "$with_dri_drivers" in +no) ;; +yes) + DRI_DIRS="yes" + ;; +*) + # verify the requested driver directories exist + dri_drivers=`IFS=', '; echo $with_dri_drivers` + for driver in $dri_drivers; do + test -d "$srcdir/src/mesa/drivers/dri/$driver" || \ + AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist]) + done + DRI_DIRS="$dri_drivers" + ;; +esac + +dnl Just default to no EGL for now +USING_EGL=0 +AC_SUBST([USING_EGL]) + +dnl Set DRI_DIRS, DEFINES and LIB_DEPS +if test "$mesa_driver" = dri; then + # Use TLS in GLX? + if test "x$GLX_USE_TLS" = xyes; then + DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS" + fi + + if test "x$USING_EGL" = x1; then + PROGRAM_DIRS="egl" + fi + + # Platform specific settings and drivers to build + case "$host_os" in + linux*) + DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" + DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS" + if test "x$driglx_direct" = xyes; then + DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" + fi + + case "$host_cpu" in + x86_64) + # ffb, gamma, and sis are missing because they have not be + # converted to use the new interface. i810 are missing + # because there is no x86-64 system where they could *ever* + # be used. + if test "x$DRI_DIRS" = "xyes"; then + DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \ + savage tdfx unichrome swrast" + fi + ;; + powerpc*) + # Build only the drivers for cards that exist on PowerPC. + # At some point MGA will be added, but not yet. + if test "x$DRI_DIRS" = "xyes"; then + DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast" + fi + ;; + sparc*) + # Build only the drivers for cards that exist on sparc` + if test "x$DRI_DIRS" = "xyes"; then + DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast" + fi + ;; + esac + ;; + freebsd* | dragonfly*) + DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1" + DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" + DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" + if test "x$driglx_direct" = xyes; then + DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" + fi + if test "x$GXX" = xyes; then + CXXFLAGS="$CXXFLAGS -ansi -pedantic" + fi + + # ffb and gamma are missing because they have not been converted + # to use the new interface. + if test "x$DRI_DIRS" = "xyes"; then + DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \ + unichrome savage sis swrast" + fi + ;; + solaris*) + DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" + DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" + if test "x$driglx_direct" = xyes; then + DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" + fi + ;; + esac + + # default drivers + if test "x$DRI_DIRS" = "xyes"; then + DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ + savage sis tdfx trident unichrome ffb swrast" + fi + + DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'` + + # Check for expat + EXPAT_INCLUDES="" + EXPAT_LIB=-lexpat + AC_ARG_WITH([expat], + [AS_HELP_STRING([--with-expat=DIR], + [expat install directory])],[ + EXPAT_INCLUDES="-I$withval/include" + CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES" + LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR" + EXPAT_LIB="-L$withval/$LIB_DIR -lexpat" + ]) + AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])]) + AC_CHECK_LIB([expat],[XML_ParserCreate],[], + [AC_MSG_ERROR([Expat required for DRI.])]) + + # put all the necessary libs together + DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS" +fi +AC_SUBST([DRI_DIRS]) +AC_SUBST([EXPAT_INCLUDES]) +AC_SUBST([DRI_LIB_DEPS]) + +dnl +dnl OSMesa configuration +dnl +if test "$mesa_driver" = xlib; then + default_gl_osmesa=yes +else + default_gl_osmesa=no +fi +AC_ARG_ENABLE([gl-osmesa], + [AS_HELP_STRING([--enable-gl-osmesa], + [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])], + [gl_osmesa="$enableval"], + [gl_osmesa="$default_gl_osmesa"]) +if test "x$gl_osmesa" = xyes; then + if test "$mesa_driver" = osmesa; then + AC_MSG_ERROR([libGL is not available for OSMesa driver]) + else + DRIVER_DIRS="$DRIVER_DIRS osmesa" + fi +fi + +dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...) +AC_ARG_WITH([osmesa-bits], + [AS_HELP_STRING([--with-osmesa-bits=BITS], + [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])], + [osmesa_bits="$withval"], + [osmesa_bits=8]) +if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then + AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver]) + osmesa_bits=8 +fi +case "x$osmesa_bits" in +x8) + OSMESA_LIB=OSMesa + ;; +x16|x32) + OSMESA_LIB="OSMesa$osmesa_bits" + DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31" + ;; +*) + AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option]) + ;; +esac +AC_SUBST([OSMESA_LIB]) + +case "$mesa_driver" in +osmesa) + # only link libraries with osmesa if shared + if test "$enable_static" = no; then + OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS" + else + OSMESA_LIB_DEPS="" + fi + OSMESA_MESA_DEPS="" + OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS" + ;; +*) + # Link OSMesa to libGL otherwise + OSMESA_LIB_DEPS="" + # only link libraries with osmesa if shared + if test "$enable_static" = no; then + OSMESA_MESA_DEPS='-l$(GL_LIB)' + else + OSMESA_MESA_DEPS="" + fi + OSMESA_PC_REQ="gl" + ;; +esac +if test "$enable_static" = no; then + OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS" +fi +OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV" +AC_SUBST([OSMESA_LIB_DEPS]) +AC_SUBST([OSMESA_MESA_DEPS]) +AC_SUBST([OSMESA_PC_REQ]) +AC_SUBST([OSMESA_PC_LIB_PRIV]) + +dnl +dnl GLU configuration +dnl +AC_ARG_ENABLE([glu], + [AS_HELP_STRING([--disable-glu], + [enable OpenGL Utility library @<:@default=enabled@:>@])], + [enable_glu="$enableval"], + [enable_glu=yes]) +if test "x$enable_glu" = xyes; then + SRC_DIRS="$SRC_DIRS glu" + + case "$mesa_driver" in + osmesa) + # If GLU is available and we have libOSMesa (not 16 or 32), + # we can build the osdemos + if test "$with_demos" = yes && test "$osmesa_bits" = 8; then + PROGRAM_DIRS="$PROGRAM_DIRS osdemos" + fi + + # Link libGLU to libOSMesa instead of libGL + GLU_LIB_DEPS="" + GLU_PC_REQ="osmesa" + if test "$enable_static" = no; then + GLU_MESA_DEPS='-l$(OSMESA_LIB)' + else + GLU_MESA_DEPS="" + fi + ;; + *) + # If static, empty GLU_LIB_DEPS and add libs for programs to link + GLU_PC_REQ="gl" + GLU_PC_LIB_PRIV="-lm" + if test "$enable_static" = no; then + GLU_LIB_DEPS="-lm" + GLU_MESA_DEPS='-l$(GL_LIB)' + else + GLU_LIB_DEPS="" + GLU_MESA_DEPS="" + APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++" + fi + ;; + esac +fi +if test "$enable_static" = no; then + GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS" +fi +GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS" +AC_SUBST([GLU_LIB_DEPS]) +AC_SUBST([GLU_MESA_DEPS]) +AC_SUBST([GLU_PC_REQ]) +AC_SUBST([GLU_PC_REQ_PRIV]) +AC_SUBST([GLU_PC_LIB_PRIV]) +AC_SUBST([GLU_PC_CFLAGS]) + +dnl +dnl GLw configuration +dnl +AC_ARG_ENABLE([glw], + [AS_HELP_STRING([--disable-glw], + [enable Xt/Motif widget library @<:@default=enabled@:>@])], + [enable_glw="$enableval"], + [enable_glw=yes]) +dnl Don't build GLw on osmesa +if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then + AC_MSG_WARN([Disabling GLw since the driver is OSMesa]) + enable_glw=no +fi +AC_ARG_ENABLE([motif], + [AS_HELP_STRING([--enable-motif], + [use Motif widgets in GLw @<:@default=disabled@:>@])], + [enable_motif="$enableval"], + [enable_motif=no]) + +if test "x$enable_glw" = xyes; then + SRC_DIRS="$SRC_DIRS glw" + if test "$x11_pkgconfig" = yes; then + PKG_CHECK_MODULES([GLW],[x11 xt]) + GLW_PC_REQ_PRIV="x11 xt" + GLW_LIB_DEPS="$GLW_LIBS" + else + # should check these... + GLW_LIB_DEPS="$X_LIBS -lXt -lX11" + GLW_PC_LIB_PRIV="$GLW_LIB_DEPS" + GLW_PC_CFLAGS="$X11_INCLUDES" + fi + + GLW_SOURCES="GLwDrawA.c" + MOTIF_CFLAGS= + if test "x$enable_motif" = xyes; then + GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c" + AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no]) + if test "x$MOTIF_CONFIG" != xno; then + MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags` + MOTIF_LIBS=`$MOTIF_CONFIG --libs` + else + AC_CHECK_HEADER([Xm/PrimitiveP.h], [], + [AC_MSG_ERROR([Can't locate Motif headers])]) + AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"], + [AC_MSG_ERROR([Can't locate Motif Xm library])]) + fi + # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11 + GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS" + GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV" + GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS" + fi + + # If static, empty GLW_LIB_DEPS and add libs for programs to link + GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV" + if test "$enable_static" = no; then + GLW_MESA_DEPS='-l$(GL_LIB)' + GLW_LIB_DEPS="$GLW_LIB_DEPS" + else + APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS" + GLW_LIB_DEPS="" + GLW_MESA_DEPS="" + fi +fi +AC_SUBST([GLW_LIB_DEPS]) +AC_SUBST([GLW_MESA_DEPS]) +AC_SUBST([GLW_SOURCES]) +AC_SUBST([MOTIF_CFLAGS]) +AC_SUBST([GLW_PC_REQ_PRIV]) +AC_SUBST([GLW_PC_LIB_PRIV]) +AC_SUBST([GLW_PC_CFLAGS]) + +dnl +dnl GLUT configuration +dnl +if test -f "$srcdir/include/GL/glut.h"; then + default_glut=yes +else + default_glut=no +fi +AC_ARG_ENABLE([glut], + [AS_HELP_STRING([--disable-glut], + [enable GLUT library @<:@default=enabled if source available@:>@])], + [enable_glut="$enableval"], + [enable_glut="$default_glut"]) + +dnl Can't build glut if GLU not available +if test "x$enable_glu$enable_glut" = xnoyes; then + AC_MSG_WARN([Disabling glut since GLU is disabled]) + enable_glut=no +fi +dnl Don't build glut on osmesa +if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then + AC_MSG_WARN([Disabling glut since the driver is OSMesa]) + enable_glut=no +fi + +if test "x$enable_glut" = xyes; then + SRC_DIRS="$SRC_DIRS glut/glx" + GLUT_CFLAGS="" + if test "x$GCC" = xyes; then + GLUT_CFLAGS="-fexceptions" + fi + if test "$x11_pkgconfig" = yes; then + PKG_CHECK_MODULES([GLUT],[x11 xmu xi]) + GLUT_PC_REQ_PRIV="x11 xmu xi" + GLUT_LIB_DEPS="$GLUT_LIBS" + else + # should check these... + GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi" + GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS" + GLUT_PC_CFLAGS="$X11_INCLUDES" + fi + GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" + GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm" + + # If glut is available, we can build most programs + if test "$with_demos" = yes; then + PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl" + fi + + # If static, empty GLUT_LIB_DEPS and add libs for programs to link + if test "$enable_static" = no; then + GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)' + else + APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS" + GLUT_LIB_DEPS="" + GLUT_MESA_DEPS="" + fi +fi +AC_SUBST([GLUT_LIB_DEPS]) +AC_SUBST([GLUT_MESA_DEPS]) +AC_SUBST([GLUT_CFLAGS]) +AC_SUBST([GLUT_PC_REQ_PRIV]) +AC_SUBST([GLUT_PC_LIB_PRIV]) +AC_SUBST([GLUT_PC_CFLAGS]) + +dnl +dnl Program library dependencies +dnl Only libm is added here if necessary as the libraries should +dnl be pulled in by the linker +dnl +if test "x$APP_LIB_DEPS" = x; then + case "$host_os" in + solaris*) + APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm" + ;; + *) + APP_LIB_DEPS="-lm" + ;; + esac +fi +AC_SUBST([APP_LIB_DEPS]) +AC_SUBST([PROGRAM_DIRS]) + + +dnl Restore LDFLAGS and CPPFLAGS +LDFLAGS="$_SAVE_LDFLAGS" +CPPFLAGS="$_SAVE_CPPFLAGS" + +dnl Substitute the config +AC_CONFIG_FILES([configs/autoconf]) + +dnl Replace the configs/current symlink +AC_CONFIG_COMMANDS([configs],[ +if test -f configs/current || test -L configs/current; then + rm -f configs/current +fi +ln -s autoconf configs/current +]) + +AC_OUTPUT + +dnl +dnl Output some configuration info for the user +dnl +echo "" +echo " prefix: $prefix" +echo " exec_prefix: $exec_prefix" +echo " libdir: $libdir" +echo " includedir: $includedir" + +dnl Driver info +echo "" +echo " Driver: $mesa_driver" +if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then + echo " OSMesa: lib$OSMESA_LIB" +else + echo " OSMesa: no" +fi +if test "$mesa_driver" = dri; then + # cleanup the drivers var + dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'` +if test "x$DRI_DIRS" = x; then + echo " DRI drivers: no" +else + echo " DRI drivers: $dri_dirs" +fi + echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" +fi +echo " Use XCB: $enable_xcb" + +dnl Libraries +echo "" +echo " Shared libs: $enable_shared" +echo " Static libs: $enable_static" +echo " GLU: $enable_glu" +echo " GLw: $enable_glw (Motif: $enable_motif)" +echo " glut: $enable_glut" + +dnl Programs +# cleanup the programs var for display +program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'` +if test "x$program_dirs" = x; then + echo " Demos: no" +else + echo " Demos: $program_dirs" +fi + +dnl Compiler options +# cleanup the CFLAGS/CXXFLAGS/DEFINES vars +cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ + $SED 's/^ *//;s/ */ /;s/ *$//'` +cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ + $SED 's/^ *//;s/ */ /;s/ *$//'` +defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'` +echo "" +echo " CFLAGS: $cflags" +echo " CXXFLAGS: $cxxflags" +echo " Macros: $defines" + +echo "" +echo " Run '${MAKE-make}' to build Mesa" +echo "" diff -Nru xpsb-glx-0.19/mesa/descrip.mms xpsb-glx-0.19/mesa/descrip.mms --- xpsb-glx-0.19/mesa/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/descrip.mms 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,22 @@ +# Makefile for Mesa for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +macro : + @ macro="" +.ifdef NOSHARE +.else + @ if f$getsyi("HW_MODEL") .ge. 1024 then macro= "/MACRO=(SHARE=1)" +.endif + $(MMS)$(MMSQUALIFIERS)'macro' all + +all : + if f$search("lib.dir") .eqs. "" then create/directory [.lib] + set default [.src] + $(MMS)$(MMSQUALIFIERS) + set default [-.progs.util] + $(MMS)$(MMSQUALIFIERS) + set default [-.demos] + $(MMS)$(MMSQUALIFIERS) + set default [-.xdemos] + $(MMS)$(MMSQUALIFIERS) + if f$search("[-]tests.DIR") .nes. "" then pipe set default [-.tests] ; $(MMS)$(MMSQUALIFIERS) diff -Nru xpsb-glx-0.19/mesa/docs/autoconf.html xpsb-glx-0.19/mesa/docs/autoconf.html --- xpsb-glx-0.19/mesa/docs/autoconf.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/autoconf.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,289 @@ + + +Compilation and Installation using Autoconf + + + + + + +

Compilation and Installation using Autoconf

+ +
    +
  1. Basic Usage
  2. +
  3. Driver Options
  4. + +
  5. Library Options
  6. + +
  7. Demo Program Options
  8. +
+ + + +

1. Basic Usage

+ +

+The autoconf generated configure script can be used to guess your +platform and change various options for building Mesa. To use the +configure script, type: +

+ +
+    ./configure
+
+ +

+To see a short description of all the options, type ./configure +--help. If you are using a development snapshot and the configure +script does not exist, type ./autogen.sh to generate it +first. If you know the options you want to pass to +configure, you can pass them to autogen.sh. It +will run configure with these options after it is +generated. Once you have run configure and set the options +to your preference, type: +

+ +
+    make
+
+ +

+This will produce libGL.so and several other libraries depending on the +options you have chosen. Later, if you want to rebuild for a different +configuration run make realclean before rebuilding. +

+ +

+Some of the generic autoconf options are used with Mesa: + +

    +
  • --prefix=PREFIX - This is the root directory where +files will be installed by make install. The default is +/usr/local. +
  • +
  • --exec-prefix=EPREFIX - This is the root directory +where architecture-dependent files will be installed. In Mesa, this is +only used to derive the directory for the libraries. The default is +${prefix}. +
  • +
  • --libdir=LIBDIR - This option specifies the directory +where the GL libraries will be installed. The default is +${exec_prefix}/lib. It also serves as the name of the +library staging area in the source tree. For instance, if the option +--libdir=/usr/local/lib64 is used, the libraries will be +created in a lib64 directory at the top of the Mesa source +tree. +
  • +
  • --enable-static, --disable-shared - By default, Mesa +will build shared libraries. Either of these options will force static +libraries to be built. It is not currently possible to build static and +shared libraries in a single pass. +
  • +
  • CC, CFLAGS, CXX, CXXFLAGS - These environment variables +control the C and C++ compilers used during the build. By default, +gcc and g++ are used with the options +"-g -O2". +
  • +
  • LDFLAGS - An environment variable specifying flags to +pass when linking programs. These are normally empty, but can be used +to direct the linker to use libraries in nonstandard directories. For +example, LDFLAGS="-L/usr/X11R6/lib". +
  • +
  • PKG_CONFIG_PATH - When available, the +pkg-config utility is used to search for external libraries +on the system. This environment variable is used to control the search +path for pkg-config. For instance, setting +PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig will search for +package metadata in /usr/X11R6 before the standard +directories. +
  • +
+

+ +

+There are also a few general options for altering the Mesa build: +

    +
  • --with-x - When the X11 development libraries are +needed, the pkg-config utility will +be used for locating them. If they cannot be found through +pkg-config a fallback routing using imake will +be used. In this case, the --with-x, +--x-includes and --x-libraries options can +control the use of X for Mesa. +
  • +
  • --enable-gl-osmesa - The OSMesa +library can be built on top of libGL for drivers that provide it. +This option controls whether to build libOSMesa. By default, this is +enabled for the Xlib driver and disabled otherwise. Note that this +option is different than using OSMesa as the driver. +
  • +
  • --enable-debug - This option will enable compiler +options and macros to aid in debugging the Mesa libraries. +
  • +
  • --disable-asm - There are assembly routines +available for a few architectures. These will be used by default if +one of these architectures is detected. This option ensures that +assembly will not be used. +
  • +
  • --enable-32-bit, --enable-64-bit - By default, the +build will compile code as directed by the environment variables +CC, CFLAGS, etc. If the compiler is +gcc, these options offer a helper to add the compiler flags +to force 32- or 64-bit code generation as used on the x86 and x86_64 +architectures. +
  • +
+

+ + + +

2. Driver Options

+ +

+There are several different driver modes that Mesa can use. These are +described in more detail in the basic +installation instructions. The Mesa driver is controlled through the +configure option --with-driver. There are currently three supported +options in the configure script. +

+ + + + + +

3. Library Options

+ +

+The configure script provides more fine grained control over the GL +libraries that will be built. More details on the specific GL libraries +can be found in the basic installation +instructions. + +

+

+ + +
+

4. Demo Program Options

+ +

+There are many demonstration programs in the MesaDemos tarball. If the +programs are available when ./configure is run, a subset of +the programs will be built depending on the driver and library options +chosen. See the directory progs for the full set of demos. + +

    +
  • --with-demos=DEMOS,DEMOS,... - This option allows a +specific set of demo programs to be built. For example, +--with-demos="xdemos,slang". Beware that if this option is +used, it will not be ensured that the necessary GL libraries will be +available. +
  • +
  • --without-demos - This completely disables building the +demo programs. It is equivalent to --with-demos=no. +
  • +
+

+ + + diff -Nru xpsb-glx-0.19/mesa/docs/banner.html xpsb-glx-0.19/mesa/docs/banner.html --- xpsb-glx-0.19/mesa/docs/banner.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/banner.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,27 @@ + + + + Banner + + +
+ + + + + + + + +
+

+
The +Mesa 3D Graphics Library +

+
+


+

+
+ + diff -Nru xpsb-glx-0.19/mesa/docs/bugs.html xpsb-glx-0.19/mesa/docs/bugs.html --- xpsb-glx-0.19/mesa/docs/bugs.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/bugs.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,53 @@ + + +Mesa Bug Reporting + + + + + +

Bug Database

+ +

+The Mesa bug database is hosted on +freedesktop.org. +The old bug database on SourceForge is no longer used. +

+ +

+To file a Mesa bug, go to + +Bugzilla on freedesktop.org +

+ +

+Please follow these bug reporting guidelines: +

+ +
    +
  • Check if a new version of Mesa is available which might have fixed +the problem. +
  • Check if your bug is already reported in the database. +
  • Monitor your bug report for requests for additional information, etc. +
  • If you're reporting a crash, try to use your debugger (gdb) to get a stack +trace. Also, recompile Mesa in debug mode to get more detailed information. +
  • Describe in detail how to reproduce the bug, especially with games +and applications that the Mesa developers might not be familiar with. +
  • Provide a simple GLUT-based test program if possible +
+ +

+Bug reports will automatically be forwarded by bugzilla to the Mesa +developer's mailing list. +

+ +

+The easier a bug is to reproduce, the sooner it will be fixed. +Please do everything you can to facilitate quickly fixing bugs. +If your bug report is vague or your test program doesn't compile +easily, the problem may not be fixed very quickly. +

+ + + diff -Nru xpsb-glx-0.19/mesa/docs/cell.html xpsb-glx-0.19/mesa/docs/cell.html --- xpsb-glx-0.19/mesa/docs/cell.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/cell.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,149 @@ + + +Cell Driver + + + + + +

Mesa/Gallium Cell Driver

+ +

+The Mesa +Cell +driver is part of the +Gallium3D +architecture. +

+ +

+Tungsten Graphics +is leading the project. +Two phases are planned. +First, to implement the framework for parallel rasterization using the Cell +SPEs, including texture mapping. +Second, to implement a full-featured OpenGL driver with support for GLSL, etc. +The second phase is now underway. +

+ + +

Source Code

+ +

+The latest Cell driver source code is on the gallium-0.2 branch +of the Mesa git repository. +After you've cloned the repository, check out the branch with: +

+
+   git-checkout -b gallium-0.2 origin/gallium-0.2
+
+

+To build the driver you'll need the IBM Cell SDK (version 2.1 or 3.0). +To use the driver you'll need a Cell system, such as a PS3 running Linux, +or the Cell Simulator (untested, though). +

+ +

+If using Cell SDK 2.1, see the configs/linux-cell file for some +special changes. +

+ +

+To compile the code, run make linux-cell. +To build in debug mode, run make linux-cell-debug. +

+ +

+To use the library, make sure LD_LIBRARY_PATH points the Mesa/lib/ +directory that contains libGL.so. +

+ +

+Verify that the Cell driver is being used by running glxinfo +and looking for: +

+  OpenGL renderer string: Gallium 0.2, Cell on Xlib
+
+ + +

Driver Implementation Summary

+ +

+Rasterization is parallelized across the SPUs in a tiled-based manner. +Batches of transformed triangles are sent to the SPUs (actually, pulled by from +main memory by the SPUs). +Each SPU loops over a set of 32x32-pixel screen tiles, rendering the triangles +into each tile. +Because of the limited SPU memory, framebuffer tiles are paged in/out of +SPU local store as needed. +Similarly, textures are tiled and brought into local store as needed. +

+ + +

Status

+ +

+As of October 2008, the driver runs quite a few OpenGL demos. +Features that work include: +

+
    +
  • Point/line/triangle rendering, glDrawPixels +
  • 2D, NPOT and cube texture maps with nearest/linear/mipmap filtering +
  • Dynamic SPU code generation for fragment shaders, but not complete +
  • Dynamic SPU code generation for fragment ops (blend, Z-test, etc), but not complete +
  • Dynamic PPU/PPC code generation for vertex shaders, but not complete +
+

+Performance has recently improved with the addition of PPC code generation +for vertex shaders, but the code quality isn't too great yet. +

+

+Another bottleneck is SwapBuffers. It may be the limiting factor for +many simple GL tests. +

+ + + +

Debug Options

+ +

+The CELL_DEBUG env var can be set to a comma-separated list of one or +more of the following debug options: +

+
    +
  • checker - use a different background clear color for each SPU. + This lets you see which SPU is rendering which screen tiles. +
  • sync - wait/synchronize after each DMA transfer +
  • asm - print generated SPU assembly code to stdout +
  • fragops - emit fragment ops debug messages +
  • fragopfallback - don't use codegen for fragment ops +
  • cmd - print SPU commands as their received +
  • cache - print texture cache statistics when program exits +
+

+Note that some of these options may only work for linux-cell-debug builds. +

+ +

+If the GALLIUM_NOPPC env var is set, PPC code generation will not be used +and vertex shaders will be run with the TGSI interpreter. +

+

+If the GALLIUM_NOCELL env var is set, the softpipe driver will be used +intead of the Cell driver. +This is useful for comparison/validation. +

+ + + +

Contributing

+ +

+If you're interested in contributing to the effort, familiarize yourself +with the code, join the mesa3d-dev mailing list, +and describe what you'd like to do. +

+ + + + diff -Nru xpsb-glx-0.19/mesa/docs/conform.html xpsb-glx-0.19/mesa/docs/conform.html --- xpsb-glx-0.19/mesa/docs/conform.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/conform.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,695 @@ + + +Conformance + + + + + +

Conformance

+ +

+The SGI OpenGL conformance tests verify correct operation of OpenGL +implementations. I, Brian Paul, have been given a copy of the tests +for testing Mesa. The tests are not publically available. +

+

+This file has the latest results of testing Mesa with the OpenGL 1.2 +conformance tests. Testing with the preliminary OpenGL 1.3 tests has +also been done. Mesa passes all the 1.3 tests. +

+

+The tests were run using the software X11 device driver on 24-bpp +and 16-bpp displays. +

+

+Mesa 4.0 and later pass all conformance tests at all path levels. +Note that this says nothing about the conformance of hardware drivers +based upon Mesa. +

+ + +
+
+COVERAGE TESTS
+--------------
+
+Test that all API functions accept the legal parameters and reject
+illegal parameters.  The result of each test is either pass or fail.
+
+% covgl
+OpenGL Coverage Test.
+Version 1.2
+
+covgl passed.
+
+covgl passed at 1.1 level.
+
+covgl passed at 1.2 level.
+
+covgl passed for ARB_multitexture.
+
+
+% covglu
+OpenGL GLU Coverage Test.
+Version 1.3
+
+covglu passed.
+
+covglu passed at 1.1 level.
+
+
+% covglx
+OpenGL X Coverage Test.
+Version 1.1.1
+
+covglx passed.
+
+
+% primtest -v
+Open GL Primitives Test.
+Version 1.2
+
+[lots of output deleted]
+
+292159 Combinations.
+primtest passed.
+
+
+
+
+GL CONFORMANCE TEST
+===================
+
+Render test images, read them back, then test for expected results.
+
+
+----------------------------------------------------------------------
+% conform -v 2
+
+OpenGL Conformance Test
+Version 1.2
+
+Setup Report.
+    Verbose level = 2.
+    Random number seed = 1.
+    Path inactive.
+
+Visual Report.
+    Display ID = 35. Indirect Rendering.
+    Double Buffered.
+    RGBA (5, 6, 5, 0).
+    Stencil (8).
+    Depth (16).
+    Accumulation (16, 16, 16, 16).
+
+Epsilon Report.
+    zero error epsilon = 0.000122.
+    RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
+    Depth buffer error epsilon = 0.000137.
+    Stencil plane error epsilon = 0.00404.
+    Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
+
+Default State test passed.
+Must Pass test passed.
+Divide By Zero test passed.
+Viewport Clamp test passed.
+Matrix Stack test passed.
+Matrix Stack Mixing test passed.
+Vertex Order test passed.
+Transformations test passed.
+Transformation Normal test passed.
+Viewport Transformation test passed.
+Buffer Clear test passed.
+Buffer Corners test passed.
+Buffer Color test passed.
+Color Ramp test passed.
+Mask test passed.
+Buffer Invariance test passed.
+Accumulation Buffer test passed.
+Select test passed.
+Feedback test passed.
+Scissor test passed.
+Alpha Plane Function test passed.
+Stencil Plane Clear test passed.
+Stencil Plane Corners test passed.
+Stencil Plane Operation test passed.
+Stencil Plane Function test passed.
+Depth Buffer Clear test passed.
+Depth Buffer Function test passed.
+Blend test passed.
+Dither test passed.
+LogicOp Function test does not exist for an RGB visual.
+DrawPixels test passed.
+CopyPixels test passed.
+Bitmap Rasterization test passed.
+Point Rasterization test passed.
+Anti-aliased Point test passed.
+Line Rasterization test passed.
+Line Stipple test passed.
+Anti-aliased Line test passed.
+Horizontal and Vertical Line test passed.
+Triangle Rasterization test passed.
+Triangle Tile test passed.
+Triangle Stipple test passed.
+Anti-aliased Triangles test passed.
+Quad Rasterization test passed.
+Polygon Face test passed.
+Polygon Cull test passed.
+Polygon Stipple test passed.
+Polygon Edge test passed.
+Ambient Material test passed.
+Ambient Scene test passed.
+Attenuation Position test passed.
+Diffuse Light test passed.
+Diffuse Material test passed.
+Diffuse Material Normal test passed.
+Diffuse Material Positioning test passed.
+Emissive Material test passed.
+Specular Exponent test passed.
+Specular Exponent Normal test passed.
+Specular Local Eye Half Angle test passed.
+Specular Light test passed.
+Specular Material test passed.
+Specular Normal test passed.
+Spot Positioning test passed.
+Spot Exponent and Positioning test passed.
+Spot Exponent and Direction test passed.
+Fog Exponential test passed.
+Fog Linear test passed.
+Texture Decal test passed.
+Texture Border test passed.
+Mipmaps Selection test passed.
+Mipmaps Interpolation test passed.
+Display Lists test passed.
+Evaluator test passed.
+Evaluator Color test passed.
+Texture Edge Clamp test passed.
+Packed Pixels test passed.
+Texture LOD test passed.
+Rescale Normal test passed.
+Color Table test passed.
+Convolution test passed.
+Convolution Border test passed.
+Histogram test passed.
+MinMax test passed.
+MultiTexture test passed.
+
+Conform passed.
+
+----------------------------------------------------------------------
+% conform -v 2 -p 1
+
+OpenGL Conformance Test
+Version 1.2
+
+Setup Report.
+    Verbose level = 2.
+    Random number seed = 1.
+    Path level = 1.
+
+Visual Report.
+    Display ID = 35. Indirect Rendering.
+    Double Buffered.
+    RGBA (5, 6, 5, 0).
+    Stencil (8).
+    Depth (16).
+    Accumulation (16, 16, 16, 16).
+
+Epsilon Report.
+    zero error epsilon = 0.000122.
+    RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
+    Depth buffer error epsilon = 0.000137.
+    Stencil plane error epsilon = 0.00404.
+    Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
+
+Default State test passed.
+Must Pass test passed.
+Divide By Zero test passed.
+Viewport Clamp test passed.
+Matrix Stack test passed.
+Matrix Stack Mixing test passed.
+Vertex Order test passed.
+Transformations test passed.
+Transformation Normal test passed.
+Viewport Transformation test passed.
+Buffer Clear test passed.
+Buffer Corners test passed.
+Buffer Color test passed.
+Color Ramp test passed.
+Mask test passed.
+Buffer Invariance test passed.
+Accumulation Buffer test passed.
+Select test passed.
+Feedback test passed.
+Scissor test passed.
+Alpha Plane Function test passed.
+Stencil Plane Clear test passed.
+Stencil Plane Corners test passed.
+Stencil Plane Operation test passed.
+Stencil Plane Function test passed.
+Depth Buffer Clear test passed.
+Depth Buffer Function test passed.
+Blend test passed.
+Dither test passed.
+LogicOp Function test does not exist for an RGB visual.
+DrawPixels test passed.
+CopyPixels test passed.
+Bitmap Rasterization test passed.
+Point Rasterization test passed.
+Anti-aliased Point test passed.
+Line Rasterization test passed.
+Line Stipple test passed.
+Anti-aliased Line test passed.
+Horizontal and Vertical Line test passed.
+Triangle Rasterization test passed.
+Triangle Tile test passed.
+Triangle Stipple test passed.
+Anti-aliased Triangles test passed.
+Quad Rasterization test passed.
+Polygon Face test passed.
+Polygon Cull test passed.
+Polygon Stipple test passed.
+Polygon Edge test passed.
+Ambient Material test passed.
+Ambient Scene test passed.
+Attenuation Position test passed.
+Diffuse Light test passed.
+Diffuse Material test passed.
+Diffuse Material Normal test passed.
+Diffuse Material Positioning test passed.
+Emissive Material test passed.
+Specular Exponent test passed.
+Specular Exponent Normal test passed.
+Specular Local Eye Half Angle test passed.
+Specular Light test passed.
+Specular Material test passed.
+Specular Normal test passed.
+Spot Positioning test passed.
+Spot Exponent and Positioning test passed.
+Spot Exponent and Direction test passed.
+Fog Exponential test passed.
+Fog Linear test passed.
+Texture Decal test passed.
+Texture Border test passed.
+Mipmaps Selection test passed.
+Mipmaps Interpolation test passed.
+Display Lists test passed.
+Evaluator test passed.
+Evaluator Color test passed.
+Texture Edge Clamp test passed.
+Packed Pixels test passed.
+Texture LOD test passed.
+Rescale Normal test passed.
+Color Table test passed.
+Convolution test passed.
+Convolution Border test passed.
+Histogram test passed.
+MinMax test passed.
+MultiTexture test passed.
+
+Conform passed.
+
+----------------------------------------------------------------------
+% conform -v 2 -p 2
+
+OpenGL Conformance Test
+Version 1.2
+
+Setup Report.
+    Verbose level = 2.
+    Random number seed = 1.
+    Path level = 2.
+
+Visual Report.
+    Display ID = 35. Indirect Rendering.
+    Double Buffered.
+    RGBA (5, 6, 5, 0).
+    Stencil (8).
+    Depth (16).
+    Accumulation (16, 16, 16, 16).
+
+Epsilon Report.
+    zero error epsilon = 0.000122.
+    RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
+    Depth buffer error epsilon = 0.000137.
+    Stencil plane error epsilon = 0.00404.
+    Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
+
+Default State test passed.
+Must Pass test passed.
+Divide By Zero test passed.
+Viewport Clamp test passed.
+Matrix Stack test passed.
+Matrix Stack Mixing test passed.
+Vertex Order test passed.
+Transformations test passed.
+Transformation Normal test passed.
+Viewport Transformation test passed.
+Buffer Clear test passed.
+Buffer Corners test passed.
+Buffer Color test passed.
+Color Ramp test passed.
+Mask test passed.
+Buffer Invariance test passed.
+Accumulation Buffer test passed.
+Select test passed.
+Feedback test passed.
+Scissor test passed.
+Alpha Plane Function test passed.
+Stencil Plane Clear test passed.
+Stencil Plane Corners test passed.
+Stencil Plane Operation test passed.
+Stencil Plane Function test passed.
+Depth Buffer Clear test passed.
+Depth Buffer Function test passed.
+Blend test passed.
+Dither test passed.
+LogicOp Function test does not exist for an RGB visual.
+DrawPixels test passed.
+CopyPixels test passed.
+Bitmap Rasterization test passed.
+Point Rasterization test passed.
+Anti-aliased Point test passed.
+Line Rasterization test passed.
+Line Stipple test passed.
+Anti-aliased Line test passed.
+Horizontal and Vertical Line test passed.
+Triangle Rasterization test passed.
+Triangle Tile test passed.
+Triangle Stipple test passed.
+Anti-aliased Triangles test passed.
+Quad Rasterization test passed.
+Polygon Face test passed.
+Polygon Cull test passed.
+Polygon Stipple test passed.
+Polygon Edge test passed.
+Ambient Material test passed.
+Ambient Scene test passed.
+Attenuation Position test passed.
+Diffuse Light test passed.
+Diffuse Material test passed.
+Diffuse Material Normal test passed.
+Diffuse Material Positioning test passed.
+Emissive Material test passed.
+Specular Exponent test passed.
+Specular Exponent Normal test passed.
+Specular Local Eye Half Angle test passed.
+Specular Light test passed.
+Specular Material test passed.
+Specular Normal test passed.
+Spot Positioning test passed.
+Spot Exponent and Positioning test passed.
+Spot Exponent and Direction test passed.
+Fog Exponential test passed.
+Fog Linear test passed.
+Texture Decal test passed.
+Texture Border test passed.
+Mipmaps Selection test passed.
+Mipmaps Interpolation test passed.
+Display Lists test passed.
+Evaluator test passed.
+Evaluator Color test passed.
+Texture Edge Clamp test passed.
+Packed Pixels test passed.
+Texture LOD test passed.
+Rescale Normal test passed.
+Color Table test passed.
+Convolution test passed.
+Convolution Border test passed.
+Histogram test passed.
+MinMax test passed.
+MultiTexture test passed.
+
+Conform passed.
+
+----------------------------------------------------------------------
+% conform -v 2 -p 3
+
+OpenGL Conformance Test
+Version 1.2
+
+Setup Report.
+    Verbose level = 2.
+    Random number seed = 1.
+    Path level = 3.
+
+Visual Report.
+    Display ID = 35. Indirect Rendering.
+    Double Buffered.
+    RGBA (5, 6, 5, 0).
+    Stencil (8).
+    Depth (16).
+    Accumulation (16, 16, 16, 16).
+
+Epsilon Report.
+    zero error epsilon = 0.000122.
+    RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
+    Depth buffer error epsilon = 0.000137.
+    Stencil plane error epsilon = 0.00404.
+    Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
+
+Default State test passed.
+Must Pass test passed.
+Divide By Zero test passed.
+Viewport Clamp test passed.
+Matrix Stack test passed.
+Matrix Stack Mixing test passed.
+Vertex Order test passed.
+Transformations test passed.
+Transformation Normal test passed.
+Viewport Transformation test passed.
+Buffer Clear test passed.
+Buffer Corners test passed.
+Buffer Color test passed.
+Color Ramp test passed.
+Mask test passed.
+Buffer Invariance test passed.
+Accumulation Buffer test passed.
+Select test passed.
+Feedback test passed.
+Scissor test passed.
+Alpha Plane Function test passed.
+Stencil Plane Clear test passed.
+Stencil Plane Corners test passed.
+Stencil Plane Operation test passed.
+Stencil Plane Function test passed.
+Depth Buffer Clear test passed.
+Depth Buffer Function test passed.
+Blend test passed.
+Dither test passed.
+LogicOp Function test does not exist for an RGB visual.
+DrawPixels test passed.
+CopyPixels test passed.
+Bitmap Rasterization test passed.
+Point Rasterization test passed.
+Anti-aliased Point test passed.
+Line Rasterization test passed.
+Line Stipple test passed.
+Anti-aliased Line test passed.
+Horizontal and Vertical Line test passed.
+Triangle Rasterization test passed.
+Triangle Tile test passed.
+Triangle Stipple test passed.
+Anti-aliased Triangles test passed.
+Quad Rasterization test passed.
+Polygon Face test passed.
+Polygon Cull test passed.
+Polygon Stipple test passed.
+Polygon Edge test passed.
+Ambient Material test passed.
+Ambient Scene test passed.
+Attenuation Position test passed.
+Diffuse Light test passed.
+Diffuse Material test passed.
+Diffuse Material Normal test passed.
+Diffuse Material Positioning test passed.
+Emissive Material test passed.
+Specular Exponent test passed.
+Specular Exponent Normal test passed.
+Specular Local Eye Half Angle test passed.
+Specular Light test passed.
+Specular Material test passed.
+Specular Normal test passed.
+Spot Positioning test passed.
+Spot Exponent and Positioning test passed.
+Spot Exponent and Direction test passed.
+Fog Exponential test passed.
+Fog Linear test passed.
+Texture Decal test passed.
+Texture Border test passed.
+Mipmaps Selection test passed.
+Mipmaps Interpolation test passed.
+Display Lists test passed.
+Evaluator test passed.
+Evaluator Color test passed.
+Texture Edge Clamp test passed.
+Packed Pixels test passed.
+Texture LOD test passed.
+Rescale Normal test passed.
+Color Table test passed.
+Convolution test passed.
+Convolution Border test passed.
+Histogram test passed.
+MinMax test passed.
+MultiTexture test passed.
+
+Conform passed.
+
+----------------------------------------------------------------------
+% conform -v 2 -p 4
+
+OpenGL Conformance Test
+Version 1.2
+
+Setup Report.
+    Verbose level = 2.
+    Random number seed = 1.
+    Path level = 4.
+
+Visual Report.
+    Display ID = 35. Indirect Rendering.
+    Double Buffered.
+    RGBA (5, 6, 5, 0).
+    Stencil (8).
+    Depth (16).
+    Accumulation (16, 16, 16, 16).
+
+Epsilon Report.
+    zero error epsilon = 0.000122.
+    RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
+    Depth buffer error epsilon = 0.000137.
+    Stencil plane error epsilon = 0.00404.
+    Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
+
+Default State test passed.
+Must Pass test passed.
+Divide By Zero test passed.
+Viewport Clamp test passed.
+Matrix Stack test passed.
+Matrix Stack Mixing test passed.
+Vertex Order test passed.
+Transformations test passed.
+Transformation Normal test passed.
+Viewport Transformation test passed.
+Buffer Clear test passed.
+Buffer Corners test passed.
+Buffer Color test passed.
+Color Ramp test passed.
+Mask test passed.
+Buffer Invariance test passed.
+Accumulation Buffer test passed.
+Select test passed.
+Feedback test passed.
+Scissor test passed.
+Alpha Plane Function test passed.
+Stencil Plane Clear test passed.
+Stencil Plane Corners test passed.
+Stencil Plane Operation test passed.
+Stencil Plane Function test passed.
+Depth Buffer Clear test passed.
+Depth Buffer Function test passed.
+Blend test passed.
+Dither test passed.
+LogicOp Function test does not exist for an RGB visual.
+DrawPixels test passed.
+CopyPixels test passed.
+Bitmap Rasterization test passed.
+Point Rasterization test passed.
+Anti-aliased Point test passed.
+Line Rasterization test passed.
+Line Stipple test passed.
+Anti-aliased Line test passed.
+Horizontal and Vertical Line test passed.
+Triangle Rasterization test passed.
+Triangle Tile test passed.
+Triangle Stipple test passed.
+Anti-aliased Triangles test passed.
+Quad Rasterization test passed.
+Polygon Face test passed.
+Polygon Cull test passed.
+Polygon Stipple test passed.
+Polygon Edge test passed.
+Ambient Material test passed.
+Ambient Scene test passed.
+Attenuation Position test passed.
+Diffuse Light test passed.
+Diffuse Material test passed.
+Diffuse Material Normal test passed.
+Diffuse Material Positioning test passed.
+Emissive Material test passed.
+Specular Exponent test passed.
+Specular Exponent Normal test passed.
+Specular Local Eye Half Angle test passed.
+Specular Light test passed.
+Specular Material test passed.
+Specular Normal test passed.
+Spot Positioning test passed.
+Spot Exponent and Positioning test passed.
+Spot Exponent and Direction test passed.
+Fog Exponential test passed.
+Fog Linear test passed.
+Texture Decal test passed.
+Texture Border test passed.
+Mipmaps Selection test passed.
+Mipmaps Interpolation test passed.
+Display Lists test passed.
+Evaluator test passed.
+Evaluator Color test passed.
+Texture Edge Clamp test passed.
+Packed Pixels test passed.
+Texture LOD test passed.
+Rescale Normal test passed.
+Color Table test passed.
+Convolution test passed.
+Convolution Border test passed.
+Histogram test passed.
+MinMax test passed.
+MultiTexture test passed.
+
+Conform passed.
+
+
+
+GLX CONFORMANCE TEST
+====================
+
+% conformx -v 2
+
+OpenGL X Conformance Test
+Version 1.1.1
+
+Setup Report.
+    Verbose level = 2.
+    Random number seed = 1.
+    Path inactive.
+
+Visual Report.
+    Display ID = 34. Direct Rendering.
+    Double Buffered.
+    RGBA (8, 8, 8, 0).
+    Stencil (8).
+    Depth (16).
+    Accumulation (16, 16, 16, 16).
+
+Epsilon Report.
+    zero error epsilon = 0.000122.
+    RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122.
+    Depth buffer error epsilon = 0.000137.
+    Stencil plane error epsilon = 0.00404.
+    Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
+
+Default State test passed.
+glReadPixels() test passed.
+Font test passed.
+
+Conformx passed.
+
+
+
+ +NOTE: conformx passes for all machine path levels (-p option). + + + + diff -Nru xpsb-glx-0.19/mesa/docs/contents.html xpsb-glx-0.19/mesa/docs/contents.html --- xpsb-glx-0.19/mesa/docs/contents.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/contents.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,104 @@ + + +Contents + + + + + + + +Documentation + + +Download / Install + + +Resources + + +User Topics + + +Developer Topics + + +Links + + +Hosted by: +
+
+Sourceforge.net +
+ + + diff -Nru xpsb-glx-0.19/mesa/docs/COPYING xpsb-glx-0.19/mesa/docs/COPYING --- xpsb-glx-0.19/mesa/docs/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/COPYING 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,490 @@ + +Some parts of Mesa are copyrighted under the GNU LGPL. See the +Mesa/docs/COPYRIGHT file for details. + +The following is the standard GNU copyright file. +---------------------------------------------------------------------- + + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff -Nru xpsb-glx-0.19/mesa/docs/debugging.html xpsb-glx-0.19/mesa/docs/debugging.html --- xpsb-glx-0.19/mesa/docs/debugging.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/debugging.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,38 @@ + + +Debugging Tips + + + + + +

Debugging Tips

+ +

+ Normally Mesa (and OpenGL) records but does not notify the user of + errors. It is up to the application to call + glGetError to check for errors. Mesa supports an + environment variable, MESA_DEBUG, to help with debugging. If + MESA_DEBUG is defined, a message will be printed to stdout whenever + an error occurs. +

+ +

+ More extensive error checking is done when Mesa is compiled with the + DEBUG symbol defined. You'll have to edit the Make-config file and + add -DDEBUG to the CFLAGS line for your system configuration. You may + also want to replace any optimization flags with the -g flag so you can + use your debugger. After you've edited Make-config type 'make clean' + before recompiling. +

+

+ In your debugger you can set a breakpoint in _mesa_error() to trap Mesa + errors. +

+

+ There is a display list printing/debugging facility. See the end of + src/dlist.c for details. +

+ + + diff -Nru xpsb-glx-0.19/mesa/docs/demos.html xpsb-glx-0.19/mesa/docs/demos.html --- xpsb-glx-0.19/mesa/docs/demos.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/demos.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,18 @@ + + +Demos + + + + + +

Demos

+ + + + + + + \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/docs/developers.html xpsb-glx-0.19/mesa/docs/developers.html --- xpsb-glx-0.19/mesa/docs/developers.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/developers.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,51 @@ + + +Developers + + + + + +

Developers

+ +

+Both professional and volunteer developers contribute to Mesa. +

+

+Tungsten Graphics +employs several of the main Mesa developers including Brian Paul +and Keith Whitwell. +Much of the on-going work in Mesa is done through Tungsten Graphics engineering +contracts. +Prominent examples of this work includes: +

+
    +
  • DRI drivers for Intel i965, i945, i915 and other chips +
  • Advanced memory manager and framebuffer object support +
  • Shading language compiler and OpenGL 2.0 support +
  • MiniGLX environment +
+ +

+Other companies including +Intel +and IBM also actively contribute to the project. +

+ +

+Volunteers have made significant contributions to all parts of Mesa, including +complete device drivers. +

+ + +

Custom Development

+

+Contact +Tungsten Graphics +for information about custom development in Mesa, OpenGL, X and other +graphics technologies. +

+ + + + diff -Nru xpsb-glx-0.19/mesa/docs/devinfo.html xpsb-glx-0.19/mesa/docs/devinfo.html --- xpsb-glx-0.19/mesa/docs/devinfo.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/devinfo.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,210 @@ + + +Development Notes + + + + + +

Development Notes

+ + +

Adding Extentions

+ +

+To add a new GL extension to Mesa you have to do at least the following. + +

    +
  • + If glext.h doesn't define the extension, edit include/GL/gl.h and add + code like this: +
    +     #ifndef GL_EXT_the_extension_name
    +     #define GL_EXT_the_extension_name 1
    +     /* declare the new enum tokens */
    +     /* prototype the new functions */
    +     /* TYPEDEFS for the new functions */
    +     #endif
    +   
    +
  • +
  • + In the src/mesa/glapi/ directory, add the new extension functions and + enums to the gl_API.xml file. + Then, a bunch of source files must be regenerated by executing the + corresponding Python scripts. +
  • +
  • + Add a new entry to the gl_extensions struct in mtypes.h +
  • +
  • + Update the extensions.c file. +
  • +
  • + From this point, the best way to proceed is to find another extension, + similar to the new one, that's already implemented in Mesa and use it + as an example. +
  • +
  • + If the new extension adds new GL state, the functions in get.c, enable.c + and attrib.c will most likely require new code. +
  • +
+ + + +

Coding Style

+ +

+Mesa's code style has changed over the years. Here's the latest. +

+ +

+Comment your code! It's extremely important that open-source code be +well documented. Also, strive to write clean, easily understandable code. +

+ +

+3-space indentation +

+ +

+If you use tabs, set them to 8 columns +

+ +

+Brace example: +

+
+	if (condition) {
+	   foo;
+	}
+	else {
+	   bar;
+	}
+
+ +

+Here's the GNU indent command which will best approximate my preferred style: +

+
+	indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
+
+ + +

+Local variable name example: localVarName (no underscores) +

+ +

+Constants and macros are ALL_UPPERCASE, with _ between words +

+ +

+Global variables are not allowed. +

+ +

+Function name examples: +

+
+	glFooBar()       - a public GL entry point (in dispatch.c)
+	_mesa_FooBar()   - the internal immediate mode function
+	save_FooBar()    - retained mode (display list) function in dlist.c
+	foo_bar()        - a static (private) function
+	_mesa_foo_bar()  - an internal non-static Mesa function
+
+ + +

Making a New Mesa Release

+ +

+These are the instructions for making a new Mesa release. +

+ +

Get latest source files

+

+Use "cvs update -dAP " to get the latest Mesa files from CVS. +

+ + +

Verify and update version info

+

+Create/edit the docs/RELNOTES-X.Y file to document what's new in the release. +Add the new RELNOTES-X.Y file to relnotes.html. +Update the docs/VERSIONS file too. +

+ +

+Edit the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in +configs/default. +

+ +

+Make sure the values in src/mesa/main/version.h are correct. +

+ +

+Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and +DEMO_NAME are correct. +

+ +

+Update the docs/news.html file and docs/download.html files. +

+ +

+Check in all updates to CVS. +

+ +

+Tag the CVS files with the release name (in the form mesa_X_Y). +

+ + +

Make the tarballs

+

+Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example, +ln -s Mesa Mesa-6.3 +This is needed in order to make a correct tar file in the next step. +

+ +

+Make the distribution files. From inside the Mesa directory: +

+	make tarballs
+
+ +

+After the tarballs are created, the md5 checksums for the files will +be computed. +Add them to the docs/news.html file. +

+ +

+Copy the distribution files to a temporary directory, unpack them, +compile everything, and run some demos to be sure everything works. +

+ +

Update the website and announce the release

+

+Follow the directions on SourceForge for creating a new "release" and +uploading the tarballs. +

+ +

+Update the web site by copying the docs/ directory's files to +/home/users/b/br/brianp/mesa-www/htdocs/ +

+ +

+Make an announcement on the mailing lists: +mesa3d-dev@lists.sf.net, +mesa3d-users@lists.sf.net +and +mesa3d-announce@lists.sf.net +

+ + + + + diff -Nru xpsb-glx-0.19/mesa/docs/dispatch.html xpsb-glx-0.19/mesa/docs/dispatch.html --- xpsb-glx-0.19/mesa/docs/dispatch.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/dispatch.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,274 @@ + + +GL Dispatch in Mesa + + + + +

GL Dispatch in Mesa

+ +

Several factors combine to make efficient dispatch of OpenGL functions +fairly complicated. This document attempts to explain some of the issues +and introduce the reader to Mesa's implementation. Readers already familiar +with the issues around GL dispatch can safely skip ahead to the overview of Mesa's implementation.

+ +

1. Complexity of GL Dispatch

+ +

Every GL application has at least one object called a GL context. +This object, which is an implicit parameter to ever GL function, stores all +of the GL related state for the application. Every texture, every buffer +object, every enable, and much, much more is stored in the context. Since +an application can have more than one context, the context to be used is +selected by a window-system dependent function such as +glXMakeContextCurrent.

+ +

In environments that implement OpenGL with X-Windows using GLX, every GL +function, including the pointers returned by glXGetProcAddress, are +context independent. This means that no matter what context is +currently active, the same glVertex3fv function is used.

+ +

This creates the first bit of dispatch complexity. An application can +have two GL contexts. One context is a direct rendering context where +function calls are routed directly to a driver loaded within the +application's address space. The other context is an indirect rendering +context where function calls are converted to GLX protocol and sent to a +server. The same glVertex3fv has to do the right thing depending +on which context is current.

+ +

Highly optimized drivers or GLX protocol implementations may want to +change the behavior of GL functions depending on current state. For +example, glFogCoordf may operate differently depending on whether +or not fog is enabled.

+ +

In multi-threaded environments, it is possible for each thread to have a +differnt GL context current. This means that poor old glVertex3fv +has to know which GL context is current in the thread where it is being +called.

+ + +

2. Overview of Mesa's Implementation

+ +

Mesa uses two per-thread pointers. The first pointer stores the address +of the context current in the thread, and the second pointer stores the +address of the dispatch table associated with that context. The +dispatch table stores pointers to functions that actually implement +specific GL functions. Each time a new context is made current in a thread, +these pointers a updated.

+ +

The implementation of functions such as glVertex3fv becomes +conceptually simple:

+ +
    +
  • Fetch the current dispatch table pointer.
  • +
  • Fetch the pointer to the real glVertex3fv function from the +table.
  • +
  • Call the real function.
  • +
+ +

This can be implemented in just a few lines of C code. The file +src/mesa/glapi/glapitemp.h contains code very similar to this.

+ +
+ + +
+void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
+{
+    const struct _glapi_table * const dispatch = GET_DISPATCH();
+    
+    (*dispatch->Vertex3f)(x, y, z);
+}
Sample dispatch function
+
+ +

The problem with this simple implementation is the large amount of +overhead that it adds to every GL function call.

+ +

In a multithreaded environment, a niave implementation of +GET_DISPATCH involves a call to pthread_getspecific or a +similar function. Mesa provides a wrapper function called +_glapi_get_dispatch that is used by default.

+ +

3. Optimizations

+ +

A number of optimizations have been made over the years to diminish the +performance hit imposed by GL dispatch. This section describes these +optimizations. The benefits of each optimization and the situations where +each can or cannot be used are listed.

+ +

3.1. Dual dispatch table pointers

+ +

The vast majority of OpenGL applications use the API in a single threaded +manner. That is, the application has only one thread that makes calls into +the GL. In these cases, not only do the calls to +pthread_getspecific hurt performance, but they are completely +unnecessary! It is possible to detect this common case and avoid these +calls.

+ +

Each time a new dispatch table is set, Mesa examines and records the ID +of the executing thread. If the same thread ID is always seen, Mesa knows +that the application is, from OpenGL's point of view, single threaded.

+ +

As long as an application is single threaded, Mesa stores a pointer to +the dispatch table in a global variable called _glapi_Dispatch. +The pointer is also stored in a per-thread location via +pthread_setspecific. When Mesa detects that an application has +become multithreaded, NULL is stored in _glapi_Dispatch.

+ +

Using this simple mechanism the dispatch functions can detect the +multithreaded case by comparing _glapi_Dispatch to NULL. +The resulting implementation of GET_DISPATCH is slightly more +complex, but it avoids the expensive pthread_getspecific call in +the common case.

+ +
+ + +
+#define GET_DISPATCH() \
+    (_glapi_Dispatch != NULL) \
+        ? _glapi_Dispatch : pthread_getspecific(&_glapi_Dispatch_key)
+
Improved GET_DISPATCH Implementation
+
+ +

3.2. ELF TLS

+ +

Starting with the 2.4.20 Linux kernel, each thread is allocated an area +of per-thread, global storage. Variables can be put in this area using some +extensions to GCC. By storing the dispatch table pointer in this area, the +expensive call to pthread_getspecific and the test of +_glapi_Dispatch can be avoided.

+ +

The dispatch table pointer is stored in a new variable called +_glapi_tls_Dispatch. A new variable name is used so that a single +libGL can implement both interfaces. This allows the libGL to operate with +direct rendering drivers that use either interface. Once the pointer is +properly declared, GET_DISPACH becomes a simple variable +reference.

+ +
+ + +
+extern __thread struct _glapi_table *_glapi_tls_Dispatch
+    __attribute__((tls_model("initial-exec")));
+
+#define GET_DISPATCH() _glapi_tls_Dispatch
+
TLS GET_DISPATCH Implementation
+
+ +

Use of this path is controlled by the preprocessor define +GLX_USE_TLS. Any platform capable of using TLS should use this as +the default dispatch method.

+ +

3.3. Assembly Language Dispatch Stubs

+ +

Many platforms has difficulty properly optimizing the tail-call in the +dispatch stubs. Platforms like x86 that pass parameters on the stack seem +to have even more difficulty optimizing these routines. All of the dispatch +routines are very short, and it is trivial to create optimal assembly +language versions. The amount of optimization provided by using assembly +stubs varies from platform to platform and application to application. +However, by using the assembly stubs, many platforms can use an additional +space optimization (see below).

+ +

The biggest hurdle to creating assembly stubs is handling the various +ways that the dispatch table pointer can be accessed. There are four +different methods that can be used:

+ +
    +
  1. Using _glapi_Dispatch directly in builds for non-multithreaded +environments.
  2. +
  3. Using _glapi_Dispatch and _glapi_get_dispatch in +multithreaded environments.
  4. +
  5. Using _glapi_Dispatch and pthread_getspecific in +multithreaded environments.
  6. +
  7. Using _glapi_tls_Dispatch directly in TLS enabled +multithreaded environments.
  8. +
+ +

People wishing to implement assembly stubs for new platforms should focus +on #4 if the new platform supports TLS. Otherwise, implement #2 followed by +#3. Environments that do not support multithreading are uncommon and not +terribly relevant.

+ +

Selection of the dispatch table pointer access method is controlled by a +few preprocessor defines.

+ +
    +
  • If GLX_USE_TLS is defined, method #4 is used.
  • +
  • If PTHREADS is defined, method #3 is used.
  • +
  • If any of PTHREADS, USE_XTHREADS, +SOLARIS_THREADS, WIN32_THREADS, or BEOS_THREADS +is defined, method #2 is used.
  • +
  • If none of the preceeding are defined, method #1 is used.
  • +
+ +

Two different techniques are used to handle the various different cases. +On x86 and SPARC, a macro called GL_STUB is used. In the preamble +of the assembly source file different implementations of the macro are +selected based on the defined preprocessor variables. The assmebly code +then consists of a series of invocations of the macros such as: + +

+ + +
+GL_STUB(Color3fv, _gloffset_Color3fv)
+
SPARC Assembly Implementation of glColor3fv
+
+ +

The benefit of this technique is that changes to the calling pattern +(i.e., addition of a new dispatch table pointer access method) require fewer +changed lines in the assembly code.

+ +

However, this technique can only be used on platforms where the function +implementation does not change based on the parameters passed to the +function. For example, since x86 passes all parameters on the stack, no +additional code is needed to save and restore function parameters around a +call to pthread_getspecific. Since x86-64 passes parameters in +registers, varying amounts of code needs to be inserted around the call to +pthread_getspecific to save and restore the GL function's +parameters.

+ +

The other technique, used by platforms like x86-64 that cannot use the +first technique, is to insert #ifdef within the assembly +implementation of each function. This makes the assembly file considerably +larger (e.g., 29,332 lines for glapi_x86-64.S versus 1,155 lines for +glapi_x86.S) and causes simple changes to the function +implementation to generate many lines of diffs. Since the assmebly files +are typically generated by scripts (see below), this +isn't a significant problem.

+ +

Once a new assembly file is created, it must be inserted in the build +system. There are two steps to this. The file must first be added to +src/mesa/sources. That gets the file built and linked. The second +step is to add the correct #ifdef magic to +src/mesa/main/dispatch.c to prevent the C version of the dispatch +functions from being built.

+ + +

3.4. Fixed-Length Dispatch Stubs

+ +

To implement glXGetProcAddress, Mesa stores a table that +associates function names with pointers to those functions. This table is +stored in src/mesa/glapi/glprocs.h. For different reasons on +different platforms, storing all of those pointers is inefficient. On most +platforms, including all known platforms that support TLS, we can avoid this +added overhead.

+ +

If the assembly stubs are all the same size, the pointer need not be +stored for every function. The location of the function can instead be +calculated by multiplying the size of the dispatch stub by the offset of the +function in the table. This value is then added to the address of the first +dispatch stub.

+ +

This path is activated by adding the correct #ifdef magic to +src/mesa/glapi/glapi.c just before glprocs.h is +included.

+ +
+

4. Automatic Generation of Dispatch Stubs

+ + + diff -Nru xpsb-glx-0.19/mesa/docs/download.html xpsb-glx-0.19/mesa/docs/download.html --- xpsb-glx-0.19/mesa/docs/download.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/download.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,142 @@ + + +Getting Mesa + + + + + +

Downloading

+ +

+Current stable release: 7.4 +
+Last unstable/development release: 7.3 +

+ +

+Primary download site: +SourceForge +

+ +

+When a new release is coming, release candidates (betas) can be found +here. +

+ + +

+Mesa is distributed in several parts: +

+
    +
  • MesaLib-x.y.z - the main Mesa library source code, drivers + and documentation. +
  • +
  • MesaDemos-x.y.z - OpenGL demonstration and test programs. + Most of the programs require GLUT (either the + original GLUT by Mark Kilgard or + freeglut or + OpenGLUT). +
  • +
  • MesaGLUT-x.y.z - Mark Kilgard's GLUT, easily compiled and used + with Mesa. Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc. +
  • +
+ +

+If you're not interested in running the demos, you'll only need the first +package. +

+ +

+If you're new to this and not sure what you're doing, grab all three packages. +

+ +

+The packages are available in .tar.gz, .tar.bz2 and .zip formats. +Other sites might offer additional package formats. +

+ +

Unpacking

+ +

+All the packages should be in the same directory prior to unpacking. +

+ +
    +
  • To unpack .tar.gz files: +
    +	tar zxf MesaLib-X.Y.tar.gz
    +	tar zxf MesaDemos-X.Y.tar.gz
    +	tar zxf MesaGLUT-X.Y.tar.gz
    +
    +or +
    +	gzcat MesaLib-X.Y.tar.gz | tar xf -
    +	gzcat MesaDemos-X.Y.tar.gz | tar xf -
    +	gzcat MesaGLUT-X.Y.tar.gz | tar xf -
    +
    +or +
    +	gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
    +	gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar
    +	gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar
    +
    +
  • To unpack .tar.bz2 files: +
    +	bunzip2 -c MesaLib-X.Y.tar.gz | tar xf -
    +	bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf -
    +	bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf -
    +
    +
  • To unpack .zip files: +
    +	unzip MesaLib-X.Y.zip
    +	unzip MesaDemos-X.Y.zip
    +	unzip MesaGLUT-X.Y.zip
    +
    +
+ + +

Contents

+ +

+After unpacking you'll have these files and directories (among others): +

+
+Makefile	- top-level Makefile for most systems
+configs/	- makefile parameter files for various systems
+include/	- GL header (include) files
+bin/		- shell scripts for making shared libraries, etc
+docs/		- documentation
+src/		- source code for libraries
+src/mesa	- sources for the main Mesa library and device drivers
+src/glu		- libGLU source code
+src/glx		- sources for building libGL with full GLX and DRI support
+src/glw		- Xt/Motif/OpenGL widget code
+
+ +If you downloaded and unpacked the MesaDemos.X.Y package: + +
+progs/demos	- original Mesa demos
+progs/xdemos	- GLX OpenGL/Mesa demos
+progs/redbook	- examples from the OpenGL Programming Guide
+progs/samples	- examples from SGI
+progs/images/	- image files
+
+ +If you downloaded and unpacked the MesaGLUT.X.Y package: +
+src/glut	- GLUT library source code
+
+ +

+Proceed to the compilation and installation +instructions. +

+ + + + diff -Nru xpsb-glx-0.19/mesa/docs/enums.txt xpsb-glx-0.19/mesa/docs/enums.txt --- xpsb-glx-0.19/mesa/docs/enums.txt 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/enums.txt 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,47 @@ + +Blocks allocated to Mesa: + 0x8750-0x875F + 0x8BB0-0x8BBF + + +GL_MESA_packed_depth_stencil + GL_DEPTH_STENCIL_MESA 0x8750 + GL_UNSIGNED_INT_24_8_MESA 0x8751 + GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 + GL_UNSIGNED_SHORT_15_1_MESA 0x8753 + GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +GL_MESA_trace.spec: + GL_TRACE_ALL_BITS_MESA 0xFFFF + GL_TRACE_OPERATIONS_BIT_MESA 0x0001 + GL_TRACE_PRIMITIVES_BIT_MESA 0x0002 + GL_TRACE_ARRAYS_BIT_MESA 0x0004 + GL_TRACE_TEXTURES_BIT_MESA 0x0008 + GL_TRACE_PIXELS_BIT_MESA 0x0010 + GL_TRACE_ERRORS_BIT_MESA 0x0020 + GL_TRACE_MASK_MESA 0x8755 + GL_TRACE_NAME_MESA 0x8756 + +MESA_ycbcr_texture.spec: + GL_YCBCR_MESA 0x8757 + GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */ + GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */ + +GL_MESA_pack_invert.spec + GL_PACK_INVERT_MESA 0x8758 + +GL_MESA_shader_debug.spec: + GL_DEBUG_OBJECT_MESA 0x8759 + GL_DEBUG_PRINT_MESA 0x875A + GL_DEBUG_ASSERT_MESA 0x875B + +GL_MESA_program_debug.spec: + GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_MESA 0x???? + GL_FRAGMENT_PROGRAM_POSITION_MESA 0x???? + GL_VERTEX_PROGRAM_POSITION_MESA 0x???? + GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x???? + GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x???? + diff -Nru xpsb-glx-0.19/mesa/docs/envvars.html xpsb-glx-0.19/mesa/docs/envvars.html --- xpsb-glx-0.19/mesa/docs/envvars.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/envvars.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,51 @@ + + +Environment Variables + + + + + +

Environment Variables

+ +

+Mesa supports the following environment variables: +

+
    +
  • MESA_NO_ASM - if set, disables all assembly language optimizations +
  • MESA_NO_MMX - if set, disables Intel MMX optimizations +
  • MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations +
  • MESA_NO_SSE - if set, disables Intel SSE optimizations +
  • MESA_DEBUG - if set, error messages are printed to stderr. +If the value of MESA_DEBUG is "FP" floating point arithmetic errors will +generate exceptions. +
  • MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER) +
  • MESA_TEX_PROG - if set, implement conventional texture env modes with +fragment programs (intended for developers only) +
  • MESA_TNL_PROG - if set, implement conventional vertex transformation +operations with vertex programs (intended for developers only). +Setting this variable automatically sets the MESA_TEX_PROG variable as well. +
+ +

+The following are only applicable to the Xlib software driver. +See the Xlib software driver page for details. +

+
    +
  • MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode +
  • MESA_CI_VISUAL - specifies the X visual and depth for CI mode +
  • MESA_BACK_BUFFER - specifies how to implement the back color buffer, + either "pixmap" or "ximage" +
  • MESA_GAMMA - gamma correction coefficients for red, green, blue channels +
  • MESA_XSYNC - enable synchronous X behavior (for debugging only) +
  • MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals +
  • MESA_GLX_FX - set to either "fullscreen" for full-screen rendering, + "window" to render into a window, or "disable" to disable the Glide driver. +
  • MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel. +
  • MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer. +
  • MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel. +
+ + + + diff -Nru xpsb-glx-0.19/mesa/docs/extensions.html xpsb-glx-0.19/mesa/docs/extensions.html --- xpsb-glx-0.19/mesa/docs/extensions.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/extensions.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,34 @@ + + +Mesa Extensions + + + + + +

Mesa Extensions

+ +

+A number of extensions have been developed especially for Mesa. +The specifications follow. +

+ + + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/faq.html xpsb-glx-0.19/mesa/docs/faq.html --- xpsb-glx-0.19/mesa/docs/faq.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/faq.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,384 @@ + + +Mesa FAQ + + + + + + +
+

Mesa Frequently Asked Questions

+Last updated: 21 August 2006 +
+ +
+
+

Index

+1. High-level Questions and Answers +
+2. Compilation and Installation Problems +
+3. Runtime / Rendering Problems +
+4. Developer Questions +
+
+
+ + + + +

1. High-level Questions and Answers

+ +

1.1 What is Mesa?

+

+Mesa is an open-source implementation of the OpenGL specification. +OpenGL is a programming library for writing interactive 3D applications. +See the OpenGL website for more +information. +

+

+Mesa 6.x supports the OpenGL 1.5 specification. +

+ + +

1.2 Does Mesa support/use graphics hardware?

+

+Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI +drivers for XFree86/X.org. See the DRI +website for more information. +

+

+There have been other hardware drivers for Mesa over the years (such as +the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers +are the modern ones. +

+ +

1.3 What purpose does Mesa serve today?

+

+Hardware-accelerated OpenGL implementations are available for most popular +operating systems today. +Still, Mesa serves at least these purposes: +

+
    +
  • Mesa is used as the core of the open-source XFree86/X.org DRI + hardware drivers. +
  • +
  • Mesa is quite portable and allows OpenGL to be used on systems + that have no other OpenGL solution. +
  • +
  • Software rendering with Mesa serves as a reference for validating the + hardware drivers. +
  • +
  • A software implementation of OpenGL is useful for experimentation, + such as testing new rendering techniques. +
  • +
  • Mesa can render images with deep color channels: 16-bit integer + and 32-bit floating point color channels are supported. + This capability is only now appearing in hardware. +
  • +
  • Mesa's internal limits (max lights, clip planes, texture size, etc) can be + changed for special needs (hardware limits are hard to overcome). +
  • +
+ + +

1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?

+

+Stand-alone Mesa is the original incarnation of Mesa. +On systems running the X Window System it does all its rendering through +the Xlib API: +

    +
  • The GLX API is supported, but it's really just an emulation of the + real thing. +
  • The GLX wire protocol is not supported and there's no OpenGL extension + loaded by the X server. +
  • There is no hardware acceleration. +
  • The OpenGL library, libGL.so, contains everything (the programming API, + the GLX functions and all the rendering code). +
+

+

+Alternately, Mesa acts as the core for a number of OpenGL hardware drivers +within the DRI (Direct Rendering Infrastructure): +

    +
  • The libGL.so library provides the GL and GLX API functions, a GLX + protocol encoder, and a device driver loader. +
  • The device driver modules (such as r200_dri.so) contain a built-in + copy of the core Mesa code. +
  • The X server loads the GLX module. + The GLX module decodes incoming GLX protocol and dispatches the commands + to a rendering module. + For the DRI, this module is basically a software Mesa renderer. +
+ + + +

1.5 How do I upgrade my DRI installation to use a new Mesa release?

+

+This wasn't easy in the past. +Now, the DRI drivers are included in the Mesa tree and can be compiled +separately from the X server. +Just follow the Mesa compilation instructions. +

+ + +

1.6 Are there other open-source implementations of OpenGL?

+

+Yes, SGI's +OpenGL Sample Implemenation (SI) is available. +The SI was written during the time that OpenGL was originally designed. +Unfortunately, development of the SI has stagnated. +Mesa is much more up to date with modern features and extensions. +

+ +

+Vincent is +an open-source implementation of OpenGL ES for mobile devices. + +

+miniGL +is a subset of OpenGL for PalmOS devices. + +

+TinyGL is a subset of OpenGL. +

+ +

+SoftGL +is an OpenGL subset for mobile devices. +

+ +

+Chromium +isn't a conventional OpenGL implementation (it's layered upon OpenGL), +but it does export the OpenGL API. It allows tiled rendering, sort-last +rendering, etc. +

+ +

+ClosedGL is an OpenGL subset library for TI +graphing calculators. +

+ +

+There may be other open OpenGL implementations, but Mesa is the most +popular and feature-complete. +

+ + + +
+
+ + + +

2. Compilation and Installation Problems

+ + +

2.1 What's the easiest way to install Mesa?

+

+If you're using a Linux-based system, your distro CD most likely already +has Mesa packages (like RPM or DEB) which you can easily install. +

+ + +

2.2 I get undefined symbols such as bgnpolygon, v3f, etc...

+

+You're application is written in IRIS GL, not OpenGL. +IRIS GL was the predecessor to OpenGL and is a different thing (almost) +entirely. +Mesa's not the solution. +

+ + +

2.3 Where is the GLUT library?

+

+GLUT (OpenGL Utility Toolkit) is in the separate MesaGLUT-x.y.z.tar.gz file. +If you don't already have GLUT installed, you should grab the MesaGLUT +package and compile it with the rest of Mesa. +

+ + + +

2.4 What's the proper place for the libraries and headers?

+

+On Linux-based systems you'll want to follow the +Linux ABI standard. +Basically you'll want the following: +

+
    +
  • /usr/include/GL/gl.h - the main OpenGL header +
  • /usr/include/GL/glu.h - the OpenGL GLU (utility) header +
  • /usr/include/GL/glx.h - the OpenGL GLX header +
  • /usr/include/GL/glext.h - the OpenGL extensions header +
  • /usr/include/GL/glxext.h - the OpenGL GLX extensions header +
  • /usr/include/GL/osmesa.h - the Mesa off-screen rendering header +
  • /usr/lib/libGL.so - a symlink to libGL.so.1 +
  • /usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz +
  • /usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the +Mesa version number. +
  • /usr/lib/libGLU.so - a symlink to libGLU.so.1 +
  • /usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz +
  • /usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa +version number. +
+

+After installing XFree86/X.org and the DRI drivers, some of these files +may be symlinks into the /usr/X11R6/ tree. +

+

+The old-style Makefile system doesn't install the Mesa libraries; it's +up to you to copy them (and the headers) to the right place. +

+

+The GLUT header and library should go in the same directories. +

+
+
+ + + +

3. Runtime / Rendering Problems

+ +

3.1 Rendering is slow / why isn't my graphics hardware being used?

+

+Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any +support for hardware acceleration (with the exception of the 3DFX Voodoo +driver). +

+

+What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver +for your particular hardware. +

+

+You can run the glxinfo program to learn about your OpenGL +library. +Look for the GL_VENDOR and GL_RENDERER values. +That will identify who's OpenGL library you're using and what sort of +hardware it has detected. +

+

+If your DRI-based driver isn't working, go to the +DRI website for trouble-shooting information. +

+ + +

3.2 I'm seeing errors in depth (Z) buffering. Why?

+

+Make sure the ratio of the far to near clipping planes isn't too great. +Look + here for details. +

+

+Mesa uses a 16-bit depth buffer by default which is smaller and faster +to clear than a 32-bit buffer but not as accurate. +If you need a deeper you can modify the parameters to + glXChooseVisual in your code. +

+ + +

3.3 Why Isn't depth buffering working at all?

+

+Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG +environment variable it will warn you about trying to enable depth testing +when you don't have a depth buffer. +

+

Specifically, make sure glutInitDisplayMode is being called +with GLUT_DEPTH or glXChooseVisual is being +called with a non-zero value for GLX_DEPTH_SIZE. +

+

This discussion applies to stencil buffers, accumulation buffers and +alpha channels too. +

+ + +

3.4 Why does glGetString() always return NULL?

+

+Be sure you have an active/current OpenGL rendering context before +calling glGetString. +

+ + +

3.5 GL_POINTS and GL_LINES don't touch the right pixels

+

+If you're trying to draw a filled region by using GL_POINTS or GL_LINES +and seeing holes or gaps it's because of a float-to-int rounding problem. +But this is not a bug. +See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips". +Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates +will fix the problem. +

+ +
+
+ + + +

4. Developer Questions

+ +

4.1 How can I contribute?

+

+First, join the Mesa3d-dev +mailing list. +That's where Mesa development is discussed. +

+

+The +OpenGL Specification is the bible for OpenGL implemention work. +You should read it. +

+

Most of the Mesa development work involves implementing new OpenGL +extensions, writing hardware drivers (for the DRI), and code optimization. +

+ +

4.2 How do I write a new device driver?

+

+Unfortunately, writing a device driver isn't easy. +It requires detailed understanding of OpenGL, the Mesa code, and your +target hardware/operating system. +3D graphics are not simple. +

+

+The best way to get started is to use an existing driver as your starting +point. +For a software driver, the X11 and OSMesa drivers are good examples. +For a hardware driver, the Radeon and R200 DRI drivers are good examples. +

+

The DRI website has more information about writing hardware drivers. +The process isn't well document because the Mesa driver interface changes +over time, and we seldome have spare time for writing documentation. +That being said, many people have managed to figure out the process. +

+

+Joining the appropriate mailing lists and asking questions (and searching +the archives) is a good way to get information. +

+ + +

4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?

+

+The specification for the extension +indicates that there are intellectual property (IP) and/or patent issues +to be dealt with. +

+

We've been unsucessful in getting a response from S3 (or whoever owns +the IP nowadays) to indicate whether or not an open source project can +implement the extension (specifically the compression/decompression +algorithms). +

+

+In the mean time, a 3rd party plug-in library is available. +

+ + + + diff -Nru xpsb-glx-0.19/mesa/docs/fbdev-dri.html xpsb-glx-0.19/mesa/docs/fbdev-dri.html --- xpsb-glx-0.19/mesa/docs/fbdev-dri.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/fbdev-dri.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,341 @@ +Mesa fbdev/DRI Environment + + + + + + + +

Mesa fbdev/DRI Drivers

+
+ +

1. Introduction

+ +

+The fbdev/DRI environment supports hardware-accelerated 3D rendering without +the X window system. This is typically used for embedded applications. +

+ +

+Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie. +

+ +

+Applications in the fbdev/DRI environment use +the MiniGLX interface to choose pixel +formats, create rendering contexts, etc. It's a subset of the GLX and +Xlib interfaces allowing some degree of application portability between +the X and X-less environments. +

+ +

+Note that this environment is not well-supported and these instructions +may not be completely up to date. +

+
+ + + +

2. Compilation

+

+ +

2.1 glxproto

+ +Get glxproto.h. Copy it to the /mesa/include/GL/ directory. +

+ +

2.2 libpciaccess

+

+Check if you have libpciaccess installed: +

+ +
pkg-config --modversion pciaccess
+
+

+If not you can download the latest code from: +

+
   git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
+
+

+Run autogen.sh to generate a configure file. autogen.sh uses autoconf +utility. This utility may not be installed with your linux distro, +check if it is available. if not you can use your package manager or +type: +

+
sudo apt-get install autoconf
+
+The next step is to install the libpciaccess library. +
make
+make install
+
+

Now your libpciaccess.a file is saved into /usr/local/lib +directory. If you have a libpciaccess.a in /usr/lib you may simply copy +and overwrite these files. Don't forget to copy libpciaccess.pc file to +/usr/lib/pkgconfig, which is also located in /usr/local/lib/pkgconfig/. +Or you may use the following system variables: +

+
export LD_LIBRARY_PATH=/usr/local/lib
+export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+
+ +

2.3 drm

+ +

The next step is to compile the drm. DRM consists of two seperate parts, +the DRM client library(lindrm.so) and kernel device module(such as +radeon.ko). We need to make a small change in kernel device module. So +you need to download the kernel source. You may choose the nearest +mirror from www.kernel.org, or you are using Fedora Core 5, for +example, you may need to install RPMs such as: +kernel-smp-devel-2.16.15-1.2054_FC5.i686.rpm +kernel-devel-2.6.15-1.2054_FC5.i686.rpm +etc. You can find a detailed information here. +

+ +

You will find drm_drv.c at /usr/src/LINUX-VERSION/drivers/char/drm/. Edit this code and comment out the following part: +

+ +
+   /* ||
+   ((ioctl->flags & DRM_MASTER) && !priv->master)*/
+
+Now you are ready to compile your kernel. If your kernel version is +identical to the version you have compiled, you can simply over write +your new "ko" files over older ones. If you have compiled a different +kernel, you must configure your grub or lilo to be able to boot your +new kernel.

+You'll need fbdev header files. Check with: +

+
+   ls -l /usr/include/linux/fb.
+
+

This file may be missing if you have not installed linux header files. + + +

2.4 Mesa

+ +

Get latest development Mesa sources from git repository +(currently 7.1-prerelease) +

+
+   git clone git://anongit.freedesktop.org/git/mesa/mesa
+
+ +

You will need the makedepend utility which is a part of mesa project +to build your linux-solo. You probably wont have this utility. You can +download its source from following git repulsitory: +

+
+   git clone git://anongit.freedesktop.org/git/xorg/util/makedepend
+
+ +

Get the latest stable mesa version from SourceForge (currently 7.0.3) +http://sourceforge.net/project/showfiles.php?group_id=3 +

+ +

Copy the miniglx folder from 7.1-prerelease to 7.0.3. +You may also extract GLUT to 7.0.3 version at this step. +

+ +

Edit linux-solo.conf at /conf directory, just only compile the +graphics driver you need, delete the unwanted drivers names from the +list(some drivers are causing problems...) +

+
+   while(build==0)
+   {
+     make linux-solo
+
+     There will be some missing header files, copy them from 7.1-prerelease
+   }
+
+ +

+When complete you should have the following: +

+
    +
  • lib/libGL.so - the GL library which applications link with +
  • lib/*_dri_so - DRI drivers +
  • lib/miniglx.conf - sample MiniGLX config file +
  • progs/miniglx/* - several MiniGLX sample programs +
+ +To install these files into appropriate locations in system: +
+   make install
+
+ +Now your openGL libraries are copied to /usr/local/lib and +miniglx.conf is copied to /etc. You may copy them to /usr/lib and +overwrite your old GL libraries. Or you may export following variable: + +
+   export LIBGL_DRIVERS_PATH=/usr/local/lib
+
+
+ + +

3. Using fbdev/DRI

+ +

+If an X server currently running, exit/stop it so you're working from +the console. Following command shuts down the x window and also the multi user support. +

+
+   init 1
+
+ +

Also you may define the runlevel as 1 in "/etc/inittab". Your system +will always start in single user mode and without x-window with this +option set. +

3.1 Load Kernel Modules

+ +

+You'll need to load the kernel modules specific to your graphics hardware. +Typically, this consists of the agpgart module, an fbdev driver module +and the DRM kernel module. +

+

+As root, the kernel modules can be loaded as follows: +

+ +

+If you have Intel i915/i945 hardware: +

+
   modprobe agpgart            # the AGP GART module
+   modprobe intelfb            # the Intel fbdev driver
+   modprobe i915               # the i915/945 DRI kernel module
+
+ +

+If you have ATI Radeon/R200 hardware: +

+
   modprobe agpgart            # the AGP GART module
+   modprobe radeonfb           # the Radeon fbdev driver
+   modprobe radeon             # the Radeon DRI kernel module
+
+ +

+If you have ATI Rage 128 hardware: +

+
   modprobe agpgart            # the AGP GART module
+   modprobe aty128fb           # the Rage 128 fbdev driver
+   modprobe r128               # the Rage 128 DRI kernel module
+
+ +

+If you have Matrox G200/G400 hardware: +

+
   modprobe agpgart            # the AGP GART module
+   modprobe mgafb              # the Matrox fbdev driver
+   modprobe mga                # the Matrox DRI kernel module
+
+ +

+To verify that the agpgart, fbdev and drm modules are loaded: +

+
   ls -l /dev/agpgart /dev/fb* /dev/dri
+
+

+Alternately, use lsmod to inspect the currently installed modules. +If you have problems, look at the output of dmesg. +

+ + +

3.2 Configuration File

+ +

+review/edit /etc/miniglx.conf. +Alternately, the MINIGLX_CONF environment variable can be used to +indicate the location of miniglx.conf +

+ +To determine the pciBusID value, run lspci and examine the output. +For example: +

+
   /sbin/lspci:
+   00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
+
+

+00:02.0 indicates that pciBusID should be PCI:0:2:0 +

+ + + + +

3.3 Running fbdev/DRI Programs

+ +

+Make sure your LD_LIBRARY_PATH environment variable is set to the +location of the libGL.so library. You may need to append other paths +to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location, +for example. +

+ +

+Change to the Mesa/progs/miniglx/ directory and +start the sample_server program in the background: +

+
   ./sample_server &
+
+ +

+Then try running the miniglxtest program: +

+
   ./miniglxtest
+
+

+You should see a rotating quadrilateral which changes color as it rotates. +It will exit automatically after a bit. +

+ +

+If you run other tests in the miniglx/ directory, you may want to run +them from a remote shell so that you can stop them with ctrl-C. +

+
+ + +

4.0 Troubleshooting

+ +
    +
  1. +If you try to run miniglxtest and get the following: +
    +
       [miniglx] failed to probe chipset
    +   connect: Connection refused
    +   server connection lost
    +
    +It means that the sample_server process is not running. +
    +
    +
  2. +
+ + +

5.0 Programming Information

+ +

+OpenGL/Mesa is interfaced to fbdev via the MiniGLX +interface. +MiniGLX is a subset of Xlib and GLX API functions which provides just +enough functionality to setup OpenGL rendering and respond to simple +input events. +

+ +

+Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written +to the MiniGLX API can also be run on full Xlib/GLX implementations. +This allows some degree of flexibility for software development and testing. +

+ +

+However, the MiniGLX API is not binary-compatible with full Xlib/GLX. +Some of the structures are different and some macros/functions work +differently. +See the GL/miniglx.h header file for details. +

+ + + + + diff -Nru xpsb-glx-0.19/mesa/docs/games.html xpsb-glx-0.19/mesa/docs/games.html --- xpsb-glx-0.19/mesa/docs/games.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/games.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,64 @@ + + +Games + + + + + +

Games

+ + + + + + \ No newline at end of file Binary files /tmp/DzrXGGCBaZ/xpsb-glx-0.19/mesa/docs/gears.png and /tmp/hXDugikVVD/xpsb-glx-0.19/mesa/docs/gears.png differ diff -Nru xpsb-glx-0.19/mesa/docs/glfbdev-driver.html xpsb-glx-0.19/mesa/docs/glfbdev-driver.html --- xpsb-glx-0.19/mesa/docs/glfbdev-driver.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/glfbdev-driver.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,111 @@ + + +Mesa glFBDev Driver + + + + + +

Mesa glFBDev Driver

+ + +

1. Introduction

+ +

+The GLFBDev driver interface allows one to do OpenGL rendering into a +framebuffer managed with the Linux's fbdev interface. +

+ +

+Basically, the programmer uses the fbdev functions to initialize the +graphics hardware and setup the framebuffer. +Then, using a calls to Mesa's glFBDev API functions, one can render +into the framebuffer with the OpenGL API functions. +

+ +

+Note, only software rendering is supported; there is no hardware +acceleration. +

+ + +

+The GL/glfbdev.h header file defines the glFBDev interface. +

+ +

+The progs/fbdev/glfbdevtest.c demonstrates how to use the glFBDev interface. +

+ + +

+For more information about fbdev, see the + +Framebuffer Howto +

+

+You will need at minimum, a framebuffer device, check /dev/fb0 +

+ +

2. Compilation

+ +

+To compile Mesa with support for the glFBDev interface: +

+      make realclean
+      make linux-fbdev
+
+ +

+When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo. +

+

3. Permissions

+ +

+Typically /dev/fb/0 is grouped to the video group. It may be useful to add +your user to the video group so the demos will not have to be run as root. +To use fbdevglut with the prefered tty input, you should add the user to the +tty group as well +

+ +

4. Using fbdevglut

+Almost all of the programs in the progs directory use glut, and they compile with fbdevglut. + +

+To compile the redbook sample programs: +

+       cd progs/redbook
+       make
+
+

+

glut features not supported: +

  • Overlays +
  • Subwindows +
  • Input devices other than Keyboard/Mouse +
  • No support for GLUT_MULTISAMPLE, GLUT_STEREO, or GLUT_LUMINANCE +
  • Cursor and Menu Support will flicker in GLUT_SINGLE mode + +

    Keyboard input is read by opening /dev/tty and reading keycodes in medium raw mode. +

    Mouse input is read from env var MOUSE, or /dev/gpmdata and should be in ms3 format. +To forward data in this format to /dev/gpmdata, run gpm with the -Rms3 option. +

    glutInit allows glut programs to pass parameters to the glut library, currently the +following options are supported for fbdevglut: +

  • -geometry widthxheight -- This will force the resolution to be widthxheight instead of autodetecting. +The modes are read from /etc/fb.modes +

  • -bpp -- This will force the bitdepth to the one specified +

  • -vt -- This allows you to specify the virtual terminal to attach keyboard input to. It is useful to specify when running inside screen. +

  • -mousespeed -- A floating point multiplication factor to increase mouse speed +

  • -nomouse -- Disable mouse support +

  • -nokeyboard -- Disable keyboard support (this will probably break mouse support as well) +

  • -stdin -- Use stdin for input instead of attaching to kbd in medium-raw mode. +This will make it impossible to detect keypresses like Shift+Tab, you will also need to specify -gpmmouse for mouse support. This option can be used with a debugger, and it is possible to single step a program with gdb and set the FRAMEBUFFER environment variable to a different framebuffer for display. The program will not be able to handle vt switching on it's own, so it will always display. +

  • -gpmmouse -- This will attempt to connect to the /dev/gpmctl socket using liblow +for mouse data. Gpm does not provide this data when in graphics mode, so vt switching +will briefly display text. This mode typically has no initial mouse delay. +

  • -- Ignore any additional arguments +

    Notes: +

    +1. The mouse pointer flickers in single buffering mode, as it must be rendered in software. Hopefully in the future there will be a way to access hardware cursors in fbdev devices. +

    + + diff -Nru xpsb-glx-0.19/mesa/docs/glu.html xpsb-glx-0.19/mesa/docs/glu.html --- xpsb-glx-0.19/mesa/docs/glu.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/glu.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,45 @@ + + +SGI GLU + + + + + +

    SGI SI GLU

    + +(Silicon Graphics, Inc. Sample Implementation of the OpenGL Utility library) + +

    +SGI open-sourced their OpenGL Sample Implementation (SI) in January, 2000. +This includes the GLU library. +

    + +

    +The SI GLU library implements GLU version 1.3 whereas the original +Mesa GLU library only implemented version 1.2. +We recommend using the SI GLU library instead of Mesa's GLU library +since it's more up-to-date, complete and reliable. +We're no longer developing the original Mesa GLU library. +

    + +

    +The SI GLU library code is included in the Mesa distribution. +You don't have to download it separately. +

    + + +

    +Olivier Michel has made Linux RPMs of GLU for i386 and PowerPC. +You can download them from the +download area under Miscellaneous. +

    + +

    +Visit the +OpenGL Sample Implementation home page for more information about the SI. +

    + + + diff -Nru xpsb-glx-0.19/mesa/docs/helpwanted.html xpsb-glx-0.19/mesa/docs/helpwanted.html --- xpsb-glx-0.19/mesa/docs/helpwanted.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/helpwanted.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,74 @@ + + +Help Wanted + + + + + +

    Help Wanted / To-Do List

    + +

    +We can always use more help with the Mesa project. +Here are some specific ideas and areas where help would be appreciated: +

    + +
      +
    1. +Driver patching and testing. +Patches are often posted to the mesa3d-dev mailing list, but aren't +immediately checked into git because not enough people are testing them. +Just applying patches, testing and reporting back is helpful. +
    2. +Driver debugging. +There are plenty of open bugs in the bug database. +
    3. +Remove aliasing warnings. +Enable gcc -Wstrict-aliasing=2 -fstrict-aliasing and track down aliasing +issues in the code. +
    4. +Windows driver building, testing and maintenance. +The Visual Studio project files aren't always updated in a timely manner +when new source files are added or old ones are removed. +Fixing these tends to delay new Mesa releases. +
    5. +Maintenance and testing of lesser-used drivers. +Drivers such as DOS/DJGPP, GGI, etc that aren't being maintained are being +deprecated starting in Mesa 7.3. +
    6. +Contribute more tests to +glean. +
    7. +Automatic testing. + +It would be great if someone would set up an automated system for grabbing +the latest Mesa code and run tests (such as glean) then report issues to +the mailing list. +
    + + +

    +If you want to do something new in Mesa, first join the Mesa developer's +mailing list. +Then post a message to propose what you want to do, just to make sure +there's no issues. +

    + +

    +Anyone is welcome to contribute code to the Mesa project. +By doing so, it's assumed that you agree to the code's licensing terms. +

    + +

    +Finally: +

    + +

      +
    1. Try to write high-quality code that follows the existing style. +
    2. Use uniform indentation, write comments, use meaningful identifiers, etc. +
    3. Test your code thoroughly. Include test programs if appropriate. +
    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/index.html xpsb-glx-0.19/mesa/docs/index.html --- xpsb-glx-0.19/mesa/docs/index.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/index.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,29 @@ + + + + +Mesa Home Page + + + + + + + + + + + + + + + +<p>Sorry, this site requires frame support</p> + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/install.html xpsb-glx-0.19/mesa/docs/install.html --- xpsb-glx-0.19/mesa/docs/install.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/install.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,363 @@ + + +Compiling and Installing + + + + + + +

    Compiling and Installing

    + +
      +
    1. Unix / X11 + +
    2. Windows +
    3. Other +
    +
    + + + +

    1. Unix/X11 Compilation and Installation

    + + +
    +

    1.1 Prerequisites for DRI and hardware acceleration

    + +

    +The following are required for DRI-based hardware acceleration with Mesa 7.3: +

    + +
      +
    • dri2proto version 1.99.3 or later +
    • Linux 2.6.28 +
    • libDRM +version 2.4.3 or later +
    • Xorg server version 1.5 or later +
    +

    + + + +

    1.2 Building with Autoconf

    + +

    +Mesa may be built using autoconf. +This should work well on most GNU-based systems. +If that fails the traditional Mesa build system is available. + + + + +

    1.3 Building with traditional Makefiles

    + +

    +The traditional Mesa build system is based on a collection of pre-defined +system configurations. +

    +

    +To see the list of configurations, just type make. +Then choose a configuration from the list and type make +configname. +

    + +

    +Mesa may be built in several different ways using the predefined configurations: +

    +
      +
    • Stand-alone/Xlib mode - Mesa will be compiled as +a software renderer using Xlib to do all rendering. +The libGL.so library will be a self-contained rendering library that will +allow you to run OpenGL/GLX applications on any X server (regardless of +whether it supports the GLX X server extension). +You will not be able to use hardware 3D acceleration. +

      +To compile stand-alone Mesa type make in the top-level directory. +You'll see a list of supported system configurations. +Choose one from the list (such as linux-x86), and type: +

      +
      +    make linux-x86
      +
      +

      This will produce libGL.so and several other libraries

      +
    • + +
    • DRI/accelerated - The DRI hardware drivers for +accelerated OpenGL rendering (for ATI, Intel, Matrox, etc) will be built. +The libGL.so library will support the GLX extension and will load/use +the DRI hardware drivers. + + +

      +Build Mesa and the DRI hardware drivers by running +

      +
      +   make linux-dri
      +
      +

      +There are also linux-dri-x86, linux-dri-x86-64, +and linux-ppc configurations which are optimized for those +architectures. +

      +

      +Make sure you have the prerequisite versions of DRM and Xserver mentioned +above. +

      + +
    • + +
    + + +

    +Later, if you want to rebuild for a different configuration run +make realclean before rebuilding. +

    + + +
    +

    1.4 The libraries

    + +

    +When compilation has finished, look in the top-level lib/ +(or lib64/) directory. +You'll see a set of library files similar to this: +

    +
    +lrwxrwxrwx    1 brian    users          10 Mar 26 07:53 libGL.so -> libGL.so.1*
    +lrwxrwxrwx    1 brian    users          19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
    +-rwxr-xr-x    1 brian    users     3375861 Mar 26 07:53 libGL.so.1.5.060100*
    +lrwxrwxrwx    1 brian    users          11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
    +lrwxrwxrwx    1 brian    users          20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
    +-rwxr-xr-x    1 brian    users      549269 Mar 26 07:53 libGLU.so.1.3.060100*
    +lrwxrwxrwx    1 brian    users          12 Mar 26 07:53 libglut.so -> libglut.so.3*
    +lrwxrwxrwx    1 brian    users          16 Mar 26 07:53 libglut.so.3 -> libglut.so.3.7.1*
    +-rwxr-xr-x    1 brian    users      597754 Mar 26 07:53 libglut.so.3.7.1*
    +lrwxrwxrwx    1 brian    users          11 Mar 26 08:04 libGLw.so -> libGLw.so.1*
    +lrwxrwxrwx    1 brian    users          15 Mar 26 08:04 libGLw.so.1 -> libGLw.so.1.0.0*
    +-rwxr-xr-x    1 brian    users       20750 Mar 26 08:04 libGLw.so.1.0.0*
    +lrwxrwxrwx    1 brian    users          14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
    +lrwxrwxrwx    1 brian    users          23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
    +-rwxr-xr-x    1 brian    users       23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
    +
    + +

    +libGL is the main OpenGL library (i.e. Mesa). +
    +libGLU is the OpenGL Utility library. +
    +libglut is the GLUT library. +
    +libGLw is the Xt/Motif OpenGL drawing area widget library. +
    +libOSMesa is the OSMesa (Off-Screen) interface library. +

    + +

    +If you built the DRI hardware drivers, you'll also see the DRI drivers: +

    +
    +-rwxr-xr-x   1 brian users 15607851 Jul 21 12:11 ffb_dri.so
    +-rwxr-xr-x   1 brian users 15148747 Jul 21 12:11 i810_dri.so
    +-rwxr-xr-x   1 brian users 14497814 Jul 21 12:11 i830_dri.so
    +-rwxr-xr-x   1 brian users 16895413 Jul 21 12:11 i915_dri.so
    +-rwxr-xr-x   1 brian users 11320803 Jul 21 12:11 mach64_dri.so
    +-rwxr-xr-x   1 brian users 11418014 Jul 21 12:12 mga_dri.so
    +-rwxr-xr-x   1 brian users 11064426 Jul 21 12:12 r128_dri.so
    +-rwxr-xr-x   1 brian users 11849858 Jul 21 12:12 r200_dri.so
    +-rwxr-xr-x   1 brian users 16050488 Jul 21 12:11 r300_dri.so
    +-rwxr-xr-x   1 brian users 11757388 Jul 21 12:12 radeon_dri.so
    +-rwxr-xr-x   1 brian users 11232304 Jul 21 12:13 s3v_dri.so
    +-rwxr-xr-x   1 brian users 11062970 Jul 21 12:13 savage_dri.so
    +-rwxr-xr-x   1 brian users 11214212 Jul 21 12:13 sis_dri.so
    +-rwxr-xr-x   1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
    +-rwxr-xr-x   1 brian users 10598868 Jul 21 12:13 trident_dri.so
    +-rwxr-xr-x   1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
    +
    + + +
    +

    1.5 Running the demos

    + +

    +If you downloaded/unpacked the MesaDemos-x.y.z.tar.gz archive or +obtained Mesa from CVS, the progs/ directory will contain a +bunch of demonstration programs. +

    + +

    +Before running a demo, you'll probably have to set two environment variables +to indicate where the libraries are located. For example: +

    +

    +cd lib/ +
    +export LD_LIBRARY_PATH=${PWD} +
    +export LIBGL_DRIVERS_PATH=${PWD} (if using DRI drivers) +
    + +

    +Next, change to the Mesa/demos/ directory: +

    +
    +cd ../progs/demos +
    + +

    +Run a demo such as gears: +

    +
    +./gears +
    + +

    +If this doesn't work, try the Mesa/progs/xdemos/glxinfo program +and see that it prints the expected Mesa version number. +

    + +

    +If you're using Linux or a similar OS, verify that the demo program is +being linked with the proper library files: +

    +
    +ldd gears +
    + +

    +You should see something like this: +

    +
    +        libglut.so.3 => /home/brian/Mesa/lib/libglut.so.3 (0x40013000)
    +        libGLU.so.1 => /home/brian/Mesa/lib/libGLU.so.1 (0x40051000)
    +        libGL.so.1 => /home/brian/Mesa/lib/libGL.so.1 (0x400e0000)
    +        libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
    +        libm.so.6 => /lib/i686/libm.so.6 (0x403da000)
    +        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403fc000)
    +        libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x404da000)
    +        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404f1000)
    +        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40543000)
    +        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4054b000)
    +        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405fd000)
    +        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40605000)
    +        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40613000)
    +        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
    +        libdl.so.2 => /lib/libdl.so.2 (0x40644000)
    +        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40647000)
    +        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40650000)
    +
    + +

    +Retrace your steps if this doesn't look right. +

    + + +
    +

    1.6 Installing the header and library files

    + +

    +The standard location for the OpenGL header files on Unix-type systems is +in /usr/include/GL/. +The standard location for the libraries is /usr/lib/. +For more information see, the + +Linux/OpenGL ABI specification. +

    + +

    +If you'd like Mesa to co-exist with another implementation of OpenGL that's +already installed, you'll have to choose different directories, like +/usr/local/include/GL/ and /usr/local/lib/. +

    + +

    +To install Mesa's headers and libraries, run make install. +But first, check the Mesa/configs/default file and examine the values +of the INSTALL_DIR and DRI_DRIVER_INSTALL_DIR variables. +Change them if needed, then run make install. +

    + +

    +The variable +DESTDIR may also be used to install the contents to a temporary +staging directory. +This can be useful for package management. +For example: make install DESTDIR=/somepath/ +

    + +

    +Note: at runtime you can use the LD_LIBRARY_PATH environment variable +(on Linux at least) to switch +between the Mesa libraries and other vendor's libraries whenever you want. +This is a handy way to compare multiple OpenGL implementations. +

    + + + +

    1.7 Building OpenGL programs with pkg-config

    + +

    +Running make install will install package configuration files +for the pkg-config utility. +

    + +

    +When compiling your OpenGL application you can use pkg-config to determine +the proper compiler and linker flags. +

    + +

    +For example, compiling and linking a GLUT application can be done with: +

    +
    +   gcc `pkg-config --cflags --libs glut` mydemo.c -o mydemo
    +
    + +
    + +
    +

    2. Windows Compilation and Installation

    + +

    +Please see the README.WIN32 file. +

    + + + + +

    3. Other systems

    + +

    +Documentation for other environments (some may be very out of date): +

    + +
    + + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/intro.html xpsb-glx-0.19/mesa/docs/intro.html --- xpsb-glx-0.19/mesa/docs/intro.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/intro.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,315 @@ + + +Mesa Introduction + + + + + +

    Introduction

    + +

    +Mesa is an open-source implementation of the +OpenGL specification - +a system for rendering interactive 3D graphics. +

    + +

    +A variety of device drivers allows Mesa to be used in many different +environments ranging from software emulation to complete hardware acceleration +for modern GPUs. +

    + +

    +Mesa ties into several other open-source projects: the +Direct Rendering +Infrastructure and X.org to +provide OpenGL support to users of X on Linux, FreeBSD and other operating +systems. +

    + + + +

    Project History

    + +

    +The Mesa project was originally started by Brian Paul. +Here's a short history of the project. +

    + +

    +August, 1993: I begin working on Mesa in my spare time. The project +has no name at that point. I was simply interested in writing a simple +3D graphics library that used the then-new OpenGL API. I was partially +inspired by the VOGL library which emulated a subset of IRIS GL. +I had been programming with IRIS GL since 1991. +

    + +

    +November 1994: I contact SGI to ask permission to distribute my OpenGL-like +graphics library on the internet. SGI was generally receptive to the +idea and after negotiations with SGI's legal department, I get permission +to release it. +

    + +

    +February 1995: Mesa 1.0 is released on the internet. I expected that +a few people would be interested in it, but not thousands. +I was soon receiving patches, new features and thank-you notes on a +daily basis. That encouraged me to continue working on Mesa. The +name Mesa just popped into my head one day. SGI had asked me not to use +the terms "Open" or "GL" in the project name and I didn't +want to make up a new acronym. Later, I heard of the Mesa programming +language and the Mesa spreadsheet for NeXTStep. +

    + +

    +In the early days, OpenGL wasn't available on too many systems. +It even took a while for SGI to support it across their product line. +Mesa filled a big hole during that time. +For a lot of people, Mesa was their first introduction to OpenGL. +I think SGI recognized that Mesa actually helped to promote +the OpenGL API, so they didn't feel threatened by the project. +

    + + +

    +1995-1996: I continue working on Mesa both during my spare time and during +my work hours at the Space Science and Engineering Center at the University +of Wisconsin in Madison. My supervisor, Bill Hibbard, lets me do this because +Mesa is now being using for the Vis5D project. +

    +October 1996: Mesa 2.0 is released. It implements the OpenGL 1.1 specification. +

    + +

    +March 1997: Mesa 2.2 is released. It supports the new 3dfx Voodoo graphics +card via the Glide library. It's the first really popular hardware OpenGL +implementation for Linux. +

    + +

    +September 1998: Mesa 3.0 is released. It's the first publicly-available +implementation of the OpenGL 1.2 API. +

    + +

    +March 1999: I attend my first OpenGL ARB meeting. I contribute to the +development of several official OpenGL extensions over the years. +

    + +

    +September 1999: I'm hired by Precision Insight, Inc. Mesa is a key +component of 3D hardware acceleration in the new DRI project for XFree86. +Drivers for 3dfx, 3dLabs, Intel, Matrox and ATI hardware soon follow. +

    + +

    +October 2001: Mesa 4.0 is released. +It implements the OpenGL 1.3 specification. +

    + + +

    +November 2001: I cofound +Tungsten Graphics, Inc. with Keith Whitwell, Jens Owen, David Dawes and +Frank LaMonica. +I continue to develop Mesa as part of my resposibilities with Tungsten +Graphics and as a spare-time project. +

    + +

    +November 2002: Mesa 5.0 is released. +It implements the OpenGL 1.4 specification. +

    + +

    +January 2003: Mesa 6.0 is released. It implements the OpenGL 1.5 +specification as well as the GL_ARB_vertex_program and +GL_ARB_fragment_program extensions. +

    + +

    +June 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification +and OpenGL Shading Language. +

    + + +

    +Ongoing: Mesa is used as the core of many hardware OpenGL drivers for +the XFree86 and X.org X servers within the +DRI project. +I continue to enhance Mesa with new extensions and features. +

    + + + +

    Major Versions

    + +

    +This is a summary of the major versions of Mesa. +Mesa's major version number has been incremented whenever a new version +of the OpenGL specification is implemented. +

    + + +

    Version 7.x features

    +

    +Version 7.x of Mesa implements the OpenGL 2.1 API. The main feature +of OpenGL 2.x is the OpenGL Shading Language. +

    + + +

    Version 6.x features

    +

    +Version 6.x of Mesa implements the OpenGL 1.5 API with the following +extensions incorporated as standard features: +

    +
      +
    • GL_ARB_occlusion_query +
    • GL_ARB_vertex_buffer_object +
    • GL_EXT_shadow_funcs +
    +

    +Also note that several OpenGL tokens were renamed in OpenGL 1.5 +for the sake of consistency. +The old tokens are still available. +

    +
    +New Token                   Old Token
    +------------------------------------------------------------
    +GL_FOG_COORD_SRC            GL_FOG_COORDINATE_SOURCE
    +GL_FOG_COORD                GL_FOG_COORDINATE
    +GL_CURRENT_FOG_COORD        GL_CURRENT_FOG_COORDINATE
    +GL_FOG_COORD_ARRAY_TYPE     GL_FOG_COORDINATE_ARRAY_TYPE
    +GL_FOG_COORD_ARRAY_STRIDE   GL_FOG_COORDINATE_ARRAY_STRIDE
    +GL_FOG_COORD_ARRAY_POINTER  GL_FOG_COORDINATE_ARRAY_POINTER
    +GL_FOG_COORD_ARRAY          GL_FOG_COORDINATE_ARRAY
    +GL_SRC0_RGB                 GL_SOURCE0_RGB
    +GL_SRC1_RGB                 GL_SOURCE1_RGB
    +GL_SRC2_RGB                 GL_SOURCE2_RGB
    +GL_SRC0_ALPHA               GL_SOURCE0_ALPHA
    +GL_SRC1_ALPHA               GL_SOURCE1_ALPHA
    +GL_SRC2_ALPHA               GL_SOURCE2_ALPHA
    +
    +

    +See the + +OpenGL specification for more details. +

    + + + +

    Version 5.x features

    +

    +Version 5.x of Mesa implements the OpenGL 1.4 API with the following +extensions incorporated as standard features: +

    +
      +
    • GL_ARB_depth_texture +
    • GL_ARB_shadow +
    • GL_ARB_texture_env_crossbar +
    • GL_ARB_texture_mirror_repeat +
    • GL_ARB_window_pos +
    • GL_EXT_blend_color +
    • GL_EXT_blend_func_separate +
    • GL_EXT_blend_logic_op +
    • GL_EXT_blend_minmax +
    • GL_EXT_blend_subtract +
    • GL_EXT_fog_coord +
    • GL_EXT_multi_draw_arrays +
    • GL_EXT_point_parameters +
    • GL_EXT_secondary_color +
    • GL_EXT_stencil_wrap +
    • GL_EXT_texture_lod_bias (plus, a per-texture LOD bias parameter) +
    • GL_SGIS_generate_mipmap +
    + + +

    Version 4.x features

    + +

    +Version 4.x of Mesa implements the OpenGL 1.3 API with the following +extensions incorporated as standard features: +

    + +
      +
    • GL_ARB_multisample +
    • GL_ARB_multitexture +
    • GL_ARB_texture_border_clamp +
    • GL_ARB_texture_compression +
    • GL_ARB_texture_cube_map +
    • GL_ARB_texture_env_add +
    • GL_ARB_texture_env_combine +
    • GL_ARB_texture_env_dot3 +
    • GL_ARB_transpose_matrix +
    + +

    Version 3.x features

    + +

    +Version 3.x of Mesa implements the OpenGL 1.2 API with the following +features: +

    +
      +
    • BGR, BGRA and packed pixel formats +
    • New texture border clamp mode +
    • glDrawRangeElements() +
    • standard 3-D texturing +
    • advanced MIPMAP control +
    • separate specular color interpolation +
    + + +

    Version 2.x features

    +

    +Version 2.x of Mesa implements the OpenGL 1.1 API with the following +features. +

    +
      +
    • Texture mapping: +
        +
      • glAreTexturesResident +
      • glBindTexture +
      • glCopyTexImage1D +
      • glCopyTexImage2D +
      • glCopyTexSubImage1D +
      • glCopyTexSubImage2D +
      • glDeleteTextures +
      • glGenTextures +
      • glIsTexture +
      • glPrioritizeTextures +
      • glTexSubImage1D +
      • glTexSubImage2D +
      +
    • Vertex Arrays: +
        +
      • glArrayElement +
      • glColorPointer +
      • glDrawElements +
      • glEdgeFlagPointer +
      • glIndexPointer +
      • glInterleavedArrays +
      • glNormalPointer +
      • glTexCoordPointer +
      • glVertexPointer +
      +
    • Client state management: +
        +
      • glDisableClientState +
      • glEnableClientState +
      • glPopClientAttrib +
      • glPushClientAttrib +
      +
    • Misc: +
        +
      • glGetPointer +
      • glIndexub +
      • glIndexubv +
      • glPolygonOffset +
      +
    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/libraries.html xpsb-glx-0.19/mesa/docs/libraries.html --- xpsb-glx-0.19/mesa/docs/libraries.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/libraries.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,57 @@ + + +Libraries and Toolkits + + + + + +

    Libraries and Toolkits

    + +
      +
    • Apprentice - free OpenInventor work-alike +
    • Coin - OSS Open Inventor clone +
    • Ch - OpenGL bindings for the Ch C/C++ interpreter +
    • FOX - GUI Library +
    • GL4Java - a Java wrapper for OpenGL +
    • GtkGLArea - OpenGL Gtk widget +
    • GtkGLArea-- - OpenGL Gtk-- widget for C++ +
    • GTKpas - OpenGL Gtk widget for FreePascal +
    • FreeGLUT - a GLUT work-alike +
    • Fortran77/90 bindings for OpenGL and Mesa - by William Mitchell +
    • GLOW - a GUI toolkit for GLUT and OpenGL +
    • Glt - an OpenGL C++ toolkit +
    • GLUT (GL Utility Toolkit) - by Mark Kilgard +
    • GuileGL - OpenGL and GtkGLArea language bindings for Guile +
    • IDL - Interactive Data Language +
    • JX - C++ application framework and GUI library +
    • MAM/VRS - object-oriented toolkit for 3D graphics +
    • MINOS - GUI library +
    • OglCLib - C++ wrapper for OpenGL +
    • Open Inventor - the Open Inventor toolkit from SGI +
    • Open Inventor - the Open Inventor toolkit from Template Graphics Software, Inc. +
    • OpenRM +- Open Source, multithreaded, parallel scene graph API +
    • +Open SG PLUS - a scene-graph library +
    • Open Scene Graph + - a scene-graph library +
    • OpenVRML +- a VRML parsing/display library with "lookat" - an example VRML browser +
    • PLIB - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API +
    • Pryan - an OpenInventor-like toolkit +
    • PyOpenGL - OpenGL interface for Python +
    • Quesa - QuickDraw3D-compatible library based on OpenGL, Mesa or Direct3D +
    • repGL - IRIS GL emulated with OpenGL +
    • SciTech MGL - A multiplatform (Windows, Linux, OS/2, DOS, QNX, SMX, RT-Target & more) graphics library +
    • SGL - a 3D Scene Graph Library +
    • SoFree - a free implementation of Open Inventor +
    • Togl - Tcl/Tk widget for OpenGL +
    • VLE - Virtual Reality Toolkit +
    • View3D Widget - 3-D GUI widget +
    • VTK - Visualization Toolkit +
    • YAJOGL - Yet Another Java GL Binding. +
    + + + \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/docs/license.html xpsb-glx-0.19/mesa/docs/license.html --- xpsb-glx-0.19/mesa/docs/license.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/license.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,117 @@ + + +License / Cppyright Information + + + + + +

    Disclaimer

    + +

    +Mesa is a 3-D graphics library with an API which is very similar to +that of OpenGL.* +To the extent that Mesa utilizes the OpenGL command syntax or state +machine, it is being used with authorization from Silicon Graphics, +Inc.(SGI). However, the author does not possess an OpenGL license +from SGI, and makes no claim that Mesa is in any way a compatible +replacement for OpenGL or associated with SGI. Those who want a +licensed implementation of OpenGL should contact a licensed +vendor. +

    + +

    +Please do not refer to the library as MesaGL (for legal +reasons). It's just Mesa or The Mesa 3-D graphics +library.
    +

    + +

    +* OpenGL is a trademark of Silicon Graphics Incorporated. +

    + + + +

    License / Copyright Information

    + +

    +The Mesa distribution consists of several components. Different copyrights +and licenses apply to different components. For example, GLUT is copyrighted +by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa +device drivers are copyrighted by their authors. See below for a list of +Mesa's main components and the license for each. +

    +

    +The core Mesa library is licensed according to the terms of the MIT license. +This allows integration with the XFree86, Xorg and DRI projects. +

    +

    +The default Mesa license is as follows: +

    + +
    +Copyright (C) 1999-2007  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.
    +
    + + +

    Attention, Contributors

    + +

    +When contributing to the Mesa project you must agree to the licensing terms +of the component to which you're contributing. +The following section lists the primary components of the Mesa distribution +and their respective licenses. +

    + + +

    Mesa Component Licenses

    + +
    +Component         Location               License
    +------------------------------------------------------------------
    +Main Mesa code    src/mesa/              Mesa (MIT)
    +
    +Device drivers    src/mesa/drivers/*     MIT, generally
    +
    +Ext headers       include/GL/glext.h     Khronos
    +                  include/GL/glxext.h
    +
    +GLUT              src/glut/              Mark Kilgard's copyright
    +
    +SGI GLU library   src/glu/sgi/           SGI Free B
    +
    +demo programs     progs/demos/           see source files
    +
    +X demos           progs/xdemos/          see source files
    +
    +SGI demos         progs/samples/         SGI license
    +
    +RedBook demos     progs/redbook/         SGI license
    +
    + +

    +In general, consult the source files for license terms. +

    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/lists.html xpsb-glx-0.19/mesa/docs/lists.html --- xpsb-glx-0.19/mesa/docs/lists.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/lists.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,69 @@ + + +Mesa Mailing Lists + + + + + +

    Mailing Lists

    + + +

    There are four Mesa 3D / DRI mailing lists: +

    + +
      +
    • mesa3d-announce - announcements of new Mesa +versions are sent to this list. +
    • +
      +
    • mesa3d-users - intended for users of the Mesa and DRI. +Newbie questions are appropriate, but please try the general OpenGL +resources and Mesa/DRI documentation first. +
    • +
      +
    • mesa3d-dev - for discussion of Mesa and Direct Rendering +Infrastructure development. Not for beginners. +
    • +
      +
    • mesa-commit - relays git check-in messages +(for developers). +
      +Note: the old mesa3d-cvs list is no longer in use. +
    • +
    + +

    For mailing lists about Direct Rendering Modules (drm) in Linux/BSD +kernels, see wiki. + +

    +Notice: non-member posts to any of these lists will be automatically +rejected. +

    + + +
    + +

    OpenGL Forums

    + +

    +Here are some other OpenGL-related forums you might find useful: +

    + +
      +
    • OpenGL discussion forums at www.opengl.org
    • +
    • Usenet newsgroups: +
        +
      • comp.graphics.algorithms
      • +
      • comp.graphics.api.opengl
      • +
      • comp.os.linux.x
      • +
      +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/mangling.html xpsb-glx-0.19/mesa/docs/mangling.html --- xpsb-glx-0.19/mesa/docs/mangling.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/mangling.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,30 @@ + + +Function Name Mangling + + + + + +

    Function Name Mangling

    + +

    +If you want to use both Mesa and another OpenGL library in the same +application at the same time you may find it useful to compile Mesa with +name mangling. +This results in all the Mesa functions being prefixed with +mgl instead of gl. +

    + +

    +To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE. +Add the flag to CFLAGS in the configuration file which you want to use. +For example: +

    +CFLAGS += -DUSE_MGL_NAMESPACE
    +
    +

    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/MESA_agp_offset.spec xpsb-glx-0.19/mesa/docs/MESA_agp_offset.spec --- xpsb-glx-0.19/mesa/docs/MESA_agp_offset.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_agp_offset.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,95 @@ +Name + + MESA_agp_offset + +Name Strings + + GLX_MESA_agp_offset + +Contact + + Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com) + Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com) + +Status + + Shipping (Mesa 4.0.4 and later. Only implemented in particular + XFree86/DRI drivers.) + +Version + + 1.0 + +Number + + TBD + +Dependencies + + OpenGL 1.0 or later is required + GLX_NV_vertex_array_range is required. + This extensions is written against the OpenGL 1.4 Specification. + +Overview + + This extensions provides a way to convert pointers in an AGP memory + region into byte offsets into the AGP aperture. + Note, this extension depends on GLX_NV_vertex_array_range, for which + no real specification exists. See GL_NV_vertex_array_range for more + information. + +IP Status + + None + +Issues + + None + +New Procedures and Functions + + unsigned int glXGetAGPOffsetMESA( const void *pointer ) + +New Tokens + + None + +Additions to the OpenGL 1.4 Specification + + None + +Additions to Chapter 3 the GLX 1.4 Specification (Functions and Errors) + + Add a new section, 3.6 as follows: + + 3.6 AGP Memory Access + + On "PC" computers, AGP memory can be allocated with glXAllocateMemoryNV + and freed with glXFreeMemoryNV. Sometimes it's useful to know where a + block of AGP memory is located with respect to the start of the AGP + aperature. The function + + GLuint glXGetAGPOffsetMESA( const GLvoid *pointer ) + + Returns the offset of the given memory block from the start of AGP + memory in basic machine units (i.e. bytes). If pointer is invalid + the value ~0 will be returned. + +GLX Protocol + + None. This is a client side-only extension. + +Errors + + glXGetAGPOffsetMESA will return ~0 if the pointer does not point to + an AGP memory region. + +New State + + None + +Revision History + + 20 September 2002 - Initial draft + 2 October 2002 - finished GLX chapter 3 additions + 27 July 2004 - use unsigned int instead of GLuint, void instead of GLvoid diff -Nru xpsb-glx-0.19/mesa/docs/MESA_copy_sub_buffer.spec xpsb-glx-0.19/mesa/docs/MESA_copy_sub_buffer.spec --- xpsb-glx-0.19/mesa/docs/MESA_copy_sub_buffer.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_copy_sub_buffer.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,96 @@ +Name + + MESA_copy_sub_buffer + +Name Strings + + GLX_MESA_copy_sub_buffer + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + +Status + + Shipping since Mesa 2.6 in February, 1998. + +Version + + Last Modified Date: 12 January 2009 + +Number + + 215 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + The glxCopySubBufferMESA() function copies a rectangular region + of the back color buffer to the front color buffer. This can be + used to quickly repaint 3D windows in response to expose events + when the back color buffer cannot be damaged by other windows. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); + +New Tokens + + None. + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + Add to section 3.3.10 Double Buffering: + + The function + + void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); + + may be used to copy a rectangular region of the back color buffer to + the front color buffer. This can be used to quickly repaint 3D windows + in response to expose events when the back color buffer cannot be + damaged by other windows. + + and indicates the lower-left corner of the region to copy and + and indicate the size in pixels. Coordinate (0,0) + corresponds to the lower-left pixel of the window, like glReadPixels. + + If dpy and drawable are the display and drawable for the calling + thread's current context, glXCopySubBufferMESA performs an + implicit glFlush before it returns. Subsequent OpenGL commands + may be issued immediately after calling glXCopySubBufferMESA, but + are not executed until the copy is completed. + +GLX Protocol + + None at this time. The extension is implemented in terms of ordinary + Xlib protocol inside of Mesa. + +Errors + + None. + +New State + + None. + +Revision History + + 12 January 2009 Ian Romanick - Added language about implicit flush + and command completion. + 8 June 2000 Brian Paul - initial specification + diff -Nru xpsb-glx-0.19/mesa/docs/mesa.css xpsb-glx-0.19/mesa/docs/mesa.css --- xpsb-glx-0.19/mesa/docs/mesa.css 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/mesa.css 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,33 @@ +/* Mesa CSS */ +body { + background-color: #ffffff; + font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; + color: black; + link: #111188; +} + +h1 { + font: 24px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; + font-weight: bold; + color: black; +} + +h2 { + font: 18px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif, bold; + font-weight: bold; + color: black; +} + +code { + font-family: monospace; + font-size: 10pt; + color: black; +} + + +pre { + /*font-family: monospace;*/ + font-size: 10pt; + /*color: black;*/ +} + diff -Nru xpsb-glx-0.19/mesa/docs/MESA_pack_invert.spec xpsb-glx-0.19/mesa/docs/MESA_pack_invert.spec --- xpsb-glx-0.19/mesa/docs/MESA_pack_invert.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_pack_invert.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,138 @@ +Name + + MESA_pack_invert + +Name Strings + + GL_MESA_pack_invert + +Contact + + Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com) + Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com) + +Status + + Shipping (Mesa 4.0.4 and later) + +Version + + 1.0 + +Number + + TBD + +Dependencies + + OpenGL 1.0 or later is required + This extensions is written against the OpenGL 1.4 Specification. + +Overview + + This extension adds a new pixel storage parameter to indicate that + images are to be packed in top-to-bottom order instead of OpenGL's + conventional bottom-to-top order. Only pixel packing can be + inverted (i.e. for glReadPixels, glGetTexImage, glGetConvolutionFilter, + etc). + + Almost all known image file formats store images in top-to-bottom + order. As it is, OpenGL reads images from the frame buffer in + bottom-to-top order. Thus, images usually have to be inverted before + writing them to a file with image I/O libraries. This extension + allows images to be read such that inverting isn't needed. + +IP Status + + None + +Issues + + 1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc? + + Resolved: No, we're only concerned with pixel packing. There are other + solutions for inverting images when using glDrawPixels (negative Y pixel + zoom) or glTexImage (invert the vertex T coordinates). It would be easy + enough to define a complementary extension for pixel packing in the + future if needed. + +New Procedures and Functions + + None + +New Tokens + + Accepted by the parameter of PixelStorei and PixelStoref + and the parameter of GetIntegerv, GetFloatv, GetDoublev + and GetBooleanv: + + PACK_INVERT_MESA 0x8758 + +Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) + + None + +Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment +Operations and the Frame Buffer) + + Add the following entry to table 4.4 (PixelStore parameters) on page 182: + + Parameter Name Type Initial Value Valid Range + --------------------------------------------------------- + PACK_INVERT_MESA boolean FALSE TRUE/FALSE + + In the section labeled "Placement in Client Memory" on page 184 + insert the following text into the paragraph before the sentence + that starts with "If the format is RED, GREEN, BLUE...": + + "The parameter PACK_INVERT_MESA controls whether the image is packed + in bottom-to-top order (the default) or top-to-bottom order. Equation + 3.8 is modified as follows: + + ... the first element of the Nth row is indicated by + + p + Nk, if PACK_INVERT_MESA is false + p + k * (H - 1) - Nk, if PACK_INVERT_MESA is true, where H is the + image height + " + +Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions) + + None + +Additions to Chapter 6 of the OpenGL 1.4 Specification (State and +State Requests) + + None + +Additions to Appendix A of the OpenGL 1.4 Specification (Invariance) + + None + +Additions to the AGL/GLX/WGL Specifications + + None + +GLX Protocol + + None + +Errors + + None + +New State + + Add the following entry to table 6.20 (Pixels) on page 235: + + Get Value Type Get Cmd Initial Value Description Sec Attribute + -------------------------------------------------------------------------------------------------- + PACK_INVERT_MESA boolean GetBoolean FALSE Value of PACK_INVERT_MESA 4.3.2 pixel-store + +Revision History + + 21 September 2002 - Initial draft diff -Nru xpsb-glx-0.19/mesa/docs/MESA_pixmap_colormap.spec xpsb-glx-0.19/mesa/docs/MESA_pixmap_colormap.spec --- xpsb-glx-0.19/mesa/docs/MESA_pixmap_colormap.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_pixmap_colormap.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,90 @@ +Name + + MESA_pixmap_colormap + +Name Strings + + GLX_MESA_pixmap_colormap + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + +Status + + Shipping since Mesa 1.2.8 in May, 1996. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 216 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + Since Mesa allows RGB rendering into drawables with PseudoColor, + StaticColor, GrayScale and StaticGray visuals, Mesa needs a colormap + in order to compute pixel values during rendering. + + The colormap associated with a window can be queried with normal + Xlib functions but there is no colormap associated with pixmaps. + + The glXCreateGLXPixmapMESA function is an alternative to glXCreateGLXPixmap + which allows specification of a colormap. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ); + +New Tokens + + None. + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + Add to section 3.4.2 Off Screen Rendering + + The Mesa implementation of GLX allows RGB rendering into X windows and + pixmaps of any visual class, not just TrueColor or DirectColor. In order + to compute pixel values from RGB values Mesa requires a colormap. + + The function + + GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ); + + allows one to create a GLXPixmap with a specific colormap. The image + rendered into the pixmap may then be copied to a window (which uses the + same colormap and visual) with the expected results. + +GLX Protocol + + None since this is a client-side extension. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification diff -Nru xpsb-glx-0.19/mesa/docs/MESA_release_buffers.spec xpsb-glx-0.19/mesa/docs/MESA_release_buffers.spec --- xpsb-glx-0.19/mesa/docs/MESA_release_buffers.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_release_buffers.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,85 @@ +Name + + MESA_release_buffers + +Name Strings + + GLX_MESA_release_buffers + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + +Status + + Shipping since Mesa 2.0 in October, 1996. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 217 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + Mesa's implementation of GLX is entirely implemented on the client side. + Therefore, Mesa cannot immediately detect when an X window or pixmap is + destroyed in order to free any ancilliary data associated with the window + or pixmap. + + The glxMesaReleaseBuffers() function can be used to explicitly indicate + when the back color buffer, depth buffer, stencil buffer, and/or accum- + ulation buffer associated with a drawable can be freed. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); + +New Tokens + + None. + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + The function + + Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); + + causes all software ancilliary buffers (back buffer, depth, stencil, + accum, etc) associated with the named drawable to be immediately + deallocated. True is returned if is a valid Mesa GLX drawable, + else False is returned. After calling glXReleaseBuffersMESA, the + drawable should no longer be used for GL rendering. Results of + attempting to do so are undefined. + + +GLX Protocol + + None, since this is a client-side operation. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification diff -Nru xpsb-glx-0.19/mesa/docs/MESA_resize_buffers.spec xpsb-glx-0.19/mesa/docs/MESA_resize_buffers.spec --- xpsb-glx-0.19/mesa/docs/MESA_resize_buffers.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_resize_buffers.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,81 @@ +Name + + MESA_resize_buffers + +Name Strings + + GL_MESA_resize_buffers + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + +Status + + Shipping (since Mesa version 2.2) + +Version + + +Number + + 196 + +Dependencies + + Mesa 2.2 or later is required. + +Overview + + Mesa is often used as a client library with no integration with + the computer's window system (an X server, for example). And since + Mesa does not have an event loop nor window system callbacks, it + cannot properly respond to window system events. In particular, + Mesa cannot automatically detect when a window has been resized. + + Mesa's glViewport command queries the current window size and updates + its internal data structors accordingly. This normally works fine + since most applications call glViewport in responce to window size + changes. + + In some situations, however, the application may not call glViewport + when a window size changes but would still like Mesa to adjust to + the new window size. This extension exports a new function to solve + this problem. + +New Procedures and Functions + + void glResizeBuffersMESA( void ) + +New Tokens + + none + +Additions to the OpenGL Specification (no particular section) + + The glResizeBuffersMESA command may be called when the client + determines that a window has been resized. Calling + glResizeBuffersMESA causes Mesa to query the current window size + and adjust its internal data structures. This may include + reallocating depth, stencil, alpha and accumulation buffers. + +Additions to the AGL/GLX/WGL Specifications + + None + +Errors + + INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen + Begin and End. + +New State + + None. + +New Implementation Dependent State + + None. + +Revision History + + * Revision 1.0 - Initial specification diff -Nru xpsb-glx-0.19/mesa/docs/MESA_set_3dfx_mode.spec xpsb-glx-0.19/mesa/docs/MESA_set_3dfx_mode.spec --- xpsb-glx-0.19/mesa/docs/MESA_set_3dfx_mode.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_set_3dfx_mode.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,85 @@ +Name + + MESA_set_3dfx_mode + +Name Strings + + GLX_MESA_set_3dfx_mode + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + +Status + + Shipping since Mesa 2.6 in February, 1998. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 218 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + The Mesa Glide driver allows full-screen rendering or rendering into + an X window. The glXSet3DfxModeMESA() function allows an application + to switch between full-screen and windowed rendering. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + GLboolean glXSet3DfxModeMESA( GLint mode ); + +New Tokens + + GLX_3DFX_WINDOW_MODE_MESA 0x1 + GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + The Mesa Glide device driver allows either rendering in full-screen + mode or rendering into an X window. An application can switch between + full-screen and window rendering with the command: + + GLboolean glXSet3DfxModeMESA( GLint mode ); + + may either be GLX_3DFX_WINDOW_MODE_MESA to indicate window + rendering or GLX_3DFX_FULLSCREEN_MODE_MESA to indicate full-screen mode. + + GL_TRUE is returned if is valid and the operation completed + normally. GL_FALSE is returned if is invalid or if the Glide + driver is not being used. + + Note that only one drawable and context can be created at any given + time with the Mesa Glide driver. + +GLX Protocol + + None since this is a client-side extension. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification diff -Nru xpsb-glx-0.19/mesa/docs/MESA_shader_debug.spec xpsb-glx-0.19/mesa/docs/MESA_shader_debug.spec --- xpsb-glx-0.19/mesa/docs/MESA_shader_debug.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_shader_debug.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,264 @@ +Name + + MESA_shader_debug + +Name Strings + + GL_MESA_shader_debug + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + Michal Krol (mjkrol 'at' gmail.com) + +Status + + XXX - Not complete yet!!! + +Version + + Last Modified Date: July 30, 2006 + Author Revision: 0.2 + +Number + + TBD + +Dependencies + + OpenGL 1.0 is required. + + The ARB_shader_objects extension is required. + + The ARB_shading_language_100 extension is required. + + The extension is written against the OpenGL 1.5 specification. + + The extension is written against the OpenGL Shading Language 1.10 + Specification. + +Overview + + This extension introduces a debug object that can be attached to + a program object to enable debugging. Vertex and/or fragment shader, + during execution, issue diagnostic function calls that are logged + to the debug object's log. A separate debug log for each shader type + is maintained. A debug object can be attached, detached and queried + at any time outside the Begin/End pair. Multiple debug objects can + be attached to a single program object. + +IP Status + + None + +Issues + + None + +New Procedures and Functions + + handleARB CreateDebugObjectMESA(void) + void ClearDebugLogMESA(handleARB obj, enum logType, enum shaderType) + void GetDebugLogMESA(handleARB obj, enum logType, enum shaderType, + sizei maxLength, sizei *length, + charARB *debugLog) + sizei GetDebugLogLengthMESA(handleARB obj, enum logType, + enum shaderType) + +New Types + + None + +New Tokens + + Returned by the parameter of GetObjectParameter{fi}vARB: + + DEBUG_OBJECT_MESA 0x8759 + + Accepted by the argument of ClearDebugLogMESA, + GetDebugLogLengthMESA and GetDebugLogMESA: + + DEBUG_PRINT_MESA 0x875A + DEBUG_ASSERT_MESA 0x875B + +Additions to Chapter 2 of the OpenGL 1.5 Specification +(OpenGL Operation) + + None + +Additions to Chapter 3 of the OpenGL 1.5 Specification (Rasterization) + + None + +Additions to Chapter 4 of the OpenGL 1.5 Specification (Per-Fragment +Operations and the Frame Buffer) + + None + +Additions to Chapter 5 of the OpenGL 1.5 Specification +(Special Functions) + + None + +Additions to Chapter 6 of the OpenGL 1.5 Specification (State and State +Requests) + + None + +Additions to Appendix A of the OpenGL 1.5 Specification (Invariance) + + None + +Additions to Chapter 1 of the OpenGL Shading Language 1.10 Specification +(Introduction) + + None + +Additions to Chapter 2 of the OpenGL Shading Language 1.10 Specification +(Overview of OpenGL Shading) + + None + +Additions to Chapter 3 of the OpenGL Shading Language 1.10 Specification +(Basics) + + None + +Additions to Chapter 4 of the OpenGL Shading Language 1.10 Specification +(Variables and Types) + + None + +Additions to Chapter 5 of the OpenGL Shading Language 1.10 Specification +(Operators and Expressions) + + None + +Additions to Chapter 6 of the OpenGL Shading Language 1.10 Specification +(Statements and Structure) + + None + +Additions to Chapter 7 of the OpenGL Shading Language 1.10 Specification +(Built-in Variables) + + None + +Additions to Chapter 8 of the OpenGL Shading Language 1.10 Specification +(Built-in Functions) + + Add a new section 8.10 "Debug Functions": + + Debug functions are available to both fragment and vertex shaders. + They are used to track the execution of a shader by logging + passed-in arguments to the debug object's log. Those values can be + retrieved by the application for inspection after shader execution + is complete. + + The text, if any, produced by any of these functions is appended + to each debug object that is attached to the program object. + There are different debug log types + + Add a new section 8.10.1 "Print Function": + + The following printMESA prototypes are available. + + void printMESA(const float value) + void printMESA(const int value) + void printMESA(const bool value) + void printMESA(const vec2 value) + void printMESA(const vec3 value) + void printMESA(const vec4 value) + void printMESA(const ivec2 value) + void printMESA(const ivec3 value) + void printMESA(const ivec4 value) + void printMESA(const bvec2 value) + void printMESA(const bvec3 value) + void printMESA(const bvec4 value) + void printMESA(const mat2 value) + void printMESA(const mat3 value) + void printMESA(const mat4 value) + void printMESA(const sampler1D value) + void printMESA(const sampler2D value) + void printMESA(const sampler3D value) + void printMESA(const samplerCube value) + void printMESA(const sampler1DShadow value) + void printMESA(const sampler2DShadow value) + + The printMESA function writes the argument to the "debug + print log" (XXX DEBUG_PRINT_MESA?). Each component is written in + text format (XXX format!) and is delimited by a white space (XXX 1 + or more?). + + Add a new section 8.10.2 "Assert Function": + + The following assertMESA prototypes are available. + + void assertMESA(const bool condition) + void assertMESA(const bool condition, const int cookie) + void assertMESA(const bool condition, const int cookie, + const int file, const int line) + + The assertMESA function checks if the argument is + true or false. If it is true, nothing happens. If it is false, + a diagnostic message is written to the "debug assert log". + The message contains the argument , , and + implementation dependent double-quoted string, each of this + delimited by a white space. If the argument is not present, + it is meant as if it was of value 0. If the arguments and + are not present, they are meant as if they were of values + __FILE__ and __LINE__, respectively. The following three calls + produce the same output, assuming they were issued from the same + file and line. + + assertMESA (false); + assertMESA (false, 0); + assertMESA (false, 0, __FILE__, __LINE__); + + The diagnostic message examples follow. + + 1 89 0 "" + 1 45 333 "all (lessThanEqual (fragColor, vec4 (1.0)))" + 1 66 1 "assertion failed in file 1, line 66, cookie 1" + +Additions to Chapter 9 of the OpenGL Shading Language 1.10 Specification +(Shading Language Grammar) + + None + +Additions to Chapter 10 of the OpenGL Shading Language 1.10 +Specification (Issues) + + None + +Additions to the AGL/EGL/GLX/WGL Specifications + + None + +GLX Protocol + + None + +Errors + + TBD + +New State + + TBD + +New Implementation Dependent State + + TBD + +Sample Code + + TBD + +Revision History + + 29 May 2006 + Initial draft. (Michal Krol) + 30 July 2006 + Add Overview, New Procedures and Functions, New Tokens sections. + Add sections 8.10.1, 8.10.2 to GLSL spec. diff -Nru xpsb-glx-0.19/mesa/docs/MESA_swap_control.spec xpsb-glx-0.19/mesa/docs/MESA_swap_control.spec --- xpsb-glx-0.19/mesa/docs/MESA_swap_control.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_swap_control.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,132 @@ +Name + + MESA_swap_control + +Name Strings + + GLX_MESA_swap_control + +Contact + + Ian Romanick, IBM, idr at us.ibm.com + +Status + + Deployed in DRI drivers post-XFree86 4.3. + +Version + + Date: 5/1/2003 Revision: 1.1 + +Number + + ??? + +Dependencies + + None + + Based on GLX_SGI_swap_control version 1.9 and WGL_EXT_swap_control + version 1.5. + +Overview + + This extension allows an application to specify a minimum periodicity + of color buffer swaps, measured in video frame periods. + +Issues + + * Should implementations that export GLX_MESA_swap_control also export + GL_EXT_swap_control for compatibility with WGL_EXT_swap_control? + + UNRESOLVED. + +New Procedures and Functions + + int glXSwapIntervalMESA(int interval) + int glXGetSwapIntervalMESA(void) + +New Tokens + + None + +Additions to Chapter 2 of the 1.4 GL Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the 1.4 GL Specification (Rasterization) + + None + +Additions to Chapter 4 of the 1.4 GL Specification (Per-Fragment Operations +and the Framebuffer) + + None + +Additions to Chapter 5 of the 1.4 GL Specification (Special Functions) + + None + +Additions to Chapter 6 of the 1.4 GL Specification (State and State Requests) + + None + +Additions to the GLX 1.3 Specification + + [Add the following to Section 3.3.10 of the GLX Specification (Double + Buffering)] + + glXSwapIntervalMESA specifies the minimum number of video frame periods + per buffer swap. (e.g. a value of two means that the color buffers + will be swapped at most every other video frame.) A return value + of zero indicates success; otherwise an error occurred. The interval + takes effect when glXSwapBuffers is first called subsequent to the + glXSwapIntervalMESA call. + + A video frame period is the time required by the monitor to display a + full frame of video data. In the case of an interlaced monitor, + this is typically the time required to display both the even and odd + fields of a frame of video data. + + If is set to a value of 0, buffer swaps are not synchron- + ized to a video frame. The value is silently clamped to + the maximum implementation-dependent value supported before being + stored. + + The swap interval is not part of the render context state. It cannot + be pushed or popped. The current swap interval for the window + associated with the current context can be obtained by calling + glXGetSwapIntervalMESA. The default swap interval is 0. + + On XFree86, setting the environment variable LIBGL_THROTTLE_REFRESH sets + the swap interval to 1. + +Errors + + glXSwapIntervalMESA returns GLX_BAD_VALUE if parameter is + less than zero. + + glXSwapIntervalMESA returns GLX_BAD_CONTEXT if there is no current + GLXContext. + +GLX Protocol + + None. This extension only extends to direct rendering contexts. + +New State + + Get Value Get Command Type Initial Value + --------- ----------- ---- ------------- + [swap interval] GetSwapInterval Z+ 0 + +New Implementation Dependent State + + None + + +Revision History + + 1.1, 5/1/03 Added the issues section and contact information. + Changed the default swap interval to 0. + 1.0, 3/17/03 Initial version based on GLX_SGI_swap_control and + WGL_EXT_swap_control. diff -Nru xpsb-glx-0.19/mesa/docs/MESA_swap_frame_usage.spec xpsb-glx-0.19/mesa/docs/MESA_swap_frame_usage.spec --- xpsb-glx-0.19/mesa/docs/MESA_swap_frame_usage.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_swap_frame_usage.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,201 @@ +Name + + MESA_swap_frame_usage + +Name Strings + + GLX_MESA_swap_frame_usage + +Contact + + Ian Romanick, IBM, idr at us.ibm.com + +Status + + Deployed in DRI drivers post-XFree86 4.3. + +Version + + Date: 5/1/2003 Revision: 1.1 + +Number + + ??? + +Dependencies + + GLX_SGI_swap_control affects the definition of this extension. + GLX_MESA_swap_control affects the definition of this extension. + GLX_OML_sync_control affects the definition of this extension. + + Based on WGL_I3D_swap_frame_usage version 1.3. + +Overview + + This extension allows an application to determine what portion of the + swap period has elapsed since the last swap operation completed. The + "usage" value is a floating point value on the range [0,max] which is + calculated as follows: + + td + percent = ---- + tf + + where td is the time measured from the last completed buffer swap (or + call to enable the statistic) to when the next buffer swap completes, tf + is the entire time for a frame which may be multiple screen refreshes + depending on the swap interval as set by the GLX_SGI_swap_control or + GLX_OML_sync_control extensions. + + The value, percent, indicates the amount of time spent between the + completion of the two swaps. If the value is in the range [0,1], the + buffer swap occurred within the time period required to maintain a + constant frame rate. If the value is in the range (1,max], a constant + frame rate was not achieved. The value indicates the number of frames + required to draw. + + This definition of "percent" differs slightly from + WGL_I3D_swap_frame_usage. In WGL_I3D_swap_frame_usage, the measurement + is taken from the completion of one swap to the issuance of the next. + This representation may not be as useful as measuring between + completions, as a significant amount of time may pass between the + issuance of a swap and the swap actually occurring. + + There is also a mechanism to determine whether a frame swap was + missed. + +New Procedures and Functions + + int glXGetFrameUsageMESA(Display *dpy, + GLXDrawable drawable, + float *usage) + + int glXBeginFrameTrackingMESA(Display *dpy, + GLXDrawable drawable) + + int glXEndFrameTrackingMESA(Display *dpy, + GLXDrawable drawable) + + int glXQueryFrameTrackingMESA(Display *dpy, + GLXDrawable drawable, + int64_t *swapCount, + int64_t *missedFrames, + float *lastMissedUsage) + +New Tokens + + None + +Additions to Chapter 2 of the 1.4 GL Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the 1.4 GL Specification (Rasterization) + + None + +Additions to Chapter 4 of the 1.4 GL Specification (Per-Fragment Operations +and the Framebuffer) + + None + +Additions to Chapter 5 of the 1.4 GL Specification (Special Functions) + + None + +Additions to Chapter 6 of the 1.4 GL Specification (State and State Requests) + + None + +Additions to the GLX 1.3 Specification + + The frame usage is measured as the percentage of the swap period elapsed + between two buffer-swap operations being committed. In unextended GLX the + swap period is the vertical refresh time. If SGI_swap_control or + MESA_swap_control are supported, the swap period is the vertical refresh + time multiplied by the swap interval (or one if the swap interval is set + to zero). + + If OML_sync_control is supported, the swap period is the vertical + refresh time multiplied by the divisor parameter to + glXSwapBuffersMscOML. The frame usage in this case is less than 1.0 if + the swap is committed before target_msc, and is greater than or equal to + 1.0 otherwise. The actual usage value is based on the divisor and is + never less than 0.0. + + int glXBeginFrameTrackingMESA(Display *dpy, + GLXDrawable drawable, + float *usage) + + glXGetFrameUsageMESA returns a floating-point value in + that represents the current swap usage, as defined above. + + Missed frame swaps can be tracked by calling the following function: + + int glXBeginFrameTrackingMESA(Display *dpy, + GLXDrawable drawable) + + glXBeginFrameTrackingMESA resets a "missed frame" count and + synchronizes with the next frame vertical sync before it returns. + If a swap is missed based in the rate control specified by the + set by glXSwapIntervalSGI or the default swap of once + per frame, the missed frame count is incremented. + + The current missed frame count and total number of swaps since + the last call to glXBeginFrameTrackingMESA can be obtained by + calling the following function: + + int glXQueryFrameTrackingMESA(Display *dpy, + GLXDrawable drawable, + int64_t *swapCount, + int64_t *missedFrames, + float *lastMissedUsage) + + The location pointed to by will be updated with the + number of swaps that have been committed. This value may not match the + number of swaps that have been requested since swaps may be + queued by the implementation. This function can be called at any + time and does not synchronize to vertical blank. + + The location pointed to by will contain the number + swaps that missed the specified frame. The frame usage for the + last missed frame is returned in the location pointed to by + . + + Frame tracking is disabled by calling the function + + int glXEndFrameTrackingMESA(Display *dpy, + GLXDrawable drawable) + + This function will not return until all swaps have occurred. The + application can call glXQueryFrameTrackingMESA for a final swap and + missed frame count. + + If these functions are successful, zero is returned. If the context + associated with dpy and drawable is not a direct context, + GLX_BAD_CONTEXT is returned. + +Errors + + If the function succeeds, zero is returned. If the function + fails, one of the following error codes is returned: + + GLX_BAD_CONTEXT The current rendering context is not a direct + context. + +GLX Protocol + + None. This extension only extends to direct rendering contexts. + +New State + + None + +New Implementation Dependent State + + None + +Revision History + + 1.1, 5/1/03 Added contact information. + 1.0, 3/17/03 Initial version based on WGL_I3D_swap_frame_usage. diff -Nru xpsb-glx-0.19/mesa/docs/MESA_texture_array.spec xpsb-glx-0.19/mesa/docs/MESA_texture_array.spec --- xpsb-glx-0.19/mesa/docs/MESA_texture_array.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_texture_array.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,804 @@ +Name + + MESA_texture_array + +Name Strings + + GL_MESA_texture_array + +Contact + + Ian Romanick, IBM (idr 'at' us.ibm.com) + +IP Status + + No known IP issues. + +Status + + Shipping in Mesa 7.1 + +Version + + +Number + + TBD + +Dependencies + + OpenGL 1.2 or GL_EXT_texture3D is required. + + Support for ARB_fragment_program is assumed, but not required. + + Support for ARB_fragment_program_shadow is assumed, but not required. + + Support for EXT_framebuffer_object is assumed, but not required. + + Written based on the wording of the OpenGL 2.0 specification and + ARB_fragment_program_shadow but not dependent on them. + +Overview + + There are a number of circumstances where an application may wish to + blend two textures out of a larger set of textures. Moreover, in some + cases the selected textures may vary on a per-fragment basis within + a polygon. Several examples include: + + 1. High dynamic range textures. The application stores several + different "exposures" of an image as different textures. On a + per-fragment basis, the application selects which exposures are + used. + + 2. A terrain engine where the altitude of a point determines the + texture applied to it. If the transition is from beach sand to + grass to rocks to snow, the application will store each texture + in a different texture map, and dynamically select which two + textures to blend at run-time. + + 3. Storing short video clips in textures. Each depth slice is a + single frame of video. + + Several solutions to this problem have been proposed, but they either + involve using a separate texture unit for each texture map or using 3D + textures without mipmaps. Both of these options have major drawbacks. + + This extension provides a third alternative that eliminates the major + drawbacks of both previous methods. A new texture target, + TEXTURE_2D_ARRAY, is added that functions identically to TEXTURE_3D in + all aspects except the sizes of the non-base level images. In + traditional 3D texturing, the size of the N+1 LOD is half the size + of the N LOD in all three dimensions. For the TEXTURE_2D_ARRAY target, + the height and width of the N+1 LOD is halved, but the depth is the + same for all levels of detail. The texture then becomes an array of + 2D textures. The per-fragment texel is selected by the R texture + coordinate. + + References: + + http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011557 + http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=000516 + http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011903 + http://www.delphi3d.net/articles/viewarticle.php?article=terraintex.htm + +New Procedures and Functions + + All functions come directly from EXT_texture_array. + + void FramebufferTextureLayerEXT(enum target, enum attachment, + uint texture, int level, int layer); + +New Tokens + + All token names and values come directly from EXT_texture_array. + + Accepted by the parameter of Enable, Disable, and IsEnabled, by + the parameter of GetBooleanv, GetIntegerv, GetFloatv, and + GetDoublev, and by the parameter of TexImage3D, GetTexImage, + GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and + GetTexParameterfv: + + TEXTURE_1D_ARRAY_EXT 0x8C18 + TEXTURE_2D_ARRAY_EXT 0x8C1A + + Accepted by the parameter of TexImage2D, TexSubImage2D, + CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, + CompressedTexSubImage2D, GetTexLevelParameteriv, and + GetTexLevelParameterfv: + + TEXTURE_1D_ARRAY_EXT + PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 + + Accepted by the parameter of TexImage3D, TexSubImage3D, + CopyTexSubImage3D, CompressedTexImage3D, CompressedTexSubImage3D, + GetTexLevelParameteriv, and GetTexLevelParameterfv: + + TEXTURE_2D_ARRAY_EXT + PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B + + Accepted by the parameter of GetBooleanv, GetIntegerv, + GetFloatv, and GetDoublev + + TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C + TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF + + Accepted by the parameter of TexParameterf, TexParameteri, + TexParameterfv, and TexParameteriv when the parameter is + TEXTURE_COMPARE_MODE_ARB: + + COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E + + (Note: COMPARE_REF_DEPTH_TO_TEXTURE_EXT is simply an alias for the + existing COMPARE_R_TO_TEXTURE token in OpenGL 2.0; the alternate name + reflects the fact that the R coordinate is not always used.) + + Accepted by the parameter of TexImage3D and + CompressedTexImage3D, and by the parameter of + CompressedTexSubImage3D: + + COMPRESSED_RGB_S3TC_DXT1_EXT + COMPRESSED_RGBA_S3TC_DXT1_EXT + COMPRESSED_RGBA_S3TC_DXT3_EXT + COMPRESSED_RGBA_S3TC_DXT5_EXT + + Accepted by the parameter of + GetFramebufferAttachmentParameterivEXT: + + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 + + (Note: FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is simply an alias for the + FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT token provided in + EXT_framebuffer_object. This extension generalizes the notion of + "" to include layers of an array texture.) + +Additions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) + + -- Section 3.8.1 "Texture Image Specification" + + Change the first paragraph (page 150) to say (spec changes identical to + EXT_texture_array): + + "The command + + void TexImage3D(enum target, int level, int internalformat, + sizei width, sizei height, sizei depth, int border, + enum format, enum type, void *data); + + is used to specify a three-dimensional texture image. target must be one + one of TEXTURE_3D for a three-dimensional texture or + TEXTURE_2D_ARRAY_EXT for an two-dimensional array texture. + Additionally, target may be either PROXY_TEXTURE_3D for a + three-dimensional proxy texture, or PROXY_TEXTURE_2D_ARRAY_EXT for a + two-dimensional proxy array texture." + + Change the fourth paragraph on page 151 to say (spec changes identical + to EXT_texture_array): + + "Textures with a base internal format of DEPTH_COMPONENT are supported + by texture image specification commands only if target is TEXTURE_1D, + TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_2D_ARRAY_EXT, + PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_1D_ARRAY_EXT, or + PROXY_TEXTURE_2D_ARRAY_EXT. Using this format in conjunction with any + other target will result in an INVALID_OPERATION error." + + + Change the fourth paragraph on page 156 to say (spec changes identical + to EXT_texture_array): + + "The command + + void TexImage2D(enum target, int level, + int internalformat, sizei width, sizei height, + int border, enum format, enum type, void *data); + + is used to specify a two-dimensional texture image. target must be one + of TEXTURE_2D for a two-dimensional texture, TEXTURE_1D_ARRAY_EXT for a + one-dimensional array texture, or one of TEXTURE_CUBE_MAP_POSITIVE_X, + TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, + TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or + TEXTURE_CUBE_MAP_NEGATIVE_Z for a cube map texture. Additionally, + target may be either PROXY_TEXTURE_2D for a two-dimensional proxy + texture, PROXY_TEXTURE_1D_ARRAY_EXT for a one-dimensional proxy array + texture, or PROXY TEXTURE_CUBE_MAP for a cube map proxy texture in the + special case discussed in section 3.8.11. The other parameters match + the corresponding parameters of TexImage3D. + + For the purposes of decoding the texture image, TexImage2D is + equivalent to calling TexImage3D with corresponding arguments and depth + of 1, except that + + * The border depth, d_b, is zero, and the depth of the image is + always 1 regardless of the value of border. + + * The border height, h_b, is zero if is + TEXTURE_1D_ARRAY_EXT, and otherwise. + + * Convolution will be performed on the image (possibly changing its + width and height) if SEPARABLE 2D or CONVOLUTION 2D is enabled. + + * UNPACK SKIP IMAGES is ignored." + + -- Section 3.8.2 "Alternate Texture Image Specification Commands" + + Change the second paragraph (page 159) (spec changes identical + to EXT_texture_array): + + "The command + + void CopyTexImage2D(enum target, int level, + enum internalformat, int x, int y, sizei width, + sizei height, int border); + + defines a two-dimensional texture image in exactly the manner of + TexImage2D, except that the image data are taken from the framebuffer + rather than from client memory. Currently, target must be one of + TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_CUBE_MAP_POSITIVE_X, + TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE MAP_POSITIVE_Y, + TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or + TEXTURE_CUBE_MAP_NEGATIVE_Z. + + + Change the last paragraph on page 160 to say (spec changes identical + to EXT_texture_array): + + "Currently the target arguments of TexSubImage1D and CopyTexSubImage1D + must be TEXTURE_1D, the target arguments of TexSubImage2D and + CopyTexSubImage2D must be one of TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, + TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, + TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, + TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z, and the + target arguments of TexSubImage3D and CopyTexSubImage3D must be + TEXTURE_3D or TEXTURE_2D_ARRAY_EXT. ..." + + + -- Section 3.8.4 "Texture Parameters" + + Change the first paragraph (page 166) to say: + + "Various parameters control how the texel array is treated when + specified or changed, and when applied to a fragment. Each parameter is + set by calling + + void TexParameter{if}(enum target, enum pname, T param); + void TexParameter{if}v(enum target, enum pname, T params); + + target is the target, either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, + TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT." + + + -- Section 3.8.8 "Texture Minification" in the section "Scale Factor and Level of Detail" + + Change the first paragraph (page 172) to say: + + "Let s(x,y) be the function that associates an s texture coordinate + with each set of window coordinates (x,y) that lie within a primitive; + define t(x,y) and r(x,y) analogously. Let u(x,y) = w_t * s(x,y), + v(x,y) = h_t * t(x,y), and w(x,y) = d_t * r(x,y), where w_t, h_t, + and d_t are as defined by equations 3.15, 3.16, and 3.17 with + w_s, h_s, and d_s equal to the width, height, and depth of the + image array whose level is level_base. For a one-dimensional + texture or a one-dimensional array texture, define v(x,y) = 0 and + w(x,y) = 0; for a two-dimensional texture or a two-dimensional array + texture, define w(x,y) = 0..." + + -- Section 3.8.8 "Texture Minification" in the section "Mipmapping" + + Change the third paragraph (page 174) to say: + + "For a two-dimensional texture, two-dimensional array texture, or + cube map texture," + + Change the fourth paragraph (page 174) to say: + + "And for a one-dimensional texture or a one-dimensional array texture," + + After the first paragraph (page 175) add: + + "For one-dimensional array textures, h_b and d_b are treated as 1, + regardless of the actual values, when performing mipmap calculations. + For two-dimensional array textures, d_b is always treated as one, + regardless of the actual value, when performing mipmap calculations." + + -- Section 3.8.8 "Automatic Mipmap Generation" in the section "Mipmapping" + + Change the third paragraph (page 176) to say (spec changes identical + to EXT_texture_array): + + "The contents of the derived arrays are computed by repeated, filtered + reduction of the level_base array. For one- and two-dimensional array + textures, each layer is filtered independently. ..." + + -- Section 3.8.8 "Manual Mipmap Generation" in the section "Mipmapping" + + Change first paragraph to say (spec changes identical to + EXT_texture_array): + + "Mipmaps can be generated manually with the command + + void GenerateMipmapEXT(enum target); + + where is one of TEXTURE_1D, TEXTURE_2D, TEXTURE_CUBE_MAP, + TEXTURE_3D, TEXTURE_1D_ARRAY, or TEXTURE_2D_ARRAY. Mipmap generation + affects the texture image attached to . ..." + + -- Section 3.8.10 "Texture Completeness" + + Change the second paragaph (page 177) to say (spec changes identical + to EXT_texture_array): + + "For one-, two-, or three-dimensional textures and one- or + two-dimensional array textures, a texture is complete if the following + conditions all hold true:" + + -- Section 3.8.11 "Texture State and Proxy State" + + Change the second and third paragraphs (page 179) to say (spec changes + identical to EXT_texture_array): + + "In addition to image arrays for one-, two-, and three-dimensional + textures, one- and two-dimensional array textures, and the six image + arrays for the cube map texture, partially instantiated image arrays + are maintained for one-, two-, and three-dimensional textures and one- + and two-dimensional array textures. Additionally, a single proxy image + array is maintained for the cube map texture. Each proxy image array + includes width, height, depth, border width, and internal format state + values, as well as state for the red, green, blue, alpha, luminance, + and intensity component resolutions. Proxy image arrays do not include + image data, nor do they include texture properties. When TexImage3D is + executed with target specified as PROXY_TEXTURE_3D, the + three-dimensional proxy state values of the specified level-of-detail + are recomputed and updated. If the image array would not be supported + by TexImage3D called with target set to TEXTURE 3D, no error is + generated, but the proxy width, height, depth, border width, and + component resolutions are set to zero. If the image array would be + supported by such a call to TexImage3D, the proxy state values are set + exactly as though the actual image array were being specified. No pixel + data are transferred or processed in either case. + + Proxy arrays for one- and two-dimensional textures and one- and + two-dimensional array textures are operated on in the same way when + TexImage1D is executed with target specified as PROXY_TEXTURE_1D, + TexImage2D is executed with target specified as PROXY_TEXTURE_2D or + PROXY_TEXTURE_1D_ARRAY_EXT, or TexImage3D is executed with target + specified as PROXY_TETXURE_2D_ARRAY_EXT." + + -- Section 3.8.12 "Texture Objects" + + Change section (page 180) to say (spec changes identical to + EXT_texture_array): + + "In addition to the default textures TEXTURE_1D, TEXTURE_2D, + TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_EXT, + named one-, two-, and three-dimensional, cube map, and one- and + two-dimensional array texture objects can be created and operated upon. + The name space for texture objects is the unsigned integers, with zero + reserved by the GL. + + A texture object is created by binding an unused name to TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or + TEXTURE_2D_ARRAY_EXT. The binding is effected by calling + + void BindTexture(enum target, uint texture); + + with set to the desired texture target and set to + the unused name. The resulting texture object is a new state vector, + comprising all the state values listed in section 3.8.11, set to the + same initial values. If the new texture object is bound to TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or + TEXTURE_2D_ARRAY_EXT, it is and remains a one-, two-, + three-dimensional, cube map, one- or two-dimensional array texture + respectively until it is deleted. + + BindTexture may also be used to bind an existing texture object to + either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, + TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT. The error + INVALID_OPERATION is generated if an attempt is made to bind a texture + object of different dimensionality than the specified target. If the + bind is successful no change is made to the state of the bound texture + object, and any previous binding to target is broken. + + While a texture object is bound, GL operations on the target to which + it is bound affect the bound object, and queries of the target to which + it is bound return state from the bound object. If texture mapping of + the dimensionality of the target to which a texture object is bound is + enabled, the state of the bound texture object directs the texturing + operation. + + In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, + TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_ARRAY_EXT have + one-, two-, three-dimensional, cube map, and one- and two-dimensional + array texture state vectors respectively associated with them. In order + that access to these initial textures not be lost, they are treated as + texture objects all of whose names are 0. The initial one-, two-, + three-dimensional, cube map, one- and two-dimensional array textures + are therefore operated upon, queried, and applied as TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and + TEXTURE_2D_ARRAY_EXT respectively while 0 is bound to the corresponding + targets. + + Change second paragraph on page 181 to say (spec changes identical to + EXT_texture_array): + + "... If a texture that is currently bound to one of the targets + TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, + TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT is deleted, it is as + though BindTexture had been executed with the same target and texture + zero. ..." + + Change second paragraph on page 182 to say (spec changes identical to + EXT_texture_array): + + "The texture object name space, including the initial one-, two-, and + three dimensional, cube map, and one- and two-dimensional array texture + objects, is shared among all texture units. ..." + + + -- Section 3.8.14 "Depth Texture Comparison Modes" in "Texture Comparison Modes" + + Change second through fourth paragraphs (page 188) to say: + + "Let D_t be the depth texture value, in the range [0, 1]. For + texture lookups from one- and two-dimesional, rectangle, and + one-dimensional array targets, let R be the interpolated + texture coordinate, clamped to the range [0, 1]. For texture lookups + from two-dimesional array texture targets, let R be the interpolated + texture coordinate, clamped to the range [0, 1]. Then the + effective texture value L_t, I_t, or A_t is computed as follows: + + If the value of TEXTURE_COMPARE_MODE is NONE, then + + r = Dt + + If the value of TEXTURE_COMPARE_MODE is + COMPARE_REF_DEPTH_TO_TEXTURE_EXT), then r depends on the texture + comparison function as shown in table 3.27." + + -- Section 3.8.15 "Texture Application" + + Change the first paragraph (page 189) to say: + + "Texturing is enabled or disabled using the generic Enable and Disable + commands, respectively, with the symbolic constants TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or + TEXTURE_2D_ARRAY_EXT to enable one-, two-, three-dimensional, cube + map, one-dimensional array, or two-dimensional array texture, + respectively. If both two- and one-dimensional textures are enabled, + the two-dimensional texture is used. If the three-dimensional and + either of the two- or one-dimensional textures is enabled, the + three-dimensional texture is used. If the cube map texture and any of + the three-, two-, or one-dimensional textures is enabled, then cube map + texturing is used. If one-dimensional array texture is enabled and any + of cube map, three-, two-, or one-dimensional textures is enabled, + one-dimensional array texturing is used. If two-dimensional array + texture is enabled and any of cube map, three-, two-, one-dimensional + textures or one-dimensional array texture is enabled, two-dimensional + array texturing is used..." + + -- Section 3.11.2 of ARB_fragment_program (Fragment Program Grammar and Restrictions): + + (mostly add to existing grammar rules) + + ::= "MESA_texture_array" + + ::= "1D" + | "2D" + | "3D" + | "CUBE" + | "RECT" + | (if program option is present) + | (if program option is present) + + ::= "ARRAY1D" + | "ARRAY2D" + + ::= "SHADOW1D" + | "SHADOW2D" + | "SHADOWRECT" + | (if program option is present) + + ::= "SHADOWARRAY1D" + | "SHADOWARRAY2D" + + + -- Add Section 3.11.4.5.4 "Texture Stack Option" + + "If a fragment program specifies the "MESA_texture_array" program + option, the rule is modified to add the texture targets + ARRAY1D and ARRAY2D (See Section 3.11.2)." + + -- Section 3.11.6 "Fragment Program Texture Instruction Set" + + (replace 1st and 2nd paragraphs with the following paragraphs) + + "The first three texture instructions described below specify the + mapping of 4-tuple input vectors to 4-tuple output vectors. + The sampling of the texture works as described in section 3.8, + except that texture environments and texture functions are not + applicable, and the texture enables hierarchy is replaced by explicit + references to the desired texture target (i.e., 1D, 2D, 3D, cube map, + rectangle, ARRAY1D, ARRAY2D). These texture instructions specify + how the 4-tuple is mapped into the coordinates used for sampling. The + following function is used to describe the texture sampling in the + descriptions below: + + vec4 TextureSample(vec4 coord, float lodBias, int texImageUnit, + enum texTarget); + + Note that not all four components of the texture coordinates + are used by all texture targets. Component usage for each + is defined in table X. + + coordinates used + texTarget Texture Type s t r layer shadow + ---------------- --------------------- ----- ----- ------ + 1D TEXTURE_1D x - - - - + 2D TEXTURE_2D x y - - - + 3D TEXTURE_3D x y z - - + CUBE TEXTURE_CUBE_MAP x y z - - + RECT TEXTURE_RECTANGLE_ARB x y - - - + ARRAY1D TEXTURE_1D_ARRAY_EXT x - - y - + ARRAY2D TEXTURE_2D_ARRAY_EXT x y - z - + SHADOW1D TEXTURE_1D x - - - z + SHADOW2D TEXTURE_2D x y - - z + SHADOWRECT TEXTURE_RECTANGLE_ARB x y - - z + SHADOWARRAY1D TEXTURE_1D_ARRAY_EXT x - - y z + SHADOWARRAY2D TEXTURE_2D_ARRAY_EXT x y - z w + + Table X: Texture types accessed for each of the , and + coordinate mappings. The "coordinates used" column indicate the + input values used for each coordinate of the texture lookup, the + layer selector for array textures, and the reference value for + texture comparisons." + + -- Section 3.11.6.2 "TXP: Project coordinate and map to color" + + Add to the end of the section: + + "A program will fail to load if the TXP instruction is used in + conjunction with the SHADOWARRAY2D target." + +Additions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment Operations) + + -- Section 4.4.2.3 "Attaching Texture Images to a Framebuffer" + + Add to the end of the section (spec changes identical to + EXT_texture_array): + + "The command + + void FramebufferTextureLayerEXT(enum target, enum attachment, + uint texture, int level, int layer); + + operates identically to FramebufferTexture3DEXT, except that it + attaches a single layer of a three-dimensional texture or a one- or + two-dimensional array texture. is an integer indicating the + layer number, and is treated identically to the parameter in + FramebufferTexture3DEXT. The error INVALID_VALUE is generated if + is negative. The error INVALID_OPERATION is generated if + is non-zero and is not the name of a three dimensional + texture or one- or two-dimensional array texture. Unlike + FramebufferTexture3D, no parameter is accepted. + + If is non-zero and the command does not result in an error, + the framebuffer attachment state corresponding to is + updated as in the other FramebufferTexture commands, except that + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT is set to ." + + -- Section 4.4.4.1 "Framebuffer Attachment Completeness" + + Add to the end of the list of completeness rules (spec changes + identical to EXT_texture_array): + + "* If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or + two-dimensional array texture, then + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be smaller than the + number of layers in the texture." + +Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions) + + -- Section 5.4 "Display Lists" + + Change the first paragraphi on page 242 to say (spec changes + identical to EXT_texture_array): + + "TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are + executed immediately when called with the corresponding proxy arguments + PROXY_TEXTURE_3D or PROXY_TEXTURE_2D_ARRAY_EXT; PROXY_TEXTURE_2D, + PROXY_TEXTURE_CUBE_MAP, or PROXY_TEXTURE_1D_ARRAY_EXT; + PROXY_TEXTURE_1D; PROXY_HISTOGRAM; and PROXY_COLOR_TABLE, + PROXY_POST_CONVOLUTION_COLOR_TABLE, or + PROXY_POST_COLOR_MATRIX_COLOR_TABLE." + +Additions to Chapter 6 of the OpenGL 2.0 Specification (State and State Requests) + + -- Section 6.1.3 "Enumerated Queries" + + Add after the line beginning "If the value of + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE" (spec changes + identical to EXT_texture_array): + + "If is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT and the + texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT is a + three-dimensional texture or a one- or two-dimensional array texture, + then will contain the number of texture layer attached to the + attachment point. Otherwise, will contain the value zero." + + -- Section 6.1.4 "Texture Queries" + + Change the first three paragraphs (page 248) to say (spec changes + identical to EXT_texture_array): + + "The command + + void GetTexImage(enum tex, int lod, enum format, + enum type, void *img); + + is used to obtain texture images. It is somewhat different from the + other get commands; tex is a symbolic value indicating which texture + (or texture face in the case of a cube map texture target name) is to + be obtained. TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY_EXT, + and TEXTURE_2D_ARRAY_EXT indicate a one-, two-, or three-dimensional + texture, or one- or two-dimensional array texture, respectively. + TEXTURE_CUBE_MAP_POSITIVE_X, ... + + GetTexImage obtains... from the first image to the last for + three-dimensional textures. One- and two-dimensional array textures + are treated as two- and three-dimensional images, respectively, where + the layers are treated as rows or images. These groups are then... + + For three-dimensional and two-dimensional array textures, pixel storage + operations are applied as if the image were two-dimensional, except + that the additional pixel storage state values PACK_IMAGE_HEIGHT and + PACK_SKIP_IMAGES are applied. ..." + +Additions to Appendix A of the OpenGL 2.0 Specification (Invariance) + + None + +Additions to the AGL/GLX/WGL Specifications + + None + +GLX Protocol + + None + +Dependencies on ARB_fragment_program + + If ARB_fragment_program is not supported, the changes to section 3.11 + should be ignored. + +Dependencies on EXT_framebuffer_object + + If EXT_framebuffer_object is not supported, the changes to section + 3.8.8 ("Manual Mipmap Generation"), 4.4.2.3, and 6.1.3 should be ignored. + +Dependencies on EXT_texture_compression_s3tc and NV_texture_compression_vtc + + (Identical dependency as EXT_texture_array.) + + S3TC texture compression is supported for two-dimensional array textures. + When is TEXTURE_2D_ARRAY_EXT, each layer is stored independently + as a compressed two-dimensional textures. When specifying or querying + compressed images using one of the S3TC formats, the images are provided + and/or returned as a series of two-dimensional textures stored + consecutively in memory, with the layer closest to zero specified first. + For array textures, images are not arranged in 4x4x4 or 4x4x2 blocks as in + the three-dimensional compression format provided in the + EXT_texture_compression_vtc extension. Pixel store parameters, including + those specific to three-dimensional images, are ignored when compressed + image data are provided or returned, as in the + EXT_texture_compression_s3tc extension. + + S3TC compression is not supported for one-dimensional texture targets in + EXT_texture_compression_s3tc, and is not supported for one-dimensional + array textures in this extension. If compressed one-dimensional arrays + are needed, use a two-dimensional texture with a height of one. + + This extension allows the use of the four S3TC internal format types in + TexImage3D, CompressedTexImage3D, and CompressedTexSubImage3D calls. + +Errors + + None + +New State + + (add to table 6.15, p. 276) + + Initial + Get Value Type Get Command Value Description Sec. Attribute + ---------------------------- ----- ----------- ----- -------------------- ------ --------- + TEXTURE_BINDING_1D_ARRAY_EXT 2*xZ+ GetIntegerv 0 texture object bound 3.8.12 texture + to TEXTURE_1D_ARRAY + TEXTURE_BINDING_2D_ARRAY_EXT 2*xZ+ GetIntegerv 0 texture object bound 3.8.12 texture + to TEXTURE_2D_ARRAY + + +New Implementation Dependent State + + (add to Table 6.32, p. 293) + + Minimum + Get Value Type Get Command Value Description Sec. Attribute + ---------------------------- ---- ----------- ------- ------------------ ----- --------- + MAX_TEXTURE_ARRAY_LAYERS_EXT Z+ GetIntegerv 64 maximum number of 3.8.1 - + layers for texture + arrays + +Issues + + (1) Is "texture stack" a good name for this functionality? + + NO. The name is changed to "array texture" to match the + nomenclature used by GL_EXT_texture_array. + + (2) Should the R texture coordinate be treated as normalized or + un-normalized? If it were un-normalized, floor(R) could be thought + of as a direct index into the array texture. This may be more + convenient for applications. + + RESOLVED. All texture coordinates are normalized. The issue of + un-normalized texture coordinates has been discussed in the ARB + before and should be left for a layered extension. + + RE-RESOLVED. The R coordinate is un-normalized. Accessing an array + using [0, layers-1] coordinates is much more natural. + + (3) How does LOD selection work for stacked textures? + + RESOLVED. For 2D array textures the R coordinate is ignored, and + the LOD selection equations for 2D textures are used. For 1D + array textures the T coordinate is ignored, and the LOD selection + equations for 1D textures are used. The expected usage is in a + fragment program with an explicit LOD selection. + + (4) What is the maximum size of a 2D array texture? Is it the same + as for a 3D texture, or should a new query be added? How about for 1D + array textures? + + RESOLVED. A new query is added. + + (5) How are array textures exposed in GLSL? + + RESOLVED. Use GL_EXT_texture_array. + + (6) Should a 1D array texture also be exposed? + + RESOLVED. For orthogonality, yes. + + (7) How are stacked textures attached to framebuffer objects? + + RESOLVED. Layers of both one- and two-dimensional array textures + are attached using FreambufferTextureLayerEXT. Once attached, the + array texture layer behaves exactly as either a one- or + two-dimensional texture. + + (8) How is this extension related to GL_EXT_texture_array? + + This extension adapats GL_MESAX_texture_stack to the notation, + indexing, and FBO access of GL_EXT_texture_array. This extension + replaces the GLSL support of GL_EXT_texture_array with + GL_ARB_fragment_program support. + + Assembly program support is also provided by GL_NV_gpu_program4. + GL_NV_gpu_program4 also adds support for other features that are + specific to Nvidia hardware, while this extension adds only support + for array textures. + + Much of text of this extension that has changed since + GL_MESAX_texture_stack comes directly from either + GL_EXT_texture_array or GL_NV_gpu_program4. + +Revision History + + ||2005/11/15||0.1||idr||Initial draft MESAX version.|| + ||2005/12/07||0.2||idr||Added framebuffer object interactions.|| + ||2005/12/12||0.3||idr||Updated fragment program interactions.|| + ||2007/05/16||0.4||idr||Converted to MESA_texture_array. Brought in line with EXT_texture_array and NV_gpu_program4.|| diff -Nru xpsb-glx-0.19/mesa/docs/MESA_window_pos.spec xpsb-glx-0.19/mesa/docs/MESA_window_pos.spec --- xpsb-glx-0.19/mesa/docs/MESA_window_pos.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_window_pos.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,126 @@ +Name + + MESA_window_pos + +Name Strings + + GL_MESA_window_pos + +Contact + + Brian Paul, brian.paul 'at' tungstengraphics.com + +Status + + Shipping (since Mesa version 1.2.8) + +Version + + +Number + + 197 + +Dependencies + + OpenGL 1.0 is required. + The extension is written against the OpenGL 1.2 Specification + +Overview + + In order to set the current raster position to a specific window + coordinate with the RasterPos command, the modelview matrix, projection + matrix and viewport must be set very carefully. Furthermore, if the + desired window coordinate is outside of the window's bounds one must + rely on a subtle side-effect of the Bitmap command in order to circumvent + frustum clipping. + + This extension provides a set of functions to directly set the + current raster position, bypassing the modelview matrix, the + projection matrix and the viewport to window mapping. Furthermore, + clip testing is not performed. + + This greatly simplifies the process of setting the current raster + position to a specific window coordinate prior to calling DrawPixels, + CopyPixels or Bitmap. + +New Procedures and Functions + + void WindowPos2dMESA(double x, double y) + void WindowPos2fMESA(float x, float y) + void WindowPos2iMESA(int x, int y) + void WindowPos2sMESA(short x, short y) + void WindowPos2ivMESA(const int *p) + void WindowPos2svMESA(const short *p) + void WindowPos2fvMESA(const float *p) + void WindowPos2dvMESA(const double *p) + void WindowPos3iMESA(int x, int y, int z) + void WindowPos3sMESA(short x, short y, short z) + void WindowPos3fMESA(float x, float y, float z) + void WindowPos3dMESA(double x, double y, double z) + void WindowPos3ivMESA(const int *p) + void WindowPos3svMESA(const short *p) + void WindowPos3fvMESA(const float *p) + void WindowPos3dvMESA(const double *p) + void WindowPos4iMESA(int x, int y, int z, int w) + void WindowPos4sMESA(short x, short y, short z, short w) + void WindowPos4fMESA(float x, float y, float z, float w) + void WindowPos4dMESA(double x, double y, double z, double ) + void WindowPos4ivMESA(const int *p) + void WindowPos4svMESA(const short *p) + void WindowPos4fvMESA(const float *p) + void WindowPos4dvMESA(const double *p) + +New Tokens + + none + +Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation) + + - (2.12, p. 41) Insert after third paragraph: + + Alternately, the current raster position may be set by one of the + WindowPosMESA commands: + + void WindowPos{234}{sidf}MESA( T coords ); + void WindowPos{234}{sidf}vMESA( T coords ); + + WindosPos4MESA takes four values indicating x, y, z, and w. + WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only + x, y, and z with w implicitly set to 1 (or only x and y with z + implicititly set to 0 and w implicitly set to 1). + + WindowPosMESA operates like RasterPos except that the current modelview + matrix, projection matrix and viewport parameters are ignored and the + clip test operation always passes. The current raster position values + are directly set to the parameters passed to WindowPosMESA. The current + color, color index and texture coordinate update the current raster + position's associated data. + +Additions to the AGL/GLX/WGL Specifications + + None + +GLX Protocol + + Not specified at this time. However, a protocol message very similar + to that of RasterPos is expected. + +Errors + + INVALID_OPERATION is generated if WindowPosMESA is called betweeen + Begin and End. + +New State + + None. + +New Implementation Dependent State + + None. + +Revision History + + * Revision 1.0 - Initial specification + * Revision 1.1 - Minor clean-up (7 Jan 2000, Brian Paul) + diff -Nru xpsb-glx-0.19/mesa/docs/MESA_ycbcr_texture.spec xpsb-glx-0.19/mesa/docs/MESA_ycbcr_texture.spec --- xpsb-glx-0.19/mesa/docs/MESA_ycbcr_texture.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MESA_ycbcr_texture.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,204 @@ +Name + + MESA_ycbcr_texture + +Name Strings + + GL_MESA_ycbcr_texture + +Contact + + Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com) + Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com) + +Status + + Shipping (Mesa 4.0.4 and later) + +Version + + 1.0 + +Number + + TBD + +Dependencies + + OpenGL 1.0 or later is required + This extensions is written against the OpenGL 1.4 Specification. + NV_texture_rectangle effects the definition of this extension. + +Overview + + This extension supports texture images stored in the YCbCr format. + There is no support for converting YCbCr images to RGB or vice versa + during pixel transfer. The texture's YCbCr colors are converted to + RGB during texture sampling, after-which, all the usual per-fragment + operations take place. Only 2D texture images are supported (not + glDrawPixels, glReadPixels, etc). + + A YCbCr pixel (texel) is a 16-bit unsigned short with two components. + The first component is luminance (Y). For pixels in even-numbered + image columns, the second component is Cb. For pixels in odd-numbered + image columns, the second component is Cr. If one were to convert the + data to RGB one would need to examine two pixels from columns N and N+1 + (where N is even) to deduce the RGB color. + +IP Status + + None + +Issues + + None + +New Procedures and Functions + + None + +New Tokens + + Accepted by the and parameters of + TexImage2D and TexSubImage2D: + + YCBCR_MESA 0x8757 + + Accepted by the parameter of TexImage2D and TexSubImage2D: + + UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */ + UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */ + +Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) + + In section 3.6.4, Rasterization of Pixel Rectangles, on page 101, + add the following to Table 3.8 (Packed pixel formats): + + type Parameter GL Data Number of Matching + Token Name Type Components Pixel Formats + -------------- ------- ---------- ------------- + UNSIGNED_SHORT_8_8_MESA ushort 2 YCBCR_MESA + UNSIGNED_SHORT_8_8_REV_MESA ushort 2 YCBCR_MESA + + + In section 3.6.4, Rasterization of Pixel Rectangles, on page 102, + add the following to Table 3.10 (UNSIGNED_SHORT formats): + + UNSIGNED_SHORT_8_8_MESA: + + 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + +-------------------------------+-------------------------------+ + | 1st | 2nd | + +-------------------------------+-------------------------------+ + + UNSIGNED_SHORT_8_8_REV_MESA: + + 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + +-------------------------------+-------------------------------+ + | 2nd | 1st | + +-------------------------------+-------------------------------+ + + + In section 3.6.4, Rasterization of Pixel Rectangles, on page 104, + add the following to Table 3.12 (Packed pixel fiedl assignments): + + First Second Third Fourth + Format Element Element Element Element + ------ ------- ------- ------- ------- + YCBCR_MESA luminance chroma + + + In section 3.8.1, Texture Image Specification, on page 125, add + another item to the list of TexImage2D and TexImage3D equivalence + exceptions: + + * The value of internalformat and format may be YCBCR_MESA to + indicate that the image data is in YCbCr format. type must + be either UNSIGNED_SHORT_8_8_MESA or UNSIGNED_SHORT_8_8_REV_MESA + as seen in tables 3.8 and 3.10. Table 3.12 describes the mapping + between Y and Cb/Cr to the components. + If NV_texture_rectangle is supported target may also be + TEXTURE_RECTANGLE_NV or PROXY_TEXTURE_RECTANGLE_NV. + All pixel transfer operations are bypassed. The texture is stored as + YCbCr, not RGB. Queries of the texture's red, green and blue component + sizes will return zero. The YCbCr colors are converted to RGB during + texture sampling using an implementation dependent conversion. + + + In section 3.8.1, Texture Image Specification, on page 126, add + another item to the list of TexImage1D and TexImage2D equivalence + exceptions: + + * The value of internalformat and format can not be YCBCR_MESA. + + + In section 3.8.2, Alternate Texture Image Specification Commands, on + page 129, insert this paragraph after the first full paragraph on the + page: + + "If the internal storage format of the image being updated by + TexSubImage2D is YCBCR_MESA then format must be YCBCR_MESA. + The error INVALID_OPERATION will be generated otherwise." + + +Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment +Operations and the Frame Buffer) + + None + +Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions) + + None + +Additions to Chapter 6 of the OpenGL 1.4 Specification (State and +State Requests) + + None + +Additions to Appendix A of the OpenGL 1.4 Specification (Invariance) + + None + +Additions to the AGL/GLX/WGL Specifications + + None + +GLX Protocol + + None + +Errors + + INVALID_ENUM is generated by TexImage2D if is + MESA_YCBCR but is not MESA_YCBCR. + + INVALID_ENUM is generated by TexImage2D if is MESA_YCBCR but + is not MESA_YCBCR. + + INVALID_VALUE is generated by TexImage2D if is MESA_YCBCR and + is MESA_YCBCR and is not zero. + + INVALID_OPERATION is generated by TexSubImage2D if the internal image + format is YCBCR_MESA and is not YCBCR_MESA. + + INVALID_OPERATION is generated by CopyTexSubImage2D if the internal + image is YCBCR_MESA. + +New State + + Edit table 6.16 on page 231: change the type of TEXTURE_INTERNAL_FORMAT + from n x Z42 to n x Z43 to indicate that internal format may also be + YCBCR_MESA. + +Revision History + + 20 September 2002 - Initial draft + 29 April 2003 - minor updates + 3 September 2003 - further clarify when YCbCr->RGB conversion takes place + 19 September 2003 - a few more updates prior to submitting to extension + registry. + 3 April 2004 - fix assorted inaccuracies diff -Nru xpsb-glx-0.19/mesa/docs/MiniGLX.html xpsb-glx-0.19/mesa/docs/MiniGLX.html --- xpsb-glx-0.19/mesa/docs/MiniGLX.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/MiniGLX.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,534 @@ + + + + Mini GLX Specification + + +

    +
    Mini GLX Specification
    +

    +

    +
    Tungsten Graphics, Inc.
    +
    +January 20, 2003
    +
    +
    +

    +

    Copyright © 2002-2003 by Tungsten Graphics, Inc., Cedar Park, +Texas. All Rights Reserved.
    +
    +Permission is granted to make and distribute verbatim copies of this +document provided the copyright notice and this permission notice are +preserved on all copies.
    +
    +

    +

    1. Introduction

    +

    The Mini GLX interface facilitates OpenGL rendering on embedded +devices. The interface is a subset of the GLX interface, plus a minimal +set of Xlib-like functions.

    +

    Programs written to the Mini GLX specification should run unchanged +on systems with the X Window System and the GLX extension. The intention +is to allow flexibility for prototyping and testing.

    +

    This document serves as both the reference guide and programming +guide for Mini GLX.
    +
    +

    +

    2. Mini GLX Concepts

    +

    The OpenGL specification does not describe how OpenGL rendering +contexts and drawing surfaces (i.e. the frame buffer) are created and +managed. Rather, this is handled by an OpenGL window system interface, +such as Mini GLX.

    +

    There are three main datatypes or resources managed by Mini GLX. The +resources and their corresponding GLX or Xlib data types are:

    + + + + + + + + + + + + + + + + + + + +
    ResourceData type
    pixel formatsX Visual and XVisualInfo
    drawing surfacesX Window or GLXDrawable
    rendering contextsGLXContext
    +

    Pixel formats or X Visuals describe the per-pixel attributes of the +frame buffer. For example, bits per color component, Z buffer size, +stencil size, TrueColor vs PseudoColor, etc.

    +

    Drawing surfaces or X Windows typically describe a spatial +allocation of the frame buffer (i.e. the position and size of a +rectangular region of pixels). Since MiniGLX doesn't really support a +window system, the window is effectively the entire frame buffer.

    +

    A rendering context represents the current OpenGL state such as +current drawing color, line width, blending mode, texture parameters, +etc. Several rendering contexts can be created but only one can be in +use at any given time.

    +

    The Mini GLX interface provides all the functions needed for +choosing pixel formats, create drawing surfaces, creating rendering +contexts and binding rendering contexts to drawing surfaces.
    +
    +

    +

    3. Using Mini GLX

    +

    To use the Mini GLX interface in your application, include the +GL/miniglx.h header file at compile time:

    +
    #include <GL/miniglx.h>
    +
    +Applications should link with libGL.so (i.e. gcc +myprogram.o -lGL -o myprogram).  libGL.so implements the +MiniGLX API functions and, in turn, loads a hardware-specific device +driver (such as radeon_dri.so) at runtime.  The +environment variable LIBGL_DRIVERS_PATH should name the +directory where these modules are located.
    +
    +The remainder of this section describes the MiniGLX API functions.
    +
    +

    3.1 Initialization

    +

    The XOpenDisplay function is used to initialize the graphics system:

    +
    +
    Display *XOpenDisplay(const char *displayname)
    +
    +

    The displayName parameter is currently ignored in Mini +GLX. It is recommended that NULL be passed as thedisplayName +parameter.

    +

    If XOpenDisplay is able to initialize the graphics system a pointer +to a Display will be returned. Otherwise, NULL will be returned.

    +

    3.2 Choosing a Visual

    +

    A visual (i.e. pixel format) must be chosen before a drawing surface +or rendering context can be created. This is done with the +glXChooseVisual function:

    +
    +
    XVisualInfo *glXChooseVisual(Display *dpy, int screen, const int *attribList)
    +
    +

    dpy is a pointer to the display returned by +XOpenDisplay.

    +

    screen is currently ignored by Mini GLX and should be +zero.

    +

    attribList is a list of GLX attributes which describe +the desired pixel format. It is terminated by the token None. +The attributes are as follows:

    +
    +
    +
    GLX_USE_GL
    +
    This attribute should always be present in order to maintain +compatibility with GLX.
    +
    GLX_RGBA
    +
    If present, only RGBA pixel formats will be considered. +Otherwise, only color index formats are considered.
    +
    GLX_DOUBLEBUFFER
    +
    if present, only double-buffered pixel formats will be chosen.
    +
    GLX_RED_SIZE n
    +
    Must be followed by a non-negative integer indicating the +minimum number of bits per red pixel component that is acceptable.
    +
    GLX_GREEN_SIZE n
    +
    Must be followed by a non-negative integer indicating the +minimum number of bits per green pixel component that is acceptable.
    +
    GLX_BLUE_SIZE n
    +
    Must be followed by a non-negative integer indicating the +minimum number of bits per blue pixel component that is acceptable.
    +
    GLX_ALPHA_SIZE n
    +
    Must be followed by a non-negative integer indicating the +minimum number of bits per alpha pixel component that is acceptable.
    +
    GLX_STENCIL_SIZE n
    +
    Must be followed by a non-negative integer indicating the +minimum number of bits per stencil value that is acceptable.
    +
    None
    +
    This token is used to terminate the attribute list.
    +
    +
    +

    glXChooseVisual will return a pointer to an XVisualInfo object which +most closely matches the requirements of the attribute list. If there +is no visual which matches the request, NULL will be returned.

    +

    Note that visuals with accumulation buffers and depth buffers are +not available.
    +
    +

    +

    3.3 Creating a Drawing Surface

    +

    Drawing surfaces are created as X windows.  For Mini GLX, +windows are full-screen; they cover the entire frame buffer. + Also, Mini GLX imposes a limit of one window. A second window +cannot be created until the first one is destroyed.

    +

    3.3.1 Window Creation

    +

    The XCreateWindow function is used to create a drawing surface:

    +
    +
    Window XCreateWindow( Display *display,
    Window parent,
    int x, int y,
    unsigned int width, unsigned int height,
    unsigned int borderWidth,
    int depth,
    unsigned int class,
    Visual *visual,
    unsigned long valuemask,
    XSetWindowAttributes *attributes )
    +
    +

    The parameters are as follows:

    +
    +
    +
    display
    +
    A Display pointer, as returned by XOpenDisplay.
    +
    parent
    +
    The parent window for the new window. For Mini GLX, this +should beRootWindow(dpy, 0).
    +
    x, y
    +
    The position of the window. For Mini GLX, both values should +be zero.
    +
    width, height
    +
    The size of the window. For Mini GLX, this specifies the +desired screen size such as 1024, 768 or 1280, 1024.
    +
    borderWidth
    +
    This parameter should be zero.
    +
    depth
    +
    The pixel depth for the window. For Mini GLX this should be +the depth found in the XVisualInfo object returned by glxChooseVisual.
    +
    class
    +
    The window class. For Mini GLX this value should be InputOutput.
    +
    visual
    +
    This parameter should be the visual field of the XVisualInfo +object returned by glxChooseVisual.
    +
    valuemask
    +
    This parameter indicates which fields of the XSetWindowAttributes +are to be used. For Mini GLX this is typically the bitmaskCWBackPixel +| CWBorderPixel | CWColormap.
    +
    attributes
    +
    Initial window attributes. Of the fields in the XSetWindowAttributes +structure, thebackground_pixel, border_pixel +and colormap fields should be set.  See the discussion +below regarding colormaps.
    +
    +
    +

    XCreateWindow will return a window handle if it succeeds +or zero if it fails.

    +

    3.3.2 Window Mapping

    +

    To display the window the XMapWindow function must be called:

    +
    +
    void XMapWindow(Display *dpy, Window w)
    +
    +

    This function does nothing in Mini GLX but is required for Xlib/GLX +compatibility

    +

    3.3.3 Colormaps
    +

    +

    Xlib requires specification of a colormap when creating a window. + For purposes of interoperability, Mini GLX requires this as well, +though the colormap is not actually used.  The XCreateColormap +function is used to create a colormap:

    +
    Colormap XCreateColormap(Display *dpy, Window window, +Visual *visual, int alloc)
    +
    +

    The parameters are as follows:
    +

    +
    +
    +
    dpy
    +
    The display handle as returned by XOpenDisplay.
    +
    window
    +
    This parameter is ignored by Mini GLX but should be the value +returned by the RootWindow(dpy, 0) macro.
    +
    +
    visual
    +
    This parameter is ignored by Mini GLX but should be the visual +field of the XVisualInfo object returned by glXChooseVisual.
    +
    alloc
    +
    This parameter is ignored by Mini GLX but should be set to AllocNone.
    +
    +
    +
    +

    3.4 Creating a Rendering Context

    +

    An OpenGL rendering context is created with the glXCreateContext +function:

    +
    +
    GLXContext glXCreateContext(Display *dpy, XVisualInfo *visInfo, GLXContext shareList, Bool direct)
    +
    +

    The parameters are as follows:

    +
    +
    +
    dpy
    +
    The display handle as returned by XOpenDisplay.
    +
    visInfo
    +
    The visual as returned by glXChooseVisual.
    +
    shareList
    +
    If non-zero, texture objects and display lists are shared with +the named rendering context. If zero, texture objects and display lists +will (initially) be private to this context. They may be shared when a +subsequent context is created.
    +
    direct
    +
    Specifies whether direct or indirect rendering is desired. For +Mini GLX this value is ignored but it should be set to True.
    +
    +
    +

    glXCreateContext will return a GLXContext handle if it +succeeds or zero if it fails due to invalid parameter or insufficient +resources.
    +
    +

    +

    3.5 Binding a Rendering Context

    +

    The final step before beginning OpenGL rendering is to bind (i.e. +activate) a rendering context and drawing surface with the +glXMakeCurrent function:

    +
    +
    Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
    +
    +

    The parameters are as follows:

    +
    +
    +
    dpy
    +
    The display handle, as returned by XOpenDisplay.
    +
    drawable
    +
    The window or drawable to bind to the rendering context. This +should be the value returned by XCreateWindow.
    +
    ctx
    +
    The rendering context to bind, as returned by glXCreateContext.
    +
    +
    +

    If glXMakeCurrent succeeds True is returned. Otherwise False is +returned to indicate an invalid display, window or context parameter.

    +

    After the rendering context has been bound to the drawing surface +OpenGL rendering can begin.

    +

    The current rendering context may be unbound by calling +glXMakeCurrent with the window and context parameters set to zero.

    +

    An application may create any number of rendering contexts and bind +them as needed. Note that binding a rendering context is generally not a +light-weight operation.  Most simple OpenGL applications create +only one rendering context.
    +
    +

    +

    3.6 Color Buffer Swapping

    +

    A double buffered window has two color buffers: a front buffer and a +back buffer. Normally, rendering is directed to the back buffer while +the front buffer is displayed. When rendering of a frame is finished +the front and back buffers are swapped to provide the illusion of +instanteous screen updates.

    +

    The color buffers for a particular window (i.e. drawable) may be +swapped with the glXSwapBuffers command:

    +
    +
    void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
    +
    +Any pending rendering commands will be completed before the buffer swap +takes place.
    +
    +Calling glXSwapBuffers on a window which is single-buffered has no +effect.
    +
    +

    3.7 Releasing Resources

    +

    3.7.1 Releasing Rendering Contexts

    +

    A rendering context may be destroyed by calling glXDestroyContext:

    +
    +
    void glXDestroyContext(Display *dpy, GLXContext ctx)
    +
    +

    3.7.2 Releasing Windows

    +

    A window may be destroyed by calling XDestroyWindow:

    +
    +
    void XDestroyWindow(Display *dpy, Window window)
    +
    +

    3.7.3 Releasing Visuals

    +

    An XVisualInfo object may be freed by calling XFree:

    +
    +
    void XFree(void *data)
    +
    +

    3.7.4 Releasing Colormaps

    +

    A colormap may be freed by calling XFreeColormap:

    +
    +
    void XFreeColormap(Display *dpy, Colormap colormap)
    +
    +

    3.7.4 Releasing Display Resources

    +

    When the application is about to exit, the resources associated with +the graphics system can be released by calling XCloseDisplay:

    +
    +
    void XCloseDisplay(Display *dpy)
    +
    +

    The display handle becomes invalid at this point.
    +
    +

    +

    3.8 Query Functions

    +

    3.8.1 Querying Available Visuals

    +A list of all available visuals can be obtained with the XGetVisualInfo +function:
    +
    +
    XVisualInfo +*XGetVisualInfo(Display *dpy, long vinfo_mask, XVisualInfo +*vinfo_template, int *nitems_return)
    +
    +
    +The parameters are as follows:
    +
    +
    +
    dpy
    +
    The display handle, as returned by XOpenDisplay.
    +
    vinfo_mask
    +
    A bitmask indicating which fields of the vinfo_template are to +be matched.  The value must be VisualScreenMask.
    +
    vinfo_template
    +
    A template whose fields indicate which visual attributes must +be matched by the results.  The screen field of this structure must +be zero.
    +
    nitems_return
    +
    Returns the number of visuals returned.
    +
    +
    +The return value is the address of an array of all available visuals.
    +
    +An example of using XGetVisualInfo to get all available visuals follows:
    +
    +
    XVisualInfo visTemplate, *results;
    +int numVisuals;
    +Display *dpy = XOpenDisplay(NULL);
    +visTemplate.screen = 0;
    +results = XGetVisualInfo(dpy, VisualScreenMask, &visTemplate, +&numVisuals);
    +
    +
    +

    3.8.2 Querying Visual Attributes

    +

    The GLX attributes of an X visual may be queried with the +glXGetConfig function:

    +
    +
    int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute, int *value)
    +
    +

    The parameters are as follows:

    +
    +
    +
    dpy
    +
    The display handle, as returned by XOpenDisplay.
    +
    vis
    +
    The visual, as returned by glXChooseVisual.
    +
    attribute
    +
    The attribute to query. The attributes are listed below.
    +
    value
    +
    Pointer to an integer in which the result of the query will be +stored.
    +
    +
    +

    The return value will be zero if no error occurs. + GLX_INVALID_ATTRIBUTE will be returned if the attribute +parameter is invalid.  GLX_BAD_VISUAL will be returned +if the XVisualInfo parameter is invalid.

    +

    The following attributes may be queried:

    +
    +
    +
    GLX_USE_GL
    +
    The result will be True or False to +indicate if OpenGL rendering is supported with the visual. Mini GLX +always return True.
    +
    GLX_RGBA
    +
    The result will be True for RGBA visuals or False +for color index visuals.
    +
    GLX_DOUBLEBUFFER
    +
    The result will be True if the visual has two +color buffers or False if the visual has one color buffer.
    +
    GLX_RED_SIZE
    +
    The result will be the number of red bits per pixel.
    +
    GLX_GREEN_SIZE
    +
    The result will be the number of green bits per pixel.
    +
    GLX_BLUE_SIZE
    +
    The result will be the number of blue bits per pixel.
    +
    GLX_ALPHA_SIZE
    +
    The result will be the number of alpha bits per pixel.
    +
    GLX_DEPTH_SIZE
    +
    The result will be the number of bits per Z value.
    +
    GLX_STENCIL_SIZE
    +
    The result will be the number of bits per stencil value.
    +
    +
    +
    +
    +

    3.8.3 Querying the Current Rendering Context

    +

    The current rendering context can be queried with +glXGetCurrentContext:

    +
    +
    GLXContext glXGetCurrentContext(void)
    +
    +

    Zero will be returned if no context is currently bound.
    +
    +

    +

    3.8.4 Querying the Current Drawable

    +

    The current drawable (i.e. window or drawing surface) can be queried +with glXGetCurrentDrawable:

    +
    +
    GLXDrawable glXGetCurrentDrawable(void)
    +
    +

    Zero will be returned if no drawable is currently bound.
    +
    +

    +

    3.8.5 Function Address Queries

    +

    The glXGetProcAddress function will return the address of any +available OpenGL or Mini GLX function:

    +
    +
    void *glXGetProcAddress(const GLubyte *procName)
    +
    +

    If procName is a valid function name, a pointer to that +function will be returned.  Otherwise, NULL will be returned.

    +

    The purpose of glXGetProcAddress is to facilitate using future +extensions to OpenGL or Mini GLX. If a future version of the library +adds new extension functions they'll be accessible via +glXGetProcAddress. The alternative is to hard-code calls to the new +functions in the application but doing so will prevent linking the +application with older versions of the library.
    +
    +

    +

    3.9 Versioning

    +The Mini GLX version can be queried at run time with glXQueryVersion: +
    +
    Bool glXQueryVersion(Display *dpy, int *major, int *minor)
    +
    +

    major will be set to the major version number andminor +will be set to the minor version number.True will be +returned if the function succeeds. False will be returned +if the function fails due to invalid parameters. The dpy +argument is currently ignored, but should be the value returned by +XOpenDisplay.

    +

    At compile time, the Mini GLX interface version can be tested with +the MINI_GLX_VERSION_1_x preprocessor tokens. For example, if +version 1.0 of Mini GLX is supported, then MINI_GLX_VERSION_1_0 +will be defined. If version 1.1 of Mini GLX is supported, then +MINI_GLX_VERSION_1_1 will be defined.

    +

    At the time of writing the current Mini GLX version is 1.0.
    +
    +

    +

    4.0 Interoperability with GLX and Xlib

    +While Mini GLX strives to be compatible with GLX and Xlib there are +some unavoidable differences which must be taken into consideration.
    +

    4.1 Public vs Private Structures

    +The structure of many X data types is public.  For example, the Display +data type is defined as a structure in /usr/include/X11/Xlib.h and +programmers may access any fields of that structure at will.  Mini +GLX also defines a Display data type but its fields are hidden and not +visiblein miniglx.h.  Duplicating the Xlib +declaration for the Display data type in minigl.h would +require defining a large number of other superfluous Xlib datatypes.
    +
    +Mini GLX users are discouraged from directly accessing the fields of +Xlib data types to maximize portability - though this is unavoidable to +some extent.  For example, the XVisualInfo and XSetWindowAtttributes +data types must be completely public. +

    4.2 Macros

    +In some cases, Xlib defines macros which are meant to be used instead +of direct structure accesses.  For example, the RootWindow(dpy, +screen) macro returns the root window for a given screen on a +given display.  Unfortunately, macros do nothing to aid in ABI +compatibility since they are resolved at compile time instead of at +link/run time.
    +
    +Mini GLX also defines a RootWindow macro since it's +essential for creating windows.  But the implementation of this +macro by Xlib and Mini GLX is completely different.
    +

    4.3 Summary

    +Because Xlib and Mini GLX define data types and macros differently, +Mini GLX applications must be recompiled when retargeting Mini GLX or +native Xlib/GLX.  That is, applications can't simply be re-linked +because of ABI incompatibilities.
    +
    +Nevertheless, the fact that Mini GLX programs can be recompiled for +Xlib and GLX increases portability and flexibility for testing and +prototyping.
    +
    +

    5.0 Example Program

    +

    This section shows an example program which uses the Mini GLX +interface. The program simply draws several frames of a rotating square.
    +

    +

    The program may be compiled for use with Xlib/GLX or Mini GLX by +setting the USE_MINIGLX token to 0 or 1, respectively. + Note that the only difference is the header files which are +included.
    +

    +

    +

    #define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */

    #include <stdio.h>
    #include <stdlib.h>
    #include <GL/gl.h>

    #if USE_MINIGLX
    #include <GL/miniglx.h>
    #else
    #include <GL/glx.h>
    #include <X11/Xlib.h>
    #endif

    /*
    * Create a simple double-buffered RGBA window.
    */
    static Window
    MakeWindow(Display * dpy, unsigned int width, unsigned int height)
    {
    int visAttributes[] = {
    GLX_RGBA,
    GLX_RED_SIZE, 1,
    GLX_GREEN_SIZE, 1,
    GLX_BLUE_SIZE, 1,
    GLX_DOUBLEBUFFER,
    None
    };
    XSetWindowAttributes attr;
    unsigned long attrMask;
    Window root;
    Window win;
    GLXContext ctx;
    XVisualInfo *visinfo;

    root = RootWindow(dpy, 0);

    /* Choose GLX visual / pixel format */
    visinfo = glXChooseVisual(dpy, 0, visAttributes);
    if (!visinfo) {
    printf("Error: couldn't get an RGB, Double-buffered visual\n");
    exit(1);
    }

    /* Create the window */
    attr.background_pixel = 0;
    attr.border_pixel = 0;
    attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
    attrMask = CWBackPixel | CWBorderPixel | CWColormap;
    win = XCreateWindow(dpy, root, 0, 0, width, height,
    0, visinfo->depth, InputOutput,
    visinfo->visual, attrMask, &attr);
    if (!win) {
    printf("Error: XCreateWindow failed\n");
    exit(1);
    }

    /* Display the window */
    XMapWindow(dpy, win);

    /* Create GLX rendering context */
    ctx = glXCreateContext(dpy, visinfo, NULL, True);
    if (!ctx) {
    printf("Error: glXCreateContext failed\n");
    exit(1);
    }

    /* Bind the rendering context and window */
    glXMakeCurrent(dpy, win, ctx);

    return win;
    }


    /*
    * Draw a few frames of a rotating square.
    */
    static void
    DrawFrames(Display * dpy, Window win)
    {
    int angle;
    glShadeModel(GL_FLAT);
    glClearColor(0.5, 0.5, 0.5, 1.0);
    for (angle = 0; angle < 360; angle += 10) {
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 0.0);
    glPushMatrix();
    glRotatef(angle, 0, 0, 1);
    glRectf(-0.8, -0.8, 0.8, 0.8);
    glPopMatrix();
    glXSwapBuffers(dpy, win);
    }
    }


    int
    main(int argc, char *argv[])
    {
    Display *dpy;
    Window win;

    dpy = XOpenDisplay(NULL);
    if (!dpy) {
    printf("Error: XOpenDisplay failed\n");
    return 1;
    }

    win = MakeWindow(dpy, 300, 300);

    DrawFrames(dpy, win);

    return 0;
    }
    +
    + + diff -Nru xpsb-glx-0.19/mesa/docs/modelers.html xpsb-glx-0.19/mesa/docs/modelers.html --- xpsb-glx-0.19/mesa/docs/modelers.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/modelers.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,68 @@ + + +Modelers, Renderers and Viewers + + + + + +

    Modelers, Renderers and Viewers

    + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/news.html xpsb-glx-0.19/mesa/docs/news.html --- xpsb-glx-0.19/mesa/docs/news.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/news.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1206 @@ + + +Mesa News + + + + + + + +

    News

    + + +

    March 27, 2009

    +

    +Mesa 7.4 is released. +This is a stable release fixing bugs since the 7.3 release. +

    + + +

    January 22, 2009

    +

    +Mesa 7.3 is released. +This is a new development release. +Mesa 7.4 will follow and will have bug fixes relative to 7.3. +

    + + +

    September 20, 2008

    +

    +Mesa 7.2 is released. +This is a stable, bug-fix release. +

    + + +

    August 26, 2008

    +

    +Mesa 7.1 is released. +This is a new development release. +It should be relatively stable, but those especially concerned about +stability should wait for the 7.2 release or use Mesa 7.0.4 (the +previous stable release). +

    + + +

    August 16, 2008

    +

    +Mesa 7.0.4 is released. +This is a bug-fix release. +

    + + +

    April 4, 2008

    +

    +Mesa 7.0.3 is released. +This is a bug-fix release. +

    + + +

    January 24, 2008

    + +

    +Added a new page describing the Mesa Cell driver. +

    + + + +

    November 13, 2007

    + +

    +Gallium3D is the codename for the new Mesa device driver architecture +which is currently under development. +A summary of the architecture can be found on the +Tungsten Graphics website. +

    +

    +Gallium3D development is taking place on the gallium-0.1 branch +of the git repository. +Currently, there's only a software-only driver and an Intel i915/945 driver +but other drivers will be coming... +

    + + +

    November 10, 2007

    +

    +Mesa 7.0.2 is released. +This is a bug-fix release. +

    + + +

    August 3, 2007

    +

    +Mesa 7.0.1 is released. +This is a bug-fix release. +

    + + +

    June 22, 2007

    +

    +Mesa 7.0 is released. +This is a stable release featuring OpenGL 2.1 support. +

    + + +

    April 27, 2007

    +

    +Mesa 6.5.3 is released. +This is a development release which will lead up to the Mesa 7.0 release +(which will advertise OpenGL 2.1 API support). +

    + + +

    March 26, 2007

    +

    +The new Shading Language compiler branch has been merged into the git +master branch. This is a step toward hardware support for the OpenGL +2.0 Shading Language and will be included in the next Mesa release. +In conjunction, Glean + has been updated with a new test that does over 130 tests of the +shading language and built-in functions. +

    + +

    April 2007

    +

    +Thomas Hellström of + +Tungsten Graphics has written a whitepaper describing the new +DRI memory management +system. +

    + +

    December 5, 2006

    +

    +Mesa is now using git as its source code management system. +The previous CVS repository should no longer be used. +See the repository page for more information. +

    + +

    December 2, 2006

    +

    +Mesa 6.5.2 has been released. +This is a new development release. +

    + +

    September 15, 2006

    +

    +Mesa 6.5.1 has been released. +This is a new development release. +

    + +

    March 31, 2006

    +

    +Mesa 6.5 has been released. +This is a new development release. +

    + + +

    February 2, 2006

    +

    +Mesa 6.4.2 has been released. +This is stable, bug-fix release. +

    + + +

    November 29, 2005

    +

    +Mesa 6.4.1 has been released. +This is stable, bug-fix release. +

    + + + +

    October 24, 2005

    +

    +Mesa 6.4 has been released. +This is stable, bug-fix release. +

    + + +

    August 19, 2005

    +

    +Mesa 6.3.2 has been released. +Note: there was no public release of version 6.3.1. +

    +Changes in version 6.3.1 +

    +The MD5 checksums are: +

    +
    +98192e45ed8d69113688f89f90869346  MesaLib-6.3.2.tar.gz
    +0df27701df0924d17ddf41185efa8ce1  MesaLib-6.3.2.tar.bz2
    +ccb2423aab77fc7e81ce628734586140  MesaLib-6.3.2.zip
    +9d0fca0a7d051c34a0b485423fb3e85d  MesaDemos-6.3.2.tar.gz
    +96708868450c188205e42229b5d813c4  MesaDemos-6.3.2.tar.bz2
    +c5102501e609aa8996d832fafacb8ab9  MesaDemos-6.3.2.zip
    +
    + + +

    July 20, 2005

    +

    +Mesa 6.3 has been released. +This is a development release with new features, changes and bug fixes. +

    +
    +    New:
    +	- GL_EXT_framebuffer_object extension
    +	- GL_ARB_draw_buffers extension
    +	- GL_ARB_pixel_buffer_object extension
    +	- GL_OES_read_format extension (Ian Romanick)
    +	- DirectFB driver (Claudio Ciccani)
    +	- x86_64 vertex transformation code (Mikko T.)
    +    Changes:
    +	- added -stereo option for glxgears demo (Jacek Rosik)
    +	- updated the PBuffer demo code in xdemos/ directory
    +	- glDeleteTextures/Programs/Buffers() now makes the object ID
    +	  available for immediate re-use
    +	- assorted 64-bit clean-ups fixes (x86_64 and Win64)
    +	- lots of internal changes for GL_EXT_framebuffer_object
    +    Bug fixes:
    +	- some functions didn't support PBO functionality
    +	- glGetTexImage didn't convert color index images to RGBA as required
    +	- fragment program texcoords were sometimes wrong for points and lines
    +	- fixed problem with negative dot product in arbfplight, fplight demos
    +	- fixed bug in perspective correction of antialiased, textured lines
    +	- querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
    +	- fixed a couple per-pixel fog bugs (Soju Matsumoto)
    +	- glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
    +	- fixed float parsing bug in ARB frag/vert programs (bug 2520)
    +	- XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
    +	- GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
    +	- glXChooseFBConfig() crashed if attribList pointer was NULL
    +	- program state.light[n].spot.direction.w was wrong value (bug 3083)
    +	- fragment program fog option required glEnable(GL_FOG) - wrong.
    +	- glColorTable() could produce a Mesa implementation error (bug 3135)
    +	- RasterPos could get corrupted by color index rendering path
    +	- Removed bad XTranslateCoordinates call when rendering to Pixmaps
    +	- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
    +	- fixed a few Darwin compilation problems
    +
    +

    +The MD5 checksums are: +

    +
    +0236f552d37514776945d5a013e5bb7b  MesaLib-6.3.tar.gz
    +60e1a8f78c4a8c7750a1e95753190986  MesaLib-6.3.tar.bz2
    +ca7c950fbace68c70caa822322db7223  MesaLib-6.3.zip
    +25ea801645b376c014051804fe4974b2  MesaDemos-6.3.tar.gz
    +9248e74872ea88c57ec25c900c295057  MesaDemos-6.3.tar.bz2
    +8537dfa734ef258dcc7272097558d434  MesaDemos-6.3.zip
    +
    + + +

    December 9, 2004

    +

    +Mesa 6.2.1 has been released. +This is a stable release which just fixes bugs since the 6.2 release. +

    +
    +    Bug fixes:
    +	- don't apply regular fog or color sum when using a fragment program
    +	- glProgramEnvParameter4fARB always generated an error on
    +	  GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
    +	- glVertexAttrib3svNV and glVertexAttrib3svARB were broken
    +	- fixed width/height mix-up in glSeparableFilter2D()
    +	- fixed regression in glCopyPixels + convolution
    +	- glReadPixels from a clipped front color buffer didn't always work
    +	- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
    +	- Attempting queries/accesses of VBO 0 weren't detected as errors
    +	- paletted textures failed if the palette had fewer than 256 entries
    +    Changes:
    +	- fixed a bunch of compiler warnings found with gcc 3.4
    +	- bug reports should to go bugzilla.freedesktop.org
    +
    +

    +The MD5 checksums are: +

    +
    +80008a92f6e055d3bfdde2cf331ec3fa  MesaLib-6.2.1.tar.gz
    +f43228cd2bf70f583ef3275c1c545421  MesaLib-6.2.1.tar.bz2
    +dec26cfd40116ad021020fea2d94f652  MesaLib-6.2.1.zip
    +2c7af3c986a7571c8713c8bfee7e49e3  MesaDemos-6.2.1.tar.gz
    +3cac74667b50bcbd4f67f594fb4224a2  MesaDemos-6.2.1.tar.bz2
    +75b3edd12eb2b370caf05f29b99e508a  MesaDemos-6.2.1.zip
    +
    + + +

    October 2, 2004

    +

    +Mesa 6.2 has been released. +This is a stable release which just fixes bugs since the 6.1 release. +

    +
    +    New:
    +	- enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
    +	- updated Doxygen support (Jose Fonseca)
    +    Changes:
    +	- some GGI driver updates (Christoph Egger, bug 1025977)
    +    Bug fixes:
    +	- Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
    +	- fixed a few compilation issues on IRIX
    +	- fixed a matrix classification bug (reported by Wes Bethel)
    +	- we weren't reseting the vertex/fragment program error state
    +	  before parsing (Dave Reveman)
    +	- adjust texcoords for sampling texture rectangles (Dave Reveman)
    +	- glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
    +	- repeated calls to glDeleteTexture(t) could lead to a crash
    +	- fixed potential ref count bugs in VBOs and vertex/fragment programs
    +	- spriteblast demo didn't handle window size changes correctly
    +	- glTexSubImage didn't handle pixels=NULL correctly for PBOs
    +	- fixed color index mode glDrawPixels bug (Karl Schultz)
    +
    +

    +The MD5 checksums are: +

    +
    +9e8f34b059272dbb8e1f2c968b33bbf0  MesaLib-6.2.tar.gz
    +3d6a6362390b6a37d3cb2e615f3ac7db  MesaLib-6.2.tar.bz2
    +6cfd7895d28e695c0dbbed9469564091  MesaLib-6.2.zip
    +3e06e33b0809f09855cb60883b8bdfef  MesaDemos-6.2.tar.gz
    +9d160009c3dfdb35fe7e4088c9ba8f85  MesaDemos-6.2.tar.bz2
    +856f7ec947122eb3c8985ebc2f654dcd  MesaDemos-6.2.zip
    +
    + + +

    August 18, 2004

    +

    +Mesa 6.1 has been released. +This is a new development release (version 6.2 will be a stabilization +release). +

    +
    +    New:
    +	- Revamped Makefile system
    +	- glXUseRotatedXFont() utility (see xdemos/xuserotfont.c)
    +	- internal driver interface changes related to texture object
    +	  allocation, vertex/fragment programs, BlendEquationSeparate, etc.
    +	- option to walk triangle edges with double-precision floats
    +	  (Justin Novosad of Discreet) (see config.h file)
    +	- support for AUX buffers in software GLX driver
    +	- updated glext.h to version 24 and glxext.h to version 6
    +	- new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars
    +	- updated BeOS support (Philippe Houdoin)
    +    Changes:
    +	- fragment fog interpolation is perspective corrected now
    +	- new glTexImage code, much cleaner, may be a bit faster
    +    Bug fixes:
    +	- glArrayElement in display lists didn't handle generic vertex attribs
    +	- glFogCoord didn't always work properly
    +	- ARB_fragment_program fog options didn't work
    +	- frag prog TEX instruction no longer incorrectly divides s,t,r by q
    +	- ARB frag prog TEX and TEXP instructions now use LOD=0
    +	- glTexEnviv in display lists didn't work
    +	- glRasterPos didn't do texgen or apply texture matrix
    +	- GL_DOUBLE-valued vertex arrays were broken in some cases
    +	- fixed texture rectangle edge/border sampling bugs
    +	- sampling an incomplete texture in a fragment program would segfault
    +	- glTexImage was missing a few error checks
    +	- fixed some minor glGetTexParameter glitches
    +	- GL_INTENSITY was mistakenly accepted as a  to glTexImage
    +	- fragment program writes to RC/HC register were broken
    +	- fixed a few glitches in GL_HP_occlusion_test extension
    +	- glBeginQueryARB and glEndQueryARB didn't work inside display lists
    +	- vertex program state references were broken
    +	- fixed triangle color interpolation bug on AIX (Shane Blackett)
    +	- fixed a number of minor memory leaks (bug #1002030)
    +
    +The MD5 checksums are: +

    +
    +c9284d295ebcd2e0486cc3cd54e5863c  MesaLib-6.1.tar.gz
    +5de1f53ec0709f60fc68fdfed57351f3  MesaLib-6.1.tar.bz2
    +483e77cac4789a5d36c42f3c0136d6d8  MesaLib-6.1.zip
    +8c46cfa6f9732acc6f6c25724aad0246  MesaDemos-6.1.tar.gz
    +89bfe0f6c69b39fd0ebd9fff481a4e9b  MesaDemos-6.1.tar.bz2
    +161268531fcc6f0c5a056430ee97e0c1  MesaDemos-6.1.zip
    +
    + + + +

    April 2, 2004

    + +

    +Mesa 6.0.1 has been released. +This release basically just fixes bugs since the 6.0. release. +

    +
    +    New:
    +	- upgraded glext.h to version 22
    +	- new build targets (Dan Schikore)
    +	- new linux-x86-opteron build target (Heath Feather)
    +    Bug fixes:
    +	- glBindProgramARB didn't update all necessary state
    +	- fixed build problems on OpenBSD
    +	- omit CVS directories from tarballs
    +	- glGetTexImage(GL_COLOR_INDEX) was broken
    +	- fixed an infinite loop in t&l module
    +	- silenced some valgrind warnings about using unitialized memory
    +	- fixed some compilation/link glitches on IRIX (Mike Stephens)
    +	- glBindProgram wasn't getting compiled into display lists
    +	- GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079)
    +	- two-sided lighting and vertex program didn't work (bug 887330)
    +	- stores to program parameter registers in vertex state programs
    +	  didn't work.
    +	- fixed glOrtho bug found with gcc 3.2.2 (RH9)
    +	- glXCreateWindow() wasn't fully implemented (bug 890894)
    +	- generic vertex attribute arrays didn't work in display lists
    +	- vertex buffer objects' default usage and access fields were wrong
    +	- glDrawArrays with start!=0 was broken
    +	- fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken
    +	- linux-osmesa16-static config didn't work
    +	- fixed a few color index rendering problems (bug 910687)
    +	- glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE
    +	- OSMesa RGB and BGR modes were broken
    +	- glProgramStringARB mistakenly required a null-terminated string
    +	- fragment program XPD instruction was incorrect
    +	- glGetMaterial() didn't work reliably
    +
    +The MD5 checksums are: +

    +
    +011be0e79666c7a6eb9693fbf9348653  MesaLib-6.0.1.tar.gz
    +b7f14088c5c2f14490d2739a91102112  MesaLib-6.0.1.tar.bz2
    +bf0510cf0a2b87d64cdd317eca3f1db1  MesaLib-6.0.1.zip
    +b7b648599e0aaee1c4ffc554a2a9139e  MesaDemos-6.0.1.tar.gz
    +dd6aadfd9ca8e1cfa90c6ee492bc6f43  MesaDemos-6.0.1.tar.bz2
    +eff71d59c211825e949199852f5a2316  MesaDemos-6.0.1.zip
    +
    + + + +

    January 16, 2004

    + +

    +Mesa 6.0 has been released. This is a stabilization of the 5.1 release +and primarily just incorporates bug fixes. +

    +
    +    New:
    +	- full OpenGL 1.5 support
    +	- updated GL/glext.h file to version 21
    +    Changes:
    +	- changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h)
    +    Bug fixes:
    +	- fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color
    +	  clamping issue
    +	- updated suno5-gcc configs
    +	- glColor3 functions sometimes resulted in undefined alpha values
    +	- fixed FP divide by zero error seen on VMS with xlockmore, others
    +	- fixed vertex/fragment program debug problem (bug 873011)
    +	- building on AIX with gcc works now
    +	- glDeleteProgramsARB failed for ARB fragment programs (bug 876160)
    +	- glDrawRangeElements tried to modify potentially read-only storage
    +	- updated files for building on Windows
    +
    + + + +

    December 28, 2003

    + +

    +The Mesa CVS server has been moved to +freedesktop.org because of problems with SourceForge's anonymous +CVS service. +

    + +

    Please see the CVS access page for details. +

    + + +

    December 17, 2003

    + +

    +Mesa 5.1 has been released. This is a new development release. +Mesa 6.0 will be the next stable release and will support all +OpenGL 1.5 features. +

    +
    +    New features:
    +	- reorganized directory tree
    +	- GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
    +	- GL_ATI_texture_env_combine3 extension (Ian Romanick)
    +	- GL_SGI_texture_color_table extension (Eric Plante)
    +	- GL_NV_fragment_program extension
    +	- GL_NV_light_max_exponent extension
    +	- GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle)
    +	- GL_ARB_occlusion_query extension
    +	- GL_ARB_point_sprite extension
    +	- GL_ARB_texture_non_power_of_two extension
    +	- GL_IBM_multimode_draw_arrays extension
    +	- GL_EXT_texture_mirror_clamp extension (Ian Romanick)
    +	- GL_ARB_vertex_buffer_object extension
    +	- new X86 feature detection code (Petr Sebor)
    +	- less memory used for display lists and vertex buffers
    +	- demo of per-pixel lighting with a fragment program (demos/fplight.c)
    +	- new version (18) of glext.h header
    +	- new spriteblast.c demo of GL_ARB_point_sprite
    +	- faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1)
    +	- faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1)
    +    Bug fixes:
    +	- really enable OpenGL 1.4 features in DOS driver.
    +	- fixed issues in glDrawPixels and glCopyPixels for very wide images
    +	- glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint
    +	- fixed some texgen bugs reported by Daniel Borca
    +	- fixed wglMakeCurrent(NULL, NULL) bug (#835861)
    +	- fixed glTexSubImage3D z-offset bug (Cedric Gautier)
    +	- fixed RGBA blend enable bug (Ville Syrjala)
    +	- glAccum is supposed to be a no-op in selection/feedback mode
    +	- fixed texgen bug #597589 (John Popplewell)
    +    Changes:
    +	- dropped API trace feature (src/Trace/)
    +	- documentation overhaul.  merged with website content.  more html.
    +	- glxgears.c demo updated to use GLX swap rate extensions
    +	- glTexImage1/2/3D now allows width/height/depth = 0
    +	- disable SPARC asm code on Linux (bug 852204)
    +
    + +The MD5 checksums are: +

    +
    +78f452f6c55478471a744f07147612b5  MesaLib-5.1.tar.gz
    +67b3b8d3f7f4c8c44904551b851d01af  MesaLib-5.1.tar.bz2
    +6dd19ffa750ec7f634e370a987505c9d  MesaLib-5.1.zip
    +e0214d4ebb22409dfa9262f2b52fd828  MesaDemos-5.1.tar.gz
    +066c9aff4fd924405de1ae9bad5ec9a7  MesaDemos-5.1.tar.bz2
    +d2b5ba32b53e0ad0576c637a4cc1fb41  MesaDemos-5.1.zip
    +
    + + +

    November 12, 2003

    + +

    +New Mesa 5.0.2 tarballs have been uploaded to SourceForge which fix a +number of automake/libtool problems. +

    +

    +The new MD5 checksums are: +

    +
    +a9dcf3ff9ad1b7d6ce73a0df7cff8b5b  MesaLib-5.0.2.tar.gz
    +7b4bf9261657c2fca03796d4955e6f50  MesaLib-5.0.2.tar.bz2
    +79c141bddcbad557647535d02194f346  MesaLib-5.0.2.zip
    +952d9dc823dd818981d1a648d7b2668a  MesaDemos-5.0.2.tar.gz
    +b81fafff90995025d2f25ea02b786642  MesaDemos-5.0.2.tar.bz2
    +a21be975589e8a2d1871b6bb7874fffa  MesaDemos-5.0.2.zip
    +
    + + + +

    September 5, 2003

    + +

    +Mesa 5.0.2 has been released. This is a stable, bug-fix release. +

    +
    +    Bug fixes:
    +	- fixed texgen problem causing texcoord's Q to be zero (stex3d)
    +	- default GL_TEXTURE_COMPARE_MODE_ARB was wrong
    +	- GL_CURRENT_MATRIX_NV query was wrong
    +	- GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one
    +	- GL_LIST_MODE query wasn't correct
    +	- GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported
    +	- GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value
    +	- blended, wide lines didn't always work correctly (bug 711595)
    +	- glVertexAttrib4svNV w component was always 1
    +	- fixed bug in GL_IBM_rasterpos_clip (missing return)
    +	- GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly
    +	- a few Solaris compilation fixes
    +	- fixed glClear() problem for DRI drivers (non-existant stencil, etc)
    +	- fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux)
    +	- fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz)
    +	- glFog() didn't clamp fog colors
    +	- fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the
    +	  gl[Get]TexParameteri[v] functions
    +	- fixed invalid memory references in glTexGen functions (bug 781602)
    +	- integer-valued color arrays weren't handled correctly
    +	- glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work
    +	- GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1
    +    Changes:
    +	- build GLUT with -fexceptions so C++ apps propogate exceptions
    +
    + + + +

    June 2003

    + +

    +Mesa's directory tree has been overhauled. +Things are better organized now with some thought toward future needs. +

    +

    +In CVS, the latest Mesa 5.1 development code is now rooted under the +Mesa-newtree/ directory. The old top-level Mesa/ directory +holds the Mesa 5.0.x code which will be abandoned at some point. +

    + + + +

    March 30, 2003

    + +

    +Mesa 5.0.1 has been released. This is a stable, bug-fix release. +

    +
    +    New:
    +	- DOS driver updates from Daniel Borca
    +	- updated GL/gl_mangle.h file (Bill Hoffman)
    +    Bug fixes:
    +	- auto mipmap generation for cube maps was broken (bug 641363)
    +	- writing/clearing software alpha channels was unreliable
    +	- minor compilation fixes for OS/2 (Evgeny Kotsuba)
    +	- fixed some bad assertions found with shadowtex demo
    +	- fixed error checking bug in glCopyTexSubImage2D (bug 659020)
    +	- glRotate(angle, -x, 0, 0) was incorrect (bug 659677)
    +	- fixed potential segfault in texture object validation (bug 659012)
    +	- fixed some bogus code in _mesa_test_os_sse_exception_support (Linus)
    +	- fix fog stride bug in tnl code for h/w drivers (Michel Danzer)
    +	- fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080)
    +	- glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3
    +	- fixed compilation problem on Solaris7/x86 (bug 536406)
    +	- fixed prefetch bug in 3DNow! code (Felix Kuhling)
    +	- fixed NeXT build problem (FABSF macro)
    +	- glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811)
    +	- zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964)
    +	- AA line and triangle Z values are now rounded, not truncated
    +	- fixed color interpolation bug when GLchan==GLfloat (bug 694461)
    +	- glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca)
    +	- fixed a minor GL_COLOR_MATERIAL bug
    +	- NV vertex program EXP instruction was broken
    +	- glColorMask misbehaved with X window / pixmap rendering
    +	- fix autoconf/libtool GLU C++ linker problem on Linux (a total hack)
    +	- attempt to fix GGI compilation problem when MesaDemos not present
    +	- NV vertex program ARL-relative fetches didn't work
    +    Changes:
    +	- use glPolygonOffset in gloss demo to avoid z-fighting artifacts
    +	- updated winpos and pointblast demos to use ARB extensions
    +	- disable SPARC normal transformation code (bug 673938)
    +	- GLU fixes for OS/2 (Evgeny Kotsuba)
    +
    +

    +MD5 checksums follow: +

    +
    +b80f8b5d53a3e9f19b9fde5af0c542f0  MesaLib-5.0.1.tar.gz
    +513b4bbd7d38951f05027179063d876b  MesaLib-5.0.1.tar.bz2
    +eebd395678f4520d33b267e5d5c22651  MesaLib-5.0.1.zip
    +49d7feaec6dc1d2091d7c3cc72a9b320  MesaDemos-5.0.1.tar.gz
    +37190374a98c3c892f0698be9ca3acf0  MesaDemos-5.0.1.tar.bz2
    +becd8bf17f5791361b4a54ba2a78e5c9  MesaDemos-5.0.1.zip
    +
    + + + +

    March 7, 2003

    +

    +Website and documentation overhaul. +

    +

    +The website content and Mesa documentation (from the doc/ directory) have +been merged together. +All the documentation files have been entered into the CVS repository. +Many of the old plain-text files have been converted to html and modernized. +

    + + +

    November 13, 2002

    +

    Mesa 5.0 has been released. This is a stable release which +implements the OpenGL 1.4 specification. +

    New:
    +    - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4")
    +    - removed some overlooked debugging code
    +    - glxinfo updated to support GLX_ARB_multisample
    +    - GLUT now support GLX_ARB_multisample
    +    - updated DOS driver (Daniel Borca)
    +Bug fixes:
    +    - GL_POINT and GL_LINE-mode polygons didn't obey cull state
    +    - fixed potential bug in _mesa_align_malloc/calloc()
    +    - fixed missing triangle bug when running vertex programs
    +    - fixed a few HPUX compilation problems
    +    - FX (Glide) driver didn't compile
    +    - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work
    +    - a few EXT functions, like glGenTexturesEXT, were no-ops
    +    - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate,
    +      glMultiDrawArrays and glMultiDrawElements were missing
    +    - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken
    +    - Pentium 4 Mobile was mistakenly identified as having 3DNow!
    +    - fixed one-bit error in point/line fragment Z calculation
    +    - fixed potential segfault in fakeglx code
    +    - fixed color overflow problem in DOT3 texture env mode
    +
    + + +

    October 29, 2002

    +

    Mesa 4.1 has been released. This is a new development release. +For a stable release, get 4.0.4. +

    New:
    +    - GL_NV_vertex_program extension
    +    - GL_NV_vertex_program1_1 extension
    +    - GL_ARB_window_pos extension
    +    - GL_ARB_depth_texture extension
    +    - GL_ARB_shadow extension
    +    - GL_ARB_shadow_ambient extension
    +    - GL_EXT_shadow_funcs extension
    +    - GL_ARB_point_parameters extension
    +    - GL_ARB_texture_env_crossbar
    +    - GL_NV_point_sprite extension
    +    - GL_NV_texture_rectangle extension
    +    - GL_EXT_multi_draw_arrays extension
    +    - GL_EXT_stencil_two_side extension
    +    - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions
    +    - GL_ATI_texture_mirror_once extension (Ian Romanick)
    +    - massive overhaul/simplification of software rasterizer module,
    +      many contributions from Klaus Niederkrueger
    +    - faster software texturing in some cases (i.e. trilinear filtering)
    +    - new OSMesaGetProcAddress() function
    +    - more blend modes implemented with MMX code (Jose Fonseca)
    +    - added glutGetProcAddress() to GLUT
    +    - added GLUT_FPS env var to compute frames/second in glutSwapBuffers()
    +    - pbinfo and pbdemo PBuffer programs
    +    - glxinfo -v prints transprent pixel info (Gerd Sussner)
    +Bug fixes:
    +    - better mipmap LOD computation (prevents excessive blurriness)
    +    - OSMesaMakeCurrent() didn't recognize buffer size changes
    +    - assorted conformance fixes for 16-bit/channel rendering
    +    - texcombine alpha subtraction mode was broken
    +    - fixed some blend problems when GLchan==GLfloat (Gerk Huisma)
    +    - clamp colors to [0,1] in OSMesa if GLchan==GLfloat (Gerk Huisma)
    +    - fixed divide by zero error in NURBS tessellator (Jon Perry)
    +    - fixed GL_LINEAR fog bug by adding clamping
    +    - fixed FP exceptions found using Alpha CPU
    +    - 3dfx/glide driver render-to-window feature was broken
    +    - added missing GLX_TRANSPARENT_RGB token to glx.h
    +    - fixed error checking related to paletted textures
    +    - fixed reference count error in glDeleteTextures (Randy Fayan)
    +Changes:
    +    - New spec file and Python code to generate some GL dispatch files
    +    - Glide driver defaults to "no" with autoconf/automake
    +    - floating point color channels now clamped to [0,inf)
    +    - updated demos/stex3d with new options
    +
    + + +

    October 4, 2002

    +

    +The Mesa FAQ has been rewritten. +

    + +

    October 3, 2002

    +

    Mesa 4.0.4 has been released. This is a stable bug-fix release. +

        New:
    +	- GL_NV_texture_rectangle extension
    +	- updated glext.h header (version 17)
    +	- updated DOS driver (Daniel Borca)
    +	- updated BeOS R5 driver (Philippe Houdoin)
    +	- added GL_IBM_texture_mirror_repeat
    +	- glxinfo now takes -l option to print interesting OpenGL limits info
    +	- GL_MESA_ycbcr_texture extension
    +	- GL_APPLE_client_storage extension (for some DRI drivers only)
    +	- GL_MESA_pack_invert extension
    +    Bug fixes:
    +	- fixed GL_LINEAR fog bug by adding clamping
    +	- fixed FP exceptions found using Alpha CPU
    +	- 3dfx MESA_GLX_FX=window (render to window) didn't work
    +	- fixed memory leak in wglCreateContest (Karl Schultz)
    +	- define GLAPIENTRY and GLAPI if undefined in glu.h
    +	- wglGetProcAddress didn't handle all API functions
    +	- when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map
    +	- removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc()
    +	- error checking in compressed tex image functions had some glitches
    +	- fixed AIX compile problem in src/config.c
    +	- glGetTexImage was using pixel unpacking instead of packing params
    +	- auto-mipmap generation for cube maps was incorrect
    +    Changes:
    +	- max texture units reduced to six to accomodate texture rectangles
    +	- removed unfinished GL_MESA_sprite_point extension code
    +
    + +

    June 25, 2002

    +

    Mesa 4.0.3 has been released. This is a stable bug-fix release. +

        New:
    +    - updated GL/glext.h file (version 15)
    +    - corrected MMX blend code (Jose Fonseca)
    +    - support for software-based alpha planes in Windows driver
    +    - updated GGI driver (Filip Spacek)
    +    Bug fixes:
    +    - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens
    +    - OSMesaMakeCurrent() didn't recognize buffer size changes
    +    - assorted conformance fixes for 16-bit/channel rendering
    +    - texcombine alpha subtraction mode was broken
    +    - fixed lighting bug with non-uniform scaling and display lists
    +    - fixed bug when deleting shared display lists
    +    - disabled SPARC cliptest assembly code (Mesa bug 544665)
    +    - fixed a couple Solaris compilation/link problems
    +    - blending clipped glDrawPixels didn't always work
    +    - glGetTexImage() didn't accept packed pixel types
    +    - glPixelMapu[is]v() could explode given too large of pixelmap
    +    - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT
    +    - glXCopyContext() could lead to segfaults
    +    - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665)
    +    Changes:
    +    - lots of C++ (g++) code clean-ups
    +    - lots of T&L updates for the Radeon DRI driver
    +    Known bugs:
    +    - mipmap LOD computation (fixed for Mesa 4.1)
    +
    + +

    April 2, 2002

    +

    Mesa 4.0.2 has been released. This is a stable bug-fix release. +

        New:
    +      - New DOS (DJGPP) driver written by Daniel Borca
    +      - New driver interface functions for TCL drivers (such as Radeon DRI)
    +      - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
    +        if using deep color channels
    +      - latest GL/glext.h and GL/glxext.h headers from SGI
    +    Bug fixes:
    +      - GL_BLEND with non-black texture env color wasn't always correct
    +      - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
    +      - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
    +      - glReadPixels was sometimes mistakenly clipped by the scissor box
    +      - glDraw/ReadPixels didn't catch all the errors that they should have
    +      - Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
    +      - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
    +      - Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP)
    +      - glColorMask as sometimes effecting glXSwapBuffers()
    +      - fixed a potential bug in XMesaGarbageCollect()
    +      - N threads rendering into one window didn't work reliably
    +      - glCopyPixels didn't work for deep color channels
    +      - improved 8 -> 16bit/channel texture image conversion (Gerk Huisma)
    +      - glPopAttrib() didn't correctly restore user clip planes
    +      - user clip planes failed for some perspective projections (Chromium)
    +
    + +

    December 17, 2001

    +

    Mesa 4.0.1 has been released. This is a stable bug-fix release. +

        New:
    +      - better sub-pixel sample positions for AA triangles (Ray Tice)
    +      - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
    +    Bug fixes:
    +      - added missing break statements in glGet*() for multisample cases
    +      - fixed uninitialized hash table mutex bug (display lists / texobjs)
    +      - fixed bad teximage error check conditional (bug 476846)
    +      - fixed demos readtex.c compilation problem on Windows (Karl Schultz)
    +      - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
    +      - silence some compiler warnings (gcc 2.96)
    +      - enable the #define GL_VERSION_1_3 in GL/gl.h
    +      - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
    +      - fixed glu.h typedef problem found with MSDev 6.0
    +      - build libGL.so with -Bsymbolic (fixes bug found with Chromium)
    +      - added missing 'const' to glXGetContextIDEXT() in glxext.h
    +      - fixed a few glXGetProcAddress() errors (texture compression, etc)
    +      - fixed start index bug in compiled vertex arrays (Keith)
    +      - fixed compilation problems in src/SPARC/glapi_sparc.S
    +      - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
    +      - use glXGetProcAddressARB in GLUT to avoid extension linking problems
    +      - provoking vertex of flat-shaded, color-index triangles was wrong
    +      - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
    +      - glTexParameter didn't flush the vertex buffer (Ray Tice)
    +      - feedback attributes for glDraw/CopyPixels and glBitmap were wrong
    +      - fixed bug in normal length caching (ParaView lighting bug)
    +
    + +

    October 22, 2001

    +

    Mesa 4.0 has been released. This is a stable release. +

        New:
    +      - Mesa 4.0 implements the OpenGL 1.3 specification
    +      - GL_IBM_rasterpos_clip extension
    +      - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp)
    +      - GL_ARB_texture_mirrored_repeat extension
    +      - WindML UGL driver (Stephane Raimbault)
    +      - added OSMESA_MAX_WIDTH/HEIGHT queries
    +      - attempted compiliation fixes for Solaris 5, 7 and 8
    +      - updated glext.h and glxext.h files
    +      - updated Windows driver (Karl Schultz)
    +    Bug fixes:
    +      - added some missing GLX 1.3 tokens to include/GL/glx.h
    +      - GL_COLOR_MATRIX changes weren't recognized by teximage functions
    +      - glCopyPixels with scale and bias was broken
    +      - glRasterPos with lighting could segfault
    +      - glDeleteTextures could leave a dangling pointer
    +      - Proxy textures for cube maps didn't work
    +      - fixed a number of 16-bit color channel bugs
    +      - fixed a few minor memory leaks
    +      - GLX context sharing was broken in 3.5
    +      - fixed state-update bugs in glPopClientAttrib()
    +      - fixed glDrawRangeElements() bug
    +      - fixed a glPush/PopAttrib() bug related to texture binding
    +      - flat-shaded, textured lines were broken
    +      - fixed a dangling pointer problem in the XMesa code (Chris Burghart)
    +      - lighting didn't always produce the correct alpha value
    +      - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
    +
    + + +

    June 21, 2001

    +

    Mesa 3.5 has been released. This is a new development release. +

        New:
    +	- internals of Mesa divided into modular pieces (Keith Whitwell)
    +	- 100% OpenGL 1.2 conformance (passes all conformance tests)
    +	- new AA line algorithm
    +	- GL_EXT_convolution extension
    +        - GL_ARB_imaging subset
    +        - OSMesaCreateContextExt() function
    +        - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
    +        - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
    +        - GL_EXT_fog_coord extension (Keith Whitwell)
    +        - GL_EXT_secondary_color extension (Keith Whitwell)
    +        - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
    +        - GL_SGIX_depth_texture extension
    +        - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
    +        - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
    +        - GL_ARB_texture_env_combine extension
    +        - GL_ARB_texture_env_dot3 extension
    +        - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
    +        - OSMesaCreateContextExt() function
    +        - libOSMesa.so library, contains the OSMesa driver interface
    +        - GL/glxext.h header file for GLX extensions
    +        - somewhat faster software texturing, fogging, depth testing
    +        - all color-index conformance tests now pass (only 8bpp tested)
    +        - SPARC assembly language TCL optimizations (David Miller)
    +        - GL_SGIS_generate_mipmap extension
    +    Bug Fixes:
    +        - fbiRev and tmuRev were unitialized when using Glide3
    +        - fixed a few color index mode conformance failures; all pass now
    +        - now appling antialiasing coverage to alpha after texturing
    +        - colors weren't getting clamped to [0,1] before color table lookup
    +        - fixed RISC alignment errors caused by COPY_4UBV macro
    +        - drawing wide, flat-shaded lines could cause a segfault
    +        - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
    +    Changes:
    +        - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
    +        - new libOSMesa.so library, contains the OSMesa driver interface
    +
    + + +

    May 17, 2001

    +

    Mesa 3.4.2 has been released. This is basically just a bug-fix release. +Here's what's new:

    +
        Bug fixes:
    +        - deleting the currently bound texture could cause bad problems
    +        - using fog could result in random vertex alpha values
    +         - AA triangle rendering could touch pixels outside right window bound
    +        - fixed byteswapping problem in clear_32bit_ximage() function
    +        - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
    +        - fixed memory leak in glXUseXFont()
    +        - fragment sampling in AA triangle function was off by 1/2 pixel
    +        - Windows: reading pixels from framebuffer didn't always work
    +        - glConvolutionFilter2D could segfault or cause FP exception
    +        - fixed segfaults in FX and X drivers when using tex unit 1 but not 0
    +        - GL_NAND logicop didn't work right in RGBA mode
    +        - fixed a memory corruption bug in vertex buffer reset code
    +        - clearing the softwara alpha buffer with scissoring was broken
    +        - fixed a few color index mode fog bugs
    +        - fixed some bad assertions in color index mode
    +        - fixed FX line 'stipple' bug #420091
    +    Changes:
    +        - optimized writing mono-colored pixel spans to X pixmaps
    +        - increased max viewport size to 2048 x 2048
    +
    + + +

    April 29, 2001

    +

    New Mesa website

    +

    Mark Manning produced the new website.
    Thanks, Mark!

    + + +

    February 14, 2001

    +

    Mesa 3.4.1 has been released. Here's what's new:

    +
        New:
    +        - fixed some Linux build problems
    +        - fixed some Windows build problems
    +        - GL_EXT_texture_env_dot3 extension (Gareth Hughes)
    +    Bug fixes:
    +        - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
    +        - various state-update code changes needed for DRI bugs
    +        - disabled pixel transfer ops in glColorTable commands, not needed
    +        - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter
    +        - updated sources and fixed compile problems in widgets-mesa/
    +        - GLX_PBUFFER enum value was wrong in glx.h
    +        - fixed a glColorMaterial lighting bug
    +        - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
    +        - glXCopySubBufferMESA() Y position was off by one
    +        - Error checking of glTexSubImage3D() was broken (bug 128775)
    +        - glPopAttrib() didn't restore all derived Mesa state correctly
    +        - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
    +          conformance problems at 16bpp.
    +        - clearing depth buffer with scissoring was broken, would segfault
    +        - OSMesaGetDepthBuffer() returned bad bytesPerValue value
    +        - fixed a line clipping bug (reported by Craig McDaniel)
    +        - fixed RGB color over/underflow bug for very tiny triangles
    +    Known problems:
    +        - NURBS or evaluator surfaces inside display lists don't always work
    +
    +

    +

    November 3, 2000

    +

    Mesa 3.4 has been released. Here's what's new since the 3.3 release:

    +
        New:
    +    - optimized glDrawPixels for glPixelZoom(1,-1)
    +    Bug Fixes:
    +    - widgets-mesa/src/*.c files were missing from 3.3 distro
    +    - include/GL/mesa_wgl.h file was missing from 3.3 distro
    +    - fixed some Win32 compile problems
    +    - texture object priorities weren't getting initialized to 1.0
    +    - glAreTexturesResident return value was wrong when using hardware
    +    - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX)
    +    - glReadPixels with GLushort packed types was broken
    +    - fixed a few bugs in the GL_EXT_texture_env_combine texture code
    +    - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables
    +    - fixed some typos/bugs in the VB code
    +    - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work
    +    - optimized glDrawPixels paths weren't being used
    +    - per-fragment fog calculation didn't work without a Z buffer
    +    - improved blending accuracy, fixes Glean  blendFunc test failures
    +    - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly
    +    - glXGetProcAddressARB() didn't always return the right address
    +    - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format
    +    - texture matrix changes weren't always detected (GLUT projtex demo)
    +    - fixed random color problem in vertex fog code
    +    - fixed Glide-related bug that let Quake get a 24-bit Z buffer
    +    Changes:
    +    - finished internal support for compressed textures for DRI
    +
    +

    +

    April 24, 2000

    +

    Mesa 3.2 has been released. Here's what's new since the beta release:

    +
        Bug fixes:
    +    - fixed memcpy bugs in span.c
    +    - fixed missing glEnd problem in demos/tessdemo.c
    +    - fixed bug when clearing 24bpp Ximages
    +    - fixed clipping problem found in Unreal Tournament
    +    - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2
    +    - fixed Loki's 3dfx RGB vs BGR bug
    +    - fixed Loki's 3dfx smooth/flat shading bug in SoF
    +    Changes:
    +    - updated docs/README file
    +    - use bcopy() optimizations on FreeBSD
    +    - re-enabled the optimized persp_textured_triangle() function
    +
    +

    +

    March 23, 2000

    +

    I've just upload the Mesa 3.2 beta 1 files to SourceForge at http://sourceforge.net/project/filelist.php?group_id=3

    +

    3.2 (note even number) is a stabilization release of Mesa 3.1 meaning it's mainly +just bug fixes.

    +

    Here's what's changed: + +

      + Bug fixes: +
        + - mixed drawing of lines and bitmaps sometimes had wrong colors
        + - added missing glHintPGI() function
        + - fixed a polygon culling bug
        + - fixed bugs in gluPartialDisk()
        + - Z values in selection mode were wrong
        + - added missing tokens: +
          + GL_SMOOTH_POINT_SIZE_RANGE
          + GL_SMOOTH_POINT_SIZE_GRANULARITY
          + GL_SMOOTH_LINE_WIDTH_RANGE
          + GL_SMOOTH_LINE_WIDTH_GRANULARITY
          + GL_ALIASED_POINT_SIZE_RANGE
          + GL_ALIASED_LINE_WIDTH_RANGE +
        + - fixed glCopyPixels when copying from back to front buffer
        + - GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT
        + - glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken
        + - glDeleteTextures() didn't decrement reference count correctly
        + - GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly
        + - Actual depth of transformation matrix stacks was off by one
        + - 24bpp visuals didn't address pixels correctly
        + - mipmap level of detail (lambda) calculation simplified, more accurate
        + - 101691 - Polygon clipping and GL_LINE
        + - 101928 - Polygon clipping and GL_LINE (same fix as above)
        + - 101808 - Non-glVertexArrays tristrip bug
        + - 101971 - find_last_3f on Dec OSF (worked around)
        + - 102369 - segv on dec osf (possibly a duplicate of the above)
        + - 102893 - orientations of modelview cause segfault +
      + New: +
        + - updated SVGA Linux driver
        + - added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX
        + - build libGLw.a (Xt/OpenGL drawing area widget) library by default
        + - changed -O2 to -O3 for a number of gcc configs +
      + Changes: +
        + - glXCopyContext's mask parameter is now unsigned long, per GLX spec +
      +
    + +

    Please report any problems with this release ASAP. Bugs should be filed on the +Mesa3D website at sourceforge.
    +After 3.2 is wrapped up I hope to release 3.3 beta 1 soon afterward.

    +

    -- Brian

    +

    +

    December 17, 1999

    +

    A Slashdot interview with Brian about Mesa (questions submitted by Slashdot readers) +can be found at http://slashdot.org/interviews/99/12/17/0927212.shtml.

    +

    +

    December 14, 1999

    +

    Mesa 3.1 is released!

    +

    +

    September 21, 1999

    +

    There appear to be two new files on the ftp site, MesaLib-3.1beta3.tar.gz +and MesaDemos-3.1beta3.tar.gz, +that seem to be... yes, I've just received confirmation from the beta center, they +are indeed the THIRD beta release of Mesa 3.1! Happy Days. Happy Days. Thanks +Keith Whitwell for preparing these for us during Brian's absence.

    +

    +

    August 30, 1999

    +

    I'm pleased to announce that I've accepted a position with Precision Insight, +Inc. effective October, 1999. I'll be leaving Avid Technology in September.

    +

    I've been working on Mesa in my spare time for over five years. With Precision +Insight I now have the opportunity to devote my full attention to advancing Mesa +and OpenGL on Linux.

    +

    While I'll be focused on Linux, the X Window System, and hardware acceleration, +my work will continue to be open sourced and available to any other programmers who +may want to contribute to it, or use it for other projects or platforms

    +

    PS: I'm going to be traveling until Sep 6 and won't be reading email until then.

    +

    +

    August 23, 1999

    +

    Anonymous CVS access is back online so suck up all the bandwidth you can afford. +Note that this is a new archive, so you will need to re-checkout the archive. That +means don't cvs update from a previous download.

    +

    +

    August 17, 1999

    +

    A report from the SIGGRAPH '99 Linux/OpenGL +BOF meeting is now available.

    +

    -Brian

    +

    +

    August 14, 1999

    +

    www.mesa3d.org is having technical problems due to hardware failures at VA Linux +systems. The Mac pages, ftp, and CVS services aren't fully restored yet. Please be +patient.

    +

    -Brian

    +

    +

    June 7, 1999

    +

    RPMS of the nVidia RIVA server can be found at ftp://ftp.mesa3d.org/mesa/misc/nVidia/.

    +

    +

    June 2, 1999

    +

    nVidia has released some Linux binaries for +xfree86 3.3.3.1, along with the full source, which includes GLX acceleration +based on Mesa 3.0. They can be downloaded from http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html.

    +

    +

    May 24, 1999

    +

    Beta 2 of Mesa 3.1 has been make available at ftp://ftp.mesa3d.org/mesa/beta/. +If you are into the quake scene, you may want to try this out, as it contains some +optimizations specifically in the Q3A rendering path. +

    +

    May 13, 1999

    +

    For those interested in the integration of Mesa into XFree86 4.0, Precision Insight +has posted their lowlevel design documents at http://www.precisioninsight.com.

    +

    +

    May 13, 1999

    +
    May 1999 - John Carmack of id Software, Inc. has made a donation of
    +US$10,000 to the Mesa project to support its continuing development.
    +Mesa is a free implementation of the OpenGL 3D graphics library and id's
    +newest game, Quake 3 Arena, will use Mesa as the 3D renderer on Linux.
    +
    +The donation will go to Keith Whitwell, who has been optimizing Mesa to
    +improve performance on 3d hardware.  Thanks to Keith's work, many
    +applications using Mesa 3.1 will see a dramatic performance increase
    +over Mesa 3.0.  The donation will allow Keith to continue working on
    +Mesa full time for some time to come.
    +
    +For more information about Mesa see www.mesa3d.org.  For more
    +information about id Software, Inc. see www.idsoftware.com.
    +
    +--------------------------------
    +
    +This donation from John/id is very generous.  Keith and I are very
    +grateful.
    +
    +
    +

    +

    May 1, 1999

    +

    John Carmack made an interesting .plan update yesterday: + +

      + "I put together a document on optimizing OpenGL drivers for Q3 that + should be helpful to the various Linux 3D teams.
      +
      http://www.quake3arena.com/news/glopt.html" +
    + +

    +

    April 7, 1999

    +

    Updated the Mesa contributors section and added links to RPM Mesa packages.

    +

    +

    March 18, 1999

    +

    The new webpages are now online. Enjoy, and let me know if you find any errors. +For an eye-candy free version you can use http://www.mesa3d.org/txt/.

    +

    +

    February 16, 1999

    +

    SGI releases its GLX +source code.

    +

    +

    January 22, 1999

    +

    www.mesa3d.org established

    + + +

    + + +
    + + diff -Nru xpsb-glx-0.19/mesa/docs/OLD/MESA_packed_depth_stencil.spec xpsb-glx-0.19/mesa/docs/OLD/MESA_packed_depth_stencil.spec --- xpsb-glx-0.19/mesa/docs/OLD/MESA_packed_depth_stencil.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/OLD/MESA_packed_depth_stencil.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,230 @@ +Name + + MESA_packed_depth_stencil + +Name Strings + + GL_MESA_packed_depth_stencil + +Contact + + Keith Whitwell, VA Linux Systems Inc. (keithw 'at' valinux.com) + Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com) + +Status + + Obsolete. + +Version + + +Number + + ??? + +Dependencies + + EXT_abgr affects the definition of this extension + SGIS_texture4D affects the definition of this extension + EXT_cmyka affects the definition of this extension + ARB_packed_pixels affects the definition of this extension + +Overview + + Provides a mechanism for DrawPixels and ReadPixels to efficiently + transfer depth and stencil image data. Specifically, we defined new + packed pixel formats and types which pack both stencil and depth + into one value. + +Issues: + + 1. Is this the right way to distinguish between 24/8 and 8/24 + pixel formats? Should we instead provide both: + + GL_DEPTH_STENCIL_MESA + GL_STENCIL_DEPTH_MESA + + And perhaps just use GL_UNSIGNED_INT, GL_UNSIGNED_SHORT ? + + 2. If not, is it correct to use _REV to indicate that stencil + preceeds depth in the 1_15 and 8_24 formats? + + 3. Do we really want the GL_UNSIGNED_SHORT formats? + + +New Procedures and Functions + + None. + +New Tokens + + Accepted by the parameter of ReadPixels and DrawPixels: + + GL_DEPTH_STENCIL_MESA 0x8750 + + Accepted by the parameter of ReadPixels and DrawPixels: + + GL_UNSIGNED_INT_24_8_MESA 0x8751 + GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 + GL_UNSIGNED_SHORT_15_1_MESA 0x8753 + GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the 1.1 Specification (Rasterization) + + One entry is added to table 3.5 (DrawPixels and ReadPixels formats). + The new table is: + + Target + Format Name Buffer Element Meaning and Order + ----------- ------ ------------------------- + COLOR_INDEX Color Color index + STENCIL_INDEX Stencil Stencil index + DEPTH_COMPONENT Depth Depth component + RED Color R component + GREEN Color G component + BLUE Color B component + ALPHA Color A component + RGB Color R, G, B components + RGBA Color R, G, B, A components + BGRA Color B, G, R, A components + ABGR_EXT Color A, B, G, R components + CMYK_EXT Color Cyan, Magenta, Yellow, Black components + CMYKA_EXT Color Cyan, Magenta, Yellow, Black, A components + LUMINANCE Color Luminance component + LUMINANCE_ALPHA Color Luminance, A components + DEPTH_STENCIL Depth, Depth component, stencil index. + Stencil + + Table 3.5: DrawPixels and ReadPixels formats. The third column + gives a description of and the number and order of elements in a + group. + + Add to the description of packed pixel formats: + + Parameter Data of Matching + Token Name Type Elements Pixel Formats + ---------------- ---- -------- ------------- + + UNSIGNED_BYTE_3_3_2 ubyte 3 RGB + UNSIGNED_BYTE_2_3_3_REV ubyte 3 RGB + UNSIGNED_SHORT_5_6_5 ushort 3 RGB + UNSIGNED_SHORT_5_6_5_REV ushort 3 RGB + UNSIGNED_SHORT_4_4_4_4 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT + UNSIGNED_SHORT_4_4_4_4_REV ushort 4 RGBA,BGRA + UNSIGNED_SHORT_5_5_5_1 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT + UNSIGNED_SHORT_1_5_5_5_REV ushort 4 RGBA,BGRA + UNSIGNED_INT_8_8_8_8 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT + UNSIGNED_INT_8_8_8_8_REV uint 4 RGBA,BGRA + UNSIGNED_INT_10_10_10_2 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT + UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA + UNSIGNED_SHORT_15_1_MESA ushort 2 DEPTH_STENCIL_MESA + UNSIGNED_SHORT_1_15_REV_MESA ushort 2 DEPTH_STENCIL_MESA + UNSIGNED_SHORT_24_8_MESA ushort 2 DEPTH_STENCIL_MESA + UNSIGNED_SHORT_8_24_REV_MESA ushort 2 DEPTH_STENCIL_MESA + + UNSIGNED_INT_8_24: + + 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + +-----------------------+-----------------------------------------------------------------------+ + | | | + +-----------------------+-----------------------------------------------------------------------+ + + first second + element element + + + UNSIGNED_INT_24_8: + + 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + +----------------------------------------------------------------------+------------------------+ + | | | + +----------------------------------------------------------------------+------------------------+ + + first second + element element + + UNSIGNED_SHORT_15_1: + + 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + +-----------------------------------------------------------+---+ + | | | + +-----------------------------------------------------------+---+ + + first second + element element + + + UNSIGNED_SHORT_1_15_REV: + + 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + +---+-----------------------------------------------------------+ + | | | + +---+-----------------------------------------------------------+ + + second first + element element + + The assignment of elements to fields in the packed pixel is as + described in the table below: + + First Second Third Fourth + Format Element Element Element Element + ------ ------- ------- ------- ------- + RGB red green blue + RGBA red green blue alpha + BGRA blue green red alpha + ABGR_EXT alpha blue green red + CMYK_EXT cyan magenta yellow black + DEPTH_STENCIL_MESA depth stencil + +Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations +and the Frame Buffer) + + The new format is added to the discussion of Obtaining Pixels from the + Framebuffer. It should read " If the is one of RED, GREEN, + BLUE, ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, and + the GL is in color index mode, then the color index is obtained." + + The new format is added to the discussion of Index Lookup. It should + read "If is one of RED, GREEN, BLUE, ALPHA, RGB, RGBA, + ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, then the index is used to + reference 4 tables of color components: PIXEL_MAP_I_TO_R, + PIXEL_MAP_I_TO_G, PIXEL_MAP_I_TO_B, and PIXEL_MAP_I_TO_A." + + +Additions to Chapter 5 of the 1.1 Specification (Special Functions) + + None + +Additions to Chapter 6 of the 1.1 Specification (State and State Requests) + + None + +Additions to the GLX Specification + + None + +GLX Protocol + + TBD + +Errors + + None + +New State + + None + +Revision History + + Version 1.0 - 23 Sep 2000 + Keith's original version. + + Version 1.1 - 3 Nov 2000 + Brian's edits, assigned values to new enums. + diff -Nru xpsb-glx-0.19/mesa/docs/OLD/MESA_program_debug.spec xpsb-glx-0.19/mesa/docs/OLD/MESA_program_debug.spec --- xpsb-glx-0.19/mesa/docs/OLD/MESA_program_debug.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/OLD/MESA_program_debug.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,356 @@ +Name + + MESA_program_debug + +Name Strings + + GL_MESA_program_debug + +Contact + + Brian Paul (brian.paul 'at' tungstengraphics.com) + +Status + + XXX - Not complete yet!!! + +Version + + Last Modified Date: July 20, 2003 + Author Revision: 1.0 + +Number + + TBD + +Dependencies + + OpenGL 1.4 is required + The extension is written against the OpenGL 1.4 specification. + ARB_vertex_program or ARB_fragment_program or NV_vertex_program + or NV_fragment_program is required. + +Overview + + The extension provides facilities for implementing debuggers for + vertex and fragment programs. + + The concept is that vertex and fragment program debuggers will be + implemented outside of the GL as a utility package. This extension + only provides the minimal hooks required to implement a debugger. + + There are facilities to do the following: + 1. Have the GL call a user-specified function prior to executing + each vertex or fragment instruction. + 2. Query the current program string's execution position. + 3. Query the current values of intermediate program values. + + The main feature is the ProgramCallbackMESA function. It allows the + user to register a callback function with the GL. The callback will + be called prior to executing each vertex or fragment program instruction. + + From within the callback, the user may issue Get* commands to + query current GL state. The GetProgramRegisterfvMESA function allows + current program values to be queried (such as temporaries, input + attributes, and result registers). + + There are flags for enabling/disabling the program callbacks. + + The current execution position (as an offset from the start of the + program string) can be queried with + GetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos) or + GetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos). + + +IP Status + + None + +Issues + + 1. Is this the right model for a debugger? + + It seems prudent to minimize the scope of this extension and leave + it up to the developer (or developer community) to write debuggers + that layer on top of this extension. + + If the debugger were fully implemented within the GL it's not + clear how terminal and GUI-based interfaces would work, for + example. + + 2. There aren't any other extensions that register callbacks with + the GL. Isn't there another solution? + + If we want to be able to single-step through vertex/fragment + programs I don't see another way to do it. + + 3. How do we prevent the user from doing something crazy in the + callback function, like trying to call glBegin (leading to + recursion)? + + The rule is that the callback function can only issue glGet*() + functions and no other GL commands. It could be difficult to + enforce this, however. Therefore, calling any non-get GL + command from within the callback will result in undefined + results. + + 4. Is this extension amenable to hardware implementation? + + Hopefully, but if not, the GL implementation will have to fall + back to a software path when debugging. This may be acceptable + for debugging. + + 5. What's the parameter to ProgramCallbackMESA for? + + It's a common programming practice to associate a user-supplied + value with callback functions. + + 6. Debuggers often allow one to modify intermediate program values, + then continue. Does this extension support that? + + No. + + +New Procedures and Functions (and datatypes) + + typedef void (*programcallbackMESA)(enum target, void *data) + + void ProgramCallbackMESA(enum target, programcallbackMESA callback, + void *data) + + void GetProgramRegisterfvMESA(enum target, sizei len, + const ubyte *registerName, float *v) + +New Tokens + + Accepted by the parameter of Enable, Disable, IsEnabled, + GetBooleanv, GetDoublev, GetFloatv and GetIntegerv: + + FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 + VERTEX_PROGRAM_CALLBACK_MESA 0x8bb4 + + Accepted by the parameter GetBooleanv, GetDoublev, + GetFloatv and GetIntegerv: + + FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 + VERTEX_PROGRAM_POSITION_MESA 0x8bb4 + + Accepted by the parameter of GetPointerv: + + FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 + FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 + VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 + VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 + +Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation) + + None. + +Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) + + None. + +Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment +Operations and the Frame Buffer) + + None. + +Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions) + + In section 5.4 "Display Lists", page 202, add the following command + to the list of those that are not compiled into display lists: + + ProgramCallbackMESA. + + + Add a new section 5.7 "Callback Functions" + + The function + + void ProgramCallbackMESA(enum target, programcallbackMESA callback, + void *data) + + registers a user-defined callback function with the GL. + may be FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB. The enabled + callback functions registered with these targets will be called + prior to executing each instruction in the current fragment or + vertex program, respectively. The callbacks are enabled and + disabled by calling Enable or Disable with + FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB. + + The callback function's signature must match the typedef + + typedef void (*programcallbackMESA)(enum target, void *data) + + When the callback function is called, will either be + FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB to indicate which + program is currently executing and will be the value + specified when ProgramCallbackMESA was called. + + From within the callback function, only the following GL commands + may be called: + + GetBooleanv + GetDoublev + GetFloatv + GetIntegerv + GetProgramLocalParameter + GetProgramEnvParameter + GetProgramRegisterfvMESA + GetProgramivARB + GetProgramStringARB + GetError + + Calling any other command from within the callback results in + undefined behaviour. + + +Additions to Chapter 6 of the OpenGL 1.4 Specification (State and +State Requests) + + Add a new section 6.1.3 "Program Value Queries": + + The command + + void GetProgramRegisterfvMESA(enum target, sizei len, + const ubyte *registerName, + float *v) + + Is used to query the value of program variables and registers + during program execution. GetProgramRegisterfvMESA may only be + called from within a callback function registered with + ProgramCallbackMESA. + + and specify the name a variable, input + attribute, temporary, or result register in the program string. + The current value of the named variable is returned as four + values in . If doesn't exist in the program string, + the error INVALID_OPERATION is generated. + +Additions to Appendix A of the OpenGL 1.4 Specification (Invariance) + + None. + +Additions to the AGL/GLX/WGL Specifications + + None. + +GLX Protocol + + XXX TBD + +Dependencies on NV_vertex_program and NV_fragment_program + + If NV_vertex_program and/or NV_fragment_program are supported, + vertex and/or fragment programs defined by those extensions may + be debugged as well. Register queries will use the syntax used + by those extensions (i.e. "v[X]" to query vertex attributes, + "o[X]" for vertex outputs, etc.) + +Errors + + INVALID_OPERATION is generated if ProgramCallbackMESA is called + between Begin and End. + + INVALID_ENUM is generated by ProgramCallbackMESA if is not + a supported vertex or fragment program type. + + Note: INVALID_OPERAION IS NOT generated by GetProgramRegisterfvMESA, + GetBooleanv, GetDoublev, GetFloatv, or GetIntegerv if called between + Begin and End when a vertex or fragment program is currently executing. + + INVALID_ENUM is generated by ProgramCallbackMESA, + GetProgramRegisterfvMESA if is not a program target supported + by ARB_vertex_program, ARB_fragment_program (or NV_vertex_program or + NV_fragment_program). + + INVALID_VALUE is generated by GetProgramRegisterfvMESA if + does not name a known program register or variable. + + INVALID_OPERATION is generated by GetProgramRegisterfvMESA when a + register query is attempted for a program target that's not currently + being executed. + + +New State + + XXX finish + +(table 6.N, p. ###) + Initial + Get Value Type Get Command Value Description Sec. Attribute + --------- ---- ----------- ----- ----------- ---- --------- + FRAGMENT_PROGRAM_CALLBACK_MESA B IsEnabled FALSE XXX XXX enable + VERTEX_PROGRAM_CALLBACK_MESA B IsEnabled FALSE XXX XXX enable + FRAGMENT_PROGRAM_POSITION_MESA Z+ GetIntegerv -1 XXX XXX - + VERTEX_PROGRAM_POSITION_MESA Z+ GetIntegerv -1 XXX XXX - + FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA P GetPointerv NULL XXX XXX - + VERTEX_PROGRAM_CALLBACK_FUNC_MESA P GetPointerv NULL XXX XXX - + FRAGMENT_PROGRAM_CALLBACK_DATA_MESA P GetPointerv NULL XXX XXX - + VERTEX_PROGRAM_CALLBACK_DATA_MESA P GetPointerv NULL XXX XXX - + + XXX more? + +New Implementation Dependent State + + None. + +Revision History + + 8 July 2003 + Initial draft. (Brian Paul) + 11 July 2003 + Second draft. (Brian Paul) + 20 July 2003 + Third draft. Lots of fundamental changes. (Brian Paul) + 23 July 2003 + Added chapter 5 and 6 spec language. (Brian Paul) + +Example Usage + + The following is a very simple example of how this extension may + be used to print the values of R0, R1, R2 and R3 while executing + vertex programs. + + + /* This is called by the GL when the vertex program is executing. + * We can only make glGet* calls from within this function! + */ + void DebugCallback(GLenum target, GLvoid *data) + { + GLint pos; + GLuint i; + + /* Get PC and current instruction string */ + glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_ARB, &pos); + + printf("Current position: %d\n", pos); + + printf("Current temporary registers:\n"); + for (i = 0; i < 4; i++) { + GLfloat v[4]; + char s[10]; + sprintf(s, "R%d", i); + glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_ARB, strlen(s), s, v); + printf("R%d = %g, %g, %g, %g\n", i, v[0], v[1], v[2], v[3]); + } + } + + + /* + * elsewhere... + */ + + /* Register our debugger callback function */ + glProgramCallbackMESA(GL_VERTEX_PROGRAM_ARB, DebugCallback, NULL); + glEnable(GL_VERTEX_PROGRAM_CALLBACK_MESA); + + /* define/bind a vertex program */ + + glEnable(GL_VERTEX_PROGRAM); + + /* render something */ + glBegin(GL_POINTS); + glVertex2f(0, 0); + glEnd(); + diff -Nru xpsb-glx-0.19/mesa/docs/OLD/MESA_sprite_point.spec xpsb-glx-0.19/mesa/docs/OLD/MESA_sprite_point.spec --- xpsb-glx-0.19/mesa/docs/OLD/MESA_sprite_point.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/OLD/MESA_sprite_point.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,190 @@ +Name + + MESA_sprite_point + +Name Strings + + GL_MESA_sprite_point + +Contact + + Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com) + +Status + + Obsolete - see GL_ARB_point_sprite. + +Version + + +Number + + ??? + +Dependencies + + GL_EXT_point_parameters effects the definition of this extension + GL_ARB_multitexture effects the definition of this extension + +Overview + + This extension modifies the way in which points are rendered, + specifically when they're textured. When SPRITE_POINT_MESA is enabled + a point is rendered as if it were a quadrilateral with unique texture + coordinates at each vertex. This extension effectively turns points + into sprites which may be rendered more easily and quickly than using + conventional textured quadrilaterals. + + When using point size > 1 or attenuated points this extension is an + effective way to render many small sprite images for particle systems + or other effects. + +Issues: + + 1. How are the texture coordinates computed? + + The lower-left corner has texture coordinate (0,0,r,q). + The lower-right, (1,0,r,q). The upper-right, (1,1,r,q). + The upper-left, (0,1,r,q). + + 2. What about texgen and texture matrices? + + Texgen and the texture matrix have no effect on the point's s and t + texture coordinates. The r and q coordinates may have been computed + by texgen or the texture matrix. Note that with a 3D texture and/or + texgen that the r coordinate could be used to select a slice in the + 3D texture. + + 3. What about point smoothing? + + When point smoothing is enabled, a triangle fan could be rendered + to approximate a circular point. This could be problematic to + define and implement so POINT_SMOOTH is ignored when drawing sprite + points. + + Smoothed points can be approximated by using an appropriate texture + images, alpha testing and blending. + + POLYGON_SMOOTH does effect the rendering of the quadrilateral, however. + + 4. What about sprite rotation? + + There is none. Sprite points are always rendered as window-aligned + squares. One could define rotated texture images if desired. A 3D + texture and appropriate texture r coordinates could be used to + effectively specify image rotation per point. + + 5. What about POLYGON_MODE? + + POLYGON_MODE does not effect the rasterization of the quadrilateral. + + 6. What about POLYGON_CULL? + + TBD. Polygon culling is normally specified and implemented in the + transformation stage of OpenGL. However, some rasterization hardware + implements it later during triangle setup. + + Polygon culling wouldn't be useful for sprite points since the + quadrilaterals are always defined in counter-clockwise order in + window space. For that reason, polygon culling should probably be + ignored. + + 7. Should sprite points be alpha-attenuated if their size is below the + point parameter's threshold size? + + 8. Should there be an advertisized maximum sprite point size? + + No. Since we're rendering the point as a quadrilateral there's no + need to limit the size. + + +New Procedures and Functions + + None. + +New Tokens + + Accepted by the parameter of Enable, Disable, IsEnabled, + GetIntegerv, GetBooleanv, GetFloatv and GetDoublev: + + SPRITE_POINT_MESA 0x???? + MAX_SPRITE_POINT_SIZE_MESA 0x???? (need this?) + +Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the 1.1 Specification (Rasterization) + + Section ???. + + When SPRITE_POINT_MESA is enabled points are rasterized as screen- + aligned quadrilaterals. If the four vertices of the quadrilateral + are labeled A, B, C, and D, starting at the lower-left corner and moving + counter-clockwise around the quadrilateral, then the vertex and + texture coordinates are computed as follows: + + vertex window coordinate texture coordinate + A (x-r, y-r, z, w) (0, 0, r, q) + B (x+r, y-r, z, w) (1, 0, r, q) + C (x+r, y+r, z, w) (1, 1, r, q) + D (x-r, y+r, z, w) (0, 1, r, q) + + where x, y, z, w are the point's window coordinates, r and q are the + point's 3rd and 4th texture coordinates and r is half the point's + size. The other vertex attributes (such as the color and fog coordinate) + are simply duplicated from the original point vertex. + + Point size may either be specified with PointSize or computed + according to the EXT_point_parameters extension. + + The new texture coordinates are not effected by texgen or the texture + matrix. Note, however, that the texture r and q coordinates are passed + unchanged and may have been computed with texgen and/or the texture + matrix. + + If multiple texture units are present the same texture coordinate is + used for all texture units. + + The point is then rendered as if it were a quadrilateral using the + normal point sampling rules. POLYGON_MODE does not effect the + rasterization of the quadrilateral but POLYGON_SMOOTH does. + + POINT_SMOOTH has no effect when SPRITE_POINT_MESA is enabled. + +Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations +and the Frame Buffer) + + None. + +Additions to Chapter 5 of the 1.1 Specification (Special Functions) + + None + +Additions to Chapter 6 of the 1.1 Specification (State and State Requests) + + None + +Additions to the GLX Specification + + None + +GLX Protocol + + TBD + +Errors + + None + +New State + + Add boolean variable SPRITE_POINT_MESA to the point attribute group. + +Revision History + + Version 1.0 - 4 Dec 2000 + Original draft. + + + diff -Nru xpsb-glx-0.19/mesa/docs/OLD/MESA_trace.spec xpsb-glx-0.19/mesa/docs/OLD/MESA_trace.spec --- xpsb-glx-0.19/mesa/docs/OLD/MESA_trace.spec 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/OLD/MESA_trace.spec 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,359 @@ +Name + + MESA_trace + +Name Strings + + GL_MESA_trace + +Contact + + Bernd Kreimeier, Loki Entertainment, bk 'at' lokigames.com + Brian Paul, VA Linux Systems, Inc., brianp 'at' valinux.com + +Status + + Obsolete. + +Version + + +Number + + none yet + +Dependencies + + OpenGL 1.2 is required. + The extension is written against the OpenGL 1.2 Specification + +Overview + + Provides the application with means to enable and disable logging + of GL calls including parameters as readable text. The verbosity + of the generated log can be controlled. The resulting logs are + valid (but possibly incomplete) C code and can be compiled and + linked for standalone test programs. The set of calls and the + amount of static data that is logged can be controlled at runtime. + The application can add comments and enable or disable tracing of GL + operations at any time. The data flow from the application to GL + and back is unaffected except for timing. + + Application-side implementation of these features raises namespace + and linkage issues. In the driver dispatch table a simple + "chain of responsibility" pattern (aka "composable piepline") + can be added. + +IP Status + + The extension spec is in the public domain. The current implementation + in Mesa is covered by Mesa's XFree86-style copyright by the authors above. + This extension is partially inspired by the Quake2 QGL wrapper. + +Issues + + + (1) Is this Extension obsolete because it can + be implemented as a wrapper DLL? + + RESOLVED: No. While certain operating systems (Win32) provide linkers + that facilitate this kind of solution, other operating systems + (Linux) do not support hierarchical linking, so a wrapper solution + would result in symbol collisions. + Further, IHV's might have builtin support for tracing GL execution + that enjoys privileged access, or that they do not wish to separate + the tracing code from their driver code base. + + (2) Should the Trace API explicitely support the notion of "frames? + This would require hooking into glXSwapBuffers calls as well. + + RESOLVED: No. The application can use NewTraceMESA/EndTraceMESA + and TraceComment along with external parsing tools to split the + trace into frames, in whatever way considered adequate. + + (2a) Should GLX calls be traced? + + PBuffers and other render-to-texture solutions demonstrate that + context level commands beyond SwapBuffers might have to be + traced. The GL DLL exports the entry points, so this would not + be out of the question. + + (3) Should the specification mandate the actual output format? + + RESOLVED: No. It is sufficient to guarantee that all data and commands + will be traced as requested by Enable/DisableTraceMESA, in the order + encountered. Whether the resulting trace is available as a readable + text file, binary metafile, compilable source code, much less which + indentation and formatting has been used, is up to the implementation. + For the same reason this specification does not enforce or prohibit + additional information added to the trace (statistics, profiling/timing, + warnings on possible error conditions). + + (4) Should the comment strings associated with names and pointer (ranges) + be considered persistent state? + + RESOLVED: No. The implementation is not forced to use this information + on subsequent occurences of name/pointer, and is free to consider it + transient state. + + (5) Should comment commands be prohibited between Begin/End? + + RESOLVED: Yes, with the exception of TraceCommentMESA. TraceCommentMESA + is transient, the other commands might cause storage of persistent + data in the context. There is no need to have the ability mark names + or pointers between Begin and End. + + +New Procedures and Functions + + void NewTraceMESA( bitfield mask, const ubyte * traceName ) + + void EndTraceMESA( void ) + + void EnableTraceMESA( bitfield mask ) + + void DisableTraceMESA( bitfield mask ) + + void TraceAssertAttribMESA( bitfield attribMask ) + + void TraceCommentMESA( const ubyte* comment ) + + void TraceTextureMESA( uint name, const ubyte* comment ) + + void TraceListMESA( uint name, const ubyte* comment ) + + void TracePointerMESA( void* pointer, const ubyte* comment ) + + void TracePointerRangeMESA( const void* first, + const void* last, + const ubyte* comment ) + +New Tokens + + Accepted by the parameter of EnableTrace and DisableTrace: + + TRACE_ALL_BITS_MESA 0xFFFF + TRACE_OPERATIONS_BIT_MESA 0x0001 + TRACE_PRIMITIVES_BIT_MESA 0x0002 + TRACE_ARRAYS_BIT_MESA 0x0004 + TRACE_TEXTURES_BIT_MESA 0x0008 + TRACE_PIXELS_BIT_MESA 0x0010 + TRACE_ERRORS_BIT_MESA 0x0020 + + Accepted by the parameter of GetIntegerv, GetBooleanv, + GetFloatv, and GetDoublev: + + TRACE_MASK_MESA 0x8755 + + Accepted by the parameter to GetString: + + TRACE_NAME_MESA 0x8756 + + +Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) + + None. + +Additions to Chapter 3 of the OpenGL 1.2.1 Specification (OpenGL Operation) + + None. + +Additions to Chapter 4 of the OpenGL 1.2.1 Specification (OpenGL Operation) + + None. + +Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) + + Add a new section: + + 5.7 Tracing + + The tracing facility is used to record the execution of a GL program + to a human-readable log. The log appears as a sequence of GL commands + using C syntax. The primary intention of tracing is to aid in program + debugging. + + A trace is started with the command + + void NewTraceMESA( bitfield mask, const GLubyte * traceName ) + + may be any value accepted by PushAttrib and specifies a set of + attribute groups. The state values included in those attribute groups + is written to the trace as a sequence of GL commands. + + specifies a name or label for the trace. It is expected + that will be interpreted as a filename in most implementations. + + A trace is ended by calling the command + + void EndTraceMESA( void ) + + It is illegal to call NewTraceMESA or EndTraceMESA between Begin and End. + + The commands + + void EnableTraceMESA( bitfield mask ) + void DisableTraceMESA( bitfield mask ) + + enable or disable tracing of different classes of GL commands. + may be the union of any of TRACE_OPERATIONS_BIT_MESA, + TRACE_PRIMITIVES_BIT_MESA, TRACE_ARRAYS_BIT_MESA, TRACE_TEXTURES_BIT_MESA, + and TRACE_PIXELS_BIT_MESA. The special token TRACE_ALL_BITS_MESA + indicates all classes of commands are to be logged. + + TRACE_OPERATIONS_BIT_MESA controls logging of all commands outside of + Begin/End, including Begin/End. + + TRACE_PRIMITIVES_BIT_MESA controls logging of all commands inside of + Begin/End, including Begin/End. + + TRACE_ARRAYS_BIT_MESA controls logging of VertexPointer, NormalPointer, + ColorPointer, IndexPointer, TexCoordPointer and EdgeFlagPointer commands. + + TRACE_TEXTURES_BIT_MESA controls logging of texture data dereferenced by + TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, and + TexSubImage3D commands. + + TRACE_PIXELS_BIT_MESA controls logging of image data dereferenced by + Bitmap and DrawPixels commands. + + TRACE_ERRORS_BIT_MESA controls logging of all errors. If this bit is + set, GetError will be executed whereever applicable, and the result will + be added to the trace as a comment. The error returns are cached and + returned to the application on its GetError calls. If the user does not + wish the additional GetError calls to be performed, this bit should not + be set. + + The command + + void TraceCommentMESA( const ubyte* comment ) + + immediately adds the string to the trace output, surrounded + by C-style comment delimiters. + + The commands + + void TraceTextureMESA( uint name, const ubyte* comment ) + void TraceListMESA( uint name, const ubyte* comment ) + + associates with the texture object or display list specified + by . Logged commands which reference the named texture object or + display list will be annotated with . If IsTexture(name) or + IsList(name) fail (respectively) the command is quietly ignored. + + The commands + + void TracePointerMESA( void* pointer, const ubyte* comment ) + + void TracePointerRangeMESA( const void* first, + const void* last, + const ubyte* comment ) + + associate with the address specified by or with + a range of addresses specified by through . + Any logged commands which reference or an address between + and will be annotated with . + + The command + + void TraceAssertAttribMESA( bitfield attribMask ) + + will add GL state queries and assertion statements to the log to + confirm that the current state at the time TraceAssertAttrib is + executed matches the current state when the trace log is executed + in the future. + + is any value accepted by PushAttrib and specifies + the groups of state variables which are to be asserted. + + The commands NewTraceMESA, EndTraceMESA, EnableTraceMESA, DisableTraceMESA, + TraceAssertAttribMESA, TraceCommentMESA, TraceTextureMESA, TraceListMESA, + TracePointerMESA and TracePointerRangeMESA are not compiled into display lists. + + + Examples: + + The command NewTraceMESA(DEPTH_BUFFER_BIT, "log") will query the state + variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE + to get the values , , , and respectively. + Statements equivalent to the following will then be logged: + + glEnable(GL_DEPTH_TEST); (if is true) + glDisable(GL_DEPTH_TEST); (if is false) + glDepthFunc(); + glDepthMask(); + glClearDepth(); + + + The command TraceAssertAttribMESA(DEPTH_BUFFER_BIT) will query the state + variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE + to get the values , , , and respectively. + The resulting trace might then look will like this: + + { + GLboolean b; + GLint i; + GLfloat f; + b = glIsEnabled(GL_DEPTH_TEST); + assert(b == ); + glGetIntegerv(GL_DEPTH_FUNC, &i); + assert(i == ); + glGetIntegerv(GL_DEPTH_MASK, &i); + assert(i == ); + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &f); + assert(f == ); + } + + +Additions to Chapter 6 of the OpenGL 1.2.1 Specification + (State and State Requests) + + Querying TRACE_MASK_MESA with GetIntegerv, GetFloatv, GetBooleanv or + GetDoublev returns the current command class trace mask. + + Querying TRACE_NAME_MESA with GetString returns the current trace name. + + +Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance) + + The MESA_trace extension can be used in a way that does not affect data + flow from application to OpenGL, as well as data flow from OpenGL to + application, except for timing, possible print I/O. TRACE_ERRORS_BIT_MESA + will add additional GetError queries. Setting a trace mask with NewTraceMESA + as well as use of TraceAssertAttribMESA might cause additional state queries. + With the possible exception of performance, OpenGL rendering should not be + affected at all by a properly chosen logging operation. + +Additions to the AGL/GLX/WGL Specifications + + None. + +GLX Protocol + + None. The logging operation is carried out client-side, by exporting + entry points to the wrapper functions that execute the logging operation. + +Errors + + INVALID_OPERATION is generated if any trace command except TraceCommentMESA + is called between Begin and End. + +New State + + The current trace name and current command class mask are stored + per-context. + +New Implementation Dependent State + + None. + +Revision History + + * Revision 0.1 - Initial draft from template (bk000415) + * Revision 0.2 - Draft (bk000906) + * Revision 0.3 - Draft (bk000913) + * Revision 0.4 - Reworked text, fixed typos (bp000914) + * Revision 0.5 - Assigned final GLenum values (bp001103) + * Revision 0.6 - TRACE_ERRORS_BIT_MESA (bk000916) + * Revision 0.7 - Added MESA postfix (bk010126) + diff -Nru xpsb-glx-0.19/mesa/docs/osmesa.html xpsb-glx-0.19/mesa/docs/osmesa.html --- xpsb-glx-0.19/mesa/docs/osmesa.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/osmesa.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,88 @@ + + +Off-screen Rendering + + + + + +

    Off-screen Rendering

    + + +

    +Mesa's off-screen rendering interface is used for rendering into +user-allocated blocks of memory. +That is, the GL_FRONT colorbuffer is actually a buffer in main memory, +rather than a window on your display. +There are no window system or operating system dependencies. +One potential application is to use Mesa as an off-line, batch-style renderer. +

    + +

    +The OSMesa API provides three basic functions for making off-screen +renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and +OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for +more information about the API functions. +

    + +

    +There are several examples of OSMesa in the progs/osdemo/ +directory. +

    + + +

    Deep color channels

    + +

    +For some applications 8-bit color channels don't have sufficient +precision. +OSMesa supports 16-bit and 32-bit color channels through the OSMesa interface. +When using 16-bit channels, channels are GLushorts and RGBA pixels occupy +8 bytes. +When using 32-bit channels, channels are GLfloats and RGBA pixels occupy +16 bytes. +

    + +

    +Before version 6.5.1, Mesa had to be recompiled to support exactly +one of 8, 16 or 32-bit channels. +With Mesa 6.5.1, Mesa can be compiled for either 8, 16 or 32-bit channels +and render into any of the smaller size channels. +For example, if Mesa's compiled for 32-bit channels, you can also render +16 and 8-bit channel images. +

    + +

    +To build Mesa/OSMesa for 16 and 8-bit color channel support: +

    +      make realclean
    +      make linux-osmesa16
    +
    + +

    +To build Mesa/OSMesa for 32, 16 and 8-bit color channel support: +

    +      make realclean
    +      make linux-osmesa32
    +
    + +

    +You'll wind up with a library named libOSMesa16.so or libOSMesa32.so. +Otherwise, most Mesa configurations build an 8-bit/channel libOSMesa.so library +by default. +

    + +

    +If performance is important, compile Mesa for the channel size you're +most interested in. +

    + +

    +If you need to compile on a non-Linux platform, copy Mesa/configs/linux-osmesa16 +to a new config file and edit it as needed. Then, add the new config name to +the top-level Makefile. Send a patch to the Mesa developers too, if you're +inclined. +

    + + + diff -Nru xpsb-glx-0.19/mesa/docs/pbuffers.html xpsb-glx-0.19/mesa/docs/pbuffers.html --- xpsb-glx-0.19/mesa/docs/pbuffers.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/pbuffers.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,54 @@ + + +PBuffer Rendering + + + + + +

    PBuffer Rendering

    + +

    +Basically, FBconfigs and PBuffers allow you to do off-screen rendering +with OpenGL. The OSMesa interface does basically the same thing, but +fbconfigs and pbuffers are supported by more vendors. +PBuffer rendering may also be hardware accelerated. +

    + +

    +PBuffers are getting more use nowadays, though they've actually been +around for a long time on IRIX systems and other workstations. +

    + +

    +The +GL_SGIX_fbconfig +and + +GL_SGIX_pbuffer extensions describe the functionality. +More recently, these extensions have been promoted to ARB extensions (on +Windows at least). +

    + +

    +The Mesa/progs/xdemos/ directory has some useful code for working +with pbuffers: +

    + +
      +
    • pbinfo.c - like glxinfo, it prints a list of available + fbconfigs and whether each supports pbuffers. +
    • pbutil.c - a few utility functions for dealing with + fbconfigs and pbuffers. +
    • pbdemo.c - a demonstration of off-screen rendering with pbuffers. +
    + +

    +Mesa 4.1 and later support GL_SGIX_fbconfig and GL_SGIX_pbuffer (software +rendering only). +

    + + + diff -Nru xpsb-glx-0.19/mesa/docs/perf.html xpsb-glx-0.19/mesa/docs/perf.html --- xpsb-glx-0.19/mesa/docs/perf.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/perf.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,68 @@ + + +Performance Tips + + + + + +

    Performance Tips

    + +

    +Performance tips for software rendering: +

    +
      + +
    1. Turn off smooth shading when you don't need it (glShadeModel) +
    2. Turn off depth buffering when you don't need it. +
    3. Turn off dithering when not needed. +
    4. Use double buffering as it's often faster than single buffering +
    5. Compile in the X Shared Memory extension option if it's supported + on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for + your system in the Make-config file. +
    6. Recompile Mesa with more optimization if possible. +
    7. Try to maximize the amount of drawing done between glBegin/glEnd pairs. +
    8. Use the MESA_BACK_BUFFER variable to find best performance in double + buffered mode. (X users only) +
    9. Optimized polygon rasterizers are employed when: + rendering into back buffer which is an XImage + RGB mode, not grayscale, not monochrome + depth buffering is GL_LESS, or disabled + flat or smooth shading + dithered or non-dithered + no other rasterization operations enabled (blending, stencil, etc) +
    10. Optimized line drawing is employed when: + rendering into back buffer which is an XImage + RGB mode, not grayscale, not monochrome + depth buffering is GL_LESS or disabled + flat shading + dithered or non-dithered + no other rasterization operations enabled (blending, stencil, etc) +
    11. Textured polygons are fastest when: + using a 3-component (RGB), 2-D texture + minification and magnification filters are GL_NEAREST + texture coordinate wrap modes for S and T are GL_REPEAT + GL_DECAL environment mode + glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ) + depth buffering is GL_LESS or disabled +
    12. Lighting is fastest when: + Two-sided lighting is disabled + GL_LIGHT_MODEL_LOCAL_VIEWER is false + GL_COLOR_MATERIAL is disabled + No spot lights are used (all GL_SPOT_CUTOFFs are 180.0) + No local lights are used (all position W's are 0.0) + All material and light coefficients are >= zero +
    13. XFree86 users: if you want to use 24-bit color try starting your + X server in 32-bit per pixel mode for better performance. That is, + start your X server with + startx -- -bpp 32 + instead of + startx -- -bpp 24 +
    14. Try disabling dithering with the MESA_NO_DITHER environment variable. + If this env var is defined Mesa will disable dithering and the + command glEnable(GL_DITHER) will be ignored. +
    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/precompiled.html xpsb-glx-0.19/mesa/docs/precompiled.html --- xpsb-glx-0.19/mesa/docs/precompiled.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/precompiled.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,26 @@ + + +Precompiled libraries + + + + + +

    Precompiled Libraries

    + +

    +In general, precompiled libraries are not available. +However, people occasionally prepare packages of precompiled libraries +for some systems. +

    + +

    Mesa-6.0 for Solaris

    + +

    +Steve Christensen has submitted precompiled Mesa-6.0 libraries for +Solaris at +sunfreeware.com. +

    + + + diff -Nru xpsb-glx-0.19/mesa/docs/README.3DFX xpsb-glx-0.19/mesa/docs/README.3DFX --- xpsb-glx-0.19/mesa/docs/README.3DFX 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.3DFX 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,830 @@ + + 3Dfx Glide device driver + + + +Requirements: +------------- + +A Voodoo-based videocard/accelerator +DOS (with DJGPP), Windows9x/2k (with MinGW), Linux +Glide3x library for your OS + +http://sourceforge.net/projects/glide/ + + + +How to compile: +--------------- + +DJGPP: + Place the Glide3 SDK in the top Mesa directory: + $(MESA)/glide3/include/ + 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h + $(MESA)/glide3/lib/ + libgld3x.a, libgld3i.a, glide3x.dxe + Type: + make -f Makefile.DJ X86=1 FX=1 + Look into the makefile for further information. + +MinGW: + Place the Glide3 SDK in the top Mesa directory: + $(MESA)/glide3/include/ + 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h + $(MESA)/glide3/lib/ + libglide3x.a, glide3x.dll + Type: + make -f Makefile.mgw X86=1 FX=1 + Look into the makefile for further information. + +Linux: + Place the Glide3 SDK in /usr/local/glide + /usr/local/glide/include/ + 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h + /usr/local/glide/lib/ + libglide3x.a, libglide3x.so + Type: + make linux-glide + or + make linux-x86-glide + + + +Compilation defines: +-------------------- + +FX_DEBUG + enable driver debug code +FX_TRAP_GLIDE + enable Glide trace code +FX_PACKEDCOLOR + use packed color in vertex structure +FX_TC_NAPALM + map GL_COMPRESSED_RGB[A] to FXT1. Works with VSA100-based cards only. +FX_COMPRESS_S3TC_AS_FXT1_HACK + map S3TC to FXT1 +FX_RESCALE_BIG_TEXURES_HACK + fake textures larger than HW can support + (see MESA_FX_MAXLOD environment variable) + + + +Environment variables: +---------------------- + +The following environment variables affect MesaFX. Those that affect Glide +only, are beyond the scope of this section. Entries that don't have a "Value" +field, can have any value whatsoever + ex: set MESA_FX_IGNORE_CMBEXT=y + +"Note" (*) means that the environment variable affects Glide, too; also, if +the var is not found in the environment, it is searched in windoze registry. +"Note" (!) means that the environment variable is not working as expected; +may have undefined effects, might have effects only at Glide level or might +not have any effect whatsoever. Caveat emptor! Those are to be revised soon. + +It is recommended to leave the envvars alone, so that Mesa/Glide will run with +default values. Use them only when you experience crashes or strange behavior. + +FX_GLIDE_NUM_TMU + OS: all + HW: dual-TMU cards (Voodoo2, Avenger, Napalm) + Desc: force single-TMU + Note: (*) + Value: "1" +FX_GLIDE_SWAPPENDINGCOUNT + OS: all + HW: all + Desc: max # of buffers allowed to build up + Note: (*) (!) + Value: "0", "1", "2", "3", "4", "5" or "6" +FX_GLIDE_SWAPINTERVAL + OS: all + HW: all + Desc: number of vertical retraces to wait before swapping + Note: (*) (!) works only at Glide-level? +SSTH3_SLI_AA_CONFIGURATION + OS: all + HW: VSA100-based cards + Desc: SLI/AA setup + Note: (*) (!) works only at Glide-level? + Value: + 1, 2, 4 chip cards + "0" - SLI & AA disable + "1" - SLI disabled, 2 sample AA enabled + 2, 4 chip cards + "2" - 2-way SLI enabled, AA disabled + "3" - 2-way SLI enabled, 2 sample AA enabled + "4" - SLI disabled, 4 sample AA enabled + 4 chip cards + "5" - 4-way SLI enabled, AA disabled + "6" - 4-way SLI enabled, 2 sample AA enabled + "7" - 2-way SLI enabled, 4 sample AA enabled + "8" - SLI disabled, 8 sample AA enabled +SST_DUALHEAD + OS: win32 + HW: ? + Desc: ? + Note: (!) disabled? +MESA_FX_NO_SIGNALS + OS: linux + HW: all + Desc: avoid installing signals + Note: (!) untested! +MESA_FX_INFO + OS: all + HW: all + Desc: verbose to stderr + Value: any; special value "r" to redirect stderr to MESA.LOG +MESA_FX_NOSNAP + OS: all + HW: Voodoo1, Rush, Banshee + Desc: do not snap vertices inside Mesa + Note: to be used with Glide3x that snaps vertices internally +MESA_FX_POINTCAST + OS: all + HW: dual-TMU cards (some Voodoo1, Voodoo2, Avenger, Napalm) + Desc: try to use pointcast palette + Note: may give adverse effects on UMA cards (Avenger, Napalm) +MESA_FX_IGNORE_PALEXT + OS: all + HW: all + Desc: disable 6666 palette +MESA_FX_IGNORE_PIXEXT + OS: all + HW: Napalm + Desc: force 565 16bpp mode (traditional Voodoo, no 32/15bpp) +MESA_FX_IGNORE_TEXFMT + OS: all + HW: Napalm + Desc: disable 32bit textures +MESA_FX_IGNORE_CMBEXT + OS: all + HW: Napalm + Desc: disable Napalm combiners (color/alpha/texture) + Note: this option allows dual-TMU cards perform single-pass + trilinear, but some advanced (multi)texturing modes + won't work (GL_EXT_texture_env_combine) +MESA_FX_IGNORE_MIREXT + OS: all + HW: all + Desc: disable mirror extension +MESA_FX_IGNORE_TEXUMA + OS: all + HW: all + Desc: disable UMA +MESA_FX_IGNORE_TEXUS2 + OS: all + HW: all + Desc: disable Texus2 +MESA_FX_MAXLOD + OS: all + HW: non VSA-100 cards + Desc: enable large texture support using SW rescaling + Value: + "9" - 512x512 textures + "10" - 1024x1024 textures + "11" - 2048x2048 textures +MESA_FX_ALLOW_VP + OS: all + HW: all + Desc: allow vertex program extensions +MESA_GLX_FX + OS: linux + HW: Voodoo1, Rush, Voodoo2 + Desc: display mode + Note: (!) experimental + Value: + "w" - windowed mode + "f" - fullscreen mode + "d" - disable glide driver + OS: win32 + HW: Rush, Banshee, Avenger, Napalm + Desc: display mode + Note: (!) experimental + Value: + "w" - windowed mode + + + +Contact: +-------- + +Daniel Borca +Hiroshi Morii + + + +WARNING! The info below this line is outdated (yet some of it useful). WARNING! +******************************************************************************* + + + +Info for Mesa 4.1 +----------------- + +The 3dfx Glide driver in Mesa is disabled by default. Not too many people +use this driver anymore and at some point down the road it will be dropped. + +To use/enable the Glide driver either do this: + +'./configure --with-glide=DIR' Where DIR is the location of Glide, like + /usr/ or /usr/local + +OR + +'make linux-x86-glide' If using the old-style Makefile system. + +The rest of this file hasn't changed since Mesa 3.3. Some of it's out of +date, but some is still valid. + + + +What do you need ? +------------------ + + - A PC with a 3Dfx Voodoo1/2 Graphics or Voodoo Rush based board + (Pure3D, Monster 3D, R3D, Obsidian, Stingray 128/3D, etc.). + The Quantum3D Obsidian3D-2 X-24 requires some special env. setting + under Linux (more information in the "Useful Glide Environment + Variables"); + + - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine). + The Voodoo2 requires the Glide library 2.51. The Glide 3.1 is not + compatible with the Glide 2.x so it doesn't work with the current + version of the driver; + + - A compiler supported by the Glide library (Micro$oft VC++ (tested), + Watcom (tested), GCC for Linux (tested), etc.); + + - It's nice to have two monitors - one for your normal graphics + card and one for your 3Dfx card. If something goes wrong with + an application using the 3Dfx hardware you can still see your + normal screen in order to recover. + + + +Tested on: +---------- + Windows 95 - David Bucciarelli + Windows NT - Henri Fousse + MS-DOS + Linux - Daryll Strauss, Brian Paul, David Bucciarelli + FreeBSD + BeOS - Duncan Wilcox + MacOS - Fazekas Miklos + + +What is able to do ? +-------------------- + + - It is able accelerate points, lines and polygon with flat + shading, gouraud shading, Z-buffer, texture mapping, blending, fog and + antialiasing (when possible). There is also the support for rendering + in a window with a slow trick for the Voodoo Graphics (available only + for Linux) and at full speed with the Voodoo Rush chipset. + Under Linux is also possible to switch on-the-fly between the fullscreen + and in-window rendering hack. + There is also the support for using more than one Voodoo Graphics in the + some application/PC (you can create one context for each board and use + multiple video outputs for driving monitors, videoprojectors or HMDs). + The driver is able to fallback to pure software rendering when afeature + isn't supported by the Voodoo hardware (however software rendering is + very slow compared to hardware supported rendering) + + + +How to compile: +--------------- + +Linux: +------ + Here are the basic steps for using the 3Dfx hardware with Mesa + on Linux: + + - You'll need the Glide library and headers. Mesa expects: + /usr/local/glide/include/*.h // all the Glide headers + /usr/local/glide/lib/libglide2x.so + + If your Glide libraries and headers are in a different directory + you'll have to modify the Mesa-config and mklib.glide files. + + - Unpack the MesaLib-3.1.tar.gz and MesaDemos-3.1.tar.gz archives; + + - If you're going to use a newer Mesa/Glide driver than v0.27 then + unpack the new driver archive over the Mesa directory. + + - In the Mesa-3.1 directory type "make linux-glide" + + - Compilation _should_ finish without errors; + + - Set your LD_LIBRARY_PATH environment variable so that the + libglide2x.so and Mesa library files can be found. For example: + setenv LD_LIBRARY_PATH "/usr/local/glide/lib:/SOMEDIR/Mesa-3.1/lib" + + - You'll have to run Glide-based programs as root or set the suid + bit on executables; + + - Try a demo: + cd gdemos + su + setenv MESA_GLX_FX f + ./gears (hit ESC to exit) + + - You can find the demos especially designed for the Voodoo driver in + in the Mesa-3.1/3Dfx/demos directory (type "make" in order to compile + everything). + +MacOS: +------ + Check the WEB page at http://valerie.inf.elte.hu/~boga/Mesa.html + +MS Windows: +----------- + + For the MSVC++: + - The glide2x.lib have to be in the default MSVC++ lib directory; + + - The Glide headers have to be in the default MSVC++ include directory; + + - You must have the vcvars32.bat script in your PATH; + + - Go to the directory Mesa-3.1 and run the mesafx.bat; + + - The script will compile everything (Mesa-3.1/lib/OpenGL32.{lib,dll}, + Mesa-3.1/lib/GLU32.{lib,dll}, Mesa-3.1/lib/GLUT32.{lib,dll} and + Voodoo demos); + + - At the end, you will be in the Mesa-3.1/3Dfx/demos directory; + + - Try some demo (fire.exe, teapot.exe, etc.) in order to check if + everything is OK (you can use Alt-Tab or Ctrl-F9 to switch between + the Voodoo screen and the windows desktop); + + - Remember to copy the Mesa OpenGL32.dll, GLU32.dll and GLUT32.dll in the + some directory were you run your Mesa based applications. + + - I think that you can easy change the Makefile.fx files in order + to work with other kind of compilers; + + - To discover how open the 3Dfx screen, read the sources under + the Mesa-3.1/3Dfx/demos directory. You can use the GLUT library or + the Diego Picciani's wgl emulator. + + NOTE: the MSVC++ 5.0 optimizer is really buggy. Also if you install the + SP3, you could have some problem (you can disable optimization in order + solve these kind of problems). + + +Doing more with Mesa & Linux Glide: +----------------------------------- + + The MESA_GLX_FX environment variable can be used to coax most + GLX-based programs into using Glide (and the __GLUT library + is GLX-based__). + + Full-screen 3Dfx rendering: + --------------------------- + + 1. Set the MESA_GLX_FX variable to "fullscreen": + + ksh: + export MESA_GLX_FX = "fullscreen" + csh: + setenv MESA_GLX_FX fullscreen + + 2. As root, run a GLX-based program (any GLUT demo on Linux). + + 3. Be careful: once the 3Dfx screen appears you won't be able + to see the GLUT windows on your X display. This can make using + the mouse tricky! One solution is to hook up your 3Dfx card to + a second monitor. If you can do this then set these env vars + first: + + setenv SST_VGA_PASS 1 + setenv SST_NOSHUTDOWN + + or for the Voodoo2: + + setenv SSTV2_VGA_PASS 1 + setenv SSTV2_NOSHUTDOWN + + Rendering into an X window with the help of the Voodoo hardware: + ---------------------------------------------------------------- + + 1. Start your X server in 16 bpp mode (XFree86: startx -- -bpp 16) + in order to have the best performance and the best visual + quality. However you can use any visual depth supported by X. + + 2. Set the following environment variables: + export MESA_GLX_FX="window" # to enable window rendering + export SST_VGA_PASS=1 # to stop video signal switching + export SST_NOSHUTDOWN=1 # to stop video signal switching + OR + setenv MESA_GLX_FX window + setenv SST_VGA_PASS 1 + setenv SST_NOSHUTDOWN 1 + + (the Voodoo2 requires to use "SSTV2_" instead "SST_"). + + 3. As root, try running a GLX-based program + + How does it work? We use the 3Dfx hardware to do rendering then + copy the image from the 3Dfx frame buffer into an X window when + the SwapBuffers() function is called. The problem with this + idea is it's slow. The image must be copied from the 3Dfx frame + buffer to main memory then copied into the X window (and when the X + visual depth doesn't match the Voodoo framebufffer bit per pixel, it + is required also a pixel format translation). + + NOTE: the in-window rendering feature only works with double-buffering. + + + On the fly switching between in window rendering and full screen rendering + -------------------------------------------------------------------------- + + The Mesa 2.6 has introduced the capability of switching + on-the-fly between the fullscreen/fullspeed rendering and the in-window + hack and vice versa. The on-the-fly switching requires a direct support + by the application but it is really easy to add. You have to start + your X server in 16 bpp mode and to add the following lines to your + application: + + #if defined(FX) && define(XMESA) + #include + + static int fullscreen=1; + #endif + + ... + + /* In the GLUT keyboard event callback */ + + #if defined(FX) && !define(WIN32) + case ' ': + fullscreen=(!fullscreen); + XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW); + break; + #endif + ... + + See the 3Dfx/demos/tunnel.c program + for an example. You have to set the -DXMESA flag in the Makefile's COPTS + to enable it. + + Rendering into an X window with the X11 software driver: + -------------------------------------------------------- + + Set the MESA_GLX_FX variable to "disable" your GLX-based program will use + the X11 software driver (the 3Dfx hardware isn't used at all). + + + +Useful Glide Environment Variables: +----------------------------------- + + - To disable the 3Dfx logo, set the FX_GLIDE_NO_SPLASH variable. + + - To disable video signal switching: + setenv SST_VGA_PASS 1 + setenv SST_NOSHUTDOWN + or for the Voodoo2: + setenv SSTV2_VGA_PASS 1 + setenv SSTV2_NOSHUTDOWN + + - To set the default screen refresh rate: + setenv SST_SCREENREFRESH=75 + + the supported values are 60, 70, 72, 75, 80, 85, 90, 100, 120. + + - To force the Mesa library to swap buffers as fast as possible, + without any vertical blanking synchronization (useful for benchmarks): + setenv FX_GLIDE_SWAPINTERVAL 0 + setenv SST_SWAP_EN_WAIT_ON_VIDSYNC 0 + + - You can slight improve the performances of your Voodoo1 board with + the following env. var.: + setenv SST_FASTMEM 1 + setenv SST_PCIRD 1 + setenv SST_GRXCLK 57 + + (don't use this setting with the Quantum3D 100SB or with any other + SLI configuration: it will hang everything !). + The following setting can be used with the Voodoo2: + setenv SSTV2_FASTMEM_RAS_READS=1 + setenv SSTV2_FASTPCIRD=1 + setenv SSTV2_GRXCLK=95 + + - The Quantum3D Obsidian3D-2 X-24 requires some special env. setting + in order to work under Linux: + + export SSTV2_FT_CLKDEL=5 + export SSTV2_TF0_CLKDEL=7 + export SSTV2_TF1_CLKDEL=7 + export SSTV2_TF2_CLKDEL=7 + export SSTV2_SLIM_VIN_CLKDEL=3 + export SSTV2_SLIM_VOUT_CLKDEL=2 + export SSTV2_SLIS_VIN_CLKDEL=3 + export SSTV2_SLIS_VOUT_CLKDEL=2 + + (Thanks to Phil Ross for this trick). + + + + +The Mesa/Voodoo Environment Variables: +-------------------------------------- + + - Only for Windows/Voodoo Rush users, if you define the + env. var. MESA_WGL_FX: + export MESA_WGL_FX=fullscreen + you will get fullscreen rendering; + + - Only for Windows/Voodoo Rush users, if you define the + env. var. MESA_WGL_FX: + export MESA_WGL_FX=window + you will get window rendering (default value); + + - Only for Linux users, you can find more informations about + the env. var. MESA_GLX_FX in the "Doing more with Mesa & Linux Glide" + section; + + - If you define the env. var. MESA_FX_SWAP_PENDING: + export MESA_FX_SWAP_PENDING=4 + you will able to set the maximum number of swapbuffers + commands in the Voodoo FIFO after a swapbuffer (default value: 2); + + - If you define the env. var. MESA_FX_INFO: + export MESA_FX_INFO=1 + you will get some useful statistic. + + - If you define the env. var. MESA_FX_NO_SIGNALS: + export MESA_FX_NO_SIGNALS=1 + Mesa/FX will not install atexit() or signal() handlers. + + + +Know BUGS and Problems: +----------------------- + + - fog doesn't work in the right way when using the glDepthRange() function; + + - Maximum texture size: 256x256 (this is an hardware limit); + + - Texture border aren't yet supported; + + - A GL_BLEND in a glTexEnv() is not supported (it is an hardware limit); + + - Use the glBindTexture extension (standard in OpenGL 1.1) for texture + mapping (the old way: glTexImage inside a display list, download + the texture map each time that you call the display list !!!); + + - Stencil buffer and Accumulation buffer are emulated in software (they are not + directly supported by the Hardware); + + - Color index mode not implemented (this is an hardware limit); + + - Thre is an know bug in the Linux Glide library so the in-window-rendering hack + and any other operations that requires to read the Voodoo frame buffer + (like the accumulation buffer support) doesn't work on Voodoo SLI cards. + + - The driver switch to pure software (_slow_) rendering when: + + - Stencil enabled; + - Using the Accumulation buffer; + - Blend enabled and blend equation != GL_FUNC_ADD_EXT; + - Color logic operation enabled and color logic operation != GL_COPY; + - Using GL_SEPARATE_SPECULAR_COLOR; + - The four values of glColorMask() aren't the some; + - Texture 1D or 3D enabled; + - Texture function is GL_BLEND; + - Using the Multitexture extension with Voodoo cards with only one TMU; + - Using the Multitexture extension with Voodoo cards with more than + one TMU, and texture function isn't GL_MODULATE; + - Point size is != 1.0 or point params vector != (1.0,0.0,0.0); + - Line width != 1.0 or using stipple lines. + - Using polygon offset or stipple polygons; + + NOTE: this is list is not yet complete. + + +Hints and Special Features: +--------------------------- + + - Under Linux and with a Voodoo Graphics board, you can use + XMesaSetFXmode(XMESA_FX_FULLSCREEN or XMESA_FX_WINDOW) in order to + switch on the fly between fullscreen rendering and the in-window-rendering + hack. + + - The driver is able to use all the texture memory available: 2/4MB on + Voodoo1 boards and 8MB (!) on high-end Voodoo1 and Voodoo2 boards. + + - Trilinear filtering is fully supported on Voodoo boards with two TMUs + (high-end Voodoo1 boards and Voodoo2 boards). When only one TMU is + available the driver fallback to bilinear filter also if you ask + for trilinear filtering. + + - The Voodoo driver support multiple Voodoo Graphics boards in the + some PC. Using this feature, you can write applications that use + multiple monitors, videoprojectors or HMDs for the output. See + Mesa-3.1/3Dfx/demos/tunnel2.c for an example of how setup one + context for each board. + + - The v0.19 introduces a new powerful texture memory manager: the + texture memory is used as a cache of the set of all defined texture + maps. You can now define several MBs of texture maps also with a 2MB + of texture memory (the texture memory manager will do automatically + all the swap out/swap in + texture memory work). The new texture memory manager has also + solved a lot of other bugs/no specs compliance/problems + related to the texture memory usage. + + - Use triangles and quads strip: they are a LOT faster than sparse + triangles and quads. + + - The Voodoo driver supports the GL_EXT_paletted_texture. it works + only with GL_COLOR_INDEX8_EXT, GL_RGBA palettes and the alpha value + is ignored because this is a limitation of the the current Glide + version and of the Voodoo hardware. See Mesa-3.1/3Dfx/demos/paltex.c for + a demo of this extension. + + - The Voodoo driver directly supports 3Dfx Global Palette extension. + It was written for GLQuake and I think that it isn't a good idea + to use this extension for any other purpose (it is a trick). See + Mesa-3.1/3Dfx/demos/glbpaltex.c for a demo of this extension. + + - The Voodoo driver chooses the screen resolution according to the + requested window size. If you open a 640x480 window, you will get + a 640x480 screen resolution, if you open a 800x600 window, you + will get a 800x600 screen resolution, etc. + Most GLUT demos support the '-geometry' option, so you can choose + the screen resolution: 'tunnel -geometry 800x600'. + Clearly, you Voodoo board must have enough framebuffer RAM (otherwise + the window creation will fail). + + - The glGetString(GL_RENDERER) returns more information + about the hardware configuration: "Mesa Glide + CARD/ FB/ + TM/ TMU/" + where: CARD is the card used for the current context, + FB is the number of MB for the framebuffer, + TM is the number of MB for the texture memory, + TMU is the number of TMU. You can try to run + Mesa/demos/glinfo in order to have an example of the output. + +Did you find a lot BUGs and problems ? Good, send me an email. + + + +FAQ: +---- + +For a complete FAQ check the Bernd Kreimeier's Linux 3Dfx HOWTO +available at http://www.gamers.org/dEngine/xf3D (it includes also +a lot of informations not strictly related to Linux, so it can be +useful also if you don't use Linux) + +1. What is 3Dfx? + +3Dfx Interactive, Inc. is the company which builds the VooDoo 3-D graphics +chipset (and others) used in popular PC cards such as the Diamond Monster 3D +and the Orchid Righteous 3D (more informations at http://www.3dfx.com). + + +2. What is Glide? + +Glide is a "thin" programming interface for the 3Dfx hardware. It was +originally written for Windows/Intel but has been ported to Linux/Intel +by Daryll Strauss. + +3Dfx, Inc. should be applauded for allowing the Linux version of Glide +to be written. + +You can directly program with the Glide library if you wish. You can +obtain Glide from the "Developer" section of the 3Dfx website: www.3dfx.com +There's a Linux/Glide newsgroup at news://news.3dfx.com/3dfx.glide.linux + + +3. What is fxmesa? + +"fxmesa" is the name of the Mesa device driver for the 3Dfx Glide library. +It was written by David Bucciarelli and others. It works on both Linux +and Windows. Basically, it allows you to write and run OpenGL-style programs +on the 3Dfx hardware. + + +4. What is GLQuake? + +Quake is a very popular game from id software, Inc. See www.idsoftware.com +GLQuake is a version of Quake written for OpenGL. There is now a Linux +version of GLQuake with works with the Mesa/3Dfx/Glide combo. + +Here's what you need to run GLQuake on Linux: + PC with 100MHz Pentium or better + a 3Dfx-based card + Mesa 3.1 libraries: libMesaGL.so libMesaGLU.so + Glide 2.4 libraries: libglide2x.so libtexus.so + GLQuake for Linux. + +Also, the windows version of GLQuake works fine with the Mesa OpenGL32.dll, +you have only to copy the Mesa-3.1/lib/OpenGL32.dll in the GLQuake directory +in order to test 'MesaQuake'. + + +5. What is GLUT? + +GLUT is Mark Kilgard's OpenGL Utility Toolkit. It provides an API for +writing portable OpenGL programs with support for multiple windows, pop- +up menus, event handling, etc. + +Check the Mark's home page for more informations (http://reality.sgi.com/mjk_asd). + +Every OpenGL programmer should check out GLUT. + +GLUT on Linux uses GLX. + + +6. What is GLX? + +GLX is the OpenGL extension to the X Window System. I defines both a +programming API (glX*() functions) and a network protocol. Mesa implements +an emulation of GLX on Linux. A real GLX implementation would requires +hooks into the X server. The 3Dfx hardware can be used with GLX-based +programs via the MESA_GLX_FX environment variable. + + +7. Is the Voodoo driver able to use the 4Mb texture memory of +the Pure3D boards ? + +Yes, the Voodoo driver v0.20 includes the support for Voodoo +Graphics boards with more than 2Mb of texture memory. + + +8. Do the Voodoo driver support the Voodoo Rush under Windows ? + +Yes, Diego Picciani has developed the support for the Voodoo +Rush but David Bucciarelli has a Pure3D and a Monster3D and Brian Paul +has a Monster3D, so the new versions of the Mesa/Voodoo sometime are +not tested with the Voodoo Rush. + + +9. Do the Voodoo driver support the Voodoo Rush under Linux ? + +No because the Linux Glide doesn't (yet) support the Voodoo Rush. + + +10. Can I sell my Mesa/Voodoo based software and include +a binary copy of the Mesa in order to make the software +working out of the box ? + +Yes. + + +11. Which is the best make target for compiling the Mesa for +Linux GLQuake ('make linux-glide', 'make linux-386-glide', etc.) ? + +'make linux-386-opt-glide' for Voodoo1 and 'make linux-386-opt-V2-glide' +for Voodoo2 boards because it doesn't include the '-fPIC' +option (4-5% faster). + + +12. Can I use a Mesa compiled with a 'make linux-386-opt-V2-glide' +for my applications/programs/demos ? + +Yes, there is only one constrain: you can't run two Mesa applications +at the some time. This isn't a big issue with the today Voodoo Graphics. + + +Thanks to: +---------- + +Henri Fousse (he has written several parts of the v0.15 and the old GLUT + emulator for Win); + +Diego Picciani (he has developed all the Voodoo Rush support and the wgl + emulator); + +Daryll Strauss (for the Linux Glide and the first Linux support); + +Brian Paul (of course); + +Dave 'Zoid' Kirsch (for the Linux GLQuake and Linux Quake2test/Q2 ports) + +Bernd Kreimeier (for the Linux 3Dfx HOWTO and for pushing companies to offer + a better Linux support) + +3Dfx and Quantum3D (for actively supporting Linux) + +The most update places where find Mesa VooDoo driver related informations are +the Mesa mailing list and my driver WEB page +(http://www-hmw.caribel.pisa.it/fxmesa/index.shtml) + + +David Bucciarelli (davibu@tin.it) + +Humanware s.r.l. +Via XXIV Maggio 62 +Pisa, Italy +Tel./Fax +39-50-554108 +email: info.hmw@plus.it +www: www-hmw.caribel.pisa.it diff -Nru xpsb-glx-0.19/mesa/docs/README.AMIWIN xpsb-glx-0.19/mesa/docs/README.AMIWIN --- xpsb-glx-0.19/mesa/docs/README.AMIWIN 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.AMIWIN 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,181 @@ +AMIGA AMIWIN PORT of MESA: THE OPENGL SOFTWARE EMULATION +======================================================== +Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu) +Original Author (Brian Paul (brianp@ssec.wisc.edu) + +Dec.1 , 1995: Port of release Mesa 1.2.5 + - Modifications made to minimize changes to Mesa distribution. + +Nov.25, 1995: Port of release Mesa 1.2.4 + + +HISTORY +======= +As a 3D graphics progammer, I was increasingly frustrated to see OpenGL +appearing on so many platforms EXCEPT the Amiga. Up to now, the task +of porting OpenGL directly from native Amiga drawing routines seemed like +a daunting task. However, two important events made this port possible. + +First of all, Brian Paul wrote Mesa, the OpenGL software emulator that +can be found on many platforms - except the Amiga and Atari (who cares +about the latter!). This was pretty ironic considering that Mesa was +originally prototyped on an Amiga! The second great event was when +Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely +register for this great piece of software) and released a development kit +so one could compile X programs with SAS/C. + +Since Mesa had X routines as its primitive drawing operations, this made +a marriage of Mesa and Amiwin feasible. I copied over the sources from +an ftp site, played with the code, wrote some Smakefiles, and voila, +I had OpenGL programs displaying on my Amiga. + +Although the speed is nothing to be impressed about, this port can be +potentially useful to those who want to quickly test their code in +wireframe or perhaps learn more about programming with the OpenGL API. + +I hope Amiga developers will continue to write excellent software for +their machine, especially more X clients for Amiwin. If you have any +solutions so some of my problems in the porting notes, please send me +some email! + +See you around, +Vic. + +HOW TO CREATE THE LIBRARIES AND SAMPLE CODE +=========================================== + +Just run the shell script mklib.amiwin in the mesa directory. This will +make all the libraries and copy them into the mesa/lib directory. If you +don't want to compile everything, just go to the desired directory and +type smake in that directory. + +Change any of the variables in the smakefiles as necessary. You will REQUIRE +the Amiwin development kit to compile these libraries since you need X11.LIB +and the shareable X libraries. Some examples require the AmiTCP4.0 +net.lib static link library and related header files for unix related +header files and functions like sleep(). + +HOW TO USE THE MESA LIBRARIES +============================= + +Study the Smakefiles in the demos, samples and book directories for the +proper SAS/C options and linkable libraries to use. Basically aux calls +require Mesaaux.LIB, gl calls require MesaGL.LIB, glu calls MesaGLU.LIB, +tk calls Mesatk.LIB. There is a preliminary port of MesaGLUT.LIB toolkit +available in the lib directory with the other Mesa libraries. However, +it seems to cause crashes on some of the sample code. Someone else may want +to attempt a more stable port. + +PORTING NOTES TO AMIWIN +======================= + +My strategy of porting was to leave as much of the code untouched as +possible. I surrounded any amiga specific changes with +#ifdef AMIWIN ... #endif or #ifndef AMIWIN ... #endif preprocessor +symbols. The code was ported on an Amiga 2000, with Fusion 40 accelerator +and a Picasso II graphics card. The SAS/C 6.56 compiler was used, with +the AmiWin 2.16 X development kit. + +All compilations were done for a 68040 CPU with 68882 math coprocessor for +maximum speed. Please edit the smakefile for other compilers. +I wrote smakefiles for the directories I ported. I omitted the Windows +and Widgets directories. The former is for MS Windows and the latter +requires Motif, which is not easily available for the Amiga. + +Here are the changes I did per directory: + +* mesa +Nov. 25, 1995 v 1.2.4 + - added a mklib.amiwin shell script that will make all the libraries and + sample code for Mesa + - created this readme file: readme.AMIGA + +* mesa/include +Dec. 1, 1995 v 1.2.5 + - added the following to GL/xmesa.h + #ifdef AMIWIN + #include + extern struct Library *XLibBase; + #endif +NET CHANGE: xmesa.h + +* mesa/src +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c + This prevents undefined symbols errors during the linking phase for + X library calls + - created smakefile +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, + glx.c since they are now defined in include/GL/xmesa.h +NET CHANGE: smakefile + +* mesa/src-tk +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + private.h + - created smakefile +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN includes from private.h since it is now defined in + include/GL/xmesa.h +NET CHANGE: smakefile + +* mesa/src-glu +Nov. 25, 1995 v 1.2.4 + - created smakefile +NET CHANGE: smakefile + +* mesa/src-aux +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + glaux.c + - created smakefile +NET CHANGE: glaux.c, smakefile + +* mesa/demos +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + xdemo.c, glxdemo.c, offset.c + - created smakefile + - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since + they are not part of AmigaDOS. +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN defines from xdemo.c, glxdemo.c, offset.c since + already defined in include/GL/xmesa.h + - modified Smakefile to include header and includes from the AmiTCP4.0 + net.lib linkable library to provide unix-compatible sys/time.h and + the sleep() function + - removed AMIWIN defines in xdemo.c since sleep() now defined +NET CHANGE: smakefile + +* mesa/samples +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + oglinfo.c + - created smakefile + - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c + - removed olympic from smakefile targets since not defined +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN defines from oglinfo.c, since already defined in + include/GL/xmesa.h + - modified Smakefile to include header and includes from the AmiTCP4.0 + net.lib linkable library to provide unix-compatible sys/time.h and + the sleep() function + - removed AMIWIN defines in blendxor.c for sleep() + - added AMIWIN defines around _MACHTEN_ in olympic.c since xrandom() + functions are not defined in any libraries + - added olympic back into the Smakefile targets +NET CHANGE: smakefile, olympic.c + +* mesa/book +Nov. 25, 1995 v 1.2.4 +- created smakefile +- removed accpersp and dof from smakefile targets since the SAS/C compile seems to + confuse the near,far variables with near/far memory models. +NET CHANGE: smakefile + +* mesa/windows +Dec. 1, 1995 v 1.2.5 +- Removed directory to save space since this is only needed for Windows based + machines. diff -Nru xpsb-glx-0.19/mesa/docs/README.BEOS xpsb-glx-0.19/mesa/docs/README.BEOS --- xpsb-glx-0.19/mesa/docs/README.BEOS 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.BEOS 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,136 @@ + + Mesa / BeOS Information + + + +* Introduction + +Brian Paul added in Mesa 3.1 a driver for BeOS R4.5 operating system. +This driver implements a clone of the BGLView class. This class, +derived from BView, allows OpenGL rendering into any BeOS window. His +driver was updated in Mesa 4.1 and again in version 6.1 by Philippe +Houdoin, who's maintaining this driver since. + +Any application which uses the BGLView should be able to use Mesa +instead of Be's OpenGL without changing any code. + +Since Be's OpenGL implementation (as of R5) is basically just the +SGI sample implementation, it's pretty slow. You'll see that Mesa +is considerably faster. + + +* Source Code + +The source code for the driver is in src/mesa/drivers/beos/ directory. +It's not 100% finished at this time but many GLUT-based demos are +working. No optimizations have been made at this time. + + +* Compiling + +Since Mesa 6.x, it can be build under BeOS with both the R5 builtin gcc version +or more recent gcc versions available for BeOS, like this gcc version 2.95.3 for BeOS +you can find at http://www.bebits.com/app/2157. +Anyway, keep in mind that to take full advantage of Mesa x86 optimizations, you better +want to use gcc 2.95.3 or sooner versions... + +To build Mesa-powered BeOS libGL.so version, open an Terminal window, +move to Mesa root folder and type this command: + +$ make beos + +Note that the "beos" argument is only needed the first time to setup build config. +Next times, typing "make" will be enough. + +When it finishes the Mesa based libGL.so library for +BeOS will be in the lib/ directory, along libglut.so library. +Several demo/test programs should have been build too under progs/* folders. +If it stop when building one of the progs/* programs, you may want to ignore it +and force make to move on next target by adding the -k make option: + +$ cd progs +$ make -k + +To install it as Be's default libGL.so replacement, put it in your +/boot/home/config/lib/ directory. All your GL/GLUT apps will use +the Mesa based then. + +By default, it build a non-debug version library. +The x86 (MMX, SSE and 3DNOW) optimizations are also supported for x86 target. +For PowerPC BeOS flavor, sorry, Mesa don't have ppc (Altivec) optimizations +yet. + +To build a DEBUG version, type instead this : + +$ DEBUG=1 make + + +* Example Programs + +Look under progs/beos/ for some BGLView-based programs. +You should find under progs/samples and progs/redbook directories GLUT-based programs too. +They all should have been compiled along with the Mesa library. + + +* GLUT + +A beta version of GLUT 3.7 port for BeOS, made by Jake Hamby, can be found at +http://anobject.com/jehamby/Code/Glut-3.7-x86.zip. +This is the version currently included in Mesa source code, and +build in lib/libglut.so. + +A previous 3.5 version of this GLUT BeOS port used to be available at +http://home.beoscentral.com/jehamby/Glut-3.5-x86.zip. + +They're special versions of GLUT for the BeOS platform. I don't +believe Mark Kilgard's normal GLUT distribution includes BeOS +support. + + +* Special Features + +Mesa's implementation of the BGLView class has an extra member +function: CopySubBufferMESA(). It basically works like SwapBuffers() +but it only copies a sub region from the back buffer to the front +buffer. This is a useful optimization for some applications. +If you use this method in your code be sure that you check at runtime +that you're actually using Mesa (with glGetString) so you don't +cause a fatal error when running with Be's OpenGL. + + +* Work Left To Do + +- BDirectWindow single buffering support is not implemented yet. +- Color index mode is not implemented yet. +- Reading pixels from the front buffer not implemented yet. +- There is also a BGLScreen class in BeOS for full-screen OpenGL rendering. + This should also be implemented for Mesa. +- Multiple renderers add-ons support, first step toward hardware acceleration + support. + +* Other contributors to this BeOS port + +Jake Hamby jhamby anobject com +Marcin Konicki ahwayakchih neoni net +Francois Revol revol free fr +Nathan Whitehorn nathanw uchicago edu + + +* Older BeOS Driver + +Mesa 2.6 had an earlier BeOS driver. It was based on Mesa's Off-screen +rendering interface, not BGLView. If you're interested in the older +driver you should get Mesa 2.6. + + +* BeOS and Glide + +Mesa 3.0 supported the 3Dfx/Glide library on Beos. Download Mesa 3.0 +if interested. Ideally, the 3Dfx/Glide support should be updated to +work with the new Mesa 3.1 BGLView implementation. + +The Glide library hasn't been updated for BeOS R4 and newer, to my knowledge, +as of February, 1999. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/README.CYGWIN xpsb-glx-0.19/mesa/docs/README.CYGWIN --- xpsb-glx-0.19/mesa/docs/README.CYGWIN 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.CYGWIN 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,256 @@ + + Mesa Cygwin/X11 Information + + +WARNING +======= + +If you installed X11 (packages xorg-x11-devel and xorg-x11-bin-dlls ) with the +latest setup.exe from Cygwin the GL (Mesa) libraries and include are already +installed in /usr/X11R6. + +The following will explain how to "replace" them. + +Installation +============ + +How to compile Mesa on Cygwin/X11 systems: + +1. Shared libs: + type 'make cygwin-sl'. + + When finished, the Mesa DLL will be in the Mesa-x.y/lib/ and + Mesa-x.y/bin directories. + + +2. Static libs: + type 'make cygwin-static'. + When finished, the Mesa libraries will be in the Mesa-x.y/lib/ directory. + +Header and library files: + After you've compiled Mesa and tried the demos I recommend the following + procedure for "installing" Mesa. + + Copy the Mesa include/GL directory to /usr/X11R6/include: + cp -a include/GL /usr/X11R6/include + + Copy the Mesa library files to /usr/X11R6/lib: + cp -a lib/* /usr/X11R6ocal/lib + + Copy the Mesa bin files (used by the DLL stuff) to /usr/X11R6/bin: + cp -a lib/cyg* /usr/X11R6/bin + +Xt/Motif widgets: + If you want to use Mesa or OpenGL in your Xt/Motif program you can build + the widgets found in either the widgets-mesa or widgets-sgi directories. + The former were written for Mesa and the later are the original SGI + widgets. Look in those directories for more information. + For the Motif widgets you must have downloaded the lesstif package. + + +Using the library +================= + +Configuration options: + The file src/mesa/main/config.h has many parameters which you can adjust + such as maximum number of lights, clipping planes, maximum texture size, + etc. In particular, you may want to change DEPTH_BITS from 16 to 32 + if a 16-bit depth buffer isn't precise enough for your application. + + +Shared libraries: + If you compile shared libraries (Win32 DLLS) you may have to set an + environment variable to specify where the Mesa libraries are located. + Set the PATH variable to include /your-dir/Mesa-2.6/bin. + Otherwise, when you try to run a demo it may fail with a message saying + that one or more DLL couldn't be found. + + +Xt/Motif Widgets: + Two versions of the Xt/Motif OpenGL drawing area widgets are included: + + widgets-sgi/ SGI's stock widgets + widgets-mesa/ Mesa-tuned widgets + + Look in those directories for details + + +Togl: + Togl is an OpenGL/Mesa widget for Tcl/Tk. + See http://togl.sourceforge.net for more information. + + + +X Display Modes: + Mesa supports RGB(A) rendering into almost any X visual type and depth. + + The glXChooseVisual function tries its best to pick an appropriate visual + for the given attribute list. However, if this doesn't suit your needs + you can force Mesa to use any X visual you want (any supported by your + X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL + environment variables. When an RGB visual is requested, glXChooseVisual + will first look if the MESA_RGB_VISUAL variable is defined. If so, it + will try to use the specified visual. Similarly, when a color index + visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL + variable. + + The format of accepted values is: + Here are some examples: + + using the C-shell: + % setenv MESA_RGB_VISUAL "TrueColor 8" // 8-bit TrueColor + % setenv MESA_CI_VISUAL "PseudoColor 12" // 12-bit PseudoColor + % setenv MESA_RGB_VISUAL "PseudoColor 8" // 8-bit PseudoColor + + using the KornShell: + $ export MESA_RGB_VISUAL="TrueColor 8" + $ export MESA_CI_VISUAL="PseudoColor 12" + $ export MESA_RGB_VISUAL="PseudoColor 8" + + +Double buffering: + Mesa can use either an X Pixmap or XImage as the backbuffer when in + double buffer mode. Using GLX, the default is to use an XImage. The + MESA_BACK_BUFFER environment variable can override this. The valid + values for MESA_BACK_BUFFER are: Pixmap and XImage (only the first + letter is checked, case doesn't matter). + + A pixmap is faster when drawing simple lines and polygons while an + XImage is faster when Mesa has to do pixel-by-pixel rendering. If you + need depth buffering the XImage will almost surely be faster. Exper- + iment with the MESA_BACK_BUFFER variable to see which is faster for + your application. + + +Colormaps: + When using Mesa directly or with GLX, it's up to the application writer + to create a window with an appropriate colormap. The aux, tk, and GLUT + toolkits try to minimize colormap "flashing" by sharing colormaps when + possible. Specifically, if the visual and depth of the window matches + that of the root window, the root window's colormap will be shared by + the Mesa window. Otherwise, a new, private colormap will be allocated. + + When sharing the root colormap, Mesa may be unable to allocate the colors + it needs, resulting in poor color quality. This can happen when a + large number of colorcells in the root colormap are already allocated. + To prevent colormap sharing in aux, tk and GLUT, define the environment + variable MESA_PRIVATE_CMAP. The value isn't significant. + + +Gamma correction: + To compensate for the nonlinear relationship between pixel values + and displayed intensities, there is a gamma correction feature in + Mesa. Some systems, such as Silicon Graphics, support gamma + correction in hardware (man gamma) so you won't need to use Mesa's + gamma facility. Other systems, however, may need gamma adjustment + to produce images which look correct. If in the past you thought + Mesa's images were too dim, read on. + + Gamma correction is controlled with the MESA_GAMMA environment + variable. Its value is of the form "Gr Gg Gb" or just "G" where + Gr is the red gamma value, Gg is the green gamma value, Gb is the + blue gamma value and G is one gamma value to use for all three + channels. Each value is a positive real number typically in the + range 1.0 to 2.5. The defaults are all 1.0, effectively disabling + gamma correction. Examples using csh: + + % setenv MESA_GAMMA "2.3 2.2 2.4" // separate R,G,B values + % setenv MESA_GAMMA "2.0" // same gamma for R,G,B + + The demos/gamma.c program may help you to determine reasonable gamma + value for your display. With correct gamma values, the color intensities + displayed in the top row (drawn by dithering) should nearly match those + in the bottom row (drawn as grays). + + Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well + on HP displays using the HP-ColorRecovery technology. + + Mesa implements gamma correction with a lookup table which translates + a "linear" pixel value to a gamma-corrected pixel value. There is a + small performance penalty. Gamma correction only works in RGB mode. + Also be aware that pixel values read back from the frame buffer will + not be "un-corrected" so glReadPixels may not return the same data + drawn with glDrawPixels. + + For more information about gamma correction see: + http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html + + +Overlay Planes + + Overlay planes in the frame buffer are supported by Mesa but require + hardware and X server support. To determine if your X server has + overlay support you can test for the SERVER_OVERLAY_VISUALS property: + + xprop -root | grep SERVER_OVERLAY_VISUALS + + +HPCR glClear(GL_COLOR_BUFFER_BIT) dithering + + If you set the MESA_HPCR_CLEAR environment variable then dithering + will be used when clearing the color buffer. This is only applicable + to HP systems with the HPCR (Color Recovery) system. + + +Extensions +========== + There are three Mesa-specific GLX extensions at this time. + + GLX_MESA_pixmap_colormap + + This extension adds the GLX function: + + GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ) + + It is an alternative to the standard glXCreateGLXPixmap() function. + Since Mesa supports RGB rendering into any X visual, not just True- + Color or DirectColor, Mesa needs colormap information to convert RGB + values into pixel values. An X window carries this information but a + pixmap does not. This function associates a colormap to a GLX pixmap. + See the xdemos/glxpixmap.c file for an example of how to use this + extension. + + GLX_MESA_release_buffers + + Mesa associates a set of ancillary (depth, accumulation, stencil and + alpha) buffers with each X window it draws into. These ancillary + buffers are allocated for each X window the first time the X window + is passed to glXMakeCurrent(). Mesa, however, can't detect when an + X window has been destroyed in order to free the ancillary buffers. + + The best it can do is to check for recently destroyed windows whenever + the client calls the glXCreateContext() or glXDestroyContext() + functions. This may not be sufficient in all situations though. + + The GLX_MESA_release_buffers extension allows a client to explicitly + deallocate the ancillary buffers by calling glxReleaseBuffersMESA() + just before an X window is destroyed. For example: + + #ifdef GLX_MESA_release_buffers + glXReleaseBuffersMESA( dpy, window ); + #endif + XDestroyWindow( dpy, window ); + + This extension is new in Mesa 2.0. + + GLX_MESA_copy_sub_buffer + + This extension adds the glXCopySubBufferMESA() function. It works + like glXSwapBuffers() but only copies a sub-region of the window + instead of the whole window. + + This extension is new in Mesa version 2.6 + + + +Summary of X-related environment variables: + MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only) + MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only) + MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only) + MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only) + MESA_GAMMA - gamma correction coefficients (X only) + + +---------------------------------------------------------------------- +README.CYGWIN - lassauge April 2004 - based on README.X11 diff -Nru xpsb-glx-0.19/mesa/docs/README.D3D xpsb-glx-0.19/mesa/docs/README.D3D --- xpsb-glx-0.19/mesa/docs/README.D3D 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.D3D 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,124 @@ + + DirectX 6 Driver for Mesa 3.0 + + +This software is distributed under the terms of the GNU Library +General Public License, see the LICENSE file for details. + + + +What do you need ? +------------------ + + - A PC with a DirectX 6 video driver installed. + + - Mesa 3.0 + + - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine). + The Voodoo2 requires the Glide library 2.51. The Glide 3.0 is not + compatible with the Glide 2.x so it doesn't work with the current + version of the driver; + + - Visual C++ 5.0 is only compiler test but others should be ok with + changes to the makefiles (CFLAGS/LFLAGS). + + - DirectX 6 SDK (was a MS download but not sure if still available). + + - SoftIce or another debugger that will get DPF's is nice. + + +Tested on: +---------- + Windows 95 + Windows 98 + Windows NT 5.0 (beta 2) + + +What is able to do ? +-------------------- + + - the driver will try and use DirectX to rasterize the OpenGL primitives + that are sent to the driver. The driver will fall back to SW if the rendering + context is too big. The fallback to SW still uses DirectDraw. If the driver + fails to support and operation (accum, stencil, etc) then it will try and get + Mesa to render it in SW. DirectX 6 features that are unsupported by the + installed DirectX 6 driver will be mapped to some other best fit feature. + + +How to compile: +--------------- + + These instructions assume you have Visual C++ installed. + + You might need to increase you enviroment space. You can do this by + adding the following statement to you config.sys. + + shell=C:\COMMAND.COM C:\ /p /e:8198 + + Next setup you compiler enviroment by running vcvars32.bat in the Visual C++ + 'bin' directoy. + + c:\DevStudio\VC\bin\vcvars32.bat + + Modify the D3D makefile to point at your SDK install. Example has the SDK + installed on my 'f' drive in the root. + + file: \Mesa-3.0\src\makefile.d3d + + SDKROOT=f:\mssdk + + Now you can simply make the project. If you look in the makefile you can see + I have some different targets like 'install'. + + nmake /f makefile.d3d + + +FAQ: +---- + + 1) I don't think the driver is using my DirectX driver. + + This maybe true as the current version will only select the Primary D3D driver + installed. If you 3D card is the secondary (3dfx) then your out of luck for this + release. + + 2) The driver seems like its not HW accelerated. + + If you have a video card with limited memory then you might want to try and + change your destop resolution to a low setting (640x480x16) so that the 3D part + of the card has more resources. Remeber the driver can't make the card better... + + 3) Nothing works. + + Make sure you have a DirectX '6' driver installed. Check you driver docs for this + info or use the SDK info utilities. + The final 'dll' is named opengl32.dll and is either in the same directory as the + OpenGL program or in your system directory (x:\windows\system or x:\winnt\system32). + Check your destop resolution. Most DirectX 6 drivers will only support 16bit and + 32bit color depth. To find out for sure you can check the DirectX Info Viewer in + the SDK. + + + 4) Rendering doesn't look right. + + Sometimes this is because the card doesn't support a feature that that is required. + This is usually due to unsupported alpha functions (test/blend) or texture mapping. + Some cards suffer from too small of an alpha channel. The driver does its best to + fallback on unsupported features. This is not to say the driver may not have a bug(s). + + 5) Textures look bad. + + No mipmapping in this release. + + +Thanks to: +---------- + +Brian Paul + + + + +Leigh McRae (leigh@altsoftware.com) +February 9, 1999 + diff -Nru xpsb-glx-0.19/mesa/docs/README.directfb xpsb-glx-0.19/mesa/docs/README.directfb --- xpsb-glx-0.19/mesa/docs/README.directfb 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.directfb 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,28 @@ + + Mesa DirectFB Information + + +Requirements +============ + + To build Mesa with DirectFB (DirectFBGL) support you need: + - DirectFB at least 1.0.0 (http://directfb.org) + - pkg-config at least 0.9 (http://pkgconfig.sf.net) + + +Installation +============ + Run + + make linux-directfb + + to build Mesa and DirectFBGL module, + + make install + + to install OpenGL libraries and + + make linux-directfb-install + + to install DirectFBGL module in the proper location. + diff -Nru xpsb-glx-0.19/mesa/docs/README.DJ xpsb-glx-0.19/mesa/docs/README.DJ --- xpsb-glx-0.19/mesa/docs/README.DJ 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.DJ 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,275 @@ + Mesa 6.5 DOS/DJGPP Port v1.8 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +Description: +~~~~~~~~~~~~ + +Well, guess what... this is the DOS port of Mesa 6.5, for DJGPP fans... Whoa! +The driver uses OSMesa to draw off screen, and then blits the buffer. This is +not terribly efficient, and has some drawbacks, but saves maintenance costs. + + + +Legal: +~~~~~~ + +Mesa copyright applies. + + + +Installation: +~~~~~~~~~~~~~ + +Unzip and type: + + make -f Makefile.DJ [OPTIONS...] + +Available options: + + Environment variables: + CPU optimize for the given processor. + default = pentium + GLIDE path to Glide3 SDK; used with FX. + default = $(TOP)/glide3 + FX=1 build for 3dfx Glide3. Note that this disables + compilation of most DMesa code and requires fxMesa. + As a consequence, you'll need the DJGPP Glide3 + library to build any application. + default = no + X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). + default = no + + Targets: + all: build everything + libgl: build GL + libglu: build GLU + libglut: build GLUT + clean: remove object files + realclean: remove all generated files + + + +Tested on: + Video card: Radeon 9500 + DJGPP: djdev 2.04 + gcc v4.1.0 + make v3.80 + OS: DOS, Win98SE, WinXP (using Videoport driver) + + + +FAQ: +~~~~ + +1. Compilation + + Q) `make' barfs and exits because it cannot find some stupid file. + A) You need LFN support. + A) When compiling for Glide (FX=1), pay attention to Glide path. + + Q) Libraries built OK, but linker complains about `vsnprintf' every time I + compile some demo. + A) Upgrade to DJGPP 2.04. + A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!). + A) Patch `src/mesa/main/imports.c' with the following line: + #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg) + This hack should be safe in 90% of the cases, but if anything goes wrong, + don't come back to me crying. + + Q) `make' complains about DXE3 or something, yet it builds the libraries. + A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest + DJGPP distro, or download the separate package from my web page. Read the + DXE3 documentation on how to use them. + A) When compiling for Glide (FX=1), make sure `glide3x.dxe' can be found in + LD_LIBRARY_PATH (or top `lib' directory). + +2. Using Mesa for DJGPP + + Q) Every test I tried crashes badly. + A) If you have compiled with SSE and you're running under plain DOS, you + have to disable SSE at run-time. See environment variables below. + + Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... + A) Is that a question? If you have a 3dfx Voodoo (any model), you're + lucky (check http://sourceforge.net/projects/glide for the DJGPP port). + If you haven't, sorry; everything is done in software. + + Q) I tried to set refresh rate w/ DMesa, but without success. + A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in + which case FX_GLIDE_REFRESH will be overwritten if it is defined and + is not 0). + + Q) I made a simple application and it does nothing. It exits right away. Not + even a blank screen. + A) Software drivers (VESA/VGA/NUL) must to be constructed as single-buffered + visuals. However, DMesaSwapBuffers must be called to get any output. + A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a + lazy programmer and I found that the easiest way to keep buffer handling + at peak performance ;-). + + Q) I'm getting a "bad font!" fatal error. + A) Always use GLUT_STROKE_* and GLUT_BITMAP_* constants when dealing with + GLUT fonts. If you're using `glut.dxe', then make sure GLUT_STROKE_* and + GLUT_BITMAP_* are mapped to integer constants, not to the actual font + address (same mechanism used for Win32 _DLL). + + Q) What is NUL driver good for, if I don't get any output at all? + A) For debugging. The NUL driver is very much like OSMesa. Everything is + done just the same as VESA/VGA drivers, only it doesn't touch your video + hardware. You can query the actual buffer by issuing: + DMesaGetIntegerv(DMESA_GET_BUFFER_ADDR, &buffer); + and dump it to a file. + + Q) How do I query for a list of available video modes to choose as a visual? + A) This is an ugly hack, for which I'm sure I'll burn in hell. + First, query for a list of modes: + n = DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, NULL); + If `n' is strictly positive, you allocate an array of pointers to a given + struct (which is guaranteed to be extended only - not changed in future): + struct { + int xres, yres; + int bpp; + } **l = malloc(n * sizeof(void *)); + Now pass the newly allocated buffer to fill in: + DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l); + And collect the info: + for (i = 0; i < n; i++) { + printf("%dx%d:%d\n", l[i]->xres, l[i]->yres, l[i]->bpp); + } + + Q) The GLUT is incomplete. + A) See below. + + + +libGLUT (the toolkit): +~~~~~~~~~~~~~~~~~~~~~~ + +Well, this "skeletal" GLUT implementation was taken from AllegGL project and +heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian +Paul and probably others (or probably not ;-). GLUT functionality will be +extended only on an "as needed" basis. + +GLUT talks to hardware via PC_HW package which was put together from various +pieces I wrote long time ago. It consists from the keyboard, mouse and timer +drivers. + +My keyboard driver used only scancodes; as GLUT requires ASCII values for keys, +I borrowed the translation tables (and maybe more) from Allegro -- many thanks +to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) +will shut down the GLUT engine unconditionally: it will raise SIGINT, which in +turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-) +NB: since the DJGPP guys ensured signal handlers won't go beyond program's +space (and since dynamic modules shall) the SIGINT can't be hooked (well, it +can, but it is useless), therefore you must live with the 'Exiting due to +signal SIGINT' message... + +The mouse driver is far from complete (lack of drawing, etc), but is enough to +make almost all the demos work. Supports the CuteMouse WheelAPI. + +The timer is pretty versatile for it supports multiple timers with different +frequencies. While not being the most accurate timer in the known universe, I +think it's OK. Take this example: you have timer A with a very high rate, and +then you have timer B with very low rate compared to A; now, A ticks OK, but +timer B will probably loose precision! + +As an addition, stdout and stderr are redirected and dumped upon exit. This +means that `printf' can be safely called during graphics. A bit of a hack, I +know, because all messages come in bulk, but I think it's better than nothing. +"Borrowed" from LIBRHUTI (Robert Hoehne). + +Window creating defaults: (0, 0, 300, 300), 16bpp. However, the video mode is +chosen in such a way that first window will fit. If you need high resolution +with small windows, set initial position far to the right (or way down); then +you can move them back to any position right before the main loop. + + + +Environment variables: +~~~~~~~~~~~~~~~~~~~~~~ + DMESA_NULDRV - (any value) force NUL driver + GLUT_FPS - print frames/second statistics to stderr + MESA_NO_SSE - (any value) safe option under pure DOS + DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) + DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) + DMESA_GLUT_ALPHA - set default alpha bits (8) + DMESA_GLUT_DEPTH - set default depth bits (16) + DMESA_GLUT_STENCIL - set default stencil bits (8) + DMESA_GLUT_ACCUM - set default accum bits (16) + + + +History: +~~~~~~~~ + +v1.0 (mar-2002) + initial release + +v1.1 (sep-2002) + + added 3dfx Glide3 support + + added refresh rate control + + added fonts in GLUT + * lots of minor changes + +v1.2 (nov-2002) + * synced w/ Mesa-4.1 + - removed dmesadxe.h + +v1.3 (mar-2003) + + enabled OpenGL 1.4 support + + added MMX clear/blit routines + + enabled SGI's GLU compilation + + added samples makefile + + added new GLUT functions + + added color-index modes + + added Matrox Millennium MGA2064W driver + + added 8bit FakeColor (thanks to Neil Funk) + + added VGA support (to keep Ben Decker happy) + ! fixed some compilation errors (reported by Chan Kar Heng) + * optimized driver for faster callback access... yeah, right :) + * overhauled virtual buffer and internal video drivers + * better fxMesa integration + * revamped GLUT + * switched to DXE3 + +v1.4 (dec-2003) + + enabled GLUT fonts with DXE + + truly added multi-window support in GLUT (for Adrian Woodward) + * accomodated makefiles with the new sourcetree + * fixed some ALPHA issues + * minor changes to PC_HW/timer interface + x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii) + +v1.5 (jan-2004) + + added interface to query available "visuals" (GLFW - Marcus Geelnard) + + added GLUT timer callback + - removed Matrox Millennium MGA2064W driver + x more changes to the 3dfx driver + +v1.6 (aug-2004) + + implemented NUL driver + + added DMesaGetProcAddress and glutGetProcAddress + * reorganized fxMesa wrapper to handle multiple contexts + ! fixed a horrible bug in VGA initialization routine + ! fixed partial clears + +v1.7 (???-2005) + + enabled OpenGL 2.0 support + + added support for sw texture compression + + added FreeGLUT specific functions + * no more GLX sources in DOS GLUT + * made GLUT timer callbacks less accurate but safer + +v1.8 (apr-2006) + * killed lots of code, the driver is now a front-end to OSMesa + * fixed problem with WinNT (http://www.volny.cz/martin.sulak/) + - removed 3dfx Glide3 support (temporarily?) + + + +Contact: +~~~~~~~~ + +Name: Daniel Borca +E-mail: dborca@users.sourceforge.net +WWW: http://www.geocities.com/dborca/ diff -Nru xpsb-glx-0.19/mesa/docs/README.GGI xpsb-glx-0.19/mesa/docs/README.GGI --- xpsb-glx-0.19/mesa/docs/README.GGI 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.GGI 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,26 @@ +GGIMesa for LibGGI 2.x + +Requirements: +------------- +LibGGI 2.0 or greater + +Installation: +------------- +To install GGIMesa, follow the instructions in INSTALL.GNU. If you +wish to install GGIGLUT as well, first install GGIMesa and then run + +make +make install (must be root) + +in ggi/ggiglut. + +Notes: +------ + +* Set the environment variables GGIMESA_DEBUG and/or GGIGLUT_DEBUG +to 255 to see lots of debugging output. + +* GGIGLUT contains support for all of the GLUT 3.6 API except for the +high-level primitive drawing functions, but many of the functions (in +particular the menu drawing functions) are just stubs. + diff -Nru xpsb-glx-0.19/mesa/docs/README.LYNXOS xpsb-glx-0.19/mesa/docs/README.LYNXOS --- xpsb-glx-0.19/mesa/docs/README.LYNXOS 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.LYNXOS 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,64 @@ + +Mesa 3.0 for LynxOS builds in the following way: + +make lynxos + +This will build all the libraries and demo applications. You should have +around 400 megabytes free for everything since everything is done with +static +libraries. + +Before using this make file however, you should perform the following +actions: +0) cd to the Mesa-3.0 directory +1) Copy the GL directory under the include directory to /usr/include. +2) Copy the files in the lib directory to /lib. +3) Make links so that the Mesa libraries look like ordinary OpenGL +libraries +in /lib. This is important for compatibility with other OpenGL apps. This +is done as follows: + +cd /lib +ln -s libMesaGL.a libGL.a +ln -s libMesaGLU.a libGLU.a + +Mesa 3.0 includes the GLUT (GL Utility Toolkit) by default. +The demo applications are done using this toolkit. + +Mesa makefiles for building their apps could be used as well, but the +following one is much more concise. Note that the order of the X libraries +is important to the linker so that all symbols get resolved correctly. +Changing the order may result in having to list a library twice to make +sure all linkages are made correctly. + +----cut here for Makefile ----- + +FILES = your_app.x + +SPECIAL_INCLUDES = -I/usr/include/GL + +SPECIAL_CFLAGS = -g -ansi -pedantic -funroll-loops -ffast-math -DSHM + +SPECIAL_LIBS = -lglut -lGLU -lGL -lm -L/usr/X11/lib -lXext -lXmu -lXi \ +-lX11 -lbsd -g + +STANDARD_OFILES = $(FILES:.x=.o) + +%.o: %.c + gcc -c $(SPECIAL_CFLAGS) $(SPECIAL_INCLUDES) $< -o $@ + +all: $(STANDARD_OFILES) + gcc -o your_app $(STANDARD_OFILES) $(SPECIAL_LIBS) + + +----cut here for Makefile----- + +I have tested Mesa under LynxOS 3.0 and 3.01. It should build fine under +other +versions as well. Note, however, that LynxOS versions prior to 3.0 are not +binary compatible, so you will have to rebuild from source. + + +Vik Sohal +vik@lynx.com +January 13, 1999 diff -Nru xpsb-glx-0.19/mesa/docs/README.MINGW32 xpsb-glx-0.19/mesa/docs/README.MINGW32 --- xpsb-glx-0.19/mesa/docs/README.MINGW32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.MINGW32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,153 @@ + Mesa 6.1 for MinGW32 + ~~~~~~~~~~~~~~~~~~~~ + + + +Quick & dirty start: +-------------------- + + mingw32-make -f Makefile.mgw [OPTIONS...] + + Look into the corresponding makefiles for further information. + Check README.3DFX to find out how to compile Mesa Glide3 driver + with MinGW32! + + + +******************************************************************************* +The Mingw port for Mesa 3-D Graphics Library was created August 30, 1998 by Paul Garceau. + +Updated January 13, 2000; June 3, 2005 -- Paul Garceau + +DISCLAIMER: I make this port of the Mesa 3-D Graphics Library as a service +to the general public. I can, in no way support or make any guarantee that the +build will work for your system. + +Acknowledgements: + + Daniel Borca, whose work and commitment to maintaining the Mingw port of the Mesa 3-D Graphics Library has been, and will continue to be greatly appreciated by an overworked and underpaid developer such as myself. + Without the creative inspiration and personal commitment provided by Mumit Khan, Jan-Jaap Vanderhagen and Colin Peters, Mingw would never have existed. Acknowledgements also need to be given to all of the developers who have worked on Mingw, Mesa and Msys over the years. + Last, but certainly far from the least, Brian Paul, who has dedicated at least the last seven or eight years of his life to making Mesa 3-D Graphics Library what it is today and managing the development for all of those years. +********************************************************************************* + +Greetings, + + Feel free to modify or change things related to the Mingw build as you see fit, just remember that, the author of the current build may not be able to support any modifications you might want to make to the files which have been included for the build. + +Mesa core components are licensed under XFree-86 (for more on licensing of Mesa 3-D Graphics Library, check out the Mesa homepage (http://www.mesa3d.org). + +The Mingw generated libraries themselves are licensed under the GNU-LGPL license. Source code for Mingw can be found at http://www.mingw.org. For licensing terms on Mingw, please visit http://www.mingw.org. + + It is recommended that you use the latest "stable" release of Mingw. "Candidates" are beta testing distributions for Mingw. Mingw is available at http://www.mingw.org. + + This build has been tested under WinNT4/SP6. Win9x and WinNT5 remain untested by me. I have not tested any of the demos included with Mesa3d. + +Installation: + + This readme assumes that you already have extracted the necessary files to a working directory/folder that Mingw can use to build the Mesa3D libraries and that you know where that directory/folder is located on your Windows system. If you have any questions about how to set things up properly which is specific to Mesa3D, the folks on the Mesa3D mailing lists (http://www.mesa3d.org) would probably be happy to assist you. Also you can probably ask anyone on the Mingw mailing lists for any questions specific to Mingw (http://www.mingw.org) + +Targets and Environment variables used for Mingw build: + + Before going into the actual build of the libraries, here is a list of available targets for the make process: + + "all" or "libgl" -- this target will build libopengl.a, a static library. It will not build the demos, etc. + + clean -- this target will clean up most of the Mesa 3-D Graphics Library/object code from your hard drive. + + realclean -- this target will clean up all of the Mesa 3D Graphics Library and the Mesa object code that it can find. + + Environment Variables: + + The environment variables are used to determine what sort of graphics driver support needs to be included in the finished Mesa 3-D Graphics Library. + + GLIDE path to Glide3 SDK; used with FX. + default = $(TOP)/glide3 + FX=1 build for 3dfx Glide3. Note that this disables + compilation of most WMesa code and requires fxMesa. + As a consequence, you'll need the Win32 Glide3 + library to build any application. + default = no + ICD=1 build the installable client driver interface + (windows opengl driver interface) + default = no + X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). + default = no + + +Running the Build: + + Launch Mingw. + From the Windows Command Prompt: + Set Environment Variables (as needed). + "cd" to your Mesa3D 'root' directory. + Enter "mingw32-make -f makefile.mgw + + That's all there is to it. + + Enjoy! + + Paul G. + Daniel Borca + + + +******This section is added by Heromyth ************* + +==================== +Updated on 2007-7-21 +==================== + +Notice: + 1) The generated DLLs are *not* compatible with the ones built +with the other compilers like VC8, especially for GLUT. + + 2) Although more tests are needed, it can be used individually! + + 3) You can set the options about whether using STDCALL to build MESA. The +config file is \configs\config.mgw. The default setting is that: + ALL_USING_STDCALL = 1 +, which means using STDCALL to build MESA. + + 4) Of course, you can MESA without using STDCALL,I like this:) +The setting is : + ALL_USING_STDCALL = 0 +To do this, however, you must modify wingdi.h which is in MingW's include dir. +For example, run: + notepad C:\MingW\include\wingdi.h +, and delete all the lines where all the wgl*() functions are. Because they would +be conflicted with the ones in \include\GL\mesa_wgl.h. + +>>>>>>>>>> Conflicted Functions List >>>>>>>>>> +WINGDIAPI BOOL WINAPI wglCopyContext(HGLRC,HGLRC,UINT); +WINGDIAPI HGLRC WINAPI wglCreateContext(HDC); +WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC,int); +WINGDIAPI BOOL WINAPI wglDeleteContext(HGLRC); +WINGDIAPI BOOL WINAPI wglDescribeLayerPlane(HDC,int,int,UINT,LPLAYERPLANEDESCRIPTOR); +WINGDIAPI HGLRC WINAPI wglGetCurrentContext(void); +WINGDIAPI HDC WINAPI wglGetCurrentDC(void); +WINGDIAPI int WINAPI wglGetLayerPaletteEntries(HDC,int,int,int,COLORREF*); +WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR); +WINGDIAPI BOOL WINAPI wglMakeCurrent(HDC,HGLRC); +WINGDIAPI BOOL WINAPI wglRealizeLayerPalette(HDC,int,BOOL); +WINGDIAPI int WINAPI wglSetLayerPaletteEntries(HDC,int,int,int,const COLORREF*); +WINGDIAPI BOOL WINAPI wglShareLists(HGLRC,HGLRC); +WINGDIAPI BOOL WINAPI wglSwapLayerBuffers(HDC,UINT); +WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC,DWORD,DWORD,DWORD); +WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC,DWORD,DWORD,DWORD); +WINGDIAPI BOOL WINAPI wglUseFontOutlinesA(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT); +WINGDIAPI BOOL WINAPI wglUseFontOutlinesW(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT); +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + +==================== +Updated on 2007-7-22 +==================== + I havn't thought that I would find a better way to solve my problems so soon. +I changed the method in which the import-libs and DLLs are made. After this update, +the DLLs of MESA are more optimized and more compatible. + It seems that there is no need to keep the building way of 'NO-STDCALL'.The +way of USING_STDCALL is so nice! The file \configs\config.mgw is +also not needed, and can be deleted safely! + + + +********************************************************************************* \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/docs/README.MITS xpsb-glx-0.19/mesa/docs/README.MITS --- xpsb-glx-0.19/mesa/docs/README.MITS 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.MITS 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,102 @@ + + Mesa 3.0 MITS Information + + +This software is distributed under the terms of the GNU Library +General Public License, see the LICENSE file for details. + + +This document is a preliminary introduction to help you get +started. For more detaile information consult the web page. + +http://10-dencies.zkm.de/~mesa/ + + + +Version 0.1 (Yes it's very alpha code so be warned!) +Contributors: + Emil Briggs (briggs@bucky.physics.ncsu.edu) + David Bucciarelli (tech.hmw@plus.it) + Andreas Schiffler (schiffler@zkm.de) + + + +1. Requirements: + Mesa 3.0. + An SMP capable machine running Linux 2.x + libpthread installed on your machine. + + +2. What does MITS stand for? + MITS stands for Mesa Internal Threading System. By adding + internal threading to Mesa it should be possible to improve + performance of OpenGL applications on SMP machines. + + +3. Do applications have to be recoded to take advantage of MITS? + No. The threading is internal to Mesa and transparent to + applications. + + +4. Will all applications benefit from the current implementation of MITS? + No. This implementation splits the processing of the vertex buffer + over two threads. There is a certain amount of overhead involved + with the thread synchronization and if there is not enough work + to be done the extra overhead outweighs any speedup from using + dual processors. You will not for example see any speedup when + running Quake because it uses GL_POLYGON and there is only one + polygon for each vertex buffer processed. Test results on a + dual 200 Mhz. Pentium Pro system show that one needs around + 100-200 vertices in the vertex buffer before any there is any + appreciable benefit from the threading. + + +5. Are there any parameters that I can tune to try to improve performance. + Yes. You can try to vary the size of the vertex buffer which is + define in VB_MAX located in the file src/vb.h from your top level + Mesa distribution. The number needs to be a multiple of 12 and + the optimum value will probably depend on the capabilities of + your machine and the particular application you are running. + + +6. Are there any ways I can modify the application to improve its + performance with the MITS? + Yes. Try to use as many vertices between each Begin/End pair + as possbile. This will reduce the thread synchronization + overhead. + + +7. What sort of speedups can I expect? + On some benchmarks performance gains of up to 30% have been + observerd. Others may see no gain at all and in a few rare + cases even some degradation. + + +8. What still needs to be done? + Lots of testing and benchmarking. + A portable implementation that works within the Mesa thread API. + Threading of additional areas of Mesa to improve performance + even more. + + + +Installation: + + 1. This assumes that you already have a working Mesa 3.0 installation + from source. + 2. Place the tarball MITS.tar.gz in your top level Mesa directory. + 3. Unzip it and untar it. It will replace the following files in + your Mesa source tree so back them up if you want to save them. + + + README.MITS + Make-config + Makefile + mklib.glide + src/vbxform.c + src/vb.h + + 4. Rebuild Mesa using the command + + make linux-386-glide-mits + diff -Nru xpsb-glx-0.19/mesa/docs/README.NeXT xpsb-glx-0.19/mesa/docs/README.NeXT --- xpsb-glx-0.19/mesa/docs/README.NeXT 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.NeXT 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,6 @@ +The NeXT support has now been incorporated into the OpenStep support. +You can build NeXT libraries simply by typing "make next", though before +linking they will need to be ranlib'd by hand. For more information see +the README.OpenStep file, together with the README files in OpenStep/Old_Demos. + +-Pete French. (pete@ohm.york.ac.uk) 28/5/1998 diff -Nru xpsb-glx-0.19/mesa/docs/README.OpenStep xpsb-glx-0.19/mesa/docs/README.OpenStep --- xpsb-glx-0.19/mesa/docs/README.OpenStep 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.OpenStep 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,35 @@ +This is a port of the GL and GLU libraries to NeXT/Apple object +orientated systems. As these systems have their own window handling +systems we simply use the offscreen rendering capability of Mesa +to generate bitmaps which may then be displayed by the application +with a View as required. Example pieces of code may be found in the +OpenStep directory. + +Sadly there are now a proliferation of different system that we need to +support compilation for: The original NextStep system, The OpenStep +system, the Rhapsody/Mac OS X system and also the windows implementations +of the latter two systems. This version of the code has been compiled and +tested under the following architectures: + + NextStep 3.3 + OpenStep 4.2 + Rhapsody DR2 + WebObjects for NT 3.5 + WebObjects for NT 4.0 + +All tests were done with Intel processors. Feedback on other systems would, +however, be appreciated ! + +On UNIX systems simply type "make openstep". Under Windows systems +with WebObjects run the "win32-openstep.sh" script from within the Bourne +shell provided with the development environment. In both cases this will +build the libraries and place them into the "lib" directory. Some examples +may be found in the OpenStep directory showing how to use the code in an +actual application (MesaView) as well as some command line demos. + +The CC variable may be specified on the command line for doing such things +as building FFAT libraries or using alternative compilers to the standard 'cc' +e.g. make CC='cc -arch m68k -arch i386' openstep" will build the libraries +with both intel and motorola architectures. + +-Pete French. (pete@ohm.york.ac.uk) 7/6/1999 diff -Nru xpsb-glx-0.19/mesa/docs/README.OS2 xpsb-glx-0.19/mesa/docs/README.OS2 --- xpsb-glx-0.19/mesa/docs/README.OS2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.OS2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,96 @@ + README for port of Mesa 3.x to XFree86 on OS/2 (X/2) + (as of 19990514) + + + Contents: + + 1) Binary release + 2) Building from sources + 3) History + 4) Todo + 5) Mesa Home Page + + +1) Binary release + + Though the Mesa sources should build in a quite reasonable time even on + a 585 class machine a binary relase is available (check topic 4) for an URL) + This package includes: + + - lib/MesaGL.dll, MesaGL.a + - lib/MesaGLU.dll, MesaGLU.a + - lib/glut.dll, glut.a + - include/GL/*.h + + Installing this in your XFree86 tree will enable you to build and + run all applications compatible with Mesa (and the current DLL + interface, of course ;-) + As usual the OMF-style libraries can be created using emxomf. + (e.g. "emxomf foo.a" creates the foo.lib omf-style library). + The static libraries are rarely used and you have to rebuild + Mesa to get them. They're a supported target, so you get + them in a straightforward way (see below). + + The testing of these libraries was limited to the supplied + demos/examples and a quite small number of third-party apps. + No warranty ... as usual ... ;-) + + +2) Instructions to build Mesa 3.x for XFree86/OS2 from sources: + + Except the official Mesa source distribution you need: + - a recent version of XFree86 (3.3.x or above) including + the programming libraries + - EMX 0.9c (0.9d might work, never checked) + - GNU make + - REXX (!) + + The creation of the DLLs as well as of the static libraries + (if you want to have them) is handled in "mklib-emx.cmd", + a small REXX script. Perhaps not the best idea, but this + way it fits best in the scheme used to build libraries + on all platforms in Mesa 3.x. + + To actually build the libraries and demos, check mklib-emx.cmd + and modify it as desired. Then type + make os2-x11 + and wait for completion ;-) + + +3) History + + Initially Darren Abbott (abbott@hiwaay.net) ported Mesa versions 2.x + to XFree86 OS/2. This port might still be available from + http://fly.HiWAAY.net/~abbott/xfree86-os2/xfree86.html + + The current port picked up things during the beta test for 3.0. + No major changes in the source were done. The build mechanism under OS/2 + has been made very similar to other platforms (if you treat mklib-emx.cmd + as a "black box"). + Advantage is that X/2 is now a valid target and all files are + integrated in the official source distribution. + Disadvantage is that this port (i.e. the DLLs' interface itself) is + definitly NOT COMPATIBLE to those of version 2.x. + It's uncertain whether this would be at all possible but since there + a _very_ few those apps it's not worth to find out anyway. + Also some libs (MesaTK, MesaAUX) are withdrawn from the Mesa distribution, + and accordingly from the OS/2 port. + +4) Todo + + By now binary compatiblity is ensured by using the function names + as entry points instead of ordinals. This might cost performance and + is subject to change in future. In addition the supplied X86 assembler + source is not used yet. + +5) Mesa Home Page + + You can get the source code and more information about Mesa from + http://www.mesa3d.org/ + + The OS/2 ports should be available from + http://r350.ee.ntu.edu.tw/~hcchu/os2/ports + +-- +Alexander Mai +st002279@hrzpub.tu-darmstadt.de diff -Nru xpsb-glx-0.19/mesa/docs/README.QUAKE xpsb-glx-0.19/mesa/docs/README.QUAKE --- xpsb-glx-0.19/mesa/docs/README.QUAKE 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.QUAKE 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,207 @@ + + Info on using Mesa 3.0 with Linux Quake I and Quake II + + + +Disclaimer +---------- + +I am _not_ a Quake expert by any means. I pretty much only run it to +test Mesa. There have been a lot of questions about Linux Quake and +Mesa so I'm trying to provide some useful info here. If this file +doesn't help you then you should look elsewhere for help. The Mesa +mailing list or the news://news.3dfx.com/3dfx.linux.glide newsgroup +might be good. + +Again, all the information I have is in this file. Please don't email +me with questions. + +If you have information to contribute to this file please send it to +me at brianp@elastic.avid.com + + + +Linux Quake +----------- + +You can get Linux Quake from http://www.idsoftware.com/ + +Quake I and II for Linux were tested with, and include, Mesa 2.6. You +shouldn't have too many problems if you simply follow the instructions +in the Quake distribution. + + + +RedHat 5.0 Linux problems +------------------------- + +RedHat Linux 5.x uses the GNU C library ("glibc" or "libc6") whereas +previous RedHat and other Linux distributions use "libc5" for its +runtime C library. + +Linux Quake I and II were compiled for libc5. If you compile Mesa +on a RedHat 5.x system the resulting libMesaGL.so file will not work +with Linux Quake because of the different C runtime libraries. +The symptom of this is a segmentation fault soon after starting Quake. + +If you want to use a newer version of Mesa (like 3.x) with Quake on +RedHat 5.x then read on. + +The solution to the C library problem is to force Mesa to use libc5. +libc5 is in /usr/i486-linux-libc5/lib on RedHat 5.x systems. + +Emil Briggs (briggs@tick.physics.ncsu.edu) nicely gave me the following +info: + +> I only know what works on a RedHat 5.0 distribution. RH5 includes +> a full set of libraries for both libc5 and glibc. The loader ld.so +> uses the libc5 libraries in /usr/i486-linux-libc5/lib for programs +> linked against libc5 while it uses the glibc libraries in /lib and +> /usr/lib for programs linked against glibc. +> +> Anyway I changed line 41 of mklib.glide to +> GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib" +> +> And I started quake2 up with a script like this +> #!/bin/csh +> setenv LD_LIBRARY_PATH /usr/i486-linux-libc5/lib +> setenv MESA_GLX_FX f +> ./quake2 +set vid_ref gl +> kbd_mode -a +> reset + + +I've already patched the mklib.glide file. You'll have to start Quake +with the script shown above though. + + + +********************** + +Daryll Strauss writes: + +Here's my thoughts on the problem. On a RH 5.x system, you can NOT build +a libc5 executable or library. Red Hat just doesn't include the right +stuff to do it. + +Since Quake is a libc5 based application, you are in trouble. You need +libc5 libraries. + +What can you do about it? Well there's a package called gcc5 that does +MOST of the right stuff to compile with libc5. (It brings back older +header files, makes appropriate symbolic links for libraries, and sets +up the compiler to use the correct directories) You can find gcc5 here: +ftp://ecg.mit.edu/pub/linux/gcc5-1.0-1.i386.rpm + +No, this isn't quite enough. There are still a few tricks to getting +Mesa to compile as a libc5 application. First you have to make sure that +every compile uses gcc5 instead of gcc. Second, in some cases the link +line actually lists -L/usr/lib which breaks gcc5 (because it forces you +to use the glibc version of things) + +If you get all the stuff correctly compiled with gcc5 it should work. +I've run Mesa 3.0B6 and its demos in a window with my Rush on a Red Hat +5.1 system. It is a big hassle, but it can be done. I've only made Quake +segfault, but I think that's from my libRush using the wrong libc. + +Yes, mixing libc5 and glibc is a major pain. I've been working to get +all my libraries compiling correctly with this setup. Someone should +make an RPM out of it and feed changes back to Brian once they get it +all working. If no one else has done so by the time I get the rest of my +stuff straightened out, I'll try to do it myself. + + - |Daryll + + + +********************* + +David Bucciarelli (tech.hmw@plus.it) writes: + +I'm using the Mesa-3.0beta7 and the RedHat 5.1 and QuakeII is +working fine for me. I had only to make a small change to the +Mesa-3.0/mklib.glide file, from: + + + GLIDELIBS="-L/usr/local/glide/lib -lglide2x +-L/usr/i486-linux-libc5/lib -lm" + +to: + + GLIDELIBS="-L/usr/i486-linux-libc5/lib -lglide2x" + +and to make two symbolic links: + +[david@localhost Mesa]$ ln -s libMesaGL.so libMesaGL.so.2 +[david@localhost Mesa]$ ln -s libMesaGLU.so libMesaGLU.so.2 + +I'm using the Daryll's Linux glide rpm for the Voodoo2 and glibc (it +includes also the Glide for the libc5). I'm not using the /dev/3Dfx and +running QuakeII as root with the following env. var: + +export +LD_LIBRARY_PATH=/dsk1/home/david/src/gl/Mesa/lib:/usr/i486-linux-libc5/lib + +I think that all problems are related to the glibc, Quake will never +work if you get the following output: + +[david@localhost Mesa]$ ldd lib/libMesaGL.so + libglide2x.so => /usr/lib/libglide2x.so (0x400f8000) + libm.so.6 => /lib/libm.so.6 (0x40244000) + libc.so.6 => /lib/libc.so.6 (0x4025d000) + /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000) + +You must get the following outputs: + +[david@localhost Mesa]# ldd lib/libMesaGL.so + libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so +(0x400f3000) + +[root@localhost quake2]# ldd quake2 + libdl.so.1 => /lib/libdl.so.1 (0x40005000) + libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x40008000) + libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x40010000) + +[root@localhost quake2]# ldd ref_gl.so + libMesaGL.so.2 => +/dsk1/home/david/src/gl/Mesa/lib/libMesaGL.so.2 (0x400eb000) + libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so +(0x401d9000) + libX11.so.6 => /usr/i486-linux-libc5/lib/libX11.so.6 +(0x40324000) + libXext.so.6 => /usr/i486-linux-libc5/lib/libXext.so.6 +(0x403b7000) + libvga.so.1 => /usr/i486-linux-libc5/lib/libvga.so.1 +(0x403c1000) + libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x403f5000) + libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x403fd000) + + +*********************** + +Steve Davies (steve@one47.demon.co.uk) writes: + + +Try using: + + export LD_LIBRARY_PATH=/usr/i486-linux-libc5/lib + ./quake2 +set vid_ref gl + +to start the game... Works for me, but assumes that you have the +compatability libc5 RPMs installed. + + +*************************** + +WWW resources - you may find additional Linux Quake help at these URLs: + + +http://quake.medina.net/howto + +http://webpages.mr.net/bobz + +http://www.linuxgames.com/quake2/ + + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/README.THREADS xpsb-glx-0.19/mesa/docs/README.THREADS --- xpsb-glx-0.19/mesa/docs/README.THREADS 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.THREADS 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,52 @@ + + +Mesa Threads README +------------------- + +Thread safety was introduced in Mesa 2.6 by John Stone and +Christoph Poliwoda. + +It was redesigned in Mesa 3.3 so that thread safety is +supported by default (on systems which support threads, +that is). There is no measurable penalty on single +threaded applications. + +NOTE that the only _driver_ which is thread safe at this time +is the OS/Mesa driver! + + +At present the mthreads code supports three thread APIS: + 1) POSIX threads (aka pthreads). + 2) Solaris / Unix International threads. + 3) Win32 threads (Win 95/NT). + +Support for other thread libraries can be added src/glthread.[ch] + + +In order to guarantee proper operation, it is +necessary for both Mesa and application code to use the same threads API. +So, if your application uses Sun's thread API, then you should build Mesa +using one of the targets for Sun threads. + +The mtdemos directory contains some example programs which use +multiple threads to render to osmesa rendering context(s). + +Linux users should be aware that there exist many different POSIX +threads packages. The best solution is the linuxthreads package +(http://pauillac.inria.fr/~xleroy/linuxthreads/) as this package is the +only one that really supports multiprocessor machines (AFAIK). See +http://pauillac.inria.fr/~xleroy/linuxthreads/README for further +information about the usage of linuxthreads. + +If you are interested in helping with thread safety work in Mesa +join the Mesa developers mailing list and post your proposal. + + +Regards, + John Stone -- j.stone@acm.org johns@cs.umr.edu + Christoph Poliwoda -- poliwoda@volumegraphics.com + + +Version info: + Mesa 2.6 - initial thread support. + Mesa 3.3 - thread support mostly rewritten (Brian Paul) diff -Nru xpsb-glx-0.19/mesa/docs/README.VMS xpsb-glx-0.19/mesa/docs/README.VMS --- xpsb-glx-0.19/mesa/docs/README.VMS 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.VMS 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,38 @@ + +VMS support contributed by Jouk Jansen (joukj@hrem.stm.tudelft.nl) + + +The latest version was tested on a VMSAlpha7.2 system using DECC6.0, but +probably also works for other versions. + +At the moment only the libraries LIBMESGL.EXE/LIBMESGL.OLB, +LIBMESAGLU.EXE/LIBMESAGLU.OLB and LIBGLUT.EXE/LIBGLUT.OLB and the demos of the +directory [.DEMOS] can be build. +However, feel free to create the missing "decrip.mms-files" in the other +directories. + + The make files were tested +using the DIGITAL make utility called MMS. There is also a public domain +clone available (MMK) and I think, but it is not tested, that this +utility will give (hardly) any problem. + +To make everything just type MMS (or MMK) in the main directory of +mesagl. For MMS the deafult makefile is called descrip.mms, and +that is what I have called it. I included alse some config files, +all having mms somewhere in the name which all the makefiles need +(just as your unix makefiles). + +On Alpha platforms at default a sharable images for the libraries are created. +To get a static library make it by typing MMS/MACRO=(NOSHARE=1). +On VAX platforms only static libraries can be build. + +23-sep-2005 +changed default compilation to use /float=ieee/ieee=denorm. The reason for +this is that it makes Mesa on OpenVMS better compatible with other platforms +and other packages for VMS that I maintain. +For more information see + http://nchrem.tnw.tudelft.nl/openvms + https://bugs.freedesktop.org/show_bug.cgi?id=4270 +You may want to compile Mesa to use VAX-floating point arithmetic, instead +of IEEE floating point by removing the /float=IEEE/denorm flag from the +compiler options in the descrip.mms files. diff -Nru xpsb-glx-0.19/mesa/docs/README.WIN32 xpsb-glx-0.19/mesa/docs/README.WIN32 --- xpsb-glx-0.19/mesa/docs/README.WIN32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.WIN32 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,163 @@ +File: docs/README.WIN32 + +Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net + +Quick Start +----- ----- + +Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same +directory. The libs and demos build separately, so if you do not care +about the demos or GLUT, you only need to unzip MesaLib. If you unzip +more than one ZIP file, they all need to be unzipped into the same +directory. Don't worry, you will not overwrite anything. + +The Windows build system uses Microsoft Visual Studio. Project files +for a specific version of Visual Studio are in their own directory in +the top-level "windows" directory. For example, Visual Studio 8 files +are in windows/VC8. + +Support has been dropped for versions of Visual Studio prior to 8. The +main reason is because Microsoft now provides a free compiler and +developer environment. Visual Studio Express can be found at + +http://msdn.microsoft.com/vstudio/express/visualc/default.aspx + +You'll also need the Platform SDK. Instructions for obtaining and +using the SDK with Visual Studio Express can be found at + +http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ + +If you are stuck using VC6 or VC7, you may start with these project +files, but you may need to modify them to reflect changes in the +Mesa source code tree. If you sucessfully update the project files, +please submit them to the author of this document so that they may +be included in the next distribution. + +The project files to build the core Mesa library, Windows Mesa +drivers, OSMesa, and GLU are in the mesa directory. The project files +to build GLUT and some demo programs are in the progs directory. + +Makefiles are no longer shipped or supported, but can be generated +from the projects using Visual Studio. + + +Windows Drivers +------- ------- + +At this time, only the GDI driver is known to work. Most of the demos +in progs/demos should work with this driver. + +Source code also exists in the tree for other drivers in +src/mesa/drivers/windows, but the status of this code is unknown. + +The GDI driver operates basically by writing pixel spans into a DIB +section and then blitting the DIB to the window. The driver was +recently cleaned up and rewitten and so may have bugs or may be +missing some functionality. The older versions of the CVS source may +be useful in figuring out any problems, or report them to me. + +To build Mesa with the GDI driver, build the mesa, gdi, and glu +projects in the Visual Studio workspace found at + + windows/VC8/mesa/mesa.sln + +The osmesa DLL can also be built with the osmesa project. + +The build system creates a lib top-level directory and copies +resulting LIB and DLL files to this lib directory. The files are: + + OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB + OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL + +If the MesaDemos ZIP file was extracted, the DLL files are also copied +to the demos directory. This facilitates running the demos as described +below. + + +GLUT and Demos +---- --- ----- + +A Visual Studio workspace can be found at + + windows/VC8/progs/progs.sln + +It can be used to build GLUT and a few demos. The GLUT lib and DLL +are copied to the top-level lib directory, along with the Mesa libs. + +The demo build system expects to find the LIB files in the top level +lib directory, so you must build the Mesa libs first. The demo +executables are placed in the demos directory, because some of them +rely on data files found there. Also, the Mesa lib DLL's were copied +there by the Mesa lib build process. Therefore, you should be able to +simply run the demo executables from the demo directory. + +If you want to run the demos from the Visual Studio, you may have to +change the startup directory and explicitly state where the executables are. + +You may also build all the demo programs by using a makefile. Go to +the progs/demos directory and make sure you have executed VCVARS32.BAT +or whatever setup script is appropriate for your compiler. Then, + + nmake -f Makefile.win + +should build all the demos. + + +Build System Notes +----- ------ ----- + +VC6 (not actively supported) +--- + +Visual Studio 6 does not recognize files with the .cc extension as C++ +language files, without a lot of unnatural tweaking. So, the VC6 +build process uses custom build steps to compile these files in the +GLU library. + +Two additional configurations are provided, Debug x86 and Release x86 +that activate the shader code compilation by defining SLANG_86. It is +unknown if and how this works. + +VC7 (not actively supported) +--- + +The above-mentioned .cc problem does not exist in this version. + +VC8 +--- + +No notes. + + +General +------- + +After building, you can copy the above DLL files to a place in your +PATH such as $SystemRoot/SYSTEM32. If you don't like putting things +in a system directory, place them in the same directory as the +executable(s). Be careful about accidentially overwriting files of +the same name in the SYSTEM32 directory. + +The DLL files are built so that the external entry points use the +stdcall calling convention. + +Static LIB files are not built. The LIB files that are built with are +the linker import files associated with the DLL files. + +The si-glu sources are used to build the GLU libs. This was done +mainly to get the better tessellator code. + +To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE +to the project settings. You will also need to edit src/mesa.def to +change all the gl* symbols to mgl*. Because this is easy to do with a +global replace operation in a text editor, no additional mangled +version of mesa.def is maintained or shipped. + +If you have a Windows-related build problem or question, it is +probably better to direct it to me (kschultz@users.sourceforge.net), +rather than directly to the other Mesa developers. I will help you as +much as I can. I also monitor the Mesa mailing lists and will answer +questions in this area there as well. + + +Karl Schultz diff -Nru xpsb-glx-0.19/mesa/docs/README.WINDML xpsb-glx-0.19/mesa/docs/README.WINDML --- xpsb-glx-0.19/mesa/docs/README.WINDML 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/README.WINDML 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,146 @@ + + WindML Driver for Mesa 4.0 + + +Requirements +------------ + +Tornado 2 + WindML, Cumulative Patchs are recommended. + +I suppose you have a valid WindML installation. Double buffer hardware +gives better performance than double buffer software so if you can +compile your WindML driver with this option, just do it. I/O +redirection is adviced in target server. + + +Tested on +--------- + +During the development, my main target was a CoolMonster: +- Video card: CT69000 +- CPU: PENTIUM 266MHz + +and my host a Windows NT + Tornado 2. + + +Installation +------------ + +1. Mesa sources must be in root directory (C:\) + +2. Add the following line to your torVars.bat: +set MESA_BASE=C:\Mesa + +OR copy the new torVars.bat in your bin path: +c:/Mesa/src/ugl/tornado/torVars.sample -> +/mnt/nt/Tornado/host/x86-win32/bin/torVars (for example) + +3. In a command prompt: +$ torVars +$ cd c:\Mesa +$ make -f Makefile.ugl CPU=PENTIUM + +Take a long while... + +5. Include all the files from ugldemos folder to build some downloadable + application modules + +4. Download UGL/Mesa object files on target + +For example via the WindShell: +ld < c:\Tornado\target\lib\objMesaGL.o +ld < c:\Tornado\target\lib\objMesaUGL.o +ld < c:\Tornado\target\lib\objMesaGLU.o +ld < c:\Tornado\target\lib\objGLUTshapes.o +ld < c:\Tornado\target\lib\objMesaOS.o + +You can put the previous lines in a file and use: +< filename + +6. Download the application modules. + +7. In WindShell, run: +-> uglalldemos + +During the show some messages will appear, it provides some useful +information on key management. + + +Coding +------ + +Sample Usage: + +In addition to the usual ugl calls to initialize UGL, (may be find an +input driver), you must do the following to use the UGL/Mesa interface: + +1. Call uglMesaCreateContext() to create a UGL/Mesa rendering context, + given the display format. + +2. Call uglMesaMakeCurrent() to bind the UGL/Mesa buffers to an + UGL/Mesa Context and to make the context the current one. + +3. Make gl* calls to render your graphics. + +4. Use uglMesaSwapBuffers() when double buffering to swap front/back buffers. + +5. Before the UGL is destroyed, call MesaDestroyContext(). + +6. Before exiting, call if required uglEventQDestroy and then + uglDeinitialize(); + +Limitations +----------- + +I found the following limitations in my driver : + - Color Indexed management is only in 8 bits + - It's possible to mix UGL/OpenGL application with a software + double buffer + +Modifications +------------ + +New files in Mesa: +- Makefile.ugl +- rules.windmlmesa +- docs/README.UGL +- include/GL/uglmesa.h +- si-glu/Makefile.ugl +- src/Makefile.ugl +- src/ugl/torGLUTShapesInit.c +- src/ugl/torMesaUGLInit.c +- src/ugl/ugl_api.c +- src/ugl/ugl_dd.c +- src/ugl/ugl_glutshapes.c +- src/ugl/ugl_line.c +- src/ugl/ugl_span.c +- src/ugl/ugl_tri.c +- src/ugl/uglmesaP.h +- ugldemos/* + +Modified files in Tornado 2.0: +- c:\Tornado\host\x86-win32\bin\torVars.bat +rem Command line build environments +set WIND_HOST_TYPE=x86-win32 +set WIND_BASE=C:\Tornado +set MESA_BASE=C:\Mesa +set PATH=%WIND_BASE%\host\%WIND_HOST_TYPE%\bin;%PATH% +- c:\Tornado\target\config\comps\VxWorks\01uglmesa.cdf +- c:\Tornado\target\h\GL\* + +Todo +---- +- GCC 2.96, ASM compilation + +Thanks to: +---------- + +Precision Insight team for their great job around Mesa, XFree, and DRI. +Wind River Systems to take me as an intern. + + +Stephane Raimbault + + + +July 24, 2001 diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.1 xpsb-glx-0.19/mesa/docs/RELNOTES-3.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,145 @@ + + Mesa 3.1 release notes + + PLEASE READ!!!! + + +New copyright +------------- + +Mesa 3.1 will be distributed under an XFree86-style copyright instead +of the GNU LGPL. + + +New directories +--------------- + +All documentation files are now in the docs/ directory. +All shell scripts are now in the bin/ directory. + + +New library names +----------------- + +Formerly, the main Mesa library was named libMesaGL.so (or libMesaGL.a) +and the GLU library was named libMesaGLU.so (or libMesaGLU.a). + +Now, the main library is named libGL.so (or libGL.a) and the GLU library +is named libGLU.so (or libGLU.a). + +The change allows Mesa to be more easily substituted for OpenGL. +Specifically, the linker/loader on some Unix-like systems won't +allow libMesaGL.so to be used instead of libGL.so if the application +was linked with the former. + +Warning: if you have another OpenGL implementation installed on your +system (i.e. you have another OpenGL libGL.so) you'll have to be +carefull about which library (OpenGL or Mesa) you link against. Be +aware of -L linker flags and the value of the LD_LIBRARY_PATH environment +variable. + + +New library versioning +---------------------- + +Previously, the Mesa GL library was named libMesaGL.so.3.0 +To better support Linux/OpenGL standards, the Mesa GL library is now +named libGL.so.1.2.030100 This indicates version 1.2 of the OpenGL spec +and Mesa implementation 3.1.0 + +In the long term this will allow better interoperability with other +OpenGL implementations, especially on Linux. In the short term, +OpenGL apps may have to be relinked to use the new library naming. + + + +New makefiles +------------- + +The old Makefiles found in the various directories have been renamed +to Makefile.X11 in order to prevent filename collisions with autoconfig- +generated Makefiles. + +The top-level Makefile simply includes Makefile.X11 +If your top-level Makefile get's overwritten/destroyed you can restore +it by copying Makefile.X11 to Makefile + + +New extensions +-------------- + +GL_EXT_stencil_wrap + Implements two new stencil operations: GL_INCR_WRAP_EXT and + GL_DECR_WRAP_EXT which allow stencil increment and decrement + without clamping. + +GL_INGR_blend_func_separate + Allows specification of blend factors for RGB and Alpha independently. + (INGR = Intergraph) + +GL_ARB_multitexture + Multiple simultaneous textures. (ARB = Architecture Review Board) + +GL_NV_texgen_reflection + nVidia texgen extension for better reflection mapping. + +GL_PGI_misc_hints + Assorted transformation hints. + +GL_EXT_compiled_vertex_array + Compiled vertex arrays. + +GL_EXT_clip_volume_hint + Allows one to disable clip volume (frustum) testing. + + + +Extensions removed +------------------ + +GL_EXT_multitexture - obsolete in favor of GL_ARB_multitexture + + + +Config file +----------- + +By default, /etc/mesa.conf will be read when Mesa starts. This +file controls default hints, enable/disable of extensions, and +more. See the CONFIG file for documentation. + + + +Optimizations +------------- + +Keith Whitwell has contributed significant optimizations to Mesa's +vertex transformation code. Basically, the whole transformation +stage of Mesa has been rewritten. + +It's impossible to give a speedup factor. You'll just have to +try your app and see how it performs. + + + +Device Driver changes +--------------------- + +A bunch of new device driver functions have been added. See src/dd.h +Keith Harrison contributed many of them. I've been planning on adding +a bunch of functions like these to make writing hardware drivers easier. +More such function will probably be added in the near future. + + + +Miscellaneous +------------- + +util/glstate.c has some handy functions for debugging. Basically, it +offers a simple function for printing GL state variables. It's not +finished yet. There's a LOT more GLenum records to be added (see the +code). Anyone want to help? + + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.2 xpsb-glx-0.19/mesa/docs/RELNOTES-3.2 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,11 @@ + + Mesa 3.2 release notes + + PLEASE READ!!!! + + +Mesa 3.2 is a stabilization of the Mesa 3.1 release. No new features +have been added. For a list of bug fixes please read the VERSIONS file. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.2.1 xpsb-glx-0.19/mesa/docs/RELNOTES-3.2.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.2.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.2.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,31 @@ + + Mesa 3.2.1 release notes + + PLEASE READ!!!! + + + +The Mesa 3.2.1 release mainly just fixes bugs since the 3.2 release. +See the VERSIONS file for the exact list. + + + +GLU Polygon Tessellator +----------------------- + +The GLU tessellator has been reverted back to the version included +with Mesa 3.0 since it's more stable. The Mesa 3.1/3.2 tessellator +implemented the GLU 1.3 specification but suffered from a number of +bugs. + +Mesa implements GLU 1.1. + +Ideally, people should use the GLU 1.3 library included in SGI's +OpenGL Sample Implementation (SI) available from +http://oss.sgi.com/projects/ogl-sample/ +People are working to make easy-to-install Linux RPMs of the +GLU library. + + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.3 xpsb-glx-0.19/mesa/docs/RELNOTES-3.3 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.3 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.3 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,270 @@ + + Mesa 3.3 release notes + + July 21, 2000 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.2.1) designate stable releases. + +Mesa 3.3 has a undergone many internal changes since version 3.2 +and features a lot of new extensions. 3.3 is expected to be pretty +stable, but perhaps not as stable as 3.2 which has been used by +thousands of users over the past months. + +Everyone is encouraged to try Mesa 3.3. Bugs should be reported to +the Mesa bug database on www.sourceforge.net. + + + +Header file / GLenum changes +---------------------------- + +The gl.h and glu.h headers now use #defines to define all GL_* tokens +instead of C-language enums. This change improves Mesa/OpenGL +interoperability. + + + +New API dispatch code +--------------------- + +The core Mesa gl* functions are now implemented with a new dispatch +(jump table) which will allow simultaneous direct/indirect rendering. + +The code is found in the glapi*.[ch] files. + +Of interest: the actual "glFooBar" functions are generated with +templatized code defined in glapitemp.h and included by glapi.c +The glapitemp.h template should be reusable for all sorts of OpenGL +projects. + +The new dispatch code has also optimized with x86 assembly code. +This optimization eliminates copying the function arguments during +dispatch. + + + +New thread support +------------------ + +Thread support in Mesa has been rewritten. The glthread.[ch] files +replace mthreads.[ch]. Thread safety is always enabled (on platforms +which support threads, that is). There is virtually no performance +penalty for typical single-thread applications. See the glapi.c +file for details. + +The Xlib driver (XMesa) is now thread-safe as well. Be sure to +call XInitThreads() in your app first. See the xdemos/glthreads.c +demo for an example. + + + +Make configuration changes +-------------------------- + +If you use the old-style (non GNU automake) method to build Mesa note +that several of the configuration names have changed: + + Old name New name + ------------- ---------------- + linux-elf linux + linux linux-static + linux-386-elf linux-386 + linux-386 linux-386-static + etc. + + + +New extensions +-------------- + +GL_ARB_transpose_matrix + Adds glLoadTransposeMatrixARB() and glMultTransposeMatrixARB() + functions. + +GL_ARB_texture_cube_map + For cube-based reflection mapping. + +GL_EXT_texture_add_env + Adds GL_ADD texture environment mode. + See http://www.berkelium.com/OpenGL/EXT/texture_env_add.txt + +GL_EXT_texture_lod_bias + Allows mipmapped texture blurring and sharpening. + +GLX_EXT_visual_rating extension + This extension has no effect in stand-alone Mesa (used for DRI). + +GL_HP_occlusion_test + Used for bounding box occlusion testing (see demos/occlude.c). + +GL_SGIX_pixel_texture / GL_SGIS_pixel_texture + Lets glDraw/CopyPixels draw a texture coordinate image. + +GL_SGI_color_matrix + Adds a color matrix and another set of scale and bias parameters + to the glDraw/CopyPixels paths. + +GL_SGI_color_table + Adds additional color tables to the glDraw/Read/CopyPixels paths. + +GL_EXT_histogram + Compute histograms for glDraw/Read/CopyPixels. + +GL_EXT_blend_func_separate + This is the same as GL_INGR_blend_func_separate. + +GL_ARB_texture_cube_mapping + 6-face cube mapping, nicer than sphere mapping + +GL_EXT_texture_env_combine + For advanced texture environment effects. + + +Documentation for all these functions can be found at +http://oss.sgi.com/projects/ogl-sample/registry/ + + + +GLX_SGI_make_current_read functionality +--------------------------------------- + +The functionality of this extension is needed for GLX 1.3 (and required +for the Linux/OpenGL standards base). + +Implementing this function required a **DEVICE DRIVER CHANGE**. +The old SetBuffer() function has been replaced by SetReadBuffer() and +SetDrawBuffer(). All device drivers will have to be updated because +of this change. + +The new function, glXMakeContextCurrent(), in GLX 1.3 now works in Mesa. +The xdemos/wincopy.c program demonstrates it. + + + +Image-related code changes +-------------------------- + +The imaging path code used by glDrawPixels, glTexImage[123]D, +glTexSubImage[123], etc has been rewritten. It's now faster, +uses less memory and has several bug fixes. This work was +actually started in Mesa 3.1 with the glTexImage paths but has now +been carried over to glDrawPixels as well. + + + +Device driver interface changes +------------------------------- + +Added new functions for hardware stencil buffer support: + WriteStencilSpan + ReadStencilSpan + WriteStencilPixels + ReadStencilPixels + + +Removed old depth buffer functions: + AllocDepthBuffer + DepthTestSpan + DepthTestPixels + ReadDepthSpanFloat + ReadDepthSpanInt + + +Added new depth buffer functions: + WriteDepthSpan + ReadDepthSpan + WriteDepthPixels + ReadDepthPixels + + These functions always read/write 32-bit GLuints. This will allow + drivers to have anywhere from 0 to 32-bit Z buffers without + recompiling for 16 vs 32 bits as was previously needed. + + +New texture image functions + The entire interface for texture image specification has been updated. + With the new functions, it's optional for Mesa to keep an internal copy + of all textures. Texture download should be a lot faster when the extra + copy isn't made. + +Misc changes + TexEnv now takes a target argument + Removed UseGlobalTexturePalette (use Enable function instead) + + +Also added + ReadPixels + CopyPixels + + +The SetBufffer function has been replaced by SetDrawBuffer and +SetReadBuffer functions. This lets core Mesa independently +specify which buffer is to be used for reading and which for +drawing. + +The Clear function's mask parameter has changed. Instead of +mask being the flags specified by the user to glClear, the +mask is now a bitmask of the DD_*_BIT flags in dd.h. Now +multiple color buffers can be specified for clearing (ala +glDrawBuffers). The driver's Clear function must also +check the glColorMask glIndexMask, and glStencilMask settings +and do the right thing. See the X/Mesa, OS/Mesa, or FX/Mesa +drivers for examples. + + +The depth buffer changes shouldn't be hard to make for existing +drivers. In fact, it should simply the code. Be careful with +the depthBits value passed to gl_create_context(). 1 is a bad +value! It should normally be 0, 16, 24, or 32. + + +gl_create_framebuffer() takes new arguments which explicitly tell +core Mesa which ancillary buffers (depth, stencil, accum, alpha) +should be implemented in software. Mesa hardware drivers should +carefully set these flags depending on which buffers are in the +graphics card. + + + +Internal constants +------------------ + +Point and line size range and granularity limits are now stored +in the gl_constants struct, which is the Const member of GLcontext. +The limits are initialized from values in config.h but may be +overridden by device drivers to reflect the limits of that driver's +hardware. + +Also added constants for NumAuxBuffers and SubPixelBits. + + + +OpenGL Conformance +------------------ + +Mesa now passes all the OpenGL 1.1 conformance tests, except for +antialiased lines. AA lines fail on some, but not all, the tests. +In order to fix the remaining failures, a new AA line algorithm will +be needed (which computes coverage values for end-point fragments). +This will be done for Mesa 3.5/3.6. + + + +OpenGL 1.2 GL_ARB_imaging subset +-------------------------------- + +Mesa 3.3 implements all the features of GL_ARB_imaging except for +image convolution. This will (hopefully) be done for Mesa 3.5/3.6. + + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.4 xpsb-glx-0.19/mesa/docs/RELNOTES-3.4 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.4 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.4 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,21 @@ + + Mesa 3.4 release notes + + November 3, 2000 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 3.4 simply fixes bugs found in the Mesa 3.3 release. For details, +see the VERSIONS file. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.1 xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,21 @@ + + Mesa 3.4.1 release notes + + February 9, 2001 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 3.4.1 is a maintenance release that simply fixes bugs found since +the Mesa 3.4 release. For details, see the VERSIONS file. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.2 xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.2 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.4.2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,21 @@ + + Mesa 3.4.2 release notes + + May 17, 2001 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 3.4.2 is a maintenance release that simply fixes bugs found since +the Mesa 3.4.1 release. For details, see the VERSIONS file. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-3.5 xpsb-glx-0.19/mesa/docs/RELNOTES-3.5 --- xpsb-glx-0.19/mesa/docs/RELNOTES-3.5 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-3.5 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,227 @@ + + Mesa 3.5 release notes + + June 21, 2001 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.5) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +The biggest change in Mesa 3.5 is a complete overhaul of the source +code in order to make it more modular. This was driven by the DRI +hardware drivers. It simplifies the DRI drivers and opens the door +to hardware transform/clip/lighting (TCL). Keith Whitwell can take +the credit for that. + + + +Driver Support +-------------- + +The device driver interface in Mesa 3.5 has changed a lot since Mesa 3.4 +Not all of the older Mesa drivers have been updated. Here's the status: + +Driver Status +---------------------- ----------- +XMesa (Xlib) updated +OSMesa (off-screen) updated +FX (3dfx Voodoo1/2) updated +SVGA updated +GGI not updated +Windows/Win32 not updated +DOS/DJGPP not updated +BeOS not updated +Allegro not updated +D3D not updated +DOS not updated + +We're looking for volunteers to update the remaining drivers. Please +post to the Mesa3d-dev mailing list if you can help. + + + +GLU 1.3 +------- + +Mesa 3.5 includes the SGI Sample Implementation (SI) GLU library. +This version of GLU supports the GLU 1.3 specification. The old +Mesa GLU library implemented the 1.1 specification. The SI GLU +library should work much better. + +You'll need a C++ compiler to compile the SI GLU library. This may +be a problem on some systems. + + + +New Extensions +-------------- + +GL_EXT_convolution + Adds image convolution to glRead/Copy/DrawPixels/TexImage. + +GL_ARB_imaging + This is the optional imaging subset of OpenGL 1.2. + It's the GL_EXT_convolution, GL_HP_convolution_border_modes, + GL_EXT_histogram, GL_EXT_color_table, GL_EXT_color_subtable + GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract + and GL_SGI_color_matrix extensions all rolled together. + This is supported in all software renderers but not in all + hardware drivers (3dfx for example). + +GL_ARB_texture_compression + This is supported in Mesa but only used by the 3dfx DRI drivers + for Voodoo4 and later. + +GL_ARB_texture_env_add + This is identical to GL_EXT_texture_env_add. + +GL_NV_blend_square + Adds extra blend source and dest factors which allow squaring + of color values. + +GL_EXT_fog_coord + Allows specification of a per-vertex fog coordinate instead of + having fog always computed from the eye distance. + +GL_EXT_secondary_color + Allows specifying the secondary (specular) color for each vertex + instead of getting it only from lighting in GL_SEPARATE_SPECULAR_COLOR + mode. + +GL_ARB_texture_env_combine + Basically the same as GL_EXT_texture_env_combine + +GL_ARB_texture_env_add extension + Texture addition mode. + +GL_ARB_texture_env_dot3 extension + Dot product texture environment. + +GL_ARB_texture_border_clamp + Adds GL_CLAMP_TO_BORDER_ARB texture wrap mode + +GL_SGIX_depth_texture, GL_SGIX_shadow and GL_SGIX_shadow_ambient + Implements a shadow casting algorithm based on depth map textures + +GL_SGIS_generate_mipmap + Automatically generate lower mipmap images whenever the base mipmap + image is changed with glTexImage, glCopyTexImage, etc. + + + +libOSMesa.so +------------ + +libOSMesa.so is a new library which contains the OSMesa interface for +off-screen rendering. Apps which need the OSMesa interface should link +with both -lOSMesa and -lGL. This change was made so that stand-alone +Mesa works the same way as XFree86/DRI's libGL. + + + +Device Driver Changes / Core Mesa Changes +----------------------------------------- + +The ctx->Driver.LogicOp() function has been removed. It used to +be called during state update in order to determine if the driver +could do glLogicOp() operations, and if not, set the SWLogicOpEnabled +flag. Drivers should instead examine the LogicOp state themselves +and choose specialized point, line, and triangle functions appropriately, +or fall back to software rendering. The Xlib driver was the only driver +to use this function. And since the Xlib driver no longer draws +points, lines or triangles using Xlib, the LogicOp function isn't needed. + +The ctx->Driver.Dither() function has been removed. Drivers should +detect dither enable/disable via ctx->Driver.Enable() instead. + +The ctx->Driver.IndexMask() and ctx->Driver.ColorMask() functions +are now just called from glIndexMask and glColorMask like the other +GL state-changing functions. They are no longer called from inside +gl_update_state(). Also, they now return void. The change was made +mostly for sake of uniformity. + +The NEW_DRVSTATE[0123] flags have been removed. They weren't being used +and are obsolete w.r.t. the way state updates are done in DRI drivers. + + +Removed obsolete gl_create_visual() and gl_destroy_visual(). + +Renamed functions (new namespace): + +old new +gl_create_framebuffer _mesa_create_framebuffer +gl_destroy_framebuffer _mesa_destroy_framebuffer +gl_create_context _mesa_create_context +gl_destroy_context _mesa_destroy_context +gl_context_initialize _mesa_context_initialize +gl_copy_context _mesa_copy_context +gl_make_current _mesa_make_current +gl_make_current2 _mesa_make_current2 +gl_get_current_context _mesa_get_current_context +gl_flush_vb _mesa_flush_vb +gl_warning _mesa_warning +gl_compile_error _mesa_compile_error + + +All the drivers have been updated, but not all of them have been +tested since I can't test some platforms (DOS, Windows, Allegro, etc). + + +X/Mesa Driver +------------- + +The source files for the X/Mesa driver in src/X have been renamed. +The xmesa[1234].c files are gone. The new files are xm_api.c, +xm_dd.c, xm_line.c, xm_span.c and xm_tri.c. + + + +Multitexture +------------ + +Eight texture units are now supported by default. + + + +OpenGL SI related changes +------------------------- + +In an effort to make Mesa's internal interfaces more like the OpenGL +SI interfaces, a number of changes have been made: + +1. Importing the SI's glcore.h file which defines a number of +interface structures like __GLimports and __GLexports. + +2. Renamed "struct gl_context" to "struct __GLcontextRec". + +3. Added __glCoreCreateContext() and __glCoreNopDispatch() functions. + +4. The GLcontext member Visual is no longer a pointer. + +5. New file: imports.c to setup default import functions for Mesa. + + + + +16-bit color channels +--------------------- + +There's experimental support for 16-bit color channels (64-bit pixels) +in Mesa 3.5. Only the OSMesa interface can be used for 16-bit rendering. +Type "make linux-osmesa16" in the top-level directory to build the +special libOSMesa16.so library. + +This hasn't been tested very thoroughly yet so please file bug reports +if you have trouble. + +In the future I hope to implement support for 32-bit, floating point +color channels. + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-4.0 xpsb-glx-0.19/mesa/docs/RELNOTES-4.0 --- xpsb-glx-0.19/mesa/docs/RELNOTES-4.0 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-4.0 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,162 @@ + + Mesa 4.0 release notes + + October 18, 2001 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa version 4.0 signifies two things: + + 1. A stabilization of the 3.5 development release + 2. Implementation of the OpenGL 1.3 specification + + +Note that the Mesa major version number is incremented with the OpenGL +minor version number: + + Mesa 1.x == OpenGL 1.0 + Mesa 2.x == OpenGL 1.1 + Mesa 3.x == OpenGL 1.2 + Mesa 4.x == OpenGL 1.3 + + + +New Features +------------ + +Mesa 3.5 already had all the new features of OpenGL 1.3, implemented as +extensions. These extensions were simply promoted to standard features: + + GL_ARB_multisample + GL_ARB_multitexture + GL_ARB_texture_border_clamp + GL_ARB_texture_compression + GL_ARB_texture_cube_map + GL_ARB_texture_env_add + GL_ARB_texture_env_combine + GL_ARB_texture_env_dot3 + GL_ARB_transpose_matrix + +In Mesa 4.0 the functions defined by these extensions are now available +without the "ARB" suffix. For example, glLoadTransposeMatrixf() is now +a standard API function. The new functions in OpenGL 1.3 and Mesa 4.0 are: + + glActiveTexture + glClientActiveTexture + glCompressedTexImage1D + glCompressedTexImage2D + glCompressedTexImage3D + glCompressedTexSubImage1D + glCompressedTexSubImage2D + glCompressedTexSubImage3D + glGetCompressedTexImage + glLoadTransposeMatrixd + glLoadTransposeMatrixf + glMultiTexCoord1d + glMultiTexCoord1dv + glMultiTexCoord1f + glMultiTexCoord1fv + glMultiTexCoord1i + glMultiTexCoord1iv + glMultiTexCoord1s + glMultiTexCoord1sv + glMultiTexCoord2d + glMultiTexCoord2dv + glMultiTexCoord2f + glMultiTexCoord2fv + glMultiTexCoord2i + glMultiTexCoord2iv + glMultiTexCoord2s + glMultiTexCoord2sv + glMultiTexCoord3d + glMultiTexCoord3dv + glMultiTexCoord3f + glMultiTexCoord3fv + glMultiTexCoord3i + glMultiTexCoord3iv + glMultiTexCoord3s + glMultiTexCoord3sv + glMultiTexCoord4d + glMultiTexCoord4dv + glMultiTexCoord4f + glMultiTexCoord4fv + glMultiTexCoord4i + glMultiTexCoord4iv + glMultiTexCoord4s + glMultiTexCoord4sv + glMultTransposeMatrixd + glMultTransposeMatrixf + glSampleCoverage + glSamplePass + + +GLX 1.4 is the companion to OpenGL 1.3. The only new features in GLX 1.4 +are support for multisampling and the GLX_ARB_get_proc_address extension. +glXGetProcAddress() is the only new function in GLX 1.4. + + + +Multisample and Texture Compression +----------------------------------- + +The OpenGL 1.3 specification allows the multisample and texture compression +features to essentially be no-ops. For example, if you query for multisample +support you'll find none, but the API functions work. + +Similarly, texture compression is not implemented by any of the software +drivers but you can specify a generic compressed texture format (like +GL_COMPRESSED_RGBA) to glTexImage2D and it'll be accepted. + + + +Device Drivers +-------------- + +Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the +device driver. If the driver enables all the ARB extensions which are part +of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise, +it'll return "1.2". + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of the drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.3 +OSMesa (off-screen) implements OpenGL 1.3 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.3 +GGI needs updating +DOS/DJGPP needs updating +BeOS needs updating +Allegro needs updating +D3D needs updating +DOS needs updating + +Special thanks go to Karl Schultz for updating the Windows driver. + +The XFree86/DRI drivers have not yet been updated to use Mesa 4.0 as of +September 2001, but that should happen eventually. + + + +Other Changes +------------- + +See the VERSIONS file for more details about bug fixes, etc. in Mesa 4.0. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.1 xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,21 @@ + + Mesa 4.0.1 release notes + + December 17, 2001 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 4.0.1 only contains bug fixes since version 4.0. + +See the docs/VERSIONS file for the list of bug fixes. + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.2 xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.2 --- xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,49 @@ + + Mesa 4.0.2 release notes + + March 25, 2002 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 4.0.2 only contains bug fixes and a new DOS driver since version 4.0.1. + +See the docs/VERSIONS file for the list of bug fixes. + + +Device Drivers +-------------- + +Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the +device driver. If the driver enables all the ARB extensions which are part +of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise, +it'll return "1.2". + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of the drivers. +Here's the current status of all included drivers: + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.3 +OSMesa (off-screen) implements OpenGL 1.3 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.3 +DOS/DJGPP implements OpenGL 1.3 (new in Mesa 4.0.2) +GGI needs updating +BeOS needs updating +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.3 xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.3 --- xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.3 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-4.0.3 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,51 @@ + + Mesa 4.0.3 release notes + + June 25, 2002 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 4.0.3 basically just contains bug fixes version 4.0.2. + +See the docs/VERSIONS file for the list of bug fixes. + +The GGI driver has been updated, thanks to Filip Spacek. + + +Device Drivers +-------------- + +Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the +device driver. If the driver enables all the ARB extensions which are part +of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise, +it'll return "1.2". + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of the drivers. +Here's the current status of all included drivers: + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.3 +OSMesa (off-screen) implements OpenGL 1.3 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.3 +DOS/DJGPP implements OpenGL 1.3 (new in Mesa 4.0.2) +GGI implements OpenGL 1.3 +BeOS needs updating +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-4.1 xpsb-glx-0.19/mesa/docs/RELNOTES-4.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-4.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-4.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,307 @@ + + Mesa 4.1 release notes + + October 29, 2002 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Even numbered versions (such as 4.0) designate stable releases. +Odd numbered versions (such as 4.1) designate new developmental releases. + + +New Features in Mesa 4.1 +------------------------ + +New extensions. Docs at http://oss.sgi.com/projects/ogl-sample/registry/ + +GL_NV_vertex_program + + NVIDIA's vertex programming extension + +GL_NV_vertex_program1_1 + + A few features built on top of GL_NV_vertex_program + +GL_ARB_window_pos + + This is the ARB-approved version of GL_MESA_window_pos + +GL_ARB_depth_texture + + This is the ARB-approved version of GL_SGIX_depth_texture. + It allows depth (Z buffer) data to be stored in textures. + This is used by GL_ARB_shadow + +GL_ARB_shadow + + Shadow mapping with depth textures. + This is the ARB-approved version of GL_SGIX_shadow. + +GL_ARB_shadow_ambient + + Allows one to specify the luminance of shadowed pixels. + This is the ARB-approved version of GL_SGIX_shadow_ambient. + +GL_EXT_shadow_funcs + + Extends the set of GL_ARB_shadow texture comparision functions to + include all eight of standard OpenGL dept-test functions. + +GL_ARB_point_parameters + + This is basically the same as GL_EXT_point_parameters. + +GL_ARB_texture_env_crossbar + + Allows any texture combine stage to reference any texture source unit. + +GL_NV_point_sprite + + For rendering points as textured quads. Useful for particle effects. + +GL_NV_texture_rectangle (new in 4.0.4 actually) + + Allows one to use textures with sizes that are not powers of two. + Note that mipmapping and several texture wrap modes are not allowed. + +GL_EXT_multi_draw_arrays + + Allows arrays of vertex arrays to be rendered with one call. + +GL_EXT_stencil_two_side + + Separate stencil modes for front and back-facing polygons. + +GLX_SGIX_fbconfig & GLX_SGIX_pbuffer + + Off-screen rendering support. + +GL_ATI_texture_mirror_once + + Adds two new texture wrap modes: GL_MIRROR_CLAMP_ATI and + GL_MIRROR_CLAMP_TO_EDGE_ATI. + + + +Device Driver Status +-------------------- + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of these drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.3 +OSMesa (off-screen) implements OpenGL 1.3 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.3 +DOS/DJGPP implements OpenGL 1.3 +GGI implements OpenGL 1.3 +BeOS needs updating (underway) +Allegro needs updating +D3D needs updating +DOS needs updating + + + +New features in GLUT +-------------------- + +1. Frames per second printing + + GLUT now looks for an environment variable called "GLUT_FPS". If it's + set, GLUT will print out a frames/second statistic to stderr when + glutSwapBuffers() is called. By default, frames/second is computed + and displayed once every 5 seconds. You can specify a different + interval (in milliseconds) when you set the env var. For example + 'export GLUT_FPS=1000' or 'setenv GLUT_FPS 1000' will set the interval + to one second. + + NOTE: the demo or application must call the glutInit() function for + this to work. Otherwise, the env var will be ignored. + + Finally, this feature may not be reliable in multi-window programs. + + +2. glutGetProcAddress() function + + The new function: + + void *glutGetProcAddress(const char *procName) + + is a wrapper for glXGetProcAddressARB() and wglGetProcAddress(). It + lets you dynamically get the address of an OpenGL function at runtime. + The GLUT_API_VERSION has been bumped to 5, but I haven't bumped the + GLUT version number from 3.7 since that's probably Mark Kilgard's role. + + This function should probably also be able to return the address of + GLUT functions themselves, but it doesn't do that yet. + + + +XXX Things To Do Yet XXXX +------------------------- + +isosurf with vertex program exhibits some missing triangles (probably +when recycling the vertex buffer for long prims). + + + +Porting Info +------------ + +If you're porting a DRI or other driver from Mesa 4.0.x to Mesa 4.1 here +are some things to change: + +1. ctx->Texture._ReallyEnabled is obsolete. + + Since there are now 5 texture targets (1D, 2D, 3D, cube and rect) that + left room for only 6 units (6*5 < 32) in this field. + This field is being replaced by ctx->Texture._EnabledUnits which has one + bit per texture unit. If the bit k of _EnabledUnits is set, that means + ctx->Texture.Unit[k]._ReallyEnabled is non-zero. You'll have to look at + ctx->Texture.Unit[k]._ReallyEnabled to learn if the 1D, 2D, 3D, cube or + rect texture is enabled for unit k. + + This also means that the constants TEXTURE1_*, TEXTURE2_*, etc are + obsolete. + + The tokens TEXTURE0_* have been replaced as well (since there's no + significance to the "0" part: + + old token new token + TEXTURE0_1D TEXTURE_1D_BIT + TEXTURE0_2D TEXTURE_2D_BIT + TEXTURE0_3D TEXTURE_3D_BIT + TEXTURE0_CUBE TEXTURE_CUBE_BIT + TEXTURE_RECT_BIT + + These tokens are only used for the ctx->Texture.Unit[i].Enabled and + ctx->Texture.Unit[i]._ReallyEnabled fields. Exactly 0 or 1 bits will + be set in _ReallyEnabled at any time! + + Q: "What's the purpose of Unit[i].Enabled vs Unit[i]._ReallyEnabled?" + A: The user can enable GL_TEXTURE_1D, GL_TEXTURE_2D, etc for any + texure unit all at once (an unusual thing to do). + OpenGL defines priorities that basically say GL_TEXTURE_2D has + higher priority than GL_TEXTURE_1D, etc. Also, just because a + texture target is enabled by the user doesn't mean we'll actually + use that texture! If a texture object is incomplete (missing mip- + map levels, etc) it's as if texturing is disabled for that target. + The _ReallyEnabled field will have a bit set ONLY if the texture + target is enabled and complete. This spares the driver writer from + examining a _lot_ of GL state to determine which texture target is + to be used. + + +2. Tnl tokens changes + + During the implementation of GL_NV_vertex_program some of the vertex + buffer code was changed. Specifically, the VERT_* bits defined in + tnl/t_context.h have been renamed to better match the conventions of + GL_NV_vertex_program. The old names are still present but obsolete. + Drivers should use the newer names. + + For example: VERT_RGBA is now VERT_BIT_COLOR0 and + VERT_SPEC_RGB is now VERT_BIT_COLOR1. + + + +3. Read/Draw Buffer changes + + The business of setting the current read/draw buffers in Mesa 4.0.x + was complicated. It's much simpler now in Mesa 4.1. + + Here are the changes: + + - Renamed ctx->Color.DrawDestMask to ctx->Color._DrawDestMask + - Removed ctx->Color.DriverDrawBuffer + - Removed ctx->Pixel.DriverReadBuffer + - Removed ctx->Color.MultiDrawBuffer + - Removed ctx->Driver.SetDrawBuffer() + - Removed swrast->Driver.SetReadBuffer(). + - Added ctx->Color._DrawDestMask - a bitmask of FRONT/BACK_LEFT/RIGHT_BIT + values to indicate the current draw buffers. + - Added ctx->Pixel._ReadSrcMask to indicate the source for pixel reading. + The value is _one_ of the FRONT/BACK_LEFT/RIGHT_BIT values. + - Added ctx->Driver.DrawBuffer() and ctx->Driver.ReadBuffer(). + These functions exactly correspond to glDrawBuffer and glReadBuffer calls. + Many drivers will set ctx->Driver.DrawBuffer = _swrast_DrawBuffer and + leave ctx->Draw.ReadBuffer NULL. + DRI drivers should implement their own function for ctx->Driver.DrawBuffer + and use it to set the current hardware drawing buffer. You'll probably + also want to check for GL_FRONT_AND_BACK mode and fall back to software. + Call _swrast_DrawBuffer() too, to update the swrast state. + - Added swrast->Driver.SetBuffer(). + This function should be implemented by all device drivers that use swrast. + Mesa will call it to specify the buffer to use for span reading AND + writing and point/line/triangle rendering. + There should be no confusion between current read or draw buffer anymore. + - Added swrast->CurrentBuffer to indicate which color buffer to read/draw. + Will be FRONT_LEFT_BIT, BACK_LEFT_BIT, FRONT_RIGHT_BIT or BACK_RIGHT_BIT. + This value is usually passed to swrast->Driver.SetBuffer(). + + +4. _mesa_create_context() changes. This function now takes a pointer to + a __GLimports object. The __GLimports structure contains function + pointers to system functions like fprintf(), malloc(), etc. + The _mesa_init_default_imports() function can be used to initialize + a __GLimports object. Most device drivers (like the DRI drivers) + should use this. + + +5. In tnl's struct vertex_buffer, the field "ProjectedClipCoords" + has been replaced by "NdcPtr" to better match the OpenGL spec's + terminology. + + +6. Since GL_EXT_stencil_two_side has been implemented, many of the + ctx->Stencil fields are now 2-element arrays. For example, + "GLenum Ref" is now "GLenum Ref[2]" The [0] elements are the front-face + values and the [1] elements are the back-face values. + ctx->Stencil.ActiveFace is 0 or 1 to indicate the current face for + the glStencilOp/Func/Mask() functions. + ctx->Stencil.TestTwoSide controls whether or not 1 or 2-sided stenciling + is enabled. + + +7. Removed ctx->Polygon._OffsetAny. Removed ctx->Polygon.OffsetMRD. + + +8. GLfloat / GLchan changes: + + - Changed ctx->Driver.ClearColor() to take GLfloat[4] instead of GLchan[4]. + ctx->Color.ClearColor is now GLfloat[4] too. + - Changed ctx->Driver.AlphaRef() to take GLfloat instead of GLchan. + - ctx->Color.AlphaRef is now GLfloat. + - texObj->BorderColor is now GLfloat[4]. texObj->_BorderChan is GLchan[4]. + + This is part of an effort to remove all GLchan types from core Mesa so + that someday we can support 8, 16 and 32-bit color channels dynamically + at runtime, instead of at compile-time. + + +9. GLboolean ctx->Tranform.ClipEnabled[MAX_CLIP_PLANES] has been replaced + by GLuint ctx->Transform.ClipPlanesEnabled. The later is a bitfield. + + +10. There's a new matrix_stack type in mtypes.h used for the Modelview, + Projection, Color and Texcoord matrix stacks. + + +11. The ctx->Current.* fields have changed a lot. Now, there's a + ctx->Current.Attrib[] array for all vertex attributes which matches + the NV vertex program conventions. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-5.0 xpsb-glx-0.19/mesa/docs/RELNOTES-5.0 --- xpsb-glx-0.19/mesa/docs/RELNOTES-5.0 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-5.0 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,84 @@ + + Mesa 5.0 release notes + + November 13, 2002 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Even-numbered versions (such as 5.0) designate stable releases. +Odd-numbered versions (such as 4.1) designate new developmental releases. + +Mesa 5.0 is basically just a stabilization of Mesa 4.1. To see a list of +bug fixes, etc. see the VERSIONS file. + + + +New Features in Mesa 5.0 +------------------------ + +Mesa 5.0 supports OpenGL 1.4. Note Mesa's versioning convention: + + OpenGL Version Mesa Version + ------------------------------ + 1.0 1.x + 1.1 2.x + 1.2 3.x + 1.3 4.x + 1.4 5.x + +OpenGL 1.4 (and Mesa 5.0) incorporates the following OpenGL extensions as +standard features: + + GL_ARB_depth_texture + GL_ARB_shadow + GL_ARB_texture_env_crossbar + GL_ARB_texture_mirror_repeat + GL_ARB_window_pos + GL_EXT_blend_color + GL_EXT_blend_func_separate + GL_EXT_blend_logic_op + GL_EXT_blend_minmax + GL_EXT_blend_subtract + GL_EXT_fog_coord + GL_EXT_multi_draw_arrays + GL_EXT_point_parameters + GL_EXT_secondary_color + GL_EXT_stencil_wrap + GL_SGIS_generate_mipmap + + + +Device Driver Status +-------------------- + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of these drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.4 +OSMesa (off-screen) implements OpenGL 1.4 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.4 +DOS/DJGPP implements OpenGL 1.3 +GGI implements OpenGL 1.3 +DOS implements OpenGL 1.4 +BeOS needs updating (underway) +Allegro needs updating +D3D needs updating + +Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the +driver call the _mesa_enable_1_4_extensions() function. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.1 xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,45 @@ + + Mesa 5.0.1 release notes + + March 30, 2003 + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Even-numbered versions (such as 5.0.x) designate stable releases. +Odd-numbered versions (such as 4.1.x) designate new developmental releases. + +Mesa 5.0.1 just fixes bugs found since the 5.0 release. See the VERSIONS +file for details. + + +Device Driver Status +-------------------- + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of these drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.4 +OSMesa (off-screen) implements OpenGL 1.4 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.4 +DJGPP implements OpenGL 1.4 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.4 +Allegro needs updating +D3D needs updating + +Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the +driver call the _mesa_enable_1_4_extensions() function. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.2 xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.2 --- xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-5.0.2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,45 @@ + + Mesa 5.0.2 release notes + + September 5, 2003 + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Even-numbered versions (such as 5.0.x) designate stable releases. +Odd-numbered versions (such as 4.1.x) designate new developmental releases. + +Mesa 5.0.2 just fixes bugs found since the 5.0.1 release. See the VERSIONS +file for details. + + +Device Driver Status +-------------------- + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of these drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.4 +OSMesa (off-screen) implements OpenGL 1.4 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.4 +DJGPP implements OpenGL 1.4 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.4 +Allegro needs updating +D3D needs updating + +Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the +driver call the _mesa_enable_1_4_extensions() function. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-5.1 xpsb-glx-0.19/mesa/docs/RELNOTES-5.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-5.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-5.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,279 @@ + + Mesa 5.1 release notes + + December 17, 2003 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Even-numbered versions (such as 5.0) designate stable releases. +Odd-numbered versions (such as 5.1) designate new developmental releases. + + +Bug fixes +--------- +See the VERSIONS file for a list of bugs fixed in this release. + + + +New Features in Mesa 5.1 +------------------------ + +GL_ARB_vertex_program / GL_ARB_fragment_program + Michal Krol and Karl Rasche implemented these extensions. Thanks! + Be aware that there may be some rough edges and lurking bugs. + +GL_ATI_texture_env_combine3 extension + This adds a few new texture combine modes. + Contributed by Ian Romanick. + +GL_SGI_texture_color_table + Adds a color table lookup to the RGBA texture path. There's a separate + color table for each texture unit. + Contributed by Eric Plante. + +GL_NV_fragment_program + NVIDIA's fragment-level programming feature. + Possible lurking bugs: + - the DDX and DDY commands aren't fully tested + - there may be bugs in the parser + - the TEX and TXP instructions both do perspective correction + - the pack/unpack instructions may not be correct + +GL_EXT_depth_bounds_test + This extension adds a scissor-like test for the Z axis. It's used to + optimize stencil-volume shadow algorithms. + +GL_NV_light_max_exponent + Lifts the 128 limit for max light exponent. + +GL_EXT_texture_rectangle + Identical to GL_NV_texture_rectangle + +GL_ARB_occlusion_query + Useful for visibility-based culling. + +GL_ARB_texture_non_power_of_two + Removes the restriction that texture dimensions must be powers of two. + +GL_ARB_vertex_buffer_object + Allows server-side vertex arrays, optimized host/card data transfers, etc. + +GL_ARB_point_sprite + ARB-approved version of GL_NV_point_sprite. Basically allows textures + to be applied to points. + +GL_IBM_multimode_draw_arrays + Allows multiple vertex arrays to be drawn with one call, including arrays + of different types of primitives. + +GL_SUN_multi_draw_arrays + An alias for GL_EXT_multi_draw_arrays, standard in OpenGL 1.4. + +Faster glDrawPixels / glCopyPixels in X11 driver + If your X screen is 32bpp, glDrawPixels to the front color buffer will + be accelerated (via XPutImage()) if the image format is GL_BGRA and the + type is GL_UNSIGNED_BYTE. No raster operations, such as depth test, + blend, fog, etc. can be enabled. + + If your X screen is 16bpp, glDrawPixels to the front color buffer will + be accelerated (via XPutImage()) if the image format is GL_RGB and the + type is GL_UNSIGNED_SHORT_5_6_5. No raster operations, such as depth + test, blend, fog, etc. can be enabled. + + glCopyPixels() calls for the front color buffer will be accelerated + (via XCopyArea()) if no raster operations, such as depth test, blend, + fog, pixel zoom, etc. are enabled. + + The speed-up over typical software rendering is a factor of 10 for + glDrawPixels and 100 for glCopyPixels. + + +With the addition of GL_ARB_occlusion_query, GL_ARB_vertex_buffer_object, +GL_ARB_texture_non_power_of_two and GL_EXT_shadow_funcs, Mesa 5.1 supports +all the new features of OpenGL 1.5. Mesa 6.0 (the next stable release) +will advertise GL_VERSION = "1.5". + + + +Vertex/Fragment program debugger +-------------------------------- + +GL_MESA_program_debug is an experimental extension to support +interactive debugging of vertex and fragment programs. See the +docs/MESA_program_debug.spec file for details. + +The bulk of the vertex/fragment program debugger is implemented +outside of Mesa. The GL_MESA_program_debug extension just has minimal +hooks for stopping running programs and inspecting programs. + +The progs/tests/debugger.c (only in CVS) program is an example of how +the extension can be used. Presently, the debugger code and demo code +is in the same file. Eventually the debugger code should be moved +into a reusable module. + +As it is now, the demo lets you set breakpoings in vertex/fragment +programs, single step, and print intermediate register values. It's +basically just a proof of concept. + + + +Directory tree reorganization +----------------------------- + +The directory structure for Mesa has been overhauled to improve its layout. +All source code for Mesa, GLU, GLUT, etc is now under the src/ directory +in appropriate subdirectories. + +The Mesa source code and drivers has been reorganized under src/mesa/. + +All demonstration programs and tests are now in subdirectories under progs/. + + + +Build System Changes +-------------------- + +The GNU automake/autoconf support has been removed. As it was, it seldom +worked on anything but Linux. The Mesa developers aren't big fans of +automake/autoconf/libtool and didn't have the time to maintain it. +If someone wants to contribute new automake/autoconf support (and is +willing to maintain it), it may be re-incorporated into Mesa, subject +to some requirements. + +The "old style" makefile system has been updated: + 1. Make-config has been trimmed down to fewer, modern configurations. + 2. Most of the bin/mklib.* scripts have been rolled into a new "mklib" + script that works on all sorts of systems. There are probably some + bugs in it, but it's been tested on Linux, SunOS 5.8 and IRIX 6.5. + Improvements/contributes are greatly appreciated. + 3. The Makefile.X11 files have been cleaned up in various ways + + + +Source File Changes +------------------- + +The mmath.[ch] files are obsolete. Their contents have been moved +into the imports.[ch] and macros.[ch] files. + +The files related to vertex and fragment programming have changed. +Old files: + vpexec.[ch] + vpparse.[ch] + vpstate.[ch] +New files: + program.[ch] - generic ARB/NV program code + arbprogram.[ch] - ARB program API functions + arbfragparse.[ch] - ARB fragment program parsing + arbvertparse.[ch] - ARB vertex program parsing + arbparse.[ch] - ARB vertex/fragment parsing + arbparse_syn.h - vertex/fragment program syntax + nvprogram.[ch] - NV program API functions + nvvertprog.h - NV vertex program definitions + nvfragprog.h - NV fragment program definitions + nvvertparse.[ch] - NV vertex program parser + nvfragparse.[ch] - NV fragment program parser + nvvertexec.[ch] - NV vertex program execution + swrast/s_nvfragprog.[ch] - NV fragment program execution + +The files related to per-vertex handling have changed. +Old files: + tnl/t_eval_api.c - old per-vertex code + tnl/t_imm_alloc.c - old per-vertex code + tnl/t_imm_api.c - old per-vertex code + tnl/t_imm_debug.c - old per-vertex code + tnl/t_imm_dlist.c - old per-vertex code + tnl/t_imm_elt.c - old per-vertex code + tnl/t_imm_eval.c - old per-vertex code + tnl/t_imm_exec.c - old per-vertex code + tnl/t_imm_fixup.c - old per-vertex code + tnl/t_vtx_sse.c - old per-vertex code + tnl/t_vtx_x86.c - old per-vertex code +New files: + tnl/t_save_api.c - new per-vertex code + tnl/t_save_loopback.c - new per-vertex code + tnl/t_save_playback.c - new per-vertex code + tnl/t_vtx_eval.c - old per-vertex code + +Other new files: + bufferobj.[ch] - GL_ARB_vertex_buffer_object functions + version.h - defines the Mesa version info + +Other removed files: + swrast/s_histogram.[ch] - moved into src/histogram.c + + + +Other Changes +------------- + +The ctx->Driver.CreateTexture function has been removed - it wasn't used. + +New device driver hook functions: + NewTextureObject - used to allocate struct gl_texture_objects + NewTextureImage - used to allocate struct gl_texture_images + +New ctx->Texture._EnabledCoordUnits field: + With the addition of GL_NV_fragment_program we may need to interpolate + various sets of texture coordinates even when the corresponding texture + unit is not enabled. That is, glEnable(GL_TEXTURE_xD) may never get + called but we still may have to interpolate texture coordinates across + triangles so that the fragment program will get them. + This new field indicates which sets of texture coordinates are needed. + If a bit is set in the ctx->Texture._EnabledUnits bitmask is set, the + same bit MUST be set in ctx->Texture._EnabledCoordUnits. + +The ctx->_TriangleCaps field is deprecated. + Instead of testing the DD_* bits in _TriangleCaps, you should instead + directly test the relevant state variables, or use one of the helper + functions like NEED_SECONDARY_COLOR() at the bottom of context.h + While testing _TriangleCaps bits was fast, it was kludgey, and setting + the bits in the first place could be error prone. + +New vertex processing code. + The code behind glBegin, glEnd, glVertex, glNormal, etc. has been + totally rewritten. It's a cleaner implementation now and should use + less memory. (Keith) + + + +To Do +----- +Add screen-awareness to fakeglx.c + + + + +Device Driver Status +-------------------- + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of these drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.4 +OSMesa (off-screen) implements OpenGL 1.4 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.4 +DJGPP implements OpenGL 1.4 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.4 +Allegro needs updating +D3D needs updating + +Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the +driver call the _mesa_enable_1_4_extensions() function. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.0 xpsb-glx-0.19/mesa/docs/RELNOTES-6.0 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.0 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.0 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,86 @@ + + Mesa 6.0 release notes + + January 16, 2004 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 5.1) designate new developmental releases. +Even numbered versions (such as 6.0) designate stable releases. + +Mesa version 6.0 signifies two things: + + 1. A stabilization of the 5.1 development release + 2. Implementation of the OpenGL 1.5 specification. When you query + glGetString(GL_VERSION) "1.5" will be returned (as long as the + driver supports all the required features). + + +Note that the Mesa major version number is incremented with the OpenGL +minor version number: + + Mesa 1.x == OpenGL 1.0 + Mesa 2.x == OpenGL 1.1 + Mesa 3.x == OpenGL 1.2 + Mesa 4.x == OpenGL 1.3 + Mesa 5.x == OpenGL 1.4 + Mesa 6.x == OpenGL 1.5 + + + +New Features +------------ + +Mesa 5.1 already had all the new features of OpenGL 1.5, implemented as +extensions. These extensions were simply promoted to standard features: + + GL_ARB_occlusion_query extension + GL_ARB_texture_non_power_of_two extension + GL_ARB_vertex_buffer_object extension + GL_EXT_shadow_funcs + + + +Device Drivers +-------------- + +Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on +the device driver. For example, if the driver enables all the ARB +extensions which are part of OpenGL 1.3 then glGetString(GL_VERSION) +will return "1.3". Otherwise, it'll return "1.2". + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of the drivers. +Here's the current status of all included drivers: + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + + + +Other Changes +------------- + +See the VERSIONS file for more details about bug fixes, etc. in Mesa 6.0. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.0.1 xpsb-glx-0.19/mesa/docs/RELNOTES-6.0.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.0.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.0.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,49 @@ + + Mesa 6.0.1 release notes + + April 2, 2003 + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Even-numbered versions (such as 6.0.x) designate stable releases. +Odd-numbered versions (such as 6.1.x) designate new developmental releases. + +Mesa 6.0.1 just fixes bugs found since the 6.0 release. See the VERSIONS +file for details. + + + +Device Drivers +-------------- + +Mesa advertises itself as supporting OpenGL 1.2, 1.3, 1.4 or 1.5 +depending on the device driver's capabilities. For example, if the +driver enables all the ARB extensions which are part of OpenGL 1.5 +then glGetString(GL_VERSION) will return "1.5". Otherwise, it'll +return "1.4" or the next lower version that implements all required +functionality. + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of the drivers. +Here's the current status of all included drivers: + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +FX (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.1 xpsb-glx-0.19/mesa/docs/RELNOTES-6.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,111 @@ + + Mesa 6.1 release notes + + August 18, 2004 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.1) designate new developmental releases. +Even numbered versions (such as 6.0) designate stable releases. + + +New Features +------------ + +Half-precision floating point (GLhalf) pixel formats are supported +in Mesa, but the feature isn't exposed yet since the ARB extension +hasn't been finalized yet. + + +Texture image handling +---------------------- + +The code which implements image conversion, pixel transfer ops, etc +for glTexImage commands has been rewritten. + +Now the gl_texture_format struct has a new StoreImage function +pointer. Each texture format must implement this function. The +function is totally responsible for converting the user's texture +image into the specific format. A few helper functions makes this +relatively simple. + +Overall, the code is much simpler, cleaner and easier to work with +now. Adding new texture formats is straight-forward and there's no +longer any distinction between "hardware" and "software" formats. + +Finally, the code for compressed texture images has been reorganized +as well. + +Removed files: + texutil.c + texutil.h + texutil_tmp.h + +New files: + texcompress_s3tc.c + texcompress_fxt1.c + + + +Driver / context changes +------------------------ + +The _mesa_create_context() and _mesa_initialize_context() function +parameters have changed. They now take a pointer to a struct +dd_function_table. Drivers can initialize this table by calling +_mesa_init_driver_functions(). Drivers should then plug in the special +functions they implement. In particular, the ctx->Driver.NewTextureObject +pointer _must_ be set so that the default texture objects created in +_mesa_create/initialize_context() are correctly built. + +The _mesa_init_driver_functions() function allows a lot of redundant code +to be removed from the device drivers (such as initializing +ctx->Driver.Accum to point to _swrast_Accum). Adding new functions to +the dd_function_table can be done with less hassle since the pointer can +be initialized in _mesa_init_driver_functions() rather than in _all_ the +drivers. + + +Device Drivers +-------------- + +Mesa advertises itself as supporting OpenGL 1.2, 1.3, 1.4 or 1.5 +depending on the device driver's capabilities. For example, if the +driver enables all the ARB extensions which are part of OpenGL 1.5 +then glGetString(GL_VERSION) will return "1.5". Otherwise, it'll +return "1.4" or the next lower version that implements all required +functionality. + +A number of Mesa's software drivers haven't been actively maintained for +some time. We rely on volunteers to maintain many of the drivers. +Here's the current status of all included drivers: + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + + +Other Changes +------------- + +See the VERSIONS file for more details about bug fixes, etc. in Mesa 6.1. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.2 xpsb-glx-0.19/mesa/docs/RELNOTES-6.2 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,51 @@ + + Mesa 6.2 release notes + + October 2, 2004 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.1) designate new developmental releases. +Even numbered versions (such as 6.2) designate stable releases. + + +This release primarily just fixes bugs found in the Mesa 6.1 release. +See the VERSIONS file for details. + + +ToDo: PBO for polygon stipple, convolution filter, etc. + + + +Known Issues +------------ + +The GL_EXT_pixel_buffer_object extension isn't fully implemented for +functions like glPolygonStipple, glConvolutionFilter, glColorTable, +etc. The important functions like glRead/DrawPixels, glTex[Sub]Image, +and glBitmap work with PBOs. + + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.2.1 xpsb-glx-0.19/mesa/docs/RELNOTES-6.2.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.2.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.2.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,49 @@ + + Mesa 6.2.1 release notes + + December 9, 2004 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.1) designate new developmental releases. +Even numbered versions (such as 6.2.x) designate stable releases. + + +This release primarily just fixes bugs found in the Mesa 6.2 release. +See the VERSIONS file for details. + + + +Known Issues +------------ + +The GL_EXT_pixel_buffer_object extension isn't fully implemented for +functions like glPolygonStipple, glConvolutionFilter, glColorTable, +etc. The important functions like glRead/DrawPixels, glTex[Sub]Image, +and glBitmap work with PBOs. This has been fixed for Mesa 6.3. + + + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.3 xpsb-glx-0.19/mesa/docs/RELNOTES-6.3 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.3 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.3 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,114 @@ + + Mesa 6.3 release notes + + July 20, 2005 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.3) designate new developmental releases. +Even numbered versions (such as 6.2) designate stable releases. + + + +New Features +------------ + +GL_ARB_draw_buffers - allows a fragment program to write to a number of + separate color buffers, instead of just one. + +GL_OES_read_format - allows one to query the fastest glReadPixels format + and datatype. + +GL_ARB_pixel_buffer_object - buffer objects for pixel read/write functions. + +GL_EXT_framebuffer_object - allows render-to-texture and provides a + window-system indepedent Pbuffer facility. + The Mesa CVS tree contains a couple tests of this extension. + +DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb +for details. + + + +Vertex/Fragment Program PRINT Instruction +----------------------------------------- + +The GL_NV_vertex_program and GL_NV_fragment_program languages have been +extended with a PRINT instruction. + + + +glDeleteTextures(), glDeletePrograms() and glDeleteBuffers() Changed +-------------------------------------------------------------------- + +To match the behaviour of other OpenGL implementations, glDeleteTextures, +glDeletePrograms and glDeleteBuffers have been modified so that: + + * The named texture/program/buffer ID is immediately freed for re-use. + + * The actual texture object, program or buffers isn't really deleted until + it is no longer bound in any rendering context (the reference count + is zero). + +Previously, the texture/program/buffer ID wasn't freed until the object +was really deleted. + +Note that textures, programs and buffers can be shared by several rendering +contexts so they can't be deleted until they're unbound in _all_ contexts. + + + +GL_EXT_framebuffer_object changes +--------------------------------- + +Implementing this extension involved changing a lot of code (for the better). + +The gl_framebuffer object now a collection of gl_renderbuffer objects. +Renderbuffers may store colors, stencil indices, or depth values. The +gl_framebuffer and gl_renderbuffer types are object-oriented in design. + +All the old RGB, color index, stencil and depth-related span functions for +reading/writing pixels from/to buffers has changed. Now, all pixels are +read/written through a set of common renderbuffer functions (methods). + +Most device drivers have been updated for these changes, but some haven't. + + + +To Do (someday) items +--------------------- + Switch to freeglut + Increase MAX_DRAWBUFFERS + driver hooks for BeginQuery/EndQuery + + + +Miscellaneous +------------- + +The main/get.c file is now generated with a Python script (get_gen.py). + + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.1 xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.1 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.1 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,48 @@ + + Mesa 6.3.1 release notes + + July XX, 2005 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.3) designate new developmental releases. +Even numbered versions (such as 6.2) designate stable releases. + + + +DRI drivers +----------- + +This release includes the DRI drivers and GLX code for hardware rendering. + + + +Bug fixes +--------- + +Bugs fixed in 6.3.1 are listed in the VERSIONS file. + + + +Driver Status +---------------------- --------------------- +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.2 xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.2 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.3.2 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,36 @@ + + Mesa 6.3.2 Release Notes + + August 19, 2005 + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.3) designate new developmental releases. +Even numbered versions (such as 6.2) designate stable releases. + + +6.3.2 is primarily a bug-fix release. See the VERSIONS file for details. + + + +Driver Status +---------------------- ---------------------- +DRI drivers varies with the driver +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA implements OpenGL 1.3 +Wind River UGL implements OpenGL 1.3 +Windows/Win32 implements OpenGL 1.5 +DJGPP implements OpenGL 1.5 +GGI implements OpenGL 1.3 +BeOS implements OpenGL 1.5 +Allegro needs updating +D3D needs updating + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/RELNOTES-6.4 xpsb-glx-0.19/mesa/docs/RELNOTES-6.4 --- xpsb-glx-0.19/mesa/docs/RELNOTES-6.4 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/RELNOTES-6.4 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,49 @@ + + Mesa 6.4 Release Notes + + October 24, 2005 + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.3) designate new developmental releases. +Even numbered versions (such as 6.4) designate stable releases. + + +6.4 is a bug-fix release. See the VERSIONS file for details. + + + +GLUT tarball +------------ + +Starting with 6.4, the GLUT library sources are distributed in a separate +tarball. This was done at the request of Linux distro vendors who prefer +to use freeglut. + + + + +Driver Status +---------------------- ---------------------- +DRI drivers varies with the driver +XMesa (Xlib) implements OpenGL 1.5 +OSMesa (off-screen) implements OpenGL 1.5 +Windows/Win32 implements OpenGL 1.5 +Glide (3dfx Voodoo1/2) requires updates +SVGA requires updates +DJGPP requires updates +GGI requires updates +BeOS requires updates +Allegro requires updates +D3D requires updates + +The drivers which require updates mostly need to be updated to work +with the new gl_renderbuffer / gl_framebuffer infrastructure introduced +in Mesa 6.3. + + +---------------------------------------------------------------------- diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.4.1.html xpsb-glx-0.19/mesa/docs/relnotes-6.4.1.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.4.1.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.4.1.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,68 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.4.1 / November 29, 2006

    + +

    +Mesa 6.4.1 is a stable, bug-fix release. +

    + + +

    MD5 checksums

    +
    +698ceb574cf882b0226761f5913c0da9  MesaLib-6.4.1.tar.gz
    +ea148c828ec6f645526451db1b8556f1  MesaLib-6.4.1.tar.bz2
    +42e93279468975ed2bf3111b8721e5d9  MesaLib-6.4.1.zip
    +e3b0d50807fd2bdcd1a95aaddd786f13  MesaDemos-6.4.1.tar.gz
    +99df1fdcb98d391666b476ca6f1dda8a  MesaDemos-6.4.1.tar.bz2
    +b999d2c6d92fb4b7740a3dbd889348e3  MesaDemos-6.4.1.zip
    +eadfe01fe5ddfb1eb8227dd567b31635  MesaGLUT-6.4.1.tar.gz
    +bd003bb4f981a4f91dee4c38644d4f3f  MesaGLUT-6.4.1.tar.bz2
    +71c401c037088bf688a88afdaeb3420f  MesaGLUT-6.4.1.zip
    +
    + + +

    Bug fixes

    +
      +
    • redefining a vertex program string didn't take effect in TNL module +
    • fixed occasional segfault upon vertex/fragment parsing error +
    • vertex program LIT instruction didn't handle 0^0=1 correctly +
    • fragment program fog option didn't work with glDrawPixels, glBitmap +
    • USE_MGL_NAMESPACE didn't work for x86-64 +
    • OSMesa demos were missing from previous release tarballs +
    • fixed problem with float->ushort conversion in glClear (bug 4992) +
    • popping of GL_EYE_PLANE texgen state was broken (bug 4996) +
    • popping of GL_SPOT_DIRECTION light state was broken (bug 5005) +
    • fixed occasional triangle color interpolation problem on VMS +
    • work around invalid free() call (bug 5131) +
    • fixed BSD X server compilation problem by including stdint.h +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa (Xlib)		implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Windows/Win32		implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)  requires updates	
    +SVGA			requires updates
    +DJGPP			requires updates
    +GGI			requires updates
    +BeOS			requires updates
    +Allegro			requires updates
    +D3D			requires updates
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.4.2.html xpsb-glx-0.19/mesa/docs/relnotes-6.4.2.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.4.2.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.4.2.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,75 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.4.2 / February 2, 2006

    + +

    +Mesa 6.4.2 is a stable, bug-fix release. +

    + + +

    MD5 checksums

    +
    +cb0d745d520fa7c2bb9178058b763544  MesaLib-6.4.2.tar.gz
    +7674d2c603b5834259e4e5a820cefd5b  MesaLib-6.4.2.tar.bz2
    +d224e1325b33ff71a0f3893fc6b4d594  MesaLib-6.4.2.zip
    +d4b345d4588fc750cd3d34f3ac26673e  MesaDemos-6.4.2.tar.gz
    +9cae1ab874af533ce356bd7dfe2e0bb0  MesaDemos-6.4.2.tar.bz2
    +2da6e1d1245e441d27813595c6ba50de  MesaDemos-6.4.2.zip
    +84427d18c3453f0ea52388eeba7169b5  MesaGLUT-6.4.2.tar.gz
    +b157ba8ad1ea63260cf5339132e7aac6  MesaGLUT-6.4.2.tar.bz2
    +fe1523744fc05edc3811dfc6a1bf4181  MesaGLUT-6.4.2.zip
    +
    + + +

    New features

    +
      +
    • added OSMesaColorClamp() function/feature +
    • added wglGetExtensionStringARB() function +
    + +

    Changes

    +
      +
    • GLUT tarball +
      +Starting with 6.4, the GLUT library sources are distributed in a separate +tarball. This was done at the request of Linux distro vendors who prefer +to use freeglut. +
    + +

    Bug fixes

    +
      +
    • fixed some problems when building on Windows +
    • GLw header files weren't installed by installmesa script (bug 5396) +
    • GL/glfbdev.h file was missing from tarballs +
    • fixed TNL initialization bug which could lead to crash (bug 5791) +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa (Xlib)		implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Windows/Win32		implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)  requires updates	
    +SVGA			requires updates
    +DJGPP			requires updates
    +GGI			requires updates
    +BeOS			requires updates
    +Allegro			requires updates
    +D3D			requires updates
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.4.html xpsb-glx-0.19/mesa/docs/relnotes-6.4.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.4.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.4.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,90 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.4 / October 24, 2005

    + +

    +Mesa 6.4 is a stable, bug-fix release. +

    + + +

    MD5 checksums

    +
    +1cce0c1eb4fd15e9dfe837a1ce0c9812  MesaLib-6.4.tar.gz
    +85a84e47a3f718f752f306b9e0954ef6  MesaLib-6.4.tar.bz2
    +b976fea4f3ee06354c53f91b6e3f2ffc  MesaLib-6.4.zip
    +d8734f2c69bcf7ef9f5ae454a85743ba  MesaDemos-6.4.tar.gz
    +1a8c4d4fc699233f5fdb902b8753099e  MesaDemos-6.4.tar.bz2
    +607ab7c7a7de0cc5febbdde2bfa03098  MesaDemos-6.4.zip
    +3260156f66174322a092be0767962d34  MesaGLUT-6.4.tar.gz
    +0465d053f83775f44a12dec4050dfd78  MesaGLUT-6.4.tar.bz2
    +02abfcdcdf72ba938ae00f6e3b70fbe0  MesaGLUT-6.4.zip
    +
    + + +

    New

    +
      +
    • Added a fast XOR line drawing function in Xlib driver +
    • Added support for GL_ARB_texture_mirrored_repeat to savage driver (supported only on Savage4 hardware). +
    + +

    Changes

    +
      +
    • Mesa now packaged in three parts: Library, Demos and GLUT +
    + +

    Bug fixes

    +
      +
    • GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig +
    • Some files were present multiple times in the 6.3.2 tarballs +
    • r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207) +
    • glxgears_fbconfig demo didn't work (bug 4237) +
    • fixed bug when bilinear sampling 2d textures with borders +
    • glXCreatePbuffer() could segfault instead of returning 0 (bug 4235) +
    • fixed undefined frexp and rand in X.org libGLcore.a (bug 4242) +
    • fixed a few problems with proxy color tables (bug 4270) +
    • fixed precision problem in Z clearing (bug 4395) +
    • glBitmap, glDraw/CopyPixels mistakenly generated selection hits +
    • fixed potential segfault caused by reading pixels outside + of renderbuffer bounds +
    • glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB +
    • fixed memory corruption bug involving software alpha buffers +
    • glReadPixels clipped by window bounds was sometimes broken +
    • glDraw/CopyPixels of stencil data ignored the stencil write mask +
    • glReadPixels from a texture bound to a framebuffer object didn't work +
    • glIsRender/FramebufferEXT weren't totally correct +
    • fixed a number of point size attenuation/fade bugs +
    • fixed glFogCoord bug 4729 +
    • GLX encoding for transpose matrix functions was broken +
    • fixed broken fragment program KIL and SWZ instructions +
    • fragment programs that wrote result.depth.z didn't work +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa (Xlib)		implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Windows/Win32		implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)  requires updates	
    +SVGA			requires updates
    +DJGPP			requires updates
    +GGI			requires updates
    +BeOS			requires updates
    +Allegro			requires updates
    +D3D			requires updates
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.5.1.html xpsb-glx-0.19/mesa/docs/relnotes-6.5.1.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.5.1.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.5.1.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,139 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.5.1 Release Notes / September 15, 2006

    + +

    +Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of +bug fixes. +

    + + +

    MD5 checksums

    +
    +d9a555297319bb932a3192952d53d073  MesaLib-6.5.1.tar.gz
    +c46f2c6646a270911b791dd8e1c2d977  MesaLib-6.5.1.tar.bz2
    +939eaaff33322bfeafac784402b45f4f  MesaLib-6.5.1.zip
    +9e4bbe83c007bfbaa67449a81cc3d36a  MesaDemos-6.5.1.tar.gz
    +0f2794baf7a9d98b22caea9f78c6942d  MesaDemos-6.5.1.tar.bz2
    +14c77eab9cc7a265c331abf239927c1c  MesaDemos-6.5.1.zip
    +c5f87c23aaf4eaf1bda0d007ea98366c  MesaGLUT-6.5.1.tar.gz
    +2525642fe7f454e3e1a1aad01359b406  MesaGLUT-6.5.1.tar.bz2
    +e33b165c22551e23b58ede8767378543  MesaGLUT-6.5.1.zip
    +
    + + +

    New Features

    +
      +
    • Intel i965 "broadwater" DRI driver + +
    • GL_APPLE_vertex_array_object - allows encapsulation of a set of vertex + arrays in an object. + +
    • GL_EXT_texture_sRGB - non-linearly mapped texture formats + +
    • GL_EXT_gpu_program_parameters - addes a few new functions for setting + multiple vertex/fragment program parameters with one call. +
    • "engine" demo +
    • updated fbdev driver and GLUT for fbdev (Sean D'Epagnier) +
    • many updates to the DRI drivers +
    + +

    Changes

    +
      +
    • The glVertexAttribARB functions no longer alias the conventional + vertex attributes. +
    • glxinfo program prints more info with -l option +
    • GL_FRAGMENT_PROGRAM_NV and GL_FRAGMENT_PROGRAM_ARB are now + compatible, in terms of glBindProgramARB() +
    • The GL_ARB_vertex_program attribute vertex.weight is now + accepted by the parser, even though the GL_ARB_vertex_blend and + GL_EXT_vertex_weighting extensions aren't supported. + Allows Warcraft to run. +
    + +

    Bug fixes

    +
      +
    • fixed broken texture border handling for depth textures (bug 6498) +
    • removed the test for duplicated framebuffer attachments, per + version 117 of the GL_EXT_framebuffer_object specification +
    • fixed a few render-to-texture bugs, including render to depth texture +
    • clipping of lines against user-defined clip planes was broken (6512) +
    • assembly language dispatch for SPARC was broken (bug 6484) +
    • assorted compilation fixes on various Unix platforms (Dan Schikore) +
    • glPopAttrib could restore an invalid value for GL_DRAW_BUFFER +
    • assorted minor fixes for 16 and 32 bit/channel modes +
    • fixed assorted bugs in texture compression paths +
    • fixed indirect rendering vertex array crashes (bug 6863) +
    • glDrawPixels GL_INDEX_OFFSET didn't always work +
    • fixed convolution memory leak (bug 7077) +
    • rectangular depth textures didn't work +
    • invalid mode to glBegin didn't generate an error (bug 7142) +
    • 'normalized' parameter to glVertexAttribPointerARB didn't work +
    • disable bogus GLX_SGI_video_sync extension in xlib driver +
    • fixed R128 driver locking bug (Martijn van Oosterhout) +
    • using evaluators with vertex programs caused crashes (bug 7564) +
    • fragment.position wasn't set correctly for point/line primitives +
    • fixed parser bug for scalar sources for GL_NV_fragment_program +
    • max fragment program length was incorrectly 128, now 1024 +
    • writes to result.depth in fragment programs weren't clamped to [0,1] +
    • fixed potential dangling pointer bug in glBindProgram() +
    • fixed some memory leaks (and potential crashes) in Xlib driver +
    • fixed a number of build issues on HP-UX (Christopher Bell) +
    • accum buffer didn't work with OSMesa interface +
    + + +

    Internal code changes

    + +

    +A number of Mesa program-related structs were renamed. +For example struct vertex_program is now struct gl_vertex_program. +All the effected drivers have been updated. +

    + +

    Ian Romanick updated the GL API dispatch code in a number of ways. +First, many old/unused extensions were removed. +Second, the static entrypoints for some extensions were removed. +This means GL function pointers will have to be used more often +(e.g. use glXGetProcAddressARB()). +

    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Increase MAX_DRAWBUFFERS +
    • Fix linux-glide target/driver. +
    • Fix lambda calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			implements OpenGL 1.3
    +Wind River UGL		implements OpenGL 1.3
    +Windows/Win32		implements OpenGL 1.5
    +DJGPP			implements OpenGL 1.5
    +GGI			implements OpenGL 1.3
    +BeOS			implements OpenGL 1.5
    +Allegro			needs updating
    +D3D			needs updating
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.5.2.html xpsb-glx-0.19/mesa/docs/relnotes-6.5.2.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.5.2.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.5.2.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,126 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.5.2 Release Notes / December 2, 2006

    + +

    +Mesa 6.5.2 is a 6.5 follow-on development release with a few new features +but mostly consisting of bug fixes. +

    + + +

    MD5 checksums

    +
    +11a033b078e090b3caaeb467234fe299  MesaLib-6.5.2.tar.gz
    +e4d894181f1859651658b3704633e10d  MesaLib-6.5.2.tar.bz2
    +63bf1d444fa738cca52ce1043e284021  MesaLib-6.5.2.zip
    +2b8f1375d16bda5f5a2304174cd5bcf7  MesaDemos-6.5.2.tar.gz
    +e870efe98d3a50be01ab211b9b2e25d9  MesaDemos-6.5.2.tar.bz2
    +d92cc6f5fee5ca75af0be04f9f4908f0  MesaDemos-6.5.2.zip
    +8d4d77e3a7132f4217bbc7c1ab157030  MesaGLUT-6.5.2.tar.gz
    +e84edbb11c69c8e408dfadd2ed08e95b  MesaGLUT-6.5.2.tar.bz2
    +c6d7134843ed5faf11f6686ecb5d2a2e  MesaGLUT-6.5.2.zip
    +
    + + +

    New features

    +
      +
    • New DRI memory manager system. Currently used by the i915tex driver. +Other DRI drivers will be updated to use the new memory manager in coming +months. +
      +To use the new driver you'll need the most recent DRM library and drivers +(version 2.2 or later) and a recent xf86-video-intel driver module from X.org. +
      +New features resulting from this work include: +
        +
      • EXT_framebuffer_objects, render to texture +
      • ARB_pixel_buffer_objects +
      • Accelerated CopyTexSubimage, DrawPixels, ReadPixels, CopyPixels +
      • Accelerated texture uploads from pixel buffer objects +
      • Potentially texturing directly from the pixel buffer object (zero +copy texturing). +
      +
    • New Intel i965 DRI driver +
    • New minstall script to replace normal install program +
    • Faster fragment program execution in software +
    • Added (or fixed) support for + GLX_SGI_make_current_read to the following drivers:
    • +
        +
      • radeon
      • +
      • savage
      • +
      • mga
      • +
      • tdfx
      • +
      +
    • Added support for ARB_occlusion_query to the tdfx driver (Ian +Romanick).
    • +
    + +

    Bug fixes

    +
      +
    • fixed invalid memory read while rendering textured points (bug 8320) +
    • fixed problems with freebsd-dri configuration (bug 8344) +
    • Mesa's fake glxGetCurrentContext() wasn't thread-aware +
    • OPTION NV_position_invariant didn't work in NV vertex programs +
    • glDrawPixels into a user-created framebuffer object could crash Xlib driver +
    • Line clipping was broken in some circumstances +
    • fragment.fogcoord register didn't always contain the correct value +
    • RGBA logicops didn't work reliably in some DRI drivers +
    • Fixed broken RGBA LogicOps in Intel DRI drivers +
    • Fixed some fragment program bugs in Intel i915 DRI driver +
    • Fixed glGetVertexAttribfvARB bug 8883 +
    • Implemented glGetUniform[fi]vARB() functions +
    • Fixed glDrawPixels(GL_COLOR_INDEX, GL_BITMAP) segfault (bug 9044) +
    • Fixed some gluBuild2DMipmaps() bugs (Greg McGarragh) +
    • Fixed broken "mgl" name mangling +
    • Indirect rending was broken for glMap* functions (bug 8899) +
    + + +

    Internal code changes

    + +
      +
    • The device driver functions ResizeBuffers and GetBufferSize have been +decprecated. +
    • OpenGL 2.0 and 2.1 support is nearly done. We need to do quite a bit +more testing of the shading language functions. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Increase MAX_DRAWBUFFERS +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			implements OpenGL 1.3
    +Wind River UGL		implements OpenGL 1.3
    +Windows/Win32		implements OpenGL 1.5
    +DJGPP			implements OpenGL 1.5
    +GGI			implements OpenGL 1.3
    +BeOS			implements OpenGL 1.5
    +Allegro			needs updating
    +D3D			needs updating
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.5.3.html xpsb-glx-0.19/mesa/docs/relnotes-6.5.3.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.5.3.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.5.3.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,119 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.5.3 Release Notes / April 27, 2007

    + +

    +Mesa 6.5.3 is a development release with many changes and new features. +Mesa 7.0 is expected to follow shortly. +

    + + +

    MD5 checksums

    +
    +39f33ea64e34e2d5b20640b008b57649  MesaLib-6.5.3.tar.gz
    +46359457147c469745f24b5074a186f0  MesaLib-6.5.3.tar.bz2
    +a8946fa861634ce15971396f47992c41  MesaLib-6.5.3.zip
    +08e26948d57eaca74d02a530b2d8106e  MesaDemos-6.5.3.tar.gz
    +8af91773ab2653fe537499676b05f2e8  MesaDemos-6.5.3.tar.bz2
    +783f81b171bf89b0929abc894efd25a6  MesaDemos-6.5.3.zip
    +9467d415388fe1ad82991fb20704b812  MesaGLUT-6.5.3.tar.gz
    +360843e46b7ebb6909290b023f9b26fa  MesaGLUT-6.5.3.tar.bz2
    +7686065e5c15a30de08a1610860b6840  MesaGLUT-6.5.3.zip
    +
    + + +

    Shared library numbering

    +

    +Mesa 6.5.3 supports the OpenGL 2.0/2.1 API. However, the (unix) +shared library version is still 1.5 (i.e. libGL.so.1.5.xxxxxx). +Bumping the shared library version to 2.x would cause linking problems +with existing OpenGL applications. Since OpenGL 2.x is backward +compatible with OpenGL 1.x the shared library version number doesn't +have to be incremented (which would indicate an incompatible ABI). +

    +

    +Other OpenGL vendors name their OpenGL 2.x libraries libGL.so.1.0.xxxxx +for the same reason. +

    + + + +

    New features

    +
      +
    • OpenGL 2.0 and 2.1 API support. +
    • Entirely new Shading Language code generator. See the +Shading Language page for more information. +
    • Much faster software execution of vertex, fragment shaders. +
    • New vertex buffer object (vbo) infrastructure +
    • Updated glext.h file (version 39) +
    • Updated glxext.h file (version 19) +
    • GL_MAX_DRAWBUFFERS is now 4 (software rendering) so + "multiple render targets" are really supported. +
    + +

    Bug fixes

    +
      +
    • Fog was errantly applied when a fragment shader was enabled (bug 9346) +
    • glPush/PopClientAttrib didn't handle VBO bindings correctly (bug 9445) +
    • With 32-bit Z buffer, the fragment Z of lines and points was sometimes wrong. +
    • GL_POST_CONVOLUTION_ALPHA_BIAS/SCALE was broken. +
    • 1D convolution state could effect 2D image transfers +
    • Overlapping glCopyPixels with negative Y zoom didn't work (bug 10521) +
    • Fixed a number of framebuffer/renderbuffer reference counting bugs +
    • Fixed a few bugs in software-emulated alpha planes +
    • Assorted minor bug fixes in glCopy/DrawPixels, glPixelZoom, etc. +
    • Assorted DRI driver bug fixes. +
    • Fixed a number of bugs that prevented "depth-peeling" rendering from working. +
    + + +

    Internal code changes

    +
      +
    • Old array_cache module replaced by new vbo module. All geometry +rendering is now cast in the form of vertex buffer objects. +
    • Massive changes to the Shading Language compiler and related state. +
    • Vertex/fragment shaders are compiled into GPU instructions and +programs very similar to GL_ARB_vertex/fragment_program. +
    • Vertex and fragment programs are executed with the same code now. +
    • The SSE-optimized vertex program path has been removed since it didn't +support more than 12 temp registers, didn't support branching/looping, etc. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-6.5.html xpsb-glx-0.19/mesa/docs/relnotes-6.5.html --- xpsb-glx-0.19/mesa/docs/relnotes-6.5.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-6.5.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,131 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.5 Release Notes / March 31, 2006

    + +

    +Mesa 6.5 is a new development release. +

    + + +

    MD5 checksums

    +
    +657be3b92f6dabc78a67ed9cb8d67813  MesaLib-6.5.tar.gz
    +61beda590bfc5b4a12e979d5f2d70d7a  MesaLib-6.5.tar.bz2
    +19d48b872d579d4f91466060804a59ac  MesaLib-6.5.zip
    +694ad3a7007010c7418a9c72d1cba5b7  MesaDemos-6.5.tar.gz
    +ab95b590dcd640726a2d89e62068c66e  MesaDemos-6.5.tar.bz2
    +b792c303fefd87294488e2b7eab976e5  MesaDemos-6.5.zip
    +ac1d585483617db0c91e5c15cb5ec3a3  MesaGLUT-6.5.tar.gz
    +59f0bf2b2ffb67fe23ee479f9b044f31  MesaGLUT-6.5.tar.bz2
    +005decb2136718e22222ac1c4805cd15  MesaGLUT-6.5.zip
    +
    + + + +

    New Features

    +
      +
    • OpenGL Shading language support +
      + This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100, + GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of + the work was done by Michal Krol. + There's probably a fair number of bugs since this is a pretty large, + complicated body of code. +
      + The OpenGL 2.0 interface to these features will be implemented in a + future version of Mesa, + +
    • GL_EXT_timer_query +
      + Used to measure the time of OpenGL operations at high precision. + Only supported in the software/Xlib driver at this time. + +
    • GL_EXT_packed_depth_stencil +
      + Defines a new GL_DEPTH_STENCIL_EXT pixel format. + +
    • GL_EXT_framebuffer_blit +
      + A simplified glCopyPixels-like feature for copying pixel rectangles. + +
    • GL_ARB_half_float_pixel +
      + Adds a new half-precision floating point format for image transfers, + such as for glDrawPixels, glReadPixels, glTexImage, etc. +
    + +

    Changes

    +
      +
    • removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead) +
    • removed GL_SGIX/SGIS_pixel_texture extensions +
    +

    Bug fixes

    +
      +
    • fixed glxcontextmodes.c datatype problem (bug 5835) +
    • fixed aix-gcc build/install bugs (bug 5874) +
    • fixed some bugs in texture env program generation +
    • glXCopyContext() didn't handle texture object bindings properly +
    • glXCopyContext() didn't copy all lighting state +
    • fixed FreeBSD config (Pedro Giffuni) +
    • fixed some minor framebuffer object bugs +
    • replaced dprintf() with _glu_printf() in GLU (bug 6244) +
    • fixed a number of thread safety bugs/regressions +
    • fixed a number of GLU tesselator bugs (John Shell, bug 6339) +
    • paletted texturing was broken w/ floating point palettes (K. Schultz) +
    • lots of assorted framebuffer object bug fixes +
    + + +

    Known Issues

    +
      +
    • Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL +textures should work. +
    + + +

    Driver Interface Changes

    +
      +
    • Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by +the two-sided versions: Driver.Stencil*Separate(). +
    • Render-to-texture: The functions for rendering to textures have changed. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Increase MAX_DRAWBUFFERS +
    • Fix linux-glide target/driver. +
    • Fix lambda calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			implements OpenGL 1.3
    +Wind River UGL		implements OpenGL 1.3
    +Windows/Win32		implements OpenGL 1.5
    +DJGPP			implements OpenGL 1.5
    +GGI			implements OpenGL 1.3
    +BeOS			implements OpenGL 1.5
    +Allegro			needs updating
    +D3D			needs updating
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.0.1.html xpsb-glx-0.19/mesa/docs/relnotes-7.0.1.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.0.1.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.0.1.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,101 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.0.1 Release Notes / August 3, 2007

    + +

    +Mesa 7.0.1 is a stable release with bug fixes since version 7.0. +

    + + +

    MD5 checksums

    +
    +db55141a44b902fcc61d9265b7862c06  MesaLib-7.0.1.tar.gz
    +c056abd763e899114bf745c9eedbf9ad  MesaLib-7.0.1.tar.bz2
    +ecc2637547fae2b38271ae362d013afa  MesaLib-7.0.1.zip
    +b85a4a5be4e829f4a1165e4514b13183  MesaDemos-7.0.1.tar.gz
    +3b66b3268df12ca8a6c4e0c4c457912c  MesaDemos-7.0.1.tar.bz2
    +b1c18006f16e44e80fea66774c59b391  MesaDemos-7.0.1.zip
    +b87a69986839ae43ce12fc8e3dc1ebb4  MesaGLUT-7.0.1.tar.gz
    +25f30d0c1651997b4412366ba0572f7f  MesaGLUT-7.0.1.tar.bz2
    +676ee6682a6ce78a5540554fd975c03e  MesaGLUT-7.0.1.zip
    +
    + + +

    New features

    +
      +
    • Added a bluegene-osmesa build config +
    + +

    Bug fixes

    +
      +
    • Fixed some MingW build issues +
    • Added a few missing OpenGL 2.0 API entrypoints: +
        +
      • glVertexAttrib4bv +
      • glVertexAttrib4iv +
      • glVertexAttrib4ubv +
      • glVertexAttrib4uiv +
      • glVertexAttrib4usv +
      +
    • Fixed glDrawPixels(GL_STENCIL_INDEX) pixel transfer bug 11457 +
    • GLSL bug fix: added vec2(vec4) constructor +
    • GLSL bug fix: .strq and .rgba writemasks didn't always work +
    • Stencil pixel map didn't always work for glDrawPixels (bug 11475) +
    • Fixed polygon stipple bug in i915 driver +
    • Binding a zero-sized texture didn't disable texturing (bug 11309) +
    • Queries of GL_INFO_LOG_LENGTH, GL_SHADER_SOURCE_LENGTH didn't include +the terminating zero (bug 11588) +
    • glXChooseFBConfig() in Xlib driver didn't handle GLX_STEREO flag properly +
    • Fixed a GLSL function call bug (#11731) +
    • glPointParameteriv(GL_DISTANCE_ATTENUATION_EXT) didn't work (bug 11754) +
    • glGetAttribLocation() always returned 1 (bug 11774) +
    • Fixed a few memory-related bugs in GLU library +
    + + +

    Changes

    +
      +
    • The libOSMesa library version has been reverted to 6.5.3 (soname=6) +in order to avoid application linking issues. Otherwise, applications +previously linked with libOSMesa.so.6 would no longer link with libOSMesa.so.7 +
    • Dropped obsolete, unmaintained Windows project files for VC6 and VC7. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.0.2.html xpsb-glx-0.19/mesa/docs/relnotes-7.0.2.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.0.2.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.0.2.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,88 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.0.2 Release Notes / November 10, 2007

    + +

    +Mesa 7.0.2 is a stable release with bug fixes since version 7.0. +

    + + +

    MD5 checksums

    +
    +c9cf607f36e7e50172f5f9c7d552c34e  MesaLib-7.0.2.tar.gz
    +93e6ed7924ff069a4f883b4fce5349dc  MesaLib-7.0.2.tar.bz2
    +10c324c3613f90f059cb8429f700f300  MesaLib-7.0.2.zip
    +aa8b1244a5de1d23e5814bf9b67f1435  MesaDemos-7.0.2.tar.gz
    +11a10410bae7be85cf25bc7119966468  MesaDemos-7.0.2.tar.bz2
    +1dd0b5fd6d69430a2fd76a6adbfd8fff  MesaDemos-7.0.2.zip
    +a7dbf25c025955858bd2d89a6eb6db4c  MesaGLUT-7.0.2.tar.gz
    +3a33f8efc8c58a592a854cfc7a643286  MesaGLUT-7.0.2.tar.bz2
    +eba4ef2aa8c362ead81b54357f1903a3  MesaGLUT-7.0.2.zip
    +
    + + +

    New features

    +
      +
    • Updated Windows VC7 project files +
    • Added DESTDIR variable for 'make install' +
    • Added pkg-config files for gl, glu, glut and glw libraries +
    • Added bluegene-xlc-osmesa and catamount-osmesa-pgi configs +
    • Support for Intel G33/Q33/Q35 graphics chipsets +
    + +

    Bug fixes

    +
      +
    • Fixed a vertex buffer wrapping issue (bug 9962) +
    • Added mutex protection around texture object reference counters +
    • Added checking/support for additional chips in the i915/i945 family +(see 11978) +
    • Fixed a blending/banding issue (bug 11931) +
    • Fixed a GLU matrix inversion bug (#6748) +
    • Fixed problem with large glDrawArrays calls and indirect rendering (bug 12141) +
    • Fixed an assortment of i965 driver bugs +
    • Fixed x86-64 vertex transformation bug (12216) +
    • Fixed X server crash caused by multiple indirect rendering clients +
    • Parsing of state.texgen in ARB vertex/fragment programs didn't work (bug 12313) +
    • Fixed a glCopyPixels/glPixelZoom bug (12417) +
    • Fixed a bug when using glMaterial in display lists (bug 10604) +
    • Fixed a few GLUT/Fortran issues (Bill Mitchell) +
    • Fixed Blender crash bug (12164) +
    • Fixed some issues preventing cross-compiling +
    • Fixed up broken GL_ATI_separate_stencil extension +
    • glDrawArrays(count=0) led to a crash +
    • Fix SSE code gen memory leak, possible crash +
    • Fixed MMX 565 rgb conversion problem (bug 12614) +
    • Added -fno-strict-aliasing and -fPIC flags for gcc +
    • Fixed Blender crash in Unichrome driver (bug 13142) +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.0.3.html xpsb-glx-0.19/mesa/docs/relnotes-7.0.3.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.0.3.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.0.3.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,84 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.0.3 Release Notes / April 4, 2008

    + +

    +Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2. +

    + + +

    MD5 checksums

    +
    +3fd1cb76531b2515ef7db92d9a93dbf8  MesaLib-7.0.3.tar.gz
    +e6e6379d7793af40a6bc3ce1bace572e  MesaLib-7.0.3.tar.bz2
    +97882bac195229ee0b78cab82e0e3be1  MesaLib-7.0.3.zip
    +8abf6bbcb1661e7dd4ce73b3fbb85898  MesaDemos-7.0.3.tar.gz
    +47fd6863621d3c9c7dbb870ab7f0c303  MesaDemos-7.0.3.tar.bz2
    +99e442e14da1928f76a7297bb421a3af  MesaDemos-7.0.3.zip
    +2b50fe9fadc4709b57c52adef09fce3c  MesaGLUT-7.0.3.tar.gz
    +0ff23c4e91b238abae63a5fc9fa003e7  MesaGLUT-7.0.3.tar.bz2
    +70e83554a4462dad28e0d6e20f79aada  MesaGLUT-7.0.3.zip
    +
    + + +

    Bug fixes

    +
      +
    • Added missing glw.pc.in file to release tarball +
    • Fix GLUT/Fortran issues +
    • GLSL gl_FrontLightModelProduct.sceneColor variable wasn't defined +
    • Fix crash upon GLSL variable array indexes (not yet supported) +
    • Two-sided stencil test didn't work in software rendering +
    • Fix two-sided lighting bugs/crashes (bug 13368) +
    • GLSL gl_FrontFacing didn't work properly +
    • glGetActiveUniform returned incorrect sizes (bug 13751) +
    • Fix several bugs relating to uniforms and attributes in GLSL API (Bruce Merry, bug 13753) +
    • glTexImage3D(GL_PROXY_TEXTURE_3D) mis-set teximage depth field +
    • Fixed GLX indirect vertex array rendering bug (14197) +
    • Fixed crash when deleting framebuffer objects (bugs 13507, 14293) +
    • User-defined clip planes enabled for R300 (bug 9871) +
    • Fixed glBindTexture() crash upon bad target (bug 14514) +
    • Fixed potential crash in glDrawPixels(GL_DEPTH_COMPONENT) (bug 13915) +
    • Bad strings given to glProgramStringARB() didn't generate GL_INVALID_OPERATION +
    • Fixed minor point rasterization regression (bug 11016) +
    • state.texenv.color state var didn't work in GL_ARB_fragment_program (bug 14931) +
    • glBitmap from a PBO didn't always work +
    • glGetTexImage into a PBO didn't always work +
    • Comments at the end of ARB vertex/fragment programs crashed the parser +
    + +

    Changes

    +
      +
    • Updated glext.h to version 40 +
    + + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.0.4.html xpsb-glx-0.19/mesa/docs/relnotes-7.0.4.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.0.4.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.0.4.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,80 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.0.4 Release Notes / August 16, 2008

    + +

    +Mesa 7.0.4 is a stable release with bug fixes since version 7.0.3. +

    + + +

    MD5 checksums

    +
    +909afa3a01ae31478d363837681415ac  MesaLib-7.0.4.tar.gz
    +8d7bacbe0234742a5d08c8088c4619e9  MesaLib-7.0.4.tar.bz2
    +5e44261ef85b049a868e1785d9adc276  MesaLib-7.0.4.zip
    +53dcd77d37a819feaf50b5fcdd0a6e0f  MesaDemos-7.0.4.tar.gz
    +c1215b31c5f7b85f81eed3bfba07d556  MesaDemos-7.0.4.tar.bz2
    +b1825a7361f116b28d82d328077630b4  MesaDemos-7.0.4.zip
    +d7677d015f52602d1bf8b837fb717848  MesaGLUT-7.0.4.tar.gz
    +f5f8b46f7e763d9f7b7d1d115c1c44ee  MesaGLUT-7.0.4.tar.bz2
    +a786775271a02c62a3370b13b26bf48d  MesaGLUT-7.0.4.zip
    +
    + + +

    Bug fixes

    +
      +
    • define #extension GL_ARB_texture_rectangle in shading language +
    • fixed WIN32 compile problem in libGLU +
    • Fixed a per-vertex glMaterial bug which could cause bad lighting +
    • Fixed potential crash in AA/smoothed triangle rendering when using a fragment shader +
    • Fixed glDrawElement + VBO segfault (bug 16156) +
    • Fixed GLSL linker bug causing generic vertex attributes to get aliased +
    • Fixed stack overflow when using glPixelZoom on Windows +
    • Fixed broken all(bvec2) GLSL function, added misc missing bvec constructors +
    • ARB program "state.clip[n].plane" didn't parse correctly +
    • Fixed broken glGetUniformiv() (bug 13774) +
    + +

    Changes

    +
      +
    • Including the latest glext.h and glxext.h header files from Khronos +
    • Added support for DragonFly OS +
    • Added a build config for FreeBSD static libs (Anatolij Shkodin) +
    • Enabled GL_EXT_multi_draw_arrays extension in R200/R300 drivers +
    • Enabled GL_ARB_point_sprite extension in I965 driver +
    • Enabled GL_EXT_texture_sRGB extension in I965 driver +
    • Added support for GL shading language in I965 driver +
    + + + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.0.html xpsb-glx-0.19/mesa/docs/relnotes-7.0.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.0.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.0.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,93 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.0 Release Notes / June 22, 2007

    + +

    +Mesa 7.0 is a stable release, featuring OpenGL 2.1 API support. +A number of bugs have been fixed since the 6.5.3 release. +

    + + +

    MD5 checksums

    +
    +35a1698986f7ac8dc435624ee9256cda  MesaLib-7.0.tar.gz
    +50c371455fa7532c04aa0a970f9bc51f  MesaLib-7.0.tar.bz2
    +bcedb6f43c97c1bc49e5cc7f12835722  MesaLib-7.0.zip
    +9bad332c7b74f59be96556135212ca9e  MesaDemos-7.0.tar.gz
    +fada2bc1f29da513e015fda1e3abd0c0  MesaDemos-7.0.tar.bz2
    +84e3bbe470d983ae32f1f0c779faf99e  MesaDemos-7.0.zip
    +76c7bb54f9850c689eba844f6daed332  MesaGLUT-7.0.tar.gz
    +4af28296e02772ef1de00e4e79bf3d12  MesaGLUT-7.0.tar.bz2
    +9043cb0b54cc03d1874728d74b12188c  MesaGLUT-7.0.zip
    +
    + + +

    New features

    +
      +
    • OpenGL 2.0 and 2.1 API support. +
    + +

    Bug fixes

    +
      +
    • Fixed a few fog-related bugs. +
    • Fixed broken GLSL mix() function. +
    • Fixed broken GLSL exp() functions. +
    • Fixed GLSL mod4(vec4, vec4) bug. +
    • Implemented GLSL asin(), acos(), atan() functions. +
    • Fixed an R300 driver bug that caused Xorg composite manager to crash +
    • Fixed R300 vertex program/matrix bug (10848) +
    • GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords) +
    • Specifying an invalid texture unit as a sampler could lead to a crash +
    • The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983) +
    • ARB vp state.light[n].half value was incorrect (bug 10987) +
    • Fixed a positional light source bug (bug 11009) +
    • Fixed point size attenuation problem (bug 11042) +
    • glPopAttrib didn't restore texture object's LOD bias (bug 11049) +
    • Fixed a TLS / TEXTREL problem (bug 7459) +
    + + +

    Internal code changes

    +
      +
    • Some texture code consolidation and simplifiction (Ian Romanick) +
    • R300 driver clean-ups. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.1.html xpsb-glx-0.19/mesa/docs/relnotes-7.1.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.1.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.1.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,94 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.1 Release Notes / August 26, 2008

    + +

    +Mesa 7.1 is a new development release. +There have been many internal code changes since Mesa 7.0.x. +It should be relatively stable, but those who are especially concerned about +stability should wait for Mesa 7.2 or use Mesa 7.0.4 (the previous stable +release). +

    + +Note that this version of Mesa does not use the GEM memory manager. +The master branch of git uses GEM. +

    +

    +DRM version 2.3.1 should be used with Mesa 7.1 +

    + + +

    MD5 checksums

    +
    +971c2fe6e6949dc5ba200a6f97a6dc81  MesaLib-7.1.tar.gz
    +6bff7f532d16f90f944a400c8bd7074d  MesaLib-7.1.tar.bz2
    +d48224bf9d54c3da6776adb4869ba024  MesaLib-7.1.zip
    +3de268420efca43e9a19ab506cdfc993  MesaDemos-7.1.tar.gz
    +abfc9775e1462363af8ec160d1feb01f  MesaDemos-7.1.tar.bz2
    +f7b3623387c4036e9895cd9ac0dfad99  MesaDemos-7.1.zip
    +fdf348f78cd09304b6ff801ef8acc8eb  MesaGLUT-7.1.tar.gz
    +f6d88a4eeb02e98c7e92f1c895d3c76b  MesaGLUT-7.1.tar.bz2
    +4dc102a5ca51e1c41dde87d3f8c7b22a  MesaGLUT-7.1.zip
    +
    + + +

    New features

    +
      +
    • autoconf-based configuration (and clean-up of Makefiles) +
    • Assorted DRI driver enhancements +
    • Reduced dependencies between X server and Mesa +
    • GL_EXT_texture_from_pixmap extension for Xlib driver +
    • Support for the GL shading language with i965 driver (implemented by Intel) +
    • ATI R500 series support (Radeon X1300–X1950) in r300 DRI driver +
    + + +

    Bug fixes

    +
      +
    • Numerous GLSL fixes +
    • Fixed some error code/detection bugs in the GLSL-related API functions +
    • Lots of DRI driver fixes. +
    + + +

    To Do (someday) items

    +
      +
    • Remove the MEMCPY() and _mesa_memcpy() wrappers and just use memcpy(). +Probably do the same for malloc, calloc, etc. +The wrappers were useful in the past for memory debugging but now we +have valgrind. Not worried about SunOS 4 support anymore either... +
    • Switch to freeglut +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.2.html xpsb-glx-0.19/mesa/docs/relnotes-7.2.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.2.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.2.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,104 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.2 Release Notes / 20 September 2008

    + +

    +Mesa 7.2 is a stable release fixing bugs found in 7.1, which was a +new development release. +

    +

    +Mesa 7.2 implements the OpenGL 2.1 API, but the version reported by +glGetString(GL_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 2.1. +

    +

    +Note that this version of Mesa does not use the GEM memory manager. +The master branch of git uses GEM. +The prototype DRI2 code that was in 7.1 has also been removed. +

    +

    +DRM version 2.3.1 should be used with Mesa 7.2 +

    + + +

    MD5 checksums

    +
    +81a2a4b7cbfce7553f7ad8d924edbe2f  MesaLib-7.2.tar.gz
    +04d379292e023df0b0266825cb0dbde5  MesaLib-7.2.tar.bz2
    +8bc497a37977a55e987a4d1fabc3d882  MesaLib-7.2.zip
    +10c762e39486df395838af1d7b57e69c  MesaDemos-7.2.tar.gz
    +22e03dc4038cd63f32c21eb60994892b  MesaDemos-7.2.tar.bz2
    +1197bc4eb3bf44e291c14d4eb2e19381  MesaDemos-7.2.zip
    +42e3c6c6d156cd9dc545dbef72407354  MesaGLUT-7.2.tar.gz
    +f67daf93e12c4a459703bbf3e4004e31  MesaGLUT-7.2.tar.bz2
    +0390567eb2c2d12fbf82e8523fd77e2b  MesaGLUT-7.2.zip
    +
    + + +

    New features

    +
      +
    • i965 driver: added support for G41 chipset (Intel) +
    + + +

    Bug fixes

    +
      +
    • Fixed display list bug involving primitives split across lists (bug 17564) +
    • Fixed some issues with glBindAttribLocation() +
    • Fixed crash in _tnl_InvalidateState() found with Amira (bug 15834) +
    • Assorted bug fixes for Ming build +
    • Fixed some vertex/pixel buffer object reference counting bugs +
    • Fixed depth/stencil bug in i915/945 driver +
    • Fixed some shader flow control bugs in i965 driver +
    • Fixed a few tdfx driver bugs which prevented driver from working +
    • Fixed multisample enable/disable bug +
    + +

    Changes

    +
      +
    • Updated SGI header files with new license terms. +
    + + + +

    To Do (someday) items

    +
      +
    • Remove the MEMCPY() and _mesa_memcpy() wrappers and just use memcpy(). +Probably do the same for malloc, calloc, etc. +The wrappers were useful in the past for memory debugging but now we +have valgrind. Not worried about SunOS 4 support anymore either... +
    • Switch to freeglut +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.3.html xpsb-glx-0.19/mesa/docs/relnotes-7.3.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.3.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.3.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,93 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.3 Release Notes / 22 January 2009

    + +

    +Mesa 7.3 is a new development release. +Users especially concerned with stability should stick with latest +stable release: version 7.2. +

    +

    +Mesa 7.3 implements the OpenGL 2.1 API, but the version reported by +glGetString(GL_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 2.1. +

    +

    +See the Compiling/Installing page for prerequisites +for DRI hardware acceleration. +

    + + +

    MD5 checksums

    +
    +8ed03191432b22d118d88d6db497f304  MesaLib-7.3.tar.gz
    +781e7811a6ed5c97b2b8defefc8ffbc9  MesaLib-7.3.tar.bz2
    +3ccba9a1734ed6d4b3389e1535d90fbf  MesaLib-7.3.zip
    +d312e974b31043b13b61bac5fbf00b87  MesaDemos-7.3.tar.gz
    +3f0741394069bdf2329565a387396cda  MesaDemos-7.3.tar.bz2
    +4d0887fd4c66a824295cdd619f6d34cb  MesaDemos-7.3.zip
    +2d7661b66022bcb8878728f3d5bd33ab  MesaGLUT-7.3.tar.gz
    +abe8036a724c1a483bdad6b5a55ddc1a  MesaGLUT-7.3.tar.bz2
    +5f247819b47e2a7c62d07a6afe5262fb  MesaGLUT-7.3.zip
    +
    + + +

    New features

    +
      +
    • Support for GLSL 1.20 +
    • Intel DRI drivers now use GEM and DRI2 +
    + + +

    Bug fixes

    +
      +
    • Assorted GLSL bug fixes +
    • Assorted i965 driver fixes +
    • Fix for wglCreateLayerContext() in WGL/Windows driver +
    • Build fixes for OpenBSD and gcc 2.95 +
    • GLSL preprocessor handles #pragma now +
    • Fix incorrect transformation of GL_SPOT_DIRECTION +
    • Fixed several bugs (#18367 and #19625) in glXMakeContextCurrent() +
    • Assorted Windows build fixes +
    + +

    Changes

    +
      +
    • Deprecated the "XMesa" interface (include/GL/xmesa*.h files) +
    • Deprecated the "FXMesa" interface (include/GL/fxmesa.h file) +
    • Deprecated the "Allegro" interface (include/GL/amesa.h file) +
    • Removed include/GL/uglmesa.h header +
    • Removed include/GLView.h header for BeOS +
    + + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.4.1.html xpsb-glx-0.19/mesa/docs/relnotes-7.4.1.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.4.1.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.4.1.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,75 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.4.1 Release Notes / (date TBD)

    + +

    +Mesa 7.4.1 is a stable development release fixing bugs since the 7.4 release. +

    +

    +Mesa 7.4.1 implements the OpenGL 2.1 API, but the version reported by +glGetString(GL_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 2.1. +

    +

    +See the Compiling/Installing page for prerequisites +for DRI ardware acceleration. +

    + + +

    MD5 checksums

    +
    +tbd
    +
    + + +

    New features

    +
      +
    + + +

    Bug fixes

    +
      +
    • Fixed a two-sided lighting bug in fixed-function-to-GPU code generation +
    • Fixed some Darwin issues (Jeremy Huddleston) +
    • Indexing the GLSL gl_EyePlane[] or gl_ObjectPlane[] arrays with a variable + was broken, bug 20986 +
    • Fixed incorrect texture unit bias in TXB instruction +
    • glTexParameter settings weren't always propogated to drivers +
    • Assorted vertex/fragment program bug fixes +
    + +

    Changes

    +
      +
    + + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes-7.4.html xpsb-glx-0.19/mesa/docs/relnotes-7.4.html --- xpsb-glx-0.19/mesa/docs/relnotes-7.4.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes-7.4.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,89 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.4 Release Notes / 27 March 2009

    + +

    +Mesa 7.4 is a stable development release fixing bugs since the 7.3 release. +

    +

    +Mesa 7.4 implements the OpenGL 2.1 API, but the version reported by +glGetString(GL_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 2.1. +

    +

    +See the Compiling/Installing page for prerequisites +for DRI ardware acceleration. +

    + + +

    MD5 checksums

    +
    +ed6bd7437177307e51e16d0c7c381dfa  MesaLib-7.4.tar.gz
    +7ecddb341a2691e0dfdb02f697109834  MesaLib-7.4.tar.bz2
    +433e823f8245f9fd5f397e7b719a8e47  MesaLib-7.4.zip
    +656eee6128016fb237e01aa8dabbc703  MesaDemos-7.4.tar.gz
    +02816f10f30b1dc5e069e0f68c177c98  MesaDemos-7.4.tar.bz2
    +44a70d6db4aa4c64ecc47871b6aceee8  MesaDemos-7.4.zip
    +25f80db4f8645cd3e58e2c9af53ec341  MesaGLUT-7.4.tar.gz
    +04ec01caebde44f5b0d619f00716b368  MesaGLUT-7.4.tar.bz2
    +019dc213baecaa3cb1278847d41b8591  MesaGLUT-7.4.zip
    +
    + + +

    New features

    +
      +
    • Added MESA_GLX_FORCE_DIRECT env var for Xlib/software driver +
    • GLSL version 1.20 is returnd by the GL_SHADING_LANGUAGE_VERSION query +
    + + +

    Bug fixes

    +
      +
    • glGetActiveUniform() returned wrong size for some array types +
    • Fixed some error checking in glUniform() +
    • Fixed a potential glTexImage('proxy target') segfault +
    • Fixed bad reference counting for 1D/2D texture arrays +
    • Fixed VBO + glPush/PopClientAttrib() bug #19835 +
    • Assorted i965 driver bug fixes +
    • Fixed a Windows compilation failure in s_triangle.c +
    • Fixed a GLSL array indexing bug +
    • Fixes for building on Haiku +
    + +

    Changes

    +
      +
    • Updated GL/glxext.h to version 48 +
    • Assorted updates for building on Solaris +
    + + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + diff -Nru xpsb-glx-0.19/mesa/docs/relnotes.html xpsb-glx-0.19/mesa/docs/relnotes.html --- xpsb-glx-0.19/mesa/docs/relnotes.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/relnotes.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,75 @@ + + +Mesa Release Notes + + + + + +

    Release Notes

    + +

    +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.5) designate new developmental releases. +Even numbered versions (such as 6.4) designate stable releases. +

    + + +

    +The release notes summarize what's new or changed in each Mesa release. +

    + + +Versions of Mesa prior to 6.4 are summarized in the +versions file and the following release notes. +

    + + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/repository.html xpsb-glx-0.19/mesa/docs/repository.html --- xpsb-glx-0.19/mesa/docs/repository.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/repository.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,132 @@ + + +Cocd Repository + + + + + +

    Code Repository

    + +

    +As of December 5, 2006, Mesa is using +git +as its source code management system. +CVS was used previously. +The old CVS repository should no longer be used. +

    + +The master git repository is hosted on +freedesktop.org. +

    + +

    +You may access the repository either as an +anonymous user (read-only) or as a +developer +(read/write). +

    + +

    +You may also +browse the git repository. +

    + + + +

    Anonymous git Access

    + +

    +To get the Mesa sources anonymously (read-only): +

    + +
      +
    1. Install the git software on your computer if needed.

      +
    2. Get an initial, local copy of the repository with: +
      +    git clone git://anongit.freedesktop.org/git/mesa/mesa
      +    
      +
    3. Later, you can update your tree from the master repository with: +
      +    git pull origin
      +    
      +
    + + +
    +

    Developer git Access

    + +

    +Mesa developers need to first have an account on +freedesktop.org. +To get an account, please ask Brian or the other Mesa developers for +permission. +Then, if there are no objections, follow this + +procedure. +

    + +

    +Once your account is established: +

    + +
      +
    1. Install the git software on your computer if needed.

      +
    2. Get an initial, local copy of the repository with: +
      +    git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa
      +    
      + Replace username with your actual login name.

      +
    3. Later, you can update your tree from the master repository with: +
      +    git pull origin
      +    
      +
    + + +

    Windows Users

    + +

    +If you're +using git on Windows you'll want to enable automatic CR/LF conversion in +your local copy of the repository: +

    +
    +   git config --global core.autocrlf true
    +
    + +

    +This will cause git to convert all text files to CR+LF on checkout, +and to LF on commit. +

    +

    +Unix users don't need to set this option. +

    +
    + + + +

    Development Branches

    + +

    +At any given time, there may be several active branches in Mesa's +repository. +Generally, the trunk contains the latest development (unstable) +code while a branch has the latest stable code. +

    + +

    +The command git-branch will list all available branches. +

    + +

    +Questions about branch status/activity should be posted to the +mesa3d-dev mailing list. +

    + + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/science.html xpsb-glx-0.19/mesa/docs/science.html --- xpsb-glx-0.19/mesa/docs/science.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/science.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,72 @@ + + +Science and Technical + + + + + +

    Science and Technical

    + +
      +
    • Ch - OpenGL bindings for the Ch C/C++ interpreter +
    • CLEO3D - event displayer for the CLEOIII detector +
    • DINO - Visualizing + Structural Biology +
    • General + Mesh Viewer (GMV) - scientific vis. +
    • GiD - finite element + analysis +
    • glpoisson - A finite + element analysis program that simulates wave in an arbitrary region. +
    • GLWaves - + Electromagnetic wave visualization +
    • Gmsh - + finite element mesh generator / viewer +
    • gOpenMol + - computational chemistry +
    • GPS 3D - GPS-based map visualization +
    • Hitchhiker + - virtual solar system +
    • Hydra - physics + and engineering pkg +
    • Light Speed + - a real-time, interactive relativistic simulator +
    • LinkWinds - scientific + vis +
    • MathGL3d - Mathematica viewer +
    • Mathworks + - mathematics and visualization +
    • Medit - 3D surface mesh viewer +
    • MOLMOL + - molecular modeling and analysis +
    • Molscript - molecular + modeling +
    • +
    • OpenDX - Data visualization + system +
    • +
    • ORSA - An interactive tool for Celestial Mechanics +
    • +
    • ParaView - Scientific visualization package +
    • +
    • PHLEX - Finite element vis +
    • ROOT - Object Oriented Data + Analysis Framework +
    • SLFFEA - GNU finite element + package +
    • Spock - molecular + modeling +
    • Ssystem - solar + system simulation +
    • SPARROW - robot simulation +
    • Vis5D + - atmospheric visualization +
    • VMD - molecular + modeling +
    • Webots - 3-D mobile + robot simulator +
    + + + \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/docs/shading.html xpsb-glx-0.19/mesa/docs/shading.html --- xpsb-glx-0.19/mesa/docs/shading.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/shading.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,341 @@ + + +Shading Language Support + + + + + +

    Shading Language Support

    + +

    +This page describes the features and status of Mesa's support for the + +OpenGL Shading Language. +

    + +

    +Last updated on 15 December 2008. +

    + +

    +Contents +

    + + + + + +

    GLSL 1.20 support

    + +

    +GLSL version 1.20 is supported in Mesa 7.3. +Among the features/differences of GLSL 1.20 are: +

      +
    • mat2x3, mat2x4, etc. types and functions +
    • transpose(), outerProduct(), matrixCompMult() functions +(but untested) +
    • precision qualifiers (lowp, mediump, highp) +
    • invariant qualifier +
    • array.length() method +
    • float[5] a; array syntax +
    • centroid qualifier +
    • unsized array constructors +
    • initializers for uniforms +
    • const initializers calling built-in functions +
    + + + +
    +

    Unsupported Features

    + +

    +The following features of the shading language are not yet supported +in Mesa: +

    + +
      +
    • Linking of multiple shaders is not supported +
    • gl_ClipVertex +
    • The gl_Color and gl_SecondaryColor varying vars are interpolated + without perspective correction +
    + +

    +All other major features of the shading language should function. +

    + + +
    +

    Implementation Notes

    + +
      +
    • Shading language programs are compiled into low-level programs + very similar to those of GL_ARB_vertex/fragment_program. +
    • All vector types (vec2, vec3, vec4, bvec2, etc) currently occupy full + float[4] registers. +
    • Float constants and variables are packed so that up to four floats + can occupy one program parameter/register. +
    • All function calls are inlined. +
    • Shaders which use too many registers will not compile. +
    • The quality of generated code is pretty good, register usage is fair. +
    • Shader error detection and reporting of errors (InfoLog) is not + very good yet. +
    • The ftransform() function doesn't necessarily match the results of + fixed-function transformation. +
    + +

    +These issues will be addressed/resolved in the future. +

    + + +
    +

    Programming Hints

    + +
      +
    • Declare in function parameters as const whenever possible. + This improves the efficiency of function inlining. +
    • +
      +
    • To reduce register usage, declare variables within smaller scopes. + For example, the following code: +
      +    void main()
      +    {
      +       vec4 a1, a2, b1, b2;
      +       gl_Position = expression using a1, a2.
      +       gl_Color = expression using b1, b2;
      +    }
      +
      + Can be rewritten as follows to use half as many registers: +
      +    void main()
      +    {
      +       {
      +          vec4 a1, a2;
      +          gl_Position = expression using a1, a2.
      +       }
      +       {
      +          vec4 b1, b2;
      +          gl_Color = expression using b1, b2;
      +       }
      +    }
      +
      + Alternately, rather than using several float variables, use + a vec4 instead. Use swizzling and writemasks to access the + components of the vec4 as floats. +
    • +
      +
    • Use the built-in library functions whenever possible. + For example, instead of writing this: +
      +        float x = 1.0 / sqrt(y);
      +
      + Write this: +
      +        float x = inversesqrt(y);
      +
      +
    • + Use ++i when possible as it's more efficient than i++ +
    • +
    + + +
    +

    Stand-alone GLSL Compiler

    + +

    +A unique stand-alone GLSL compiler driver has been added to Mesa. +

    + +

    +The stand-alone compiler (like a conventional command-line compiler) +is a tool that accepts Shading Language programs and emits low-level +GPU programs. +

    + +

    +This tool is useful for: +

    +

      +
    • Inspecting GPU code to gain insight into compilation +
    • Generating initial GPU code for subsequent hand-tuning +
    • Debugging the GLSL compiler itself +
    + +

    +After building Mesa, the glslcompiler can be built by manually running: +

    +
    +    cd src/mesa/drivers/glslcompiler
    +    make
    +
    + + +

    +Here's an example of using the compiler to compile a vertex shader and +emit GL_ARB_vertex_program-style instructions: +

    +
    +    bin/glslcompiler --debug --numbers --fs progs/glsl/CH06-brick.frag.txt
    +
    +

    +results in: +

    +
    +# Fragment Program/Shader
    +  0: RCP TEMP[4].x, UNIFORM[2].xxxx;
    +  1: RCP TEMP[4].y, UNIFORM[2].yyyy;
    +  2: MUL TEMP[3].xy, VARYING[0], TEMP[4];
    +  3: MOV TEMP[1], TEMP[3];
    +  4: MUL TEMP[0].w, TEMP[1].yyyy, CONST[4].xxxx;
    +  5: FRC TEMP[1].z, TEMP[0].wwww;
    +  6: SGT.C TEMP[0].w, TEMP[1].zzzz, CONST[4].xxxx;
    +  7: IF (NE.wwww); # (if false, goto 9);
    +  8:    ADD TEMP[1].x, TEMP[1].xxxx, CONST[4].xxxx;
    +  9: ENDIF;
    + 10: FRC TEMP[1].xy, TEMP[1];
    + 11: SGT TEMP[2].xy, UNIFORM[3], TEMP[1];
    + 12: MUL TEMP[1].z, TEMP[2].xxxx, TEMP[2].yyyy;
    + 13: LRP TEMP[0], TEMP[1].zzzz, UNIFORM[0], UNIFORM[1];
    + 14: MUL TEMP[0].xyz, TEMP[0], VARYING[1].xxxx;
    + 15: MOV OUTPUT[0].xyz, TEMP[0];
    + 16: MOV OUTPUT[0].w, CONST[4].yyyy;
    + 17: END
    +
    + +

    +Note that some shading language constructs (such as uniform and varying +variables) aren't expressible in ARB or NV-style programs. +Therefore, the resulting output is not always legal by definition of +those program languages. +

    +

    +Also note that this compiler driver is still under development. +Over time, the correctness of the GPU programs, with respect to the ARB +and NV languagues, should improve. +

    + + + +
    +

    Compiler Implementation

    + +

    +The source code for Mesa's shading language compiler is in the +src/mesa/shader/slang/ directory. +

    + +

    +The compiler follows a fairly standard design and basically works as follows: +

    +
      +
    • The input string is tokenized (see grammar.c) and parsed +(see slang_compiler_*.c) to produce an Abstract Syntax Tree (AST). +The nodes in this tree are slang_operation structures +(see slang_compile_operation.h). +The nodes are decorated with symbol table, scoping and datatype information. +
    • The AST is converted into an Intermediate representation (IR) tree +(see the slang_codegen.c file). +The IR nodes represent basic GPU instructions, like add, dot product, +move, etc. +The IR tree is mostly a binary tree, but a few nodes have three or four +children. +In principle, the IR tree could be executed by doing an in-order traversal. +
    • The IR tree is traversed in-order to emit code (see slang_emit.c). +This is also when registers are allocated to store variables and temps. +
    • In the future, a pattern-matching code generator-generator may be +used for code generation. +Programs such as L-BURG (Bottom-Up Rewrite Generator) and Twig look for +patterns in IR trees, compute weights for subtrees and use the weights +to select the best instructions to represent the sub-tree. +
    • The emitted GPU instructions (see prog_instruction.h) are stored in a +gl_program object (see mtypes.h). +
    • When a fragment shader and vertex shader are linked (see slang_link.c) +the varying vars are matched up, uniforms are merged, and vertex +attributes are resolved (rewriting instructions as needed). +
    + +

    +The final vertex and fragment programs may be interpreted in software +(see prog_execute.c) or translated into a specific hardware architecture +(see drivers/dri/i915/i915_fragprog.c for example). +

    + +

    Code Generation Options

    + +

    +Internally, there are several options that control the compiler's code +generation and instruction selection. +These options are seen in the gl_shader_state struct and may be set +by the device driver to indicate its preferences: + +

    +struct gl_shader_state
    +{
    +   ...
    +   /** Driver-selectable options: */
    +   GLboolean EmitHighLevelInstructions;
    +   GLboolean EmitCondCodes;
    +   GLboolean EmitComments;
    +};
    +
    + +
      +
    • EmitHighLevelInstructions +
      +This option controls instruction selection for loops and conditionals. +If the option is set high-level IF/ELSE/ENDIF, LOOP/ENDLOOP, CONT/BRK +instructions will be emitted. +Otherwise, those constructs will be implemented with BRA instructions. +
    • + +
    • EmitCondCodes +
      +If set, condition codes (ala GL_NV_fragment_program) will be used for +branching and looping. +Otherwise, ordinary registers will be used (the IF instruction will +examine the first operand's X component and do the if-part if non-zero). +This option is only relevant if EmitHighLevelInstructions is set. +
    • + +
    • EmitComments +
      +If set, instructions will be annoted with comments to help with debugging. +Extra NOP instructions will also be inserted. +
      + +
    + + +
    +

    Compiler Validation

    + +

    +A Glean test has +been create to exercise the GLSL compiler. +

    +

    +The glsl1 test runs over 170 sub-tests to check that the language +features and built-in functions work properly. +This test should be run frequently while working on the compiler to catch +regressions. +

    +

    +The test coverage is reasonably broad and complete but additional tests +should be added. +

    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/sourcedocs.html xpsb-glx-0.19/mesa/docs/sourcedocs.html --- xpsb-glx-0.19/mesa/docs/sourcedocs.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/sourcedocs.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,37 @@ + + +Source Code Documentation + + + + + +

    Source Code Documentation

    + +

    +Doxygen +is used to automatically +produce cross-referenced documentation from the Mesa source code. +

    + +

    +The Doxygen configuration files and generated files are not included +in the normal Mesa distribution (they're very large). +To generate Doxygen documentation, download Mesa from CVS, change to +the doxygen directory and run make. +

    + +

    +For an example of Doxygen usage in Mesa, see a recent source file +such as bufferobj.c. +

    + + +

    +If you're reading this page from your local copy of Mesa, and have +run the doxygen scripts, you can read the documentation +here +

    + + + diff -Nru xpsb-glx-0.19/mesa/docs/subset-A.html xpsb-glx-0.19/mesa/docs/subset-A.html --- xpsb-glx-0.19/mesa/docs/subset-A.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/subset-A.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,3579 @@ + + + + Mini GLX Specification + + + +

    +
    Mesa Subset Specification
    +

    +

    +
    +

    Tungsten Graphics, Inc.

    +

    February 26, 2003
    +

    +
    +

    +

    Copyright © 2002-2003 by Tungsten Graphics, Inc., +Cedar Park, Texas. All Rights Reserved.
    +
    +Permission is granted to make and distribute verbatim copies of this +document provided the copyright notice and this permission notice are +preserved on all copies.
    +

    +

    OpenGL is a trademark of Silicon +Graphics, Inc..

    +

    1. Introduction

    +This document describes a subset of the Mesa implemented by Tungsten +Graphics, Inc. for embedded devices.  Prior to reading this +document the reader should be familiar with the OpenGL 1.2.1 +specification dated April 1, 1999 (available from http://www.opengl.org/developers/documentation/specs.html.) + Experience with OpenGL programming is highly advisable.
    +

    +Tungsten Graphics, Inc. is working with industry standards +organizations +in an attempt to standardize this Mesa subset and any +other possible subsets +as a result of this work.
    +
    +Appendix A contains a list of issues of which some may not be resolved.
    +
    +To summarize, the following major features of Mesa are omitted from the +subset:
    +
      +
    • Vertex arrays
    • +
    • Texture coordinate generation
    • +
    • Lighting
    • +
    • Point size
    • +
    • Polygon stipple
    • +
    • DrawPixels, CopyPixels, PixelZoom
    • +
    • 1-D and 3-D textures
    • +
    • CopyTex[Sub]Image
    • +
    • Fog
    • +
    • Depth test
    • +
    • Color Index mode
    • +
    • Accumulation buffer
    • +
    • Feedback mode
    • +
    • Evaluators
    • +
    • Push/Pop attributes
    • +
    • Display lists
      +
    • +
    +

    Further reductions are made at a lower level of detail.
    +

    +

    Mesa function names are printed in bold +face.  Function parameters are printed in italics.
    +

    +

    The Tungsten Graphics, Inc. Mesa subset library is hereafter +referred to as the subset.
    +
    +

    +

    2. Primitive Specification

    +

    2.1 glBegin, glEnd and glVertex Commands

    +The basic rendering primitives are points, lines and triangles. + Quadrilaterals and polygons are composed of triangles. + Primitives are drawn with the glBegin +and glEnd commands and a subset +of the glVertex commands:
    +
    +
    void glBegin(GLenummode)
    +void glEnd(void)
    +
    +void glVertex2f(GLfloat x, GLfloat y)
    +void glVertex2fv(const GLfloat +*v)
    +void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
    +void glVertex3fv(const GLfloat +*v)
    +
    +
    +The mode parameter to glBegin may be one of the following
    +
    +
    GL_POINTS - a series of individual +points
    +GL_LINES - a series of disjoint line segments
    +GL_LINE_STRIP - series of connected line segments
    +GL_LINE_LOOP - a closed loop of line segments
    +GL_TRIANGLES - a series of individual triangles
    +GL_TRIANGLE_STRIP - a connected strip of triangles
    +GL_TRIANGLE_FAN - a sequence of triangles all sharing a common vertex
    +GL_QUADS - a sequence of individual quadrilaterals
    +GL_QUAD_STRIP - a connected strip of quadrilaterals
    +GL_POLYGON - a closed, convex polygon
    +
    +
    +
    +The glVertex commands take two +or three floating point coordinates, or a pointer to an array of two or +three floating point coordinates.  Vertices are actually 4-element +homogeneous coordinates.  The fourth component, unspecified by the +subset's glVertex commands, is +one.
    +
    + +

    2.2 Other Per-vertex Commands
    +

    +The glColor and glTexCoord commands may be used to +specify colors and texture coordinates for each vertex:
    +
    +
    void glColor3f(GLfloatred, GLfloat green, GLfloat blue)
    +void glColor3fv(const GLfloat *rgb)
    +void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
    +void glColor4fv(const GLfloat *rgba)
    +void glTexCoord2f(GLfloat s, GLfloat t)
    +void glTexCoord2fv(const +GLfloat *c)
    +
    +
    +The glColor commands specify +the color and optionally, the alpha value, for subsequent vertices. + For the glColor3 commands, +alpha is set to one.
    +
    +The glTexCoord2 commands +specify the texture coordinate for subsequent vertices.  Texture +coordinates are actually four-component coordinates: (s, t, r, q). + The glTexCoord2 commands +set s and t explicitly.  The r and q components are zero and one, +respectively.
    +
    +Only glVertex, glColor and glTexCoord commands are allowed +between glBegin and glEnd.  Calling any other +command between glBegin and glEnd will result in the error +GL_INVALID_OPERATION.
    +
    +

    2.3 Unsupported Commands

    +None of the following commands related to primitive specification are +supported by the subset:
    +
    +
    Per-Vertex commands:
    +
    +
    +
    glVertex2d, +glVertex2i, glVertex2s, glVertex3d, glVertex3i, glVertex3s, glVertex4d, +glVertex4i, glVertex4s, glVertex2dv, glVertex2iv, glVertex2sv, +glVertex3dv, glVertex3iv, glVertex3sv, glVertex4dv, glVertex4iv, +glVertex4sv,
    +glNormal3b, glNormal3d, glNormal3f, glNormal3i, glNormal3s,
    glNormal3bv, glNormal3dv, glNormal3fv, +glNormal3iv, glNormal3sv,
    +glIndexd, glIndexf, glIndexi, glIndexs, glIndexub, glIndexdv, +glIndexfv, glIndexiv, glIndexsv, glIndexubv,
    +glColor3b, glColor3d, glColor3i, glColor3s, glColor3ub, glColor3ui, +glColor3us,
    glColor3bv, +glColor3dv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, +glColor3usv, lColor4b, +glColor4d, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, glColor4bv, glColor4dv, glColor4iv, +glColor4sv, glColor4ubv, glColor4uiv, glColor4usv,
    +
    glTexCoord1d, glTexCoord1f, +glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2i, glTexCoord2s, +glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, glTexCoord4d, +glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv, +glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2iv, +glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, +glTexCoord3sv, glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, +glTexCoord4sv,
    +glEdgeFlag, glEdgeFlagv

    +
    +
    +Vertex array commands:
    +
    glVertexPointer, +glColorPointer, glIndexPointer, glTexCoordPointer, glEdgeFlagPointer, +glNormalPointer, glInterleavedArrays, glArrayElement, glDrawArrays, +glDrawElements, glDrawRangeElements, glEnableClientState, +glDisableClientState
    +
    +
    +

    +Rectangle commands:
    +
    glRects, +glRecti, glRectf, glRectd, glRectsv, glRectiv, glRectfv, glRectdv,
    +
    +
    +
    +
    Lighting commands:
    +
    +
    glMaterialf, +glMateriali, glMaterialfv, glMaterialiv
    +

    +
    +
    Evaluator commands:
    +
    glEvalCoord1d, +glEvalCoord1f, glEvalCoord1dv, glEvalCoord1fv, glEvalCoord2d, glEvalCoord2f, +glEvalCoord2dv, glEvalCoord2fv,
    +
    glEvalPoint1, glEvalPoint2
    +
    +
    +
    +

    3. Coordinate Transformation

    +

    3.1 Vertex Transformation

    +Vertex coordinates are transformed by the current modelview and +projection matrices then mapped to window coordinates as specified by +the viewport.  The following coordinate transformation commands are +supported by the subset
    +
    +
    glMatrixMode(GLenum mode)
    +glLoadIdentity(void)
    +glPushMatrix(void)
    +glPopMatrix(void)
    +glLoadMatrixf(const GLfloat *m)
    +glMultMatrixf(const GLfloat *m)
    +glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
    +glTranslatef(GLfloat x, GLfloat y, GLfloat z)
    +glScalef(GLfloat x, GLfloat y, GLfloat z)
    +glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)

    +glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
    +glViewport(GLint x, GLint y, GLsize width, GLsizei height)
    +
    +
    +The glMatrixMode command +specifies the current matrix. + The mode parameter may be GL_MODELVIEW or GL_PROJECTION to specify +the modelview matrix or projection matrix.  Subsequent matrix +commands will effect the current matrix.  Also associated with the +modelview and projection matrices are a modelview matrix stack and +projection matrix stack.
    +
    +The glLoadIdentity command +replaces the current matrix with the identity matrix.  The matrix +elements are specified in column-major order.
    +
    +The glPushMatrix command pushes +a copy of the current matrix onto either the modelview matrix stack or +the projection matrix stack.  The glPopMatrix +command replaces the current matrix with a copy of the top matrix off +the modelview matrix stack or projection matrix stack, the pops the +stack.  Matrix stacks are useful for traversing and rendering +hierarchical models.
    +
    +The glMultMatrixf command +post-multiplies the current matrix by the specified matrix.  The +matrix elements are specified in column-major order.
    +
    +The glRotatef command +post-multiplies the current matrix by a rotation matrix defined by the +angle and rotation axis defined by x, y and z.
    +
    +The glTranslatef command +post-multiplies the current matrix by a translation matrix defined by +the x, y and z translation parameters.
    +
    +The glScalef command +post-multiplies the current matrix by a scaling matrix defined by the x, y and z scale factors.
    +
    +The glFrustum command +post-multiplies the current matrix by a perspective projection matrix. + The near and far values specify the position of +the hither and yon Z-axis clipping planes.  The left, right, bottom and top parameters are the X and Y +extents at the near clipping plane.  glFrustum is normally used to modify +the projection matrix.
    +
    +The glOrtho command +post-multiplies the current matrix by an orthographic projection matrix. + The near and far values specify the position of +the hither and yon Z-axis clipping planes.  The left, right, bottom and top parameters specify the X and +Y-axis clipping planes.  glOrtho +is normally used to modify the projection matrix.
    +
    +The glViewport command +specifies the mapping of coordinates from normalized device coordinates +to window coordinates.  The x +and y parameters specify the +viewport's lower-left corner in the window and the width and height parameters specify the size +of the viewport.  glViewport +does not effect the current matrix.
    +
    +A coordinate transformed to window coordinates is hereafter known as (xw, +yw, zw).
    +
    +

    3.2 Clipping

    +View-volume clipping automatically discards or trims primitives which +lie completely or partially outside of the view volume specified by glFrustum and glOrtho.  Note that the glViewport command does not define a +clipping region.
    +
    +Clipping occurs in clip coordinate +space - the coordinates produced after applying the projection +matrix.
    +
    +

    3.3 Current Raster Position

    +The current raster position specifies the location for drawing images +with glBitmap.  The current +raster position is set with the commands:
    +
    +
    void glRasterPos2f(GLfloatx, GLfloat y)
    +void glRasterPos2fv(const +GLfloat *v)
    +void glRasterPos2i(GLint x, GLint y)
    +void glRasterPos2iv(const +GLint *v)
    +
    +
    +glRasterPos specifies a +4-component coordinate (x, y, 0, 1).  The coordinate is processed +like a vertex; it is transformed by the modelview matrix, the projection +matrix and mapped to the viewport.  The resulting window coordinate +is stored as the current raster position.  The coordinate is +clipped-tested against the frustum like a vertex.  If the +coordinate is clipped, then the current raster position becomes invalid +and subsequent glBitmap commands +have no effect.
    +
    +glRasterPos also updates the +current raster color and current raster texture coordinates.  The +current raster color is updated (copied) from the current color (as +specified by glColor). + The current raster texture coordinate is updated (copied) from the +current texture coordinate (as specified by glTexCoord).
    +
    +

    3.4 Unsupported Commands

    +The following commands related to vertex transformation are not +supported by the subset:
    +
    +
    User-defined clip plane commands:
    +
    glClipPlane
    +
    +
    +
    +
    Lighting and material commands:
    +
    glLightModeli, +glLightModelf, glLightModeliv, +glLightModelfv, glLightf, +glLighti, glLightfv, glLightiv, glColorMaterial
    +
    +
    +
    Automatic texture coordinate generation +commands:
    +
    +
    +
    glTexGend, +glTexGenf, glTexGeni, glTexGendv, +glTexGenfv, glTexGeniv,
    +
    +
    +Double-valued commands:
    +
    glLoadMatrixd, +glMultMatrixd, glRotated, glTranslated, glScaled
    +
    +
    +Depth Range command:
    +
    glDepthRange +(the near value is always 0.0 and the far value is always 1.0)
    +
    +
    +Extra RasterPos commands:
    +
    glRasterPos2d, +glRasterPos2s, glRasterPos3d, glRasterPos3f, glRasterPos3i, +glRasterPos3s, glRasterPos4d, glRasterPos4f, glRasterPos4i, +glRasterPos4s, glRasterPos2dv, glRasterPos2sv, glRasterPos3dv, +glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, glRasterPos4dv, +glRasterPos4fv, glRasterPos4iv, glRasterPos4sv
    +
    +
    +
    +
    +

    4. Rasterization

    +This section describes the commands and options for drawing points, +lines, triangles and bitmaps.  Rasterization +is the term for the process which produces fragments from the geometric +description of a primitive (a point, line, polygon or bitmap).  For +example, given the two coordinates for the end-points of a line segment, +rasterization determines which pixels in the frame buffer are modified +to draw the line.  A +fragment is a tuple which consists of a window coordinate, colors and +texture coordinates.  The fragments produced by rasterization are +subsequently processed by the per-fragment operations described later.
    +
    +

    4.1 Point Rasterization

    +Points are rendered with the command sequence glBegin(GL_POINTS), glVertex, ... glEnd.  The window coordinate (xw, +yw, zw) is truncated to rasterize the point. + The truncated coordinate with its associated color and texture +coordinate is sent as a single fragment to the per-fragment processing +stages.
    +
    +The glPointSize command is not +supported; only 1-pixel points are supported.
    +
    +Point smoothing (antialiasing) is also not supported.
    +
    +

    4.2 Line Rasterization

    +Lines are rendered with the command sequence glBegin(mode), glVertex, glVertex, ... glEnd where mode is one of GL_LINES, +GL_LINE_STRIP or GL_LINE_LOOP.  Lines are rasterized as described +in the OpenGL specification.  Note that OpenGL specifies the half-open convention for drawing +lines: the last fragment in a line segment is omitted so that endpoint +pixels shared by two line segments will only be drawn once instead of +twice.
    +
    +

    4.2.1 Line Width

    +The width of lines can be controlled by
    +
    +
    void glLineWidth(GLfloatwidth)
    +
    +
    +where width is the line width +in pixels.  The width defaults to 1.0.  Attempting to set the +width to a value less than or equal to zero will raise the error +GL_INVALID_VALUE.
    +
    +

    4.2.2 Line Stipple
    +

    +Lines may be stippled (i.e. dashed) with the command
    +
    +
    glLineStipple(GLintfactor, GLushort pattern)
    +
    +
    +pattern describes an on/off +pattern for the fragments produced by rasterization and factor specifies how many subsequent +fragments are kept or culled for each pattern bit.  Line stippling +can be enabled or disabled by the commands glEnable(GL_LINE_STIPPLE) and glDisable(GL_LINE_STIPPLE).
    +
    +

    4.2.3 Line Antialiasing

    +Lines may be antialiased.  For antialiased lines, each fragment +produced by rasterization is assigned a coverage value which describes how +much of the fragment's area is considered to be inside the line.  Later, the +alpha value of each fragment is multiplied by the coverage value. + By blending the fragments into the frame buffer, the edges of +lines appear smoothed.
    +
    +Line antialiasing can be enabled or disabled with the commands glEnable(GL_LINE_SMOOTH) and glDisable(GL_LINE_SMOOTH).
    +
    +

    4.3 Polygon Rasterization

    +Polygons, quadrilaterals and triangles share the same polygon +rasterization options.
    +
    +Triangles are rendered by the command sequence glBegin(mode),glVertex, glVertex, ... glEnd where mode may be one of GL_TRIANGLES, +GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN. + For GL_TRIANGLES mode, the number of vertices should be a multiple +of three - extra vertices will be ignored.  For GL_TRIANGLE_STRIP +and GL_TRIANGLE_FAN, at least three vertices should be specified. + If less than three are specified, nothing is drawn.  
    +
    +Quadrilaterals are rendered by +the command sequence glBegin(mode),glVertex, glVertex, ... glEnd where mode may be one of GL_QUADS or +GL_QUAD_STRIP.   For +GL_QUADS, the number of vertices should be a multiple of four - extra +vertices will be ignored.  For GL_QUAD_STRIP, the number of +vertices should be even and at least four.  Extra vertices (one) +will be ignored.
    +
    +Convex polygons are rendered +by the command sequence glBegin(GL_POLYGON),glVertex, glVertex, ... glEnd. + If less than three vertices are specified, nothing is drawn.
    +
    +

    4.3.1 Polygon Orientation

    +The winding order of vertices +(clockwise or counter-clockwise) is significant.  It is used to +determine the front-facing or back-facing orientation of polygons. + By default, a front-facing polygon's vertices are in +counter-clockwise order (in window coordinates).  Figures 2.4 and +2.5 of the OpenGL 1.2.1 specification illustrate the winding order for +front-facing triangles and quadrilaterals, respectively.
    +
    +The command
    +
    +
    void glFrontFace(GLenum mode)
    +
    +
    +specifies whether clockwise or counter-clockwise winding indicates a +front-facing polygon.  If mode +is GL_CW then polygons with clockwise winding are front-facing.  If mode is GL_CCW then polygons with +counter-clockwise winding are front-facing.  The default value is +GL_CCW.  If mode is not +GL_CCW or GL_CW then the error GL_INVALID_ENUM will be raised.
    +
    +

    4.3.2 Polygon Culling

    +Polygons may be culled (discarded) depending on whether they are +front-facing or back-facing.  The command
    +
    +
    void +glCullFace(GLenum mode)
    +
    +
    +specifies whether front-facing, back-facing or all polygons should be +culled.  If mode is +GL_FRONT then front-facing polygons will be culled.  If mode is GL_BACK then back-facing +polygons will be culled. Otherwise, if mode +is GL_FRONT_AND_BACK then all polygons will be culled.  Any other +value for mode will raise the +error GL_INVALID_ENUM.
    +
    +Polygon culling is enabled and disabled with the commands glEnable(GL_CULL_FACE) and glDisable(GL_CULL_FACE), +respectively.
    +
    +

    4.3.3 Polygon Antialiasing

    +Polygons may be antialiased in order to smooth their edges. + Polygon antialiasing is enabled and disabled with the commands glEnable(GL_POLYGON_SMOOTH) and glDisable(GL_POLYGON_SMOOTH).
    +
    +When polygon antialiasing is enabled each fragment produced by polygon, +triangle and quadrilateral rasterization will be given a coverage value which indicates how +much of the fragment is covered by the polygon.  Fragments +completely inside the polygon have coverage 1.0.  Fragments +completely outside the polygon have zero coverage (in theory). + Fragments which intersect the polygon's edge have a coverage value +in the range (0, 1).
    +
    +The fragment's alpha value is multiplied by the coverage value. + By enabling the appropriate blending mode, polygon edges will +appear smoothed.
    +
    +

    4.4 Shading

    +The command
    +
    +
    void glShadeModel(GLenummode)
    +
    +
    +determines whether colors are interpolated between vertices during +rasterization.  If mode is +GL_FLAT then vertex colors are not interpolated.  The color used +for drawing lines, triangles and quadrilaterals is that of the last +vertex used to specify each primitive.  For polygons, the color of +the first vertex specifies the color for the entire polygon.  If mode is GL_SMOOTH then vertex colors +are linearly interpolated to produce the fragment colors.
    +
    +

    4.5 Bitmap Rasterization

    +A bitmap is a monochromatic, binary image in which each image element +(or pixel) is represented by one bit.  Fragments are only generated +for the bits (pixels) which are set.  Bitmaps are commonly used to +draw text (glyphs) and markers.
    +
    +A bitmap is drawn with the command
    +
    +
    void glBitmap(GLsizeiwidth, GLsizei height, GLfloat xOrig, GLfloat yOrig, GLfloat xMove, GLfloat yMove, const  GLubyte *image)
    +
    +
    +width and height specify the image size in +pixels.  xOrig and yOrig specify the bitmap origin. + xMove and yMove are added to the current +raster position after the bitmap is rasterized.  image is a pointer to the bitmap +data.
    +
    +If the current raster position is not valid, glBitmap has no effect.
    +
    +

    4.5.1 Bitmap Unpacking

    +The first step in bitmap rendering is unpacking. + Unpacking is the process of extracting image data from +client memory subject to byte swapping, non-default row strides, etc. + The unpacking parameters are specified with the command
    +
    +
    void +glPixelStorei(GLenum pname, GLint value)
    +
    +
    +The following unpacking parameters may be set:
    +
    + + + + + + + + + + + + + + + + + + +
    Parameter (pname)
    +
    Value (value)
    +
    Default
    +
    GL_UNPACK_ROW_LENGTH
    +
    Width of the image in memory, in +pixels.
    +
    0
    +
    GL_UNPACK_LSB_FIRST
    +
    GL_FALSE indicates that the most +significant bit is unpacked first from each byte.  GL_TRUE +indicates that the least significant bit is unpacked first from each +byte.
    +
    GL_FALSE
    +
    +
    +
    +The GL_UNPACK_ROW_LENGTH specifies the stride (in pixels) for advancing +from one row of the image to the next.  If it's zero, the width parameter to glBitmap specifies the width of the +image in memory.
    +
    +GL_UNPACK_LSB_FIRST determines whether the least significant or most +significant bit in each byte is unpacked first.  Unpacking occurs +in left to right order (in image space).
    +
    +The value of bit (i, j) of the image (where i is the image row and j is +the image column) is found as follows:
    +
    +
    rowLength = (GL_UNPACK_ROW_LENGTH != 0) +? GL_UNPACK_ROW_LENGTH : width;
    +
    +byte = image[((rowLength + 7) +/ 8) * i + j / 8];
    +
    +if (GL_UNPACK_LSB_FIRST != 0)
    +    bitMask = 1 << (j % 8);
    +else
    +    bitMask = 128 >> (j % 8);
    +
    +if (byte & bitMask)
    +    bit = 1;
    +else
    +    bit = 0;
    +
    +
    + +

    4.5.2 Rasterization

    +If the current raster position is (xrp, yrp, zrp, +wrp), then the bitmap is rasterized according to the +following algorithm:
    +
    +for (j = 0; j < height; +j++) {
    +    for (i = 0; i < width; +i++) {
    +        if (bit(i,j)) {
    +            fragment.x = +floor(xrp - xOrig) ++ i;
    +            fragment.y = +floor(yrp - yOrig) ++ j;
    +            fragment.color += GL_CURRENT_RASTER_COLOR;
    +            +fragment.texture = GL_CURRENT_RASTER_TEXTURE_COORDS;
    +            +ProcessFragment(fragment)
    +         }
    +    }
    +}
    +
    +After the bitmap has been rendered the current raster position is +updated as follows:
    +
    +
    xrp = xrp + xMove
    +yrp = yrp + yMove
    +
    +
    +

    4.5.3 Per-fragment Operations

    +XXX supported?  See issue in appendix A.
    +
    +

    4.6 Unsupported Commands

    +The following commands related to rasterization are not supported by +the subset.
    +
    +
    Point commands:
    +
    glPointSize
    +
    +
    +Polygon commands:
    +
    glPolygonStipple
    +glPolygonOffset
    +glPolygonMode
    +
    +
    +
    +
    Pixel storage commands:
    +
    +
    glPixelStoref
    +
    +
    +
    +

    5. Texture Mapping
    +

    +There are four elements to texture mapping: texture coordinate +specification, texture image specification, texture sampling and texture +application.
    +
    +Texture mapping is enabled and disabled with the commands glEnable(GL_TEXTURE_2D) and glDisable(GL_TEXTURE_2D).
    +
    +

    5.1 Texture Image Specification

    +A texture image is specified with the command:
    +
    +
    void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
    +
    +
    +target must be GL_TEXTURE_2D. + level indicates the +mipmap level for mipmap textures.  internalFormat +is a hint to indicate the preferred internal storage format for the +texture.  width and height indicate the image size in +pixels (or texels).  border must +be zero.  format and type describe the pixel format and +data type for the incoming image.  pixels +points to the incoming texture image.  These parameters are +described in more detail below.
    +
    +

    5.1.1 Texture Image Size and Mipmaps

    +

    +Texture images must have dimensions (width and height) that are powers +of two. For example: 256 x 256, 32 x 1024, 1 x 8, etc.  That is, it +must be the case that width = +2n and height = 2m +for some positive integers n and m.
    +
    +Mipmapping is a method of antialiasing or filtering textures to improve +their appearance.  A mipmap is a set of images consisting of a base +image and a set of filtered, reduced-resolution images.  If the +base image (level=0) is of +width 2n and height 2m then the level 1 image must +be of width 2n-1 and height 2m-1.  Each mipmap +level is half the width and height of the previous level, or at least +one.  The last mipmap level has a width and height of one.
    +
    +The following is an example of a mipmap's image levels:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    mipmap level
    +
    width
    +
    height
    +
    0
    +
    256
    +
    64
    +
    1
    +
    128
    +
    32
    +
    2
    +
    64
    +
    16
    +
    3
    +
    32
    +
    8
    +
    4
    +
    16
    +
    4
    +
    5
    +
    8
    +
    2
    +
    6
    +
    4
    +
    1
    +
    7
    +
    2
    +
    1
    +
    8
    +
    1
    +
    1
    +
    +
    +If the width or height parameters are not powers of +two, the error GL_INVALID_VALUE is raised.  If the image levels in +a mipmap do not satisfy the restrictions listed above the texture is +considered to be inconsistent +and the system will behave as if the texturing is disabled.
    +
    +

    5.1.2 Texture Image Formats and Unpacking

    +The glTexImage2D command's format and type parameters describe the format +of the incoming texture image.  Accepted values for format are GL_INTENSITY, GL_RGB and +GL_RGBA.  The type +parameter must be GL_UNSIGNED_BYTE.  Pixel component values are +thus in the range 0 through 255.
    +
    +If format is GL_INTENSITY then +the image has one byte per pixel which specifies the pixel's red, green, +blue and alpha values.
    +
    +If format is GL_RGB then the +image has three bytes per pixel which specify the pixel's red, green and +blue values (in that order).  The alpha value defaults to 255.
    +
    +If format is GL_RGBA then the +image has four bytes per pixel which specify the pixel's red, green, +blue and alpha values (in that order).
    +
    +The command
    +
    +
    void +glPixelStorei(GLenum pname, +GLint value)
    +
    +
    +controls the unpacking of texture image data from client memory.  pname may be GL_UNPACK_ROW_LENGTH to +indicate the stride, in pixels, between subsequent rows of the image in +client memory.  If GL_UNPACK_ROW_LENGTH is zero (the default) then +the width parameter to glTexImage2D determines the stride.
    +
    +

    5.1.3 Internal Texture Format

    +glTexImage2D converts the incoming +texture image to one of the supported internal texture formats.
    +
    +The internalFormat parameter +indicates the desired internal format for the texture and may be either +GL_INTENSITY8, GL_RGB5 or GL_RGBA8.
    +
    +If internalFormat is +GL_INTENSITY8 then the texture has one byte per texel (texture element) +which indicates the texel's intensity (or brightness).  The +intensity is obtained from the incoming image's red channel.
    +
    +If internalFormat is GL_RGB5 +then the texture is stored with two bytes per texel:  5 bits per +red value, 5 bits per green value and 5 bits per blue value.
    +
    +If internalFormat is +GL_RGBA8 then the texture is stored with four bytes per texel:  8 +bits for each of the red, green,  blue and alpha values.
    +
    +The internal format is also significant to texture application (see +section 5.4).
    +
    +

    5.2 Texture Coordinates

    +Texture coordinates control the mapping from local polygon space to +texture image space.  Texture coordinates are set for each vertex +with the glTexCoord commands. + During line and polygon rasterization the vertex's texture +coordinates are interpolated across the primitive to produce a texture +coordinate for each fragment.  The fragment texture coordinates are +used to sample the current texture image.
    +
    +Texture coordinates are normally in the range [0, 1].  Values +outside that range are processed according to the texture wrap mode.  The +texture wrap mode is set with the command
    +
    +
    void glTexParameteri(GLenum target, GLenum pname, GLint value)
    +
    +
    +target must be GL_TEXTURE_2D. + If pname is +GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T then value must be either +GL_CLAMP_TO_EDGE or GL_REPEAT.
    +
    +For GL_CLAMP_TO_EDGE, texture coordinates are effectively clamped to +the interval [0, 1].
    +
    +For GL_REPEAT, the integer part of texture coordinates is ignored; only +the fractional part of the texture coordinates is used.  This +allows texture images to repeated or tiled across an object.
    +
    +

    5.3 Texture Sampling

    +Texture sampling is the process of using texture coordinates to extract +a color from the texture image.  Multiple, weighted samples may be +taken from the texture and combined during the filtering step.
    +
    +During texture coordinate interpolation a level of detail value (lambda) is +computed for each fragment.  For a mipmapped texture, lambda +determines which level (or levels) of the mipmap will be sampled to +obtain the texture color.
    +
    +If lambda indicates that multiple texels map to a single screen pixel, +then the texture minification +filter will be used.  Otherwise, if lambda indicates that a single +texel maps to multiple screen pixels, then the texture magnification filter will be used.
    +
    +

    5.3.1 Texture Minification

    +The texture minification filter is set with the glTexParameteri command by setting target to GL_TEXTURE_2D, setting pname to GL_TEXTURE_MIN_FILTER and +setting value to GL_NEAREST, +GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST,  +GL_NEAREST_MIPMAP_LINEAR,   GL_LINEAR_MIPMAP_NEAREST or +GL_LINEAR_MIPMAP_LINEAR.
    +
    +GL_NEAREST samples the texel nearest the texture coordinate in the +level 0 texture image.
    +
    +GL_LINEAR samples the four texels around the texture coordinate in the +level 0 texture image.  The four texels are linearly weighted to +compute the final texel value.
    +
    +GL_NEAREST_MIPMAP_NEAREST samples the texel nearest the texture +coordinate in the level N texture image.  N is the level of detail +and is computed by the partial derivatives of the texture coordinates +with respect to the window coordinates.
    +
    +GL_NEAREST_MIPMAP_LINEAR samples two texels nearest the texture +coordinates in the level N and N+1 texture images.  The two texels +are linearly weighted to compute the final texel value.  N is the +level of detail and is computed by the partial derivatives of the +texture coordinates with respect to the window coordinates.
    +
    +GL_LINEAR_MIPMAP_NEAREST samples four texels around the texture +coordinate in the level N texture image.  The four texels are +linearly weighted to compute the final texel value.  N is the level +of detail and is computed by the partial derivatives of the texture +coordinates with respect to the window coordinates.
    +
    +GL_LINEAR_MIPMAP_LINEAR samples four texels around the texture +coordinate in the level N texture image and four texels around the +texture coordinate in the level N+1 texture image.  The eight +texels are linearly weighted to compute the final texel value.  N +is the level of detail and is computed by the partial derivatives of the +texture coordinates with respect to the window coordinates.
    +
    +Filter modes other than GL_LINEAR and GL_NEAREST requires that the +texture have a complete set of mipmaps.  If the mipmap is +incomplete, it is as if texturing is disabled.

    +

    5.3.2 Texture Magnification

    +The texture magnification filter is set with the glTexParameteri command +by setting target to +GL_TEXTURE_2D, setting pname to +GL_TEXTURE_MAG_FILTER and setting value +to GL_NEAREST or GL_LINEAR.
    +
    +GL_NEAREST samples the texel nearest the texture coordinate in the +level 0 texture image.
    +
    +GL_LINEAR samples the four texels around the texture coordinate in the +level 0 texture image.  The four texels are linearly weighted to +compute the final texel value.
    +
    +

    5.4 Texture Application

    +The sampled texture value is combined with the incoming fragment color +to produce a new fragment color.  The fragment and texture colors +are combined according to the texture environment mode and the current +texture's base internal format.  The texture environment mode is +set with the command
    +
    +
    void +glTexEnvi(GLenum target, +GLenum pname, GLint value)
    +
    +
    +target must be GL_TEXTURE_ENV. + If pname is +GL_TEXTURE_ENV_MODE then value +must be one of GL_REPLACE, GL_MODULATE, GL_DECAL, or GL_BLEND.
    +
    +There is also a texture environment +color that can factor into texture application.  The texture +environment color can be set with the command
    +
    +
    void +glTexEnvfv(GLenum target, +GLenum pname, const GLfloat *value)
    +
    +
    +target must be GL_TEXTURE_ENV. + If pname is +GL_TEXTURE_ENV_COLOR then value must +point to an array of four values which specify the red, green, blue, +and alpha values of the texture environment color.  The values are +clamped to the range [0, 1].  The default color is (0, 0, 0, 0).
    +
    +The following table describes the arithmetic used for each combination +of environment mode and base internal format.  (Rf, Gf, Bf, Af) is +the incoming fragment color.  (Rt, Gt, Bt, At) is the sampled +texture color.  Lt is the sampled texture luminance.  'It' is the sampled texture +intensity.  (Rc, Gc, Bc, Ac) is the texture environment color. + (Rv, Gv, Bv, Av) is the resulting value.
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Base Internal Format
    +
    GL_REPLACE
    +
    GL_MODULATE
    +
    GL_DECAL
    +
    GL_BLEND
    +
    GL_INTENSITY
    +
    Rv = It
    +Gv = It
    +Bv = It
    +Bf = It
    +
    Rv = Rf * It
    +Gv = Gf * It
    +Bv = Bf * It
    +Av = Af * It
    undefined
    +
    Rv = Rf*(1-It) + Rc*It
    +Gv = Gf*(1-It) + Gc*It
    +Bv = Bf*(1-It) + Bc*It
    +Av = Af*(1-It) + Ac*It
    GL_RGB
    +
    Rv = Rt
    +Gv = Gt
    +Bv = Bt
    +Av = Af
    +
    Rv = Rf * Rt
    +Gv = Gf * Gt
    +Bv = Bf * Bt
    +Av = Af
    +
    Rv = Rt
    +Gv = Gt
    +Bv = Bt
    +Av = Af
    Rv = Rf*(1-Rt) + Rc*Rt
    +Gv = Gf*(1-Gt) + Gc*Gt
    +Bv = Bf*(1-Bt) + Bc*Bt
    +Av = Af
    GL_RGBA
    +
    Rv = Rt
    +Gv = Gt
    +Bv = Bt
    +Av = At
    +
    Rv = Rf * Rt
    +Gv = Gf * Gt
    +Bv = Bf * Bt
    +Av = Af * At
    Rv = Rf*(1-At) + Rt*At
    +Gv = Gf*(1-At) + Gt*At
    +Bv = Bf*(1-At) + Bt*At
    +Av = Af
    +
    Rv = Rf*(1-Rt) + Rc*Rt
    +Gv = Gf*(1-Gt) + Gc*Gt
    +Bv = Bf*(1-Bt) + Bc*Bt
    +Av = Af*At
    +
    +
    +
    +

    5.5 Texture Objects

    +Texture objects encapsulate a set of texture images (mipmap) and +related state into a named object.  This facilitates use of +multiple textures in an application.  Texture objects are named +with GLuints (unsigned integers).  There is a default texture +object with the name/identifier zero which can never be deleted.
    +
    +

    5.5.1 Creating Texture Objects

    +A texture object is created by binding a new GLuint identifier to the +GL_TEXTURE_2D target with the command:
    +
    +
    void glBindTexture(GLenum target, GLuint textureID)
    +
    +
    +target must be GL_TEXTURE_2D. + textureID may be any +unsigned integer.  If textureID +does not name an existing texture object, a new texture object with that +ID will be created, initialized to the default state.  Whether the +ID is new or existed previously, that named texture object is bound as +the current texture object. + Subsequent glTexParameter andglTexImage2D calls will effect the +current texture object.
    +
    +

    5.5.2 Deleting Texture Objects

    +One or more texture objects may be deleted with the command:
    +
    +
    void glDeleteTextures(GLsizein, const GLuint *textureIDs)
    +
    +
    +textureIDs is an array of n texture IDs.  The named +texture objects will be deleted.  If the current texture object is +deleted the default texture object (number 0) will be bound as the +current texture object.
    +
    +

    5.5.3 Allocating Texture Object Identifiers

    +A list of new, unused texture IDs can be obtained by calling the command
    +
    +
    void glGenTextures(GLsizei n, GLuint *textureIDs)
    +
    +
    +An array of n unused texture +IDs will be returned in the textureIDs +array.
    +
    +
    +

    6. Per-fragment Operations

    +The fragments produced by rasterization are subjected to a number of +operations which either modify the fragment or test the fragment +(discarding the fragment if the test fails.)  This chapter +describes the per-fragment operations.  They are presented in the +order in which they're performed.  If a fragment fails a test it is +discarded and not subjected to subsequent tests or modifications.
    +
    +

    6.1 Scissor Test

    +The scissor test limits rendering to a 2-D rectangular region of the +framebuffer.  The command
    +
    +
    void glScissor(GLintx, GLint y, GLsizei width, GLsizei height)
    +
    +
    +defines a clipping region with the lower-left corner at (x, y) and the given width and height.  The scissor test is +enabled and disabled with the command glEnable(GL_SCISSOR_TEST) +and glDisable(GL_SCISSOR_TEST).
    +
    +If the incoming fragment's position is (xf, yf) +then the fragment will pass the test if x <= xf < x + width and y <= yf < y + height.  Otherwise, the +fragment is discarded.
    +
    +If width or height is less than zero the error +GL_INVALID_VALUE is raised.  The default scissor rectangle bounds +are (0, 0, w, h) where w is the initial window width and h is the +initial window height.  The scissor test is disabled by default.
    +
    +

    6.2 Alpha Test

    +The alpha test compares the fragment's alpha value against a reference +value and discards the fragment if the comparison fails.  The test +is specified by the command
    +
    +
    void glAlphaFunc(GLenummode, GLclampf reference)
    +
    +
    +mode specifies an inequality +and reference specifies a value +to compare against.  The following table lists all possible +modes and the +corresponding test:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Comparison mode
    +
    The test passes if
    +
    GL_LESS
    +
    alpha < reference
    +
    GL_LEQUAL
    +
    alpha <= reference
    GL_GREATER
    +
    alpha > reference
    GL_GEQUAL
    +
    alpha >= reference
    GL_EQUAL
    +
    alpha == reference
    GL_NOTEQUAL
    +
    alpha != reference
    GL_NEVER
    +
    never pass
    +
    GL_ALWAYS
    +
    always passes
    +
    +
    +The reference parameter is +clamped to the range [0, 1].
    +
    +The alpha test is enabled and disabled with the commands glEnable(GL_ALPHA_TEST) and glDisable(GL_ALPHA_TEST).
    +
    +The default mode is GL_ALWAYS and the default reference value is 0.
    +
    +

    6.3 Stencil Test

    +The stencil buffer stores an N-bit integer value for each pixel in the +frame buffer.  The stencil test compares the stencil buffer value +at the fragment's position to a reference value and possibly discards +the fragment based on the outcome.  Furthermore, the stencil buffer +value may be updated or modified depending on the outcome.  If +there is no stencil buffer the stencil test is bypassed.
    +
    +Stenciling is controlled by the commands
    +
    +
    void glStencilFunc(GLenumfunc, GLint ref, GLuint mask)
    +void glStencilOp(GLenum stencilFail, GLenum depthTestFail, GLenum depthTestPass)
    +
    +
    +The glStencilFunc command controls the +stencil test while glStencilOp +command controls the how the stencil buffer is updated/modified after +the test.
    +
    +ref is clamped to the range [0, +2N-1] where N is the number of bits per stencil value in the +stencil buffer.
    +
    +The following table lists all possible values for the func parameter and when the stencil +test will pass.  Both the stencil buffer value and the stencil +reference value are bit-wise ANDed with the mask parameter before the test.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Stencil func value
    +
    Stencil test passes if
    +
    GL_LESS
    +
    (ref&mask) < (stencil buffer value +& mask)
    +
    GL_LEQUAL
    +
    (ref +& mask) <= (stencil +buffer value & mask)
    GL_GREATER
    +
    (ref +& mask) > (stencil +buffer value & mask)
    GL_GEQUAL
    +
    (ref +& mask) >= (stencil +buffer value & mask)
    GL_EQUAL
    +
    (ref +& mask) == (stencil +buffer value & mask)
    GL_NOTEQUAL
    +
    (ref +& mask) != (stencil +buffer value & mask)
    GL_NEVER
    +
    never passes
    +
    GL_ALWAYS
    +
    always passes
    +
    +
    +
    +If the stencil test passes, the fragment is passed to the next +per-fragment operation.  Otherwise, if the stencil test fails, the +value in the stencil buffer is updated according to the value of the stencilFail parameter to glStencilOp.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    stencilFail +value
    +
    New stencil buffer value
    +
    GL_KEEP
    +
    originalValue
    +
    GL_ZERO
    +
    0
    +
    GL_INVERT
    +
    BitWiseInvert(originalValue) +i.e. ~originalValue
    +
    GL_REPLACE
    +
    ref
    +
    GL_INCR
    +
    originalValue + 1, clamped to +[0, 2N-1]
    GL_DECR
    +
    originalValue - 1, clamped to +[0, 2N-1]
    +
    +
    +The depthTestFail and depthTestPass parameters to glStencilOp are ignored.  Values +for func and stencilFail other than those listed +in the table will cause the error GL_INVALID_ENUM to be raised.
    +
    +The stencil test is enabled and disabled with the commands glEnable(GL_STENCIL_TEST) and glDisable(GL_STENCIL_TEST).
    +
    +The default stencil function is GL_ALWAYS.  The default stencil +reference value is 0.  The default stencil mask is ~0.  The +default stencil fail operation is GL_KEEP.
    +
    +Values written into the stencil buffer are masked with the command
    +
    +
    void glStencilMask(GLuintmask)
    +
    +
    +Only the bits which are set in mask +will be modified in the stencil buffer when written to.  If each +stencil buffer value has N bits, only the least significant N bits of mask are relevant.  The default +stencil mask is ~0.
    +
    +

    6.4 Blending and Logicop

    +Blending or a logic operation combines the incoming fragment color with +the destination frame buffer color according to a blending equation or +bit-wise Boolean logical operation.
    +
    +Blending is enabled and disabled with the commands glEnable(GL_BLEND) and glDisable(GL_BLEND).
    +
    +The logic operation is enabled and disabled with the commands glEnable(GL_LOGIC_OP) and glDisable(GL_LOGIC_OP).
    +
    +If both blending and the logic operation are enabled, the logic +operation has higher priority; blending is bypassed.
    +
    +

    6.4.1 Logic Op

    +The command
    +
    +
    void glLogicop(GLenummode)
    +
    +
    +Specifies the Boolean logic operation for combining the incoming +fragment color with the destination frame buffer color.  Both the +incoming fragment color and destination frame buffer colors are +interpreted as four-tuples of unsigned integer color components in the +range [0, 2N-1] where N is the number of bits per color +channel.  N may not be the same for all color channels.
    +
    +The following table lists all values for mode and the boolean arithmetic used +to combine the incoming fragment color value (src) with the destination framebuffer +color value (dst).  Standard ANSI C operators used.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LogicOp mode
    +
    Resulting channel value
    +
    GL_CLEAR
    +
    0
    +
    GL_SET
    +
    ~0
    +
    GL_COPY
    +
    src
    +
    GL_COPY_INVERTED
    +
    ~s
    +
    GL_NOOP
    +
    dst
    +
    GL_INVERT
    +
    ~dst
    +
    GL_AND
    +
    src & dst
    +
    GL_NAND
    +
    ~(src & dst)
    +
    GL_AND_REVERSE
    +
    src & ~dst
    +
    GL_AND_INVERTED
    +
    ~src & dst
    +
    GL_OR
    +
    src | dst
    +
    GL_NOR
    +
    ~(src | dst)
    +
    GL_OR_REVERSE
    +
    src | ~dst
    +
    GL_OR_INVERTED
    +
    ~src | dst
    +
    GL_XOR
    +
    src ^ dst
    +
    GL_EQUIV
    +
    ~(src ^ dst)
    +
    +
    +The fragment's color is replaced by the result of the logic operation.
    +
    +Specifying any value for mode +other than those listed in the above table will cause the error +GL_INVALID_ENUM to be raised.
    +
    +The default value for mode is +GL_COPY.  The logic operation is disabled by default.
    +
    +

    6.4.2 Blending

    +The command
    +
    +
    void glBlendFunc(GLenumsrcTerm, GLenum dstTerm)
    +
    +
    +specifies the terms of the blending equation.  If Cf = (Rf, Gf, +Bf, Af) is the incoming fragment color and Cb = (Rb, Gb, Bb, Ab) is the +frame buffer color, then the resulting color Cv = (Rv, Gv, Bv, Av) is +computed by:
    +
    +
    Cv = Cf * srcTerm + Cb * dstTerm
    +
    +
    +All possible values for srcTerm +and the corresponding arithmetic term are listed in the following table:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    srcTerm
    +
    srcTermArithmetic
    +
    GL_ZERO
    +
    (0, 0, 0, 0)
    +
    GL_ONE
    +
    (1, 1, 1, 1)
    +
    GL_DST_COLOR
    +
    (Rb, Gb, Bb, Ab)
    +
    GL_ONE_MINUS_DST_COLOR
    +
    (1-Rb, 1-Gb, 1-Bb, 1-Ab)
    +
    GL_SRC_ALPHA
    +
    (Af, Af, Af, AF)
    +
    GL_ONE_MINUS_SRC_ALPHA
    +
    (1-Af, 1-Af, 1-Af, 1-Af)
    +
    GL_DST_ALPHA
    +
    (Ab, Ab, Ab, Ab)
    +
    GL_ONE_MINUS_DST_ALPHA
    +
    (1-Ab, 1-Ab, 1-Ab, 1-Ab)
    +
    GL_SRC_ALPHA_SATURATE
    +
    (m, m, m, 1) where m = MIN(Af, +1-Ab)
    +
    +
    +All possible values for srcTerm +and the corresponding arithmetic term are listed in the following table:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    dstTerm
    +
    dstTermArithmetic
    +
    GL_ZERO
    +
    (0, 0, 0, 0)
    +
    GL_ONE
    +
    (1, 1, 1, 1)
    +
    GL_SRC_COLOR
    +
    (Rf, Gf, Bf, Af)
    +
    GL_ONE_MINUS_SRC_COLOR
    +
    (1-Rf, 1-Gf, 1-Bf, 1-Af)
    +
    GL_SRC_ALPHA
    +
    (Af, Af, Af, AF)
    +
    GL_ONE_MINUS_SRC_ALPHA
    +
    (1-Af, 1-Af, 1-Af, 1-Af)
    +
    GL_DST_ALPHA
    +
    (Ab, Ab, Ab, Ab)
    +
    GL_ONE_MINUS_DST_ALPHA
    +
    (1-Ab, 1-Ab, 1-Ab, 1-Ab)
    +
    +
    +The fragment's color is replaced by the result of the blending equation.
    +
    +Values for srcTerm and dstTerm other than those listed in +the table will cause the error GL_INVALID_ENUM to be raised.
    +
    +The default value for srcTerm +is GL_ONE.  The default value for dstTerm +is GL_ZERO.  Blending is disabled by default.
    +
    +

    6.5 Color Mask

    +The final fragment color is written into the current color buffer at +the end of the per-fragment operations.  Normally, all color +channels in the frame buffer are replaced with the final fragment color. + However, the command
    +
    +
    void glColorMask(GLbooleanredMask, GLboolean greenMask, GLboolean blueMask, GLboolean alphaMask)
    +
    +
    +allows selective writing to individual color channels.  If redMask is GL_TRUE then writing to +the red color channel is enabled, otherwise it's disabled. + Similarly, the green, blue and alpha channels can also be masked.
    +
    +Initially all four mask values are GL_TRUE.
    +
    +Color masking is not enabled/disabled with the glEnable/glDisable commands.
    +
    +

    7. Frame Buffer Operations

    +The frame buffer is considered to be a two-dimensional array of pixels. + The frame buffer is also organized into layers or logical buffers. + There may be a front color buffer, back color buffer and stencil +buffer.  A double-buffered frame buffer has both a front color +buffer and back color buffer.  A single-buffered framebuffer only +has a front color buffer.  Each pixel in a color buffer has a red, +green and blue value and an optional alpha value.
    +
    +

    7.1 Clearing Buffers

    +Buffers are cleared (set to uniform values) with the command
    +
    +
    void glClear(GLbitfieldbuffers)
    +
    +
    +buffers is a bitmask for which +the value may be the bitwise-OR of the values GL_COLOR_BUFFER_BIT and +GL_STENCIL_BUFFER_BIT.  If the GL_COLOR_BUFFER_BIT bit is +specified, the current color buffer will be cleared.  If the +GL_STENCIL_BUFFER_BIT bit is specified, the stencil buffer will be +cleared.
    +
    +The current color buffer is specified with the command
    +
    +
    void glDrawBuffer(GLenum buffer)
    +
    +
    +buffer may be either GL_FRONT, +GL_BACK or GL_NONE.  GL_FRONT indicates that the front color buffer +will be modified by glClear and +any drawing command.  GL_BACK indicates that the back color buffer +will be modified by glClear and +any drawing command.  GL_NONE indicates that neither color buffer +will be modified by glClear or +any drawing command.  GL_BACK is only valid for double-buffered +frame buffers.
    +
    +The current scissor rectangle, set by the glScissor command, effects glClear, limiting +the clear to the scissor rectangle, if it's enabled.  Furthermore, only the color channels enabled by glColorMask will be effected by glClear(GL_COLOR_BUFFER_BIT). + Likewise, only the stencil bits enabled by glStencilMask will be effected by glClear(GL_STENCIL_BUFFER_BIT).
    +
    +The current clear color is set with the command
    +
    +
    void glClearColor(GLclampfred, GLclampf green, GLclampf blue, GLclampf alpha)
    +
    +
    +Subsequent calls to glClear +will use the color (red, green, blue, +alpha) to clear the front or back color buffers.
    +
    +The current stencil clear value is set with the command
    +
    +
    void glClearStencil(GLintclearValue)
    +
    +
    +If the stencil buffer is N bits deep, the least significant N bits of clearValue will be used to clear the +stencil buffer.
    +
    +
    +

    8. Other Features

    +

    8.1 Frame Buffer Readback

    +A rectangular region of pixels can be read from the frame buffer and +placed in client memory with the command
    +
    +
    void glReadPixels(GLintx, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *data)
    +
    +
    +x and y specify the coordinate of the +lower-left corner of the region to read and width and height specify the size of the +rectangular region to read.  format +specifies the format of image data and must be either GL_RGB or +GL_RGBA.  type specify the +data type of the image data and must be either GL_UNSIGNED_BYTE or +GL_FLOAT.  Other values for format +or type will cause the error +GL_INVALID_ENUM to be raised.
    +
    +The framebuffer may contain 3-component colors (red, green, blue) or +4-component colors (red, green, blue, alpha).  If an alpha channel +is not present, alpha values default to 1.0.
    +
    +The frame buffer color components (red, green, blue, alpha) are either +converted to 8-bit unsigned integers in the range[0, 255] if type is GL_UNSIGNED_BYTE or +converted to floating point values in the range [0, 1] if type is GL_FLOAT.  The (red, +green, blue, alpha) tuples are then stored as GL_RGB triplets (by +dropping the alpha component) or GL_RGBA quadruples in client memory.
    +
    +Image data is packed into +client memory according to the pixel packing parameters which are set by +the command
    +
    +
    void glPixelStorei(GLenum pname, GLint value)
    +
    +
    +pname must be +GL_PACK_ROW_LENGTH.  value +indicates the stride (in pixels) between subsequent rows in the +destination image.  If GL_PACK_ROW_LENGTH is zero (the default) +then the width parameter to glReadPixels indicates the row stride.
    +
    +Pixel readback takes place as follows:
    +
    +
    if (GL_PACK_ROW_LENGTH == 0)
    +    rowLength = width;
    +else
    +    rowLength = GL_PACK_ROW_LENGTH
    +
    +if (format == GL_RGB) {
    +    for (i = 0; i < height; +i++) {
    +        for (j = 0; j < width; j++) {
    +            k = (i * +rowLength + j) * 3;
    +            data[k+0] = FrameBuffer(x + j, y + i).red;
    +            data[k+1] = FrameBuffer(x + j, y + i).green;
    +            data[k+2] = FrameBuffer(x + j, y + i).blue;
    +        }
    +    }
    +}
    +else {
    +    for (i = 0; i < height; +i++) {
    +        for (j = 0; j < width; j++) {
    +            k = (i * +rowLength + j) * 4;
    +            data[k+0] = FrameBuffer(x + j, y + i).red;
    +            data[k+1] = FrameBuffer(x + j, y + i).green;
    +            data[k+2] = FrameBuffer(x + j, y + i).blue;
    +            data[k+3] = FrameBuffer(x + j, y + i).alpha;
    +        }
    +    }
    +}
    +
    +
    +The function FrameBuffer(c, r) +returns the pixel in the frame buffer at column c of row r.  data is considered to be either a +GLubyte pointer or a GLfloat pointer, depending on the type parameter.  Similarly, the +FrameBuffer function returns either GLubyte values in the range [0, 255] +or GLfloat values in the range [0,1], depending on the type parameter.
    +
    +Pixels may be read from either the front or back color buffer. + The command
    +
    +
    void glReadBuffer(GLenumbuffer)
    +
    +
    +specifies the source for reading images with glReadPixels.  If buffer is GL_FRONT then front color +buffer is the source.  If buffer +is GL_BACK then the back color buffer is the source.  It is illegal +to specify GL_BACK when the color buffer is not double buffered. + Any invalid value for buffer +will raise the error GL_INVALID_ENUM.
    +
    +The default read source is GL_BACK if the frame buffer is double +buffered.  Otherwise, the default read source is GL_FRONT.
    +
    +

    8.2 Selection Mode

    +Selection mode is typically used to implement picking: determining which +primitive(s) are present at particular window positions.  The +command
    +
    +
    GLint glRenderMode(GLenummode)
    +
    +
    +is used to enable selection mode.  If mode is GL_SELECTION the graphics +library is put into selection mode.  If mode is GL_RENDER the graphic +library is put into normal rendering mode.  Any other value for mode will raise the error +GL_INVALID_ENUM.
    +
    +When in selection mode rendering commands will not effect the +framebuffer.  Instead, a record of the primitives that would have +been drawn is placed in the selection buffer.  The selection buffer +is specified with the command
    +
    +
    void glSelectionBuffer(GLsizein, GLuint *buffer)
    +
    +
    +buffer
    is an array of n +unsigned integers.  No more than n +values will be placed in the buffer.
    +
    +The name stack is a stack +(LIFO) of unsigned integer names.  The following commands +manipulate the name stack:
    +
    +
    void glInitNames(void)
    +void glPushName(GLuint name)
    +void glPopName(void)
    +void glLoadName(GLuint name)
    +
    +
    +glInitNames resets the name +stack to an empty state.  glPushName pushes the given name value onto the stack.  glPopName pops the top name from the +stack.  glLoadName replaces the top value on +the stack with the specified name. + Stack underflow and overflow conditions cause the errors +GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW to be raised.
    +
    +While in selection mode, primitives (points, lines, polygons) are +transformed and clip-tested normally.  Primitives which aren't +discarded by clipping cause the hit data to be updated.  The hit +data consists of three pieces of information: a hit flag, a minimum Z +value and a maximum Z value.  First, the hit flag is set. + Then, for each of the primitive's vertices, the vertex Z value is +compared to the minimum and maximum Z values.  The minimum Z value +is updated if the vertex's Z value is less than the minimum Z value. + The maximum Z value is updated if the vertex's Z value is greater +than the maximum Z value.
    +
    +When any of glInitNames, glPushName, glPopName, glLoadName or glRenderMode are called and the hit +flag is set, a hit record is +written to the selection buffer.
    +
    +A hit record consists of a sequence of unsigned integers.  The +first value is the size of the name stack.  The second value is the +minimum Z value multiplied by 232-1.  The third value is +the maximum Z value multiplied by 232-1.  The remaining +values are the values in the name stack, in bottom to top order. + The hit flag is cleared after a hit record is written to the +selection buffer.  Hit records are places sequentially into the +selection buffer until it is full or selection mode is terminated.
    +
    +Selection mode is terminated by calling glRenderMode(GL_RENDER).   The +return value of glRenderMode +will be -1 if the selection buffer overflowed.  Otherwise, the +return value will indicate the number of values written into the +selection buffer.
    +
    +

    8.3 Synchronization

    +The command
    +
    +
    void glFlush(void)
    +
    +
    +makes the graphics library to flush all pending graphics commands. + The command
    +

    +void glFinish(void)
    +
    +
    +makes the graphics library flush the command queue and wait until those +commands are completed.  glFlush +will not return until all previous graphics commands have been fully +completed.
    +
    +These commands are typically used to force completion of rendering to +the front color buffer.  Otherwise, rendering to the front color +buffer may not appear.  The swapbuffers +command (part of the window system binding library) does an implicit +flush before swapping the front and back color buffers.  The glReadPixels command also does an +implicit flush before reading pixel data from the frame buffer.
    +
    +

    9. State Queries

    +The current value of nearly all library state variables can be queried. + This chapter describes the commands used for querying the value of +state variables.
    +
    +

    9.1 General State Queries

    +The command
    +
    +
    void glGetFloatv(GLenumpname, GLfloat *values)
    +
    +
    +returns the value(s) of the state variable specified by pname.  The following table +lists all accepted values for pname +and a description of the value(s).  Specifying any other value for pname causes the error +GL_INVALID_ENUM to be raised.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Variable (pname)
    +
    Number of values
    +
    Value(s) Description
    +
    GL_ALPHA_BITS
    +
    1
    +
    Number of bits per alpha value +in the frame buffer.
    +
    GL_ALPHA_TEST
    +
    1
    +
    Zero if the alpha test is +disabled.
    +One if the alpha test is enabled.
    +
    GL_ALPHA_TEST_FUNC
    +
    1
    +
    The alpha test function.
    +
    GL_BLEND
    +
    1
    +
    Zero if blending is disabled.
    +One if blending is enabled.
    +
    GL_BLEND_DST
    +
    1
    +
    Blend destination function/term.
    +
    GL_BLEND_SRC
    +
    1
    +
    Blend source function/term.
    +
    GL_BLUE_BITS
    +
    1
    +
    Number of bits per blue value in +the frame buffer.
    +
    GL_COLOR_CLEAR_VALUE
    +
    4
    +
    Clear color (red, green, blue, +alpha).
    +
    GL_COLOR_WRITE_MASK
    +
    4
    +
    Color buffer writemask (red, +green, blue, alpha).
    +Zero if writing is disabled.
    +One if writing is enabled.
    +
    GL_CULL_FACE
    +
    1
    +
    Zero if polygon culling is +disabled.
    +One if polygon culling is enabled.
    +
    GL_CULL_FACE_MODE
    +
    1
    +
    Polygon cull mode: GL_FRONT, +GL_BACK or GL_FRONT_AND_BACK.
    +
    GL_CURRENT_COLOR
    +
    4
    +
    Current color (red, green, blue, +alpha).
    +
    GL_CURRENT_RASTER_COLOR
    +
    4
    +
    Current raster position color +(red, green, blue, alpha).
    +
    GL_CURRENT_RASTER_TEXTURE_COORDS
    +
    4
    +
    Current raster position texture +coordinates (s, t, r, q).
    +
    GL_CURRENT_RASTER_POSITION
    +
    4
    +
    Current raster position (x, y, +z, w).
    +
    GL_CURRENT_POSITION_VALID
    +
    1
    +
    Zero if current raster position +is invalid.
    +One if current raster position is valid.
    +
    GL_CURRENT_TEXTURE_COORDS
    +
    4
    +
    Current texture coordinates (s, +t, r, q)
    +
    GL_DOUBLEBUFFER
    +
    1
    +
    Zero if color buffer is +single-buffered.
    +One if color buffer is double-buffered.
    +
    GL_DRAW_BUFFER
    +
    1
    +
    Current color draw buffer: +GL_FRONT or GL_BACK.
    +
    GL_FRONT_FACE1
    +
    Polygon front-face winding: +GL_CW or GL_CCW.
    +
    GL_GREEN_BITS
    +
    1
    +
    Number of bits per green value +in the frame buffer.
    +
    GL_LINE_SMOOTH
    +
    1
    +
    Zero if line smoothing is +disabled.
    +One if line smoothing is enabled.
    +
    GL_LINE_STIPPLE
    +
    1
    +
    Zero if line stippling is +disabled.
    +One if line stippling is enabled.
    +
    GL_LINE_STIPPLE_PATTERN
    +
    1
    +
    Line stipple pattern.
    +
    GL_LINE_STIPPLE_REPEAT
    +
    1
    +
    Line stipple repeat factor.
    +
    GL_LINE_WIDTH
    +
    1
    +
    Line width in pixels.
    +
    GL_LINE_WIDTH_GRANULARITY
    +
    1
    +
    Aliased line width granularity.
    +
    GL_LINE_WIDTH_RANGE
    +
    2
    +
    Minimum and maximum aliased line +widths.
    +
    GL_ALIASED_LINE_WIDTH_RANGE
    +
    2
    +
    Minimum and maximum antialiased +line widths.
    GL_COLOR_LOGIC_OP
    +
    1
    +
    Zero if logicop is disabled.
    +One if logicop is enabled.
    +
    GL_LOGIC_OP_MODE
    +
    1
    +
    Logicop function.
    +
    GL_MATRIX_MODE
    +
    1
    +
    Matrix mode: GL_MODELVIEW or +GL_PROJECTION.
    +
    GL_MAX_MODELVIEW_STACK_DEPTH
    +
    1
    +
    Maximum size of the modelview +matrix stack.
    +
    GL_MAX_NAME_STACK_DEPTH
    +
    1
    +
    Maximum size of the selection +name stack.
    +
    GL_MAX_PROJECTION_STACK_DEPTH
    +
    1
    +
    Maximum size of the projection +matrix stack.
    +
    GL_MAX_TEXTURE_SIZE
    +
    1
    +
    Maximum 2D texture image width +and height.
    +
    GL_MAX_VIEWPORT_DIMS
    +
    2Maximum viewport width and +height in pixels.
    +
    GL_MODELVIEW_MATRIX
    +
    16
    +
    Current/top modelview matrix +values.
    +
    GL_MODELVIEW_MATRIX_STACK_DEPTH
    +
    1
    +
    Current size of the modelview +matrix stack.
    +
    GL_NAME_STACK_DEPTH
    +
    1
    +
    Current size of the selection +name stack.
    +
    GL_PACK_ROW_LENGTH
    +
    1
    +
    Pixel packing row length.
    +
    GL_POLYGON_SMOOTH
    +
    1
    +
    Zero if polygon smoothing is +disabled.
    +One if polygon smoothing is enabled.
    +
    GL_PROJECTION_MATRIX
    +
    16
    +
    Current/top projection matrix +values.
    +
    GL_PROJECTION_STACK_DEPTH
    +
    1
    +
    Current size of projection +matrix stack.
    +
    GL_READ_BUFFER
    +
    1
    +
    Current read buffer: GL_FRONT or +GL_BACK.
    +
    GL_RED_BITS
    +
    1
    +
    Number of bits per red value in +the frame buffer.
    +
    GL_RENDER_MODE
    +
    1
    +
    Current rendering mode: +GL_RENDER or GL_SELECTION.
    +
    GL_RGBA_MODE
    +
    1
    +
    Always one.
    +
    GL_SCISSOR_BOX
    +
    4
    +
    Scissor box (x, y, width, +height).
    +
    GL_SCISSOR_TEST
    +
    1
    +
    Zero if scissor test is disabled.
    +One if scissor test is enabled.
    +
    GL_SELECTION_BUFFER_SIZE
    +
    1
    +
    Size of selection buffer.
    +
    GL_SHADE_MODEL
    +
    1
    +
    Shade model: GL_FLAT or +GL_SMOOTH.
    +
    GL_STENCIL_BITS
    +
    1
    +
    Number of bits per stencil value +in the frame buffer.
    +
    GL_STENCIL_CLEAR_VALUE
    +
    1
    +
    Stencil buffer clear value.
    +
    GL_STENCIL_FAIL
    +
    1
    +
    Stencil fail operation.
    +
    GL_STENCIL_FUNC
    +
    1
    +
    Stencil function.
    +
    GL_STENCIL_REF
    +
    1
    +
    Stencil reference value.
    +
    GL_STENCIL_TEST
    +
    1
    +
    Zero if stencil test is disabled.
    +One if stencil test is enabled.
    +
    GL_STENCIL_VALUE_MASK
    +
    1
    +
    Stencil mask value.
    +
    GL_STENCIL_WRITE_MASK
    +
    1
    +
    Stencil buffer write mask.
    +
    GL_TEXTURE_2D
    +
    1
    +
    Zero if 2D texture mapping is +disabled.
    +One if 2D texture mapping is enabled.
    +
    GL_TEXTURE_BINDING_2D1
    +
    Name of currently bound 2D +texture object.
    +
    GL_TEXTURE_ENV_COLOR
    +
    4
    +
    Texture environment color (red, +green, blue, alpha).
    +
    GL_TEXTURE_ENV_MODE
    +
    1
    +
    Texture environment mode.
    +
    GL_UNPACK_ROW_LENGTH
    +
    1
    +
    Pixel unpacking row length.
    +
    GL_UNPACK_LSB_FIRST
    +
    1
    +
    Zero if most significant bit is +unpacked first for bitmaps.
    +One if least significant bit is unpacked first for bitmaps.
    +
    GL_VIEWPORT
    +
    4
    +
    Current viewport (x, y, width, +height).
    +
    +
    +
    +

    9.2 String Queries

    +The command
    +
    +
    const GLubyte *glGetString(GLenum name)
    +
    +
    +is used to query string-valued values.  The legal values for name are described in the following +table:
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    name
    +
    Return value
    +
    GL_VERSION
    +
    The library version, such as +"1.2".
    +
    GL_RENDERER
    +
    The renderer, such as "Mesa DRI +Radeon".
    +
    GL_VENDOR
    +
    The vendor of this +implementation, such as "Tungsten Graphics, Inc."
    +
    GL_EXTENSIONS
    +
    A white-space separated list of +the supported extensions.
    +
    +

    9.3 Error Queries

    +The command
    +
    +
    GLenum glGetError(void)
    +
    +
    +returns the current error code.  The current error code will be +set by a GL command when an error condition has been detected.  If +the current error code is already set, subsequent errors will not be +recorded.  The error code is reset/cleared to GL_NO_ERROR when glGetError returns.  The +following error codes are possible:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Error code
    +
    Meaning
    +
    GL_NO_ERROR
    +
    No error has been recorded.
    +
    GL_INVALID_ENUM
    +
    An enum parameter had an invalid +value.
    +
    GL_INVALID_VALUE
    +
    A numeric parameter had an +invalid value.
    +
    GL_INVALID_OPERATION
    +
    A function was called when not +legal to do so.
    +
    GL_STACK_OVERFLOW
    +
    The current transformation +matrix stack is full.
    +
    GL_STACK_UNDERFLOW
    +
    The current transformation +matrix stack is empty.
    +
    GL_OUT_OF_MEMORY
    +
    The system ran out of dynamic +memory.
    +
    +
    +
    +

    10. Unsupported Features

    +This section lists other features and functions which are not supported +and not previously discussed.
    +
    +

    10.1 Feedback Mode

    +Feedback mode and the following related functions are not supported.
    +
    +
    glFeedbackBuffer
    +glPassThrough
    +
    +
    +

    10.2 1D and 3D Textures
    +

    +Only 2D texture images are supported.  The following functions +used to specify 1D and 3D texture images are not supported:
    +
    +
    glTexImage1D
    +glTexImage3D
    +glTexSubImage1D
    + glTexSubImage3D
    +glCopyTexImage1D
    + glCopyTexSubImage1D
    + glCopyTexSubImage3D
    +
    +
    +

    10.3 Alternate Texture Image Commands
    +

    +Texture images may only be specified with glTexImage2D.  The following +alternate texture image commands are not supported:
    +
    +
    glTexSubImage2D
    +glCopyTexImage2D
    +glCopyTexSubImage2D
    +
    +
    +

    10.4 Proxy Textures

    +Proxy textures are not supported and the GL_PROXY_TEXTURE_2D token is +not supported by any function.
    +
    +
    +

    10.5 Other Texture Commands

    +The following commands related to texture mapping are not supported by +the subset:
    +
    +
    glPrioritizeTextures
    +glAreTexturesResident
    +glIsTexture
    +glTexEnviv
    +glTexEnvf
    +glTexParameterf
    +glTexParameteriv
    +glTexParameterfv
    +
    +
    +
    +

    10.6 Copy and Draw Pixels
    +

    +The following commands are not supported:
    +
    +
    glDrawPixels
    +glCopyPixels
    +glPixelZoom
    +
    +
    +

    10.7 Color Index Mode
    +

    +Color index mode and the following related commands are not supported:
    +
    + +
    glIndexub
    +
    glIndexi
    +glIndexs
    +glIndexf
    +glIndexd
    +
    glIndexubv
    +
    glIndexiv
    +glIndexsv
    +glIndexfv
    +glIndexdv

    +glIndexMask
    +
    glClearIndex
    +glIndexPointer

    +
    +
    +

    10.8 Pixel Transfer Operations

    +The pixel transfer operations (scale, bias, look-up table, etc) are not +supported and the following commands are omitted:
    +
    +
    glPixelTransferf
    +glPixelTransferi
    +glPixelMapfv
    +glPixelMapuiv
    +glPixelMapusv
    +glGetPixelMapfv
    +glGetPixelMapuiv
    +glGetPixelMapusv
    +
    +
    +

    10.9 Hints

    +Hints and the following related command is not supported:
    +
    +
    glHint
    +

    +
    +

    10.10 State Query Commands
    +

    +The following state query commands are not supported:
    +
    +
    glGetBooleanv
    +glGetIntegerv
    +glGetDoublev
    +glGetPointerv
    +glGetTexEnvi
    +glGetTexEnvf
    +glGetTexParameteriv
    +glGetTexParameterfv
    +glGetTexLevelParameteriv
    +glGetTexLevelParameterfv
    +glGetTexImage
    +glGetClipPlane
    +
    +
    +

    10.11 Attribute Stacks

    +State attribute stacks and the following related commands are not +supported:
    +
    +
    glPushAttrib
    +glPopAtttrib
    +
    +
    +

    10.12 Double-Valued Functions

    +All functions which take double-precision floating point values, but +for which there is an equivalent single-precision valued function, are +omitted.  This includes, but is not limited to:
    +
    +
    glVertex2d
    +glVertex2dv
    +glVertex3d
    + glVertex3dv
    +glVertex4d
    + glVertex4dv
    +glColor3d
    +glColor3dv
    +glColor4d
    + glColor4dv
    +glTexCoord1d
    +glTexCoord1dv
    +glTexCoord2d
    + glTexCoord2dv
    +glTexCoord3d
    + glTexCoord3dv
    +glTexCoord4d
    + glTexCoord4dv
    +glRasterPos2d
    + glRasterPos2dv
    +glRasterPos3d
    + glRasterPos3dv
    +glRasterPos4d
    + glRasterPos4dv
    +glLoadMatrixd
    +glMultMatrixd
    +glScaled
    +glRotated
    +glTranslated
    +glRectd
    +glRectdv
    +

    +
    +

    10.13 Evaluators

    +Evaluators and the following related commands are not supported:
    +
    +
    glMap1f
    +glMap2d
    +glMap2f
    +glGetMapdv
    +glGetMapfv
    +glGetMapiv
    +glEvalCoord1d
    +glEvalCoord1f
    +glEvalCoord1dv
    +glEvalCoord1fv
    +glEvalCoord2d
    +glEvalCoord2f
    +glEvalCoord2dv
    +glEvalCoord2fv
    +glMapGrid1d
    +glMapGrid1f
    +glMapGrid2d
    +glMapGrid2f
    +glEvalPoint1
    +glEvalPoint2
    +glEvalMesh1
    +glEvalMesh2
    +
    +
    +

    10.14 Display Lists

    +Display lists and the following related commands are not supported:
    +
    +
    glIsList
    +glDeleteLists
    +glGenLists
    +glNewList
    +glEndList
    +glCallList
    +glCallLists
    +glListBase
    +
    +
    +

    10.15 Accumulation Buffer

    +The accumulation buffer and the following related commands are not +supported:
    +
    +
    glAccum
    +glClearAccum
    +
    +
    +

    10.16 Fog

    +Fog and the following related commands are not supported:
    +
    +
    glFogi
    +glFogf
    +glFogiv
    +glFogfv
    +
    +
    +

    10.17 Depth Test

    +Depth testing and the following related commands are not supported:
    +
    +
    glDepthFunc
    +glDepthMask
    +glDepthRange
    +glClearDepth
    +
    +
    +

    10.18 Imaging Subset

    +The OpenGL imaging subset (which implements features such as +convolution, histogram, min/max recording, color matrix and color +tables) is not supported.
    +
    +
    +

    Appendix A: Issues

    +This appendix lists documentation and subset issues with their current +status.  For items which are still open, the documentation (above) +follows the recommended solution.
    +
    +

    A.1 Vertex Arrays

    +Should vertex arrays be supported?  Is there a performance +advantage?
    +
    +RESOLUTION: No, there isn't enough of a performance advantage to +justify them.
    +
    +

    A.2 Polygon Antialiasing and Edge Flags

    +Should edge flags be supported for antialiasing?
    +
    +Edge flags don't effect antialiasing, at least not normally.  A +number of approaches to antialiasing have been summarized in email.
    +
    +RECOMMENDATION: don't support edge flags.  They don't effect +polygon antialiasing.
    +
    +RESOLUTION: closed, as of 26 Feb 2003.
    +
    +

    A.3 glRasterPos vs. glWindowPos

    +Should glRasterPos and/or glWindowPos commands be supported?
    +
    +RESOLUTION: Closed: implement glRasterPos commands, but not glWindowPos +commands.
    +
    +

    A.4 GL_IBM_rasterpos_clip extension

    +Should the GL_IBM_rasterpos_clip extension be implemented?
    +
    +RESOLUTION:  No.  It's not required.
    +
    +

    A.5 Image Formats and Types

    +Which image formats and types should be supported for glTexImage2D and glReadPixels?
    +
    +OpenGL specifies a large +variety of image formats and data types.  Only a few are commonly +used.
    +
    +RECOMMENDATION:  we propose a subset:
    +
    +For glTexImage2D only allow type=GL_UNSIGNED_BYTE and format=GL_RGBA, GL_RGB, +GL_INTENSITY.   Only allow internalFormat +to be GL_RGBA, GL_RGB or GL_INTENSITY as well.  Basically, only +support image formats/types that are directly supported by the Radeon +hardware.  This will allow glTexImage2D +to basically just use memcpy to +copy texture images.
    +
    +For glReadPixels, only allow type = GL_UNSIGNED_BYTE or GL_FLOAT. + Only allow format = +GL_RGB or GL_RGBA.  This is just enough to support the OpenGL +conformance tests.
    +
    +RESOLUTION: open
    +
    +

    A.6 Texture Environment Modes

    +Which texture environment modes should be supported?  OpenGL 1.2 +has GL_REPLACE, GL_MODULATE, GL_DECAL and GL_BLEND.  GL_DECAL isn't +defined for all base internal texture formats.  GL_ADD is another +useful mode.  Perhaps drop GL_DECAL mode and add GL_ADD mode.
    +
    +RECOMMENDATION: implement the standard modes GL_REPLACE, GL_MODULATE, +GL_DECAL and GL_BLEND.
    +
    +RESOLUTION: open
    +
    +

    A.7 Truncated Mipmaps and LOD Control

    +Should we support the GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, +GL_TEXTURE_MIN_LOD and GL_TEXTURE_MAX_LOD texture parameters?
    +
    +RECOMMENDATION:  We propose omitting these features at this time, +in the interest of simplifying the driver.
    +
    +RESOLUTION: open
    +
    +

    A.8 Texture Priorities and Residency

    +Should the subset support texture priorities via glPrioritizeTextures and the glAreTexturesResident command?
    +
    +RECOMMENDATION:  Few applications use these features and +functions.  We propose omitting them to simplify the driver.
    +
    +RESOLUTION: open
    +
    +

    A.9 Pixel Pack/Unpack Alignment Control

    +Should we support the GL_PACK_ALIGNMENT and GL_UNPACK_ALIGNMENT options?
    +
    +These are used to align pixel data addresses to 1, 2 and 4-byte +multiples for glBitmap, glTexImage2D +and glReadPixels.  These +aren't strictly needed since the user can provide a 1, 2 or 4-byte +aligned address and appropriate GL_PACK_ROW_LENGTH or +GL_UNPACK_ROW_LENGTH values instead.
    +
    +RECOMMENDATION:  We recommend omitting them to simplify the driver.
    +
    +RESOLUTION: open
    +
    +

    A.10 Pixel Pack/Unpack Skip Rows/Pixels Control

    +Should we support the GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS, +GL_PACK_SKIP_PIXELS and GL_PACK_SKIP_ROWS options for pixel +unpacking/packing?
    +
    +These options aren't really needed since the user can adjust the start +address and GL_PACK/UNPACK_ROW_LENGTH parameters to achieve the same +effect.
    +
    +RECOMMENDATION:  omit these parameters.
    +
    +RESOLUTION: open
    +
    +

    A.11 Texture State Queries

    +Should we support the command glGetTexEnvi/fv, +glGetTexParameteri/fv and glGetTexLevelParameteri/fv?
    +
    +RECOMMENDATION:  No. They're seldom needed and their +implementation is several hundred lines of code in length.
    +
    +RESOLUTION:  open
    +
    +

    A.12 glGetIntegerv, glGetBooleanv and glGetDoublev

    +Should we support the commands glGetIntegerv, +glGetBooleanv and glGetDoublev +in addition to glGetFloatv?
    +
    +RECOMMENDATION:  Omit the boolean, integer and double-valued +functions. All state values which can be queried by these commands can +be expressed as floating point values and queried with glGetFloatv.  The +implementation of the other three commands involves many lines of code.
    +
    +RESOLUTION:  open
    +
    +

    A.13 glBitmap and Per-Fragment Operations

    +Should bitmaps rendered with glBitmap +be subjected to the per-fragment operations?
    +
    +If bitmaps are implemented with points it will be easy to implement the +per-fragment operations.  Otherwise, it could be difficult.
    +
    +RECOMMENDATION:  Implement glBitmap by drawing points/pixels with +the hardware.  This will make supporting the per-fragments +trivially easy.  Also, it makes portrait-mode display relatively +easy.
    +
    +RESOLUTION:  open
    +
    +

    A.14 Reduced gl.h Header File

    +Should we produce a reduced gl.h header file which only defines the +tokens and functions which are implemented by the subset?
    +
    +RECOMMENDATION: yes.  It would be a useful reference to +programmers to quickly determine which functions and tokens are +supported.
    +
    +RESOLUTION: open
    +
    +

    A.15 glPolygonMode

    +Is glPolygonMode needed?
    +
    +RECOMMENDATION: No.  Omit it.
    +
    +RESOLUTION: closed, as of 26 Feb 2003
    +
    +
    +

    + + diff -Nru xpsb-glx-0.19/mesa/docs/subset.html xpsb-glx-0.19/mesa/docs/subset.html --- xpsb-glx-0.19/mesa/docs/subset.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/subset.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,24 @@ + + +Mesa Subset Driver + + + + + +

    Mesa Subset Driver

    + +

    +In 2002/2003 Tungsten Graphics was contracted to develop a subset Mesa/Radeon +driver for an embedded environment. The result is a reduced-size DRI driver +for the ATI R200 chip, for use with +fbdev/DRI environment. +

    + +

    +The specification for this subset can be found +here. +

    + + + diff -Nru xpsb-glx-0.19/mesa/docs/systems.html xpsb-glx-0.19/mesa/docs/systems.html --- xpsb-glx-0.19/mesa/docs/systems.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/systems.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,71 @@ + + +Supported Systems and Drivers + + + + + +

    Supported Systems and Drivers

    + +

    +Mesa was originally designed for Unix/X11 systems and is still best +supported on those systems. All you need is an ANSI C compiler and the +X development environment to use Mesa. +

    + +

    +The DRI hardware drivers for the X.org server and XFree86 provide +hardware accelerated rendering for chips from ATI, Intel, Matrox, 3dfx +and others on Linux and FreeBSD. +

    + +

    +Drivers for other assorted platforms include: +the Amiga, Apple Macintosh, BeOS, NeXT, OS/2, MS-DOS, VMS, Windows +9x/NT, and Direct3D. +

    + +

    +Details about particular drivers follows: +

    + + + + +

    Deprecated Systems

    + +

    +These drivers have not been maintained and are being deprecated. +They can be saved if someone steps up to help. +

    + + + +And for historical reference: + + + + diff -Nru xpsb-glx-0.19/mesa/docs/thanks.html xpsb-glx-0.19/mesa/docs/thanks.html --- xpsb-glx-0.19/mesa/docs/thanks.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/thanks.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,134 @@ + + + +Acknowledgements + + + + + + +

    Acknowledgments

    + + +The following individuals and groups are to be acknowledged for their +contributions to Mesa over the years. +This list is far from complete and somewhat dated, unfortunately. + + +
      +
    • Early Mesa development was done while Brian was part of the +SSEC Visualization Project at the University of +Wisconsin. He'd like to thank Bill Hibbard for letting him work on +Mesa as part of that project. +
      +
      +
    • John Carmack of id Software, Inc. funded Keith Whitwell in 1999 in +order to optimize Mesa's vertex transformation module. This is a very +substantial piece of work. +
      +
      +
    • Precision Insight, Inc., VA Linux Systems, Inc., and most recently, +Tungsten Graphics, Inc. have supported the ongoing development of Mesa. +
      +
      +
    • The +Mesa +website is hosted by + +Sourceforge.net +
      +
      + +
    • The Mesa git repository is hosted by +freedesktop.org. +
      +
      + + +
    • alt.software contributed the Direct3D driver. + +
    • Bernd Barsuhn wrote the evaluator code for (splines, +patches) in Mesa. + +
    • Bernhard Tschirren wrote the Allegro DJGPP driver. + +
    • Bogdan Sikorski wrote the GLU NURBS and polygon tessellator +in Mesa. + +
    • Charlie Wallace wrote the MS-DOS driver. + +
    • CJ Beyer was the www.mesa3d.org webmaster. + +
    • Darren Abbott provided the OS/2 driver. + +
    • David Bucciarelli wrote and maintained the 3Dfx Glide +driver. Thousands of Linux/Quake players thank David! + +
    • Gareth Hughes wrote new GLU 1.2 Polygon Tessellation code +(now superceded by SGI SI GLU). + +
    • Holger Waechtler contributed AMD 3DNow! assembly code which +accelerates vertex transformation in Mesa 3.1. Holger also implemented +the GL_EXT_texture_env_combine extension. + +
    • Jeroen van der Zijp and Thorsten Ohl contributed the +Xt/Motif widget code. + +
    • John Stone provided the multi-threading support in Mesa 3.0. + +
    • John Watson assisted with web page design. + +
    • Josh Vanderhoof contributed Intel x86 assembly code which +accelerates vertex transformation in Mesa 3.x. + +
    • Jouk Jansen contributed and continues to maintain the VMS +support. + +
    • Karl Schultz has been maintaining the Windows driver. + +
    • Keith Whitwell has made extension contributions to Mesa +since 1999. + +
    • Kendall Bennett wrote the SciTech MGL driver. + +
    • Klaus Niederkrueger contributed many improvements to Mesa's +software rasterizer. + +
    • Mark Kilgard contributed antialiased line improvements and +several extensions. + +
    • Michael Pichler contributed many bug fixes + +
    • Miklos Fazekas wrote and maintains the Macintosh driver. + +
    • Pascal Thibaudeau wrote the NeXT driver. + +
    • Pedro Vazquez setup and maintains the Mesa Mailing list. + +
    • Randy Frank contributed many bug fixes. + +
    • Stefan Zivkovic wrote the Amiga driver. + +
    • Stephane Rehel provided the Cygnus Win32 support + +
    • Ted Jump maintained the +makefiles and project files for Windows 95/98/NT compilation for some time. + +
    • Uwe Maurer wrote the LibGGI driver for Mesa-3.0. + +
    • Victor Ng-Thow-Hing wrote the Amiwin driver for the Amiga. + +
    + +

    +Apologies to anyone who's been omitted. +Please send corrections and additions to Brian. +

    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/utilities.html xpsb-glx-0.19/mesa/docs/utilities.html --- xpsb-glx-0.19/mesa/docs/utilities.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/utilities.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,26 @@ + + +Development Utilities + + + + + +

    Development Utilities

    + +
      + +
    • The Mesa distribution includes several utility routines in the +progs/util/ directory + +
    • Allen Akin's glean is a framework for OpenGL testing. + +
    • Valgrind is a very useful tool for tracking down +memory-related problems in your code. + +
    + + + \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/docs/utility.html xpsb-glx-0.19/mesa/docs/utility.html --- xpsb-glx-0.19/mesa/docs/utility.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/utility.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,44 @@ + + +Utilities + + + + + +

    Utilities

    + + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/VERSIONS xpsb-glx-0.19/mesa/docs/VERSIONS --- xpsb-glx-0.19/mesa/docs/VERSIONS 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/VERSIONS 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1514 @@ + + +Mesa Version History +==================== + +1.0 beta February 1995 + Initial release + +1.1 beta March 4, 1995 + Changes: + faster point and line drawing (2x faster) + more systems supported, better Makefiles + Renamed lib*.a files to avoid collisions + many small bug fixes + New: + pseudo-GLX functions added + new implementation of evaluators (eval2.c) + GLUT support + +1.1.1 beta March 7, 1995 + Changes: + Reverted from eval2.c to eval.c due to FPE on Linux + more speed improvements + more Makefile changes + +1.1.2 beta March 14, 1995 + New: + implementation of SGI's blending extensions + glXUseXFont implemented + added MESA_DEBUG environment variable support + Changes: + Using eval2.c again + more FPE-prevention checks (0-length normals are OK) + a few small bug fixes + much faster pixel logic ops! + faster transformation arithmetic + +1.1.3 beta March 31, 1995 + New: + gluScaleImage() and gluBuild2DMipMaps() implemented + Mesa widgets for Xt/Motif + blendEXT demos + added environment variables for selecting visuals + Changes: + almost all GLUT demos work correctly now + faster X device driver functions + more bug fixes + +1.1.4 beta April 20, 1995 + Bug fixes: + - missing #define SEEK_SET in src-tk/image.c + - compile glShadeModel into display lists + - fixed pow() domain error in src/light.c + - fixed "flickering bitmaps" in double buffer mode + - fixed tk.h and aux.h for C++ + - state of LIGHT_MODEL_LOCAL_VIEWER was inverted + New features: + - MUCH, MUCH nicer dithering in 8-bit RGB mode + - updated widgets and widget demos + - Implemented GLXPixmap functions + - Added GLU 1.1 and GLX 1.1 functions + - Changed the X/Mesa interface API, more versatile + - Implemented gluPartialDisk() + +1.2 May 22, 1995 + Bug fixes: + - IRIX 4.x makefile problem + - modified tk to share root colormap as needed + - gluLookAt normalization problem + - suppress Expose, NoExpose events in swapbuffers + - glBitmap() and glDrawPixels() clipping + New features: + - GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture + modes implemented + - texture maps stored more efficiently + - texture maps can be compiled into display lists + - Bogdan Sikorski's GLU polygon tesselation code + - Linas Vepstas's sweep and extrusion library + - glXCreateContext()'s shareList parameter works as it's supposed to. + XMesaCreateContext() updated to accept a shareList parameter too. + - Mesa can be compiled with real OpenGL .h files + - MESA_BACK_BUFFER environment variable + - better GLX error checking + +1.2.1 June 22, 1995 + Bug fixes: + - X/Mesa double buffer window resize crash + - widgets now pass PointerMotion events + - X/Mesa incorrect default clear color and drawing color + - more robust X MIT-SHM support in X/Mesa + - glTexImage( format=GL_LUMINANCE ) didn't work + - GL_LINE mode polygons with line width > 1.0 could cause a crash + - numerous feedback bugs + - glReadPixels() from depth buffer was wrong + - error prone depth and stencil buffer allocation + New features: + - Preliminary Microsoft Windows driver + - Implemented a number of missing functions: glEvalCoord[12][df]v(), + glGet...(), etc. + - Added a few missing symbols to gl.h and glu.h + - Faster rendering of smooth-shaded, RGBA, depth-buffered polygons. + - Faster rendering of lines when width=2.0 + - Stencil-related functions now work in display lists + Changes: + - renamed aux.h as glaux.h (MS-DOS names can't start with aux) + - most filenames are in 8.3 format to accomodate MS-DOS + - use GLubytes to store arrays of colors instead of GLints + +1.2.2 August 2, 1995 + New features: + - texture mapped points and lines + - NURBS! (but not 100% complete) + - viewports may safely extend beyond window boundaries + - MESA_PRIVATE_CMAP environment variable + - Grayscale X display support + - two new demos: demos/gears.c and demos/shadow.c + - MachTen for Macintosh configuration + Bug fixes: + - glGet*(GL_DEPTH_BITS) returned bytes, not bits + - point, line, and bitmap rasterization suffered from roundoff errors + - fixed a division by zero error in line clippping + - occasional wrong default background color really fixed! + - glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work + - gluBuild2DMipmaps malloc problem fixed + - view volume clipping of smooth shaded lines resulted in bad colors + Changes: + - new visual selection method in glXChooseVisual() + - improved GLU quadric functions + - call XSync for glFinish and XFlush for glFlush + - glVertex() calls now use a function pointer to avoid conditionals + - removed contrib directory from Mesa tar file (available on ftp site) + - AIX shared library support + - Removed GLUenum type as it's not in OpenGL + +1.2.3 September 26, 1995 + New features: + - Mesa header files now equivalent to SGI OpenGL headers + - Support for HP's Color Recovery dithering displays + - Faster vertex transformation + - Faster raster operations into X windows under certain conditions + - New configurations: HP w/ shared libs, Ultrix w/ GCC, Data General + - 4-bit visuals now supported + Bug fixes: + - glScissor bug fixed + - round-off errors in clipping lines against clip planes fixed + - byte swapping between hosts and display servers implemented + - glGetError() can be called without a current rendering context + - problem with accidentally culled polygons is fixed + - fixed some widget compilation problems + +1.2.4 November 17, 1995 + New features: + - More speed improvements (lighting, fogging, polygon drawing) + - Window system and OS-independent off-screen rendering + - Preliminary Fortran bindings + - glPolygonOffsetEXT implemented + - glColorMask and glIndexMask now fully implemented + - glPixelZoom implemented + - display lists fully implemented + - gamma correction + - dithering in 8-bit TrueColor/DirectColor visuals + Changes: + - Improved device driver interface + - tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk + - Dithering support moved from core into device driver + Bug fixes: + - glEnable/Disable( GL_LIGHTING ) didn't always take effect + - glReadPixels byte swapping was broken + - glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken + - duplicate glColor4b() prototype in GL/gl.h removed + - stripes in wave -ci demo fixed + - GL_LINEAR_MIPMAP_NEAREST had wrong value + - bugs in HP Color Recovery support fixed + - fixed bug when blending lines, points, bitmaps outside of window + +1.2.5 November 30, 1995 + New Features: + - updated MS Windows driver + - new implementation of StaticGray/GrayScale visual support + Bug fixes: + - pixelzooming with gamma correction or blending didn't work + - HP color recovery visual wasn't being picked by glXChooseVisual + - glClear didn't always observe glColorMask changes + - olympic and offset demos didn't compile on some Suns + - texcoord clamping wasn't correct + - a polygon optimization introduced an occasional sampling problem + +1.2.6 January 26, 1996 + New Features: + - faster line and polygon rendering under certain conditions. See + Performance Tips 9 and 10 in README + - profiling + - lighting is a bit faster + - better perspective corrected texture mapping + - Amiga AmiWin (X11) support + - preliminary Linux SVGA driver + Changes: + - now using a 16-bit depth buffer, faster, smaller + - GL_NORMALIZE is disabled by default + Bug fixes: + - projective texture mapping + - fixed a memory leak in the context destroy function + - GL_POLYGON with less than 3 vertices caused a crash + - glGet*() returned wrong result for GL_INDEX_MODE + - reading pixels from an unmapped X window caused a BadMatch error + +1.2.7 March 5, 1996 + New: + - faster lighting + - faster 16-bit TrueColor rendering on Linux + - faster 32-bit TrueColor rendering on Linux, HP, IBM + - non-depth-buffered XImage polygons are faster + - vertex array extension + - software alpha planes + - updated Macintosh driver + - new NeXT driver + - GLU quadric functions generate texture coordinates + - reflect.c demo - reflective, textured surface demo + Changes: + - gamma correction code moved into the X driver for better performance + Bug fixes: + - multiple glClipPlane()'s didn't work reliably + - glPolygonMode() didn't always work + - glCullFace( GL_FRONT_AND_BACK ) didn't work + - texture mapping with gamma correction was buggy + - floating point exceptions in texture coordinate interpolation + - XImage byte swapping didn't always work + - polygon edge flags weren't always used correctly + +1.2.8 May 22, 1996 + New: + - overlay planes on X servers with the SERVER_OVERLAY_VISUALS property + - better monochrome output + - more IRIX 6.x configurations + - more robust RGB mode color allocation + - added MESA_XSYNC environment variable + - GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions + - GL_MESA_window_pos extension + - faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT + and GL_UNSIGNED_INT + - driver for prototype Cirrus Mondello 3-D board + - updated AmigaDOS driver + - a few small speed optimizations in polygon rendering + Changes: + - internal device driver interface modified to simplify device + driver implementations and to support hardware Z buffers + - several changes to the X/Mesa interface (xmesa.h) + Bug fixes: + - fixed pow(0,0) domain error triggered on some systems + - glStencilClear() in a display list caused an infinite loop + - glRasterPos*() was sometimes off by +/-0.5 in X and Y + - color masking and blending were performed in wrong order + - auxSolidCylinder() sometimes drew a wire-frame cylinder + - fixed file writing bug in osdemo.c + - pixel mapping didn't always work + - the GL_GEQUAL stencil func didn't work + - the GL_INVERT stencil op didn't work + - the stencil write mask didn't work + - glPush/PopAttrib() didn't do enough error checking + - glIsList() didn't always work correctly + +2.0 October 10, 1996 + New: + - Implements OpenGL 1.1 API functions + - all texture filtering modes supported (mipmapping) + - faster texture mapping, see Performance Tip 11 in README + - antialiased RGB points + - X support for line and polygon stippling + - glDrawBuffer( GL_FRONT_AND_BACK ) works + - util/ directory of useful stuff + - demos/texobj demo of texture objects + Changes: + - major internal changes for thread-safeness + - new device driver interface + - MESA_ALPHA env variable removed + - triangle rasterizer replaces polygon rasterizer + Bug fixes: + - glPopAttrib() bug + - glDrawBuffer(GL_NONE) works now + +2.1 December 14, 1996 + New: + - VMS support + - MS-DOS driver + - OpenStep support + - updated, combined Windows 95/NT driver + - implemented glGetLighti() and glGetTexGen*() + - GLX does garbage collection of ancillary buffers + Bug fixes: + - removed unused _EXT constants from gl.h + - fixed polygon offset bugs + - Z coordinates of clipped lines were incorrect + - glEdgeFlag() in display lists didn't always work + - glLight*() in display lists didn't work + - fixed X line stipple bugs (Michael Pichler) + - glXUseXfonts XFreeFont/XFreeFontInfo bug fixed + - fixed a feedback bug + - glTexGen*() now transforms GL_EYE_PLANE by inverse modelview matrix + - polygons were sometimes culled instead of clipped + - triangle rasterizer suffered from float/int overflow exceptions + - fixed FP underflow exception in lighting (specular exponent) + - glEnable/glDisable of GL_EXT_vertex_array enums didn't work + - fixed free(NULL) in GLU tesselator code + - using 24-bit color on some X servers resulted in garbage rendering + - 32-bit per pixel mode for XFree86 now works + - glRotate(a,0,0,0) gave unpredictable results + - GL_LINE_STRIP with > 480 vertices had occasional clipping problems + - 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap + - glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled + - glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right + - accumulation buffer was limited to positive values + - projective textures didn't work + - selection buffer overflows weren't handled correctly + Changes: + - restored the GL_EXT_polygon_offset extension + - slightly faster RGB dithering + - the SVGA driver works again + - Amiga driver now distributed separately + - NeXT driver updated for Mesa 2.x + +2.2 March 14, 1997 + New: + - better color selection when dithering + - added GL_EXT_texture_object extension + - updated MS-DOS driver for DJGPP + - added openbsd make configuration + - faster dithered flat-shaded triangles + - various compilation problems with Motif widgets fixed + - gl.h, glx.h and glu.h name mangling option + - BeOS driver + - 3D texture mapping extension + - GL_MESA_resize_buffers extension + - morph3d, stex3d and spectex demos + - 3Dfx support + Bug fixes: + - glColorMaterial should finally work right in all respects + - linear interpolation of mipmap levels was incorrectly weighted + - readpix.c didn't compile on Macintosh + - GL_INVERT and related logic ops didn't work right + - glTexImage[12]D() didn't check its parameters consistantly + - fixed a memory leak in glTexImage[12]D() + - kludged around a SunOS 5.x/GCC compiler bug in the feedback code + - glReadPixels aborted instead of normally catching some errors + - a few 1.1 constants were missing or misnamed in gl.h + - glBegin(p); glBegin(q); didn't generate an error + - fixed a memory leak in GLX code + - clipping of concave polygons could cause a core dump + - 1-component alpha texture maps didn't work + - fixed a GLU polygon tesselator bug + - polygons with colinear vertices were sometimes culled + - feedback triangle colors were wrong when using smooth shading + - textures with borders didn't work correctly + - colors returned in feedback mode were wrong when using lighting + - spotlights didn't effect ambient lighting correctly + - gluPartialDisk() had a few bugs + Changes: + - device driver interface expanded to support texture mapping + - faster matrix inversion subroutine + - commented out #include "wmesa_extend.h" from src/wmesa.c + - fixed many compiler warnings in the demo programs + +2.3 June 30, 1997 + New: + - Mesa distribution divided into two pieces: library code and demos + - faster vertex transformation, clip testing, lighting + - faster line drawing + - TrueColor visuals how have dithering (for depths < 24 bits) + - added MESA_NO_DITHER environment variable + - new device driver function: NearFar(), RenderVB(), RasterSetup() + - added LynxOS configuration + - added cygnus Win32 configuration + - added texcyl.c GLUT demo + - added XMesaDitherColor() to X/Mesa interface + - new NURBS code from Bogdan Sikorski + - added demos/shape.c (non-rectangular X window!) + Bug fixes: + - glEnable/DisableClientState() were missing from GL/gl.h + - GL_SPHERE_MAP texcoord generation didn't work correctly + - glXGetConfig() returned wrong number of depth, stencil, accum bits + - glDrawPixels feedback/selection didn't examine RasterPos valid bit + - black and white were reversed on some monochrome displays + - fixed potential image memory leak (wasn't setting reference counter) + - glDrawPixels sometimes didn't recognize some GL state changes + - gluProject/UnProject() didn't check for divide by zero + - stex3d demo called random() and srandom(), not portable + - fixed memory leaks in context.c and drawpix.c + - fixed NULL dereferencing problem in gl_update_texture_state() + - glReadPixels between glBegin/glEnd didn't generate an error. + - fixed memory leak in polygon tesselator (Randy Frank) + - fixed seg fault bug drawing flat-shaded, depth-tested lines + - clipped GL_TRIANGLE_STRIPs sometimes had wrong color when flat-shaded + - glBindTexture sometimes didn't work + - fixed a bug deep in glXReleaseBuffersMESA() + - fog was mistakenly applied to alpha + - glPopMatrix didn't set "dirty matrix" flag + - glPolygonStipple pattern was sometimes wrong + - glClear wasn't disabled during feedback and selection + - fixed memory leak in glTexSubImage[123]D + Changes: + - many library source files reorganized + - faster X color allocation, colors also freed when finished with them + - new texture sampling function pointer in texture objects + - incorporated 3Dfx VooDoo driver v0.16 into main source tree + - many 3Dfx driver updates + - cygnus Makefiles now included + - updated DOS driver + - made a few changes to dosmesa.c and wmesa.c (VB->Unclipped) + - internally, colors now stored in GLubytes, not GLfixed + - optimized changing of GL_SHININESS parameter + +2.4 September 18, 1997 + New: + - updated 3Dfx Glide driver + - hacks for 3Dfx rendering into an X window or fullscreen + - added depth buffer access functions to X/Mesa and OS/Mesa interfaces + Bug fixes: + - pixel buffer could overflow with long, wide lines + - fixed FP underflow problems in lighting + - glTexSubImage1D() had an unitialized variable + - incomplete texture objects could cause a segfault + - glDrawPixels with GL_COMPILE_AND_EXECUTE caused infinite loop + - flat-shaded quads in a strip were miscolored if clipped + - mipmapped triangle lod computation now works correctly + - fixed a few under/overflow bugs in triangle rasterizer + - glArrayElement() assigned bad normal if normal array disabled + - changed argument to glXReleaseBuffersMESA() + - fixed small triangle underflow bugs in tritemp.h (hopefully) + - glBindTexture(target, 0) caused a crash + - glTexImage[123]D() with NULL image pointer caused crash + - glPixelStore parameters are now ignored during display list execution + - fixed a two-sided lighting w/ clipping bug (black vertices) + - textures with width!=height were sometimes mis-rendered + - "weird" projection matrices could cause div by 0, other fp errors + Changes: + - changed precompiled header symbol from PCH to PC_HEADER + - split api.c into api1.c and api2.c + - added hash.c source file (but not used yet) + - a few Sun and HP configuration file changes + - MESA_GLX_FX env var replaces MESA_FX_WINDOW and MESA_FX_FULLSCREEN + - fixed a few cygnus build problems (src/Makefile.cygnus, src/wmesa.c) + +2.5 November 20, 1997 + New: + - updated 3Dfx driver (v20) for GLQuake + - added GL_EXT_paletted_texture extension + - added GL_EXT_shared_texture_palette extension + - added GL_EXT_point_parameters extension + - now including Mark Kilgard's GLUT library v3.6 + - new GLUT-based demos in gdemos/ + - added a few more Unix config targets + - added Intel X86 assembly language vertex transformation code + - 3Dfx/Glide driver for Mesa now recognizes SST_SCREENREFRESH env var + - Windows 95 S3 Virge driver + Bug fixes: + - glCopyTexImage?D would crash due to uninitialized variable + - glColor w/ glColorMaterial in a display list caused a bug + - fixed several glDrawPixels() and ReadPixels() bugs in 3Dfx driver + - glVertex4*() vertices weren't always projected correctly + - trying to use mipmapped textured points or lines caused crash + - glColor[34][fd]() values now clamped to [0,1] before int conversion + Changes: + - new device driver functions for texture mapping + - hash tables used for display list and texture object lookup + - fixed GLX visual handling code to avoid saving redundant visuals + - 3Dfx Glide libraries automatically linked to libMesaGL.so + - dropped the Cirrus Logic Mondello code since it's obsolete + - updated Cygnus Makefiles (Stephane Rehel) + - updated Windows MSVC++ Makefiles (Oleg Letsinsky) + - procedure for making library files has changed: scripts now take + a major and minor version arguments. Make-config changed a lot. + - new implementation of glTexSubImage2D() + - updated widgets-mesa directory to create libMesaGLwM.a (Motif widget) + - separate linux-glide and linux-386-glide configurations + +2.6 February 12, 1998 + New: + - Windows WGL functions + - updated VMS, DOS, Windows, Cygnus, BeOS, Amiga compilation support + - v0.22 of 3Dfx Glide driver + - more X86 assembly language optimizations + - faster blending for some modes + - XMesaSetFXmode() to switch between 3Dfx window and full-screen mode + - added preliminary thread support + - added GLX_MESA_copy_sub_buffer extension + - some clipping optimizations + Bug fixes: + - fixed shading/material bug when drawing long primitive strips + - fixed clipping problem in long primitive strips + - fixed clipping bug when using 3Dfx driver + - fixed a problem when trying to use X fonts w/ 3Dfx driver + - fixed a texture filter bug in 3Dfx/Glide driver + - fixed bug in 3Dfx/Glide driver involving depth mask & clearing + - glLoadMatrix to set projection matrix confused the 3Dfx driver + - non-identity texture matrices didn't work with linux-386 configs + - glGenTextures() didn't reserve the returned texture IDs + - NULL proxy image sent to glTexImageXD() caused crash + - added texture state validation optimization (Henk Kok) + - fixed colormap reuse problem when using both RGB and CI windows + - 32bpp True/DirectColor X visuals weren't recognized + - fixed potential problem in evaluators memory allocation + - fixed assorted demo compilation bugs + Changes: + - replaced old Mesa/windows/ directory with Mesa/WIN32/ directory + - converted a few old glaux/gltk demos to GLUT + - renamed directories: demos -> xdemos, gdemos -> demos + + +3.0 September 17, 1998 + New: + - OpenGL 1.2 API + - GL_EXT_abgr pixel format extension + - GL_SGIS_texture_edge_clamp extension + - GL_SGIS_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_rescale_normal extension and renormal.c demo + - GLX_SGI_video_sync extension (a no-op) + - antialiased lines + - glGetTexImage() now implemented + - glDraw/Copy/ReadPixels() optimizations + - optimized textured triangle code (Marten Stromberg) + - more optimization of dithered TrueColor triangles in X driver + - Linux GGI driver + - updated MGL driver + Bug fixes: + - lots of assorted compilation fixes + - glInitNames didn't write initial hit record + - glBitmap didn't always check for invalid raster position + - switching between GLX and OSMesa contexts caused a crash + - fixed uninitialized variable in Mesa widget code + - fixed typo in texture code which caused book/texgen to crash + - fixed texture sampling bug when filter=GL_LINEAR and wrap=GL_CLAMP + - gluDisk() in POINT or LINE mode sometimes failed + - fixed texture + fog bug + - GL_COMPILE_AND_EXECUTE mode didn't work reliably + - glMultMatrix in projection matrix mode w/ 3Dfx driver could fail + - glDrawPixels(color index pixels) weren't converted to RGBA + - fixed possible getenv() buffer overflow security bug + - glBitmap in feedback mode was offset by xOrig, yOrig params + - device driver's DrawPixels hook was never used + - glDrawPixels with zoomY!=1 and top/bottom clipping didn't work + - glDrawPixels optimized for GL_LUMINANCE, GL_LUMINANCE_ALPHA, GLubyte + - fixed MakeCurrent bug in GLwRedrawObjects() in MesaWorkstation.c + - glCopyTexSubImage2D() didn't work with 3Dfx driver + - lines with width = 2 could cause crash + - glClear with scissor rect sometimes cleared whole buffer + - glTexSubImage2D( .. GL_COLOR_INDEX .. ) didn't work + - glTexImageXD( .. GL_ABGR_EXT .. ) didn't work + - computation of inverse modelview matrix sometimes failed + - fixed GL_CLAMP mode texture sampling bug + - textured line interpolation was somewhat broken + - textured triangle interpolation was also somewhat broken + - glGet(MODELVIEW/PROJECTION/TEXTURE_MATRIX_STACK_DEPTH) off by one + - evaluator state wasn't fully initialized + - texture coordinate clipping was buggy + - evaluator surfaces could be mis-colored + - glAccum(GL_RETURN, s) didn't obey glColorMask() settings + - zero area polygons shouldn't be culled if polygon mode is point/line + - clipped width and height of glReadPixels was sometimes off by one + - blending with alpha = 0 or 1.0 wasn't always exact + - reading of pixels from clipped region was buggy + - minor tweaking of X visual management in GLX emulator + - glPolygonStipple now obeys pixel unpacking parameters + - glGetPolygonStipple now obeys pixel packing parameters + - interleaved vertex array texture coordinates were broken + - query of proxy texture internal format was broken + - alpha channel wasn't reliably cleared + - fixed divide by zero error in gluScaleImage if dest size = 1 x 1 + Conformance bug fixes: + - GL_SELECTION_BUFFER_POINTER and GL_SELECTION_BUFFER_SIZE were missing + - GL_TEXTURE_INTERNAL_FORMAT was missing + - glGet*(GL_POLYGON_STIPPLE) was broken + - glPush/PopAttrib() didn't save/restore all texture state + - glBitmap in feedback mode didn't work + - feedback of texture coords didn't always work + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLbyte was broke + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLubyte was broke + - glDrawPixels w/ format=GL_STENCIL_INDEX, type=GL_BITMAP was broke + Changes: + - upgraded GLUT to version 3.7 + - only GL and GLU library code included in MesaLib.tar.gz + - GLUT and all demos now in MesaDemos.tar.gz + - glaux and gltk libraries removed + - IRIX -n32 and -64 libs go in lib32/ and lib64/ directories + + +3.1 beta 1 November 19, 1998 + New: + - GL_EXT_stencil_wrap extension + - GL_INGR_blend_func_separate extension + - GL_ARB_multitexture extension + - GL_NV_texgen_reflection extension + - newly optimized vertex transformation code + - updated GLUT 3.7 code + - better precision when using 32-bit Z buffer + - Allegro DJGPP driver + Bug fixes: + - glCopyPixels between front/back buffers didn't copy alpha correctly + - fixed out-of-bounds memory access in optimized 2-D texture code + - glPixelStorei didn't accept GL_PACK/UNPACK_IMAGE_HEIGHT parameter + - glGet*() didn't accept GL_MAX_3D_TEXTURE_SIZE parameter + - clipping of texture coordinates sometimes had bad R,Q values + - GL_CLAMP_TO_EDGE texture sampling was off by 0.5 texels + - glEdgeFlagPointer() now takes a GLvoid * instead of GLboolean * + - texture was sometimes applied twice with 3Dfx driver + - glPush/PopAttrib() fouled up texture object reference counts + - glDeleteLists(0, n) caused assertion failure + - bilinear texture sampling wasn't accurate enough + - glClear w/ glDepthMask(GL_FALSE) didn't work right on 3Dfx + - color components were reversed on big endian 32 bpp X visuals + Changes: + - removed GL_EXT_multitexture extension + + +3.1 beta 2 May 24, 1999 + New: + - multi-textured points and lines (mjk@nvidia.com) + - optimized 24bpp X rendering (bernd.paysan@gmx.de) + - added allegro support (bernie-t@geocities.com) + - cleaned-up Windows-related stuff (Ted Jump) + - minor stereo changes (KendallB@scitechsoft.com) + - new BeOS driver which implements BGLView class + - new Direct3D driver (see src/D3D) + - more efficient filled gluCylinder() function + - utilities: util/showbuffer.[ch] and util/glstate.[ch] + - fixed some IRIX compiler warnings + - added support for building Mesa in XFree86 with + SGI's GLX (kevin@precisioninsight.com) + Bug fixes: + - a variety of Windows/Mesa bug fixes (mjk@nvidia.com) + - packed pixel images weren't unpacked correctly + - patches some win32 files in GLUT (mjk@nvidia.com) + - glTexImage[123]D() didn't accept internalFormat == GL_COLOR_INDEX + - fixed lighting bug in Keith's new shading code + - fixed texture segfault seen in Lament screensaver + - fixed miscellaneous low-memory bugs + - glClear(GL_COLOR_BUFFER_BIT) with RGBA or CI masking was broken + - GL_LINEAR sampling of 3D textures was broken + - fixed SVR4 'cc' compiler macro problem (dawes@xfree86.org) + - added GL_TEXTURE_PRIORITY fix (keithh@netcomuk.co.uk) + - fixed wide point and wide line conformance bugs (brianp) + Changes: + - some device driver changes (see src/dd.h) + - new copyright on core Mesa code + + +3.1 beta 3 September 17, 1999 + New: + - optimized glAccum function + - optimized 24bpp rendering in XMesa driver + - GLU 1.2 polygon tessellator + Bug Fixes: + - glGetTexLevelParameter wasn't fully implemented + - glXUseXFont now handles multi-byte fonts + - glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result + - alpha channel of blending points, lines was sometimes incorrect + Changes: + - New library names: "libGL" instead of "libMesaGL" + - New library numbering: libGL.so.1.2.310 + - New subdirectories: docs/ and bin/ + - New Makefile-system (autoconf,automake,libtool) + + +3.1 final December 14, 1999 + New: + - added demos/gloss.c + - added xdemos/glxdpyinfo.c + - added GLX_ARB_get_proc_address extension + - rewritten glTexImage code paths (faster, less memory, bug fixes) + Bug Fixes: + - several vertex array bug fixes + - overlapping glCopyPixels with pixel zooming now works + - glXUseXFont() bitmaps were vertically shifted by one pixel + - glCopyPixels with pixel zooming now works + + +3.2 final April 24, 2000 + Bug fixes: + - fixed memcpy bugs in span.c + - fixed missing glEnd problem in demos/tessdemo.c + - fixed bug when clearing 24bpp Ximages + - fixed clipping problem found in Unreal Tournament + - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2 + - fixed Loki's 3dfx RGB vs BGR bug + - fixed Loki's 3dfx smooth/flat shading bug in SoF + Changes: + - updated docs/README file + - use bcopy() optimizations on FreeBSD + - re-enabled the optimized persp_textured_triangle() function + + +3.2.1 July 19, 2000 + Bug fixes: + - gluBuild2DMipmaps() didn't accept GL_BGRA + - Fixed compile/makefile problems on IRIX + - fixed segfault in 3dfx driver when using GL selection/feedback + - no longer cull very, very tiny triangles + - blending w/ drawbuffer==GL_FRONT_BACK caused segfault (sw rendering) + - fixed Motif detection code in widgets-mesa/configure.in + - glColorMaterial and glMaterial updates to emissive and ambient + didn't always work right + - Specular highlights weren't always in the right place + - clipped GL_LINE mode polygons had interior lines appear + - blend term GL_ONE_MINUS_CONSTANT_ALPHA was broken + - GL_NICEST fog didn't always work with flat shading + - glRect commands in display lists were sometimes miscolored + - Line Z offset didn't always work + - fixed texgen normal vector problem (gloss's teapot) + - numerous GL conformance bugs fixed + Changes: + - glColorMask(false, false, false, false) handled better/faster + - reverted to old GLU polygon tessellator, GLU 1.1 + - updated Win32 build files + + +3.3 July 21, 2000 + New: + - antialiased triangles now implemented + - GL_EXT_texture_env_add texture mode extension + - GLX 1.3 API + - support for separate draw/read buffers (ie GL_SGI_make_current_read) + - thread-safe API dispath + - improved glxinfo program + - demos/texdown program to measure texture download performance + - glext.h header file + - demos/geartrain program + - GL_EXT_texture_lod_bias extension + - demos/lodbias program + - further optimized glRead/DrawPixels for 16-bit TrueColor X visuals + - GLX_EXT_visual_rating extension (a no-op, however) + - GL_HP_occlusion_test extension (for X and OS/Mesa drivers) + - demos/occlude program + - GL_SGIS_pixel_texture and GL_SGIX_pixel_texture extensions + - demos/pixeltex program + - GL_SGI_color_matrix extension + - GL_SGI_color_table extension + - GL_EXT_histogram extension + - GL_ARB_texture_cube_map extension + - added xdemos/glxheads and xdemos/manywin + - demos/texenv.c demo + - GL_EXT_texture_env_combine extension (by Holger Waechtler) + - Xlib driver is now thread-safe (see xdemos/glthreads) + Bug Fixes: + - various GL conformance failures fixed since 3.2.1 + Changes: + - gl.h now uses #defines instead of C enums for all tokens + - glu.h now uses #defines instead of C enums for all tokens + - moved programs from 3Dfx/demos/ into demos/ directory + + +3.4 November 3, 2000 + New: + - optimized glDrawPixels for glPixelZoom(1,-1) + Bug Fixes: + - widgets-mesa/src/*.c files were missing from 3.3 distro + - include/GL/mesa_wgl.h file was missing from 3.3 distro + - fixed some Win32 compile problems + - texture object priorities weren't getting initialized to 1.0 + - glAreTexturesResident return value was wrong when using hardware + - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX) + - glReadPixels with GLushort packed types was broken + - fixed a few bugs in the GL_EXT_texture_env_combine texture code + - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables + - fixed some typos/bugs in the VB code + - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work + - optimized glDrawPixels paths weren't being used + - per-fragment fog calculation didn't work without a Z buffer + - improved blending accuracy, fixes Glean blendFunc test failures + - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly + - glXGetProcAddressARB() didn't always return the right address + - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format + - texture matrix changes weren't always detected (GLUT projtex demo) + - fixed random color problem in vertex fog code + - fixed Glide-related bug that let Quake get a 24-bit Z buffer + Changes: + - finished internal support for compressed textures for DRI + + +3.4.1 February 14, 2001 + New: + - fixed some Linux build problems + - fixed some Windows build problems + - GL_EXT_texture_env_dot3 extension (Gareth Hughes) + Bug fixes: + - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI + - various state-update code changes needed for DRI bugs + - disabled pixel transfer ops in glColorTable commands, not needed + - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter + - updated sources and fixed compile problems in widgets-mesa/ + - GLX_PBUFFER enum value was wrong in glx.h + - fixed a glColorMaterial lighting bug + - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function + - glXCopySubBufferMESA() Y position was off by one + - Error checking of glTexSubImage3D() was broken (bug 128775) + - glPopAttrib() didn't restore all derived Mesa state correctly + - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL + conformance problems at 16bpp. + - clearing depth buffer with scissoring was broken, would segfault + - OSMesaGetDepthBuffer() returned bad bytesPerValue value + - fixed a line clipping bug (reported by Craig McDaniel) + - fixed RGB color over/underflow bug for very tiny triangles + Known problems: + - NURBS or evaluator surfaces inside display lists don't always work + + +3.4.2 May 17, 2001 + Bug fixes: + - deleting the currently bound texture could cause bad problems + - using fog could result in random vertex alpha values + - AA triangle rendering could touch pixels outside right window bound + - fixed byteswapping problem in clear_32bit_ximage() function + - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam + - fixed memory leak in glXUseXFont() + - fragment sampling in AA triangle function was off by 1/2 pixel + - Windows: reading pixels from framebuffer didn't always work + - glConvolutionFilter2D could segfault or cause FP exception + - fixed segfaults in FX and X drivers when using tex unit 1 but not 0 + - GL_NAND logicop didn't work right in RGBA mode + - fixed a memory corruption bug in vertex buffer reset code + - clearing the softwara alpha buffer with scissoring was broken + - fixed a few color index mode fog bugs + - fixed some bad assertions in color index mode + - fixed FX line 'stipple' bug #420091 + - fixed stencil buffer clear width/height typo + - fixed GL error glitches in gl[Client]ActiveTextureARB() + - fixed Windows compilation problem in texutil.c + - fixed 1/8-pixel AA triangle sampling error + Changes: + - optimized writing mono-colored pixel spans to X pixmaps + - increased max viewport size to 2048 x 2048 + + +3.5 June 21, 2001 + New: + - internals of Mesa divided into modular pieces (Keith Whitwell) + - 100% OpenGL 1.2 conformance (passes all conformance tests) + - new AA line algorithm + - GL_EXT_convolution extension + - GL_ARB_imaging subset + - OSMesaCreateContextExt() function + - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) + - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight + - GL_EXT_fog_coord extension (Keith Whitwell) + - GL_EXT_secondary_color extension (Keith Whitwell) + - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) + - GL_SGIX_depth_texture extension + - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions + - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow + - GL_ARB_texture_env_combine extension + - GL_ARB_texture_env_dot3 extension + - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp) + - OSMesaCreateContextExt() function + - libOSMesa.so library, contains the OSMesa driver interface + - GL/glxext.h header file for GLX extensions + - somewhat faster software texturing, fogging, depth testing + - all color-index conformance tests now pass (only 8bpp tested) + - SPARC assembly language TCL optimizations (David Miller) + - GL_SGIS_generate_mipmap extension + Bug Fixes: + - fbiRev and tmuRev were unitialized when using Glide3 + - fixed a few color index mode conformance failures; all pass now + - now appling antialiasing coverage to alpha after texturing + - colors weren't getting clamped to [0,1] before color table lookup + - fixed RISC alignment errors caused by COPY_4UBV macro + - drawing wide, flat-shaded lines could cause a segfault + - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles + Changes: + - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU + - new libOSMesa.so library, contains the OSMesa driver interface + + +4.0 October 22, 2001 + New: + - Mesa 4.0 implements the OpenGL 1.3 specification + - GL_IBM_rasterpos_clip extension + - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp) + - GL_ARB_texture_mirrored_repeat extension + - WindML UGL driver (Stephane Raimbault) + - added OSMESA_MAX_WIDTH/HEIGHT queries + - attempted compiliation fixes for Solaris 5, 7 and 8 + - updated glext.h and glxext.h files + - updated Windows driver (Karl Schultz) + Bug fixes: + - added some missing GLX 1.3 tokens to include/GL/glx.h + - GL_COLOR_MATRIX changes weren't recognized by teximage functions + - glCopyPixels with scale and bias was broken + - glRasterPos with lighting could segfault + - glDeleteTextures could leave a dangling pointer + - Proxy textures for cube maps didn't work + - fixed a number of 16-bit color channel bugs + - fixed a few minor memory leaks + - GLX context sharing was broken in 3.5 + - fixed state-update bugs in glPopClientAttrib() + - fixed glDrawRangeElements() bug + - fixed a glPush/PopAttrib() bug related to texture binding + - flat-shaded, textured lines were broken + - fixed a dangling pointer problem in the XMesa code (Chris Burghart) + - lighting didn't always produce the correct alpha value + - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky) + + +4.0.1 December 17, 2001 + New: + - better sub-pixel sample positions for AA triangles (Ray Tice) + - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO) + Bug fixes: + - added missing break statements in glGet*() for multisample cases + - fixed uninitialized hash table mutex bug (display lists / texobjs) + - fixed bad teximage error check conditional (bug 476846) + - fixed demos readtex.c compilation problem on Windows (Karl Schultz) + - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT + - silence some compiler warnings (gcc 2.96) + - enable the #define GL_VERSION_1_3 in GL/gl.h + - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h + - fixed glu.h typedef problem found with MSDev 6.0 + - build libGL.so with -Bsymbolic (fixes bug found with Chromium) + - added missing 'const' to glXGetContextIDEXT() in glxext.h + - fixed a few glXGetProcAddress() errors (texture compression, etc) + - fixed start index bug in compiled vertex arrays (Keith) + - fixed compilation problems in src/SPARC/glapi_sparc.S + - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith) + - use glXGetProcAddressARB in GLUT to avoid extension linking problems + - provoking vertex of flat-shaded, color-index triangles was wrong + - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith) + - glTexParameter didn't flush the vertex buffer (Ray Tice) + - feedback attributes for glDraw/CopyPixels and glBitmap were wrong + - fixed bug in normal length caching (ParaView lighting bug) + - fixed separate_specular color bug found in Chimera (18 Dec 2001) + + +4.0.2 April 2, 2002 + New: + - New DOS (DJGPP) driver written by Daniel Borca + - New driver interface functions for TCL drivers (such as Radeon DRI) + - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32" + if using deep color channels + - latest GL/glext.h and GL/glxext.h headers from SGI + Bug fixes: + - GL_BLEND with non-black texture env color wasn't always correct + - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha) + - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken + - glReadPixels was sometimes mistakenly clipped by the scissor box + - glDraw/ReadPixels didn't catch all the errors that they should have + - Fixed 24bpp rendering problem in Windows driver (Karl Schultz) + - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c) + - Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP) + - glColorMask as sometimes effecting glXSwapBuffers() + - fixed a potential bug in XMesaGarbageCollect() + - N threads rendering into one window didn't work reliably + - glCopyPixels didn't work for deep color channels + - improved 8 -> 16bit/channel texture image conversion (Gerk Huisma) + - glPopAttrib() didn't correctly restore user clip planes + - user clip planes failed for some perspective projections (Chromium) + Known bugs: + - mipmap LOD computation + + +4.0.3 June 25, 2002 + New: + - updated GL/glext.h file (version 15) + - corrected MMX blend code (Jose Fonseca) + - support for software-based alpha planes in Windows driver + - updated GGI driver (Filip Spacek) + Bug fixes: + - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens + - OSMesaMakeCurrent() didn't recognize buffer size changes + - assorted conformance fixes for 16-bit/channel rendering + - texcombine alpha subtraction mode was broken + - fixed lighting bug with non-uniform scaling and display lists + - fixed bug when deleting shared display lists + - disabled SPARC cliptest assembly code (Mesa bug 544665) + - fixed a couple Solaris compilation/link problems + - blending clipped glDrawPixels didn't always work + - glGetTexImage() didn't accept packed pixel types + - glPixelMapu[is]v() could explode given too large of pixelmap + - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT + - glXCopyContext() could lead to segfaults + - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665) + Changes: + - lots of C++ (g++) code clean-ups + - lots of T&L updates for the Radeon DRI driver + Known bugs: + - mipmap LOD computation (fixed for Mesa 4.1) + + +4.0.4 October 3, 2002 + New: + - GL_NV_texture_rectangle extension + - updated glext.h header (version 17) + - updated DOS driver (Daniel Borca) + - updated BeOS R5 driver (Philippe Houdoin) + - added GL_IBM_texture_mirror_repeat + - glxinfo now takes -l option to print interesting OpenGL limits info + - GL_MESA_ycbcr_texture extension + - GL_APPLE_client_storage extension (for some DRI drivers only) + - GL_MESA_pack_invert extension + Bug fixes: + - fixed GL_LINEAR fog bug by adding clamping + - fixed FP exceptions found using Alpha CPU + - 3dfx MESA_GLX_FX=window (render to window) didn't work + - fixed memory leak in wglCreateContest (Karl Schultz) + - define GLAPIENTRY and GLAPI if undefined in glu.h + - wglGetProcAddress didn't handle all API functions + - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map + - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc() + - error checking in compressed tex image functions had some glitches + - fixed AIX compile problem in src/config.c + - glGetTexImage was using pixel unpacking instead of packing params + - auto-mipmap generation for cube maps was incorrect + Changes: + - max texture units reduced to six to accomodate texture rectangles + - removed unfinished GL_MESA_sprite_point extension code + + +4.1 October 29, 2002 + New: + - GL_NV_vertex_program extension + - GL_NV_vertex_program1_1 extension + - GL_ARB_window_pos extension + - GL_ARB_depth_texture extension + - GL_ARB_shadow extension + - GL_ARB_shadow_ambient extension + - GL_EXT_shadow_funcs extension + - GL_ARB_point_parameters extension + - GL_ARB_texture_env_crossbar + - GL_NV_point_sprite extension + - GL_NV_texture_rectangle extension + - GL_EXT_multi_draw_arrays extension + - GL_EXT_stencil_two_side extension + - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions + - GL_ATI_texture_mirror_once extension (Ian Romanick) + - massive overhaul/simplification of software rasterizer module, + many contributions from Klaus Niederkrueger + - faster software texturing in some cases (i.e. trilinear filtering) + - new OSMesaGetProcAddress() function + - more blend modes implemented with MMX code (Jose Fonseca) + - added glutGetProcAddress() to GLUT + - added GLUT_FPS env var to compute frames/second in glutSwapBuffers() + - pbinfo and pbdemo PBuffer programs + - glxinfo -v prints transprent pixel info (Gerd Sussner) + Bug fixes: + - better mipmap LOD computation (prevents excessive blurriness) + - OSMesaMakeCurrent() didn't recognize buffer size changes + - assorted conformance fixes for 16-bit/channel rendering + - texcombine alpha subtraction mode was broken + - fixed some blend problems when GLchan==GLfloat (Gerk Huisma) + - clamp colors to [0,inf] in OSMesa if GLchan==GLfloat (Gerk Huisma) + - fixed divide by zero error in NURBS tessellator (Jon Perry) + - fixed GL_LINEAR fog bug by adding clamping + - fixed FP exceptions found using Alpha CPU + - 3dfx/glide driver render-to-window feature was broken + - added missing GLX_TRANSPARENT_RGB token to glx.h + - fixed error checking related to paletted textures + - fixed reference count error in glDeleteTextures (Randy Fayan) + Changes: + - New spec file and Python code to generate some GL dispatch files + - Glide driver defaults to "no" with autoconf/automake + - updated demos/stex3d with new options + + +5.0 November 13, 2002 + New: + - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4") + - removed some overlooked debugging code + - glxinfo updated to support GLX_ARB_multisample + - GLUT now support GLX_ARB_multisample + - updated DOS driver (Daniel Borca) + Bug fixes: + - GL_POINT and GL_LINE-mode polygons didn't obey cull state + - fixed potential bug in _mesa_align_malloc/calloc() + - fixed missing triangle bug when running vertex programs + - fixed a few HPUX compilation problems + - FX (Glide) driver didn't compile + - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work + - a few EXT functions, like glGenTexturesEXT, were no-ops + - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate, + glMultiDrawArrays and glMultiDrawElements were missing + - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken + - Pentium 4 Mobile was mistakenly identified as having 3DNow! + - fixed one-bit error in point/line fragment Z calculation + - fixed potential segfault in fakeglx code + - fixed color overflow problem in DOT3 texture env mode + + +5.0.1 March 30, 2003 + New: + - DOS driver updates from Daniel Borca + - updated GL/gl_mangle.h file (Bill Hoffman) + Bug fixes: + - auto mipmap generation for cube maps was broken (bug 641363) + - writing/clearing software alpha channels was unreliable + - minor compilation fixes for OS/2 (Evgeny Kotsuba) + - fixed some bad assertions found with shadowtex demo + - fixed error checking bug in glCopyTexSubImage2D (bug 659020) + - glRotate(angle, -x, 0, 0) was incorrect (bug 659677) + - fixed potential segfault in texture object validation (bug 659012) + - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus) + - fix fog stride bug in tnl code for h/w drivers (Michel Danzer) + - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080) + - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3 + - fixed compilation problem on Solaris7/x86 (bug 536406) + - fixed prefetch bug in 3DNow! code (Felix Kuhling) + - fixed NeXT build problem (FABSF macro) + - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811) + - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964) + - AA line and triangle Z values are now rounded, not truncated + - fixed color interpolation bug when GLchan==GLfloat (bug 694461) + - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca) + - fixed a minor GL_COLOR_MATERIAL bug + - NV vertex program EXP instruction was broken + - glColorMask misbehaved with X window / pixmap rendering + - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack) + - attempt to fix GGI compilation problem when MesaDemos not present + - NV vertex program ARL-relative fetches didn't work + Changes: + - use glPolygonOffset in gloss demo to avoid z-fighting artifacts + - updated winpos and pointblast demos to use ARB extensions + - disable SPARC normal transformation code (bug 673938) + - GLU fixes for OS/2 (Evgeny Kotsuba) + + +5.0.2 September 5, 2003 + Bug fixes: + - fixed texgen problem causing texcoord's Q to be zero (stex3d) + - default GL_TEXTURE_COMPARE_MODE_ARB was wrong + - GL_CURRENT_MATRIX_NV query was wrong + - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one + - GL_LIST_MODE query wasn't correct + - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported + - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value + - blended, wide lines didn't always work correctly (bug 711595) + - glVertexAttrib4svNV w component was always 1 + - fixed bug in GL_IBM_rasterpos_clip (missing return) + - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly + - a few Solaris compilation fixes + - fixed glClear() problem for DRI drivers (non-existant stencil, etc) + - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux) + - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz) + - glFog() didn't clamp fog colors + - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the + gl[Get]TexParameteri[v] functions + - fixed invalid memory references in glTexGen functions (bug 781602) + - integer-valued color arrays weren't handled correctly + - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work + - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1 + Changes: + - build GLUT with -fexceptions so C++ apps propogate exceptions + + +5.1 December 17, 2003 + New: + - reorganized directory tree + - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche) + - GL_ATI_texture_env_combine3 extension (Ian Romanick) + - GL_SGI_texture_color_table extension (Eric Plante) + - GL_NV_fragment_program extension + - GL_NV_light_max_exponent extension + - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle) + - GL_ARB_occlusion_query extension + - GL_ARB_point_sprite extension + - GL_ARB_texture_non_power_of_two extension + - GL_IBM_multimode_draw_arrays extension + - GL_EXT_texture_mirror_clamp extension (Ian Romanick) + - GL_ARB_vertex_buffer_object extension + - new X86 feature detection code (Petr Sebor) + - less memory used for display lists and vertex buffers + - demo of per-pixel lighting with a fragment program (demos/fplight.c) + - new version (18) of glext.h header + - new spriteblast.c demo of GL_ARB_point_sprite + - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1) + - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1) + Bug fixes: + - really enable OpenGL 1.4 features in DOS driver. + - fixed issues in glDrawPixels and glCopyPixels for very wide images + - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint + - fixed some texgen bugs reported by Daniel Borca + - fixed wglMakeCurrent(NULL, NULL) bug (#835861) + - fixed glTexSubImage3D z-offset bug (Cedric Gautier) + - fixed RGBA blend enable bug (Ville Syrjala) + - glAccum is supposed to be a no-op in selection/feedback mode + - fixed texgen bug #597589 (John Popplewell) + Changes: + - dropped API trace feature (src/Trace/) + - documentation overhaul. merged with website content. more html. + - glxgears.c demo updated to use GLX swap rate extensions + - glTexImage1/2/3D now allows width/height/depth = 0 + - disable SPARC asm code on Linux (bug 852204) + + +6.0 January 16, 2004 + New: + - full OpenGL 1.5 support + - updated GL/glext.h file to version 21 + Changes: + - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h) + Bug fixes: + - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color + clamping issue + - updated suno5-gcc configs + - glColor3 functions sometimes resulted in undefined alpha values + - fixed FP divide by zero error seen on VMS with xlockmore, others + - fixed vertex/fragment program debug problem (bug 873011) + - building on AIX with gcc works now + - glDeleteProgramsARB failed for ARB fragment programs (bug 876160) + - glDrawRangeElements tried to modify potentially read-only storage + - updated files for building on Windows + + +6.0.1 April 2, 2004 + New: + - upgraded glext.h to version 22 + - new build targets (Dan Schikore) + - new linux-x86-opteron build target (Heath Feather) + Bug fixes: + - glBindProgramARB didn't update all necessary state + - fixed build problems on OpenBSD + - omit CVS directories from tarballs + - glGetTexImage(GL_COLOR_INDEX) was broken + - fixed an infinite loop in t&l module + - silenced some valgrind warnings about using unitialized memory + - fixed some compilation/link glitches on IRIX (Mike Stephens) + - glBindProgram wasn't getting compiled into display lists + - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079) + - two-sided lighting and vertex program didn't work (bug 887330) + - stores to program parameter registers in vertex state programs + didn't work. + - fixed glOrtho bug found with gcc 3.2.2 (RH9) + - glXCreateWindow() wasn't fully implemented (bug 890894) + - generic vertex attribute arrays didn't work in display lists + - vertex buffer objects' default usage and access fields were wrong + - glDrawArrays with start!=0 was broken + - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken + - linux-osmesa16-static config didn't work + - fixed a few color index rendering problems (bug 910687) + - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE + - OSMesa RGB and BGR modes were broken + - glProgramStringARB mistakenly required a null-terminated string + - fragment program XPD instruction was incorrect + - glGetMaterial() didn't work reliably + - ARB_fragment_program KIL instruction was incorrect + + +6.1 August 18, 2004 + New: + - Revamped Makefile system + - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c) + - internal driver interface changes related to texture object + allocation, vertex/fragment programs, BlendEquationSeparate, etc. + - option to walk triangle edges with double-precision floats + (Justin Novosad of Discreet) (see config.h file) + - support for AUX buffers in software GLX driver + - updated glext.h to version 24 and glxext.h to version 6 + - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars + - updated BeOS support (Philippe Houdoin) + Changes: + - fragment fog interpolation is perspective corrected now + - new glTexImage code, much cleaner, may be a bit faster + Bug fixes: + - glArrayElement in display lists didn't handle generic vertex attribs + - glFogCoord didn't always work properly + - ARB_fragment_program fog options didn't work + - frag prog TEX instruction no longer incorrectly divides s,t,r by q + - ARB frag prog TEX and TEXP instructions now use LOD=0 + - glTexEnviv in display lists didn't work + - glRasterPos didn't do texgen or apply texture matrix + - GL_DOUBLE-valued vertex arrays were broken in some cases + - fixed texture rectangle edge/border sampling bugs + - sampling an incomplete texture in a fragment program would segfault + - glTexImage was missing a few error checks + - fixed some minor glGetTexParameter glitches + - GL_INTENSITY was mistakenly accepted as a to glTexImage + - fragment program writes to RC/HC register were broken + - fixed a few glitches in GL_HP_occlusion_test extension + - glBeginQueryARB and glEndQueryARB didn't work inside display lists + - vertex program state references were broken + - fixed triangle color interpolation bug on AIX (Shane Blackett) + - fixed a number of minor memory leaks (bug #1002030) + + +6.2 October 2, 2004 + New: + - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle) + - updated Doxygen support (Jose Fonseca) + Changes: + - some GGI driver updates (Christoph Egger, bug 1025977) + Bug fixes: + - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features + - fixed a few compilation issues on IRIX + - fixed a matrix classification bug (reported by Wes Bethel) + - we weren't reseting the vertex/fragment program error state + before parsing (Dave Reveman) + - adjust texcoords for sampling texture rectangles (Dave Reveman) + - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented + - repeated calls to glDeleteTexture(t) could lead to a crash + - fixed potential ref count bugs in VBOs and vertex/fragment programs + - spriteblast demo didn't handle window size changes correctly + - glTexSubImage didn't handle pixels=NULL correctly for PBOs + - fixed color index mode glDrawPixels bug (Karl Schultz) + + +6.2.1 December 9, 2004 + Bug fixes: + - don't apply regular fog or color sum when using a fragment program + - glProgramEnvParameter4fARB always generated an error on + GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645) + - glVertexAttrib3svNV and glVertexAttrib3svARB were broken + - fixed width/height mix-up in glSeparableFilter2D() + - fixed regression in glCopyPixels + convolution + - glReadPixels from a clipped front color buffer didn't always work + - glTexImage didn't accept GL_RED/GREEN/BLUE as the format + - Attempting queries/accesses of VBO 0 weren't detected as errors + - paletted textures failed if the palette had fewer than 256 entries + Changes: + - fixed a bunch of compiler warnings found with gcc 3.4 + - bug reports should to go bugzilla.freedesktop.org + + +6.3 July 20, 2005 + New: + - GL_EXT_framebuffer_object extension + - GL_ARB_draw_buffers extension + - GL_ARB_pixel_buffer_object extension + - GL_OES_read_format extension (Ian Romanick) + - DirectFB driver (Claudio Ciccani) + - x86_64 vertex transformation code (Mikko T.) + - Updated GL/glext.h to version 29 + Changes: + - added -stereo option for glxgears demo (Jacek Rosik) + - updated the PBuffer demo code in xdemos/ directory + - glDeleteTextures/Programs/Buffers() now makes the object ID + available for immediate re-use + - assorted 64-bit clean-ups fixes (x86_64 and Win64) + - lots of internal changes for GL_EXT_framebuffer_object + Bug fixes: + - some functions didn't support PBO functionality + - glGetTexImage didn't convert color index images to RGBA as required + - fragment program texcoords were sometimes wrong for points and lines + - fixed problem with negative dot product in arbfplight, fplight demos + - fixed bug in perspective correction of antialiased, textured lines + - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value + - fixed a couple per-pixel fog bugs (Soju Matsumoto) + - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken + - fixed float parsing bug in ARB frag/vert programs (bug 2520) + - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue + - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha + - glXChooseFBConfig() crashed if attribList pointer was NULL + - program state.light[n].spot.direction.w was wrong value (bug 3083) + - fragment program fog option required glEnable(GL_FOG) - wrong. + - glColorTable() could produce a Mesa implementation error (bug 3135) + - RasterPos could get corrupted by color index rendering path + - Removed bad XTranslateCoordinates call when rendering to Pixmaps + - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state + - fixed a few Darwin compilation problems + + +6.3.1 + This was an intermediate release for X.org which wasn't otherwise released. + + +6.3.2 August 19, 2005 + New: + - The distribution now includes the DRI drivers and GLX code + Changes: + - Made the DRI "new" driver interface standard, remove old code + Bug fixes: + - GL_ARB_vertex/fragment_shader were mistakenly listed in the + extensions string + - negative relative addressing in vertex programs was broken + - update/fix SPARC assembly code for vertex transformation + - fixed memory leak when freeing GLX drawables/renderbuffers + - fixed display list memory leak + - the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer + - wglGetProcAddress() didn't handle wgl-functions + - fixed glxext.h cross-compile issue (Colin Harrison) + - assorted DRI driver fixes + + +6.4 October 24, 2005 + New: + - Added a fast XOR line drawing function in Xlib driver + - Added support for GL_ARB_texture_mirrored_repeat to savage + driver (supported only on Savage4 hardware). + Changes: + - Mesa now packaged in three parts: Library, Demos and GLUT + Bug fixes: + - GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig + - Some files were present multiple times in the 6.3.2 tarballs + - r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207) + - glxgears_fbconfig demo didn't work (bug 4237) + - fixed bug when bilinear sampling 2d textures with borders + - glXCreatePbuffer() could segfault instead of returning 0 (bug 4235) + - fixed undefined frexp and rand in X.org libGLcore.a (bug 4242) + - fixed a few problems with proxy color tables (bug 4270) + - fixed precision problem in Z clearing (bug 4395) + - glBitmap, glDraw/CopyPixels mistakenly generated selection hits + - fixed potential segfault caused by reading pixels outside + of renderbuffer bounds + - glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB + - fixed memory corruption bug involving software alpha buffers + - glReadPixels clipped by window bounds was sometimes broken + - glDraw/CopyPixels of stencil data ignored the stencil write mask + - glReadPixels from a texture bound to a framebuffer object didn't work + - glIsRender/FramebufferEXT weren't totally correct + - fixed a number of point size attenuation/fade bugs + - fixed glFogCoord bug 4729 + - GLX encoding for transpose matrix functions was broken + - fixed broken fragment program KIL and SWZ instructions + - fragment programs that wrote result.depth.z didn't work + + +6.4.1 November 30, 2005 + Bug fixes: + - redefining a vertex program string didn't take effect in TNL module + - fixed occasional segfault upon vertex/fragment parsing error + - vertex program LIT instruction didn't handle 0^0=1 correctly + - fragment program fog option didn't work with glDrawPixels, glBitmap + - USE_MGL_NAMESPACE didn't work for x86-64 + - OSMesa demos were missing from previous release tarballs + - fixed problem with float->ushort conversion in glClear (bug 4992) + - popping of GL_EYE_PLANE texgen state was broken (bug 4996) + - popping of GL_SPOT_DIRECTION light state was broken (bug 5005) + - fixed occasional triangle color interpolation problem on VMS + - work around invalid free() call (bug 5131) + - fixed BSD X server compilation problem by including stdint.h + + +6.4.2 February 2, 2006 + New: + - added OSMesaColorClamp() function/feature + - added wglGetExtensionStringARB() function + Bug fixes: + - fixed some problems when building on Windows + - GLw header files weren't installed by installmesa script (bug 5396) + - GL/glfbdev.h file was missing from tarballs + - fixed TNL initialization bug which could lead to crash (bug 5791) + + +6.5 March 31, 2006 + New: + - OpenGL Shading Language support through GL_ARB_shader_objects, + GL_ARB_shading_language_100, GL_ARB_vertex_shader and + GL_ARB_fragment_shader (done by Michal Krol) + - GL_EXT_packed_depth_stencil extension + - GL_EXT_timer_query extension + - GL_EXT_framebuffer_blit extension + - GL_ARB_half_float_pixel + - reflect demo improved to support multiple windows + - singlebuffer demo (shows no/little-flicker single-buffered rendering) + - r200: enable GL_ARB_texture_env_crossbar, separate the texture + sampling unit bits from the texture env combine enable bits + - r200: add support for GL_ATI_fragment_shader + - added fast XOR-mode line drawing optimization + - radeon: add support for all 3 tmus, GL_ARB_texture_cube_map + and GL_EXT_fog_coord + - MESA_GLX_ALPHA_BITS env var for xlib driver + - many DRI driver updates (including screen rotation support + for the Intel DRI driver) + Changes: + - removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead) + - removed GL_SGIX/SGIS_pixel_texture extensions + Bug fixes: + - fixed glxcontextmodes.c datatype problem (bug 5835) + - fixed aix-gcc build/install bugs (bug 5874) + - fixed some bugs in texture env program generation + - glXCopyContext() didn't handle texture object bindings properly + - glXCopyContext() didn't copy all lighting state + - fixed FreeBSD config (Pedro Giffuni) + - fixed some minor framebuffer object bugs + - replaced dprintf() with _glu_printf() in GLU (bug 6244) + - fixed a number of thread safety bugs/regressions + - fixed a number of GLU tesselator bugs (John Shell, bug 6339) + - paletted texturing was broken w/ floating point palettes (K. Schultz) + - lots of assorted framebuffer object bug fixes + +6.5.1 August 31, 2006 + New: + - Intel i965 DRI driver + - GL_APPLE_vertex_array_object extension (Ian Romanick) + - GL_EXT_texture_sRGB extension + - GL_EXT_gpu_program_parameters (Ian Romanick) + - "engine" demo + - updated fbdev driver and GLUT for fbdev (Sean D'Epagnier) + - many updates to the DRI drivers + Changes: + - The glVertexAttribARB functions no longer alias the conventional + vertex attributes. + - glxinfo program prints more info with -l option + - GL_FRAGMENT_PROGRAM_NV and GL_FRAGMENT_PROGRAM_ARB are now + compatible, in terms of glBindProgramARB() + Bug fixes: + - fixed broken texture border handling for depth textures (bug 6498) + - removed the test for duplicated framebuffer attachments, per + version 117 of the GL_EXT_framebuffer_object specification + - fixed a few render-to-texture bugs, including render to depth texture + - clipping of lines against user-defined clip planes was broken (6512) + - assembly language dispatch for SPARC was broken (bug 6484) + - assorted compilation fixes on various Unix platforms (Dan Schikore) + - glPopAttrib could restore an invalid value for GL_DRAW_BUFFER + - assorted minor fixes for 16 and 32 bit/channel modes + - fixed assorted bugs in texture compression paths + - fixed indirect rendering vertex array crashes (bug 6863) + - glDrawPixels GL_INDEX_OFFSET didn't always work + - fixed convolution memory leak (bug 7077) + - rectangular depth textures didn't work + - invalid mode to glBegin didn't generate an error (bug 7142) + - 'normalized' parameter to glVertexAttribPointerARB didn't work + - disable bogus GLX_SGI_video_sync extension in xlib driver + - fixed R128 driver locking bug (Martijn van Oosterhout) + - using evaluators with vertex programs caused crashes (bug 7564) + - fragment.position wasn't set correctly for point/line primitives + - fixed parser bug for scalar sources for GL_NV_fragment_program + - max fragment program length was incorrectly 128, now 1024 + - writes to result.depth in fragment programs weren't clamped to [0,1] + - fixed potential dangling pointer bug in glBindProgram() + - fixed some memory leaks (and potential crashes) in Xlib driver diff -Nru xpsb-glx-0.19/mesa/docs/versions.html xpsb-glx-0.19/mesa/docs/versions.html --- xpsb-glx-0.19/mesa/docs/versions.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/versions.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1656 @@ + + +Mesa Version History + + + + + + + + +NOTE: Changes for Mesa 6.4 and later are documented in the corresponding +release notes file. + + + +

    Mesa Version History

    + + +

    1.0 beta February 1995

    +
      +
    • Initial release +
    + +

    1.1 beta March 4, 1995

    +Changes: +
      +
    • faster point and line drawing (2x faster) +
    • more systems supported, better Makefiles +
    • Renamed lib*.a files to avoid collisions +
    • many small bug fixes +
    +New: +
      +
    • pseudo-GLX functions added +
    • new implementation of evaluators (eval2.c) +
    • GLUT support +
    + +

    1.1.1 beta March 7, 1995

    +Changes: +
      +
    • Reverted from eval2.c to eval.c due to FPE on Linux +
    • more speed improvements +
    • more Makefile changes +
    + +

    1.1.2 beta March 14, 1995

    +New: +
      +
    • implementation of SGI's blending extensions +
    • glXUseXFont implemented +
    • added MESA_DEBUG environment variable support +
    +Changes: +
      +
    • Using eval2.c again +
    • more FPE-prevention checks (0-length normals are OK) +
    • a few small bug fixes +
    • much faster pixel logic ops! +
    • faster transformation arithmetic +
    + +

    1.1.3 beta March 31, 1995

    +New: +
      +
    • gluScaleImage() and gluBuild2DMipMaps() implemented +
    • Mesa widgets for Xt/Motif +
    • blendEXT demos +
    • added environment variables for selecting visuals +
    +Changes: +
      +
    • almost all GLUT demos work correctly now +
    • faster X device driver functions +
    • more bug fixes +
    + +

    1.1.4 beta April 20, 1995

    +Bug fixes: +
      +
    • missing #define SEEK_SET in src-tk/image.c +
    • compile glShadeModel into display lists +
    • fixed pow() domain error in src/light.c +
    • fixed "flickering bitmaps" in double buffer mode +
    • fixed tk.h and aux.h for C++ +
    • state of LIGHT_MODEL_LOCAL_VIEWER was inverted +
    +New features: +
      +
    • MUCH, MUCH nicer dithering in 8-bit RGB mode +
    • updated widgets and widget demos +
    • Implemented GLXPixmap functions +
    • Added GLU 1.1 and GLX 1.1 functions +
    • Changed the X/Mesa interface API, more versatile +
    • Implemented gluPartialDisk() +
    + +

    1.2 May 22, 1995

    +Bug fixes: +
      +
    • IRIX 4.x makefile problem +
    • modified tk to share root colormap as needed +
    • gluLookAt normalization problem +
    • suppress Expose, NoExpose events in swapbuffers +
    • glBitmap() and glDrawPixels() clipping +
    +New features: +
      +
    • GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture + modes implemented +
    • texture maps stored more efficiently +
    • texture maps can be compiled into display lists +
    • Bogdan Sikorski's GLU polygon tesselation code +
    • Linas Vepstas's sweep and extrusion library +
    • glXCreateContext()'s shareList parameter works as it's supposed to. + XMesaCreateContext() updated to accept a shareList parameter too. +
    • Mesa can be compiled with real OpenGL .h files +
    • MESA_BACK_BUFFER environment variable +
    • better GLX error checking +
    + +

    1.2.1 June 22, 1995

    +Bug fixes: +
      +
    • X/Mesa double buffer window resize crash +
    • widgets now pass PointerMotion events +
    • X/Mesa incorrect default clear color and drawing color +
    • more robust X MIT-SHM support in X/Mesa +
    • glTexImage( format=GL_LUMINANCE ) didn't work +
    • GL_LINE mode polygons with line width > 1.0 could cause a crash +
    • numerous feedback bugs +
    • glReadPixels() from depth buffer was wrong +
    • error prone depth and stencil buffer allocation +New features: +
    • Preliminary Microsoft Windows driver +
    • Implemented a number of missing functions: glEvalCoord[12][df]v(), + glGet...(), etc. +
    • Added a few missing symbols to gl.h and glu.h +
    • Faster rendering of smooth-shaded, RGBA, depth-buffered polygons. +
    • Faster rendering of lines when width=2.0 +
    • Stencil-related functions now work in display lists +
    +Changes: +
      +
    • renamed aux.h as glaux.h (MS-DOS names can't start with aux) +
    • most filenames are in 8.3 format to accomodate MS-DOS +
    • use GLubytes to store arrays of colors instead of GLints +
    + +

    1.2.2 August 2, 1995

    +New features: +
      +
    • texture mapped points and lines +
    • NURBS! (but not 100% complete) +
    • viewports may safely extend beyond window boundaries +
    • MESA_PRIVATE_CMAP environment variable +
    • Grayscale X display support +
    • two new demos: demos/gears.c and demos/shadow.c +
    • MachTen for Macintosh configuration +
    +Bug fixes: +
      +
    • glGet*(GL_DEPTH_BITS) returned bytes, not bits +
    • point, line, and bitmap rasterization suffered from roundoff errors +
    • fixed a division by zero error in line clippping +
    • occasional wrong default background color really fixed! +
    • glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work +
    • gluBuild2DMipmaps malloc problem fixed +
    • view volume clipping of smooth shaded lines resulted in bad colors +
    +Changes: +
      +
    • new visual selection method in glXChooseVisual() +
    • improved GLU quadric functions +
    • call XSync for glFinish and XFlush for glFlush +
    • glVertex() calls now use a function pointer to avoid conditionals +
    • removed contrib directory from Mesa tar file (available on ftp site) +
    • AIX shared library support +
    • Removed GLUenum type as it's not in OpenGL +
    + +

    1.2.3 September 26, 1995

    +New features: +
      +
    • Mesa header files now equivalent to SGI OpenGL headers +
    • Support for HP's Color Recovery dithering displays +
    • Faster vertex transformation +
    • Faster raster operations into X windows under certain conditions +
    • New configurations: HP w/ shared libs, Ultrix w/ GCC, Data General +
    • 4-bit visuals now supported +
    +Bug fixes: +
      +
    • glScissor bug fixed +
    • round-off errors in clipping lines against clip planes fixed +
    • byte swapping between hosts and display servers implemented +
    • glGetError() can be called without a current rendering context +
    • problem with accidentally culled polygons is fixed +
    • fixed some widget compilation problems +
    + +

    1.2.4 November 17, 1995

    +New features: +
      +
    • More speed improvements (lighting, fogging, polygon drawing) +
    • Window system and OS-independent off-screen rendering +
    • Preliminary Fortran bindings +
    • glPolygonOffsetEXT implemented +
    • glColorMask and glIndexMask now fully implemented +
    • glPixelZoom implemented +
    • display lists fully implemented +
    • gamma correction +
    • dithering in 8-bit TrueColor/DirectColor visuals +
    +Changes: +
      +
    • Improved device driver interface +
    • tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk +
    • Dithering support moved from core into device driver +
    +Bug fixes: +
      +
    • glEnable/Disable( GL_LIGHTING ) didn't always take effect +
    • glReadPixels byte swapping was broken +
    • glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken +
    • duplicate glColor4b() prototype in GL/gl.h removed +
    • stripes in wave -ci demo fixed +
    • GL_LINEAR_MIPMAP_NEAREST had wrong value +
    • bugs in HP Color Recovery support fixed +
    • fixed bug when blending lines, points, bitmaps outside of window +
    + +

    1.2.5 November 30, 1995

    +New Features: +
      +
    • updated MS Windows driver +
    • new implementation of StaticGray/GrayScale visual support +
    +Bug fixes: +
      +
    • pixelzooming with gamma correction or blending didn't work +
    • HP color recovery visual wasn't being picked by glXChooseVisual +
    • glClear didn't always observe glColorMask changes +
    • olympic and offset demos didn't compile on some Suns +
    • texcoord clamping wasn't correct +
    • a polygon optimization introduced an occasional sampling problem +
    + +

    1.2.6 January 26, 1996

    +New Features: +
      +
    • faster line and polygon rendering under certain conditions. See + Performance Tips 9 and 10 in README +
    • profiling +
    • lighting is a bit faster +
    • better perspective corrected texture mapping +
    • Amiga AmiWin (X11) support +
    • preliminary Linux SVGA driver +Changes: +
    • now using a 16-bit depth buffer, faster, smaller +
    • GL_NORMALIZE is disabled by default +
    +Bug fixes: +
      +
    • projective texture mapping +
    • fixed a memory leak in the context destroy function +
    • GL_POLYGON with less than 3 vertices caused a crash +
    • glGet*() returned wrong result for GL_INDEX_MODE +
    • reading pixels from an unmapped X window caused a BadMatch error +
    + +

    1.2.7 March 5, 1996

    +New: +
      +
    • faster lighting +
    • faster 16-bit TrueColor rendering on Linux +
    • faster 32-bit TrueColor rendering on Linux, HP, IBM +
    • non-depth-buffered XImage polygons are faster +
    • vertex array extension +
    • software alpha planes +
    • updated Macintosh driver +
    • new NeXT driver +
    • GLU quadric functions generate texture coordinates +
    • reflect.c demo - reflective, textured surface demo +
    +Changes: +
      +
    • gamma correction code moved into the X driver for better performance +
    +Bug fixes: +
      +
    • multiple glClipPlane()'s didn't work reliably +
    • glPolygonMode() didn't always work +
    • glCullFace( GL_FRONT_AND_BACK ) didn't work +
    • texture mapping with gamma correction was buggy +
    • floating point exceptions in texture coordinate interpolation +
    • XImage byte swapping didn't always work +
    • polygon edge flags weren't always used correctly +
    + +

    1.2.8 May 22, 1996

    +New: +
      +
    • overlay planes on X servers with the SERVER_OVERLAY_VISUALS property +
    • better monochrome output +
    • more IRIX 6.x configurations +
    • more robust RGB mode color allocation +
    • added MESA_XSYNC environment variable +
    • GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions +
    • GL_MESA_window_pos extension +
    • faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT + and GL_UNSIGNED_INT +
    • driver for prototype Cirrus Mondello 3-D board +
    • updated AmigaDOS driver +
    • a few small speed optimizations in polygon rendering +
    +Changes: +
      +
    • internal device driver interface modified to simplify device + driver implementations and to support hardware Z buffers +
    • several changes to the X/Mesa interface (xmesa.h) +
    +Bug fixes: +
      +
    • fixed pow(0,0) domain error triggered on some systems +
    • glStencilClear() in a display list caused an infinite loop +
    • glRasterPos*() was sometimes off by +/-0.5 in X and Y +
    • color masking and blending were performed in wrong order +
    • auxSolidCylinder() sometimes drew a wire-frame cylinder +
    • fixed file writing bug in osdemo.c +
    • pixel mapping didn't always work +
    • the GL_GEQUAL stencil func didn't work +
    • the GL_INVERT stencil op didn't work +
    • the stencil write mask didn't work +
    • glPush/PopAttrib() didn't do enough error checking +
    • glIsList() didn't always work correctly +
    + +

    2.0 October 10, 1996

    +New: +
      +
    • Implements OpenGL 1.1 API functions +
    • all texture filtering modes supported (mipmapping) +
    • faster texture mapping, see Performance Tip 11 in README +
    • antialiased RGB points +
    • X support for line and polygon stippling +
    • glDrawBuffer( GL_FRONT_AND_BACK ) works +
    • util/ directory of useful stuff +
    • demos/texobj demo of texture objects +
    +Changes: +
      +
    • major internal changes for thread-safeness +
    • new device driver interface +
    • MESA_ALPHA env variable removed +
    • triangle rasterizer replaces polygon rasterizer +
    +Bug fixes: +
      +
    • glPopAttrib() bug +
    • glDrawBuffer(GL_NONE) works now +
    + +

    2.1 December 14, 1996

    +New: +
      +
    • VMS support +
    • MS-DOS driver +
    • OpenStep support +
    • updated, combined Windows 95/NT driver +
    • implemented glGetLighti() and glGetTexGen*() +
    • GLX does garbage collection of ancillary buffers +
    +Bug fixes: +
      +
    • removed unused _EXT constants from gl.h +
    • fixed polygon offset bugs +
    • Z coordinates of clipped lines were incorrect +
    • glEdgeFlag() in display lists didn't always work +
    • glLight*() in display lists didn't work +
    • fixed X line stipple bugs (Michael Pichler) +
    • glXUseXfonts XFreeFont/XFreeFontInfo bug fixed +
    • fixed a feedback bug +
    • glTexGen*() now transforms GL_EYE_PLANE by inverse modelview matrix +
    • polygons were sometimes culled instead of clipped +
    • triangle rasterizer suffered from float/int overflow exceptions +
    • fixed FP underflow exception in lighting (specular exponent) +
    • glEnable/glDisable of GL_EXT_vertex_array enums didn't work +
    • fixed free(NULL) in GLU tesselator code +
    • using 24-bit color on some X servers resulted in garbage rendering +
    • 32-bit per pixel mode for XFree86 now works +
    • glRotate(a,0,0,0) gave unpredictable results +
    • GL_LINE_STRIP with > 480 vertices had occasional clipping problems +
    • 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap +
    • glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled +
    • glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right +
    • accumulation buffer was limited to positive values +
    • projective textures didn't work +
    • selection buffer overflows weren't handled correctly +
    +Changes: +
      +
    • restored the GL_EXT_polygon_offset extension +
    • slightly faster RGB dithering +
    • the SVGA driver works again +
    • Amiga driver now distributed separately +
    • NeXT driver updated for Mesa 2.x +
    + +

    2.2 March 14, 1997

    +New: +
      +
    • better color selection when dithering +
    • added GL_EXT_texture_object extension +
    • updated MS-DOS driver for DJGPP +
    • added openbsd make configuration +
    • faster dithered flat-shaded triangles +
    • various compilation problems with Motif widgets fixed +
    • gl.h, glx.h and glu.h name mangling option +
    • BeOS driver +
    • 3D texture mapping extension +
    • GL_MESA_resize_buffers extension +
    • morph3d, stex3d and spectex demos +
    • 3Dfx support +
    +Bug fixes: +
      +
    • glColorMaterial should finally work right in all respects +
    • linear interpolation of mipmap levels was incorrectly weighted +
    • readpix.c didn't compile on Macintosh +
    • GL_INVERT and related logic ops didn't work right +
    • glTexImage[12]D() didn't check its parameters consistantly +
    • fixed a memory leak in glTexImage[12]D() +
    • kludged around a SunOS 5.x/GCC compiler bug in the feedback code +
    • glReadPixels aborted instead of normally catching some errors +
    • a few 1.1 constants were missing or misnamed in gl.h +
    • glBegin(p); glBegin(q); didn't generate an error +
    • fixed a memory leak in GLX code +
    • clipping of concave polygons could cause a core dump +
    • 1-component alpha texture maps didn't work +
    • fixed a GLU polygon tesselator bug +
    • polygons with colinear vertices were sometimes culled +
    • feedback triangle colors were wrong when using smooth shading +
    • textures with borders didn't work correctly +
    • colors returned in feedback mode were wrong when using lighting +
    • spotlights didn't effect ambient lighting correctly +
    • gluPartialDisk() had a few bugs +
    +Changes: +
      +
    • device driver interface expanded to support texture mapping +
    • faster matrix inversion subroutine +
    • commented out #include "wmesa_extend.h" from src/wmesa.c +
    • fixed many compiler warnings in the demo programs +
    + +

    2.3 June 30, 1997

    +New: +
      +
    • Mesa distribution divided into two pieces: library code and demos +
    • faster vertex transformation, clip testing, lighting +
    • faster line drawing +
    • TrueColor visuals how have dithering (for depths < 24 bits) +
    • added MESA_NO_DITHER environment variable +
    • new device driver function: NearFar(), RenderVB(), RasterSetup() +
    • added LynxOS configuration +
    • added cygnus Win32 configuration +
    • added texcyl.c GLUT demo +
    • added XMesaDitherColor() to X/Mesa interface +
    • new NURBS code from Bogdan Sikorski +
    • added demos/shape.c (non-rectangular X window!) +
    +Bug fixes: +
      +
    • glEnable/DisableClientState() were missing from GL/gl.h +
    • GL_SPHERE_MAP texcoord generation didn't work correctly +
    • glXGetConfig() returned wrong number of depth, stencil, accum bits +
    • glDrawPixels feedback/selection didn't examine RasterPos valid bit +
    • black and white were reversed on some monochrome displays +
    • fixed potential image memory leak (wasn't setting reference counter) +
    • glDrawPixels sometimes didn't recognize some GL state changes +
    • gluProject/UnProject() didn't check for divide by zero +
    • stex3d demo called random() and srandom(), not portable +
    • fixed memory leaks in context.c and drawpix.c +
    • fixed NULL dereferencing problem in gl_update_texture_state() +
    • glReadPixels between glBegin/glEnd didn't generate an error. +
    • fixed memory leak in polygon tesselator (Randy Frank) +
    • fixed seg fault bug drawing flat-shaded, depth-tested lines +
    • clipped GL_TRIANGLE_STRIPs sometimes had wrong color when flat-shaded +
    • glBindTexture sometimes didn't work +
    • fixed a bug deep in glXReleaseBuffersMESA() +
    • fog was mistakenly applied to alpha +
    • glPopMatrix didn't set "dirty matrix" flag +
    • glPolygonStipple pattern was sometimes wrong +
    • glClear wasn't disabled during feedback and selection +
    • fixed memory leak in glTexSubImage[123]D +
    +Changes: +
      +
    • many library source files reorganized +
    • faster X color allocation, colors also freed when finished with them +
    • new texture sampling function pointer in texture objects +
    • incorporated 3Dfx VooDoo driver v0.16 into main source tree +
    • many 3Dfx driver updates +
    • cygnus Makefiles now included +
    • updated DOS driver +
    • made a few changes to dosmesa.c and wmesa.c (VB->Unclipped) +
    • internally, colors now stored in GLubytes, not GLfixed +
    • optimized changing of GL_SHININESS parameter +
    + +

    2.4 September 18, 1997

    +New: +
      +
    • updated 3Dfx Glide driver +
    • hacks for 3Dfx rendering into an X window or fullscreen +
    • added depth buffer access functions to X/Mesa and OS/Mesa interfaces +
    +Bug fixes: +
      +
    • pixel buffer could overflow with long, wide lines +
    • fixed FP underflow problems in lighting +
    • glTexSubImage1D() had an unitialized variable +
    • incomplete texture objects could cause a segfault +
    • glDrawPixels with GL_COMPILE_AND_EXECUTE caused infinite loop +
    • flat-shaded quads in a strip were miscolored if clipped +
    • mipmapped triangle lod computation now works correctly +
    • fixed a few under/overflow bugs in triangle rasterizer +
    • glArrayElement() assigned bad normal if normal array disabled +
    • changed argument to glXReleaseBuffersMESA() +
    • fixed small triangle underflow bugs in tritemp.h (hopefully) +
    • glBindTexture(target, 0) caused a crash +
    • glTexImage[123]D() with NULL image pointer caused crash +
    • glPixelStore parameters are now ignored during display list execution +
    • fixed a two-sided lighting w/ clipping bug (black vertices) +
    • textures with width!=height were sometimes mis-rendered +
    • "weird" projection matrices could cause div by 0, other fp errors +
    +Changes: +
      +
    • changed precompiled header symbol from PCH to PC_HEADER +
    • split api.c into api1.c and api2.c +
    • added hash.c source file (but not used yet) +
    • a few Sun and HP configuration file changes +
    • MESA_GLX_FX env var replaces MESA_FX_WINDOW and MESA_FX_FULLSCREEN +
    • fixed a few cygnus build problems (src/Makefile.cygnus, src/wmesa.c) +
    + +

    2.5 November 20, 1997

    +New: +
      +
    • updated 3Dfx driver (v20) for GLQuake +
    • added GL_EXT_paletted_texture extension +
    • added GL_EXT_shared_texture_palette extension +
    • added GL_EXT_point_parameters extension +
    • now including Mark Kilgard's GLUT library v3.6 +
    • new GLUT-based demos in gdemos/ +
    • added a few more Unix config targets +
    • added Intel X86 assembly language vertex transformation code +
    • 3Dfx/Glide driver for Mesa now recognizes SST_SCREENREFRESH env var +
    • Windows 95 S3 Virge driver +
    +Bug fixes: +
      +
    • glCopyTexImage?D would crash due to uninitialized variable +
    • glColor w/ glColorMaterial in a display list caused a bug +
    • fixed several glDrawPixels() and ReadPixels() bugs in 3Dfx driver +
    • glVertex4*() vertices weren't always projected correctly +
    • trying to use mipmapped textured points or lines caused crash +
    • glColor[34][fd]() values now clamped to [0,1] before int conversion +
    +Changes: +
      +
    • new device driver functions for texture mapping +
    • hash tables used for display list and texture object lookup +
    • fixed GLX visual handling code to avoid saving redundant visuals +
    • 3Dfx Glide libraries automatically linked to libMesaGL.so +
    • dropped the Cirrus Logic Mondello code since it's obsolete +
    • updated Cygnus Makefiles (Stephane Rehel) +
    • updated Windows MSVC++ Makefiles (Oleg Letsinsky) +
    • procedure for making library files has changed: scripts now take + a major and minor version arguments. Make-config changed a lot. +
    • new implementation of glTexSubImage2D() +
    • updated widgets-mesa directory to create libMesaGLwM.a (Motif widget) +
    • separate linux-glide and linux-386-glide configurations +
    + +

    2.6 February 12, 1998

    +New: +
      +
    • Windows WGL functions +
    • updated VMS, DOS, Windows, Cygnus, BeOS, Amiga compilation support +
    • v0.22 of 3Dfx Glide driver +
    • more X86 assembly language optimizations +
    • faster blending for some modes +
    • XMesaSetFXmode() to switch between 3Dfx window and full-screen mode +
    • added preliminary thread support +
    • added GLX_MESA_copy_sub_buffer extension +
    • some clipping optimizations +
    +Bug fixes: +
      +
    • fixed shading/material bug when drawing long primitive strips +
    • fixed clipping problem in long primitive strips +
    • fixed clipping bug when using 3Dfx driver +
    • fixed a problem when trying to use X fonts w/ 3Dfx driver +
    • fixed a texture filter bug in 3Dfx/Glide driver +
    • fixed bug in 3Dfx/Glide driver involving depth mask & clearing +
    • glLoadMatrix to set projection matrix confused the 3Dfx driver +
    • non-identity texture matrices didn't work with linux-386 configs +
    • glGenTextures() didn't reserve the returned texture IDs +
    • NULL proxy image sent to glTexImageXD() caused crash +
    • added texture state validation optimization (Henk Kok) +
    • fixed colormap reuse problem when using both RGB and CI windows +
    • 32bpp True/DirectColor X visuals weren't recognized +
    • fixed potential problem in evaluators memory allocation +
    • fixed assorted demo compilation bugs +
    +Changes: +
      +
    • replaced old Mesa/windows/ directory with Mesa/WIN32/ directory +
    • converted a few old glaux/gltk demos to GLUT +
    • renamed directories: demos -> xdemos, gdemos -> demos +
    + + +

    3.0 September 17, 1998

    +New: +
      +
    • OpenGL 1.2 API +
    • GL_EXT_abgr pixel format extension +
    • GL_SGIS_texture_edge_clamp extension +
    • GL_SGIS_multitexture extension (to be replaced by GL_ARB_multitex) +
    • GL_EXT_multitexture extension (to be replaced by GL_ARB_multitex) +
    • GL_EXT_rescale_normal extension and renormal.c demo +
    • GLX_SGI_video_sync extension (a no-op) +
    • antialiased lines +
    • glGetTexImage() now implemented +
    • glDraw/Copy/ReadPixels() optimizations +
    • optimized textured triangle code (Marten Stromberg) +
    • more optimization of dithered TrueColor triangles in X driver +
    • Linux GGI driver +
    • updated MGL driver +
    +Bug fixes: +
      +
    • lots of assorted compilation fixes +
    • glInitNames didn't write initial hit record +
    • glBitmap didn't always check for invalid raster position +
    • switching between GLX and OSMesa contexts caused a crash +
    • fixed uninitialized variable in Mesa widget code +
    • fixed typo in texture code which caused book/texgen to crash +
    • fixed texture sampling bug when filter=GL_LINEAR and wrap=GL_CLAMP +
    • gluDisk() in POINT or LINE mode sometimes failed +
    • fixed texture + fog bug +
    • GL_COMPILE_AND_EXECUTE mode didn't work reliably +
    • glMultMatrix in projection matrix mode w/ 3Dfx driver could fail +
    • glDrawPixels(color index pixels) weren't converted to RGBA +
    • fixed possible getenv() buffer overflow security bug +
    • glBitmap in feedback mode was offset by xOrig, yOrig params +
    • device driver's DrawPixels hook was never used +
    • glDrawPixels with zoomY!=1 and top/bottom clipping didn't work +
    • glDrawPixels optimized for GL_LUMINANCE, GL_LUMINANCE_ALPHA, GLubyte +
    • fixed MakeCurrent bug in GLwRedrawObjects() in MesaWorkstation.c +
    • glCopyTexSubImage2D() didn't work with 3Dfx driver +
    • lines with width = 2 could cause crash +
    • glClear with scissor rect sometimes cleared whole buffer +
    • glTexSubImage2D( .. GL_COLOR_INDEX .. ) didn't work +
    • glTexImageXD( .. GL_ABGR_EXT .. ) didn't work +
    • computation of inverse modelview matrix sometimes failed +
    • fixed GL_CLAMP mode texture sampling bug +
    • textured line interpolation was somewhat broken +
    • textured triangle interpolation was also somewhat broken +
    • glGet(MODELVIEW/PROJECTION/TEXTURE_MATRIX_STACK_DEPTH) off by one +
    • evaluator state wasn't fully initialized +
    • texture coordinate clipping was buggy +
    • evaluator surfaces could be mis-colored +
    • glAccum(GL_RETURN, s) didn't obey glColorMask() settings +
    • zero area polygons shouldn't be culled if polygon mode is point/line +
    • clipped width and height of glReadPixels was sometimes off by one +
    • blending with alpha = 0 or 1.0 wasn't always exact +
    • reading of pixels from clipped region was buggy +
    • minor tweaking of X visual management in GLX emulator +
    • glPolygonStipple now obeys pixel unpacking parameters +
    • glGetPolygonStipple now obeys pixel packing parameters +
    • interleaved vertex array texture coordinates were broken +
    • query of proxy texture internal format was broken +
    • alpha channel wasn't reliably cleared +
    • fixed divide by zero error in gluScaleImage if dest size = 1 x 1 +
    +Conformance bug fixes: +
      +
    • GL_SELECTION_BUFFER_POINTER and GL_SELECTION_BUFFER_SIZE were missing +
    • GL_TEXTURE_INTERNAL_FORMAT was missing +
    • glGet*(GL_POLYGON_STIPPLE) was broken +
    • glPush/PopAttrib() didn't save/restore all texture state +
    • glBitmap in feedback mode didn't work +
    • feedback of texture coords didn't always work +
    • glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLbyte was broke +
    • glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLubyte was broke +
    • glDrawPixels w/ format=GL_STENCIL_INDEX, type=GL_BITMAP was broke +
    +Changes: +
      +
    • upgraded GLUT to version 3.7 +
    • only GL and GLU library code included in MesaLib.tar.gz +
    • GLUT and all demos now in MesaDemos.tar.gz +
    • glaux and gltk libraries removed +
    • IRIX -n32 and -64 libs go in lib32/ and lib64/ directories +
    + + +

    3.1 beta 1 November 19, 1998

    +New: +
      +
    • GL_EXT_stencil_wrap extension +
    • GL_INGR_blend_func_separate extension +
    • GL_ARB_multitexture extension +
    • GL_NV_texgen_reflection extension +
    • newly optimized vertex transformation code +
    • updated GLUT 3.7 code +
    • better precision when using 32-bit Z buffer +
    • Allegro DJGPP driver +
    +Bug fixes: +
      +
    • glCopyPixels between front/back buffers didn't copy alpha correctly +
    • fixed out-of-bounds memory access in optimized 2-D texture code +
    • glPixelStorei didn't accept GL_PACK/UNPACK_IMAGE_HEIGHT parameter +
    • glGet*() didn't accept GL_MAX_3D_TEXTURE_SIZE parameter +
    • clipping of texture coordinates sometimes had bad R,Q values +
    • GL_CLAMP_TO_EDGE texture sampling was off by 0.5 texels +
    • glEdgeFlagPointer() now takes a GLvoid * instead of GLboolean * +
    • texture was sometimes applied twice with 3Dfx driver +
    • glPush/PopAttrib() fouled up texture object reference counts +
    • glDeleteLists(0, n) caused assertion failure +
    • bilinear texture sampling wasn't accurate enough +
    • glClear w/ glDepthMask(GL_FALSE) didn't work right on 3Dfx +
    • color components were reversed on big endian 32 bpp X visuals +
    +Changes: +
      +
    • removed GL_EXT_multitexture extension +
    + + +

    3.1 beta 2 May 24, 1999

    +New: +
      +
    • multi-textured points and lines (mjk@nvidia.com) +
    • optimized 24bpp X rendering (bernd.paysan@gmx.de) +
    • added allegro support (bernie-t@geocities.com) +
    • cleaned-up Windows-related stuff (Ted Jump) +
    • minor stereo changes (KendallB@scitechsoft.com) +
    • new BeOS driver which implements BGLView class +
    • new Direct3D driver (see src/D3D) +
    • more efficient filled gluCylinder() function +
    • utilities: util/showbuffer.[ch] and util/glstate.[ch] +
    • fixed some IRIX compiler warnings +
    • added support for building Mesa in XFree86 with + SGI's GLX (kevin@precisioninsight.com) +
    +Bug fixes: +
      +
    • a variety of Windows/Mesa bug fixes (mjk@nvidia.com) +
    • packed pixel images weren't unpacked correctly +
    • patches some win32 files in GLUT (mjk@nvidia.com) +
    • glTexImage[123]D() didn't accept internalFormat == GL_COLOR_INDEX +
    • fixed lighting bug in Keith's new shading code +
    • fixed texture segfault seen in Lament screensaver +
    • fixed miscellaneous low-memory bugs +
    • glClear(GL_COLOR_BUFFER_BIT) with RGBA or CI masking was broken +
    • GL_LINEAR sampling of 3D textures was broken +
    • fixed SVR4 'cc' compiler macro problem (dawes@xfree86.org) +
    • added GL_TEXTURE_PRIORITY fix (keithh@netcomuk.co.uk) +
    • fixed wide point and wide line conformance bugs (brianp) +
    +Changes: +
      +
    • some device driver changes (see src/dd.h) +
    • new copyright on core Mesa code +
    + + +

    3.1 beta 3 September 17, 1999

    +New: +
      +
    • optimized glAccum function +
    • optimized 24bpp rendering in XMesa driver +
    • GLU 1.2 polygon tessellator +
    +Bug Fixes: +
      +
    • glGetTexLevelParameter wasn't fully implemented +
    • glXUseXFont now handles multi-byte fonts +
    • glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result +
    • alpha channel of blending points, lines was sometimes incorrect +
    +Changes: +
      +
    • New library names: "libGL" instead of "libMesaGL" +
    • New library numbering: libGL.so.1.2.310 +
    • New subdirectories: docs/ and bin/ +
    • New Makefile-system (autoconf,automake,libtool) +
    + + +

    3.1 final December 14, 1999

    +New: +
      +
    • added demos/gloss.c +
    • added xdemos/glxdpyinfo.c +
    • added GLX_ARB_get_proc_address extension +
    • rewritten glTexImage code paths (faster, less memory, bug fixes) +
    +Bug Fixes: +
      +
    • several vertex array bug fixes +
    • overlapping glCopyPixels with pixel zooming now works +
    • glXUseXFont() bitmaps were vertically shifted by one pixel +
    • glCopyPixels with pixel zooming now works +
    + + +

    3.2 final April 24, 2000

    +Bug fixes: +
      +
    • fixed memcpy bugs in span.c +
    • fixed missing glEnd problem in demos/tessdemo.c +
    • fixed bug when clearing 24bpp Ximages +
    • fixed clipping problem found in Unreal Tournament +
    • fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2 +
    • fixed Loki's 3dfx RGB vs BGR bug +
    • fixed Loki's 3dfx smooth/flat shading bug in SoF +
    +Changes: +
      +
    • updated docs/README file +
    • use bcopy() optimizations on FreeBSD +
    • re-enabled the optimized persp_textured_triangle() function +
    + + +

    3.2.1 July 19, 2000

    +Bug fixes: +
      +
    • gluBuild2DMipmaps() didn't accept GL_BGRA +
    • Fixed compile/makefile problems on IRIX +
    • fixed segfault in 3dfx driver when using GL selection/feedback +
    • no longer cull very, very tiny triangles +
    • blending w/ drawbuffer==GL_FRONT_BACK caused segfault (sw rendering) +
    • fixed Motif detection code in widgets-mesa/configure.in +
    • glColorMaterial and glMaterial updates to emissive and ambient + didn't always work right +
    • Specular highlights weren't always in the right place +
    • clipped GL_LINE mode polygons had interior lines appear +
    • blend term GL_ONE_MINUS_CONSTANT_ALPHA was broken +
    • GL_NICEST fog didn't always work with flat shading +
    • glRect commands in display lists were sometimes miscolored +
    • Line Z offset didn't always work +
    • fixed texgen normal vector problem (gloss's teapot) +
    • numerous GL conformance bugs fixed +
    +Changes: +
      +
    • glColorMask(false, false, false, false) handled better/faster +
    • reverted to old GLU polygon tessellator, GLU 1.1 +
    • updated Win32 build files +
    + + +

    3.3 July 21, 2000

    +New: +
      +
    • antialiased triangles now implemented +
    • GL_EXT_texture_env_add texture mode extension +
    • GLX 1.3 API +
    • support for separate draw/read buffers (ie GL_SGI_make_current_read) +
    • thread-safe API dispath +
    • improved glxinfo program +
    • demos/texdown program to measure texture download performance +
    • glext.h header file +
    • demos/geartrain program +
    • GL_EXT_texture_lod_bias extension +
    • demos/lodbias program +
    • further optimized glRead/DrawPixels for 16-bit TrueColor X visuals +
    • GLX_EXT_visual_rating extension (a no-op, however) +
    • GL_HP_occlusion_test extension (for X and OS/Mesa drivers) +
    • demos/occlude program +
    • GL_SGIS_pixel_texture and GL_SGIX_pixel_texture extensions +
    • demos/pixeltex program +
    • GL_SGI_color_matrix extension +
    • GL_SGI_color_table extension +
    • GL_EXT_histogram extension +
    • GL_ARB_texture_cube_map extension +
    • added xdemos/glxheads and xdemos/manywin +
    • demos/texenv.c demo +
    • GL_EXT_texture_env_combine extension (by Holger Waechtler) +
    • Xlib driver is now thread-safe (see xdemos/glthreads) +
        +Bug Fixes: +
      +
    • various GL conformance failures fixed since 3.2.1 +
    +Changes: +
      +
    • gl.h now uses #defines instead of C enums for all tokens +
    • glu.h now uses #defines instead of C enums for all tokens +
    • moved programs from 3Dfx/demos/ into demos/ directory +
    + + +

    3.4 November 3, 2000

    +New: +
      +
    • optimized glDrawPixels for glPixelZoom(1,-1) +Bug Fixes: +
    • widgets-mesa/src/*.c files were missing from 3.3 distro +
    • include/GL/mesa_wgl.h file was missing from 3.3 distro +
    • fixed some Win32 compile problems +
    • texture object priorities weren't getting initialized to 1.0 +
    • glAreTexturesResident return value was wrong when using hardware +
    • glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX) +
    • glReadPixels with GLushort packed types was broken +
    • fixed a few bugs in the GL_EXT_texture_env_combine texture code +
    • glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables +
    • fixed some typos/bugs in the VB code +
    • glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work +
    • optimized glDrawPixels paths weren't being used +
    • per-fragment fog calculation didn't work without a Z buffer +
    • improved blending accuracy, fixes Glean blendFunc test failures +
    • glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly +
    • glXGetProcAddressARB() didn't always return the right address +
    • gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format +
    • texture matrix changes weren't always detected (GLUT projtex demo) +
    • fixed random color problem in vertex fog code +
    • fixed Glide-related bug that let Quake get a 24-bit Z buffer +
        +Changes: +
      +
    • finished internal support for compressed textures for DRI +
    + + +

    3.4.1 February 14, 2001

    +New: +
      +
    • fixed some Linux build problems +
    • fixed some Windows build problems +
    • GL_EXT_texture_env_dot3 extension (Gareth Hughes) +
    +Bug fixes: +
      +
    • added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI +
    • various state-update code changes needed for DRI bugs +
    • disabled pixel transfer ops in glColorTable commands, not needed +
    • fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter +
    • updated sources and fixed compile problems in widgets-mesa/ +
    • GLX_PBUFFER enum value was wrong in glx.h +
    • fixed a glColorMaterial lighting bug +
    • fixed bad args to Read/WriteStencilSpan in h/w stencil clear function +
    • glXCopySubBufferMESA() Y position was off by one +
    • Error checking of glTexSubImage3D() was broken (bug 128775) +
    • glPopAttrib() didn't restore all derived Mesa state correctly +
    • Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL + conformance problems at 16bpp. +
    • clearing depth buffer with scissoring was broken, would segfault +
    • OSMesaGetDepthBuffer() returned bad bytesPerValue value +
    • fixed a line clipping bug (reported by Craig McDaniel) +
    • fixed RGB color over/underflow bug for very tiny triangles +
    +Known problems: +
      +
    • NURBS or evaluator surfaces inside display lists don't always work +
    + + +

    3.4.2 May 17, 2001

    +Bug fixes: +
      +
    • deleting the currently bound texture could cause bad problems +
    • using fog could result in random vertex alpha values +
    • AA triangle rendering could touch pixels outside right window bound +
    • fixed byteswapping problem in clear_32bit_ximage() function +
    • fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam +
    • fixed memory leak in glXUseXFont() +
    • fragment sampling in AA triangle function was off by 1/2 pixel +
    • Windows: reading pixels from framebuffer didn't always work +
    • glConvolutionFilter2D could segfault or cause FP exception +
    • fixed segfaults in FX and X drivers when using tex unit 1 but not 0 +
    • GL_NAND logicop didn't work right in RGBA mode +
    • fixed a memory corruption bug in vertex buffer reset code +
    • clearing the softwara alpha buffer with scissoring was broken +
    • fixed a few color index mode fog bugs +
    • fixed some bad assertions in color index mode +
    • fixed FX line 'stipple' bug #420091 +
    • fixed stencil buffer clear width/height typo +
    • fixed GL error glitches in gl[Client]ActiveTextureARB() +
    • fixed Windows compilation problem in texutil.c +
    • fixed 1/8-pixel AA triangle sampling error +
    +Changes: +
      +
    • optimized writing mono-colored pixel spans to X pixmaps +
    • increased max viewport size to 2048 x 2048 +
    + + +

    3.5 June 21, 2001

    +New: +
      +
    • internals of Mesa divided into modular pieces (Keith Whitwell) +
    • 100% OpenGL 1.2 conformance (passes all conformance tests) +
    • new AA line algorithm +
    • GL_EXT_convolution extension +
    • GL_ARB_imaging subset +
    • OSMesaCreateContextExt() function +
    • GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) +
    • GL_MAX_TEXTURE_UNITS_ARB now defaults to eight +
    • GL_EXT_fog_coord extension (Keith Whitwell) +
    • GL_EXT_secondary_color extension (Keith Whitwell) +
    • GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) +
    • GL_SGIX_depth_texture extension +
    • GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions +
    • demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow +
    • GL_ARB_texture_env_combine extension +
    • GL_ARB_texture_env_dot3 extension +
    • GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp) +
    • OSMesaCreateContextExt() function +
    • libOSMesa.so library, contains the OSMesa driver interface +
    • GL/glxext.h header file for GLX extensions +
    • somewhat faster software texturing, fogging, depth testing +
    • all color-index conformance tests now pass (only 8bpp tested) +
    • SPARC assembly language TCL optimizations (David Miller) +
    • GL_SGIS_generate_mipmap extension +
    +Bug Fixes: +
      +
    • fbiRev and tmuRev were unitialized when using Glide3 +
    • fixed a few color index mode conformance failures; all pass now +
    • now appling antialiasing coverage to alpha after texturing +
    • colors weren't getting clamped to [0,1] before color table lookup +
    • fixed RISC alignment errors caused by COPY_4UBV macro +
    • drawing wide, flat-shaded lines could cause a segfault +
    • vertices now snapped to 1/16 pixel to fix rendering of tiny triangles +
    +Changes: +
      +
    • SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU +
    • new libOSMesa.so library, contains the OSMesa driver interface +
    + + +

    4.0 October 22, 2001

    +New: +
      +
    • Mesa 4.0 implements the OpenGL 1.3 specification +
    • GL_IBM_rasterpos_clip extension +
    • GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp) +
    • GL_ARB_texture_mirrored_repeat extension +
    • WindML UGL driver (Stephane Raimbault) +
    • added OSMESA_MAX_WIDTH/HEIGHT queries +
    • attempted compiliation fixes for Solaris 5, 7 and 8 +
    • updated glext.h and glxext.h files +
    • updated Windows driver (Karl Schultz) +
    +Bug fixes: +
      +
    • added some missing GLX 1.3 tokens to include/GL/glx.h +
    • GL_COLOR_MATRIX changes weren't recognized by teximage functions +
    • glCopyPixels with scale and bias was broken +
    • glRasterPos with lighting could segfault +
    • glDeleteTextures could leave a dangling pointer +
    • Proxy textures for cube maps didn't work +
    • fixed a number of 16-bit color channel bugs +
    • fixed a few minor memory leaks +
    • GLX context sharing was broken in 3.5 +
    • fixed state-update bugs in glPopClientAttrib() +
    • fixed glDrawRangeElements() bug +
    • fixed a glPush/PopAttrib() bug related to texture binding +
    • flat-shaded, textured lines were broken +
    • fixed a dangling pointer problem in the XMesa code (Chris Burghart) +
    • lighting didn't always produce the correct alpha value +
    • fixed 3DNow! code to not read past end of arrays (Andrew Lewycky) +
    + + +

    4.0.1 December 17, 2001

    +New: +
      +
    • better sub-pixel sample positions for AA triangles (Ray Tice) +
    • slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO) +
    +Bug fixes: +
      +
    • added missing break statements in glGet*() for multisample cases +
    • fixed uninitialized hash table mutex bug (display lists / texobjs) +
    • fixed bad teximage error check conditional (bug 476846) +
    • fixed demos readtex.c compilation problem on Windows (Karl Schultz) +
    • added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT +
    • silence some compiler warnings (gcc 2.96) +
    • enable the #define GL_VERSION_1_3 in GL/gl.h +
    • added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h +
    • fixed glu.h typedef problem found with MSDev 6.0 +
    • build libGL.so with -Bsymbolic (fixes bug found with Chromium) +
    • added missing 'const' to glXGetContextIDEXT() in glxext.h +
    • fixed a few glXGetProcAddress() errors (texture compression, etc) +
    • fixed start index bug in compiled vertex arrays (Keith) +
    • fixed compilation problems in src/SPARC/glapi_sparc.S +
    • fixed triangle strip "parity" bug found in VTK medical1 demo (Keith) +
    • use glXGetProcAddressARB in GLUT to avoid extension linking problems +
    • provoking vertex of flat-shaded, color-index triangles was wrong +
    • fixed a few display list bugs (GLUT walker, molecule, etc) (Keith) +
    • glTexParameter didn't flush the vertex buffer (Ray Tice) +
    • feedback attributes for glDraw/CopyPixels and glBitmap were wrong +
    • fixed bug in normal length caching (ParaView lighting bug) +
    • fixed separate_specular color bug found in Chimera (18 Dec 2001) +
    + + +

    4.0.2 April 2, 2002

    +New: +
      +
    • New DOS (DJGPP) driver written by Daniel Borca +
    • New driver interface functions for TCL drivers (such as Radeon DRI) +
    • GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32" + if using deep color channels +
    • latest GL/glext.h and GL/glxext.h headers from SGI +
    +Bug fixes: +
      +
    • GL_BLEND with non-black texture env color wasn't always correct +
    • GL_REPLACE with GL_RGB texture format wasn't always correct (alpha) +
    • glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken +
    • glReadPixels was sometimes mistakenly clipped by the scissor box +
    • glDraw/ReadPixels didn't catch all the errors that they should have +
    • Fixed 24bpp rendering problem in Windows driver (Karl Schultz) +
    • 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c) +
    • Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP) +
    • glColorMask as sometimes effecting glXSwapBuffers() +
    • fixed a potential bug in XMesaGarbageCollect() +
    • N threads rendering into one window didn't work reliably +
    • glCopyPixels didn't work for deep color channels +
    • improved 8 -> 16bit/channel texture image conversion (Gerk Huisma) +
    • glPopAttrib() didn't correctly restore user clip planes +
    • user clip planes failed for some perspective projections (Chromium) +
    +Known bugs: +
      +
    • mipmap LOD computation +
    + + +

    4.0.3 June 25, 2002

    +New: +
      +
    • updated GL/glext.h file (version 15) +
    • corrected MMX blend code (Jose Fonseca) +
    • support for software-based alpha planes in Windows driver +
    • updated GGI driver (Filip Spacek) +
    +Bug fixes: +
      +
    • glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens +
    • OSMesaMakeCurrent() didn't recognize buffer size changes +
    • assorted conformance fixes for 16-bit/channel rendering +
    • texcombine alpha subtraction mode was broken +
    • fixed lighting bug with non-uniform scaling and display lists +
    • fixed bug when deleting shared display lists +
    • disabled SPARC cliptest assembly code (Mesa bug 544665) +
    • fixed a couple Solaris compilation/link problems +
    • blending clipped glDrawPixels didn't always work +
    • glGetTexImage() didn't accept packed pixel types +
    • glPixelMapu[is]v() could explode given too large of pixelmap +
    • glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT +
    • glXCopyContext() could lead to segfaults +
    • glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665) +
    +Changes: +
      +
    • lots of C++ (g++) code clean-ups +
    • lots of T&L updates for the Radeon DRI driver +
    +Known bugs: +
      +
    • mipmap LOD computation (fixed for Mesa 4.1) +
    + + +

    4.0.4 October 3, 2002

    +New: +
      +
    • GL_NV_texture_rectangle extension +
    • updated glext.h header (version 17) +
    • updated DOS driver (Daniel Borca) +
    • updated BeOS R5 driver (Philippe Houdoin) +
    • added GL_IBM_texture_mirror_repeat +
    • glxinfo now takes -l option to print interesting OpenGL limits info +
    • GL_MESA_ycbcr_texture extension +
    • GL_APPLE_client_storage extension (for some DRI drivers only) +
    • GL_MESA_pack_invert extension +
    +Bug fixes: +
      +
    • fixed GL_LINEAR fog bug by adding clamping +
    • fixed FP exceptions found using Alpha CPU +
    • 3dfx MESA_GLX_FX=window (render to window) didn't work +
    • fixed memory leak in wglCreateContest (Karl Schultz) +
    • define GLAPIENTRY and GLAPI if undefined in glu.h +
    • wglGetProcAddress didn't handle all API functions +
    • when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map +
    • removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc() +
    • error checking in compressed tex image functions had some glitches +
    • fixed AIX compile problem in src/config.c +
    • glGetTexImage was using pixel unpacking instead of packing params +
    • auto-mipmap generation for cube maps was incorrect +
    +Changes: +
      +
    • max texture units reduced to six to accomodate texture rectangles +
    • removed unfinished GL_MESA_sprite_point extension code +
    + + +

    4.1 October 29, 2002

    +New: +
      +
    • GL_NV_vertex_program extension +
    • GL_NV_vertex_program1_1 extension +
    • GL_ARB_window_pos extension +
    • GL_ARB_depth_texture extension +
    • GL_ARB_shadow extension +
    • GL_ARB_shadow_ambient extension +
    • GL_EXT_shadow_funcs extension +
    • GL_ARB_point_parameters extension +
    • GL_ARB_texture_env_crossbar +
    • GL_NV_point_sprite extension +
    • GL_NV_texture_rectangle extension +
    • GL_EXT_multi_draw_arrays extension +
    • GL_EXT_stencil_two_side extension +
    • GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions +
    • GL_ATI_texture_mirror_once extension (Ian Romanick) +
    • massive overhaul/simplification of software rasterizer module, + many contributions from Klaus Niederkrueger +
    • faster software texturing in some cases (i.e. trilinear filtering) +
    • new OSMesaGetProcAddress() function +
    • more blend modes implemented with MMX code (Jose Fonseca) +
    • added glutGetProcAddress() to GLUT +
    • added GLUT_FPS env var to compute frames/second in glutSwapBuffers() +
    • pbinfo and pbdemo PBuffer programs +
    • glxinfo -v prints transprent pixel info (Gerd Sussner) +
    +Bug fixes: +
      +
    • better mipmap LOD computation (prevents excessive blurriness) +
    • OSMesaMakeCurrent() didn't recognize buffer size changes +
    • assorted conformance fixes for 16-bit/channel rendering +
    • texcombine alpha subtraction mode was broken +
    • fixed some blend problems when GLchan==GLfloat (Gerk Huisma) +
    • clamp colors to [0,inf] in OSMesa if GLchan==GLfloat (Gerk Huisma) +
    • fixed divide by zero error in NURBS tessellator (Jon Perry) +
    • fixed GL_LINEAR fog bug by adding clamping +
    • fixed FP exceptions found using Alpha CPU +
    • 3dfx/glide driver render-to-window feature was broken +
    • added missing GLX_TRANSPARENT_RGB token to glx.h +
    • fixed error checking related to paletted textures +
    • fixed reference count error in glDeleteTextures (Randy Fayan) +
    +Changes: +
      +
    • New spec file and Python code to generate some GL dispatch files +
    • Glide driver defaults to "no" with autoconf/automake +
    • updated demos/stex3d with new options +
    + + +

    5.0 November 13, 2002

    +New: +
      +
    • OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4") +
    • removed some overlooked debugging code +
    • glxinfo updated to support GLX_ARB_multisample +
    • GLUT now support GLX_ARB_multisample +
    • updated DOS driver (Daniel Borca) +
    +Bug fixes: +
      +
    • GL_POINT and GL_LINE-mode polygons didn't obey cull state +
    • fixed potential bug in _mesa_align_malloc/calloc() +
    • fixed missing triangle bug when running vertex programs +
    • fixed a few HPUX compilation problems +
    • FX (Glide) driver didn't compile +
    • setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work +
    • a few EXT functions, like glGenTexturesEXT, were no-ops +
    • a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate, + glMultiDrawArrays and glMultiDrawElements were missing +
    • glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken +
    • Pentium 4 Mobile was mistakenly identified as having 3DNow! +
    • fixed one-bit error in point/line fragment Z calculation +
    • fixed potential segfault in fakeglx code +
    • fixed color overflow problem in DOT3 texture env mode +
    + + +

    5.0.1 March 30, 2003

    +New: +
      +
    • DOS driver updates from Daniel Borca +
    • updated GL/gl_mangle.h file (Bill Hoffman) +Bug fixes: +
    • auto mipmap generation for cube maps was broken (bug 641363) +
    • writing/clearing software alpha channels was unreliable +
    • minor compilation fixes for OS/2 (Evgeny Kotsuba) +
    • fixed some bad assertions found with shadowtex demo +
    • fixed error checking bug in glCopyTexSubImage2D (bug 659020) +
    • glRotate(angle, -x, 0, 0) was incorrect (bug 659677) +
    • fixed potential segfault in texture object validation (bug 659012) +
    • fixed some bogus code in _mesa_test_os_sse_exception_support (Linus) +
    • fix fog stride bug in tnl code for h/w drivers (Michel Danzer) +
    • fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080) +
    • glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3 +
    • fixed compilation problem on Solaris7/x86 (bug 536406) +
    • fixed prefetch bug in 3DNow! code (Felix Kuhling) +
    • fixed NeXT build problem (FABSF macro) +
    • glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811) +
    • zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964) +
    • AA line and triangle Z values are now rounded, not truncated +
    • fixed color interpolation bug when GLchan==GLfloat (bug 694461) +
    • glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca) +
    • fixed a minor GL_COLOR_MATERIAL bug +
    • NV vertex program EXP instruction was broken +
    • glColorMask misbehaved with X window / pixmap rendering +
    • fix autoconf/libtool GLU C++ linker problem on Linux (a total hack) +
    • attempt to fix GGI compilation problem when MesaDemos not present +
    • NV vertex program ARL-relative fetches didn't work +
    +Changes: +
      +
    • use glPolygonOffset in gloss demo to avoid z-fighting artifacts +
    • updated winpos and pointblast demos to use ARB extensions +
    • disable SPARC normal transformation code (bug 673938) +
    • GLU fixes for OS/2 (Evgeny Kotsuba) +
    + + +

    5.0.2 September 5, 2003

    +Bug fixes: +
      +
    • fixed texgen problem causing texcoord's Q to be zero (stex3d) +
    • default GL_TEXTURE_COMPARE_MODE_ARB was wrong +
    • GL_CURRENT_MATRIX_NV query was wrong +
    • GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one +
    • GL_LIST_MODE query wasn't correct +
    • GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported +
    • GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value +
    • blended, wide lines didn't always work correctly (bug 711595) +
    • glVertexAttrib4svNV w component was always 1 +
    • fixed bug in GL_IBM_rasterpos_clip (missing return) +
    • GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly +
    • a few Solaris compilation fixes +
    • fixed glClear() problem for DRI drivers (non-existant stencil, etc) +
    • fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux) +
    • fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz) +
    • glFog() didn't clamp fog colors +
    • fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the + gl[Get]TexParameteri[v] functions +
    • fixed invalid memory references in glTexGen functions (bug 781602) +
    • integer-valued color arrays weren't handled correctly +
    • glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work +
    • GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1 +
    +Changes: +
      +
    • build GLUT with -fexceptions so C++ apps propogate exceptions +
    + + +

    5.1 December 17, 2003

    +New: +
      +
    • reorganized directory tree +
    • GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche) +
    • GL_ATI_texture_env_combine3 extension (Ian Romanick) +
    • GL_SGI_texture_color_table extension (Eric Plante) +
    • GL_NV_fragment_program extension +
    • GL_NV_light_max_exponent extension +
    • GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle) +
    • GL_ARB_occlusion_query extension +
    • GL_ARB_point_sprite extension +
    • GL_ARB_texture_non_power_of_two extension +
    • GL_IBM_multimode_draw_arrays extension +
    • GL_EXT_texture_mirror_clamp extension (Ian Romanick) +
    • GL_ARB_vertex_buffer_object extension +
    • new X86 feature detection code (Petr Sebor) +
    • less memory used for display lists and vertex buffers +
    • demo of per-pixel lighting with a fragment program (demos/fplight.c) +
    • new version (18) of glext.h header +
    • new spriteblast.c demo of GL_ARB_point_sprite +
    • faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1) +
    • faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1) +
    +Bug fixes: +
      +
    • really enable OpenGL 1.4 features in DOS driver. +
    • fixed issues in glDrawPixels and glCopyPixels for very wide images +
    • glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint +
    • fixed some texgen bugs reported by Daniel Borca +
    • fixed wglMakeCurrent(NULL, NULL) bug (#835861) +
    • fixed glTexSubImage3D z-offset bug (Cedric Gautier) +
    • fixed RGBA blend enable bug (Ville Syrjala) +
    • glAccum is supposed to be a no-op in selection/feedback mode +
    • fixed texgen bug #597589 (John Popplewell) +
    +Changes: +
      +
    • dropped API trace feature (src/Trace/) +
    • documentation overhaul. merged with website content. more html. +
    • glxgears.c demo updated to use GLX swap rate extensions +
    • glTexImage1/2/3D now allows width/height/depth = 0 +
    • disable SPARC asm code on Linux (bug 852204) +
    + + +

    6.0 January 16, 2004

    +New: +
      +
    • full OpenGL 1.5 support +
    • updated GL/glext.h file to version 21 +Changes: +
    • changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h) +Bug fixes: +
    • fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color + clamping issue +
    • updated suno5-gcc configs +
    • glColor3 functions sometimes resulted in undefined alpha values +
    • fixed FP divide by zero error seen on VMS with xlockmore, others +
    • fixed vertex/fragment program debug problem (bug 873011) +
    • building on AIX with gcc works now +
    • glDeleteProgramsARB failed for ARB fragment programs (bug 876160) +
    • glDrawRangeElements tried to modify potentially read-only storage +
    • updated files for building on Windows +
    + + +

    6.0.1 April 2, 2004

    +New: +
      +
    • upgraded glext.h to version 22 +
    • new build targets (Dan Schikore) +
    • new linux-x86-opteron build target (Heath Feather) +
    +Bug fixes: +
      +
    • glBindProgramARB didn't update all necessary state +
    • fixed build problems on OpenBSD +
    • omit CVS directories from tarballs +
    • glGetTexImage(GL_COLOR_INDEX) was broken +
    • fixed an infinite loop in t&l module +
    • silenced some valgrind warnings about using unitialized memory +
    • fixed some compilation/link glitches on IRIX (Mike Stephens) +
    • glBindProgram wasn't getting compiled into display lists +
    • GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079) +
    • two-sided lighting and vertex program didn't work (bug 887330) +
    • stores to program parameter registers in vertex state programs + didn't work. +
    • fixed glOrtho bug found with gcc 3.2.2 (RH9) +
    • glXCreateWindow() wasn't fully implemented (bug 890894) +
    • generic vertex attribute arrays didn't work in display lists +
    • vertex buffer objects' default usage and access fields were wrong +
    • glDrawArrays with start!=0 was broken +
    • fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken +
    • linux-osmesa16-static config didn't work +
    • fixed a few color index rendering problems (bug 910687) +
    • glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE +
    • OSMesa RGB and BGR modes were broken +
    • glProgramStringARB mistakenly required a null-terminated string +
    • fragment program XPD instruction was incorrect +
    • glGetMaterial() didn't work reliably +
    • ARB_fragment_program KIL instruction was incorrect +
    + + +

    6.1 August 18, 2004

    +New: +
      +
    • Revamped Makefile system +
    • glXUseRotatedXFont() utility (see xdemos/xuserotfont.c) +
    • internal driver interface changes related to texture object + allocation, vertex/fragment programs, BlendEquationSeparate, etc. +
    • option to walk triangle edges with double-precision floats + (Justin Novosad of Discreet) (see config.h file) +
    • support for AUX buffers in software GLX driver +
    • updated glext.h to version 24 and glxext.h to version 6 +
    • new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars +
    • updated BeOS support (Philippe Houdoin) +
    +Changes: +
      +
    • fragment fog interpolation is perspective corrected now +
    • new glTexImage code, much cleaner, may be a bit faster +
    +Bug fixes: +
      +
    • glArrayElement in display lists didn't handle generic vertex attribs +
    • glFogCoord didn't always work properly +
    • ARB_fragment_program fog options didn't work +
    • frag prog TEX instruction no longer incorrectly divides s,t,r by q +
    • ARB frag prog TEX and TEXP instructions now use LOD=0 +
    • glTexEnviv in display lists didn't work +
    • glRasterPos didn't do texgen or apply texture matrix +
    • GL_DOUBLE-valued vertex arrays were broken in some cases +
    • fixed texture rectangle edge/border sampling bugs +
    • sampling an incomplete texture in a fragment program would segfault +
    • glTexImage was missing a few error checks +
    • fixed some minor glGetTexParameter glitches +
    • GL_INTENSITY was mistakenly accepted as a to glTexImage +
    • fragment program writes to RC/HC register were broken +
    • fixed a few glitches in GL_HP_occlusion_test extension +
    • glBeginQueryARB and glEndQueryARB didn't work inside display lists +
    • vertex program state references were broken +
    • fixed triangle color interpolation bug on AIX (Shane Blackett) +
    • fixed a number of minor memory leaks (bug #1002030) +
    + + +

    6.2 October 2, 2004

    +New: +
      +
    • enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle) +
    • updated Doxygen support (Jose Fonseca) +
    +Changes: +
      +
    • some GGI driver updates (Christoph Egger, bug 1025977) +
    +Bug fixes: +
      +
    • Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features +
    • fixed a few compilation issues on IRIX +
    • fixed a matrix classification bug (reported by Wes Bethel) +
    • we weren't reseting the vertex/fragment program error state + before parsing (Dave Reveman) +
    • adjust texcoords for sampling texture rectangles (Dave Reveman) +
    • glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented +
    • repeated calls to glDeleteTexture(t) could lead to a crash +
    • fixed potential ref count bugs in VBOs and vertex/fragment programs +
    • spriteblast demo didn't handle window size changes correctly +
    • glTexSubImage didn't handle pixels=NULL correctly for PBOs +
    • fixed color index mode glDrawPixels bug (Karl Schultz) +
    + + +

    6.2.1 December 9, 2004

    +Bug fixes: +
      +
    • don't apply regular fog or color sum when using a fragment program +
    • glProgramEnvParameter4fARB always generated an error on + GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645) +
    • glVertexAttrib3svNV and glVertexAttrib3svARB were broken +
    • fixed width/height mix-up in glSeparableFilter2D() +
    • fixed regression in glCopyPixels + convolution +
    • glReadPixels from a clipped front color buffer didn't always work +
    • glTexImage didn't accept GL_RED/GREEN/BLUE as the format +
    • Attempting queries/accesses of VBO 0 weren't detected as errors +
    • paletted textures failed if the palette had fewer than 256 entries +
    +Changes: +
      +
    • fixed a bunch of compiler warnings found with gcc 3.4 +
    • bug reports should to go bugzilla.freedesktop.org +
    + + +

    6.3 July 20, 2005

    +New: +
      +
    • GL_EXT_framebuffer_object extension +
    • GL_ARB_draw_buffers extension +
    • GL_ARB_pixel_buffer_object extension +
    • GL_OES_read_format extension (Ian Romanick) +
    • DirectFB driver (Claudio Ciccani) +
    • x86_64 vertex transformation code (Mikko T.) +
    • Updated GL/glext.h to version 29 +
    +Changes: +
      +
    • added -stereo option for glxgears demo (Jacek Rosik) +
    • updated the PBuffer demo code in xdemos/ directory +
    • glDeleteTextures/Programs/Buffers() now makes the object ID + available for immediate re-use +
    • assorted 64-bit clean-ups fixes (x86_64 and Win64) +
    • lots of internal changes for GL_EXT_framebuffer_object +
    +Bug fixes: +
      +
    • some functions didn't support PBO functionality +
    • glGetTexImage didn't convert color index images to RGBA as required +
    • fragment program texcoords were sometimes wrong for points and lines +
    • fixed problem with negative dot product in arbfplight, fplight demos +
    • fixed bug in perspective correction of antialiased, textured lines +
    • querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value +
    • fixed a couple per-pixel fog bugs (Soju Matsumoto) +
    • glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken +
    • fixed float parsing bug in ARB frag/vert programs (bug 2520) +
    • XMesaGetDepthBuffer() returned incorrect value for bytesPerValue +
    • GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha +
    • glXChooseFBConfig() crashed if attribList pointer was NULL +
    • program state.light[n].spot.direction.w was wrong value (bug 3083) +
    • fragment program fog option required glEnable(GL_FOG) - wrong. +
    • glColorTable() could produce a Mesa implementation error (bug 3135) +
    • RasterPos could get corrupted by color index rendering path +
    • Removed bad XTranslateCoordinates call when rendering to Pixmaps +
    • glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state +
    • fixed a few Darwin compilation problems +
    + + +

    6.3.1

    +

    +This was an intermediate release for X.org which wasn't otherwise released.) +

    + + +

    6.3.2 August 19, 2005

    +New: +
      +
    • The distribution now includes the DRI drivers and GLX code +
    +Changes: +
      +
    • Made the DRI "new" driver interface standard, remove old code +
    +Bug fixes: +
      +
    • GL_ARB_vertex/fragment_shader were mistakenly listed in the + extensions string +
    • negative relative addressing in vertex programs was broken +
    • update/fix SPARC assembly code for vertex transformation +
    • fixed memory leak when freeing GLX drawables/renderbuffers +
    • fixed display list memory leak +
    • the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer +
    • wglGetProcAddress() didn't handle wgl-functions +
    • fixed glxext.h cross-compile issue (Colin Harrison) +
    • assorted DRI driver fixes +
    + + + +NOTE: Changes for Mesa 6.4 and later are documented in the corresponding +
    release notes file. + + + + + diff -Nru xpsb-glx-0.19/mesa/docs/webmaster.html xpsb-glx-0.19/mesa/docs/webmaster.html --- xpsb-glx-0.19/mesa/docs/webmaster.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/webmaster.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,24 @@ + + +Mesa Introduction + + + + + +

    Webmaster

    + +

    +If you have problems, edits or additions for this website send them +to Brian +(brian.e.paul gmail.com). +

    + +

    +Mark Manning made the frame-based layout for the website. +Brian's modified it a lot since then. +

    + + + + diff -Nru xpsb-glx-0.19/mesa/docs/xlibdriver.html xpsb-glx-0.19/mesa/docs/xlibdriver.html --- xpsb-glx-0.19/mesa/docs/xlibdriver.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/docs/xlibdriver.html 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,291 @@ + + +Xlib Software Driver + + + + + +

    Xlib Software Driver

    + +

    +Mesa's Xlib driver provides an emulation of the GLX interface so that +OpenGL programs which use the GLX API can render to any X display, even +those that don't support the GLX extension. +Effectively, the Xlib driver converts all OpenGL rendering into Xlib calls. +

    + +

    +The Xlib driver is the oldest Mesa driver and the most mature of Mesa's +software-only drivers. +

    + +

    +Since the Xlib driver emulates the GLX extension, it's not +totally conformant with a true GLX implementation. +The differences are fairly obscure, however. +

    + +

    +The unique features of the Xlib driver follows. +

    + + +

    X Visual Selection

    +

    +Mesa supports RGB(A) rendering into almost any X visual type and depth. +

    +

    +The glXChooseVisual function tries to choose the best X visual +for the given attribute list. However, if this doesn't suit your needs +you can force Mesa to use any X visual you want (any supported by your +X server that is) by setting the MESA_RGB_VISUAL and +MESA_CI_VISUAL +environment variables. +When an RGB visual is requested, glXChooseVisual +will first look if the MESA_RGB_VISUAL variable is defined. +If so, it will try to use the specified visual. +Similarly, when a color index visual is requested, glXChooseVisual will +look for the MESA_CI_VISUAL variable. +

    + +

    +The format of accepted values is: visual-class depth +

    +

    +Here are some examples: +

    +
    +   using csh:
    +	% setenv MESA_RGB_VISUAL "TrueColor 8"		// 8-bit TrueColor
    +	% setenv MESA_CI_VISUAL "PseudoColor 12"	// 12-bit PseudoColor
    +	% setenv MESA_RGB_VISUAL "PseudoColor 8"	// 8-bit PseudoColor
    +
    +   using bash:
    +	$ export MESA_RGB_VISUAL="TrueColor 8"
    +	$ export MESA_CI_VISUAL="PseudoColor 12"
    +	$ export MESA_RGB_VISUAL="PseudoColor 8"
    +
    + + +

    Double Buffering

    +

    +Mesa can use either an X Pixmap or XImage as the back color buffer when in +double-buffer mode. +The default is to use an XImage. +The MESA_BACK_BUFFER environment variable can override this. +The valid values for MESA_BACK_BUFFER are: Pixmap and +XImage (only the first letter is checked, case doesn't matter). +

    + +

    +Using XImage is almost always faster than a Pixmap since it resides in +the application's address space. +When glXSwapBuffers() is called, XPutImage() or XShmPutImage() is used +to transfer the XImage to the on-screen window. +

    +

    +A Pixmap may be faster when doing remote rendering of a simple scene. +Some OpenGL features will be very slow with a Pixmap (for example, blending +will require a round-trip message for pixel readback.) +

    +

    +Experiment with the MESA_BACK_BUFFER variable to see which is faster +for your application. +

    + + +

    Colormaps

    +

    +When using Mesa directly or with GLX, it's up to the application +writer to create a window with an appropriate colormap. The GLUT +toolkit tris to minimize colormap flashing by sharing +colormaps when possible. Specifically, if the visual and depth of the +window matches that of the root window, the root window's colormap +will be shared by the Mesa window. Otherwise, a new, private colormap +will be allocated. +

    + +

    +When sharing the root colormap, Mesa may be unable to allocate the colors +it needs, resulting in poor color quality. This can happen when a +large number of colorcells in the root colormap are already allocated. +To prevent colormap sharing in GLUT, set the +MESA_PRIVATE_CMAP environment variable. The value isn't +significant. +

    + + +

    Gamma Correction

    +

    +To compensate for the nonlinear relationship between pixel values +and displayed intensities, there is a gamma correction feature in +Mesa. Some systems, such as Silicon Graphics, support gamma +correction in hardware (man gamma) so you won't need to use Mesa's +gamma facility. Other systems, however, may need gamma adjustment +to produce images which look correct. If you believe that +Mesa's images are too dim, read on. +

    + +

    +Gamma correction is controlled with the MESA_GAMMA environment +variable. Its value is of the form Gr Gg Gb or just G where +Gr is the red gamma value, Gg is the green gamma value, Gb is the +blue gamma value and G is one gamma value to use for all three +channels. Each value is a positive real number typically in the +range 1.0 to 2.5. +The defaults are all 1.0, effectively disabling gamma correction. +Examples: +

    +
    +	% export MESA_GAMMA="2.3 2.2 2.4"	// separate R,G,B values
    +	% export MESA_GAMMA="2.0"		// same gamma for R,G,B
    +
    +

    +The progs/demos/gamma.c program may help you to determine reasonable gamma +value for your display. With correct gamma values, the color intensities +displayed in the top row (drawn by dithering) should nearly match those +in the bottom row (drawn as grays). +

    + +

    +Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well +on HP displays using the HP-ColorRecovery technology. +

    + +

    +Mesa implements gamma correction with a lookup table which translates +a "linear" pixel value to a gamma-corrected pixel value. There is a +small performance penalty. Gamma correction only works in RGB mode. +Also be aware that pixel values read back from the frame buffer will +not be "un-corrected" so glReadPixels may not return the same data +drawn with glDrawPixels. +

    + +

    +For more information about gamma correction see: + +

    + + +

    Direct Rendering Flag

    +

    +Some applications won't run with indirect rendering contexts (which is +what the Xlib driver supports). +To force the glXIsDirect() query to return True, set the MESA_GLX_FORCE_DIRECT +environment variable. +For example: +

    +
    +	$ export MESA_GLX_FORCE_DIRECT=1
    +
    + + + +

    Overlay Planes

    +

    +Hardware overlay planes are supported by the Xlib driver. To +determine if your X server has overlay support you can test for the +SERVER_OVERLAY_VISUALS property: +

    +
    +	xprop -root | grep SERVER_OVERLAY_VISUALS
    +
    + + +

    HPCR Dithering

    +

    +If you set the MESA_HPCR_CLEAR environment variable then dithering +will be used when clearing the color buffer. This is only applicable +to HP systems with the HPCR (Color Recovery) feature. +This incurs a small performance penalty. +

    + + +

    Extensions

    +

    +The following MESA-specific extensions are implemented in the Xlib driver. +

    + +

    GLX_MESA_pixmap_colormap

    + +

    +This extension adds the GLX function: +

    +
    +    GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
    +                                      Pixmap pixmap, Colormap cmap )
    +
    +

    +It is an alternative to the standard glXCreateGLXPixmap() function. +Since Mesa supports RGB rendering into any X visual, not just True- +Color or DirectColor, Mesa needs colormap information to convert RGB +values into pixel values. An X window carries this information but a +pixmap does not. This function associates a colormap to a GLX pixmap. +See the xdemos/glxpixmap.c file for an example of how to use this +extension. +

    +

    +GLX_MESA_pixmap_colormap specification +

    + + +

    GLX_MESA_release_buffers

    +

    +Mesa associates a set of ancillary (depth, accumulation, stencil and +alpha) buffers with each X window it draws into. These ancillary +buffers are allocated for each X window the first time the X window +is passed to glXMakeCurrent(). Mesa, however, can't detect when an +X window has been destroyed in order to free the ancillary buffers. +

    +

    +The best it can do is to check for recently destroyed windows whenever +the client calls the glXCreateContext() or glXDestroyContext() +functions. This may not be sufficient in all situations though. +

    +

    +The GLX_MESA_release_buffers extension allows a client to explicitly +deallocate the ancillary buffers by calling glxReleaseBuffersMESA() +just before an X window is destroyed. For example: +

    +
    +         #ifdef GLX_MESA_release_buffers
    +            glXReleaseBuffersMESA( dpy, window );
    +         #endif
    +         XDestroyWindow( dpy, window );
    +
    +

    +GLX_MESA_release_buffers specification +

    +

    +This extension was added in Mesa 2.0. +

    + +

    GLX_MESA_copy_sub_buffer

    +

    +This extension adds the glXCopySubBufferMESA() function. It works +like glXSwapBuffers() but only copies a sub-region of the window +instead of the whole window. +

    +

    +GLX_MESA_copy_sub_buffer specification +

    +

    +This extension was added in Mesa 2.6 +

    + +

    Summary of X-related environment variables

    +
    +   MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
    +   MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
    +   MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
    +   MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
    +   MESA_GAMMA - gamma correction coefficients (X only)
    +   MESA_GLX_FORCE_DIRECT - report that the driver is direct rendering, even
    +      though it's not.
    +
    + + + + diff -Nru xpsb-glx-0.19/mesa/doxygen/common.doxy xpsb-glx-0.19/mesa/doxygen/common.doxy --- xpsb-glx-0.19/mesa/doxygen/common.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/common.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1153 @@ +# Doxyfile 1.3.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = Mesa + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 6.5 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of source +# files, where putting all generated files in the same directory would otherwise +# cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, +# Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = header.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = ../include + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse the +# parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = NO + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superseded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes that +# lay further from the root node will be omitted. Note that setting this option to +# 1 or 2 may greatly reduce the computation time needed for large code bases. Also +# note that a graph may be further truncated if the graph's image dimensions are +# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). +# If 0 is used for the depth value (the default), the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff -Nru xpsb-glx-0.19/mesa/doxygen/core_subset.doxy xpsb-glx-0.19/mesa/doxygen/core_subset.doxy --- xpsb-glx-0.19/mesa/doxygen/core_subset.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/core_subset.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,226 @@ +# Doxyfile 0.1 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa Main" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = YES +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +ENABLED_SECTIONS = subset +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_FORMAT = +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/main/ +FILE_PATTERNS = \ + accum.h \ + attrib.h \ + blend.[ch] \ + buffers.[ch] \ + dd.h \ + debug.h \ + depth.h \ + dlist.h \ + context.[ch] \ + config.h \ + colormac.h \ + colortab.h \ + enable.h \ + enums.h \ + eval.h \ + extensions.h \ + feedback.[ch] \ + fog.h \ + get.h \ + glheader.h \ + glthread.h \ + hash.[ch] \ + hint.h \ + histogram.h \ + image.[ch] \ + imports.[ch] \ + lines.[ch] \ + light.h \ + matrix.[ch] \ + macros.h \ + mmath.h \ + mtypes.h \ + pixel.h \ + points.[ch] \ + polygon.[ch] \ + rastpos.[ch] \ + simple_list.h \ + state.[ch] \ + stencil.[ch] \ + subset_*.c \ + texformat.h \ + teximage.h \ + texstate.h \ + texstore.h \ + texobj.[ch] \ + texutil_tmp.h \ + varray.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = core_subset +HTML_HEADER = header_subset.html +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = \ + math_subset.tag=../math_subset \ + miniglx.tag=../miniglx +GENERATE_TAGFILE = core_subset.tag +ALLEXTERNALS = NO +PERL_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +HIDE_UNDOC_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = +EXT_DOC_PATHS = diff -Nru xpsb-glx-0.19/mesa/doxygen/doxy.bat xpsb-glx-0.19/mesa/doxygen/doxy.bat --- xpsb-glx-0.19/mesa/doxygen/doxy.bat 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/doxy.bat 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,19 @@ +doxygen tnl_dd.doxy +doxygen vbo.doxy +doxygen math.doxy +doxygen swrast.doxy +doxygen swrast_setup.doxy +doxygen tnl.doxy +doxygen core.doxy +doxygen glapi.doxy +doxygen shader.doxy + +echo Building again, to resolve tags +doxygen tnl_dd.doxy +doxygen vbo.doxy +doxygen math.doxy +doxygen swrast.doxy +doxygen swrast_setup.doxy +doxygen tnl.doxy +doxygen glapi.doxy +doxygen shader.doxy diff -Nru xpsb-glx-0.19/mesa/doxygen/.gitignore xpsb-glx-0.19/mesa/doxygen/.gitignore --- xpsb-glx-0.19/mesa/doxygen/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/.gitignore 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,15 @@ +*.tag +agpgart +array_cache +core +core_subset +math +math_subset +miniglx +radeon_subset +radeondrm +radeonfb +swrast +swrast_setup +tnl +tnl_dd diff -Nru xpsb-glx-0.19/mesa/doxygen/glapi.doxy xpsb-glx-0.19/mesa/doxygen/glapi.doxy --- xpsb-glx-0.19/mesa/doxygen/glapi.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/glapi.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,49 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa GL API dispatcher" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/glapi/ +FILE_PATTERNS = *.c *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = glapi +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = main.tag=../core \ + math.tag=../math \ + tnl_dd.tag=../tnl_dd \ + swrast.tag=../swrast \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl \ + vbo.tag=vbo +GENERATE_TAGFILE = swrast.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/header.html xpsb-glx-0.19/mesa/doxygen/header.html --- xpsb-glx-0.19/mesa/doxygen/header.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/header.html 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,17 @@ + + +Mesa Source Code Documentation + + + +
    +core | +glapi | +vbo | +math | +shader | +swrast | +swrast_setup | +tnl | +tnl_dd +
    diff -Nru xpsb-glx-0.19/mesa/doxygen/header_subset.html xpsb-glx-0.19/mesa/doxygen/header_subset.html --- xpsb-glx-0.19/mesa/doxygen/header_subset.html 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/header_subset.html 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,11 @@ + +Mesa Source Code Documentation + + + + diff -Nru xpsb-glx-0.19/mesa/doxygen/main.doxy xpsb-glx-0.19/mesa/doxygen/main.doxy --- xpsb-glx-0.19/mesa/doxygen/main.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/main.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,50 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa Main" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/main/ +FILE_PATTERNS = *.c *.h +RECURSIVE = NO +EXCLUDE = ../src/glapitemp.h ../src/glapioffsets.h +EXCLUDE_PATTERNS = subset_* +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = main +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = _HAVE_FULL_GL=1 +EXPAND_AS_DEFINED = _glthread_DECLARE_STATIC_MUTEX +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = tnl_dd.tag=../tnl_dd \ + vbo.tag=../vbo \ + glapi.tag=../glapi \ + math.tag=../math \ + shader.tag=../shader \ + swrast.tag=../swrast \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl +GENERATE_TAGFILE = main.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/Makefile xpsb-glx-0.19/mesa/doxygen/Makefile --- xpsb-glx-0.19/mesa/doxygen/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,33 @@ + +default: full + +all: full subset + +%.tag: %.doxy + doxygen $< + +FULL = \ + main.doxy \ + math.doxy \ + vbo.doxy \ + glapi.doxy \ + shader.doxy \ + swrast.doxy \ + swrast_setup.doxy \ + tnl.doxy \ + tnl_dd.doxy + +full: $(FULL:.doxy=.tag) + $(foreach FILE,$(FULL),doxygen $(FILE);) + +SUBSET = \ + main.doxy \ + math.doxy \ + miniglx.doxy + +subset: $(SUBSET:.doxy=.tag) + $(foreach FILE,$(SUBSET),doxygen $(FILE);) + +clean: + -rm -rf $(FULL:.doxy=) $(SUBSET:.doxy=) + -rm -rf *.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/math.doxy xpsb-glx-0.19/mesa/doxygen/math.doxy --- xpsb-glx-0.19/mesa/doxygen/math.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/math.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,49 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa math module" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/math/ +FILE_PATTERNS = *.c \ + *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = math +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = tnl_dd.tag=../tnl_dd \ + main.tag=../core \ + swrast.tag=../swrast \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl \ + vbo.tag=../vbo +GENERATE_TAGFILE = math.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/math_subset.doxy xpsb-glx-0.19/mesa/doxygen/math_subset.doxy --- xpsb-glx-0.19/mesa/doxygen/math_subset.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/math_subset.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,177 @@ +# Doxyfile 0.1 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa math module" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = . +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = YES +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_FORMAT = +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/math/ +FILE_PATTERNS = m_matrix.[ch] +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = math_subset +HTML_HEADER = header_subset.html +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = core_subset.tag=../core_subset +GENERATE_TAGFILE = math_subset.tag +ALLEXTERNALS = NO +PERL_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +HIDE_UNDOC_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = +EXT_DOC_PATHS = diff -Nru xpsb-glx-0.19/mesa/doxygen/miniglx.doxy xpsb-glx-0.19/mesa/doxygen/miniglx.doxy --- xpsb-glx-0.19/mesa/doxygen/miniglx.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/miniglx.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,179 @@ +# Doxyfile 0.1 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "MiniGLX" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = YES +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = NO +SHOW_INCLUDE_FILES = NO +JAVADOC_AUTOBRIEF = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_FORMAT = +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/glx/mini/ ../include/GL/miniglx.h +FILE_PATTERNS = *.h *.c +RECURSIVE = NO +EXCLUDE = ../src/glx/mini/glapi.c +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = miniglx +HTML_HEADER = header_subset.html +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = \ + core_subset.tag=../core_subset \ + math_subset.tag=../math_subset +GENERATE_TAGFILE = miniglx.tag +ALLEXTERNALS = NO +PERL_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +HIDE_UNDOC_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = +EXT_DOC_PATHS = diff -Nru xpsb-glx-0.19/mesa/doxygen/radeon_subset.doxy xpsb-glx-0.19/mesa/doxygen/radeon_subset.doxy --- xpsb-glx-0.19/mesa/doxygen/radeon_subset.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/radeon_subset.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,203 @@ +# Doxyfile 0.1 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Radeon Subset Driver" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = YES +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = NO +SHOW_INCLUDE_FILES = NO +JAVADOC_AUTOBRIEF = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_FORMAT = +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = \ + ../src/mesa/drivers/dri/common/mm.c \ + ../src/mesa/drivers/dri/common/mm.h \ + ../src/mesa/drivers/dri/radeon/radeon_context.c \ + ../src/mesa/drivers/dri/radeon/radeon_context.h \ + ../src/mesa/drivers/dri/radeon/radeon_ioctl.c \ + ../src/mesa/drivers/dri/radeon/radeon_ioctl.h \ + ../src/mesa/drivers/dri/radeon/radeon_lock.c \ + ../src/mesa/drivers/dri/radeon/radeon_lock.h \ + ../src/mesa/drivers/dri/radeon/radeon_screen.c \ + ../src/mesa/drivers/dri/radeon/radeon_screen.h \ + ../src/mesa/drivers/dri/radeon/radeon_state.c \ + ../src/mesa/drivers/dri/radeon/radeon_state.h \ + ../src/mesa/drivers/dri/radeon/radeon_state_init.c \ + ../src/mesa/drivers/dri/radeon/radeon_subset.h \ + ../src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c \ + ../src/mesa/drivers/dri/radeon/radeon_subset_readpix.c \ + ../src/mesa/drivers/dri/radeon/radeon_subset_select.c \ + ../src/mesa/drivers/dri/radeon/radeon_subset_tex.c \ + ../src/mesa/drivers/dri/radeon/radeon_subset_vtx.c \ + ../src/mesa/drivers/dri/radeon/radeon_tcl.h \ + ../src/mesa/drivers/dri/radeon/radeon_tex.h \ + ../src/mesa/drivers/dri/radeon/radeon_vtxfmt.h \ + ../src/mesa/drivers/dri/radeon/server +FILE_PATTERNS = *.h *.c +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = radeon_subset +HTML_HEADER = header_subset.html +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = \ + core_subset.tag=../core_subset \ + math_subset.tag=../math_subset \ + miniglx.tag=../miniglx +GENERATE_TAGFILE = radeon_subset.tag +ALLEXTERNALS = NO +PERL_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +HIDE_UNDOC_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = +EXT_DOC_PATHS = diff -Nru xpsb-glx-0.19/mesa/doxygen/README xpsb-glx-0.19/mesa/doxygen/README --- xpsb-glx-0.19/mesa/doxygen/README 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/README 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,10 @@ + +This directory is for doxygen (a source code documentation system). + +See http://www.doxygen.org/ for more info. + +Either run 'make' (Unix) or 'doxy.bat' (Windows) to run doxygen +and generate souce code documentation. + +Then, load either doxygen/main/index.html or doxygen/core_subset/index.html into +your web browser. diff -Nru xpsb-glx-0.19/mesa/doxygen/shader.doxy xpsb-glx-0.19/mesa/doxygen/shader.doxy --- xpsb-glx-0.19/mesa/doxygen/shader.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/shader.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,49 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa Vertex and Fragment Program code" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/shader/ +FILE_PATTERNS = *.c *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = shader +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = main.tag=../core \ + math.tag=../math \ + tnl_dd.tag=../tnl_dd \ + swrast.tag=../swrast \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl \ + vbo.tag=vbo +GENERATE_TAGFILE = swrast.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/swrast.doxy xpsb-glx-0.19/mesa/doxygen/swrast.doxy --- xpsb-glx-0.19/mesa/doxygen/swrast.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/swrast.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,48 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa Software Rasterization (swrast)" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/swrast/ +FILE_PATTERNS = *.c *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = swrast +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../include/ +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = main.tag=../core \ + math.tag=../math \ + tnl_dd.tag=../tnl_dd \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl \ + vbo.tag=vbo +GENERATE_TAGFILE = swrast.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/swrast_setup.doxy xpsb-glx-0.19/mesa/doxygen/swrast_setup.doxy --- xpsb-glx-0.19/mesa/doxygen/swrast_setup.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/swrast_setup.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,49 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa swrast_setup" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/swrast_setup/ +FILE_PATTERNS = *.c \ + *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = swrast_setup +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = tnl_dd.tag=../tnl_dd \ + main.tag=../core \ + math.tag=../math \ + swrast.tag=../swrast \ + tnl.tag=../tnl \ + vbo.tag=../vbo +GENERATE_TAGFILE = swrast_setup.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/tnl_dd.doxy xpsb-glx-0.19/mesa/doxygen/tnl_dd.doxy --- xpsb-glx-0.19/mesa/doxygen/tnl_dd.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/tnl_dd.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,49 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa tnl_dd" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/tnl_dd/ +FILE_PATTERNS = *.c *.h +RECURSIVE = YES +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = tnl_dd +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = main.tag=../core \ + math.tag=../math \ + shader.tag=../shader \ + swrast.tag=../swrast \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl \ + vbo.tag=vbo +GENERATE_TAGFILE = tnl_dd.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/tnl.doxy xpsb-glx-0.19/mesa/doxygen/tnl.doxy --- xpsb-glx-0.19/mesa/doxygen/tnl.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/tnl.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,50 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa Transform and Lighting (tnl)" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/tnl/ +FILE_PATTERNS = *.c \ + *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = tnl +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = tnl_dd.tag=../tnl \ + main.tag=../core \ + math.tag=../math \ + shader.tag=../shader \ + swrast.tag=../swrast \ + swrast_setup.tag=swrast_setup \ + vbo.tag=vbo +GENERATE_TAGFILE = tnl.tag diff -Nru xpsb-glx-0.19/mesa/doxygen/vbo.doxy xpsb-glx-0.19/mesa/doxygen/vbo.doxy --- xpsb-glx-0.19/mesa/doxygen/vbo.doxy 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/doxygen/vbo.doxy 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,50 @@ +# Doxyfile 0.1 + +@INCLUDE = common.doxy + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Mesa vbo" +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/mesa/vbo/ +FILE_PATTERNS = *.c \ + *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +HTML_OUTPUT = vbo +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = main.tag=../core \ + math.tag=../math \ + shader.tag=../shader \ + swrast.tag=../swrast \ + swrast_setup.tag=../swrast_setup \ + tnl.tag=../tnl \ + tnl_dd.tag=../tnl_dd +GENERATE_TAGFILE = vbo.tag diff -Nru xpsb-glx-0.19/mesa/include/GL/directfbgl.h xpsb-glx-0.19/mesa/include/GL/directfbgl.h --- xpsb-glx-0.19/mesa/include/GL/directfbgl.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/directfbgl.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,89 @@ +/* + (c) Copyright 2001 convergence integrated media GmbH. + All rights reserved. + + Written by Denis Oliver Kropp and + Andreas Hundt . + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef __DIRECTFBGL_H__ +#define __DIRECTFBGL_H__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct { + int buffer_size; + int depth_size; + int stencil_size; + int aux_buffers; + + int red_size; + int green_size; + int blue_size; + int alpha_size; + + int accum_red_size; + int accum_green_size; + int accum_blue_size; + int accum_alpha_size; + + DFBBoolean double_buffer; + DFBBoolean stereo; +} DFBGLAttributes; + + +DEFINE_INTERFACE( IDirectFBGL, + + /** Context handling **/ + + /* + * Acquire the hardware lock. + */ + DFBResult (*Lock) ( + IDirectFBGL *thiz + ); + + /* + * Release the lock. + */ + DFBResult (*Unlock) ( + IDirectFBGL *thiz + ); + + /* + * Query the OpenGL attributes. + */ + DFBResult (*GetAttributes) ( + IDirectFBGL *thiz, + DFBGLAttributes *attributes + ); +) + + +#ifdef __cplusplus +} +#endif + +#endif + diff -Nru xpsb-glx-0.19/mesa/include/GL/dmesa.h xpsb-glx-0.19/mesa/include/GL/dmesa.h --- xpsb-glx-0.19/mesa/include/GL/dmesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/dmesa.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,160 @@ +/* + * Mesa 3-D graphics library + * Version: 6.1 + * + * Copyright (C) 1999-2004 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#ifndef DMESA_H_included +#define DMESA_H_included + +#define DMESA_MAJOR_VERSION 6 +#define DMESA_MINOR_VERSION 5 + +/* Sample Usage: + * + * 1. Call DMesaCreateVisual() to initialize graphics. + * 2. Call DMesaCreateContext() to create a DMesa rendering context. + * 3. Call DMesaCreateBuffer() to define the window. + * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext. + * 5. Make gl* calls to render your graphics. + * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers. + * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual. + */ + +typedef struct dmesa_context *DMesaContext; +typedef struct dmesa_visual *DMesaVisual; +typedef struct dmesa_buffer *DMesaBuffer; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Create a new Visual and set graphics mode. + */ +DMesaVisual DMesaCreateVisual (GLint width, /* X res */ + GLint height, /* Y res */ + GLint colDepth, /* BPP */ + GLint refresh, /* refresh rate: 0=default */ + GLboolean dbFlag, /* double-buffered */ + GLboolean rgbFlag, /* RGB mode */ + GLint alphaSize, /* requested bits/alpha */ + GLint depthSize, /* requested bits/depth */ + GLint stencilSize, /* requested bits/stencil */ + GLint accumSize); /* requested bits/accum */ + +/* + * Destroy Visual and restore screen. + */ +void DMesaDestroyVisual (DMesaVisual v); + + + +/* + * Create a new Context for rendering. + */ +DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); + +/* + * Destroy Context. + */ +void DMesaDestroyContext (DMesaContext c); + +/* + * Return a handle to the current context. + */ +DMesaContext DMesaGetCurrentContext (void); + + + +/* + * Create a new Buffer (window). + */ +DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, + GLint xpos, GLint ypos, + GLint width, GLint height); + +/* + * Destroy Buffer. + */ +void DMesaDestroyBuffer (DMesaBuffer b); + +/* + * Return a handle to the current buffer. + */ +DMesaBuffer DMesaGetCurrentBuffer (void); + +/* + * Swap the front and back buffers for the given Buffer. + * No action is taken if the buffer is not double buffered. + */ +void DMesaSwapBuffers (DMesaBuffer b); + +/* + * Bind Buffer to Context and make the Context the current one. + */ +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); + + + +/* + * Move/Resize current Buffer. + */ +GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos); +GLboolean DMesaResizeBuffer (GLint width, GLint height); + +/* + * Set palette index, using normalized values. + */ +void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); + +/* + * DMesa functions + */ +typedef void (*DMesaProc) (); +DMesaProc DMesaGetProcAddress (const char *name); + +/* + * DMesa state retrieval. + */ +#define DMESA_GET_SCREEN_SIZE 0x0100 +#define DMESA_GET_DRIVER_CAPS 0x0200 +#define DMESA_GET_VIDEO_MODES 0x0300 +#define DMESA_GET_BUFFER_ADDR 0x0400 + +#define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */ +#define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */ +int DMesaGetIntegerv (GLenum pname, GLint *params); + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/ggimesa.h xpsb-glx-0.19/mesa/include/GL/ggimesa.h --- xpsb-glx-0.19/mesa/include/GL/ggimesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/ggimesa.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,85 @@ +/* + * Mesa 3-D graphics library GGI bindings (GGIGL [giggle]) + * Version: 4.0 + * Copyright (C) 1995-2000 Brian Paul + * Copyright (C) 1998 Uwe Maurer + * Copyrigth (C) 2001 Filip Spacek + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef GGIMESA_H +#define GGIMESA_H + +#define GGIMESA_MAJOR_VERSION 4 +#define GGIMESA_MINOR_VERSION 0 + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "GL/gl.h" + +typedef struct ggi_mesa_context *ggi_mesa_context_t; + +/* + * Initialize Mesa GGI extension + */ +int ggiMesaInit(void); +/* + * Clean up Mesa GGI exension + */ +int ggiMesaExit(void); + +/* + * Attach Mesa GGI extension to the visual 'vis' + */ +int ggiMesaAttach(ggi_visual_t vis); +/* + * Detach Mesa GGI extension from the visual 'vis' + */ +int ggiMesaDetach(ggi_visual_t vis); + +int ggiMesaExtendVisual(ggi_visual_t vis, GLboolean alpha_flag, + GLboolean stereo_flag, GLint depth_size, + GLint stencil_size, GLint accum_red_size, + GLint accum_green_size, GLint accum_blue_size, + GLint accum_alpha_size, GLint num_samples); + +/* + * Create a new context capable of displaying on the visual vis. + */ +ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis); +/* + * Destroy the context 'ctx' + */ +void ggiMesaDestroyContext(ggi_mesa_context_t ctx); + +/* + * Make context 'ctx' the current context and bind it to visual 'vis'. + * Note that the context must have been created with respect to that visual. + */ +void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis); + +void ggiMesaSwapBuffers(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/glext.h xpsb-glx-0.19/mesa/include/GL/glext.h --- xpsb-glx-0.19/mesa/include/GL/glext.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glext.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,8565 @@ +#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 +#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 2009/03/19 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 48 + +#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_VERSION_3_0 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +/* Reuse tokens from ARB_depth_buffer_float */ +/* reuse GL_DEPTH_COMPONENT32F */ +/* reuse GL_DEPTH32F_STENCIL8 */ +/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_DEFAULT */ +/* reuse GL_FRAMEBUFFER_UNDEFINED */ +/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ +/* reuse GL_INDEX */ +/* reuse GL_MAX_RENDERBUFFER_SIZE */ +/* reuse GL_DEPTH_STENCIL */ +/* reuse GL_UNSIGNED_INT_24_8 */ +/* reuse GL_DEPTH24_STENCIL8 */ +/* reuse GL_TEXTURE_STENCIL_SIZE */ +/* reuse GL_TEXTURE_RED_TYPE */ +/* reuse GL_TEXTURE_GREEN_TYPE */ +/* reuse GL_TEXTURE_BLUE_TYPE */ +/* reuse GL_TEXTURE_ALPHA_TYPE */ +/* reuse GL_TEXTURE_LUMINANCE_TYPE */ +/* reuse GL_TEXTURE_INTENSITY_TYPE */ +/* reuse GL_TEXTURE_DEPTH_TYPE */ +/* reuse GL_UNSIGNED_NORMALIZED */ +/* reuse GL_FRAMEBUFFER_BINDING */ +/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_BINDING */ +/* reuse GL_READ_FRAMEBUFFER */ +/* reuse GL_DRAW_FRAMEBUFFER */ +/* reuse GL_READ_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_SAMPLES */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* reuse GL_FRAMEBUFFER_COMPLETE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ +/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ +/* reuse GL_MAX_COLOR_ATTACHMENTS */ +/* reuse GL_COLOR_ATTACHMENT0 */ +/* reuse GL_COLOR_ATTACHMENT1 */ +/* reuse GL_COLOR_ATTACHMENT2 */ +/* reuse GL_COLOR_ATTACHMENT3 */ +/* reuse GL_COLOR_ATTACHMENT4 */ +/* reuse GL_COLOR_ATTACHMENT5 */ +/* reuse GL_COLOR_ATTACHMENT6 */ +/* reuse GL_COLOR_ATTACHMENT7 */ +/* reuse GL_COLOR_ATTACHMENT8 */ +/* reuse GL_COLOR_ATTACHMENT9 */ +/* reuse GL_COLOR_ATTACHMENT10 */ +/* reuse GL_COLOR_ATTACHMENT11 */ +/* reuse GL_COLOR_ATTACHMENT12 */ +/* reuse GL_COLOR_ATTACHMENT13 */ +/* reuse GL_COLOR_ATTACHMENT14 */ +/* reuse GL_COLOR_ATTACHMENT15 */ +/* reuse GL_DEPTH_ATTACHMENT */ +/* reuse GL_STENCIL_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_RENDERBUFFER_WIDTH */ +/* reuse GL_RENDERBUFFER_HEIGHT */ +/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ +/* reuse GL_STENCIL_INDEX1 */ +/* reuse GL_STENCIL_INDEX4 */ +/* reuse GL_STENCIL_INDEX8 */ +/* reuse GL_STENCIL_INDEX16 */ +/* reuse GL_RENDERBUFFER_RED_SIZE */ +/* reuse GL_RENDERBUFFER_GREEN_SIZE */ +/* reuse GL_RENDERBUFFER_BLUE_SIZE */ +/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ +/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ +/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ +/* reuse GL_MAX_SAMPLES */ +/* Reuse tokens from ARB_framebuffer_sRGB */ +/* reuse GL_FRAMEBUFFER_SRGB */ +/* Reuse tokens from ARB_half_float_vertex */ +/* reuse GL_HALF_FLOAT */ +/* Reuse tokens from ARB_map_buffer_range */ +/* reuse GL_MAP_READ_BIT */ +/* reuse GL_MAP_WRITE_BIT */ +/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ +/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ +/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ +/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ +/* Reuse tokens from ARB_texture_compression_rgtc */ +/* reuse GL_COMPRESSED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_RG_RGTC2 */ +/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ +/* Reuse tokens from ARB_texture_rg */ +/* reuse GL_RG */ +/* reuse GL_RG_INTEGER */ +/* reuse GL_R8 */ +/* reuse GL_R16 */ +/* reuse GL_RG8 */ +/* reuse GL_RG16 */ +/* reuse GL_R16F */ +/* reuse GL_R32F */ +/* reuse GL_RG16F */ +/* reuse GL_RG32F */ +/* reuse GL_R8I */ +/* reuse GL_R8UI */ +/* reuse GL_R16I */ +/* reuse GL_R16UI */ +/* reuse GL_R32I */ +/* reuse GL_R32UI */ +/* reuse GL_RG8I */ +/* reuse GL_RG8UI */ +/* reuse GL_RG16I */ +/* reuse GL_RG16UI */ +/* reuse GL_RG32I */ +/* reuse GL_RG32UI */ +/* Reuse tokens from ARB_vertex_array_object */ +/* reuse GL_VERTEX_ARRAY_BINDING */ +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +#ifndef GL_ARB_draw_instanced +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_HALF_FLOAT 0x140B +#endif + +#ifndef GL_ARB_instanced_arrays +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +#ifndef GL_ARB_texture_rg +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#endif + +#ifndef GL_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_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + +#ifndef GL_NV_conditional_render +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#endif + +#ifndef GL_NV_present_video +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +#endif + +#ifndef GL_EXT_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#endif + +#ifndef GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +#ifndef GL_AMD_texture_texture4 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +#endif + + +/*************************************************************/ + +#include +#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 glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#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 +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include /* 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_VERSION_3_0 +#define GL_VERSION_3_0 1 +/* OpenGL 3.0 also reuses entry points from these extensions: */ +/* ARB_framebuffer_object */ +/* ARB_map_buffer_range */ +/* ARB_vertex_array_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *); +GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glEnablei (GLenum, GLuint); +GLAPI void APIENTRY glDisablei (GLenum, GLuint); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glClampColor (GLenum, GLenum); +GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint); +GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glUniform1ui (GLint, GLuint); +GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint); +GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *); +GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *); +GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *); +GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint); +GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +#endif + +#ifndef GL_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_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint); +GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint); +GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmap (GLenum); +GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisor (GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArray (GLuint); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#endif + +#ifndef GL_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 *); +#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 *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, 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); +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 + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#endif + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint); +GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *); +GLAPI void APIENTRY glVideoParameterivNV (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint *params); +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield); +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixPopEXT (GLenum); +GLAPI void APIENTRY glMatrixPushEXT (GLenum); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *); +GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_AMD_vertex_shader_tesselator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat); +GLAPI void APIENTRY glTessellationModeAMD (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/glfbdev.h xpsb-glx-0.19/mesa/include/GL/glfbdev.h --- xpsb-glx-0.19/mesa/include/GL/glfbdev.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glfbdev.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,149 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef GLFBDEV_H +#define GLFBDEV_H + + +/* avoid including linux/fb.h */ +struct fb_fix_screeninfo; +struct fb_var_screeninfo; + + +/* public types */ +typedef struct GLFBDevVisualRec *GLFBDevVisualPtr; +typedef struct GLFBDevBufferRec *GLFBDevBufferPtr; +typedef struct GLFBDevContextRec *GLFBDevContextPtr; + + +/* API version */ +#define GLFBDEV_VERSION_1_0 1 + + +/* For glFBDevCreateVisual */ +#define GLFBDEV_DOUBLE_BUFFER 100 +#define GLFBDEV_COLOR_INDEX 101 +#define GLFBDEV_DEPTH_SIZE 102 +#define GLFBDEV_STENCIL_SIZE 103 +#define GLFBDEV_ACCUM_SIZE 104 +#define GLFBDEV_LEVEL 105 +#define GLFBDEV_MULTISAMPLE 106 +#define GLFBDEV_NONE 0 + +/* For glFBDevGetString */ +#define GLFBDEV_VERSION 200 +#define GLFBDEV_VENDOR 201 + + +/* Misc functions */ + +extern const char * +glFBDevGetString( int str ); + + +typedef void (*GLFBDevProc)(); + + +extern GLFBDevProc +glFBDevGetProcAddress( const char *procName ); + + + +/** + * Create a GLFBDevVisual. + * \param fixInfo - needed to get the visual types, etc. + * \param varInfo - needed to get the bits_per_pixel, etc. + * \param attribs - for requesting depth, stencil, accum buffers, etc. + */ +extern GLFBDevVisualPtr +glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, + const struct fb_var_screeninfo *varInfo, + const int *attribs ); + +extern void +glFBDevDestroyVisual( GLFBDevVisualPtr visual ); + +extern int +glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib); + + + +/** + * Create a GLFBDevBuffer. + * \param fixInfo, varInfo - needed in order to get the screen size + * (resolution), etc. + * \param visual - as returned by glFBDevCreateVisual() + * \param frontBuffer - address of front color buffer + * \param backBuffer - address of back color buffer (may be NULL) + * \param size - size of the color buffer(s) in bytes. + */ +extern GLFBDevBufferPtr +glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, + const struct fb_var_screeninfo *varInfo, + const GLFBDevVisualPtr visual, + void *frontBuffer, void *backBuffer, size_t size ); + +extern void +glFBDevDestroyBuffer( GLFBDevBufferPtr buffer ); + +extern int +glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib); + +extern GLFBDevBufferPtr +glFBDevGetCurrentDrawBuffer( void ); + +extern GLFBDevBufferPtr +glFBDevGetCurrentReadBuffer( void ); + +extern void +glFBDevSwapBuffers( GLFBDevBufferPtr buffer ); + + + +/** + * Create a GLFBDevContext. + * \param visual - as created by glFBDevCreateVisual. + * \param share - specifies another context with which to share textures, + * display lists, etc. (may be NULL). + */ +extern GLFBDevContextPtr +glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share ); + +extern void +glFBDevDestroyContext( GLFBDevContextPtr context ); + +extern int +glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib); + +extern GLFBDevContextPtr +glFBDevGetCurrentContext( void ); + +extern int +glFBDevMakeCurrent( GLFBDevContextPtr context, + GLFBDevBufferPtr drawBuffer, + GLFBDevBufferPtr readBuffer ); + + +#endif /* GLFBDEV_H */ diff -Nru xpsb-glx-0.19/mesa/include/GL/gl.h xpsb-glx-0.19/mesa/include/GL/gl.h --- xpsb-glx-0.19/mesa/include/GL/gl.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/gl.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,2285 @@ +/* + * Mesa 3-D graphics library + * Version: 7.4 + * + * 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 /* 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 +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \ + && !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__) +#include +#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 + +#endif /* GL_GLEXT_LEGACY */ + + + +#if GL_ARB_shader_objects + +#ifndef GL_MESA_shader_debug +#define GL_MESA_shader_debug 1 + +#define GL_DEBUG_OBJECT_MESA 0x8759 +#define GL_DEBUG_PRINT_MESA 0x875A +#define GL_DEBUG_ASSERT_MESA 0x875B + +GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void); +GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); +GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, + GLsizei *length, GLcharARB *debugLog); +GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); + +#endif /* GL_MESA_shader_debug */ + +#endif /* GL_ARB_shader_objects */ + + +/* + * ???. GL_MESA_packed_depth_stencil + * XXX obsolete + */ +#ifndef GL_MESA_packed_depth_stencil +#define GL_MESA_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_MESA 0x8750 +#define GL_UNSIGNED_INT_24_8_MESA 0x8751 +#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 +#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 +#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +#endif /* GL_MESA_packed_depth_stencil */ + + +#ifndef GL_MESA_program_debug +#define GL_MESA_program_debug 1 + +#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 +#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 +#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 +#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 +#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4 +#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5 +#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 +#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 + +typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); + +GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); + +GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); + +#endif /* GL_MESA_program_debug */ + + +#ifndef GL_MESA_texture_array +#define GL_MESA_texture_array 1 + +/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array. + */ +#ifndef GL_EXT_texture_array + +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target, + GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif /* GL_GLEXT_PROTOTYPES */ + +#if 0 +/* (temporarily) disabled because of collision with typedef in glext.h + * that happens if apps include both gl.h and glext.h + */ +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, + GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif + +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#endif + +#endif + + +#ifndef GL_ATI_blend_equation_separate +#define GL_ATI_blend_equation_separate 1 + +#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D + +GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); + +#endif /* GL_ATI_blend_equation_separate */ + + + +/** + ** 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 -Nru xpsb-glx-0.19/mesa/include/GL/gl_mangle.h xpsb-glx-0.19/mesa/include/GL/gl_mangle.h --- xpsb-glx-0.19/mesa/include/GL/gl_mangle.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/gl_mangle.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1866 @@ +#if 0 +#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output" +#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names" + files="gl.h glext.h" +#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line" + awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0 + echo "" +#define GL_MANGLE_C4 get aliases + grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq + echo "" + echo "#endif /* GL_MANGLE_H */" + exit +#endif /* REGENERATION */ + +/* + * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link + * your application both with OpenGL and Mesa. The Mesa functions will + * be redefined so they are prefixed with "mgl" instead of "gl". + * Mgl contributed by Randy Frank (rfrank@rsinc.com) + * Regneration code contributed by Ray Tice (rayt@ma.ultra.net) + */ + +#ifndef GL_MANGLE_H +#define GL_MANGLE_H + +#ifndef MANGLE +#define MANGLE(x) mgl##x +#endif /*MANGLE*/ + +/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */ + +#define glAccum MANGLE(Accum) +#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT) +#define glActiveTextureARB MANGLE(ActiveTextureARB) +#define glActiveTexture MANGLE(ActiveTexture) +#define glActiveVaryingNV MANGLE(ActiveVaryingNV) +#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI) +#define glAlphaFunc MANGLE(AlphaFunc) +#define glApplyTextureEXT MANGLE(ApplyTextureEXT) +#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV) +#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT) +#define glAreTexturesResident MANGLE(AreTexturesResident) +#define glArrayElementEXT MANGLE(ArrayElementEXT) +#define glArrayElement MANGLE(ArrayElement) +#define glArrayObjectATI MANGLE(ArrayObjectATI) +#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) +#define glAttachObjectARB MANGLE(AttachObjectARB) +#define glAttachShader MANGLE(AttachShader) +#define glBeginConditionalRender MANGLE(BeginConditionalRender) +#define glBeginConditionalRenderNV MANGLE(BeginConditionalRenderNV) +#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) +#define glBegin MANGLE(Begin) +#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) +#define glBeginQueryARB MANGLE(BeginQueryARB) +#define glBeginQuery MANGLE(BeginQuery) +#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT) +#define glBeginTransformFeedback MANGLE(BeginTransformFeedback) +#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV) +#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) +#define glBindAttribLocationARB MANGLE(BindAttribLocationARB) +#define glBindAttribLocation MANGLE(BindAttribLocation) +#define glBindBufferARB MANGLE(BindBufferARB) +#define glBindBufferBaseEXT MANGLE(BindBufferBaseEXT) +#define glBindBufferBase MANGLE(BindBufferBase) +#define glBindBufferBaseNV MANGLE(BindBufferBaseNV) +#define glBindBuffer MANGLE(BindBuffer) +#define glBindBufferOffsetEXT MANGLE(BindBufferOffsetEXT) +#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV) +#define glBindBufferRangeEXT MANGLE(BindBufferRangeEXT) +#define glBindBufferRange MANGLE(BindBufferRange) +#define glBindBufferRangeNV MANGLE(BindBufferRangeNV) +#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT) +#define glBindFragDataLocation MANGLE(BindFragDataLocation) +#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) +#define glBindFramebufferEXT MANGLE(BindFramebufferEXT) +#define glBindFramebuffer MANGLE(BindFramebuffer) +#define glBindLightParameterEXT MANGLE(BindLightParameterEXT) +#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) +#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT) +#define glBindParameterEXT MANGLE(BindParameterEXT) +#define glBindProgramARB MANGLE(BindProgramARB) +#define glBindProgramNV MANGLE(BindProgramNV) +#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT) +#define glBindRenderbuffer MANGLE(BindRenderbuffer) +#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT) +#define glBindTextureEXT MANGLE(BindTextureEXT) +#define glBindTexture MANGLE(BindTexture) +#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT) +#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV) +#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE) +#define glBindVertexArray MANGLE(BindVertexArray) +#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT) +#define glBinormal3bEXT MANGLE(Binormal3bEXT) +#define glBinormal3bvEXT MANGLE(Binormal3bvEXT) +#define glBinormal3dEXT MANGLE(Binormal3dEXT) +#define glBinormal3dvEXT MANGLE(Binormal3dvEXT) +#define glBinormal3fEXT MANGLE(Binormal3fEXT) +#define glBinormal3fvEXT MANGLE(Binormal3fvEXT) +#define glBinormal3iEXT MANGLE(Binormal3iEXT) +#define glBinormal3ivEXT MANGLE(Binormal3ivEXT) +#define glBinormal3sEXT MANGLE(Binormal3sEXT) +#define glBinormal3svEXT MANGLE(Binormal3svEXT) +#define glBinormalPointerEXT MANGLE(BinormalPointerEXT) +#define glBitmap MANGLE(Bitmap) +#define glBlendColorEXT MANGLE(BlendColorEXT) +#define glBlendColor MANGLE(BlendColor) +#define glBlendEquationEXT MANGLE(BlendEquationEXT) +#define glBlendEquation MANGLE(BlendEquation) +#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI) +#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT) +#define glBlendEquationSeparate MANGLE(BlendEquationSeparate) +#define glBlendFunc MANGLE(BlendFunc) +#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) +#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) +#define glBlendFuncSeparate MANGLE(BlendFuncSeparate) +#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT) +#define glBlitFramebuffer MANGLE(BlitFramebuffer) +#define glBufferDataARB MANGLE(BufferDataARB) +#define glBufferData MANGLE(BufferData) +#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE) +#define glBufferSubDataARB MANGLE(BufferSubDataARB) +#define glBufferSubData MANGLE(BufferSubData) +#define glCallList MANGLE(CallList) +#define glCallLists MANGLE(CallLists) +#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT) +#define glCheckFramebufferStatus MANGLE(CheckFramebufferStatus) +#define glCheckNamedFramebufferStatusEXT MANGLE(CheckNamedFramebufferStatusEXT) +#define glClampColorARB MANGLE(ClampColorARB) +#define glClampColor MANGLE(ClampColor) +#define glClearAccum MANGLE(ClearAccum) +#define glClearBufferfi MANGLE(ClearBufferfi) +#define glClearBufferfv MANGLE(ClearBufferfv) +#define glClearBufferiv MANGLE(ClearBufferiv) +#define glClearBufferuiv MANGLE(ClearBufferuiv) +#define glClearColorIiEXT MANGLE(ClearColorIiEXT) +#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT) +#define glClearColor MANGLE(ClearColor) +#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA) +#define glClearDepthdNV MANGLE(ClearDepthdNV) +#define glClearDepth MANGLE(ClearDepth) +#define glClearIndex MANGLE(ClearIndex) +#define glClear MANGLE(Clear) +#define glClearStencil MANGLE(ClearStencil) +#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB) +#define glClientActiveTexture MANGLE(ClientActiveTexture) +#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI) +#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT) +#define glClipPlane MANGLE(ClipPlane) +#define glColor3b MANGLE(Color3b) +#define glColor3bv MANGLE(Color3bv) +#define glColor3d MANGLE(Color3d) +#define glColor3dv MANGLE(Color3dv) +#define glColor3f MANGLE(Color3f) +#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN) +#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN) +#define glColor3fv MANGLE(Color3fv) +#define glColor3hNV MANGLE(Color3hNV) +#define glColor3hvNV MANGLE(Color3hvNV) +#define glColor3i MANGLE(Color3i) +#define glColor3iv MANGLE(Color3iv) +#define glColor3s MANGLE(Color3s) +#define glColor3sv MANGLE(Color3sv) +#define glColor3ub MANGLE(Color3ub) +#define glColor3ubv MANGLE(Color3ubv) +#define glColor3ui MANGLE(Color3ui) +#define glColor3uiv MANGLE(Color3uiv) +#define glColor3us MANGLE(Color3us) +#define glColor3usv MANGLE(Color3usv) +#define glColor4b MANGLE(Color4b) +#define glColor4bv MANGLE(Color4bv) +#define glColor4d MANGLE(Color4d) +#define glColor4dv MANGLE(Color4dv) +#define glColor4f MANGLE(Color4f) +#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN) +#define glColor4fv MANGLE(Color4fv) +#define glColor4hNV MANGLE(Color4hNV) +#define glColor4hvNV MANGLE(Color4hvNV) +#define glColor4i MANGLE(Color4i) +#define glColor4iv MANGLE(Color4iv) +#define glColor4s MANGLE(Color4s) +#define glColor4sv MANGLE(Color4sv) +#define glColor4ub MANGLE(Color4ub) +#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN) +#define glColor4ubv MANGLE(Color4ubv) +#define glColor4ui MANGLE(Color4ui) +#define glColor4uiv MANGLE(Color4uiv) +#define glColor4us MANGLE(Color4us) +#define glColor4usv MANGLE(Color4usv) +#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI) +#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI) +#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI) +#define glColorMaski MANGLE(ColorMaski) +#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT) +#define glColorMask MANGLE(ColorMask) +#define glColorMaterial MANGLE(ColorMaterial) +#define glColorPointerEXT MANGLE(ColorPointerEXT) +#define glColorPointerListIBM MANGLE(ColorPointerListIBM) +#define glColorPointer MANGLE(ColorPointer) +#define glColorPointervINTEL MANGLE(ColorPointervINTEL) +#define glColorSubTableEXT MANGLE(ColorSubTableEXT) +#define glColorSubTable MANGLE(ColorSubTable) +#define glColorTableEXT MANGLE(ColorTableEXT) +#define glColorTable MANGLE(ColorTable) +#define glColorTableParameterfv MANGLE(ColorTableParameterfv) +#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI) +#define glColorTableParameteriv MANGLE(ColorTableParameteriv) +#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI) +#define glColorTableSGI MANGLE(ColorTableSGI) +#define glCombinerInputNV MANGLE(CombinerInputNV) +#define glCombinerOutputNV MANGLE(CombinerOutputNV) +#define glCombinerParameterfNV MANGLE(CombinerParameterfNV) +#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV) +#define glCombinerParameteriNV MANGLE(CombinerParameteriNV) +#define glCombinerParameterivNV MANGLE(CombinerParameterivNV) +#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV) +#define glCompileShaderARB MANGLE(CompileShaderARB) +#define glCompileShader MANGLE(CompileShader) +#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT MANGLE(CompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT MANGLE(CompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT MANGLE(CompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT MANGLE(CompressedMultiTexSubImage3DEXT) +#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB) +#define glCompressedTexImage1D MANGLE(CompressedTexImage1D) +#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB) +#define glCompressedTexImage2D MANGLE(CompressedTexImage2D) +#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB) +#define glCompressedTexImage3D MANGLE(CompressedTexImage3D) +#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB) +#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D) +#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB) +#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D) +#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB) +#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D) +#define glCompressedTextureImage1DEXT MANGLE(CompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT MANGLE(CompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT MANGLE(CompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT MANGLE(CompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT MANGLE(CompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT MANGLE(CompressedTextureSubImage3DEXT) +#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT) +#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D) +#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT) +#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D) +#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT) +#define glConvolutionParameterf MANGLE(ConvolutionParameterf) +#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT) +#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv) +#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT) +#define glConvolutionParameteri MANGLE(ConvolutionParameteri) +#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT) +#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv) +#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT) +#define glCopyColorSubTable MANGLE(CopyColorSubTable) +#define glCopyColorTable MANGLE(CopyColorTable) +#define glCopyColorTableSGI MANGLE(CopyColorTableSGI) +#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D) +#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT) +#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D) +#define glCopyMultiTexImage1DEXT MANGLE(CopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT MANGLE(CopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT MANGLE(CopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT MANGLE(CopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT MANGLE(CopyMultiTexSubImage3DEXT) +#define glCopyPixels MANGLE(CopyPixels) +#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT) +#define glCopyTexImage1D MANGLE(CopyTexImage1D) +#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT) +#define glCopyTexImage2D MANGLE(CopyTexImage2D) +#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT) +#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D) +#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT) +#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) +#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) +#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCopyTextureImage1DEXT MANGLE(CopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT MANGLE(CopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT MANGLE(CopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT MANGLE(CopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT MANGLE(CopyTextureSubImage3DEXT) +#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA) +#define glCreateProgram MANGLE(CreateProgram) +#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB) +#define glCreateShader MANGLE(CreateShader) +#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB) +#define glCullFace MANGLE(CullFace) +#define glCullParameterdvEXT MANGLE(CullParameterdvEXT) +#define glCullParameterfvEXT MANGLE(CullParameterfvEXT) +#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB) +#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX) +#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX) +#define glDeformSGIX MANGLE(DeformSGIX) +#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX) +#define glDeleteBuffersARB MANGLE(DeleteBuffersARB) +#define glDeleteBuffers MANGLE(DeleteBuffers) +#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE) +#define glDeleteFencesNV MANGLE(DeleteFencesNV) +#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) +#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT) +#define glDeleteFramebuffers MANGLE(DeleteFramebuffers) +#define glDeleteLists MANGLE(DeleteLists) +#define glDeleteObjectARB MANGLE(DeleteObjectARB) +#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) +#define glDeleteProgram MANGLE(DeleteProgram) +#define glDeleteProgramsARB MANGLE(DeleteProgramsARB) +#define glDeleteProgramsNV MANGLE(DeleteProgramsNV) +#define glDeleteQueriesARB MANGLE(DeleteQueriesARB) +#define glDeleteQueries MANGLE(DeleteQueries) +#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT) +#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers) +#define glDeleteShader MANGLE(DeleteShader) +#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) +#define glDeleteTextures MANGLE(DeleteTextures) +#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV) +#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE) +#define glDeleteVertexArrays MANGLE(DeleteVertexArrays) +#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT) +#define glDepthBoundsdNV MANGLE(DepthBoundsdNV) +#define glDepthBoundsEXT MANGLE(DepthBoundsEXT) +#define glDepthFunc MANGLE(DepthFunc) +#define glDepthMask MANGLE(DepthMask) +#define glDepthRangedNV MANGLE(DepthRangedNV) +#define glDepthRange MANGLE(DepthRange) +#define glDetachObjectARB MANGLE(DetachObjectARB) +#define glDetachShader MANGLE(DetachShader) +#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) +#define glDisableClientStateIndexedEXT MANGLE(DisableClientStateIndexedEXT) +#define glDisableClientState MANGLE(DisableClientState) +#define glDisablei MANGLE(Disablei) +#define glDisableIndexedEXT MANGLE(DisableIndexedEXT) +#define glDisable MANGLE(Disable) +#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) +#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) +#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray) +#define glDrawArraysEXT MANGLE(DrawArraysEXT) +#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB) +#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT) +#define glDrawArrays MANGLE(DrawArrays) +#define glDrawBuffer MANGLE(DrawBuffer) +#define glDrawBuffersARB MANGLE(DrawBuffersARB) +#define glDrawBuffersATI MANGLE(DrawBuffersATI) +#define glDrawBuffers MANGLE(DrawBuffers) +#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE) +#define glDrawElementArrayATI MANGLE(DrawElementArrayATI) +#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB) +#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT) +#define glDrawElements MANGLE(DrawElements) +#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN) +#define glDrawPixels MANGLE(DrawPixels) +#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE) +#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI) +#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT) +#define glDrawRangeElements MANGLE(DrawRangeElements) +#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV) +#define glEdgeFlag MANGLE(EdgeFlag) +#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT) +#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM) +#define glEdgeFlagPointer MANGLE(EdgeFlagPointer) +#define glEdgeFlagv MANGLE(EdgeFlagv) +#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE) +#define glElementPointerATI MANGLE(ElementPointerATI) +#define glEnableClientStateIndexedEXT MANGLE(EnableClientStateIndexedEXT) +#define glEnableClientState MANGLE(EnableClientState) +#define glEnablei MANGLE(Enablei) +#define glEnableIndexedEXT MANGLE(EnableIndexedEXT) +#define glEnable MANGLE(Enable) +#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) +#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) +#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray) +#define glEndConditionalRender MANGLE(EndConditionalRender) +#define glEndConditionalRenderNV MANGLE(EndConditionalRenderNV) +#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI) +#define glEndList MANGLE(EndList) +#define glEnd MANGLE(End) +#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) +#define glEndQueryARB MANGLE(EndQueryARB) +#define glEndQuery MANGLE(EndQuery) +#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT) +#define glEndTransformFeedback MANGLE(EndTransformFeedback) +#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV) +#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) +#define glEvalCoord1d MANGLE(EvalCoord1d) +#define glEvalCoord1dv MANGLE(EvalCoord1dv) +#define glEvalCoord1f MANGLE(EvalCoord1f) +#define glEvalCoord1fv MANGLE(EvalCoord1fv) +#define glEvalCoord2d MANGLE(EvalCoord2d) +#define glEvalCoord2dv MANGLE(EvalCoord2dv) +#define glEvalCoord2f MANGLE(EvalCoord2f) +#define glEvalCoord2fv MANGLE(EvalCoord2fv) +#define glEvalMapsNV MANGLE(EvalMapsNV) +#define glEvalMesh1 MANGLE(EvalMesh1) +#define glEvalMesh2 MANGLE(EvalMesh2) +#define glEvalPoint1 MANGLE(EvalPoint1) +#define glEvalPoint2 MANGLE(EvalPoint2) +#define glExecuteProgramNV MANGLE(ExecuteProgramNV) +#define glExtractComponentEXT MANGLE(ExtractComponentEXT) +#define glFeedbackBuffer MANGLE(FeedbackBuffer) +#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV) +#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX) +#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE) +#define glFinishFenceNV MANGLE(FinishFenceNV) +#define glFinish MANGLE(Finish) +#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE) +#define glFinishTextureSUNX MANGLE(FinishTextureSUNX) +#define glFlush MANGLE(Flush) +#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE) +#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange) +#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV) +#define glFlushRasterSGIX MANGLE(FlushRasterSGIX) +#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE) +#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV) +#define glFogCoorddEXT MANGLE(FogCoorddEXT) +#define glFogCoordd MANGLE(FogCoordd) +#define glFogCoorddvEXT MANGLE(FogCoorddvEXT) +#define glFogCoorddv MANGLE(FogCoorddv) +#define glFogCoordfEXT MANGLE(FogCoordfEXT) +#define glFogCoordf MANGLE(FogCoordf) +#define glFogCoordfvEXT MANGLE(FogCoordfvEXT) +#define glFogCoordfv MANGLE(FogCoordfv) +#define glFogCoordhNV MANGLE(FogCoordhNV) +#define glFogCoordhvNV MANGLE(FogCoordhvNV) +#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) +#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) +#define glFogCoordPointer MANGLE(FogCoordPointer) +#define glFogf MANGLE(Fogf) +#define glFogFuncSGIS MANGLE(FogFuncSGIS) +#define glFogfv MANGLE(Fogfv) +#define glFogi MANGLE(Fogi) +#define glFogiv MANGLE(Fogiv) +#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX) +#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX) +#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX) +#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX) +#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX) +#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX) +#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX) +#define glFramebufferDrawBufferEXT MANGLE(FramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT MANGLE(FramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT MANGLE(FramebufferReadBufferEXT) +#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT) +#define glFramebufferRenderbuffer MANGLE(FramebufferRenderbuffer) +#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT) +#define glFramebufferTexture1D MANGLE(FramebufferTexture1D) +#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT) +#define glFramebufferTexture2D MANGLE(FramebufferTexture2D) +#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT) +#define glFramebufferTexture3D MANGLE(FramebufferTexture3D) +#define glFramebufferTextureARB MANGLE(FramebufferTextureARB) +#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT) +#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB) +#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT) +#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB) +#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT) +#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer) +#define glFrameTerminatorGREMEDY MANGLE(FrameTerminatorGREMEDY) +#define glFrameZoomSGIX MANGLE(FrameZoomSGIX) +#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI) +#define glFrontFace MANGLE(FrontFace) +#define glFrustum MANGLE(Frustum) +#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) +#define glGenBuffersARB MANGLE(GenBuffersARB) +#define glGenBuffers MANGLE(GenBuffers) +#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT) +#define glGenerateMipmap MANGLE(GenerateMipmap) +#define glGenerateMultiTexMipmapEXT MANGLE(GenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT MANGLE(GenerateTextureMipmapEXT) +#define glGenFencesAPPLE MANGLE(GenFencesAPPLE) +#define glGenFencesNV MANGLE(GenFencesNV) +#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) +#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT) +#define glGenFramebuffers MANGLE(GenFramebuffers) +#define glGenLists MANGLE(GenLists) +#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV) +#define glGenProgramsARB MANGLE(GenProgramsARB) +#define glGenProgramsNV MANGLE(GenProgramsNV) +#define glGenQueriesARB MANGLE(GenQueriesARB) +#define glGenQueries MANGLE(GenQueries) +#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT) +#define glGenRenderbuffers MANGLE(GenRenderbuffers) +#define glGenSymbolsEXT MANGLE(GenSymbolsEXT) +#define glGenTexturesEXT MANGLE(GenTexturesEXT) +#define glGenTextures MANGLE(GenTextures) +#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV) +#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE) +#define glGenVertexArrays MANGLE(GenVertexArrays) +#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) +#define glGetActiveAttribARB MANGLE(GetActiveAttribARB) +#define glGetActiveAttrib MANGLE(GetActiveAttrib) +#define glGetActiveUniformARB MANGLE(GetActiveUniformARB) +#define glGetActiveUniform MANGLE(GetActiveUniform) +#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV) +#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) +#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) +#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB) +#define glGetAttachedShaders MANGLE(GetAttachedShaders) +#define glGetAttribLocationARB MANGLE(GetAttribLocationARB) +#define glGetAttribLocation MANGLE(GetAttribLocation) +#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT) +#define glGetBooleani_v MANGLE(GetBooleani_v) +#define glGetBooleanv MANGLE(GetBooleanv) +#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB) +#define glGetBufferParameteriv MANGLE(GetBufferParameteriv) +#define glGetBufferPointervARB MANGLE(GetBufferPointervARB) +#define glGetBufferPointerv MANGLE(GetBufferPointerv) +#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB) +#define glGetBufferSubData MANGLE(GetBufferSubData) +#define glGetClipPlane MANGLE(GetClipPlane) +#define glGetColorTableEXT MANGLE(GetColorTableEXT) +#define glGetColorTable MANGLE(GetColorTable) +#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT) +#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv) +#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI) +#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT) +#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv) +#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI) +#define glGetColorTableSGI MANGLE(GetColorTableSGI) +#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV) +#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV) +#define glGetCompressedMultiTexImageEXT MANGLE(GetCompressedMultiTexImageEXT) +#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB) +#define glGetCompressedTexImage MANGLE(GetCompressedTexImage) +#define glGetCompressedTextureImageEXT MANGLE(GetCompressedTextureImageEXT) +#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT) +#define glGetConvolutionFilter MANGLE(GetConvolutionFilter) +#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT) +#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv) +#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT) +#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv) +#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA) +#define glGetDebugLogMESA MANGLE(GetDebugLogMESA) +#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS) +#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT) +#define glGetDoublev MANGLE(GetDoublev) +#define glGetError MANGLE(GetError) +#define glGetFenceivNV MANGLE(GetFenceivNV) +#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV) +#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT) +#define glGetFloatv MANGLE(GetFloatv) +#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS) +#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT) +#define glGetFragDataLocation MANGLE(GetFragDataLocation) +#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX) +#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT) +#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv) +#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT) +#define glGetHandleARB MANGLE(GetHandleARB) +#define glGetHistogramEXT MANGLE(GetHistogramEXT) +#define glGetHistogram MANGLE(GetHistogram) +#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT) +#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv) +#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT) +#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv) +#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP) +#define glGetInfoLogARB MANGLE(GetInfoLogARB) +#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX) +#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT) +#define glGetIntegeri_v MANGLE(GetIntegeri_v) +#define glGetIntegerv MANGLE(GetIntegerv) +#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT) +#define glGetLightfv MANGLE(GetLightfv) +#define glGetLightiv MANGLE(GetLightiv) +#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX) +#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX) +#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT) +#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV) +#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV) +#define glGetMapdv MANGLE(GetMapdv) +#define glGetMapfv MANGLE(GetMapfv) +#define glGetMapiv MANGLE(GetMapiv) +#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV) +#define glGetMapParameterivNV MANGLE(GetMapParameterivNV) +#define glGetMaterialfv MANGLE(GetMaterialfv) +#define glGetMaterialiv MANGLE(GetMaterialiv) +#define glGetMinmaxEXT MANGLE(GetMinmaxEXT) +#define glGetMinmax MANGLE(GetMinmax) +#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT) +#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv) +#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT) +#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv) +#define glGetMultisamplefvNV MANGLE(GetMultisamplefvNV) +#define glGetMultiTexEnvfvEXT MANGLE(GetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT MANGLE(GetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT MANGLE(GetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT MANGLE(GetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT MANGLE(GetMultiTexGenivEXT) +#define glGetMultiTexImageEXT MANGLE(GetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT MANGLE(GetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT MANGLE(GetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterfvEXT MANGLE(GetMultiTexParameterfvEXT) +#define glGetMultiTexParameterIivEXT MANGLE(GetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT MANGLE(GetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterivEXT MANGLE(GetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT MANGLE(GetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT MANGLE(GetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT MANGLE(GetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT MANGLE(GetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramivEXT MANGLE(GetNamedProgramivEXT) +#define glGetNamedProgramLocalParameterdvEXT MANGLE(GetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT MANGLE(GetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramLocalParameterIivEXT MANGLE(GetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT) +#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT) +#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI) +#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI) +#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB) +#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB) +#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV) +#define glGetPixelMapfv MANGLE(GetPixelMapfv) +#define glGetPixelMapuiv MANGLE(GetPixelMapuiv) +#define glGetPixelMapusv MANGLE(GetPixelMapusv) +#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS) +#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS) +#define glGetPointerIndexedvEXT MANGLE(GetPointerIndexedvEXT) +#define glGetPointervEXT MANGLE(GetPointervEXT) +#define glGetPointerv MANGLE(GetPointerv) +#define glGetPolygonStipple MANGLE(GetPolygonStipple) +#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB) +#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV) +#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV) +#define glGetProgramInfoLog MANGLE(GetProgramInfoLog) +#define glGetProgramivARB MANGLE(GetProgramivARB) +#define glGetProgramiv MANGLE(GetProgramiv) +#define glGetProgramivNV MANGLE(GetProgramivNV) +#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB) +#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV) +#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV) +#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV) +#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV) +#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) +#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA) +#define glGetProgramStringARB MANGLE(GetProgramStringARB) +#define glGetProgramStringNV MANGLE(GetProgramStringNV) +#define glGetQueryivARB MANGLE(GetQueryivARB) +#define glGetQueryiv MANGLE(GetQueryiv) +#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT) +#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB) +#define glGetQueryObjectiv MANGLE(GetQueryObjectiv) +#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT) +#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB) +#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) +#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT) +#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv) +#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) +#define glGetSeparableFilter MANGLE(GetSeparableFilter) +#define glGetShaderInfoLog MANGLE(GetShaderInfoLog) +#define glGetShaderiv MANGLE(GetShaderiv) +#define glGetShaderSourceARB MANGLE(GetShaderSourceARB) +#define glGetShaderSource MANGLE(GetShaderSource) +#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) +#define glGetStringi MANGLE(GetStringi) +#define glGetString MANGLE(GetString) +#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI) +#define glGetTexEnvfv MANGLE(GetTexEnvfv) +#define glGetTexEnviv MANGLE(GetTexEnviv) +#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS) +#define glGetTexGendv MANGLE(GetTexGendv) +#define glGetTexGenfv MANGLE(GetTexGenfv) +#define glGetTexGeniv MANGLE(GetTexGeniv) +#define glGetTexImage MANGLE(GetTexImage) +#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv) +#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv) +#define glGetTexParameterfv MANGLE(GetTexParameterfv) +#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT) +#define glGetTexParameterIiv MANGLE(GetTexParameterIiv) +#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT) +#define glGetTexParameterIuiv MANGLE(GetTexParameterIuiv) +#define glGetTexParameteriv MANGLE(GetTexParameteriv) +#define glGetTextureImageEXT MANGLE(GetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT) +#define glGetTextureParameterfvEXT MANGLE(GetTextureParameterfvEXT) +#define glGetTextureParameterIivEXT MANGLE(GetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT MANGLE(GetTextureParameterIuivEXT) +#define glGetTextureParameterivEXT MANGLE(GetTextureParameterivEXT) +#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV) +#define glGetTransformFeedbackVaryingEXT MANGLE(GetTransformFeedbackVaryingEXT) +#define glGetTransformFeedbackVarying MANGLE(GetTransformFeedbackVarying) +#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV) +#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT) +#define glGetUniformfvARB MANGLE(GetUniformfvARB) +#define glGetUniformfv MANGLE(GetUniformfv) +#define glGetUniformivARB MANGLE(GetUniformivARB) +#define glGetUniformiv MANGLE(GetUniformiv) +#define glGetUniformLocationARB MANGLE(GetUniformLocationARB) +#define glGetUniformLocation MANGLE(GetUniformLocation) +#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT) +#define glGetUniformuivEXT MANGLE(GetUniformuivEXT) +#define glGetUniformuiv MANGLE(GetUniformuiv) +#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI) +#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT) +#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT) +#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT) +#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT) +#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV) +#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI) +#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB) +#define glGetVertexAttribdv MANGLE(GetVertexAttribdv) +#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) +#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB) +#define glGetVertexAttribfv MANGLE(GetVertexAttribfv) +#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV) +#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT) +#define glGetVertexAttribIiv MANGLE(GetVertexAttribIiv) +#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT) +#define glGetVertexAttribIuiv MANGLE(GetVertexAttribIuiv) +#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB) +#define glGetVertexAttribiv MANGLE(GetVertexAttribiv) +#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV) +#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB) +#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv) +#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) +#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN) +#define glHint MANGLE(Hint) +#define glHintPGI MANGLE(HintPGI) +#define glHistogramEXT MANGLE(HistogramEXT) +#define glHistogram MANGLE(Histogram) +#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX) +#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP) +#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP) +#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP) +#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP) +#define glIndexd MANGLE(Indexd) +#define glIndexdv MANGLE(Indexdv) +#define glIndexf MANGLE(Indexf) +#define glIndexFuncEXT MANGLE(IndexFuncEXT) +#define glIndexfv MANGLE(Indexfv) +#define glIndexi MANGLE(Indexi) +#define glIndexiv MANGLE(Indexiv) +#define glIndexMask MANGLE(IndexMask) +#define glIndexMaterialEXT MANGLE(IndexMaterialEXT) +#define glIndexPointerEXT MANGLE(IndexPointerEXT) +#define glIndexPointerListIBM MANGLE(IndexPointerListIBM) +#define glIndexPointer MANGLE(IndexPointer) +#define glIndexs MANGLE(Indexs) +#define glIndexsv MANGLE(Indexsv) +#define glIndexub MANGLE(Indexub) +#define glIndexubv MANGLE(Indexubv) +#define glInitNames MANGLE(InitNames) +#define glInsertComponentEXT MANGLE(InsertComponentEXT) +#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX) +#define glInterleavedArrays MANGLE(InterleavedArrays) +#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX) +#define glIsBufferARB MANGLE(IsBufferARB) +#define glIsBuffer MANGLE(IsBuffer) +#define glIsEnabledi MANGLE(IsEnabledi) +#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT) +#define glIsEnabled MANGLE(IsEnabled) +#define glIsFenceAPPLE MANGLE(IsFenceAPPLE) +#define glIsFenceNV MANGLE(IsFenceNV) +#define glIsFramebufferEXT MANGLE(IsFramebufferEXT) +#define glIsFramebuffer MANGLE(IsFramebuffer) +#define glIsList MANGLE(IsList) +#define glIsObjectBufferATI MANGLE(IsObjectBufferATI) +#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) +#define glIsProgramARB MANGLE(IsProgramARB) +#define glIsProgram MANGLE(IsProgram) +#define glIsProgramNV MANGLE(IsProgramNV) +#define glIsQueryARB MANGLE(IsQueryARB) +#define glIsQuery MANGLE(IsQuery) +#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT) +#define glIsRenderbuffer MANGLE(IsRenderbuffer) +#define glIsShader MANGLE(IsShader) +#define glIsTextureEXT MANGLE(IsTextureEXT) +#define glIsTexture MANGLE(IsTexture) +#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV) +#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) +#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE) +#define glIsVertexArray MANGLE(IsVertexArray) +#define glLightEnviSGIX MANGLE(LightEnviSGIX) +#define glLightf MANGLE(Lightf) +#define glLightfv MANGLE(Lightfv) +#define glLighti MANGLE(Lighti) +#define glLightiv MANGLE(Lightiv) +#define glLightModelf MANGLE(LightModelf) +#define glLightModelfv MANGLE(LightModelfv) +#define glLightModeli MANGLE(LightModeli) +#define glLightModeliv MANGLE(LightModeliv) +#define glLineStipple MANGLE(LineStipple) +#define glLineWidth MANGLE(LineWidth) +#define glLinkProgramARB MANGLE(LinkProgramARB) +#define glLinkProgram MANGLE(LinkProgram) +#define glListBase MANGLE(ListBase) +#define glListParameterfSGIX MANGLE(ListParameterfSGIX) +#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX) +#define glListParameteriSGIX MANGLE(ListParameteriSGIX) +#define glListParameterivSGIX MANGLE(ListParameterivSGIX) +#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX) +#define glLoadIdentity MANGLE(LoadIdentity) +#define glLoadMatrixd MANGLE(LoadMatrixd) +#define glLoadMatrixf MANGLE(LoadMatrixf) +#define glLoadName MANGLE(LoadName) +#define glLoadProgramNV MANGLE(LoadProgramNV) +#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB) +#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd) +#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB) +#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf) +#define glLockArraysEXT MANGLE(LockArraysEXT) +#define glLogicOp MANGLE(LogicOp) +#define glMap1d MANGLE(Map1d) +#define glMap1f MANGLE(Map1f) +#define glMap2d MANGLE(Map2d) +#define glMap2f MANGLE(Map2f) +#define glMapBufferARB MANGLE(MapBufferARB) +#define glMapBuffer MANGLE(MapBuffer) +#define glMapBufferRange MANGLE(MapBufferRange) +#define glMapControlPointsNV MANGLE(MapControlPointsNV) +#define glMapGrid1d MANGLE(MapGrid1d) +#define glMapGrid1f MANGLE(MapGrid1f) +#define glMapGrid2d MANGLE(MapGrid2d) +#define glMapGrid2f MANGLE(MapGrid2f) +#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT) +#define glMapObjectBufferATI MANGLE(MapObjectBufferATI) +#define glMapParameterfvNV MANGLE(MapParameterfvNV) +#define glMapParameterivNV MANGLE(MapParameterivNV) +#define glMaterialf MANGLE(Materialf) +#define glMaterialfv MANGLE(Materialfv) +#define glMateriali MANGLE(Materiali) +#define glMaterialiv MANGLE(Materialiv) +#define glMatrixFrustumEXT MANGLE(MatrixFrustumEXT) +#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB) +#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB) +#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB) +#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB) +#define glMatrixLoaddEXT MANGLE(MatrixLoaddEXT) +#define glMatrixLoadfEXT MANGLE(MatrixLoadfEXT) +#define glMatrixLoadIdentityEXT MANGLE(MatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT MANGLE(MatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT MANGLE(MatrixLoadTransposefEXT) +#define glMatrixMode MANGLE(MatrixMode) +#define glMatrixMultdEXT MANGLE(MatrixMultdEXT) +#define glMatrixMultfEXT MANGLE(MatrixMultfEXT) +#define glMatrixMultTransposedEXT MANGLE(MatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT MANGLE(MatrixMultTransposefEXT) +#define glMatrixOrthoEXT MANGLE(MatrixOrthoEXT) +#define glMatrixPopEXT MANGLE(MatrixPopEXT) +#define glMatrixPushEXT MANGLE(MatrixPushEXT) +#define glMatrixRotatedEXT MANGLE(MatrixRotatedEXT) +#define glMatrixRotatefEXT MANGLE(MatrixRotatefEXT) +#define glMatrixScaledEXT MANGLE(MatrixScaledEXT) +#define glMatrixScalefEXT MANGLE(MatrixScalefEXT) +#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT) +#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT) +#define glMinmaxEXT MANGLE(MinmaxEXT) +#define glMinmax MANGLE(Minmax) +#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT) +#define glMultiDrawArrays MANGLE(MultiDrawArrays) +#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE) +#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT) +#define glMultiDrawElements MANGLE(MultiDrawElements) +#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE) +#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM) +#define glMultiTexBufferEXT MANGLE(MultiTexBufferEXT) +#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB) +#define glMultiTexCoord1d MANGLE(MultiTexCoord1d) +#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB) +#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv) +#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB) +#define glMultiTexCoord1f MANGLE(MultiTexCoord1f) +#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB) +#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv) +#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV) +#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV) +#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB) +#define glMultiTexCoord1i MANGLE(MultiTexCoord1i) +#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB) +#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv) +#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB) +#define glMultiTexCoord1s MANGLE(MultiTexCoord1s) +#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB) +#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv) +#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB) +#define glMultiTexCoord2d MANGLE(MultiTexCoord2d) +#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB) +#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv) +#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB) +#define glMultiTexCoord2f MANGLE(MultiTexCoord2f) +#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB) +#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv) +#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV) +#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV) +#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB) +#define glMultiTexCoord2i MANGLE(MultiTexCoord2i) +#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB) +#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv) +#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB) +#define glMultiTexCoord2s MANGLE(MultiTexCoord2s) +#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB) +#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv) +#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB) +#define glMultiTexCoord3d MANGLE(MultiTexCoord3d) +#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB) +#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv) +#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB) +#define glMultiTexCoord3f MANGLE(MultiTexCoord3f) +#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB) +#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv) +#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV) +#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV) +#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB) +#define glMultiTexCoord3i MANGLE(MultiTexCoord3i) +#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB) +#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv) +#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB) +#define glMultiTexCoord3s MANGLE(MultiTexCoord3s) +#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB) +#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv) +#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB) +#define glMultiTexCoord4d MANGLE(MultiTexCoord4d) +#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB) +#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv) +#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB) +#define glMultiTexCoord4f MANGLE(MultiTexCoord4f) +#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB) +#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv) +#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV) +#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV) +#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB) +#define glMultiTexCoord4i MANGLE(MultiTexCoord4i) +#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB) +#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv) +#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB) +#define glMultiTexCoord4s MANGLE(MultiTexCoord4s) +#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB) +#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv) +#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT) +#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT) +#define glMultiTexEnviEXT MANGLE(MultiTexEnviEXT) +#define glMultiTexEnvivEXT MANGLE(MultiTexEnvivEXT) +#define glMultiTexGendEXT MANGLE(MultiTexGendEXT) +#define glMultiTexGendvEXT MANGLE(MultiTexGendvEXT) +#define glMultiTexGenfEXT MANGLE(MultiTexGenfEXT) +#define glMultiTexGenfvEXT MANGLE(MultiTexGenfvEXT) +#define glMultiTexGeniEXT MANGLE(MultiTexGeniEXT) +#define glMultiTexGenivEXT MANGLE(MultiTexGenivEXT) +#define glMultiTexImage1DEXT MANGLE(MultiTexImage1DEXT) +#define glMultiTexImage2DEXT MANGLE(MultiTexImage2DEXT) +#define glMultiTexImage3DEXT MANGLE(MultiTexImage3DEXT) +#define glMultiTexParameterfEXT MANGLE(MultiTexParameterfEXT) +#define glMultiTexParameterfvEXT MANGLE(MultiTexParameterfvEXT) +#define glMultiTexParameteriEXT MANGLE(MultiTexParameteriEXT) +#define glMultiTexParameterIivEXT MANGLE(MultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT MANGLE(MultiTexParameterIuivEXT) +#define glMultiTexParameterivEXT MANGLE(MultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT MANGLE(MultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT MANGLE(MultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT MANGLE(MultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT MANGLE(MultiTexSubImage3DEXT) +#define glMultMatrixd MANGLE(MultMatrixd) +#define glMultMatrixf MANGLE(MultMatrixf) +#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB) +#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd) +#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB) +#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) +#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT) +#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT MANGLE(NamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT MANGLE(NamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT MANGLE(NamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT MANGLE(NamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT MANGLE(NamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT MANGLE(NamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT MANGLE(NamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT MANGLE(NamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT MANGLE(NamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT MANGLE(NamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT) +#define glNewList MANGLE(NewList) +#define glNewObjectBufferATI MANGLE(NewObjectBufferATI) +#define glNormal3b MANGLE(Normal3b) +#define glNormal3bv MANGLE(Normal3bv) +#define glNormal3d MANGLE(Normal3d) +#define glNormal3dv MANGLE(Normal3dv) +#define glNormal3f MANGLE(Normal3f) +#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN) +#define glNormal3fv MANGLE(Normal3fv) +#define glNormal3hNV MANGLE(Normal3hNV) +#define glNormal3hvNV MANGLE(Normal3hvNV) +#define glNormal3i MANGLE(Normal3i) +#define glNormal3iv MANGLE(Normal3iv) +#define glNormal3s MANGLE(Normal3s) +#define glNormal3sv MANGLE(Normal3sv) +#define glNormalPointerEXT MANGLE(NormalPointerEXT) +#define glNormalPointerListIBM MANGLE(NormalPointerListIBM) +#define glNormalPointer MANGLE(NormalPointer) +#define glNormalPointervINTEL MANGLE(NormalPointervINTEL) +#define glNormalStream3bATI MANGLE(NormalStream3bATI) +#define glNormalStream3bvATI MANGLE(NormalStream3bvATI) +#define glNormalStream3dATI MANGLE(NormalStream3dATI) +#define glNormalStream3dvATI MANGLE(NormalStream3dvATI) +#define glNormalStream3fATI MANGLE(NormalStream3fATI) +#define glNormalStream3fvATI MANGLE(NormalStream3fvATI) +#define glNormalStream3iATI MANGLE(NormalStream3iATI) +#define glNormalStream3ivATI MANGLE(NormalStream3ivATI) +#define glNormalStream3sATI MANGLE(NormalStream3sATI) +#define glNormalStream3svATI MANGLE(NormalStream3svATI) +#define glOrtho MANGLE(Ortho) +#define glPassTexCoordATI MANGLE(PassTexCoordATI) +#define glPassThrough MANGLE(PassThrough) +#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV) +#define glPixelDataRangeNV MANGLE(PixelDataRangeNV) +#define glPixelMapfv MANGLE(PixelMapfv) +#define glPixelMapuiv MANGLE(PixelMapuiv) +#define glPixelMapusv MANGLE(PixelMapusv) +#define glPixelStoref MANGLE(PixelStoref) +#define glPixelStorei MANGLE(PixelStorei) +#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS) +#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS) +#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS) +#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS) +#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX) +#define glPixelTransferf MANGLE(PixelTransferf) +#define glPixelTransferi MANGLE(PixelTransferi) +#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT) +#define glPixelZoom MANGLE(PixelZoom) +#define glPNTrianglesfATI MANGLE(PNTrianglesfATI) +#define glPNTrianglesiATI MANGLE(PNTrianglesiATI) +#define glPointParameterfARB MANGLE(PointParameterfARB) +#define glPointParameterfEXT MANGLE(PointParameterfEXT) +#define glPointParameterf MANGLE(PointParameterf) +#define glPointParameterfSGIS MANGLE(PointParameterfSGIS) +#define glPointParameterfvARB MANGLE(PointParameterfvARB) +#define glPointParameterfvEXT MANGLE(PointParameterfvEXT) +#define glPointParameterfv MANGLE(PointParameterfv) +#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS) +#define glPointParameteri MANGLE(PointParameteri) +#define glPointParameteriNV MANGLE(PointParameteriNV) +#define glPointParameteriv MANGLE(PointParameteriv) +#define glPointParameterivNV MANGLE(PointParameterivNV) +#define glPointSize MANGLE(PointSize) +#define glPollAsyncSGIX MANGLE(PollAsyncSGIX) +#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX) +#define glPolygonMode MANGLE(PolygonMode) +#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT) +#define glPolygonOffset MANGLE(PolygonOffset) +#define glPolygonStipple MANGLE(PolygonStipple) +#define glPopAttrib MANGLE(PopAttrib) +#define glPopClientAttrib MANGLE(PopClientAttrib) +#define glPopMatrix MANGLE(PopMatrix) +#define glPopName MANGLE(PopName) +#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV) +#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV) +#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) +#define glPrioritizeTextures MANGLE(PrioritizeTextures) +#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV) +#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV) +#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA) +#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB) +#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV) +#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT) +#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV) +#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB) +#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV) +#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT) +#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV) +#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV) +#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV) +#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV) +#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV) +#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV) +#define glProgramParameteriARB MANGLE(ProgramParameteriARB) +#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT) +#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV) +#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV) +#define glProgramStringARB MANGLE(ProgramStringARB) +#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT) +#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT) +#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT) +#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT) +#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT) +#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT) +#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT) +#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT) +#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT) +#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT) +#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT) +#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT) +#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT) +#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT) +#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT) +#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT) +#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT) +#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT) +#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT) +#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT) +#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT) +#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT) +#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT) +#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT) +#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV) +#define glPushAttrib MANGLE(PushAttrib) +#define glPushClientAttribDefaultEXT MANGLE(PushClientAttribDefaultEXT) +#define glPushClientAttrib MANGLE(PushClientAttrib) +#define glPushMatrix MANGLE(PushMatrix) +#define glPushName MANGLE(PushName) +#define glRasterPos2d MANGLE(RasterPos2d) +#define glRasterPos2dv MANGLE(RasterPos2dv) +#define glRasterPos2f MANGLE(RasterPos2f) +#define glRasterPos2fv MANGLE(RasterPos2fv) +#define glRasterPos2i MANGLE(RasterPos2i) +#define glRasterPos2iv MANGLE(RasterPos2iv) +#define glRasterPos2s MANGLE(RasterPos2s) +#define glRasterPos2sv MANGLE(RasterPos2sv) +#define glRasterPos3d MANGLE(RasterPos3d) +#define glRasterPos3dv MANGLE(RasterPos3dv) +#define glRasterPos3f MANGLE(RasterPos3f) +#define glRasterPos3fv MANGLE(RasterPos3fv) +#define glRasterPos3i MANGLE(RasterPos3i) +#define glRasterPos3iv MANGLE(RasterPos3iv) +#define glRasterPos3s MANGLE(RasterPos3s) +#define glRasterPos3sv MANGLE(RasterPos3sv) +#define glRasterPos4d MANGLE(RasterPos4d) +#define glRasterPos4dv MANGLE(RasterPos4dv) +#define glRasterPos4f MANGLE(RasterPos4f) +#define glRasterPos4fv MANGLE(RasterPos4fv) +#define glRasterPos4i MANGLE(RasterPos4i) +#define glRasterPos4iv MANGLE(RasterPos4iv) +#define glRasterPos4s MANGLE(RasterPos4s) +#define glRasterPos4sv MANGLE(RasterPos4sv) +#define glReadBuffer MANGLE(ReadBuffer) +#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX) +#define glReadPixels MANGLE(ReadPixels) +#define glRectd MANGLE(Rectd) +#define glRectdv MANGLE(Rectdv) +#define glRectf MANGLE(Rectf) +#define glRectfv MANGLE(Rectfv) +#define glRecti MANGLE(Recti) +#define glRectiv MANGLE(Rectiv) +#define glRects MANGLE(Rects) +#define glRectsv MANGLE(Rectsv) +#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) +#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT) +#define glRenderbufferStorage MANGLE(RenderbufferStorage) +#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV) +#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT) +#define glRenderbufferStorageMultisample MANGLE(RenderbufferStorageMultisample) +#define glRenderMode MANGLE(RenderMode) +#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) +#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) +#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN) +#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN) +#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN) +#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN) +#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV) +#define glResetHistogramEXT MANGLE(ResetHistogramEXT) +#define glResetHistogram MANGLE(ResetHistogram) +#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT) +#define glResetMinmax MANGLE(ResetMinmax) +#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA) +#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV) +#define glRotated MANGLE(Rotated) +#define glRotatef MANGLE(Rotatef) +#define glSampleCoverageARB MANGLE(SampleCoverageARB) +#define glSampleCoverage MANGLE(SampleCoverage) +#define glSampleMapATI MANGLE(SampleMapATI) +#define glSampleMaskEXT MANGLE(SampleMaskEXT) +#define glSampleMaskIndexedNV MANGLE(SampleMaskIndexedNV) +#define glSampleMaskSGIS MANGLE(SampleMaskSGIS) +#define glSamplePatternEXT MANGLE(SamplePatternEXT) +#define glSamplePatternSGIS MANGLE(SamplePatternSGIS) +#define glScaled MANGLE(Scaled) +#define glScalef MANGLE(Scalef) +#define glScissor MANGLE(Scissor) +#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT) +#define glSecondaryColor3b MANGLE(SecondaryColor3b) +#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT) +#define glSecondaryColor3bv MANGLE(SecondaryColor3bv) +#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT) +#define glSecondaryColor3d MANGLE(SecondaryColor3d) +#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT) +#define glSecondaryColor3dv MANGLE(SecondaryColor3dv) +#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT) +#define glSecondaryColor3f MANGLE(SecondaryColor3f) +#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT) +#define glSecondaryColor3fv MANGLE(SecondaryColor3fv) +#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV) +#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV) +#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT) +#define glSecondaryColor3i MANGLE(SecondaryColor3i) +#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT) +#define glSecondaryColor3iv MANGLE(SecondaryColor3iv) +#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT) +#define glSecondaryColor3s MANGLE(SecondaryColor3s) +#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT) +#define glSecondaryColor3sv MANGLE(SecondaryColor3sv) +#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT) +#define glSecondaryColor3ub MANGLE(SecondaryColor3ub) +#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT) +#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv) +#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT) +#define glSecondaryColor3ui MANGLE(SecondaryColor3ui) +#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT) +#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv) +#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT) +#define glSecondaryColor3us MANGLE(SecondaryColor3us) +#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT) +#define glSecondaryColor3usv MANGLE(SecondaryColor3usv) +#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT) +#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM) +#define glSecondaryColorPointer MANGLE(SecondaryColorPointer) +#define glSelectBuffer MANGLE(SelectBuffer) +#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT) +#define glSeparableFilter2D MANGLE(SeparableFilter2D) +#define glSetFenceAPPLE MANGLE(SetFenceAPPLE) +#define glSetFenceNV MANGLE(SetFenceNV) +#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI) +#define glSetInvariantEXT MANGLE(SetInvariantEXT) +#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT) +#define glShadeModel MANGLE(ShadeModel) +#define glShaderOp1EXT MANGLE(ShaderOp1EXT) +#define glShaderOp2EXT MANGLE(ShaderOp2EXT) +#define glShaderOp3EXT MANGLE(ShaderOp3EXT) +#define glShaderSourceARB MANGLE(ShaderSourceARB) +#define glShaderSource MANGLE(ShaderSource) +#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS) +#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX) +#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX) +#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX) +#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) +#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) +#define glStencilClearTagEXT MANGLE(StencilClearTagEXT) +#define glStencilFunc MANGLE(StencilFunc) +#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) +#define glStencilFuncSeparate MANGLE(StencilFuncSeparate) +#define glStencilMask MANGLE(StencilMask) +#define glStencilMaskSeparate MANGLE(StencilMaskSeparate) +#define glStencilOp MANGLE(StencilOp) +#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI) +#define glStencilOpSeparate MANGLE(StencilOpSeparate) +#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX) +#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY) +#define glSwizzleEXT MANGLE(SwizzleEXT) +#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX) +#define glTangent3bEXT MANGLE(Tangent3bEXT) +#define glTangent3bvEXT MANGLE(Tangent3bvEXT) +#define glTangent3dEXT MANGLE(Tangent3dEXT) +#define glTangent3dvEXT MANGLE(Tangent3dvEXT) +#define glTangent3fEXT MANGLE(Tangent3fEXT) +#define glTangent3fvEXT MANGLE(Tangent3fvEXT) +#define glTangent3iEXT MANGLE(Tangent3iEXT) +#define glTangent3ivEXT MANGLE(Tangent3ivEXT) +#define glTangent3sEXT MANGLE(Tangent3sEXT) +#define glTangent3svEXT MANGLE(Tangent3svEXT) +#define glTangentPointerEXT MANGLE(TangentPointerEXT) +#define glTbufferMask3DFX MANGLE(TbufferMask3DFX) +#define glTestFenceAPPLE MANGLE(TestFenceAPPLE) +#define glTestFenceNV MANGLE(TestFenceNV) +#define glTestObjectAPPLE MANGLE(TestObjectAPPLE) +#define glTexBufferARB MANGLE(TexBufferARB) +#define glTexBufferEXT MANGLE(TexBufferEXT) +#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI) +#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI) +#define glTexCoord1d MANGLE(TexCoord1d) +#define glTexCoord1dv MANGLE(TexCoord1dv) +#define glTexCoord1f MANGLE(TexCoord1f) +#define glTexCoord1fv MANGLE(TexCoord1fv) +#define glTexCoord1hNV MANGLE(TexCoord1hNV) +#define glTexCoord1hvNV MANGLE(TexCoord1hvNV) +#define glTexCoord1i MANGLE(TexCoord1i) +#define glTexCoord1iv MANGLE(TexCoord1iv) +#define glTexCoord1s MANGLE(TexCoord1s) +#define glTexCoord1sv MANGLE(TexCoord1sv) +#define glTexCoord2d MANGLE(TexCoord2d) +#define glTexCoord2dv MANGLE(TexCoord2dv) +#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2f MANGLE(TexCoord2f) +#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN) +#define glTexCoord2fv MANGLE(TexCoord2fv) +#define glTexCoord2hNV MANGLE(TexCoord2hNV) +#define glTexCoord2hvNV MANGLE(TexCoord2hvNV) +#define glTexCoord2i MANGLE(TexCoord2i) +#define glTexCoord2iv MANGLE(TexCoord2iv) +#define glTexCoord2s MANGLE(TexCoord2s) +#define glTexCoord2sv MANGLE(TexCoord2sv) +#define glTexCoord3d MANGLE(TexCoord3d) +#define glTexCoord3dv MANGLE(TexCoord3dv) +#define glTexCoord3f MANGLE(TexCoord3f) +#define glTexCoord3fv MANGLE(TexCoord3fv) +#define glTexCoord3hNV MANGLE(TexCoord3hNV) +#define glTexCoord3hvNV MANGLE(TexCoord3hvNV) +#define glTexCoord3i MANGLE(TexCoord3i) +#define glTexCoord3iv MANGLE(TexCoord3iv) +#define glTexCoord3s MANGLE(TexCoord3s) +#define glTexCoord3sv MANGLE(TexCoord3sv) +#define glTexCoord4d MANGLE(TexCoord4d) +#define glTexCoord4dv MANGLE(TexCoord4dv) +#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4f MANGLE(TexCoord4f) +#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN) +#define glTexCoord4fv MANGLE(TexCoord4fv) +#define glTexCoord4hNV MANGLE(TexCoord4hNV) +#define glTexCoord4hvNV MANGLE(TexCoord4hvNV) +#define glTexCoord4i MANGLE(TexCoord4i) +#define glTexCoord4iv MANGLE(TexCoord4iv) +#define glTexCoord4s MANGLE(TexCoord4s) +#define glTexCoord4sv MANGLE(TexCoord4sv) +#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT) +#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM) +#define glTexCoordPointer MANGLE(TexCoordPointer) +#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL) +#define glTexEnvf MANGLE(TexEnvf) +#define glTexEnvfv MANGLE(TexEnvfv) +#define glTexEnvi MANGLE(TexEnvi) +#define glTexEnviv MANGLE(TexEnviv) +#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS) +#define glTexGend MANGLE(TexGend) +#define glTexGendv MANGLE(TexGendv) +#define glTexGenf MANGLE(TexGenf) +#define glTexGenfv MANGLE(TexGenfv) +#define glTexGeni MANGLE(TexGeni) +#define glTexGeniv MANGLE(TexGeniv) +#define glTexImage1D MANGLE(TexImage1D) +#define glTexImage2D MANGLE(TexImage2D) +#define glTexImage3DEXT MANGLE(TexImage3DEXT) +#define glTexImage3D MANGLE(TexImage3D) +#define glTexImage4DSGIS MANGLE(TexImage4DSGIS) +#define glTexParameterf MANGLE(TexParameterf) +#define glTexParameterfv MANGLE(TexParameterfv) +#define glTexParameterIivEXT MANGLE(TexParameterIivEXT) +#define glTexParameterIiv MANGLE(TexParameterIiv) +#define glTexParameteri MANGLE(TexParameteri) +#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT) +#define glTexParameterIuiv MANGLE(TexParameterIuiv) +#define glTexParameteriv MANGLE(TexParameteriv) +#define glTexRenderbufferNV MANGLE(TexRenderbufferNV) +#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT) +#define glTexSubImage1D MANGLE(TexSubImage1D) +#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT) +#define glTexSubImage2D MANGLE(TexSubImage2D) +#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT) +#define glTexSubImage3D MANGLE(TexSubImage3D) +#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS) +#define glTextureBufferEXT MANGLE(TextureBufferEXT) +#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS) +#define glTextureImage1DEXT MANGLE(TextureImage1DEXT) +#define glTextureImage2DEXT MANGLE(TextureImage2DEXT) +#define glTextureImage3DEXT MANGLE(TextureImage3DEXT) +#define glTextureLightEXT MANGLE(TextureLightEXT) +#define glTextureMaterialEXT MANGLE(TextureMaterialEXT) +#define glTextureNormalEXT MANGLE(TextureNormalEXT) +#define glTextureParameterfEXT MANGLE(TextureParameterfEXT) +#define glTextureParameterfvEXT MANGLE(TextureParameterfvEXT) +#define glTextureParameteriEXT MANGLE(TextureParameteriEXT) +#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT) +#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT) +#define glTextureParameterivEXT MANGLE(TextureParameterivEXT) +#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT) +#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT) +#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT) +#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT) +#define glTrackMatrixNV MANGLE(TrackMatrixNV) +#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT) +#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings) +#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV) +#define glTranslated MANGLE(Translated) +#define glTranslatef MANGLE(Translatef) +#define glUniform1fARB MANGLE(Uniform1fARB) +#define glUniform1f MANGLE(Uniform1f) +#define glUniform1fvARB MANGLE(Uniform1fvARB) +#define glUniform1fv MANGLE(Uniform1fv) +#define glUniform1iARB MANGLE(Uniform1iARB) +#define glUniform1i MANGLE(Uniform1i) +#define glUniform1ivARB MANGLE(Uniform1ivARB) +#define glUniform1iv MANGLE(Uniform1iv) +#define glUniform1uiEXT MANGLE(Uniform1uiEXT) +#define glUniform1ui MANGLE(Uniform1ui) +#define glUniform1uivEXT MANGLE(Uniform1uivEXT) +#define glUniform1uiv MANGLE(Uniform1uiv) +#define glUniform2fARB MANGLE(Uniform2fARB) +#define glUniform2f MANGLE(Uniform2f) +#define glUniform2fvARB MANGLE(Uniform2fvARB) +#define glUniform2fv MANGLE(Uniform2fv) +#define glUniform2iARB MANGLE(Uniform2iARB) +#define glUniform2i MANGLE(Uniform2i) +#define glUniform2ivARB MANGLE(Uniform2ivARB) +#define glUniform2iv MANGLE(Uniform2iv) +#define glUniform2uiEXT MANGLE(Uniform2uiEXT) +#define glUniform2ui MANGLE(Uniform2ui) +#define glUniform2uivEXT MANGLE(Uniform2uivEXT) +#define glUniform2uiv MANGLE(Uniform2uiv) +#define glUniform3fARB MANGLE(Uniform3fARB) +#define glUniform3f MANGLE(Uniform3f) +#define glUniform3fvARB MANGLE(Uniform3fvARB) +#define glUniform3fv MANGLE(Uniform3fv) +#define glUniform3iARB MANGLE(Uniform3iARB) +#define glUniform3i MANGLE(Uniform3i) +#define glUniform3ivARB MANGLE(Uniform3ivARB) +#define glUniform3iv MANGLE(Uniform3iv) +#define glUniform3uiEXT MANGLE(Uniform3uiEXT) +#define glUniform3ui MANGLE(Uniform3ui) +#define glUniform3uivEXT MANGLE(Uniform3uivEXT) +#define glUniform3uiv MANGLE(Uniform3uiv) +#define glUniform4fARB MANGLE(Uniform4fARB) +#define glUniform4f MANGLE(Uniform4f) +#define glUniform4fvARB MANGLE(Uniform4fvARB) +#define glUniform4fv MANGLE(Uniform4fv) +#define glUniform4iARB MANGLE(Uniform4iARB) +#define glUniform4i MANGLE(Uniform4i) +#define glUniform4ivARB MANGLE(Uniform4ivARB) +#define glUniform4iv MANGLE(Uniform4iv) +#define glUniform4uiEXT MANGLE(Uniform4uiEXT) +#define glUniform4ui MANGLE(Uniform4ui) +#define glUniform4uivEXT MANGLE(Uniform4uivEXT) +#define glUniform4uiv MANGLE(Uniform4uiv) +#define glUniformBufferEXT MANGLE(UniformBufferEXT) +#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) +#define glUniformMatrix2fv MANGLE(UniformMatrix2fv) +#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv) +#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv) +#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) +#define glUniformMatrix3fv MANGLE(UniformMatrix3fv) +#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv) +#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv) +#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) +#define glUniformMatrix4fv MANGLE(UniformMatrix4fv) +#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv) +#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv) +#define glUnlockArraysEXT MANGLE(UnlockArraysEXT) +#define glUnmapBufferARB MANGLE(UnmapBufferARB) +#define glUnmapBuffer MANGLE(UnmapBuffer) +#define glUnmapNamedBufferEXT MANGLE(UnmapNamedBufferEXT) +#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI) +#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) +#define glUseProgram MANGLE(UseProgram) +#define glUseProgramObjectARB MANGLE(UseProgramObjectARB) +#define glValidateProgramARB MANGLE(ValidateProgramARB) +#define glValidateProgram MANGLE(ValidateProgram) +#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) +#define glVariantbvEXT MANGLE(VariantbvEXT) +#define glVariantdvEXT MANGLE(VariantdvEXT) +#define glVariantfvEXT MANGLE(VariantfvEXT) +#define glVariantivEXT MANGLE(VariantivEXT) +#define glVariantPointerEXT MANGLE(VariantPointerEXT) +#define glVariantsvEXT MANGLE(VariantsvEXT) +#define glVariantubvEXT MANGLE(VariantubvEXT) +#define glVariantuivEXT MANGLE(VariantuivEXT) +#define glVariantusvEXT MANGLE(VariantusvEXT) +#define glVertex2d MANGLE(Vertex2d) +#define glVertex2dv MANGLE(Vertex2dv) +#define glVertex2f MANGLE(Vertex2f) +#define glVertex2fv MANGLE(Vertex2fv) +#define glVertex2hNV MANGLE(Vertex2hNV) +#define glVertex2hvNV MANGLE(Vertex2hvNV) +#define glVertex2i MANGLE(Vertex2i) +#define glVertex2iv MANGLE(Vertex2iv) +#define glVertex2s MANGLE(Vertex2s) +#define glVertex2sv MANGLE(Vertex2sv) +#define glVertex3d MANGLE(Vertex3d) +#define glVertex3dv MANGLE(Vertex3dv) +#define glVertex3f MANGLE(Vertex3f) +#define glVertex3fv MANGLE(Vertex3fv) +#define glVertex3hNV MANGLE(Vertex3hNV) +#define glVertex3hvNV MANGLE(Vertex3hvNV) +#define glVertex3i MANGLE(Vertex3i) +#define glVertex3iv MANGLE(Vertex3iv) +#define glVertex3s MANGLE(Vertex3s) +#define glVertex3sv MANGLE(Vertex3sv) +#define glVertex4d MANGLE(Vertex4d) +#define glVertex4dv MANGLE(Vertex4dv) +#define glVertex4f MANGLE(Vertex4f) +#define glVertex4fv MANGLE(Vertex4fv) +#define glVertex4hNV MANGLE(Vertex4hNV) +#define glVertex4hvNV MANGLE(Vertex4hvNV) +#define glVertex4i MANGLE(Vertex4i) +#define glVertex4iv MANGLE(Vertex4iv) +#define glVertex4s MANGLE(Vertex4s) +#define glVertex4sv MANGLE(Vertex4sv) +#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE) +#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV) +#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB) +#define glVertexAttrib1d MANGLE(VertexAttrib1d) +#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV) +#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB) +#define glVertexAttrib1dv MANGLE(VertexAttrib1dv) +#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV) +#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB) +#define glVertexAttrib1f MANGLE(VertexAttrib1f) +#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV) +#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB) +#define glVertexAttrib1fv MANGLE(VertexAttrib1fv) +#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV) +#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV) +#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV) +#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB) +#define glVertexAttrib1s MANGLE(VertexAttrib1s) +#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV) +#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB) +#define glVertexAttrib1sv MANGLE(VertexAttrib1sv) +#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV) +#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB) +#define glVertexAttrib2d MANGLE(VertexAttrib2d) +#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV) +#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB) +#define glVertexAttrib2dv MANGLE(VertexAttrib2dv) +#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV) +#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB) +#define glVertexAttrib2f MANGLE(VertexAttrib2f) +#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV) +#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB) +#define glVertexAttrib2fv MANGLE(VertexAttrib2fv) +#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV) +#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV) +#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV) +#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB) +#define glVertexAttrib2s MANGLE(VertexAttrib2s) +#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV) +#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB) +#define glVertexAttrib2sv MANGLE(VertexAttrib2sv) +#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV) +#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB) +#define glVertexAttrib3d MANGLE(VertexAttrib3d) +#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV) +#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB) +#define glVertexAttrib3dv MANGLE(VertexAttrib3dv) +#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV) +#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB) +#define glVertexAttrib3f MANGLE(VertexAttrib3f) +#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV) +#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB) +#define glVertexAttrib3fv MANGLE(VertexAttrib3fv) +#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV) +#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV) +#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV) +#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB) +#define glVertexAttrib3s MANGLE(VertexAttrib3s) +#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) +#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB) +#define glVertexAttrib3sv MANGLE(VertexAttrib3sv) +#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV) +#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB) +#define glVertexAttrib4bv MANGLE(VertexAttrib4bv) +#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB) +#define glVertexAttrib4d MANGLE(VertexAttrib4d) +#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV) +#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB) +#define glVertexAttrib4dv MANGLE(VertexAttrib4dv) +#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV) +#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB) +#define glVertexAttrib4f MANGLE(VertexAttrib4f) +#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV) +#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB) +#define glVertexAttrib4fv MANGLE(VertexAttrib4fv) +#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) +#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV) +#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV) +#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB) +#define glVertexAttrib4iv MANGLE(VertexAttrib4iv) +#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) +#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv) +#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) +#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv) +#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB) +#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv) +#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB) +#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub) +#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB) +#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv) +#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB) +#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv) +#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB) +#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv) +#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB) +#define glVertexAttrib4s MANGLE(VertexAttrib4s) +#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV) +#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB) +#define glVertexAttrib4sv MANGLE(VertexAttrib4sv) +#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV) +#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV) +#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB) +#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv) +#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV) +#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB) +#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv) +#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB) +#define glVertexAttrib4usv MANGLE(VertexAttrib4usv) +#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI) +#define glVertexAttribDivisor MANGLE(VertexAttribDivisor) +#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT) +#define glVertexAttribI1i MANGLE(VertexAttribI1i) +#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT) +#define glVertexAttribI1iv MANGLE(VertexAttribI1iv) +#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT) +#define glVertexAttribI1ui MANGLE(VertexAttribI1ui) +#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT) +#define glVertexAttribI1uiv MANGLE(VertexAttribI1uiv) +#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT) +#define glVertexAttribI2i MANGLE(VertexAttribI2i) +#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT) +#define glVertexAttribI2iv MANGLE(VertexAttribI2iv) +#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT) +#define glVertexAttribI2ui MANGLE(VertexAttribI2ui) +#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT) +#define glVertexAttribI2uiv MANGLE(VertexAttribI2uiv) +#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT) +#define glVertexAttribI3i MANGLE(VertexAttribI3i) +#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT) +#define glVertexAttribI3iv MANGLE(VertexAttribI3iv) +#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT) +#define glVertexAttribI3ui MANGLE(VertexAttribI3ui) +#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT) +#define glVertexAttribI3uiv MANGLE(VertexAttribI3uiv) +#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT) +#define glVertexAttribI4bv MANGLE(VertexAttribI4bv) +#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT) +#define glVertexAttribI4i MANGLE(VertexAttribI4i) +#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT) +#define glVertexAttribI4iv MANGLE(VertexAttribI4iv) +#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT) +#define glVertexAttribI4sv MANGLE(VertexAttribI4sv) +#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT) +#define glVertexAttribI4ubv MANGLE(VertexAttribI4ubv) +#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT) +#define glVertexAttribI4ui MANGLE(VertexAttribI4ui) +#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT) +#define glVertexAttribI4uiv MANGLE(VertexAttribI4uiv) +#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT) +#define glVertexAttribI4usv MANGLE(VertexAttribI4usv) +#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT) +#define glVertexAttribIPointer MANGLE(VertexAttribIPointer) +#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB) +#define glVertexAttribPointer MANGLE(VertexAttribPointer) +#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV) +#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV) +#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV) +#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV) +#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV) +#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV) +#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV) +#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV) +#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV) +#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV) +#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV) +#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV) +#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV) +#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV) +#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV) +#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV) +#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV) +#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV) +#define glVertexBlendARB MANGLE(VertexBlendARB) +#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI) +#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI) +#define glVertexPointerEXT MANGLE(VertexPointerEXT) +#define glVertexPointerListIBM MANGLE(VertexPointerListIBM) +#define glVertexPointer MANGLE(VertexPointer) +#define glVertexPointervINTEL MANGLE(VertexPointervINTEL) +#define glVertexStream1dATI MANGLE(VertexStream1dATI) +#define glVertexStream1dvATI MANGLE(VertexStream1dvATI) +#define glVertexStream1fATI MANGLE(VertexStream1fATI) +#define glVertexStream1fvATI MANGLE(VertexStream1fvATI) +#define glVertexStream1iATI MANGLE(VertexStream1iATI) +#define glVertexStream1ivATI MANGLE(VertexStream1ivATI) +#define glVertexStream1sATI MANGLE(VertexStream1sATI) +#define glVertexStream1svATI MANGLE(VertexStream1svATI) +#define glVertexStream2dATI MANGLE(VertexStream2dATI) +#define glVertexStream2dvATI MANGLE(VertexStream2dvATI) +#define glVertexStream2fATI MANGLE(VertexStream2fATI) +#define glVertexStream2fvATI MANGLE(VertexStream2fvATI) +#define glVertexStream2iATI MANGLE(VertexStream2iATI) +#define glVertexStream2ivATI MANGLE(VertexStream2ivATI) +#define glVertexStream2sATI MANGLE(VertexStream2sATI) +#define glVertexStream2svATI MANGLE(VertexStream2svATI) +#define glVertexStream3dATI MANGLE(VertexStream3dATI) +#define glVertexStream3dvATI MANGLE(VertexStream3dvATI) +#define glVertexStream3fATI MANGLE(VertexStream3fATI) +#define glVertexStream3fvATI MANGLE(VertexStream3fvATI) +#define glVertexStream3iATI MANGLE(VertexStream3iATI) +#define glVertexStream3ivATI MANGLE(VertexStream3ivATI) +#define glVertexStream3sATI MANGLE(VertexStream3sATI) +#define glVertexStream3svATI MANGLE(VertexStream3svATI) +#define glVertexStream4dATI MANGLE(VertexStream4dATI) +#define glVertexStream4dvATI MANGLE(VertexStream4dvATI) +#define glVertexStream4fATI MANGLE(VertexStream4fATI) +#define glVertexStream4fvATI MANGLE(VertexStream4fvATI) +#define glVertexStream4iATI MANGLE(VertexStream4iATI) +#define glVertexStream4ivATI MANGLE(VertexStream4ivATI) +#define glVertexStream4sATI MANGLE(VertexStream4sATI) +#define glVertexStream4svATI MANGLE(VertexStream4svATI) +#define glVertexWeightfEXT MANGLE(VertexWeightfEXT) +#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT) +#define glVertexWeighthNV MANGLE(VertexWeighthNV) +#define glVertexWeighthvNV MANGLE(VertexWeighthvNV) +#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) +#define glViewport MANGLE(Viewport) +#define glWeightbvARB MANGLE(WeightbvARB) +#define glWeightdvARB MANGLE(WeightdvARB) +#define glWeightfvARB MANGLE(WeightfvARB) +#define glWeightivARB MANGLE(WeightivARB) +#define glWeightPointerARB MANGLE(WeightPointerARB) +#define glWeightsvARB MANGLE(WeightsvARB) +#define glWeightubvARB MANGLE(WeightubvARB) +#define glWeightuivARB MANGLE(WeightuivARB) +#define glWeightusvARB MANGLE(WeightusvARB) +#define glWindowPos2dARB MANGLE(WindowPos2dARB) +#define glWindowPos2d MANGLE(WindowPos2d) +#define glWindowPos2dMESA MANGLE(WindowPos2dMESA) +#define glWindowPos2dvARB MANGLE(WindowPos2dvARB) +#define glWindowPos2dv MANGLE(WindowPos2dv) +#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA) +#define glWindowPos2fARB MANGLE(WindowPos2fARB) +#define glWindowPos2f MANGLE(WindowPos2f) +#define glWindowPos2fMESA MANGLE(WindowPos2fMESA) +#define glWindowPos2fvARB MANGLE(WindowPos2fvARB) +#define glWindowPos2fv MANGLE(WindowPos2fv) +#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA) +#define glWindowPos2iARB MANGLE(WindowPos2iARB) +#define glWindowPos2i MANGLE(WindowPos2i) +#define glWindowPos2iMESA MANGLE(WindowPos2iMESA) +#define glWindowPos2ivARB MANGLE(WindowPos2ivARB) +#define glWindowPos2iv MANGLE(WindowPos2iv) +#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA) +#define glWindowPos2sARB MANGLE(WindowPos2sARB) +#define glWindowPos2s MANGLE(WindowPos2s) +#define glWindowPos2sMESA MANGLE(WindowPos2sMESA) +#define glWindowPos2svARB MANGLE(WindowPos2svARB) +#define glWindowPos2sv MANGLE(WindowPos2sv) +#define glWindowPos2svMESA MANGLE(WindowPos2svMESA) +#define glWindowPos3dARB MANGLE(WindowPos3dARB) +#define glWindowPos3d MANGLE(WindowPos3d) +#define glWindowPos3dMESA MANGLE(WindowPos3dMESA) +#define glWindowPos3dvARB MANGLE(WindowPos3dvARB) +#define glWindowPos3dv MANGLE(WindowPos3dv) +#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA) +#define glWindowPos3fARB MANGLE(WindowPos3fARB) +#define glWindowPos3f MANGLE(WindowPos3f) +#define glWindowPos3fMESA MANGLE(WindowPos3fMESA) +#define glWindowPos3fvARB MANGLE(WindowPos3fvARB) +#define glWindowPos3fv MANGLE(WindowPos3fv) +#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA) +#define glWindowPos3iARB MANGLE(WindowPos3iARB) +#define glWindowPos3i MANGLE(WindowPos3i) +#define glWindowPos3iMESA MANGLE(WindowPos3iMESA) +#define glWindowPos3ivARB MANGLE(WindowPos3ivARB) +#define glWindowPos3iv MANGLE(WindowPos3iv) +#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA) +#define glWindowPos3sARB MANGLE(WindowPos3sARB) +#define glWindowPos3s MANGLE(WindowPos3s) +#define glWindowPos3sMESA MANGLE(WindowPos3sMESA) +#define glWindowPos3svARB MANGLE(WindowPos3svARB) +#define glWindowPos3sv MANGLE(WindowPos3sv) +#define glWindowPos3svMESA MANGLE(WindowPos3svMESA) +#define glWindowPos4dMESA MANGLE(WindowPos4dMESA) +#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA) +#define glWindowPos4fMESA MANGLE(WindowPos4fMESA) +#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA) +#define glWindowPos4iMESA MANGLE(WindowPos4iMESA) +#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA) +#define glWindowPos4sMESA MANGLE(WindowPos4sMESA) +#define glWindowPos4svMESA MANGLE(WindowPos4svMESA) +#define glWriteMaskEXT MANGLE(WriteMaskEXT) + +#endif /* GL_MANGLE_H */ diff -Nru xpsb-glx-0.19/mesa/include/GL/glu.h xpsb-glx-0.19/mesa/include/GL/glu.h --- xpsb-glx-0.19/mesa/include/GL/glu.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glu.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,353 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#ifndef __glu_h__ +#define __glu_h__ + +#if defined(USE_MGL_NAMESPACE) +#include "glu_mangle.h" +#endif + +#include + +#ifndef GLAPIENTRY +#if defined(_MSC_VER) || defined(__MINGW32__) +#define GLAPIENTRY __stdcall +#else +#define GLAPIENTRY +#endif +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32) +# undef GLAPI +# define GLAPI __declspec(dllexport) +#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) +/* tag specifying we're building for DLL runtime support */ +# undef GLAPI +# define GLAPI __declspec(dllimport) +#elif !defined(GLAPI) +/* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +#endif /* _STATIC_MESA support */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************/ + +/* Extensions */ +#define GLU_EXT_object_space_tess 1 +#define GLU_EXT_nurbs_tessellator 1 + +/* Boolean */ +#define GLU_FALSE 0 +#define GLU_TRUE 1 + +/* Version */ +#define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 +#define GLU_VERSION_1_3 1 + +/* StringName */ +#define GLU_VERSION 100800 +#define GLU_EXTENSIONS 100801 + +/* ErrorCode */ +#define GLU_INVALID_ENUM 100900 +#define GLU_INVALID_VALUE 100901 +#define GLU_OUT_OF_MEMORY 100902 +#define GLU_INCOMPATIBLE_GL_VERSION 100903 +#define GLU_INVALID_OPERATION 100904 + +/* NurbsDisplay */ +/* GLU_FILL */ +#define GLU_OUTLINE_POLYGON 100240 +#define GLU_OUTLINE_PATCH 100241 + +/* NurbsCallback */ +#define GLU_NURBS_ERROR 100103 +#define GLU_ERROR 100103 +#define GLU_NURBS_BEGIN 100164 +#define GLU_NURBS_BEGIN_EXT 100164 +#define GLU_NURBS_VERTEX 100165 +#define GLU_NURBS_VERTEX_EXT 100165 +#define GLU_NURBS_NORMAL 100166 +#define GLU_NURBS_NORMAL_EXT 100166 +#define GLU_NURBS_COLOR 100167 +#define GLU_NURBS_COLOR_EXT 100167 +#define GLU_NURBS_TEXTURE_COORD 100168 +#define GLU_NURBS_TEX_COORD_EXT 100168 +#define GLU_NURBS_END 100169 +#define GLU_NURBS_END_EXT 100169 +#define GLU_NURBS_BEGIN_DATA 100170 +#define GLU_NURBS_BEGIN_DATA_EXT 100170 +#define GLU_NURBS_VERTEX_DATA 100171 +#define GLU_NURBS_VERTEX_DATA_EXT 100171 +#define GLU_NURBS_NORMAL_DATA 100172 +#define GLU_NURBS_NORMAL_DATA_EXT 100172 +#define GLU_NURBS_COLOR_DATA 100173 +#define GLU_NURBS_COLOR_DATA_EXT 100173 +#define GLU_NURBS_TEXTURE_COORD_DATA 100174 +#define GLU_NURBS_TEX_COORD_DATA_EXT 100174 +#define GLU_NURBS_END_DATA 100175 +#define GLU_NURBS_END_DATA_EXT 100175 + +/* NurbsError */ +#define GLU_NURBS_ERROR1 100251 +#define GLU_NURBS_ERROR2 100252 +#define GLU_NURBS_ERROR3 100253 +#define GLU_NURBS_ERROR4 100254 +#define GLU_NURBS_ERROR5 100255 +#define GLU_NURBS_ERROR6 100256 +#define GLU_NURBS_ERROR7 100257 +#define GLU_NURBS_ERROR8 100258 +#define GLU_NURBS_ERROR9 100259 +#define GLU_NURBS_ERROR10 100260 +#define GLU_NURBS_ERROR11 100261 +#define GLU_NURBS_ERROR12 100262 +#define GLU_NURBS_ERROR13 100263 +#define GLU_NURBS_ERROR14 100264 +#define GLU_NURBS_ERROR15 100265 +#define GLU_NURBS_ERROR16 100266 +#define GLU_NURBS_ERROR17 100267 +#define GLU_NURBS_ERROR18 100268 +#define GLU_NURBS_ERROR19 100269 +#define GLU_NURBS_ERROR20 100270 +#define GLU_NURBS_ERROR21 100271 +#define GLU_NURBS_ERROR22 100272 +#define GLU_NURBS_ERROR23 100273 +#define GLU_NURBS_ERROR24 100274 +#define GLU_NURBS_ERROR25 100275 +#define GLU_NURBS_ERROR26 100276 +#define GLU_NURBS_ERROR27 100277 +#define GLU_NURBS_ERROR28 100278 +#define GLU_NURBS_ERROR29 100279 +#define GLU_NURBS_ERROR30 100280 +#define GLU_NURBS_ERROR31 100281 +#define GLU_NURBS_ERROR32 100282 +#define GLU_NURBS_ERROR33 100283 +#define GLU_NURBS_ERROR34 100284 +#define GLU_NURBS_ERROR35 100285 +#define GLU_NURBS_ERROR36 100286 +#define GLU_NURBS_ERROR37 100287 + +/* NurbsProperty */ +#define GLU_AUTO_LOAD_MATRIX 100200 +#define GLU_CULLING 100201 +#define GLU_SAMPLING_TOLERANCE 100203 +#define GLU_DISPLAY_MODE 100204 +#define GLU_PARAMETRIC_TOLERANCE 100202 +#define GLU_SAMPLING_METHOD 100205 +#define GLU_U_STEP 100206 +#define GLU_V_STEP 100207 +#define GLU_NURBS_MODE 100160 +#define GLU_NURBS_MODE_EXT 100160 +#define GLU_NURBS_TESSELLATOR 100161 +#define GLU_NURBS_TESSELLATOR_EXT 100161 +#define GLU_NURBS_RENDERER 100162 +#define GLU_NURBS_RENDERER_EXT 100162 + +/* NurbsSampling */ +#define GLU_OBJECT_PARAMETRIC_ERROR 100208 +#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 +#define GLU_OBJECT_PATH_LENGTH 100209 +#define GLU_OBJECT_PATH_LENGTH_EXT 100209 +#define GLU_PATH_LENGTH 100215 +#define GLU_PARAMETRIC_ERROR 100216 +#define GLU_DOMAIN_DISTANCE 100217 + +/* NurbsTrim */ +#define GLU_MAP1_TRIM_2 100210 +#define GLU_MAP1_TRIM_3 100211 + +/* QuadricDrawStyle */ +#define GLU_POINT 100010 +#define GLU_LINE 100011 +#define GLU_FILL 100012 +#define GLU_SILHOUETTE 100013 + +/* QuadricCallback */ +/* GLU_ERROR */ + +/* QuadricNormal */ +#define GLU_SMOOTH 100000 +#define GLU_FLAT 100001 +#define GLU_NONE 100002 + +/* QuadricOrientation */ +#define GLU_OUTSIDE 100020 +#define GLU_INSIDE 100021 + +/* TessCallback */ +#define GLU_TESS_BEGIN 100100 +#define GLU_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_VERTEX 100101 +#define GLU_TESS_END 100102 +#define GLU_END 100102 +#define GLU_TESS_ERROR 100103 +#define GLU_TESS_EDGE_FLAG 100104 +#define GLU_EDGE_FLAG 100104 +#define GLU_TESS_COMBINE 100105 +#define GLU_TESS_BEGIN_DATA 100106 +#define GLU_TESS_VERTEX_DATA 100107 +#define GLU_TESS_END_DATA 100108 +#define GLU_TESS_ERROR_DATA 100109 +#define GLU_TESS_EDGE_FLAG_DATA 100110 +#define GLU_TESS_COMBINE_DATA 100111 + +/* TessContour */ +#define GLU_CW 100120 +#define GLU_CCW 100121 +#define GLU_INTERIOR 100122 +#define GLU_EXTERIOR 100123 +#define GLU_UNKNOWN 100124 + +/* TessProperty */ +#define GLU_TESS_WINDING_RULE 100140 +#define GLU_TESS_BOUNDARY_ONLY 100141 +#define GLU_TESS_TOLERANCE 100142 + +/* TessError */ +#define GLU_TESS_ERROR1 100151 +#define GLU_TESS_ERROR2 100152 +#define GLU_TESS_ERROR3 100153 +#define GLU_TESS_ERROR4 100154 +#define GLU_TESS_ERROR5 100155 +#define GLU_TESS_ERROR6 100156 +#define GLU_TESS_ERROR7 100157 +#define GLU_TESS_ERROR8 100158 +#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 +#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 +#define GLU_TESS_MISSING_END_POLYGON 100153 +#define GLU_TESS_MISSING_END_CONTOUR 100154 +#define GLU_TESS_COORD_TOO_LARGE 100155 +#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 + +/* TessWinding */ +#define GLU_TESS_WINDING_ODD 100130 +#define GLU_TESS_WINDING_NONZERO 100131 +#define GLU_TESS_WINDING_POSITIVE 100132 +#define GLU_TESS_WINDING_NEGATIVE 100133 +#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 + +/*************************************************************/ + + +#ifdef __cplusplus +class GLUnurbs; +class GLUquadric; +class GLUtesselator; +#else +typedef struct GLUnurbs GLUnurbs; +typedef struct GLUquadric GLUquadric; +typedef struct GLUtesselator GLUtesselator; +#endif + +typedef GLUnurbs GLUnurbsObj; +typedef GLUquadric GLUquadricObj; +typedef GLUtesselator GLUtesselatorObj; +typedef GLUtesselator GLUtriangulatorObj; + +#define GLU_TESS_MAX_COORD 1.0e150 + +/* Internal convenience typedefs */ +typedef void (GLAPIENTRYP _GLUfuncptr)(); + +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 -Nru xpsb-glx-0.19/mesa/include/GL/glu_mangle.h xpsb-glx-0.19/mesa/include/GL/glu_mangle.h --- xpsb-glx-0.19/mesa/include/GL/glu_mangle.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glu_mangle.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,86 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef GLU_MANGLE_H +#define GLU_MANGLE_H + + +#define gluLookAt mgluLookAt +#define gluOrtho2D mgluOrtho2D +#define gluPerspective mgluPerspective +#define gluPickMatrix mgluPickMatrix +#define gluProject mgluProject +#define gluUnProject mgluUnProject +#define gluErrorString mgluErrorString +#define gluScaleImage mgluScaleImage +#define gluBuild1DMipmaps mgluBuild1DMipmaps +#define gluBuild2DMipmaps mgluBuild2DMipmaps +#define gluNewQuadric mgluNewQuadric +#define gluDeleteQuadric mgluDeleteQuadric +#define gluQuadricDrawStyle mgluQuadricDrawStyle +#define gluQuadricOrientation mgluQuadricOrientation +#define gluQuadricNormals mgluQuadricNormals +#define gluQuadricTexture mgluQuadricTexture +#define gluQuadricCallback mgluQuadricCallback +#define gluCylinder mgluCylinder +#define gluSphere mgluSphere +#define gluDisk mgluDisk +#define gluPartialDisk mgluPartialDisk +#define gluNewNurbsRenderer mgluNewNurbsRenderer +#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer +#define gluLoadSamplingMatrices mgluLoadSamplingMatrices +#define gluNurbsProperty mgluNurbsProperty +#define gluGetNurbsProperty mgluGetNurbsProperty +#define gluBeginCurve mgluBeginCurve +#define gluEndCurve mgluEndCurve +#define gluNurbsCurve mgluNurbsCurve +#define gluBeginSurface mgluBeginSurface +#define gluEndSurface mgluEndSurface +#define gluNurbsSurface mgluNurbsSurface +#define gluBeginTrim mgluBeginTrim +#define gluEndTrim mgluEndTrim +#define gluPwlCurve mgluPwlCurve +#define gluNurbsCallback mgluNurbsCallback +#define gluNewTess mgluNewTess +#define gluDeleteTess mgluDeleteTess +#define gluTessBeginPolygon mgluTessBeginPolygon +#define gluTessBeginContour mgluTessBeginContour +#define gluTessVertex mgluTessVertex +#define gluTessEndPolygon mgluTessEndPolygon +#define gluTessEndContour mgluTessEndContour +#define gluTessProperty mgluTessProperty +#define gluTessNormal mgluTessNormal +#define gluTessCallback mgluTessCallback +#define gluGetTessProperty mgluGetTessProperty +#define gluBeginPolygon mgluBeginPolygon +#define gluNextContour mgluNextContour +#define gluEndPolygon mgluEndPolygon +#define gluGetString mgluGetString +#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels +#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels +#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels +#define gluBuild3DMipmaps mgluBuild3DMipmaps +#define gluCheckExtension mgluCheckExtension +#define gluUnProject4 mgluUnProject4 +#define gluNurbsCallbackData mgluNurbsCallbackData +#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/glutf90.h xpsb-glx-0.19/mesa/include/GL/glutf90.h --- xpsb-glx-0.19/mesa/include/GL/glutf90.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glutf90.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,81 @@ +#ifndef __glutf90_h__ +#define __glutf90_h__ + +/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* This header provides the binding interface for William Mitchell's + f90gl Fortran 90 GLUT binding. Other GLUT language bindings + can and should use this interace. */ + +/* I appreciate the guidance from William Mitchell + (mitchell@cam.nist.gov) in developing this friend interface + for use by the f90gl package. See ../../README.fortran */ + +#include + +/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ +/* NOTE These values are part of a binary interface for the f90gl Fortran + 90 binding and so must NOT changes (additions are allowed). */ + +/* GLUTwindow callbacks. */ +#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ +#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ +#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ +#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ +#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ +#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ +#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ +#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ +#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ +#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ +#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ +#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ +#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ +#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ +#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ +#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ +#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ +#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ +#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ +#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ +/* Non-GLUTwindow callbacks. */ +#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ +#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ +#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ + +/* GLUT Fortran callback function types. */ +typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); +/* NOTE the pressed key is int, not unsigned char for Fortran! */ +typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); +typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); +typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); +typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); + +typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); +typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); +typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTidleFCB) (void); + +/* Functions that set and return Fortran callback functions. */ +GLUTAPI GLUTproc APIENTRY __glutGetFCB(int which); +GLUTAPI void APIENTRY __glutSetFCB(int which, GLUTproc func); + +#endif /* __glutf90_h__ */ diff -Nru xpsb-glx-0.19/mesa/include/GL/glut.h xpsb-glx-0.19/mesa/include/GL/glut.h --- xpsb-glx-0.19/mesa/include/GL/glut.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glut.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,755 @@ +#ifndef __glut_h__ +#define __glut_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ + +/* This program is freely distributable without licensing fees and is + provided without guarantee or warrantee expressed or implied. This + program is -not- in the public domain. */ + +#include +#include + +#if defined(__MINGW32__) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) + +/* GLUT 3.7 now tries to avoid including + to avoid name space pollution, but Win32's + needs APIENTRY and WINGDIAPI defined properly. + + tjump@spgs.com contributes: + If users are building glut code on MS Windows, then they should + make sure they include windows.h early, let's not get into a + header definitions war since MS has proven it's capability to + change header dependencies w/o publishing they have done so. + + So, let's not include windows.h here, as it's not really required and + MS own gl/gl.h *should* include it if the dependency is there. */ + +/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA + in your compile preprocessor options. */ +# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA) +# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */ +/* To enable automatic SGI OpenGL for Windows library usage for GLUT, + define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */ +# ifdef GLUT_USE_SGI_OPENGL +# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */ +# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */ +# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */ +# else +# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */ +# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */ +# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */ +# endif +# endif + +/* To disable supression of annoying warnings about floats being promoted + to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor + options. */ +# ifndef GLUT_NO_WARNING_DISABLE +# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */ +# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +# endif + +/* Win32 has an annoying issue where there are multiple C run-time + libraries (CRTs). If the executable is linked with a different CRT + from the GLUT DLL, the GLUT DLL will not share the same CRT static + data seen by the executable. In particular, atexit callbacks registered + in the executable will not be called if GLUT calls its (different) + exit routine). GLUT is typically built with the + "/MD" option (the CRT with multithreading DLL support), but the Visual + C++ linker default is "/ML" (the single threaded CRT). + + One workaround to this issue is requiring users to always link with + the same CRT as GLUT is compiled with. That requires users supply a + non-standard option. GLUT 3.7 has its own built-in workaround where + the executable's "exit" function pointer is covertly passed to GLUT. + GLUT then calls the executable's exit function pointer to ensure that + any "atexit" calls registered by the application are called if GLUT + needs to exit. + + Note that the __glut*WithExit routines should NEVER be called directly. + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ + +/* XXX This is from Win32's */ +# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl) + /* Define __cdecl for non-Microsoft compilers. */ +# define __cdecl +# define GLUT_DEFINED___CDECL +# endif +# ifndef _CRTIMP +# ifdef _NTSDK + /* Definition compatible with NT SDK */ +# define _CRTIMP +# else + /* Current definition */ +# ifdef _DLL +# define _CRTIMP __declspec(dllimport) +# else +# define _CRTIMP +# endif +# endif +# define GLUT_DEFINED__CRTIMP +# endif +# ifndef GLUT_BUILDING_LIB +extern _CRTIMP void __cdecl exit(int); +# endif + +/* GLUT callback calling convention for Win32. */ +# define GLUTCALLBACK __cdecl + +/* for callback/function pointer defs */ +# define GLUTAPIENTRYV __cdecl + +/* glut-win32 specific macros, defined to prevent collision with + and redifinition of Windows system defs, also removes requirement of + pretty much any standard windows header from this file */ + +#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__) +# define GLUTAPIENTRY __stdcall +#else +# define GLUTAPIENTRY +#endif + +/* GLUT API entry point declarations for Win32. */ +#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL) +# define GLUTAPI __declspec(dllexport) +#elif defined(_DLL) +# define GLUTAPI __declspec(dllimport) +#else +# define GLUTAPI extern +#endif + +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA) +# if !defined(MESA_MINWARN) +# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" ) +# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ") +# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" ) +# endif +# define CALLBACK __stdcall + +#if !defined(__MINGW32__) + typedef int (GLUTAPIENTRY *PROC)(); + typedef void *HGLRC; + typedef void *HDC; +#endif +typedef unsigned long COLORREF; +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA) +# if !defined(MESA_MINWARN) +# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" ) +# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ") +# pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" ) +# endif +# define WGL_FONT_LINES 0 +# define WGL_FONT_POLYGONS 1 +# ifdef UNICODE +# define wglUseFontBitmaps wglUseFontBitmapsW +# define wglUseFontOutlines wglUseFontOutlinesW +# else +# define wglUseFontBitmaps wglUseFontBitmapsA +# define wglUseFontOutlines wglUseFontOutlinesA +# endif /* !UNICODE */ +typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; +# pragma warning( push ) +# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */ +# define WGLAPI __declspec(dllimport) +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC); +WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc); +WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void); +WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); +WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int); +WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); +WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*); +WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); +WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); +WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC); +WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int); +WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); +WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC); +WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); +WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +WGLAPI int GLAPIENTRY SwapBuffers(HDC); +WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY GetPixelFormat(HDC); +WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); +# undef WGLAPI +# pragma warning( pop ) +#endif + +#else /* _WIN32 not defined */ + +/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */ +# define GLUTAPIENTRY GLAPIENTRY +# define GLUTAPIENTRYV +# define GLUTCALLBACK +# define GLUTAPI extern + +#endif + + +/** + GLUT API revision history: + + GLUT_API_VERSION is updated to reflect incompatible GLUT + API changes (interface changes, semantic changes, deletions, + or additions). + + GLUT_API_VERSION=1 First public release of GLUT. 11/29/94 + + GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling, + extension. Supports new input devices like tablet, dial and button + box, and Spaceball. Easy to query OpenGL extensions. + + GLUT_API_VERSION=3 glutMenuStatus added. + + GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer, + glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic + video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, + glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, + glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). + + GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP) +**/ +#ifndef GLUT_API_VERSION /* allow this to be overriden */ +#define GLUT_API_VERSION 5 +#endif + +/** + GLUT implementation revision history: + + GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT + API revisions and implementation revisions (ie, bug fixes). + + GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of + GLUT Xlib-based implementation. 11/29/94 + + GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of + GLUT Xlib-based implementation providing GLUT version 2 + interfaces. + + GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95 + + GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95 + + GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95 + + GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96 + + GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner + and video resize. 1/3/97 + + GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines. + + GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release. + + GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling. + + GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support. + + GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface. + + GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa +**/ +#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */ +#define GLUT_XLIB_IMPLEMENTATION 15 +#endif + +/* Display mode bit masks. */ +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 +#if (GLUT_API_VERSION >= 2) +#define GLUT_MULTISAMPLE 128 +#define GLUT_STEREO 256 +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_LUMINANCE 512 +#endif + +/* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + +/* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +#if (GLUT_API_VERSION >= 2) +/* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 +/* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 +#endif + +/* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + +/* Menu usage state. */ +#define GLUT_MENU_NOT_IN_USE 0 +#define GLUT_MENU_IN_USE 1 + +/* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + +/* Window status state. */ +#define GLUT_HIDDEN 0 +#define GLUT_FULLY_RETAINED 1 +#define GLUT_PARTIALLY_RETAINED 2 +#define GLUT_FULLY_COVERED 3 + +/* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +/* Layers for use. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +#if defined(_WIN32) || defined (GLUT_IMPORT_LIB) +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) +#endif +#else +/* Stroke font opaque addresses (use constants instead in source code). */ +GLUTAPI void *glutStrokeRoman; +GLUTAPI void *glutStrokeMonoRoman; + +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN (&glutStrokeRoman) +#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) + +/* Bitmap font opaque addresses (use constants instead in source code). */ +GLUTAPI void *glutBitmap9By15; +GLUTAPI void *glutBitmap8By13; +GLUTAPI void *glutBitmapTimesRoman10; +GLUTAPI void *glutBitmapTimesRoman24; +GLUTAPI void *glutBitmapHelvetica10; +GLUTAPI void *glutBitmapHelvetica12; +GLUTAPI void *glutBitmapHelvetica18; + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) +#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) +#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) +#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) +#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) +#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) +#endif +#endif + +/* glutGet parameters. */ +#define GLUT_WINDOW_X 100 +#define GLUT_WINDOW_Y 101 +#define GLUT_WINDOW_WIDTH 102 +#define GLUT_WINDOW_HEIGHT 103 +#define GLUT_WINDOW_BUFFER_SIZE 104 +#define GLUT_WINDOW_STENCIL_SIZE 105 +#define GLUT_WINDOW_DEPTH_SIZE 106 +#define GLUT_WINDOW_RED_SIZE 107 +#define GLUT_WINDOW_GREEN_SIZE 108 +#define GLUT_WINDOW_BLUE_SIZE 109 +#define GLUT_WINDOW_ALPHA_SIZE 110 +#define GLUT_WINDOW_ACCUM_RED_SIZE 111 +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112 +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113 +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114 +#define GLUT_WINDOW_DOUBLEBUFFER 115 +#define GLUT_WINDOW_RGBA 116 +#define GLUT_WINDOW_PARENT 117 +#define GLUT_WINDOW_NUM_CHILDREN 118 +#define GLUT_WINDOW_COLORMAP_SIZE 119 +#if (GLUT_API_VERSION >= 2) +#define GLUT_WINDOW_NUM_SAMPLES 120 +#define GLUT_WINDOW_STEREO 121 +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_WINDOW_CURSOR 122 +#endif +#define GLUT_SCREEN_WIDTH 200 +#define GLUT_SCREEN_HEIGHT 201 +#define GLUT_SCREEN_WIDTH_MM 202 +#define GLUT_SCREEN_HEIGHT_MM 203 +#define GLUT_MENU_NUM_ITEMS 300 +#define GLUT_DISPLAY_MODE_POSSIBLE 400 +#define GLUT_INIT_WINDOW_X 500 +#define GLUT_INIT_WINDOW_Y 501 +#define GLUT_INIT_WINDOW_WIDTH 502 +#define GLUT_INIT_WINDOW_HEIGHT 503 +#define GLUT_INIT_DISPLAY_MODE 504 +#if (GLUT_API_VERSION >= 2) +#define GLUT_ELAPSED_TIME 700 +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_WINDOW_FORMAT_ID 123 +#endif + +#if (GLUT_API_VERSION >= 2) +/* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD 600 +#define GLUT_HAS_MOUSE 601 +#define GLUT_HAS_SPACEBALL 602 +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +#define GLUT_HAS_TABLET 604 +#define GLUT_NUM_MOUSE_BUTTONS 605 +#define GLUT_NUM_SPACEBALL_BUTTONS 606 +#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +#define GLUT_NUM_DIALS 608 +#define GLUT_NUM_TABLET_BUTTONS 609 +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610 +#define GLUT_DEVICE_KEY_REPEAT 611 +#define GLUT_HAS_JOYSTICK 612 +#define GLUT_OWNS_JOYSTICK 613 +#define GLUT_JOYSTICK_BUTTONS 614 +#define GLUT_JOYSTICK_AXES 615 +#define GLUT_JOYSTICK_POLL_RATE 616 +#endif + +#if (GLUT_API_VERSION >= 3) +/* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE 800 +#define GLUT_LAYER_IN_USE 801 +#define GLUT_HAS_OVERLAY 802 +#define GLUT_TRANSPARENT_INDEX 803 +#define GLUT_NORMAL_DAMAGED 804 +#define GLUT_OVERLAY_DAMAGED 805 + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +/* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE 900 +#define GLUT_VIDEO_RESIZE_IN_USE 901 +#define GLUT_VIDEO_RESIZE_X_DELTA 902 +#define GLUT_VIDEO_RESIZE_Y_DELTA 903 +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 +#define GLUT_VIDEO_RESIZE_X 906 +#define GLUT_VIDEO_RESIZE_Y 907 +#define GLUT_VIDEO_RESIZE_WIDTH 908 +#define GLUT_VIDEO_RESIZE_HEIGHT 909 +#endif + +/* glutUseLayer parameters. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + +/* glutSetCursor parameters. */ +/* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 +/* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 +/* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 +/* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 +/* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 +/* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 +/* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 +#endif + +/* GLUT initialization sub-API. */ +GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); } +#define glutInit glutInit_ATEXIT_HACK +#endif +#endif +GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string); +#endif +GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y); +GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height); +GLUTAPI void GLUTAPIENTRY glutMainLoop(void); + +/* GLUT window sub-API. */ +GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); } +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK +#endif +#endif +GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); +GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win); +GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) +GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win); +#endif +GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void); +GLUTAPI int GLUTAPIENTRY glutGetWindow(void); +GLUTAPI void GLUTAPIENTRY glutSetWindow(int win); +GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title); +GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title); +GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y); +GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height); +GLUTAPI void GLUTAPIENTRY glutPopWindow(void); +GLUTAPI void GLUTAPIENTRY glutPushWindow(void); +GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void); +GLUTAPI void GLUTAPIENTRY glutShowWindow(void); +GLUTAPI void GLUTAPIENTRY glutHideWindow(void); +#if (GLUT_API_VERSION >= 3) +GLUTAPI void GLUTAPIENTRY glutFullScreen(void); +GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y); +#endif + +/* GLUT overlay sub-API. */ +GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void); +GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void); +GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer); +GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) +GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win); +#endif +GLUTAPI void GLUTAPIENTRY glutShowOverlay(void); +GLUTAPI void GLUTAPIENTRY glutHideOverlay(void); +#endif + +/* GLUT menu sub-API. */ +GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int)); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); } +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK +#endif +#endif +GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu); +GLUTAPI int GLUTAPIENTRY glutGetMenu(void); +GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu); +GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value); +GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu); +GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value); +GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); +GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item); +GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button); +GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button); + +/* GLUT window callback sub-API. */ +GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void)); +GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height)); +GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state)); +GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state)); +GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void)); +GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value); +GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state)); +#if (GLUT_API_VERSION >= 2) +GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); +GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); +GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state)); +GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state)); +GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value)); +GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); +#if (GLUT_API_VERSION >= 3) +GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void)); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state)); +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval); +#endif +#endif +#endif + +/* GLUT color index sub-API. */ +GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component); +GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win); + +/* GLUT state retrieval sub-API. */ +GLUTAPI int GLUTAPIENTRY glutGet(GLenum type); +GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type); +#if (GLUT_API_VERSION >= 2) +/* GLUT extension support sub-API */ +GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name); +#endif +#if (GLUT_API_VERSION >= 3) +GLUTAPI int GLUTAPIENTRY glutGetModifiers(void); +GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type); +#endif +#if (GLUT_API_VERSION >= 5) +typedef void (*GLUTproc)(); +GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName); +#endif + +/* GLUT font sub-API */ +GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character); +GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character); +GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character); +GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string); +GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string); +#endif + +/* GLUT pre-built models sub-API */ +GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void); +GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void); +GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void); +GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void); + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +/* GLUT video resize sub-API. */ +GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param); +GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void); +GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void); +GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height); +GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height); + +/* GLUT debugging sub-API. */ +GLUTAPI void GLUTAPIENTRY glutReportErrors(void); +#endif + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +/* GLUT device control sub-API. */ +/* glutSetKeyRepeat modes. */ +#define GLUT_KEY_REPEAT_OFF 0 +#define GLUT_KEY_REPEAT_ON 1 +#define GLUT_KEY_REPEAT_DEFAULT 2 + +/* Joystick button masks. */ +#define GLUT_JOYSTICK_BUTTON_A 1 +#define GLUT_JOYSTICK_BUTTON_B 2 +#define GLUT_JOYSTICK_BUTTON_C 4 +#define GLUT_JOYSTICK_BUTTON_D 8 + +GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore); +GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode); +GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void); + +/* GLUT game mode sub-API. */ +/* glutGameModeGet. */ +#define GLUT_GAME_MODE_ACTIVE 0 +#define GLUT_GAME_MODE_POSSIBLE 1 +#define GLUT_GAME_MODE_WIDTH 2 +#define GLUT_GAME_MODE_HEIGHT 3 +#define GLUT_GAME_MODE_PIXEL_DEPTH 4 +#define GLUT_GAME_MODE_REFRESH_RATE 5 +#define GLUT_GAME_MODE_DISPLAY_CHANGED 6 + +GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string); +GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void); +GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void); +GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __glut_h__ */ diff -Nru xpsb-glx-0.19/mesa/include/GL/glut_h.dja xpsb-glx-0.19/mesa/include/GL/glut_h.dja --- xpsb-glx-0.19/mesa/include/GL/glut_h.dja 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glut_h.dja 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,340 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This header file is based on the REAL glut.h by Mark J. Kilgard. + * + * The DJGPP/ALLEGRO (DJA) GLUT implementation was written by + * Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose + * of compiling all the sample programs (which use GLUT). Therefore, + * is NOT AT ALL a complete version of GLUT! + */ + + +#ifndef __AGLUT_H__ +#define __AGLUT_H__ + +#include +#include + +#define GLUTCALLBACK +#define APIENTRY +#define GLUTAPI extern + +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 + +/* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + +/* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +/* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 + +/* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 + +/* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + +/* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + +/* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +/* Layers for use. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) + +/* glutGet parameters. */ +#define GLUT_WINDOW_X 100 +#define GLUT_WINDOW_Y 101 +#define GLUT_WINDOW_WIDTH 102 +#define GLUT_WINDOW_HEIGHT 103 +#define GLUT_WINDOW_BUFFER_SIZE 104 +#define GLUT_WINDOW_STENCIL_SIZE 105 +#define GLUT_WINDOW_DEPTH_SIZE 106 +#define GLUT_WINDOW_RED_SIZE 107 +#define GLUT_WINDOW_GREEN_SIZE 108 +#define GLUT_WINDOW_BLUE_SIZE 109 +#define GLUT_WINDOW_ALPHA_SIZE 110 +#define GLUT_WINDOW_ACCUM_RED_SIZE 111 +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112 +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113 +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114 +#define GLUT_WINDOW_DOUBLEBUFFER 115 +#define GLUT_WINDOW_RGBA 116 +#define GLUT_WINDOW_PARENT 117 +#define GLUT_WINDOW_NUM_CHILDREN 118 +#define GLUT_WINDOW_COLORMAP_SIZE 119 +#define GLUT_WINDOW_NUM_SAMPLES 120 +#define GLUT_WINDOW_STEREO 121 +#define GLUT_WINDOW_CURSOR 122 +#define GLUT_SCREEN_WIDTH 200 +#define GLUT_SCREEN_HEIGHT 201 +#define GLUT_SCREEN_WIDTH_MM 202 +#define GLUT_SCREEN_HEIGHT_MM 203 +#define GLUT_MENU_NUM_ITEMS 300 +#define GLUT_DISPLAY_MODE_POSSIBLE 400 +#define GLUT_INIT_WINDOW_X 500 +#define GLUT_INIT_WINDOW_Y 501 +#define GLUT_INIT_WINDOW_WIDTH 502 +#define GLUT_INIT_WINDOW_HEIGHT 503 +#define GLUT_INIT_DISPLAY_MODE 504 +#define GLUT_ELAPSED_TIME 700 +#define GLUT_WINDOW_FORMAT_ID 123 + +/* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD 600 +#define GLUT_HAS_MOUSE 601 +#define GLUT_HAS_SPACEBALL 602 +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +#define GLUT_HAS_TABLET 604 +#define GLUT_NUM_MOUSE_BUTTONS 605 +#define GLUT_NUM_SPACEBALL_BUTTONS 606 +#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +#define GLUT_NUM_DIALS 608 +#define GLUT_NUM_TABLET_BUTTONS 609 +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610 +#define GLUT_DEVICE_KEY_REPEAT 611 +#define GLUT_HAS_JOYSTICK 612 +#define GLUT_OWNS_JOYSTICK 613 +#define GLUT_JOYSTICK_BUTTONS 614 +#define GLUT_JOYSTICK_AXES 615 +#define GLUT_JOYSTICK_POLL_RATE 616 + +/* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE 800 +#define GLUT_LAYER_IN_USE 801 +#define GLUT_HAS_OVERLAY 802 +#define GLUT_TRANSPARENT_INDEX 803 +#define GLUT_NORMAL_DAMAGED 804 +#define GLUT_OVERLAY_DAMAGED 805 + +/* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE 900 +#define GLUT_VIDEO_RESIZE_IN_USE 901 +#define GLUT_VIDEO_RESIZE_X_DELTA 902 +#define GLUT_VIDEO_RESIZE_Y_DELTA 903 +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 +#define GLUT_VIDEO_RESIZE_X 906 +#define GLUT_VIDEO_RESIZE_Y 907 +#define GLUT_VIDEO_RESIZE_WIDTH 908 +#define GLUT_VIDEO_RESIZE_HEIGHT 909 + +/* glutUseLayer parameters. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + +/* glutSetCursor parameters. */ +/* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 +/* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 +/* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 +/* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 +/* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 +/* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 +/* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 + +/* GLUT initialization sub-API. */ +GLUTAPI void APIENTRY glutInit(int *argcp, char **argv); +GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode); +GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y); +GLUTAPI void APIENTRY glutInitWindowSize(int width, int height); +GLUTAPI void APIENTRY glutMainLoop(void); + +/* GLUT window sub-API. */ +GLUTAPI int APIENTRY glutCreateWindow(const char *title); +GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); +GLUTAPI void APIENTRY glutDestroyWindow(int win); +GLUTAPI void APIENTRY glutPostRedisplay(void); +GLUTAPI void APIENTRY glutSwapBuffers(void); +GLUTAPI int APIENTRY glutGetWindow(void); +GLUTAPI void APIENTRY glutSetWindow(int win); +GLUTAPI void APIENTRY glutSetWindowTitle(const char *title); +GLUTAPI void APIENTRY glutSetIconTitle(const char *title); +GLUTAPI void APIENTRY glutPositionWindow(int x, int y); +GLUTAPI void APIENTRY glutReshapeWindow(int width, int height); +GLUTAPI void APIENTRY glutPopWindow(void); +GLUTAPI void APIENTRY glutPushWindow(void); +GLUTAPI void APIENTRY glutIconifyWindow(void); +GLUTAPI void APIENTRY glutShowWindow(void); +GLUTAPI void APIENTRY glutHideWindow(void); + +/* GLUT overlay sub-API. */ +GLUTAPI void APIENTRY glutEstablishOverlay(void); +GLUTAPI void APIENTRY glutRemoveOverlay(void); +GLUTAPI void APIENTRY glutUseLayer(GLenum layer); +GLUTAPI void APIENTRY glutPostOverlayRedisplay(void); +GLUTAPI void APIENTRY glutShowOverlay(void); +GLUTAPI void APIENTRY glutHideOverlay(void); + +/* GLUT menu sub-API. */ +GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int)); +GLUTAPI void APIENTRY glutDestroyMenu(int menu); +GLUTAPI int APIENTRY glutGetMenu(void); +GLUTAPI void APIENTRY glutSetMenu(int menu); +GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value); +GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu); +GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value); +GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); +GLUTAPI void APIENTRY glutRemoveMenuItem(int item); +GLUTAPI void APIENTRY glutAttachMenu(int button); +GLUTAPI void APIENTRY glutDetachMenu(int button); + +/* GLUT window callback sub-API. */ +GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height)); +GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y)); +GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value); +GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y)); +GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state)); +GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state)); +GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value)); +GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y)); +GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state)); + +/* GLUT color index sub-API. */ +GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component); +GLUTAPI void APIENTRY glutCopyColormap(int win); + +/* GLUT state retrieval sub-API. */ +GLUTAPI int APIENTRY glutGet(GLenum type); +GLUTAPI int APIENTRY glutDeviceGet(GLenum type); + +/* GLUT font sub-API */ +GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character); +GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character); +GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character); +GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character); + +/* GLUT pre-built models sub-API */ +GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCube(GLdouble size); +GLUTAPI void APIENTRY glutSolidCube(GLdouble size); +GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutWireDodecahedron(void); +GLUTAPI void APIENTRY glutSolidDodecahedron(void); +GLUTAPI void APIENTRY glutWireTeapot(GLdouble size); +GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size); +GLUTAPI void APIENTRY glutWireOctahedron(void); +GLUTAPI void APIENTRY glutSolidOctahedron(void); +GLUTAPI void APIENTRY glutWireTetrahedron(void); +GLUTAPI void APIENTRY glutSolidTetrahedron(void); +GLUTAPI void APIENTRY glutWireIcosahedron(void); +GLUTAPI void APIENTRY glutSolidIcosahedron(void); + +#endif /* __AGLUT_H__ */ diff -Nru xpsb-glx-0.19/mesa/include/GL/glxext.h xpsb-glx-0.19/mesa/include/GL/glxext.h --- xpsb-glx-0.19/mesa/include/GL/glxext.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glxext.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,833 @@ +#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 +#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 2008/10/22 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GLX_GLXEXT_VERSION 21 + +#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_ARB_create_context +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +#ifndef GLX_SGI_swap_control +#endif + +#ifndef GLX_SGI_video_sync +#endif + +#ifndef GLX_SGI_make_current_read +#endif + +#ifndef GLX_SGIX_video_source +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* reuse GLX_NONE_EXT */ +#endif + +#ifndef GLX_EXT_import_context +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +/* reuse GLX_SCREEN_EXT */ +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#endif + +#ifndef GLX_SGI_cushion +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024 +#endif + +#ifndef GLX_SGIX_swap_group +#endif + +#ifndef GLX_SGIX_swap_barrier +#endif + +#ifndef GLX_SGIS_blended_overlay +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +#ifndef GLX_SGIS_shared_multisample +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +#ifndef GLX_SUN_get_transparent_index +#endif + +#ifndef GLX_3DFX_multisample +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#endif + +#ifndef GLX_MESA_pixmap_colormap +#endif + +#ifndef GLX_MESA_release_buffers +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +#ifndef GLX_OML_sync_control +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +#endif + +#ifndef GLX_MESA_agp_offset +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB +#endif + +#ifndef GLX_NV_present_video +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +#ifndef GLX_NV_video_out +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC +#endif + +#ifndef GLX_NV_swap_group +#endif + + +/*************************************************************/ + +#ifndef GLX_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 glext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GLX_OML_sync_control extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#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 +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include /* 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_ARB_create_context +#define GLX_ARB_create_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); +#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 + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 +#endif + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 +#endif + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/glx.h xpsb-glx-0.19/mesa/include/GL/glx.h --- xpsb-glx-0.19/mesa/include/GL/glx.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glx.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,519 @@ +/* + * 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 +# ifdef __cplusplus +/* VMS Xlib.h gives problems with C++. + * this avoids a bunch of trivial warnings */ +#pragma message disable nosimpint +#endif +#endif +#include +#include +#ifdef __VMS +# ifdef __cplusplus +#pragma message enable nosimpint +#endif +#endif +#include + + +#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.3 function pointer typedefs */ +typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void); +typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); +typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); + + +/* + * ARB 2. GLX_ARB_get_proc_address + */ +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +typedef void (*__GLXextFuncPtr)(void); +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); + +#endif /* GLX_ARB_get_proc_address */ + + + +/* GLX 1.4 and later */ +extern void (*glXGetProcAddress(const GLubyte *procname))( void ); + +/* GLX 1.4 function pointer typedefs */ +typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); + + +#ifndef GLX_GLXEXT_LEGACY + +#include + +#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 */ + + +/* + * 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 -Nru xpsb-glx-0.19/mesa/include/GL/glx_mangle.h xpsb-glx-0.19/mesa/include/GL/glx_mangle.h --- xpsb-glx-0.19/mesa/include/GL/glx_mangle.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/glx_mangle.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,81 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef GLX_MANGLE_H +#define GLX_MANGLE_H + +#define glXChooseVisual mglXChooseVisual +#define glXCreateContext mglXCreateContext +#define glXDestroyContext mglXDestroyContext +#define glXMakeCurrent mglXMakeCurrent +#define glXCopyContext mglXCopyContext +#define glXSwapBuffers mglXSwapBuffers +#define glXCreateGLXPixmap mglXCreateGLXPixmap +#define glXDestroyGLXPixmap mglXDestroyGLXPixmap +#define glXQueryExtension mglXQueryExtension +#define glXQueryVersion mglXQueryVersion +#define glXIsDirect mglXIsDirect +#define glXGetConfig mglXGetConfig +#define glXGetCurrentContext mglXGetCurrentContext +#define glXGetCurrentDrawable mglXGetCurrentDrawable +#define glXWaitGL mglXWaitGL +#define glXWaitX mglXWaitX +#define glXUseXFont mglXUseXFont +#define glXQueryExtensionsString mglXQueryExtensionsString +#define glXQueryServerString mglXQueryServerString +#define glXGetClientString mglXGetClientString +#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA +#define glXReleaseBuffersMESA mglXReleaseBuffersMESA +#define glXCopySubBufferMESA mglXCopySubBufferMESA +#define glXGetVideoSyncSGI mglXGetVideoSyncSGI +#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI + +/* GLX 1.2 */ +#define glXGetCurrentDisplay mglXGetCurrentDisplay + +/* GLX 1.3 */ +#define glXChooseFBConfig mglXChooseFBConfig +#define glXGetFBConfigAttrib mglXGetFBConfigAttrib +#define glXGetFBConfigs mglXGetFBConfigs +#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig +#define glXCreateWindow mglXCreateWindow +#define glXDestroyWindow mglXDestroyWindow +#define glXCreatePixmap mglXCreatePixmap +#define glXDestroyPixmap mglXDestroyPixmap +#define glXCreatePbuffer mglXCreatePbuffer +#define glXDestroyPbuffer mglXDestroyPbuffer +#define glXQueryDrawable mglXQueryDrawable +#define glXCreateNewContext mglXCreateNewContext +#define glXMakeContextCurrent mglXMakeContextCurrent +#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable +#define glXQueryContext mglXQueryContext +#define glXSelectEvent mglXSelectEvent +#define glXGetSelectedEvent mglXGetSelectedEvent + +/* GLX 1.4 */ +#define glXGetProcAddress mglXGetProcAddress + + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/internal/dri_interface.h xpsb-glx-0.19/mesa/include/GL/internal/dri_interface.h --- xpsb-glx-0.19/mesa/include/GL/internal/dri_interface.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/internal/dri_interface.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,675 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2007-2008 Red Hat, Inc. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file dri_interface.h + * + * This file contains all the types and functions that define the interface + * between a DRI driver and driver loader. Currently, the most common driver + * loader is the XFree86 libGL.so. However, other loaders do exist, and in + * the future the server-side libglx.a will also be a loader. + * + * \author Kevin E. Martin + * \author Ian Romanick + * \author Kristian Høgsberg + */ + +#ifndef DRI_INTERFACE_H +#define DRI_INTERFACE_H + +/* For archs with no drm.h */ +#if !defined(__APPLE__) && !defined(__CYGWIN__) +#include +#else +typedef unsigned int drm_context_t; +typedef unsigned int drm_drawable_t; +typedef struct drm_clip_rect drm_clip_rect_t; +#endif + +/** + * \name DRI interface structures + * + * The following structures define the interface between the GLX client + * side library and the DRI (direct rendering infrastructure). + */ +/*@{*/ +typedef struct __DRIdisplayRec __DRIdisplay; +typedef struct __DRIscreenRec __DRIscreen; +typedef struct __DRIcontextRec __DRIcontext; +typedef struct __DRIdrawableRec __DRIdrawable; +typedef struct __DRIconfigRec __DRIconfig; +typedef struct __DRIframebufferRec __DRIframebuffer; +typedef struct __DRIversionRec __DRIversion; + +typedef struct __DRIcoreExtensionRec __DRIcoreExtension; +typedef struct __DRIextensionRec __DRIextension; +typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension; +typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension; +typedef struct __DRIallocateExtensionRec __DRIallocateExtension; +typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension; +typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension; +typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension; +typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension; +typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension; +typedef struct __DRIswrastExtensionRec __DRIswrastExtension; +typedef struct __DRIbufferRec __DRIbuffer; +typedef struct __DRIdri2ExtensionRec __DRIdri2Extension; +typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension; + +/*@}*/ + + +/** + * Extension struct. Drivers 'inherit' from this struct by embedding + * it as the first element in the extension struct. + * + * We never break API in for a DRI extension. If we need to change + * the way things work in a non-backwards compatible manner, we + * introduce a new extension. During a transition period, we can + * leave both the old and the new extension in the driver, which + * allows us to move to the new interface without having to update the + * loader(s) in lock step. + * + * However, we can add entry points to an extension over time as long + * as we don't break the old ones. As we add entry points to an + * extension, we increase the version number. The corresponding + * #define can be used to guard code that accesses the new entry + * points at compile time and the version field in the extension + * struct can be used at run-time to determine how to use the + * extension. + */ +struct __DRIextensionRec { + const char *name; + int version; +}; + +/** + * The first set of extension are the screen extensions, returned by + * __DRIcore::getExtensions(). This entry point will return a list of + * extensions and the loader can use the ones it knows about by + * casting them to more specific extensions and advertising any GLX + * extensions the DRI extensions enables. + */ + +/** + * Used by drivers to indicate support for setting the read drawable. + */ +#define __DRI_READ_DRAWABLE "DRI_ReadDrawable" +#define __DRI_READ_DRAWABLE_VERSION 1 + +/** + * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension. + */ +#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer" +#define __DRI_COPY_SUB_BUFFER_VERSION 1 +struct __DRIcopySubBufferExtensionRec { + __DRIextension base; + void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h); +}; + +/** + * Used by drivers that implement the GLX_SGI_swap_control or + * GLX_MESA_swap_control extension. + */ +#define __DRI_SWAP_CONTROL "DRI_SwapControl" +#define __DRI_SWAP_CONTROL_VERSION 1 +struct __DRIswapControlExtensionRec { + __DRIextension base; + void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval); + unsigned int (*getSwapInterval)(__DRIdrawable *drawable); +}; + +/** + * Used by drivers that implement the GLX_MESA_allocate_memory. + */ +#define __DRI_ALLOCATE "DRI_Allocate" +#define __DRI_ALLOCATE_VERSION 1 +struct __DRIallocateExtensionRec { + __DRIextension base; + + void *(*allocateMemory)(__DRIscreen *screen, GLsizei size, + GLfloat readfreq, GLfloat writefreq, + GLfloat priority); + + void (*freeMemory)(__DRIscreen *screen, GLvoid *pointer); + + GLuint (*memoryOffset)(__DRIscreen *screen, const GLvoid *pointer); +}; + +/** + * Used by drivers that implement the GLX_MESA_swap_frame_usage extension. + */ +#define __DRI_FRAME_TRACKING "DRI_FrameTracking" +#define __DRI_FRAME_TRACKING_VERSION 1 +struct __DRIframeTrackingExtensionRec { + __DRIextension base; + + /** + * Enable or disable frame usage tracking. + * + * \since Internal API version 20030317. + */ + int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable); + + /** + * Retrieve frame usage information. + * + * \since Internal API version 20030317. + */ + int (*queryFrameTracking)(__DRIdrawable *drawable, + int64_t * sbc, int64_t * missedFrames, + float * lastMissedUsage, float * usage); +}; + + +/** + * Used by drivers that implement the GLX_SGI_video_sync extension. + */ +#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter" +#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1 +struct __DRImediaStreamCounterExtensionRec { + __DRIextension base; + + /** + * Wait for the MSC to equal target_msc, or, if that has already passed, + * the next time (MSC % divisor) is equal to remainder. If divisor is + * zero, the function will return as soon as MSC is greater than or equal + * to target_msc. + */ + int (*waitForMSC)(__DRIdrawable *drawable, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc); + + /** + * Get the number of vertical refreshes since some point in time before + * this function was first called (i.e., system start up). + */ + int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable, + int64_t *msc); +}; + + +#define __DRI_TEX_OFFSET "DRI_TexOffset" +#define __DRI_TEX_OFFSET_VERSION 1 +struct __DRItexOffsetExtensionRec { + __DRIextension base; + + /** + * Method to override base texture image with a driver specific 'offset'. + * The depth passed in allows e.g. to ignore the alpha channel of texture + * images where the non-alpha components don't occupy a whole texel. + * + * For GLX_EXT_texture_from_pixmap with AIGLX. + */ + void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, GLuint pitch); +}; + + +#define __DRI_TEX_BUFFER "DRI_TexBuffer" +#define __DRI_TEX_BUFFER_VERSION 1 +struct __DRItexBufferExtensionRec { + __DRIextension base; + + /** + * Method to override base texture image with the contents of a + * __DRIdrawable. + * + * For GLX_EXT_texture_from_pixmap with AIGLX. + */ + void (*setTexBuffer)(__DRIcontext *pDRICtx, + GLint target, + __DRIdrawable *pDraw); +}; + + +/** + * XML document describing the configuration options supported by the + * driver. + */ +extern const char __driConfigOptions[]; + +/*@}*/ + +/** + * The following extensions describe loader features that the DRI + * driver can make use of. Some of these are mandatory, such as the + * getDrawableInfo extension for DRI and the DRI Loader extensions for + * DRI2, while others are optional, and if present allow the driver to + * expose certain features. The loader pass in a NULL terminated + * array of these extensions to the driver in the createNewScreen + * constructor. + */ + +typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension; +typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension; +typedef struct __DRIdamageExtensionRec __DRIdamageExtension; +typedef struct __DRIloaderExtensionRec __DRIloaderExtension; +typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension; + + +/** + * Callback to getDrawableInfo protocol + */ +#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo" +#define __DRI_GET_DRAWABLE_INFO_VERSION 1 +struct __DRIgetDrawableInfoExtensionRec { + __DRIextension base; + + /** + * This function is used to get information about the position, size, and + * clip rects of a drawable. + */ + GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable, + unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, drm_clip_rect_t ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects, + void *loaderPrivate); +}; + +/** + * Callback to get system time for media stream counter extensions. + */ +#define __DRI_SYSTEM_TIME "DRI_SystemTime" +#define __DRI_SYSTEM_TIME_VERSION 1 +struct __DRIsystemTimeExtensionRec { + __DRIextension base; + + /** + * Get the 64-bit unadjusted system time (UST). + */ + int (*getUST)(int64_t * ust); + + /** + * Get the media stream counter (MSC) rate. + * + * Matching the definition in GLX_OML_sync_control, this function returns + * the rate of the "media stream counter". In practical terms, this is + * the frame refresh rate of the display. + */ + GLboolean (*getMSCRate)(__DRIdrawable *draw, + int32_t * numerator, int32_t * denominator, + void *loaderPrivate); +}; + +/** + * Damage reporting + */ +#define __DRI_DAMAGE "DRI_Damage" +#define __DRI_DAMAGE_VERSION 1 +struct __DRIdamageExtensionRec { + __DRIextension base; + + /** + * Reports areas of the given drawable which have been modified by the + * driver. + * + * \param drawable which the drawing was done to. + * \param rects rectangles affected, with the drawable origin as the + * origin. + * \param x X offset of the drawable within the screen (used in the + * front_buffer case) + * \param y Y offset of the drawable within the screen. + * \param front_buffer boolean flag for whether the drawing to the + * drawable was actually done directly to the front buffer (instead + * of backing storage, for example) + * \param loaderPrivate the data passed in at createNewDrawable time + */ + void (*reportDamage)(__DRIdrawable *draw, + int x, int y, + drm_clip_rect_t *rects, int num_rects, + GLboolean front_buffer, + void *loaderPrivate); +}; + +#define __DRI_SWRAST_IMAGE_OP_DRAW 1 +#define __DRI_SWRAST_IMAGE_OP_CLEAR 2 +#define __DRI_SWRAST_IMAGE_OP_SWAP 3 + +/** + * SWRast Loader extension. + */ +#define __DRI_SWRAST_LOADER "DRI_SWRastLoader" +#define __DRI_SWRAST_LOADER_VERSION 1 +struct __DRIswrastLoaderExtensionRec { + __DRIextension base; + + /* + * Drawable position and size + */ + void (*getDrawableInfo)(__DRIdrawable *drawable, + int *x, int *y, int *width, int *height, + void *loaderPrivate); + + /** + * Put image to drawable + */ + void (*putImage)(__DRIdrawable *drawable, int op, + int x, int y, int width, int height, char *data, + void *loaderPrivate); + + /** + * Get image from drawable + */ + void (*getImage)(__DRIdrawable *drawable, + int x, int y, int width, int height, char *data, + void *loaderPrivate); +}; + +/** + * The remaining extensions describe driver extensions, immediately + * available interfaces provided by the driver. To start using the + * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for + * the extension you need in the array. + */ +#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions" + +/** + * Tokens for __DRIconfig attribs. A number of attributes defined by + * GLX or EGL standards are not in the table, as they must be provided + * by the loader. For example, FBConfig ID or visual ID, drawable type. + */ + +#define __DRI_ATTRIB_BUFFER_SIZE 1 +#define __DRI_ATTRIB_LEVEL 2 +#define __DRI_ATTRIB_RED_SIZE 3 +#define __DRI_ATTRIB_GREEN_SIZE 4 +#define __DRI_ATTRIB_BLUE_SIZE 5 +#define __DRI_ATTRIB_LUMINANCE_SIZE 6 +#define __DRI_ATTRIB_ALPHA_SIZE 7 +#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8 +#define __DRI_ATTRIB_DEPTH_SIZE 9 +#define __DRI_ATTRIB_STENCIL_SIZE 10 +#define __DRI_ATTRIB_ACCUM_RED_SIZE 11 +#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12 +#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13 +#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14 +#define __DRI_ATTRIB_SAMPLE_BUFFERS 15 +#define __DRI_ATTRIB_SAMPLES 16 +#define __DRI_ATTRIB_RENDER_TYPE 17 +#define __DRI_ATTRIB_CONFIG_CAVEAT 18 +#define __DRI_ATTRIB_CONFORMANT 19 +#define __DRI_ATTRIB_DOUBLE_BUFFER 20 +#define __DRI_ATTRIB_STEREO 21 +#define __DRI_ATTRIB_AUX_BUFFERS 22 +#define __DRI_ATTRIB_TRANSPARENT_TYPE 23 +#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24 +#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25 +#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26 +#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27 +#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28 +#define __DRI_ATTRIB_FLOAT_MODE 29 +#define __DRI_ATTRIB_RED_MASK 30 +#define __DRI_ATTRIB_GREEN_MASK 31 +#define __DRI_ATTRIB_BLUE_MASK 32 +#define __DRI_ATTRIB_ALPHA_MASK 33 +#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34 +#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35 +#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36 +#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37 +#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38 +#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39 +#define __DRI_ATTRIB_SWAP_METHOD 40 +#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41 +#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42 +#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43 +#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44 +#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45 +#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46 +#define __DRI_ATTRIB_YINVERTED 47 + +/* __DRI_ATTRIB_RENDER_TYPE */ +#define __DRI_ATTRIB_RGBA_BIT 0x01 +#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02 +#define __DRI_ATTRIB_LUMINANCE_BIT 0x04 + +/* __DRI_ATTRIB_CONFIG_CAVEAT */ +#define __DRI_ATTRIB_SLOW_BIT 0x01 +#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02 + +/* __DRI_ATTRIB_TRANSPARENT_TYPE */ +#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00 +#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01 + +/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */ +#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01 +#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02 +#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04 + +/** + * This extension defines the core DRI functionality. + */ +#define __DRI_CORE "DRI_Core" +#define __DRI_CORE_VERSION 1 + +struct __DRIcoreExtensionRec { + __DRIextension base; + + __DRIscreen *(*createNewScreen)(int screen, int fd, + unsigned int sarea_handle, + const __DRIextension **extensions, + const __DRIconfig ***driverConfigs, + void *loaderPrivate); + + void (*destroyScreen)(__DRIscreen *screen); + + const __DRIextension **(*getExtensions)(__DRIscreen *screen); + + int (*getConfigAttrib)(const __DRIconfig *config, + unsigned int attrib, + unsigned int *value); + + int (*indexConfigAttrib)(const __DRIconfig *config, int index, + unsigned int *attrib, unsigned int *value); + + __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, + const __DRIconfig *config, + unsigned int drawable_id, + unsigned int head, + void *loaderPrivate); + + void (*destroyDrawable)(__DRIdrawable *drawable); + + void (*swapBuffers)(__DRIdrawable *drawable); + + __DRIcontext *(*createNewContext)(__DRIscreen *screen, + const __DRIconfig *config, + __DRIcontext *shared, + void *loaderPrivate); + + int (*copyContext)(__DRIcontext *dest, + __DRIcontext *src, + unsigned long mask); + + void (*destroyContext)(__DRIcontext *context); + + int (*bindContext)(__DRIcontext *ctx, + __DRIdrawable *pdraw, + __DRIdrawable *pread); + + int (*unbindContext)(__DRIcontext *ctx); +}; + +/** + * Stored version of some component (i.e., server-side DRI module, kernel-side + * DRM, etc.). + * + * \todo + * There are several data structures that explicitly store a major version, + * minor version, and patch level. These structures should be modified to + * have a \c __DRIversionRec instead. + */ +struct __DRIversionRec { + int major; /**< Major version number. */ + int minor; /**< Minor version number. */ + int patch; /**< Patch-level. */ +}; + +/** + * Framebuffer information record. Used by libGL to communicate information + * about the framebuffer to the driver's \c __driCreateNewScreen function. + * + * In XFree86, most of this information is derrived from data returned by + * calling \c XF86DRIGetDeviceInfo. + * + * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen + * __driUtilCreateNewScreen CallCreateNewScreen + * + * \bug This structure could be better named. + */ +struct __DRIframebufferRec { + unsigned char *base; /**< Framebuffer base address in the CPU's + * address space. This value is calculated by + * calling \c drmMap on the framebuffer handle + * returned by \c XF86DRIGetDeviceInfo (or a + * similar function). + */ + int size; /**< Framebuffer size, in bytes. */ + int stride; /**< Number of bytes from one line to the next. */ + int width; /**< Pixel width of the framebuffer. */ + int height; /**< Pixel height of the framebuffer. */ + int dev_priv_size; /**< Size of the driver's dev-priv structure. */ + void *dev_priv; /**< Pointer to the driver's dev-priv structure. */ +}; + + +/** + * This extension provides alternative screen, drawable and context + * constructors for legacy DRI functionality. This is used in + * conjunction with the core extension. + */ +#define __DRI_LEGACY "DRI_Legacy" +#define __DRI_LEGACY_VERSION 1 + +struct __DRIlegacyExtensionRec { + __DRIextension base; + + __DRIscreen *(*createNewScreen)(int screen, + const __DRIversion *ddx_version, + const __DRIversion *dri_version, + const __DRIversion *drm_version, + const __DRIframebuffer *frame_buffer, + void *pSAREA, int fd, + const __DRIextension **extensions, + const __DRIconfig ***driver_configs, + void *loaderPrivate); + + __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, + const __DRIconfig *config, + drm_drawable_t hwDrawable, + int renderType, const int *attrs, + void *loaderPrivate); + + __DRIcontext *(*createNewContext)(__DRIscreen *screen, + const __DRIconfig *config, + int render_type, + __DRIcontext *shared, + drm_context_t hwContext, + void *loaderPrivate); +}; + +/** + * This extension provides alternative screen, drawable and context + * constructors for swrast DRI functionality. This is used in + * conjunction with the core extension. + */ +#define __DRI_SWRAST "DRI_SWRast" +#define __DRI_SWRAST_VERSION 1 + +struct __DRIswrastExtensionRec { + __DRIextension base; + + __DRIscreen *(*createNewScreen)(int screen, + const __DRIextension **extensions, + const __DRIconfig ***driver_configs, + void *loaderPrivate); + + __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, + const __DRIconfig *config, + void *loaderPrivate); +}; + +/** + * DRI2 Loader extension. + */ +#define __DRI_BUFFER_FRONT_LEFT 0 +#define __DRI_BUFFER_BACK_LEFT 1 +#define __DRI_BUFFER_FRONT_RIGHT 2 +#define __DRI_BUFFER_BACK_RIGHT 3 +#define __DRI_BUFFER_DEPTH 4 +#define __DRI_BUFFER_STENCIL 5 +#define __DRI_BUFFER_ACCUM 6 +#define __DRI_BUFFER_FAKE_FRONT_LEFT 7 +#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8 + +struct __DRIbufferRec { + unsigned int attachment; + unsigned int name; + unsigned int pitch; + unsigned int cpp; + unsigned int flags; +}; + +#define __DRI_DRI2_LOADER "DRI_DRI2Loader" +#define __DRI_DRI2_LOADER_VERSION 1 +struct __DRIdri2LoaderExtensionRec { + __DRIextension base; + + __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable, + int *width, int *height, + unsigned int *attachments, int count, + int *out_count, void *loaderPrivate); +}; + +/** + * This extension provides alternative screen, drawable and context + * constructors for DRI2. + */ +#define __DRI_DRI2 "DRI_DRI2" +#define __DRI_DRI2_VERSION 1 + +struct __DRIdri2ExtensionRec { + __DRIextension base; + + __DRIscreen *(*createNewScreen)(int screen, int fd, + const __DRIextension **extensions, + const __DRIconfig ***driver_configs, + void *loaderPrivate); + + __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, + const __DRIconfig *config, + void *loaderPrivate); + + __DRIcontext *(*createNewContext)(__DRIscreen *screen, + const __DRIconfig *config, + __DRIcontext *shared, + void *loaderPrivate); + +}; + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/internal/glcore.h xpsb-glx-0.19/mesa/include/GL/internal/glcore.h --- xpsb-glx-0.19/mesa/include/GL/internal/glcore.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/internal/glcore.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,179 @@ +#ifndef __gl_core_h_ +#define __gl_core_h_ + +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include + +#define GL_CORE_SGI 1 +#define GL_CORE_MESA 2 +#define GL_CORE_APPLE 4 +#define GL_CORE_WINDOWS 8 + +typedef struct __GLcontextRec __GLcontext; + +/* +** This file defines the interface between the GL core and the surrounding +** "operating system" that supports it (currently the GLX or WGL extensions). +** +** Members (data and function pointers) are documented as imported or +** exported according to how they are used by the core rendering functions. +** Imported members are initialized by the "operating system" and used by +** the core functions. Exported members are initialized by the core functions +** and used by the "operating system". +*/ + +/** + * Mode and limit information for a context. This information is + * kept around in the context so that values can be used during + * command execution, and for returning information about the + * context to the application. + * + * Instances of this structure are shared by the driver and the loader. To + * maintain binary compatability, new fields \b must be added only to the + * end of the structure. + * + * \sa _gl_context_modes_create + */ +typedef struct __GLcontextModesRec { + struct __GLcontextModesRec * next; + + GLboolean rgbMode; + GLboolean floatMode; + GLboolean colorIndexMode; + GLuint doubleBufferMode; + GLuint stereoMode; + + GLboolean haveAccumBuffer; + GLboolean haveDepthBuffer; + GLboolean haveStencilBuffer; + + GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ + GLuint redMask, greenMask, blueMask, alphaMask; + GLint rgbBits; /* total bits for rgb */ + GLint indexBits; /* total bits for colorindex */ + + GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + GLint depthBits; + GLint stencilBits; + + GLint numAuxBuffers; + + GLint level; + + GLint pixmapMode; + + /* GLX */ + GLint visualID; + GLint visualType; /**< One of the GLX X visual types. (i.e., + * \c GLX_TRUE_COLOR, etc.) + */ + + /* EXT_visual_rating / GLX 1.2 */ + GLint visualRating; + + /* EXT_visual_info / GLX 1.2 */ + GLint transparentPixel; + /* colors are floats scaled to ints */ + GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; + GLint transparentIndex; + + /* ARB_multisample / SGIS_multisample */ + GLint sampleBuffers; + GLint samples; + + /* SGIX_fbconfig / GLX 1.3 */ + GLint drawableType; + GLint renderType; + GLint xRenderable; + GLint fbconfigID; + + /* SGIX_pbuffer / GLX 1.3 */ + GLint maxPbufferWidth; + GLint maxPbufferHeight; + GLint maxPbufferPixels; + GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ + GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ + + /* SGIX_visual_select_group */ + GLint visualSelectGroup; + + /* OML_swap_method */ + GLint swapMethod; + + GLint screen; + + /* EXT_texture_from_pixmap */ + GLint bindToTextureRgb; + GLint bindToTextureRgba; + GLint bindToMipmapTexture; + GLint bindToTextureTargets; + GLint yInverted; +} __GLcontextModes; + +/* Several fields of __GLcontextModes can take these as values. Since + * GLX header files may not be available everywhere they need to be used, + * redefine them here. + */ +#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_NON_CONFORMANT_CONFIG 0x800D +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLX_DONT_CARE 0xFFFFFFFF + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 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_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + +#endif /* __gl_core_h_ */ diff -Nru xpsb-glx-0.19/mesa/include/GL/internal/sarea.h xpsb-glx-0.19/mesa/include/GL/internal/sarea.h --- xpsb-glx-0.19/mesa/include/GL/internal/sarea.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/internal/sarea.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,92 @@ +/** + * \file sarea.h + * SAREA definitions. + * + * \author Kevin E. Martin + * \author Jens Owen + * \author Rickard E. (Rik) Faith + */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef _SAREA_H_ +#define _SAREA_H_ + +#include "xf86drm.h" + +/* SAREA area needs to be at least a page */ +#if defined(__alpha__) +#define SAREA_MAX 0x2000 +#elif defined(__ia64__) +#define SAREA_MAX 0x10000 /* 64kB */ +#else +/* Intel 830M driver needs at least 8k SAREA */ +#define SAREA_MAX 0x2000 +#endif + +#define SAREA_MAX_DRAWABLES 256 + +#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 + +/** + * SAREA per drawable information. + * + * \sa _XF86DRISAREA. + */ +typedef struct _XF86DRISAREADrawable { + unsigned int stamp; + unsigned int flags; +} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr; + +/** + * SAREA frame information. + * + * \sa _XF86DRISAREA. + */ +typedef struct _XF86DRISAREAFrame { + unsigned int x; + unsigned int y; + unsigned int width; + unsigned int height; + unsigned int fullscreen; +} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr; + +/** + * SAREA definition. + */ +typedef struct _XF86DRISAREA { + /** first thing is always the DRM locking structure */ + drmLock lock; + /** \todo Use readers/writer lock for drawable_lock */ + drmLock drawable_lock; + XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES]; + XF86DRISAREAFrameRec frame; + drm_context_t dummy_context; +} XF86DRISAREARec, *XF86DRISAREAPtr; + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/Makefile.am xpsb-glx-0.19/mesa/include/GL/Makefile.am --- xpsb-glx-0.19/mesa/include/GL/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/Makefile.am 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,38 @@ +## Process this file with automake to produce Makefile.in + +GLincludedir = $(includedir)/GL + +INC_GGI = ggimesa.h +INC_OSMESA = osmesa.h +INC_SVGA = svgamesa.h +INC_X11 = glx.h glxext.h glx_mangle.h +INC_GLUT = glut.h glutf90.h + +if HAVE_GGI +sel_inc_ggi = $(INC_GGI) +endif + +if HAVE_OSMESA +sel_inc_osmesa = $(INC_OSMESA) +endif + +if HAVE_SVGA +sel_inc_svga = $(INC_SVGA) +endif + +if HAVE_X11 +sel_inc_x11 = $(INC_X11) +endif + +if NEED_GLUT +sel_inc_glut = $(INC_GLUT) +endif + +EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ + vms_x_fix.h wmesa.h \ + $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) + +GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ + $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \ + $(sel_inc_x11) $(sel_inc_glut) +include $(top_srcdir)/common_rules.make diff -Nru xpsb-glx-0.19/mesa/include/GL/mesa_wgl.h xpsb-glx-0.19/mesa/include/GL/mesa_wgl.h --- xpsb-glx-0.19/mesa/include/GL/mesa_wgl.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/mesa_wgl.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,128 @@ +/* + * Mesa 3-D graphics library + * Version: 3.1 + * + * Copyright (C) 1999 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. + */ + + +/* prototypes for the Mesa WGL functions */ +/* relocated here so that I could make GLUT get them properly */ + +#ifndef _mesa_wgl_h_ +#define _mesa_wgl_h_ + +#if defined(__MINGW32__) +# define __W32API_USE_DLLIMPORT__ +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef WGLAPI +#define WGLAPI GLAPI +#endif + +#if defined(__MINGW32__) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +# include +#endif + + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) +#ifndef _GNU_H_WINDOWS32_FUNCTIONS +# ifdef UNICODE +# define wglUseFontBitmaps wglUseFontBitmapsW +# define wglUseFontOutlines wglUseFontOutlinesW +# else +# define wglUseFontBitmaps wglUseFontBitmapsA +# define wglUseFontOutlines wglUseFontOutlinesA +# endif /* !UNICODE */ +#endif /* _GNU_H_WINDOWS32_FUNCTIONS */ +typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; +typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; +#endif + + +#ifdef _MSC_VER +# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/ +# pragma warning( push ) +# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */ +#endif + + +WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc); +WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc); + +WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); +WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); +WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int); +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); +WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); +WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void); +WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); +WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC); +WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int); +WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); +WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC); +WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); +WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); + +#ifndef __MINGW32__ +WGLAPI int GLAPIENTRY SwapBuffers(HDC); +WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY GetPixelFormat(HDC); +WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); +#endif + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc); + +#endif /* WGL_ARB_extensions_string */ + + +#ifdef _MSC_VER +# pragma warning( pop ) +#endif + +#ifdef __cplusplus +} +#endif + + +#endif /* _mesa_wgl_h_ */ diff -Nru xpsb-glx-0.19/mesa/include/GL/mglmesa.h xpsb-glx-0.19/mesa/include/GL/mglmesa.h --- xpsb-glx-0.19/mesa/include/GL/mglmesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/mglmesa.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,79 @@ +/**************************************************************************** +* +* Mesa bindings for SciTech MGL +* +* Copyright (C) 1996 SciTech Software. +* All rights reserved. +* +* Filename: mglmesa.h +* Version: Revision: 1.1.1.1 +* +* Language: ANSI C +* Environment: Any +* +* Description: Header file for the Mesa/OpenGL interface bindings for the +* SciTech MGL graphics library. Uses the MGL internal +* device context structures to get direct access to the +* high performance MGL rasterization functions for maximum +* performance. Utilizes the VESA VBE/AF Accelerator Functions +* via the MGL's accelerated device driver functions, as well +* as basic DirectDraw accelerated functions provided by the +* MGL. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU Library General Public +* License along with this library; if not, write to the Free +* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* +****************************************************************************/ + +#ifndef __MGLMESA_H +#define __MGLMESA_H + +#include "mgraph.h" + +/*------------------------- Function Prototypes ---------------------------*/ + +#ifdef __cplusplus +extern "C" { /* Use "C" linkage when in C++ mode */ +#endif + +#ifndef __WINDOWS__ +#define GLAPIENTRY +#endif + +#ifdef __WINDOWS__ +bool GLAPIENTRY MGLMesaInitDLL(MGLCallbacks *cb,char *version); +#endif +void GLAPIENTRY MGLMesaChooseVisual(MGLDC *dc,MGLVisual *visual); +bool GLAPIENTRY MGLMesaSetVisual(MGLDC *dc,MGLVisual *visual); +bool GLAPIENTRY MGLMesaCreateContext(MGLDC *dc,bool forceMemDC); +void GLAPIENTRY MGLMesaDestroyContext(MGLDC *dc); +void GLAPIENTRY MGLMesaMakeCurrent(MGLDC *dc); +void GLAPIENTRY MGLMesaSwapBuffers(MGLDC *dc,bool waitVRT); + +/* Palette manipulation support. The reason we provide palette manipulation + * routines is so that when rendering in double buffered modes with a + * software backbuffer, the palette for the backbuffer is kept consistent + * with the hardware front buffer. + */ + +void GLAPIENTRY MGLMesaSetPaletteEntry(MGLDC *dc,int entry,uchar red,uchar green,uchar blue); +void GLAPIENTRY MGLMesaSetPalette(MGLDC *dc,palette_t *pal,int numColors,int startIndex); +void GLAPIENTRY MGLMesaRealizePalette(MGLDC *dc,int numColors,int startIndex,int waitVRT); + +#ifdef __cplusplus +} /* End of "C" linkage for C++ */ +#endif /* __cplusplus */ + +#endif /* __MGLMESA_H */ diff -Nru xpsb-glx-0.19/mesa/include/GL/miniglx.h xpsb-glx-0.19/mesa/include/GL/miniglx.h --- xpsb-glx-0.19/mesa/include/GL/miniglx.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/miniglx.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,482 @@ +/* + * Mesa 3-D graphics library + * Version: 6.1 + * + * Copyright (C) 1999-2004 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. + */ + + +/** + * \file miniglx.h + * \brief Mini GLX interface functions. + * \author Brian Paul + * + * See comments miniglx.c for more information. + */ + +#ifndef MINIGLX_H +#define MINIGLX_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \name Replacement Xlib/GLX types + */ +/*@{*/ +/** + * \brief Boolean type. + * + * It can have the values #True or #False. + */ +#ifndef MINIGLX_NO_XTYPES +typedef int Bool; +#endif +typedef int MINI_Bool; + +/** + * \brief Color map. + * + * Alias for private ::MiniGLXColormapRec structure. + */ +typedef struct MiniGLXColormapRec *MINI_Colormap; +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXColormapRec *Colormap; +#endif + +/** + * \brief Window attributes. + */ +typedef struct MiniGLXSetWindowAttributesRec { + int background_pixel; /**< \brief background pixel */ + int border_pixel; /**< \brief border pixel value */ + MINI_Colormap colormap; /**< \brief color map to be associated with window */ + int event_mask; /**< \brief set of events that should be saved */ +} XSetWindowAttributes; + +/** + * \brief Visual. + * + * Alias for the private ::MiniGLXVisualRec structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXVisualRec Visual; + +/** + * \brief Visual information. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef unsigned long VisualID; +#endif +typedef unsigned long MINI_VisualID; +typedef struct MiniGLXXVisualInfoRec { + Visual *visual; /**< \brief pointer to the GLX Visual */ + MINI_VisualID visualid; /**< \brief visual ID */ + int screen; /**< \brief screen number */ + int depth; /**< \brief bit depth */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /**< \brief class */ +#else + int class; /**< \brief class */ +#endif + int bits_per_rgb; /**< \brief total bits per pixel */ +} XVisualInfo; + +/** + * \brief GLX Frame Buffer Configuration (for pbuffers) + * \sa \ref datatypes. + */ +typedef struct MiniGLXFBConfigRec { + XVisualInfo *visInfo; +} GLXFBConfig; + + +/** + * \brief Display handle. + * + * Alias for the private ::MiniGLXDisplayRec structure. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXDisplayRec Display; +#endif +typedef struct MiniGLXDisplayRec MINI_Display; + +/** + * \brief Window handle. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXWindowRec *Window; +#endif +typedef struct MiniGLXWindowRec *MINI_Window; + +/** + * \brief Drawable. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * For Mini GLX only the full-screen window can be used as source and + * destination in graphics operations. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXWindowRec *Drawable; +#endif +typedef struct MiniGLXWindowRec *MINI_Drawable; + +/** + * \brief GLX drawable. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * Same as #Drawable. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *GLXDrawable; + +/** + * \brief GLX pbuffer. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * Same as #Drawable. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *GLXPbuffer; + +/** + * \brief GLX context. + * + * Alias for the private ::MiniGLXContext structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXContextRec *GLXContext; +/*@}*/ + + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window window; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ +} XExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window parent; /* parent of the window */ + MINI_Window window; /* window id of window created */ + int x, y; /* window location */ + int width, height; /* size of window */ + int border_width; /* border width */ + MINI_Bool override_redirect; /* creation should be overridden */ +} XCreateWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; +} XDestroyWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; + MINI_Bool from_configure; +} XUnmapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; + MINI_Bool override_redirect; /* boolean, is override set... */ +} XMapEvent; + + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window parent; + MINI_Window window; +} XMapRequestEvent; + +typedef union _XEvent { + int type; /* must not be changed; first element */ + XExposeEvent xexpose; + XCreateWindowEvent xcreatewindow; + XDestroyWindowEvent xdestroywindow; + XUnmapEvent xunmap; + XMapEvent xmap; + XMapRequestEvent xmaprequest; + long pad[24]; +} XEvent; + + +/** + * \name Xlib constants + */ +/*@{*/ +#define False 0 +#define True 1 +#define None 0 +#define AllocNone 0 +#define InputOutput 1 +#define ExposureMask (1L<<15) +#define StructureNotifyMask (1L<<17) +#define CWBackPixel (1L<<1) +#define CWBorderPixel (1L<<3) +#define CWEventMask (1L<<11) +#define CWColormap (1L<<13) +#define PseudoColor 3 +#define TrueColor 4 +#define VisualIDMask 0x1 +#define VisualScreenMask 0x2 +#define Expose 12 +#define CreateNotify 16 +#define DestroyNotify 17 +#define UnmapNotify 18 +#define MapNotify 19 +#define MapRequest 20 + +/*@}*/ + +/** + * \name Standard GLX tokens + */ +/*@{*/ +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_ATTRIBUTE 1 +#define GLX_BAD_VISUAL 4 +/*@}*/ + + +/** + * \name Unique to Mini GLX + * + * At compile time, the Mini GLX interface version can be tested with the + * MINI_GLX_VERSION_1_x preprocessor tokens. + * + * \sa glXQueryVersion() + */ +/*@{*/ +/** \brief Defined if version 1.0 of Mini GLX is supported. */ +#define MINI_GLX_VERSION_1_0 1 +/** \brief Defined if version 1.1 of Mini GLX is supported. */ +#define MINI_GLX_VERSION_1_1 1 +/*@}*/ + + +/** + * \name Server-specific functions + */ +extern MINI_Display * +__miniglx_StartServer( const char *display_name ); + +extern int +__miniglx_Select( MINI_Display *dpy, int maxfd, + fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *tv ); + + +/** + * \name Simulated Xlib functions + */ +/*@{*/ +extern MINI_Display * +XOpenDisplay( const char *dpy_name ); + + +extern void +XCloseDisplay( MINI_Display *display ); + +extern MINI_Window +XCreateWindow( MINI_Display *display, MINI_Window parent, int x, int y, + unsigned int width, unsigned int height, + unsigned int border_width, int depth, unsigned int winclass, + Visual *visual, unsigned long valuemask, + XSetWindowAttributes *attributes ); + +extern int +XNextEvent(MINI_Display *display, XEvent *event_return); + +extern MINI_Bool +XCheckMaskEvent( MINI_Display *dpy, long event_mask, XEvent *event_return ); + +/** + * \brief Return the root window. + * + * \param display the display handle. It is ignored by Mini GLX, but should be + * the value returned by XOpenDisplay(). + * \param screen the screen number on the host server. It is ignored by Mini + * GLX but should be zero. + * + * \return the root window. Always zero on Mini GLX. + */ +#define RootWindow(display, screen) 0 +#define DefaultScreen(dpy) 0 + +extern void +XDestroyWindow( MINI_Display *display, MINI_Window w ); + +extern void +XMapWindow( MINI_Display *display, MINI_Window w ); + +/* Should clients have access to this? + */ +extern void +XUnmapWindow( MINI_Display *display, MINI_Window w ); + +extern MINI_Colormap +XCreateColormap( MINI_Display *display, MINI_Window w, Visual *visual, int alloc ); + +extern void +XFreeColormap( MINI_Display *display, MINI_Colormap cmap ); + +extern void +XFree( void *data ); + +extern XVisualInfo * +XGetVisualInfo( MINI_Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, int *nitems_return ); +/*@}*/ + + + +/** + * \name GLX functions + */ +/*@{*/ +extern XVisualInfo* +glXChooseVisual( MINI_Display *dpy, int screen, int *attribList ); + +extern int +glXGetConfig( MINI_Display *dpy, XVisualInfo *vis, int attrib, int *value ); + +extern GLXContext +glXCreateContext( MINI_Display *dpy, XVisualInfo *vis, + GLXContext shareList, MINI_Bool direct ); + +extern void +glXDestroyContext( MINI_Display *dpy, GLXContext ctx ); + +extern MINI_Bool +glXMakeCurrent( MINI_Display *dpy, GLXDrawable drawable, GLXContext ctx); + +extern void +glXSwapBuffers( MINI_Display *dpy, GLXDrawable drawable ); + +extern GLXContext +glXGetCurrentContext( void ); + +extern GLXDrawable +glXGetCurrentDrawable( void ); + +extern void +(*glXGetProcAddress(const GLubyte *procname))( void ); + +extern MINI_Bool +glXQueryVersion( MINI_Display *dpy, int *major, int *minor ); + +/* Added in MiniGLX 1.1 */ +extern GLXPbuffer +glXCreatePbuffer( MINI_Display *dpy, GLXFBConfig config, const int *attribList ); + +extern void +glXDestroyPbuffer( MINI_Display *dpy, GLXPbuffer pbuf ); + +extern GLXFBConfig * +glXChooseFBConfig( MINI_Display *dpy, int screen, const int *attribList, + int *nitems ); + +extern XVisualInfo * +glXGetVisualFromFBConfig( MINI_Display *dpy, GLXFBConfig config ); + +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 ); +/*@}*/ + +extern void +__glXScrEnableExtension( void *, const char * name ); + +/*@}*/ + + +#ifdef __cplusplus +} +#endif + +#endif /* MINIGLX_H */ diff -Nru xpsb-glx-0.19/mesa/include/GL/osmesa.h xpsb-glx-0.19/mesa/include/GL/osmesa.h --- xpsb-glx-0.19/mesa/include/GL/osmesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/osmesa.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,289 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/* + * Mesa Off-Screen rendering interface. + * + * This is an operating system and window system independent interface to + * Mesa which allows one to render images into a client-supplied buffer in + * main memory. Such images may manipulated or saved in whatever way the + * client wants. + * + * These are the API functions: + * OSMesaCreateContext - create a new Off-Screen Mesa rendering context + * OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer + * and make the specified context the current one. + * OSMesaDestroyContext - destroy an OSMesaContext + * OSMesaGetCurrentContext - return thread's current context ID + * OSMesaPixelStore - controls how pixels are stored in image buffer + * OSMesaGetIntegerv - return OSMesa state parameters + * + * + * The limits on the width and height of an image buffer are MAX_WIDTH and + * MAX_HEIGHT as defined in Mesa/src/config.h. Defaults are 1280 and 1024. + * You can increase them as needed but beware that many temporary arrays in + * Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT. + */ + + +#ifndef OSMESA_H +#define OSMESA_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include + + +#define OSMESA_MAJOR_VERSION 6 +#define OSMESA_MINOR_VERSION 5 +#define OSMESA_PATCH_VERSION 0 + + + +/* + * Values for the format parameter of OSMesaCreateContext() + * New in version 2.0. + */ +#define OSMESA_COLOR_INDEX GL_COLOR_INDEX +#define OSMESA_RGBA GL_RGBA +#define OSMESA_BGRA 0x1 +#define OSMESA_ARGB 0x2 +#define OSMESA_RGB GL_RGB +#define OSMESA_BGR 0x4 +#define OSMESA_RGB_565 0x5 + + +/* + * OSMesaPixelStore() parameters: + * New in version 2.0. + */ +#define OSMESA_ROW_LENGTH 0x10 +#define OSMESA_Y_UP 0x11 + + +/* + * Accepted by OSMesaGetIntegerv: + */ +#define OSMESA_WIDTH 0x20 +#define OSMESA_HEIGHT 0x21 +#define OSMESA_FORMAT 0x22 +#define OSMESA_TYPE 0x23 +#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */ +#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */ + + +typedef struct osmesa_context *OSMesaContext; + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export on +#endif + + +/* + * Create an Off-Screen Mesa rendering context. The only attribute needed is + * an RGBA vs Color-Index mode flag. + * + * Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA, + * OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR. + * sharelist - specifies another OSMesaContext with which to share + * display lists. NULL indicates no sharing. + * Return: an OSMesaContext or 0 if error + */ +GLAPI OSMesaContext GLAPIENTRY +OSMesaCreateContext( GLenum format, OSMesaContext sharelist ); + + + +/* + * Create an Off-Screen Mesa rendering context and specify desired + * size of depth buffer, stencil buffer and accumulation buffer. + * If you specify zero for depthBits, stencilBits, accumBits you + * can save some memory. + * + * New in Mesa 3.5 + */ +GLAPI OSMesaContext GLAPIENTRY +OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, + GLint accumBits, OSMesaContext sharelist); + + +/* + * Destroy an Off-Screen Mesa rendering context. + * + * Input: ctx - the context to destroy + */ +GLAPI void GLAPIENTRY +OSMesaDestroyContext( OSMesaContext ctx ); + + + +/* + * Bind an OSMesaContext to an image buffer. The image buffer is just a + * block of memory which the client provides. Its size must be at least + * as large as width*height*sizeof(type). Its address should be a multiple + * of 4 if using RGBA mode. + * + * Image data is stored in the order of glDrawPixels: row-major order + * with the lower-left image pixel stored in the first array position + * (ie. bottom-to-top). + * + * Since the only type initially supported is GL_UNSIGNED_BYTE, if the + * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA + * value. If the context is in color indexed mode, each pixel will be + * stored as a 1-byte value. + * + * If the context's viewport hasn't been initialized yet, it will now be + * initialized to (0,0,width,height). + * + * Input: ctx - the rendering context + * buffer - the image buffer memory + * type - data type for pixel components, only GL_UNSIGNED_BYTE + * supported now + * width, height - size of image buffer in pixels, at least 1 + * Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx, + * invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1, + * width>internal limit or height>internal limit. + */ +GLAPI GLboolean GLAPIENTRY +OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, + GLsizei width, GLsizei height ); + + + + +/* + * Return the current Off-Screen Mesa rendering context handle. + */ +GLAPI OSMesaContext GLAPIENTRY +OSMesaGetCurrentContext( void ); + + + +/* + * Set pixel store/packing parameters for the current context. + * This is similar to glPixelStore. + * Input: pname - OSMESA_ROW_LENGTH + * specify actual pixels per row in image buffer + * 0 = same as image width (default) + * OSMESA_Y_UP + * zero = Y coordinates increase downward + * non-zero = Y coordinates increase upward (default) + * value - the value for the parameter pname + * + * New in version 2.0. + */ +GLAPI void GLAPIENTRY +OSMesaPixelStore( GLint pname, GLint value ); + + + +/* + * Return an integer value like glGetIntegerv. + * Input: pname - + * OSMESA_WIDTH return current image width + * OSMESA_HEIGHT return current image height + * OSMESA_FORMAT return image format + * OSMESA_TYPE return color component data type + * OSMESA_ROW_LENGTH return row length in pixels + * OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction + * value - pointer to integer in which to return result. + */ +GLAPI void GLAPIENTRY +OSMesaGetIntegerv( GLint pname, GLint *value ); + + + +/* + * Return the depth buffer associated with an OSMesa context. + * Input: c - the OSMesa context + * Output: width, height - size of buffer in pixels + * bytesPerValue - bytes per depth value (2 or 4) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + * New in Mesa 2.4. + */ +GLAPI GLboolean GLAPIENTRY +OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height, + GLint *bytesPerValue, void **buffer ); + + + +/* + * Return the color buffer associated with an OSMesa context. + * Input: c - the OSMesa context + * Output: width, height - size of buffer in pixels + * format - buffer format (OSMESA_FORMAT) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + * New in Mesa 3.3. + */ +GLAPI GLboolean GLAPIENTRY +OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height, + GLint *format, void **buffer ); + + + +/** + * This typedef is new in Mesa 6.3. + */ +typedef void (*OSMESAproc)(); + + +/* + * Return pointer to the named function. + * New in Mesa 4.1 + * Return OSMESAproc in 6.3. + */ +GLAPI OSMESAproc GLAPIENTRY +OSMesaGetProcAddress( const char *funcName ); + + + +/** + * Enable/disable color clamping, off by default. + * New in Mesa 6.4.2 + */ +GLAPI void GLAPIENTRY +OSMesaColorClamp(GLboolean enable); + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export off +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/svgamesa.h xpsb-glx-0.19/mesa/include/GL/svgamesa.h --- xpsb-glx-0.19/mesa/include/GL/svgamesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/svgamesa.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,97 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * SVGA/Mesa interface for Linux. + */ + + +/* + * Intro to using the VGA/Mesa interface + * + * 1. #include the file + * 2. Call vga_init() to initialize the SVGA library. + * 3. Call vga_setmode() to specify the screen size and color depth. + * 4. Call SVGAMesaCreateContext() to setup a Mesa context. If using 8-bit + * color Mesa assumes color index mode, if using 16-bit or deeper color + * Mesa assumes RGB mode. + * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context. + * 6. You can now use the Mesa API functions. + * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT) + * to restore the original text screen. + * + * Notes + * 1. You must run your executable as root (or use the set UID-bit) because + * the SVGA library requires it. + * 2. The SVGA driver is not fully implemented yet. See svgamesa.c for what + * has to be done yet. + */ + + +#ifndef SVGAMESA_H +#define SVGAMESA_H + + +#define SVGAMESA_MAJOR_VERSION 4 +#define SVGAMESA_MINOR_VERSION 0 + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "GL/gl.h" + + + +/* + * This is the SVGAMesa context 'handle': + */ +typedef struct svgamesa_context *SVGAMesaContext; + + + +/* + * doubleBuffer flag new in version 2.4 + */ +extern int SVGAMesaInit( int GraphMode ); + +extern int SVGAMesaClose( void ); + +extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ); + +extern void SVGAMesaDestroyContext( SVGAMesaContext ctx ); + +extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx ); + +extern void SVGAMesaSwapBuffers( void ); + +extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue); + +extern SVGAMesaContext SVGAMesaGetCurrentContext( void ); + +#ifdef __cplusplus +} +#endif + + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/vms_x_fix.h xpsb-glx-0.19/mesa/include/GL/vms_x_fix.h --- xpsb-glx-0.19/mesa/include/GL/vms_x_fix.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/vms_x_fix.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1224 @@ +/*************************************************************************** + * * + * Author : Jouk Jansen (joukj@hrem.nano.tudelft.nl) * + * * + * Last revision : 31 August 2006 * + * * + * Repair definitions of Runtime library functions when compiling with * + * /name=(as_is) on OpenVMS * + * * + ***************************************************************************/ + +#ifndef VMS_X_FIX +#define VMS_X_FIX + +#define decw$_select DECW$_SELECT +#define DtSaverGetWindows DTSAVERGETWINDOWS +#define MrmFetchWidget MRMFETCHWIDGET +#define MrmInitialize MRMINITIALIZE +#define MrmOpenHierarchy MRMOPENHIERARCHY +#define MrmRegisterNames MRMREGISTERNAMES +#define XAddExtension XADDEXTENSION +#define XAddHosts XADDHOSTS +#define XAllocClassHint XALLOCCLASSHINT +#define XAllocColor XALLOCCOLOR +#define XAllocColorCells XALLOCCOLORCELLS +#define XAllocIconSize XALLOCICONSIZE +#define XAllocNamedColor XALLOCNAMEDCOLOR +#define XAllocSizeHints XALLOCSIZEHINTS +#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP +#define XAllocWMHints XALLOCWMHINTS +#define XAllowEvents XALLOWEVENTS +#define XAutoRepeatOff XAUTOREPEATOFF +#define XAutoRepeatOn XAUTOREPEATON +#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET +#define XBell XBELL +#define XBitmapPad XBITMAPPAD +#define XBlackPixel XBLACKPIXEL +#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN +#define XCellsOfScreen XCELLSOFSCREEN +#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB +#define XChangeGC XCHANGEGC +#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL +#define XChangePointerControl XCHANGEPOINTERCONTROL +#define XChangeProperty XCHANGEPROPERTY +#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES +#define XCheckIfEvent XCHECKIFEVENT +#define XCheckMaskEvent XCHECKMASKEVENT +#define XCheckTypedEvent XCHECKTYPEDEVENT +#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT +#define XCheckWindowEvent XCHECKWINDOWEVENT +#define XClearArea XCLEARAREA +#define XClearWindow XCLEARWINDOW +#define XClipBox XCLIPBOX +#define XCloseDisplay XCLOSEDISPLAY +#define XCloseIM XCLOSEIM +#define XConfigureWindow XCONFIGUREWINDOW +#define XConvertSelection XCONVERTSELECTION +#define XCopyArea XCOPYAREA +#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE +#define XCopyGC XCOPYGC +#define XCopyPlane XCOPYPLANE +#define XCreateBitmapFromData XCREATEBITMAPFROMDATA +#define XCreateColormap XCREATECOLORMAP +#define XCreateFontCursor XCREATEFONTCURSOR +#define XCreateFontSet XCREATEFONTSET +#define XCreateGC XCREATEGC +#define XCreateGlyphCursor XCREATEGLYPHCURSOR +#define XCreateIC XCREATEIC +#define XCreateImage XCREATEIMAGE +#define XCreatePixmap XCREATEPIXMAP +#define XCreatePixmapCursor XCREATEPIXMAPCURSOR +#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA +#define XCreateRegion XCREATEREGION +#define XCreateSimpleWindow XCREATESIMPLEWINDOW +#define XCreateWindow XCREATEWINDOW +#define XDefaultColormap XDEFAULTCOLORMAP +#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN +#define XDefaultDepth XDEFAULTDEPTH +#define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN +#define XDefaultGC XDEFAULTGC +#define XDefaultRootWindow XDEFAULTROOTWINDOW +#define XDefaultScreen XDEFAULTSCREEN +#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY +#define XDefaultVisual XDEFAULTVISUAL +#define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN +#define XDefineCursor XDEFINECURSOR +#define XDeleteContext XDELETECONTEXT +#define XDeleteProperty XDELETEPROPERTY +#define XDestroyIC XDESTROYIC +#define XDestroyRegion XDESTROYREGION +#define XDestroySubwindows XDESTROYSUBWINDOWS +#define XDestroyWindow XDESTROYWINDOW +#define XDisableAccessControl XDISABLEACCESSCONTROL +#define XDisplayCells XDISPLAYCELLS +#define XDisplayHeight XDISPLAYHEIGHT +#define XDisplayKeycodes XDISPLAYKEYCODES +#define XDisplayName XDISPLAYNAME +#define XDisplayOfIM XDISPLAYOFIM +#define XDisplayOfScreen XDISPLAYOFSCREEN +#define XDisplayString XDISPLAYSTRING +#define XDisplayWidth XDISPLAYWIDTH +#define XDoesBackingStore XDOESBACKINGSTORE +#define XDrawArc XDRAWARC +#define XDrawArcs XDRAWARCS +#define XDrawImageString XDRAWIMAGESTRING +#define XDrawImageString16 XDRAWIMAGESTRING16 +#define XDrawLine XDRAWLINE +#define XDrawLines XDRAWLINES +#define XDrawPoint XDRAWPOINT +#define XDrawPoints XDRAWPOINTS +#define XDrawRectangle XDRAWRECTANGLE +#define XDrawRectangles XDRAWRECTANGLES +#define XDrawSegments XDRAWSEGMENTS +#define XDrawString XDRAWSTRING +#define XDrawString16 XDRAWSTRING16 +#define XDrawText XDRAWTEXT +#define XDrawText16 XDRAWTEXT16 +#define XESetCloseDisplay XESETCLOSEDISPLAY +#define XEmptyRegion XEMPTYREGION +#define XEnableAccessControl XENABLEACCESSCONTROL +#define XEqualRegion XEQUALREGION +#define XEventsQueued XEVENTSQUEUED +#define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE +#define XExtentsOfFontSet XEXTENTSOFFONTSET +#define XFetchBuffer XFETCHBUFFER +#define XFetchBytes XFETCHBYTES +#define XFetchName XFETCHNAME +#define XFillArc XFILLARC +#define XFillArcs XFILLARCS +#define XFillPolygon XFILLPOLYGON +#define XFillRectangle XFILLRECTANGLE +#define XFillRectangles XFILLRECTANGLES +#define XFilterEvent XFILTEREVENT +#define XFindContext XFINDCONTEXT +#define XFlush XFLUSH +#define XFontsOfFontSet XFONTSOFFONTSET +#define XForceScreenSaver XFORCESCREENSAVER +#define XFree XFREE +#define XFreeColormap XFREECOLORMAP +#define XFreeColors XFREECOLORS +#define XFreeCursor XFREECURSOR +#define XFreeDeviceList XFREEDEVICELIST +#define XFreeDeviceState XFREEDEVICESTATE +#define XFreeFont XFREEFONT +#define XFreeFontInfo XFREEFONTINFO +#define XFreeFontNames XFREEFONTNAMES +#define XFreeFontSet XFREEFONTSET +#define XFreeGC XFREEGC +#define XFreeModifiermap XFREEMODIFIERMAP +#define XFreePixmap XFREEPIXMAP +#define XFreeStringList XFREESTRINGLIST +#define XGContextFromGC XGCONTEXTFROMGC +#define XGeometry XGEOMETRY +#define XGetAtomName XGETATOMNAME +#define XGetClassHint XGETCLASSHINT +#define XGetCommand XGETCOMMAND +#define XGetDefault XGETDEFAULT +#define XGetErrorDatabaseText XGETERRORDATABASETEXT +#define XGetErrorText XGETERRORTEXT +#define XGetExtensionVersion XGETEXTENSIONVERSION +#define XGetFontProperty XGETFONTPROPERTY +#define XGetGCValues XGETGCVALUES +#define XGetGeometry XGETGEOMETRY +#define XGetICValues XGETICVALUES +#define XGetIMValues XGETIMVALUES +#define XGetIconName XGETICONNAME +#define XGetIconSizes XGETICONSIZES +#define XGetImage XGETIMAGE +#define XGetInputFocus XGETINPUTFOCUS +#define XGetKeyboardControl XGETKEYBOARDCONTROL +#define XGetKeyboardMapping XGETKEYBOARDMAPPING +#define XGetModifierMapping XGETMODIFIERMAPPING +#define XGetMotionEvents XGETMOTIONEVENTS +#define XGetNormalHints XGETNORMALHINTS +#define XGetPointerControl XGETPOINTERCONTROL +#define XGetPointerMapping XGETPOINTERMAPPING +#define XGetRGBColormaps XGETRGBCOLORMAPS +#define XGetScreenSaver XGETSCREENSAVER +#define XGetSelectionOwner XGETSELECTIONOWNER +#define XGetStandardColormap XGETSTANDARDCOLORMAP +#define XGetSubImage XGETSUBIMAGE +#define XGetTextProperty XGETTEXTPROPERTY +#define XGetVisualInfo XGETVISUALINFO +#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS +#define XGetWMHints XGETWMHINTS +#define XGetWMIconName XGETWMICONNAME +#define XGetWMName XGETWMNAME +#define XGetWMNormalHints XGETWMNORMALHINTS +#define XGetWindowAttributes XGETWINDOWATTRIBUTES +#define XGetWindowProperty XGETWINDOWPROPERTY +#define XGrabButton XGRABBUTTON +#define XGrabKeyboard XGRABKEYBOARD +#define XGrabPointer XGRABPOINTER +#define XGrabServer XGRABSERVER +#define XHeightMMOfScreen XHEIGHTMMOFSCREEN +#define XHeightOfScreen XHEIGHTOFSCREEN +#define XIconifyWindow XICONIFYWINDOW +#define XIfEvent XIFEVENT +#define XInitExtension XINITEXTENSION +#define XInitImage XINITIMAGE +#define XInstallColormap XINSTALLCOLORMAP +#define XInternAtom XINTERNATOM +#define XInternAtoms XINTERNATOMS +#define XIntersectRegion XINTERSECTREGION +#define XKeycodeToKeysym XKEYCODETOKEYSYM +#define XKeysymToKeycode XKEYSYMTOKEYCODE +#define XKeysymToString XKEYSYMTOSTRING +#define XKillClient XKILLCLIENT +#define XListDepths XLISTDEPTHS +#define XListFonts XLISTFONTS +#define XListFontsWithInfo XLISTFONTSWITHINFO +#define XListHosts XLISTHOSTS +#define XListInputDevices XLISTINPUTDEVICES +#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS +#define XListPixmapFormats XLISTPIXMAPFORMATS +#define XListProperties XLISTPROPERTIES +#define XLoadFont XLOADFONT +#define XLoadQueryFont XLOADQUERYFONT +#define XLookupColor XLOOKUPCOLOR +#define XLookupKeysym XLOOKUPKEYSYM +#define XLookupString XLOOKUPSTRING +#define XLowerWindow XLOWERWINDOW +#define XMapRaised XMAPRAISED +#define XMapSubwindows XMAPSUBWINDOWS +#define XMapWindow XMAPWINDOW +#define XMaskEvent XMASKEVENT +#define XMatchVisualInfo XMATCHVISUALINFO +#define XMaxRequestSize XMAXREQUESTSIZE +#define XMissingExtension XMISSINGEXTENSION +#define XMoveResizeWindow XMOVERESIZEWINDOW +#define XMoveWindow XMOVEWINDOW +#define XNextEvent XNEXTEVENT +#define XNextRequest XNEXTREQUEST +#define XNoOp XNOOP +#define XOffsetRegion XOFFSETREGION +#define XOpenDevice XOPENDEVICE +#define XOpenDisplay XOPENDISPLAY +#define XOpenIM XOPENIM +#define XParseColor XPARSECOLOR +#define XParseGeometry XPARSEGEOMETRY +#define XPeekEvent XPEEKEVENT +#define XPeekIfEvent XPEEKIFEVENT +#define XPending XPENDING +#define XPointInRegion XPOINTINREGION +#define XPolygonRegion XPOLYGONREGION +#define XPutBackEvent XPUTBACKEVENT +#define XPutImage XPUTIMAGE +#define XQLength XQLENGTH +#define XQueryBestCursor XQUERYBESTCURSOR +#define XQueryBestStipple XQUERYBESTSTIPPLE +#define XQueryColor XQUERYCOLOR +#define XQueryColors XQUERYCOLORS +#define XQueryDeviceState XQUERYDEVICESTATE +#define XQueryExtension XQUERYEXTENSION +#define XQueryFont XQUERYFONT +#define XQueryKeymap XQUERYKEYMAP +#define XQueryPointer XQUERYPOINTER +#define XQueryTree XQUERYTREE +#define XRaiseWindow XRAISEWINDOW +#define XReadBitmapFile XREADBITMAPFILE +#define XRecolorCursor XRECOLORCURSOR +#define XReconfigureWMWindow XRECONFIGUREWMWINDOW +#define XRectInRegion XRECTINREGION +#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING +#define XRemoveHosts XREMOVEHOSTS +#define XReparentWindow XREPARENTWINDOW +#define XResetScreenSaver XRESETSCREENSAVER +#define XResizeWindow XRESIZEWINDOW +#define XResourceManagerString XRESOURCEMANAGERSTRING +#define XRestackWindows XRESTACKWINDOWS +#define XRotateBuffers XROTATEBUFFERS +#define XRootWindow XROOTWINDOW +#define XRootWindowOfScreen XROOTWINDOWOFSCREEN +#define XSaveContext XSAVECONTEXT +#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN +#define XScreenOfDisplay XSCREENOFDISPLAY +#define XSelectAsyncEvent XSELECTASYNCEVENT +#define XSelectAsyncInput XSELECTASYNCINPUT +#define XSelectExtensionEvent XSELECTEXTENSIONEVENT +#define XSelectInput XSELECTINPUT +#define XSendEvent XSENDEVENT +#define XServerVendor XSERVERVENDOR +#define XSetArcMode XSETARCMODE +#define XSetBackground XSETBACKGROUND +#define XSetClassHint XSETCLASSHINT +#define XSetClipMask XSETCLIPMASK +#define XSetClipOrigin XSETCLIPORIGIN +#define XSetClipRectangles XSETCLIPRECTANGLES +#define XSetCloseDownMode XSETCLOSEDOWNMODE +#define XSetCommand XSETCOMMAND +#define XSetDashes XSETDASHES +#define XSetErrorHandler XSETERRORHANDLER +#define XSetExtensionErrorHandler XSETEXTENSIONERRORHANDLER +#define XSetFillRule XSETFILLRULE +#define XSetFillStyle XSETFILLSTYLE +#define XSetFont XSETFONT +#define XSetForeground XSETFOREGROUND +#define XSetFunction XSETFUNCTION +#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES +#define XSetICFocus XSETICFOCUS +#define XSetICValues XSETICVALUES +#define XSetIOErrorHandler XSETIOERRORHANDLER +#define XSetIconName XSETICONNAME +#define XSetInputFocus XSETINPUTFOCUS +#define XSetLineAttributes XSETLINEATTRIBUTES +#define XSetLocaleModifiers XSETLOCALEMODIFIERS +#define XSetNormalHints XSETNORMALHINTS +#define XSetPlaneMask XSETPLANEMASK +#define XSetRegion XSETREGION +#define XSetRGBColormaps XSETRGBCOLORMAPS +#define XSetScreenSaver XSETSCREENSAVER +#define XSetSelectionOwner XSETSELECTIONOWNER +#define XSetStandardProperties XSETSTANDARDPROPERTIES +#define XSetState XSETSTATE +#define XSetStipple XSETSTIPPLE +#define XSetSubwindowMode XSETSUBWINDOWMODE +#define XSetTSOrigin XSETTSORIGIN +#define XSetTextProperty XSETTEXTPROPERTY +#define XSetTile XSETTILE +#define XSetTransientForHint XSETTRANSIENTFORHINT +#define XSetWMClientMachine XSETWMCLIENTMACHINE +#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS +#define XSetWMHints XSETWMHINTS +#define XSetWMIconName XSETWMICONNAME +#define XSetWMName XSETWMNAME +#define XSetWMNormalHints XSETWMNORMALHINTS +#define XSetWMProperties XSETWMPROPERTIES +#define XSetWMProtocols XSETWMPROTOCOLS +#define XSetWMSizeHints XSETWMSIZEHINTS +#define XSetWindowBackground XSETWINDOWBACKGROUND +#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP +#define XSetWindowBorder XSETWINDOWBORDER +#define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP +#define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH +#define XSetWindowColormap XSETWINDOWCOLORMAP +#define XShapeCombineMask XSHAPECOMBINEMASK +#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES +#define XShapeGetRectangles XSHAPEGETRECTANGLES +#define XShapeQueryExtension XSHAPEQUERYEXTENSION +#define XShmAttach XSHMATTACH +#define XShmCreateImage XSHMCREATEIMAGE +#define XShmCreatePixmap XSHMCREATEPIXMAP +#define XShmDetach XSHMDETACH +#define XShmGetEventBase XSHMGETEVENTBASE +#define XShmPutImage XSHMPUTIMAGE +#define XShmQueryExtension XSHMQUERYEXTENSION +#define XShmQueryVersion XSHMQUERYVERSION +#define XShrinkRegion XSHRINKREGION +#define XStoreBuffer XSTOREBUFFER +#define XStoreBytes XSTOREBYTES +#define XStoreColor XSTORECOLOR +#define XStoreColors XSTORECOLORS +#define XStoreName XSTORENAME +#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY +#define XStringToKeysym XSTRINGTOKEYSYM +#define XSubtractRegion XSUBTRACTREGION +#define XSupportsLocale XSUPPORTSLOCALE +#define XSync XSYNC +#define XSynchronize XSYNCHRONIZE +#define XTextExtents XTEXTEXTENTS +#define XTextExtents16 XTEXTEXTENTS16 +#define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST +#define XTextWidth XTEXTWIDTH +#define XTextWidth16 XTEXTWIDTH16 +#define XTranslateCoordinates XTRANSLATECOORDINATES +#define XUndefineCursor XUNDEFINECURSOR +#define XUngrabButton XUNGRABBUTTON +#define XUngrabKeyboard XUNGRABKEYBOARD +#define XUngrabPointer XUNGRABPOINTER +#define XUngrabServer XUNGRABSERVER +#define XUninstallColormap XUNINSTALLCOLORMAP +#define XUnionRectWithRegion XUNIONRECTWITHREGION +#define XUnionRegion XUNIONREGION +#define XUniqueContext XUNIQUECONTEXT +#define XUnloadFont XUNLOADFONT +#define XUnmapWindow XUNMAPWINDOW +#define XUnsetICFocus XUNSETICFOCUS +#define XVaCreateNestedList XVACREATENESTEDLIST +#define XVisualIDFromVisual XVISUALIDFROMVISUAL +#define XWMGeometry XWMGEOMETRY +#define XWarpPointer XWARPPOINTER +#define XWhitePixel XWHITEPIXEL +#define XWhitePixelOfScreen XWHITEPIXELOFSCREEN +#define XWidthMMOfScreen XWIDTHMMOFSCREEN +#define XWidthOfScreen XWIDTHOFSCREEN +#define XWindowEvent XWINDOWEVENT +#define XWithdrawWindow XWITHDRAWWINDOW +#define XXorRegion XXORREGION +#define XcmsQueryColor XCMSQUERYCOLOR +#define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME +#define XdbeFreeVisualInfo XDBEFREEVISUALINFO +#define XdbeGetVisualInfo XDBEGETVISUALINFO +#define XdbeQueryExtension XDBEQUERYEXTENSION +#define XdbeSwapBuffers XDBESWAPBUFFERS +#define XextAddDisplay XEXTADDDISPLAY +#define XextFindDisplay XEXTFINDDISPLAY +#define XextRemoveDisplay XEXTREMOVEDISPLAY +#define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT +#define XmActivateProtocol XMACTIVATEPROTOCOL +#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK +#define XmAddProtocols XMADDPROTOCOLS +#define XmChangeColor XMCHANGECOLOR +#define XmClipboardCopy XMCLIPBOARDCOPY +#define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME +#define XmClipboardEndCopy XMCLIPBOARDENDCOPY +#define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE +#define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT +#define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT +#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH +#define XmClipboardLock XMCLIPBOARDLOCK +#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE +#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY +#define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE +#define XmClipboardUnlock XMCLIPBOARDUNLOCK +#define XmCommandError XMCOMMANDERROR +#define XmCommandGetChild XMCOMMANDGETCHILD +#define XmCommandSetValue XMCOMMANDSETVALUE +#define XmCreateArrowButton XMCREATEARROWBUTTON +#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET +#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG +#define XmCreateCascadeButton XMCREATECASCADEBUTTON +#define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET +#define XmCreateDialogShell XMCREATEDIALOGSHELL +#define XmCreateDragIcon XMCREATEDRAGICON +#define XmCreateDrawingArea XMCREATEDRAWINGAREA +#define XmCreateDrawnButton XMCREATEDRAWNBUTTON +#define XmCreateErrorDialog XMCREATEERRORDIALOG +#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX +#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG +#define XmCreateForm XMCREATEFORM +#define XmCreateFormDialog XMCREATEFORMDIALOG +#define XmCreateFrame XMCREATEFRAME +#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG +#define XmCreateLabel XMCREATELABEL +#define XmCreateLabelGadget XMCREATELABELGADGET +#define XmCreateList XMCREATELIST +#define XmCreateMainWindow XMCREATEMAINWINDOW +#define XmCreateMenuBar XMCREATEMENUBAR +#define XmCreateMessageBox XMCREATEMESSAGEBOX +#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG +#define XmCreateOptionMenu XMCREATEOPTIONMENU +#define XmCreatePanedWindow XMCREATEPANEDWINDOW +#define XmCreatePopupMenu XMCREATEPOPUPMENU +#define XmCreatePromptDialog XMCREATEPROMPTDIALOG +#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU +#define XmCreatePushButton XMCREATEPUSHBUTTON +#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET +#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG +#define XmCreateRadioBox XMCREATERADIOBOX +#define XmCreateRowColumn XMCREATEROWCOLUMN +#define XmCreateScale XMCREATESCALE +#define XmCreateScrollBar XMCREATESCROLLBAR +#define XmCreateScrolledList XMCREATESCROLLEDLIST +#define XmCreateScrolledText XMCREATESCROLLEDTEXT +#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW +#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG +#define XmCreateSeparator XMCREATESEPARATOR +#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET +#define XmCreateSimpleMenuBar XMCREATESIMPLEMENUBAR +#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG +#define XmCreateText XMCREATETEXT +#define XmCreateTextField XMCREATETEXTFIELD +#define XmCreateToggleButton XMCREATETOGGLEBUTTON +#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET +#define XmCreateWarningDialog XMCREATEWARNINGDIALOG +#define XmCvtCTToXmString XMCVTCTTOXMSTRING +#define XmDestroyPixmap XMDESTROYPIXMAP +#define XmDragStart XMDRAGSTART +#define XmDropSiteRegister XMDROPSITEREGISTER +#define XmDropSiteUnregister XMDROPSITEUNREGISTER +#define XmDropSiteUpdate XMDROPSITEUPDATE +#define XmDropTransferStart XMDROPTRANSFERSTART +#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD +#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH +#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY +#define XmFontListCopy XMFONTLISTCOPY +#define XmFontListCreate XMFONTLISTCREATE +#define XmFontListEntryCreate XMFONTLISTENTRYCREATE +#define XmFontListEntryFree XMFONTLISTENTRYFREE +#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT +#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG +#define XmFontListEntryLoad XMFONTLISTENTRYLOAD +#define XmFontListFree XMFONTLISTFREE +#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT +#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT +#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT +#define XmFontListNextEntry XMFONTLISTNEXTENTRY +#define XmGetColors XMGETCOLORS +#define XmGetColorCalculation XMGETCOLORCALCULATION +#define XmGetFocusWidget XMGETFOCUSWIDGET +#define XmGetMenuCursor XMGETMENUCURSOR +#define XmGetPixmap XMGETPIXMAP +#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH +#define XmGetTearOffControl XMGETTEAROFFCONTROL +#define XmGetXmDisplay XMGETXMDISPLAY +#define XmImMbLookupString XMIMMBLOOKUPSTRING +#define XmImRegister XMIMREGISTER +#define XmImSetFocusValues XMIMSETFOCUSVALUES +#define XmImSetValues XMIMSETVALUES +#define XmImUnregister XMIMUNREGISTER +#define XmImUnsetFocus XMIMUNSETFOCUS +#define XmInstallImage XMINSTALLIMAGE +#define XmInternAtom XMINTERNATOM +#define XmIsMotifWMRunning XMISMOTIFWMRUNNING +#define XmListAddItem XMLISTADDITEM +#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED +#define XmListAddItems XMLISTADDITEMS +#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED +#define XmListDeleteAllItems XMLISTDELETEALLITEMS +#define XmListDeleteItem XMLISTDELETEITEM +#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS +#define XmListDeletePos XMLISTDELETEPOS +#define XmListDeselectAllItems XMLISTDESELECTALLITEMS +#define XmListDeselectPos XMLISTDESELECTPOS +#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS +#define XmListGetMatchPos XMLISTGETMATCHPOS +#define XmListGetSelectedPos XMLISTGETSELECTEDPOS +#define XmListItemExists XMLISTITEMEXISTS +#define XmListItemPos XMLISTITEMPOS +#define XmListPosSelected XMLISTPOSSELECTED +#define XmListReplaceItems XMLISTREPLACEITEMS +#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS +#define XmListSelectItem XMLISTSELECTITEM +#define XmListSelectPos XMLISTSELECTPOS +#define XmListSetBottomPos XMLISTSETBOTTOMPOS +#define XmListSetItem XMLISTSETITEM +#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS +#define XmListSetPos XMLISTSETPOS +#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS +#define XmMenuPosition XMMENUPOSITION +#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD +#define XmOptionButtonGadget XMOPTIONBUTTONGADGET +#define XmOptionLabelGadget XMOPTIONLABELGADGET +#define XmProcessTraversal XMPROCESSTRAVERSAL +#define XmQmotif XMQMOTIF +#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK +#define XmRemoveProtocols XMREMOVEPROTOCOLS +#define XmRemoveTabGroup XMREMOVETABGROUP +#define XmRepTypeGetId XMREPTYPEGETID +#define XmRepTypeGetRecord XMREPTYPEGETRECORD +#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON +#define XmRepTypeRegister XMREPTYPEREGISTER +#define XmRepTypeValidValue XMREPTYPEVALIDVALUE +#define XmScrollBarGetValues XMSCROLLBARGETVALUES +#define XmScrollBarSetValues XMSCROLLBARSETVALUES +#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS +#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD +#define XmSetColorCalculation XMSETCOLORCALCULATION +#define XmStringByteCompare XMSTRINGBYTECOMPARE +#define XmStringCompare XMSTRINGCOMPARE +#define XmStringConcat XMSTRINGCONCAT +#define XmStringCopy XMSTRINGCOPY +#define XmStringCreate XMSTRINGCREATE +#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED +#define XmStringCreateLtoR XMSTRINGCREATELTOR +#define XmStringCreateSimple XMSTRINGCREATESIMPLE +#define XmStringDraw XMSTRINGDRAW +#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE +#define XmStringExtent XMSTRINGEXTENT +#define XmStringFree XMSTRINGFREE +#define XmStringFreeContext XMSTRINGFREECONTEXT +#define XmStringGetLtoR XMSTRINGGETLTOR +#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT +#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT +#define XmStringInitContext XMSTRINGINITCONTEXT +#define XmStringLength XMSTRINGLENGTH +#define XmStringLtoRCreate XMSTRINGLTORCREATE +#define XmStringNConcat XMSTRINGNCONCAT +#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE +#define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE +#define XmStringWidth XMSTRINGWIDTH +#define XmTextClearSelection XMTEXTCLEARSELECTION +#define XmTextCopy XMTEXTCOPY +#define XmTextCut XMTEXTCUT +#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION +#define XmTextFieldCopy XMTEXTFIELDCOPY +#define XmTextFieldCut XMTEXTFIELDCUT +#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE +#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION +#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION +#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH +#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION +#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION +#define XmTextFieldGetString XMTEXTFIELDGETSTRING +#define XmTextFieldInsert XMTEXTFIELDINSERT +#define XmTextFieldPaste XMTEXTFIELDPASTE +#define XmTextFieldRemove XMTEXTFIELDREMOVE +#define XmTextFieldReplace XMTEXTFIELDREPLACE +#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE +#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT +#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION +#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH +#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION +#define XmTextFieldSetString XMTEXTFIELDSETSTRING +#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION +#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION +#define XmTextGetEditable XMTEXTGETEDITABLE +#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION +#define XmTextGetLastPosition XMTEXTGETLASTPOSITION +#define XmTextGetMaxLength XMTEXTGETMAXLENGTH +#define XmTextGetSelection XMTEXTGETSELECTION +#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION +#define XmTextGetString XMTEXTGETSTRING +#define XmTextInsert XMTEXTINSERT +#define XmTextPaste XMTEXTPASTE +#define XmTextPosToXY XMTEXTPOSTOXY +#define XmTextRemove XMTEXTREMOVE +#define XmTextReplace XMTEXTREPLACE +#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION +#define XmTextSetEditable XMTEXTSETEDITABLE +#define XmTextSetHighlight XMTEXTSETHIGHLIGHT +#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION +#define XmTextSetSelection XMTEXTSETSELECTION +#define XmTextSetString XMTEXTSETSTRING +#define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER +#define XmTextShowPosition XMTEXTSHOWPOSITION +#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE +#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE +#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE +#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE +#define XmUninstallImage XMUNINSTALLIMAGE +#define XmUpdateDisplay XMUPDATEDISPLAY +#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX +#define XmbDrawString XMBDRAWSTRING +#define XmbLookupString XMBLOOKUPSTRING +#define XmbResetIC XMBRESETIC +#define XmbSetWMProperties XMBSETWMPROPERTIES +#define XmbTextEscapement XMBTEXTESCAPEMENT +#define XmbTextExtents XMBTEXTEXTENTS +#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY +#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST +#define XmbufCreateBuffers XMBUFCREATEBUFFERS +#define XmbufDestroyBuffers XMBUFDESTROYBUFFERS +#define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS +#define XmbufQueryExtension XMBUFQUERYEXTENSION +#define Xmemory_free XMEMORY_FREE +#define Xmemory_malloc XMEMORY_MALLOC +#define XmuClientWindow XMUCLIENTWINDOW +#define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION +#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP +#define XmuInternAtom XMUINTERNATOM +#define XmuInternStrings XMUINTERNSTRINGS +#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP +#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE +#define XrmCombineDatabase XRMCOMBINEDATABASE +#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE +#define XrmDestroyDatabase XRMDESTROYDATABASE +#define XrmGetDatabase XRMGETDATABASE +#define XrmGetFileDatabase XRMGETFILEDATABASE +#define XrmGetResource XRMGETRESOURCE +#define XrmGetStringDatabase XRMGETSTRINGDATABASE +#define XrmInitialize XRMINITIALIZE +#define XrmMergeDatabases XRMMERGEDATABASES +#define XrmParseCommand XRMPARSECOMMAND +#define XrmPermStringToQuark XRMPERMSTRINGTOQUARK +#define XrmPutFileDatabase XRMPUTFILEDATABASE +#define XrmPutLineResource XRMPUTLINERESOURCE +#define XrmPutStringResource XRMPUTSTRINGRESOURCE +#define XrmQGetResource XRMQGETRESOURCE +#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE +#define XrmQuarkToString XRMQUARKTOSTRING +#define XrmSetDatabase XRMSETDATABASE +#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST +#define XrmStringToQuark XRMSTRINGTOQUARK +#define XtAddCallback XTADDCALLBACK +#define XtAddCallbacks XTADDCALLBACKS +#define XtAddConverter XTADDCONVERTER +#define XtAddEventHandler XTADDEVENTHANDLER +#define XtAddExposureToRegion XTADDEXPOSURETOREGION +#define XtAddGrab XTADDGRAB +#define XtAddRawEventHandler XTADDRAWEVENTHANDLER +#define XtAllocateGC XTALLOCATEGC +#define XtAppAddActions XTAPPADDACTIONS +#define XtAppAddInput XTAPPADDINPUT +#define XtAppAddTimeOut XTAPPADDTIMEOUT +#define XtAppAddWorkProc XTAPPADDWORKPROC +#define XtAppCreateShell XTAPPCREATESHELL +#define XtAppError XTAPPERROR +#define XtAppErrorMsg XTAPPERRORMSG +#define XtAppGetErrorDatabase XTAPPGETERRORDATABASE +#define XtAppGetErrorDatabaseText XTAPPGETERRORDATABASETEXT +#define XtAppSetErrorMsgHandler XTAPPSETERRORMSGHANDLER +#define XtAppInitialize XTAPPINITIALIZE +#define XtAppMainLoop XTAPPMAINLOOP +#define XtAppNextEvent XTAPPNEXTEVENT +#define XtAppPeekEvent XTAPPPEEKEVENT +#define XtAppPending XTAPPPENDING +#define XtAppProcessEvent XTAPPPROCESSEVENT +#define XtAppSetErrorHandler XTAPPSETERRORHANDLER +#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES +#define XtAppSetTypeConverter XTAPPSETTYPECONVERTER +#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER +#define XtAppWarningMsg XTAPPWARNINGMSG +#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER +#define XtAppWarning XTAPPWARNING +#define XtAugmentTranslations XTAUGMENTTRANSLATIONS +#define XtCallActionProc XTCALLACTIONPROC +#define XtCallCallbackList XTCALLCALLBACKLIST +#define XtCallCallbacks XTCALLCALLBACKS +#define XtCallConverter XTCALLCONVERTER +#define XtCalloc XTCALLOC +#ifndef NOXTDISPLAY +#define XtClass XTCLASS +#endif +#define XtCloseDisplay XTCLOSEDISPLAY +#define XtConfigureWidget XTCONFIGUREWIDGET +#define XtConvert XTCONVERT +#define XtConvertAndStore XTCONVERTANDSTORE +#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT +#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET +#define XtCreatePopupShell XTCREATEPOPUPSHELL +#define XtCreateWidget XTCREATEWIDGET +#define XtCreateWindow XTCREATEWINDOW +#define XtCvtStringToFont XTCVTSTRINGTOFONT +#define XtDatabase XTDATABASE +#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT +#define XtDestroyWidget XTDESTROYWIDGET +#define XtDisownSelection XTDISOWNSELECTION +#define XtDispatchEvent XTDISPATCHEVENT +#ifndef NOXTDISPLAY +#define XtDisplay XTDISPLAY +#endif +#define XtDisplayInitialize XTDISPLAYINITIALIZE +#define XtDisplayOfObject XTDISPLAYOFOBJECT +#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING +#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT +#define XtError XTERROR +#define XtErrorMsg XTERRORMSG +#define XtFree XTFREE +#define XtGetActionKeysym XTGETACTIONKEYSYM +#define XtGetActionList XTGETACTIONLIST +#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS +#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES +#define XtGetClassExtension XTGETCLASSEXTENSION +#define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST +#define XtGetGC XTGETGC +#define XtGetMultiClickTime XTGETMULTICLICKTIME +#define XtGetResourceList XTGETRESOURCELIST +#define XtGetSelectionValue XTGETSELECTIONVALUE +#define XtGetSelectionValues XTGETSELECTIONVALUES +#define XtGetSubresources XTGETSUBRESOURCES +#define XtGetValues XTGETVALUES +#define XtGrabButton XTGRABBUTTON +#define XtGrabKeyboard XTGRABKEYBOARD +#define XtGrabPointer XTGRABPOINTER +#define XtHasCallbacks XTHASCALLBACKS +#define XtInitialize XTINITIALIZE +#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS +#define XtInsertEventHandler XTINSERTEVENTHANDLER +#define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER +#define XtInstallAccelerators XTINSTALLACCELERATORS +#define XtIsManaged XTISMANAGED +#define XtIsObject XTISOBJECT +#ifndef NOXTDISPLAY +#define XtIsRealized XTISREALIZED +#endif +#define XtIsSensitive XTISSENSITIVE +#define XtIsSubclass XTISSUBCLASS +#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED +#define XtMainLoop XTMAINLOOP +#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST +#define XtMakeResizeRequest XTMAKERESIZEREQUEST +#define XtMalloc XTMALLOC +#define XtManageChild XTMANAGECHILD +#define XtManageChildren XTMANAGECHILDREN +#define XtMergeArgLists XTMERGEARGLISTS +#define XtMoveWidget XTMOVEWIDGET +#define XtName XTNAME +#define XtNameToWidget XTNAMETOWIDGET +#define XtOpenApplication XTOPENAPPLICATION +#define XtOpenDisplay XTOPENDISPLAY +#define XtOverrideTranslations XTOVERRIDETRANSLATIONS +#define XtOwnSelection XTOWNSELECTION +#ifndef NOXTDISPLAY +#define XtParent XTPARENT +#endif +#define XtParseAcceleratorTable XTPARSEACCELERATORTABLE +#define XtParseTranslationTable XTPARSETRANSLATIONTABLE +#define XtPopdown XTPOPDOWN +#define XtPopup XTPOPUP +#define XtPopupSpringLoaded XTPOPUPSPRINGLOADED +#define XtQueryGeometry XTQUERYGEOMETRY +#define XtRealizeWidget XTREALIZEWIDGET +#define XtRealloc XTREALLOC +#define XtRegisterDrawable _XTREGISTERWINDOW +#define XtRegisterGrabAction XTREGISTERGRABACTION +#define XtReleaseGC XTRELEASEGC +#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS +#define XtRemoveCallback XTREMOVECALLBACK +#define XtRemoveEventHandler XTREMOVEEVENTHANDLER +#define XtRemoveGrab XTREMOVEGRAB +#define XtRemoveInput XTREMOVEINPUT +#define XtRemoveTimeOut XTREMOVETIMEOUT +#define XtRemoveWorkProc XTREMOVEWORKPROC +#define XtResizeWidget XTRESIZEWIDGET +#define XtResolvePathname XTRESOLVEPATHNAME +#ifndef NOXTDISPLAY +#define XtScreen XTSCREEN +#endif +#define XtScreenDatabase XTSCREENDATABASE +#define XtScreenOfObject XTSCREENOFOBJECT +#define XtSessionReturnToken XTSESSIONRETURNTOKEN +#define XtSetErrorHandler XTSETERRORHANDLER +#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS +#define XtSetLanguageProc XTSETLANGUAGEPROC +#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED +#define XtSetSensitive XTSETSENSITIVE +#define XtSetTypeConverter XTSETTYPECONVERTER +#define XtSetValues XTSETVALUES +#define XtShellStrings XTSHELLSTRINGS +#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING +#define XtStrings XTSTRINGS +#define XtToolkitInitialize XTTOOLKITINITIALIZE +#define XtTranslateCoords XTTRANSLATECOORDS +#define XtTranslateKeycode XTTRANSLATEKEYCODE +#define XtUngrabButton XTUNGRABBUTTON +#define XtUngrabKeyboard XTUNGRABKEYBOARD +#define XtUngrabPointer XTUNGRABPOINTER +#define XtUnmanageChild XTUNMANAGECHILD +#define XtUnmanageChildren XTUNMANAGECHILDREN +#define XtUnrealizeWidget XTUNREALIZEWIDGET +#define XtUnregisterDrawable _XTUNREGISTERWINDOW +#define XtVaAppCreateShell XTVAAPPCREATESHELL +#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET +#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL +#define XtVaCreateWidget XTVACREATEWIDGET +#define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES +#define XtVaGetValues XTVAGETVALUES +#define XtVaSetValues XTVASETVALUES +#define XtWarning XTWARNING +#define XtWarningMsg XTWARNINGMSG +#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT +#ifndef NOXTDISPLAY +#define XtWindow XTWINDOW +#endif +#define XtWindowOfObject XTWINDOWOFOBJECT +#define XtWindowToWidget XTWINDOWTOWIDGET +#define XwcDrawImageString XWCDRAWIMAGESTRING +#define XwcDrawString XWCDRAWSTRING +#define XwcFreeStringList XWCFREESTRINGLIST +#define XwcTextEscapement XWCTEXTESCAPEMENT +#define XwcTextExtents XWCTEXTEXTENTS +#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY +#define XwcLookupString XWCLOOKUPSTRING +#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST +#define _XAllocTemp _XALLOCTEMP +#define _XDeqAsyncHandler _XDEQASYNCHANDLER +#define _XEatData _XEATDATA +#define _XFlush _XFLUSH +#define _XFreeTemp _XFREETEMP +#define _XGetAsyncReply _XGETASYNCREPLY +#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS +#define _XRead _XREAD +#define _XReadPad _XREADPAD +#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE +#define _XReply _XREPLY +#define _XSend _XSEND +#define _XUnregisterFilter _XUNREGISTERFILTER +#define _XVIDtoVisual _XVIDTOVISUAL +#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT +#define _XmClearBorder _XMCLEARBORDER +#define _XmConfigureObject _XMCONFIGUREOBJECT +#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK +#define _XmDrawArrow _XMDRAWARROW +#define _XmDrawShadows _XMDRAWSHADOWS +#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT +#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS +#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS +#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR +#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST +#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON +#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA +#define _XmGrabKeyboard _XMGRABKEYBOARD +#define _XmGrabPointer _XMGRABPOINTER +#define _XmInheritClass _XMINHERITCLASS +#define _XmInputForGadget _XMINPUTFORGADGET +#define _XmInputInGadget _XMINPUTINGADGET +#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST +#define _XmMenuPopDown _XMMENUPOPDOWN +#define _XmMoveObject _XMMOVEOBJECT +#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED +#define _XmOSBuildFileList _XMOSBUILDFILELIST +#define _XmOSFileCompare _XMOSFILECOMPARE +#define _XmOSFindPatternPart _XMOSFINDPATTERNPART +#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC +#define _XmPostPopupMenu _XMPOSTPOPUPMENU +#define _XmPrimitiveEnter _XMPRIMITIVEENTER +#define _XmPrimitiveLeave _XMPRIMITIVELEAVE +#define _XmRedisplayGadgets _XMREDISPLAYGADGETS +#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE +#define _XmStringDraw _XMSTRINGDRAW +#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT +#define _XmStrings _XMSTRINGS +#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS +#define _XmToVerticalPixels _XMTOVERTICALPIXELS +#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT +#define _Xm_fastPtr _XM_FASTPTR +#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG +#define _XtCopyFromArg _XTCOPYFROMARG +#define _XtCountVaList _XTCOUNTVALIST +#define _XtInherit _XTINHERIT +#define _XtInheritTranslations _XTINHERITTRANSLATIONS +#define _XtIsSubclassOf _XTISSUBCLASSOF +#define _XtVaToArgList _XTVATOARGLIST +#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS +#define cli$dcl_parse CLI$DCL_PARSE +#define cli$get_value CLI$GET_VALUE +#define cli$present CLI$PRESENT +#define compositeClassRec COMPOSITECLASSREC +#define compositeWidgetClass COMPOSITEWIDGETCLASS +#define constraintClassRec CONSTRAINTCLASSREC +#define constraintWidgetClass CONSTRAINTWIDGETCLASS +#define coreWidgetClass COREWIDGETCLASS +#define exe$getspi EXE$GETSPI +#define lbr$close LBR$CLOSE +#define lbr$get_header LBR$GET_HEADER +#define lbr$get_index LBR$GET_INDEX +#define lbr$get_record LBR$GET_RECORD +#define lbr$ini_control LBR$INI_CONTROL +#define lbr$lookup_key LBR$LOOKUP_KEY +#define lbr$open LBR$OPEN +#define lbr$output_help LBR$OUTPUT_HELP +#define lib$add_times LIB$ADD_TIMES +#define lib$addx LIB$ADDX +#define lib$create_dir LIB$CREATE_DIR +#define lib$create_vm_zone LIB$CREATE_VM_ZONE +#define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME +#define lib$cvt_htb LIB$CVT_HTB +#define lib$cvt_vectim LIB$CVT_VECTIM +#define lib$day LIB$DAY +#define lib$day_of_week LIB$DAY_OF_WEEK +#define lib$delete_symbol LIB$DELETE_SYMBOL +#define lib$delete_vm_zone LIB$DELETE_VM_ZONE +#define lib$disable_ctrl LIB$DISABLE_CTRL +#define lib$ediv LIB$EDIV +#define lib$emul LIB$EMUL +#define lib$enable_ctrl LIB$ENABLE_CTRL +#define lib$find_vm_zone LIB$FIND_VM_ZONE +#define lib$format_date_time LIB$FORMAT_DATE_TIME +#define lib$free_timer LIB$FREE_TIMER +#define lib$free_vm LIB$FREE_VM +#define lib$get_ef LIB$GET_EF +#define lib$get_foreign LIB$GET_FOREIGN +#define lib$get_input LIB$GET_INPUT +#define lib$get_users_language LIB$GET_USERS_LANGUAGE +#define lib$get_vm LIB$GET_VM +#define lib$get_symbol LIB$GET_SYMBOL +#define lib$getdvi LIB$GETDVI +#define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT +#define lib$init_timer LIB$INIT_TIMER +#define lib$find_file LIB$FIND_FILE +#define lib$find_file_end LIB$FIND_FILE_END +#define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL +#define lib$mult_delta_time LIB$MULT_DELTA_TIME +#define lib$put_output LIB$PUT_OUTPUT +#define lib$rename_file LIB$RENAME_FILE +#define lib$reset_vm_zone LIB$RESET_VM_ZONE +#define lib$set_symbol LIB$SET_SYMBOL +#define lib$sfree1_dd LIB$SFREE1_DD +#define lib$show_vm LIB$SHOW_VM +#define lib$show_vm_zone LIB$SHOW_VM_ZONE +#define lib$spawn LIB$SPAWN +#define lib$stat_timer LIB$STAT_TIMER +#define lib$subx LIB$SUBX +#define lib$sub_times LIB$SUB_TIMES +#define lib$wait LIB$WAIT +#define mail$send_add_address MAIL$SEND_ADD_ADDRESS +#define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE +#define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART +#define mail$send_begin MAIL$SEND_BEGIN +#define mail$send_end MAIL$SEND_END +#define mail$send_message MAIL$SEND_MESSAGE +#define ncs$convert NCS$CONVERT +#define ncs$get_cf NCS$GET_CF +#define objectClass OBJECTCLASS +#define objectClassRec OBJECTCLASSREC +#define overrideShellClassRec OVERRIDESHELLCLASSREC +#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS +#define pthread_attr_create PTHREAD_ATTR_CREATE +#define pthread_attr_delete PTHREAD_ATTR_DELETE +#define pthread_attr_destroy PTHREAD_ATTR_DESTROY +#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP +#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP +#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED +#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO +#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED +#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM +#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY +#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE +#define pthread_attr_init PTHREAD_ATTR_INIT +#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP +#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE +#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP +#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED +#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO +#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED +#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM +#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY +#ifndef pthread_attr_setscope +# define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE +#endif +#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE +#define pthread_cancel PTHREAD_CANCEL +#define pthread_cancel_e PTHREAD_CANCEL_E +#define pthread_cond_broadcast PTHREAD_COND_BROADCAST +#define pthread_cond_destroy PTHREAD_COND_DESTROY +#define pthread_cond_init PTHREAD_COND_INIT +#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP +#define pthread_cond_signal PTHREAD_COND_SIGNAL +#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP +#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT +#define pthread_cond_wait PTHREAD_COND_WAIT +#define pthread_condattr_create PTHREAD_CONDATTR_CREATE +#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE +#define pthread_condattr_init PTHREAD_CONDATTR_INIT +#define pthread_create PTHREAD_CREATE +#define pthread_delay_np PTHREAD_DELAY_NP +#define pthread_detach PTHREAD_DETACH +#define pthread_equal PTHREAD_EQUAL +#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP +#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP +#define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP +#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP +#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP +#define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP +#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP +#define pthread_exit PTHREAD_EXIT +#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP +#define pthread_getprio PTHREAD_GETPRIO +#define pthread_getschedparam PTHREAD_GETSCHEDPARAM +#define pthread_getscheduler PTHREAD_GETSCHEDULER +#define pthread_getspecific PTHREAD_GETSPECIFIC +#define pthread_getunique_np PTHREAD_GETUNIQUE_NP +#define pthread_join PTHREAD_JOIN +#define pthread_join32 PTHREAD_JOIN32 +#define pthread_key_create PTHREAD_KEY_CREATE +#define pthread_key_delete PTHREAD_KEY_DELETE +#define pthread_keycreate PTHREAD_KEYCREATE +#define pthread_kill PTHREAD_KILL +#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP +#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY +#define pthread_mutex_init PTHREAD_MUTEX_INIT +#define pthread_mutex_lock PTHREAD_MUTEX_LOCK +#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK +#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK +#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE +#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE +#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY +#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP +#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT +#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP +#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP +#define pthread_once PTHREAD_ONCE +#define pthread_resume_np PTHREAD_RESUME_NP +#define pthread_self PTHREAD_SELF +#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL +#define pthread_setcancel PTHREAD_SETCANCEL +#define pthread_setcancelstate PTHREAD_SETCANCELSTATE +#define pthread_setcanceltype PTHREAD_SETCANCELTYPE +#define pthread_setprio PTHREAD_SETPRIO +#define pthread_setschedparam PTHREAD_SETSCHEDPARAM +#define pthread_setscheduler PTHREAD_SETSCHEDULER +#define pthread_setspecific PTHREAD_SETSPECIFIC +#define pthread_suspend_np PTHREAD_SUSPEND_NP +#define pthread_testcancel PTHREAD_TESTCANCEL +#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP +#define pthread_yield PTHREAD_YIELD +#define pthread_yield_np PTHREAD_YIELD_NP +#define rectObjClass RECTOBJCLASS +#define rectObjClassRec RECTOBJCLASSREC +#define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS +#define shellWidgetClass SHELLWIDGETCLASS +#define shmat SHMAT +#define shmctl SHMCTL +#define shmdt SHMDT +#define shmget SHMGET +#define smg$create_key_table SMG$CREATE_KEY_TABLE +#define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD +#define smg$read_composed_line SMG$READ_COMPOSED_LINE +#define sys$add_ident SYS$ADD_IDENT +#define sys$asctoid SYS$ASCTOID +#define sys$assign SYS$ASSIGN +#define sys$bintim SYS$BINTIM +#define sys$cancel SYS$CANCEL +#define sys$cantim SYS$CANTIM +#define sys$check_access SYS$CHECK_ACCESS +#define sys$close SYS$CLOSE +#define sys$connect SYS$CONNECT +#define sys$create SYS$CREATE +#define sys$create_user_profile SYS$CREATE_USER_PROFILE +#define sys$crembx SYS$CREMBX +#define sys$creprc SYS$CREPRC +#define sys$crmpsc SYS$CRMPSC +#define sys$dassgn SYS$DASSGN +#define sys$dclast SYS$DCLAST +#define sys$dclexh SYS$DCLEXH +#define sys$delprc SYS$DELPRC +#define sys$deq SYS$DEQ +#define sys$dgblsc SYS$DGBLSC +#define sys$display SYS$DISPLAY +#define sys$enq SYS$ENQ +#define sys$enqw SYS$ENQW +#define sys$erase SYS$ERASE +#define sys$fao SYS$FAO +#define sys$faol SYS$FAOL +#define sys$find_held SYS$FIND_HELD +#define sys$finish_rdb SYS$FINISH_RDB +#define sys$flush SYS$FLUSH +#define sys$forcex SYS$FORCEX +#define sys$get SYS$GET +#define sys$get_security SYS$GET_SECURITY +#define sys$getdviw SYS$GETDVIW +#define sys$getjpi SYS$GETJPI +#define sys$getjpiw SYS$GETJPIW +#define sys$getlkiw SYS$GETLKIW +#define sys$getmsg SYS$GETMSG +#define sys$getsyi SYS$GETSYI +#define sys$getsyiw SYS$GETSYIW +#define sys$gettim SYS$GETTIM +#define sys$getuai SYS$GETUAI +#define sys$grantid SYS$GRANTID +#define sys$hash_password SYS$HASH_PASSWORD +#define sys$hiber SYS$HIBER +#define sys$mgblsc SYS$MGBLSC +#define sys$numtim SYS$NUMTIM +#define sys$open SYS$OPEN +#define sys$parse SYS$PARSE +#define sys$parse_acl SYS$PARSE_ACL +#define sys$parse_acl SYS$PARSE_ACL +#define sys$persona_assume SYS$PERSONA_ASSUME +#define sys$persona_create SYS$PERSONA_CREATE +#define sys$persona_delete SYS$PERSONA_DELETE +#define sys$process_scan SYS$PROCESS_SCAN +#define sys$put SYS$PUT +#define sys$qio SYS$QIO +#define sys$qiow SYS$QIOW +#define sys$read SYS$READ +#define sys$resched SYS$RESCHED +#define sys$rewind SYS$REWIND +#define sys$search SYS$SEARCH +#define sys$set_security SYS$SET_SECURITY +#define sys$setast SYS$SETAST +#define sys$setef SYS$SETEF +#define sys$setimr SYS$SETIMR +#define sys$setpri SYS$SETPRI +#define sys$setprn SYS$SETPRN +#define sys$setprv SYS$SETPRV +#define sys$setswm SYS$SETSWM +#define sys$setuai SYS$SETUAI +#define sys$sndopr SYS$SNDOPR +#define sys$synch SYS$SYNCH +#define sys$trnlnm SYS$TRNLNM +#define sys$update SYS$UPDATE +#define sys$wake SYS$WAKE +#define sys$write SYS$WRITE +#define topLevelShellClassRec TOPLEVELSHELLCLASSREC +#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS +#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS +#define vendorShellClassRec VENDORSHELLCLASSREC +#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS +#define widgetClass WIDGETCLASS +#define widgetClassRec WIDGETCLASSREC +#define wmShellClassRec WMSHELLCLASSREC +#define wmShellWidgetClass WMSHELLWIDGETCLASS +#define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK +#define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH +#define x$soft_reenable_asts X$SOFT_REENABLE_ASTS +#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS +#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS +#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC +#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS +#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS +#define xmCommandWidgetClass XMCOMMANDWIDGETCLASS +#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS +#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS +#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS +#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS +#define xmFormWidgetClass XMFORMWIDGETCLASS +#define xmFrameWidgetClass XMFRAMEWIDGETCLASS +#define xmGadgetClass XMGADGETCLASS +#define xmLabelGadgetClass XMLABELGADGETCLASS +#define xmLabelWidgetClass XMLABELWIDGETCLASS +#define xmListWidgetClass XMLISTWIDGETCLASS +#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS +#define xmManagerClassRec XMMANAGERCLASSREC +#define xmManagerWidgetClass XMMANAGERWIDGETCLASS +#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS +#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS +#define xmPrimitiveClassRec XMPRIMITIVECLASSREC +#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS +#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC +#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS +#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS +#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS +#define xmSashWidgetClass XMSASHWIDGETCLASS +#define xmScaleWidgetClass XMSCALEWIDGETCLASS +#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS +#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC +#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS +#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS +#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS +#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS +#define xmTextWidgetClass XMTEXTWIDGETCLASS +#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS +#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS + +#if (__VMS_VER < 80200000) +# define SetReqLen(req,n,badlen) \ + if ((req->length + n) > (unsigned)65535) { \ + n = badlen; \ + req->length += n; \ + } else \ + req->length += n +#endif + +#ifdef __cplusplus +extern "C" { +#endif +extern void XtFree(char*); +#ifdef __cplusplus +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/include/GL/wmesa.h xpsb-glx-0.19/mesa/include/GL/wmesa.h --- xpsb-glx-0.19/mesa/include/GL/wmesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GL/wmesa.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,141 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + + +/* + * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us) + * Updated by Li Wei (liwei@aiar.xjtu.edu.cn) + * + * + *************************************************************** + * WMesa * + * version 2.3 * + * * + * By * + * Li Wei * + * Institute of Artificial Intelligence & Robotics * + * Xi'an Jiaotong University * + * Email: liwei@aiar.xjtu.edu.cn * + * Web page: http://sun.aiar.xjtu.edu.cn * + * * + * July 7th, 1997 * + *************************************************************** + */ + + +#ifndef WMESA_H +#define WMESA_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "GL/gl.h" + +#if defined(_MSV_VER) && !defined(__GNUC__) +# pragma warning (disable:4273) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */ +# if (MESA_WARNQUIET>1) +# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */ +# endif +#endif + +/* + * This is the WMesa context 'handle': + */ +typedef struct wmesa_context *WMesaContext; + + + +/* + * Create a new WMesaContext for rendering into a window. You must + * have already created the window of correct visual type and with an + * appropriate colormap. + * + * Input: + * hDC - Windows device or memory context + * Pal - Palette to use + * rgb_flag - GL_TRUE = RGB mode, + * GL_FALSE = color index mode + * db_flag - GL_TRUE = double-buffered, + * GL_FALSE = single buffered + * alpha_flag - GL_TRUE = create software alpha buffer, + * GL_FALSE = no software alpha buffer + * + * Note: Indexed mode requires double buffering under Windows. + * + * Return: a WMesa_context or NULL if error. + */ +extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal, + GLboolean rgb_flag, + GLboolean db_flag, + GLboolean alpha_flag); + + +/* + * Destroy a rendering context as returned by WMesaCreateContext() + */ +extern void WMesaDestroyContext( WMesaContext ctx ); + + + +/* + * Make the specified context the current one. + */ +extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc ); + + +/* + * Return a handle to the current context. + */ +extern WMesaContext WMesaGetCurrentContext( void ); + + +/* + * Swap the front and back buffers for the current context. No action + * taken if the context is not double buffered. + */ +extern void WMesaSwapBuffers(HDC hdc); + + +/* + * In indexed color mode we need to know when the palette changes. + */ +extern void WMesaPaletteChange(HPALETTE Pal); + +extern void WMesaMove(void); + +void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx); + +#ifdef __cplusplus +} +#endif + + +#endif + diff -Nru xpsb-glx-0.19/mesa/include/GLES/egl.h xpsb-glx-0.19/mesa/include/GLES/egl.h --- xpsb-glx-0.19/mesa/include/GLES/egl.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GLES/egl.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,320 @@ +#ifndef _EGL_H +#define _EGL_H + +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#if 0/*XXX TEMPORARY HACK*/ +#include +#else +#include +#endif +#include + +/* XXX should go in eglext.h */ +#define GL_OES_VERSION_1_0 1 +#define GL_OES_read_format 1 +#define GL_OES_compressed_paletted_texture 1 +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#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 +/* XXX */ + +/* +** Versioning and extensions +*/ +#define EGL_VERSION_1_0 1 +#define EGL_VERSION_1_1 1 + +/* +** Boolean +*/ +#define EGL_FALSE 0 +#define EGL_TRUE 1 + +/* +** Errors +*/ +#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 +/* 0x300F - 0x301F reserved 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 /* Also a config value */ +#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 + +/* +** Config values +*/ +#define EGL_DONT_CARE ((EGLint) -1) + +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */ +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ +#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */ +#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */ +#define EGL_TEXTURE_RGBA 0x305E /* " */ +#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */ + +/* +** Config attribute mask bits +*/ +#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */ +#define EGL_PIXMAP_BIT 0x02 /* " */ +#define EGL_WINDOW_BIT 0x04 /* " */ + +/* +** String names +*/ +#define EGL_VENDOR 0x3053 /* eglQueryString target */ +#define EGL_VERSION 0x3054 /* " */ +#define EGL_EXTENSIONS 0x3055 /* " */ + +/* +** Surface attributes +*/ +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */ +#define EGL_TEXTURE_TARGET 0x3081 /* " */ +#define EGL_MIPMAP_TEXTURE 0x3082 /* " */ +#define EGL_MIPMAP_LEVEL 0x3083 /* " */ + +/* +** BindTexImage / ReleaseTexImage buffer target +*/ +#define EGL_BACK_BUFFER 0x3084 + +/* +** Current surfaces +*/ +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A + +/* +** Engines +*/ +#define EGL_CORE_NATIVE_ENGINE 0x305B + +/* 0x305C-0x3FFFF reserved for future use */ + +/* +** Functions +*/ +#ifdef __cplusplus +extern "C" { +#endif + +GLAPI EGLint APIENTRY eglGetError (void); + +GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display); +GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy); +GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(void); + +GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); + +GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list); +GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); +GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); + +/* EGL 1.1 render-to-texture APIs */ +GLAPI EGLBoolean APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +GLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +GLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); + +/* EGL 1.1 swap control API */ +GLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); + +GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +GLAPI EGLContext APIENTRY eglGetCurrentContext (void); +GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw); +GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void); +GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); + +GLAPI EGLBoolean APIENTRY eglWaitGL (void); +GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine); +GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw); +GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target); + + + +/* 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 + +GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); +GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); +GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); +GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); +GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode); + +#endif /* EGL_MESA_screen_surface */ + + +#ifndef EGL_MESA_copy_context +#define EGL_MESA_copy_context 1 + +GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask); + +#endif /* EGL_MESA_copy_context */ + + +/* XXX this is preliminary! */ +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 + +typedef int EGLenum; +typedef int EGLClientBuffer; + +#define EGL_DISPLAY_SCALING 10000 +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_OPENGL_ES_BIT 0x1 +#define EGL_OPENVG_BIT 0x2 + +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 + +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 + +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_COLORSPACE 0x3087 +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_COLORSPACE_sRGB 0x3089 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_CLIENT_APIS 0x308D +#define EGL_RGB_BUFFER 0x308E +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 + +GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api); +GLAPI EGLenum APIENTRY eglQueryAPI(void); +GLAPI EGLBoolean APIENTRY eglWaitClient(void); +GLAPI EGLBoolean APIENTRY eglReleaseThread(void); +GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); + +#endif /* EGL_VERSION_1_2 */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _EGL_H */ diff -Nru xpsb-glx-0.19/mesa/include/GLES/egltypes.h xpsb-glx-0.19/mesa/include/GLES/egltypes.h --- xpsb-glx-0.19/mesa/include/GLES/egltypes.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/include/GLES/egltypes.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,45 @@ +/* +** egltypes.h for Mesa +** +** ONLY egl.h SHOULD INCLUDE THIS FILE! +** +** See comments about egltypes.h in the standard egl.h file. +*/ + + +#include + + +/* +** These opaque EGL types are implemented as unsigned 32-bit integers: +*/ +typedef uint32_t EGLDisplay; +typedef uint32_t EGLConfig; +typedef uint32_t EGLSurface; +typedef uint32_t EGLContext; + +/* EGL_MESA_screen_surface */ +typedef uint32_t EGLModeMESA; +typedef uint32_t EGLScreenMESA; + + +/* +** Other basic EGL types: +*/ +typedef uint8_t EGLBoolean; +typedef int32_t EGLint; + +typedef void * NativeDisplayType; +typedef int NativePixmapType; +typedef int NativeWindowType; + +/* +** EGL and native handle null values: +*/ +#define EGL_DEFAULT_DISPLAY ((NativeDisplayType) 0) +#define EGL_NO_CONTEXT ((EGLContext) 0) +#define EGL_NO_DISPLAY ((EGLDisplay) 0) +#define EGL_NO_SURFACE ((EGLSurface) 0) + +/* EGL_MESA_screen_surface */ +#define EGL_NO_MODE_MESA ((EGLModeMESA) 0) diff -Nru xpsb-glx-0.19/mesa/M32UYF~X xpsb-glx-0.19/mesa/M32UYF~X --- xpsb-glx-0.19/mesa/M32UYF~X 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/M32UYF~X 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,23 @@ +# Makefile for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + + +#vms +.ifdef SHARE +GL_SHAR = libMesaGL.exe +GLU_SHAR = libMesaGLU.exe +GLUT_SHAR = libglut.exe +.endif +GL_LIB = libMesaGL.olb +GLU_LIB = libMesaGLU.olb +GLUT_LIB = libglut.olb +CC = cc +CXX = cxx/define=(LIBRARYBUILD=1)/assume=(nostdnew,noglobal_array_new) +CFLAGS1 = +MAKELIB = library/create +RANLIB = true +.ifdef SHARE +XLIBS = [--.vms]xlib_share/opt +.else +XLIBS = [--.vms]xlib/opt +.endif diff -Nru xpsb-glx-0.19/mesa/Makefile xpsb-glx-0.19/mesa/Makefile --- xpsb-glx-0.19/mesa/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,533 @@ +# Top-level Mesa makefile + +TOP = . + +SUBDIRS = src progs + + +default: $(TOP)/configs/current + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + fi \ + done + + +doxygen: + cd doxygen && $(MAKE) + +clean: + -@touch $(TOP)/configs/current + -@for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) clean) ; \ + fi \ + done + -@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current + + +realclean: clean + -rm -rf lib* + -rm -f $(TOP)/configs/current + -rm -f $(TOP)/configs/autoconf + -rm -rf autom4te.cache + -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \ + -name depend -o -name depend.bak ')' -exec rm -f '{}' ';' + + + +install: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) install) || exit 1 ; \ + fi \ + done + + +# DirectFBGL module installation +linux-directfb-install: + cd src/mesa/drivers/directfb && $(MAKE) install + +.PHONY: default doxygen clean realclean install linux-directfb-install + +# If there's no current configuration file +$(TOP)/configs/current: + @echo + @echo + @echo "Please choose a configuration from the following list:" + @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*" + @echo + @echo "Then type 'make ' (ex: 'make linux-x86')" + @echo + @echo "Or, run './configure' then 'make'" + @echo "See './configure --help' for details" + @echo + @echo "(ignore the following error message)" + @exit 1 + + +# Rules to set/install a specific build configuration +aix \ +aix-64 \ +aix-64-static \ +aix-gcc \ +aix-static \ +autoconf \ +bluegene-osmesa \ +bluegene-xlc-osmesa \ +beos \ +catamount-osmesa-pgi \ +darwin \ +darwin-fat-32bit \ +darwin-fat-all \ +darwin-static \ +darwin-static-x86ppc \ +freebsd \ +freebsd-dri \ +freebsd-dri-amd64 \ +freebsd-dri-x86 \ +hpux10 \ +hpux10-gcc \ +hpux10-static \ +hpux11-32 \ +hpux11-32-static \ +hpux11-32-static-nothreads \ +hpux11-64 \ +hpux11-64-static \ +hpux11-ia64 \ +hpux11-ia64-static \ +hpux9 \ +hpux9-gcc \ +irix6-64 \ +irix6-64-static \ +irix6-n32 \ +irix6-n32-static \ +irix6-o32 \ +irix6-o32-static \ +linux \ +linux-alpha \ +linux-alpha-static \ +linux-debug \ +linux-directfb \ +linux-dri \ +linux-dri-debug \ +linux-dri-x86 \ +linux-dri-x86-64 \ +linux-dri-ppc \ +linux-dri-xcb \ +linux-indirect \ +linux-fbdev \ +linux-glide \ +linux-ia64-icc \ +linux-ia64-icc-static \ +linux-icc \ +linux-icc-static \ +linux-osmesa \ +linux-osmesa16 \ +linux-osmesa16-static \ +linux-osmesa32 \ +linux-ppc \ +linux-ppc-static \ +linux-solo \ +linux-solo-x86 \ +linux-solo-ia64 \ +linux-sparc \ +linux-sparc5 \ +linux-static \ +linux-ultrasparc \ +linux-tcc \ +linux-x86 \ +linux-x86-debug \ +linux-x86-32 \ +linux-x86-64 \ +linux-x86-64-debug \ +linux-x86-64-static \ +linux-x86-glide \ +linux-x86-static \ +netbsd \ +openbsd \ +osf1 \ +osf1-static \ +solaris-x86 \ +solaris-x86-gcc \ +solaris-x86-gcc-static \ +sunos4 \ +sunos4-gcc \ +sunos4-static \ +sunos5 \ +sunos5-gcc \ +sunos5-64-gcc \ +sunos5-smp \ +sunos5-v8 \ +sunos5-v8-static \ +sunos5-v9 \ +sunos5-v9-static \ +sunos5-v9-cc-g++ \ +ultrix-gcc: + @ if test -f configs/current || test -L configs/current ; then \ + echo "Please run 'make realclean' before changing configs" ; \ + exit 1 ; \ + fi + (cd configs && rm -f current && ln -s $@ current) + $(MAKE) default + + +# Rules for making release tarballs + +VERSION=7.4 +DIRECTORY = Mesa-$(VERSION) +LIB_NAME = MesaLib-$(VERSION) +DEMO_NAME = MesaDemos-$(VERSION) +GLUT_NAME = MesaGLUT-$(VERSION) + +MAIN_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/configure \ + $(DIRECTORY)/configure.ac \ + $(DIRECTORY)/acinclude.m4 \ + $(DIRECTORY)/aclocal.m4 \ + $(DIRECTORY)/descrip.mms \ + $(DIRECTORY)/mms-config. \ + $(DIRECTORY)/bin/config.guess \ + $(DIRECTORY)/bin/config.sub \ + $(DIRECTORY)/bin/install-sh \ + $(DIRECTORY)/bin/mklib \ + $(DIRECTORY)/bin/minstall \ + $(DIRECTORY)/bin/version.mk \ + $(DIRECTORY)/configs/[a-z]* \ + $(DIRECTORY)/docs/*.html \ + $(DIRECTORY)/docs/COPYING \ + $(DIRECTORY)/docs/README.* \ + $(DIRECTORY)/docs/RELNOTES* \ + $(DIRECTORY)/docs/*.spec \ + $(DIRECTORY)/include/GL/internal/glcore.h \ + $(DIRECTORY)/include/GL/dmesa.h \ + $(DIRECTORY)/include/GL/ggimesa.h \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/include/GL/glx.h \ + $(DIRECTORY)/include/GL/glxext.h \ + $(DIRECTORY)/include/GL/glx_mangle.h \ + $(DIRECTORY)/include/GL/glfbdev.h \ + $(DIRECTORY)/include/GL/mesa_wgl.h \ + $(DIRECTORY)/include/GL/mglmesa.h \ + $(DIRECTORY)/include/GL/osmesa.h \ + $(DIRECTORY)/include/GL/svgamesa.h \ + $(DIRECTORY)/include/GL/vms_x_fix.h \ + $(DIRECTORY)/include/GL/wmesa.h \ + $(DIRECTORY)/src/Makefile \ + $(DIRECTORY)/src/descrip.mms \ + $(DIRECTORY)/src/mesa/Makefile* \ + $(DIRECTORY)/src/mesa/sources \ + $(DIRECTORY)/src/mesa/descrip.mms \ + $(DIRECTORY)/src/mesa/gl.pc.in \ + $(DIRECTORY)/src/mesa/osmesa.pc.in \ + $(DIRECTORY)/src/mesa/depend \ + $(DIRECTORY)/src/mesa/main/*.[chS] \ + $(DIRECTORY)/src/mesa/main/descrip.mms \ + $(DIRECTORY)/src/mesa/glapi/*.[chS] \ + $(DIRECTORY)/src/mesa/glapi/descrip.mms \ + $(DIRECTORY)/src/mesa/math/*.[ch] \ + $(DIRECTORY)/src/mesa/math/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/*.[ch] \ + $(DIRECTORY)/src/mesa/shader/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \ + $(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/slang/*.[ch] \ + $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ + $(DIRECTORY)/src/mesa/shader/slang/library/*.gc \ + $(DIRECTORY)/src/mesa/shader/slang/library/*.syn \ + $(DIRECTORY)/src/mesa/shader/slang/library/Makefile \ + $(DIRECTORY)/src/mesa/swrast/*.[ch] \ + $(DIRECTORY)/src/mesa/swrast/descrip.mms \ + $(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \ + $(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \ + $(DIRECTORY)/src/mesa/vbo/*.[chS] \ + $(DIRECTORY)/src/mesa/vbo/descrip.mms \ + $(DIRECTORY)/src/mesa/tnl/*.[chS] \ + $(DIRECTORY)/src/mesa/tnl/descrip.mms \ + $(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \ + $(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \ + $(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \ + $(DIRECTORY)/src/mesa/drivers/Makefile \ + $(DIRECTORY)/src/mesa/drivers/beos/*.cpp \ + $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ + $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ + $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ + $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \ + $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ + $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \ + $(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \ + $(DIRECTORY)/src/mesa/drivers/ggi/default/genkgi.conf.in \ + $(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \ + $(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \ + $(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \ + $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \ + $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \ + $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \ + $(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ + $(DIRECTORY)/src/mesa/drivers/x11/Makefile \ + $(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/glslcompiler/Makefile \ + $(DIRECTORY)/src/mesa/drivers/glslcompiler/glslcompiler.c \ + $(DIRECTORY)/src/mesa/ppc/*.[ch] \ + $(DIRECTORY)/src/mesa/sparc/*.[chS] \ + $(DIRECTORY)/src/mesa/x86/Makefile \ + $(DIRECTORY)/src/mesa/x86/*.[ch] \ + $(DIRECTORY)/src/mesa/x86/*.S \ + $(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \ + $(DIRECTORY)/src/mesa/x86-64/*.[chS] \ + $(DIRECTORY)/src/mesa/x86-64/Makefile \ + $(DIRECTORY)/progs/Makefile \ + $(DIRECTORY)/progs/util/README \ + $(DIRECTORY)/progs/util/*.[ch] \ + $(DIRECTORY)/progs/util/sampleMakefile \ + $(DIRECTORY)/vms/analyze_map.com \ + $(DIRECTORY)/vms/xlib.opt \ + $(DIRECTORY)/vms/xlib_share.opt \ + $(DIRECTORY)/windows/VC8/ + + +DRI_FILES = \ + $(DIRECTORY)/include/GL/internal/dri_interface.h \ + $(DIRECTORY)/include/GL/internal/glcore.h \ + $(DIRECTORY)/include/GL/internal/sarea.h \ + $(DIRECTORY)/src/glx/Makefile \ + $(DIRECTORY)/src/glx/x11/Makefile \ + $(DIRECTORY)/src/glx/x11/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/dri/Makefile \ + $(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \ + $(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \ + $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \ + $(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \ + $(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \ + $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \ + $(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch] + +SGI_GLU_FILES = \ + $(DIRECTORY)/src/glu/Makefile \ + $(DIRECTORY)/src/glu/descrip.mms \ + $(DIRECTORY)/src/glu/glu.pc.in \ + $(DIRECTORY)/src/glu/sgi/Makefile \ + $(DIRECTORY)/src/glu/sgi/Makefile.mgw \ + $(DIRECTORY)/src/glu/sgi/Makefile.win \ + $(DIRECTORY)/src/glu/sgi/Makefile.DJ \ + $(DIRECTORY)/src/glu/sgi/glu.def \ + $(DIRECTORY)/src/glu/sgi/dummy.cc \ + $(DIRECTORY)/src/glu/sgi/descrip.mms \ + $(DIRECTORY)/src/glu/sgi/glu.exports \ + $(DIRECTORY)/src/glu/sgi/glu.exports.darwin \ + $(DIRECTORY)/src/glu/sgi/mesaglu.opt \ + $(DIRECTORY)/src/glu/sgi/include/gluos.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \ + $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \ + $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \ + $(DIRECTORY)/src/glu/sgi/libtess/README \ + $(DIRECTORY)/src/glu/sgi/libtess/alg-outline \ + $(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \ + $(DIRECTORY)/src/glu/sgi/libutil/*.[ch] + +MESA_GLU_FILES = \ + $(DIRECTORY)/src/glu/mesa/README[12] \ + $(DIRECTORY)/src/glu/mesa/Makefile* \ + $(DIRECTORY)/src/glu/mesa/descrip.mms \ + $(DIRECTORY)/src/glu/mesa/mms_depend \ + $(DIRECTORY)/src/glu/mesa/*.def \ + $(DIRECTORY)/src/glu/mesa/depend \ + $(DIRECTORY)/src/glu/mesa/*.[ch] + +GLW_FILES = \ + $(DIRECTORY)/src/glw/*.[ch] \ + $(DIRECTORY)/src/glw/Makefile* \ + $(DIRECTORY)/src/glw/README \ + $(DIRECTORY)/src/glw/glw.pc.in \ + $(DIRECTORY)/src/glw/depend + +DEMO_FILES = \ + $(DIRECTORY)/progs/beos/*.cpp \ + $(DIRECTORY)/progs/beos/Makefile \ + $(DIRECTORY)/progs/images/*.rgb \ + $(DIRECTORY)/progs/images/*.rgba \ + $(DIRECTORY)/progs/demos/Makefile* \ + $(DIRECTORY)/progs/demos/descrip.mms \ + $(DIRECTORY)/progs/demos/*.[ch] \ + $(DIRECTORY)/progs/demos/*.cxx \ + $(DIRECTORY)/progs/demos/*.dat \ + $(DIRECTORY)/progs/demos/README \ + $(DIRECTORY)/progs/fbdev/Makefile \ + $(DIRECTORY)/progs/fbdev/glfbdevtest.c \ + $(DIRECTORY)/progs/osdemos/Makefile \ + $(DIRECTORY)/progs/osdemos/*.c \ + $(DIRECTORY)/progs/xdemos/Makefile* \ + $(DIRECTORY)/progs/xdemos/descrip.mms \ + $(DIRECTORY)/progs/xdemos/*.[chf] \ + $(DIRECTORY)/progs/redbook/Makefile* \ + $(DIRECTORY)/progs/redbook/README \ + $(DIRECTORY)/progs/redbook/*.[ch] \ + $(DIRECTORY)/progs/samples/Makefile* \ + $(DIRECTORY)/progs/samples/README \ + $(DIRECTORY)/progs/samples/*.c \ + $(DIRECTORY)/progs/glsl/Makefile* \ + $(DIRECTORY)/progs/glsl/*.c \ + $(DIRECTORY)/progs/glsl/*.frag \ + $(DIRECTORY)/progs/glsl/*.vert \ + $(DIRECTORY)/progs/windml/Makefile.ugl \ + $(DIRECTORY)/progs/windml/*.c \ + $(DIRECTORY)/progs/windml/*.bmp \ + $(DIRECTORY)/progs/ggi/*.c \ + $(DIRECTORY)/windows/VC6/progs/demos/*.dsp \ + $(DIRECTORY)/windows/VC6/progs/progs.dsw \ + $(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \ + $(DIRECTORY)/windows/VC7/progs/progs.sln + +GLUT_FILES = \ + $(DIRECTORY)/include/GL/glut.h \ + $(DIRECTORY)/include/GL/glutf90.h \ + $(DIRECTORY)/src/glut/glx/Makefile* \ + $(DIRECTORY)/src/glut/glx/depend \ + $(DIRECTORY)/src/glut/glx/glut.pc.in \ + $(DIRECTORY)/src/glut/glx/*def \ + $(DIRECTORY)/src/glut/glx/descrip.mms \ + $(DIRECTORY)/src/glut/glx/mms_depend \ + $(DIRECTORY)/src/glut/glx/*.[ch] \ + $(DIRECTORY)/src/glut/beos/*.[ch] \ + $(DIRECTORY)/src/glut/beos/*.cpp \ + $(DIRECTORY)/src/glut/beos/Makefile \ + $(DIRECTORY)/src/glut/dos/*.[ch] \ + $(DIRECTORY)/src/glut/dos/Makefile.DJ \ + $(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \ + $(DIRECTORY)/src/glut/ggi/*.[ch] \ + $(DIRECTORY)/src/glut/ggi/Makefile \ + $(DIRECTORY)/src/glut/fbdev/Makefile \ + $(DIRECTORY)/src/glut/fbdev/*[ch] \ + $(DIRECTORY)/src/glut/mini/*[ch] \ + $(DIRECTORY)/src/glut/mini/glut.pc.in \ + $(DIRECTORY)/src/glut/directfb/Makefile \ + $(DIRECTORY)/src/glut/directfb/NOTES \ + $(DIRECTORY)/src/glut/directfb/*[ch] \ + $(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \ + $(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj + +DEPEND_FILES = \ + $(TOP)/src/mesa/depend \ + $(TOP)/src/glx/x11/depend \ + $(TOP)/src/glw/depend \ + $(TOP)/src/glut/glx/depend \ + $(TOP)/src/glu/sgi/depend + + +LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES) + + +# Everything for new a Mesa release: +tarballs: rm_depend configure aclocal.m4 lib_gz demo_gz glut_gz \ + lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5 + + +# Helper for autoconf builds +ACLOCAL = aclocal +ACLOCAL_FLAGS = +AUTOCONF = autoconf +AC_FLAGS = +aclocal.m4: configure.ac acinclude.m4 + $(ACLOCAL) $(ACLOCAL_FLAGS) +configure: configure.ac aclocal.m4 acinclude.m4 + $(AUTOCONF) $(AC_FLAGS) + +rm_depend: + @for dep in $(DEPEND_FILES) ; do \ + rm -f $$dep ; \ + touch $$dep ; \ + done + +lib_gz: + rm -f configs/current ; \ + rm -f configs/autoconf ; \ + cd .. ; \ + tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \ + gzip $(LIB_NAME).tar ; \ + mv $(LIB_NAME).tar.gz $(DIRECTORY) + +demo_gz: + cd .. ; \ + tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \ + gzip $(DEMO_NAME).tar ; \ + mv $(DEMO_NAME).tar.gz $(DIRECTORY) + +glut_gz: + cd .. ; \ + tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \ + gzip $(GLUT_NAME).tar ; \ + mv $(GLUT_NAME).tar.gz $(DIRECTORY) + +lib_bz2: + rm -f configs/current ; \ + rm -f configs/autoconf ; \ + cd .. ; \ + tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \ + bzip2 $(LIB_NAME).tar ; \ + mv $(LIB_NAME).tar.bz2 $(DIRECTORY) + +demo_bz2: + cd .. ; \ + tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \ + bzip2 $(DEMO_NAME).tar ; \ + mv $(DEMO_NAME).tar.bz2 $(DIRECTORY) + +glut_bz2: + cd .. ; \ + tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \ + bzip2 $(GLUT_NAME).tar ; \ + mv $(GLUT_NAME).tar.bz2 $(DIRECTORY) + +lib_zip: + rm -f configs/current ; \ + rm -f configs/autoconf ; \ + rm -f $(LIB_NAME).zip ; \ + cd .. ; \ + zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \ + mv $(LIB_NAME).zip $(DIRECTORY) + +demo_zip: + rm -f $(DEMO_NAME).zip ; \ + cd .. ; \ + zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \ + mv $(DEMO_NAME).zip $(DIRECTORY) + +glut_zip: + rm -f $(GLUT_NAME).zip ; \ + cd .. ; \ + zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \ + mv $(GLUT_NAME).zip $(DIRECTORY) + +md5: + @-md5sum $(LIB_NAME).tar.gz + @-md5sum $(LIB_NAME).tar.bz2 + @-md5sum $(LIB_NAME).zip + @-md5sum $(DEMO_NAME).tar.gz + @-md5sum $(DEMO_NAME).tar.bz2 + @-md5sum $(DEMO_NAME).zip + @-md5sum $(GLUT_NAME).tar.gz + @-md5sum $(GLUT_NAME).tar.bz2 + @-md5sum $(GLUT_NAME).zip + +.PHONY: tarballs rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 \ + glut_bz2 lib_zip demo_zip glut_zip md5 diff -Nru xpsb-glx-0.19/mesa/Makefile.DJ xpsb-glx-0.19/mesa/Makefile.DJ --- xpsb-glx-0.19/mesa/Makefile.DJ 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/Makefile.DJ 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,88 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 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. + +# DOS/DJGPP makefile for Mesa +# +# Author: Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. +# default = no +# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). +# default = no +# +# Targets: +# all: build everything +# libgl: build GL +# libglu: build GLU +# libglut: build GLUT +# clean: remove object files +# realclean: remove all generated files +# + + + +.PHONY : all libgl libglu libglut clean realclean + +CFLAGS = -Wall -W -pedantic +CFLAGS += -O2 -ffast-math + +export CFLAGS + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +all: libgl libglu libglut + +libgl: lib + $(MAKE) -f Makefile.DJ -C src/mesa +libglu: lib + $(MAKE) -f Makefile.DJ -C src/glu/sgi +libglut: lib + $(MAKE) -f Makefile.DJ -C src/glut/dos + +lib: + mkdir lib + +clean: + $(MAKE) -f Makefile.DJ clean -C src/mesa + $(MAKE) -f Makefile.DJ clean -C src/glu/mesa + $(MAKE) -f Makefile.DJ clean -C src/glu/sgi + $(MAKE) -f Makefile.DJ clean -C src/glut/dos + +realclean: clean + -$(call UNLINK,lib/*.a) + -$(call UNLINK,lib/*.dxe) diff -Nru xpsb-glx-0.19/mesa/Makefile.mgw xpsb-glx-0.19/mesa/Makefile.mgw --- xpsb-glx-0.19/mesa/Makefile.mgw 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/Makefile.mgw 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,110 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 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. + +# MinGW makefile v1.2 for Mesa +# +# Copyright (C) 2002 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most WMesa code and requires fxMesa. +# As a consequence, you'll need the Win32 Glide3 +# library to build any application. +# default = no +# ICD=1 build the installable client driver interface +# (windows opengl driver interface) +# default = no +# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). +# default = no +# +# Targets: +# all: build everything +# libgl: build GL +# clean: remove object files +# realclean: remove all generated files +# + +# MinGW core makefile updated for Mesa 7.0 +# +# Updated : by Heromyth, on 2007-7-21 +# Email : zxpmyth@yahoo.com.cn +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# The others havn't been tested yet. +# 2) The generated DLLs are *not* compatible with the ones built +# with the other compilers like VC8, especially for GLUT. +# 3) MAlthough more tests are needed, it can be used individually! + + +.PHONY : all libgl clean realclean + +ifeq ($(ICD),1) + # when -std=c99 mingw will not define WIN32 + CFLAGS = -Wall -Werror +else + # I love c89 + CFLAGS = -Wall -pedantic +endif +CFLAGS += -O2 -ffast-math + +export CFLAGS + + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +all: libgl libglu libglut example + +libgl: lib + $(MAKE) -f Makefile.mgw -C src/mesa + +libglu: libgl + $(MAKE) -f Makefile.mgw -C src/glu/sgi + +libglut: libglu + $(MAKE) -f Makefile.mgw -C src/glut/glx + +example: libglut + $(MAKE) -f Makefile.mgw star -C progs/samples + copy progs\samples\star.exe lib + +lib: + mkdir lib + +clean: + $(MAKE) -f Makefile.mgw clean -C src/mesa + $(MAKE) -f Makefile.mgw clean -C src/glu/sgi + $(MAKE) -f Makefile.mgw clean -C src/glut/glx + +realclean: clean + -$(call UNLINK,lib/*.a) + -$(call UNLINK,lib/*.dll) diff -Nru xpsb-glx-0.19/mesa/src/descrip.mms xpsb-glx-0.19/mesa/src/descrip.mms --- xpsb-glx-0.19/mesa/src/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/descrip.mms 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,43 @@ +# Makefile for Mesa for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +.include [-]mms-config. + +all : + set default [.mesa] + $(MMS)$(MMSQUALIFIERS) + set default [-] +.ifdef SHARE + $(MMS)$(MMSQUALIFIERS) [-.lib]$(GL_SHAR) +.endif + set default [.glu] + $(MMS)$(MMSQUALIFIERS) + set default [-.glut.glx] + $(MMS)$(MMSQUALIFIERS) + set default [--] + +[-.lib]$(GL_SHAR) : [-.lib]$(GL_LIB) + @ WRITE_ SYS$OUTPUT " generating libmesa.opt" + @ library/extract=* [-.lib]$(GL_LIB) + @ OPEN_/WRITE FILE libmesa.opt + @ WRITE_ FILE "!" + @ WRITE_ FILE "! libmesa.opt generated by DESCRIP.$(MMS_EXT)" + @ WRITE_ FILE "!" + @ WRITE_ FILE "IDENTIFICATION=""mesa5.1""" + @ WRITE_ FILE "GSMATCH=LEQUAL,5,1 + @ WRITE_ FILE "libmesagl.obj" + @ write_ file "sys$share:decw$xextlibshr/share" + @ write_ file "sys$share:decw$xlibshr/share" + @ write_ file "sys$share:pthread$rtl/share" + @ CLOSE_ FILE + @ $(MMS)$(MMSQUALIFIERS)/ignore=warning mesa_vms + @ WRITE_ SYS$OUTPUT " linking ..." + @ LINK_/NODEB/SHARE=[-.lib]$(GL_SHAR)/MAP=libmesa.map/FULL libmesa.opt/opt,\ + mesa_vms.opt/opt + @ delete libmesagl.obj;* + +mesa_vms : + @ WRITE_ SYS$OUTPUT " generating libmesa.map ..." + @ LINK_/NODEB/NOSHARE/NOEXE/MAP=libmesa.map/FULL libmesa.opt/OPT + @ WRITE_ SYS$OUTPUT " analyzing libmesa.map ..." + @ @[-.vms]analyze_map.com libmesa.map mesa_vms.opt diff -Nru xpsb-glx-0.19/mesa/src/egl/docs/EGL_MESA_screen_surface xpsb-glx-0.19/mesa/src/egl/docs/EGL_MESA_screen_surface --- xpsb-glx-0.19/mesa/src/egl/docs/EGL_MESA_screen_surface 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/docs/EGL_MESA_screen_surface 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,564 @@ +Name + + MESA_screen_surface + +Name Strings + + EGL_MESA_screen_surface + +Contact + + Brian Paul + + To discuss, join the dri-egl@lists.freedesktop.org list. + +Status + + Preliminary - totally subject to change. + +Version + + 11 (27 January 2006) + +Number + + TBD + +Dependencies + + EGL 1.0 or later. + +Overview + + EGL 1.1 supports three types of drawing surfaces: + * Window surfaces + * Pixmap surfaces + * Pbuffer surfaces + This extension defines a fourth type of drawing surface: + * Screen surface + + A screen surface is a surface for which the (front) color buffer can + be directly displayed (i.e. scanned out) on a monitor (such as a flat + panel or CRT). In particular the color buffer memory will be allocated + at a location in VRAM (and in a suitable format) which can be displayed + by the graphics hardware. + + Note that the width and height of the screen surface need not exactly + match the monitor's current resolution. For example, while the monitor + may be configured to to show 1024x768 pixels, the associated screen + surface may be larger, such as 1200x1000. The "screen origin" attribute + will specify which region of the screen surface which is visible on the + monitor. The screen surface can be scrolled by changing this origin. + + This extension also defines functions for controlling the monitor's + display mode (width, height, refresh rate, etc), and specifing which + screen surface is to be displayed on a monitor. + + The new EGLModeMESA type and related functions are very similar to the + EGLConfig type and related functions. The user may get a list of + supported modes for a screen and specify the mode to be used when + displaying a screen surface. + + +Issues + + 1. Should EGL_INTERLACE be a supported mode attribute? + + Arguments against: + + No, this should be provided by another extension which would + also provide the mechanisms needed to play back interlaced video + material correctly on hardware that supports it. + This extension should prefer non-interlaced modes. [M. Danzer] + + Arguments for: + + An interlaced display can be of use without considering video + material. Being able to query whether a screen is operating in + interlaced mode can be used by applications to control their + drawing. For example: avoid drawing 1-pixel-wide horizontal lines + if screen is interlaced. [B. Paul] + + Resolution: Defer for future extension? + + + 2. Should EGL_REFRESH_RATE be a supported mode attribute? + + Arguments for: + + Yes, it's been shown that applications and/or users need to select + modes by this. [M. Danzer] + + Many examples have been given in which it's desirable to let the + user choose from a variety of refresh rates without having to + restart/reconfigure. [B. Paul] + + Arguments against: + + TBD. + + Resolution: Yes. + + + 3. Exactly how should the list of modes returned by eglChooseConfigMESA + be sorted? + + Current method is described in the text below. Subject to change. + + Alternately, leave the sorting order undefined so that each + implementation can return the modes in order of "most desirable" + to "least desirable" which may depend on the display technology + (CRT vs LCD, etc) or other factors. + + + 4. How should screen blanking be supported? Note that a screen can be + disabled or turned off by calling eglShowSurface(dpy, scrn, + EGL_NO_SURFACE, EGL_NO_MODE_MESA). But what about power-save mode? + + I would defer this to other extensions that depend on this one. + I can imagine people wanting different semantics not just in + relation to the power management API being exposed (DPMS or whatever) + but also relating to what events can trigger EGL_CONTEXT_LOST. Also + I'm not sure whether power management commands are properly operations + on the Display or on a screen surface. [A. Jackson] + + + 5. Should the EGL_PHYSICAL_SIZE_EGL query be kept? The size information + isn't always reliable (consider video projectors) but can still be + used to determine the pixel aspect ratio. + + Resolution: Omit. The EGL 1.2 specification includes queries for + the display resolution and pixel aspect ratio. + + + 6. Should detailed mode timing information be exposed by this API? + + Probably not. Instead, offer that information in a layered extension. + + + 7. How should the notion of a screen's "native" mode be expressed? + For example, LCD panels have a native resolution and refresh rate + that looks best but other sub-optimal resolutions may be supported. + + The mode attribute EGL_OPTIMAL_MESA will be set for modes which + best match the screen. [M. Danzer] + + + 8. Should eglQueryModeStringMESA() be included? This function returns + a human-readable string which corresponds to an EGLMode. + + Arguments for: + + A mode name such as "HDTV-720P" might mean more to users than + "1280x720@60Hz" if the later were generated via code. + + Arguments against: + + There's no standard syntax for the strings. May cause more + trouble than it's worth. + + Postpone for future extension. [A. Jackson] + + Latest discussion leaning toward omitting this function. + + + 9. Should we use "Get" or "Query" for functions which return state? + The EGL 1.x specification doesn't seem to be totally consistent + in this regard, but "Query" is used more often. + + Use "Get" for mode-related queries (as for EGLConfigs) but "Query" + for everything else. + + + 10. What should be the default size for screen surfaces? + + For Pbuffer surfaces the default width and height are zero. + We'll do the same for screen surfaces. Since there's no function + to resize surfaces it's useless to have a 0x0 screen, but this isn't + a situation that'll normally be encountered. + + + 11. Should there be a function for resizing a screen surface? + + Suppose one wants to change the screen's size in the EGL application. + Also suppose there's a hardware restriction such that only one screen + surface can exist at a time (either for lack of memory or because of + memory layout restrictions). + + The basic idea is that the currently displayed screen surface must + be deallocated before a new one can be created. Perhaps a resize + function would work better? + + + 12. How should sub-pixel LCD color information be made available? + What about the display's gamma value? + + Perhaps expose as additional read-only mode attributes. + + Perhaps postpone for a layered extension. + + + 13. What happens if the user attempts to delete a screen surface that + is currently being shown? + + Spec currently says that's illegal and that an error (TBD) will be + generated. + + + 14. What if the physical screen size can't be determined? Should + a query of EGL_PHYSICAL_SIZE_MESA return [0,0]? + + Obsolete: EGL_PHYSICAL_SIZE_MESA not used. + + + 15. Suppose the device's number of RAMDACs is different from the + number of output ports. For example, a graphics card with + two RAMDACs but three ports (VGA, DVI, TV). + + Address this in a follow-on extension. [Matthias Hopf] + + + 16. How should we deal with on-the-fly device changes? For example, + the monitor being unplugged and replaced by another with different + characteristics? + + A HAL event could be received via DBUS in the application [J. Smirl, + A. Jackson]. + + Should there be an EGL mechanism for detecting this? Maybe an + EGL_SCREEN_LOST error (similar to EGL_CONTEXT_LOST) can be recorded + when there's a screen change. At least then the application can + poll to detect this situation. + + Maybe leave that to a future extension. + + See also the EGL_SCREEN_COUNT_MESA query. + + + 17. What if pixel-accurate panning is not supported (see + eglScreenPositionMESA)? [M. Danzer] + + Is this a common problem? Can we ignore it for now? + + + 18. Should eglShowSurfaceMESA be renamed to eglShowScreenSurfaceMESA? + + Probably. + + + +New Procedures and Functions + + EGLBoolean eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + const EGLint *attrib_list, + EGLModeMESA *modes, EGLint modes_size, + EGLint *num_modes) + + EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *modes, EGLint modes_size, + EGLint *num_modes) + + EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, + EGLint attrib, EGLint *value) + + + EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, + EGLint screens_size, EGLint *num_screens) + + EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) + + EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface surface, EGLModeMESA mode) + + EGLBoolean eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint x, EGLint y) + + + EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint attrib, EGLint *value); + + EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface *surface) + + EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *mode) + + const char *eglQueryModeStringMESA(EGLDisplay dpy, EGLMode mode); + + +New Types + + EGLModeMESA + EGLScreenMESA + +New Tokens + + New error codes: + + EGL_BAD_SCREEN_MESA + EGL_BAD_MODE_MESA + + Screen-related tokens: + + EGL_SCREEN_COUNT_MESA + EGL_SCREEN_POSITION_MESA + EGL_SCREEN_BIT_MESA + EGL_SCREEN_POSITION_GRANULARITY_MESA + + Mode-related tokens: + + EGL_MODE_ID_MESA + EGL_REFRESH_RATE_MESA + EGL_INTERLACED_MESA + EGL_OPTIMAL_MESA + EGL_NO_MODE_MESA + + +Additions to Chapter X of the EGL 1.1 Specification + + [XXX this all has to be rewritten to fit into the EGL specification + and match the conventions of an EGL extension. For now, just list + all the functions with brief descriptions.] + + + EGLBoolean eglChooseModeMESA(EGLDisplay dpy, const EGLScreenMESA screen, + EGLint *attrib_list, EGLModeMESA *modes, + EGLint modes_size, EGLint *num_modes) + + Like eglChooseConfig, returns a list of EGLModes which match the given + attribute list. This does not set the screen's current display mode. + The attribute list is a list of token/value pairs terminated with + EGL_NONE. Supported attributes include: + + Name Description + --------------------- --------------------------------------------- + EGL_WIDTH Mode width (resolution) + EGL_HEIGHT Mode height (resolution) + EGL_REFRESH_RATE_MESA The mode's refresh rate, multiplied by 1000 + EGL_INTERLACED_MESA 1 indicates an interlaced mode, 0 otherwise + EGL_OPTIMAL_MESA Set if the most is especially optimal for the + screen (ex. for particular LCD resolutions) + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + + The list of modes returned by eglChooseModeMESA will be sorted + according to the following criteria. See the discussion of table 3.3 + in the EGL specification for more information. + + Selection Sort Sort + Attribute Default Criteria Order Priority + -------------------- -------------- ----------- ------ -------- + EGL_OPTIMAL_MESA EGL_DONT_CARE Exact 1,0 1 + EGL_INTERLACED_MESA EGL_DONT_CARE Exact 0,1 2 + EGL_REFRESH_RATE EGL_DONT_CARE AtLeast Larger 3 + EGL_WIDTH EGL_DONT_CARE AtLeast Larger 4 + EGL_HEIGHT EGL_DONT_CARE AtLeast Larger 5 + EGL_MODE_ID_MESA EGL_DONT_CARE Exact Smaller 6 + + + EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *modes, EGLint modes_size, + EGLint *num_modes) + + Like eglGetConfigs, returns a list of all modes supported by the + given screen. The returned modes will be sorted in the same manner + as for eglChooseModeMESA(). + + + + EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, + EGLint attrib, EGLint *value) + + Used to query mode attributes. The following attributes are supported: + + Name Return value description + --------------------- ---------------------------------------------- + EGL_OPTIMAL_MESA 1 indicates an optimal mode, 0 otherwise + EGL_INTERLACED_MESA 1 indicates an interlaced mode, 0 otherwise + EGL_REFRESH_RATE_MESA The mode's refresh rate, multiplied by 1000 + EGL_WIDTH Mode width (resolution) + EGL_HEIGHT Mode height (resolution) + EGL_MODE_ID_MESA A unique small integer identifier for the mode + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + + + + EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, + EGLint screens_size, EGLint *num_screens) + + This function returns an array of all available screen handles. + is the maximum number of screens to return in the + array. will return the number of screen handles + placed in the array, even if is NULL. + + The number of screens and the availability of each may change over + time (hot-plugging). Screen handles will not be reused. When a + screen handle becomes invalid, function calls which reference an + invalid handle will generate EGL_BAD_SCREEN_MESA. + + The first screen handle returned will be considered to be the primary + one. + + + + EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) + + Create a surface that can be displayed on a screen. is + an array of token/value pairs terminated with EGL_NONE. Valid tokens + include: + + Name Description + ---------------- -------------------------------- + EGL_WIDTH desired surface width in pixels + EGL_HEIGHT desired surface height in pixels + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + The default width and height are zero. + + + + EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface surface, EGLModeMESA mode) + + This function causes a screen to show the given surface (or more + precisely, the surface's front color buffer) with the given mode. + + If the surface is in any way incompatible with the mode, the error + EGL_BAD_MATCH will be generated, EGL_FALSE will be returned, and the + previous screen state will remain in effect. This might occur when + the bandwidth of the video-out subsystem is exceeded, or if the mode + specifies a width or height that's greater than the width or height + of the surface. + + To disable a screen, the values EGL_NO_SURFACE and EGL_NO_MODE_MESA + be passed as the and parameters. + + The values of EGL_SCREEN_POSITION_MESA are clamped to the new valid + range computed from the screen size and surface size. If the new + surface is EGL_NO_SURFACE, EGL_SCREEN_POSITION_MESA is set to [0, 0]. + + + Attempting to delete a screen surface which is currently being + displayed will result in the error EGL_BAD_ACCESS being generated. + + + + EGLBoolean eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint x, EGLint y) + + Specifies the origin of the screen's view into the surface, if the + surface is larger than the screen. Valid values for x and y are + [0, surfaceWidth - screenWidth] and [0, surfaceHeight - screenHeight], + respectively. + + The x and y values are also constrained to be integer multiples of the + EGL_SCREEN_POSITION_GRANULARITY_MESA values. + + + + + EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint attrib, EGLint *value); + + Used to query screen attributes. may be one of the following: + + Name Return value description + ------------------------ --------------------------------------------- + EGL_SCREEN_POSITION_MESA x, y position of the screen's origin with + respect to the surface. If no surface is + attached to the screen, [0, 0] is returned. + EGL_SCREEN_POSITION_GRANULARITY_MESA + Returns the granularity, in pixels, for + which the screen position is constrained. + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + + + + + EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface *surface) + + Returns the surface currently displayed on the given screen. + may be EGL_NO_SURFACE if the screen isn't currently showing any surface. + + + + + EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *mode) + + Returns the given screen's current display mode. The mode may be + EGL_NO_MODE_MESA if the screen is currently disabled. + + + + const char *eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode); + + Returns a human-readable string for the given mode. The string is a + zero-terminated C string which the user should not attempt to free. + There is no standard syntax for mode strings. Applications should + not directly rely on mode strings. + + + +Version History + + 1. 15 March 2005 - BrianP + Initial version + + 2. 16 March 2005 - BrianP + Removed EGL_DEPTH_MESA + Added EGL_PHYSICAL_WIDTH_MESA, EGL_PHYSICAL_HEIGHT_MESA queries + Added EGL_OPTIMAL_MESA for width/height/refresh rate selection + Added possible eglQueryModeStringMESA() function + More details of the new functions explained. + + 3. 18 March 2005 - BrianP + Added screen_number to eglChooseModeMESA(). + Fix off by one mistake in value range for ORIGIN attributes + Added Issues section + + 4. 21 March 2005 - BrianP + Removed eglScreenAttribsMESA(). + Added eglScreenPositionMESA() to set screen origin. + Replaced EGL_SCREEN_X/Y_OFFSET_MESA with EGL_SCREEN_POSITION_MESA. + Replaced EGL_PHYSICAL_WIDTH/HEIGHT_MESA with EGL_PHYSICAL_SIZE_MESA. + Use EGL_OPTIMAL_MESA as a new mode attribute. (Michel Danzer) + Added a few more issues. + + 5. 6 April 2005 - BrianP + More language for eglGetModeStringMESA(). + Added issues 10, 11, 12, 13, 14. + Updated issue 3 discussion about mode sorting. + + 6. 22 April 2005 - BrianP + Fixed "LDC" typo. + Added issues 15, 16. + Changed dependency on EGL 1.1 to EGL 1.0 + s/EGL_NUM_SCREENS_MESA/EGL_SCREEN_COUNT_MESA/ + Added eglQueryDisplayMESA() to New Functions section. + Clarified language for the EGL_SCREEN_COUNT_MESA query. + + 7. 29 April 2005 - BrianP + Added EGLScreenMESA type and eglGetScreensMESA() function. [J. Smirl]. + Replaced EGLint screen_number parameters with EGLScreenMESA screen. + Added issue 17 (pixel-accurate panning) + + 8. 2 May 2005 - BrianP + Removed eglQueryDisplayMESA. + Fixed a few more EGLint -> EGLScreenMESA changes. + + 9. 20 May 2005 - BrianP + Fixed a few typos. + Updated some open issues text. + + 10. 10 August 2005 - BrianP + Added EGL_SCREEN_POSITION_GRANULARITY_MESA. + + 11. 27 January 2006 - BrianP + EGL_PHYSICAL_SIZE_MESA removed since EGL 1.2 has a similar feature. + diff -Nru xpsb-glx-0.19/mesa/src/egl/drivers/demo/demo.c xpsb-glx-0.19/mesa/src/egl/drivers/demo/demo.c --- xpsb-glx-0.19/mesa/src/egl/drivers/demo/demo.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/drivers/demo/demo.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,316 @@ +/* + * Sample driver: Demo + */ + +#include +#include +#include +#include "eglconfig.h" +#include "eglcontext.h" +#include "egldisplay.h" +#include "egldriver.h" +#include "eglglobals.h" +#include "eglmode.h" +#include "eglscreen.h" +#include "eglsurface.h" + + +/** + * Demo driver-specific driver class derived from _EGLDriver + */ +typedef struct demo_driver +{ + _EGLDriver Base; /* base class/object */ + GLuint DemoStuff; +} DemoDriver; + +#define DEMO_DRIVER(D) ((DemoDriver *) (D)) + + +/** + * Demo driver-specific surface class derived from _EGLSurface + */ +typedef struct demo_surface +{ + _EGLSurface Base; /* base class/object */ + GLuint DemoStuff; +} DemoSurface; + + +/** + * Demo driver-specific context class derived from _EGLContext + */ +typedef struct demo_context +{ + _EGLContext Base; /* base class/object */ + GLuint DemoStuff; +} DemoContext; + + + +static EGLBoolean +demoInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor) +{ + _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLScreen *scrn; + EGLint i; + + /* Create a screen */ + scrn = calloc(1, sizeof(*scrn)); + _eglAddScreen(disp, scrn); + + /* Create the screen's modes - silly example */ + _eglAddNewMode(scrn, 1600, 1200, 72 * 1000, "1600x1200-72"); + _eglAddNewMode(scrn, 1280, 1024, 72 * 1000, "1280x1024-70"); + _eglAddNewMode(scrn, 1280, 1024, 70 * 1000, "1280x1024-70"); + _eglAddNewMode(scrn, 1024, 768, 72 * 1000, "1024x768-72"); + + /* Create the display's visual configs - silly example */ + for (i = 0; i < 4; i++) { + _EGLConfig config; + _eglInitConfig(&config, i + 1); + _eglSetConfigAttrib(&config, EGL_RED_SIZE, 8); + _eglSetConfigAttrib(&config, EGL_GREEN_SIZE, 8); + _eglSetConfigAttrib(&config, EGL_BLUE_SIZE, 8); + _eglSetConfigAttrib(&config, EGL_ALPHA_SIZE, 8); + _eglSetConfigAttrib(&config, EGL_BUFFER_SIZE, 32); + if (i & 1) { + _eglSetConfigAttrib(&config, EGL_DEPTH_SIZE, 32); + } + if (i & 2) { + _eglSetConfigAttrib(&config, EGL_STENCIL_SIZE, 8); + } + _eglSetConfigAttrib(&config, EGL_SURFACE_TYPE, + (EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT)); + _eglAddConfig(disp, &config); + } + + drv->Initialized = EGL_TRUE; + + *major = 1; + *minor = 0; + + return EGL_TRUE; +} + + +static EGLBoolean +demoTerminate(_EGLDriver *drv, EGLDisplay dpy) +{ + /*DemoDriver *demo = DEMO_DRIVER(dpy);*/ + free(drv); + return EGL_TRUE; +} + + +static DemoContext * +LookupDemoContext(EGLContext ctx) +{ + _EGLContext *c = _eglLookupContext(ctx); + return (DemoContext *) c; +} + + +static DemoSurface * +LookupDemoSurface(EGLSurface surf) +{ + _EGLSurface *s = _eglLookupSurface(surf); + return (DemoSurface *) s; +} + + + +static EGLContext +demoCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list) +{ + _EGLConfig *conf; + DemoContext *c; + int i; + + conf = _eglLookupConfig(drv, dpy, config); + if (!conf) { + _eglError(EGL_BAD_CONFIG, "eglCreateContext"); + return EGL_NO_CONTEXT; + } + + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + switch (attrib_list[i]) { + /* no attribs defined for now */ + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglCreateContext"); + return EGL_NO_CONTEXT; + } + } + + c = (DemoContext *) calloc(1, sizeof(DemoContext)); + if (!c) + return EGL_NO_CONTEXT; + + _eglInitContext(drv, dpy, &c->Base, config, attrib_list); + c->DemoStuff = 1; + printf("demoCreateContext\n"); + + /* generate handle and insert into hash table */ + _eglSaveContext(&c->Base); + assert(c->Base.Handle); + + return c->Base.Handle; +} + + +static EGLSurface +demoCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list) +{ + int i; + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + switch (attrib_list[i]) { + /* no attribs at this time */ + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglCreateWindowSurface"); + return EGL_NO_SURFACE; + } + } + printf("eglCreateWindowSurface()\n"); + /* XXX unfinished */ + + return EGL_NO_SURFACE; +} + + +static EGLSurface +demoCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list) +{ + _EGLConfig *conf; + EGLint i; + + conf = _eglLookupConfig(drv, dpy, config); + if (!conf) { + _eglError(EGL_BAD_CONFIG, "eglCreatePixmapSurface"); + return EGL_NO_SURFACE; + } + + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + switch (attrib_list[i]) { + /* no attribs at this time */ + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglCreatePixmapSurface"); + return EGL_NO_SURFACE; + } + } + + if (conf->Attrib[EGL_SURFACE_TYPE - FIRST_ATTRIB] == 0) { + _eglError(EGL_BAD_MATCH, "eglCreatePixmapSurface"); + return EGL_NO_SURFACE; + } + + printf("eglCreatePixmapSurface()\n"); + return EGL_NO_SURFACE; +} + + +static EGLSurface +demoCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) +{ + DemoSurface *surf = (DemoSurface *) calloc(1, sizeof(DemoSurface)); + if (!surf) + return EGL_NO_SURFACE; + + if (!_eglInitSurface(drv, dpy, &surf->Base, EGL_PBUFFER_BIT, + config, attrib_list)) { + free(surf); + return EGL_NO_SURFACE; + } + + /* a real driver would allocate the pbuffer memory here */ + + return surf->Base.Handle; +} + + +static EGLBoolean +demoDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface) +{ + DemoSurface *fs = LookupDemoSurface(surface); + _eglRemoveSurface(&fs->Base); + if (fs->Base.IsBound) { + fs->Base.DeletePending = EGL_TRUE; + } + else { + free(fs); + } + return EGL_TRUE; +} + + +static EGLBoolean +demoDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context) +{ + DemoContext *fc = LookupDemoContext(context); + _eglRemoveContext(&fc->Base); + if (fc->Base.IsBound) { + fc->Base.DeletePending = EGL_TRUE; + } + else { + free(fc); + } + return EGL_TRUE; +} + + +static EGLBoolean +demoMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context) +{ + /*DemoDriver *demo = DEMO_DRIVER(dpy);*/ + DemoSurface *readSurf = LookupDemoSurface(read); + DemoSurface *drawSurf = LookupDemoSurface(draw); + DemoContext *ctx = LookupDemoContext(context); + EGLBoolean b; + + b = _eglMakeCurrent(drv, dpy, draw, read, context); + if (!b) + return EGL_FALSE; + + /* XXX this is where we'd do the hardware context switch */ + (void) drawSurf; + (void) readSurf; + (void) ctx; + + printf("eglMakeCurrent()\n"); + return EGL_TRUE; +} + + +/** + * The bootstrap function. Return a new DemoDriver object and + * plug in API functions. + */ +_EGLDriver * +_eglMain(_EGLDisplay *dpy) +{ + DemoDriver *demo; + + demo = (DemoDriver *) calloc(1, sizeof(DemoDriver)); + if (!demo) { + return NULL; + } + + /* First fill in the dispatch table with defaults */ + _eglInitDriverFallbacks(&demo->Base); + /* then plug in our Demo-specific functions */ + demo->Base.API.Initialize = demoInitialize; + demo->Base.API.Terminate = demoTerminate; + demo->Base.API.CreateContext = demoCreateContext; + demo->Base.API.MakeCurrent = demoMakeCurrent; + demo->Base.API.CreateWindowSurface = demoCreateWindowSurface; + demo->Base.API.CreatePixmapSurface = demoCreatePixmapSurface; + demo->Base.API.CreatePbufferSurface = demoCreatePbufferSurface; + demo->Base.API.DestroySurface = demoDestroySurface; + demo->Base.API.DestroyContext = demoDestroyContext; + + /* enable supported extensions */ + demo->Base.Extensions.MESA_screen_surface = EGL_TRUE; + demo->Base.Extensions.MESA_copy_context = EGL_TRUE; + + return &demo->Base; +} diff -Nru xpsb-glx-0.19/mesa/src/egl/drivers/demo/Makefile xpsb-glx-0.19/mesa/src/egl/drivers/demo/Makefile --- xpsb-glx-0.19/mesa/src/egl/drivers/demo/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/drivers/demo/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,32 @@ +# src/egl/drivers/demo/Makefile + +TOP = ../../../.. +include $(TOP)/configs/current + + +INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/egl/main + + +SOURCES = demo.c + +OBJECTS = $(SOURCES:.c=.o) + + +.c.o: + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ + + + +default: $(TOP)/$(LIB_DIR)/demodriver.so + + +$(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS) + $(MKLIB) -o demodriver.so -noprefix -linker '$(CC)' \ + -ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \ + $(OBJECTS) + + + +clean: + -rm -f *.o + -rm -f *.so diff -Nru xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.c xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.c --- xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1138 @@ +/** + * Generic EGL driver for DRI. + * + * This file contains all the code needed to interface DRI-based drivers + * with libEGL. + * + * There's a lot of dependencies on fbdev and the /sys/ filesystem. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "egldriver.h" +#include "egldisplay.h" +#include "eglcontext.h" +#include "eglconfig.h" +#include "eglsurface.h" +#include "eglscreen.h" +#include "eglglobals.h" +#include "egllog.h" +#include "eglmode.h" + +#include "egldri.h" + +const char *sysfs = "/sys/class"; +#define None 0 +static const int empty_attribute_list[1] = { None }; + + +/** + * The bootstrap function. + * Return a new driDriver object and plug in API functions. + * This function, in turn, loads a specific DRI driver (ex: r200_dri.so). + */ +_EGLDriver * +_eglMain(_EGLDisplay *dpy) +{ + int length; + char path[NAME_MAX]; + struct dirent *dirent; +#if 1 + FILE *file; +#endif + DIR *dir; + _EGLDriver *driver = NULL;; + + snprintf(path, sizeof(path), "%s/drm", sysfs); + if (!(dir = opendir(path))) { + _eglLog(_EGL_WARNING, "%s DRM devices not found.", path); + return EGL_FALSE; + } + while ((dirent = readdir(dir))) { + + if (strncmp(&dirent->d_name[0], "card", 4) != 0) + continue; + if (strcmp(&dirent->d_name[4], &dpy->Name[1]) != 0) + continue; + + snprintf(path, sizeof(path), "%s/drm/card%s/dri_library_name", sysfs, &dpy->Name[1]); + _eglLog(_EGL_INFO, "Opening %s", path); +#if 1 + file = fopen(path, "r"); + if (!file) { + _eglLog(_EGL_WARNING, "Failed to open %s", path); + return NULL; + } + fgets(path, sizeof(path), file); + fclose(file); +#else + strcpy(path, "r200\n"); +#endif + if ((length = strlen(path)) > 0) + path[length - 1] = '\0'; /* remove the trailing newline from sysfs */ + strncat(path, "_dri", sizeof(path)); + + driver = _eglOpenDriver(dpy, path); + + break; + } + closedir(dir); + + return driver; +} + + +/** + * Called by eglCreateContext via drv->API.CreateContext(). + */ +static EGLContext +_eglDRICreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + EGLContext share_list, const EGLint *attrib_list) +{ + driDisplay *disp = Lookup_driDisplay(dpy); + driContext *c, *share; + void *sharePriv; + _EGLConfig *conf; + __GLcontextModes visMode; + + c = (driContext *) calloc(1, sizeof(*c)); + if (!c) + return EGL_NO_CONTEXT; + + if (!_eglInitContext(drv, dpy, &c->Base, config, attrib_list)) { + free(c); + return EGL_NO_CONTEXT; + } + + if (share_list != EGL_NO_CONTEXT) { + _EGLContext *shareCtx = _eglLookupContext(share_list); + if (!shareCtx) { + _eglError(EGL_BAD_CONTEXT, "eglCreateContext(share_list)"); + return EGL_FALSE; + } + } + share = Lookup_driContext(share_list); + if (share) + sharePriv = share->driContext.private; + else + sharePriv = NULL; + + conf = _eglLookupConfig(drv, dpy, config); + assert(conf); + _eglConfigToContextModesRec(conf, &visMode); + + c->driContext.private = disp->driScreen.createNewContext(disp, &visMode, + GLX_WINDOW_BIT, sharePriv, &c->driContext); + if (!c->driContext.private) { + free(c); + return EGL_FALSE; + } + + /* generate handle and insert into hash table */ + _eglSaveContext(&c->Base); + + return c->Base.Handle; +} + + +static EGLBoolean +_eglDRIMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, + EGLSurface read, EGLContext context) +{ + driDisplay *disp = Lookup_driDisplay(dpy); + driContext *ctx = Lookup_driContext(context); + EGLBoolean b; + + b = _eglMakeCurrent(drv, dpy, draw, read, context); + if (!b) + return EGL_FALSE; + + if (ctx) { + ctx->driContext.bindContext(disp, 0, read, draw, &ctx->driContext); + } + else { + /* what's this??? */ + /* _mesa_make_current( NULL, NULL, NULL );*/ + } + return EGL_TRUE; +} + + +static EGLSurface +_eglDRICreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) +{ + driSurface *surf; + + surf = (driSurface *) calloc(1, sizeof(*surf)); + if (!surf) { + return EGL_NO_SURFACE; + } + + if (!_eglInitSurface(drv, dpy, &surf->Base, EGL_PBUFFER_BIT, + config, attrib_list)) { + free(surf); + return EGL_NO_SURFACE; + } + + /* create software-based pbuffer */ + { +#if 0 + GLcontext *ctx = NULL; /* this _should_ be OK */ +#endif + GLvisual visMode; + _EGLConfig *conf = _eglLookupConfig(drv, dpy, config); + assert(conf); /* bad config should be caught earlier */ + _eglConfigToContextModesRec(conf, &visMode); + +#if 0 + surf->mesa_framebuffer = _mesa_create_framebuffer(&visMode); + _mesa_add_soft_renderbuffers(surf->mesa_framebuffer, + GL_TRUE, /* color bufs */ + visMode.haveDepthBuffer, + visMode.haveStencilBuffer, + visMode.haveAccumBuffer, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */ ); + + /* set pbuffer/framebuffer size */ + _mesa_resize_framebuffer(ctx, surf->mesa_framebuffer, + surf->Base.Width, surf->Base.Height); +#endif + } + + _eglSaveSurface(&surf->Base); + + return surf->Base.Handle; +} + + +static EGLBoolean +_eglDRIDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface) +{ + driDisplay *disp = Lookup_driDisplay(dpy); + driSurface *fs = Lookup_driSurface(surface); + + _eglRemoveSurface(&fs->Base); + + fs->drawable.destroyDrawable(disp, fs->drawable.private); + + if (fs->Base.IsBound) { + fs->Base.DeletePending = EGL_TRUE; + } + else { + free(fs); + } + return EGL_TRUE; +} + + +static EGLBoolean +_eglDRIDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context) +{ + driDisplay *disp = Lookup_driDisplay(dpy); + driContext *fc = Lookup_driContext(context); + + _eglRemoveContext(&fc->Base); + + fc->driContext.destroyContext(disp, 0, fc->driContext.private); + + if (fc->Base.IsBound) { + fc->Base.DeletePending = EGL_TRUE; + } + else { + free(fc); + } + return EGL_TRUE; +} + + +/** + * Create a drawing surface which can be directly displayed on a screen. + */ +static EGLSurface +_eglDRICreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg, + const EGLint *attrib_list) +{ + _EGLConfig *config = _eglLookupConfig(drv, dpy, cfg); + driDisplay *disp = Lookup_driDisplay(dpy); + driSurface *surface; + GLvisual visMode; + + surface = (driSurface *) calloc(1, sizeof(*surface)); + if (!surface) { + return EGL_NO_SURFACE; + } + + /* init base class, do error checking, etc. */ + if (!_eglInitSurface(drv, dpy, &surface->Base, EGL_SCREEN_BIT_MESA, + cfg, attrib_list)) { + free(surface); + return EGL_NO_SURFACE; + } + + _eglSaveSurface(&surface->Base); + + + /* + * XXX this is where we should allocate video memory for the surface! + */ + + + /* convert EGLConfig to GLvisual */ + _eglConfigToContextModesRec(config, &visMode); + + /* Create a new DRI drawable */ + if (!disp->driScreen.createNewDrawable(disp, &visMode, surface->Base.Handle, + &surface->drawable, GLX_WINDOW_BIT, + empty_attribute_list)) { + _eglRemoveSurface(&surface->Base); + free(surface); + return EGL_NO_SURFACE; + } + + return surface->Base.Handle; +} + + +/** + * Set the fbdev colormap to a simple linear ramp. + */ +static void +_eglDRILoadColormap(driScreen *scrn) +{ + char path[ NAME_MAX ]; + char *buffer; + int i, fd; + + /* cmap attribute uses 256 lines of 16 bytes. + * Allocate one extra char for the \0 added by sprintf() + */ + if ( !( buffer = malloc( 256 * 16 + 1 ) ) ) { + _eglLog(_EGL_WARNING, "Out of memory in _eglDRILoadColormap"); + return; + } + + /* cmap attribute uses 256 lines of 16 bytes */ + for ( i = 0; i < 256; i++ ) { + int c = (i << 8) | i; /* expand to 16-bit value */ + sprintf(&buffer[i * 16], "%02x%c%04x%04x%04x\n", i, ' ', c, c, c); + } + + snprintf(path, sizeof(path), "%s/graphics/%s/color_map", sysfs, scrn->fb); + if ( !( fd = open( path, O_RDWR ) ) ) { + _eglLog(_EGL_WARNING, "Unable to open %s to set colormap", path); + return; + } + write( fd, buffer, 256 * 16 ); + close( fd ); + + free( buffer ); +} + + +/** + * Show the given surface on the named screen. + * If surface is EGL_NO_SURFACE, disable the screen's output. + * Called via eglShowSurfaceMESA(). + */ +EGLBoolean +_eglDRIShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLScreenMESA screen, + EGLSurface surface, EGLModeMESA m) +{ + driDisplay *display = Lookup_driDisplay(dpy); + driScreen *scrn = Lookup_driScreen(dpy, screen); + driSurface *surf = Lookup_driSurface(surface); + _EGLMode *mode = _eglLookupMode(dpy, m); + FILE *file; + char fname[NAME_MAX], buffer[1000]; + int temp; + + _eglLog(_EGL_DEBUG, "Enter _eglDRIShowScreenSurface"); + + /* This will check that surface, screen, and mode are valid. + * Also, it checks that the surface is large enough for the mode, etc. + */ + if (!_eglShowScreenSurfaceMESA(drv, dpy, screen, surface, m)) + return EGL_FALSE; + + assert(surface == EGL_NO_SURFACE || surf); + assert(m == EGL_NO_MODE_MESA || mode); + assert(scrn); + + /* + * Blank/unblank screen depending on if m == EGL_NO_MODE_MESA + */ + snprintf(fname, sizeof(fname), "%s/graphics/%s/blank", sysfs, scrn->fb); + file = fopen(fname, "r+"); + if (!file) { + _eglLog(_EGL_WARNING, "kernel patch?? chown all fb sysfs attrib to allow" + " write - %s\n", fname); + return EGL_FALSE; + } + snprintf(buffer, sizeof(buffer), "%d", + (m == EGL_NO_MODE_MESA ? VESA_POWERDOWN : VESA_VSYNC_SUSPEND)); + fputs(buffer, file); + fclose(file); + + if (m == EGL_NO_MODE_MESA) { + /* all done! */ + return EGL_TRUE; + } + + _eglLog(_EGL_INFO, "Setting display mode to %d x %d, %d bpp", + mode->Width, mode->Height, display->bpp); + + /* + * Set the display mode + */ + snprintf(fname, sizeof(fname), "%s/graphics/%s/mode", sysfs, scrn->fb); + file = fopen(fname, "r+"); + if (!file) { + _eglLog(_EGL_WARNING, "Failed to open %s to set mode", fname); + return EGL_FALSE; + } + /* note: nothing happens without the \n! */ + snprintf(buffer, sizeof(buffer), "%s\n", mode->Name); + fputs(buffer, file); + fclose(file); + _eglLog(_EGL_INFO, "Set mode to %s in %s", mode->Name, fname); + + /* + * Set display bpp + */ + snprintf(fname, sizeof(fname), "%s/graphics/%s/bits_per_pixel", + sysfs, scrn->fb); + file = fopen(fname, "r+"); + if (!file) { + _eglLog(_EGL_WARNING, "Failed to open %s to set bpp", fname); + return EGL_FALSE; + } + display->bpp = GET_CONFIG_ATTRIB(surf->Base.Config, EGL_BUFFER_SIZE); + display->cpp = display->bpp / 8; + snprintf(buffer, sizeof(buffer), "%d", display->bpp); + fputs(buffer, file); + fclose(file); + + /* + * Unblank display + */ + snprintf(fname, sizeof(fname), "%s/graphics/%s/blank", sysfs, scrn->fb); + file = fopen(fname, "r+"); + if (!file) { + _eglLog(_EGL_WARNING, "Failed to open %s", fname); + return EGL_FALSE; + } + snprintf(buffer, sizeof(buffer), "%d", VESA_NO_BLANKING); + fputs(buffer, file); + fclose(file); + + /* + * Set fbdev buffer virtual size to surface's size. + */ + snprintf(fname, sizeof(fname), "%s/graphics/%s/virtual_size", sysfs, scrn->fb); + file = fopen(fname, "r+"); + snprintf(buffer, sizeof(buffer), "%d,%d", surf->Base.Width, surf->Base.Height); + fputs(buffer, file); + rewind(file); + fgets(buffer, sizeof(buffer), file); + sscanf(buffer, "%d,%d", &display->virtualWidth, &display->virtualHeight); + fclose(file); + + /* + * round up pitch as needed + */ + temp = display->virtualWidth; + switch (display->bpp / 8) { + case 1: temp = (display->virtualWidth + 127) & ~127; break; + case 2: temp = (display->virtualWidth + 31) & ~31; break; + case 3: + case 4: temp = (display->virtualWidth + 15) & ~15; break; + default: + _eglLog(_EGL_WARNING, "Bad display->bpp = %d in _eglDRIShowScreenSurface"); + } + display->virtualWidth = temp; + + /* + * sanity check + */ + if (surf->Base.Width < display->virtualWidth || + surf->Base.Height < display->virtualHeight) { + /* this case _should_ have been caught at the top of this function */ + _eglLog(_EGL_WARNING, "too small of surface in _eglDRIShowScreenSurfaceMESA " + "%d x %d < %d x %d", + surf->Base.Width, + surf->Base.Height, + display->virtualWidth, + display->virtualHeight); + /* + return EGL_FALSE; + */ + } + + /* This used to be done in the _eglDRICreateScreens routine. */ + _eglDRILoadColormap(scrn); + + return EGL_TRUE; +} + + +/** + * Called by eglSwapBuffers via the drv->API.SwapBuffers() pointer. + * + * If the backbuffer is on a videocard, this is extraordinarily slow! + */ +static EGLBoolean +_eglDRISwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw) +{ + driSurface *drawable = Lookup_driSurface(draw); + + /* this does error checking */ + if (!_eglSwapBuffers(drv, dpy, draw)) + return EGL_FALSE; + + drawable->drawable.swapBuffers(NULL, drawable->drawable.private); + + return EGL_TRUE; +} + + +EGLBoolean +_eglDRIGetDisplayInfo(driDisplay *dpy) +{ + char path[ NAME_MAX ]; + FILE *file; + int i, rc; + drmSetVersion sv; + drm_magic_t magic; + + snprintf( path, sizeof( path ), "%s/graphics/fb%d/device/device", sysfs, dpy->minor ); + file = fopen( path, "r" ); + if (!file) { + _eglLog(_EGL_WARNING, "Unable to open %s", path); + return EGL_FALSE; + } + fgets( path, sizeof( path ), file ); + sscanf( path, "%x", &dpy->chipset ); + fclose( file ); + + sprintf(path, DRM_DEV_NAME, DRM_DIR_NAME, dpy->minor); + if ( ( dpy->drmFD = open(path, O_RDWR, 0) ) < 0 ) { + _eglLog(_EGL_WARNING, "drmOpen failed."); + return EGL_FALSE; + } + + /* Set the interface version, asking for 1.2 */ + sv.drm_di_major = 1; + sv.drm_di_minor = 2; + sv.drm_dd_major = -1; + if ((rc = drmSetInterfaceVersion(dpy->drmFD, &sv))) + return EGL_FALSE; + + /* self authorize */ + if (drmGetMagic(dpy->drmFD, &magic)) + return EGL_FALSE; + if (drmAuthMagic(dpy->drmFD, magic)) + return EGL_FALSE; + + /* Map framebuffer and SAREA */ + for (i = 0; ; i++) { + drm_handle_t handle, offset; + drmSize size; + drmMapType type; + drmMapFlags flags; + int mtrr; + + if (drmGetMap(dpy->drmFD, i, &offset, &size, &type, &flags, + &handle, &mtrr)) + break; + + if (type == DRM_FRAME_BUFFER) { + rc = drmMap( dpy->drmFD, offset, size, (drmAddressPtr) &dpy->pFB); + if (rc < 0) { + _eglLog(_EGL_WARNING, "drmMap DRM_FAME_BUFFER failed"); + return EGL_FALSE; + } + dpy->fbSize = size; + _eglLog(_EGL_INFO, "Found framebuffer size: %d", dpy->fbSize); + } + else if (type == DRM_SHM) { + rc = drmMap(dpy->drmFD, offset, size, (drmAddressPtr) &dpy->pSAREA); + if (rc < 0 ) { + _eglLog(_EGL_WARNING, "drmMap DRM_SHM failed."); + return EGL_FALSE; + } + dpy->SAREASize = SAREA_MAX; + _eglLog(_EGL_DEBUG, "mapped SAREA 0x%08lx to %p, size %d", + (unsigned long) offset, dpy->pSAREA, dpy->SAREASize ); + } + } + + if (!dpy->pFB) { + _eglLog(_EGL_WARNING, "failed to map framebuffer"); + return EGL_FALSE; + } + + if (!dpy->pSAREA) { + /* if this happens, make sure you're using the most recent DRM modules */ + _eglLog(_EGL_WARNING, "failed to map SAREA"); + return EGL_FALSE; + } + + memset( dpy->pSAREA, 0, dpy->SAREASize ); + + return EGL_TRUE; +} + + + /* Return the DRI per screen structure */ +static __DRIscreen * +__eglFindDRIScreen(__DRInativeDisplay *ndpy, int scrn) +{ + driDisplay *disp = (driDisplay *)ndpy; + return &disp->driScreen; +} + + +static GLboolean +__eglCreateContextWithConfig(__DRInativeDisplay* ndpy, int screen, + int configID, void* context, + drm_context_t * hHWContext) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __eglFindDRIScreen(ndpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + psp = (__DRIscreenPrivate *) pDRIScreen->private; + if (psp->fd) { + if (drmCreateContext(psp->fd, hHWContext)) { + _eglLog(_EGL_WARNING, "drmCreateContext failed."); + return GL_FALSE; + } + *(void**)context = (void*) *hHWContext; + } +#if 0 + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __glXFindDRIScreen(dpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + + psp = (__DRIscreenPrivate *) pDRIScreen->private; + + if (psp->fd) { + if (drmCreateContext(psp->fd, hHWContext)) { + _eglLog(_EGL_WARNING, "drmCreateContext failed."); + return GL_FALSE; + } + *(void**)contextID = (void*) *hHWContext; + } +#endif + return GL_TRUE; +} + + +static GLboolean +__eglDestroyContext( __DRInativeDisplay * ndpy, int screen, __DRIid context ) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __eglFindDRIScreen(ndpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + psp = (__DRIscreenPrivate *) pDRIScreen->private; + if (psp->fd) + drmDestroyContext(psp->fd, context); + + return GL_TRUE; +} + + +static GLboolean +__eglCreateDrawable(__DRInativeDisplay * ndpy, int screen, + __DRIid drawable, drm_drawable_t * hHWDrawable) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __eglFindDRIScreen(ndpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + psp = (__DRIscreenPrivate *) pDRIScreen->private; + if (psp->fd) { + if (drmCreateDrawable(psp->fd, hHWDrawable)) { + _eglLog(_EGL_WARNING, "drmCreateDrawable failed."); + return GL_FALSE; + } + } + return GL_TRUE; +} + + +static GLboolean +__eglDestroyDrawable( __DRInativeDisplay * ndpy, int screen, __DRIid drawable ) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __eglFindDRIScreen(ndpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + psp = (__DRIscreenPrivate *) pDRIScreen->private; + if (psp->fd) + drmDestroyDrawable(psp->fd, drawable); + + return GL_TRUE; +} + +static GLboolean +__eglGetDrawableInfo(__DRInativeDisplay * ndpy, int screen, __DRIid drawable, + unsigned int* index, unsigned int* stamp, + int* X, int* Y, int* W, int* H, + int* numClipRects, drm_clip_rect_t ** pClipRects, + int* backX, int* backY, + int* numBackClipRects, drm_clip_rect_t ** pBackClipRects ) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + driSurface *surf = Lookup_driSurface(drawable); + + pDRIScreen = __eglFindDRIScreen(ndpy, screen); + + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + psp = (__DRIscreenPrivate *) pDRIScreen->private; + *X = 0; + *Y = 0; + *W = surf->Base.Width; + *H = surf->Base.Height; + + *backX = 0; + *backY = 0; + *numBackClipRects = 0; + *pBackClipRects = NULL; + + *numClipRects = 1; + *pClipRects = malloc(sizeof(**pClipRects)); + **pClipRects = (drm_clip_rect_t){0, 0, surf->Base.Width, surf->Base.Height}; + + psp->pSAREA->drawableTable[0].stamp = 1; + *stamp = 1; +#if 0 + GLXDrawable drawable = (GLXDrawable) draw; + drm_clip_rect_t * cliprect; + Display* display = (Display*)dpy; + __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private; + if (drawable == 0) { + return GL_FALSE; + } + + cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t)); + cliprect->x1 = drawable->x; + cliprect->y1 = drawable->y; + cliprect->x2 = drawable->x + drawable->w; + cliprect->y2 = drawable->y + drawable->h; + + /* the drawable index is by client id */ + *index = display->clientID; + + *stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp; + *x = drawable->x; + *y = drawable->y; + *width = drawable->w; + *height = drawable->h; + *numClipRects = 1; + *pClipRects = cliprect; + + *backX = drawable->x; + *backY = drawable->y; + *numBackClipRects = 0; + *pBackClipRects = 0; +#endif + return GL_TRUE; +} + + +/** + * Implement \c __DRIinterfaceMethods::getProcAddress. + */ +static __DRIfuncPtr +get_proc_address(const char * proc_name) +{ + return NULL; +} + + +/** + * Destroy a linked list of \c __GLcontextModes structures created by + * \c _gl_context_modes_create. + * + * \param modes Linked list of structures to be destroyed. All structres + * in the list will be freed. + */ +static void +__egl_context_modes_destroy(__GLcontextModes *modes) +{ + while ( modes != NULL ) { + __GLcontextModes * const next = modes->next; + + free( modes ); + modes = next; + } +} + + +/** + * Allocate a linked list of \c __GLcontextModes structures. The fields of + * each structure will be initialized to "reasonable" default values. In + * most cases this is the default value defined by table 3.4 of the GLX + * 1.3 specification. This means that most values are either initialized to + * zero or \c GLX_DONT_CARE (which is -1). As support for additional + * extensions is added, the new values will be initialized to appropriate + * values from the extension specification. + * + * \param count Number of structures to allocate. + * \param minimum_size Minimum size of a structure to allocate. This allows + * for differences in the version of the + * \c __GLcontextModes stucture used in libGL and in a + * DRI-based driver. + * \returns A pointer to the first element in a linked list of \c count + * stuctures on success, or \c NULL on failure. + * + * \warning Use of \c minimum_size does \b not guarantee binary compatibility. + * The fundamental assumption is that if the \c minimum_size + * specified by the driver and the size of the \c __GLcontextModes + * structure in libGL is the same, then the meaning of each byte in + * the structure is the same in both places. \b Be \b careful! + * Basically this means that fields have to be added in libGL and + * then propagated to drivers. Drivers should \b never arbitrarilly + * extend the \c __GLcontextModes data-structure. + */ +static __GLcontextModes * +__egl_context_modes_create(unsigned count, size_t minimum_size) +{ + const size_t size = (minimum_size > sizeof( __GLcontextModes )) + ? minimum_size : sizeof( __GLcontextModes ); + __GLcontextModes * base = NULL; + __GLcontextModes ** next; + unsigned i; + + next = & base; + for ( i = 0 ; i < count ; i++ ) { + *next = (__GLcontextModes *) malloc( size ); + if ( *next == NULL ) { + __egl_context_modes_destroy( base ); + base = NULL; + break; + } + + (void) memset( *next, 0, size ); + (*next)->visualID = GLX_DONT_CARE; + (*next)->visualType = GLX_DONT_CARE; + (*next)->visualRating = GLX_NONE; + (*next)->transparentPixel = GLX_NONE; + (*next)->transparentRed = GLX_DONT_CARE; + (*next)->transparentGreen = GLX_DONT_CARE; + (*next)->transparentBlue = GLX_DONT_CARE; + (*next)->transparentAlpha = GLX_DONT_CARE; + (*next)->transparentIndex = GLX_DONT_CARE; + (*next)->xRenderable = GLX_DONT_CARE; + (*next)->fbconfigID = GLX_DONT_CARE; + (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; + + next = & ((*next)->next); + } + + return base; +} + + +static GLboolean +__eglWindowExists(__DRInativeDisplay *dpy, __DRIid draw) +{ + return EGL_TRUE; +} + + +/** + * Get the unadjusted system time (UST). Currently, the UST is measured in + * microseconds since Epoc. The actual resolution of the UST may vary from + * system to system, and the units may vary from release to release. + * Drivers should not call this function directly. They should instead use + * \c glXGetProcAddress to obtain a pointer to the function. + * + * \param ust Location to store the 64-bit UST + * \returns Zero on success or a negative errno value on failure. + * + * \sa glXGetProcAddress, PFNGLXGETUSTPROC + * + * \since Internal API version 20030317. + */ +static int +__eglGetUST(int64_t *ust) +{ + struct timeval tv; + + if ( ust == NULL ) { + return -EFAULT; + } + + if ( gettimeofday( & tv, NULL ) == 0 ) { + ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; + return 0; + } + else { + return -errno; + } +} + +/** + * Determine the refresh rate of the specified drawable and display. + * + * \param dpy Display whose refresh rate is to be determined. + * \param drawable Drawable whose refresh rate is to be determined. + * \param numerator Numerator of the refresh rate. + * \param demoninator Denominator of the refresh rate. + * \return If the refresh rate for the specified display and drawable could + * be calculated, True is returned. Otherwise False is returned. + * + * \note This function is implemented entirely client-side. A lot of other + * functionality is required to export GLX_OML_sync_control, so on + * XFree86 this function can be called for direct-rendering contexts + * when GLX_OML_sync_control appears in the client extension string. + */ +static GLboolean +__eglGetMSCRate(__DRInativeDisplay * dpy, __DRIid drawable, + int32_t * numerator, int32_t * denominator) +{ + return EGL_TRUE; +} + + +/** + * Table of functions exported by the loader to the driver. + */ +static const __DRIinterfaceMethods interface_methods = { + get_proc_address, + + __egl_context_modes_create, + __egl_context_modes_destroy, + + __eglFindDRIScreen, + __eglWindowExists, + + __eglCreateContextWithConfig, + __eglDestroyContext, + + __eglCreateDrawable, + __eglDestroyDrawable, + __eglGetDrawableInfo, + + __eglGetUST, + __eglGetMSCRate, +}; + + +static int +__glXGetInternalVersion(void) +{ + return 20050725; +} + +static const char createNewScreenName[] = "__driCreateNewScreen_20050727"; + + +/** + * Do per-display initialization. + */ +EGLBoolean +_eglDRICreateDisplay(driDisplay *dpy, __DRIframebuffer *framebuffer) +{ + PFNCREATENEWSCREENFUNC createNewScreen; + int api_ver = __glXGetInternalVersion(); + __DRIversion ddx_version; + __DRIversion dri_version; + __DRIversion drm_version; + drmVersionPtr version; + + version = drmGetVersion( dpy->drmFD ); + if ( version ) { + drm_version.major = version->version_major; + drm_version.minor = version->version_minor; + drm_version.patch = version->version_patchlevel; + drmFreeVersion( version ); + } + else { + drm_version.major = -1; + drm_version.minor = -1; + drm_version.patch = -1; + } + + /* + * Get device name (like "tdfx") and the ddx version numbers. + * We'll check the version in each DRI driver's "createScreen" + * function. + */ + ddx_version.major = 4; + ddx_version.minor = 0; + ddx_version.patch = 0; + + /* + * Get the DRI X extension version. + */ + dri_version.major = 4; + dri_version.minor = 0; + dri_version.patch = 0; + + createNewScreen = ( PFNCREATENEWSCREENFUNC ) dlsym( dpy->Base.Driver->LibHandle, createNewScreenName ); + if ( !createNewScreen ) { + _eglLog(_EGL_WARNING, "Couldn't find %s function in the driver.", + createNewScreenName ); + return EGL_FALSE; + } + + dpy->driScreen.private = createNewScreen( dpy, 0, &dpy->driScreen, NULL, + &ddx_version, &dri_version, + &drm_version, framebuffer, + dpy->pSAREA, dpy->drmFD, + api_ver, + & interface_methods, + NULL); + if (!dpy->driScreen.private) + return EGL_FALSE; + + DRM_UNLOCK( dpy->drmFD, dpy->pSAREA, dpy->serverContext ); + + return EGL_TRUE; +} + + +/** + * Create all the EGL screens for the given display. + */ +EGLBoolean +_eglDRICreateScreens(driDisplay *dpy) +{ + const int numScreens = 1; /* XXX fix this someday */ + int i; + + for (i = 0; i < numScreens; i++) { + char path[ NAME_MAX ]; + FILE *file; + driScreen *s; + + /* Create a screen */ + if ( !( s = ( driScreen * ) calloc( 1, sizeof( *s ) ) ) ) + return EGL_FALSE; + + snprintf( s->fb, NAME_MAX, "fb%d", dpy->minor ); + _eglInitScreen( &s->Base ); + + _eglAddScreen( &dpy->Base, &s->Base ); + + /* Create the screen's mode list */ + snprintf( path, sizeof( path ), "%s/graphics/%s/modes", sysfs, s->fb ); + file = fopen( path, "r" ); + while ( fgets( path, sizeof( path ), file ) ) { + unsigned int x, y, r; + char c; + path[ strlen( path ) - 1 ] = '\0'; /* strip off \n from sysfs */ + sscanf( path, "%c:%ux%u-%u", &c, &x, &y, &r ); + _eglAddNewMode( &s->Base, x, y, r * 1000, path ); + } + fclose( file ); + + /* + * NOTE: we used to set the colormap here, but that didn't work reliably. + * Some entries near the start of the table would get corrupted by later + * mode changes. + */ + } + + return EGL_TRUE; +} + + +EGLBoolean +_eglDRIInitialize(_EGLDriver *drv, EGLDisplay dpy, + EGLint *major, EGLint *minor) +{ + _EGLDisplay *disp = _eglLookupDisplay(dpy); + driDisplay *display; + + assert(disp); + + /* Create new driDisplay object to replace the _EGLDisplay that was + * previously created. + */ + display = calloc(1, sizeof(*display)); + display->Base = *disp; + _eglHashInsert(_eglGlobal.Displays, disp->Handle, display); + free(disp); + + *major = 1; + *minor = 0; + + sscanf(&disp->Name[1], "%d", &display->minor); + + drv->Initialized = EGL_TRUE; + return EGL_TRUE; +} + + +static EGLBoolean +_eglDRITerminate(_EGLDriver *drv, EGLDisplay dpy) +{ + driDisplay *display = Lookup_driDisplay(dpy); + _eglCleanupDisplay(&display->Base);/*rename that function*/ + free(display); + free(drv); + return EGL_TRUE; +} + + +/** + * Plug in the DRI-specific functions into the driver's dispatch table. + * Also, enable some EGL extensions. + */ +void +_eglDRIInitDriverFallbacks(_EGLDriver *drv) +{ + _eglInitDriverFallbacks(drv); + + drv->API.Initialize = _eglDRIInitialize; + drv->API.Terminate = _eglDRITerminate; + drv->API.CreateContext = _eglDRICreateContext; + drv->API.MakeCurrent = _eglDRIMakeCurrent; + drv->API.CreatePbufferSurface = _eglDRICreatePbufferSurface; + drv->API.DestroySurface = _eglDRIDestroySurface; + drv->API.DestroyContext = _eglDRIDestroyContext; + drv->API.CreateScreenSurfaceMESA = _eglDRICreateScreenSurfaceMESA; + drv->API.ShowScreenSurfaceMESA = _eglDRIShowScreenSurfaceMESA; + drv->API.SwapBuffers = _eglDRISwapBuffers; + + /* enable supported extensions */ + drv->Extensions.MESA_screen_surface = EGL_TRUE; + drv->Extensions.MESA_copy_context = EGL_TRUE; +} diff -Nru xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.h xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.h --- xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/drivers/dri/egldri.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,113 @@ +#ifndef EGLDRI_INCLUDED +#define EGLDRI_INCLUDED + +#include "egldisplay.h" +#include "eglscreen.h" +#include "eglsurface.h" +#include "eglcontext.h" +#include "mtypes.h" +#include "dri_util.h" +#include "drm_sarea.h" + +/** + * dri display-specific driver class derived from _EGLDisplay + */ +typedef struct dri_display +{ + _EGLDisplay Base; /* base class/object */ + void *pFB; + int drmFD; /**< \brief DRM device file descriptor */ + int minor; + unsigned long hFrameBuffer; + + int virtualWidth; + int virtualHeight; + int fbSize; + int bpp; + int cpp; + int card_type; + int SAREASize; + drm_sarea_t *pSAREA; + unsigned int serverContext; /**< \brief DRM context only active on server */ + unsigned long FBStart; /**< \brief physical address of the framebuffer */ + void *driverClientMsg; + int driverClientMsgSize; + int chipset; + void *driverPrivate; + drm_magic_t magic; + + __DRIscreen driScreen; + +} driDisplay; + + +/** + * dri driver-specific screen class derived from _EGLScreen + */ +typedef struct dri_screen +{ + _EGLScreen Base; + char fb[NAME_MAX]; /** the screen name, like "fb0" */ +} driScreen; + + +/** + * dri driver-specific surface class derived from _EGLSurface + */ +typedef struct dri_surface +{ + _EGLSurface Base; /* base class/object */ + __DRIdrawable drawable; +} driSurface; + + +/** + * dri driver-specific context class derived from _EGLContext + */ +typedef struct dri_context +{ + _EGLContext Base; /* base class/object */ + __DRIcontext driContext; /**< \brief context dependent methods */ +} driContext; + + + +static inline driDisplay * +Lookup_driDisplay(EGLDisplay dpy) +{ + _EGLDisplay *d = _eglLookupDisplay(dpy); + return (driDisplay *) d; +} + + +static inline driScreen * +Lookup_driScreen(EGLDisplay dpy, EGLScreenMESA screen) +{ + _EGLScreen *s = _eglLookupScreen(dpy, screen); + return (driScreen *) s; +} + + +static inline driContext * +Lookup_driContext(EGLContext ctx) +{ + _EGLContext *c = _eglLookupContext(ctx); + return (driContext *) c; +} + + +static inline driSurface * +Lookup_driSurface(EGLSurface surf) +{ + _EGLSurface *s = _eglLookupSurface(surf); + return (driSurface *) s; +} + +extern void _eglDRIInitDriverFallbacks(_EGLDriver *drv); +extern EGLBoolean _eglDRIShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA m); +extern EGLBoolean _eglDRIInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor); +extern EGLBoolean _eglDRIGetDisplayInfo(driDisplay *dpy); +extern EGLBoolean _eglDRICreateDisplay(driDisplay *dpy, __DRIframebuffer *framebuffer); +extern EGLBoolean _eglDRICreateScreens(driDisplay *dpy); + +#endif /* EGLDRI_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/drivers/dri/Makefile xpsb-glx-0.19/mesa/src/egl/drivers/dri/Makefile --- xpsb-glx-0.19/mesa/src/egl/drivers/dri/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/drivers/dri/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,62 @@ +# src/egl/drivers/dri/Makefile + +TOP = ../../../.. +include $(TOP)/configs/current + + +### Include directories +INCLUDE_DIRS = \ + -I. \ + -I/usr/include \ + -I/usr/include/drm \ + -I$(TOP)/include \ + -I$(TOP)/include/GL/internal \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/math \ + -I$(TOP)/src/mesa/transform \ + -I$(TOP)/src/mesa/shader \ + -I$(TOP)/src/mesa/swrast \ + -I$(TOP)/src/mesa/swrast_setup \ + -I$(TOP)/src/egl/main \ + -I$(TOP)/src/mesa/drivers/dri/common + + +HEADERS = egldri.h + +SOURCES = egldri.c + +OBJECTS = $(SOURCES:.c=.o) + + +.c.o: + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ + + + +default: depend library Makefile + + +# EGLdri Library +library: $(TOP)/$(LIB_DIR)/libEGLdri.so + +$(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS) + $(MKLIB) -o EGLdri -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major 1 -minor 0 \ + -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) + + +clean: + -rm -f *.o + -rm -f *.so + +depend: $(SOURCES) $(HEADERS) + @ echo "running $(MKDEP)" + @ touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \ + $(SOURCES) $(HEADERS) > /dev/null + +include depend +# DO NOT DELETE + diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglapi.c xpsb-glx-0.19/mesa/src/egl/main/eglapi.c --- xpsb-glx-0.19/mesa/src/egl/main/eglapi.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglapi.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,586 @@ +/** + * Public EGL API entrypoints + * + * Generally, we use the EGLDisplay parameter as a key to lookup the + * appropriate device driver handle, then jump though the driver's + * dispatch table to handle the function. + * + * That allows us the option of supporting multiple, simultaneous, + * heterogeneous hardware devices in the future. + * + * The EGLDisplay, EGLConfig, EGLContext and EGLSurface types are + * opaque handles implemented with 32-bit unsigned integers. + * It's up to the driver function or fallback function to look up the + * handle and get an object. + * By using opaque handles, we leave open the possibility of having + * indirect rendering in the future, like GLX. + * + * + * Notes on naming conventions: + * + * eglFooBar - public EGL function + * EGL_FOO_BAR - public EGL token + * EGLDatatype - public EGL datatype + * + * _eglFooBar - private EGL function + * _EGLDatatype - private EGL datatype, typedef'd struct + * _egl_struct - private EGL struct, non-typedef'd + * + */ + + + +#include +#include +#include +#include "eglcontext.h" +#include "egldisplay.h" +#include "egltypedefs.h" +#include "eglglobals.h" +#include "egldriver.h" +#include "eglsurface.h" + + + +/** + * NOTE: displayName is treated as a string in _eglChooseDriver()!!! + * This will probably change! + * See _eglChooseDriver() for details! + */ +EGLDisplay APIENTRY +eglGetDisplay(NativeDisplayType displayName) +{ + _EGLDisplay *dpy; + _eglInitGlobals(); + dpy = _eglNewDisplay(displayName); + if (dpy) + return dpy->Handle; + else + return EGL_NO_DISPLAY; +} + + +EGLBoolean APIENTRY +eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) +{ + if (dpy) { + _EGLDriver *drv = _eglChooseDriver(dpy); + if (drv) + return drv->API.Initialize(drv, dpy, major, minor); + } + return EGL_FALSE; +} + + +EGLBoolean APIENTRY +eglTerminate(EGLDisplay dpy) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return _eglCloseDriver(drv, dpy); + else + return EGL_FALSE; +} + + +const char * APIENTRY +eglQueryString(EGLDisplay dpy, EGLint name) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->API.QueryString(drv, dpy, name); + else + return NULL; +} + + +EGLBoolean APIENTRY +eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + /* XXX check drv for null in remaining functions */ + return drv->API.GetConfigs(drv, dpy, configs, config_size, num_config); +} + + +EGLBoolean APIENTRY +eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.ChooseConfig(drv, dpy, attrib_list, configs, config_size, num_config); +} + + +EGLBoolean APIENTRY +eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.GetConfigAttrib(drv, dpy, config, attribute, value); +} + + +EGLContext APIENTRY +eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CreateContext(drv, dpy, config, share_list, attrib_list); +} + + +EGLBoolean APIENTRY +eglDestroyContext(EGLDisplay dpy, EGLContext ctx) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.DestroyContext(drv, dpy, ctx); +} + + +EGLBoolean APIENTRY +eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.MakeCurrent(drv, dpy, draw, read, ctx); +} + + +EGLBoolean APIENTRY +eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.QueryContext(drv, dpy, ctx, attribute, value); +} + + +EGLSurface APIENTRY +eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CreateWindowSurface(drv, dpy, config, window, attrib_list); +} + + +EGLSurface APIENTRY +eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CreatePixmapSurface(drv, dpy, config, pixmap, attrib_list); +} + + +EGLSurface APIENTRY +eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CreatePbufferSurface(drv, dpy, config, attrib_list); +} + + +EGLBoolean APIENTRY +eglDestroySurface(EGLDisplay dpy, EGLSurface surface) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.DestroySurface(drv, dpy, surface); +} + + +EGLBoolean APIENTRY +eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.QuerySurface(drv, dpy, surface, attribute, value); +} + + +EGLBoolean APIENTRY +eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.SurfaceAttrib(drv, dpy, surface, attribute, value); +} + + +EGLBoolean APIENTRY +eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.BindTexImage(drv, dpy, surface, buffer); +} + + +EGLBoolean APIENTRY +eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.ReleaseTexImage(drv, dpy, surface, buffer); +} + + +EGLBoolean APIENTRY +eglSwapInterval(EGLDisplay dpy, EGLint interval) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.SwapInterval(drv, dpy, interval); +} + + +EGLBoolean APIENTRY +eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.SwapBuffers(drv, dpy, draw); +} + + +EGLBoolean APIENTRY +eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, NativePixmapType target) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CopyBuffers(drv, dpy, surface, target); +} + + +EGLBoolean APIENTRY +eglWaitGL(void) +{ + EGLDisplay dpy = eglGetCurrentDisplay(); + if (dpy != EGL_NO_DISPLAY) { + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.WaitGL(drv, dpy); + } + else + return EGL_FALSE; +} + + +EGLBoolean APIENTRY +eglWaitNative(EGLint engine) +{ + EGLDisplay dpy = eglGetCurrentDisplay(); + if (dpy != EGL_NO_DISPLAY) { + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.WaitNative(drv, dpy, engine); + } + else + return EGL_FALSE; +} + + +EGLDisplay APIENTRY +eglGetCurrentDisplay(void) +{ + _EGLDisplay *dpy = _eglGetCurrentDisplay(); + if (dpy) + return dpy->Handle; + else + return EGL_NO_DISPLAY; +} + + +EGLContext APIENTRY +eglGetCurrentContext(void) +{ + _EGLContext *ctx = _eglGetCurrentContext(); + if (ctx) + return ctx->Handle; + else + return EGL_NO_CONTEXT; +} + + +EGLSurface APIENTRY +eglGetCurrentSurface(EGLint readdraw) +{ + _EGLSurface *s = _eglGetCurrentSurface(readdraw); + if (s) + return s->Handle; + else + return EGL_NO_SURFACE; +} + + +EGLint APIENTRY +eglGetError(void) +{ + _EGLThreadInfo *t = _eglGetCurrentThread(); + EGLint e = t->LastError; + t->LastError = EGL_SUCCESS; + return e; +} + + +void (* APIENTRY eglGetProcAddress(const char *procname))() +{ + typedef void (*genericFunc)(); + struct name_function { + const char *name; + _EGLProc function; + }; + static struct name_function egl_functions[] = { + /* alphabetical order */ + { "eglBindTexImage", (_EGLProc) eglBindTexImage }, + { "eglChooseConfig", (_EGLProc) eglChooseConfig }, + { "eglCopyBuffers", (_EGLProc) eglCopyBuffers }, + { "eglCreateContext", (_EGLProc) eglCreateContext }, + { "eglCreatePbufferSurface", (_EGLProc) eglCreatePbufferSurface }, + { "eglCreatePixmapSurface", (_EGLProc) eglCreatePixmapSurface }, + { "eglCreateWindowSurface", (_EGLProc) eglCreateWindowSurface }, + { "eglDestroyContext", (_EGLProc) eglDestroyContext }, + { "eglDestroySurface", (_EGLProc) eglDestroySurface }, + { "eglGetConfigAttrib", (_EGLProc) eglGetConfigAttrib }, + { "eglGetConfigs", (_EGLProc) eglGetConfigs }, + { "eglGetCurrentContext", (_EGLProc) eglGetCurrentContext }, + { "eglGetCurrentDisplay", (_EGLProc) eglGetCurrentDisplay }, + { "eglGetCurrentSurface", (_EGLProc) eglGetCurrentSurface }, + { "eglGetDisplay", (_EGLProc) eglGetDisplay }, + { "eglGetError", (_EGLProc) eglGetError }, + { "eglGetProcAddress", (_EGLProc) eglGetProcAddress }, + { "eglInitialize", (_EGLProc) eglInitialize }, + { "eglMakeCurrent", (_EGLProc) eglMakeCurrent }, + { "eglQueryContext", (_EGLProc) eglQueryContext }, + { "eglQueryString", (_EGLProc) eglQueryString }, + { "eglQuerySurface", (_EGLProc) eglQuerySurface }, + { "eglReleaseTexImage", (_EGLProc) eglReleaseTexImage }, + { "eglSurfaceAttrib", (_EGLProc) eglSurfaceAttrib }, + { "eglSwapBuffers", (_EGLProc) eglSwapBuffers }, + { "eglSwapInterval", (_EGLProc) eglSwapInterval }, + { "eglTerminate", (_EGLProc) eglTerminate }, + { "eglWaitGL", (_EGLProc) eglWaitGL }, + { "eglWaitNative", (_EGLProc) eglWaitNative }, + /* Extensions */ +#ifdef EGL_MESA_screen_surface + { "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA }, + { "eglGetModesMESA", (_EGLProc) eglGetModesMESA }, + { "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA }, + { "eglCopyContextMESA", (_EGLProc) eglCopyContextMESA }, + { "eglGetScreensMESA", (_EGLProc) eglGetScreensMESA }, + { "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA }, + { "eglShowScreenSurfaceMESA", (_EGLProc) eglShowScreenSurfaceMESA }, + { "eglScreenPositionMESA", (_EGLProc) eglScreenPositionMESA }, + { "eglQueryScreenMESA", (_EGLProc) eglQueryScreenMESA }, + { "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA }, + { "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA }, + { "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA }, +#endif /* EGL_MESA_screen_surface */ +#ifdef EGL_VERSION_1_2 + { "eglBindAPI", (_EGLProc) eglBindAPI }, + { "eglCreatePbufferFromClientBuffer", (_EGLProc) eglCreatePbufferFromClientBuffer }, + { "eglQueryAPI", (_EGLProc) eglQueryAPI }, + { "eglReleaseThread", (_EGLProc) eglReleaseThread }, + { "eglWaitClient", (_EGLProc) eglWaitClient }, +#endif /* EGL_VERSION_1_2 */ + { NULL, NULL } + }; + EGLint i; + for (i = 0; egl_functions[i].name; i++) { + if (strcmp(egl_functions[i].name, procname) == 0) { + return (genericFunc) egl_functions[i].function; + } + } +#if 0 + /* XXX enable this code someday */ + return (genericFunc) _glapi_get_proc_address(procname); +#else + return NULL; +#endif +} + + +/* + * EGL_MESA_screen extension + */ + +EGLBoolean APIENTRY +eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + const EGLint *attrib_list, EGLModeMESA *modes, + EGLint modes_size, EGLint *num_modes) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->API.ChooseModeMESA(drv, dpy, screen, attrib_list, modes, modes_size, num_modes); + else + return EGL_FALSE; +} + + +EGLBoolean APIENTRY +eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->API.GetModesMESA(drv, dpy, screen, modes, mode_size, num_mode); + else + return EGL_FALSE; +} + + +EGLBoolean APIENTRY +eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->API.GetModeAttribMESA(drv, dpy, mode, attribute, value); + else + return EGL_FALSE; +} + + +EGLBoolean APIENTRY +eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->API.CopyContextMESA(drv, dpy, source, dest, mask); + else + return EGL_FALSE; +} + + +EGLBoolean +eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->API.GetScreensMESA(drv, dpy, screens, max_screens, num_screens); + else + return EGL_FALSE; +} + + +EGLSurface +eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CreateScreenSurfaceMESA(drv, dpy, config, attrib_list); +} + + +EGLBoolean +eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.ShowScreenSurfaceMESA(drv, dpy, screen, surface, mode); +} + + +EGLBoolean +eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.ScreenPositionMESA(drv, dpy, screen, x, y); +} + + +EGLBoolean +eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.QueryScreenMESA(drv, dpy, screen, attribute, value); +} + + +EGLBoolean +eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.QueryScreenSurfaceMESA(drv, dpy, screen, surface); +} + + +EGLBoolean +eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.QueryScreenModeMESA(drv, dpy, screen, mode); +} + + +const char * +eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.QueryModeStringMESA(drv, dpy, mode); +} + + +/** + ** EGL 1.2 + **/ + +#ifdef EGL_VERSION_1_2 + +EGLBoolean +eglBindAPI(EGLenum api) +{ + _EGLThreadInfo *t = _eglGetCurrentThread(); + + switch (api) { + case EGL_OPENGL_ES_API: + if (_eglGlobal.OpenGLESAPISupported) { + t->CurrentAPI = api; + return EGL_TRUE; + } + _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); + return EGL_FALSE; + case EGL_OPENVG_API: + if (_eglGlobal.OpenVGAPISupported) { + t->CurrentAPI = api; + return EGL_TRUE; + } + _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); + return EGL_FALSE; + default: + return EGL_FALSE; + } + return EGL_TRUE; +} + + +EGLSurface +eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, + EGLClientBuffer buffer, EGLConfig config, + const EGLint *attrib_list) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.CreatePbufferFromClientBuffer(drv, dpy, buftype, buffer, + config, attrib_list); +} + + +EGLenum +eglQueryAPI(void) +{ + /* returns one of EGL_OPENGL_ES_API or EGL_OPENVG_API */ + _EGLThreadInfo *t = _eglGetCurrentThread(); + return t->CurrentAPI; +} + + +EGLBoolean +eglReleaseThread(void) +{ + _EGLThreadInfo *t = _eglGetCurrentThread(); + EGLDisplay dpy = eglGetCurrentDisplay(); + if (dpy) { + _EGLDriver *drv = _eglLookupDriver(dpy); + /* unbind context */ + (void) drv->API.MakeCurrent(drv, dpy, EGL_NO_SURFACE, + EGL_NO_SURFACE, EGL_NO_CONTEXT); + } + _eglDeleteThreadData(t); + return EGL_TRUE; +} + + +EGLBoolean +eglWaitClient(void) +{ + EGLDisplay dpy = eglGetCurrentDisplay(); + if (dpy != EGL_NO_DISPLAY) { + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->API.WaitClient(drv, dpy); + } + else + return EGL_FALSE; +} + +#endif /* EGL_VERSION_1_2 */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglapi.h xpsb-glx-0.19/mesa/src/egl/main/eglapi.h --- xpsb-glx-0.19/mesa/src/egl/main/eglapi.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglapi.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,119 @@ +#ifndef EGLAPI_INCLUDED +#define EGLAPI_INCLUDED + +/** + * Typedefs for all EGL API entrypoint functions. + */ + + +/* driver funcs */ +typedef EGLBoolean (*Initialize_t)(_EGLDriver *, EGLDisplay dpy, EGLint *major, EGLint *minor); +typedef EGLBoolean (*Terminate_t)(_EGLDriver *, EGLDisplay dpy); + +/* config funcs */ +typedef EGLBoolean (*GetConfigs_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +typedef EGLBoolean (*ChooseConfig_t)(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +typedef EGLBoolean (*GetConfigAttrib_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); + +/* context funcs */ +typedef EGLContext (*CreateContext_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); +typedef EGLBoolean (*DestroyContext_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx); +typedef EGLBoolean (*MakeCurrent_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +typedef EGLBoolean (*QueryContext_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); + +/* surface funcs */ +typedef EGLSurface (*CreateWindowSurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list); +typedef EGLSurface (*CreatePixmapSurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); +typedef EGLSurface (*CreatePbufferSurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +typedef EGLBoolean (*DestroySurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean (*QuerySurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +typedef EGLBoolean (*SurfaceAttrib_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +typedef EGLBoolean (*BindTexImage_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean (*ReleaseTexImage_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean (*SwapInterval_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint interval); +typedef EGLBoolean (*SwapBuffers_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw); +typedef EGLBoolean (*CopyBuffers_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, NativePixmapType target); + +/* misc funcs */ +typedef const char *(*QueryString_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint name); +typedef EGLBoolean (*WaitGL_t)(_EGLDriver *drv, EGLDisplay dpy); +typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engine); + + +#ifdef EGL_MESA_screen_surface +typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode); +typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +typedef EGLBoolean (*CopyContextMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask); +typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); +typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +typedef EGLBoolean (*ShowScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); +typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); +typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); +typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); +typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode); +#endif /* EGL_MESA_screen_surface */ + + +#ifdef EGL_VERSION_1_2 +typedef EGLBoolean (*WaitClient_t)(_EGLDriver *drv, EGLDisplay dpy); +typedef EGLSurface (*CreatePbufferFromClientBuffer_t)(_EGLDriver *drv, EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +#endif /* EGL_VERSION_1_2 */ + + + +/** + * The API dispatcher jumps through these functions + */ +struct _egl_api +{ + Initialize_t Initialize; + Terminate_t Terminate; + + GetConfigs_t GetConfigs; + ChooseConfig_t ChooseConfig; + GetConfigAttrib_t GetConfigAttrib; + + CreateContext_t CreateContext; + DestroyContext_t DestroyContext; + MakeCurrent_t MakeCurrent; + QueryContext_t QueryContext; + + CreateWindowSurface_t CreateWindowSurface; + CreatePixmapSurface_t CreatePixmapSurface; + CreatePbufferSurface_t CreatePbufferSurface; + DestroySurface_t DestroySurface; + QuerySurface_t QuerySurface; + SurfaceAttrib_t SurfaceAttrib; + BindTexImage_t BindTexImage; + ReleaseTexImage_t ReleaseTexImage; + SwapInterval_t SwapInterval; + SwapBuffers_t SwapBuffers; + CopyBuffers_t CopyBuffers; + + QueryString_t QueryString; + WaitGL_t WaitGL; + WaitNative_t WaitNative; + + /* EGL_MESA_screen extension */ + ChooseModeMESA_t ChooseModeMESA; + GetModesMESA_t GetModesMESA; + GetModeAttribMESA_t GetModeAttribMESA; + CopyContextMESA_t CopyContextMESA; + GetScreensMESA_t GetScreensMESA; + CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA; + ShowScreenSurfaceMESA_t ShowScreenSurfaceMESA; + ScreenPositionMESA_t ScreenPositionMESA; + QueryScreenMESA_t QueryScreenMESA; + QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA; + QueryScreenModeMESA_t QueryScreenModeMESA; + QueryModeStringMESA_t QueryModeStringMESA; + +#ifdef EGL_VERSION_1_2 + WaitClient_t WaitClient; + CreatePbufferFromClientBuffer_t CreatePbufferFromClientBuffer; +#endif +}; + +#endif /* EGLAPI_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglconfig.c xpsb-glx-0.19/mesa/src/egl/main/eglconfig.c --- xpsb-glx-0.19/mesa/src/egl/main/eglconfig.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglconfig.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,638 @@ +/** + * EGL Configuration (pixel format) functions. + */ + + +#include +#include +#include +#include +#include "eglconfig.h" +#include "egldisplay.h" +#include "egldriver.h" +#include "eglglobals.h" +#include "egllog.h" + + +#define MIN2(A, B) (((A) < (B)) ? (A) : (B)) + + +/** + * Convert an _EGLConfig to a __GLcontextModes object. + * NOTE: This routine may be incomplete - we're only making sure that + * the fields needed by Mesa (for _mesa_create_context/framebuffer) are + * set correctly. + */ +void +_eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode) +{ + memset(mode, 0, sizeof(*mode)); + + mode->rgbMode = GL_TRUE; /* no color index */ + mode->colorIndexMode = GL_FALSE; + mode->doubleBufferMode = GL_TRUE; /* always DB for now */ + mode->stereoMode = GL_FALSE; + + mode->redBits = GET_CONFIG_ATTRIB(config, EGL_RED_SIZE); + mode->greenBits = GET_CONFIG_ATTRIB(config, EGL_GREEN_SIZE); + mode->blueBits = GET_CONFIG_ATTRIB(config, EGL_BLUE_SIZE); + mode->alphaBits = GET_CONFIG_ATTRIB(config, EGL_ALPHA_SIZE); + mode->rgbBits = GET_CONFIG_ATTRIB(config, EGL_BUFFER_SIZE); + + /* no rgba masks - fix? */ + + mode->depthBits = GET_CONFIG_ATTRIB(config, EGL_DEPTH_SIZE); + mode->haveDepthBuffer = mode->depthBits > 0; + + mode->stencilBits = GET_CONFIG_ATTRIB(config, EGL_STENCIL_SIZE); + mode->haveStencilBuffer = mode->stencilBits > 0; + + /* no accum */ + + mode->level = GET_CONFIG_ATTRIB(config, EGL_LEVEL); + mode->samples = GET_CONFIG_ATTRIB(config, EGL_SAMPLES); + mode->sampleBuffers = GET_CONFIG_ATTRIB(config, EGL_SAMPLE_BUFFERS); + + /* surface type - not really needed */ + mode->visualType = GLX_TRUE_COLOR; + mode->renderType = GLX_RGBA_BIT; +} + + +void +_eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val) +{ + assert(attr >= FIRST_ATTRIB); + assert(attr < FIRST_ATTRIB + MAX_ATTRIBS); + config->Attrib[attr - FIRST_ATTRIB] = val; +} + + +/** + * Init the given _EGLconfig to default values. + * \param id the configuration's ID. + */ +void +_eglInitConfig(_EGLConfig *config, EGLint id) +{ + memset(config, 0, sizeof(*config)); + config->Handle = id; + _eglSetConfigAttrib(config, EGL_CONFIG_ID, id); + _eglSetConfigAttrib(config, EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_CONFIG_CAVEAT, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_NATIVE_RENDERABLE, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_MIN_SWAP_INTERVAL, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_MAX_SWAP_INTERVAL, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_SURFACE_TYPE, + EGL_SCREEN_BIT_MESA | EGL_PBUFFER_BIT | + EGL_PIXMAP_BIT | EGL_WINDOW_BIT); + _eglSetConfigAttrib(config, EGL_TRANSPARENT_TYPE, EGL_NONE); + _eglSetConfigAttrib(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE); + _eglSetConfigAttrib(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE); +#ifdef EGL_VERSION_1_2 + _eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER); + _eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT); +#endif /* EGL_VERSION_1_2 */ +} + + +/** + * Given an EGLConfig handle, return the corresponding _EGLConfig object. + */ +_EGLConfig * +_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config) +{ + EGLint i; + _EGLDisplay *disp = _eglLookupDisplay(dpy); + for (i = 0; i < disp->NumConfigs; i++) { + if (disp->Configs[i].Handle == config) { + return disp->Configs + i; + } + } + return NULL; +} + + +/** + * Add the given _EGLConfig to the given display. + */ +_EGLConfig * +_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config) +{ + _EGLConfig *newConfigs; + EGLint n; + + n = display->NumConfigs; + + newConfigs = (_EGLConfig *) realloc(display->Configs, + (n + 1) * sizeof(_EGLConfig)); + if (newConfigs) { + display->Configs = newConfigs; + display->Configs[n] = *config; /* copy struct */ + display->Configs[n].Handle = n; + display->NumConfigs++; + return display->Configs + n; + } + else { + return NULL; + } +} + + +/** + * Parse the attrib_list to fill in the fields of the given _eglConfig + * Return EGL_FALSE if any errors, EGL_TRUE otherwise. + */ +EGLBoolean +_eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list) +{ + EGLint i; + + /* set all config attribs to EGL_DONT_CARE */ + for (i = 0; i < MAX_ATTRIBS; i++) { + config->Attrib[i] = EGL_DONT_CARE; + } + + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + const EGLint attr = attrib_list[i]; + if (attr >= EGL_BUFFER_SIZE && + attr <= EGL_MAX_SWAP_INTERVAL) { + EGLint k = attr - FIRST_ATTRIB; + assert(k >= 0); + assert(k < MAX_ATTRIBS); + config->Attrib[k] = attrib_list[++i]; + } +#ifdef EGL_VERSION_1_2 + else if (attr == EGL_COLOR_BUFFER_TYPE) { + EGLint bufType = attrib_list[++i]; + if (bufType != EGL_RGB_BUFFER && bufType != EGL_LUMINANCE_BUFFER) { + _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig"); + return EGL_FALSE; + } + _eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, bufType); + } + else if (attr == EGL_RENDERABLE_TYPE) { + EGLint renType = attrib_list[++i]; + if (renType & ~(EGL_OPENGL_ES_BIT | EGL_OPENVG_BIT)) { + _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig"); + return EGL_FALSE; + } + _eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, renType); + } + else if (attr == EGL_ALPHA_MASK_SIZE || + attr == EGL_LUMINANCE_SIZE) { + EGLint value = attrib_list[++i]; + _eglSetConfigAttrib(config, attr, value); + } +#endif /* EGL_VERSION_1_2 */ + else { + _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig"); + return EGL_FALSE; + } + } + return EGL_TRUE; +} + + +#define EXACT 1 +#define ATLEAST 2 +#define MASK 3 +#define SMALLER 4 +#define SPECIAL 5 +#define NONE 6 + +struct sort_info { + EGLint Attribute; + EGLint MatchCriteria; + EGLint SortOrder; +}; + +/* This encodes the info from Table 3.5 of the EGL spec, ordered by + * Sort Priority. + * + * XXX To do: EGL 1.2 attribs + */ +static struct sort_info SortInfo[] = { + { EGL_CONFIG_CAVEAT, EXACT, SPECIAL }, + { EGL_RED_SIZE, ATLEAST, SPECIAL }, + { EGL_GREEN_SIZE, ATLEAST, SPECIAL }, + { EGL_BLUE_SIZE, ATLEAST, SPECIAL }, + { EGL_ALPHA_SIZE, ATLEAST, SPECIAL }, + { EGL_BUFFER_SIZE, ATLEAST, SMALLER }, + { EGL_SAMPLE_BUFFERS, ATLEAST, SMALLER }, + { EGL_SAMPLES, ATLEAST, SMALLER }, + { EGL_DEPTH_SIZE, ATLEAST, SMALLER }, + { EGL_STENCIL_SIZE, ATLEAST, SMALLER }, + { EGL_NATIVE_VISUAL_TYPE, EXACT, SPECIAL }, + { EGL_CONFIG_ID, EXACT, SMALLER }, + { EGL_BIND_TO_TEXTURE_RGB, EXACT, NONE }, + { EGL_BIND_TO_TEXTURE_RGBA, EXACT, NONE }, + { EGL_LEVEL, EXACT, NONE }, + { EGL_NATIVE_RENDERABLE, EXACT, NONE }, + { EGL_MAX_SWAP_INTERVAL, EXACT, NONE }, + { EGL_MIN_SWAP_INTERVAL, EXACT, NONE }, + { EGL_SURFACE_TYPE, MASK, NONE }, + { EGL_TRANSPARENT_TYPE, EXACT, NONE }, + { EGL_TRANSPARENT_RED_VALUE, EXACT, NONE }, + { EGL_TRANSPARENT_GREEN_VALUE, EXACT, NONE }, + { EGL_TRANSPARENT_BLUE_VALUE, EXACT, NONE }, + { 0, 0, 0 } +}; + + +/** + * Return EGL_TRUE if the attributes of c meet or exceed the minimums + * specified by min. + */ +static EGLBoolean +_eglConfigQualifies(const _EGLConfig *c, const _EGLConfig *min) +{ + EGLint i; + for (i = 0; SortInfo[i].Attribute != 0; i++) { + const EGLint mv = GET_CONFIG_ATTRIB(min, SortInfo[i].Attribute); + if (mv != EGL_DONT_CARE) { + const EGLint cv = GET_CONFIG_ATTRIB(c, SortInfo[i].Attribute); + if (SortInfo[i].MatchCriteria == EXACT) { + if (cv != mv) { + return EGL_FALSE; + } + } + else if (SortInfo[i].MatchCriteria == ATLEAST) { + if (cv < mv) { + return EGL_FALSE; + } + } + else { + assert(SortInfo[i].MatchCriteria == MASK); + if ((mv & cv) != mv) { + return EGL_FALSE; + } + } + } + } + return EGL_TRUE; +} + + +/** + * Compare configs 'a' and 'b' and return -1 if a belongs before b, + * 1 if a belongs after b, or 0 if they're equal. + * Used by qsort(). + */ +static int +_eglCompareConfigs(const void *a, const void *b) +{ + const _EGLConfig *aConfig = (const _EGLConfig *) a; + const _EGLConfig *bConfig = (const _EGLConfig *) b; + EGLint i; + + for (i = 0; SortInfo[i].Attribute != 0; i++) { + const EGLint aVal = GET_CONFIG_ATTRIB(aConfig, SortInfo[i].Attribute); + const EGLint bVal = GET_CONFIG_ATTRIB(bConfig, SortInfo[i].Attribute); + if (SortInfo[i].SortOrder == SMALLER) { + if (aVal < bVal) + return -1; + else if (aVal > bVal) + return 1; + /* else, continue examining attribute values */ + } + else if (SortInfo[i].SortOrder == SPECIAL) { + if (SortInfo[i].Attribute == EGL_CONFIG_CAVEAT) { + /* values are EGL_NONE, SLOW_CONFIG, or NON_CONFORMANT_CONFIG */ + if (aVal < bVal) + return -1; + else if (aVal > bVal) + return 1; + } + else if (SortInfo[i].Attribute == EGL_RED_SIZE || + SortInfo[i].Attribute == EGL_GREEN_SIZE || + SortInfo[i].Attribute == EGL_BLUE_SIZE || + SortInfo[i].Attribute == EGL_ALPHA_SIZE) { + if (aVal > bVal) + return -1; + else if (aVal < bVal) + return 1; + } + else { + assert(SortInfo[i].Attribute == EGL_NATIVE_VISUAL_TYPE); + if (aVal < bVal) + return -1; + else if (aVal > bVal) + return 1; + } + } + else { + assert(SortInfo[i].SortOrder == NONE); + /* continue examining attribute values */ + } + } + + /* all attributes identical */ + return 0; +} + + +/** + * Typical fallback routine for eglChooseConfig + */ +EGLBoolean +_eglChooseConfig(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list, + EGLConfig *configs, EGLint config_size, EGLint *num_configs) +{ + _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLConfig **configList, criteria; + EGLint i, count; + + /* parse the attrib_list to initialize criteria */ + if (!_eglParseConfigAttribs(&criteria, attrib_list)) { + return EGL_FALSE; + } + + /* allocate array of config pointers */ + configList = (_EGLConfig **) malloc(config_size * sizeof(_EGLConfig *)); + if (!configList) { + _eglError(EGL_BAD_CONFIG, "eglChooseConfig(out of memory)"); + return EGL_FALSE; + } + + /* make array of pointers to qualifying configs */ + for (i = count = 0; i < disp->NumConfigs && count < config_size; i++) { + if (_eglConfigQualifies(disp->Configs + i, &criteria)) { + configList[count++] = disp->Configs + i; + } + } + + /* sort array of pointers */ + qsort(configList, count, sizeof(_EGLConfig *), _eglCompareConfigs); + + /* copy config handles to output array */ + for (i = 0; i < count; i++) { + configs[i] = configList[i]->Handle; + } + + free(configList); + + *num_configs = count; + + return EGL_TRUE; +} + + +/** + * Fallback for eglGetConfigAttrib. + */ +EGLBoolean +_eglGetConfigAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + EGLint attribute, EGLint *value) +{ + const _EGLConfig *conf = _eglLookupConfig(drv, dpy, config); + const EGLint k = attribute - FIRST_ATTRIB; + if (k >= 0 && k < MAX_ATTRIBS) { + *value = conf->Attrib[k]; + return EGL_TRUE; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib"); + return EGL_FALSE; + } +} + + +/** + * Fallback for eglGetConfigs. + */ +EGLBoolean +_eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, + EGLint config_size, EGLint *num_config) +{ + _EGLDisplay *disp = _eglLookupDisplay(dpy); + + if (!drv->Initialized) { + _eglError(EGL_NOT_INITIALIZED, "eglGetConfigs"); + return EGL_FALSE; + } + + if (configs) { + EGLint i; + *num_config = MIN2(disp->NumConfigs, config_size); + for (i = 0; i < *num_config; i++) { + configs[i] = disp->Configs[i].Handle; + } + } + else { + /* just return total number of supported configs */ + *num_config = disp->NumConfigs; + } + + return EGL_TRUE; +} + + +/** + * Creates a set of \c __GLcontextModes that a driver will expose. + * + * A set of \c __GLcontextModes will be created based on the supplied + * parameters. The number of modes processed will be 2 * + * \c num_depth_stencil_bits * \c num_db_modes. + * + * For the most part, data is just copied from \c depth_bits, \c stencil_bits, + * \c db_modes, and \c visType into each \c __GLcontextModes element. + * However, the meanings of \c fb_format and \c fb_type require further + * explanation. The \c fb_format specifies which color components are in + * each pixel and what the default order is. For example, \c GL_RGB specifies + * that red, green, blue are available and red is in the "most significant" + * position and blue is in the "least significant". The \c fb_type specifies + * the bit sizes of each component and the actual ordering. For example, if + * \c GL_UNSIGNED_SHORT_5_6_5_REV is specified with \c GL_RGB, bits [15:11] + * are the blue value, bits [10:5] are the green value, and bits [4:0] are + * the red value. + * + * One sublte issue is the combination of \c GL_RGB or \c GL_BGR and either + * of the \c GL_UNSIGNED_INT_8_8_8_8 modes. The resulting mask values in the + * \c __GLcontextModes structure is \b identical to the \c GL_RGBA or + * \c GL_BGRA case, except the \c alphaMask is zero. This means that, as + * far as this routine is concerned, \c GL_RGB with \c GL_UNSIGNED_INT_8_8_8_8 + * still uses 32-bits. + * + * If in doubt, look at the tables used in the function. + * + * \param ptr_to_modes Pointer to a pointer to a linked list of + * \c __GLcontextModes. Upon completion, a pointer to + * the next element to be process will be stored here. + * If the function fails and returns \c GL_FALSE, this + * value will be unmodified, but some elements in the + * linked list may be modified. + * \param fb_format Format of the framebuffer. Currently only \c GL_RGB, + * \c GL_RGBA, \c GL_BGR, and \c GL_BGRA are supported. + * \param fb_type Type of the pixels in the framebuffer. Currently only + * \c GL_UNSIGNED_SHORT_5_6_5, + * \c GL_UNSIGNED_SHORT_5_6_5_REV, + * \c GL_UNSIGNED_INT_8_8_8_8, and + * \c GL_UNSIGNED_INT_8_8_8_8_REV are supported. + * \param depth_bits Array of depth buffer sizes to be exposed. + * \param stencil_bits Array of stencil buffer sizes to be exposed. + * \param num_depth_stencil_bits Number of entries in both \c depth_bits and + * \c stencil_bits. + * \param db_modes Array of buffer swap modes. If an element has a + * value of \c GLX_NONE, then it represents a + * single-buffered mode. Other valid values are + * \c GLX_SWAP_EXCHANGE_OML, \c GLX_SWAP_COPY_OML, and + * \c GLX_SWAP_UNDEFINED_OML. See the + * GLX_OML_swap_method extension spec for more details. + * \param num_db_modes Number of entries in \c db_modes. + * \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or + * \c GLX_DIRECT_COLOR. + * + * \returns + * \c GL_TRUE on success or \c GL_FALSE on failure. Currently the only + * cause of failure is a bad parameter (i.e., unsupported \c fb_format or + * \c fb_type). + * + * \todo + * There is currently no way to support packed RGB modes (i.e., modes with + * exactly 3 bytes per pixel) or floating-point modes. This could probably + * be done by creating some new, private enums with clever names likes + * \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32, + * \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it. + */ +GLboolean +_eglFillInConfigs(_EGLConfig * configs, + GLenum fb_format, GLenum fb_type, + const uint8_t * depth_bits, const uint8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes, + int visType) +{ + static const uint8_t bits_table[3][4] = { + /* R G B A */ + { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ + { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */ + { 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */ + }; + + /* The following arrays are all indexed by the fb_type masked with 0x07. + * Given the four supported fb_type values, this results in valid array + * indices of 3, 4, 5, and 7. + */ + static const uint32_t masks_table_rgb[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5 */ + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5_REV */ + {0xFF000000, 0x00FF0000, 0x0000FF00, 0x00000000}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000} /* 8_8_8_8_REV */ + }; + + static const uint32_t masks_table_rgba[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5 */ + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5_REV */ + {0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000}, /* 8_8_8_8_REV */ + }; + + static const uint32_t masks_table_bgr[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5 */ + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5_REV */ + {0x0000FF00, 0x00FF0000, 0xFF000000, 0x00000000}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000}, /* 8_8_8_8_REV */ + }; + + static const uint32_t masks_table_bgra[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5 */ + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5_REV */ + {0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}, /* 8_8_8_8_REV */ + }; + + static const uint8_t bytes_per_pixel[8] = { + 0, 0, 0, 2, 2, 4, 0, 4 + }; + + const uint8_t * bits; + const uint32_t * masks; + const int index = fb_type & 0x07; + _EGLConfig *config; + unsigned i; + unsigned j; + unsigned k; + + if ( bytes_per_pixel[index] == 0 ) { + _eglLog(_EGL_INFO, + "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.", + __FUNCTION__, __LINE__, fb_type); + return GL_FALSE; + } + + /* Valid types are GL_UNSIGNED_SHORT_5_6_5 and GL_UNSIGNED_INT_8_8_8_8 and + * the _REV versions. + * + * Valid formats are GL_RGBA, GL_RGB, and GL_BGRA. + */ + switch ( fb_format ) { + case GL_RGB: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1]; + masks = masks_table_rgb[index]; + break; + + case GL_RGBA: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2]; + masks = masks_table_rgba[index]; + break; + + case GL_BGR: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1]; + masks = masks_table_bgr[index]; + break; + + case GL_BGRA: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2]; + masks = masks_table_bgra[index]; + break; + + default: + _eglLog(_EGL_WARNING, + "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.", + __FUNCTION__, __LINE__, fb_format); + return GL_FALSE; + } + + config = configs; + for (k = 0; k < num_depth_stencil_bits; k++) { + for (i = 0; i < num_db_modes; i++) { + for (j = 0; j < 2; j++) { + _eglSetConfigAttrib(config, EGL_RED_SIZE, bits[0]); + _eglSetConfigAttrib(config, EGL_GREEN_SIZE, bits[1]); + _eglSetConfigAttrib(config, EGL_BLUE_SIZE, bits[2]); + _eglSetConfigAttrib(config, EGL_ALPHA_SIZE, bits[3]); + _eglSetConfigAttrib(config, EGL_BUFFER_SIZE, + bits[0] + bits[1] + bits[2] + bits[3]); + + _eglSetConfigAttrib(config, EGL_STENCIL_SIZE, stencil_bits[k]); + _eglSetConfigAttrib(config, EGL_DEPTH_SIZE, depth_bits[i]); + + _eglSetConfigAttrib(config, EGL_SURFACE_TYPE, EGL_SCREEN_BIT_MESA | + EGL_PBUFFER_BIT | EGL_PIXMAP_BIT | EGL_WINDOW_BIT); + + config++; + } + } + } + return GL_TRUE; +} diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglconfig.h xpsb-glx-0.19/mesa/src/egl/main/eglconfig.h --- xpsb-glx-0.19/mesa/src/egl/main/eglconfig.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglconfig.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,67 @@ +#ifndef EGLCONFIG_INCLUDED +#define EGLCONFIG_INCLUDED + + +#include "egltypedefs.h" +#include "GL/internal/glcore.h" + + +#define MAX_ATTRIBS 100 +#define FIRST_ATTRIB EGL_BUFFER_SIZE + + +struct _egl_config +{ + EGLConfig Handle; /* the public/opaque handle which names this config */ + EGLint Attrib[MAX_ATTRIBS]; +}; + + +#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL) +#define GET_CONFIG_ATTRIB(CONF, ATTR) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB]) + + +extern void +_eglInitConfig(_EGLConfig *config, EGLint id); + + +extern _EGLConfig * +_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config); + + +extern _EGLConfig * +_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config); + + +extern EGLBoolean +_eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list); + + +extern EGLBoolean +_eglChooseConfig(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); + + +extern EGLBoolean +_eglGetConfigAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); + + +extern EGLBoolean +_eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); + + +extern void +_eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val); + +extern GLboolean +_eglFillInConfigs( _EGLConfig *configs, + GLenum fb_format, GLenum fb_type, + const uint8_t * depth_bits, const uint8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes, + int visType ); + +extern void +_eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode); + + +#endif /* EGLCONFIG_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglcontext.c xpsb-glx-0.19/mesa/src/egl/main/eglcontext.c --- xpsb-glx-0.19/mesa/src/egl/main/eglcontext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglcontext.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,276 @@ +#include +#include +#include +#include "eglconfig.h" +#include "eglcontext.h" +#include "egldisplay.h" +#include "egldriver.h" +#include "eglglobals.h" +#include "eglhash.h" +#include "eglsurface.h" + + +/** + * Initialize the given _EGLContext object to defaults. + */ +EGLBoolean +_eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx, + EGLConfig config, const EGLint *attrib_list) +{ + _EGLConfig *conf; + _EGLDisplay *display = _eglLookupDisplay(dpy); + EGLint i; + + conf = _eglLookupConfig(drv, dpy, config); + if (!conf) { + _eglError(EGL_BAD_CONFIG, "eglCreateContext"); + return EGL_FALSE; + } + + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + switch (attrib_list[i]) { + /* no attribs defined for now */ + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglCreateContext"); + return EGL_NO_CONTEXT; + } + } + + memset(ctx, 0, sizeof(_EGLContext)); + ctx->Display = display; + ctx->Config = conf; + ctx->DrawSurface = EGL_NO_SURFACE; + ctx->ReadSurface = EGL_NO_SURFACE; + + return EGL_TRUE; +} + + +/* + * Assign an EGLContext handle to the _EGLContext object then put it into + * the hash table. + */ +void +_eglSaveContext(_EGLContext *ctx) +{ + assert(ctx); + ctx->Handle = _eglHashGenKey(_eglGlobal.Contexts); + _eglHashInsert(_eglGlobal.Contexts, ctx->Handle, ctx); +} + + +/** + * Remove the given _EGLContext object from the hash table. + */ +void +_eglRemoveContext(_EGLContext *ctx) +{ + _eglHashRemove(_eglGlobal.Contexts, ctx->Handle); +} + + +/** + * Return the _EGLContext object that corresponds to the given + * EGLContext handle. + */ +_EGLContext * +_eglLookupContext(EGLContext ctx) +{ + _EGLContext *c = (_EGLContext *) _eglHashLookup(_eglGlobal.Contexts, ctx); + return c; +} + + +/** + * Return the currently bound _EGLContext object, or NULL. + */ +_EGLContext * +_eglGetCurrentContext(void) +{ + _EGLThreadInfo *t = _eglGetCurrentThread(); + return t->CurrentContext; +} + + +/** + * Just a placeholder/demo function. Real driver will never use this! + */ +EGLContext +_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + EGLContext share_list, const EGLint *attrib_list) +{ +#if 0 /* example code */ + _EGLContext *context; + + context = (_EGLContext *) calloc(1, sizeof(_EGLContext)); + if (!context) + return EGL_NO_CONTEXT; + + if (!_eglInitContext(drv, dpy, context, config, attrib_list)) { + free(context); + return EGL_NO_CONTEXT; + } + + _eglSaveContext(context); + return context->Handle; +#endif + return EGL_NO_CONTEXT; +} + + +/** + * Default fallback routine - drivers should usually override this. + */ +EGLBoolean +_eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx) +{ + _EGLContext *context = _eglLookupContext(ctx); + if (context) { + _eglHashRemove(_eglGlobal.Contexts, ctx); + if (context->IsBound) { + context->DeletePending = EGL_TRUE; + } + else { + free(context); + } + return EGL_TRUE; + } + else { + _eglError(EGL_BAD_CONTEXT, "eglDestroyContext"); + return EGL_TRUE; + } +} + + +EGLBoolean +_eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, + EGLint attribute, EGLint *value) +{ + _EGLContext *c = _eglLookupContext(ctx); + + (void) drv; + (void) dpy; + + if (!c) { + _eglError(EGL_BAD_CONTEXT, "eglQueryContext"); + return EGL_FALSE; + } + + switch (attribute) { + case EGL_CONFIG_ID: + *value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID); + return EGL_TRUE; +#ifdef EGL_VERSION_1_2 + case EGL_CONTEXT_CLIENT_TYPE: + *value = c->ClientAPI; + return EGL_FALSE; +#endif /* EGL_VERSION_1_2 */ + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext"); + return EGL_FALSE; + } +} + + +/** + * Drivers will typically call this to do the error checking and + * update the various IsBound and DeletePending flags. + * Then, the driver will do its device-dependent Make-Current stuff. + */ +EGLBoolean +_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface d, + EGLSurface r, EGLContext context) +{ + _EGLThreadInfo *t = _eglGetCurrentThread(); + _EGLContext *ctx = _eglLookupContext(context); + _EGLSurface *draw = _eglLookupSurface(d); + _EGLSurface *read = _eglLookupSurface(r); + + _EGLContext *oldContext = _eglGetCurrentContext(); + _EGLSurface *oldDrawSurface = _eglGetCurrentSurface(EGL_DRAW); + _EGLSurface *oldReadSurface = _eglGetCurrentSurface(EGL_READ); + + /* error checking */ + if (ctx) { + if (draw == NULL || read == NULL) { + _eglError(EGL_BAD_MATCH, "eglMakeCurrent"); + return EGL_FALSE; + } + if (draw->Config != ctx->Config) { + _eglError(EGL_BAD_MATCH, "eglMakeCurrent"); + return EGL_FALSE; + } + if (read->Config != ctx->Config) { + _eglError(EGL_BAD_MATCH, "eglMakeCurrent"); + return EGL_FALSE; + } + } + + /* + * check if the old context or surfaces need to be deleted + */ + if (oldDrawSurface != NULL) { + oldDrawSurface->IsBound = EGL_FALSE; + if (oldDrawSurface->DeletePending) { + /* make sure we don't try to rebind a deleted surface */ + if (draw == oldDrawSurface || draw == oldReadSurface) { + draw = NULL; + } + /* really delete surface now */ + drv->API.DestroySurface(drv, dpy, oldDrawSurface->Handle); + } + } + if (oldReadSurface != NULL && oldReadSurface != oldDrawSurface) { + oldReadSurface->IsBound = EGL_FALSE; + if (oldReadSurface->DeletePending) { + /* make sure we don't try to rebind a deleted surface */ + if (read == oldDrawSurface || read == oldReadSurface) { + read = NULL; + } + /* really delete surface now */ + drv->API.DestroySurface(drv, dpy, oldReadSurface->Handle); + } + } + if (oldContext != NULL) { + oldContext->IsBound = EGL_FALSE; + if (oldContext->DeletePending) { + /* make sure we don't try to rebind a deleted context */ + if (ctx == oldContext) { + ctx = NULL; + } + /* really delete context now */ + drv->API.DestroyContext(drv, dpy, oldContext->Handle); + } + } + + if (ctx) { + /* check read/draw again, in case we deleted them above */ + if (draw == NULL || read == NULL) { + _eglError(EGL_BAD_MATCH, "eglMakeCurrent"); + return EGL_FALSE; + } + ctx->DrawSurface = draw; + ctx->ReadSurface = read; + ctx->IsBound = EGL_TRUE; + draw->IsBound = EGL_TRUE; + read->IsBound = EGL_TRUE; + } + + t->CurrentContext = ctx; + + return EGL_TRUE; +} + + +/** + * This is defined by the EGL_MESA_copy_context extension. + */ +EGLBoolean +_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, + EGLContext dest, EGLint mask) +{ + /* This function will always have to be overridden/implemented in the + * device driver. If the driver is based on Mesa, use _mesa_copy_context(). + */ + return EGL_FALSE; +} diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglcontext.h xpsb-glx-0.19/mesa/src/egl/main/eglcontext.h --- xpsb-glx-0.19/mesa/src/egl/main/eglcontext.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglcontext.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,71 @@ + +#ifndef EGLCONTEXT_INCLUDED +#define EGLCONTEXT_INCLUDED + + +#include "egltypedefs.h" + + +/** + * "Base" class for device driver contexts. + */ +struct _egl_context +{ + EGLContext Handle; /* The public/opaque handle which names this object */ + + _EGLDisplay *Display; /* who do I belong to? */ + + _EGLConfig *Config; + + _EGLSurface *DrawSurface; + _EGLSurface *ReadSurface; + + EGLBoolean IsBound; + EGLBoolean DeletePending; +#ifdef EGL_VERSION_1_2 + EGLint ClientAPI; /* Either EGL_OPENGL_ES_API or EGL_OPENVG_API */ +#endif /* EGL_VERSION_1_2 */ +}; + + +extern EGLBoolean +_eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx, + EGLConfig config, const EGLint *attrib_list); + + +extern void +_eglSaveContext(_EGLContext *ctx); + + +extern void +_eglRemoveContext(_EGLContext *ctx); + + +extern _EGLContext * +_eglLookupContext(EGLContext ctx); + + +extern _EGLContext * +_eglGetCurrentContext(void); + + +extern EGLContext +_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); + + +extern EGLBoolean +_eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx); + + +extern EGLBoolean +_eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); + + +extern EGLBoolean +_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); + + +extern EGLBoolean +_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask); + +#endif /* EGLCONTEXT_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egldisplay.c xpsb-glx-0.19/mesa/src/egl/main/egldisplay.c --- xpsb-glx-0.19/mesa/src/egl/main/egldisplay.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egldisplay.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,71 @@ +#include +#include +#include "eglcontext.h" +#include "egldisplay.h" +#include "eglglobals.h" +#include "eglhash.h" + + +static char * +my_strdup(const char *s) +{ + int l = strlen(s); + char *s2 = malloc(l + 1); + strcpy(s2, s); + return s2; +} + + +/** + * We're assuming that the NativeDisplayType parameter is actually + * a string. + * Return a new _EGLDisplay object for the given displayName + */ +_EGLDisplay * +_eglNewDisplay(NativeDisplayType displayName) +{ + _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay)); + if (dpy) { + dpy->Handle = _eglHashGenKey(_eglGlobal.Displays); + _eglHashInsert(_eglGlobal.Displays, dpy->Handle, dpy); + if (displayName) + dpy->Name = my_strdup(displayName); + else + dpy->Name = NULL; + dpy->Driver = NULL; /* this gets set later */ + } + return dpy; +} + + +/** + * Return the _EGLDisplay object that corresponds to the given public/ + * opaque display handle. + */ +_EGLDisplay * +_eglLookupDisplay(EGLDisplay dpy) +{ + _EGLDisplay *d = (_EGLDisplay *) _eglHashLookup(_eglGlobal.Displays, dpy); + return d; +} + + +_EGLDisplay * +_eglGetCurrentDisplay(void) +{ + _EGLContext *ctx = _eglGetCurrentContext(); + if (ctx) + return ctx->Display; + else + return NULL; +} + + +void +_eglCleanupDisplay(_EGLDisplay *disp) +{ + /* XXX incomplete */ + free(disp->Configs); + free(disp->Name); + /* driver deletes _EGLDisplay */ +} diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egldisplay.h xpsb-glx-0.19/mesa/src/egl/main/egldisplay.h --- xpsb-glx-0.19/mesa/src/egl/main/egldisplay.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egldisplay.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,44 @@ +#ifndef EGLDISPLAY_INCLUDED +#define EGLDISPLAY_INCLUDED + + +#include "egltypedefs.h" + + +struct _egl_display +{ + EGLDisplay Handle; + + char *Name; + _EGLDriver *Driver; + + EGLint NumScreens; + _EGLScreen **Screens; /* array [NumScreens] */ + + EGLint NumConfigs; + _EGLConfig *Configs; /* array [NumConfigs] */ +}; + + +extern _EGLDisplay * +_eglNewDisplay(NativeDisplayType displayName); + + +extern _EGLDisplay * +_eglLookupDisplay(EGLDisplay dpy); + + +extern _EGLDisplay * +_eglGetCurrentDisplay(void); + + +extern void +_eglCleanupDisplay(_EGLDisplay *disp); + + +extern EGLBoolean +_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value); + + + +#endif /* EGLDISPLAY_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egldriver.c xpsb-glx-0.19/mesa/src/egl/main/egldriver.c --- xpsb-glx-0.19/mesa/src/egl/main/egldriver.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egldriver.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,272 @@ +#include +#include +#include +#include +#include "eglconfig.h" +#include "eglcontext.h" +#include "egldisplay.h" +#include "egldriver.h" +#include "eglglobals.h" +#include "egllog.h" +#include "eglmode.h" +#include "eglscreen.h" +#include "eglsurface.h" + + +const char *DefaultDriverName = "demodriver"; + + +/** + * Choose and open/init the hardware driver for the given EGLDisplay. + * Previously, the EGLDisplay was created with _eglNewDisplay() where + * we recorded the user's NativeDisplayType parameter. + * + * Now we'll use the NativeDisplayType value. + * + * Currently, the native display value is treated as a string. + * If the first character is ':' we interpret it as a screen or card index + * number (i.e. ":0" or ":1", etc) + * Else if the first character is '!' we interpret it as specific driver name + * (i.e. "!r200" or "!i830". + */ +_EGLDriver * +_eglChooseDriver(EGLDisplay display) +{ + _EGLDisplay *dpy = _eglLookupDisplay(display); + _EGLDriver *drv; + const char *driverName = DefaultDriverName; + const char *name; + + assert(dpy); + + name = dpy->Name; + if (!name) { + /* use default */ + } + else if (name[0] == ':' && (name[1] >= '0' && name[1] <= '9') && !name[2]) { + /* XXX probe hardware here to determine which driver to open */ + driverName = "libEGLdri"; + } + else if (name[0] == '!') { + /* use specified driver name */ + driverName = name + 1; + } + else { + /* Maybe display was returned by XOpenDisplay? */ + _eglLog(_EGL_FATAL, "eglChooseDriver() bad name"); + } + + _eglLog(_EGL_INFO, "eglChooseDriver() choosing %s", driverName); + + drv = _eglOpenDriver(dpy, driverName); + dpy->Driver = drv; + + return drv; +} + + +/** + * Open/load the named driver and call its bootstrap function: _eglMain(). + * \return new _EGLDriver object. + */ +_EGLDriver * +_eglOpenDriver(_EGLDisplay *dpy, const char *driverName) +{ + _EGLDriver *drv; + _EGLMain_t mainFunc; + void *lib; + char driverFilename[1000]; + + /* XXX also prepend a directory path??? */ + sprintf(driverFilename, "%s.so", driverName); + + _eglLog(_EGL_DEBUG, "dlopen(%s)", driverFilename); + lib = dlopen(driverFilename, RTLD_NOW); + if (!lib) { + _eglLog(_EGL_WARNING, "Could not open %s (%s)", + driverFilename, dlerror()); + return NULL; + } + + mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain"); + if (!mainFunc) { + _eglLog(_EGL_WARNING, "_eglMain not found in %s", driverFilename); + dlclose(lib); + return NULL; + } + + drv = mainFunc(dpy); + if (!drv) { + dlclose(lib); + return NULL; + } + /* with a recurvise open you want the inner most handle */ + if (!drv->LibHandle) + drv->LibHandle = lib; + else + dlclose(lib); + + drv->Display = dpy; + return drv; +} + + +EGLBoolean +_eglCloseDriver(_EGLDriver *drv, EGLDisplay dpy) +{ + void *handle = drv->LibHandle; + EGLBoolean b; + + _eglLog(_EGL_INFO, "Closing driver"); + + /* + * XXX check for currently bound context/surfaces and delete them? + */ + + b = drv->API.Terminate(drv, dpy); + dlclose(handle); + return b; +} + + +/** + * Given a display handle, return the _EGLDriver for that display. + */ +_EGLDriver * +_eglLookupDriver(EGLDisplay dpy) +{ + _EGLDisplay *d = _eglLookupDisplay(dpy); + if (d) + return d->Driver; + else + return NULL; +} + + +/** + * Plug all the available fallback routines into the given driver's + * dispatch table. + */ +void +_eglInitDriverFallbacks(_EGLDriver *drv) +{ + /* If a pointer is set to NULL, then the device driver _really_ has + * to implement it. + */ + drv->API.Initialize = NULL; + drv->API.Terminate = NULL; + + drv->API.GetConfigs = _eglGetConfigs; + drv->API.ChooseConfig = _eglChooseConfig; + drv->API.GetConfigAttrib = _eglGetConfigAttrib; + + drv->API.CreateContext = _eglCreateContext; + drv->API.DestroyContext = _eglDestroyContext; + drv->API.MakeCurrent = _eglMakeCurrent; + drv->API.QueryContext = _eglQueryContext; + + drv->API.CreateWindowSurface = _eglCreateWindowSurface; + drv->API.CreatePixmapSurface = _eglCreatePixmapSurface; + drv->API.CreatePbufferSurface = _eglCreatePbufferSurface; + drv->API.DestroySurface = _eglDestroySurface; + drv->API.QuerySurface = _eglQuerySurface; + drv->API.SurfaceAttrib = _eglSurfaceAttrib; + drv->API.BindTexImage = _eglBindTexImage; + drv->API.ReleaseTexImage = _eglReleaseTexImage; + drv->API.SwapInterval = _eglSwapInterval; + drv->API.SwapBuffers = _eglSwapBuffers; + drv->API.CopyBuffers = _eglCopyBuffers; + + drv->API.QueryString = _eglQueryString; + drv->API.WaitGL = _eglWaitGL; + drv->API.WaitNative = _eglWaitNative; + +#ifdef EGL_MESA_screen_surface + drv->API.ChooseModeMESA = _eglChooseModeMESA; + drv->API.GetModesMESA = _eglGetModesMESA; + drv->API.GetModeAttribMESA = _eglGetModeAttribMESA; + drv->API.GetScreensMESA = _eglGetScreensMESA; + drv->API.CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA; + drv->API.ShowScreenSurfaceMESA = _eglShowScreenSurfaceMESA; + drv->API.ScreenPositionMESA = _eglScreenPositionMESA; + drv->API.QueryScreenMESA = _eglQueryScreenMESA; + drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA; + drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA; + drv->API.QueryModeStringMESA = _eglQueryModeStringMESA; +#endif /* EGL_MESA_screen_surface */ + +#ifdef EGL_VERSION_1_2 + drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer; +#endif /* EGL_VERSION_1_2 */ +} + + +/** + * Examine the individual extension enable/disable flags and recompute + * the driver's Extensions string. + */ +static void +_eglUpdateExtensionsString(_EGLDriver *drv) +{ + drv->Extensions.String[0] = 0; + + if (drv->Extensions.MESA_screen_surface) + strcat(drv->Extensions.String, "EGL_MESA_screen_surface "); + if (drv->Extensions.MESA_copy_context) + strcat(drv->Extensions.String, "EGL_MESA_copy_context "); + assert(strlen(drv->Extensions.String) < MAX_EXTENSIONS_LEN); +} + + + +const char * +_eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name) +{ + (void) drv; + (void) dpy; + switch (name) { + case EGL_VENDOR: + return "Mesa Project"; + case EGL_VERSION: + return "1.0"; + case EGL_EXTENSIONS: + _eglUpdateExtensionsString(drv); + return drv->Extensions.String; +#ifdef EGL_VERSION_1_2 + case EGL_CLIENT_APIS: + /* XXX need to initialize somewhere */ + return drv->ClientAPIs; +#endif + default: + _eglError(EGL_BAD_PARAMETER, "eglQueryString"); + return NULL; + } +} + + +EGLBoolean +_eglWaitGL(_EGLDriver *drv, EGLDisplay dpy) +{ + /* just a placeholder */ + (void) drv; + (void) dpy; + return EGL_TRUE; +} + + +EGLBoolean +_eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine) +{ + /* just a placeholder */ + (void) drv; + (void) dpy; + switch (engine) { + case EGL_CORE_NATIVE_ENGINE: + break; + default: + _eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)"); + return EGL_FALSE; + } + + return EGL_TRUE; +} diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egldriver.h xpsb-glx-0.19/mesa/src/egl/main/egldriver.h --- xpsb-glx-0.19/mesa/src/egl/main/egldriver.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egldriver.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,81 @@ +#ifndef EGLDRIVER_INCLUDED +#define EGLDRIVER_INCLUDED + + +#include "egltypedefs.h" +#include "eglapi.h" + +/* should probably use a dynamic-length string, but this will do */ +#define MAX_EXTENSIONS_LEN 1000 + + +/** + * Optional EGL extensions info. + */ +struct _egl_extensions +{ + EGLBoolean MESA_screen_surface; + EGLBoolean MESA_copy_context; + + char String[MAX_EXTENSIONS_LEN]; +}; + + +/** + * Base class for device drivers. + */ +struct _egl_driver +{ + EGLBoolean Initialized; /* set by driver after initialized */ + + void *LibHandle; /* dlopen handle */ + + _EGLDisplay *Display; + + int ABIversion; + int APImajor, APIminor; /* returned through eglInitialize */ + const char *ClientAPIs; + + _EGLAPI API; + + _EGLExtensions Extensions; +}; + + +extern _EGLDriver *_eglMain(_EGLDisplay *dpy); + + +extern _EGLDriver * +_eglChooseDriver(EGLDisplay dpy); + + +extern _EGLDriver * +_eglOpenDriver(_EGLDisplay *dpy, const char *driverName); + + +extern EGLBoolean +_eglCloseDriver(_EGLDriver *drv, EGLDisplay dpy); + + +extern _EGLDriver * +_eglLookupDriver(EGLDisplay d); + + +extern void +_eglInitDriverFallbacks(_EGLDriver *drv); + + +extern const char * +_eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name); + + +extern EGLBoolean +_eglWaitGL(_EGLDriver *drv, EGLDisplay dpy); + + +extern EGLBoolean +_eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine); + + + +#endif /* EGLDRIVER_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglglobals.c xpsb-glx-0.19/mesa/src/egl/main/eglglobals.c --- xpsb-glx-0.19/mesa/src/egl/main/eglglobals.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglglobals.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,148 @@ +#include +#include +#include "eglglobals.h" + + +struct _egl_global _eglGlobal = { .Initialized = EGL_FALSE }; + + +/** + * Init the fields in the _eglGlobal struct + * May be safely called more than once. + */ +void +_eglInitGlobals(void) +{ + if (!_eglGlobal.Initialized) { + _eglGlobal.Displays = _eglNewHashTable(); + _eglGlobal.Contexts = _eglNewHashTable(); + _eglGlobal.Surfaces = _eglNewHashTable(); + _eglGlobal.FreeScreenHandle = 1; + _eglGlobal.Initialized = EGL_TRUE; + + _eglGlobal.OpenGLESAPISupported = EGL_TRUE; + _eglGlobal.OpenVGAPISupported = EGL_FALSE; + + /* XXX temporary */ + _eglGlobal.ThreadInfo = _eglNewThreadInfo(); + } +} + + +/** + * Should call this via an atexit handler. + */ +void +_eglDestroyGlobals(void) +{ + /* XXX TODO walk over table entries, deleting each */ + _eglDeleteHashTable(_eglGlobal.Displays); + _eglDeleteHashTable(_eglGlobal.Contexts); + _eglDeleteHashTable(_eglGlobal.Surfaces); +} + + +/** + * Allocate and init a new _EGLThreadInfo object. + */ +_EGLThreadInfo * +_eglNewThreadInfo(void) +{ + _EGLThreadInfo *t = (_EGLThreadInfo *) calloc(1, sizeof(_EGLThreadInfo)); + if (t) { + t->CurrentContext = EGL_NO_CONTEXT; + t->LastError = EGL_SUCCESS; + t->CurrentAPI = EGL_NONE; + } + return t; +} + + +/** + * Delete/free a _EGLThreadInfo object. + */ +void +_eglDeleteThreadData(_EGLThreadInfo *t) +{ + free(t); +} + + + +/** + * Return pointer to calling thread's _EGLThreadInfo object. + * Create a new one if needed. + * Should never return NULL. + */ +_EGLThreadInfo * +_eglGetCurrentThread(void) +{ + _eglInitGlobals(); + + /* XXX temporary */ + return _eglGlobal.ThreadInfo; +} + + +/** + * Record EGL error code. + */ +void +_eglError(EGLint errCode, const char *msg) +{ + _EGLThreadInfo *t = _eglGetCurrentThread(); + const char *s; + + if (t->LastError == EGL_SUCCESS) { + t->LastError = errCode; + + switch (errCode) { + case EGL_BAD_ACCESS: + s = "EGL_BAD_ACCESS"; + break; + case EGL_BAD_ALLOC: + s = "EGL_BAD_ALLOC"; + break; + case EGL_BAD_ATTRIBUTE: + s = "EGL_BAD_ATTRIBUTE"; + break; + case EGL_BAD_CONFIG: + s = "EGL_BAD_CONFIG"; + break; + case EGL_BAD_CONTEXT: + s = "EGL_BAD_CONTEXT"; + break; + case EGL_BAD_CURRENT_SURFACE: + s = "EGL_BAD_CURRENT_SURFACE"; + break; + case EGL_BAD_DISPLAY: + s = "EGL_BAD_DISPLAY"; + break; + case EGL_BAD_MATCH: + s = "EGL_BAD_MATCH"; + break; + case EGL_BAD_NATIVE_PIXMAP: + s = "EGL_BAD_NATIVE_PIXMAP"; + break; + case EGL_BAD_NATIVE_WINDOW: + s = "EGL_BAD_NATIVE_WINDOW"; + break; + case EGL_BAD_PARAMETER: + s = "EGL_BAD_PARAMETER"; + break; + case EGL_BAD_SURFACE: + s = "EGL_BAD_SURFACE"; + break; + case EGL_BAD_SCREEN_MESA: + s = "EGL_BAD_SCREEN_MESA"; + break; + case EGL_BAD_MODE_MESA: + s = "EGL_BAD_MODE_MESA"; + break; + default: + s = "other"; + } + /* XXX temporary */ + fprintf(stderr, "EGL user error 0x%x (%s) in %s\n", errCode, s, msg); + } +} diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglglobals.h xpsb-glx-0.19/mesa/src/egl/main/eglglobals.h --- xpsb-glx-0.19/mesa/src/egl/main/eglglobals.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglglobals.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,68 @@ +#ifndef EGLGLOBALS_INCLUDED +#define EGLGLOBALS_INCLUDED + +#include "egltypedefs.h" +#include "eglhash.h" + + +/** + * Per-thread info + */ +struct _egl_thread_info +{ + EGLint LastError; + _EGLContext *CurrentContext; + EGLenum CurrentAPI; +}; + + +/** + * Global library data + */ +struct _egl_global +{ + EGLBoolean Initialized; + + _EGLHashtable *Displays; + _EGLHashtable *Contexts; + _EGLHashtable *Surfaces; + + EGLScreenMESA FreeScreenHandle; + + /* XXX these may be temporary */ + EGLBoolean OpenGLESAPISupported; + EGLBoolean OpenVGAPISupported; + + /* XXX temporary - should be thread-specific data (TSD) */ + _EGLThreadInfo *ThreadInfo; +}; + + +extern struct _egl_global _eglGlobal; + + +extern void +_eglInitGlobals(void); + + +extern void +_eglDestroyGlobals(void); + + +extern _EGLThreadInfo * +_eglNewThreadInfo(void); + + +extern void +_eglDeleteThreadData(_EGLThreadInfo *t); + + +extern _EGLThreadInfo * +_eglGetCurrentThread(void); + + +extern void +_eglError(EGLint errCode, const char *msg); + + +#endif /* EGLGLOBALS_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglhash.c xpsb-glx-0.19/mesa/src/egl/main/eglhash.c --- xpsb-glx-0.19/mesa/src/egl/main/eglhash.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglhash.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,347 @@ +/** + * \file hash.c + * Generic hash table. + * + * This code taken from Mesa and adapted. + */ + +#include +#include +#include +#include "eglhash.h" + + +#define TABLE_SIZE 1023 /**< Size of lookup table/array */ + +#define HASH_FUNC(K) ((K) % TABLE_SIZE) + + +/* + * Unfinished mutex stuff + */ + +typedef int _EGLMutex; + +static void +_eglInitMutex(_EGLMutex m) +{ +} + +static void +_eglDestroyMutex(_EGLMutex m) +{ +} + +static void +_eglLockMutex(_EGLMutex m) +{ +} + +static void +_eglUnlockMutex(_EGLMutex m) +{ +} + + + +typedef struct _egl_hashentry _EGLHashentry; + +struct _egl_hashentry +{ + EGLuint Key; /**< the entry's key */ + void *Data; /**< the entry's data */ + _EGLHashentry *Next; /**< pointer to next entry */ +}; + + +struct _egl_hashtable +{ + _EGLHashentry *Table[TABLE_SIZE]; /**< the lookup table */ + EGLuint MaxKey; /**< highest key inserted so far */ + _EGLMutex Mutex; /**< mutual exclusion lock */ +}; + + +/** + * Create a new hash table. + * + * \return pointer to a new, empty hash table. + */ +_EGLHashtable * +_eglNewHashTable(void) +{ + _EGLHashtable *table = (_EGLHashtable *) calloc(1, sizeof(_EGLHashtable)); + if (table) { + _eglInitMutex(table->Mutex); + table->MaxKey = 1; + } + return table; +} + + + +/** + * Delete a hash table. + * Frees each entry on the hash table and then the hash table structure itself. + * Note that the caller should have already traversed the table and deleted + * the objects in the table (i.e. We don't free the entries' data pointer). + * + * \param table the hash table to delete. + */ +void +_eglDeleteHashTable(_EGLHashtable *table) +{ + EGLuint i; + assert(table); + for (i = 0; i < TABLE_SIZE; i++) { + _EGLHashentry *entry = table->Table[i]; + while (entry) { + _EGLHashentry *next = entry->Next; + free(entry); + entry = next; + } + } + _eglDestroyMutex(table->Mutex); + free(table); +} + + + +/** + * Lookup an entry in the hash table. + * + * \param table the hash table. + * \param key the key. + * + * \return pointer to user's data or NULL if key not in table + */ +void * +_eglHashLookup(const _EGLHashtable *table, EGLuint key) +{ + EGLuint pos; + const _EGLHashentry *entry; + + assert(table); + + if (!key) + return NULL; + + pos = HASH_FUNC(key); + entry = table->Table[pos]; + while (entry) { + if (entry->Key == key) { + return entry->Data; + } + entry = entry->Next; + } + return NULL; +} + + + +/** + * Insert a key/pointer pair into the hash table. + * If an entry with this key already exists we'll replace the existing entry. + * + * \param table the hash table. + * \param key the key (not zero). + * \param data pointer to user data. + */ +void +_eglHashInsert(_EGLHashtable *table, EGLuint key, void *data) +{ + /* search for existing entry with this key */ + EGLuint pos; + _EGLHashentry *entry; + + assert(table); + assert(key); + + _eglLockMutex(table->Mutex); + + if (key > table->MaxKey) + table->MaxKey = key; + + pos = HASH_FUNC(key); + entry = table->Table[pos]; + while (entry) { + if (entry->Key == key) { + /* replace entry's data */ + entry->Data = data; + _eglUnlockMutex(table->Mutex); + return; + } + entry = entry->Next; + } + + /* alloc and insert new table entry */ + entry = (_EGLHashentry *) malloc(sizeof(_EGLHashentry)); + entry->Key = key; + entry->Data = data; + entry->Next = table->Table[pos]; + table->Table[pos] = entry; + + _eglUnlockMutex(table->Mutex); +} + + + +/** + * Remove an entry from the hash table. + * + * \param table the hash table. + * \param key key of entry to remove. + * + * While holding the hash table's lock, searches the entry with the matching + * key and unlinks it. + */ +void +_eglHashRemove(_EGLHashtable *table, EGLuint key) +{ + EGLuint pos; + _EGLHashentry *entry, *prev; + + assert(table); + assert(key); + + _eglLockMutex(table->Mutex); + + pos = HASH_FUNC(key); + prev = NULL; + entry = table->Table[pos]; + while (entry) { + if (entry->Key == key) { + /* found it! */ + if (prev) { + prev->Next = entry->Next; + } + else { + table->Table[pos] = entry->Next; + } + free(entry); + _eglUnlockMutex(table->Mutex); + return; + } + prev = entry; + entry = entry->Next; + } + + _eglUnlockMutex(table->Mutex); +} + + + +/** + * Get the key of the "first" entry in the hash table. + * + * This is used in the course of deleting all display lists when + * a context is destroyed. + * + * \param table the hash table + * + * \return key for the "first" entry in the hash table. + * + * While holding the lock, walks through all table positions until finding + * the first entry of the first non-empty one. + */ +EGLuint +_eglHashFirstEntry(_EGLHashtable *table) +{ + EGLuint pos; + assert(table); + _eglLockMutex(table->Mutex); + for (pos = 0; pos < TABLE_SIZE; pos++) { + if (table->Table[pos]) { + _eglUnlockMutex(table->Mutex); + return table->Table[pos]->Key; + } + } + _eglUnlockMutex(table->Mutex); + return 0; +} + + +/** + * Given a hash table key, return the next key. This is used to walk + * over all entries in the table. Note that the keys returned during + * walking won't be in any particular order. + * \return next hash key or 0 if end of table. + */ +EGLuint +_eglHashNextEntry(const _EGLHashtable *table, EGLuint key) +{ + const _EGLHashentry *entry; + EGLuint pos; + + assert(table); + assert(key); + + /* Find the entry with given key */ + pos = HASH_FUNC(key); + entry = table->Table[pos]; + while (entry) { + if (entry->Key == key) { + break; + } + entry = entry->Next; + } + + if (!entry) { + /* the key was not found, we can't find next entry */ + return 0; + } + + if (entry->Next) { + /* return next in linked list */ + return entry->Next->Key; + } + else { + /* look for next non-empty table slot */ + pos++; + while (pos < TABLE_SIZE) { + if (table->Table[pos]) { + return table->Table[pos]->Key; + } + pos++; + } + return 0; + } +} + + +/** + * Dump contents of hash table for debugging. + * + * \param table the hash table. + */ +void +_eglHashPrint(const _EGLHashtable *table) +{ + EGLuint i; + assert(table); + for (i = 0; i < TABLE_SIZE; i++) { + const _EGLHashentry *entry = table->Table[i]; + while (entry) { + printf("%u %p\n", entry->Key, entry->Data); + entry = entry->Next; + } + } +} + + + +/** + * Return a new, unused hash key. + */ +EGLuint +_eglHashGenKey(_EGLHashtable *table) +{ + EGLuint k; + + _eglLockMutex(table->Mutex); + k = table->MaxKey; + table->MaxKey++; + _eglUnlockMutex(table->Mutex); + return k; +} + diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglhash.h xpsb-glx-0.19/mesa/src/egl/main/eglhash.h --- xpsb-glx-0.19/mesa/src/egl/main/eglhash.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglhash.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,39 @@ +/** + * \file eglhash.h + * Generic hash table. + */ + + +#ifndef EGLHASH_INCLUDED +#define EGLHASH_INCLUDED + + +/* XXX move this? */ +typedef unsigned int EGLuint; + + +typedef struct _egl_hashtable _EGLHashtable; + + +extern _EGLHashtable *_eglNewHashTable(void); + +extern void _eglDeleteHashTable(_EGLHashtable *table); + +extern void *_eglHashLookup(const _EGLHashtable *table, EGLuint key); + +extern void _eglHashInsert(_EGLHashtable *table, EGLuint key, void *data); + +extern void _eglHashRemove(_EGLHashtable *table, EGLuint key); + +extern EGLuint _eglHashFirstEntry(_EGLHashtable *table); + +extern EGLuint _eglHashNextEntry(const _EGLHashtable *table, EGLuint key); + +extern void _eglHashPrint(const _EGLHashtable *table); + +extern EGLuint _eglHashGenKey(_EGLHashtable *table); + +extern void _egltest_hash_functions(void); + + +#endif /* EGLHASH_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egllog.c xpsb-glx-0.19/mesa/src/egl/main/egllog.c --- xpsb-glx-0.19/mesa/src/egl/main/egllog.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egllog.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,94 @@ +/** + * Logging facility for debug/info messages. + */ + + +#include +#include +#include +#include +#include "egllog.h" + +#define MAXSTRING 1000 +#define FALLBACK_LOG_LEVEL _EGL_DEBUG +#define FALLBACK_LOG_LEVEL_STR "debug" + +static EGLint ReportingLevel = -1; + + +static void +log_level_initialize (void) +{ + char *log_env = getenv ("EGL_LOG_LEVEL"); + + if (log_env == NULL) { + ReportingLevel = FALLBACK_LOG_LEVEL; + } + else if (strcasecmp (log_env, "fatal") == 0) { + ReportingLevel = _EGL_FATAL; + } + else if (strcasecmp (log_env, "warning") == 0) { + ReportingLevel = _EGL_WARNING; + } + else if (strcasecmp (log_env, "info") == 0) { + ReportingLevel = _EGL_INFO; + } + else if (strcasecmp (log_env, "debug") == 0) { + ReportingLevel = _EGL_DEBUG; + } + else { + fprintf (stderr, "Unrecognized EGL_LOG_LEVEL environment variable value. " + "Expected one of \"fatal\", \"warning\", \"info\", \"debug\". " + "Got \"%s\". Falling back to \"%s\".\n", + log_env, FALLBACK_LOG_LEVEL_STR); + ReportingLevel = FALLBACK_LOG_LEVEL; + } +} + + +/** + * Log a message to stderr. + * \param level one of _EGL_FATAL, _EGL_WARNING, _EGL_INFO, _EGL_DEBUG. + */ +void +_eglLog(EGLint level, const char *fmtStr, ...) +{ + va_list args; + char msg[MAXSTRING]; + const char *levelStr; + static int log_level_initialized = 0; + + if (!log_level_initialized) { + log_level_initialize (); + log_level_initialized = 1; + } + + if (level <= ReportingLevel) { + switch (level) { + case _EGL_FATAL: + levelStr = "Fatal"; + break; + case _EGL_WARNING: + levelStr = "Warning"; + break; + case _EGL_INFO: + levelStr = "Info"; + break; + case _EGL_DEBUG: + levelStr = "Debug"; + break; + default: + levelStr = ""; + } + + va_start(args, fmtStr); + vsnprintf(msg, MAXSTRING, fmtStr, args); + va_end(args); + + fprintf(stderr, "EGL %s: %s\n", levelStr, msg); + + if (level == _EGL_FATAL) { + exit(1); /* or abort()? */ + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egllog.h xpsb-glx-0.19/mesa/src/egl/main/egllog.h --- xpsb-glx-0.19/mesa/src/egl/main/egllog.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egllog.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,16 @@ +#ifndef EGLLOG_INCLUDED +#define EGLLOG_INCLUDED + +#include "egltypedefs.h" + +#define _EGL_FATAL 0 /* unrecoverable error */ +#define _EGL_WARNING 1 /* recoverable error/problem */ +#define _EGL_INFO 2 /* just useful info */ +#define _EGL_DEBUG 3 /* useful info for debugging */ + + +extern void +_eglLog(EGLint level, const char *fmtStr, ...); + + +#endif /* EGLLOG_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglmode.c xpsb-glx-0.19/mesa/src/egl/main/eglmode.c --- xpsb-glx-0.19/mesa/src/egl/main/eglmode.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglmode.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,431 @@ +#include +#include +#include +#include + +#include "egldisplay.h" +#include "egldriver.h" +#include "eglmode.h" +#include "eglglobals.h" +#include "eglscreen.h" + + +#define MIN2(A, B) (((A) < (B)) ? (A) : (B)) + + +static char * +my_strdup(const char *s) +{ + if (s) { + int l = strlen(s); + char *s2 = malloc(l + 1); + if (s2) + strcpy(s2, s); + return s2; + } + else { + return NULL; + } +} + + +/** + * Given an EGLModeMESA handle, return the corresponding _EGLMode object + * or null if non-existant. + */ +_EGLMode * +_eglLookupMode(EGLDisplay dpy, EGLModeMESA mode) +{ + const _EGLDisplay *disp = _eglLookupDisplay(dpy); + EGLint scrnum; + + /* loop over all screens on the display */ + for (scrnum = 0; scrnum < disp->NumScreens; scrnum++) { + const _EGLScreen *scrn = disp->Screens[scrnum]; + EGLint i; + /* search list of modes for handle */ + for (i = 0; i < scrn->NumModes; i++) { + if (scrn->Modes[i].Handle == mode) { + return scrn->Modes + i; + } + } + } + + return NULL; +} + + +/** + * Add a new mode with the given attributes (width, height, depth, refreshRate) + * to the given screen. + * Assign a new mode ID/handle to the mode as well. + * \return pointer to the new _EGLMode + */ +_EGLMode * +_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height, + EGLint refreshRate, const char *name) +{ + EGLint n; + _EGLMode *newModes; + + assert(screen); + assert(width > 0); + assert(height > 0); + assert(refreshRate > 0); + + n = screen->NumModes; + newModes = (_EGLMode *) realloc(screen->Modes, (n+1) * sizeof(_EGLMode)); + if (newModes) { + screen->Modes = newModes; + screen->Modes[n].Handle = n + 1; + screen->Modes[n].Width = width; + screen->Modes[n].Height = height; + screen->Modes[n].RefreshRate = refreshRate; + screen->Modes[n].Optimal = EGL_FALSE; + screen->Modes[n].Interlaced = EGL_FALSE; + screen->Modes[n].Name = my_strdup(name); + screen->NumModes++; + return screen->Modes + n; + } + else { + return NULL; + } +} + + + +/** + * Parse the attrib_list to fill in the fields of the given _eglMode + * Return EGL_FALSE if any errors, EGL_TRUE otherwise. + */ +static EGLBoolean +_eglParseModeAttribs(_EGLMode *mode, const EGLint *attrib_list) +{ + EGLint i; + + /* init all attribs to EGL_DONT_CARE */ + mode->Handle = EGL_DONT_CARE; + mode->Width = EGL_DONT_CARE; + mode->Height = EGL_DONT_CARE; + mode->RefreshRate = EGL_DONT_CARE; + mode->Optimal = EGL_DONT_CARE; + mode->Interlaced = EGL_DONT_CARE; + mode->Name = NULL; + + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + switch (attrib_list[i]) { + case EGL_MODE_ID_MESA: + mode->Handle = attrib_list[++i]; + if (mode->Handle <= 0) { + _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(handle)"); + return EGL_FALSE; + } + break; + case EGL_WIDTH: + mode->Width = attrib_list[++i]; + if (mode->Width <= 0) { + _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(width)"); + return EGL_FALSE; + } + break; + case EGL_HEIGHT: + mode->Height = attrib_list[++i]; + if (mode->Height <= 0) { + _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(height)"); + return EGL_FALSE; + } + break; + case EGL_REFRESH_RATE_MESA: + mode->RefreshRate = attrib_list[++i]; + if (mode->RefreshRate <= 0) { + _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(refresh rate)"); + return EGL_FALSE; + } + break; + case EGL_INTERLACED_MESA: + mode->Interlaced = attrib_list[++i]; + if (mode->Interlaced != EGL_TRUE && mode->Interlaced != EGL_FALSE) { + _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(interlaced)"); + return EGL_FALSE; + } + break; + case EGL_OPTIMAL_MESA: + mode->Optimal = attrib_list[++i]; + if (mode->Optimal != EGL_TRUE && mode->Optimal != EGL_FALSE) { + _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(optimal)"); + return EGL_FALSE; + } + break; + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglChooseModeMESA"); + return EGL_FALSE; + } + } + return EGL_TRUE; +} + + +/** + * Determine if the candidate mode's attributes are at least as good + * as the minimal mode's. + * \return EGL_TRUE if qualifies, EGL_FALSE otherwise + */ +static EGLBoolean +_eglModeQualifies(const _EGLMode *c, const _EGLMode *min) +{ + if (min->Handle != EGL_DONT_CARE && c->Handle != min->Handle) + return EGL_FALSE; + if (min->Width != EGL_DONT_CARE && c->Width < min->Width) + return EGL_FALSE; + if (min->Height != EGL_DONT_CARE && c->Height < min->Height) + return EGL_FALSE; + if (min->RefreshRate != EGL_DONT_CARE && c->RefreshRate < min->RefreshRate) + return EGL_FALSE; + if (min->Optimal != EGL_DONT_CARE && c->Optimal != min->Optimal) + return EGL_FALSE; + if (min->Interlaced != EGL_DONT_CARE && c->Interlaced != min->Interlaced) + return EGL_FALSE; + + return EGL_TRUE; +} + + +/** + * Return value of given mode attribute, or -1 if bad attrib. + */ +static EGLint +getModeAttrib(const _EGLMode *m, EGLint attrib) +{ + switch (attrib) { + case EGL_MODE_ID_MESA: + return m->Handle; + case EGL_WIDTH: + return m->Width; + case EGL_HEIGHT: + return m->Height; + case EGL_REFRESH_RATE_MESA: + return m->RefreshRate; + case EGL_OPTIMAL_MESA: + return m->Optimal; + case EGL_INTERLACED_MESA: + return m->Interlaced; + default: + return -1; + } +} + + +#define SMALLER 1 +#define LARGER 2 + +struct sort_info { + EGLint Attrib; + EGLint Order; /* SMALLER or LARGER */ +}; + +/* the order of these entries is the priority */ +static struct sort_info SortInfo[] = { + { EGL_OPTIMAL_MESA, LARGER }, + { EGL_INTERLACED_MESA, SMALLER }, + { EGL_WIDTH, LARGER }, + { EGL_HEIGHT, LARGER }, + { EGL_REFRESH_RATE_MESA, LARGER }, + { EGL_MODE_ID_MESA, SMALLER }, + { 0, 0 } +}; + + +/** + * Compare modes 'a' and 'b' and return -1 if a belongs before b, or 1 if a + * belongs after b, or 0 if they're equal. + * Used by qsort(). + */ +static int +_eglCompareModes(const void *a, const void *b) +{ + const _EGLMode *aMode = *((const _EGLMode **) a); + const _EGLMode *bMode = *((const _EGLMode **) b); + EGLint i; + + for (i = 0; SortInfo[i].Attrib; i++) { + const EGLint aVal = getModeAttrib(aMode, SortInfo[i].Attrib); + const EGLint bVal = getModeAttrib(bMode, SortInfo[i].Attrib); + if (aVal == bVal) { + /* a tie */ + continue; + } + else if (SortInfo[i].Order == SMALLER) { + return (aVal < bVal) ? -1 : 1; + } + else if (SortInfo[i].Order == LARGER) { + return (aVal > bVal) ? -1 : 1; + } + } + + /* all attributes identical */ + return 0; +} + + +/** + * Search for EGLModes which match the given attribute list. + * Called via eglChooseModeMESA API function. + */ +EGLBoolean +_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + const EGLint *attrib_list, EGLModeMESA *modes, + EGLint modes_size, EGLint *num_modes) +{ + const _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + _EGLMode **modeList, min; + EGLint i, count; + + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, "eglChooseModeMESA"); + return EGL_FALSE; + } + + if (!_eglParseModeAttribs(&min, attrib_list)) { + /* error code will have been recorded */ + return EGL_FALSE; + } + + /* allocate array of mode pointers */ + modeList = (_EGLMode **) malloc(modes_size * sizeof(_EGLMode *)); + if (!modeList) { + _eglError(EGL_BAD_MODE_MESA, "eglChooseModeMESA(out of memory)"); + return EGL_FALSE; + } + + /* make array of pointers to qualifying modes */ + for (i = count = 0; i < scrn->NumModes && count < modes_size; i++) { + if (_eglModeQualifies(scrn->Modes + i, &min)) { + modeList[count++] = scrn->Modes + i; + } + } + + /* sort array of pointers */ + qsort(modeList, count, sizeof(_EGLMode *), _eglCompareModes); + + /* copy mode handles to output array */ + for (i = 0; i < count; i++) { + modes[i] = modeList[i]->Handle; + } + + free(modeList); + + *num_modes = count; + + return EGL_TRUE; +} + + + +/** + * Return all possible modes for the given screen. No sorting of results. + * Called via eglGetModesMESA() API function. + */ +EGLBoolean +_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes) +{ + _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, "eglGetModesMESA"); + return EGL_FALSE; + } + + if (modes) { + EGLint i; + *num_modes = MIN2(scrn->NumModes, modes_size); + for (i = 0; i < *num_modes; i++) { + modes[i] = scrn->Modes[i].Handle; + } + } + else { + /* just return total number of supported modes */ + *num_modes = scrn->NumModes; + } + + return EGL_TRUE; +} + + +/** + * Query an attribute of a mode. + */ +EGLBoolean +_eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLModeMESA mode, EGLint attribute, EGLint *value) +{ + _EGLMode *m = _eglLookupMode(dpy, mode); + EGLint v; + + if (!m) { + _eglError(EGL_BAD_MODE_MESA, "eglGetModeAttribMESA"); + return EGL_FALSE; + } + + v = getModeAttrib(m, attribute); + if (v < 0) { + _eglError(EGL_BAD_ATTRIBUTE, "eglGetModeAttribMESA"); + return EGL_FALSE; + } + *value = v; + return EGL_TRUE; +} + + +/** + * Return human-readable string for given mode. + * This is the default function called by eglQueryModeStringMESA(). + */ +const char * +_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode) +{ + _EGLMode *m = _eglLookupMode(dpy, mode); + if (!m) { + _eglError(EGL_BAD_MODE_MESA, "eglQueryModeStringMESA"); + return NULL; + } + return m->Name; +} + + +#if 0 +static int +_eglRand(int max) +{ + return rand() % max; +} + +void +_eglTestModeModule(void) +{ + EGLint count = 30; + _EGLMode *modes = (_EGLMode *) malloc(count * sizeof(_EGLMode)); + _EGLMode **modeList = (_EGLMode **) malloc(count * sizeof(_EGLMode*)); + EGLint i; + + for (i = 0; i < count; i++) { + modes[i].Handle = _eglRand(20); + modes[i].Width = 512 + 256 * _eglRand(2); + modes[i].Height = 512 + 256 * _eglRand(2); + modes[i].RefreshRate = 50 + 5 * _eglRand(3); + modes[i].Interlaced = _eglRand(2); + modes[i].Optimal = _eglRand(4) == 0; + modeList[i] = modes + i; + } + + /* sort array of pointers */ + qsort(modeList, count, sizeof(_EGLMode *), compareModes); + + for (i = 0; i < count; i++) { + _EGLMode *m = modeList[i]; + printf("%2d: %3d %4d x %4d @ %3d opt %d int %d\n", i, + m->Handle, m->Width, m->Height, m->RefreshRate, + m->Optimal, m->Interlaced); + } +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglmode.h xpsb-glx-0.19/mesa/src/egl/main/eglmode.h --- xpsb-glx-0.19/mesa/src/egl/main/eglmode.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglmode.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,54 @@ +#ifndef EGLMODE_INCLUDED +#define EGLMODE_INCLUDED + +#include "egltypedefs.h" + + +/** + * Data structure which corresponds to an EGLModeMESA. + */ +struct _egl_mode +{ + EGLModeMESA Handle; /* the public/opaque handle which names this mode */ + EGLint Width, Height; /* size in pixels */ + EGLint RefreshRate; /* rate * 1000.0 */ + EGLint Optimal; + EGLint Interlaced; + const char *Name; + + /* Other possible attributes */ + /* interlaced */ + /* external sync */ +}; + + +extern _EGLMode * +_eglLookupMode(EGLDisplay dpy, EGLModeMESA mode); + + +extern _EGLMode * +_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height, + EGLint refreshRate, const char *name); + + +extern EGLBoolean +_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + const EGLint *attrib_list, EGLModeMESA *modes, + EGLint modes_size, EGLint *num_modes); + + +extern EGLBoolean +_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); + + +extern EGLBoolean +_eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, + EGLint attribute, EGLint *value); + + +extern const char * +_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode); + + +#endif /* EGLMODE_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglscreen.c xpsb-glx-0.19/mesa/src/egl/main/eglscreen.c --- xpsb-glx-0.19/mesa/src/egl/main/eglscreen.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglscreen.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,328 @@ +/* + * Ideas for screen management extension to EGL. + * + * Each EGLDisplay has one or more screens (CRTs, Flat Panels, etc). + * The screens' handles can be obtained with eglGetScreensMESA(). + * + * A new kind of EGLSurface is possible- one which can be directly scanned + * out on a screen. Such a surface is created with eglCreateScreenSurface(). + * + * To actually display a screen surface on a screen, the eglShowSurface() + * function is called. + */ + +#include +#include +#include + +#include "egldisplay.h" +#include "eglglobals.h" +#include "eglmode.h" +#include "eglconfig.h" +#include "eglsurface.h" +#include "eglscreen.h" + + +/** + * Return a new screen handle/ID. + * NOTE: we never reuse these! + */ +EGLScreenMESA +_eglAllocScreenHandle(void) +{ + EGLScreenMESA s = _eglGlobal.FreeScreenHandle; + _eglGlobal.FreeScreenHandle++; + return s; +} + + +/** + * Initialize an _EGLScreen object to default values. + */ +void +_eglInitScreen(_EGLScreen *screen) +{ + memset(screen, 0, sizeof(_EGLScreen)); + screen->StepX = 1; + screen->StepY = 1; +} + + +/** + * Given a public screen handle, return the internal _EGLScreen object. + */ +_EGLScreen * +_eglLookupScreen(EGLDisplay dpy, EGLScreenMESA screen) +{ + EGLint i; + _EGLDisplay *display = _eglLookupDisplay(dpy); + + if (!display) + return NULL; + + for (i = 0; i < display->NumScreens; i++) { + if (display->Screens[i]->Handle == screen) + return display->Screens[i]; + } + return NULL; +} + + +/** + * Add the given _EGLScreen to the display's list of screens. + */ +void +_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen) +{ + EGLint n; + + assert(display); + assert(screen); + + screen->Handle = _eglAllocScreenHandle(); + n = display->NumScreens; + display->Screens = realloc(display->Screens, (n+1) * sizeof(_EGLScreen *)); + display->Screens[n] = screen; + display->NumScreens++; +} + + + +EGLBoolean +_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, + EGLint max_screens, EGLint *num_screens) +{ + _EGLDisplay *display = _eglLookupDisplay(dpy); + EGLint n; + + if (!display) { + _eglError(EGL_BAD_DISPLAY, "eglGetScreensMESA"); + return EGL_FALSE; + } + + if (display->NumScreens > max_screens) { + n = max_screens; + } + else { + n = display->NumScreens; + } + + if (screens) { + EGLint i; + for (i = 0; i < n; i++) + screens[i] = display->Screens[i]->Handle; + } + if (num_screens) + *num_screens = n; + + return EGL_TRUE; +} + + +/** + * Example function - drivers should do a proper implementation. + */ +EGLSurface +_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) +{ +#if 0 /* THIS IS JUST EXAMPLE CODE */ + _EGLSurface *surf; + + surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface)); + if (!surf) + return EGL_NO_SURFACE; + + if (!_eglInitSurface(drv, dpy, surf, EGL_SCREEN_BIT_MESA, + config, attrib_list)) { + free(surf); + return EGL_NO_SURFACE; + } + + _eglSaveSurface(surf); + + return surf->Handle; +#endif + return EGL_NO_SURFACE; +} + + +/** + * Show the given surface on the named screen. + * If surface is EGL_NO_SURFACE, disable the screen's output. + * + * This is just a placeholder function; drivers will always override + * this with code that _really_ shows the surface. + */ +EGLBoolean +_eglShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLScreenMESA screen, EGLSurface surface, + EGLModeMESA m) +{ + _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + _EGLMode *mode = _eglLookupMode(dpy, m); + + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, "eglShowSurfaceMESA"); + return EGL_FALSE; + } + if (!mode && (m != EGL_NO_MODE_MESA )) { + _eglError(EGL_BAD_MODE_MESA, "eglShowSurfaceMESA"); + return EGL_FALSE; + } + + if (surface == EGL_NO_SURFACE) { + scrn->CurrentSurface = NULL; + } + else { + _EGLSurface *surf = _eglLookupSurface(surface); + if (!surf || surf->Type != EGL_SCREEN_BIT_MESA) { + _eglError(EGL_BAD_SURFACE, "eglShowSurfaceMESA"); + return EGL_FALSE; + } + if (surf->Width < mode->Width || surf->Height < mode->Height) { + _eglError(EGL_BAD_SURFACE, + "eglShowSurfaceMESA(surface smaller than screen size)"); + return EGL_FALSE; + } + + scrn->CurrentSurface = surf; + scrn->CurrentMode = mode; + } + return EGL_TRUE; +} + + +/** + * Set a screen's current display mode. + * Note: mode = EGL_NO_MODE is valid (turns off the screen) + * + * This is just a placeholder function; drivers will always override + * this with code that _really_ sets the mode. + */ +EGLBoolean +_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA mode) +{ + _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, "eglScreenModeMESA"); + return EGL_FALSE; + } + + scrn->CurrentMode = _eglLookupMode(dpy, mode); + + return EGL_TRUE; +} + + +/** + * Set a screen's surface origin. + */ +EGLBoolean +_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLScreenMESA screen, EGLint x, EGLint y) +{ + _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, "eglScreenPositionMESA"); + return EGL_FALSE; + } + + scrn->OriginX = x; + scrn->OriginY = y; + + return EGL_TRUE; +} + + +/** + * Query a screen's current surface. + */ +EGLBoolean +_eglQueryScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLScreenMESA screen, EGLSurface *surface) +{ + const _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + if (scrn->CurrentSurface) + *surface = scrn->CurrentSurface->Handle; + else + *surface = EGL_NO_SURFACE; + return EGL_TRUE; +} + + +/** + * Query a screen's current mode. + */ +EGLBoolean +_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *mode) +{ + const _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + if (scrn->CurrentMode) + *mode = scrn->CurrentMode->Handle; + else + *mode = EGL_NO_MODE_MESA; + return EGL_TRUE; +} + + +EGLBoolean +_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, + EGLint attribute, EGLint *value) +{ + const _EGLScreen *scrn = _eglLookupScreen(dpy, screen); + + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, "eglQueryScreenMESA"); + return EGL_FALSE; + } + + switch (attribute) { + case EGL_SCREEN_POSITION_MESA: + value[0] = scrn->OriginX; + value[1] = scrn->OriginY; + break; + case EGL_SCREEN_POSITION_GRANULARITY_MESA: + value[0] = scrn->StepX; + value[1] = scrn->StepY; + break; + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglQueryScreenMESA"); + return EGL_FALSE; + } + + return EGL_TRUE; +} + + +/** + * Delete the modes associated with given screen. + */ +void +_eglDestroyScreenModes(_EGLScreen *scrn) +{ + EGLint i; + for (i = 0; i < scrn->NumModes; i++) { + if (scrn->Modes[i].Name) + free((char *) scrn->Modes[i].Name); /* cast away const */ + } + if (scrn->Modes) + free(scrn->Modes); + scrn->Modes = NULL; + scrn->NumModes = 0; +} + + +/** + * Default fallback routine - drivers should usually override this. + */ +void +_eglDestroyScreen(_EGLScreen *scrn) +{ + _eglDestroyScreenModes(scrn); + free(scrn); +} + diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglscreen.h xpsb-glx-0.19/mesa/src/egl/main/eglscreen.h --- xpsb-glx-0.19/mesa/src/egl/main/eglscreen.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglscreen.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,90 @@ +#ifndef EGLSCREEN_INCLUDED +#define EGLSCREEN_INCLUDED + + +/** + * Per-screen information. + * Note that an EGL screen doesn't have a size. A screen may be set to + * one of several display modes (width/height/scanrate). The screen + * then displays a drawing surface. The drawing surface must be at least + * as large as the display mode's resolution. If it's larger, the + * OriginX and OriginY fields control what part of the surface is visible + * on the screen. + */ +struct _egl_screen +{ + EGLScreenMESA Handle; /* The public/opaque handle which names this object */ + + _EGLMode *CurrentMode; + _EGLSurface *CurrentSurface; + + EGLint OriginX, OriginY; /**< Origin of scan-out region w.r.t. surface */ + EGLint StepX, StepY; /**< Screen position/origin granularity */ + + EGLint NumModes; + _EGLMode *Modes; /**< array [NumModes] */ +}; + + +extern EGLScreenMESA +_eglAllocScreenHandle(void); + + +extern void +_eglInitScreen(_EGLScreen *screen); + + +extern _EGLScreen * +_eglLookupScreen(EGLDisplay dpy, EGLScreenMESA screen); + + +extern void +_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen); + + +extern EGLBoolean +_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); + + +extern EGLSurface +_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); + + +extern EGLBoolean +_eglShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); + + +extern EGLBoolean +_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA mode); + + +extern EGLBoolean +_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); + + +extern EGLBoolean +_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attribute, EGLint *value); + + +extern EGLBoolean +_eglQueryScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLScreenMESA screen, EGLSurface *surface); + + +extern EGLBoolean +_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); + + +extern EGLBoolean +_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); + + +extern void +_eglDestroyScreenModes(_EGLScreen *scrn); + + +extern void +_eglDestroyScreen(_EGLScreen *scrn); + + +#endif /* EGLSCREEN_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglsurface.c xpsb-glx-0.19/mesa/src/egl/main/eglsurface.c --- xpsb-glx-0.19/mesa/src/egl/main/eglsurface.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglsurface.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,530 @@ +/** + * Surface-related functions. + */ + + +#include +#include +#include +#include "eglcontext.h" +#include "eglconfig.h" +#include "eglglobals.h" +#include "eglhash.h" +#include "egllog.h" +#include "eglsurface.h" + + +/** + * Do error check on parameters and initialize the given _EGLSurface object. + * \return EGL_TRUE if no errors, EGL_FALSE otherwise. + */ +EGLBoolean +_eglInitSurface(_EGLDriver *drv, EGLDisplay dpy, + _EGLSurface *surf, EGLint type, EGLConfig config, + const EGLint *attrib_list) +{ + const char *func; + _EGLConfig *conf; + EGLint width = 0, height = 0, largest = 0; + EGLint texFormat = 0, texTarget = 0, mipmapTex = 0; + EGLint renderBuffer = EGL_BACK_BUFFER; +#ifdef EGL_VERSION_1_2 + EGLint colorspace = EGL_COLORSPACE_sRGB; + EGLint alphaFormat = EGL_ALPHA_FORMAT_NONPRE; +#endif + EGLint i; + + switch (type) { + case EGL_WINDOW_BIT: + func = "eglCreateWindowSurface"; + break; + case EGL_PIXMAP_BIT: + func = "eglCreatePixmapSurface"; + renderBuffer = EGL_SINGLE_BUFFER; + break; + case EGL_PBUFFER_BIT: + func = "eglCreatePBufferSurface"; + break; + case EGL_SCREEN_BIT_MESA: + func = "eglCreateScreenSurface"; + renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */ + break; + default: + _eglLog(_EGL_WARNING, "Bad type in _eglInitSurface"); + return EGL_FALSE; + } + + conf = _eglLookupConfig(drv, dpy, config); + if (!conf) { + _eglError(EGL_BAD_CONFIG, func); + return EGL_FALSE; + } + + /* + * Parse attribute list. Different kinds of surfaces support different + * attributes. + */ + for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { + switch (attrib_list[i]) { + case EGL_WIDTH: + if (type == EGL_PBUFFER_BIT || type == EGL_SCREEN_BIT_MESA) { + width = attrib_list[++i]; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_HEIGHT: + if (type == EGL_PBUFFER_BIT || type == EGL_SCREEN_BIT_MESA) { + height = attrib_list[++i]; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_LARGEST_PBUFFER: + if (type == EGL_PBUFFER_BIT) { + largest = attrib_list[++i]; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_TEXTURE_FORMAT: + if (type == EGL_PBUFFER_BIT) { + texFormat = attrib_list[++i]; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_TEXTURE_TARGET: + if (type == EGL_PBUFFER_BIT) { + texTarget = attrib_list[++i]; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_MIPMAP_TEXTURE: + if (type == EGL_PBUFFER_BIT) { + mipmapTex = attrib_list[++i]; + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; +#ifdef EGL_VERSION_1_2 + case EGL_RENDER_BUFFER: + if (type == EGL_WINDOW_BIT) { + renderBuffer = attrib_list[++i]; + if (renderBuffer != EGL_BACK_BUFFER && + renderBuffer != EGL_SINGLE_BUFFER) { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_COLORSPACE: + if (type == EGL_WINDOW_BIT || + type == EGL_PBUFFER_BIT || + type == EGL_PIXMAP_BIT) { + colorspace = attrib_list[++i]; + if (colorspace != EGL_COLORSPACE_sRGB && + colorspace != EGL_COLORSPACE_LINEAR) { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + case EGL_ALPHA_FORMAT: + if (type == EGL_WINDOW_BIT || + type == EGL_PBUFFER_BIT || + type == EGL_PIXMAP_BIT) { + alphaFormat = attrib_list[++i]; + if (alphaFormat != EGL_ALPHA_FORMAT_NONPRE && + alphaFormat != EGL_ALPHA_FORMAT_PRE) { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + } + else { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + break; + +#endif /* EGL_VERSION_1_2 */ + default: + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + } + + if (width <= 0 || height <= 0) { + _eglError(EGL_BAD_ATTRIBUTE, func); + return EGL_FALSE; + } + + memset(surf, 0, sizeof(_EGLSurface)); + surf->Config = conf; + surf->Type = type; + surf->Width = width; + surf->Height = height; + surf->TextureFormat = texFormat; + surf->TextureTarget = texTarget; + surf->MipmapTexture = mipmapTex; + surf->MipmapLevel = 0; + surf->SwapInterval = 0; +#ifdef EGL_VERSION_1_2 + surf->SwapBehavior = EGL_BUFFER_DESTROYED; /* XXX ok? */ + surf->HorizontalResolution = EGL_UNKNOWN; /* set by caller */ + surf->VerticalResolution = EGL_UNKNOWN; /* set by caller */ + surf->AspectRatio = EGL_UNKNOWN; /* set by caller */ + surf->RenderBuffer = renderBuffer; + surf->AlphaFormat = alphaFormat; + surf->Colorspace = colorspace; +#endif + + return EGL_TRUE; +} + + +void +_eglSaveSurface(_EGLSurface *surf) +{ + assert(surf); + assert(!surf->Handle); + surf->Handle = _eglHashGenKey(_eglGlobal.Contexts); + assert(surf->Handle); + _eglHashInsert(_eglGlobal.Surfaces, surf->Handle, surf); +} + + +void +_eglRemoveSurface(_EGLSurface *surf) +{ + _eglHashRemove(_eglGlobal.Surfaces, surf->Handle); +} + + +_EGLSurface * +_eglLookupSurface(EGLSurface surf) +{ + _EGLSurface *c = (_EGLSurface *) _eglHashLookup(_eglGlobal.Surfaces, surf); + return c; +} + + +_EGLSurface * +_eglGetCurrentSurface(EGLint readdraw) +{ + _EGLContext *ctx = _eglGetCurrentContext(); + if (ctx) { + switch (readdraw) { + case EGL_DRAW: + return ctx->DrawSurface; + case EGL_READ: + return ctx->ReadSurface; + default: + return NULL; + } + } + return NULL; +} + + +EGLBoolean +_eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw) +{ + /* Basically just do error checking here. Drivers have to do the + * actual buffer swap. + */ + _EGLContext *context = _eglGetCurrentContext(); + _EGLSurface *surface = _eglLookupSurface(draw); + if (context && context->DrawSurface != surface) { + _eglError(EGL_BAD_SURFACE, "eglSwapBuffers"); + return EGL_FALSE; + } + if (surface == NULL) { + _eglError(EGL_BAD_SURFACE, "eglSwapBuffers"); + return EGL_FALSE; + } + return EGL_TRUE; +} + + +EGLBoolean +_eglCopyBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, + NativePixmapType target) +{ + /* copy surface to native pixmap */ + /* All implementation burdon for this is in the device driver */ + return EGL_FALSE; +} + + +EGLBoolean +_eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf, + EGLint attribute, EGLint *value) +{ + _EGLSurface *surface = _eglLookupSurface(surf); + if (surface == NULL) { + _eglError(EGL_BAD_SURFACE, "eglQuerySurface"); + return EGL_FALSE; + } + switch (attribute) { + case EGL_WIDTH: + *value = surface->Width; + return EGL_TRUE; + case EGL_HEIGHT: + *value = surface->Height; + return EGL_TRUE; + case EGL_CONFIG_ID: + *value = GET_CONFIG_ATTRIB(surface->Config, EGL_CONFIG_ID); + return EGL_TRUE; + /*XXX case EGL_LARGEST_PBUFFER:*/ + case EGL_SURFACE_TYPE: + *value = surface->Type; + return EGL_TRUE; +#ifdef EGL_VERSION_1_1 + case EGL_TEXTURE_FORMAT: + /* texture attributes: only for pbuffers, no error otherwise */ + if (surface->Type == EGL_PBUFFER_BIT) + *value = surface->TextureFormat; + return EGL_TRUE; + case EGL_TEXTURE_TARGET: + if (surface->Type == EGL_PBUFFER_BIT) + *value = surface->TextureTarget; + return EGL_TRUE; + case EGL_MIPMAP_TEXTURE: + if (surface->Type == EGL_PBUFFER_BIT) + *value = surface->MipmapTexture; + return EGL_TRUE; + case EGL_MIPMAP_LEVEL: + if (surface->Type == EGL_PBUFFER_BIT) + *value = surface->MipmapLevel; + return EGL_TRUE; +#endif /* EGL_VERSION_1_1 */ +#ifdef EGL_VERSION_1_2 + case EGL_SWAP_BEHAVIOR: + *value = surface->SwapBehavior; + return EGL_TRUE; + case EGL_RENDER_BUFFER: + *value = surface->RenderBuffer; + return EGL_TRUE; + case EGL_PIXEL_ASPECT_RATIO: + *value = surface->AspectRatio; + return EGL_TRUE; + case EGL_HORIZONTAL_RESOLUTION: + *value = surface->HorizontalResolution; + return EGL_TRUE; + case EGL_VERTICAL_RESOLUTION: + *value = surface->VerticalResolution; + return EGL_TRUE; + case EGL_ALPHA_FORMAT: + *value = surface->AlphaFormat; + return EGL_TRUE; + case EGL_COLORSPACE: + *value = surface->Colorspace; + return EGL_TRUE; +#endif /* EGL_VERSION_1_2 */ + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface"); + return EGL_FALSE; + } +} + + +/** + * Example function - drivers should do a proper implementation. + */ +EGLSurface +_eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + NativeWindowType window, const EGLint *attrib_list) +{ +#if 0 /* THIS IS JUST EXAMPLE CODE */ + _EGLSurface *surf; + + surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface)); + if (!surf) + return EGL_NO_SURFACE; + + if (!_eglInitSurface(drv, dpy, surf, EGL_WINDOW_BIT, config, attrib_list)) { + free(surf); + return EGL_NO_SURFACE; + } + + _eglSaveSurface(surf); + + return surf->Handle; +#endif + return EGL_NO_SURFACE; +} + + +/** + * Example function - drivers should do a proper implementation. + */ +EGLSurface +_eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + NativePixmapType pixmap, const EGLint *attrib_list) +{ +#if 0 /* THIS IS JUST EXAMPLE CODE */ + _EGLSurface *surf; + + surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface)); + if (!surf) + return EGL_NO_SURFACE; + + if (!_eglInitSurface(drv, dpy, surf, EGL_PIXMAP_BIT, config, attrib_list)) { + free(surf); + return EGL_NO_SURFACE; + } + + _eglSaveSurface(surf); + + return surf->Handle; +#endif + return EGL_NO_SURFACE; +} + + +/** + * Example function - drivers should do a proper implementation. + */ +EGLSurface +_eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) +{ +#if 0 /* THIS IS JUST EXAMPLE CODE */ + _EGLSurface *surf; + + surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface)); + if (!surf) + return EGL_NO_SURFACE; + + if (!_eglInitSurface(drv, dpy, surf, EGL_PBUFFER_BIT, config, attrib_list)) { + free(surf); + return EGL_NO_SURFACE; + } + + _eglSaveSurface(surf); + + return surf->Handle; +#endif + return EGL_NO_SURFACE; +} + + +/** + * Default fallback routine - drivers should usually override this. + */ +EGLBoolean +_eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface) +{ + _EGLSurface *surf = _eglLookupSurface(surface); + if (surf) { + _eglHashRemove(_eglGlobal.Surfaces, surface); + if (surf->IsBound) { + surf->DeletePending = EGL_TRUE; + } + else { + free(surf); + } + return EGL_TRUE; + } + else { + _eglError(EGL_BAD_SURFACE, "eglDestroySurface"); + return EGL_FALSE; + } +} + + +/** + * Default fallback routine - drivers might override this. + */ +EGLBoolean +_eglSurfaceAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf, EGLint attribute, EGLint value) +{ + _EGLSurface *surface = _eglLookupSurface(surf); + + if (surface == NULL) { + _eglError(EGL_BAD_SURFACE, "eglSurfaceAttrib"); + return EGL_FALSE; + } + + switch (attribute) { + case EGL_MIPMAP_LEVEL: + surface->MipmapLevel = value; + break; + default: + _eglError(EGL_BAD_ATTRIBUTE, "eglSurfaceAttrib"); + return EGL_FALSE; + } + return EGL_TRUE; +} + + +EGLBoolean +_eglBindTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer) +{ + /* XXX unfinished */ + return EGL_FALSE; +} + + +EGLBoolean +_eglReleaseTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer) +{ + /* XXX unfinished */ + return EGL_FALSE; +} + + +EGLBoolean +_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval) +{ + _EGLSurface *surf = _eglGetCurrentSurface(EGL_DRAW); + if (surf == NULL) { + _eglError(EGL_BAD_SURFACE, "eglSwapInterval"); + return EGL_FALSE; + } + surf->SwapInterval = interval; + return EGL_TRUE; +} + + +#ifdef EGL_VERSION_1_2 + +/** + * Example function - drivers should do a proper implementation. + */ +EGLSurface +_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy, + EGLenum buftype, EGLClientBuffer buffer, + EGLConfig config, const EGLint *attrib_list) +{ + if (buftype != EGL_OPENVG_IMAGE) { + _eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer"); + return EGL_NO_SURFACE; + } + + return EGL_NO_SURFACE; +} + +#endif /* EGL_VERSION_1_2 */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/eglsurface.h xpsb-glx-0.19/mesa/src/egl/main/eglsurface.h --- xpsb-glx-0.19/mesa/src/egl/main/eglsurface.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/eglsurface.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,117 @@ +#ifndef EGLSURFACE_INCLUDED +#define EGLSURFACE_INCLUDED + + +#include "egltypedefs.h" + + +/** + * "Base" class for device driver surfaces. + */ +struct _egl_surface +{ + EGLSurface Handle; /* The public/opaque handle which names this object */ + _EGLConfig *Config; + + /* May need reference counting here */ + EGLBoolean IsBound; + EGLBoolean DeletePending; + + EGLint Type; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */ + EGLint Width, Height; + EGLint TextureFormat, TextureTarget; + EGLint MipmapTexture, MipmapLevel; + EGLint SwapInterval; + + /* If type == EGL_SCREEN_BIT: */ + EGLint VisibleRefCount; /* number of screens I'm displayed on */ + +#ifdef EGL_VERSION_1_2 + EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */ + EGLint HorizontalResolution, VerticalResolution; + EGLint AspectRatio; + EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */ + EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */ + EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */ +#endif /* EGL_VERSION_1_2 */ +}; + + +extern EGLBoolean +_eglInitSurface(_EGLDriver *drv, EGLDisplay dpy, + _EGLSurface *surf, EGLint type, EGLConfig config, + const EGLint *attrib_list); + + +extern void +_eglSaveSurface(_EGLSurface *surf); + + +extern void +_eglRemoveSurface(_EGLSurface *surf); + + +extern _EGLSurface * +_eglLookupSurface(EGLSurface surf); + + +extern _EGLSurface * +_eglGetCurrentSurface(EGLint readdraw); + + +extern EGLBoolean +_eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw); + + +extern EGLBoolean +_eglCopyBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, NativePixmapType target); + + +extern EGLBoolean +_eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); + + +extern EGLSurface +_eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list); + + +extern EGLSurface +_eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); + + +extern EGLSurface +_eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); + + +extern EGLBoolean +_eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface); + + +extern EGLBoolean +_eglSurfaceAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); + + +extern EGLBoolean +_eglBindTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer); + + +extern EGLBoolean +_eglReleaseTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer); + + +extern EGLBoolean +_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval); + + +#ifdef EGL_VERSION_1_2 + +extern EGLSurface +_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy, + EGLenum buftype, EGLClientBuffer buffer, + EGLConfig config, const EGLint *attrib_list); + +#endif /* EGL_VERSION_1_2 */ + + + +#endif /* EGLSURFACE_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/egltypedefs.h xpsb-glx-0.19/mesa/src/egl/main/egltypedefs.h --- xpsb-glx-0.19/mesa/src/egl/main/egltypedefs.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/egltypedefs.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,34 @@ +#ifndef EGLTYPEDEFS_INCLUDED +#define EGLTYPEDEFS_INCLUDED + + +#include + + +typedef struct _egl_api _EGLAPI; + +typedef struct _egl_config _EGLConfig; + +typedef struct _egl_context _EGLContext; + +typedef struct _egl_display _EGLDisplay; + +typedef struct _egl_driver _EGLDriver; + +typedef struct _egl_extensions _EGLExtensions; + +typedef struct _egl_mode _EGLMode; + +typedef struct _egl_screen _EGLScreen; + +typedef struct _egl_surface _EGLSurface; + +typedef struct _egl_thread_info _EGLThreadInfo; + + +typedef void (*_EGLProc)(); + +typedef _EGLDriver *(*_EGLMain_t)(_EGLDisplay *dpy); + + +#endif /* EGLTYPEDEFS_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/egl/main/Makefile xpsb-glx-0.19/mesa/src/egl/main/Makefile --- xpsb-glx-0.19/mesa/src/egl/main/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/main/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,67 @@ +# src/egl/main/Makefile + +TOP = ../../.. +include $(TOP)/configs/current + + +INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi + +HEADERS = \ + eglconfig.h \ + eglcontext.h \ + egldisplay.h \ + egldriver.h \ + eglglobals.h \ + egllog.h \ + eglhash.h \ + eglmode.h \ + eglscreen.h \ + eglsurface.h + +SOURCES = \ + eglapi.c \ + eglconfig.c \ + eglcontext.c \ + egldisplay.c \ + egldriver.c \ + eglglobals.c \ + egllog.c \ + eglhash.c \ + eglmode.c \ + eglscreen.c \ + eglsurface.c + +OBJECTS = $(SOURCES:.c=.o) + + +.c.o: + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ + + + +default: depend library + + +# EGL Library +library: $(TOP)/$(LIB_DIR)/libEGL.so + +$(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS) + $(MKLIB) -o EGL -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major 1 -minor 0 \ + -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) + + + +clean: + -rm -f *.o *.so* + -rm -f core.* + + +depend: $(SOURCES) $(HEADERS) + @ echo "running $(MKDEP)" + @ touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \ + $(SOURCES) $(HEADERS) > /dev/null + +include depend +# DO NOT DELETE diff -Nru xpsb-glx-0.19/mesa/src/egl/Makefile xpsb-glx-0.19/mesa/src/egl/Makefile --- xpsb-glx-0.19/mesa/src/egl/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/egl/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,24 @@ +# src/egl/Makefile + +TOP = ../.. + +SUBDIRS = main drivers/demo drivers/dri + + +default: subdirs + + +subdirs: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + fi \ + done + + +clean: + -@for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) clean) ; \ + fi \ + done diff -Nru xpsb-glx-0.19/mesa/src/glu/descrip.mms xpsb-glx-0.19/mesa/src/glu/descrip.mms --- xpsb-glx-0.19/mesa/src/glu/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/descrip.mms 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,9 @@ +# Makefile for Mesa for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +all : +# PIPE is avalailable on VMS7.0 and higher. For lower versions split the +#command in two conditional command. JJ + if f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .nes. "" then pipe set default [.sgi] ; $(MMS)$(MMSQUALIFIERS) + if f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .eqs. "" then pipe set default [.mesa] ; $(MMS)$(MMSQUALIFIERS) + set default [-] diff -Nru xpsb-glx-0.19/mesa/src/glu/glu.pc.in xpsb-glx-0.19/mesa/src/glu/glu.pc.in --- xpsb-glx-0.19/mesa/src/glu/glu.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/glu.pc.in 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,13 @@ +prefix=@INSTALL_DIR@ +exec_prefix=${prefix} +libdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: glu +Description: Mesa OpenGL Utility library +Requires: @GLU_PC_REQ@ +Requires.private: @GLU_PC_REQ_PRIV@ +Version: @VERSION@ +Libs: -L${libdir} -lGLU +Libs.private: @GLU_PC_LIB_PRIV@ +Cflags: -I${includedir} @GLU_PC_CFLAGS@ diff -Nru xpsb-glx-0.19/mesa/src/glu/Makefile xpsb-glx-0.19/mesa/src/glu/Makefile --- xpsb-glx-0.19/mesa/src/glu/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,39 @@ +# src/glu/Makefile + +TOP = ../.. + +include $(TOP)/configs/current + + +SUBDIRS = $(GLU_DIRS) + + +default: $(TOP)/configs/current + @for dir in $(SUBDIRS) ; do \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + done + +# GLU pkg-config file +pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ + -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ + -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ + -e 's,@GLU_PC_REQ@,$(GLU_PC_REQ),' \ + -e 's,@GLU_PC_REQ_PRIV@,$(GLU_PC_REQ_PRIV),' \ + -e 's,@GLU_PC_LIB_PRIV@,$(GLU_PC_LIB_PRIV),' \ + -e 's,@GLU_PC_CFLAGS@,$(GLU_PC_CFLAGS),' +glu.pc: glu.pc.in + $(pcedit) $< > $@ + +install: glu.pc + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + $(INSTALL) $(TOP)/$(LIB_DIR)/$(GLU_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + +clean: + -@for dir in $(SUBDIRS) ; do \ + (cd $$dir && $(MAKE) clean) ; \ + done + -rm -f *.pc diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/all.h xpsb-glx-0.19/mesa/src/glu/mesa/all.h --- xpsb-glx-0.19/mesa/src/glu/mesa/all.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/all.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,54 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file includes all .h files needed for the GLU source code for + * the purpose of precompiled headers. + * + * If the preprocessor symbol PCH is defined at compile time then each + * of the .c files will #include "all.h" only, instead of a bunch of + * individual .h files. + */ + + +#ifndef GLU_ALL_H +#define GLU_ALL_H + + +#ifndef PC_HEADER +This is an error. all.h should be included only if PCH is defined. +#endif + + +#include +#include +#include +#include +#include +#include "GL/gl.h" +#include "GL/glu.h" +#include "gluP.h" +#include "nurbs.h" +#include "tess.h" + + +#endif /*GLU_ALL_H */ diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/descrip.mms xpsb-glx-0.19/mesa/src/glu/mesa/descrip.mms --- xpsb-glx-0.19/mesa/src/glu/mesa/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/descrip.mms 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,61 @@ +# Makefile for GLU for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +.first + define gl [-.include.gl] + +.include [-]mms-config. + +##### MACROS ##### + +VPATH = RCS + +INCDIR = $disk2:[-.include] +LIBDIR = [-.lib] +CFLAGS = /include=$(INCDIR)/define=(FBIND=1)/name=(as_is,short)/float=ieee/ieee=denorm + +SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ + polytest.c project.c quadric.c tess.c tesselat.c + +OBJECTS =glu.obj,mipmap.obj,nurbs.obj,nurbscrv.obj,nurbssrf.obj,nurbsutl.obj,\ + polytest.obj,project.obj,quadric.obj,tess.obj,tesselat.obj + + +##### RULES ##### + +VERSION=MesaGlu V3.2 + +##### TARGETS ##### + +# Make the library: +$(LIBDIR)$(GLU_LIB) : $(OBJECTS) +.ifdef SHARE + @ WRITE_ SYS$OUTPUT " generating mesagl1.opt" + @ OPEN_/WRITE FILE mesagl1.opt + @ WRITE_ FILE "!" + @ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)" + @ WRITE_ FILE "!" + @ WRITE_ FILE "IDENTIFICATION=""$(VERSION)""" + @ WRITE_ FILE "GSMATCH=LEQUAL,3,2 + @ WRITE_ FILE "$(OBJECTS)" + @ WRITE_ FILE "[-.lib]libmesagl.exe/SHARE" + @ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE" + @ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE" + @ CLOSE_ FILE + @ WRITE_ SYS$OUTPUT " generating mesagl.map ..." + @ LINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT + @ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..." + @ @[-.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt + @ WRITE_ SYS$OUTPUT " linking $(GLU_LIB) ..." + @ LINK_/noinform/NODEB/SHARE=$(GLU_LIB)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt +.else + @ $(MAKELIB) $(GLU_LIB) $(OBJECTS) +.endif + @ rename $(GLU_LIB)* $(LIBDIR) + +clean : + delete *.obj;* + purge + +include mms_depend. + diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/glu.c xpsb-glx-0.19/mesa/src/glu/mesa/glu.c --- xpsb-glx-0.19/mesa/src/glu/mesa/glu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/glu.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,416 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include +#include +#include "gluP.h" +#endif + + +/* + * Miscellaneous utility functions + */ + + +#ifndef M_PI +#define M_PI 3.1415926536 +#endif +#define EPS 0.00001 + +#ifndef GLU_INCOMPATIBLE_GL_VERSION +#define GLU_INCOMPATIBLE_GL_VERSION 100903 +#endif + + +void GLAPIENTRY +gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, + GLdouble centerx, GLdouble centery, GLdouble centerz, + GLdouble upx, GLdouble upy, GLdouble upz) +{ + GLdouble m[16]; + GLdouble x[3], y[3], z[3]; + GLdouble mag; + + /* Make rotation matrix */ + + /* Z vector */ + z[0] = eyex - centerx; + z[1] = eyey - centery; + z[2] = eyez - centerz; + mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); + if (mag) { /* mpichler, 19950515 */ + z[0] /= mag; + z[1] /= mag; + z[2] /= mag; + } + + /* Y vector */ + y[0] = upx; + y[1] = upy; + y[2] = upz; + + /* X vector = Y cross Z */ + x[0] = y[1] * z[2] - y[2] * z[1]; + x[1] = -y[0] * z[2] + y[2] * z[0]; + x[2] = y[0] * z[1] - y[1] * z[0]; + + /* Recompute Y = Z cross X */ + y[0] = z[1] * x[2] - z[2] * x[1]; + y[1] = -z[0] * x[2] + z[2] * x[0]; + y[2] = z[0] * x[1] - z[1] * x[0]; + + /* mpichler, 19950515 */ + /* cross product gives area of parallelogram, which is < 1.0 for + * non-perpendicular unit-length vectors; so normalize x, y here + */ + + mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); + if (mag) { + x[0] /= mag; + x[1] /= mag; + x[2] /= mag; + } + + mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); + if (mag) { + y[0] /= mag; + y[1] /= mag; + y[2] /= mag; + } + +#define M(row,col) m[col*4+row] + M(0, 0) = x[0]; + M(0, 1) = x[1]; + M(0, 2) = x[2]; + M(0, 3) = 0.0; + M(1, 0) = y[0]; + M(1, 1) = y[1]; + M(1, 2) = y[2]; + M(1, 3) = 0.0; + M(2, 0) = z[0]; + M(2, 1) = z[1]; + M(2, 2) = z[2]; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; +#undef M + glMultMatrixd(m); + + /* Translate Eye to Origin */ + glTranslated(-eyex, -eyey, -eyez); + +} + + + +void GLAPIENTRY +gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) +{ + glOrtho(left, right, bottom, top, -1.0, 1.0); +} + + + +static void +frustum(GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval) +{ + GLdouble x, y, a, b, c, d; + GLdouble m[16]; + + x = (2.0 * nearval) / (right - left); + y = (2.0 * nearval) / (top - bottom); + a = (right + left) / (right - left); + b = (top + bottom) / (top - bottom); + c = -(farval + nearval) / ( farval - nearval); + d = -(2.0 * farval * nearval) / (farval - nearval); + +#define M(row,col) m[col*4+row] + M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F; + M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F; + M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d; + M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F; +#undef M + + glMultMatrixd(m); +} + + +void GLAPIENTRY +gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLdouble xmin, xmax, ymin, ymax; + + ymax = zNear * tan(fovy * M_PI / 360.0); + ymin = -ymax; + xmin = ymin * aspect; + xmax = ymax * aspect; + + /* don't call glFrustum() because of error semantics (covglu) */ + frustum(xmin, xmax, ymin, ymax, zNear, zFar); +} + + + +void GLAPIENTRY +gluPickMatrix(GLdouble x, GLdouble y, + GLdouble width, GLdouble height, GLint viewport[4]) +{ + GLfloat m[16]; + GLfloat sx, sy; + GLfloat tx, ty; + + sx = viewport[2] / width; + sy = viewport[3] / height; + tx = (viewport[2] + 2.0 * (viewport[0] - x)) / width; + ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height; + +#define M(row,col) m[col*4+row] + M(0, 0) = sx; + M(0, 1) = 0.0; + M(0, 2) = 0.0; + M(0, 3) = tx; + M(1, 0) = 0.0; + M(1, 1) = sy; + M(1, 2) = 0.0; + M(1, 3) = ty; + M(2, 0) = 0.0; + M(2, 1) = 0.0; + M(2, 2) = 1.0; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; +#undef M + + glMultMatrixf(m); +} + + + +const GLubyte *GLAPIENTRY +gluErrorString(GLenum errorCode) +{ + static char *tess_error[] = { + "missing gluBeginPolygon", + "missing gluBeginContour", + "missing gluEndPolygon", + "missing gluEndContour", + "misoriented or self-intersecting loops", + "coincident vertices", + "colinear vertices", + "FIST recovery process fatal error" + }; + static char *nurbs_error[] = { + "spline order un-supported", + "too few knots", + "valid knot range is empty", + "decreasing knot sequence knot", + "knot multiplicity greater than order of spline", + "endcurve() must follow bgncurve()", + "bgncurve() must precede endcurve()", + "missing or extra geometric data", + "can't draw pwlcurves", + "missing bgncurve()", + "missing bgnsurface()", + "endtrim() must precede endsurface()", + "bgnsurface() must precede endsurface()", + "curve of improper type passed as trim curve", + "bgnsurface() must precede bgntrim()", + "endtrim() must follow bgntrim()", + "bgntrim() must precede endtrim()", + "invalid or missing trim curve", + "bgntrim() must precede pwlcurve()", + "pwlcurve referenced twice", + "pwlcurve and nurbscurve mixed", + "improper usage of trim data type", + "nurbscurve referenced twice", + "nurbscurve and pwlcurve mixed", + "nurbssurface referenced twice", + "invalid property", + "endsurface() must follow bgnsurface()", + "misoriented trim curves", + "intersecting trim curves", + "UNUSED", + "unconnected trim curves", + "unknown knot error", + "negative vertex count encountered", + "negative byte-stride encountered", + "unknown type descriptor", + "null control array or knot vector", + "duplicate point on pwlcurve" + }; + + /* GL Errors */ + if (errorCode == GL_NO_ERROR) { + return (GLubyte *) "no error"; + } + else if (errorCode == GL_INVALID_VALUE) { + return (GLubyte *) "invalid value"; + } + else if (errorCode == GL_INVALID_ENUM) { + return (GLubyte *) "invalid enum"; + } + else if (errorCode == GL_INVALID_OPERATION) { + return (GLubyte *) "invalid operation"; + } + else if (errorCode == GL_STACK_OVERFLOW) { + return (GLubyte *) "stack overflow"; + } + else if (errorCode == GL_STACK_UNDERFLOW) { + return (GLubyte *) "stack underflow"; + } + else if (errorCode == GL_OUT_OF_MEMORY) { + return (GLubyte *) "out of memory"; + } + /* GLU Errors */ + else if (errorCode == GLU_NO_ERROR) { + return (GLubyte *) "no error"; + } + else if (errorCode == GLU_INVALID_ENUM) { + return (GLubyte *) "invalid enum"; + } + else if (errorCode == GLU_INVALID_VALUE) { + return (GLubyte *) "invalid value"; + } + else if (errorCode == GLU_OUT_OF_MEMORY) { + return (GLubyte *) "out of memory"; + } + else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) { + return (GLubyte *) "incompatible GL version"; + } + else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) { + return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1]; + } + else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) { + return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1]; + } + else { + return NULL; + } +} + + + +/* + * New in GLU 1.1 + */ + +const GLubyte *GLAPIENTRY +gluGetString(GLenum name) +{ + static char *extensions = "GL_EXT_abgr"; + static char *version = "1.1 Mesa 3.5"; + + switch (name) { + case GLU_EXTENSIONS: + return (GLubyte *) extensions; + case GLU_VERSION: + return (GLubyte *) version; + default: + return NULL; + } +} + + + +#if 0 /* gluGetProcAddressEXT not finalized yet! */ + +#ifdef __cplusplus + /* for BeOS R4.5 */ +void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...) +#else +void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) () +#endif +{ + struct proc + { + const char *name; + void *address; + }; + static struct proc procTable[] = { + {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */ + + /* new 1.1 functions */ + {"gluGetString", (void *) gluGetString}, + + /* new 1.2 functions */ + {"gluTessBeginPolygon", (void *) gluTessBeginPolygon}, + {"gluTessBeginContour", (void *) gluTessBeginContour}, + {"gluTessEndContour", (void *) gluTessEndContour}, + {"gluTessEndPolygon", (void *) gluTessEndPolygon}, + {"gluGetTessProperty", (void *) gluGetTessProperty}, + + /* new 1.3 functions */ + + {NULL, NULL} + }; + GLuint i; + + for (i = 0; procTable[i].address; i++) { + if (strcmp((const char *) procName, procTable[i].name) == 0) + return (void (GLAPIENTRY *) ()) procTable[i].address; + } + + return NULL; +} + +#endif + + + +/* + * New in GLU 1.3 + */ +#ifdef GLU_VERSION_1_3 +GLboolean GLAPIENTRY +gluCheckExtension(const GLubyte *extName, const GLubyte * extString) +{ + assert(extName); + assert(extString); + { + const int len = strlen((const char *) extName); + const char *start = (const char *) extString; + + while (1) { + const char *c = strstr(start, (const char *) extName); + if (!c) + return GL_FALSE; + + if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0)) + return GL_TRUE; + + start = c + len; + } + } +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/gluP.h xpsb-glx-0.19/mesa/src/glu/mesa/gluP.h --- xpsb-glx-0.19/mesa/src/glu/mesa/gluP.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/gluP.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,97 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * Copyright (C) 1995-2004 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file allows the GLU code to be compiled either with the Mesa + * headers or with the real OpenGL headers. + */ + + +#ifndef GLUP_H +#define GLUP_H + + +#include +#include +#include + + +#if defined(_WIN32) && !defined(__WIN32__) +# define __WIN32__ +#endif + +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) +# pragma warning( disable : 4068 ) /* unknown pragma */ +# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ +# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ +# pragma warning( disable : 4127 ) /* conditional expression is constant */ +# if defined(MESA_MINWARN) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# endif +# define GLCALLBACK __stdcall +# if defined(__CYGWIN__) +# define GLCALLBACKPCAST * +# else +# define GLCALLBACKPCAST __stdcall * +# endif +#else +/* non-Windows compilation */ +# define GLCALLBACK +# define GLCALLBACKPCAST * +#endif /* WIN32 / CYGWIN bracket */ + +/* compatability guard so we don't need to change client code */ + +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) +# define CALLBACK GLCALLBACK +#endif + + + +#ifndef GLU_TESS_ERROR9 + /* If we're using the real OpenGL header files... */ +# define GLU_TESS_ERROR9 100159 +#endif + + +#define GLU_NO_ERROR GL_NO_ERROR + + +/* for Sun: */ +#ifdef SUNOS4 +#define MEMCPY( DST, SRC, BYTES) \ + memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) ) +#else +#define MEMCPY( DST, SRC, BYTES) \ + memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) ) +#endif + + +#ifndef NULL +# define NULL 0 +#endif + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/Makefile xpsb-glx-0.19/mesa/src/glu/mesa/Makefile --- xpsb-glx-0.19/mesa/src/glu/mesa/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,56 @@ +# src/glu/mesa/Makefile + +TOP = ../../.. + +include $(TOP)/configs/current + +GLU_MAJOR = 1 +GLU_MINOR = 1 +GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +C_SOURCES = \ + glu.c \ + mipmap.c \ + nurbs.c \ + nurbscrv.c \ + nurbssrf.c \ + nurbsutl.c \ + polytest.c \ + project.c \ + quadric.c \ + tess.c \ + tesselat.c + +OBJECTS = $(C_SOURCES:.c=.o) + +INCLUDES = -I. -I$(TOP)/include + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ + +##### TARGETS ##### + +default: + @if [ "${CONFIG_NAME}" = "beos" ] ; then \ + echo "$(GLU_LIB_NAME) not build under BeOS, but integrated into ${GL_LIB_NAME}." ; \ + exit 0 ; \ + else \ + $(MAKE) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) || exit 1 ; \ + fi + +$(TOP)/$(LIB_DIR): + -mkdir $(TOP)/$(LIB_DIR) + +# Make the library: +$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) + @ $(MKLIB) -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ + $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + $(GLU_LIB_DEPS) $(OBJECTS) + +clean: + -rm -f *.o */*.o */*/*.o + -rm -f *.lo */*.lo */*/*.lo + -rm -f *.la */*.la */*/*.la diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.DJ xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.DJ --- xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.DJ 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.DJ 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,100 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 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. + +# DOS/DJGPP glu makefile v1.5 for Mesa +# +# Copyright (C) 2002 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# Targets: +# all: build GLU +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = ../../.. +LIBDIR = $(TOP)/lib +GLU_LIB = libglu.a +GLU_DXE = glu.dxe +GLU_IMP = libiglu.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib + +CC = gcc +CFLAGS += -I$(TOP)/include + +AR = ar +ARFLAGS = crus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +CORE_SOURCES = \ + glu.c \ + mipmap.c \ + nurbs.c \ + nurbscrv.c \ + nurbssrf.c \ + nurbsutl.c \ + polytest.c \ + project.c \ + quadric.c \ + tess.c \ + tesselat.c + +SOURCES = $(CORE_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< + +all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) + +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GLU_DXE)) +else + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $^ +endif + +clean: + -$(call UNLINK,*.o) diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.m32 xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.m32 --- xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.m32 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.m32 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,63 @@ +# Makefile for GLU for GCC-2.95.2/Mingw32 contributed by +# Paul Garceau + +# Mesa 3-D graphics library +# Version: 3.3 +# Copyright (C) 1995-1999 Brian Paul +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + +MESA_MAJOR=3 +MESA_MINOR=3 +MESA_TINY=0 +VERSION=$(MESA_MAJOR).$(MESA_MINOR) + +CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \ + -O2 -funroll-loops \ + -fexpensive-optimizations -fomit-frame-pointer -ffast-math \ + -malign-loops=2 -malign-jumps=2 -malign-functions=2 \ + -mwindows +CC = gcc +MAKELIB = ar ru +GLU_LIB = libGLU.a + + +##### MACROS ##### + +VPATH = RCS + +INCDIR = ../include +LIBDIR = ../lib + +SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ + polytest.c project.c quadric.c tess.c tesselat.c + +OBJECTS = $(SOURCES:.c=.o) + + + +##### RULES ##### + +.c.o: + $(CC) -c -I$(INCDIR) $(CFLAGS) $< + + + +##### TARGETS ##### + +# Make the library: +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(MAKELIB) $(GLU_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS) \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.ugl xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.ugl --- xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.ugl 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/Makefile.ugl 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,96 @@ +# Mesa 3-D graphics library +# Version: 3.5 +# +# Copyright (C) 2001 Wind River Systems, Inc + +# The MIT License +# 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. + +# Makefile for GLU library + +##### MACROS ##### +GLU_MAJOR = 1 +GLU_MINOR = 3 +GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +##### RULES ##### + +include ../rules.windml + +GLU_SOURCES = \ + glu.c \ + mipmap.c \ + nurbs.c \ + nurbscrv.c \ + nurbssrf.c \ + nurbsutl.c \ + polytest.c \ + project.c \ + quadric.c \ + tess.c \ + tesselat.c \ + ../src/windml/tornado/torMesaGLUInit.c + +GLU_OBJECTS = $(GLU_SOURCES:.c=.o) +GLU_OBJNAME = $(MESA_LIBDIR)/objMesaGLU.o + +SOURCES = $(GLU_SOURCES) + +##### TARGETS ##### + +all: depend.$(CPU)$(TOOL) $(GLU_OBJNAME) + +# Make the GLU library +$(GLU_OBJNAME): $(GLU_OBJECTS) +# $(LD) -r $(GLU_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(GLU_OBJECTS) -o $(GLU_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(GLU_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(GLU_OBJNAME) + +depend.$(CPU)$(TOOL): +ifeq ($(WIND_HOST_TYPE),x86-win32) + @ $(RM) $@ + @ $(ECHO) Creating depend.$(CPU)$(TOOL) +ifneq ($(SOURCES),) + @ for %f in ($(SOURCES)) do \ + $(CC) -MM $(CFLAGS) %f >>$@ +endif +else +Makefile + @ $(RM) $@ + @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" +ifneq ($(SOURCES),) + @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ + do \ + $(CC) -MM $(CFLAGS) $$FILE \ + | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ + done +endif +endif + +.PHONY = clean + +clean: +# $(AR) d $(MESA_LIBNAME) $(GLU_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(GLU_OBJNAME) + $(RM) $(GLU_OBJNAME) + $(RM) $(GLU_OBJECTS) + $(RM) depend.$(CPU)$(TOOL) + +include depend.$(CPU)$(TOOL) diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/MesaGLU.def xpsb-glx-0.19/mesa/src/glu/mesa/MesaGLU.def --- xpsb-glx-0.19/mesa/src/glu/mesa/MesaGLU.def 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/MesaGLU.def 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,62 @@ +LIBRARY GLU32 +DESCRIPTION 'GLU for Windows Mesa' +EXETYPE WINDOWS +CODE MOVEABLE DISCARDABLE +DATA MOVEABLE SINGLE +HEAPSIZE 256000 + +STACKSIZE 4096 + +EXPORTS + gluLookAt + gluOrtho2D + gluPerspective + gluPickMatrix + gluProject + gluUnProject + gluErrorString + gluScaleImage + gluBuild1DMipmaps + gluBuild2DMipmaps + gluNewQuadric + gluDeleteQuadric + gluQuadricDrawStyle + gluQuadricOrientation + gluQuadricNormals + gluQuadricTexture + gluQuadricCallback + gluCylinder + gluSphere + gluDisk + gluPartialDisk + gluNewNurbsRenderer + gluDeleteNurbsRenderer + gluLoadSamplingMatrices + gluNurbsProperty + gluGetNurbsProperty + gluBeginCurve + gluEndCurve + gluNurbsCurve + gluBeginSurface + gluEndSurface + gluNurbsSurface + gluBeginTrim + gluEndTrim + gluPwlCurve + gluNurbsCallback + gluNewTess + gluDeleteTess +; gluTessBeginPolygon +; gluTessBeginContour + gluTessVertex +; gluTessEndContour +; gluTessEndPolygon +; gluTessProperty +; gluTessNormal + gluTessCallback +; gluGetTessProperty + gluBeginPolygon + gluNextContour + gluEndPolygon + gluGetString + diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/mipmap.c xpsb-glx-0.19/mesa/src/glu/mesa/mipmap.c --- xpsb-glx-0.19/mesa/src/glu/mesa/mipmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/mipmap.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,824 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include +#include "gluP.h" +#endif + + +/* + * Compute ceiling of integer quotient of A divided by B: + */ +#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) + + + +#ifdef EPSILON +#undef EPSILON +#endif +#define EPSILON 0.001 + + +/* To work around optimizer bug in MSVC4.1 */ +#if defined(__WIN32__) && !defined(OPENSTEP) +void +dummy(GLuint j, GLuint k) +{ +} +#else +#define dummy(J, K) +#endif + + +GLint GLAPIENTRY +gluScaleImage(GLenum format, + GLsizei widthin, GLsizei heightin, + GLenum typein, const void *datain, + GLsizei widthout, GLsizei heightout, + GLenum typeout, void *dataout) +{ + GLint components, i, j, k; + GLfloat *tempin, *tempout; + GLfloat sx, sy; + GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; + GLint packrowlength, packalignment, packskiprows, packskippixels; + GLint sizein, sizeout; + GLint rowstride, rowlen; + + + /* Determine number of components per pixel */ + switch (format) { + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + components = 1; + break; + case GL_LUMINANCE_ALPHA: + components = 2; + break; + case GL_RGB: + case GL_BGR: + components = 3; + break; + case GL_RGBA: + case GL_BGRA: +#ifdef GL_EXT_abgr + case GL_ABGR_EXT: +#endif + components = 4; + break; + default: + return GLU_INVALID_ENUM; + } + + /* Determine bytes per input datum */ + switch (typein) { + case GL_UNSIGNED_BYTE: + sizein = sizeof(GLubyte); + break; + case GL_BYTE: + sizein = sizeof(GLbyte); + break; + case GL_UNSIGNED_SHORT: + sizein = sizeof(GLushort); + break; + case GL_SHORT: + sizein = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + sizein = sizeof(GLuint); + break; + case GL_INT: + sizein = sizeof(GLint); + break; + case GL_FLOAT: + sizein = sizeof(GLfloat); + break; + case GL_BITMAP: + /* not implemented yet */ + default: + return GL_INVALID_ENUM; + } + + /* Determine bytes per output datum */ + switch (typeout) { + case GL_UNSIGNED_BYTE: + sizeout = sizeof(GLubyte); + break; + case GL_BYTE: + sizeout = sizeof(GLbyte); + break; + case GL_UNSIGNED_SHORT: + sizeout = sizeof(GLushort); + break; + case GL_SHORT: + sizeout = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + sizeout = sizeof(GLuint); + break; + case GL_INT: + sizeout = sizeof(GLint); + break; + case GL_FLOAT: + sizeout = sizeof(GLfloat); + break; + case GL_BITMAP: + /* not implemented yet */ + default: + return GL_INVALID_ENUM; + } + + /* Get glPixelStore state */ + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength); + glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels); + glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength); + glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment); + glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows); + glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels); + + /* Allocate storage for intermediate images */ + tempin = (GLfloat *) malloc(widthin * heightin + * components * sizeof(GLfloat)); + if (!tempin) { + return GLU_OUT_OF_MEMORY; + } + tempout = (GLfloat *) malloc(widthout * heightout + * components * sizeof(GLfloat)); + if (!tempout) { + free(tempin); + return GLU_OUT_OF_MEMORY; + } + + + /* + * Unpack the pixel data and convert to floating point + */ + + if (unpackrowlength > 0) { + rowlen = unpackrowlength; + } + else { + rowlen = widthin; + } + if (sizein >= unpackalignment) { + rowstride = components * rowlen; + } + else { + rowstride = unpackalignment / sizein + * CEILING(components * rowlen * sizein, unpackalignment); + } + + switch (typein) { + case GL_UNSIGNED_BYTE: + k = 0; + for (i = 0; i < heightin; i++) { + GLubyte *ubptr = (GLubyte *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * ubptr++; + } + } + break; + case GL_BYTE: + k = 0; + for (i = 0; i < heightin; i++) { + GLbyte *bptr = (GLbyte *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * bptr++; + } + } + break; + case GL_UNSIGNED_SHORT: + k = 0; + for (i = 0; i < heightin; i++) { + GLushort *usptr = (GLushort *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * usptr++; + } + } + break; + case GL_SHORT: + k = 0; + for (i = 0; i < heightin; i++) { + GLshort *sptr = (GLshort *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * sptr++; + } + } + break; + case GL_UNSIGNED_INT: + k = 0; + for (i = 0; i < heightin; i++) { + GLuint *uiptr = (GLuint *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * uiptr++; + } + } + break; + case GL_INT: + k = 0; + for (i = 0; i < heightin; i++) { + GLint *iptr = (GLint *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * iptr++; + } + } + break; + case GL_FLOAT: + k = 0; + for (i = 0; i < heightin; i++) { + GLfloat *fptr = (GLfloat *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = *fptr++; + } + } + break; + default: + return GLU_INVALID_ENUM; + } + + + /* + * Scale the image! + */ + + if (widthout > 1) + sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1); + else + sx = (GLfloat) (widthin - 1); + if (heightout > 1) + sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1); + else + sy = (GLfloat) (heightin - 1); + +/*#define POINT_SAMPLE*/ +#ifdef POINT_SAMPLE + for (i = 0; i < heightout; i++) { + GLint ii = i * sy; + for (j = 0; j < widthout; j++) { + GLint jj = j * sx; + + GLfloat *src = tempin + (ii * widthin + jj) * components; + GLfloat *dst = tempout + (i * widthout + j) * components; + + for (k = 0; k < components; k++) { + *dst++ = *src++; + } + } + } +#else + if (sx < 1.0 && sy < 1.0) { + /* magnify both width and height: use weighted sample of 4 pixels */ + GLint i0, i1, j0, j1; + GLfloat alpha, beta; + GLfloat *src00, *src01, *src10, *src11; + GLfloat s1, s2; + GLfloat *dst; + + for (i = 0; i < heightout; i++) { + i0 = i * sy; + i1 = i0 + 1; + if (i1 >= heightin) + i1 = heightin - 1; +/* i1 = (i+1) * sy - EPSILON;*/ + alpha = i * sy - i0; + for (j = 0; j < widthout; j++) { + j0 = j * sx; + j1 = j0 + 1; + if (j1 >= widthin) + j1 = widthin - 1; +/* j1 = (j+1) * sx - EPSILON; */ + beta = j * sx - j0; + + /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */ + src00 = tempin + (i0 * widthin + j0) * components; + src01 = tempin + (i0 * widthin + j1) * components; + src10 = tempin + (i1 * widthin + j0) * components; + src11 = tempin + (i1 * widthin + j1) * components; + + dst = tempout + (i * widthout + j) * components; + + for (k = 0; k < components; k++) { + s1 = *src00++ * (1.0 - beta) + *src01++ * beta; + s2 = *src10++ * (1.0 - beta) + *src11++ * beta; + *dst++ = s1 * (1.0 - alpha) + s2 * alpha; + } + } + } + } + else { + /* shrink width and/or height: use an unweighted box filter */ + GLint i0, i1; + GLint j0, j1; + GLint ii, jj; + GLfloat sum, *dst; + + for (i = 0; i < heightout; i++) { + i0 = i * sy; + i1 = i0 + 1; + if (i1 >= heightin) + i1 = heightin - 1; +/* i1 = (i+1) * sy - EPSILON; */ + for (j = 0; j < widthout; j++) { + j0 = j * sx; + j1 = j0 + 1; + if (j1 >= widthin) + j1 = widthin - 1; +/* j1 = (j+1) * sx - EPSILON; */ + + dst = tempout + (i * widthout + j) * components; + + /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */ + for (k = 0; k < components; k++) { + sum = 0.0; + for (ii = i0; ii <= i1; ii++) { + for (jj = j0; jj <= j1; jj++) { + sum += *(tempin + (ii * widthin + jj) * components + k); + } + } + sum /= (j1 - j0 + 1) * (i1 - i0 + 1); + *dst++ = sum; + } + } + } + } +#endif + + + /* + * Return output image + */ + + if (packrowlength > 0) { + rowlen = packrowlength; + } + else { + rowlen = widthout; + } + if (sizeout >= packalignment) { + rowstride = components * rowlen; + } + else { + rowstride = packalignment / sizeout + * CEILING(components * rowlen * sizeout, packalignment); + } + + switch (typeout) { + case GL_UNSIGNED_BYTE: + k = 0; + for (i = 0; i < heightout; i++) { + GLubyte *ubptr = (GLubyte *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *ubptr++ = (GLubyte) tempout[k++]; + } + } + break; + case GL_BYTE: + k = 0; + for (i = 0; i < heightout; i++) { + GLbyte *bptr = (GLbyte *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *bptr++ = (GLbyte) tempout[k++]; + } + } + break; + case GL_UNSIGNED_SHORT: + k = 0; + for (i = 0; i < heightout; i++) { + GLushort *usptr = (GLushort *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *usptr++ = (GLushort) tempout[k++]; + } + } + break; + case GL_SHORT: + k = 0; + for (i = 0; i < heightout; i++) { + GLshort *sptr = (GLshort *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *sptr++ = (GLshort) tempout[k++]; + } + } + break; + case GL_UNSIGNED_INT: + k = 0; + for (i = 0; i < heightout; i++) { + GLuint *uiptr = (GLuint *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *uiptr++ = (GLuint) tempout[k++]; + } + } + break; + case GL_INT: + k = 0; + for (i = 0; i < heightout; i++) { + GLint *iptr = (GLint *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *iptr++ = (GLint) tempout[k++]; + } + } + break; + case GL_FLOAT: + k = 0; + for (i = 0; i < heightout; i++) { + GLfloat *fptr = (GLfloat *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *fptr++ = tempout[k++]; + } + } + break; + default: + return GLU_INVALID_ENUM; + } + + + /* free temporary image storage */ + free(tempin); + free(tempout); + + return 0; +} + + + +/* + * Return the largest k such that 2^k <= n. + */ +static GLint +ilog2(GLint n) +{ + GLint k; + + if (n <= 0) + return 0; + for (k = 0; n >>= 1; k++); + return k; +} + + + +/* + * Find the value nearest to n which is also a power of two. + */ +static GLint +round2(GLint n) +{ + GLint m; + + for (m = 1; m < n; m *= 2); + + /* m>=n */ + if (m - n <= n - m / 2) { + return m; + } + else { + return m / 2; + } +} + + +/* + * Given an pixel format and datatype, return the number of bytes to + * store one pixel. + */ +static GLint +bytes_per_pixel(GLenum format, GLenum type) +{ + GLint n, m; + + switch (format) { + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + n = 1; + break; + case GL_LUMINANCE_ALPHA: + n = 2; + break; + case GL_RGB: + case GL_BGR: + n = 3; + break; + case GL_RGBA: + case GL_BGRA: +#ifdef GL_EXT_abgr + case GL_ABGR_EXT: +#endif + n = 4; + break; + default: + n = 0; + } + + switch (type) { + case GL_UNSIGNED_BYTE: + m = sizeof(GLubyte); + break; + case GL_BYTE: + m = sizeof(GLbyte); + break; + case GL_BITMAP: + m = 1; + break; + case GL_UNSIGNED_SHORT: + m = sizeof(GLushort); + break; + case GL_SHORT: + m = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + m = sizeof(GLuint); + break; + case GL_INT: + m = sizeof(GLint); + break; + case GL_FLOAT: + m = sizeof(GLfloat); + break; + default: + m = 0; + } + + return n * m; +} + + + +/* + * WARNING: This function isn't finished and has never been tested!!!! + */ +GLint GLAPIENTRY +gluBuild1DMipmaps(GLenum target, GLint components, + GLsizei width, GLenum format, GLenum type, const void *data) +{ + GLubyte *texture; + GLint levels, max_levels; + GLint new_width, max_width; + GLint i, j, k, l; + + if (width < 1) + return GLU_INVALID_VALUE; + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_width); + max_levels = ilog2(max_width) + 1; + + /* Compute how many mipmap images to make */ + levels = ilog2(width) + 1; + if (levels > max_levels) { + levels = max_levels; + } + + new_width = 1 << (levels - 1); + + texture = (GLubyte *) malloc(new_width * components); + if (!texture) { + return GLU_OUT_OF_MEMORY; + } + + if (width != new_width) { + /* initial rescaling */ + switch (type) { + case GL_UNSIGNED_BYTE: + { + GLubyte *ub_data = (GLubyte *) data; + for (i = 0; i < new_width; i++) { + j = i * width / new_width; + for (k = 0; k < components; k++) { + texture[i * components + k] = ub_data[j * components + k]; + } + } + } + break; + default: + /* Not implemented */ + return GLU_ERROR; + } + } + + /* generate and load mipmap images */ + for (l = 0; l < levels; l++) { + glTexImage1D(GL_TEXTURE_1D, l, components, new_width, 0, + format, GL_UNSIGNED_BYTE, texture); + + /* Scale image down to 1/2 size */ + new_width = new_width / 2; + for (i = 0; i < new_width; i++) { + for (k = 0; k < components; k++) { + GLint sample1, sample2; + sample1 = (GLint) texture[i * 2 * components + k]; + sample2 = (GLint) texture[(i * 2 + 1) * components + k]; + texture[i * components + k] = (GLubyte) ((sample1 + sample2) / 2); + } + } + } + + free(texture); + + return 0; +} + + + +GLint GLAPIENTRY +gluBuild2DMipmaps(GLenum target, GLint components, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const void *data) +{ + GLint w, h, maxsize; + void *image, *newimage; + GLint neww, newh, level, bpp; + int error; + GLboolean done; + GLint retval = 0; + GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; + GLint packrowlength, packalignment, packskiprows, packskippixels; + + if (width < 1 || height < 1) + return GLU_INVALID_VALUE; + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); + + w = round2(width); + if (w > maxsize) { + w = maxsize; + } + h = round2(height); + if (h > maxsize) { + h = maxsize; + } + + bpp = bytes_per_pixel(format, type); + if (bpp == 0) { + /* probably a bad format or type enum */ + return GLU_INVALID_ENUM; + } + + /* Get current glPixelStore values */ + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength); + glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels); + glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength); + glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment); + glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows); + glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels); + + /* set pixel packing */ + glPixelStorei(GL_PACK_ROW_LENGTH, 0); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_SKIP_ROWS, 0); + glPixelStorei(GL_PACK_SKIP_PIXELS, 0); + + done = GL_FALSE; + + if (w != width || h != height) { + /* must rescale image to get "top" mipmap texture image */ + image = malloc((w + 4) * h * bpp); + if (!image) { + return GLU_OUT_OF_MEMORY; + } + error = gluScaleImage(format, width, height, type, data, + w, h, type, image); + if (error) { + retval = error; + done = GL_TRUE; + } + } + else { + image = (void *) data; + } + + level = 0; + while (!done) { + if (image != data) { + /* set pixel unpacking */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + } + + glTexImage2D(target, level, components, w, h, 0, format, type, image); + + if (w == 1 && h == 1) + break; + + neww = (w < 2) ? 1 : w / 2; + newh = (h < 2) ? 1 : h / 2; + newimage = malloc((neww + 4) * newh * bpp); + if (!newimage) { + return GLU_OUT_OF_MEMORY; + } + + error = gluScaleImage(format, w, h, type, image, + neww, newh, type, newimage); + if (error) { + retval = error; + done = GL_TRUE; + } + + if (image != data) { + free(image); + } + image = newimage; + + w = neww; + h = newh; + level++; + } + + if (image != data) { + free(image); + } + + /* Restore original glPixelStore state */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength); + glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels); + glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength); + glPixelStorei(GL_PACK_ALIGNMENT, packalignment); + glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows); + glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels); + + return retval; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/mms_depend xpsb-glx-0.19/mesa/src/glu/mesa/mms_depend --- xpsb-glx-0.19/mesa/src/glu/mesa/mms_depend 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/mms_depend 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,15 @@ +# DO NOT DELETE THIS LINE -- make depend depends on it. + +glu.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h +mipmap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h +nurbs.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h +nurbscrv.obj : nurbs.h gluP.h [-.include.gl]gl.h [-.include.gl]glu.h +nurbssrf.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h +nurbsutl.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h +project.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h +quadric.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h +tess.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_fist.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_hash.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_heap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_clip.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.c xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.c --- xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,628 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "nurbs.h" +#endif + + +void +call_user_error(GLUnurbsObj * nobj, GLenum error) +{ + nobj->error = error; + if (nobj->error_callback != NULL) { + (*(nobj->error_callback)) (error); + } + else { + printf("NURBS error %d %s\n", error, (char *) gluErrorString(error)); + } +} + + + +GLUnurbsObj *GLAPIENTRY +gluNewNurbsRenderer(void) +{ + GLUnurbsObj *n; + GLfloat tmp_viewport[4]; + GLint i, j; + + n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj)); + if (n) { + /* init */ + n->culling = GL_FALSE; + n->nurbs_type = GLU_NURBS_NONE; + n->error = GLU_NO_ERROR; + n->error_callback = NULL; + n->auto_load_matrix = GL_TRUE; + n->sampling_tolerance = 50.0; + n->parametric_tolerance = 0.5; + n->u_step = n->v_step = 100; + n->sampling_method = GLU_PATH_LENGTH; + n->display_mode = GLU_FILL; + /* in case the user doesn't supply the sampling matrices */ + /* set projection and modelview to identity */ + for (i = 0; i < 4; i++) + for (j = 0; j < 4; j++) + if (i == j) { + n->sampling_matrices.model[i * 4 + j] = 1.0; + n->sampling_matrices.proj[i * 4 + j] = 1.0; + } + else { + n->sampling_matrices.model[i * 4 + j] = 0.0; + n->sampling_matrices.proj[i * 4 + j] = 0.0; + } + /* and set the viewport sampling matrix to current ciewport */ + glGetFloatv(GL_VIEWPORT, tmp_viewport); + for (i = 0; i < 4; i++) + n->sampling_matrices.viewport[i] = tmp_viewport[i]; + n->trim = NULL; + } + return n; +} + + + +void GLAPIENTRY +gluDeleteNurbsRenderer(GLUnurbsObj * nobj) +{ + if (nobj) { + free(nobj); + } +} + + + +void GLAPIENTRY +gluLoadSamplingMatrices(GLUnurbsObj * nobj, + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], const GLint viewport[4]) +{ + GLint i; + + for (i = 0; i < 16; i++) { + nobj->sampling_matrices.model[i] = modelMatrix[i]; + nobj->sampling_matrices.proj[i] = projMatrix[i]; + } + for (i = 0; i < 4; i++) + nobj->sampling_matrices.viewport[i] = viewport[i]; +} + + +void GLAPIENTRY +gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value) +{ + GLenum val; + + switch (property) { + case GLU_SAMPLING_TOLERANCE: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->sampling_tolerance = value; + break; + case GLU_PARAMETRIC_TOLERANCE: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->parametric_tolerance = value; + break; + case GLU_U_STEP: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->u_step = (GLint) value; + break; + case GLU_V_STEP: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->v_step = (GLint) value; + break; + case GLU_SAMPLING_METHOD: + val = (GLenum) value; + if (val != GLU_PATH_LENGTH && val != GLU_PARAMETRIC_ERROR + && val != GLU_DOMAIN_DISTANCE) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + nobj->sampling_method = val; + break; + case GLU_DISPLAY_MODE: + val = (GLenum) value; + if (val != GLU_FILL && val != GLU_OUTLINE_POLYGON + && val != GLU_OUTLINE_PATCH) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + if (nobj->nurbs_type == GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR26); + return; + } + nobj->display_mode = val; + if (val == GLU_OUTLINE_PATCH) + fprintf(stderr, + "NURBS, for the moment, can display only in POLYGON mode\n"); + break; + case GLU_CULLING: + val = (GLenum) value; + if (val != GL_TRUE && val != GL_FALSE) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + nobj->culling = (GLboolean) value; + break; + case GLU_AUTO_LOAD_MATRIX: + val = (GLenum) value; + if (val != GL_TRUE && val != GL_FALSE) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + nobj->auto_load_matrix = (GLboolean) value; + break; + default: + call_user_error(nobj, GLU_NURBS_ERROR26); + } +} + + +void GLAPIENTRY +gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value) +{ + switch (property) { + case GLU_SAMPLING_TOLERANCE: + *value = nobj->sampling_tolerance; + break; + case GLU_DISPLAY_MODE: + *value = (GLfloat) (GLint) nobj->display_mode; + break; + case GLU_CULLING: + *value = nobj->culling ? 1.0 : 0.0; + break; + case GLU_AUTO_LOAD_MATRIX: + *value = nobj->auto_load_matrix ? 1.0 : 0.0; + break; + default: + call_user_error(nobj, GLU_INVALID_ENUM); + } +} + + + +void GLAPIENTRY +gluBeginCurve(GLUnurbsObj * nobj) +{ + if (nobj->nurbs_type == GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR6); + return; + } + nobj->nurbs_type = GLU_NURBS_CURVE; + nobj->curve.geom.type = GLU_INVALID_ENUM; + nobj->curve.color.type = GLU_INVALID_ENUM; + nobj->curve.texture.type = GLU_INVALID_ENUM; + nobj->curve.normal.type = GLU_INVALID_ENUM; +} + + +void GLAPIENTRY +gluEndCurve(GLUnurbsObj * nobj) +{ + if (nobj->nurbs_type == GLU_NURBS_NONE) { + call_user_error(nobj, GLU_NURBS_ERROR7); + return; + } + if (nobj->curve.geom.type == GLU_INVALID_ENUM) { + call_user_error(nobj, GLU_NURBS_ERROR8); + nobj->nurbs_type = GLU_NURBS_NONE; + return; + } + glPushAttrib((GLbitfield) (GL_EVAL_BIT | GL_ENABLE_BIT)); + glDisable(GL_MAP1_VERTEX_3); + glDisable(GL_MAP1_VERTEX_4); + glDisable(GL_MAP1_INDEX); + glDisable(GL_MAP1_COLOR_4); + glDisable(GL_MAP1_NORMAL); + glDisable(GL_MAP1_TEXTURE_COORD_1); + glDisable(GL_MAP1_TEXTURE_COORD_2); + glDisable(GL_MAP1_TEXTURE_COORD_3); + glDisable(GL_MAP1_TEXTURE_COORD_4); + glDisable(GL_MAP2_VERTEX_3); + glDisable(GL_MAP2_VERTEX_4); + glDisable(GL_MAP2_INDEX); + glDisable(GL_MAP2_COLOR_4); + glDisable(GL_MAP2_NORMAL); + glDisable(GL_MAP2_TEXTURE_COORD_1); + glDisable(GL_MAP2_TEXTURE_COORD_2); + glDisable(GL_MAP2_TEXTURE_COORD_3); + glDisable(GL_MAP2_TEXTURE_COORD_4); + do_nurbs_curve(nobj); + glPopAttrib(); + nobj->nurbs_type = GLU_NURBS_NONE; +} + + +void GLAPIENTRY +gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot, + GLint stride, GLfloat * ctlarray, GLint order, GLenum type) +{ + if (nobj->nurbs_type == GLU_NURBS_TRIM) { +#if 0 +/* TODO: NOT IMPLEMENTED YET */ + nurbs_trim *ptr1; + trim_list *ptr2; + + if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) { + call_user_error(nobj, GLU_NURBS_ERROR14); + return; + } + for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next); + if (ptr1->trim_loop) { + for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next); + if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr2 = ptr2->next; + } + else { + if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr1->trim_loop = ptr2; + } + ptr2->trim_type = GLU_TRIM_NURBS; + ptr2->curve.nurbs_curve.knot_count = nknots; + ptr2->curve.nurbs_curve.knot = knot; + ptr2->curve.nurbs_curve.stride = stride; + ptr2->curve.nurbs_curve.ctrlarray = ctlarray; + ptr2->curve.nurbs_curve.order = order; + ptr2->curve.nurbs_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3); + ptr2->curve.nurbs_curve.type = type; + ptr2->next = NULL; +#endif + } + else { + if (type == GLU_MAP1_TRIM_2 || type == GLU_MAP1_TRIM_3) { + call_user_error(nobj, GLU_NURBS_ERROR22); + return; + } + if (nobj->nurbs_type != GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR10); + return; + } + switch (type) { + case GL_MAP1_VERTEX_3: + case GL_MAP1_VERTEX_4: + if (nobj->curve.geom.type != GLU_INVALID_ENUM) { + call_user_error(nobj, GLU_NURBS_ERROR8); + return; + } + nobj->curve.geom.type = type; + nobj->curve.geom.knot_count = nknots; + nobj->curve.geom.knot = knot; + nobj->curve.geom.stride = stride; + nobj->curve.geom.ctrlarray = ctlarray; + nobj->curve.geom.order = order; + break; + case GL_MAP1_INDEX: + case GL_MAP1_COLOR_4: + nobj->curve.color.type = type; + nobj->curve.color.knot_count = nknots; + nobj->curve.color.knot = knot; + nobj->curve.color.stride = stride; + nobj->curve.color.ctrlarray = ctlarray; + nobj->curve.color.order = order; + break; + case GL_MAP1_NORMAL: + nobj->curve.normal.type = type; + nobj->curve.normal.knot_count = nknots; + nobj->curve.normal.knot = knot; + nobj->curve.normal.stride = stride; + nobj->curve.normal.ctrlarray = ctlarray; + nobj->curve.normal.order = order; + break; + case GL_MAP1_TEXTURE_COORD_1: + case GL_MAP1_TEXTURE_COORD_2: + case GL_MAP1_TEXTURE_COORD_3: + case GL_MAP1_TEXTURE_COORD_4: + nobj->curve.texture.type = type; + nobj->curve.texture.knot_count = nknots; + nobj->curve.texture.knot = knot; + nobj->curve.texture.stride = stride; + nobj->curve.texture.ctrlarray = ctlarray; + nobj->curve.texture.order = order; + break; + default: + call_user_error(nobj, GLU_INVALID_ENUM); + } + } +} + + +void GLAPIENTRY +gluBeginSurface(GLUnurbsObj * nobj) +{ + switch (nobj->nurbs_type) { + case GLU_NURBS_NONE: + nobj->nurbs_type = GLU_NURBS_SURFACE; + nobj->surface.geom.type = GLU_INVALID_ENUM; + nobj->surface.color.type = GLU_INVALID_ENUM; + nobj->surface.texture.type = GLU_INVALID_ENUM; + nobj->surface.normal.type = GLU_INVALID_ENUM; + break; + case GLU_NURBS_TRIM: + call_user_error(nobj, GLU_NURBS_ERROR16); + break; + case GLU_NURBS_SURFACE: + case GLU_NURBS_NO_TRIM: + case GLU_NURBS_TRIM_DONE: + call_user_error(nobj, GLU_NURBS_ERROR27); + break; + case GLU_NURBS_CURVE: + call_user_error(nobj, GLU_NURBS_ERROR6); + break; + } +} + + +void GLAPIENTRY +gluEndSurface(GLUnurbsObj * nobj) +{ + switch (nobj->nurbs_type) { + case GLU_NURBS_NONE: + call_user_error(nobj, GLU_NURBS_ERROR13); + break; + case GLU_NURBS_TRIM: + call_user_error(nobj, GLU_NURBS_ERROR12); + break; + case GLU_NURBS_TRIM_DONE: +/* if(nobj->trim->trim_loop==NULL) + { + call_user_error(nobj,GLU_NURBS_ERROR18); + return; + }*/ + /* no break - fallthrough */ + case GLU_NURBS_NO_TRIM: + glPushAttrib((GLbitfield) + (GL_EVAL_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT)); + glDisable(GL_MAP2_VERTEX_3); + glDisable(GL_MAP2_VERTEX_4); + glDisable(GL_MAP2_INDEX); + glDisable(GL_MAP2_COLOR_4); + glDisable(GL_MAP2_NORMAL); + glDisable(GL_MAP2_TEXTURE_COORD_1); + glDisable(GL_MAP2_TEXTURE_COORD_2); + glDisable(GL_MAP2_TEXTURE_COORD_3); + glDisable(GL_MAP2_TEXTURE_COORD_4); +/* glDisable(GL_MAP1_VERTEX_3); + glDisable(GL_MAP1_VERTEX_4); + glDisable(GL_MAP1_INDEX); + glDisable(GL_MAP1_COLOR_4); + glDisable(GL_MAP1_NORMAL); + glDisable(GL_MAP1_TEXTURE_COORD_1); + glDisable(GL_MAP1_TEXTURE_COORD_2); + glDisable(GL_MAP1_TEXTURE_COORD_3); + glDisable(GL_MAP1_TEXTURE_COORD_4);*/ + do_nurbs_surface(nobj); + glPopAttrib(); + break; + default: + call_user_error(nobj, GLU_NURBS_ERROR8); + } + nobj->nurbs_type = GLU_NURBS_NONE; +} + + +void GLAPIENTRY +gluNurbsSurface(GLUnurbsObj * nobj, + GLint sknot_count, GLfloat * sknot, + GLint tknot_count, GLfloat * tknot, + GLint s_stride, GLint t_stride, + GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type) +{ + if (nobj->nurbs_type == GLU_NURBS_NO_TRIM + || nobj->nurbs_type == GLU_NURBS_TRIM + || nobj->nurbs_type == GLU_NURBS_TRIM_DONE) { + if (type == GL_MAP2_VERTEX_3 || type == GL_MAP2_VERTEX_4) { + call_user_error(nobj, GLU_NURBS_ERROR8); + return; + } + } + else if (nobj->nurbs_type != GLU_NURBS_SURFACE) { + call_user_error(nobj, GLU_NURBS_ERROR11); + return; + } + switch (type) { + case GL_MAP2_VERTEX_3: + case GL_MAP2_VERTEX_4: + nobj->surface.geom.sknot_count = sknot_count; + nobj->surface.geom.sknot = sknot; + nobj->surface.geom.tknot_count = tknot_count; + nobj->surface.geom.tknot = tknot; + nobj->surface.geom.s_stride = s_stride; + nobj->surface.geom.t_stride = t_stride; + nobj->surface.geom.ctrlarray = ctrlarray; + nobj->surface.geom.sorder = sorder; + nobj->surface.geom.torder = torder; + nobj->surface.geom.type = type; + nobj->nurbs_type = GLU_NURBS_NO_TRIM; + break; + case GL_MAP2_INDEX: + case GL_MAP2_COLOR_4: + nobj->surface.color.sknot_count = sknot_count; + nobj->surface.color.sknot = sknot; + nobj->surface.color.tknot_count = tknot_count; + nobj->surface.color.tknot = tknot; + nobj->surface.color.s_stride = s_stride; + nobj->surface.color.t_stride = t_stride; + nobj->surface.color.ctrlarray = ctrlarray; + nobj->surface.color.sorder = sorder; + nobj->surface.color.torder = torder; + nobj->surface.color.type = type; + break; + case GL_MAP2_NORMAL: + nobj->surface.normal.sknot_count = sknot_count; + nobj->surface.normal.sknot = sknot; + nobj->surface.normal.tknot_count = tknot_count; + nobj->surface.normal.tknot = tknot; + nobj->surface.normal.s_stride = s_stride; + nobj->surface.normal.t_stride = t_stride; + nobj->surface.normal.ctrlarray = ctrlarray; + nobj->surface.normal.sorder = sorder; + nobj->surface.normal.torder = torder; + nobj->surface.normal.type = type; + break; + case GL_MAP2_TEXTURE_COORD_1: + case GL_MAP2_TEXTURE_COORD_2: + case GL_MAP2_TEXTURE_COORD_3: + case GL_MAP2_TEXTURE_COORD_4: + nobj->surface.texture.sknot_count = sknot_count; + nobj->surface.texture.sknot = sknot; + nobj->surface.texture.tknot_count = tknot_count; + nobj->surface.texture.tknot = tknot; + nobj->surface.texture.s_stride = s_stride; + nobj->surface.texture.t_stride = t_stride; + nobj->surface.texture.ctrlarray = ctrlarray; + nobj->surface.texture.sorder = sorder; + nobj->surface.texture.torder = torder; + nobj->surface.texture.type = type; + break; + default: + call_user_error(nobj, GLU_INVALID_ENUM); + } +} + + +void GLAPIENTRY +gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ()) +{ + nobj->error_callback = (void (GLCALLBACKPCAST) (GLenum)) fn; + + if (which != GLU_ERROR) + call_user_error(nobj, GLU_INVALID_ENUM); +} + +void GLAPIENTRY +gluBeginTrim(GLUnurbsObj * nobj) +{ +#if 0 + nurbs_trim *ptr; +#endif + + if (nobj->nurbs_type != GLU_NURBS_TRIM_DONE) + if (nobj->nurbs_type != GLU_NURBS_NO_TRIM) { + call_user_error(nobj, GLU_NURBS_ERROR15); + return; + } + nobj->nurbs_type = GLU_NURBS_TRIM; + fprintf(stderr, "NURBS - trimming not supported yet\n"); +#if 0 + if ((ptr = (nurbs_trim *) malloc(sizeof(nurbs_trim))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + if (nobj->trim) { + nurbs_trim *tmp_ptr; + + for (tmp_ptr = nobj->trim; tmp_ptr->next; tmp_ptr = tmp_ptr->next); + tmp_ptr->next = ptr; + } + else + nobj->trim = ptr; + ptr->trim_loop = NULL; + ptr->segments = NULL; + ptr->next = NULL; +#endif +} + +void GLAPIENTRY +gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride, + GLenum type) +{ +#if 0 + nurbs_trim *ptr1; + trim_list *ptr2; +#endif + if (nobj->nurbs_type == GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR9); + return; + } + if (nobj->nurbs_type == GLU_NURBS_NONE) { + call_user_error(nobj, GLU_NURBS_ERROR19); + return; + } + if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) { + call_user_error(nobj, GLU_NURBS_ERROR14); + return; + } +#if 0 + for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next); + if (ptr1->trim_loop) { + for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next); + if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr2 = ptr2->next; + } + else { + if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr1->trim_loop = ptr2; + } + ptr2->trim_type = GLU_TRIM_PWL; + ptr2->curve.pwl_curve.pt_count = count; + ptr2->curve.pwl_curve.ctrlarray = array; + ptr2->curve.pwl_curve.stride = stride; + ptr2->curve.pwl_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3); + ptr2->curve.pwl_curve.type = type; + ptr2->next = NULL; +#endif +} + +void GLAPIENTRY +gluEndTrim(GLUnurbsObj * nobj) +{ + if (nobj->nurbs_type != GLU_NURBS_TRIM) { + call_user_error(nobj, GLU_NURBS_ERROR17); + return; + } + nobj->nurbs_type = GLU_NURBS_TRIM_DONE; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/nurbscrv.c xpsb-glx-0.19/mesa/src/glu/mesa/nurbscrv.c --- xpsb-glx-0.19/mesa/src/glu/mesa/nurbscrv.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/nurbscrv.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,444 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "nurbs.h" +#endif + + +static int +get_curve_dim(GLenum type) +{ + switch (type) { + case GL_MAP1_VERTEX_3: + return 3; + case GL_MAP1_VERTEX_4: + return 4; + case GL_MAP1_INDEX: + return 1; + case GL_MAP1_COLOR_4: + return 4; + case GL_MAP1_NORMAL: + return 3; + case GL_MAP1_TEXTURE_COORD_1: + return 1; + case GL_MAP1_TEXTURE_COORD_2: + return 2; + case GL_MAP1_TEXTURE_COORD_3: + return 3; + case GL_MAP1_TEXTURE_COORD_4: + return 4; + default: + abort(); /* TODO: is this OK? */ + } + return 0; /*never get here */ +} + +static GLenum +test_nurbs_curve(GLUnurbsObj * nobj, curve_attribs * attribs) +{ + GLenum err; + GLint tmp_int; + + if (attribs->order < 0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return GLU_ERROR; + } + glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int); + if (attribs->order > tmp_int || attribs->order < 2) { + call_user_error(nobj, GLU_NURBS_ERROR1); + return GLU_ERROR; + } + if (attribs->knot_count < attribs->order + 2) { + call_user_error(nobj, GLU_NURBS_ERROR2); + return GLU_ERROR; + } + if (attribs->stride < 0) { + call_user_error(nobj, GLU_NURBS_ERROR34); + return GLU_ERROR; + } + if (attribs->knot == NULL || attribs->ctrlarray == NULL) { + call_user_error(nobj, GLU_NURBS_ERROR36); + return GLU_ERROR; + } + if ((err = test_knot(attribs->knot_count, attribs->knot, attribs->order)) + != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + return GLU_NO_ERROR; +} + +static GLenum +test_nurbs_curves(GLUnurbsObj * nobj) +{ + /* test the geometric data */ + if (test_nurbs_curve(nobj, &(nobj->curve.geom)) != GLU_NO_ERROR) + return GLU_ERROR; + /* now test the attributive data */ + /* color */ + if (nobj->curve.color.type != GLU_INVALID_ENUM) + if (test_nurbs_curve(nobj, &(nobj->curve.color)) != GLU_NO_ERROR) + return GLU_ERROR; + /* normal */ + if (nobj->curve.normal.type != GLU_INVALID_ENUM) + if (test_nurbs_curve(nobj, &(nobj->curve.normal)) != GLU_NO_ERROR) + return GLU_ERROR; + /* texture */ + if (nobj->curve.texture.type != GLU_INVALID_ENUM) + if (test_nurbs_curve(nobj, &(nobj->curve.texture)) != GLU_NO_ERROR) + return GLU_ERROR; + return GLU_NO_ERROR; +} + +/* prepare the knot information structures */ +static GLenum +fill_knot_structures(GLUnurbsObj * nobj, knot_str_type * geom_knot, + knot_str_type * color_knot, knot_str_type * normal_knot, + knot_str_type * texture_knot) +{ + GLint order; + GLfloat *knot; + GLint nknots; + GLint t_min, t_max; + + geom_knot->unified_knot = NULL; + knot = geom_knot->knot = nobj->curve.geom.knot; + nknots = geom_knot->nknots = nobj->curve.geom.knot_count; + order = geom_knot->order = nobj->curve.geom.order; + geom_knot->delta_nknots = 0; + t_min = geom_knot->t_min = order - 1; + t_max = geom_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + geom_knot->open_at_begin = GL_TRUE; + } + else + geom_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + geom_knot->open_at_end = GL_TRUE; + } + else + geom_knot->open_at_end = GL_FALSE; + if (nobj->curve.color.type != GLU_INVALID_ENUM) { + color_knot->unified_knot = (GLfloat *) 1; + knot = color_knot->knot = nobj->curve.color.knot; + nknots = color_knot->nknots = nobj->curve.color.knot_count; + order = color_knot->order = nobj->curve.color.order; + color_knot->delta_nknots = 0; + t_min = color_knot->t_min = order - 1; + t_max = color_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + color_knot->open_at_begin = GL_TRUE; + } + else + color_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + color_knot->open_at_end = GL_TRUE; + } + else + color_knot->open_at_end = GL_FALSE; + } + else + color_knot->unified_knot = NULL; + if (nobj->curve.normal.type != GLU_INVALID_ENUM) { + normal_knot->unified_knot = (GLfloat *) 1; + knot = normal_knot->knot = nobj->curve.normal.knot; + nknots = normal_knot->nknots = nobj->curve.normal.knot_count; + order = normal_knot->order = nobj->curve.normal.order; + normal_knot->delta_nknots = 0; + t_min = normal_knot->t_min = order - 1; + t_max = normal_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + normal_knot->open_at_begin = GL_TRUE; + } + else + normal_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + normal_knot->open_at_end = GL_TRUE; + } + else + normal_knot->open_at_end = GL_FALSE; + } + else + normal_knot->unified_knot = NULL; + if (nobj->curve.texture.type != GLU_INVALID_ENUM) { + texture_knot->unified_knot = (GLfloat *) 1; + knot = texture_knot->knot = nobj->curve.texture.knot; + nknots = texture_knot->nknots = nobj->curve.texture.knot_count; + order = texture_knot->order = nobj->curve.texture.order; + texture_knot->delta_nknots = 0; + t_min = texture_knot->t_min = order - 1; + t_max = texture_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + texture_knot->open_at_begin = GL_TRUE; + } + else + texture_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + texture_knot->open_at_end = GL_TRUE; + } + else + texture_knot->open_at_end = GL_FALSE; + } + else + texture_knot->unified_knot = NULL; + return GLU_NO_ERROR; +} + +/* covert the NURBS curve into a series of adjacent Bezier curves */ +static GLenum +convert_curve(knot_str_type * the_knot, curve_attribs * attrib, + GLfloat ** new_ctrl, GLint * ncontrol) +{ + GLenum err; + + if ((err = explode_knot(the_knot)) != GLU_NO_ERROR) { + if (the_knot->unified_knot) { + free(the_knot->unified_knot); + the_knot->unified_knot = NULL; + } + return err; + } + if (the_knot->unified_knot) { + free(the_knot->unified_knot); + the_knot->unified_knot = NULL; + } + if ((err = calc_alphas(the_knot)) != GLU_NO_ERROR) { + free(the_knot->new_knot); + return err; + } + free(the_knot->new_knot); + if ((err = calc_new_ctrl_pts(attrib->ctrlarray, attrib->stride, the_knot, + attrib->dim, new_ctrl, ncontrol)) + != GLU_NO_ERROR) { + free(the_knot->alpha); + return err; + } + free(the_knot->alpha); + return GLU_NO_ERROR; +} + +/* covert curves - geometry and possible attribute ones into equivalent */ +/* sequence of adjacent Bezier curves */ +static GLenum +convert_curves(GLUnurbsObj * nobj, GLfloat ** new_geom_ctrl, + GLint * ncontrol, GLfloat ** new_color_ctrl, + GLfloat ** new_normal_ctrl, GLfloat ** new_texture_ctrl) +{ + knot_str_type geom_knot, color_knot, normal_knot, texture_knot; + GLint junk; + GLenum err; + + *new_color_ctrl = *new_normal_ctrl = *new_texture_ctrl = NULL; + + if (fill_knot_structures(nobj, &geom_knot, &color_knot, &normal_knot, + &texture_knot) != GLU_NO_ERROR) + return GLU_ERROR; + + /* unify knots - all knots should have the same number of working */ + /* ranges */ + if ( + (err = + select_knot_working_range(nobj, &geom_knot, &color_knot, &normal_knot, + &texture_knot)) != GLU_NO_ERROR) { + return err; + } + /* convert the geometry curve */ + nobj->curve.geom.dim = get_curve_dim(nobj->curve.geom.type); + if ((err = convert_curve(&geom_knot, &(nobj->curve.geom), new_geom_ctrl, + ncontrol)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + call_user_error(nobj, err); + return err; + } + /* if additional attributive curves are given convert them as well */ + if (color_knot.unified_knot) { + nobj->curve.color.dim = get_curve_dim(nobj->curve.color.type); + if ((err = convert_curve(&color_knot, &(nobj->curve.color), + new_color_ctrl, &junk)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + free(*new_geom_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (normal_knot.unified_knot) { + nobj->curve.normal.dim = get_curve_dim(nobj->curve.normal.type); + if ((err = convert_curve(&normal_knot, &(nobj->curve.normal), + new_normal_ctrl, &junk)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + free(*new_geom_ctrl); + if (*new_color_ctrl) + free(*new_color_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (texture_knot.unified_knot) { + nobj->curve.texture.dim = get_curve_dim(nobj->curve.texture.type); + if ((err = convert_curve(&texture_knot, &(nobj->curve.texture), + new_texture_ctrl, &junk)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + free(*new_geom_ctrl); + if (*new_color_ctrl) + free(*new_color_ctrl); + if (*new_normal_ctrl) + free(*new_normal_ctrl); + call_user_error(nobj, err); + return err; + } + } + return GLU_NO_ERROR; +} + +/* main NURBS curve procedure */ +void +do_nurbs_curve(GLUnurbsObj * nobj) +{ + GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0; + GLenum geom_type; + GLint n_ctrl; + GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl, + *new_texture_ctrl; + GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0; + GLint *factors; + GLint i, j; + GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0; + + /* test the user supplied data */ + if (test_nurbs_curves(nobj) != GLU_NO_ERROR) + return; + + if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl, + &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR) + return; + + geom_order = nobj->curve.geom.order; + geom_type = nobj->curve.geom.type; + geom_dim = nobj->curve.geom.dim; + + if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim, + &factors) != GLU_NO_ERROR) { + free(new_geom_ctrl); + if (new_color_ctrl) + free(new_color_ctrl); + if (new_normal_ctrl) + free(new_normal_ctrl); + if (new_texture_ctrl) + free(new_texture_ctrl); + return; + } + glEnable(geom_type); + if (new_color_ctrl) { + glEnable(nobj->curve.color.type); + color_dim = nobj->curve.color.dim; + color_ctrl = new_color_ctrl; + color_order = nobj->curve.color.order; + } + if (new_normal_ctrl) { + glEnable(nobj->curve.normal.type); + normal_dim = nobj->curve.normal.dim; + normal_ctrl = new_normal_ctrl; + normal_order = nobj->curve.normal.order; + } + if (new_texture_ctrl) { + glEnable(nobj->curve.texture.type); + texture_dim = nobj->curve.texture.dim; + texture_ctrl = new_texture_ctrl; + texture_order = nobj->curve.texture.order; + } + for (i = 0, j = 0, geom_ctrl = new_geom_ctrl; + i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) { + if (fine_culling_test_2D + (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) { + color_ctrl += color_order * color_dim; + normal_ctrl += normal_order * normal_dim; + texture_ctrl += texture_order * texture_dim; + continue; + } + glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl); + if (new_color_ctrl) { + glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim, + color_order, color_ctrl); + color_ctrl += color_order * color_dim; + } + if (new_normal_ctrl) { + glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim, + normal_order, normal_ctrl); + normal_ctrl += normal_order * normal_dim; + } + if (new_texture_ctrl) { + glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim, + texture_order, texture_ctrl); + texture_ctrl += texture_order * texture_dim; + } + glMapGrid1f(factors[j], 0.0, 1.0); + glEvalMesh1(GL_LINE, 0, factors[j]); + } + free(new_geom_ctrl); + free(factors); + if (new_color_ctrl) + free(new_color_ctrl); + if (new_normal_ctrl) + free(new_normal_ctrl); + if (new_texture_ctrl) + free(new_texture_ctrl); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.h xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.h --- xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/nurbs.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,252 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifndef NURBS_H +#define NURBS_H + + +#define EPSILON 1e-06 /* epsilon for double precision compares */ + +typedef enum +{ + GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM, + GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE +} +GLU_nurbs_enum; + +typedef enum +{ + GLU_TRIM_NURBS, GLU_TRIM_PWL +} +GLU_trim_enum; + +typedef struct +{ + GLint sknot_count; + GLfloat *sknot; + GLint tknot_count; + GLfloat *tknot; + GLint s_stride; + GLint t_stride; + GLfloat *ctrlarray; + GLint sorder; + GLint torder; + GLint dim; + GLenum type; +} +surface_attribs; + +typedef struct +{ + surface_attribs geom; + surface_attribs color; + surface_attribs texture; + surface_attribs normal; +} +nurbs_surface; + +typedef struct +{ + GLint knot_count; + GLfloat *knot; + GLint stride; + GLfloat *ctrlarray; + GLint order; + GLint dim; + GLenum type; +} +curve_attribs; + +typedef struct +{ + GLint pt_count; + GLfloat *ctrlarray; + GLint stride; + GLint dim; + GLenum type; +} +pwl_curve_attribs; + +typedef struct +{ + curve_attribs geom; + curve_attribs color; + curve_attribs texture; + curve_attribs normal; +} +nurbs_curve; + +typedef struct trim_list_str +{ + GLU_trim_enum trim_type; + union + { + pwl_curve_attribs pwl_curve; + curve_attribs nurbs_curve; + } + curve; + struct trim_list_str *next; +} +trim_list; + +typedef struct seg_trim_str +{ + GLfloat *points; + GLint pt_cnt, seg_array_len; + struct seg_trim_str *next; +} +trim_segments; + +typedef struct nurbs_trim_str +{ + trim_list *trim_loop; + trim_segments *segments; + struct nurbs_trim_str *next; +} +nurbs_trim; + +typedef struct +{ + GLfloat model[16], proj[16], viewport[4]; +} +culling_and_sampling_str; + +struct GLUnurbs +{ + GLboolean culling; + GLenum error; + void (GLCALLBACK * error_callback) (GLenum err); + GLenum display_mode; + GLU_nurbs_enum nurbs_type; + GLboolean auto_load_matrix; + culling_and_sampling_str sampling_matrices; + GLenum sampling_method; + GLfloat sampling_tolerance; + GLfloat parametric_tolerance; + GLint u_step, v_step; + nurbs_surface surface; + nurbs_curve curve; + nurbs_trim *trim; +}; + +typedef struct +{ + GLfloat *knot; + GLint nknots; + GLfloat *unified_knot; + GLint unified_nknots; + GLint order; + GLint t_min, t_max; + GLint delta_nknots; + GLboolean open_at_begin, open_at_end; + GLfloat *new_knot; + GLfloat *alpha; +} +knot_str_type; + +typedef struct +{ + GLfloat *geom_ctrl; + GLint geom_s_stride, geom_t_stride; + GLfloat **geom_offsets; + GLint geom_s_pt_cnt, geom_t_pt_cnt; + GLfloat *color_ctrl; + GLint color_s_stride, color_t_stride; + GLfloat **color_offsets; + GLint color_s_pt_cnt, color_t_pt_cnt; + GLfloat *normal_ctrl; + GLint normal_s_stride, normal_t_stride; + GLfloat **normal_offsets; + GLint normal_s_pt_cnt, normal_t_pt_cnt; + GLfloat *texture_ctrl; + GLint texture_s_stride, texture_t_stride; + GLfloat **texture_offsets; + GLint texture_s_pt_cnt, texture_t_pt_cnt; + GLint s_bezier_cnt, t_bezier_cnt; +} +new_ctrl_type; + +extern void call_user_error(GLUnurbsObj * nobj, GLenum error); + +extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order); + +extern GLenum explode_knot(knot_str_type * the_knot); + +extern GLenum calc_alphas(knot_str_type * the_knot); + +extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, + knot_str_type * the_knot, GLint dim, + GLfloat ** new_ctrl, GLint * ncontrol); + +extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl, + GLint n_ctrl, GLint order, GLint dim, + GLint ** factors); + +extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj, + new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl, + GLint n_ctrl, GLint stride, GLint dim); + +extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl, + GLint s_n_ctrl, GLint t_n_ctrl, + GLint s_stride, GLint t_stride, + GLint dim); + +extern void do_nurbs_curve(GLUnurbsObj * nobj); + +extern void do_nurbs_surface(GLUnurbsObj * nobj); + +extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint * sfactors, GLint * tfactors); + +extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src, + GLfloat maximal_min_knot, + GLfloat minimal_max_knot); + +extern GLenum select_knot_working_range(GLUnurbsObj * nobj, + knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot); + +extern void free_unified_knots(knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot); + + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/nurbssrf.c xpsb-glx-0.19/mesa/src/glu/mesa/nurbssrf.c --- xpsb-glx-0.19/mesa/src/glu/mesa/nurbssrf.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/nurbssrf.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1317 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include "gluP.h" +#include "nurbs.h" +#endif + + +static int +get_surface_dim(GLenum type) +{ + switch (type) { + case GL_MAP2_VERTEX_3: + return 3; + case GL_MAP2_VERTEX_4: + return 4; + case GL_MAP2_INDEX: + return 1; + case GL_MAP2_COLOR_4: + return 4; + case GL_MAP2_NORMAL: + return 3; + case GL_MAP2_TEXTURE_COORD_1: + return 1; + case GL_MAP2_TEXTURE_COORD_2: + return 2; + case GL_MAP2_TEXTURE_COORD_3: + return 3; + case GL_MAP2_TEXTURE_COORD_4: + return 4; + default: + abort(); /* TODO: is this OK? */ + } + return 0; /*never get here */ +} + +static GLenum +test_nurbs_surface(GLUnurbsObj * nobj, surface_attribs * attrib) +{ + GLenum err; + GLint tmp_int; + + if (attrib->sorder < 0 || attrib->torder < 0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return GLU_ERROR; + } + glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int); + if (attrib->sorder > tmp_int || attrib->sorder < 2) { + call_user_error(nobj, GLU_NURBS_ERROR1); + return GLU_ERROR; + } + if (attrib->torder > tmp_int || attrib->torder < 2) { + call_user_error(nobj, GLU_NURBS_ERROR1); + return GLU_ERROR; + } + if (attrib->sknot_count < attrib->sorder + 2) { + call_user_error(nobj, GLU_NURBS_ERROR2); + return GLU_ERROR; + } + if (attrib->tknot_count < attrib->torder + 2) { + call_user_error(nobj, GLU_NURBS_ERROR2); + return GLU_ERROR; + } + if (attrib->s_stride < 0 || attrib->t_stride < 0) { + call_user_error(nobj, GLU_NURBS_ERROR34); + return GLU_ERROR; + } + if (attrib->sknot == NULL || attrib->tknot == NULL + || attrib->ctrlarray == NULL) { + call_user_error(nobj, GLU_NURBS_ERROR36); + return GLU_ERROR; + } + if ((err = test_knot(attrib->tknot_count, attrib->tknot, attrib->torder)) + != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + if ((err = test_knot(attrib->sknot_count, attrib->sknot, attrib->sorder)) + != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + return GLU_NO_ERROR; +} + +static GLenum +test_nurbs_surfaces(GLUnurbsObj * nobj) +{ + /* test the geometric data */ + if (test_nurbs_surface(nobj, &(nobj->surface.geom)) != GLU_NO_ERROR) + return GLU_ERROR; + /* now test the attributive data */ + /* color */ + if (nobj->surface.color.type != GLU_INVALID_ENUM) + if (test_nurbs_surface(nobj, &(nobj->surface.color)) != GLU_NO_ERROR) + return GLU_ERROR; + /* normal */ + if (nobj->surface.normal.type != GLU_INVALID_ENUM) + if (test_nurbs_surface(nobj, &(nobj->surface.normal)) != GLU_NO_ERROR) + return GLU_ERROR; + /* texture */ + if (nobj->surface.texture.type != GLU_INVALID_ENUM) + if (test_nurbs_surface(nobj, &(nobj->surface.texture)) != GLU_NO_ERROR) + return GLU_ERROR; + return GLU_NO_ERROR; +} + +static GLenum +convert_surf(knot_str_type * s_knot, knot_str_type * t_knot, + surface_attribs * attrib, GLfloat ** new_ctrl, + GLint * s_n_ctrl, GLint * t_n_ctrl) +{ + GLfloat **tmp_ctrl; + GLfloat *ctrl_offset; + GLint tmp_n_control; + GLint i, j, t_cnt, s_cnt; + GLint tmp_stride; + GLint dim; + GLenum err; + + /* valid range is empty? */ + if ((s_knot->unified_knot != NULL && s_knot->unified_nknots == 0) || + (t_knot->unified_knot != NULL && t_knot->unified_nknots == 0)) { + if (s_knot->unified_knot) { + free(s_knot->unified_knot); + s_knot->unified_knot = NULL; + } + if (t_knot->unified_knot) { + free(t_knot->unified_knot); + t_knot->unified_knot = NULL; + } + *s_n_ctrl = 0; + *t_n_ctrl = 0; + return GLU_NO_ERROR; + } + t_cnt = attrib->tknot_count - attrib->torder; + s_cnt = attrib->sknot_count - attrib->sorder; + if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * t_cnt)) == NULL) + return GLU_OUT_OF_MEMORY; + if ((err = explode_knot(s_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + if (s_knot->unified_knot) { + free(s_knot->unified_knot); + s_knot->unified_knot = NULL; + } + return err; + } + if (s_knot->unified_knot) { + free(s_knot->unified_knot); + s_knot->unified_knot = NULL; + } + if ((err = calc_alphas(s_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + free(s_knot->new_knot); + return err; + } + free(s_knot->new_knot); + ctrl_offset = attrib->ctrlarray; + dim = attrib->dim; + for (i = 0; i < t_cnt; i++) { + if ((err = calc_new_ctrl_pts(ctrl_offset, attrib->s_stride, s_knot, + dim, &(tmp_ctrl[i]), + &tmp_n_control)) != GLU_NO_ERROR) { + for (--i; i <= 0; i--) + free(tmp_ctrl[i]); + free(tmp_ctrl); + free(s_knot->alpha); + return err; + } + ctrl_offset += attrib->t_stride; + } + free(s_knot->alpha); + tmp_stride = dim * tmp_n_control; + if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * t_cnt)) + == NULL) { + for (i = 0; i < t_cnt; i++) + free(tmp_ctrl[i]); + free(tmp_ctrl); + return GLU_OUT_OF_MEMORY; + } + for (i = 0; i < tmp_n_control; i++) + for (j = 0; j < t_cnt; j++) + MEMCPY(*new_ctrl + j * dim + i * dim * t_cnt, tmp_ctrl[j] + dim * i, + sizeof(GLfloat) * dim); + for (i = 0; i < t_cnt; i++) + free(tmp_ctrl[i]); + free(tmp_ctrl); + *s_n_ctrl = tmp_n_control; + + if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * (*s_n_ctrl))) == + NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((err = explode_knot(t_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + if (t_knot->unified_knot) { + free(t_knot->unified_knot); + t_knot->unified_knot = NULL; + } + return err; + } + if (t_knot->unified_knot) { + free(t_knot->unified_knot); + t_knot->unified_knot = NULL; + } + if ((err = calc_alphas(t_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + free(t_knot->new_knot); + return err; + } + free(t_knot->new_knot); + ctrl_offset = *new_ctrl; + for (i = 0; i < (*s_n_ctrl); i++) { + if ((err = calc_new_ctrl_pts(ctrl_offset, dim, t_knot, + dim, &(tmp_ctrl[i]), + &tmp_n_control)) != GLU_NO_ERROR) { + for (--i; i <= 0; i--) + free(tmp_ctrl[i]); + free(tmp_ctrl); + free(t_knot->alpha); + return err; + } + ctrl_offset += dim * t_cnt; + } + free(t_knot->alpha); + free(*new_ctrl); + tmp_stride = dim * tmp_n_control; + if ( + (*new_ctrl = + (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * (*s_n_ctrl))) == + NULL) { + for (i = 0; i < (*s_n_ctrl); i++) + free(tmp_ctrl[i]); + free(tmp_ctrl); + return GLU_OUT_OF_MEMORY; + } + for (i = 0; i < (*s_n_ctrl); i++) { + MEMCPY(*new_ctrl + i * tmp_stride, tmp_ctrl[i], + sizeof(GLfloat) * tmp_stride); + free(tmp_ctrl[i]); + } + free(tmp_ctrl); + *t_n_ctrl = tmp_n_control; + return GLU_NO_ERROR; +} + +/* prepare the knot information structures */ +static GLenum +fill_knot_structures(GLUnurbsObj * nobj, + knot_str_type * geom_s_knot, knot_str_type * geom_t_knot, + knot_str_type * color_s_knot, + knot_str_type * color_t_knot, + knot_str_type * normal_s_knot, + knot_str_type * normal_t_knot, + knot_str_type * texture_s_knot, + knot_str_type * texture_t_knot) +{ + GLint order; + GLfloat *knot; + GLint nknots; + GLint t_min, t_max; + + geom_s_knot->unified_knot = NULL; + knot = geom_s_knot->knot = nobj->surface.geom.sknot; + nknots = geom_s_knot->nknots = nobj->surface.geom.sknot_count; + order = geom_s_knot->order = nobj->surface.geom.sorder; + geom_s_knot->delta_nknots = 0; + t_min = geom_s_knot->t_min = order - 1; + t_max = geom_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + geom_s_knot->open_at_begin = GL_TRUE; + } + else + geom_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + geom_s_knot->open_at_end = GL_TRUE; + } + else + geom_s_knot->open_at_end = GL_FALSE; + geom_t_knot->unified_knot = NULL; + knot = geom_t_knot->knot = nobj->surface.geom.tknot; + nknots = geom_t_knot->nknots = nobj->surface.geom.tknot_count; + order = geom_t_knot->order = nobj->surface.geom.torder; + geom_t_knot->delta_nknots = 0; + t_min = geom_t_knot->t_min = order - 1; + t_max = geom_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + geom_t_knot->open_at_begin = GL_TRUE; + } + else + geom_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + geom_t_knot->open_at_end = GL_TRUE; + } + else + geom_t_knot->open_at_end = GL_FALSE; + + if (nobj->surface.color.type != GLU_INVALID_ENUM) { + color_s_knot->unified_knot = (GLfloat *) 1; + knot = color_s_knot->knot = nobj->surface.color.sknot; + nknots = color_s_knot->nknots = nobj->surface.color.sknot_count; + order = color_s_knot->order = nobj->surface.color.sorder; + color_s_knot->delta_nknots = 0; + t_min = color_s_knot->t_min = order - 1; + t_max = color_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + color_s_knot->open_at_begin = GL_TRUE; + } + else + color_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + color_s_knot->open_at_end = GL_TRUE; + } + else + color_s_knot->open_at_end = GL_FALSE; + color_t_knot->unified_knot = (GLfloat *) 1; + knot = color_t_knot->knot = nobj->surface.color.tknot; + nknots = color_t_knot->nknots = nobj->surface.color.tknot_count; + order = color_t_knot->order = nobj->surface.color.torder; + color_t_knot->delta_nknots = 0; + t_min = color_t_knot->t_min = order - 1; + t_max = color_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + color_t_knot->open_at_begin = GL_TRUE; + } + else + color_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + color_t_knot->open_at_end = GL_TRUE; + } + else + color_t_knot->open_at_end = GL_FALSE; + } + else { + color_s_knot->unified_knot = NULL; + color_t_knot->unified_knot = NULL; + } + + if (nobj->surface.normal.type != GLU_INVALID_ENUM) { + normal_s_knot->unified_knot = (GLfloat *) 1; + knot = normal_s_knot->knot = nobj->surface.normal.sknot; + nknots = normal_s_knot->nknots = nobj->surface.normal.sknot_count; + order = normal_s_knot->order = nobj->surface.normal.sorder; + normal_s_knot->delta_nknots = 0; + t_min = normal_s_knot->t_min = order - 1; + t_max = normal_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + normal_s_knot->open_at_begin = GL_TRUE; + } + else + normal_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + normal_s_knot->open_at_end = GL_TRUE; + } + else + normal_s_knot->open_at_end = GL_FALSE; + normal_t_knot->unified_knot = (GLfloat *) 1; + knot = normal_t_knot->knot = nobj->surface.normal.tknot; + nknots = normal_t_knot->nknots = nobj->surface.normal.tknot_count; + order = normal_t_knot->order = nobj->surface.normal.torder; + normal_t_knot->delta_nknots = 0; + t_min = normal_t_knot->t_min = order - 1; + t_max = normal_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + normal_t_knot->open_at_begin = GL_TRUE; + } + else + normal_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + normal_t_knot->open_at_end = GL_TRUE; + } + else + normal_t_knot->open_at_end = GL_FALSE; + } + else { + normal_s_knot->unified_knot = NULL; + normal_t_knot->unified_knot = NULL; + } + + if (nobj->surface.texture.type != GLU_INVALID_ENUM) { + texture_s_knot->unified_knot = (GLfloat *) 1; + knot = texture_s_knot->knot = nobj->surface.texture.sknot; + nknots = texture_s_knot->nknots = nobj->surface.texture.sknot_count; + order = texture_s_knot->order = nobj->surface.texture.sorder; + texture_s_knot->delta_nknots = 0; + t_min = texture_s_knot->t_min = order - 1; + t_max = texture_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + texture_s_knot->open_at_begin = GL_TRUE; + } + else + texture_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + texture_s_knot->open_at_end = GL_TRUE; + } + else + texture_s_knot->open_at_end = GL_FALSE; + texture_t_knot->unified_knot = (GLfloat *) 1; + knot = texture_t_knot->knot = nobj->surface.texture.tknot; + nknots = texture_t_knot->nknots = nobj->surface.texture.tknot_count; + order = texture_t_knot->order = nobj->surface.texture.torder; + texture_t_knot->delta_nknots = 0; + t_min = texture_t_knot->t_min = order - 1; + t_max = texture_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + texture_t_knot->open_at_begin = GL_TRUE; + } + else + texture_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + texture_t_knot->open_at_end = GL_TRUE; + } + else + texture_t_knot->open_at_end = GL_FALSE; + } + else { + texture_s_knot->unified_knot = NULL; + texture_t_knot->unified_knot = NULL; + } + return GLU_NO_ERROR; +} + + +static void +free_new_ctrl(new_ctrl_type * p) +{ + if (p->geom_ctrl) + free(p->geom_ctrl); + if (p->geom_offsets) + free(p->geom_offsets); + if (p->color_ctrl) { + free(p->color_ctrl); + if (p->color_offsets) + free(p->color_offsets); + } + if (p->normal_ctrl) { + free(p->normal_ctrl); + if (p->normal_offsets) + free(p->normal_offsets); + } + if (p->texture_ctrl) { + free(p->texture_ctrl); + if (p->texture_offsets) + free(p->texture_offsets); + } +} + +/* convert surfaces - geometry and possible attribute ones into equivalent */ +/* sequence of adjacent Bezier patches */ +static GLenum +convert_surfs(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl) +{ + knot_str_type geom_s_knot, color_s_knot, normal_s_knot, texture_s_knot; + knot_str_type geom_t_knot, color_t_knot, normal_t_knot, texture_t_knot; + GLenum err; + + if ((err = fill_knot_structures(nobj, &geom_s_knot, &geom_t_knot, + &color_s_knot, &color_t_knot, + &normal_s_knot, &normal_t_knot, + &texture_s_knot, + &texture_t_knot)) != GLU_NO_ERROR) { + return err; + } + /* unify knots - all knots should have the same working range */ + if ((err = select_knot_working_range(nobj, &geom_s_knot, &color_s_knot, + &normal_s_knot, + &texture_s_knot)) != GLU_NO_ERROR) { + call_user_error(nobj, err); + return err; + } + if ((err = select_knot_working_range(nobj, &geom_t_knot, &color_t_knot, + &normal_t_knot, + &texture_t_knot)) != GLU_NO_ERROR) { + free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot, + &texture_s_knot); + call_user_error(nobj, err); + return err; + } + + /* convert the geometry surface */ + nobj->surface.geom.dim = get_surface_dim(nobj->surface.geom.type); + if ((err = convert_surf(&geom_s_knot, &geom_t_knot, &(nobj->surface.geom), + &(new_ctrl->geom_ctrl), &(new_ctrl->geom_s_pt_cnt), + &(new_ctrl->geom_t_pt_cnt))) != GLU_NO_ERROR) { + free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot, + &texture_s_knot); + free_unified_knots(&geom_t_knot, &color_t_knot, &normal_t_knot, + &texture_t_knot); + call_user_error(nobj, err); + return err; + } + /* if additional attributive surfaces are given convert them as well */ + if (color_s_knot.unified_knot) { + nobj->surface.color.dim = get_surface_dim(nobj->surface.color.type); + if ( + (err = + convert_surf(&color_s_knot, &color_t_knot, &(nobj->surface.color), + &(new_ctrl->color_ctrl), &(new_ctrl->color_s_pt_cnt), + &(new_ctrl->color_t_pt_cnt))) != GLU_NO_ERROR) { + free_unified_knots(&color_s_knot, &color_s_knot, &normal_s_knot, + &texture_s_knot); + free_unified_knots(&color_t_knot, &color_t_knot, &normal_t_knot, + &texture_t_knot); + free_new_ctrl(new_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (normal_s_knot.unified_knot) { + nobj->surface.normal.dim = get_surface_dim(nobj->surface.normal.type); + if ((err = convert_surf(&normal_s_knot, &normal_t_knot, + &(nobj->surface.normal), + &(new_ctrl->normal_ctrl), + &(new_ctrl->normal_s_pt_cnt), + &(new_ctrl->normal_t_pt_cnt))) != + GLU_NO_ERROR) { + free_unified_knots(&normal_s_knot, &normal_s_knot, &normal_s_knot, + &texture_s_knot); + free_unified_knots(&normal_t_knot, &normal_t_knot, &normal_t_knot, + &texture_t_knot); + free_new_ctrl(new_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (texture_s_knot.unified_knot) { + nobj->surface.texture.dim = get_surface_dim(nobj->surface.texture.type); + if ((err = convert_surf(&texture_s_knot, &texture_t_knot, + &(nobj->surface.texture), + &(new_ctrl->texture_ctrl), + &(new_ctrl->texture_s_pt_cnt), + &(new_ctrl->texture_t_pt_cnt))) != + GLU_NO_ERROR) { + free_unified_knots(&texture_s_knot, &texture_s_knot, &texture_s_knot, + &texture_s_knot); + free_unified_knots(&texture_t_knot, &texture_t_knot, &texture_t_knot, + &texture_t_knot); + free_new_ctrl(new_ctrl); + call_user_error(nobj, err); + return err; + } + } + return GLU_NO_ERROR; +} + +/* tesselate the "boundary" Bezier edge strips */ +static void +tesselate_strip_t_line(GLint top_start, GLint top_end, GLint top_z, + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLint bottom_domain) +{ + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; + + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + glBegin(GL_LINES); + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + for (k = 0; k <= tri_cnt; k++, top_start += direction) { + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + glEvalPoint2(top_z, top_start); + } + if (bottom_cnt) { + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + glEvalPoint2(top_z, top_start); + } + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } + glEnd(); +} + + +static void +tesselate_strip_t_fill(GLint top_start, GLint top_end, GLint top_z, + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLint bottom_domain) +{ + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; + + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + glBegin(GL_TRIANGLE_FAN); + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + for (k = 0; k <= tri_cnt; k++, top_start += direction) + glEvalPoint2(top_z, top_start); + if (bottom_cnt) { + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + } + glEnd(); + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } +} + + +static void +tesselate_strip_t(GLenum display_mode, GLint top_start, GLint top_end, + GLint top_z, GLint bottom_start, GLint bottom_end, + GLint bottom_z, GLint bottom_domain) +{ + if (display_mode == GL_FILL) + tesselate_strip_t_fill(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); + else + tesselate_strip_t_line(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); +} + + +static void +tesselate_strip_s_fill(GLint top_start, GLint top_end, GLint top_z, + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLfloat bottom_domain) +{ + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; + + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + glBegin(GL_TRIANGLE_FAN); + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + for (k = 0; k <= tri_cnt; k++, top_start += direction) + glEvalPoint2(top_start, top_z); + if (bottom_cnt) { + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + } + glEnd(); + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } +} + + +static void +tesselate_strip_s_line(GLint top_start, GLint top_end, GLint top_z, + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLfloat bottom_domain) +{ + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; + + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + glBegin(GL_LINES); + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + for (k = 0; k <= tri_cnt; k++, top_start += direction) { + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + glEvalPoint2(top_start, top_z); + } + if (bottom_cnt) { + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + glEvalPoint2(top_start, top_z); + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + } + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } + glEnd(); +} + + +static void +tesselate_strip_s(GLenum display_mode, GLint top_start, GLint top_end, + GLint top_z, GLint bottom_start, GLint bottom_end, + GLint bottom_z, GLfloat bottom_domain) +{ + if (display_mode == GL_FILL) + tesselate_strip_s_fill(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); + else + tesselate_strip_s_line(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); +} + +static void +tesselate_bottom_left_corner(GLenum display_mode, GLfloat s_1, GLfloat t_1) +{ + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(1, 1); + glEvalCoord2f(s_1, 0.0); + glEvalCoord2f(0.0, 0.0); + glEvalCoord2f(0.0, t_1); + } + else { + glBegin(GL_LINES); + glEvalCoord2f(0.0, 0.0); + glEvalCoord2f(0.0, t_1); + glEvalCoord2f(0.0, 0.0); + glEvalPoint2(1, 1); + glEvalCoord2f(0.0, 0.0); + glEvalCoord2f(s_1, 0.0); + } + glEnd(); +} + +static void +tesselate_bottom_right_corner(GLenum display_mode, GLint v_top, + GLint v_bottom, GLfloat s_1, GLfloat t_1) +{ + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(1, v_top); + glEvalCoord2f(0.0, v_bottom * t_1); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalCoord2f(s_1, (v_bottom + 1) * t_1); + } + else { + glBegin(GL_LINES); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalPoint2(1, v_top); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalCoord2f(0.0, v_bottom * t_1); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalCoord2f(s_1, (v_bottom + 1) * t_1); + } + glEnd(); +} + +static void +tesselate_top_left_corner(GLenum display_mode, GLint u_right, GLint u_left, + GLfloat s_1, GLfloat t_1) +{ + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(u_right, 1); + glEvalCoord2f((u_left + 1) * s_1, t_1); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalCoord2f(u_left * s_1, 0.0); + } + else { + glBegin(GL_LINES); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalPoint2(u_right, 1); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalCoord2f(u_left * s_1, 0.0); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalCoord2f((u_left + 1) * s_1, t_1); + } + glEnd(); +} + +static void +tesselate_top_right_corner(GLenum display_mode, GLint u_left, GLint v_bottom, + GLint u_right, GLint v_top, GLfloat s_1, + GLfloat t_1) +{ + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(u_left, v_bottom); + glEvalCoord2f((u_right - 1) * s_1, v_top * t_1); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1); + } + else { + glBegin(GL_LINES); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalPoint2(u_left, v_bottom); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalCoord2f((u_right - 1) * s_1, v_top * t_1); + } + glEnd(); +} + +/* do mesh mapping of Bezier */ +static void +nurbs_map_bezier(GLenum display_mode, GLint * sfactors, GLint * tfactors, + GLint s_bezier_cnt, GLint t_bezier_cnt, GLint s, GLint t) +{ + GLint top, bottom, right, left; + + + if (s == 0) { + top = *(tfactors + t * 3); + bottom = *(tfactors + t * 3 + 1); + } + else if (s == s_bezier_cnt - 1) { + top = *(tfactors + t * 3 + 2); + bottom = *(tfactors + t * 3); + } + else { + top = bottom = *(tfactors + t * 3); + } + if (t == 0) { + left = *(sfactors + s * 3 + 1); + right = *(sfactors + s * 3); + } + else if (t == t_bezier_cnt - 1) { + left = *(sfactors + s * 3); + right = *(sfactors + s * 3 + 2); + } + else { + left = right = *(sfactors + s * 3); + } + + if (top > bottom) { + if (left < right) { + glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 1, right, 1, top); + tesselate_strip_s(display_mode, 1, right, 1, 1, left, 0, + (GLfloat) left); + tesselate_bottom_left_corner(display_mode, (GLfloat) (1.0 / left), + (GLfloat) (1.0 / bottom)); +/* tesselate_strip_t(display_mode,1,top,1,1,bottom,0,(GLfloat)bottom);*/ + tesselate_strip_t(display_mode, top, 1, 1, bottom, 1, 0, + (GLfloat) bottom); + } + else if (left == right) { + glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 1, right, 0, top); +/* tesselate_strip_t(display_mode,0,top,1,0,bottom,0,(GLfloat)bottom);*/ + tesselate_strip_t(display_mode, top, 0, 1, bottom, 0, 0, + (GLfloat) bottom); + } + else { + glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 1, left, 0, top - 1); +/* tesselate_strip_t(display_mode,0,top-1,1,0,bottom-1,0, + (GLfloat)bottom);*/ + tesselate_strip_t(display_mode, top - 1, 0, 1, bottom - 1, 0, 0, + (GLfloat) bottom); + tesselate_bottom_right_corner(display_mode, top - 1, bottom - 1, + (GLfloat) (1.0 / right), + (GLfloat) (1.0 / bottom)); +/* tesselate_strip_s(display_mode,1,left,top-1,1,right,right, + (GLfloat)right);*/ + tesselate_strip_s(display_mode, left, 1, top - 1, right, 1, right, + (GLfloat) right); + } + } + else if (top == bottom) { + if (left < right) { + glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 0, right, 1, top); + tesselate_strip_s(display_mode, 0, right, 1, 0, left, 0, + (GLfloat) left); + } + else if (left == right) { + glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 0, right, 0, top); + } + else { + glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 0, left, 0, top - 1); +/* tesselate_strip_s(display_mode,0,left,top-1,0,right,right, + (GLfloat)right);*/ + tesselate_strip_s(display_mode, left, 0, top - 1, right, 0, right, + (GLfloat) right); + } + } + else { + if (left < right) { + glMapGrid2f(right, 0.0, 1.0, bottom, 0.0, 1.0); + glEvalMesh2(display_mode, 0, right - 1, 1, bottom); + tesselate_strip_s(display_mode, 0, right - 1, 1, 0, left - 1, 0, + (GLfloat) left); + tesselate_top_left_corner(display_mode, right - 1, left - 1, + (GLfloat) (1.0 / left), + (GLfloat) (1.0 / top)); + tesselate_strip_t(display_mode, 1, bottom, right - 1, 1, top, top, + (GLfloat) top); + } + else if (left == right) { + glMapGrid2f(right, 0.0, 1.0, bottom, 0.0, 1.0); + glEvalMesh2(display_mode, 0, right - 1, 0, bottom); + tesselate_strip_t(display_mode, 0, bottom, right - 1, 0, top, top, + (GLfloat) top); + } + else { + glMapGrid2f(left, 0.0, 1.0, bottom, 0.0, 1.0); + glEvalMesh2(display_mode, 0, left - 1, 0, bottom - 1); + tesselate_strip_t(display_mode, 0, bottom - 1, left - 1, 0, top - 1, + top, (GLfloat) top); + tesselate_top_right_corner(display_mode, left - 1, bottom - 1, right, + top, (GLfloat) (1.0 / right), + (GLfloat) (1.0 / top)); +/* tesselate_strip_s(display_mode,0,left-1,bottom-1,0,right-1,right, + (GLfloat)right);*/ + tesselate_strip_s(display_mode, left - 1, 0, bottom - 1, right - 1, + 0, right, (GLfloat) right); + } + } +} + +/* draw NURBS surface in OUTLINE POLYGON mode */ +static void +draw_polygon_mode(GLenum display_mode, GLUnurbsObj * nobj, + new_ctrl_type * new_ctrl, GLint * sfactors, + GLint * tfactors) +{ + GLsizei offset; + GLint t_bezier_cnt, s_bezier_cnt; + GLboolean do_color, do_normal, do_texture; + GLint i, j; + + t_bezier_cnt = new_ctrl->t_bezier_cnt; + s_bezier_cnt = new_ctrl->s_bezier_cnt; + glEnable(nobj->surface.geom.type); + if (new_ctrl->color_ctrl) { + glEnable(nobj->surface.color.type); + do_color = GL_TRUE; + } + else + do_color = GL_FALSE; + if (new_ctrl->normal_ctrl) { + glEnable(nobj->surface.normal.type); + do_normal = GL_TRUE; + } + else + do_normal = GL_FALSE; + if (new_ctrl->texture_ctrl) { + glEnable(nobj->surface.texture.type); + do_texture = GL_TRUE; + } + else + do_texture = GL_FALSE; + for (j = 0; j < s_bezier_cnt; j++) { + for (i = 0; i < t_bezier_cnt; i++) { + offset = j * t_bezier_cnt + i; + if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset), + nobj->surface.geom.sorder, + nobj->surface.geom.torder, + new_ctrl->geom_s_stride, + new_ctrl->geom_t_stride, + nobj->surface.geom.dim)) continue; + glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride, + nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride, + nobj->surface.geom.torder, + *(new_ctrl->geom_offsets + offset)); + if (do_color) { + glMap2f(nobj->surface.color.type, 0.0, 1.0, + new_ctrl->color_s_stride, nobj->surface.color.sorder, + 0.0, 1.0, new_ctrl->color_t_stride, + nobj->surface.color.torder, + *(new_ctrl->color_offsets + offset)); + } + if (do_normal) { + glMap2f(nobj->surface.normal.type, 0.0, 1.0, + new_ctrl->normal_s_stride, nobj->surface.normal.sorder, + 0.0, 1.0, new_ctrl->normal_t_stride, + nobj->surface.normal.torder, + *(new_ctrl->normal_offsets + offset)); + } + if (do_texture) { + glMap2f(nobj->surface.texture.type, 0.0, 1.0, + new_ctrl->texture_s_stride, nobj->surface.texture.sorder, + 0.0, 1.0, new_ctrl->texture_t_stride, + nobj->surface.texture.torder, + *(new_ctrl->texture_offsets + offset)); + } +/* glMapGrid2f(sfactors[j*3+0],0.0,1.0,tfactors[i*3+0],0.0,1.0); + glEvalMesh2(display_mode,0,sfactors[j*3+0],0,tfactors[i*3+0]);*/ + nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt, + t_bezier_cnt, j, i); + } + } +} + + + +/* draw NURBS surface in OUTLINE POLYGON mode */ +#if 0 +static void +draw_patch_mode(GLenum display_mode, GLUnurbsObj * nobj, + new_ctrl_type * new_ctrl, GLint * sfactors, GLint * tfactors) +{ + GLsizei offset; + GLint t_bezier_cnt, s_bezier_cnt; + GLboolean do_color, do_normal, do_texture; + GLint i, j; + + t_bezier_cnt = new_ctrl->t_bezier_cnt; + s_bezier_cnt = new_ctrl->s_bezier_cnt; + glEnable(nobj->surface.geom.type); + if (new_ctrl->color_ctrl) { + glEnable(nobj->surface.color.type); + do_color = GL_TRUE; + } + else + do_color = GL_FALSE; + if (new_ctrl->normal_ctrl) { + glEnable(nobj->surface.normal.type); + do_normal = GL_TRUE; + } + else + do_normal = GL_FALSE; + if (new_ctrl->texture_ctrl) { + glEnable(nobj->surface.texture.type); + do_texture = GL_TRUE; + } + else + do_texture = GL_FALSE; + for (j = 0; j < s_bezier_cnt; j++) { + for (i = 0; i < t_bezier_cnt; i++) { + offset = j * t_bezier_cnt + i; + if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset), + nobj->surface.geom.sorder, + nobj->surface.geom.torder, + new_ctrl->geom_s_stride, + new_ctrl->geom_t_stride, + nobj->surface.geom.dim)) continue; + glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride, + nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride, + nobj->surface.geom.torder, + *(new_ctrl->geom_offsets + offset)); + if (do_color) { + glMap2f(nobj->surface.color.type, 0.0, 1.0, + new_ctrl->color_s_stride, nobj->surface.color.sorder, + 0.0, 1.0, new_ctrl->color_t_stride, + nobj->surface.color.torder, + *(new_ctrl->color_offsets + offset)); + } + if (do_normal) { + glMap2f(nobj->surface.normal.type, 0.0, 1.0, + new_ctrl->normal_s_stride, nobj->surface.normal.sorder, + 0.0, 1.0, new_ctrl->normal_t_stride, + nobj->surface.normal.torder, + *(new_ctrl->normal_offsets + offset)); + } + if (do_texture) { + glMap2f(nobj->surface.texture.type, 0.0, 1.0, + new_ctrl->texture_s_stride, nobj->surface.texture.sorder, + 0.0, 1.0, new_ctrl->texture_t_stride, + nobj->surface.texture.torder, + *(new_ctrl->texture_offsets + offset)); + } + nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt, + t_bezier_cnt, i, j); +/* glMapGrid2f(sfactors[j],0.0,1.0,tfactors[i],0.0,1.0); + glEvalMesh2(display_mode,0,sfactors[j],0,tfactors[i]);*/ + } + } +} +#endif + + + +static void +init_new_ctrl(new_ctrl_type * p) +{ + p->geom_ctrl = p->color_ctrl = p->normal_ctrl = p->texture_ctrl = NULL; + p->geom_offsets = p->color_offsets = p->normal_offsets = + p->texture_offsets = NULL; + p->s_bezier_cnt = p->t_bezier_cnt = 0; +} + + +static GLenum +augment_new_ctrl(GLUnurbsObj * nobj, new_ctrl_type * p) +{ + GLsizei offset_size; + GLint i, j; + + p->s_bezier_cnt = (p->geom_s_pt_cnt) / (nobj->surface.geom.sorder); + p->t_bezier_cnt = (p->geom_t_pt_cnt) / (nobj->surface.geom.torder); + offset_size = (p->s_bezier_cnt) * (p->t_bezier_cnt); + p->geom_t_stride = nobj->surface.geom.dim; + p->geom_s_stride = (p->geom_t_pt_cnt) * (nobj->surface.geom.dim); + p->color_t_stride = nobj->surface.color.dim; + p->color_s_stride = (p->color_t_pt_cnt) * (nobj->surface.color.dim); + p->normal_t_stride = nobj->surface.normal.dim; + p->normal_s_stride = (p->normal_t_pt_cnt) * (nobj->surface.normal.dim); + p->texture_t_stride = nobj->surface.texture.dim; + p->texture_s_stride = (p->texture_t_pt_cnt) * (nobj->surface.texture.dim); + if ( + (p->geom_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if (p->color_ctrl) + if ( + (p->color_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + free_new_ctrl(p); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if (p->normal_ctrl) + if ( + (p->normal_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + free_new_ctrl(p); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if (p->texture_ctrl) + if ( + (p->texture_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + free_new_ctrl(p); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->geom_offsets + i * (p->t_bezier_cnt) + j) = + p->geom_ctrl + i * (nobj->surface.geom.sorder) * + (nobj->surface.geom.dim) * (p->geom_t_pt_cnt) + + j * (nobj->surface.geom.dim) * (nobj->surface.geom.torder); + if (p->color_ctrl) + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->color_offsets + i * (p->t_bezier_cnt) + j) = + p->color_ctrl + i * (nobj->surface.color.sorder) * + (nobj->surface.color.dim) * (p->color_t_pt_cnt) + + j * (nobj->surface.color.dim) * (nobj->surface.color.torder); + if (p->normal_ctrl) + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->normal_offsets + i * (p->t_bezier_cnt) + j) = + p->normal_ctrl + i * (nobj->surface.normal.sorder) * + (nobj->surface.normal.dim) * (p->normal_t_pt_cnt) + + j * (nobj->surface.normal.dim) * (nobj->surface.normal.torder); + if (p->texture_ctrl) + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->texture_offsets + i * (p->t_bezier_cnt) + j) = + p->texture_ctrl + i * (nobj->surface.texture.sorder) * + (nobj->surface.texture.dim) * (p->texture_t_pt_cnt) + + j * (nobj->surface.texture.dim) * + (nobj->surface.texture.torder); + return GLU_NO_ERROR; +} + +/* main NURBS surface procedure */ +void +do_nurbs_surface(GLUnurbsObj * nobj) +{ + GLint *sfactors, *tfactors; + new_ctrl_type new_ctrl; + + /* test user supplied data */ + if (test_nurbs_surfaces(nobj) != GLU_NO_ERROR) + return; + + init_new_ctrl(&new_ctrl); + + if (convert_surfs(nobj, &new_ctrl) != GLU_NO_ERROR) + return; + if (augment_new_ctrl(nobj, &new_ctrl) != GLU_NO_ERROR) + return; + switch (nobj->sampling_method) { + case GLU_PATH_LENGTH: + if (glu_do_sampling_3D(nobj, &new_ctrl, &sfactors, &tfactors) != + GLU_NO_ERROR) { + free_new_ctrl(&new_ctrl); + return; + } + break; + case GLU_DOMAIN_DISTANCE: + if (glu_do_sampling_uv(nobj, &new_ctrl, &sfactors, &tfactors) != + GLU_NO_ERROR) { + free_new_ctrl(&new_ctrl); + return; + } + break; + case GLU_PARAMETRIC_ERROR: + if (glu_do_sampling_param_3D(nobj, &new_ctrl, &sfactors, &tfactors) != + GLU_NO_ERROR) { + free_new_ctrl(&new_ctrl); + return; + } + break; + default: + abort(); + } + glFrontFace(GL_CW); + switch (nobj->display_mode) { + case GLU_FILL: +/* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/ + draw_polygon_mode(GL_FILL, nobj, &new_ctrl, sfactors, tfactors); + break; + case GLU_OUTLINE_POLYGON: + /* TODO - missing trimming handeling */ +/* just for now - no OUTLINE_PATCH mode + draw_patch_mode(GL_LINE,nobj,&new_ctrl,sfactors,tfactors); + break; */ + case GLU_OUTLINE_PATCH: +/* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/ + draw_polygon_mode(GL_LINE, nobj, &new_ctrl, sfactors, tfactors); + break; + default: + abort(); /* TODO: is this OK? */ + } + free(sfactors); + free(tfactors); + free_new_ctrl(&new_ctrl); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/nurbsutl.c xpsb-glx-0.19/mesa/src/glu/mesa/nurbsutl.c --- xpsb-glx-0.19/mesa/src/glu/mesa/nurbsutl.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/nurbsutl.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1309 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "nurbs.h" +#endif + + +GLenum test_knot(GLint nknots, GLfloat * knot, GLint order) +{ + GLsizei i; + GLint knot_mult; + GLfloat tmp_knot; + + tmp_knot = knot[0]; + knot_mult = 1; + for (i = 1; i < nknots; i++) { + if (knot[i] < tmp_knot) + return GLU_NURBS_ERROR4; + if (fabs(tmp_knot - knot[i]) > EPSILON) { + if (knot_mult > order) + return GLU_NURBS_ERROR5; + knot_mult = 1; + tmp_knot = knot[i]; + } + else + ++knot_mult; + } + return GLU_NO_ERROR; +} + +static int +/* qsort function */ +#if defined(WIN32) && !defined(OPENSTEP) + __cdecl +#endif +knot_sort(const void *a, const void *b) +{ + GLfloat x, y; + + x = *((GLfloat *) a); + y = *((GLfloat *) b); + if (fabs(x - y) < EPSILON) + return 0; + if (x > y) + return 1; + return -1; +} + +/* insert into dest knot all values within the valid range from src knot */ +/* that do not appear in dest */ +void +collect_unified_knot(knot_str_type * dest, knot_str_type * src, + GLfloat maximal_min_knot, GLfloat minimal_max_knot) +{ + GLfloat *src_knot, *dest_knot; + GLint src_t_min, src_t_max, dest_t_min, dest_t_max; + GLint src_nknots, dest_nknots; + GLint i, j, k, new_cnt; + GLboolean not_found_flag; + + src_knot = src->unified_knot; + dest_knot = dest->unified_knot; + src_t_min = src->t_min; + src_t_max = src->t_max; + dest_t_min = dest->t_min; + dest_t_max = dest->t_max; + src_nknots = src->unified_nknots; + dest_nknots = dest->unified_nknots; + + k = new_cnt = dest_nknots; + for (i = src_t_min; i <= src_t_max; i++) + if (src_knot[i] - maximal_min_knot > -EPSILON && + src_knot[i] - minimal_max_knot < EPSILON) { + not_found_flag = GL_TRUE; + for (j = dest_t_min; j <= dest_t_max; j++) + if (fabs(dest_knot[j] - src_knot[i]) < EPSILON) { + not_found_flag = GL_FALSE; + break; + } + if (not_found_flag) { + /* knot from src is not in dest - add this knot to dest */ + dest_knot[k++] = src_knot[i]; + ++new_cnt; + ++(dest->t_max); /* the valid range widens */ + ++(dest->delta_nknots); /* increment the extra knot value counter */ + } + } + dest->unified_nknots = new_cnt; + qsort((void *) dest_knot, (size_t) new_cnt, (size_t) sizeof(GLfloat), + &knot_sort); +} + +/* basing on the new common knot range for all attributes set */ +/* t_min and t_max values for each knot - they will be used later on */ +/* by explode_knot() and calc_new_ctrl_pts */ +static void +set_new_t_min_t_max(knot_str_type * geom_knot, knot_str_type * color_knot, + knot_str_type * normal_knot, knot_str_type * texture_knot, + GLfloat maximal_min_knot, GLfloat minimal_max_knot) +{ + GLuint t_min = 0, t_max = 0, cnt = 0; + + if (minimal_max_knot - maximal_min_knot < EPSILON) { + /* knot common range empty */ + geom_knot->t_min = geom_knot->t_max = 0; + color_knot->t_min = color_knot->t_max = 0; + normal_knot->t_min = normal_knot->t_max = 0; + texture_knot->t_min = texture_knot->t_max = 0; + } + else { + if (geom_knot->unified_knot != NULL) { + cnt = geom_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((geom_knot->unified_knot)[t_min] - maximal_min_knot) < + EPSILON) break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((geom_knot->unified_knot)[t_max] - minimal_max_knot) < + EPSILON) break; + } + else if (geom_knot->nknots) { + cnt = geom_knot->nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((geom_knot->knot)[t_min] - maximal_min_knot) < EPSILON) + break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((geom_knot->knot)[t_max] - minimal_max_knot) < EPSILON) + break; + } + geom_knot->t_min = t_min; + geom_knot->t_max = t_max; + if (color_knot->unified_knot != NULL) { + cnt = color_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((color_knot->unified_knot)[t_min] - maximal_min_knot) < + EPSILON) break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((color_knot->unified_knot)[t_max] - minimal_max_knot) < + EPSILON) break; + color_knot->t_min = t_min; + color_knot->t_max = t_max; + } + if (normal_knot->unified_knot != NULL) { + cnt = normal_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((normal_knot->unified_knot)[t_min] - maximal_min_knot) < + EPSILON) break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((normal_knot->unified_knot)[t_max] - minimal_max_knot) < + EPSILON) break; + normal_knot->t_min = t_min; + normal_knot->t_max = t_max; + } + if (texture_knot->unified_knot != NULL) { + cnt = texture_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((texture_knot->unified_knot)[t_min] - maximal_min_knot) + < EPSILON) + break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((texture_knot->unified_knot)[t_max] - minimal_max_knot) + < EPSILON) + break; + texture_knot->t_min = t_min; + texture_knot->t_max = t_max; + } + } +} + +/* modify all knot valid ranges in such a way that all have the same */ +/* range, common to all knots */ +/* do this by knot insertion */ +GLenum +select_knot_working_range(GLUnurbsObj * nobj, knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot) +{ + GLint max_nknots; + GLfloat maximal_min_knot, minimal_max_knot; + GLint i; + + /* find the maximum modified knot length */ + max_nknots = geom_knot->nknots; + if (color_knot->unified_knot) + max_nknots += color_knot->nknots; + if (normal_knot->unified_knot) + max_nknots += normal_knot->nknots; + if (texture_knot->unified_knot) + max_nknots += texture_knot->nknots; + maximal_min_knot = (geom_knot->knot)[geom_knot->t_min]; + minimal_max_knot = (geom_knot->knot)[geom_knot->t_max]; + /* any attirb data ? */ + if (max_nknots != geom_knot->nknots) { + /* allocate space for the unified knots */ + if ((geom_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + geom_knot->unified_nknots = geom_knot->nknots; + for (i = 0; i < geom_knot->nknots; i++) + (geom_knot->unified_knot)[i] = (geom_knot->knot)[i]; + if (color_knot->unified_knot) { + if ((color_knot->knot)[color_knot->t_min] - maximal_min_knot > + EPSILON) + maximal_min_knot = (color_knot->knot)[color_knot->t_min]; + if (minimal_max_knot - (color_knot->knot)[color_knot->t_max] > + EPSILON) + minimal_max_knot = (color_knot->knot)[color_knot->t_max]; + if ((color_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + free(geom_knot->unified_knot); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + color_knot->unified_nknots = color_knot->nknots; + for (i = 0; i < color_knot->nknots; i++) + (color_knot->unified_knot)[i] = (color_knot->knot)[i]; + } + if (normal_knot->unified_knot) { + if ((normal_knot->knot)[normal_knot->t_min] - maximal_min_knot > + EPSILON) + maximal_min_knot = (normal_knot->knot)[normal_knot->t_min]; + if (minimal_max_knot - (normal_knot->knot)[normal_knot->t_max] > + EPSILON) + minimal_max_knot = (normal_knot->knot)[normal_knot->t_max]; + if ((normal_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + free(geom_knot->unified_knot); + free(color_knot->unified_knot); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + normal_knot->unified_nknots = normal_knot->nknots; + for (i = 0; i < normal_knot->nknots; i++) + (normal_knot->unified_knot)[i] = (normal_knot->knot)[i]; + } + if (texture_knot->unified_knot) { + if ((texture_knot->knot)[texture_knot->t_min] - maximal_min_knot > + EPSILON) + maximal_min_knot = (texture_knot->knot)[texture_knot->t_min]; + if (minimal_max_knot - (texture_knot->knot)[texture_knot->t_max] > + EPSILON) + minimal_max_knot = (texture_knot->knot)[texture_knot->t_max]; + if ((texture_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + free(geom_knot->unified_knot); + free(color_knot->unified_knot); + free(normal_knot->unified_knot); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + texture_knot->unified_nknots = texture_knot->nknots; + for (i = 0; i < texture_knot->nknots; i++) + (texture_knot->unified_knot)[i] = (texture_knot->knot)[i]; + } + /* work on the geometry knot with all additional knot values */ + /* appearing in attirbutive knots */ + if (minimal_max_knot - maximal_min_knot < EPSILON) { + /* empty working range */ + geom_knot->unified_nknots = 0; + color_knot->unified_nknots = 0; + normal_knot->unified_nknots = 0; + texture_knot->unified_nknots = 0; + } + else { + if (color_knot->unified_knot) + collect_unified_knot(geom_knot, color_knot, maximal_min_knot, + minimal_max_knot); + if (normal_knot->unified_knot) + collect_unified_knot(geom_knot, normal_knot, maximal_min_knot, + minimal_max_knot); + if (texture_knot->unified_knot) + collect_unified_knot(geom_knot, texture_knot, maximal_min_knot, + minimal_max_knot); + /* since we have now built the "unified" geometry knot */ + /* add same knot values to all attributive knots */ + if (color_knot->unified_knot) + collect_unified_knot(color_knot, geom_knot, maximal_min_knot, + minimal_max_knot); + if (normal_knot->unified_knot) + collect_unified_knot(normal_knot, geom_knot, maximal_min_knot, + minimal_max_knot); + if (texture_knot->unified_knot) + collect_unified_knot(texture_knot, geom_knot, maximal_min_knot, + minimal_max_knot); + } + } + set_new_t_min_t_max(geom_knot, color_knot, normal_knot, texture_knot, + maximal_min_knot, minimal_max_knot); + return GLU_NO_ERROR; +} + +void +free_unified_knots(knot_str_type * geom_knot, knot_str_type * color_knot, + knot_str_type * normal_knot, knot_str_type * texture_knot) +{ + if (geom_knot->unified_knot) + free(geom_knot->unified_knot); + if (color_knot->unified_knot) + free(color_knot->unified_knot); + if (normal_knot->unified_knot) + free(normal_knot->unified_knot); + if (texture_knot->unified_knot) + free(texture_knot->unified_knot); +} + +GLenum explode_knot(knot_str_type * the_knot) +{ + GLfloat *knot, *new_knot; + GLint nknots, n_new_knots = 0; + GLint t_min, t_max; + GLint ord; + GLsizei i, j, k; + GLfloat tmp_float; + + if (the_knot->unified_knot) { + knot = the_knot->unified_knot; + nknots = the_knot->unified_nknots; + } + else { + knot = the_knot->knot; + nknots = the_knot->nknots; + } + ord = the_knot->order; + t_min = the_knot->t_min; + t_max = the_knot->t_max; + + for (i = t_min; i <= t_max;) { + tmp_float = knot[i]; + for (j = 0; j < ord && (i + j) <= t_max; j++) + if (fabs(tmp_float - knot[i + j]) > EPSILON) + break; + n_new_knots += ord - j; + i += j; + } + /* alloc space for new_knot */ + if ( + (new_knot = + (GLfloat *) malloc(sizeof(GLfloat) * (nknots + n_new_knots + 1))) == NULL) { + return GLU_OUT_OF_MEMORY; + } + /* fill in new knot */ + for (j = 0; j < t_min; j++) + new_knot[j] = knot[j]; + for (i = j; i <= t_max; i++) { + tmp_float = knot[i]; + for (k = 0; k < ord; k++) { + new_knot[j++] = knot[i]; + if (tmp_float == knot[i + 1]) + i++; + } + } + for (i = t_max + 1; i < (int) nknots; i++) + new_knot[j++] = knot[i]; + /* fill in the knot structure */ + the_knot->new_knot = new_knot; + the_knot->delta_nknots += n_new_knots; + the_knot->t_max += n_new_knots; + return GLU_NO_ERROR; +} + +GLenum calc_alphas(knot_str_type * the_knot) +{ + GLfloat tmp_float; + int i, j, k, m, n; + int order; + GLfloat *alpha, *alpha_new, *tmp_alpha; + GLfloat denom; + GLfloat *knot, *new_knot; + + + knot = the_knot->knot; + order = the_knot->order; + new_knot = the_knot->new_knot; + n = the_knot->nknots - the_knot->order; + m = n + the_knot->delta_nknots; + if ((alpha = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((alpha_new = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) { + free(alpha); + return GLU_OUT_OF_MEMORY; + } + for (j = 0; j < m; j++) { + for (i = 0; i < n; i++) { + if ((knot[i] <= new_knot[j]) && (new_knot[j] < knot[i + 1])) + tmp_float = 1.0; + else + tmp_float = 0.0; + alpha[i + j * n] = tmp_float; + } + } + for (k = 1; k < order; k++) { + for (j = 0; j < m; j++) + for (i = 0; i < n; i++) { + denom = knot[i + k] - knot[i]; + if (fabs(denom) < EPSILON) + tmp_float = 0.0; + else + tmp_float = (new_knot[j + k] - knot[i]) / denom * + alpha[i + j * n]; + denom = knot[i + k + 1] - knot[i + 1]; + if (fabs(denom) > EPSILON) + tmp_float += (knot[i + k + 1] - new_knot[j + k]) / denom * + alpha[(i + 1) + j * n]; + alpha_new[i + j * n] = tmp_float; + } + tmp_alpha = alpha_new; + alpha_new = alpha; + alpha = tmp_alpha; + } + the_knot->alpha = alpha; + free(alpha_new); + return GLU_NO_ERROR; +} + +GLenum +calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, knot_str_type * the_knot, + GLint dim, GLfloat ** new_ctrl, GLint * ncontrol) +{ + GLsizei i, j, k, l, m, n; + GLsizei index1, index2; + GLfloat *alpha; + GLfloat *new_knot; + + new_knot = the_knot->new_knot; + n = the_knot->nknots - the_knot->order; + alpha = the_knot->alpha; + + m = the_knot->t_max + 1 - the_knot->t_min - the_knot->order; + k = the_knot->t_min; + /* allocate space for new control points */ + if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * dim * m)) == NULL) { + return GLU_OUT_OF_MEMORY; + } + for (j = 0; j < m; j++) { + for (l = 0; l < dim; l++) + (*new_ctrl)[j * dim + l] = 0.0; + for (i = 0; i < n; i++) { + index1 = i + (j + k) * n; + index2 = i * stride; + for (l = 0; l < dim; l++) + (*new_ctrl)[j * dim + l] += alpha[index1] * ctrl[index2 + l]; + } + } + *ncontrol = (GLint) m; + return GLU_NO_ERROR; +} + +static GLint +calc_factor(GLfloat * pts, GLint order, GLint indx, GLint stride, + GLfloat tolerance, GLint dim) +{ + GLdouble model[16], proj[16]; + GLint viewport[4]; + GLdouble x, y, z, w, winx1, winy1, winz, winx2, winy2; + GLint i; + GLdouble len, dx, dy; + + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, viewport); + if (dim == 4) { + w = (GLdouble) pts[indx + 3]; + x = (GLdouble) pts[indx] / w; + y = (GLdouble) pts[indx + 1] / w; + z = (GLdouble) pts[indx + 2] / w; + gluProject(x, y, z, model, proj, viewport, &winx1, &winy1, &winz); + len = 0.0; + for (i = 1; i < order; i++) { + w = (GLdouble) pts[indx + i * stride + 3]; + x = (GLdouble) pts[indx + i * stride] / w; + y = (GLdouble) pts[indx + i * stride + 1] / w; + z = (GLdouble) pts[indx + i * stride + 2] / w; + if (gluProject + (x, y, z, model, proj, viewport, &winx2, &winy2, &winz)) { + dx = winx2 - winx1; + dy = winy2 - winy1; + len += sqrt(dx * dx + dy * dy); + } + winx1 = winx2; + winy1 = winy2; + } + } + else { + x = (GLdouble) pts[indx]; + y = (GLdouble) pts[indx + 1]; + if (dim == 2) + z = 0.0; + else + z = (GLdouble) pts[indx + 2]; + gluProject(x, y, z, model, proj, viewport, &winx1, &winy1, &winz); + len = 0.0; + for (i = 1; i < order; i++) { + x = (GLdouble) pts[indx + i * stride]; + y = (GLdouble) pts[indx + i * stride + 1]; + if (dim == 2) + z = 0.0; + else + z = (GLdouble) pts[indx + i * stride + 2]; + if (gluProject + (x, y, z, model, proj, viewport, &winx2, &winy2, &winz)) { + dx = winx2 - winx1; + dy = winy2 - winy1; + len += sqrt(dx * dx + dy * dy); + } + winx1 = winx2; + winy1 = winy2; + } + } + len /= tolerance; + return ((GLint) len + 1); +} + +/* we can't use the Mesa evaluators - no way to get the point coords */ +/* so we use our own Bezier point calculus routines */ +/* because I'm lazy, I reuse the ones from eval.c */ + +static void +bezier_curve(GLfloat * cp, GLfloat * out, GLfloat t, + GLuint dim, GLuint order, GLint offset) +{ + GLfloat s, powert; + GLuint i, k, bincoeff; + + if (order >= 2) { + bincoeff = order - 1; + s = 1.0 - t; + + for (k = 0; k < dim; k++) + out[k] = s * cp[k] + bincoeff * t * cp[offset + k]; + + for (i = 2, cp += 2 * offset, powert = t * t; i < order; + i++, powert *= t, cp += offset) { + bincoeff *= order - i; + bincoeff /= i; + + for (k = 0; k < dim; k++) + out[k] = s * out[k] + bincoeff * powert * cp[k]; + } + } + else { /* order=1 -> constant curve */ + + for (k = 0; k < dim; k++) + out[k] = cp[k]; + } +} + +static GLint +calc_parametric_factor(GLfloat * pts, GLint order, GLint indx, GLint stride, + GLfloat tolerance, GLint dim) +{ + GLdouble model[16], proj[16]; + GLint viewport[4]; + GLdouble x, y, z, w, x1, y1, z1, x2, y2, z2, x3, y3, z3; + GLint i; + GLint P; + GLfloat bez_pt[4]; + GLdouble len = 0.0, tmp, z_med; + + P = 2 * (order + 2); + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, viewport); + z_med = (viewport[2] + viewport[3]) * 0.5; + switch (dim) { + case 4: + for (i = 1; i < P; i++) { + bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 4, + order, stride); + w = (GLdouble) bez_pt[3]; + x = (GLdouble) bez_pt[0] / w; + y = (GLdouble) bez_pt[1] / w; + z = (GLdouble) bez_pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); + z3 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 4, + order, stride); + w = (GLdouble) bez_pt[3]; + x = (GLdouble) bez_pt[0] / w; + y = (GLdouble) bez_pt[1] / w; + z = (GLdouble) bez_pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); + z1 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 4, + order, stride); + w = (GLdouble) bez_pt[3]; + x = (GLdouble) bez_pt[0] / w; + y = (GLdouble) bez_pt[1] / w; + z = (GLdouble) bez_pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); + z2 *= z_med; + /* calc distance between point (x3,y3,z3) and line segment */ + /* */ + x = x2 - x1; + y = y2 - y1; + z = z2 - z1; + tmp = sqrt(x * x + y * y + z * z); + x /= tmp; + y /= tmp; + z /= tmp; + tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; + x = x1 + x * tmp - x3; + y = y1 + y * tmp - y3; + z = z1 + z * tmp - z3; + tmp = sqrt(x * x + y * y + z * z); + if (tmp > len) + len = tmp; + } + break; + case 3: + for (i = 1; i < P; i++) { + bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 3, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = (GLdouble) bez_pt[2]; + gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); + z3 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 3, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = (GLdouble) bez_pt[2]; + gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); + z1 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 3, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = (GLdouble) bez_pt[2]; + gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); + z2 *= z_med; + /* calc distance between point (x3,y3,z3) and line segment */ + /* */ + x = x2 - x1; + y = y2 - y1; + z = z2 - z1; + tmp = sqrt(x * x + y * y + z * z); + x /= tmp; + y /= tmp; + z /= tmp; + tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; + x = x1 + x * tmp - x3; + y = y1 + y * tmp - y3; + z = z1 + z * tmp - z3; + tmp = sqrt(x * x + y * y + z * z); + if (tmp > len) + len = tmp; + } + break; + case 2: + for (i = 1; i < P; i++) { + bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 2, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = 0.0; + gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); + z3 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 2, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = 0.0; + gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); + z1 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 2, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = 0.0; + gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); + z2 *= z_med; + /* calc distance between point (x3,y3,z3) and line segment */ + /* */ + x = x2 - x1; + y = y2 - y1; + z = z2 - z1; + tmp = sqrt(x * x + y * y + z * z); + x /= tmp; + y /= tmp; + z /= tmp; + tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; + x = x1 + x * tmp - x3; + y = y1 + y * tmp - y3; + z = z1 + z * tmp - z3; + tmp = sqrt(x * x + y * y + z * z); + if (tmp > len) + len = tmp; + } + break; + + } + if (len < tolerance) + return (order); + else + return (GLint) (sqrt(len / tolerance) * (order + 2) + 1); +} + +static GLenum +calc_sampling_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim, + GLint uorder, GLint vorder, GLint ** ufactors, + GLint ** vfactors) +{ + GLfloat *ctrl; + GLint tmp_factor1, tmp_factor2; + GLint ufactor_cnt, vfactor_cnt; + GLint offset1, offset2, offset3; + GLint i, j; + + ufactor_cnt = new_ctrl->s_bezier_cnt; + vfactor_cnt = new_ctrl->t_bezier_cnt; + if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3)) + == NULL) { + free(*ufactors); + return GLU_OUT_OF_MEMORY; + } + ctrl = new_ctrl->geom_ctrl; + offset1 = new_ctrl->geom_t_stride * vorder; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < vfactor_cnt; j++) { + *(*vfactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, vorder, + j * offset1, dim, + tolerance, dim); + /* loop ufactor_cnt-1 times */ + for (i = 1; i < ufactor_cnt; i++) { + tmp_factor2 = calc_factor(ctrl, vorder, + j * offset1 + i * offset2, dim, tolerance, + dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*vfactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, vorder, + j * offset1 + + i * offset2 - + new_ctrl-> + geom_s_stride, dim, + tolerance, dim); + if (tmp_factor2 > tmp_factor1) + *(*vfactors + j * 3) = tmp_factor2; + else + *(*vfactors + j * 3) = tmp_factor1; + } + offset3 = new_ctrl->geom_s_stride; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < ufactor_cnt; j++) { + *(*ufactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, uorder, + j * offset2, + offset3, tolerance, + dim); + /* loop vfactor_cnt-1 times */ + for (i = 1; i < vfactor_cnt; i++) { + tmp_factor2 = calc_factor(ctrl, uorder, + j * offset2 + i * offset1, offset3, + tolerance, dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*ufactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, uorder, + j * offset2 + + i * offset1 - + new_ctrl-> + geom_t_stride, + offset3, tolerance, + dim); + if (tmp_factor2 > tmp_factor1) + *(*ufactors + j * 3) = tmp_factor2; + else + *(*ufactors + j * 3) = tmp_factor1; + } + return GL_NO_ERROR; +} + +static GLenum +calc_sampling_param_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim, + GLint uorder, GLint vorder, GLint ** ufactors, + GLint ** vfactors) +{ + GLfloat *ctrl; + GLint tmp_factor1, tmp_factor2; + GLint ufactor_cnt, vfactor_cnt; + GLint offset1, offset2, offset3; + GLint i, j; + + ufactor_cnt = new_ctrl->s_bezier_cnt; + vfactor_cnt = new_ctrl->t_bezier_cnt; + if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3)) + == NULL) { + free(*ufactors); + return GLU_OUT_OF_MEMORY; + } + ctrl = new_ctrl->geom_ctrl; + offset1 = new_ctrl->geom_t_stride * vorder; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < vfactor_cnt; j++) { + *(*vfactors + j * 3 + 1) = tmp_factor1 = + calc_parametric_factor(ctrl, vorder, j * offset1, dim, tolerance, + dim); + /* loop ufactor_cnt-1 times */ + for (i = 1; i < ufactor_cnt; i++) { + tmp_factor2 = calc_parametric_factor(ctrl, vorder, + j * offset1 + i * offset2, dim, + tolerance, dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*vfactors + j * 3 + 2) = tmp_factor2 = + calc_parametric_factor(ctrl, vorder, + j * offset1 + i * offset2 - + new_ctrl->geom_s_stride, dim, tolerance, dim); + if (tmp_factor2 > tmp_factor1) + *(*vfactors + j * 3) = tmp_factor2; + else + *(*vfactors + j * 3) = tmp_factor1; + } + offset3 = new_ctrl->geom_s_stride; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < ufactor_cnt; j++) { + *(*ufactors + j * 3 + 1) = tmp_factor1 = + calc_parametric_factor(ctrl, uorder, j * offset2, offset3, tolerance, + dim); + /* loop vfactor_cnt-1 times */ + for (i = 1; i < vfactor_cnt; i++) { + tmp_factor2 = calc_parametric_factor(ctrl, uorder, + j * offset2 + i * offset1, + offset3, tolerance, dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*ufactors + j * 3 + 2) = tmp_factor2 = + calc_parametric_factor(ctrl, uorder, + j * offset2 + i * offset1 - + new_ctrl->geom_t_stride, offset3, tolerance, + dim); + if (tmp_factor2 > tmp_factor1) + *(*ufactors + j * 3) = tmp_factor2; + else + *(*ufactors + j * 3) = tmp_factor1; + } + return GL_NO_ERROR; +} + +static GLenum +calc_sampling_2D(GLfloat * ctrl, GLint cnt, GLint order, + GLfloat tolerance, GLint dim, GLint ** factors) +{ + GLint factor_cnt; + GLint tmp_factor; + GLint offset; + GLint i; + + factor_cnt = cnt / order; + if ((*factors = (GLint *) malloc(sizeof(GLint) * factor_cnt)) == NULL) { + return GLU_OUT_OF_MEMORY; + } + offset = order * dim; + for (i = 0; i < factor_cnt; i++) { + tmp_factor = calc_factor(ctrl, order, i * offset, dim, tolerance, dim); + if (tmp_factor == 0) + (*factors)[i] = 1; + else + (*factors)[i] = tmp_factor; + } + return GL_NO_ERROR; +} + +static void +set_sampling_and_culling(GLUnurbsObj * nobj) +{ + if (nobj->auto_load_matrix == GL_FALSE) { + GLint i; + GLfloat m[4]; + + glPushAttrib((GLbitfield) (GL_VIEWPORT_BIT | GL_TRANSFORM_BIT)); + for (i = 0; i < 4; i++) + m[i] = nobj->sampling_matrices.viewport[i]; + glViewport(m[0], m[1], m[2], m[3]); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadMatrixf(nobj->sampling_matrices.proj); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadMatrixf(nobj->sampling_matrices.model); + } +} + +static void +revert_sampling_and_culling(GLUnurbsObj * nobj) +{ + if (nobj->auto_load_matrix == GL_FALSE) { + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glPopAttrib(); + } +} + +GLenum +glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint ** sfactors, GLint ** tfactors) +{ + GLint dim; + GLenum err; + + *sfactors = NULL; + *tfactors = NULL; + dim = nobj->surface.geom.dim; + set_sampling_and_culling(nobj); + if ((err = calc_sampling_3D(new_ctrl, nobj->sampling_tolerance, dim, + nobj->surface.geom.sorder, + nobj->surface.geom.torder, sfactors, + tfactors)) == GLU_ERROR) { + revert_sampling_and_culling(nobj); + call_user_error(nobj, err); + return GLU_ERROR; + } + revert_sampling_and_culling(nobj); + return GLU_NO_ERROR; +} + +GLenum +glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint ** sfactors, GLint ** tfactors) +{ + GLint s_cnt, t_cnt, i; + GLint u_steps, v_steps; + + s_cnt = new_ctrl->s_bezier_cnt; + t_cnt = new_ctrl->t_bezier_cnt; + *sfactors = NULL; + *tfactors = NULL; + if ((*sfactors = (GLint *) malloc(sizeof(GLint) * s_cnt * 3)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((*tfactors = (GLint *) malloc(sizeof(GLint) * t_cnt * 3)) + == NULL) { + free(*sfactors); + return GLU_OUT_OF_MEMORY; + } + u_steps = nobj->u_step; + v_steps = nobj->v_step; + for (i = 0; i < s_cnt; i++) { + *(*sfactors + i * 3) = u_steps; + *(*sfactors + i * 3 + 1) = u_steps; + *(*sfactors + i * 3 + 2) = u_steps; + } + for (i = 0; i < t_cnt; i++) { + *(*tfactors + i * 3) = v_steps; + *(*tfactors + i * 3 + 1) = v_steps; + *(*tfactors + i * 3 + 2) = v_steps; + } + return GLU_NO_ERROR; +} + + +GLenum +glu_do_sampling_param_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint ** sfactors, GLint ** tfactors) +{ + GLint dim; + GLenum err; + + *sfactors = NULL; + *tfactors = NULL; + dim = nobj->surface.geom.dim; + set_sampling_and_culling(nobj); + if ( + (err = + calc_sampling_param_3D(new_ctrl, nobj->parametric_tolerance, dim, + nobj->surface.geom.sorder, + nobj->surface.geom.torder, sfactors, + tfactors)) == GLU_ERROR) { + revert_sampling_and_culling(nobj); + call_user_error(nobj, err); + return GLU_ERROR; + } + revert_sampling_and_culling(nobj); + return GLU_NO_ERROR; +} + + +static GLenum +glu_do_sampling_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order, + GLint dim, GLint ** factors) +{ + GLenum err; + + set_sampling_and_culling(nobj); + err = calc_sampling_2D(ctrl, cnt, order, nobj->sampling_tolerance, dim, + factors); + revert_sampling_and_culling(nobj); + return err; +} + + +static GLenum +glu_do_sampling_u(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order, + GLint dim, GLint ** factors) +{ + GLint i; + GLint u_steps; + + cnt /= order; + if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + u_steps = nobj->u_step; + for (i = 0; i < cnt; i++) + (*factors)[i] = u_steps; + return GLU_NO_ERROR; +} + + +static GLenum +glu_do_sampling_param_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, + GLint order, GLint dim, GLint ** factors) +{ + GLint i; + GLint u_steps; + GLfloat tolerance; + + set_sampling_and_culling(nobj); + tolerance = nobj->parametric_tolerance; + cnt /= order; + if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt)) + == NULL) { + revert_sampling_and_culling(nobj); + return GLU_OUT_OF_MEMORY; + } + u_steps = nobj->u_step; + for (i = 0; i < cnt; i++) { + (*factors)[i] = calc_parametric_factor(ctrl, order, 0, + dim, tolerance, dim); + + } + revert_sampling_and_culling(nobj); + return GLU_NO_ERROR; +} + +GLenum +glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, + GLint order, GLint dim, GLint ** factors) +{ + GLenum err; + + *factors = NULL; + switch (nobj->sampling_method) { + case GLU_PATH_LENGTH: + if ((err = glu_do_sampling_2D(nobj, ctrl, cnt, order, dim, factors)) != + GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + break; + case GLU_DOMAIN_DISTANCE: + if ((err = glu_do_sampling_u(nobj, ctrl, cnt, order, dim, factors)) != + GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + break; + case GLU_PARAMETRIC_ERROR: + if ( + (err = + glu_do_sampling_param_2D(nobj, ctrl, cnt, order, dim, + factors)) != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + break; + default: + abort(); + } + + return GLU_NO_ERROR; +} + +/* TODO - i don't like this culling - this one just tests if at least one */ +/* ctrl point lies within the viewport . Also the point_in_viewport() */ +/* should be included in the fnctions for efficiency reasons */ + +static GLboolean +point_in_viewport(GLfloat * pt, GLint dim) +{ + GLdouble model[16], proj[16]; + GLint viewport[4]; + GLdouble x, y, z, w, winx, winy, winz; + + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, viewport); + if (dim == 3) { + x = (GLdouble) pt[0]; + y = (GLdouble) pt[1]; + z = (GLdouble) pt[2]; + gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz); + } + else { + w = (GLdouble) pt[3]; + x = (GLdouble) pt[0] / w; + y = (GLdouble) pt[1] / w; + z = (GLdouble) pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz); + } + if ((GLint) winx >= viewport[0] && (GLint) winx < viewport[2] && + (GLint) winy >= viewport[1] && (GLint) winy < viewport[3]) + return GL_TRUE; + return GL_FALSE; +} + +GLboolean +fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * pts, GLint s_cnt, + GLint t_cnt, GLint s_stride, GLint t_stride, GLint dim) +{ + GLint i, j; + + if (nobj->culling == GL_FALSE) + return GL_FALSE; + set_sampling_and_culling(nobj); + + if (dim == 3) { + for (i = 0; i < s_cnt; i++) + for (j = 0; j < t_cnt; j++) + if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + else { + for (i = 0; i < s_cnt; i++) + for (j = 0; j < t_cnt; j++) + if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + revert_sampling_and_culling(nobj); + return GL_TRUE; +} + +/*GLboolean +fine_culling_test_3D(GLUnurbsObj *nobj,GLfloat *pts,GLint s_cnt,GLint t_cnt, + GLint s_stride,GLint t_stride, GLint dim) +{ + GLint visible_cnt; + GLfloat feedback_buffer[5]; + GLsizei buffer_size; + GLint i,j; + + if(nobj->culling==GL_FALSE) + return GL_FALSE; + buffer_size=5; + set_sampling_and_culling(nobj); + + glFeedbackBuffer(buffer_size,GL_2D,feedback_buffer); + glRenderMode(GL_FEEDBACK); + if(dim==3) + { + for(i=0;iculling == GL_FALSE) + return GL_FALSE; + set_sampling_and_culling(nobj); + + if (dim == 3) { + for (i = 0; i < cnt; i++) + if (point_in_viewport(pts + i * stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + else { + for (i = 0; i < cnt; i++) + if (point_in_viewport(pts + i * stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + revert_sampling_and_culling(nobj); + return GL_TRUE; +} + +/*GLboolean +fine_culling_test_2D(GLUnurbsObj *nobj,GLfloat *pts,GLint cnt, + GLint stride, GLint dim) +{ + GLint visible_cnt; + GLfloat feedback_buffer[5]; + GLsizei buffer_size; + GLint i; + + if(nobj->culling==GL_FALSE) + return GL_FALSE; + buffer_size=5; + set_sampling_and_culling(nobj); + + glFeedbackBuffer(buffer_size,GL_2D,feedback_buffer); + glRenderMode(GL_FEEDBACK); + glBegin(GL_LINE_LOOP); + if(dim==3) + { + for(i=0;i +#include +#include "gluP.h" +#include "tess.h" +#endif + + + +static GLenum store_polygon_as_contour(GLUtriangulatorObj *); +static void free_current_polygon(tess_polygon *); +static void prepare_projection_info(GLUtriangulatorObj *); +static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *); +static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *); +void tess_find_contour_hierarchies(GLUtriangulatorObj *); +static GLenum test_for_overlapping_contours(GLUtriangulatorObj *); +static GLenum contours_overlap(tess_contour *, tess_polygon *); +static GLenum is_contour_contained_in(tess_contour *, tess_contour *); +static void add_new_exterior(GLUtriangulatorObj *, tess_contour *); +static void add_new_interior(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static void add_interior_with_hierarchy_check(GLUtriangulatorObj *, + tess_contour *, tess_contour *); +static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *, + tess_contour *, + tess_contour *); +static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble); +static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *); +static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static GLenum merge_hole_with_contour(GLUtriangulatorObj *, + tess_contour *, tess_contour *, + tess_vertex *, tess_vertex *); + +static GLenum +find_normal(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *va, *vb, *vc; + GLdouble A, B, C; + GLdouble A0, A1, A2, B0, B1, B2; + + va = polygon->vertices; + vb = va->next; + A0 = vb->location[0] - va->location[0]; + A1 = vb->location[1] - va->location[1]; + A2 = vb->location[2] - va->location[2]; + for (vc = vb->next; vc != va; vc = vc->next) { + B0 = vc->location[0] - va->location[0]; + B1 = vc->location[1] - va->location[1]; + B2 = vc->location[2] - va->location[2]; + A = A1 * B2 - A2 * B1; + B = A2 * B0 - A0 * B2; + C = A0 * B1 - A1 * B0; + if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) { + polygon->A = A; + polygon->B = B; + polygon->C = C; + polygon->D = + -A * va->location[0] - B * va->location[1] - C * va->location[2]; + return GLU_NO_ERROR; + } + } + tess_call_user_error(tobj, GLU_TESS_ERROR7); + return GLU_ERROR; +} + +void +tess_test_polygon(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + + /* any vertices defined? */ + if (polygon->vertex_cnt < 3) { + free_current_polygon(polygon); + return; + } + /* wrap pointers */ + polygon->last_vertex->next = polygon->vertices; + polygon->vertices->previous = polygon->last_vertex; + /* determine the normal */ + if (find_normal(tobj) == GLU_ERROR) + return; + /* compare the normals of previously defined contours and this one */ + /* first contour define ? */ + if (tobj->contours == NULL) { + tobj->A = polygon->A; + tobj->B = polygon->B; + tobj->C = polygon->C; + tobj->D = polygon->D; + /* determine the best projection to use */ + if (fabs(polygon->A) > fabs(polygon->B)) + if (fabs(polygon->A) > fabs(polygon->C)) + tobj->projection = OYZ; + else + tobj->projection = OXY; + else if (fabs(polygon->B) > fabs(polygon->C)) + tobj->projection = OXZ; + else + tobj->projection = OXY; + } + else { + GLdouble a[3], b[3]; + tess_vertex *vertex = polygon->vertices; + + a[0] = tobj->A; + a[1] = tobj->B; + a[2] = tobj->C; + b[0] = polygon->A; + b[1] = polygon->B; + b[2] = polygon->C; + + /* compare the normals */ + if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON || + fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON || + fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) { + /* not coplanar */ + tess_call_user_error(tobj, GLU_TESS_ERROR9); + return; + } + /* the normals are parallel - test for plane equation */ + if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] + + a[2] * vertex->location[2] + tobj->D) > EPSILON) { + /* not the same plane */ + tess_call_user_error(tobj, GLU_TESS_ERROR9); + return; + } + } + prepare_projection_info(tobj); + if (verify_edge_vertex_intersections(tobj) == GLU_ERROR) + return; + if (test_for_overlapping_contours(tobj) == GLU_ERROR) + return; + if (store_polygon_as_contour(tobj) == GLU_ERROR) + return; +} + +static GLenum +test_for_overlapping_contours(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + tess_polygon *polygon; + + polygon = tobj->current_polygon; + for (contour = tobj->contours; contour != NULL; contour = contour->next) + if (contours_overlap(contour, polygon) != GLU_NO_ERROR) { + tess_call_user_error(tobj, GLU_TESS_ERROR5); + return GLU_ERROR; + } + return GLU_NO_ERROR; +} + +static GLenum +store_polygon_as_contour(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_contour *contour = tobj->contours; + + /* the first contour defined */ + if (contour == NULL) { + if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + free_current_polygon(polygon); + return GLU_ERROR; + } + tobj->contours = tobj->last_contour = contour; + contour->next = contour->previous = NULL; + } + else { + if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + free_current_polygon(polygon); + return GLU_ERROR; + } + contour->previous = tobj->last_contour; + tobj->last_contour->next = contour; + tobj->last_contour = contour; + contour->next = NULL; + } + /* mark all vertices in new contour as not special */ + /* and all are boundary edges */ + { + tess_vertex *vertex; + GLuint vertex_cnt, i; + + for (vertex = polygon->vertices, i = 0, vertex_cnt = + polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) { + vertex->shadow_vertex = NULL; + vertex->edge_flag = GL_TRUE; + } + } + contour->vertex_cnt = polygon->vertex_cnt; + contour->area = polygon->area; + contour->orientation = polygon->orientation; + contour->type = GLU_UNKNOWN; + contour->vertices = polygon->vertices; + contour->last_vertex = polygon->last_vertex; + polygon->vertices = polygon->last_vertex = NULL; + polygon->vertex_cnt = 0; + ++(tobj->contour_cnt); + return GLU_NO_ERROR; +} + +static void +free_current_polygon(tess_polygon * polygon) +{ + tess_vertex *vertex, *vertex_tmp; + GLuint i; + + /* free current_polygon structures */ + for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + polygon->vertices = polygon->last_vertex = NULL; + polygon->vertex_cnt = 0; +} + +static void +prepare_projection_info(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *vertex, *last_vertex_ptr; + GLdouble area; + + last_vertex_ptr = polygon->last_vertex; + switch (tobj->projection) { + case OXY: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[0]; + vertex->y = vertex->location[1]; + } + last_vertex_ptr->x = last_vertex_ptr->location[0]; + last_vertex_ptr->y = last_vertex_ptr->location[1]; + break; + case OXZ: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[0]; + vertex->y = vertex->location[2]; + } + last_vertex_ptr->x = last_vertex_ptr->location[0]; + last_vertex_ptr->y = last_vertex_ptr->location[2]; + break; + case OYZ: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[1]; + vertex->y = vertex->location[2]; + } + last_vertex_ptr->x = last_vertex_ptr->location[1]; + last_vertex_ptr->y = last_vertex_ptr->location[2]; + break; + } + area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex); + if (area >= 0.0) { + polygon->orientation = GLU_CCW; + polygon->area = area; + } + else { + polygon->orientation = GLU_CW; + polygon->area = -area; + } +} + +static GLdouble +twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex) +{ + tess_vertex *next; + GLdouble area, x, y; + + area = 0.0; + x = vertex->x; + y = vertex->y; + vertex = vertex->next; + for (; vertex != last_vertex; vertex = vertex->next) { + next = vertex->next; + area += + (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x); + } + return area; +} + +/* test if edges ab and cd intersect */ +/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */ +/* else if adjacent return GLU_TESS_ERROR4 */ +static GLenum +edge_edge_intersect(tess_vertex * a, + tess_vertex * b, tess_vertex * c, tess_vertex * d) +{ + GLdouble denom, r, s; + GLdouble xba, ydc, yba, xdc, yac, xac; + + xba = b->x - a->x; + yba = b->y - a->y; + xdc = d->x - c->x; + ydc = d->y - c->y; + xac = a->x - c->x; + yac = a->y - c->y; + denom = xba * ydc - yba * xdc; + r = yac * xdc - xac * ydc; + /* parallel? */ + if (fabs(denom) < EPSILON) { + if (fabs(r) < EPSILON) { + /* colinear */ + if (fabs(xba) < EPSILON) { + /* compare the Y coordinate */ + if (yba > 0.0) { + if ( + (fabs(a->y - c->y) < EPSILON + && fabs(c->y - b->y) < EPSILON) + || (fabs(a->y - d->y) < EPSILON + && fabs(d->y - b->y) < + EPSILON)) return GLU_TESS_ERROR4; + + } + else { + if ( + (fabs(b->y - c->y) < EPSILON + && fabs(c->y - a->y) < EPSILON) + || (fabs(b->y - d->y) < EPSILON + && fabs(d->y - a->y) < + EPSILON)) return GLU_TESS_ERROR4; + } + } + else { + /* compare the X coordinate */ + if (xba > 0.0) { + if ( + (fabs(a->x - c->x) < EPSILON + && fabs(c->x - b->x) < EPSILON) + || (fabs(a->x - d->x) < EPSILON + && fabs(d->x - b->x) < + EPSILON)) return GLU_TESS_ERROR4; + } + else { + if ( + (fabs(b->x - c->x) < EPSILON + && fabs(c->x - a->x) < EPSILON) + || (fabs(b->x - d->x) < EPSILON + && fabs(d->x - a->x) < + EPSILON)) return GLU_TESS_ERROR4; + } + } + } + return GLU_NO_ERROR; + } + r /= denom; + s = (yac * xba - xac * yba) / denom; + /* test if one vertex lies on other edge */ + if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) && + s > -EPSILON && s < 1.0 + EPSILON) || + ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) && + r > -EPSILON && r < 1.0 + EPSILON)) { + return GLU_TESS_ERROR4; + } + /* test for crossing */ + if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) { + return GLU_TESS_ERROR8; + } + return GLU_NO_ERROR; +} + +static GLenum +verify_edge_vertex_intersections(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *vertex1, *last_vertex, *vertex2; + GLenum test; + + last_vertex = polygon->last_vertex; + vertex1 = last_vertex; + for (vertex2 = vertex1->next->next; + vertex2->next != last_vertex; vertex2 = vertex2->next) { + test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next); + if (test != GLU_NO_ERROR) { + tess_call_user_error(tobj, test); + return GLU_ERROR; + } + } + for (vertex1 = polygon->vertices; + vertex1->next->next != last_vertex; vertex1 = vertex1->next) { + for (vertex2 = vertex1->next->next; + vertex2 != last_vertex; vertex2 = vertex2->next) { + test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next); + if (test != GLU_NO_ERROR) { + tess_call_user_error(tobj, test); + return GLU_ERROR; + } + } + } + return GLU_NO_ERROR; +} + +static int +#ifdef WIN32 + __cdecl +#endif +area_compare(const void *a, const void *b) +{ + GLdouble area1, area2; + + area1 = (*((tess_contour **) a))->area; + area2 = (*((tess_contour **) b))->area; + if (area1 < area2) + return 1; + if (area1 > area2) + return -1; + return 0; +} + +void +tess_find_contour_hierarchies(GLUtriangulatorObj * tobj) +{ + tess_contour **contours; /* dinamic array of pointers */ + tess_contour *tmp_contour_ptr = tobj->contours; + GLuint cnt, i; + GLenum result; + GLboolean hierarchy_changed; + + /* any contours? */ + if (tobj->contour_cnt < 2) { + tobj->contours->type = GLU_EXTERIOR; + return; + } + if ((contours = (tess_contour **) + malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + for (tmp_contour_ptr = tobj->contours, cnt = 0; + tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) + contours[cnt++] = tmp_contour_ptr; + /* now sort the contours in decreasing area size order */ + qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *), + area_compare); + /* we leave just the first contour - remove others from list */ + tobj->contours = contours[0]; + tobj->contours->next = tobj->contours->previous = NULL; + tobj->last_contour = tobj->contours; + tobj->contour_cnt = 1; + /* first contour is the one with greatest area */ + /* must be EXTERIOR */ + tobj->contours->type = GLU_EXTERIOR; + tmp_contour_ptr = tobj->contours; + /* now we play! */ + for (i = 1; i < cnt; i++) { + hierarchy_changed = GL_FALSE; + for (tmp_contour_ptr = tobj->contours; + tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) { + if (tmp_contour_ptr->type == GLU_EXTERIOR) { + /* check if contour completely contained in EXTERIOR */ + result = is_contour_contained_in(tmp_contour_ptr, contours[i]); + switch (result) { + case GLU_INTERIOR: + /* now we have to check if contour is inside interiors */ + /* or not */ + /* any interiors? */ + if (tmp_contour_ptr->next != NULL && + tmp_contour_ptr->next->type == GLU_INTERIOR) { + /* for all interior, check if inside any of them */ + /* if not inside any of interiors, its another */ + /* interior */ + /* or it may contain some interiors, then change */ + /* the contained interiors to exterior ones */ + add_interior_with_hierarchy_check(tobj, + tmp_contour_ptr, + contours[i]); + } + else { + /* not in interior, add as new interior contour */ + add_new_interior(tobj, tmp_contour_ptr, contours[i]); + } + hierarchy_changed = GL_TRUE; + break; + case GLU_EXTERIOR: + /* ooops, the marked as EXTERIOR (contours[i]) is */ + /* actually an interior of tmp_contour_ptr */ + /* reverse the local hierarchy */ + reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr, + contours[i]); + hierarchy_changed = GL_TRUE; + break; + case GLU_NO_ERROR: + break; + default: + abort(); + } + } + if (hierarchy_changed) + break; /* break from for loop */ + } + if (hierarchy_changed == GL_FALSE) { + /* disjoint with all contours, add to contour list */ + add_new_exterior(tobj, contours[i]); + } + } + free(contours); +} + +/* returns GLU_INTERIOR if inner is completey enclosed within outer */ +/* returns GLU_EXTERIOR if outer is completely enclosed within inner */ +/* returns GLU_NO_ERROR if contours are disjoint */ +static GLenum +is_contour_contained_in(tess_contour * outer, tess_contour * inner) +{ + GLenum relation_flag; + + /* set relation_flag to relation of containment of first inner vertex */ + /* regarding outer contour */ + if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y)) + relation_flag = GLU_INTERIOR; + else + relation_flag = GLU_EXTERIOR; + if (relation_flag == GLU_INTERIOR) + return GLU_INTERIOR; + if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y)) + return GLU_EXTERIOR; + return GLU_NO_ERROR; +} + +static GLboolean +point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y) +{ + tess_vertex *v1, *v2; + GLuint i, vertex_cnt; + GLdouble xp1, yp1, xp2, yp2; + GLboolean tst; + + tst = GL_FALSE; + v1 = contour->vertices; + v2 = contour->vertices->previous; + for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) { + xp1 = v1->x; + yp1 = v1->y; + xp2 = v2->x; + yp2 = v2->y; + if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) && + (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1)) + tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE); + v2 = v1; + v1 = v1->next; + } + return tst; +} + +static GLenum +contours_overlap(tess_contour * contour, tess_polygon * polygon) +{ + tess_vertex *vertex1, *vertex2; + GLuint vertex1_cnt, vertex2_cnt, i, j; + GLenum test; + + vertex1 = contour->vertices; + vertex2 = polygon->vertices; + vertex1_cnt = contour->vertex_cnt; + vertex2_cnt = polygon->vertex_cnt; + for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) { + for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++) + if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next)) != GLU_NO_ERROR) + return test; + } + return GLU_NO_ERROR; +} + +static void +add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + contour->type = GLU_EXTERIOR; + contour->next = NULL; + contour->previous = tobj->last_contour; + tobj->last_contour->next = contour; + tobj->last_contour = contour; +} + +static void +add_new_interior(GLUtriangulatorObj * tobj, + tess_contour * outer, tess_contour * contour) +{ + contour->type = GLU_INTERIOR; + contour->next = outer->next; + contour->previous = outer; + if (outer->next != NULL) + outer->next->previous = contour; + outer->next = contour; + if (tobj->last_contour == outer) + tobj->last_contour = contour; +} + +static void +add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj, + tess_contour * outer, + tess_contour * contour) +{ + tess_contour *ptr; + + /* for all interiors of outer check if they are interior of contour */ + /* if so, change that interior to exterior and move it of of the */ + /* interior sequence */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { + GLenum test; + + for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; + ptr = ptr->next) { + test = is_contour_contained_in(ptr, contour); + switch (test) { + case GLU_INTERIOR: + /* contour is contained in one of the interiors */ + /* check if possibly contained in other exteriors */ + /* move ptr to first EXTERIOR */ + for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next); + if (ptr == NULL) + /* another exterior */ + add_new_exterior(tobj, contour); + else + add_exterior_with_check(tobj, ptr, contour); + return; + case GLU_EXTERIOR: + /* one of the interiors is contained in the contour */ + /* change it to EXTERIOR, and shift it away from the */ + /* interior sequence */ + shift_interior_to_exterior(tobj, ptr); + break; + case GLU_NO_ERROR: + /* disjoint */ + break; + default: + abort(); + } + } + } + /* add contour to the interior sequence */ + add_new_interior(tobj, outer, contour); +} + +static void +reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj, + tess_contour * outer, + tess_contour * contour) +{ + tess_contour *ptr; + + /* reverse INTERIORS to EXTERIORS */ + /* any INTERIORS? */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) + for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; + ptr = ptr->next) ptr->type = GLU_EXTERIOR; + /* the outer now becomes inner */ + outer->type = GLU_INTERIOR; + /* contour is the EXTERIOR */ + contour->next = outer; + if (tobj->contours == outer) { + /* first contour beeing reversed */ + contour->previous = NULL; + tobj->contours = contour; + } + else { + outer->previous->next = contour; + contour->previous = outer->previous; + } + outer->previous = contour; +} + +static void +shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + contour->previous->next = contour->next; + if (contour->next != NULL) + contour->next->previous = contour->previous; + else + tobj->last_contour = contour->previous; +} + +static void +add_exterior_with_check(GLUtriangulatorObj * tobj, + tess_contour * outer, tess_contour * contour) +{ + GLenum test; + + /* this contour might be interior to further exteriors - check */ + /* if not, just add as a new exterior */ + for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) { + test = is_contour_contained_in(outer, contour); + switch (test) { + case GLU_INTERIOR: + /* now we have to check if contour is inside interiors */ + /* or not */ + /* any interiors? */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { + /* for all interior, check if inside any of them */ + /* if not inside any of interiors, its another */ + /* interior */ + /* or it may contain some interiors, then change */ + /* the contained interiors to exterior ones */ + add_interior_with_hierarchy_check(tobj, outer, contour); + } + else { + /* not in interior, add as new interior contour */ + add_new_interior(tobj, outer, contour); + } + return; + case GLU_NO_ERROR: + /* disjoint */ + break; + default: + abort(); + } + } + /* add contour to the exterior sequence */ + add_new_exterior(tobj, contour); +} + +void +tess_handle_holes(GLUtriangulatorObj * tobj) +{ + tess_contour *contour, *hole; + GLenum exterior_orientation; + + /* verify hole orientation */ + for (contour = tobj->contours; contour != NULL;) { + exterior_orientation = contour->orientation; + for (contour = contour->next; + contour != NULL && contour->type == GLU_INTERIOR; + contour = contour->next) { + if (contour->orientation == exterior_orientation) { + tess_call_user_error(tobj, GLU_TESS_ERROR5); + return; + } + } + } + /* now cut-out holes */ + for (contour = tobj->contours; contour != NULL;) { + hole = contour->next; + while (hole != NULL && hole->type == GLU_INTERIOR) { + if (cut_out_hole(tobj, contour, hole) == GLU_ERROR) + return; + hole = contour->next; + } + contour = contour->next; + } +} + +static GLenum +cut_out_hole(GLUtriangulatorObj * tobj, + tess_contour * contour, tess_contour * hole) +{ + tess_contour *tmp_hole; + tess_vertex *v1, *v2, *tmp_vertex; + GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt; + GLuint i, j, k; + GLenum test = 0; + + /* find an edge connecting contour and hole not intersecting any other */ + /* edge belonging to either the contour or any of the other holes */ + for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0; + i < vertex1_cnt; i++, v1 = v1->next) { + for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0; + j < vertex2_cnt; j++, v2 = v2->next) { + /* does edge (v1,v2) intersect any edge of contour */ + for (tmp_vertex = contour->vertices, tmp_vertex_cnt = + contour->vertex_cnt, k = 0; k < tmp_vertex_cnt; + tmp_vertex = tmp_vertex->next, k++) { + /* skip edge tests for edges directly connected */ + if (v1 == tmp_vertex || v1 == tmp_vertex->next) + continue; + test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test == GLU_NO_ERROR) { + /* does edge (v1,v2) intersect any edge of hole */ + for (tmp_vertex = hole->vertices, + tmp_vertex_cnt = hole->vertex_cnt, k = 0; + k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { + /* skip edge tests for edges directly connected */ + if (v2 == tmp_vertex || v2 == tmp_vertex->next) + continue; + test = + edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test == GLU_NO_ERROR) { + /* does edge (v1,v2) intersect any other hole? */ + for (tmp_hole = hole->next; + tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; + tmp_hole = tmp_hole->next) { + /* does edge (v1,v2) intersect any edge of hole */ + for (tmp_vertex = tmp_hole->vertices, + tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0; + k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { + test = edge_edge_intersect(v1, v2, tmp_vertex, + tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test != GLU_NO_ERROR) + break; + } + } + } + if (test == GLU_NO_ERROR) { + /* edge (v1,v2) is good for eliminating the hole */ + if (merge_hole_with_contour(tobj, contour, hole, v1, v2) + == GLU_NO_ERROR) + return GLU_NO_ERROR; + else + return GLU_ERROR; + } + } + } + /* other holes are blocking all possible connections of hole */ + /* with contour, we shift this hole as the last hole and retry */ + for (tmp_hole = hole; + tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; + tmp_hole = tmp_hole->next); + contour->next = hole->next; + hole->next->previous = contour; + if (tmp_hole == NULL) { + /* last EXTERIOR contour, shift hole as last contour */ + hole->next = NULL; + hole->previous = tobj->last_contour; + tobj->last_contour->next = hole; + tobj->last_contour = hole; + } + else { + tmp_hole->previous->next = hole; + hole->previous = tmp_hole->previous; + tmp_hole->previous = hole; + hole->next = tmp_hole; + } + hole = contour->next; + /* try once again - recurse */ + return cut_out_hole(tobj, contour, hole); +} + +static GLenum +merge_hole_with_contour(GLUtriangulatorObj * tobj, + tess_contour * contour, + tess_contour * hole, + tess_vertex * v1, tess_vertex * v2) +{ + tess_vertex *v1_new, *v2_new; + + /* make copies of v1 and v2, place them respectively after their originals */ + if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + v1_new->edge_flag = GL_TRUE; + v1_new->data = v1->data; + v1_new->location[0] = v1->location[0]; + v1_new->location[1] = v1->location[1]; + v1_new->location[2] = v1->location[2]; + v1_new->x = v1->x; + v1_new->y = v1->y; + v1_new->shadow_vertex = v1; + v1->shadow_vertex = v1_new; + v1_new->next = v1->next; + v1_new->previous = v1; + v1->next->previous = v1_new; + v1->next = v1_new; + v2_new->edge_flag = GL_TRUE; + v2_new->data = v2->data; + v2_new->location[0] = v2->location[0]; + v2_new->location[1] = v2->location[1]; + v2_new->location[2] = v2->location[2]; + v2_new->x = v2->x; + v2_new->y = v2->y; + v2_new->shadow_vertex = v2; + v2->shadow_vertex = v2_new; + v2_new->next = v2->next; + v2_new->previous = v2; + v2->next->previous = v2_new; + v2->next = v2_new; + /* link together the two lists */ + v1->next = v2_new; + v2_new->previous = v1; + v2->next = v1_new; + v1_new->previous = v2; + /* update the vertex count of the contour */ + contour->vertex_cnt += hole->vertex_cnt + 2; + /* remove the INTERIOR contour */ + contour->next = hole->next; + if (hole->next != NULL) + hole->next->previous = contour; + free(hole); + /* update tobj structure */ + --(tobj->contour_cnt); + if (contour->last_vertex == v1) + contour->last_vertex = v1_new; + /* mark two vertices with edge_flag */ + v2->edge_flag = GL_FALSE; + v1->edge_flag = GL_FALSE; + return GLU_NO_ERROR; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/project.c xpsb-glx-0.19/mesa/src/glu/mesa/project.c --- xpsb-glx-0.19/mesa/src/glu/mesa/project.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/project.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,403 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include "gluP.h" +#endif + + +/* + * This code was contributed by Marc Buffat (buffat@mecaflu.ec-lyon.fr). + * Thanks Marc!!! + */ + + + +/* implementation de gluProject et gluUnproject */ +/* M. Buffat 17/2/95 */ + + + +/* + * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in + * Input: m - the 4x4 matrix + * in - the 4x1 vector + * Output: out - the resulting 4x1 vector. + */ +static void +transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) +{ +#define M(row,col) m[col*4+row] + out[0] = + M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; + out[1] = + M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3]; + out[2] = + M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3]; + out[3] = + M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; +#undef M +} + + + + +/* + * Perform a 4x4 matrix multiplication (product = a x b). + * Input: a, b - matrices to multiply + * Output: product - product of a and b + */ +static void +matmul(GLdouble * product, const GLdouble * a, const GLdouble * b) +{ + /* This matmul was contributed by Thomas Malik */ + GLdouble temp[16]; + GLint i; + +#define A(row,col) a[(col<<2)+row] +#define B(row,col) b[(col<<2)+row] +#define T(row,col) temp[(col<<2)+row] + + /* i-te Zeile */ + for (i = 0; i < 4; i++) { + T(i, 0) = + A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, + 3) * + B(3, 0); + T(i, 1) = + A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, + 3) * + B(3, 1); + T(i, 2) = + A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, + 3) * + B(3, 2); + T(i, 3) = + A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, + 3) * + B(3, 3); + } + +#undef A +#undef B +#undef T + MEMCPY(product, temp, 16 * sizeof(GLdouble)); +} + + + +/* + * Compute inverse of 4x4 transformation matrix. + * Code contributed by Jacques Leroy jle@star.be + * Return GL_TRUE for success, GL_FALSE for failure (singular matrix) + */ +static GLboolean +invert_matrix(const GLdouble * m, GLdouble * out) +{ +/* NB. OpenGL Matrices are COLUMN major. */ +#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; } +#define MAT(m,r,c) (m)[(c)*4+(r)] + + GLdouble wtmp[4][8]; + GLdouble m0, m1, m2, m3, s; + GLdouble *r0, *r1, *r2, *r3; + + r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; + + r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1), + r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3), + r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, + r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1), + r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3), + r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, + r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1), + r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3), + r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, + r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1), + r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3), + r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; + + /* choose pivot - or die */ + if (fabs(r3[0]) > fabs(r2[0])) + SWAP_ROWS(r3, r2); + if (fabs(r2[0]) > fabs(r1[0])) + SWAP_ROWS(r2, r1); + if (fabs(r1[0]) > fabs(r0[0])) + SWAP_ROWS(r1, r0); + if (0.0 == r0[0]) + return GL_FALSE; + + /* eliminate first variable */ + m1 = r1[0] / r0[0]; + m2 = r2[0] / r0[0]; + m3 = r3[0] / r0[0]; + s = r0[1]; + r1[1] -= m1 * s; + r2[1] -= m2 * s; + r3[1] -= m3 * s; + s = r0[2]; + r1[2] -= m1 * s; + r2[2] -= m2 * s; + r3[2] -= m3 * s; + s = r0[3]; + r1[3] -= m1 * s; + r2[3] -= m2 * s; + r3[3] -= m3 * s; + s = r0[4]; + if (s != 0.0) { + r1[4] -= m1 * s; + r2[4] -= m2 * s; + r3[4] -= m3 * s; + } + s = r0[5]; + if (s != 0.0) { + r1[5] -= m1 * s; + r2[5] -= m2 * s; + r3[5] -= m3 * s; + } + s = r0[6]; + if (s != 0.0) { + r1[6] -= m1 * s; + r2[6] -= m2 * s; + r3[6] -= m3 * s; + } + s = r0[7]; + if (s != 0.0) { + r1[7] -= m1 * s; + r2[7] -= m2 * s; + r3[7] -= m3 * s; + } + + /* choose pivot - or die */ + if (fabs(r3[1]) > fabs(r2[1])) + SWAP_ROWS(r3, r2); + if (fabs(r2[1]) > fabs(r1[1])) + SWAP_ROWS(r2, r1); + if (0.0 == r1[1]) + return GL_FALSE; + + /* eliminate second variable */ + m2 = r2[1] / r1[1]; + m3 = r3[1] / r1[1]; + r2[2] -= m2 * r1[2]; + r3[2] -= m3 * r1[2]; + r2[3] -= m2 * r1[3]; + r3[3] -= m3 * r1[3]; + s = r1[4]; + if (0.0 != s) { + r2[4] -= m2 * s; + r3[4] -= m3 * s; + } + s = r1[5]; + if (0.0 != s) { + r2[5] -= m2 * s; + r3[5] -= m3 * s; + } + s = r1[6]; + if (0.0 != s) { + r2[6] -= m2 * s; + r3[6] -= m3 * s; + } + s = r1[7]; + if (0.0 != s) { + r2[7] -= m2 * s; + r3[7] -= m3 * s; + } + + /* choose pivot - or die */ + if (fabs(r3[2]) > fabs(r2[2])) + SWAP_ROWS(r3, r2); + if (0.0 == r2[2]) + return GL_FALSE; + + /* eliminate third variable */ + m3 = r3[2] / r2[2]; + r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], + r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7]; + + /* last check */ + if (0.0 == r3[3]) + return GL_FALSE; + + s = 1.0 / r3[3]; /* now back substitute row 3 */ + r3[4] *= s; + r3[5] *= s; + r3[6] *= s; + r3[7] *= s; + + m2 = r2[3]; /* now back substitute row 2 */ + s = 1.0 / r2[2]; + r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), + r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); + m1 = r1[3]; + r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, + r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; + m0 = r0[3]; + r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, + r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; + + m1 = r1[2]; /* now back substitute row 1 */ + s = 1.0 / r1[1]; + r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), + r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); + m0 = r0[2]; + r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, + r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; + + m0 = r0[1]; /* now back substitute row 0 */ + s = 1.0 / r0[0]; + r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), + r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); + + MAT(out, 0, 0) = r0[4]; + MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6]; + MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4]; + MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6]; + MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4]; + MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6]; + MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4]; + MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6]; + MAT(out, 3, 3) = r3[7]; + + return GL_TRUE; + +#undef MAT +#undef SWAP_ROWS +} + + + +/* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */ +GLint GLAPIENTRY +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble model[16], const GLdouble proj[16], + const GLint viewport[4], + GLdouble * winx, GLdouble * winy, GLdouble * winz) +{ + /* matrice de transformation */ + GLdouble in[4], out[4]; + + /* initilise la matrice et le vecteur a transformer */ + in[0] = objx; + in[1] = objy; + in[2] = objz; + in[3] = 1.0; + transform_point(out, model, in); + transform_point(in, proj, out); + + /* d'ou le resultat normalise entre -1 et 1 */ + if (in[3] == 0.0) + return GL_FALSE; + + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + + /* en coordonnees ecran */ + *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2; + *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2; + /* entre 0 et 1 suivant z */ + *winz = (1 + in[2]) / 2; + return GL_TRUE; +} + + + +/* transformation du point ecran (winx,winy,winz) en point objet */ +GLint GLAPIENTRY +gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, + const GLdouble model[16], const GLdouble proj[16], + const GLint viewport[4], + GLdouble * objx, GLdouble * objy, GLdouble * objz) +{ + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4], out[4]; + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; + in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; + in[2] = 2 * winz - 1.0; + in[3] = 1.0; + + /* calcul transformation inverse */ + matmul(A, proj, model); + if (!invert_matrix(A, m)) + return GL_FALSE; + + /* d'ou les coordonnees objets */ + transform_point(out, m, in); + if (out[3] == 0.0) + return GL_FALSE; + *objx = out[0] / out[3]; + *objy = out[1] / out[3]; + *objz = out[2] / out[3]; + return GL_TRUE; +} + + +/* + * New in GLU 1.3 + * This is like gluUnProject but also takes near and far DepthRange values. + */ +#ifdef GLU_VERSION_1_3 +GLint GLAPIENTRY +gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLclampd nearZ, GLclampd farZ, + GLdouble * objx, GLdouble * objy, GLdouble * objz, + GLdouble * objw) +{ + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4], out[4]; + GLdouble z = nearZ + winz * (farZ - nearZ); + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; + in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; + in[2] = 2.0 * z - 1.0; + in[3] = clipw; + + /* calcul transformation inverse */ + matmul(A, projMatrix, modelMatrix); + if (!invert_matrix(A, m)) + return GL_FALSE; + + /* d'ou les coordonnees objets */ + transform_point(out, m, in); + if (out[3] == 0.0) + return GL_FALSE; + *objx = out[0] / out[3]; + *objy = out[1] / out[3]; + *objz = out[2] / out[3]; + *objw = out[3]; + return GL_TRUE; +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/quadric.c xpsb-glx-0.19/mesa/src/glu/mesa/quadric.c --- xpsb-glx-0.19/mesa/src/glu/mesa/quadric.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/quadric.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,819 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1999-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* TODO: + * texture coordinate support + * flip normals according to orientation + * there's still some inside/outside orientation bugs in possibly all + * but the sphere function + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include "gluP.h" +#endif + + + +#ifndef M_PI +# define M_PI (3.1415926) +#endif + + +/* + * Convert degrees to radians: + */ +#define DEG_TO_RAD(A) ((A)*(M_PI/180.0)) + + +/* + * Sin and Cos for degree angles: + */ +#define SIND( A ) sin( (A)*(M_PI/180.0) ) +#define COSD( A) cos( (A)*(M_PI/180.0) ) + + +/* + * Texture coordinates if texture flag is set + */ +#define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y); + + + +struct GLUquadric +{ + GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */ + GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ + GLboolean TextureFlag; /* Generate texture coords? */ + GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ + void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */ +}; + + + +/* + * Process a GLU error. + */ +static void +quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg) +{ + /* Call the error call back function if any */ + if (qobj->ErrorFunc) { + (*qobj->ErrorFunc) (error); + } + /* Print a message to stdout if MESA_DEBUG variable is defined */ + if (getenv("MESA_DEBUG")) { + fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error), + msg); + } +} + + + + +GLUquadricObj *GLAPIENTRY +gluNewQuadric(void) +{ + GLUquadricObj *q; + + q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric)); + if (q) { + q->DrawStyle = GLU_FILL; + q->Orientation = GLU_OUTSIDE; + q->TextureFlag = GL_FALSE; + q->Normals = GLU_SMOOTH; + q->ErrorFunc = NULL; + } + return q; +} + + + +void GLAPIENTRY +gluDeleteQuadric(GLUquadricObj * state) +{ + if (state) { + free((void *) state); + } +} + + + +/* + * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE, + * or GLU_POINT. + */ +void GLAPIENTRY +gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle) +{ + if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE + || drawStyle == GLU_SILHOUETTE + || drawStyle == GLU_POINT)) { + quadObject->DrawStyle = drawStyle; + } + else { + quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle"); + } +} + + + +/* + * Set the orientation to GLU_INSIDE or GLU_OUTSIDE. + */ +void GLAPIENTRY +gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation) +{ + if (quadObject + && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) { + quadObject->Orientation = orientation; + } + else { + quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation"); + } +} + + + +/* + * Set the error handler callback function. + */ +void GLAPIENTRY +gluQuadricCallback(GLUquadricObj * qobj, + GLenum which, void (GLCALLBACK * fn) ()) +{ + /* + * UGH, this is a mess! I thought ANSI was a standard. + */ + if (qobj && which == GLU_ERROR) { +#ifdef __CYGWIN32__ + qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn; +#elif defined(OPENSTEP) + qobj->ErrorFunc = (void (*)(GLenum)) fn; +#elif defined(_WIN32) + qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn; +#elif defined(__STORM__) + qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn; +#elif defined(__BEOS__) + qobj->ErrorFunc = (void (*)(GLenum)) fn; +#else + qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn; +#endif + } +} + + +void GLAPIENTRY +gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals) +{ + if (quadObject + && (normals == GLU_NONE || normals == GLU_FLAT + || normals == GLU_SMOOTH)) { + quadObject->Normals = normals; + } +} + + +void GLAPIENTRY +gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords) +{ + if (quadObject) { + quadObject->TextureFlag = textureCoords; + } +} + + + + +/* + * Call glNormal3f after scaling normal to unit length. + */ +static void +normal3f(GLfloat x, GLfloat y, GLfloat z) +{ + GLdouble mag; + + mag = sqrt(x * x + y * y + z * z); + if (mag > 0.00001F) { + x /= mag; + y /= mag; + z /= mag; + } + glNormal3f(x, y, z); +} + + + +void GLAPIENTRY +gluCylinder(GLUquadricObj * qobj, + GLdouble baseRadius, GLdouble topRadius, + GLdouble height, GLint slices, GLint stacks) +{ + GLdouble da, r, dr, dz; + GLfloat x, y, z, nz, nsign; + GLint i, j; + + if (qobj->Orientation == GLU_INSIDE) { + nsign = -1.0; + } + else { + nsign = 1.0; + } + + da = 2.0 * M_PI / slices; + dr = (topRadius - baseRadius) / stacks; + dz = height / stacks; + nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */ + + if (qobj->DrawStyle == GLU_POINT) { + glBegin(GL_POINTS); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + + z = 0.0; + r = baseRadius; + for (j = 0; j <= stacks; j++) { + glVertex3f(x * r, y * r, z); + z += dz; + r += dr; + } + } + glEnd(); + } + else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { + /* Draw rings */ + if (qobj->DrawStyle == GLU_LINE) { + z = 0.0; + r = baseRadius; + for (j = 0; j <= stacks; j++) { + glBegin(GL_LINE_LOOP); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * r, y * r, z); + } + glEnd(); + z += dz; + r += dr; + } + } + else { + /* draw one ring at each end */ + if (baseRadius != 0.0) { + glBegin(GL_LINE_LOOP); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * baseRadius, y * baseRadius, 0.0); + } + glEnd(); + glBegin(GL_LINE_LOOP); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * topRadius, y * topRadius, height); + } + glEnd(); + } + } + /* draw length lines */ + glBegin(GL_LINES); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * baseRadius, y * baseRadius, 0.0); + glVertex3f(x * topRadius, y * topRadius, height); + } + glEnd(); + } + else if (qobj->DrawStyle == GLU_FILL) { + GLfloat ds = 1.0 / slices; + GLfloat dt = 1.0 / stacks; + GLfloat t = 0.0; + z = 0.0; + r = baseRadius; + for (j = 0; j < stacks; j++) { + GLfloat s = 0.0; + glBegin(GL_QUAD_STRIP); + for (i = 0; i <= slices; i++) { + GLfloat x, y; + if (i == slices) { + x = sin(0.0); + y = cos(0.0); + } + else { + x = sin(i * da); + y = cos(i * da); + } + if (nsign == 1.0) { + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t); + glVertex3f(x * r, y * r, z); + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t + dt); + glVertex3f(x * (r + dr), y * (r + dr), z + dz); + } + else { + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t); + glVertex3f(x * r, y * r, z); + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t + dt); + glVertex3f(x * (r + dr), y * (r + dr), z + dz); + } + s += ds; + } /* for slices */ + glEnd(); + r += dr; + t += dt; + z += dz; + } /* for stacks */ + } +} + + + + + +void GLAPIENTRY +gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks) +{ + GLfloat rho, drho, theta, dtheta; + GLfloat x, y, z; + GLfloat s, t, ds, dt; + GLint i, j, imin, imax; + GLboolean normals; + GLfloat nsign; + + if (qobj->Normals == GLU_NONE) { + normals = GL_FALSE; + } + else { + normals = GL_TRUE; + } + if (qobj->Orientation == GLU_INSIDE) { + nsign = -1.0; + } + else { + nsign = 1.0; + } + + drho = M_PI / (GLfloat) stacks; + dtheta = 2.0 * M_PI / (GLfloat) slices; + + /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */ + /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */ + /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */ + + if (qobj->DrawStyle == GLU_FILL) { + if (!qobj->TextureFlag) { + /* draw +Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0, 0.0, 1.0); + glVertex3f(0.0, 0.0, nsign * radius); + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(drho); + y = cos(theta) * sin(drho); + z = nsign * cos(drho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + + ds = 1.0 / slices; + dt = 1.0 / stacks; + t = 1.0; /* because loop now runs from 0 */ + if (qobj->TextureFlag) { + imin = 0; + imax = stacks; + } + else { + imin = 1; + imax = stacks - 1; + } + + /* draw intermediate stacks as quad strips */ + for (i = imin; i < imax; i++) { + rho = i * drho; + glBegin(GL_QUAD_STRIP); + s = 0.0; + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho); + y = cos(theta) * sin(rho); + z = nsign * cos(rho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + TXTR_COORD(s, t); + glVertex3f(x * radius, y * radius, z * radius); + x = -sin(theta) * sin(rho + drho); + y = cos(theta) * sin(rho + drho); + z = nsign * cos(rho + drho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + TXTR_COORD(s, t - dt); + s += ds; + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + t -= dt; + } + + if (!qobj->TextureFlag) { + /* draw -Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0, 0.0, -1.0); + glVertex3f(0.0, 0.0, -radius * nsign); + rho = M_PI - drho; + s = 1.0; + t = dt; + for (j = slices; j >= 0; j--) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho); + y = cos(theta) * sin(rho); + z = nsign * cos(rho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + s -= ds; + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + } + else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { + /* draw stack lines */ + for (i = 1; i < stacks; i++) { /* stack line at i==stacks-1 was missing here */ + rho = i * drho; + glBegin(GL_LINE_LOOP); + for (j = 0; j < slices; j++) { + theta = j * dtheta; + x = cos(theta) * sin(rho); + y = sin(theta) * sin(rho); + z = cos(rho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + /* draw slice lines */ + for (j = 0; j < slices; j++) { + theta = j * dtheta; + glBegin(GL_LINE_STRIP); + for (i = 0; i <= stacks; i++) { + rho = i * drho; + x = cos(theta) * sin(rho); + y = sin(theta) * sin(rho); + z = cos(rho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + } + else if (qobj->DrawStyle == GLU_POINT) { + /* top and bottom-most points */ + glBegin(GL_POINTS); + if (normals) + glNormal3f(0.0, 0.0, nsign); + glVertex3d(0.0, 0.0, radius); + if (normals) + glNormal3f(0.0, 0.0, -nsign); + glVertex3d(0.0, 0.0, -radius); + + /* loop over stacks */ + for (i = 1; i < stacks - 1; i++) { + rho = i * drho; + for (j = 0; j < slices; j++) { + theta = j * dtheta; + x = cos(theta) * sin(rho); + y = sin(theta) * sin(rho); + z = cos(rho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + glVertex3f(x * radius, y * radius, z * radius); + } + } + glEnd(); + } + +} + + + +void GLAPIENTRY +gluDisk(GLUquadricObj * qobj, + GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops) +{ + GLfloat da, dr; +#if 0 + GLdouble a, da; + GLfloat r, dr; + GLfloat x, y; + GLfloat r1, r2, dtc; + GLint s, l; +#endif + + /* Normal vectors */ + if (qobj->Normals != GLU_NONE) { + if (qobj->Orientation == GLU_OUTSIDE) { + glNormal3f(0.0, 0.0, +1.0); + } + else { + glNormal3f(0.0, 0.0, -1.0); + } + } + + da = 2.0 * M_PI / slices; + dr = (outerRadius - innerRadius) / (GLfloat) loops; + + switch (qobj->DrawStyle) { + case GLU_FILL: + { + /* texture of a gluDisk is a cut out of the texture unit square + * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1] + * (linear mapping) + */ + GLfloat dtc = 2.0f * outerRadius; + GLfloat sa, ca; + GLfloat r1 = innerRadius; + GLint l; + for (l = 0; l < loops; l++) { + GLfloat r2 = r1 + dr; + if (qobj->Orientation == GLU_OUTSIDE) { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = 0; s <= slices; s++) { + GLfloat a; + if (s == slices) + a = 0.0; + else + a = s * da; + sa = sin(a); + ca = cos(a); + TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc); + glVertex2f(r2 * sa, r2 * ca); + TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc); + glVertex2f(r1 * sa, r1 * ca); + } + glEnd(); + } + else { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = slices; s >= 0; s--) { + GLfloat a; + if (s == slices) + a = 0.0; + else + a = s * da; + sa = sin(a); + ca = cos(a); + TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc); + glVertex2f(r2 * sa, r2 * ca); + TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc); + glVertex2f(r1 * sa, r1 * ca); + } + glEnd(); + } + r1 = r2; + } + break; + } + case GLU_LINE: + { + GLint l, s; + /* draw loops */ + for (l = 0; l <= loops; l++) { + GLfloat r = innerRadius + l * dr; + glBegin(GL_LINE_LOOP); + for (s = 0; s < slices; s++) { + GLfloat a = s * da; + glVertex2f(r * sin(a), r * cos(a)); + } + glEnd(); + } + /* draw spokes */ + for (s = 0; s < slices; s++) { + GLfloat a = s * da; + GLfloat x = sin(a); + GLfloat y = cos(a); + glBegin(GL_LINE_STRIP); + for (l = 0; l <= loops; l++) { + GLfloat r = innerRadius + l * dr; + glVertex2f(r * x, r * y); + } + glEnd(); + } + break; + } + case GLU_POINT: + { + GLint s; + glBegin(GL_POINTS); + for (s = 0; s < slices; s++) { + GLfloat a = s * da; + GLfloat x = sin(a); + GLfloat y = cos(a); + GLint l; + for (l = 0; l <= loops; l++) { + GLfloat r = innerRadius * l * dr; + glVertex2f(r * x, r * y); + } + } + glEnd(); + break; + } + case GLU_SILHOUETTE: + { + if (innerRadius != 0.0) { + GLfloat a; + glBegin(GL_LINE_LOOP); + for (a = 0.0; a < 2.0 * M_PI; a += da) { + GLfloat x = innerRadius * sin(a); + GLfloat y = innerRadius * cos(a); + glVertex2f(x, y); + } + glEnd(); + } + { + GLfloat a; + glBegin(GL_LINE_LOOP); + for (a = 0; a < 2.0 * M_PI; a += da) { + GLfloat x = outerRadius * sin(a); + GLfloat y = outerRadius * cos(a); + glVertex2f(x, y); + } + glEnd(); + } + break; + } + default: + abort(); + } +} + + + +void GLAPIENTRY +gluPartialDisk(GLUquadricObj * qobj, GLdouble innerRadius, + GLdouble outerRadius, GLint slices, GLint loops, + GLdouble startAngle, GLdouble sweepAngle) +{ + if (qobj->Normals != GLU_NONE) { + if (qobj->Orientation == GLU_OUTSIDE) { + glNormal3f(0.0, 0.0, +1.0); + } + else { + glNormal3f(0.0, 0.0, -1.0); + } + } + + if (qobj->DrawStyle == GLU_POINT) { + GLint loop, slice; + GLdouble radius, delta_radius; + GLdouble angle, delta_angle; + delta_radius = (outerRadius - innerRadius) / (loops - 1); + delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1)); + glBegin(GL_POINTS); + radius = innerRadius; + for (loop = 0; loop < loops; loop++) { + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice < slices; slice++) { + glVertex2d(radius * sin(angle), radius * cos(angle)); + angle += delta_angle; + } + radius += delta_radius; + } + glEnd(); + } + else if (qobj->DrawStyle == GLU_LINE) { + GLint loop, slice; + GLdouble radius, delta_radius; + GLdouble angle, delta_angle; + delta_radius = (outerRadius - innerRadius) / loops; + delta_angle = DEG_TO_RAD(sweepAngle / slices); + /* draw rings */ + radius = innerRadius; + for (loop = 0; loop < loops; loop++) { + angle = DEG_TO_RAD(startAngle); + glBegin(GL_LINE_STRIP); + for (slice = 0; slice <= slices; slice++) { + glVertex2d(radius * sin(angle), radius * cos(angle)); + angle += delta_angle; + } + glEnd(); + radius += delta_radius; + } + /* draw spokes */ + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice <= slices; slice++) { + radius = innerRadius; + glBegin(GL_LINE_STRIP); + for (loop = 0; loop < loops; loop++) { + glVertex2d(radius * sin(angle), radius * cos(angle)); + radius += delta_radius; + } + glEnd(); + angle += delta_angle; + } + } + else if (qobj->DrawStyle == GLU_SILHOUETTE) { + GLint slice; + GLdouble angle, delta_angle; + delta_angle = DEG_TO_RAD(sweepAngle / slices); + /* draw outer ring */ + glBegin(GL_LINE_STRIP); + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice <= slices; slice++) { + glVertex2d(outerRadius * sin(angle), outerRadius * cos(angle)); + angle += delta_angle; + } + glEnd(); + /* draw inner ring */ + if (innerRadius > 0.0) { + glBegin(GL_LINE_STRIP); + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice < slices; slice++) { + glVertex2d(innerRadius * sin(angle), innerRadius * cos(angle)); + angle += delta_angle; + } + glEnd(); + } + /* draw spokes */ + if (sweepAngle < 360.0) { + GLdouble stopAngle = startAngle + sweepAngle; + glBegin(GL_LINES); + glVertex2d(innerRadius * SIND(startAngle), + innerRadius * COSD(startAngle)); + glVertex2d(outerRadius * SIND(startAngle), + outerRadius * COSD(startAngle)); + glVertex2d(innerRadius * SIND(stopAngle), + innerRadius * COSD(stopAngle)); + glVertex2d(outerRadius * SIND(stopAngle), + outerRadius * COSD(stopAngle)); + glEnd(); + } + } + else if (qobj->DrawStyle == GLU_FILL) { + GLint loop, slice; + GLdouble radius, delta_radius; + GLdouble angle, delta_angle; + delta_radius = (outerRadius - innerRadius) / loops; + delta_angle = DEG_TO_RAD(sweepAngle / slices); + radius = innerRadius; + for (loop = 0; loop < loops; loop++) { + glBegin(GL_QUAD_STRIP); + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice <= slices; slice++) { + if (qobj->Orientation == GLU_OUTSIDE) { + glVertex2d((radius + delta_radius) * sin(angle), + (radius + delta_radius) * cos(angle)); + glVertex2d(radius * sin(angle), radius * cos(angle)); + } + else { + glVertex2d(radius * sin(angle), radius * cos(angle)); + glVertex2d((radius + delta_radius) * sin(angle), + (radius + delta_radius) * cos(angle)); + } + angle += delta_angle; + } + glEnd(); + radius += delta_radius; + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/README1 xpsb-glx-0.19/mesa/src/glu/mesa/README1 --- xpsb-glx-0.19/mesa/src/glu/mesa/README1 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/README1 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,195 @@ + +Notes on the GLU polygon tesselation facility implemented by Bogdan Sikorski... + + + +The tesselation module is provided under the same terms as the Mesa +package. + +This is the first release of polygon tesselation code for Mesa. +It was written during my very little free time, so lets name it: +"its not perfect". If someone hates pointers, don't look at the code. +I preffer dynamic allocation versus static. But _all_ ideas, suggestions, +bug reports and fixes are welcome (if You want, also flames). I am aware +that many things could have been written using better techniques, but time +that I could devote to this library was very limited. It is not well commented, +excuse me. Also I am thinking of continuing working on this code to improve, +fix and polish it. And make it as compliant as possible to the OpenGL, so +software ports from OpenGL to Mesa will work correctly. If You know of any +differences in behaviour, expected input/output between Mesa tesselation library +and OpenGL, please send me a note. I explain later on why I am not +confident with this code. + +I tried to be fully compliant with the OpenGL routines. By "tried" I mean that +up to my knowledge it behaves as OpenGL tesselation routines. Just recently +I began to experiment with OpenGL (actually only Mesa), and also have +no access to any machine providing official implementation of OpenGL, +nor access to books (particulary Addison-Wesley publications). Thus my +knowledge on how the original tesselation code works, what kind of data +it expects etc. is based _only_ on the publicly available documentation +provided by SGI. Namely: + +* "The OpenGL Graphics System Utility Library" by K.P.Smith + (Silicon Graphics, 1992) +* "The OpenGL Graphics Interface" by M.Segal and K.Akeley + (Silicon Graphics, 19??) +* "OpenGL and X, Part 1: Introduction" by M.J.Kilgard + (Silicon Graphics, 1994) +* "OpenGL and X, Part 2: Using OpenGL with Xlib" by M.J.Kilgard + (Silicon Graphics, 1994) +* "OpenGL Graphics with the X Window System" by P.Karlton + (Silicon Graphics, 1993) +* Online Docs - Appendix C of OpenGL Programming Guide, Polygon Tesselation + (partial text cut and sent by e-mail) + + +The tesselation routines use slightly different prototypes than the ones +specified in the mentioned above publications. The _only_ differences are +the enumeration types which are not GLenum, but are GLUenum. So the +implemented routines have following prototypes: + +GLUtringulatorObj *gluNewTess(void); + +void gluTessCallback(GLUtriangulatorObj *,GLUenum,void (*)()); + ^^^^^^^ +void gluBeginPolygon(GLUtriangulatorObj *); + +void gluTessVertex(GLUtriangulatorObj *,GLdouble [3],void *); + +void gluNextContour(GLUtriangulatorObj *,GLUenum); + ^^^^^^^ +void gluEndPolygon(GLUtriangulatorObj *); + +const GLubyte *gluErrorString(GLUenum); + ^^^^^^^ + prototypes for callback functions: + +void (GLUenum); + ^^^^^^^ +void (GLboolean); +void (void *); +void (void); +void (GLUenum); + ^^^^^^^ + +The begin callback will be called only with GLU_TRIANGLES. No support +for traingle fans or strips yet. + +In case of errors an internal error variable is set to the appropiate +error enum values (GLU_TESS_ERROR?). Initially it is set to GLU_NO_ERROR. +The OpenGL library provides 8 error conditions, the tesselation code +of Mesa provides 9. They are: + +GLU_TESS_ERROR1: missing gluEndPolygon /* same as OpenGL */ +GLU_TESS_ERROR2: missing gluBeginPolygon /* same as OpenGL */ +GLU_TESS_ERROR3: misoriented contour /* not used in Mesa + in OpenGL is bad orientation or intersecting edges */ +GLU_TESS_ERROR4: vertex/edge intersection /* same as OpenGL */ +GLU_TESS_ERROR5: misoriented or self-intersecting loops /* same as OpenGL */ +GLU_TESS_ERROR6: coincident vertices /* same as OpenGL */ +GLU_TESS_ERROR7: colinear vertices /* OpenGL's illegal data */ +GLU_TESS_ERROR8: intersecting edges /* same as OpenGL */ +GLU_TESS_ERROR9: not coplanar contours /* new for Mesa */ + +The Mesa tesselation code ignores all data and calls after detecting an error +codition. This means that a _new_ tesselation object must be used for further +triangulations. Maybe this is too restrictive, and will be lifted in +future versions. + +The tesselation code completely ignores the type parameter passed in +gluNextContour. It also doesn't check if the passed parameter is a legal +enum value - ignores silently (maybe at least this should be checked). +The reason I chose this behaviour is based on what I read in the +beforementioned documents. I cite: + +".... +void gluNextContour(GLUtriangulatorObj *tessobj, GLenum type); + +Marks the beginning of the next contour when multiple contours make up the +boundary of the polygon to be tessellated. type can be GLU_EXTERIOR, +GLU_INTERIOR, GLU_CCW, GLU_CW, or GLU_UNKNOWN. These serve only as +to the tessellation. If you get them right, the tessellation might +go faster. If you get them wrong, they're ignored, and the tesselation still +works. +....." + +I hope You agree with me that my decision was correct. Mesa tesselation +_always_ checks by itself the interrelations between contours. Just as if +all contours were specified with the type GLU_UNKNOWN. + +One of OpenGL's policy is not to check all error conditions - rely sometimes +that the user "got things right". This is justified, since exhausting +error checking is timeconsuming, and would significantly slow down +a correct application. The Mesa tesselation code assumes only _one_ condition +when triangulating - all vertices in a contour are planar. This is _not_ +checked for correctness. Trying to tesselate such objects will lead to +unpredictable output. + +And now we arrive to the moment where I would like to list the required +(but checked for) conditions for triangulation, as well as summarize the +library: + +* all contours in a single tesselation cycle _must_ be coplanar - if not + an error is raised (and if provided a call to the error callback + is made) +* the contours can be passed in _any_ order, exteriors and holes can be + intermixed within a tesselation cycle and the correct hierarchy + will be determined by the library; thus specifying first holes then + exteriors, then holes within holes form a valid input. +* a hole within a hole is consider to be a yet another exterior contour +* multiple exterior contours (polygons) can be tesselated in one cycle; + _but_ this significantly degrades performance since many tests will be + performed for every contour pair; if You want triangulation to be fast + tesselate a single polygon (with possible holes) one at a time. +* orientation of exterior contours is arbitray, but if it has holes, + all interior holes of this particular exterior contour _must_ have an + opposite orientation. +* the output triangles have the same orientation as the exterior contour + that forms them +* each triangle is "enclosed" within the begin and end callbacks; + this is not efficent, but was made on purpose; so if triangulation + results in 2 triangles the following callbacks will be made in such + order: + (GLU_TRAINGLES) + (...) /* 3 vertices of first triangle */ + (...) + (...) + () + (GLU_TRAINGLES) + (...) /* 3 vertices of second triangle */ + (...) + (...) + () + Of course only when begin, vertex, and end callback were provided, + otherwise no output is done (actually tesselation does not take place). +* You will notice that some output traingles are very "thin"; there + exist possible several ways to traingulate a polygon, but "smart" code + avoiding such cases would require time to write, and will impact on + execution speed. +* like OpenGL, no new vertices are introduced during triangulation +* if the edgeflag callback is provided it will be called whenever + the just-about-to be output vertex begins a different type of edge + than the previous vertices; always before the first output a call + is made with GL_TRUE, to allow synchronization. +* all intermediate computations are done using GLdouble type, and comparisons + are biased with a precision value (EPSILON defined in tess.h) +* the point_in_poly function is my adaptation of code from the + comp.graphics.alg newsgroup FAQ (originally written by Mr. Wm. Randolph + Franklin, modified by Scott Anguish). +* the edge_edge_intersect test is also an adopted code from comp.graphics.alg + newsgroup FAQ +* the general idea for traingulation used in this library is described in + the book "Computational Geometry in C" by Joseph O'Rourke. + + +Excuse my English, its not my mother tongue. I should be available for some +time uner the following e-mail address. But For how long I am not certain. +Once I am settled in my new place, I'll post on the Mesa mailing list +my new address. + +(PS: today is my last day of work here, I'm changing my job). + +Bogdan. ( bogdan@dia.unisa.it ) + +Apr 28, 1995. + diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/README2 xpsb-glx-0.19/mesa/src/glu/mesa/README2 --- xpsb-glx-0.19/mesa/src/glu/mesa/README2 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/README2 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,43 @@ +The current NURBS implementation has no trimming facilities yet. + +The code is not well commented. + +1) Normal calculus fails for special cases of NURBS (independent + of the NURBS modules) + Those cases arise when for u or v, some control points + for a fixed value of that parameter form the same point. + Imagine a Bezier patch degenerated into a "triangle". + + v ^ 0,1,2 order=3 + | * + | + | 3* 4* 5* + | + | 6* 7* 8* + | + | + +------------------------> u + + The calculus of du derivative at triple point (0,1 and 2) will fail. + As a result, the normal vector will be 0. + The eval2.c code has to be changed to handle the above situation. + +2) Adjacent NURBS surfaces ("sharing" the same control points along + the "joining" edge) will be sampled with the same factor. + This prevents the formation of "cracks". + When the control polygon of the "shared" edge is not the same, + cracks might appear. + +The sampling tolerance is sometimes not respected! +A NURBS object is broken into Bezier curves/surfaces. If one of such +Bezier objects has a local high curvature with other portions of it +relatively flat then the high curvature part will be sampled more dense that +its flatter regions. +The flat regions might be tesselated into quads having sides of length +greater than the current sampling tolernace setting. +I believe such behaviour is acceptable, though not along the concept of +sampling tolerance. + +February 20, 1996. + +Bogdan. diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/tess.c xpsb-glx-0.19/mesa/src/glu/mesa/tess.c --- xpsb-glx-0.19/mesa/src/glu/mesa/tess.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/tess.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,327 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "tess.h" +#endif + + +/* + * This is ugly, but seems the easiest way to do things to make the + * code work under YellowBox for Windows + */ +#if defined(OPENSTEP) && defined(CALLBACK) +#undef CALLBACK +#define CALLBACK +#endif + + +static void delete_contours(GLUtriangulatorObj *); + +#ifdef __CYGWIN32__ +#define _CALLBACK +#else +#define _CALLBACK GLCALLBACK +#endif + + +static void +init_callbacks(tess_callbacks * callbacks) +{ + callbacks->begin = (void (_CALLBACK *) (GLenum)) 0; + callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0; + callbacks->vertex = (void (_CALLBACK *) (void *)) 0; + callbacks->end = (void (_CALLBACK *) (void)) 0; + callbacks->error = (void (_CALLBACK *) (GLenum)) 0; +} + +void +tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr) +{ + if (tobj->error == GLU_NO_ERROR) + tobj->error = gluerr; + if (tobj->callbacks.error != NULL) + (tobj->callbacks.error) (gluerr); +} + +GLUtriangulatorObj *GLAPIENTRY +gluNewTess(void) +{ + GLUtriangulatorObj *tobj; + + if ((tobj = (GLUtriangulatorObj *) + malloc(sizeof(struct GLUtesselator))) == NULL) + return NULL; + tobj->contours = tobj->last_contour = NULL; + init_callbacks(&tobj->callbacks); + tobj->error = GLU_NO_ERROR; + tobj->current_polygon = NULL; + tobj->contour_cnt = 0; + return tobj; +} + + +void GLAPIENTRY +gluTessCallback(GLUtriangulatorObj * tobj, GLenum which, + void (GLCALLBACK * fn) ()) +{ + switch (which) { + case GLU_BEGIN: + tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn; + break; + case GLU_EDGE_FLAG: + tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn; + break; + case GLU_VERTEX: + tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn; + break; + case GLU_END: + tobj->callbacks.end = (void (_CALLBACK *) (void)) fn; + break; + case GLU_ERROR: + tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn; + break; + default: + tobj->error = GLU_INVALID_ENUM; + break; + } +} + + + +void GLAPIENTRY +gluDeleteTess(GLUtriangulatorObj * tobj) +{ + if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt) + /* was gluEndPolygon called? */ + tess_call_user_error(tobj, GLU_TESS_ERROR1); + /* delete all internal structures */ + delete_contours(tobj); + free(tobj); +} + + +void GLAPIENTRY +gluBeginPolygon(GLUtriangulatorObj * tobj) +{ +/* + if(tobj->error!=GLU_NO_ERROR) + return; +*/ + tobj->error = GLU_NO_ERROR; + if (tobj->current_polygon != NULL) { + /* gluEndPolygon was not called */ + tess_call_user_error(tobj, GLU_TESS_ERROR1); + /* delete all internal structures */ + delete_contours(tobj); + } + else { + if ((tobj->current_polygon = + (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + tobj->current_polygon->vertex_cnt = 0; + tobj->current_polygon->vertices = + tobj->current_polygon->last_vertex = NULL; + } +} + + +void GLAPIENTRY +gluEndPolygon(GLUtriangulatorObj * tobj) +{ + /*tess_contour *contour_ptr; */ + + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* check if gluBeginPolygon was called */ + if (tobj->current_polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + tess_test_polygon(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* any real contours? */ + if (tobj->contour_cnt == 0) { + /* delete all internal structures */ + delete_contours(tobj); + return; + } + tess_find_contour_hierarchies(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + tess_handle_holes(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* if no callbacks, nothing to do */ + if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL && + tobj->callbacks.end != NULL) { + if (tobj->callbacks.edgeFlag == NULL) + tess_tesselate(tobj); + else + tess_tesselate_with_edge_flag(tobj); + } + + end: + /* delete all internal structures */ + delete_contours(tobj); +} + + +void GLAPIENTRY +gluNextContour(GLUtriangulatorObj * tobj, GLenum type) +{ + if (tobj->error != GLU_NO_ERROR) + return; + if (tobj->current_polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + /* first contour? */ + if (tobj->current_polygon->vertex_cnt) + tess_test_polygon(tobj); +} + + +void GLAPIENTRY +gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *last_vertex_ptr; + + if (tobj->error != GLU_NO_ERROR) + return; + if (polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + last_vertex_ptr = polygon->last_vertex; + if (last_vertex_ptr == NULL) { + if ((last_vertex_ptr = (tess_vertex *) + malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + polygon->vertices = last_vertex_ptr; + polygon->last_vertex = last_vertex_ptr; + last_vertex_ptr->data = data; + last_vertex_ptr->location[0] = v[0]; + last_vertex_ptr->location[1] = v[1]; + last_vertex_ptr->location[2] = v[2]; + last_vertex_ptr->next = NULL; + last_vertex_ptr->previous = NULL; + ++(polygon->vertex_cnt); + } + else { + tess_vertex *vertex_ptr; + + /* same point twice? */ + if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON && + fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON && + fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) { + tess_call_user_error(tobj, GLU_TESS_ERROR6); + return; + } + if ((vertex_ptr = (tess_vertex *) + malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + vertex_ptr->data = data; + vertex_ptr->location[0] = v[0]; + vertex_ptr->location[1] = v[1]; + vertex_ptr->location[2] = v[2]; + vertex_ptr->next = NULL; + vertex_ptr->previous = last_vertex_ptr; + ++(polygon->vertex_cnt); + last_vertex_ptr->next = vertex_ptr; + polygon->last_vertex = vertex_ptr; + } +} + + +static void +delete_contours(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_contour *contour, *contour_tmp; + tess_vertex *vertex, *vertex_tmp; + + /* remove current_polygon list - if exists due to detected error */ + if (polygon != NULL) { + if (polygon->vertices) { + for (vertex = polygon->vertices; vertex != polygon->last_vertex;) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + free(vertex); + } + free(polygon); + tobj->current_polygon = NULL; + } + /* remove all contour data */ + for (contour = tobj->contours; contour != NULL;) { + for (vertex = contour->vertices; vertex != contour->last_vertex;) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + free(vertex); + contour_tmp = contour->next; + free(contour); + contour = contour_tmp; + } + tobj->contours = tobj->last_contour = NULL; + tobj->contour_cnt = 0; +} + + +void GLAPIENTRY +gluTessNormal(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ) +{ + /* dummy function */ + (void) tess; + (void) valueX; + (void) valueY; + (void) valueZ; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/tesselat.c xpsb-glx-0.19/mesa/src/glu/mesa/tesselat.c --- xpsb-glx-0.19/mesa/src/glu/mesa/tesselat.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/tesselat.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,406 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "tess.h" +#endif + + + +static GLboolean edge_flag; + +static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, + tess_vertex *, tess_vertex *); + +static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, + tess_vertex *, GLboolean, + tess_vertex *, GLboolean, + tess_vertex *, GLboolean); + +static GLdouble +twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc) +{ + return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x - + va->x); +} + +static GLboolean +left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) +{ + if (A * x + B * y + C > -EPSILON) + return GL_TRUE; + else + return GL_FALSE; +} + +static GLboolean +right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) +{ + if (A * x + B * y + C < EPSILON) + return GL_TRUE; + else + return GL_FALSE; +} + +static GLint +convex_ccw(tess_vertex * va, + tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) +{ + GLdouble d; + + d = twice_the_triangle_area(va, vb, vc); + + if (d > EPSILON) { + return 1; + } + else if (d < -EPSILON) { + return 0; + } + else { + return -1; + } +} + +static GLint +convex_cw(tess_vertex * va, + tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) +{ + GLdouble d; + + d = twice_the_triangle_area(va, vb, vc); + + if (d < -EPSILON) { + return 1; + } + else if (d > EPSILON) { + return 0; + } + else { + return -1; + } +} + +static GLboolean +diagonal_ccw(tess_vertex * va, + tess_vertex * vb, + GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vc = va->next, *vertex, *shadow_vertex; + struct + { + GLdouble A, B, C; + } + ac, cb, ba; + GLdouble x, y; + + GLint res = convex_ccw(va, vc, vb, tobj); + if (res == 0) + return GL_FALSE; + if (res == -1) + return GL_TRUE; + + ba.A = vb->y - va->y; + ba.B = va->x - vb->x; + ba.C = -ba.A * va->x - ba.B * va->y; + ac.A = va->y - vc->y; + ac.B = vc->x - va->x; + ac.C = -ac.A * vc->x - ac.B * vc->y; + cb.A = vc->y - vb->y; + cb.B = vb->x - vc->x; + cb.C = -cb.A * vb->x - cb.B * vb->y; + for (vertex = vb->next; vertex != va; vertex = vertex->next) { + shadow_vertex = vertex->shadow_vertex; + if (shadow_vertex != NULL && + (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) + continue; + x = vertex->x; + y = vertex->y; + if (left(ba.A, ba.B, ba.C, x, y) && + left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y)) + return GL_FALSE; + } + return GL_TRUE; +} + +static GLboolean +diagonal_cw(tess_vertex * va, + tess_vertex * vb, + GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vc = va->next, *vertex, *shadow_vertex; + struct + { + GLdouble A, B, C; + } + ac, cb, ba; + GLdouble x, y; + + GLint res = convex_cw(va, vc, vb, tobj); + if (res == 0) + return GL_FALSE; + if (res == -1) + return GL_TRUE; + + ba.A = vb->y - va->y; + ba.B = va->x - vb->x; + ba.C = -ba.A * va->x - ba.B * va->y; + ac.A = va->y - vc->y; + ac.B = vc->x - va->x; + ac.C = -ac.A * vc->x - ac.B * vc->y; + cb.A = vc->y - vb->y; + cb.B = vb->x - vc->x; + cb.C = -cb.A * vb->x - cb.B * vb->y; + for (vertex = vb->next; vertex != va; vertex = vertex->next) { + shadow_vertex = vertex->shadow_vertex; + if (shadow_vertex != NULL && + (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) + continue; + x = vertex->x; + y = vertex->y; + if (right(ba.A, ba.B, ba.C, x, y) && + right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y)) + return GL_FALSE; + } + return GL_TRUE; +} + +static void +clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour) +{ + emit_triangle(tobj, v->previous, v, v->next); + /* the first in the list */ + if (contour->vertices == v) { + contour->vertices = v->next; + contour->last_vertex->next = v->next; + v->next->previous = contour->last_vertex; + } + else + /* the last ? */ + if (contour->last_vertex == v) { + contour->vertices->previous = v->previous; + v->previous->next = v->next; + contour->last_vertex = v->previous; + } + else { + v->next->previous = v->previous; + v->previous->next = v->next; + } + free(v); + --(contour->vertex_cnt); +} + +static void +clip_ear_with_edge_flag(GLUtriangulatorObj * tobj, + tess_vertex * v, tess_contour * contour) +{ + emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag, + v, v->edge_flag, v->next, GL_FALSE); + v->previous->edge_flag = GL_FALSE; + /* the first in the list */ + if (contour->vertices == v) { + contour->vertices = v->next; + contour->last_vertex->next = v->next; + v->next->previous = contour->last_vertex; + } + else + /* the last ? */ + if (contour->last_vertex == v) { + contour->vertices->previous = v->previous; + v->previous->next = v->next; + contour->last_vertex = v->previous; + } + else { + v->next->previous = v->previous; + v->previous->next = v->next; + } + free(v); + --(contour->vertex_cnt); +} + +static void +triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj, + tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear_with_edge_flag(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj, + tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear_with_edge_flag(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +void +tess_tesselate(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + + for (contour = tobj->contours; contour != NULL; contour = contour->next) { + if (contour->orientation == GLU_CCW) { + triangulate_ccw(tobj, contour); + } + else { + triangulate_cw(tobj, contour); + } + if (tobj->error != GLU_NO_ERROR) + return; + + /* emit the last triangle */ + emit_triangle(tobj, contour->vertices, contour->vertices->next, + contour->vertices->next->next); + } +} + +void +tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + + edge_flag = GL_TRUE; + /* first callback with edgeFlag set to GL_TRUE */ + (tobj->callbacks.edgeFlag) (GL_TRUE); + + for (contour = tobj->contours; contour != NULL; contour = contour->next) { + if (contour->orientation == GLU_CCW) + triangulate_ccw_with_edge_flag(tobj, contour); + else + triangulate_cw_with_edge_flag(tobj, contour); + if (tobj->error != GLU_NO_ERROR) + return; + /* emit the last triangle */ + emit_triangle_with_edge_flag(tobj, contour->vertices, + contour->vertices->edge_flag, + contour->vertices->next, + contour->vertices->next->edge_flag, + contour->vertices->next->next, + contour->vertices->next->next->edge_flag); + } +} + +static void +emit_triangle(GLUtriangulatorObj * tobj, + tess_vertex * v1, tess_vertex * v2, tess_vertex * v3) +{ + (tobj->callbacks.begin) (GL_TRIANGLES); + (tobj->callbacks.vertex) (v1->data); + (tobj->callbacks.vertex) (v2->data); + (tobj->callbacks.vertex) (v3->data); + (tobj->callbacks.end) (); +} + +static void +emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj, + tess_vertex * v1, + GLboolean edge_flag1, + tess_vertex * v2, + GLboolean edge_flag2, + tess_vertex * v3, GLboolean edge_flag3) +{ + (tobj->callbacks.begin) (GL_TRIANGLES); + if (edge_flag1 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v1->data); + if (edge_flag2 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v2->data); + if (edge_flag3 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v3->data); + (tobj->callbacks.end) (); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mesa/tess.h xpsb-glx-0.19/mesa/src/glu/mesa/tess.h --- xpsb-glx-0.19/mesa/src/glu/mesa/tess.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mesa/tess.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,107 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifndef TESS_H +#define TESS_H + + +#include "gluP.h" + +#define EPSILON 1e-06 /* epsilon for double precision compares */ + +typedef enum +{ + OXY, + OYZ, + OXZ +} +projection_type; + +typedef struct callbacks_str +{ + void (GLCALLBACK * begin) (GLenum mode); + void (GLCALLBACK * edgeFlag) (GLboolean flag); + void (GLCALLBACK * vertex) (GLvoid * v); + void (GLCALLBACK * end) (void); + void (GLCALLBACK * error) (GLenum err); +} +tess_callbacks; + +typedef struct vertex_str +{ + void *data; + GLdouble location[3]; + GLdouble x, y; + GLboolean edge_flag; + struct vertex_str *shadow_vertex; + struct vertex_str *next, *previous; +} +tess_vertex; + +typedef struct contour_str +{ + GLenum type; + GLuint vertex_cnt; + GLdouble area; + GLenum orientation; + struct vertex_str *vertices, *last_vertex; + struct contour_str *next, *previous; +} +tess_contour; + +typedef struct polygon_str +{ + GLuint vertex_cnt; + GLdouble A, B, C, D; + GLdouble area; + GLenum orientation; + struct vertex_str *vertices, *last_vertex; +} +tess_polygon; + +struct GLUtesselator +{ + tess_contour *contours, *last_contour; + GLuint contour_cnt; + tess_callbacks callbacks; + tess_polygon *current_polygon; + GLenum error; + GLdouble A, B, C, D; + projection_type projection; +}; + + +extern void tess_call_user_error(GLUtriangulatorObj *, GLenum); +extern void tess_test_polygon(GLUtriangulatorObj *); +extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); +extern void tess_handle_holes(GLUtriangulatorObj *); +extern void tess_tesselate(GLUtriangulatorObj *); +extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/all.h xpsb-glx-0.19/mesa/src/glu/mini/all.h --- xpsb-glx-0.19/mesa/src/glu/mini/all.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/all.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,54 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file includes all .h files needed for the GLU source code for + * the purpose of precompiled headers. + * + * If the preprocessor symbol PCH is defined at compile time then each + * of the .c files will #include "all.h" only, instead of a bunch of + * individual .h files. + */ + + +#ifndef GLU_ALL_H +#define GLU_ALL_H + + +#ifndef PC_HEADER +This is an error. all.h should be included only if PCH is defined. +#endif + + +#include +#include +#include +#include +#include +#include "GL/gl.h" +#include "GL/glu.h" +#include "gluP.h" +#include "nurbs.h" +#include "tess.h" + + +#endif /*GLU_ALL_H */ diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/glu.c xpsb-glx-0.19/mesa/src/glu/mini/glu.c --- xpsb-glx-0.19/mesa/src/glu/mini/glu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/glu.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,416 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include +#include +#include "gluP.h" +#endif + + +/* + * Miscellaneous utility functions + */ + + +#ifndef M_PI +#define M_PI 3.1415926536 +#endif +#define EPS 0.00001 + +#ifndef GLU_INCOMPATIBLE_GL_VERSION +#define GLU_INCOMPATIBLE_GL_VERSION 100903 +#endif + + +void GLAPIENTRY +gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, + GLdouble centerx, GLdouble centery, GLdouble centerz, + GLdouble upx, GLdouble upy, GLdouble upz) +{ + GLfloat m[16]; + GLfloat x[3], y[3], z[3]; + GLfloat mag; + + /* Make rotation matrix */ + + /* Z vector */ + z[0] = eyex - centerx; + z[1] = eyey - centery; + z[2] = eyez - centerz; + mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); + if (mag) { /* mpichler, 19950515 */ + z[0] /= mag; + z[1] /= mag; + z[2] /= mag; + } + + /* Y vector */ + y[0] = upx; + y[1] = upy; + y[2] = upz; + + /* X vector = Y cross Z */ + x[0] = y[1] * z[2] - y[2] * z[1]; + x[1] = -y[0] * z[2] + y[2] * z[0]; + x[2] = y[0] * z[1] - y[1] * z[0]; + + /* Recompute Y = Z cross X */ + y[0] = z[1] * x[2] - z[2] * x[1]; + y[1] = -z[0] * x[2] + z[2] * x[0]; + y[2] = z[0] * x[1] - z[1] * x[0]; + + /* mpichler, 19950515 */ + /* cross product gives area of parallelogram, which is < 1.0 for + * non-perpendicular unit-length vectors; so normalize x, y here + */ + + mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); + if (mag) { + x[0] /= mag; + x[1] /= mag; + x[2] /= mag; + } + + mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); + if (mag) { + y[0] /= mag; + y[1] /= mag; + y[2] /= mag; + } + +#define M(row,col) m[col*4+row] + M(0, 0) = x[0]; + M(0, 1) = x[1]; + M(0, 2) = x[2]; + M(0, 3) = 0.0; + M(1, 0) = y[0]; + M(1, 1) = y[1]; + M(1, 2) = y[2]; + M(1, 3) = 0.0; + M(2, 0) = z[0]; + M(2, 1) = z[1]; + M(2, 2) = z[2]; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; +#undef M + glMultMatrixf(m); + + /* Translate Eye to Origin */ + glTranslatef(-eyex, -eyey, -eyez); + +} + + + +void GLAPIENTRY +gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) +{ + glOrtho(left, right, bottom, top, -1.0, 1.0); +} + + + +static void +frustum(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, + GLfloat nearval, GLfloat farval) +{ + GLfloat x, y, a, b, c, d; + GLfloat m[16]; + + x = (2.0 * nearval) / (right - left); + y = (2.0 * nearval) / (top - bottom); + a = (right + left) / (right - left); + b = (top + bottom) / (top - bottom); + c = -(farval + nearval) / ( farval - nearval); + d = -(2.0 * farval * nearval) / (farval - nearval); + +#define M(row,col) m[col*4+row] + M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F; + M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F; + M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d; + M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F; +#undef M + + glMultMatrixf(m); +} + + +void GLAPIENTRY +gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLfloat xmin, xmax, ymin, ymax; + + ymax = zNear * tan(fovy * M_PI / 360.0); + ymin = -ymax; + xmin = ymin * aspect; + xmax = ymax * aspect; + + /* don't call glFrustum() because of error semantics (covglu) */ + frustum(xmin, xmax, ymin, ymax, zNear, zFar); +} + + + +void GLAPIENTRY +gluPickMatrix(GLdouble x, GLdouble y, + GLdouble width, GLdouble height, GLint viewport[4]) +{ + GLfloat m[16]; + GLfloat sx, sy; + GLfloat tx, ty; + + sx = viewport[2] / width; + sy = viewport[3] / height; + tx = (viewport[2] + 2.0 * (viewport[0] - x)) / width; + ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height; + +#define M(row,col) m[col*4+row] + M(0, 0) = sx; + M(0, 1) = 0.0; + M(0, 2) = 0.0; + M(0, 3) = tx; + M(1, 0) = 0.0; + M(1, 1) = sy; + M(1, 2) = 0.0; + M(1, 3) = ty; + M(2, 0) = 0.0; + M(2, 1) = 0.0; + M(2, 2) = 1.0; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; +#undef M + + glMultMatrixf(m); +} + + + +const GLubyte *GLAPIENTRY +gluErrorString(GLenum errorCode) +{ + static char *tess_error[] = { + "missing gluBeginPolygon", + "missing gluBeginContour", + "missing gluEndPolygon", + "missing gluEndContour", + "misoriented or self-intersecting loops", + "coincident vertices", + "colinear vertices", + "FIST recovery process fatal error" + }; + static char *nurbs_error[] = { + "spline order un-supported", + "too few knots", + "valid knot range is empty", + "decreasing knot sequence knot", + "knot multiplicity greater than order of spline", + "endcurve() must follow bgncurve()", + "bgncurve() must precede endcurve()", + "missing or extra geometric data", + "can't draw pwlcurves", + "missing bgncurve()", + "missing bgnsurface()", + "endtrim() must precede endsurface()", + "bgnsurface() must precede endsurface()", + "curve of improper type passed as trim curve", + "bgnsurface() must precede bgntrim()", + "endtrim() must follow bgntrim()", + "bgntrim() must precede endtrim()", + "invalid or missing trim curve", + "bgntrim() must precede pwlcurve()", + "pwlcurve referenced twice", + "pwlcurve and nurbscurve mixed", + "improper usage of trim data type", + "nurbscurve referenced twice", + "nurbscurve and pwlcurve mixed", + "nurbssurface referenced twice", + "invalid property", + "endsurface() must follow bgnsurface()", + "misoriented trim curves", + "intersecting trim curves", + "UNUSED", + "unconnected trim curves", + "unknown knot error", + "negative vertex count encountered", + "negative byte-stride encountered", + "unknown type descriptor", + "null control array or knot vector", + "duplicate point on pwlcurve" + }; + + /* GL Errors */ + if (errorCode == GL_NO_ERROR) { + return (GLubyte *) "no error"; + } + else if (errorCode == GL_INVALID_VALUE) { + return (GLubyte *) "invalid value"; + } + else if (errorCode == GL_INVALID_ENUM) { + return (GLubyte *) "invalid enum"; + } + else if (errorCode == GL_INVALID_OPERATION) { + return (GLubyte *) "invalid operation"; + } + else if (errorCode == GL_STACK_OVERFLOW) { + return (GLubyte *) "stack overflow"; + } + else if (errorCode == GL_STACK_UNDERFLOW) { + return (GLubyte *) "stack underflow"; + } + else if (errorCode == GL_OUT_OF_MEMORY) { + return (GLubyte *) "out of memory"; + } + /* GLU Errors */ + else if (errorCode == GLU_NO_ERROR) { + return (GLubyte *) "no error"; + } + else if (errorCode == GLU_INVALID_ENUM) { + return (GLubyte *) "invalid enum"; + } + else if (errorCode == GLU_INVALID_VALUE) { + return (GLubyte *) "invalid value"; + } + else if (errorCode == GLU_OUT_OF_MEMORY) { + return (GLubyte *) "out of memory"; + } + else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) { + return (GLubyte *) "incompatible GL version"; + } + else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) { + return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1]; + } + else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) { + return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1]; + } + else { + return NULL; + } +} + + + +/* + * New in GLU 1.1 + */ + +const GLubyte *GLAPIENTRY +gluGetString(GLenum name) +{ + static char *extensions = "GL_EXT_abgr"; + static char *version = "1.1 Mesa 3.5"; + + switch (name) { + case GLU_EXTENSIONS: + return (GLubyte *) extensions; + case GLU_VERSION: + return (GLubyte *) version; + default: + return NULL; + } +} + + + +#if 0 /* gluGetProcAddressEXT not finalized yet! */ + +#ifdef __cplusplus + /* for BeOS R4.5 */ +void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...) +#else +void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) () +#endif +{ + struct proc + { + const char *name; + void *address; + }; + static struct proc procTable[] = { + {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */ + + /* new 1.1 functions */ + {"gluGetString", (void *) gluGetString}, + + /* new 1.2 functions */ + {"gluTessBeginPolygon", (void *) gluTessBeginPolygon}, + {"gluTessBeginContour", (void *) gluTessBeginContour}, + {"gluTessEndContour", (void *) gluTessEndContour}, + {"gluTessEndPolygon", (void *) gluTessEndPolygon}, + {"gluGetTessProperty", (void *) gluGetTessProperty}, + + /* new 1.3 functions */ + + {NULL, NULL} + }; + GLuint i; + + for (i = 0; procTable[i].address; i++) { + if (strcmp((const char *) procName, procTable[i].name) == 0) + return (void (GLAPIENTRY *) ()) procTable[i].address; + } + + return NULL; +} + +#endif + + + +/* + * New in GLU 1.3 + */ +#ifdef GLU_VERSION_1_3 +GLboolean GLAPIENTRY +gluCheckExtension(const GLubyte *extName, const GLubyte * extString) +{ + assert(extName); + assert(extString); + { + const int len = strlen((const char *) extName); + const char *start = (const char *) extString; + + while (1) { + const char *c = strstr(start, (const char *) extName); + if (!c) + return GL_FALSE; + + if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0)) + return GL_TRUE; + + start = c + len; + } + } +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/gluP.h xpsb-glx-0.19/mesa/src/glu/mini/gluP.h --- xpsb-glx-0.19/mesa/src/glu/mini/gluP.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/gluP.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,141 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file allows the GLU code to be compiled either with the Mesa + * headers or with the real OpenGL headers. + */ + + +#ifndef GLUP_H +#define GLUP_H + + +#include +#include +#include + + +#if defined(_WIN32) && !defined(__WIN32__) +# define __WIN32__ +#endif + +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) +# pragma warning( disable : 4068 ) /* unknown pragma */ +# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ +# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ +# pragma warning( disable : 4127 ) /* conditional expression is constant */ +# if defined(MESA_MINWARN) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# endif +# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# define WGLAPI __declspec(dllexport) +# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# define WGLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# define WGLAPI __declspec(dllimport) +# endif /* _STATIC_MESA support */ +# define GLAPIENTRY __stdcall +# define GLAPIENTRYP __stdcall * +# define GLCALLBACK __stdcall +# define GLCALLBACKP __stdcall * +# if defined(__CYGWIN__) +# define GLCALLBACKPCAST * +# else +# define GLCALLBACKPCAST __stdcall * +# endif +# define GLWINAPI __stdcall +# define GLWINAPIV __cdecl +#else +/* non-Windows compilation */ +# define GLAPI extern +# define GLAPIENTRY +# define GLAPIENTRYP * +# define GLCALLBACK +# define GLCALLBACKP * +# define GLCALLBACKPCAST * +# define GLWINAPI +# define GLWINAPIV +#endif /* WIN32 / CYGWIN bracket */ + +/* compatibility guard so we don't need to change client code */ + +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) +# define CALLBACK GLCALLBACK +typedef int (GLAPIENTRY *PROC)(); +typedef void *HGLRC; +typedef void *HDC; +typedef unsigned long COLORREF; +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) +# define WGL_FONT_LINES 0 +# define WGL_FONT_POLYGONS 1 +#ifndef _GNU_H_WINDOWS32_FUNCTIONS +# ifdef UNICODE +# define wglUseFontBitmaps wglUseFontBitmapsW +# define wglUseFontOutlines wglUseFontOutlinesW +# else +# define wglUseFontBitmaps wglUseFontBitmapsA +# define wglUseFontOutlines wglUseFontOutlinesA +# endif /* !UNICODE */ +#endif /* _GNU_H_WINDOWS32_FUNCTIONS */ +typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; +typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; +#include +#endif + + + +#ifndef GLU_TESS_ERROR9 + /* If we're using the real OpenGL header files... */ +# define GLU_TESS_ERROR9 100159 +#endif + + +#define GLU_NO_ERROR GL_NO_ERROR + + +/* for Sun: */ +#ifdef SUNOS4 +#define MEMCPY( DST, SRC, BYTES) \ + memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) ) +#else +#define MEMCPY( DST, SRC, BYTES) \ + memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) ) +#endif + + +#ifndef NULL +# define NULL 0 +#endif + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/mipmap.c xpsb-glx-0.19/mesa/src/glu/mini/mipmap.c --- xpsb-glx-0.19/mesa/src/glu/mini/mipmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/mipmap.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,763 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include +#include "gluP.h" +#endif + + +/* + * Compute ceiling of integer quotient of A divided by B: + */ +#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) + + + +#ifdef EPSILON +#undef EPSILON +#endif +#define EPSILON 0.001 + + +/* To work around optimizer bug in MSVC4.1 */ +#if defined(__WIN32__) && !defined(OPENSTEP) +void +dummy(GLuint j, GLuint k) +{ +} +#else +#define dummy(J, K) +#endif + + +GLint GLAPIENTRY +gluScaleImage(GLenum format, + GLsizei widthin, GLsizei heightin, + GLenum typein, const void *datain, + GLsizei widthout, GLsizei heightout, + GLenum typeout, void *dataout) +{ + GLint components, i, j, k; + GLfloat *tempin, *tempout, f; + GLfloat sx, sy; + GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; + GLint packrowlength, packalignment, packskiprows, packskippixels; + GLint sizein, sizeout; + GLint rowstride, rowlen; + + + /* Determine number of components per pixel */ + switch (format) { + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + components = 1; + break; + case GL_LUMINANCE_ALPHA: + components = 2; + break; + case GL_RGB: + case GL_BGR: + components = 3; + break; + case GL_RGBA: + case GL_BGRA: +#ifdef GL_EXT_abgr + case GL_ABGR_EXT: +#endif + components = 4; + break; + default: + return GLU_INVALID_ENUM; + } + + /* Determine bytes per input datum */ + switch (typein) { + case GL_UNSIGNED_BYTE: + sizein = sizeof(GLubyte); + break; + case GL_BYTE: + sizein = sizeof(GLbyte); + break; + case GL_UNSIGNED_SHORT: + sizein = sizeof(GLushort); + break; + case GL_SHORT: + sizein = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + sizein = sizeof(GLuint); + break; + case GL_INT: + sizein = sizeof(GLint); + break; + case GL_FLOAT: + sizein = sizeof(GLfloat); + break; + case GL_BITMAP: + /* not implemented yet */ + default: + return GL_INVALID_ENUM; + } + + /* Determine bytes per output datum */ + switch (typeout) { + case GL_UNSIGNED_BYTE: + sizeout = sizeof(GLubyte); + break; + case GL_BYTE: + sizeout = sizeof(GLbyte); + break; + case GL_UNSIGNED_SHORT: + sizeout = sizeof(GLushort); + break; + case GL_SHORT: + sizeout = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + sizeout = sizeof(GLuint); + break; + case GL_INT: + sizeout = sizeof(GLint); + break; + case GL_FLOAT: + sizeout = sizeof(GLfloat); + break; + case GL_BITMAP: + /* not implemented yet */ + default: + return GL_INVALID_ENUM; + } + + /* Get glPixelStore state */ + glGetFloatv(GL_UNPACK_ROW_LENGTH, &f); unpackrowlength = (int)f; + glGetFloatv(GL_UNPACK_ALIGNMENT, &f); unpackalignment = (int)f; + glGetFloatv(GL_UNPACK_SKIP_ROWS, &f); unpackskiprows = (int)f; + glGetFloatv(GL_UNPACK_SKIP_PIXELS, &f); unpackskippixels = (int)f; + glGetFloatv(GL_PACK_ROW_LENGTH, &f); packrowlength = (int)f; + glGetFloatv(GL_PACK_ALIGNMENT, &f); packalignment = (int)f; + glGetFloatv(GL_PACK_SKIP_ROWS, &f); packskiprows = (int)f; + glGetFloatv(GL_PACK_SKIP_PIXELS, &f); packskippixels = (int)f; + + /* Allocate storage for intermediate images */ + tempin = (GLfloat *) malloc(widthin * heightin + * components * sizeof(GLfloat)); + if (!tempin) { + return GLU_OUT_OF_MEMORY; + } + tempout = (GLfloat *) malloc(widthout * heightout + * components * sizeof(GLfloat)); + if (!tempout) { + free(tempin); + return GLU_OUT_OF_MEMORY; + } + + + /* + * Unpack the pixel data and convert to floating point + */ + + if (unpackrowlength > 0) { + rowlen = unpackrowlength; + } + else { + rowlen = widthin; + } + if (sizein >= unpackalignment) { + rowstride = components * rowlen; + } + else { + rowstride = unpackalignment / sizein + * CEILING(components * rowlen * sizein, unpackalignment); + } + + switch (typein) { + case GL_UNSIGNED_BYTE: + k = 0; + for (i = 0; i < heightin; i++) { + GLubyte *ubptr = (GLubyte *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * ubptr++; + } + } + break; + case GL_BYTE: + k = 0; + for (i = 0; i < heightin; i++) { + GLbyte *bptr = (GLbyte *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * bptr++; + } + } + break; + case GL_UNSIGNED_SHORT: + k = 0; + for (i = 0; i < heightin; i++) { + GLushort *usptr = (GLushort *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * usptr++; + } + } + break; + case GL_SHORT: + k = 0; + for (i = 0; i < heightin; i++) { + GLshort *sptr = (GLshort *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * sptr++; + } + } + break; + case GL_UNSIGNED_INT: + k = 0; + for (i = 0; i < heightin; i++) { + GLuint *uiptr = (GLuint *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * uiptr++; + } + } + break; + case GL_INT: + k = 0; + for (i = 0; i < heightin; i++) { + GLint *iptr = (GLint *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = (GLfloat) * iptr++; + } + } + break; + case GL_FLOAT: + k = 0; + for (i = 0; i < heightin; i++) { + GLfloat *fptr = (GLfloat *) datain + + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + for (j = 0; j < widthin * components; j++) { + dummy(j, k); + tempin[k++] = *fptr++; + } + } + break; + default: + return GLU_INVALID_ENUM; + } + + + /* + * Scale the image! + */ + + if (widthout > 1) + sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1); + else + sx = (GLfloat) (widthin - 1); + if (heightout > 1) + sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1); + else + sy = (GLfloat) (heightin - 1); + +/*#define POINT_SAMPLE*/ +#ifdef POINT_SAMPLE + for (i = 0; i < heightout; i++) { + GLint ii = i * sy; + for (j = 0; j < widthout; j++) { + GLint jj = j * sx; + + GLfloat *src = tempin + (ii * widthin + jj) * components; + GLfloat *dst = tempout + (i * widthout + j) * components; + + for (k = 0; k < components; k++) { + *dst++ = *src++; + } + } + } +#else + if (sx < 1.0 && sy < 1.0) { + /* magnify both width and height: use weighted sample of 4 pixels */ + GLint i0, i1, j0, j1; + GLfloat alpha, beta; + GLfloat *src00, *src01, *src10, *src11; + GLfloat s1, s2; + GLfloat *dst; + + for (i = 0; i < heightout; i++) { + i0 = i * sy; + i1 = i0 + 1; + if (i1 >= heightin) + i1 = heightin - 1; +/* i1 = (i+1) * sy - EPSILON;*/ + alpha = i * sy - i0; + for (j = 0; j < widthout; j++) { + j0 = j * sx; + j1 = j0 + 1; + if (j1 >= widthin) + j1 = widthin - 1; +/* j1 = (j+1) * sx - EPSILON; */ + beta = j * sx - j0; + + /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */ + src00 = tempin + (i0 * widthin + j0) * components; + src01 = tempin + (i0 * widthin + j1) * components; + src10 = tempin + (i1 * widthin + j0) * components; + src11 = tempin + (i1 * widthin + j1) * components; + + dst = tempout + (i * widthout + j) * components; + + for (k = 0; k < components; k++) { + s1 = *src00++ * (1.0 - beta) + *src01++ * beta; + s2 = *src10++ * (1.0 - beta) + *src11++ * beta; + *dst++ = s1 * (1.0 - alpha) + s2 * alpha; + } + } + } + } + else { + /* shrink width and/or height: use an unweighted box filter */ + GLint i0, i1; + GLint j0, j1; + GLint ii, jj; + GLfloat sum, *dst; + + for (i = 0; i < heightout; i++) { + i0 = i * sy; + i1 = i0 + 1; + if (i1 >= heightin) + i1 = heightin - 1; +/* i1 = (i+1) * sy - EPSILON; */ + for (j = 0; j < widthout; j++) { + j0 = j * sx; + j1 = j0 + 1; + if (j1 >= widthin) + j1 = widthin - 1; +/* j1 = (j+1) * sx - EPSILON; */ + + dst = tempout + (i * widthout + j) * components; + + /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */ + for (k = 0; k < components; k++) { + sum = 0.0; + for (ii = i0; ii <= i1; ii++) { + for (jj = j0; jj <= j1; jj++) { + sum += *(tempin + (ii * widthin + jj) * components + k); + } + } + sum /= (j1 - j0 + 1) * (i1 - i0 + 1); + *dst++ = sum; + } + } + } + } +#endif + + + /* + * Return output image + */ + + if (packrowlength > 0) { + rowlen = packrowlength; + } + else { + rowlen = widthout; + } + if (sizeout >= packalignment) { + rowstride = components * rowlen; + } + else { + rowstride = packalignment / sizeout + * CEILING(components * rowlen * sizeout, packalignment); + } + + switch (typeout) { + case GL_UNSIGNED_BYTE: + k = 0; + for (i = 0; i < heightout; i++) { + GLubyte *ubptr = (GLubyte *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *ubptr++ = (GLubyte) tempout[k++]; + } + } + break; + case GL_BYTE: + k = 0; + for (i = 0; i < heightout; i++) { + GLbyte *bptr = (GLbyte *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *bptr++ = (GLbyte) tempout[k++]; + } + } + break; + case GL_UNSIGNED_SHORT: + k = 0; + for (i = 0; i < heightout; i++) { + GLushort *usptr = (GLushort *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *usptr++ = (GLushort) tempout[k++]; + } + } + break; + case GL_SHORT: + k = 0; + for (i = 0; i < heightout; i++) { + GLshort *sptr = (GLshort *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *sptr++ = (GLshort) tempout[k++]; + } + } + break; + case GL_UNSIGNED_INT: + k = 0; + for (i = 0; i < heightout; i++) { + GLuint *uiptr = (GLuint *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *uiptr++ = (GLuint) tempout[k++]; + } + } + break; + case GL_INT: + k = 0; + for (i = 0; i < heightout; i++) { + GLint *iptr = (GLint *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *iptr++ = (GLint) tempout[k++]; + } + } + break; + case GL_FLOAT: + k = 0; + for (i = 0; i < heightout; i++) { + GLfloat *fptr = (GLfloat *) dataout + + i * rowstride + + packskiprows * rowstride + packskippixels * components; + for (j = 0; j < widthout * components; j++) { + dummy(j, k + i); + *fptr++ = tempout[k++]; + } + } + break; + default: + return GLU_INVALID_ENUM; + } + + + /* free temporary image storage */ + free(tempin); + free(tempout); + + return 0; +} + + + +/* + * Return the largest k such that 2^k <= n. + */ +static GLint +ilog2(GLint n) +{ + GLint k; + + if (n <= 0) + return 0; + for (k = 0; n >>= 1; k++); + return k; +} + + + +/* + * Find the value nearest to n which is also a power of two. + */ +static GLint +round2(GLint n) +{ + GLint m; + + for (m = 1; m < n; m *= 2); + + /* m>=n */ + if (m - n <= n - m / 2) { + return m; + } + else { + return m / 2; + } +} + + +/* + * Given an pixel format and data type, return the number of bytes to + * store one pixel. + */ +static GLint +bytes_per_pixel(GLenum format, GLenum type) +{ + GLint n, m; + + switch (format) { + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + n = 1; + break; + case GL_LUMINANCE_ALPHA: + n = 2; + break; + case GL_RGB: + case GL_BGR: + n = 3; + break; + case GL_RGBA: + case GL_BGRA: +#ifdef GL_EXT_abgr + case GL_ABGR_EXT: +#endif + n = 4; + break; + default: + n = 0; + } + + switch (type) { + case GL_UNSIGNED_BYTE: + m = sizeof(GLubyte); + break; + case GL_BYTE: + m = sizeof(GLbyte); + break; + case GL_BITMAP: + m = 1; + break; + case GL_UNSIGNED_SHORT: + m = sizeof(GLushort); + break; + case GL_SHORT: + m = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + m = sizeof(GLuint); + break; + case GL_INT: + m = sizeof(GLint); + break; + case GL_FLOAT: + m = sizeof(GLfloat); + break; + default: + m = 0; + } + + return n * m; +} + + + +/* + * WARNING: This function isn't finished and has never been tested!!!! + */ +GLint GLAPIENTRY +gluBuild1DMipmaps(GLenum target, GLint components, + GLsizei width, GLenum format, GLenum type, const void *data) +{ + return 0; +} + + + +GLint GLAPIENTRY +gluBuild2DMipmaps(GLenum target, GLint components, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const void *data) +{ + GLint w, h; + GLint maxsize; + void *image, *newimage; + GLint neww, newh, level, bpp; + int error; + GLboolean done; + GLint retval = 0; + GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; + GLint packrowlength, packalignment, packskiprows, packskippixels; + GLfloat f; + + if (width < 1 || height < 1) + return GLU_INVALID_VALUE; + + glGetFloatv(GL_MAX_TEXTURE_SIZE, &f); maxsize = (int)f; + + w = round2(width); + if (w > maxsize) { + w = maxsize; + } + h = round2(height); + if (h > maxsize) { + h = maxsize; + } + + bpp = bytes_per_pixel(format, type); + if (bpp == 0) { + /* probably a bad format or type enum */ + return GLU_INVALID_ENUM; + } + + /* Get current glPixelStore values */ + glGetFloatv(GL_UNPACK_ROW_LENGTH, &f); unpackrowlength = (int)f; + glGetFloatv(GL_UNPACK_ALIGNMENT, &f); unpackalignment = (int)f; + glGetFloatv(GL_UNPACK_SKIP_ROWS, &f); unpackskiprows = (int)f; + glGetFloatv(GL_UNPACK_SKIP_PIXELS, &f); unpackskippixels = (int)f; + glGetFloatv(GL_PACK_ROW_LENGTH, &f); packrowlength = (int)f; + glGetFloatv(GL_PACK_ALIGNMENT, &f); packalignment = (int)f; + glGetFloatv(GL_PACK_SKIP_ROWS, &f); packskiprows = (int)f; + glGetFloatv(GL_PACK_SKIP_PIXELS, &f); packskippixels = (int)f; + + /* set pixel packing */ + glPixelStorei(GL_PACK_ROW_LENGTH, 0); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_SKIP_ROWS, 0); + glPixelStorei(GL_PACK_SKIP_PIXELS, 0); + + done = GL_FALSE; + + if (w != width || h != height) { + /* must rescale image to get "top" mipmap texture image */ + image = malloc((w + 4) * h * bpp); + if (!image) { + return GLU_OUT_OF_MEMORY; + } + error = gluScaleImage(format, width, height, type, data, + w, h, type, image); + if (error) { + retval = error; + done = GL_TRUE; + } + } + else { + image = (void *) data; + } + + level = 0; + while (!done) { + if (image != data) { + /* set pixel unpacking */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + } + + glTexImage2D(target, level, components, w, h, 0, format, type, image); + + if (w == 1 && h == 1) + break; + + neww = (w < 2) ? 1 : w / 2; + newh = (h < 2) ? 1 : h / 2; + newimage = malloc((neww + 4) * newh * bpp); + if (!newimage) { + return GLU_OUT_OF_MEMORY; + } + + error = gluScaleImage(format, w, h, type, image, + neww, newh, type, newimage); + if (error) { + retval = error; + done = GL_TRUE; + } + + if (image != data) { + free(image); + } + image = newimage; + + w = neww; + h = newh; + level++; + } + + if (image != data) { + free(image); + } + + /* Restore original glPixelStore state */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength); + glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels); + glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength); + glPixelStorei(GL_PACK_ALIGNMENT, packalignment); + glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows); + glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels); + + return retval; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/nurbs.c xpsb-glx-0.19/mesa/src/glu/mini/nurbs.c --- xpsb-glx-0.19/mesa/src/glu/mini/nurbs.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/nurbs.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,157 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "nurbs.h" +#endif + + +void +call_user_error(GLUnurbsObj * nobj, GLenum error) +{ + nobj->error = error; + if (nobj->error_callback != NULL) { + (*(nobj->error_callback)) (error); + } + else { + printf("NURBS error %d %s\n", error, (char *) gluErrorString(error)); + } +} + + + +GLUnurbsObj *GLAPIENTRY +gluNewNurbsRenderer(void) +{ + GLUnurbsObj *n; + GLfloat tmp_viewport[4]; + GLint i, j; + + n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj)); + return n; +} + + + +void GLAPIENTRY +gluDeleteNurbsRenderer(GLUnurbsObj * nobj) +{ + if (nobj) { + free(nobj); + } +} + + + +void GLAPIENTRY +gluLoadSamplingMatrices(GLUnurbsObj * nobj, + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], const GLint viewport[4]) +{ +} + + +void GLAPIENTRY +gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value) +{ +} + + +void GLAPIENTRY +gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value) +{ +} + + + +void GLAPIENTRY +gluBeginCurve(GLUnurbsObj * nobj) +{ +} + + +void GLAPIENTRY +gluEndCurve(GLUnurbsObj * nobj) +{ +} + + +void GLAPIENTRY +gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot, + GLint stride, GLfloat * ctlarray, GLint order, GLenum type) +{ +} + + +void GLAPIENTRY +gluBeginSurface(GLUnurbsObj * nobj) +{ +} + + +void GLAPIENTRY +gluEndSurface(GLUnurbsObj * nobj) +{ +} + + +void GLAPIENTRY +gluNurbsSurface(GLUnurbsObj * nobj, + GLint sknot_count, GLfloat * sknot, + GLint tknot_count, GLfloat * tknot, + GLint s_stride, GLint t_stride, + GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type) +{ +} + + +void GLAPIENTRY +gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ()) +{ +} + +void GLAPIENTRY +gluBeginTrim(GLUnurbsObj * nobj) +{ +} + +void GLAPIENTRY +gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride, + GLenum type) +{ +} + +void GLAPIENTRY +gluEndTrim(GLUnurbsObj * nobj) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/nurbscrv.c xpsb-glx-0.19/mesa/src/glu/mini/nurbscrv.c --- xpsb-glx-0.19/mesa/src/glu/mini/nurbscrv.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/nurbscrv.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,132 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "nurbs.h" +#endif + + + +/* main NURBS curve procedure */ +void +do_nurbs_curve(GLUnurbsObj * nobj) +{ + GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0; + GLenum geom_type; + GLint n_ctrl; + GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl, + *new_texture_ctrl; + GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0; + GLint *factors; + GLint i, j; + GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0; + + /* test the user supplied data */ + if (test_nurbs_curves(nobj) != GLU_NO_ERROR) + return; + + if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl, + &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR) + return; + + geom_order = nobj->curve.geom.order; + geom_type = nobj->curve.geom.type; + geom_dim = nobj->curve.geom.dim; + + if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim, + &factors) != GLU_NO_ERROR) { + free(new_geom_ctrl); + if (new_color_ctrl) + free(new_color_ctrl); + if (new_normal_ctrl) + free(new_normal_ctrl); + if (new_texture_ctrl) + free(new_texture_ctrl); + return; + } + glEnable(geom_type); + if (new_color_ctrl) { + glEnable(nobj->curve.color.type); + color_dim = nobj->curve.color.dim; + color_ctrl = new_color_ctrl; + color_order = nobj->curve.color.order; + } + if (new_normal_ctrl) { + glEnable(nobj->curve.normal.type); + normal_dim = nobj->curve.normal.dim; + normal_ctrl = new_normal_ctrl; + normal_order = nobj->curve.normal.order; + } + if (new_texture_ctrl) { + glEnable(nobj->curve.texture.type); + texture_dim = nobj->curve.texture.dim; + texture_ctrl = new_texture_ctrl; + texture_order = nobj->curve.texture.order; + } + for (i = 0, j = 0, geom_ctrl = new_geom_ctrl; + i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) { + if (fine_culling_test_2D + (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) { + color_ctrl += color_order * color_dim; + normal_ctrl += normal_order * normal_dim; + texture_ctrl += texture_order * texture_dim; + continue; + } + glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl); + if (new_color_ctrl) { + glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim, + color_order, color_ctrl); + color_ctrl += color_order * color_dim; + } + if (new_normal_ctrl) { + glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim, + normal_order, normal_ctrl); + normal_ctrl += normal_order * normal_dim; + } + if (new_texture_ctrl) { + glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim, + texture_order, texture_ctrl); + texture_ctrl += texture_order * texture_dim; + } + glMapGrid1f(factors[j], 0.0, 1.0); + glEvalMesh1(GL_LINE, 0, factors[j]); + } + free(new_geom_ctrl); + free(factors); + if (new_color_ctrl) + free(new_color_ctrl); + if (new_normal_ctrl) + free(new_normal_ctrl); + if (new_texture_ctrl) + free(new_texture_ctrl); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/nurbs.h xpsb-glx-0.19/mesa/src/glu/mini/nurbs.h --- xpsb-glx-0.19/mesa/src/glu/mini/nurbs.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/nurbs.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,252 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) + * See README2 for more info. + */ + + +#ifndef NURBS_H +#define NURBS_H + + +#define EPSILON 1e-06 /* epsilon for double precision compares */ + +typedef enum +{ + GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM, + GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE +} +GLU_nurbs_enum; + +typedef enum +{ + GLU_TRIM_NURBS, GLU_TRIM_PWL +} +GLU_trim_enum; + +typedef struct +{ + GLint sknot_count; + GLfloat *sknot; + GLint tknot_count; + GLfloat *tknot; + GLint s_stride; + GLint t_stride; + GLfloat *ctrlarray; + GLint sorder; + GLint torder; + GLint dim; + GLenum type; +} +surface_attribs; + +typedef struct +{ + surface_attribs geom; + surface_attribs color; + surface_attribs texture; + surface_attribs normal; +} +nurbs_surface; + +typedef struct +{ + GLint knot_count; + GLfloat *knot; + GLint stride; + GLfloat *ctrlarray; + GLint order; + GLint dim; + GLenum type; +} +curve_attribs; + +typedef struct +{ + GLint pt_count; + GLfloat *ctrlarray; + GLint stride; + GLint dim; + GLenum type; +} +pwl_curve_attribs; + +typedef struct +{ + curve_attribs geom; + curve_attribs color; + curve_attribs texture; + curve_attribs normal; +} +nurbs_curve; + +typedef struct trim_list_str +{ + GLU_trim_enum trim_type; + union + { + pwl_curve_attribs pwl_curve; + curve_attribs nurbs_curve; + } + curve; + struct trim_list_str *next; +} +trim_list; + +typedef struct seg_trim_str +{ + GLfloat *points; + GLint pt_cnt, seg_array_len; + struct seg_trim_str *next; +} +trim_segments; + +typedef struct nurbs_trim_str +{ + trim_list *trim_loop; + trim_segments *segments; + struct nurbs_trim_str *next; +} +nurbs_trim; + +typedef struct +{ + GLfloat model[16], proj[16], viewport[4]; +} +culling_and_sampling_str; + +struct GLUnurbs +{ + GLboolean culling; + GLenum error; + void (GLCALLBACK * error_callback) (GLenum err); + GLenum display_mode; + GLU_nurbs_enum nurbs_type; + GLboolean auto_load_matrix; + culling_and_sampling_str sampling_matrices; + GLenum sampling_method; + GLfloat sampling_tolerance; + GLfloat parametric_tolerance; + GLint u_step, v_step; + nurbs_surface surface; + nurbs_curve curve; + nurbs_trim *trim; +}; + +typedef struct +{ + GLfloat *knot; + GLint nknots; + GLfloat *unified_knot; + GLint unified_nknots; + GLint order; + GLint t_min, t_max; + GLint delta_nknots; + GLboolean open_at_begin, open_at_end; + GLfloat *new_knot; + GLfloat *alpha; +} +knot_str_type; + +typedef struct +{ + GLfloat *geom_ctrl; + GLint geom_s_stride, geom_t_stride; + GLfloat **geom_offsets; + GLint geom_s_pt_cnt, geom_t_pt_cnt; + GLfloat *color_ctrl; + GLint color_s_stride, color_t_stride; + GLfloat **color_offsets; + GLint color_s_pt_cnt, color_t_pt_cnt; + GLfloat *normal_ctrl; + GLint normal_s_stride, normal_t_stride; + GLfloat **normal_offsets; + GLint normal_s_pt_cnt, normal_t_pt_cnt; + GLfloat *texture_ctrl; + GLint texture_s_stride, texture_t_stride; + GLfloat **texture_offsets; + GLint texture_s_pt_cnt, texture_t_pt_cnt; + GLint s_bezier_cnt, t_bezier_cnt; +} +new_ctrl_type; + +extern void call_user_error(GLUnurbsObj * nobj, GLenum error); + +extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order); + +extern GLenum explode_knot(knot_str_type * the_knot); + +extern GLenum calc_alphas(knot_str_type * the_knot); + +extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, + knot_str_type * the_knot, GLint dim, + GLfloat ** new_ctrl, GLint * ncontrol); + +extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl, + GLint n_ctrl, GLint order, GLint dim, + GLint ** factors); + +extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj, + new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl, + GLint n_ctrl, GLint stride, GLint dim); + +extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl, + GLint s_n_ctrl, GLint t_n_ctrl, + GLint s_stride, GLint t_stride, + GLint dim); + +extern void do_nurbs_curve(GLUnurbsObj * nobj); + +extern void do_nurbs_surface(GLUnurbsObj * nobj); + +extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint * sfactors, GLint * tfactors); + +extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src, + GLfloat maximal_min_knot, + GLfloat minimal_max_knot); + +extern GLenum select_knot_working_range(GLUnurbsObj * nobj, + knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot); + +extern void free_unified_knots(knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot); + + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/polytest.c xpsb-glx-0.19/mesa/src/glu/mini/polytest.c --- xpsb-glx-0.19/mesa/src/glu/mini/polytest.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/polytest.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,937 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "tess.h" +#endif + + + +static GLenum store_polygon_as_contour(GLUtriangulatorObj *); +static void free_current_polygon(tess_polygon *); +static void prepare_projection_info(GLUtriangulatorObj *); +static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *); +static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *); +void tess_find_contour_hierarchies(GLUtriangulatorObj *); +static GLenum test_for_overlapping_contours(GLUtriangulatorObj *); +static GLenum contours_overlap(tess_contour *, tess_polygon *); +static GLenum is_contour_contained_in(tess_contour *, tess_contour *); +static void add_new_exterior(GLUtriangulatorObj *, tess_contour *); +static void add_new_interior(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static void add_interior_with_hierarchy_check(GLUtriangulatorObj *, + tess_contour *, tess_contour *); +static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *, + tess_contour *, + tess_contour *); +static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble); +static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *); +static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static GLenum merge_hole_with_contour(GLUtriangulatorObj *, + tess_contour *, tess_contour *, + tess_vertex *, tess_vertex *); + +static GLenum +find_normal(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *va, *vb, *vc; + GLdouble A, B, C; + GLdouble A0, A1, A2, B0, B1, B2; + + va = polygon->vertices; + vb = va->next; + A0 = vb->location[0] - va->location[0]; + A1 = vb->location[1] - va->location[1]; + A2 = vb->location[2] - va->location[2]; + for (vc = vb->next; vc != va; vc = vc->next) { + B0 = vc->location[0] - va->location[0]; + B1 = vc->location[1] - va->location[1]; + B2 = vc->location[2] - va->location[2]; + A = A1 * B2 - A2 * B1; + B = A2 * B0 - A0 * B2; + C = A0 * B1 - A1 * B0; + if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) { + polygon->A = A; + polygon->B = B; + polygon->C = C; + polygon->D = + -A * va->location[0] - B * va->location[1] - C * va->location[2]; + return GLU_NO_ERROR; + } + } + tess_call_user_error(tobj, GLU_TESS_ERROR7); + return GLU_ERROR; +} + +void +tess_test_polygon(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + + /* any vertices defined? */ + if (polygon->vertex_cnt < 3) { + free_current_polygon(polygon); + return; + } + /* wrap pointers */ + polygon->last_vertex->next = polygon->vertices; + polygon->vertices->previous = polygon->last_vertex; + /* determine the normal */ + if (find_normal(tobj) == GLU_ERROR) + return; + /* compare the normals of previously defined contours and this one */ + /* first contour define ? */ + if (tobj->contours == NULL) { + tobj->A = polygon->A; + tobj->B = polygon->B; + tobj->C = polygon->C; + tobj->D = polygon->D; + /* determine the best projection to use */ + if (fabs(polygon->A) > fabs(polygon->B)) + if (fabs(polygon->A) > fabs(polygon->C)) + tobj->projection = OYZ; + else + tobj->projection = OXY; + else if (fabs(polygon->B) > fabs(polygon->C)) + tobj->projection = OXZ; + else + tobj->projection = OXY; + } + else { + GLdouble a[3], b[3]; + tess_vertex *vertex = polygon->vertices; + + a[0] = tobj->A; + a[1] = tobj->B; + a[2] = tobj->C; + b[0] = polygon->A; + b[1] = polygon->B; + b[2] = polygon->C; + + /* compare the normals */ + if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON || + fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON || + fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) { + /* not coplanar */ + tess_call_user_error(tobj, GLU_TESS_ERROR9); + return; + } + /* the normals are parallel - test for plane equation */ + if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] + + a[2] * vertex->location[2] + tobj->D) > EPSILON) { + /* not the same plane */ + tess_call_user_error(tobj, GLU_TESS_ERROR9); + return; + } + } + prepare_projection_info(tobj); + if (verify_edge_vertex_intersections(tobj) == GLU_ERROR) + return; + if (test_for_overlapping_contours(tobj) == GLU_ERROR) + return; + if (store_polygon_as_contour(tobj) == GLU_ERROR) + return; +} + +static GLenum +test_for_overlapping_contours(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + tess_polygon *polygon; + + polygon = tobj->current_polygon; + for (contour = tobj->contours; contour != NULL; contour = contour->next) + if (contours_overlap(contour, polygon) != GLU_NO_ERROR) { + tess_call_user_error(tobj, GLU_TESS_ERROR5); + return GLU_ERROR; + } + return GLU_NO_ERROR; +} + +static GLenum +store_polygon_as_contour(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_contour *contour = tobj->contours; + + /* the first contour defined */ + if (contour == NULL) { + if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + free_current_polygon(polygon); + return GLU_ERROR; + } + tobj->contours = tobj->last_contour = contour; + contour->next = contour->previous = NULL; + } + else { + if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + free_current_polygon(polygon); + return GLU_ERROR; + } + contour->previous = tobj->last_contour; + tobj->last_contour->next = contour; + tobj->last_contour = contour; + contour->next = NULL; + } + /* mark all vertices in new contour as not special */ + /* and all are boundary edges */ + { + tess_vertex *vertex; + GLuint vertex_cnt, i; + + for (vertex = polygon->vertices, i = 0, vertex_cnt = + polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) { + vertex->shadow_vertex = NULL; + vertex->edge_flag = GL_TRUE; + } + } + contour->vertex_cnt = polygon->vertex_cnt; + contour->area = polygon->area; + contour->orientation = polygon->orientation; + contour->type = GLU_UNKNOWN; + contour->vertices = polygon->vertices; + contour->last_vertex = polygon->last_vertex; + polygon->vertices = polygon->last_vertex = NULL; + polygon->vertex_cnt = 0; + ++(tobj->contour_cnt); + return GLU_NO_ERROR; +} + +static void +free_current_polygon(tess_polygon * polygon) +{ + tess_vertex *vertex, *vertex_tmp; + GLuint i; + + /* free current_polygon structures */ + for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + polygon->vertices = polygon->last_vertex = NULL; + polygon->vertex_cnt = 0; +} + +static void +prepare_projection_info(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *vertex, *last_vertex_ptr; + GLdouble area; + + last_vertex_ptr = polygon->last_vertex; + switch (tobj->projection) { + case OXY: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[0]; + vertex->y = vertex->location[1]; + } + last_vertex_ptr->x = last_vertex_ptr->location[0]; + last_vertex_ptr->y = last_vertex_ptr->location[1]; + break; + case OXZ: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[0]; + vertex->y = vertex->location[2]; + } + last_vertex_ptr->x = last_vertex_ptr->location[0]; + last_vertex_ptr->y = last_vertex_ptr->location[2]; + break; + case OYZ: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[1]; + vertex->y = vertex->location[2]; + } + last_vertex_ptr->x = last_vertex_ptr->location[1]; + last_vertex_ptr->y = last_vertex_ptr->location[2]; + break; + } + area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex); + if (area >= 0.0) { + polygon->orientation = GLU_CCW; + polygon->area = area; + } + else { + polygon->orientation = GLU_CW; + polygon->area = -area; + } +} + +static GLdouble +twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex) +{ + tess_vertex *next; + GLdouble area, x, y; + + area = 0.0; + x = vertex->x; + y = vertex->y; + vertex = vertex->next; + for (; vertex != last_vertex; vertex = vertex->next) { + next = vertex->next; + area += + (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x); + } + return area; +} + +/* test if edges ab and cd intersect */ +/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */ +/* else if adjacent return GLU_TESS_ERROR4 */ +static GLenum +edge_edge_intersect(tess_vertex * a, + tess_vertex * b, tess_vertex * c, tess_vertex * d) +{ + GLdouble denom, r, s; + GLdouble xba, ydc, yba, xdc, yac, xac; + + xba = b->x - a->x; + yba = b->y - a->y; + xdc = d->x - c->x; + ydc = d->y - c->y; + xac = a->x - c->x; + yac = a->y - c->y; + denom = xba * ydc - yba * xdc; + r = yac * xdc - xac * ydc; + /* parallel? */ + if (fabs(denom) < EPSILON) { + if (fabs(r) < EPSILON) { + /* colinear */ + if (fabs(xba) < EPSILON) { + /* compare the Y coordinate */ + if (yba > 0.0) { + if ( + (fabs(a->y - c->y) < EPSILON + && fabs(c->y - b->y) < EPSILON) + || (fabs(a->y - d->y) < EPSILON + && fabs(d->y - b->y) < + EPSILON)) return GLU_TESS_ERROR4; + + } + else { + if ( + (fabs(b->y - c->y) < EPSILON + && fabs(c->y - a->y) < EPSILON) + || (fabs(b->y - d->y) < EPSILON + && fabs(d->y - a->y) < + EPSILON)) return GLU_TESS_ERROR4; + } + } + else { + /* compare the X coordinate */ + if (xba > 0.0) { + if ( + (fabs(a->x - c->x) < EPSILON + && fabs(c->x - b->x) < EPSILON) + || (fabs(a->x - d->x) < EPSILON + && fabs(d->x - b->x) < + EPSILON)) return GLU_TESS_ERROR4; + } + else { + if ( + (fabs(b->x - c->x) < EPSILON + && fabs(c->x - a->x) < EPSILON) + || (fabs(b->x - d->x) < EPSILON + && fabs(d->x - a->x) < + EPSILON)) return GLU_TESS_ERROR4; + } + } + } + return GLU_NO_ERROR; + } + r /= denom; + s = (yac * xba - xac * yba) / denom; + /* test if one vertex lies on other edge */ + if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) && + s > -EPSILON && s < 1.0 + EPSILON) || + ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) && + r > -EPSILON && r < 1.0 + EPSILON)) { + return GLU_TESS_ERROR4; + } + /* test for crossing */ + if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) { + return GLU_TESS_ERROR8; + } + return GLU_NO_ERROR; +} + +static GLenum +verify_edge_vertex_intersections(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *vertex1, *last_vertex, *vertex2; + GLenum test; + + last_vertex = polygon->last_vertex; + vertex1 = last_vertex; + for (vertex2 = vertex1->next->next; + vertex2->next != last_vertex; vertex2 = vertex2->next) { + test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next); + if (test != GLU_NO_ERROR) { + tess_call_user_error(tobj, test); + return GLU_ERROR; + } + } + for (vertex1 = polygon->vertices; + vertex1->next->next != last_vertex; vertex1 = vertex1->next) { + for (vertex2 = vertex1->next->next; + vertex2 != last_vertex; vertex2 = vertex2->next) { + test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next); + if (test != GLU_NO_ERROR) { + tess_call_user_error(tobj, test); + return GLU_ERROR; + } + } + } + return GLU_NO_ERROR; +} + +static int +#ifdef WIN32 + __cdecl +#endif +area_compare(const void *a, const void *b) +{ + GLdouble area1, area2; + + area1 = (*((tess_contour **) a))->area; + area2 = (*((tess_contour **) b))->area; + if (area1 < area2) + return 1; + if (area1 > area2) + return -1; + return 0; +} + +void +tess_find_contour_hierarchies(GLUtriangulatorObj * tobj) +{ + tess_contour **contours; /* dinamic array of pointers */ + tess_contour *tmp_contour_ptr = tobj->contours; + GLuint cnt, i; + GLenum result; + GLboolean hierarchy_changed; + + /* any contours? */ + if (tobj->contour_cnt < 2) { + tobj->contours->type = GLU_EXTERIOR; + return; + } + if ((contours = (tess_contour **) + malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + for (tmp_contour_ptr = tobj->contours, cnt = 0; + tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) + contours[cnt++] = tmp_contour_ptr; + /* now sort the contours in decreasing area size order */ + qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *), + area_compare); + /* we leave just the first contour - remove others from list */ + tobj->contours = contours[0]; + tobj->contours->next = tobj->contours->previous = NULL; + tobj->last_contour = tobj->contours; + tobj->contour_cnt = 1; + /* first contour is the one with greatest area */ + /* must be EXTERIOR */ + tobj->contours->type = GLU_EXTERIOR; + tmp_contour_ptr = tobj->contours; + /* now we play! */ + for (i = 1; i < cnt; i++) { + hierarchy_changed = GL_FALSE; + for (tmp_contour_ptr = tobj->contours; + tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) { + if (tmp_contour_ptr->type == GLU_EXTERIOR) { + /* check if contour completely contained in EXTERIOR */ + result = is_contour_contained_in(tmp_contour_ptr, contours[i]); + switch (result) { + case GLU_INTERIOR: + /* now we have to check if contour is inside interiors */ + /* or not */ + /* any interiors? */ + if (tmp_contour_ptr->next != NULL && + tmp_contour_ptr->next->type == GLU_INTERIOR) { + /* for all interior, check if inside any of them */ + /* if not inside any of interiors, its another */ + /* interior */ + /* or it may contain some interiors, then change */ + /* the contained interiors to exterior ones */ + add_interior_with_hierarchy_check(tobj, + tmp_contour_ptr, + contours[i]); + } + else { + /* not in interior, add as new interior contour */ + add_new_interior(tobj, tmp_contour_ptr, contours[i]); + } + hierarchy_changed = GL_TRUE; + break; + case GLU_EXTERIOR: + /* ooops, the marked as EXTERIOR (contours[i]) is */ + /* actually an interior of tmp_contour_ptr */ + /* reverse the local hierarchy */ + reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr, + contours[i]); + hierarchy_changed = GL_TRUE; + break; + case GLU_NO_ERROR: + break; + default: + abort(); + } + } + if (hierarchy_changed) + break; /* break from for loop */ + } + if (hierarchy_changed == GL_FALSE) { + /* disjoint with all contours, add to contour list */ + add_new_exterior(tobj, contours[i]); + } + } + free(contours); +} + +/* returns GLU_INTERIOR if inner is completey enclosed within outer */ +/* returns GLU_EXTERIOR if outer is completely enclosed within inner */ +/* returns GLU_NO_ERROR if contours are disjoint */ +static GLenum +is_contour_contained_in(tess_contour * outer, tess_contour * inner) +{ + GLenum relation_flag; + + /* set relation_flag to relation of containment of first inner vertex */ + /* regarding outer contour */ + if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y)) + relation_flag = GLU_INTERIOR; + else + relation_flag = GLU_EXTERIOR; + if (relation_flag == GLU_INTERIOR) + return GLU_INTERIOR; + if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y)) + return GLU_EXTERIOR; + return GLU_NO_ERROR; +} + +static GLboolean +point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y) +{ + tess_vertex *v1, *v2; + GLuint i, vertex_cnt; + GLdouble xp1, yp1, xp2, yp2; + GLboolean tst; + + tst = GL_FALSE; + v1 = contour->vertices; + v2 = contour->vertices->previous; + for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) { + xp1 = v1->x; + yp1 = v1->y; + xp2 = v2->x; + yp2 = v2->y; + if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) && + (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1)) + tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE); + v2 = v1; + v1 = v1->next; + } + return tst; +} + +static GLenum +contours_overlap(tess_contour * contour, tess_polygon * polygon) +{ + tess_vertex *vertex1, *vertex2; + GLuint vertex1_cnt, vertex2_cnt, i, j; + GLenum test; + + vertex1 = contour->vertices; + vertex2 = polygon->vertices; + vertex1_cnt = contour->vertex_cnt; + vertex2_cnt = polygon->vertex_cnt; + for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) { + for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++) + if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next)) != GLU_NO_ERROR) + return test; + } + return GLU_NO_ERROR; +} + +static void +add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + contour->type = GLU_EXTERIOR; + contour->next = NULL; + contour->previous = tobj->last_contour; + tobj->last_contour->next = contour; + tobj->last_contour = contour; +} + +static void +add_new_interior(GLUtriangulatorObj * tobj, + tess_contour * outer, tess_contour * contour) +{ + contour->type = GLU_INTERIOR; + contour->next = outer->next; + contour->previous = outer; + if (outer->next != NULL) + outer->next->previous = contour; + outer->next = contour; + if (tobj->last_contour == outer) + tobj->last_contour = contour; +} + +static void +add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj, + tess_contour * outer, + tess_contour * contour) +{ + tess_contour *ptr; + + /* for all interiors of outer check if they are interior of contour */ + /* if so, change that interior to exterior and move it of of the */ + /* interior sequence */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { + GLenum test; + + for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; + ptr = ptr->next) { + test = is_contour_contained_in(ptr, contour); + switch (test) { + case GLU_INTERIOR: + /* contour is contained in one of the interiors */ + /* check if possibly contained in other exteriors */ + /* move ptr to first EXTERIOR */ + for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next); + if (ptr == NULL) + /* another exterior */ + add_new_exterior(tobj, contour); + else + add_exterior_with_check(tobj, ptr, contour); + return; + case GLU_EXTERIOR: + /* one of the interiors is contained in the contour */ + /* change it to EXTERIOR, and shift it away from the */ + /* interior sequence */ + shift_interior_to_exterior(tobj, ptr); + break; + case GLU_NO_ERROR: + /* disjoint */ + break; + default: + abort(); + } + } + } + /* add contour to the interior sequence */ + add_new_interior(tobj, outer, contour); +} + +static void +reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj, + tess_contour * outer, + tess_contour * contour) +{ + tess_contour *ptr; + + /* reverse INTERIORS to EXTERIORS */ + /* any INTERIORS? */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) + for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; + ptr = ptr->next) ptr->type = GLU_EXTERIOR; + /* the outer now becomes inner */ + outer->type = GLU_INTERIOR; + /* contour is the EXTERIOR */ + contour->next = outer; + if (tobj->contours == outer) { + /* first contour beeing reversed */ + contour->previous = NULL; + tobj->contours = contour; + } + else { + outer->previous->next = contour; + contour->previous = outer->previous; + } + outer->previous = contour; +} + +static void +shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + contour->previous->next = contour->next; + if (contour->next != NULL) + contour->next->previous = contour->previous; + else + tobj->last_contour = contour->previous; +} + +static void +add_exterior_with_check(GLUtriangulatorObj * tobj, + tess_contour * outer, tess_contour * contour) +{ + GLenum test; + + /* this contour might be interior to further exteriors - check */ + /* if not, just add as a new exterior */ + for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) { + test = is_contour_contained_in(outer, contour); + switch (test) { + case GLU_INTERIOR: + /* now we have to check if contour is inside interiors */ + /* or not */ + /* any interiors? */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { + /* for all interior, check if inside any of them */ + /* if not inside any of interiors, its another */ + /* interior */ + /* or it may contain some interiors, then change */ + /* the contained interiors to exterior ones */ + add_interior_with_hierarchy_check(tobj, outer, contour); + } + else { + /* not in interior, add as new interior contour */ + add_new_interior(tobj, outer, contour); + } + return; + case GLU_NO_ERROR: + /* disjoint */ + break; + default: + abort(); + } + } + /* add contour to the exterior sequence */ + add_new_exterior(tobj, contour); +} + +void +tess_handle_holes(GLUtriangulatorObj * tobj) +{ + tess_contour *contour, *hole; + GLenum exterior_orientation; + + /* verify hole orientation */ + for (contour = tobj->contours; contour != NULL;) { + exterior_orientation = contour->orientation; + for (contour = contour->next; + contour != NULL && contour->type == GLU_INTERIOR; + contour = contour->next) { + if (contour->orientation == exterior_orientation) { + tess_call_user_error(tobj, GLU_TESS_ERROR5); + return; + } + } + } + /* now cut-out holes */ + for (contour = tobj->contours; contour != NULL;) { + hole = contour->next; + while (hole != NULL && hole->type == GLU_INTERIOR) { + if (cut_out_hole(tobj, contour, hole) == GLU_ERROR) + return; + hole = contour->next; + } + contour = contour->next; + } +} + +static GLenum +cut_out_hole(GLUtriangulatorObj * tobj, + tess_contour * contour, tess_contour * hole) +{ + tess_contour *tmp_hole; + tess_vertex *v1, *v2, *tmp_vertex; + GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt; + GLuint i, j, k; + GLenum test = 0; + + /* find an edge connecting contour and hole not intersecting any other */ + /* edge belonging to either the contour or any of the other holes */ + for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0; + i < vertex1_cnt; i++, v1 = v1->next) { + for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0; + j < vertex2_cnt; j++, v2 = v2->next) { + /* does edge (v1,v2) intersect any edge of contour */ + for (tmp_vertex = contour->vertices, tmp_vertex_cnt = + contour->vertex_cnt, k = 0; k < tmp_vertex_cnt; + tmp_vertex = tmp_vertex->next, k++) { + /* skip edge tests for edges directly connected */ + if (v1 == tmp_vertex || v1 == tmp_vertex->next) + continue; + test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test == GLU_NO_ERROR) { + /* does edge (v1,v2) intersect any edge of hole */ + for (tmp_vertex = hole->vertices, + tmp_vertex_cnt = hole->vertex_cnt, k = 0; + k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { + /* skip edge tests for edges directly connected */ + if (v2 == tmp_vertex || v2 == tmp_vertex->next) + continue; + test = + edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test == GLU_NO_ERROR) { + /* does edge (v1,v2) intersect any other hole? */ + for (tmp_hole = hole->next; + tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; + tmp_hole = tmp_hole->next) { + /* does edge (v1,v2) intersect any edge of hole */ + for (tmp_vertex = tmp_hole->vertices, + tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0; + k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { + test = edge_edge_intersect(v1, v2, tmp_vertex, + tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test != GLU_NO_ERROR) + break; + } + } + } + if (test == GLU_NO_ERROR) { + /* edge (v1,v2) is good for eliminating the hole */ + if (merge_hole_with_contour(tobj, contour, hole, v1, v2) + == GLU_NO_ERROR) + return GLU_NO_ERROR; + else + return GLU_ERROR; + } + } + } + /* other holes are blocking all possible connections of hole */ + /* with contour, we shift this hole as the last hole and retry */ + for (tmp_hole = hole; + tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; + tmp_hole = tmp_hole->next); + contour->next = hole->next; + hole->next->previous = contour; + if (tmp_hole == NULL) { + /* last EXTERIOR contour, shift hole as last contour */ + hole->next = NULL; + hole->previous = tobj->last_contour; + tobj->last_contour->next = hole; + tobj->last_contour = hole; + } + else { + tmp_hole->previous->next = hole; + hole->previous = tmp_hole->previous; + tmp_hole->previous = hole; + hole->next = tmp_hole; + } + hole = contour->next; + /* try once again - recurse */ + return cut_out_hole(tobj, contour, hole); +} + +static GLenum +merge_hole_with_contour(GLUtriangulatorObj * tobj, + tess_contour * contour, + tess_contour * hole, + tess_vertex * v1, tess_vertex * v2) +{ + tess_vertex *v1_new, *v2_new; + + /* make copies of v1 and v2, place them respectively after their originals */ + if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + v1_new->edge_flag = GL_TRUE; + v1_new->data = v1->data; + v1_new->location[0] = v1->location[0]; + v1_new->location[1] = v1->location[1]; + v1_new->location[2] = v1->location[2]; + v1_new->x = v1->x; + v1_new->y = v1->y; + v1_new->shadow_vertex = v1; + v1->shadow_vertex = v1_new; + v1_new->next = v1->next; + v1_new->previous = v1; + v1->next->previous = v1_new; + v1->next = v1_new; + v2_new->edge_flag = GL_TRUE; + v2_new->data = v2->data; + v2_new->location[0] = v2->location[0]; + v2_new->location[1] = v2->location[1]; + v2_new->location[2] = v2->location[2]; + v2_new->x = v2->x; + v2_new->y = v2->y; + v2_new->shadow_vertex = v2; + v2->shadow_vertex = v2_new; + v2_new->next = v2->next; + v2_new->previous = v2; + v2->next->previous = v2_new; + v2->next = v2_new; + /* link together the two lists */ + v1->next = v2_new; + v2_new->previous = v1; + v2->next = v1_new; + v1_new->previous = v2; + /* update the vertex count of the contour */ + contour->vertex_cnt += hole->vertex_cnt + 2; + /* remove the INTERIOR contour */ + contour->next = hole->next; + if (hole->next != NULL) + hole->next->previous = contour; + free(hole); + /* update tobj structure */ + --(tobj->contour_cnt); + if (contour->last_vertex == v1) + contour->last_vertex = v1_new; + /* mark two vertices with edge_flag */ + v2->edge_flag = GL_FALSE; + v1->edge_flag = GL_FALSE; + return GLU_NO_ERROR; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/project.c xpsb-glx-0.19/mesa/src/glu/mini/project.c --- xpsb-glx-0.19/mesa/src/glu/mini/project.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/project.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,403 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include "gluP.h" +#endif + + +/* + * This code was contributed by Marc Buffat (buffat@mecaflu.ec-lyon.fr). + * Thanks Marc!!! + */ + + + +/* implementation de gluProject et gluUnproject */ +/* M. Buffat 17/2/95 */ + + + +/* + * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in + * Input: m - the 4x4 matrix + * in - the 4x1 vector + * Output: out - the resulting 4x1 vector. + */ +static void +transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) +{ +#define M(row,col) m[col*4+row] + out[0] = + M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; + out[1] = + M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3]; + out[2] = + M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3]; + out[3] = + M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; +#undef M +} + + + + +/* + * Perform a 4x4 matrix multiplication (product = a x b). + * Input: a, b - matrices to multiply + * Output: product - product of a and b + */ +static void +matmul(GLdouble * product, const GLdouble * a, const GLdouble * b) +{ + /* This matmul was contributed by Thomas Malik */ + GLdouble temp[16]; + GLint i; + +#define A(row,col) a[(col<<2)+row] +#define B(row,col) b[(col<<2)+row] +#define T(row,col) temp[(col<<2)+row] + + /* i-te Zeile */ + for (i = 0; i < 4; i++) { + T(i, 0) = + A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, + 3) * + B(3, 0); + T(i, 1) = + A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, + 3) * + B(3, 1); + T(i, 2) = + A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, + 3) * + B(3, 2); + T(i, 3) = + A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, + 3) * + B(3, 3); + } + +#undef A +#undef B +#undef T + MEMCPY(product, temp, 16 * sizeof(GLdouble)); +} + + + +/* + * Compute inverse of 4x4 transformation matrix. + * Code contributed by Jacques Leroy jle@star.be + * Return GL_TRUE for success, GL_FALSE for failure (singular matrix) + */ +static GLboolean +invert_matrix(const GLdouble * m, GLdouble * out) +{ +/* NB. OpenGL Matrices are COLUMN major. */ +#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; } +#define MAT(m,r,c) (m)[(c)*4+(r)] + + GLdouble wtmp[4][8]; + GLdouble m0, m1, m2, m3, s; + GLdouble *r0, *r1, *r2, *r3; + + r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; + + r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1), + r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3), + r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, + r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1), + r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3), + r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, + r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1), + r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3), + r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, + r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1), + r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3), + r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; + + /* choose pivot - or die */ + if (fabs(r3[0]) > fabs(r2[0])) + SWAP_ROWS(r3, r2); + if (fabs(r2[0]) > fabs(r1[0])) + SWAP_ROWS(r2, r1); + if (fabs(r1[0]) > fabs(r0[0])) + SWAP_ROWS(r1, r0); + if (0.0 == r0[0]) + return GL_FALSE; + + /* eliminate first variable */ + m1 = r1[0] / r0[0]; + m2 = r2[0] / r0[0]; + m3 = r3[0] / r0[0]; + s = r0[1]; + r1[1] -= m1 * s; + r2[1] -= m2 * s; + r3[1] -= m3 * s; + s = r0[2]; + r1[2] -= m1 * s; + r2[2] -= m2 * s; + r3[2] -= m3 * s; + s = r0[3]; + r1[3] -= m1 * s; + r2[3] -= m2 * s; + r3[3] -= m3 * s; + s = r0[4]; + if (s != 0.0) { + r1[4] -= m1 * s; + r2[4] -= m2 * s; + r3[4] -= m3 * s; + } + s = r0[5]; + if (s != 0.0) { + r1[5] -= m1 * s; + r2[5] -= m2 * s; + r3[5] -= m3 * s; + } + s = r0[6]; + if (s != 0.0) { + r1[6] -= m1 * s; + r2[6] -= m2 * s; + r3[6] -= m3 * s; + } + s = r0[7]; + if (s != 0.0) { + r1[7] -= m1 * s; + r2[7] -= m2 * s; + r3[7] -= m3 * s; + } + + /* choose pivot - or die */ + if (fabs(r3[1]) > fabs(r2[1])) + SWAP_ROWS(r3, r2); + if (fabs(r2[1]) > fabs(r1[1])) + SWAP_ROWS(r2, r1); + if (0.0 == r1[1]) + return GL_FALSE; + + /* eliminate second variable */ + m2 = r2[1] / r1[1]; + m3 = r3[1] / r1[1]; + r2[2] -= m2 * r1[2]; + r3[2] -= m3 * r1[2]; + r2[3] -= m2 * r1[3]; + r3[3] -= m3 * r1[3]; + s = r1[4]; + if (0.0 != s) { + r2[4] -= m2 * s; + r3[4] -= m3 * s; + } + s = r1[5]; + if (0.0 != s) { + r2[5] -= m2 * s; + r3[5] -= m3 * s; + } + s = r1[6]; + if (0.0 != s) { + r2[6] -= m2 * s; + r3[6] -= m3 * s; + } + s = r1[7]; + if (0.0 != s) { + r2[7] -= m2 * s; + r3[7] -= m3 * s; + } + + /* choose pivot - or die */ + if (fabs(r3[2]) > fabs(r2[2])) + SWAP_ROWS(r3, r2); + if (0.0 == r2[2]) + return GL_FALSE; + + /* eliminate third variable */ + m3 = r3[2] / r2[2]; + r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], + r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7]; + + /* last check */ + if (0.0 == r3[3]) + return GL_FALSE; + + s = 1.0 / r3[3]; /* now back substitute row 3 */ + r3[4] *= s; + r3[5] *= s; + r3[6] *= s; + r3[7] *= s; + + m2 = r2[3]; /* now back substitute row 2 */ + s = 1.0 / r2[2]; + r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), + r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); + m1 = r1[3]; + r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, + r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; + m0 = r0[3]; + r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, + r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; + + m1 = r1[2]; /* now back substitute row 1 */ + s = 1.0 / r1[1]; + r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), + r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); + m0 = r0[2]; + r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, + r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; + + m0 = r0[1]; /* now back substitute row 0 */ + s = 1.0 / r0[0]; + r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), + r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); + + MAT(out, 0, 0) = r0[4]; + MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6]; + MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4]; + MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6]; + MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4]; + MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6]; + MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4]; + MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6]; + MAT(out, 3, 3) = r3[7]; + + return GL_TRUE; + +#undef MAT +#undef SWAP_ROWS +} + + + +/* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */ +GLint GLAPIENTRY +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble model[16], const GLdouble proj[16], + const GLint viewport[4], + GLdouble * winx, GLdouble * winy, GLdouble * winz) +{ + /* matrice de transformation */ + GLdouble in[4], out[4]; + + /* initilise la matrice et le vecteur a transformer */ + in[0] = objx; + in[1] = objy; + in[2] = objz; + in[3] = 1.0; + transform_point(out, model, in); + transform_point(in, proj, out); + + /* d'ou le resultat normalise entre -1 et 1 */ + if (in[3] == 0.0) + return GL_FALSE; + + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + + /* en coordonnees ecran */ + *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2; + *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2; + /* entre 0 et 1 suivant z */ + *winz = (1 + in[2]) / 2; + return GL_TRUE; +} + + + +/* transformation du point ecran (winx,winy,winz) en point objet */ +GLint GLAPIENTRY +gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, + const GLdouble model[16], const GLdouble proj[16], + const GLint viewport[4], + GLdouble * objx, GLdouble * objy, GLdouble * objz) +{ + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4], out[4]; + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; + in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; + in[2] = 2 * winz - 1.0; + in[3] = 1.0; + + /* calcul transformation inverse */ + matmul(A, proj, model); + if (!invert_matrix(A, m)) + return GL_FALSE; + + /* d'ou les coordonnees objets */ + transform_point(out, m, in); + if (out[3] == 0.0) + return GL_FALSE; + *objx = out[0] / out[3]; + *objy = out[1] / out[3]; + *objz = out[2] / out[3]; + return GL_TRUE; +} + + +/* + * New in GLU 1.3 + * This is like gluUnProject but also takes near and far DepthRange values. + */ +#ifdef GLU_VERSION_1_3 +GLint GLAPIENTRY +gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLclampd nearZ, GLclampd farZ, + GLdouble * objx, GLdouble * objy, GLdouble * objz, + GLdouble * objw) +{ + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4], out[4]; + GLdouble z = nearZ + winz * (farZ - nearZ); + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; + in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; + in[2] = 2.0 * z - 1.0; + in[3] = clipw; + + /* calcul transformation inverse */ + matmul(A, projMatrix, modelMatrix); + if (!invert_matrix(A, m)) + return GL_FALSE; + + /* d'ou les coordonnees objets */ + transform_point(out, m, in); + if (out[3] == 0.0) + return GL_FALSE; + *objx = out[0] / out[3]; + *objy = out[1] / out[3]; + *objz = out[2] / out[3]; + *objw = out[3]; + return GL_TRUE; +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/quadric.c xpsb-glx-0.19/mesa/src/glu/mini/quadric.c --- xpsb-glx-0.19/mesa/src/glu/mini/quadric.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/quadric.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,773 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1999-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* TODO: + * texture coordinate support + * flip normals according to orientation + * there's still some inside/outside orientation bugs in possibly all + * but the sphere function + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include +#include "gluP.h" +#endif + + + +#ifndef M_PI +# define M_PI (3.1415926) +#endif + + +/* + * Convert degrees to radians: + */ +#define DEG_TO_RAD(A) ((A)*(M_PI/180.0)) + + +/* + * Sin and Cos for degree angles: + */ +#define SIND( A ) sin( (A)*(M_PI/180.0) ) +#define COSD( A) cos( (A)*(M_PI/180.0) ) + + +/* + * Texture coordinates if texture flag is set + */ +#define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y); + + + +struct GLUquadric +{ + GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */ + GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ + GLboolean TextureFlag; /* Generate texture coords? */ + GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ + void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */ +}; + + + +/* + * Process a GLU error. + */ +static void +quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg) +{ + /* Call the error call back function if any */ + if (qobj->ErrorFunc) { + (*qobj->ErrorFunc) (error); + } + /* Print a message to stdout if MESA_DEBUG variable is defined */ + if (getenv("MESA_DEBUG")) { + fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error), + msg); + } +} + + + + +GLUquadricObj *GLAPIENTRY +gluNewQuadric(void) +{ + GLUquadricObj *q; + + q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric)); + if (q) { + q->DrawStyle = GLU_FILL; + q->Orientation = GLU_OUTSIDE; + q->TextureFlag = GL_FALSE; + q->Normals = GLU_SMOOTH; + q->ErrorFunc = NULL; + } + return q; +} + + + +void GLAPIENTRY +gluDeleteQuadric(GLUquadricObj * state) +{ + if (state) { + free((void *) state); + } +} + + + +/* + * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE, + * or GLU_POINT. + */ +void GLAPIENTRY +gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle) +{ + if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE + || drawStyle == GLU_SILHOUETTE + || drawStyle == GLU_POINT)) { + quadObject->DrawStyle = drawStyle; + } + else { + quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle"); + } +} + + + +/* + * Set the orientation to GLU_INSIDE or GLU_OUTSIDE. + */ +void GLAPIENTRY +gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation) +{ + if (quadObject + && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) { + quadObject->Orientation = orientation; + } + else { + quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation"); + } +} + + + +/* + * Set the error handler callback function. + */ +void GLAPIENTRY +gluQuadricCallback(GLUquadricObj * qobj, + GLenum which, void (GLCALLBACK * fn) ()) +{ + /* + * UGH, this is a mess! I thought ANSI was a standard. + */ + if (qobj && which == GLU_ERROR) { +#ifdef __CYGWIN32__ + qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn; +#elif defined(OPENSTEP) + qobj->ErrorFunc = (void (*)(GLenum)) fn; +#elif defined(_WIN32) + qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn; +#elif defined(__STORM__) + qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn; +#elif defined(__BEOS__) + qobj->ErrorFunc = (void (*)(GLenum)) fn; +#else + qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn; +#endif + } +} + + +void GLAPIENTRY +gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals) +{ + if (quadObject + && (normals == GLU_NONE || normals == GLU_FLAT + || normals == GLU_SMOOTH)) { + quadObject->Normals = normals; + } +} + + +void GLAPIENTRY +gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords) +{ + if (quadObject) { + quadObject->TextureFlag = textureCoords; + } +} + + + + +/* + * Call glNormal3f after scaling normal to unit length. + */ +static void +normal3f(GLfloat x, GLfloat y, GLfloat z) +{ +} + + + +void GLAPIENTRY +gluCylinder(GLUquadricObj * qobj, + GLdouble baseRadius, GLdouble topRadius, + GLdouble height, GLint slices, GLint stacks) +{ + GLdouble da, r, dr, dz; + GLfloat x, y, z, nz, nsign; + GLint i, j; + + if (qobj->Orientation == GLU_INSIDE) { + nsign = -1.0; + } + else { + nsign = 1.0; + } + + da = 2.0 * M_PI / slices; + dr = (topRadius - baseRadius) / stacks; + dz = height / stacks; + nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */ + + if (qobj->DrawStyle == GLU_POINT) { + glBegin(GL_POINTS); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + + z = 0.0; + r = baseRadius; + for (j = 0; j <= stacks; j++) { + glVertex3f(x * r, y * r, z); + z += dz; + r += dr; + } + } + glEnd(); + } + else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { + /* Draw rings */ + if (qobj->DrawStyle == GLU_LINE) { + z = 0.0; + r = baseRadius; + for (j = 0; j <= stacks; j++) { + glBegin(GL_LINE_LOOP); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * r, y * r, z); + } + glEnd(); + z += dz; + r += dr; + } + } + else { + /* draw one ring at each end */ + if (baseRadius != 0.0) { + glBegin(GL_LINE_LOOP); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * baseRadius, y * baseRadius, 0.0); + } + glEnd(); + glBegin(GL_LINE_LOOP); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * topRadius, y * topRadius, height); + } + glEnd(); + } + } + /* draw length lines */ + glBegin(GL_LINES); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); + glVertex3f(x * baseRadius, y * baseRadius, 0.0); + glVertex3f(x * topRadius, y * topRadius, height); + } + glEnd(); + } + else if (qobj->DrawStyle == GLU_FILL) { + GLfloat ds = 1.0 / slices; + GLfloat dt = 1.0 / stacks; + GLfloat t = 0.0; + z = 0.0; + r = baseRadius; + for (j = 0; j < stacks; j++) { + GLfloat s = 0.0; + glBegin(GL_QUAD_STRIP); + for (i = 0; i <= slices; i++) { + GLfloat x, y; + if (i == slices) { + x = sin(0.0); + y = cos(0.0); + } + else { + x = sin(i * da); + y = cos(i * da); + } + if (nsign == 1.0) { + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t); + glVertex3f(x * r, y * r, z); + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t + dt); + glVertex3f(x * (r + dr), y * (r + dr), z + dz); + } + else { + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t); + glVertex3f(x * r, y * r, z); + normal3f(x * nsign, y * nsign, nz * nsign); + TXTR_COORD(s, t + dt); + glVertex3f(x * (r + dr), y * (r + dr), z + dz); + } + s += ds; + } /* for slices */ + glEnd(); + r += dr; + t += dt; + z += dz; + } /* for stacks */ + } +} + + + + + +void GLAPIENTRY +gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks) +{ + GLfloat rho, drho, theta, dtheta; + GLfloat x, y, z; + GLfloat s, t, ds, dt; + GLint i, j, imin, imax; + GLboolean normals; + GLfloat nsign; + + if (qobj->Normals == GLU_NONE) { + normals = GL_FALSE; + } + else { + normals = GL_TRUE; + } + if (qobj->Orientation == GLU_INSIDE) { + nsign = -1.0; + } + else { + nsign = 1.0; + } + + drho = M_PI / (GLfloat) stacks; + dtheta = 2.0 * M_PI / (GLfloat) slices; + + /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */ + /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */ + /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */ + + if (qobj->DrawStyle == GLU_FILL) { + if (!qobj->TextureFlag) { + /* draw +Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); +/* glNormal3f(0.0, 0.0, 1.0); */ + glVertex3f(0.0, 0.0, nsign * radius); + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(drho); + y = cos(theta) * sin(drho); + z = nsign * cos(drho); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + + ds = 1.0 / slices; + dt = 1.0 / stacks; + t = 1.0; /* because loop now runs from 0 */ + if (qobj->TextureFlag) { + imin = 0; + imax = stacks; + } + else { + imin = 1; + imax = stacks - 1; + } + + /* draw intermediate stacks as quad strips */ + for (i = imin; i < imax; i++) { + rho = i * drho; + glBegin(GL_QUAD_STRIP); + s = 0.0; + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho); + y = cos(theta) * sin(rho); + z = nsign * cos(rho); + TXTR_COORD(s, t); + glVertex3f(x * radius, y * radius, z * radius); + x = -sin(theta) * sin(rho + drho); + y = cos(theta) * sin(rho + drho); + z = nsign * cos(rho + drho); + TXTR_COORD(s, t - dt); + s += ds; + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + t -= dt; + } + + if (!qobj->TextureFlag) { + /* draw -Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glVertex3f(0.0, 0.0, -radius * nsign); + rho = M_PI - drho; + s = 1.0; + t = dt; + for (j = slices; j >= 0; j--) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho); + y = cos(theta) * sin(rho); + z = nsign * cos(rho); + s -= ds; + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + } + else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { + /* draw stack lines */ + for (i = 1; i < stacks; i++) { /* stack line at i==stacks-1 was missing here */ + rho = i * drho; + glBegin(GL_LINE_LOOP); + for (j = 0; j < slices; j++) { + theta = j * dtheta; + x = cos(theta) * sin(rho); + y = sin(theta) * sin(rho); + z = cos(rho); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + /* draw slice lines */ + for (j = 0; j < slices; j++) { + theta = j * dtheta; + glBegin(GL_LINE_STRIP); + for (i = 0; i <= stacks; i++) { + rho = i * drho; + x = cos(theta) * sin(rho); + y = sin(theta) * sin(rho); + z = cos(rho); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); + } + } + else if (qobj->DrawStyle == GLU_POINT) { + /* top and bottom-most points */ + glBegin(GL_POINTS); + glVertex3f(0.0, 0.0, radius); + glVertex3f(0.0, 0.0, -radius); + + /* loop over stacks */ + for (i = 1; i < stacks - 1; i++) { + rho = i * drho; + for (j = 0; j < slices; j++) { + theta = j * dtheta; + x = cos(theta) * sin(rho); + y = sin(theta) * sin(rho); + z = cos(rho); + glVertex3f(x * radius, y * radius, z * radius); + } + } + glEnd(); + } + +} + + + +void GLAPIENTRY +gluDisk(GLUquadricObj * qobj, + GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops) +{ + GLfloat da, dr; +#if 0 + GLdouble a, da; + GLfloat r, dr; + GLfloat x, y; + GLfloat r1, r2, dtc; + GLint s, l; +#endif + + + da = 2.0 * M_PI / slices; + dr = (outerRadius - innerRadius) / (GLfloat) loops; + + switch (qobj->DrawStyle) { + case GLU_FILL: + { + /* texture of a gluDisk is a cut out of the texture unit square + * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1] + * (linear mapping) + */ + GLfloat dtc = 2.0f * outerRadius; + GLfloat sa, ca; + GLfloat r1 = innerRadius; + GLint l; + for (l = 0; l < loops; l++) { + GLfloat r2 = r1 + dr; + if (qobj->Orientation == GLU_OUTSIDE) { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = 0; s <= slices; s++) { + GLfloat a; + if (s == slices) + a = 0.0; + else + a = s * da; + sa = sin(a); + ca = cos(a); + TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc); + glVertex2f(r2 * sa, r2 * ca); + TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc); + glVertex2f(r1 * sa, r1 * ca); + } + glEnd(); + } + else { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = slices; s >= 0; s--) { + GLfloat a; + if (s == slices) + a = 0.0; + else + a = s * da; + sa = sin(a); + ca = cos(a); + TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc); + glVertex2f(r2 * sa, r2 * ca); + TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc); + glVertex2f(r1 * sa, r1 * ca); + } + glEnd(); + } + r1 = r2; + } + break; + } + case GLU_LINE: + { + GLint l, s; + /* draw loops */ + for (l = 0; l <= loops; l++) { + GLfloat r = innerRadius + l * dr; + glBegin(GL_LINE_LOOP); + for (s = 0; s < slices; s++) { + GLfloat a = s * da; + glVertex2f(r * sin(a), r * cos(a)); + } + glEnd(); + } + /* draw spokes */ + for (s = 0; s < slices; s++) { + GLfloat a = s * da; + GLfloat x = sin(a); + GLfloat y = cos(a); + glBegin(GL_LINE_STRIP); + for (l = 0; l <= loops; l++) { + GLfloat r = innerRadius + l * dr; + glVertex2f(r * x, r * y); + } + glEnd(); + } + break; + } + case GLU_POINT: + { + GLint s; + glBegin(GL_POINTS); + for (s = 0; s < slices; s++) { + GLfloat a = s * da; + GLfloat x = sin(a); + GLfloat y = cos(a); + GLint l; + for (l = 0; l <= loops; l++) { + GLfloat r = innerRadius * l * dr; + glVertex2f(r * x, r * y); + } + } + glEnd(); + break; + } + case GLU_SILHOUETTE: + { + if (innerRadius != 0.0) { + GLfloat a; + glBegin(GL_LINE_LOOP); + for (a = 0.0; a < 2.0 * M_PI; a += da) { + GLfloat x = innerRadius * sin(a); + GLfloat y = innerRadius * cos(a); + glVertex2f(x, y); + } + glEnd(); + } + { + GLfloat a; + glBegin(GL_LINE_LOOP); + for (a = 0; a < 2.0 * M_PI; a += da) { + GLfloat x = outerRadius * sin(a); + GLfloat y = outerRadius * cos(a); + glVertex2f(x, y); + } + glEnd(); + } + break; + } + default: + abort(); + } +} + + + +void GLAPIENTRY +gluPartialDisk(GLUquadricObj * qobj, GLdouble innerRadius, + GLdouble outerRadius, GLint slices, GLint loops, + GLdouble startAngle, GLdouble sweepAngle) +{ + if (qobj->DrawStyle == GLU_POINT) { + GLint loop, slice; + GLdouble radius, delta_radius; + GLdouble angle, delta_angle; + delta_radius = (outerRadius - innerRadius) / (loops - 1); + delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1)); + glBegin(GL_POINTS); + radius = innerRadius; + for (loop = 0; loop < loops; loop++) { + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice < slices; slice++) { + glVertex2f(radius * sin(angle), radius * cos(angle)); + angle += delta_angle; + } + radius += delta_radius; + } + glEnd(); + } + else if (qobj->DrawStyle == GLU_LINE) { + GLint loop, slice; + GLdouble radius, delta_radius; + GLdouble angle, delta_angle; + delta_radius = (outerRadius - innerRadius) / loops; + delta_angle = DEG_TO_RAD(sweepAngle / slices); + /* draw rings */ + radius = innerRadius; + for (loop = 0; loop < loops; loop++) { + angle = DEG_TO_RAD(startAngle); + glBegin(GL_LINE_STRIP); + for (slice = 0; slice <= slices; slice++) { + glVertex2f(radius * sin(angle), radius * cos(angle)); + angle += delta_angle; + } + glEnd(); + radius += delta_radius; + } + /* draw spokes */ + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice <= slices; slice++) { + radius = innerRadius; + glBegin(GL_LINE_STRIP); + for (loop = 0; loop < loops; loop++) { + glVertex2f(radius * sin(angle), radius * cos(angle)); + radius += delta_radius; + } + glEnd(); + angle += delta_angle; + } + } + else if (qobj->DrawStyle == GLU_SILHOUETTE) { + GLint slice; + GLdouble angle, delta_angle; + delta_angle = DEG_TO_RAD(sweepAngle / slices); + /* draw outer ring */ + glBegin(GL_LINE_STRIP); + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice <= slices; slice++) { + glVertex2f(outerRadius * sin(angle), outerRadius * cos(angle)); + angle += delta_angle; + } + glEnd(); + /* draw inner ring */ + if (innerRadius > 0.0) { + glBegin(GL_LINE_STRIP); + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice < slices; slice++) { + glVertex2f(innerRadius * sin(angle), innerRadius * cos(angle)); + angle += delta_angle; + } + glEnd(); + } + /* draw spokes */ + if (sweepAngle < 360.0) { + GLdouble stopAngle = startAngle + sweepAngle; + glBegin(GL_LINES); + glVertex2f(innerRadius * SIND(startAngle), + innerRadius * COSD(startAngle)); + glVertex2f(outerRadius * SIND(startAngle), + outerRadius * COSD(startAngle)); + glVertex2f(innerRadius * SIND(stopAngle), + innerRadius * COSD(stopAngle)); + glVertex2f(outerRadius * SIND(stopAngle), + outerRadius * COSD(stopAngle)); + glEnd(); + } + } + else if (qobj->DrawStyle == GLU_FILL) { + GLint loop, slice; + GLdouble radius, delta_radius; + GLdouble angle, delta_angle; + delta_radius = (outerRadius - innerRadius) / loops; + delta_angle = DEG_TO_RAD(sweepAngle / slices); + radius = innerRadius; + for (loop = 0; loop < loops; loop++) { + glBegin(GL_QUAD_STRIP); + angle = DEG_TO_RAD(startAngle); + for (slice = 0; slice <= slices; slice++) { + if (qobj->Orientation == GLU_OUTSIDE) { + glVertex2f((radius + delta_radius) * sin(angle), + (radius + delta_radius) * cos(angle)); + glVertex2f(radius * sin(angle), radius * cos(angle)); + } + else { + glVertex2f(radius * sin(angle), radius * cos(angle)); + glVertex2f((radius + delta_radius) * sin(angle), + (radius + delta_radius) * cos(angle)); + } + angle += delta_angle; + } + glEnd(); + radius += delta_radius; + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/tess.c xpsb-glx-0.19/mesa/src/glu/mini/tess.c --- xpsb-glx-0.19/mesa/src/glu/mini/tess.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/tess.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,327 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "tess.h" +#endif + + +/* + * This is ugly, but seems the easiest way to do things to make the + * code work under YellowBox for Windows + */ +#if defined(OPENSTEP) && defined(CALLBACK) +#undef CALLBACK +#define CALLBACK +#endif + + +static void delete_contours(GLUtriangulatorObj *); + +#ifdef __CYGWIN32__ +#define _CALLBACK +#else +#define _CALLBACK GLCALLBACK +#endif + + +static void +init_callbacks(tess_callbacks * callbacks) +{ + callbacks->begin = (void (_CALLBACK *) (GLenum)) 0; + callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0; + callbacks->vertex = (void (_CALLBACK *) (void *)) 0; + callbacks->end = (void (_CALLBACK *) (void)) 0; + callbacks->error = (void (_CALLBACK *) (GLenum)) 0; +} + +void +tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr) +{ + if (tobj->error == GLU_NO_ERROR) + tobj->error = gluerr; + if (tobj->callbacks.error != NULL) + (tobj->callbacks.error) (gluerr); +} + +GLUtriangulatorObj *GLAPIENTRY +gluNewTess(void) +{ + GLUtriangulatorObj *tobj; + + if ((tobj = (GLUtriangulatorObj *) + malloc(sizeof(struct GLUtesselator))) == NULL) + return NULL; + tobj->contours = tobj->last_contour = NULL; + init_callbacks(&tobj->callbacks); + tobj->error = GLU_NO_ERROR; + tobj->current_polygon = NULL; + tobj->contour_cnt = 0; + return tobj; +} + + +void GLAPIENTRY +gluTessCallback(GLUtriangulatorObj * tobj, GLenum which, + void (GLCALLBACK * fn) ()) +{ + switch (which) { + case GLU_BEGIN: + tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn; + break; + case GLU_EDGE_FLAG: + tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn; + break; + case GLU_VERTEX: + tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn; + break; + case GLU_END: + tobj->callbacks.end = (void (_CALLBACK *) (void)) fn; + break; + case GLU_ERROR: + tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn; + break; + default: + tobj->error = GLU_INVALID_ENUM; + break; + } +} + + + +void GLAPIENTRY +gluDeleteTess(GLUtriangulatorObj * tobj) +{ + if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt) + /* was gluEndPolygon called? */ + tess_call_user_error(tobj, GLU_TESS_ERROR1); + /* delete all internal structures */ + delete_contours(tobj); + free(tobj); +} + + +void GLAPIENTRY +gluBeginPolygon(GLUtriangulatorObj * tobj) +{ +/* + if(tobj->error!=GLU_NO_ERROR) + return; +*/ + tobj->error = GLU_NO_ERROR; + if (tobj->current_polygon != NULL) { + /* gluEndPolygon was not called */ + tess_call_user_error(tobj, GLU_TESS_ERROR1); + /* delete all internal structures */ + delete_contours(tobj); + } + else { + if ((tobj->current_polygon = + (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + tobj->current_polygon->vertex_cnt = 0; + tobj->current_polygon->vertices = + tobj->current_polygon->last_vertex = NULL; + } +} + + +void GLAPIENTRY +gluEndPolygon(GLUtriangulatorObj * tobj) +{ + /*tess_contour *contour_ptr; */ + + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* check if gluBeginPolygon was called */ + if (tobj->current_polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + tess_test_polygon(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* any real contours? */ + if (tobj->contour_cnt == 0) { + /* delete all internal structures */ + delete_contours(tobj); + return; + } + tess_find_contour_hierarchies(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + tess_handle_holes(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* if no callbacks, nothing to do */ + if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL && + tobj->callbacks.end != NULL) { + if (tobj->callbacks.edgeFlag == NULL) + tess_tesselate(tobj); + else + tess_tesselate_with_edge_flag(tobj); + } + + end: + /* delete all internal structures */ + delete_contours(tobj); +} + + +void GLAPIENTRY +gluNextContour(GLUtriangulatorObj * tobj, GLenum type) +{ + if (tobj->error != GLU_NO_ERROR) + return; + if (tobj->current_polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + /* first contour? */ + if (tobj->current_polygon->vertex_cnt) + tess_test_polygon(tobj); +} + + +void GLAPIENTRY +gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *last_vertex_ptr; + + if (tobj->error != GLU_NO_ERROR) + return; + if (polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + last_vertex_ptr = polygon->last_vertex; + if (last_vertex_ptr == NULL) { + if ((last_vertex_ptr = (tess_vertex *) + malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + polygon->vertices = last_vertex_ptr; + polygon->last_vertex = last_vertex_ptr; + last_vertex_ptr->data = data; + last_vertex_ptr->location[0] = v[0]; + last_vertex_ptr->location[1] = v[1]; + last_vertex_ptr->location[2] = v[2]; + last_vertex_ptr->next = NULL; + last_vertex_ptr->previous = NULL; + ++(polygon->vertex_cnt); + } + else { + tess_vertex *vertex_ptr; + + /* same point twice? */ + if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON && + fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON && + fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) { + tess_call_user_error(tobj, GLU_TESS_ERROR6); + return; + } + if ((vertex_ptr = (tess_vertex *) + malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + vertex_ptr->data = data; + vertex_ptr->location[0] = v[0]; + vertex_ptr->location[1] = v[1]; + vertex_ptr->location[2] = v[2]; + vertex_ptr->next = NULL; + vertex_ptr->previous = last_vertex_ptr; + ++(polygon->vertex_cnt); + last_vertex_ptr->next = vertex_ptr; + polygon->last_vertex = vertex_ptr; + } +} + + +static void +delete_contours(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_contour *contour, *contour_tmp; + tess_vertex *vertex, *vertex_tmp; + + /* remove current_polygon list - if exists due to detected error */ + if (polygon != NULL) { + if (polygon->vertices) { + for (vertex = polygon->vertices; vertex != polygon->last_vertex;) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + free(vertex); + } + free(polygon); + tobj->current_polygon = NULL; + } + /* remove all contour data */ + for (contour = tobj->contours; contour != NULL;) { + for (vertex = contour->vertices; vertex != contour->last_vertex;) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + free(vertex); + contour_tmp = contour->next; + free(contour); + contour = contour_tmp; + } + tobj->contours = tobj->last_contour = NULL; + tobj->contour_cnt = 0; +} + + +void GLAPIENTRY +gluTessNormal(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ) +{ + /* dummy function */ + (void) tess; + (void) valueX; + (void) valueY; + (void) valueZ; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/tesselat.c xpsb-glx-0.19/mesa/src/glu/mini/tesselat.c --- xpsb-glx-0.19/mesa/src/glu/mini/tesselat.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/tesselat.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,406 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "tess.h" +#endif + + + +static GLboolean edge_flag; + +static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, + tess_vertex *, tess_vertex *); + +static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, + tess_vertex *, GLboolean, + tess_vertex *, GLboolean, + tess_vertex *, GLboolean); + +static GLdouble +twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc) +{ + return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x - + va->x); +} + +static GLboolean +left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) +{ + if (A * x + B * y + C > -EPSILON) + return GL_TRUE; + else + return GL_FALSE; +} + +static GLboolean +right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) +{ + if (A * x + B * y + C < EPSILON) + return GL_TRUE; + else + return GL_FALSE; +} + +static GLint +convex_ccw(tess_vertex * va, + tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) +{ + GLdouble d; + + d = twice_the_triangle_area(va, vb, vc); + + if (d > EPSILON) { + return 1; + } + else if (d < -EPSILON) { + return 0; + } + else { + return -1; + } +} + +static GLint +convex_cw(tess_vertex * va, + tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) +{ + GLdouble d; + + d = twice_the_triangle_area(va, vb, vc); + + if (d < -EPSILON) { + return 1; + } + else if (d > EPSILON) { + return 0; + } + else { + return -1; + } +} + +static GLboolean +diagonal_ccw(tess_vertex * va, + tess_vertex * vb, + GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vc = va->next, *vertex, *shadow_vertex; + struct + { + GLdouble A, B, C; + } + ac, cb, ba; + GLdouble x, y; + + GLint res = convex_ccw(va, vc, vb, tobj); + if (res == 0) + return GL_FALSE; + if (res == -1) + return GL_TRUE; + + ba.A = vb->y - va->y; + ba.B = va->x - vb->x; + ba.C = -ba.A * va->x - ba.B * va->y; + ac.A = va->y - vc->y; + ac.B = vc->x - va->x; + ac.C = -ac.A * vc->x - ac.B * vc->y; + cb.A = vc->y - vb->y; + cb.B = vb->x - vc->x; + cb.C = -cb.A * vb->x - cb.B * vb->y; + for (vertex = vb->next; vertex != va; vertex = vertex->next) { + shadow_vertex = vertex->shadow_vertex; + if (shadow_vertex != NULL && + (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) + continue; + x = vertex->x; + y = vertex->y; + if (left(ba.A, ba.B, ba.C, x, y) && + left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y)) + return GL_FALSE; + } + return GL_TRUE; +} + +static GLboolean +diagonal_cw(tess_vertex * va, + tess_vertex * vb, + GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vc = va->next, *vertex, *shadow_vertex; + struct + { + GLdouble A, B, C; + } + ac, cb, ba; + GLdouble x, y; + + GLint res = convex_cw(va, vc, vb, tobj); + if (res == 0) + return GL_FALSE; + if (res == -1) + return GL_TRUE; + + ba.A = vb->y - va->y; + ba.B = va->x - vb->x; + ba.C = -ba.A * va->x - ba.B * va->y; + ac.A = va->y - vc->y; + ac.B = vc->x - va->x; + ac.C = -ac.A * vc->x - ac.B * vc->y; + cb.A = vc->y - vb->y; + cb.B = vb->x - vc->x; + cb.C = -cb.A * vb->x - cb.B * vb->y; + for (vertex = vb->next; vertex != va; vertex = vertex->next) { + shadow_vertex = vertex->shadow_vertex; + if (shadow_vertex != NULL && + (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) + continue; + x = vertex->x; + y = vertex->y; + if (right(ba.A, ba.B, ba.C, x, y) && + right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y)) + return GL_FALSE; + } + return GL_TRUE; +} + +static void +clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour) +{ + emit_triangle(tobj, v->previous, v, v->next); + /* the first in the list */ + if (contour->vertices == v) { + contour->vertices = v->next; + contour->last_vertex->next = v->next; + v->next->previous = contour->last_vertex; + } + else + /* the last ? */ + if (contour->last_vertex == v) { + contour->vertices->previous = v->previous; + v->previous->next = v->next; + contour->last_vertex = v->previous; + } + else { + v->next->previous = v->previous; + v->previous->next = v->next; + } + free(v); + --(contour->vertex_cnt); +} + +static void +clip_ear_with_edge_flag(GLUtriangulatorObj * tobj, + tess_vertex * v, tess_contour * contour) +{ + emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag, + v, v->edge_flag, v->next, GL_FALSE); + v->previous->edge_flag = GL_FALSE; + /* the first in the list */ + if (contour->vertices == v) { + contour->vertices = v->next; + contour->last_vertex->next = v->next; + v->next->previous = contour->last_vertex; + } + else + /* the last ? */ + if (contour->last_vertex == v) { + contour->vertices->previous = v->previous; + v->previous->next = v->next; + contour->last_vertex = v->previous; + } + else { + v->next->previous = v->previous; + v->previous->next = v->next; + } + free(v); + --(contour->vertex_cnt); +} + +static void +triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj, + tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear_with_edge_flag(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj, + tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear_with_edge_flag(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +void +tess_tesselate(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + + for (contour = tobj->contours; contour != NULL; contour = contour->next) { + if (contour->orientation == GLU_CCW) { + triangulate_ccw(tobj, contour); + } + else { + triangulate_cw(tobj, contour); + } + if (tobj->error != GLU_NO_ERROR) + return; + + /* emit the last triangle */ + emit_triangle(tobj, contour->vertices, contour->vertices->next, + contour->vertices->next->next); + } +} + +void +tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + + edge_flag = GL_TRUE; + /* first callback with edgeFlag set to GL_TRUE */ + (tobj->callbacks.edgeFlag) (GL_TRUE); + + for (contour = tobj->contours; contour != NULL; contour = contour->next) { + if (contour->orientation == GLU_CCW) + triangulate_ccw_with_edge_flag(tobj, contour); + else + triangulate_cw_with_edge_flag(tobj, contour); + if (tobj->error != GLU_NO_ERROR) + return; + /* emit the last triangle */ + emit_triangle_with_edge_flag(tobj, contour->vertices, + contour->vertices->edge_flag, + contour->vertices->next, + contour->vertices->next->edge_flag, + contour->vertices->next->next, + contour->vertices->next->next->edge_flag); + } +} + +static void +emit_triangle(GLUtriangulatorObj * tobj, + tess_vertex * v1, tess_vertex * v2, tess_vertex * v3) +{ + (tobj->callbacks.begin) (GL_TRIANGLES); + (tobj->callbacks.vertex) (v1->data); + (tobj->callbacks.vertex) (v2->data); + (tobj->callbacks.vertex) (v3->data); + (tobj->callbacks.end) (); +} + +static void +emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj, + tess_vertex * v1, + GLboolean edge_flag1, + tess_vertex * v2, + GLboolean edge_flag2, + tess_vertex * v3, GLboolean edge_flag3) +{ + (tobj->callbacks.begin) (GL_TRIANGLES); + if (edge_flag1 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v1->data); + if (edge_flag2 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v2->data); + if (edge_flag3 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v3->data); + (tobj->callbacks.end) (); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/mini/tess.h xpsb-glx-0.19/mesa/src/glu/mini/tess.h --- xpsb-glx-0.19/mesa/src/glu/mini/tess.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/mini/tess.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,107 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifndef TESS_H +#define TESS_H + + +#include "gluP.h" + +#define EPSILON 1e-06 /* epsilon for double precision compares */ + +typedef enum +{ + OXY, + OYZ, + OXZ +} +projection_type; + +typedef struct callbacks_str +{ + void (GLCALLBACK * begin) (GLenum mode); + void (GLCALLBACK * edgeFlag) (GLboolean flag); + void (GLCALLBACK * vertex) (GLvoid * v); + void (GLCALLBACK * end) (void); + void (GLCALLBACK * error) (GLenum err); +} +tess_callbacks; + +typedef struct vertex_str +{ + void *data; + GLdouble location[3]; + GLdouble x, y; + GLboolean edge_flag; + struct vertex_str *shadow_vertex; + struct vertex_str *next, *previous; +} +tess_vertex; + +typedef struct contour_str +{ + GLenum type; + GLuint vertex_cnt; + GLdouble area; + GLenum orientation; + struct vertex_str *vertices, *last_vertex; + struct contour_str *next, *previous; +} +tess_contour; + +typedef struct polygon_str +{ + GLuint vertex_cnt; + GLdouble A, B, C, D; + GLdouble area; + GLenum orientation; + struct vertex_str *vertices, *last_vertex; +} +tess_polygon; + +struct GLUtesselator +{ + tess_contour *contours, *last_contour; + GLuint contour_cnt; + tess_callbacks callbacks; + tess_polygon *current_polygon; + GLenum error; + GLdouble A, B, C, D; + projection_type projection; +}; + + +extern void tess_call_user_error(GLUtriangulatorObj *, GLenum); +extern void tess_test_polygon(GLUtriangulatorObj *); +extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); +extern void tess_handle_holes(GLUtriangulatorObj *); +extern void tess_tesselate(GLUtriangulatorObj *); +extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/descrip.mms xpsb-glx-0.19/mesa/src/glu/sgi/descrip.mms --- xpsb-glx-0.19/mesa/src/glu/sgi/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/descrip.mms 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,451 @@ +# Makefile for GLU for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +.first + define gl [---.include.gl] + +.include [---]mms-config. + +##### MACROS ##### + +VPATH = RCS + +INCDIR =([-.include],[.include],[.internals],[.libnurbs.internals],\ + [.libnurbs.interface],[.libnurbs.nurbtess]) +LIBDIR = [---.lib] +CFLAGS = /include=$(INCDIR)/name=(as_is,short)/float=ieee/ieee=denorm + +LU_OBJECTS=\ + [.libutil]error.obj, \ + [.libutil]glue.obj, \ + [.libutil]mipmap.obj,\ + [.libutil]project.obj,\ + [.libutil]quad.obj, \ + [.libutil]registry.obj + +LT_OBJECTS=[.libtess]dict.obj, \ + [.libtess]geom.obj, \ + [.libtess]memalloc.obj,\ + [.libtess]mesh.obj, \ + [.libtess]normal.obj,\ + [.libtess]priorityq.obj,\ + [.libtess]render.obj,\ + [.libtess]sweep.obj, \ + [.libtess]tess.obj, \ + [.libtess]tessmono.obj + +LI_OBJECTS=[.libnurbs.interface]bezierEval.obj, \ + [.libnurbs.interface]bezierPatch.obj, \ + [.libnurbs.interface]bezierPatchMesh.obj, \ + [.libnurbs.interface]glcurveval.obj, \ + [.libnurbs.interface]glinterface.obj + +LI_OBJECTS1=[.libnurbs.interface]glrenderer.obj, \ + [.libnurbs.interface]glsurfeval.obj, \ + [.libnurbs.interface]incurveeval.obj, \ + [.libnurbs.interface]insurfeval.obj + +LI2_OBJECTS=[.libnurbs.internals]arc.obj, \ + [.libnurbs.internals]arcsorter.obj, \ + [.libnurbs.internals]arctess.obj, \ + [.libnurbs.internals]backend.obj, \ + [.libnurbs.internals]basiccrveval.obj, \ + [.libnurbs.internals]basicsurfeval.obj + +LI2_OBJECTS1=[.libnurbs.internals]bin.obj, \ + [.libnurbs.internals]bufpool.obj, \ + [.libnurbs.internals]cachingeval.obj, \ + [.libnurbs.internals]ccw.obj, \ + [.libnurbs.internals]coveandtiler.obj, \ + [.libnurbs.internals]curve.obj, \ + [.libnurbs.internals]curvelist.obj + +LI2_OBJECTS2=[.libnurbs.internals]curvesub.obj, \ + [.libnurbs.internals]dataTransform.obj, \ + [.libnurbs.internals]displaylist.obj, \ + [.libnurbs.internals]flist.obj, \ + [.libnurbs.internals]flistsorter.obj + +LI2_OBJECTS3=[.libnurbs.internals]hull.obj, \ + [.libnurbs.internals]intersect.obj, \ + [.libnurbs.internals]knotvector.obj, \ + [.libnurbs.internals]mapdesc.obj + +LI2_OBJECTS4=[.libnurbs.internals]mapdescv.obj, \ + [.libnurbs.internals]maplist.obj, \ + [.libnurbs.internals]mesher.obj, \ + [.libnurbs.internals]monoTriangulationBackend.obj,\ + [.libnurbs.internals]monotonizer.obj + +LI2_OBJECTS5=[.libnurbs.internals]mycode.obj, \ + [.libnurbs.internals]nurbsinterfac.obj, \ + [.libnurbs.internals]nurbstess.obj, \ + [.libnurbs.internals]patch.obj + +LI2_OBJECTS6=[.libnurbs.internals]patchlist.obj, \ + [.libnurbs.internals]quilt.obj, \ + [.libnurbs.internals]reader.obj, \ + [.libnurbs.internals]renderhints.obj, \ + [.libnurbs.internals]slicer.obj + +LI2_OBJECTS7=[.libnurbs.internals]sorter.obj, \ + [.libnurbs.internals]splitarcs.obj, \ + [.libnurbs.internals]subdivider.obj, \ + [.libnurbs.internals]tobezier.obj + +LI2_OBJECTS8=[.libnurbs.internals]trimline.obj, \ + [.libnurbs.internals]trimregion.obj, \ + [.libnurbs.internals]trimvertpool.obj, \ + [.libnurbs.internals]uarray.obj, \ + [.libnurbs.internals]varray.obj + +LN_OBJECTS=[.libnurbs.nurbtess]directedLine.obj, \ + [.libnurbs.nurbtess]gridWrap.obj, \ + [.libnurbs.nurbtess]monoChain.obj, \ + [.libnurbs.nurbtess]monoPolyPart.obj, \ + [.libnurbs.nurbtess]monoTriangulation.obj + +LN_OBJECTS1=[.libnurbs.nurbtess]partitionX.obj, \ + [.libnurbs.nurbtess]partitionY.obj, \ + [.libnurbs.nurbtess]polyDBG.obj + +LN_OBJECTS2=[.libnurbs.nurbtess]polyUtil.obj, \ + [.libnurbs.nurbtess]primitiveStream.obj, \ + [.libnurbs.nurbtess]quicksort.obj, \ + [.libnurbs.nurbtess]rectBlock.obj + +LN_OBJECTS3=[.libnurbs.nurbtess]sampleComp.obj, \ + [.libnurbs.nurbtess]sampleCompBot.obj, \ + [.libnurbs.nurbtess]sampleCompRight.obj + +LN_OBJECTS4=[.libnurbs.nurbtess]sampleCompTop.obj, \ + [.libnurbs.nurbtess]sampleMonoPoly.obj,\ + [.libnurbs.nurbtess]sampledLine.obj, \ + [.libnurbs.nurbtess]searchTree.obj + +##### RULES ##### + +VERSION=MesaGlu V3.5 + +##### TARGETS ##### + +# Make the library: +$(LIBDIR)$(GLU_LIB) : $(LU_OBJECTS) $(LT_OBJECTS) $(LI_OBJECTS) $(LI_OBJECTS1)\ + $(LI2_OBJECTS) $(LI2_OBJECTS1) $(LI2_OBJECTS2)\ + $(LI2_OBJECTS3) $(LI2_OBJECTS4) $(LI2_OBJECTS5)\ + $(LI2_OBJECTS6) $(LI2_OBJECTS7) $(LI2_OBJECTS8)\ + $(LN_OBJECTS) $(LN_OBJECTS1) $(LN_OBJECTS2)\ + $(LN_OBJECTS3) $(LN_OBJECTS4) + @ $(MAKELIB) $(GLU_LIB) $(LU_OBJECTS),$(LT_OBJECTS),$(LI_OBJECTS),\ + $(LI2_OBJECTS),$(LN_OBJECTS) + @ rename $(GLU_LIB)* $(LIBDIR) +.ifdef SHARE + @ WRITE_ SYS$OUTPUT " generating mesagl1.opt" + @ OPEN_/WRITE FILE mesagl1.opt + @ WRITE_ FILE "!" + @ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)" + @ WRITE_ FILE "!" + @ WRITE_ FILE "IDENTIFICATION=""$(VERSION)""" + @ WRITE_ FILE "GSMATCH=LEQUAL,3,5 + @ WRITE_ FILE "$(LU_OBJECTS)" + @ WRITE_ FILE "$(LT_OBJECTS)" + @ WRITE_ FILE "$(LI_OBJECTS)" + @ WRITE_ FILE "$(LI_OBJECTS1)" + @ WRITE_ FILE "$(LI2_OBJECTS)" + @ WRITE_ FILE "$(LI2_OBJECTS1)" + @ WRITE_ FILE "$(LI2_OBJECTS2)" + @ WRITE_ FILE "$(LI2_OBJECTS3)" + @ WRITE_ FILE "$(LI2_OBJECTS4)" + @ WRITE_ FILE "$(LI2_OBJECTS5)" + @ WRITE_ FILE "$(LI2_OBJECTS6)" + @ WRITE_ FILE "$(LI2_OBJECTS7)" + @ WRITE_ FILE "$(LI2_OBJECTS8)" + @ WRITE_ FILE "$(LN_OBJECTS)" + @ WRITE_ FILE "$(LN_OBJECTS1)" + @ WRITE_ FILE "$(LN_OBJECTS2)" + @ WRITE_ FILE "$(LN_OBJECTS3)" + @ WRITE_ FILE "$(LN_OBJECTS4)" + @ WRITE_ FILE "[---.lib]libmesagl.exe/SHARE" + @ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE" + @ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE" + @ CLOSE_ FILE +# @ WRITE_ SYS$OUTPUT " generating mesagl.map ..." +# @ CXXLINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT +# @ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..." +# @ @[-.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt + @ WRITE_ SYS$OUTPUT " linking $(GLU_SHAR) ..." +# @ CXXLINK_/noinform/NODEB/SHARE=$(GLU_SHAR)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt + @ CXXLINK_/noinform/NODEB/SHARE=$(GLU_SHAR)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesaglu.opt/opt + @ rename $(GLU_SHAR)* $(LIBDIR) +.endif + +clean : + delete [...]*.obj;* + purge + +[.libutil]error.obj : [.libutil]error.c + $(CC) $(CFLAGS) /obj=[.libutil]error.obj [.libutil]error.c + +[.libutil]glue.obj : [.libutil]glue.c + $(CC) $(CFLAGS) /obj=[.libutil]glue.obj [.libutil]glue.c + +[.libutil]mipmap.obj : [.libutil]mipmap.c + $(CC) $(CFLAGS) /obj=[.libutil]mipmap.obj [.libutil]mipmap.c + +[.libutil]project.obj : [.libutil]project.c + $(CC) $(CFLAGS) /obj=[.libutil]project.obj [.libutil]project.c + +[.libutil]quad.obj : [.libutil]quad.c + $(CC) $(CFLAGS) /obj=[.libutil]quad.obj [.libutil]quad.c + +[.libutil]registry.obj : [.libutil]registry.c + $(CC) $(CFLAGS) /obj=[.libutil]registry.obj [.libutil]registry.c + +[.libtess]dict.obj : [.libtess]dict.c + $(CC) $(CFLAGS) /obj=[.libtess]dict.obj [.libtess]dict.c + +[.libtess]geom.obj : [.libtess]geom.c + $(CC) $(CFLAGS) /obj=[.libtess]geom.obj [.libtess]geom.c + +[.libtess]memalloc.obj : [.libtess]memalloc.c + $(CC) $(CFLAGS) /obj=[.libtess]memalloc.obj [.libtess]memalloc.c + +[.libtess]mesh.obj : [.libtess]mesh.c + $(CC) $(CFLAGS) /obj=[.libtess]mesh.obj [.libtess]mesh.c + +[.libtess]normal.obj : [.libtess]normal.c + $(CC) $(CFLAGS) /obj=[.libtess]normal.obj [.libtess]normal.c + +[.libtess]priorityq.obj : [.libtess]priorityq.c + $(CC) $(CFLAGS) /obj=[.libtess]priorityq.obj [.libtess]priorityq.c + +[.libtess]render.obj : [.libtess]render.c + $(CC) $(CFLAGS) /obj=[.libtess]render.obj [.libtess]render.c + +[.libtess]sweep.obj : [.libtess]sweep.c + $(CC) $(CFLAGS) /obj=[.libtess]sweep.obj [.libtess]sweep.c + +[.libtess]tess.obj : [.libtess]tess.c + $(CC) $(CFLAGS) /obj=[.libtess]tess.obj [.libtess]tess.c + +[.libtess]tessmono.obj : [.libtess]tessmono.c + $(CC) $(CFLAGS) /obj=[.libtess]tessmono.obj [.libtess]tessmono.c + +[.libnurbs.interface]bezierEval.obj : [.libnurbs.interface]bezierEval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]bezierEval.obj [.libnurbs.interface]bezierEval.cc + +[.libnurbs.interface]bezierPatch.obj : [.libnurbs.interface]bezierPatch.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]bezierPatch.obj [.libnurbs.interface]bezierPatch.cc + +[.libnurbs.interface]bezierPatchMesh.obj : [.libnurbs.interface]bezierPatchMesh.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]bezierPatchMesh.obj [.libnurbs.interface]bezierPatchMesh.cc + +[.libnurbs.interface]glcurveval.obj : [.libnurbs.interface]glcurveval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glcurveval.obj [.libnurbs.interface]glcurveval.cc + +[.libnurbs.interface]glinterface.obj : [.libnurbs.interface]glinterface.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glinterface.obj [.libnurbs.interface]glinterface.cc + +[.libnurbs.interface]glrenderer.obj : [.libnurbs.interface]glrenderer.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glrenderer.obj [.libnurbs.interface]glrenderer.cc + +[.libnurbs.interface]glsurfeval.obj : [.libnurbs.interface]glsurfeval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glsurfeval.obj [.libnurbs.interface]glsurfeval.cc + +[.libnurbs.interface]incurveeval.obj : [.libnurbs.interface]incurveeval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]incurveeval.obj [.libnurbs.interface]incurveeval.cc + +[.libnurbs.interface]insurfeval.obj : [.libnurbs.interface]insurfeval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.interface]insurfeval.obj [.libnurbs.interface]insurfeval.cc + +[.libnurbs.internals]arc.obj : [.libnurbs.internals]arc.cc + $(CXX) $(CFLAGS)/list/show=all /obj=[.libnurbs.internals]arc.obj [.libnurbs.internals]arc.cc + +[.libnurbs.internals]arcsorter.obj : [.libnurbs.internals]arcsorter.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]arcsorter.obj [.libnurbs.internals]arcsorter.cc + +[.libnurbs.internals]arctess.obj : [.libnurbs.internals]arctess.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]arctess.obj [.libnurbs.internals]arctess.cc + +[.libnurbs.internals]backend.obj : [.libnurbs.internals]backend.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]backend.obj [.libnurbs.internals]backend.cc + +[.libnurbs.internals]basiccrveval.obj : [.libnurbs.internals]basiccrveval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]basiccrveval.obj [.libnurbs.internals]basiccrveval.cc + +[.libnurbs.internals]basicsurfeval.obj : [.libnurbs.internals]basicsurfeval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]basicsurfeval.obj [.libnurbs.internals]basicsurfeval.cc + +[.libnurbs.internals]bin.obj : [.libnurbs.internals]bin.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]bin.obj [.libnurbs.internals]bin.cc + +[.libnurbs.internals]bufpool.obj : [.libnurbs.internals]bufpool.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]bufpool.obj [.libnurbs.internals]bufpool.cc + +[.libnurbs.internals]cachingeval.obj : [.libnurbs.internals]cachingeval.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]cachingeval.obj [.libnurbs.internals]cachingeval.cc + +[.libnurbs.internals]ccw.obj : [.libnurbs.internals]ccw.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]ccw.obj [.libnurbs.internals]ccw.cc + +[.libnurbs.internals]coveandtiler.obj : [.libnurbs.internals]coveandtiler.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]coveandtiler.obj [.libnurbs.internals]coveandtiler.cc + +[.libnurbs.internals]curve.obj : [.libnurbs.internals]curve.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]curve.obj [.libnurbs.internals]curve.cc + +[.libnurbs.internals]curvelist.obj : [.libnurbs.internals]curvelist.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]curvelist.obj [.libnurbs.internals]curvelist.cc + +[.libnurbs.internals]curvesub.obj : [.libnurbs.internals]curvesub.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]curvesub.obj [.libnurbs.internals]curvesub.cc + +[.libnurbs.internals]dataTransform.obj : [.libnurbs.internals]dataTransform.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]dataTransform.obj [.libnurbs.internals]dataTransform.cc + +[.libnurbs.internals]displaylist.obj : [.libnurbs.internals]displaylist.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]displaylist.obj [.libnurbs.internals]displaylist.cc + +[.libnurbs.internals]flist.obj : [.libnurbs.internals]flist.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]flist.obj [.libnurbs.internals]flist.cc + +[.libnurbs.internals]flistsorter.obj : [.libnurbs.internals]flistsorter.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]flistsorter.obj [.libnurbs.internals]flistsorter.cc + +[.libnurbs.internals]hull.obj : [.libnurbs.internals]hull.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]hull.obj [.libnurbs.internals]hull.cc + +[.libnurbs.internals]intersect.obj : [.libnurbs.internals]intersect.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]intersect.obj [.libnurbs.internals]intersect.cc + +[.libnurbs.internals]knotvector.obj : [.libnurbs.internals]knotvector.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]knotvector.obj [.libnurbs.internals]knotvector.cc + +[.libnurbs.internals]mapdesc.obj : [.libnurbs.internals]mapdesc.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mapdesc.obj [.libnurbs.internals]mapdesc.cc + +[.libnurbs.internals]mapdescv.obj : [.libnurbs.internals]mapdescv.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mapdescv.obj [.libnurbs.internals]mapdescv.cc + +[.libnurbs.internals]maplist.obj : [.libnurbs.internals]maplist.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]maplist.obj [.libnurbs.internals]maplist.cc + +[.libnurbs.internals]mesher.obj : [.libnurbs.internals]mesher.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mesher.obj [.libnurbs.internals]mesher.cc + +[.libnurbs.internals]monoTriangulationBackend.obj : [.libnurbs.internals]monoTriangulationBackend.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]monoTriangulationBackend.obj [.libnurbs.internals]monoTriangulationBackend.cc + +[.libnurbs.internals]monotonizer.obj : [.libnurbs.internals]monotonizer.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]monotonizer.obj [.libnurbs.internals]monotonizer.cc + +[.libnurbs.internals]mycode.obj : [.libnurbs.internals]mycode.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mycode.obj [.libnurbs.internals]mycode.cc + +[.libnurbs.internals]nurbsinterfac.obj : [.libnurbs.internals]nurbsinterfac.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]nurbsinterfac.obj [.libnurbs.internals]nurbsinterfac.cc + +[.libnurbs.internals]nurbstess.obj : [.libnurbs.internals]nurbstess.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]nurbstess.obj [.libnurbs.internals]nurbstess.cc + +[.libnurbs.internals]patch.obj : [.libnurbs.internals]patch.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]patch.obj [.libnurbs.internals]patch.cc + +[.libnurbs.internals]patchlist.obj : [.libnurbs.internals]patchlist.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]patchlist.obj [.libnurbs.internals]patchlist.cc + +[.libnurbs.internals]quilt.obj : [.libnurbs.internals]quilt.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]quilt.obj [.libnurbs.internals]quilt.cc + +[.libnurbs.internals]reader.obj : [.libnurbs.internals]reader.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]reader.obj [.libnurbs.internals]reader.cc + +[.libnurbs.internals]renderhints.obj : [.libnurbs.internals]renderhints.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]renderhints.obj [.libnurbs.internals]renderhints.cc + +[.libnurbs.internals]slicer.obj : [.libnurbs.internals]slicer.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]slicer.obj [.libnurbs.internals]slicer.cc + +[.libnurbs.internals]sorter.obj : [.libnurbs.internals]sorter.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]sorter.obj [.libnurbs.internals]sorter.cc + +[.libnurbs.internals]splitarcs.obj : [.libnurbs.internals]splitarcs.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]splitarcs.obj [.libnurbs.internals]splitarcs.cc + +[.libnurbs.internals]subdivider.obj : [.libnurbs.internals]subdivider.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]subdivider.obj [.libnurbs.internals]subdivider.cc + +[.libnurbs.internals]tobezier.obj : [.libnurbs.internals]tobezier.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]tobezier.obj [.libnurbs.internals]tobezier.cc + +[.libnurbs.internals]trimline.obj : [.libnurbs.internals]trimline.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]trimline.obj [.libnurbs.internals]trimline.cc + +[.libnurbs.internals]trimregion.obj : [.libnurbs.internals]trimregion.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]trimregion.obj [.libnurbs.internals]trimregion.cc + +[.libnurbs.internals]trimvertpool.obj : [.libnurbs.internals]trimvertpool.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]trimvertpool.obj [.libnurbs.internals]trimvertpool.cc + +[.libnurbs.internals]uarray.obj : [.libnurbs.internals]uarray.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]uarray.obj [.libnurbs.internals]uarray.cc + +[.libnurbs.internals]varray.obj : [.libnurbs.internals]varray.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.internals]varray.obj [.libnurbs.internals]varray.cc + +[.libnurbs.nurbtess]directedLine.obj : [.libnurbs.nurbtess]directedLine.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]directedLine.obj [.libnurbs.nurbtess]directedLine.cc + +[.libnurbs.nurbtess]gridWrap.obj : [.libnurbs.nurbtess]gridWrap.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]gridWrap.obj [.libnurbs.nurbtess]gridWrap.cc + +[.libnurbs.nurbtess]monoChain.obj : [.libnurbs.nurbtess]monoChain.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]monoChain.obj [.libnurbs.nurbtess]monoChain.cc + +[.libnurbs.nurbtess]monoPolyPart.obj : [.libnurbs.nurbtess]monoPolyPart.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]monoPolyPart.obj [.libnurbs.nurbtess]monoPolyPart.cc + +[.libnurbs.nurbtess]monoTriangulation.obj : [.libnurbs.nurbtess]monoTriangulation.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]monoTriangulation.obj [.libnurbs.nurbtess]monoTriangulation.cc + +[.libnurbs.nurbtess]partitionX.obj : [.libnurbs.nurbtess]partitionX.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]partitionX.obj [.libnurbs.nurbtess]partitionX.cc + +[.libnurbs.nurbtess]partitionY.obj : [.libnurbs.nurbtess]partitionY.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]partitionY.obj [.libnurbs.nurbtess]partitionY.cc + +[.libnurbs.nurbtess]polyDBG.obj : [.libnurbs.nurbtess]polyDBG.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]polyDBG.obj [.libnurbs.nurbtess]polyDBG.cc + +[.libnurbs.nurbtess]polyUtil.obj : [.libnurbs.nurbtess]polyUtil.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]polyUtil.obj [.libnurbs.nurbtess]polyUtil.cc + +[.libnurbs.nurbtess]primitiveStream.obj : [.libnurbs.nurbtess]primitiveStream.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]primitiveStream.obj [.libnurbs.nurbtess]primitiveStream.cc + +[.libnurbs.nurbtess]quicksort.obj : [.libnurbs.nurbtess]quicksort.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]quicksort.obj [.libnurbs.nurbtess]quicksort.cc + +[.libnurbs.nurbtess]rectBlock.obj : [.libnurbs.nurbtess]rectBlock.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]rectBlock.obj [.libnurbs.nurbtess]rectBlock.cc + +[.libnurbs.nurbtess]sampleComp.obj : [.libnurbs.nurbtess]sampleComp.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleComp.obj [.libnurbs.nurbtess]sampleComp.cc + +[.libnurbs.nurbtess]sampleCompBot.obj : [.libnurbs.nurbtess]sampleCompBot.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleCompBot.obj [.libnurbs.nurbtess]sampleCompBot.cc + +[.libnurbs.nurbtess]sampleCompRight.obj : [.libnurbs.nurbtess]sampleCompRight.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleCompRight.obj [.libnurbs.nurbtess]sampleCompRight.cc + +[.libnurbs.nurbtess]sampleCompTop.obj : [.libnurbs.nurbtess]sampleCompTop.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleCompTop.obj [.libnurbs.nurbtess]sampleCompTop.cc + +[.libnurbs.nurbtess]sampleMonoPoly.obj : [.libnurbs.nurbtess]sampleMonoPoly.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleMonoPoly.obj [.libnurbs.nurbtess]sampleMonoPoly.cc + +[.libnurbs.nurbtess]sampledLine.obj : [.libnurbs.nurbtess]sampledLine.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampledLine.obj [.libnurbs.nurbtess]sampledLine.cc + +[.libnurbs.nurbtess]searchTree.obj : [.libnurbs.nurbtess]searchTree.cc + $(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]searchTree.obj [.libnurbs.nurbtess]searchTree.cc diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/dummy.cc xpsb-glx-0.19/mesa/src/glu/sgi/dummy.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/dummy.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/dummy.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,4 @@ +/* + * This file contains nothing. It's just there so there's at least a single + * source file for libGLU.la in this directory. + */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/exptmp xpsb-glx-0.19/mesa/src/glu/sgi/exptmp --- xpsb-glx-0.19/mesa/src/glu/sgi/exptmp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/exptmp 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,123 @@ +{ +global: + gluBeginCurve; + gluBeginPolygon; + gluBeginSurface; + gluBeginTrim; + gluBuild1DMipmapLevels; + gluBuild1DMipmaps; + gluBuild2DMipmapLevels; + gluBuild2DMipmaps; + gluBuild3DMipmapLevels; + gluBuild3DMipmaps; + gluCheckExtension; + gluCylinder; + gluDeleteNurbsRenderer; + gluDeleteQuadric; + gluDeleteTess; + gluDisk; + gluEndCurve; + gluEndPolygon; + gluEndSurface; + gluEndTrim; + gluErrorString; + gluGetNurbsProperty; + gluGetString; + gluGetTessProperty; + gluLoadSamplingMatrices; + gluLookAt; + gluNewNurbsRenderer; + gluNewQuadric; + gluNewTess; + gluNextContour; + gluNurbsCallback; + gluNurbsCallbackData; + gluNurbsCallbackDataEXT; + gluNurbsCurve; + gluNurbsProperty; + gluNurbsSurface; + gluOrtho2D; + gluPartialDisk; + gluPerspective; + gluPickMatrix; + gluProject; + gluPwlCurve; + gluQuadricCallback; + gluQuadricDrawStyle; + gluQuadricNormals; + gluQuadricOrientation; + gluQuadricTexture; + gluScaleImage; + gluSphere; + gluTessBeginContour; + gluTessBeginPolygon; + gluTessCallback; + gluTessEndContour; + gluTessEndPolygon; + gluTessNormal; + gluTessProperty; + gluTessVertex; + gluUnProject; + gluUnProject4; + mgluBeginCurve; + mgluBeginPolygon; + mgluBeginSurface; + mgluBeginTrim; + mgluBuild1DMipmapLevels; + mgluBuild1DMipmaps; + mgluBuild2DMipmapLevels; + mgluBuild2DMipmaps; + mgluBuild3DMipmapLevels; + mgluBuild3DMipmaps; + mgluCheckExtension; + mgluCylinder; + mgluDeleteNurbsRenderer; + mgluDeleteQuadric; + mgluDeleteTess; + mgluDisk; + mgluEndCurve; + mgluEndPolygon; + mgluEndSurface; + mgluEndTrim; + mgluErrorString; + mgluGetNurbsProperty; + mgluGetString; + mgluGetTessProperty; + mgluLoadSamplingMatrices; + mgluLookAt; + mgluNewNurbsRenderer; + mgluNewQuadric; + mgluNewTess; + mgluNextContour; + mgluNurbsCallback; + mgluNurbsCallbackData; + mgluNurbsCallbackDataEXT; + mgluNurbsCurve; + mgluNurbsProperty; + mgluNurbsSurface; + mgluOrtho2D; + mgluPartialDisk; + mgluPerspective; + mgluPickMatrix; + mgluProject; + mgluPwlCurve; + mgluQuadricCallback; + mgluQuadricDrawStyle; + mgluQuadricNormals; + mgluQuadricOrientation; + mgluQuadricTexture; + mgluScaleImage; + mgluSphere; + mgluTessBeginContour; + mgluTessBeginPolygon; + mgluTessCallback; + mgluTessEndContour; + mgluTessEndPolygon; + mgluTessNormal; + mgluTessProperty; + mgluTessVertex; + mgluUnProject; + mgluUnProject4; +local: +*; +}; diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/glu.def xpsb-glx-0.19/mesa/src/glu/sgi/glu.def --- xpsb-glx-0.19/mesa/src/glu/sgi/glu.def 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/glu.def 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,88 @@ +;DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32' +VERSION 5.1 +; +; Module definition file for GLU (GLU32.DLL) +; +; Note: The GLU functions use the STDCALL +; function calling convention. Microsoft's +; GLU32 uses this convention and so must the +; Mesa GLU32 so that the Mesa DLL can be used +; as a drop-in replacement. +; +; The linker exports STDCALL entry points with +; 'decorated' names; e.g., _glBegin@0, where the +; trailing number is the number of bytes of +; parameter data pushed onto the stack. The +; callee is responsible for popping this data +; off the stack, usually via a RETF n instruction. +; +; However, the Microsoft GLU32.DLL does not export +; the decorated names, even though the calling convention +; is STDCALL. So, this module definition file is +; needed to force the Mesa GLU32.DLL to export the +; symbols in the same manner as the Microsoft DLL. +; Were it not for this problem, this file would not +; be needed (for the glu* functions) since the entry +; points are compiled with dllexport declspec. +; + +EXPORTS + gluBeginCurve + gluBeginPolygon + gluBeginSurface + gluBeginTrim + gluBuild1DMipmapLevels + gluBuild1DMipmaps + gluBuild2DMipmapLevels + gluBuild2DMipmaps + gluBuild3DMipmapLevels + gluBuild3DMipmaps + gluCheckExtension + gluCylinder + gluDeleteNurbsRenderer + gluDeleteQuadric + gluDeleteTess + gluDisk + gluEndCurve + gluEndPolygon + gluEndSurface + gluEndTrim + gluErrorString + gluGetNurbsProperty + gluGetString + gluGetTessProperty + gluLoadSamplingMatrices + gluLookAt + gluNewNurbsRenderer + gluNewQuadric + gluNewTess + gluNextContour + gluNurbsCallback + gluNurbsCallbackData + gluNurbsCallbackDataEXT + gluNurbsCurve + gluNurbsProperty + gluNurbsSurface + gluOrtho2D + gluPartialDisk + gluPerspective + gluPickMatrix + gluProject + gluPwlCurve + gluQuadricCallback + gluQuadricDrawStyle + gluQuadricNormals + gluQuadricOrientation + gluQuadricTexture + gluScaleImage + gluSphere + gluTessBeginContour + gluTessBeginPolygon + gluTessCallback + gluTessEndContour + gluTessEndPolygon + gluTessNormal + gluTessProperty + gluTessVertex + gluUnProject + gluUnProject4 diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports --- xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,118 @@ + gluBeginCurve + gluBeginPolygon + gluBeginSurface + gluBeginTrim + gluBuild1DMipmapLevels + gluBuild1DMipmaps + gluBuild2DMipmapLevels + gluBuild2DMipmaps + gluBuild3DMipmapLevels + gluBuild3DMipmaps + gluCheckExtension + gluCylinder + gluDeleteNurbsRenderer + gluDeleteQuadric + gluDeleteTess + gluDisk + gluEndCurve + gluEndPolygon + gluEndSurface + gluEndTrim + gluErrorString + gluGetNurbsProperty + gluGetString + gluGetTessProperty + gluLoadSamplingMatrices + gluLookAt + gluNewNurbsRenderer + gluNewQuadric + gluNewTess + gluNextContour + gluNurbsCallback + gluNurbsCallbackData + gluNurbsCallbackDataEXT + gluNurbsCurve + gluNurbsProperty + gluNurbsSurface + gluOrtho2D + gluPartialDisk + gluPerspective + gluPickMatrix + gluProject + gluPwlCurve + gluQuadricCallback + gluQuadricDrawStyle + gluQuadricNormals + gluQuadricOrientation + gluQuadricTexture + gluScaleImage + gluSphere + gluTessBeginContour + gluTessBeginPolygon + gluTessCallback + gluTessEndContour + gluTessEndPolygon + gluTessNormal + gluTessProperty + gluTessVertex + gluUnProject + gluUnProject4 + mgluBeginCurve + mgluBeginPolygon + mgluBeginSurface + mgluBeginTrim + mgluBuild1DMipmapLevels + mgluBuild1DMipmaps + mgluBuild2DMipmapLevels + mgluBuild2DMipmaps + mgluBuild3DMipmapLevels + mgluBuild3DMipmaps + mgluCheckExtension + mgluCylinder + mgluDeleteNurbsRenderer + mgluDeleteQuadric + mgluDeleteTess + mgluDisk + mgluEndCurve + mgluEndPolygon + mgluEndSurface + mgluEndTrim + mgluErrorString + mgluGetNurbsProperty + mgluGetString + mgluGetTessProperty + mgluLoadSamplingMatrices + mgluLookAt + mgluNewNurbsRenderer + mgluNewQuadric + mgluNewTess + mgluNextContour + mgluNurbsCallback + mgluNurbsCallbackData + mgluNurbsCallbackDataEXT + mgluNurbsCurve + mgluNurbsProperty + mgluNurbsSurface + mgluOrtho2D + mgluPartialDisk + mgluPerspective + mgluPickMatrix + mgluProject + mgluPwlCurve + mgluQuadricCallback + mgluQuadricDrawStyle + mgluQuadricNormals + mgluQuadricOrientation + mgluQuadricTexture + mgluScaleImage + mgluSphere + mgluTessBeginContour + mgluTessBeginPolygon + mgluTessCallback + mgluTessEndContour + mgluTessEndPolygon + mgluTessNormal + mgluTessProperty + mgluTessVertex + mgluUnProject + mgluUnProject4 diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports.darwin xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports.darwin --- xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports.darwin 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/glu.exports.darwin 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,59 @@ +_gluBeginCurve +_gluBeginPolygon +_gluBeginSurface +_gluBeginTrim +_gluBuild1DMipmapLevels +_gluBuild1DMipmaps +_gluBuild2DMipmapLevels +_gluBuild2DMipmaps +_gluBuild3DMipmapLevels +_gluBuild3DMipmaps +_gluCheckExtension +_gluCylinder +_gluDeleteNurbsRenderer +_gluDeleteQuadric +_gluDeleteTess +_gluDisk +_gluEndCurve +_gluEndPolygon +_gluEndSurface +_gluEndTrim +_gluErrorString +_gluGetNurbsProperty +_gluGetString +_gluGetTessProperty +_gluLoadSamplingMatrices +_gluLookAt +_gluNewNurbsRenderer +_gluNewQuadric +_gluNewTess +_gluNextContour +_gluNurbsCallback +_gluNurbsCallbackData +_gluNurbsCallbackDataEXT +_gluNurbsCurve +_gluNurbsProperty +_gluNurbsSurface +_gluOrtho2D +_gluPartialDisk +_gluPerspective +_gluPickMatrix +_gluProject +_gluPwlCurve +_gluQuadricCallback +_gluQuadricDrawStyle +_gluQuadricNormals +_gluQuadricOrientation +_gluQuadricTexture +_gluScaleImage +_gluSphere +_gluTessBeginContour +_gluTessBeginPolygon +_gluTessCallback +_gluTessEndContour +_gluTessEndPolygon +_gluTessNormal +_gluTessProperty +_gluTessVertex +_gluUnProject +_gluUnProject4 diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/include/gluos.h xpsb-glx-0.19/mesa/src/glu/sgi/include/gluos.h --- xpsb-glx-0.19/mesa/src/glu/sgi/include/gluos.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/include/gluos.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,72 @@ +/* +** gluos.h - operating system dependencies for GLU +** +*/ +#ifdef __VMS +#ifdef __cplusplus +#pragma message disable nocordel +#pragma message disable codeunreachable +#pragma message disable codcauunr +#endif +#endif + +#ifdef __WATCOMC__ +/* Disable *lots* of warnings to get a clean build. I can't be bothered fixing the + * code at the moment, as it is pretty ugly. + */ +#pragma warning 7 10 +#pragma warning 13 10 +#pragma warning 14 10 +#pragma warning 367 10 +#pragma warning 379 10 +#pragma warning 726 10 +#pragma warning 836 10 +#endif + +#ifdef BUILD_FOR_SNAP + +#include +#include +#include + +#elif defined(_WIN32) + +#include /* For _MAX_PATH definition */ +#include +#include + +#define WIN32_LEAN_AND_MEAN +#define NOGDI +#define NOIME +#define NOMINMAX + +#define _WIN32_WINNT 0x0400 +#ifndef STRICT + #define STRICT 1 +#endif + +#include + +/* Disable warnings */ +#pragma warning(disable : 4101) +#pragma warning(disable : 4244) +#pragma warning(disable : 4761) + +#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1300 +#pragma comment(linker, "/OPT:NOWIN98") +#endif + +#elif defined(__OS2__) + +#include +#include +#include +#define WINGDIAPI + +#else + +/* Disable Microsoft-specific keywords */ +#define GLAPIENTRY +#define WINGDIAPI + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,260 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include +#include +#include "bezierEval.h" + +#ifdef __WATCOMC__ +#pragma warning 14 10 +#endif + +#define TOLERANCE 0.0001 + +#ifndef MAX_ORDER +#define MAX_ORDER 16 +#endif + +#ifndef MAX_DIMENSION +#define MAX_DIMENSION 4 +#endif + +static void normalize(float vec[3]); +static void crossProduct(float x[3], float y[3], float ret[3]); +#if 0 // UNUSED +static void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]); +#endif + +static float binomialCoefficients[8][8] = { + {1,0,0,0,0,0,0,0}, + {1,1,0,0,0,0,0,0}, + {1,2,1,0,0,0,0,0}, + {1,3,3,1,0,0,0,0}, + {1,4,6,4,1,0,0,0}, + {1,5,10,10,5,1,0,0}, + {1,6,15,20,15,6,1,0}, + {1,7,21,35,35,21,7,1} +}; + +void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]) +{ + float uprime = (u-u0)/(u1-u0); + float *ctlptr = ctlpoints; + float oneMinusX = 1.0f-uprime; + float XPower = 1.0f; + + int i,k; + for(k=0; k=1. + */ +void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]) +{ + float uprime = (u-u0)/(u1-u0); + float buf[MAX_ORDER][MAX_ORDER][MAX_DIMENSION]; + float* ctlptr = ctlpoints; + int r, i,j; + for(i=0; i=1. + */ +void bezierCurveEvalDer(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]) +{ + int i,k; + float width = u1-u0; + float *ctlptr = ctlpoints; + + float buf[MAX_ORDER][MAX_DIMENSION]; + if(order == 1){ + for(k=0; k=3 && dimension <=4); + bezierSurfEvalDerGen(1,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialU); + bezierSurfEvalDerGen(0,1, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialV); + + if(dimension == 3){/*inhomogeneous*/ + crossProduct(partialU, partialV, retNormal); + + normalize(retNormal); + + return; + } + else { /*homogeneous*/ + float val[4]; /*the point coordinates (without derivative)*/ + float newPartialU[MAX_DIMENSION]; + float newPartialV[MAX_DIMENSION]; + int i; + bezierSurfEvalDerGen(0,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, val); + + for(i=0; i<=2; i++){ + newPartialU[i] = partialU[i] * val[3] - val[i] * partialU[3]; + newPartialV[i] = partialV[i] * val[3] - val[i] * partialV[3]; + } + crossProduct(newPartialU, newPartialV, retNormal); + normalize(retNormal); + } +} + +/*if size is 0, then nothing is done*/ +static void normalize(float vec[3]) +{ + float size = (float)sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]); + + if(size < TOLERANCE) + { +#ifdef DEBUG + fprintf(stderr, "Warning: in oglBSpline.c normal is 0\n"); +#endif + return; + } + else { + vec[0] = vec[0]/size; + vec[1] = vec[1]/size; + vec[2] = vec[2]/size; + } +} + + +static void crossProduct(float x[3], float y[3], float ret[3]) +{ + ret[0] = x[1]*y[2] - y[1]*x[2]; + ret[1] = x[2]*y[0] - y[2]*x[0]; + ret[2] = x[0]*y[1] - y[0]*x[1]; + +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierEval.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,48 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _BEZIEREVAL_H +#define _BEZIEREVAL_H + +void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]); +void bezierCurveEvalDer(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]); +void bezierCurveEvalDerGen(int der, float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]); + + +void bezierSurfEvalDerGen(int uder, int vder, float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]); + +void bezierSurfEval(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]); + +void bezierSurfEvalNormal(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float retNormal[]); + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,206 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include +#include /*for drawing bzier patch*/ +#include "bezierPatch.h" +#include "bezierEval.h" + +/* + *allocate an instance of bezierPatch. The control points are unknown. But + *the space of this array is allocated with size of + * uorder*vorder*dimension + * + */ +bezierPatch* bezierPatchMake(float umin, float vmin, float umax, float vmax, int uorder, int vorder, int dimension) +{ + bezierPatch* ret = (bezierPatch*) malloc(sizeof(bezierPatch)); + assert(ret); + ret->umin = umin; + ret->vmin = vmin; + ret->umax = umax; + ret->vmax = vmax; + ret->uorder = uorder; + ret->vorder = vorder; + ret->dimension = dimension; + ret->ctlpoints = (float*) malloc(sizeof(float) * dimension * uorder * vorder); + assert(ret->ctlpoints); + + ret->next = NULL; + + return ret; +} + +bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, int uorder, int vorder, int dimension, int ustride, int vstride, float* ctlpoints) +{ + bezierPatch* ret = (bezierPatch*) malloc(sizeof(bezierPatch)); + assert(ret); + ret->umin = umin; + ret->vmin = vmin; + ret->umax = umax; + ret->vmax = vmax; + ret->uorder = uorder; + ret->vorder = vorder; + ret->dimension = dimension; + ret->ctlpoints = (float*) malloc(sizeof(float) * dimension * uorder * vorder); + assert(ret->ctlpoints); + + /*copy the control points there*/ + int the_ustride = vorder * dimension; + int the_vstride = dimension; + for(int i=0; ictlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; + + ret->next = NULL; + + return ret; +} + +/* + *deallocate the space as allocated by Make + */ +void bezierPatchDelete(bezierPatch *b) +{ + free(b->ctlpoints); + free(b); +} + +/*delete the whole linked list + */ +void bezierPatchDeleteList(bezierPatch *b) +{ + bezierPatch *temp; + while (b != NULL) { + temp = b; + b = b->next; + bezierPatchDelete(temp); + } +} + +bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b) +{ + b->next = list; + return b; +} + +/*print the data stored in this patch*/ +void bezierPatchPrint(bezierPatch *b) +{ + printf("bezierPatch:\n"); + printf("umin,umax=(%f,%f), (vmin, vmax)=(%f,%f)\n", b->umin, b->umax, b->vmin, b->vmax); + printf("uorder=%i, vorder=%i\n", b->uorder, b->vorder); + printf("idmension = %i\n", b->dimension); +} + +/*print the whole list*/ +void bezierPatchPrintList(bezierPatch *list) +{ + bezierPatch* temp; + for(temp=list; temp != NULL; temp = temp->next) + bezierPatchPrint(temp); +} + +void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]) +{ + if( u >= b->umin && u<= b->umax + && v >= b->vmin && v<= b->vmax) + { + + bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + + } + else if(b->next != NULL) + bezierPatchEval(b->next, u,v, ret); + else + bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); +} + +/*the returned normal is normlized + */ +void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]) +{ + bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + + if( u >= b->umin && u<= b->umax + && v >= b->vmin && v<= b->vmax) + { + bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + } + else if(b->next != NULL) + bezierPatchEvalNormal(b->next, u,v, ret); + else + bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + +} + +void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso) +{ + if(bpatch->dimension == 3) + glMap2f(GL_MAP2_VERTEX_3, bpatch->umin, bpatch->umax, 3*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); + else + glMap2f(GL_MAP2_VERTEX_4, bpatch->umin, bpatch->umax, 4*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); + + glMapGrid2f(u_reso, bpatch->umin, bpatch->umax, + v_reso, bpatch->vmin, bpatch->vmax); + glEvalMesh2(GL_LINE, 0, u_reso, 0, v_reso); +} + +void bezierPatchListDraw(bezierPatch *list, int u_reso, int v_reso) +{ + bezierPatch *temp; +glEnable(GL_LIGHTING); +glEnable(GL_LIGHT0); +glEnable(GL_MAP2_VERTEX_3); +glEnable(GL_AUTO_NORMAL); +glEnable(GL_NORMALIZE); +glColor3f(1,0,0); +#ifdef DEBUG +printf("mapmap\n"); +#endif + + + for(temp = list; temp != NULL; temp = temp->next) + bezierPatchDraw(temp, u_reso, v_reso); +} + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatch.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,104 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _BEZIERPATCH_H +#define _BEZIERPATCH_H + +typedef struct bezierPatch{ + float umin, vmin, umax, vmax; + int uorder; /*order= degree + 1*/ + int vorder; + + /* + *the control points are stored in a one dimensional array. + *the surface is defined as: + * s(u,v) = sum_{i,j} P(i,j) * B_i(u) * B_j(v). + *where P(i,j) are the control points, B_i(.) are Bezier + *basis functions. + *Each control point can have dimension 3 or 4: (x,y,z,w). + *The components of P(i,j) are stored in a one dimensional + *array: + * ctlpoints[] + *in the order of: + * P[0,0], P[0,1], ..., P[0,vorder-1], + * P[1,0], P[1,1], ..., P[1,vorder-1], + * ... + * P[uorder-1,0], P[uorder-1,1], ..., P[uorder-1,vorder-1]. + */ + int dimension; + float* ctlpoints; + + /* + *in case we have to manage multiple bezierPatches. + */ + struct bezierPatch *next; + +} bezierPatch; + +#ifdef __cplusplus +extern "C" { +#endif + +bezierPatch* bezierPatchMake(float umin, float vmin, float umax, float vmax, int urder, int vorder, int dimension); + +bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, int urder, int vorder, int dimension, int ustride, int vstride, float *ctlpoints); + + +bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b); + +void bezierPatchDelete(bezierPatch *b); + +void bezierPatchDeleteList(bezierPatch *b); + +void bezierPatchPrint(bezierPatch *b); + +void bezierPatchPrintList(bezierPatch *list); + +void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]); + +void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float retNormal[]); + +void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]); + +void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]); + + +void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso); + +void bezierPatchListDraw(bezierPatch *list, int u_reso, int v_reso); + +#ifdef __cplusplus +} +#endif + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,610 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include +#include +#include "bezierEval.h" +#include "bezierPatchMesh.h" + +static int isDegenerate(float A[2], float B[2], float C[2]); + +void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips) +{ + int i,j,k; + k=0; + /*k is the index of the first component of the current vertex*/ + for(i=0; inext) + { + bezierPatchMeshDelDeg(temp); + } +} + +void bezierPatchMeshListDelete(bezierPatchMesh *list) +{ + if(list == NULL) return; + bezierPatchMeshListDelete(list->next); + bezierPatchMeshDelete(list); +} + + + + +bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list) +{ + bezierPatchMesh* ret=NULL; + bezierPatchMesh* temp; + bezierPatchMesh* nextone; + for(temp = list; temp != NULL; temp = nextone) + { + nextone = temp->next; + ret=bezierPatchMeshListInsert(ret, temp); + } + return ret; +} + +/*maptype is either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 + */ +bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array) +{ + int i,j,k; + int dimension; + int the_ustride; + int the_vstride; + + if(maptype == GL_MAP2_VERTEX_3) dimension = 3; + else if (maptype==GL_MAP2_VERTEX_4) dimension = 4; + else { + fprintf(stderr, "error in inMap2f, maptype=%i is wrong, maptype,map is invalid\n", maptype); + return NULL; + } + + bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh)); + assert(ret); + + ret->bpatch_normal = NULL; + ret->bpatch_color = NULL; + ret->bpatch_texcoord = NULL; + ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension); + + /*copy the control points there*/ + the_ustride = vorder * dimension; + the_vstride = dimension; + for(i=0; ibpatch->ctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; + + + ret->size_UVarray = size_UVarray; + ret->size_length_array = size_length_array; + ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray); + assert(ret->UVarray); + ret->length_array = (int *)malloc(sizeof(int) * size_length_array); + assert(ret->length_array); + ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array); + assert(ret->type_array); + + ret->index_UVarray = 0; + ret->index_length_array = 0; + + ret->vertex_array = NULL; + ret->normal_array = NULL; + ret->color_array = NULL; + ret->texcoord_array = NULL; + + ret->next = NULL; + return ret; +} + +bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array) +{ + bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh)); + assert(ret); + + ret->bpatch = NULL; + ret->bpatch_normal = NULL; + ret->bpatch_color = NULL; + ret->bpatch_texcoord = NULL; + + ret->size_UVarray = size_UVarray; + ret->size_length_array = size_length_array; + ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray); + assert(ret->UVarray); + ret->length_array = (int *)malloc(sizeof(int) * size_length_array); + assert(ret->length_array); + ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array); + assert(ret->type_array); + + ret->index_UVarray = 0; + ret->index_length_array = 0; + + ret->vertex_array = NULL; + ret->normal_array = NULL; + ret->color_array = NULL; + ret->texcoord_array = NULL; + + ret->next = NULL; + return ret; +} + +void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints) +{ + switch(maptype){ + case GL_MAP2_VERTEX_3: + bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); + break; + case GL_MAP2_VERTEX_4: + bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4,ustride, vstride, ctlpoints ); + break; + case GL_MAP2_NORMAL: + bpm->bpatch_normal = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); + break; + case GL_MAP2_INDEX: + bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints); + break; + case GL_MAP2_COLOR_4: + bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); + break; + case GL_MAP2_TEXTURE_COORD_1: + bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints); + break; + case GL_MAP2_TEXTURE_COORD_2: + bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 2, ustride, vstride, ctlpoints); + break; + case GL_MAP2_TEXTURE_COORD_3: + bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); + break; + case GL_MAP2_TEXTURE_COORD_4: + bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); + break; + default: + fprintf(stderr, "error in bezierPatchMeshPutPatch, maptype=%i is wrong, maptype,map is invalid\n", maptype); + } +} + + +/*delete everything including the arrays. So if you want to output the + *pointers of the arrays, you should not use this function to deallocate space. + *you should dealocate manually + */ +void bezierPatchMeshDelete(bezierPatchMesh *bpm) +{ + if(bpm->bpatch != NULL) + bezierPatchDelete(bpm->bpatch); + if(bpm->bpatch_normal != NULL) + bezierPatchDelete(bpm->bpatch_normal); + if(bpm->bpatch_color != NULL) + bezierPatchDelete(bpm->bpatch_color); + if(bpm->bpatch_texcoord != NULL) + bezierPatchDelete(bpm->bpatch_texcoord); + + free(bpm->UVarray); + free(bpm->length_array); + free(bpm->vertex_array); + free(bpm->normal_array); + free(bpm->type_array); + free(bpm); +} + +/*begin a strip + *type is the primitive type: + */ +void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type) +{ + bpm->counter = 0; + bpm->type = type; +} + +/*signal the end of the current strip*/ +void bezierPatchMeshEndStrip(bezierPatchMesh *bpm) +{ + int i; + + /*if there are no vertices in this strip, then nothing needs to be done*/ + if(bpm->counter == 0) return; + + /*if the length_array is full, it should be expanded*/ + if(bpm->index_length_array >= bpm->size_length_array) + { + int *temp = (int*) malloc(sizeof(int) * (bpm->size_length_array*2 + 1)); + assert(temp); + GLenum *temp_type = (GLenum*) malloc(sizeof(GLenum) * (bpm->size_length_array*2 + 1)); + assert(temp_type); + /*update the size*/ + bpm->size_length_array = bpm->size_length_array*2 + 1; + + /*copy*/ + for(i=0; iindex_length_array; i++) + { + temp[i] = bpm->length_array[i]; + temp_type[i] = bpm->type_array[i]; + } + + /*deallocate old array*/ + free(bpm->length_array); + free(bpm->type_array); + + /*point to the new array which is twice as bigger*/ + bpm->length_array = temp; + bpm->type_array = temp_type; + } + bpm->type_array[bpm->index_length_array] = bpm->type; + bpm->length_array[bpm->index_length_array++] = bpm->counter; + +} + +/*insert (u,v) */ +void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v) +{ + int i; + /*if the UVarray is full, it should be expanded*/ + if(bpm->index_UVarray+1 >= bpm->size_UVarray) + { + float *temp = (float*) malloc(sizeof(float) * (bpm->size_UVarray * 2 + 2)); + assert(temp); + + /*update the size*/ + bpm->size_UVarray = bpm->size_UVarray*2 + 2; + + /*copy*/ + for(i=0; iindex_UVarray; i++) + { + temp[i] = bpm->UVarray[i]; + } + + /*deallocate old array*/ + free(bpm->UVarray); + + /*pointing to the new arrays*/ + bpm->UVarray = temp; + } + /*insert the new UV*/ + bpm->UVarray[bpm->index_UVarray] = u; + bpm->index_UVarray++; + bpm->UVarray[bpm->index_UVarray] = v; + bpm->index_UVarray++; + + /*update counter: one more vertex*/ + bpm->counter++; + + +} + +void bezierPatchMeshPrint(bezierPatchMesh *bpm) +{ + int i; + printf("the bezier patch is\n"); + bezierPatchPrint(bpm->bpatch); + printf("index_length_array= %i\n", bpm->index_length_array); + printf("size_length_array =%i\n", bpm->size_length_array); + printf("index_UVarray =%i\n", bpm->index_UVarray); + printf("size_UVarray =%i\n", bpm->size_UVarray); + printf("UVarray is\n"); + for(i=0; iindex_UVarray; i++) + printf("%f ", bpm->UVarray[i]); + + printf("length_array is\n"); + for(i=0; iindex_length_array; i++) + printf("%i ", bpm->length_array[i]); + printf("\n"); + +} + +/*insert a new patch in front of the current linked list and return the new list*/ +bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm) +{ + bpm->next=list; + return bpm; +} + +/*print all the patches*/ +void bezierPatchMeshListPrint(bezierPatchMesh* list) +{ + bezierPatchMesh *temp; + for(temp = list; temp != NULL; temp = temp->next) + { + bezierPatchMeshPrint(temp); + } +} + +int bezierPatchMeshListTotalStrips(bezierPatchMesh* list) +{ + int sum=0; + bezierPatchMesh *temp; + for(temp=list; temp != NULL; temp = temp->next) + { + sum += temp->index_length_array; + } + return sum; +} + +int bezierPatchMeshListTotalVert(bezierPatchMesh* list) +{ + int sum=0; + bezierPatchMesh *temp; + for(temp=list; temp != NULL; temp = temp->next) + { + sum += temp->index_UVarray; + } + return sum/2; +} + +int bezierPatchMeshListNumTriangles(bezierPatchMesh* list) +{ + int sum=0; + bezierPatchMesh* temp; + for(temp=list; temp != NULL; temp = temp->next) + { + sum += bezierPatchMeshNumTriangles(temp); + } + return sum; +} + +int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm) +{ + int i; + int sum=0; + for(i=0; iindex_length_array; i++) + { + switch(bpm->type_array[i]) + { + case GL_TRIANGLES: + sum += bpm->length_array[i]/3; + break; + case GL_TRIANGLE_FAN: + if(bpm->length_array[i] > 2) + sum += bpm->length_array[i]-2; + break; + case GL_TRIANGLE_STRIP: + if(bpm->length_array[i] > 2) + sum += bpm->length_array[i]-2; + break; + case GL_QUAD_STRIP: + if(bpm->length_array[i]>2) + sum += (bpm->length_array[i]-2); + break; + default: + fprintf(stderr,"error in bezierPatchMeshListNumTriangles, type invalid\n"); + } + } + return sum; +} + +/*delete degenerate triangles*/ +void bezierPatchMeshDelDeg(bezierPatchMesh* bpm) +{ + if(bpm == NULL) return; + int i,j,k; + int *new_length_array; + GLenum *new_type_array; + int index_new_length_array; + float *new_UVarray; + int index_new_UVarray; + + new_length_array = (int*)malloc(sizeof(int) * bpm->index_length_array); + assert(new_length_array); + new_type_array = (GLenum*)malloc(sizeof(GLenum) * bpm->index_length_array); + assert(new_length_array); + new_UVarray = (float*) malloc(sizeof(float) * bpm->index_UVarray); + assert(new_UVarray); + + index_new_length_array = 0; + index_new_UVarray=0; + k=0; + for(i=0; iindex_length_array; i++){ + + /*(if not degenerate, we have to copy*/ + if( (bpm->length_array[i] != 3) || (!isDegenerate(bpm->UVarray+k, bpm->UVarray+k+2, bpm->UVarray+k+4))) + { + for(j=0; j<2* bpm->length_array[i]; j++) + new_UVarray[index_new_UVarray++] = bpm->UVarray[k++]; + + new_length_array[index_new_length_array] = bpm->length_array[i]; + new_type_array[index_new_length_array] = bpm->type_array[i]; + index_new_length_array++; + } + else + { + k += 6; + } + } + free(bpm->UVarray); + free(bpm->length_array); + free(bpm->type_array); + bpm->UVarray=new_UVarray; + bpm->length_array=new_length_array; + bpm->type_array=new_type_array; + bpm->index_UVarray = index_new_UVarray; + bpm->index_length_array = index_new_length_array; + +} + +/*(u,v) to XYZ + *the xyz and normals are stored in vertex_array, + *and normal_array. the spaces of both are allocated here + */ +void bezierPatchMeshEval(bezierPatchMesh* bpm) +{ + int i,j,k,l; + float u,v; + float u0 = bpm->bpatch->umin; + float u1 = bpm->bpatch->umax; + int uorder = bpm->bpatch->uorder; + float v0 = bpm->bpatch->vmin; + float v1 = bpm->bpatch->vmax; + int vorder = bpm->bpatch->vorder; + int dimension = bpm->bpatch->dimension; + int ustride = dimension * vorder; + int vstride = dimension; + float *ctlpoints = bpm->bpatch->ctlpoints; + + bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); + assert(bpm->vertex_array); + bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); + assert(bpm->normal_array); + + k=0; + l=0; + for(i=0; iindex_length_array; i++) + { + for(j=0; jlength_array[i]; j++) + { + u = bpm->UVarray[k]; + v = bpm->UVarray[k+1]; + bezierSurfEval(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->vertex_array+l); + bezierSurfEvalNormal(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->normal_array+l); + k += 2; + l += 3; + } + } +} + +void bezierPatchMeshListEval(bezierPatchMesh* list) +{ + bezierPatchMesh* temp; + for(temp = list; temp != NULL; temp = temp->next) + { + bezierPatchMeshEval(temp); + } +} + +void bezierPatchMeshDraw(bezierPatchMesh* bpm) +{ + int i,j,k; + k=0; + /*k is the index of the first component of the current vertex*/ + for(i=0; iindex_length_array; i++) + { + glBegin(bpm->type_array[i]); + for(j=0; jlength_array[i]; j++) + { + glNormal3fv(bpm->normal_array+k); + glVertex3fv(bpm->vertex_array+k); + k+= 3; + } + glEnd(); + } +} + +void bezierPatchMeshListDraw(bezierPatchMesh* list) +{ + bezierPatchMesh* temp; + for(temp = list; temp != NULL; temp = temp->next) + { + bezierPatchMeshDraw(temp); + } +} + +void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips) +{ + int i,j,k,l; + bezierPatchMesh *temp; + int total_num_vertices = bezierPatchMeshListTotalVert(list); + (*vertex_array) = (float *) malloc(sizeof(float) * total_num_vertices*3); + assert(*vertex_array); + (*normal_array) = (float *) malloc(sizeof(float) * total_num_vertices*3); + assert(*normal_array); + + *num_strips = bezierPatchMeshListTotalStrips(list); + + *length_array = (int*) malloc(sizeof(int) * (*num_strips)); + assert(*length_array); + + *type_array = (GLenum*) malloc(sizeof(GLenum) * (*num_strips)); + assert(*type_array); + + k=0; + l=0; + for(temp = list; temp != NULL; temp = temp->next) + { + int x=0; + for(i=0; iindex_length_array; i++) + { + for(j=0; jlength_array[i]; j++) + { + (*vertex_array)[k] = temp->vertex_array[x]; + (*vertex_array)[k+1] = temp->vertex_array[x+1]; + (*vertex_array)[k+2] = temp->vertex_array[x+2]; + + (*normal_array)[k] = temp->normal_array[x]; + (*normal_array)[k+1] = temp->normal_array[x+1]; + (*normal_array)[k+2] = temp->normal_array[x+2]; + + x += 3; + k += 3; + } + (*type_array)[l] = temp->type_array[i]; + (*length_array)[l++] = temp->length_array[i]; + } + } +} + + + +static int isDegenerate(float A[2], float B[2], float C[2]) +{ + if( (A[0] == B[0] && A[1]==B[1]) || + (A[0] == C[0] && A[1]==C[1]) || + (B[0] == C[0] && B[1]==C[1]) + ) + return 1; + else + return 0; +} + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,120 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _BEZIERPATCHMESH_H +#define _BEZIERPATCHMESH_H + +#include "bezierPatch.h" + +typedef struct bezierPatchMesh{ + bezierPatch *bpatch; /*vertex*/ + bezierPatch *bpatch_normal; + bezierPatch *bpatch_texcoord; /*s,t,r,q*/ + bezierPatch *bpatch_color; /*RGBA*/ + + float *UVarray; /*all UV components of all vertices of all strips*/ + int *length_array; /*[i] is the number of vertices in the ith strip*/ + GLenum *type_array; /*[i] is the type of the ith primitive*/ + + /*to support dynamic insertion*/ + int size_UVarray; + int index_UVarray; + int size_length_array; + int index_length_array; + + int counter; /*track the current strip size*/ + GLenum type; /*track the current type: 0: GL_TRIANGLES, 1: GL_TRIANGLE_STRIP*/ + + /*we eventually want to evaluate from (u,v) to (x,y,z) and draw them*/ + float *vertex_array; /*each vertex contains three components*/ + float *normal_array; /*each normal contains three components*/ + float *color_array; + float *texcoord_array; + + /*in case we need a linked list*/ + struct bezierPatchMesh *next; +} bezierPatchMesh; + +#ifdef __cplusplus +extern "C" { +#endif + + + +bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array); + +/*initilize patches to be null*/ +bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array); + +void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints); + +void bezierPatchMeshDelete(bezierPatchMesh *bpm); + +void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type); + +void bezierPatchMeshEndStrip(bezierPatchMesh *bpm); + +void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v); + +void bezierPatchMeshPrint(bezierPatchMesh *bpm); + +bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm); + +void bezierPatchMeshListPrint(bezierPatchMesh* list); + +int bezierPatchMeshListTotalStrips(bezierPatchMesh* list); + +int bezierPatchMeshListTotalVert(bezierPatchMesh* list); +int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm); +int bezierPatchMeshListNumTriangles(bezierPatchMesh* list); + +void bezierPatchMeshDelDeg(bezierPatchMesh* bpm); + + +void bezierPatchMeshEval(bezierPatchMesh* bpm); + +void bezierPatchMeshDraw(bezierPatchMesh* bpm); + +void bezierPatchMeshListDraw(bezierPatchMesh* list); +void bezierPatchMeshListEval(bezierPatchMesh* list); +void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips); + +void bezierPatchMeshListDelDeg(bezierPatchMesh* list); +void bezierPatchMeshListDelete(bezierPatchMesh *list); +bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list); +void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips); + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,402 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * glcurveval.c++ + * + */ + +/* Polynomial Evaluator Interface */ + +#include "gluos.h" +#include "glimports.h" +#include "glrenderer.h" +#include "glcurveval.h" +#include "nurbsconsts.h" + +OpenGLCurveEvaluator::OpenGLCurveEvaluator(void) +{ + //no default callback functions + beginCallBackN = NULL; + endCallBackN = NULL; + vertexCallBackN = NULL; + normalCallBackN = NULL; + colorCallBackN = NULL; + texcoordCallBackN = NULL; + beginCallBackData = NULL; + endCallBackData = NULL; + vertexCallBackData = NULL; + normalCallBackData = NULL; + colorCallBackData = NULL; + texcoordCallBackData = NULL; + + userData = NULL; + + vertex_flag = 0; + normal_flag = 0; + color_flag = 0; + texcoord_flag = 0; + + em_vertex.uprime = -1.0; + em_normal.uprime = -1.0; + em_color.uprime = -1.0; + em_texcoord.uprime = -1.0; + output_triangles = 0; // don't output triangles by default +} + +OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void) +{ +} + +/* added nonsense to avoid the warning messages at compile time */ +void +OpenGLCurveEvaluator::addMap(CurveMap *m) +{ + m = m; +} + +void +OpenGLCurveEvaluator::range1f(long type, REAL *from, REAL *to) +{ + type = type; + from = from; + to = to; +} + +void +OpenGLCurveEvaluator::domain1f(REAL ulo, REAL uhi) +{ + ulo = ulo; + uhi = uhi; +} + +void +OpenGLCurveEvaluator::bgnline(void) +{ + if(output_triangles) + beginCallBack(GL_LINE_STRIP, userData); + else + glBegin((GLenum) GL_LINE_STRIP); +} + +void +OpenGLCurveEvaluator::endline(void) +{ + if(output_triangles) + endCallBack(userData); + else + glEnd(); +} + +/*--------------------------------------------------------------------------- + * disable - turn off a curve map + *--------------------------------------------------------------------------- + */ +void +OpenGLCurveEvaluator::disable(long type) +{ + glDisable((GLenum) type); +} + +/*--------------------------------------------------------------------------- + * enable - turn on a curve map + *--------------------------------------------------------------------------- + */ +void +OpenGLCurveEvaluator::enable(long type) +{ + glEnable((GLenum) type); +} + +/*------------------------------------------------------------------------- + * mapgrid1f - define a lattice of points with origin and offset + *------------------------------------------------------------------------- + */ +void +OpenGLCurveEvaluator::mapgrid1f(long nu, REAL u0, REAL u1) +{ + if(output_triangles) + { + global_grid_u0 = u0; + global_grid_u1 = u1; + global_grid_nu = (int) nu; + } + else + glMapGrid1f((GLint) nu, (GLfloat) u0, (GLfloat) u1); +} + +/*------------------------------------------------------------------------- + * bgnmap1 - preamble to curve definition and evaluations + *------------------------------------------------------------------------- + */ +void +OpenGLCurveEvaluator::bgnmap1f(long) +{ + if(output_triangles) + { + //initialized so that no maps are set initially + vertex_flag = 0; + normal_flag = 0; + color_flag = 0; + texcoord_flag = 0; + //no need to worry about gl states when doing callback + } + else + glPushAttrib((GLbitfield) GL_EVAL_BIT); +} + +/*------------------------------------------------------------------------- + * endmap1 - postamble to a curve map + *------------------------------------------------------------------------- + */ +void +OpenGLCurveEvaluator::endmap1f(void) +{ + if(output_triangles) + { + + } + else + glPopAttrib(); +} + +/*------------------------------------------------------------------------- + * map1f - pass a desription of a curve map + *------------------------------------------------------------------------- + */ +void +OpenGLCurveEvaluator::map1f( + long type, /* map type */ + REAL ulo, /* lower parametric bound */ + REAL uhi, /* upper parametric bound */ + long stride, /* distance to next point in REALS */ + long order, /* parametric order */ + REAL *pts /* control points */ +) +{ + if(output_triangles) + { + int dimension = 0; + int which = 0; + switch(type){ + case GL_MAP1_VERTEX_3: + which = 0; + dimension = 3; + break; + case GL_MAP1_VERTEX_4: + which=0; + dimension = 4; + break; + case GL_MAP1_INDEX: + which=2; + dimension = 1; + break; + case GL_MAP1_COLOR_4: + which=2; + dimension = 4; + break; + case GL_MAP1_NORMAL: + which=1; + dimension = 3; + break; + case GL_MAP1_TEXTURE_COORD_1: + which=3; + dimension = 1; + break; + case GL_MAP1_TEXTURE_COORD_2: + which=3; + dimension = 2; + break; + + case GL_MAP1_TEXTURE_COORD_3: + which=3; + dimension = 3; + break; + case GL_MAP1_TEXTURE_COORD_4: + which=3; + dimension = 4; + break; + } + inMap1f(which, dimension, ulo, uhi, stride, order, pts); + } + else + glMap1f((GLenum) type, (GLfloat) ulo, (GLfloat) uhi, (GLint) stride, + (GLint) order, (const GLfloat *) pts); +} + +/*------------------------------------------------------------------------- + * mapmesh1f - evaluate a mesh of points on lattice + *------------------------------------------------------------------------- + */ +void OpenGLCurveEvaluator::mapmesh1f(long style, long from, long to) +{ + if(output_triangles) + { + inMapMesh1f((int) from, (int) to); + } + else + { + switch(style) { + default: + case N_MESHFILL: + case N_MESHLINE: + glEvalMesh1((GLenum) GL_LINE, (GLint) from, (GLint) to); + break; + case N_MESHPOINT: + glEvalMesh1((GLenum) GL_POINT, (GLint) from, (GLint) to); + break; + } + } +} + +/*------------------------------------------------------------------------- + * evalpoint1i - evaluate a point on a curve + *------------------------------------------------------------------------- + */ +void OpenGLCurveEvaluator::evalpoint1i(long i) +{ + glEvalPoint1((GLint) i); +} + +/*------------------------------------------------------------------------- + * evalcoord1f - evaluate a point on a curve + *------------------------------------------------------------------------- + */ +void OpenGLCurveEvaluator::evalcoord1f(long, REAL u) +{ + glEvalCoord1f((GLfloat) u); +} + +void +#ifdef _WIN32 +OpenGLCurveEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)()) +#else +OpenGLCurveEvaluator::putCallBack(GLenum which, _GLUfuncptr fn) +#endif +{ + switch(which) + { + case GLU_NURBS_BEGIN: + beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn; + break; + case GLU_NURBS_END: + endCallBackN = (void (GLAPIENTRY *) (void)) fn; + break; + case GLU_NURBS_VERTEX: + vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_NORMAL: + normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_COLOR: + colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_TEXTURE_COORD: + texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_BEGIN_DATA: + beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn; + break; + case GLU_NURBS_END_DATA: + endCallBackData = (void (GLAPIENTRY *) (void*)) fn; + break; + case GLU_NURBS_VERTEX_DATA: + vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + case GLU_NURBS_NORMAL_DATA: + normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + case GLU_NURBS_COLOR_DATA: + colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + case GLU_NURBS_TEXTURE_COORD_DATA: + texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + } +} + +void +OpenGLCurveEvaluator::beginCallBack(GLenum which, void *data) +{ + if(beginCallBackData) + beginCallBackData(which, data); + else if(beginCallBackN) + beginCallBackN(which); +} + +void +OpenGLCurveEvaluator::endCallBack(void *data) +{ + if(endCallBackData) + endCallBackData(data); + else if(endCallBackN) + endCallBackN(); +} + +void +OpenGLCurveEvaluator::vertexCallBack(const GLfloat *vert, void* data) +{ + if(vertexCallBackData) + vertexCallBackData(vert, data); + else if(vertexCallBackN) + vertexCallBackN(vert); +} + + +void +OpenGLCurveEvaluator::normalCallBack(const GLfloat *normal, void* data) +{ + if(normalCallBackData) + normalCallBackData(normal, data); + else if(normalCallBackN) + normalCallBackN(normal); +} + +void +OpenGLCurveEvaluator::colorCallBack(const GLfloat *color, void* data) +{ + if(colorCallBackData) + colorCallBackData(color, data); + else if(colorCallBackN) + colorCallBackN(color); +} + +void +OpenGLCurveEvaluator::texcoordCallBack(const GLfloat *texcoord, void* data) +{ + if(texcoordCallBackData) + texcoordCallBackData(texcoord, data); + else if(texcoordCallBackN) + texcoordCallBackN(texcoord); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glcurveval.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,157 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * glcurveval.h + * + */ + +#ifndef __gluglcurveval_h_ +#define __gluglcurveval_h_ + +#include "gluos.h" +#include +#include +#include "basiccrveval.h" + +class CurveMap; + +/*for internal evaluator callback stuff*/ +#ifndef IN_MAX_BEZIER_ORDER +#define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ +#endif + +#ifndef IN_MAX_DIMENSION +#define IN_MAX_DIMENSION 4 +#endif + +typedef struct curveEvalMachine{ + REAL uprime; //cached previously evaluated uprime + int k; //the dimension + REAL u1; + REAL u2; + int ustride; + int uorder; + REAL ctlpoints[IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION]; + REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values +} curveEvalMachine; + +class OpenGLCurveEvaluator : public BasicCurveEvaluator { +public: + OpenGLCurveEvaluator(void); + virtual ~OpenGLCurveEvaluator(void); + void range1f(long, REAL *, REAL *); + void domain1f(REAL, REAL); + void addMap(CurveMap *); + + void enable(long); + void disable(long); + void bgnmap1f(long); + void map1f(long, REAL, REAL, long, long, REAL *); + void mapgrid1f(long, REAL, REAL); + void mapmesh1f(long, long, long); + void evalpoint1i(long); + void evalcoord1f(long, REAL); + void endmap1f(void); + + void bgnline(void); + void endline(void); + + void put_vertices_call_back(int flag) + { + output_triangles = flag; + } +#ifdef _WIN32 + void putCallBack(GLenum which, void (GLAPIENTRY *fn)() ); +#else + void putCallBack(GLenum which, _GLUfuncptr fn ); +#endif + void set_callback_userData(void *data) + { + userData = data; + } + +/*------------------begin for curveEvalMachine------------*/ +curveEvalMachine em_vertex; +curveEvalMachine em_normal; +curveEvalMachine em_color; +curveEvalMachine em_texcoord; +int vertex_flag; //whether there is a vertex map or not +int normal_flag; //whether there is a normal map or not +int color_flag; //whether there is a color map or not +int texcoord_flag; //whether there is a texture map or not + +REAL global_grid_u0; +REAL global_grid_u1; +int global_grid_nu; + +void inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex + int dimension, + REAL ulower, + REAL uupper, + int ustride, + int uorder, + REAL *ctlpoints); + +void inPreEvaluate(int order, REAL vprime, REAL *coeff); +void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint); +void inDoEvalCoord1(REAL u); +void inMapMesh1f(int umin, int umax); + +void (GLAPIENTRY *beginCallBackN) (GLenum type); +void (GLAPIENTRY *endCallBackN) (void); +void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert); +void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal); +void (GLAPIENTRY *colorCallBackN) (const GLfloat *color); +void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord); + +void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data); +void (GLAPIENTRY *endCallBackData) (void* data); +void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data); +void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data); +void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data); +void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data); + +void* userData; //the opaque pointer for Data callback functions +void beginCallBack(GLenum type, void* data); +void endCallBack(void* data); +void vertexCallBack(const GLfloat *vert, void *data); +void normalCallBack(const GLfloat *normal, void* data); +void colorCallBack(const GLfloat *color, void* data); +void texcoordCallBack(const GLfloat *texcoord, void* data); + + +/*------------------end for curveEvalMachine------------*/ + +private: + int output_triangles; //true 1; false 0 +}; + +#endif /* __gluglcurveval_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glimports.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glimports.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glimports.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glimports.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * glimports.h + * + */ + +#ifndef __gluimports_h_ +#define __gluimports_h_ + +#include "mystdlib.h" +#include "mystdio.h" + +#endif /* __gluimports_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glinterface.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glinterface.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glinterface.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glinterface.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,469 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include +#include "glimports.h" +#include "glrenderer.h" +#include "nurbsconsts.h" + +//#define DOWN_LOAD_NURBS +#ifdef DOWN_LOAD_NURBS + +#include "oglTrimNurbs.h" +static int surfcount = 0; +static oglTrimNurbs* otn = NULL; +nurbSurf* tempNurb = NULL; +oglTrimLoops* tempTrim = NULL; +#endif + + +//for LOD +extern "C" {void glu_LOD_eval_list(GLUnurbs *nurb, int level);} + +void glu_LOD_eval_list(GLUnurbs *nurb, int level) +{ + nurb->LOD_eval_list(level); +} + +GLUnurbs * GLAPIENTRY +gluNewNurbsRenderer(void) +{ + GLUnurbs *t; + + t = new GLUnurbs(); + return t; +} + +void GLAPIENTRY +gluDeleteNurbsRenderer(GLUnurbs *r) +{ + delete r; +} + +extern "C" +void GLAPIENTRY + +gluDeleteNurbsTessellatorEXT(GLUnurbsObj *r) +{ + delete r; +} + +void GLAPIENTRY +gluBeginSurface(GLUnurbs *r) +{ +#ifdef DOWN_LOAD_NURBS +surfcount++; +tempTrim = OTL_make(10,10); +#endif + r->bgnsurface(0); +} + +void GLAPIENTRY +gluBeginCurve(GLUnurbs *r) +{ + r->bgncurve(0); +} + +void GLAPIENTRY +gluEndCurve(GLUnurbs *r) +{ + r->endcurve(); +} + +void GLAPIENTRY +gluEndSurface(GLUnurbs *r) +{ +#ifdef DOWN_LOAD_NURBS +if(surfcount == 1) + otn = OTN_make(1); +OTN_insert(otn, tempNurb, tempTrim); +if(surfcount >= 1) +{ +#ifdef DEBUG +printf("write file\n"); +#endif +OTN_write(otn, "out.otn"); + +} +#endif + + r->endsurface(); +} + +void GLAPIENTRY +gluBeginTrim(GLUnurbs *r) +{ +#ifdef DOWN_LOAD_NURBS +OTL_bgnTrim(tempTrim); +#endif + + r->bgntrim(); +} + +void GLAPIENTRY +gluEndTrim(GLUnurbs *r) +{ +#ifdef DOWN_LOAD_NURBS +OTL_endTrim(tempTrim); +#endif + r->endtrim(); +} + +void GLAPIENTRY +gluPwlCurve(GLUnurbs *r, GLint count, INREAL array[], + GLint stride, GLenum type) +{ +#ifdef DOWN_LOAD_NURBS +OTL_pwlCurve(tempTrim, count, array, stride, type); +#endif + + int realType; + switch(type) { + case GLU_MAP1_TRIM_2: + realType = N_P2D; + break; + case GLU_MAP1_TRIM_3: + realType = N_P2DR; + break; + default: + realType = type; + break; + } + r->pwlcurve(count, array, sizeof(INREAL) * stride, realType); +} + +void GLAPIENTRY +gluNurbsCurve(GLUnurbs *r, GLint nknots, INREAL knot[], GLint stride, + INREAL ctlarray[], GLint order, GLenum type) +{ +#ifdef DOWN_LOAD_NURBS +OTL_nurbsCurve(tempTrim, nknots, knot, stride, ctlarray, order, type); +#endif + + int realType; + + switch(type) { + case GLU_MAP1_TRIM_2: + realType = N_P2D; + break; + case GLU_MAP1_TRIM_3: + realType = N_P2DR; + break; + default: + realType = type; + break; + } + + r->nurbscurve(nknots, knot, sizeof(INREAL) * stride, ctlarray, order, + realType); +} + +void GLAPIENTRY +gluNurbsSurface(GLUnurbs *r, GLint sknot_count, GLfloat *sknot, + GLint tknot_count, GLfloat *tknot, + GLint s_stride, GLint t_stride, + GLfloat *ctlarray, GLint sorder, GLint torder, + GLenum type) +{ +#ifdef DOWN_LOAD_NURBS + { + int dimension; + switch(type){ + case GL_MAP2_VERTEX_3: + dimension = 3; + break; + case GL_MAP2_VERTEX_4: + dimension = 4; + break; + default: + fprintf(stderr, "error in glinterface.c++, type no implemented\n"); + exit(1); + } +tempNurb = nurbSurfMake(sknot_count, sknot, + tknot_count, tknot, + sorder, torder, + dimension, + ctlarray, + s_stride, t_stride); + + } +#endif + + r->nurbssurface(sknot_count, sknot, tknot_count, tknot, + sizeof(INREAL) * s_stride, sizeof(INREAL) * t_stride, + ctlarray, sorder, torder, type); +} + +void GLAPIENTRY +gluLoadSamplingMatrices(GLUnurbs *r, const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4]) +{ + r->useGLMatrices(modelMatrix, projMatrix, viewport); +} + +void GLAPIENTRY +gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) +{ + GLfloat nurbsValue; + + switch (property) { + case GLU_AUTO_LOAD_MATRIX: + r->setautoloadmode(value); + return; + + case GLU_CULLING: + if (value != 0.0) { + nurbsValue = N_CULLINGON; + } else { + nurbsValue = N_NOCULLING; + } + r->setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLING, nurbsValue); + r->setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLING, nurbsValue); + r->setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLING, nurbsValue); + r->setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLING, nurbsValue); + return; + + case GLU_SAMPLING_METHOD: + if (value == GLU_PATH_LENGTH) { + nurbsValue = N_PATHLENGTH; + } else if (value == GLU_PARAMETRIC_ERROR) { + nurbsValue = N_PARAMETRICDISTANCE; + } else if (value == GLU_DOMAIN_DISTANCE) { + nurbsValue = N_DOMAINDISTANCE; + r->set_is_domain_distance_sampling(1); //optimzing untrimmed case + + } else if (value == GLU_OBJECT_PARAMETRIC_ERROR) { + nurbsValue = N_OBJECTSPACE_PARA; + r->setautoloadmode( 0.0 ); + r->setSamplingMatrixIdentity(); + } else if (value == GLU_OBJECT_PATH_LENGTH) { + nurbsValue = N_OBJECTSPACE_PATH; + r->setautoloadmode( 0.0 ); + r->setSamplingMatrixIdentity(); + } else { + r->postError(GLU_INVALID_VALUE); + return; + } + + r->setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, nurbsValue); + r->setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMETHOD, nurbsValue); + r->setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMETHOD, nurbsValue); + r->setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMETHOD, nurbsValue); + return; + + case GLU_SAMPLING_TOLERANCE: + r->setnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value); + r->setnurbsproperty(GL_MAP2_VERTEX_4, N_PIXEL_TOLERANCE, value); + r->setnurbsproperty(GL_MAP1_VERTEX_3, N_PIXEL_TOLERANCE, value); + r->setnurbsproperty(GL_MAP1_VERTEX_4, N_PIXEL_TOLERANCE, value); + return; + + case GLU_PARAMETRIC_TOLERANCE: + r->setnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, value); + r->setnurbsproperty(GL_MAP2_VERTEX_4, N_ERROR_TOLERANCE, value); + r->setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, value); + r->setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, value); + return; + + + case GLU_DISPLAY_MODE: + + if (value == GLU_FILL) { + nurbsValue = N_FILL; + } else if (value == GLU_OUTLINE_POLYGON) { + nurbsValue = N_OUTLINE_POLY; + } else if (value == GLU_OUTLINE_PATCH) { + nurbsValue = N_OUTLINE_PATCH; + } else { + r->postError(GLU_INVALID_VALUE); + return; + } + r->setnurbsproperty(N_DISPLAY, nurbsValue); + + break; + + case GLU_U_STEP: + r->setnurbsproperty(GL_MAP1_VERTEX_3, N_S_STEPS, value); + r->setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, value); + r->setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value); + r->setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, value); + + //added for optimizing untrimmed case + r->set_domain_distance_u_rate(value); + break; + + case GLU_V_STEP: + r->setnurbsproperty(GL_MAP1_VERTEX_3, N_T_STEPS, value); + r->setnurbsproperty(GL_MAP1_VERTEX_4, N_T_STEPS, value); + r->setnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, value); + r->setnurbsproperty(GL_MAP2_VERTEX_4, N_T_STEPS, value); + + //added for optimizing untrimmed case + r->set_domain_distance_v_rate(value); + break; + + case GLU_NURBS_MODE: + if(value == GLU_NURBS_RENDERER) + r->put_callbackFlag(0); + else if(value == GLU_NURBS_TESSELLATOR) + r->put_callbackFlag(1); + else + r->postError(GLU_INVALID_ENUM); + break; + + default: + r->postError(GLU_INVALID_ENUM); + return; + } +} + +void GLAPIENTRY +gluGetNurbsProperty(GLUnurbs *r, GLenum property, GLfloat *value) +{ + GLfloat nurbsValue; + + switch(property) { + case GLU_AUTO_LOAD_MATRIX: + if (r->getautoloadmode()) { + *value = GL_TRUE; + } else { + *value = GL_FALSE; + } + break; + case GLU_CULLING: + r->getnurbsproperty(GL_MAP2_VERTEX_3, N_CULLING, &nurbsValue); + if (nurbsValue == N_CULLINGON) { + *value = GL_TRUE; + } else { + *value = GL_FALSE; + } + break; + case GLU_SAMPLING_METHOD: + r->getnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, value); + if(*value == N_PATHLENGTH) + *value = GLU_PATH_LENGTH; + else if(*value == N_PARAMETRICDISTANCE) + *value = GLU_PARAMETRIC_ERROR; + else if(*value == N_DOMAINDISTANCE) + *value = GLU_DOMAIN_DISTANCE; + else if(*value == N_OBJECTSPACE_PATH) + *value = GLU_OBJECT_PATH_LENGTH; + else if(*value == N_OBJECTSPACE_PARA) + *value = GLU_OBJECT_PARAMETRIC_ERROR; + break; + case GLU_SAMPLING_TOLERANCE: + r->getnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value); + break; + case GLU_PARAMETRIC_TOLERANCE: + r->getnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, value); + break; + + case GLU_U_STEP: + r->getnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value); + break; + case GLU_V_STEP: + r->getnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, value); + break; + case GLU_DISPLAY_MODE: + r->getnurbsproperty(N_DISPLAY, &nurbsValue); + if (nurbsValue == N_FILL) { + *value = GLU_FILL; + } else if (nurbsValue == N_OUTLINE_POLY) { + *value = GLU_OUTLINE_POLYGON; + } else { + *value = GLU_OUTLINE_PATCH; + } + break; + + case GLU_NURBS_MODE: + if(r->is_callback()) + *value = GLU_NURBS_TESSELLATOR; + else + *value = GLU_NURBS_RENDERER; + break; + + default: + r->postError(GLU_INVALID_ENUM); + return; + } +} + +extern "C" void GLAPIENTRY +gluNurbsCallback(GLUnurbs *r, GLenum which, _GLUfuncptr fn ) +{ + switch (which) { + case GLU_NURBS_BEGIN: + case GLU_NURBS_END: + case GLU_NURBS_VERTEX: + case GLU_NURBS_NORMAL: + case GLU_NURBS_TEXTURE_COORD: + case GLU_NURBS_COLOR: + case GLU_NURBS_BEGIN_DATA: + case GLU_NURBS_END_DATA: + case GLU_NURBS_VERTEX_DATA: + case GLU_NURBS_NORMAL_DATA: + case GLU_NURBS_TEXTURE_COORD_DATA: + case GLU_NURBS_COLOR_DATA: + r->putSurfCallBack(which, fn); + break; + + case GLU_NURBS_ERROR: + r->errorCallback = (void (APIENTRY *)( GLenum e )) fn; + break; + default: + r->postError(GLU_INVALID_ENUM); + return; + } +} + +extern "C" +void GLAPIENTRY +gluNurbsCallbackDataEXT(GLUnurbs* r, void* userData) +{ + r->setNurbsCallbackData(userData); +} + +extern "C" +void GLAPIENTRY +gluNurbsCallbackData(GLUnurbs* r, void* userData) +{ + gluNurbsCallbackDataEXT(r,userData); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,301 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include "glimports.h" +#include "glrenderer.h" + +GLUnurbs::GLUnurbs() + : NurbsTessellator(curveEvaluator, surfaceEvaluator) +{ + redefineMaps(); + defineMap(GL_MAP2_NORMAL, 0, 3); + defineMap(GL_MAP1_NORMAL, 0, 3); + defineMap(GL_MAP2_TEXTURE_COORD_1, 0, 1); + defineMap(GL_MAP1_TEXTURE_COORD_1, 0, 1); + defineMap(GL_MAP2_TEXTURE_COORD_2, 0, 2); + defineMap(GL_MAP1_TEXTURE_COORD_2, 0, 2); + defineMap(GL_MAP2_TEXTURE_COORD_3, 0, 3); + defineMap(GL_MAP1_TEXTURE_COORD_3, 0, 3); + defineMap(GL_MAP2_TEXTURE_COORD_4, 1, 4); + defineMap(GL_MAP1_TEXTURE_COORD_4, 1, 4); + defineMap(GL_MAP2_VERTEX_4, 1, 4); + defineMap(GL_MAP1_VERTEX_4, 1, 4); + defineMap(GL_MAP2_VERTEX_3, 0, 3); + defineMap(GL_MAP1_VERTEX_3, 0, 3); + defineMap(GL_MAP2_COLOR_4, 0, 4); + defineMap(GL_MAP1_COLOR_4, 0, 4); + defineMap(GL_MAP2_INDEX, 0, 1); + defineMap(GL_MAP1_INDEX, 0, 1); + + setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); + setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); + setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); + setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); + + setnurbsproperty(GL_MAP1_VERTEX_3, N_PIXEL_TOLERANCE, (float) 50.0); + setnurbsproperty(GL_MAP1_VERTEX_4, N_PIXEL_TOLERANCE, (float) 50.0); + setnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, (float) 50.0); + setnurbsproperty(GL_MAP2_VERTEX_4, N_PIXEL_TOLERANCE, (float) 50.0); + + setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, (float) 0.50); + setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, (float) 0.50); + setnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, (float) 0.50); + setnurbsproperty(GL_MAP2_VERTEX_4, N_ERROR_TOLERANCE, (float) 0.50); + + setnurbsproperty(GL_MAP1_VERTEX_3, N_S_STEPS, (float) 100.0); + setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, (float) 100.0); + setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, (float) 100.0); + setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, (float) 100.0); + + //added for optimizing untrimmed case + set_domain_distance_u_rate(100.0); + + setnurbsproperty(GL_MAP1_VERTEX_3, N_T_STEPS, (float) 100.0); + setnurbsproperty(GL_MAP1_VERTEX_4, N_T_STEPS, (float) 100.0); + setnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, (float) 100.0); + setnurbsproperty(GL_MAP2_VERTEX_4, N_T_STEPS, (float) 100.0); + + //added for optimizing untrimmed case + set_domain_distance_v_rate(100.0); + set_is_domain_distance_sampling(0); //since the default is path_length + + //default autoloadmode is true + autoloadmode = 1; + + //default callbackFlag is 0 + callbackFlag = 0; + + errorCallback = NULL; +} + +void +GLUnurbs::bgnrender(void) +{ + if (autoloadmode) { + loadGLMatrices(); + } +} + +void +GLUnurbs::endrender(void) +{ +} + +void +GLUnurbs::errorHandler(int i) +{ + int gluError; + + gluError = i + (GLU_NURBS_ERROR1 - 1); + postError( gluError ); +} + +void +GLUnurbs::loadGLMatrices(void) +{ + GLfloat vmat[4][4]; + GLint viewport[4]; + + grabGLMatrix((GLfloat (*)[4]) vmat); + loadCullingMatrix((GLfloat (*)[4]) vmat); + ::glGetIntegerv((GLenum) GL_VIEWPORT, (GLint *) viewport); + loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport); +} + +void +GLUnurbs::useGLMatrices(const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4]) +{ + GLfloat vmat[4][4]; + + multmatrix4d(vmat, (const GLfloat (*)[4]) modelMatrix, + (const GLfloat (*)[4]) projMatrix); + loadCullingMatrix((GLfloat (*)[4]) vmat); + loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport); +} + +/*-------------------------------------------------------------------------- + * grabGLMatrix + *-------------------------------------------------------------------------- + */ + +void +GLUnurbs::grabGLMatrix(GLfloat vmat[4][4]) +{ + GLfloat m1[4][4], m2[4][4]; + + ::glGetFloatv((GLenum) GL_MODELVIEW_MATRIX, (GLfloat *) &(m1[0][0])); + ::glGetFloatv((GLenum) GL_PROJECTION_MATRIX, (GLfloat *) &(m2[0][0])); + multmatrix4d((GLfloat (*)[4]) vmat, + (const GLfloat (*)[4]) m1, (const GLfloat (*)[4]) m2); +} + +//for object space tesselation: view independent +void +GLUnurbs::setSamplingMatrixIdentity( void ) +{ + INREAL smat[4][4] = { + {1,0,0,0}, + {0,1,0,0}, + {0,0,1,0}, + {0,0,0,1} + }; + const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]); + const long cstride = 1; + + setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); +} + + +void +GLUnurbs::loadSamplingMatrix(const GLfloat vmat[4][4], + const GLint viewport[4]) +{ + + /* rescale the mapping to correspond to pixels in x/y */ + REAL xsize = 0.5 * (REAL) (viewport[2]); + REAL ysize = 0.5 * (REAL) (viewport[3]); + + INREAL smat[4][4]; + smat[0][0] = vmat[0][0] * xsize; + smat[1][0] = vmat[1][0] * xsize; + smat[2][0] = vmat[2][0] * xsize; + smat[3][0] = vmat[3][0] * xsize; + + smat[0][1] = vmat[0][1] * ysize; + smat[1][1] = vmat[1][1] * ysize; + smat[2][1] = vmat[2][1] * ysize; + smat[3][1] = vmat[3][1] * ysize; + + smat[0][2] = 0.0; + smat[1][2] = 0.0; + smat[2][2] = 0.0; + smat[3][2] = 0.0; + + smat[0][3] = vmat[0][3]; + smat[1][3] = vmat[1][3]; + smat[2][3] = vmat[2][3]; + smat[3][3] = vmat[3][3]; + + const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]); + const long cstride = 1; + + setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + cstride); +} + +void +GLUnurbs::loadCullingMatrix(GLfloat vmat[4][4]) +{ + INREAL cmat[4][4]; + + cmat[0][0] = vmat[0][0]; + cmat[0][1] = vmat[0][1]; + cmat[0][2] = vmat[0][2]; + cmat[0][3] = vmat[0][3]; + + cmat[1][0] = vmat[1][0]; + cmat[1][1] = vmat[1][1]; + cmat[1][2] = vmat[1][2]; + cmat[1][3] = vmat[1][3]; + + cmat[2][0] = vmat[2][0]; + cmat[2][1] = vmat[2][1]; + cmat[2][2] = vmat[2][2]; + cmat[2][3] = vmat[2][3]; + + cmat[3][0] = vmat[3][0]; + cmat[3][1] = vmat[3][1]; + cmat[3][2] = vmat[3][2]; + cmat[3][3] = vmat[3][3]; + + const long rstride = sizeof(cmat[0]) / sizeof(cmat[0][0]); + const long cstride = 1; + + setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, + cstride); + //added for curves by zl + setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, + cstride); + setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, + cstride); +} + +/*--------------------------------------------------------------------- + * A = B * MAT ; transform a 4d vector through a 4x4 matrix + *--------------------------------------------------------------------- + */ +void +GLUnurbs::transform4d(GLfloat A[4], GLfloat B[4], GLfloat mat[4][4]) +{ + + A[0] = B[0]*mat[0][0] + B[1]*mat[1][0] + B[2]*mat[2][0] + B[3]*mat[3][0]; + A[1] = B[0]*mat[0][1] + B[1]*mat[1][1] + B[2]*mat[2][1] + B[3]*mat[3][1]; + A[2] = B[0]*mat[0][2] + B[1]*mat[1][2] + B[2]*mat[2][2] + B[3]*mat[3][2]; + A[3] = B[0]*mat[0][3] + B[1]*mat[1][3] + B[2]*mat[2][3] + B[3]*mat[3][3]; +} + +/*--------------------------------------------------------------------- + * new = [left][right] ; multiply two matrices together + *--------------------------------------------------------------------- + */ +void +GLUnurbs::multmatrix4d (GLfloat n[4][4], const GLfloat left[4][4], + const GLfloat right[4][4]) +{ + transform4d ((GLfloat *) n[0],(GLfloat *) left[0],(GLfloat (*)[4]) right); + transform4d ((GLfloat *) n[1],(GLfloat *) left[1],(GLfloat (*)[4]) right); + transform4d ((GLfloat *) n[2],(GLfloat *) left[2],(GLfloat (*)[4]) right); + transform4d ((GLfloat *) n[3],(GLfloat *) left[3],(GLfloat (*)[4]) right); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glrenderer.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,146 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * glrenderer.h + * + */ + +#ifndef __gluglrenderer_h_ +#define __gluglrenderer_h_ + +#include +#include +#include "nurbstess.h" +#include "glsurfeval.h" +#include "glcurveval.h" + +extern "C" { + typedef void (APIENTRY *errorCallbackType)( GLenum ); +} + +class GLUnurbs : public NurbsTessellator { + +public: + GLUnurbs( void ); + void loadGLMatrices( void ); + void useGLMatrices( const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4] ); + void setSamplingMatrixIdentity( void ); + + void errorHandler( int ); + void bgnrender( void ); + void endrender( void ); + void setautoloadmode( INREAL value ) + { + + if (value) autoloadmode = GL_TRUE; + else autoloadmode = GL_FALSE; + + } + GLboolean getautoloadmode( void ) { return autoloadmode; } + + errorCallbackType errorCallback; + void postError( int which ) + { if (errorCallback) (errorCallback)( (GLenum)which ); } +#ifdef _WIN32 + void putSurfCallBack(GLenum which, void (GLAPIENTRY *fn)() ) +#else + void putSurfCallBack(GLenum which, _GLUfuncptr fn ) +#endif + { + curveEvaluator.putCallBack(which, fn); + surfaceEvaluator.putCallBack(which, fn); + } + + int get_vertices_call_back() + { + return surfaceEvaluator.get_vertices_call_back(); + } + + void put_vertices_call_back(int flag) + { + surfaceEvaluator.put_vertices_call_back(flag); + } + + int get_callback_auto_normal() + { + return surfaceEvaluator.get_callback_auto_normal(); + } + + void put_callback_auto_normal(int flag) + { + surfaceEvaluator.put_callback_auto_normal(flag); + } + + void setNurbsCallbackData(void* userData) + { + curveEvaluator.set_callback_userData(userData); + surfaceEvaluator.set_callback_userData(userData); + } + + + //for LOD + void LOD_eval_list(int level) + { + surfaceEvaluator.LOD_eval_list(level); + } + + //NEWCALLBACK + int is_callback() + { + return callbackFlag; + } + void put_callbackFlag(int flag) + { + callbackFlag = flag; + surfaceEvaluator.put_vertices_call_back(flag); + curveEvaluator.put_vertices_call_back(flag); + } + +private: + GLboolean autoloadmode; + OpenGLSurfaceEvaluator surfaceEvaluator; + OpenGLCurveEvaluator curveEvaluator; + + void loadSamplingMatrix( const GLfloat vmat[4][4], + const GLint viewport[4] ); + void loadCullingMatrix( GLfloat vmat[4][4] ); + static void grabGLMatrix( GLfloat vmat[4][4] ); + static void transform4d( GLfloat A[4], GLfloat B[4], + GLfloat mat[4][4] ); + static void multmatrix4d( GLfloat n[4][4], const GLfloat left[4][4], + const GLfloat right[4][4] ); + + int callbackFlag; +}; + +#endif /* __gluglrenderer_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1293 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * glsurfeval.c++ + * + */ + +/* Polynomial Evaluator Interface */ +#include "gluos.h" +#include +#include "glimports.h" +#include "glrenderer.h" +#include "glsurfeval.h" +#include "nurbsconsts.h" +#include "bezierPatchMesh.h" + + +//extern int surfcount; +//int surfcount=0; + +/*#define USE_INTERNAL_EVAL*/ //use internal evaluator + +/*whether do evaluation or not*/ +/*#define NO_EVALUATION*/ + +//#define USE_LOD //for LOD test, have to turn on USE_LOD in insurfeval.c++ too + +/*for statistics*/ +//#define STATISTICS +#ifdef STATISTICS +static int STAT_num_of_triangles=0; +static int STAT_num_of_eval_vertices=0; +static int STAT_num_of_quad_strips=0; +#endif + +/*for output triangles*/ +/*#define OUTPUT_TRIANGLES*/ + + +/*#define FOR_CHRIS*/ +#ifdef FOR_CHRIS +extern "C" { void evalUStripExt(int n_upper, REAL v_upper, REAL* upper_val, + int n_lower, REAL v_lower, REAL* lower_val);} + +extern "C" { void evalVStripExt(int n_left, REAL u_left, REAL* left_val, + int n_right, REAL u_right, REAL* right_val); + } +#endif + + +/**************begin for LOD_eval_list***********/ +void OpenGLSurfaceEvaluator::LOD_eval_list(int level) +{ + if(level == 0) + LOD_eval_level = 1; + else if(level == 1) + LOD_eval_level = 2; + else if(level == 2) + LOD_eval_level = 4; + else + LOD_eval_level = 8; + + inBPMListEvalEM(global_bpm); +} + + +OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator() +{ + int i; + + for (i=0; i= n_upper) /*case1: no more in upper*/ + { + if(j= n_lower) /*case2: no more in lower*/ + { + if(i=i; k--) /*reverse order for two-side lighting*/ + { + coord2f(upper_val[k], v_upper); +// glNormal3fv(upperNormal[k]); +// glVertex3fv(upperXYZ[k]); + } + + endtfan(); + } + break; /*exit the main loop*/ + } + else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ + { + if(upper_val[i] <= lower_val[j]) + { + bgntfan(); + coord2f(lower_val[j], v_lower); +// glNormal3fv(lowerNormal[j]); +// glVertex3fv(lowerXYZ[j]); + + /*find the last k>=i such that + *upperverts[k][0] <= lowerverts[j][0] + */ + k=i; + + while(k lower_val[j]) + break; + k++; + + } + k--; + + + for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ + { + coord2f(upper_val[l], v_upper); +// glNormal3fv(upperNormal[l]); +// glVertex3fv(upperXYZ[l]); + + } + coord2f(leftMostV[0], leftMostV[1]); +// glNormal3fv(leftMostNormal); +// glVertex3fv(leftMostXYZ); + + endtfan(); + + /*update i and leftMostV for next loop + */ + i = k+1; + + leftMostV[0] = upper_val[k]; + leftMostV[1] = v_upper; +// leftMostNormal = upperNormal[k]; +// leftMostXYZ = upperXYZ[k]; + } + else /*upperVerts[i][0] > lowerVerts[j][0]*/ + { + bgntfan(); + coord2f(upper_val[i], v_upper); +// glNormal3fv(upperNormal[i]); +// glVertex3fv(upperXYZ[i]); + + coord2f(leftMostV[0], leftMostV[1]); +// glNormal3fv(leftMostNormal); +// glVertex3fv(leftMostXYZ); + + + /*find the last k>=j such that + *lowerverts[k][0] < upperverts[i][0] + */ + k=j; + while(k< n_lower) + { + if(lower_val[k] >= upper_val[i]) + break; + coord2f(lower_val[k], v_lower); +// glNormal3fv(lowerNormal[k]); +// glVertex3fv(lowerXYZ[k]); + + k++; + } + endtfan(); + + /*update j and leftMostV for next loop + */ + j=k; + leftMostV[0] = lower_val[j-1]; + leftMostV[1] = v_lower; + +// leftMostNormal = lowerNormal[j-1]; +// leftMostXYZ = lowerXYZ[j-1]; + } + } + } + //clean up +// free(upperXYZ); +// free(lowerXYZ); +// free(upperNormal); +// free(lowerNormal); +#endif + +} + + +void +OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val) +{ +#ifdef USE_INTERNAL_EVAL + inEvalVStrip(n_left, u_left, left_val, + n_right, u_right, right_val); +#else + +#ifdef FOR_CHRIS + evalVStripExt(n_left, u_left, left_val, + n_right, u_right, right_val); + return; + +#endif + + int i,j,k,l; + REAL botMostV[2]; + /* + *the algorithm works by scanning from bot to top. + *botMostV: the bot most of the remaining verteces (on both left and right). + * it could an element of leftVerts or rightVerts. + *i: leftVerts[i] is the first vertex to the top of botMostV on left line + *j: rightVerts[j] is the first vertex to the top of botMostV on rightline + */ + + /*initialize i,j,and botMostV + */ + if(left_val[0] <= right_val[0]) + { + i=1; + j=0; + + botMostV[0] = u_left; + botMostV[1] = left_val[0]; + } + else + { + i=0; + j=1; + + botMostV[0] = u_right; + botMostV[1] = right_val[0]; + } + + /*the main loop. + *the invariance is that: + *at the beginning of each loop, the meaning of i,j,and botMostV are + *maintained + */ + while(1) + { + if(i >= n_left) /*case1: no more in left*/ + { + if(j= n_right) /*case2: no more in right*/ + { + if(i=i; k--) /*reverse order for two-side lighting*/ + { + coord2f(u_left, left_val[k]); +// glNormal3fv(leftNormal[k]); +// glVertex3fv(leftXYZ[k]); + } + + endtfan(); + } + break; /*exit the main loop*/ + } + else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/ + { + if(left_val[i] <= right_val[j]) + { + bgntfan(); + coord2f(u_right, right_val[j]); +// glNormal3fv(rightNormal[j]); +// glVertex3fv(rightXYZ[j]); + + /*find the last k>=i such that + *leftverts[k][0] <= rightverts[j][0] + */ + k=i; + + while(k right_val[j]) + break; + k++; + + } + k--; + + + for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ + { + coord2f(u_left, left_val[l]); +// glNormal3fv(leftNormal[l]); +// glVertex3fv(leftXYZ[l]); + + } + coord2f(botMostV[0], botMostV[1]); +// glNormal3fv(botMostNormal); +// glVertex3fv(botMostXYZ); + + endtfan(); + + /*update i and botMostV for next loop + */ + i = k+1; + + botMostV[0] = u_left; + botMostV[1] = left_val[k]; +// botMostNormal = leftNormal[k]; +// botMostXYZ = leftXYZ[k]; + } + else /*left_val[i] > right_val[j])*/ + { + bgntfan(); + coord2f(u_left, left_val[i]); +// glNormal3fv(leftNormal[i]); +// glVertex3fv(leftXYZ[i]); + + coord2f(botMostV[0], botMostV[1]); +// glNormal3fv(botMostNormal); +// glVertex3fv(botMostXYZ); + + + /*find the last k>=j such that + *rightverts[k][0] < leftverts[i][0] + */ + k=j; + while(k< n_right) + { + if(right_val[k] >= left_val[i]) + break; + coord2f(u_right, right_val[k]); +// glNormal3fv(rightNormal[k]); +// glVertex3fv(rightXYZ[k]); + + k++; + } + endtfan(); + + /*update j and botMostV for next loop + */ + j=k; + botMostV[0] = u_right; + botMostV[1] = right_val[j-1]; + +// botMostNormal = rightNormal[j-1]; +// botMostXYZ = rightXYZ[j-1]; + } + } + } + //clean up +// free(leftXYZ); +// free(leftNormal); +// free(rightXYZ); +// free(rightNormal); +#endif +} + + +void +OpenGLSurfaceEvaluator::bgnqstrip(void) +{ + if(output_triangles) + bezierPatchMeshBeginStrip(global_bpm, GL_QUAD_STRIP); + else + glBegin((GLenum) GL_QUAD_STRIP); + +#ifdef STATISTICS + STAT_num_of_quad_strips++; +#endif +} + +void +OpenGLSurfaceEvaluator::endqstrip(void) +{ + if(output_triangles) + bezierPatchMeshEndStrip(global_bpm); + else + glEnd(); + +} + +/*------------------------------------------------------------------------- + * bgnmap2f - preamble to surface definition and evaluations + *------------------------------------------------------------------------- + */ +void +OpenGLSurfaceEvaluator::bgnmap2f(long) +{ + if(output_triangles) + { + /*deallocate the space which may has been + *allocated by global_bpm previously + */ + if(global_bpm != NULL) { + bezierPatchMeshListDelete(global_bpm); + global_bpm = NULL; + } + + + /* + auto_normal_flag = 1; //always output normal in callback mode. + //we could have used the following code, + //but Inspector doesn't have gl context + //before it calls tessellator. + //this way is temporary. + */ + //NEWCALLBACK + //if one of the two normal callback functions are set, + //then set + if(normalCallBackN != NULL || + normalCallBackData != NULL) + auto_normal_flag = 1; + else + auto_normal_flag = 0; + + //initialize so that no maps initially + vertex_flag = 0; + normal_flag = 0; + color_flag = 0; + texcoord_flag = 0; + + /* + if(glIsEnabled(GL_AUTO_NORMAL) == GL_TRUE) + auto_normal_flag = 1; + else if (callback_auto_normal == 1) + auto_normal_flag = 1; + else + auto_normal_flag = 0; + */ + glPushAttrib((GLbitfield) GL_EVAL_BIT); + + } + else + { + glPushAttrib((GLbitfield) GL_EVAL_BIT); + + /*to avoid side effect, we restor the opengl state for GL_POLYGON_MODE + */ + glGetIntegerv(GL_POLYGON_MODE, gl_polygon_mode); + } + +} + +/*------------------------------------------------------------------------- + * endmap2f - postamble to a map + *------------------------------------------------------------------------- + */ +void +OpenGLSurfaceEvaluator::endmap2f(void) +{ + + if(output_triangles) + { + //bezierPatchMeshListDelDeg(global_bpm); + + // bezierPatchMeshListEval(global_bpm); + + //surfcount++; + //printf("surfcount=%i\n", surfcount); + //if(surfcount == 8) exit(0); + + inBPMListEvalEM(global_bpm); + + + +/* + global_bpm = bezierPatchMeshListReverse(global_bpm); + { + float *vertex_array; + float *normal_array; + int *length_array; + int *type_array; + int num_strips; + bezierPatchMeshListCollect(global_bpm, &vertex_array, &normal_array, &length_array, &type_array, &num_strips); + drawStrips(vertex_array, normal_array, length_array, type_array, num_strips); + free(vertex_array); + free(normal_array); + free(length_array); + free(type_array); + } +*/ + + //bezierPatchMeshListPrint(global_bpm); + //bezierPatchMeshListDraw(global_bpm); + +// printf("num triangles=%i\n", bezierPatchMeshListNumTriangles(global_bpm)); + +#ifdef USE_LOD +#else + bezierPatchMeshListDelete(global_bpm); + global_bpm = NULL; +#endif + glPopAttrib(); + } +else + { +#ifndef USE_LOD + glPopAttrib(); +#endif + +#ifdef STATISTICS + fprintf(stderr, "num_vertices=%i,num_triangles=%i,num_quads_strips=%i\n", STAT_num_of_eval_vertices,STAT_num_of_triangles,STAT_num_of_quad_strips); +#endif + + /*to restore the gl_polygon_mode + */ +#ifndef USE_LOD + glPolygonMode( GL_FRONT, (GLenum) gl_polygon_mode[0]); + glPolygonMode( GL_BACK, (GLenum) gl_polygon_mode[1]); +#endif +} + +} + +/*------------------------------------------------------------------------- + * map2f - pass a desription of a surface map + *------------------------------------------------------------------------- + */ +void +OpenGLSurfaceEvaluator::map2f( + long _type, + REAL _ulower, /* u lower domain coord */ + REAL _uupper, /* u upper domain coord */ + long _ustride, /* interpoint distance */ + long _uorder, /* parametric order */ + REAL _vlower, /* v lower domain coord */ + REAL _vupper, /* v upper domain coord */ + long _vstride, /* interpoint distance */ + long _vorder, /* parametric order */ + REAL *pts) /* control points */ +{ +#ifdef USE_INTERNAL_EVAL + inMap2f((int) _type, (REAL) _ulower, (REAL) _uupper, + (int) _ustride, (int) _uorder, (REAL) _vlower, + (REAL) _vupper, (int) _vstride, (int) _vorder, + (REAL *) pts); +#else + + + + if(output_triangles) + { + if(global_bpm == NULL) + global_bpm = bezierPatchMeshMake2(10,10); + if( + (global_bpm->bpatch == NULL && + (_type == GL_MAP2_VERTEX_3 || _type == GL_MAP2_VERTEX_4)) + || + (global_bpm->bpatch_normal == NULL && + (_type == GL_MAP2_NORMAL)) + || + (global_bpm->bpatch_color == NULL && + (_type == GL_MAP2_INDEX || _type == GL_MAP2_COLOR_4)) + || + (global_bpm->bpatch_texcoord == NULL && + (_type == GL_MAP2_TEXTURE_COORD_1 || + _type == GL_MAP2_TEXTURE_COORD_2 || + _type == GL_MAP2_TEXTURE_COORD_3 || + _type == GL_MAP2_TEXTURE_COORD_4 ) + )) + { + bezierPatchMeshPutPatch(global_bpm, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts); + } + else /*new surface patch (with multiple maps) starts*/ + { + bezierPatchMesh *temp = bezierPatchMeshMake2(10,10); + bezierPatchMeshPutPatch(temp, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts); + global_bpm = bezierPatchMeshListInsert(global_bpm, temp); + + /* + global_bpm = bezierPatchMeshListInsert(global_bpm, + bezierPatchMeshMake( + (int) _type, _ulower, _uupper,(int) _ustride, (int) _uorder, _vlower, _vupper, (int) _vstride, (int) _vorder, pts, 10, 10)); + */ + } + } + else /*not output triangles*/ + { + glMap2f((GLenum) _type, (GLfloat) _ulower, (GLfloat) _uupper, + (GLint) _ustride, (GLint) _uorder, (GLfloat) _vlower, + (GLfloat) _vupper, (GLint) _vstride, (GLint) _vorder, + (const GLfloat *) pts); + } + +#endif +} + + +/*------------------------------------------------------------------------- + * mapmesh2f - evaluate a mesh of points on lattice + *------------------------------------------------------------------------- + */ +void +OpenGLSurfaceEvaluator::mapmesh2f(long style, long umin, long umax, long vmin, long vmax) +{ +#ifdef NO_EVALUATION +return; +#endif + +#ifdef USE_INTERNAL_EVAL + inEvalMesh2((int)umin, (int)vmin, (int)umax, (int)vmax); +#else + + + +if(output_triangles) +{ +#ifdef USE_LOD + bezierPatchMeshBeginStrip(global_bpm, GL_POLYGON); + bezierPatchMeshInsertUV(global_bpm, global_grid_u0, global_grid_v0); + bezierPatchMeshInsertUV(global_bpm, global_grid_u1, global_grid_v1); + bezierPatchMeshInsertUV(global_bpm, (REAL)global_grid_nu, (REAL)global_grid_nv); + bezierPatchMeshInsertUV(global_bpm, (REAL)umin, (REAL)vmin); + bezierPatchMeshInsertUV(global_bpm, (REAL)umax, (REAL)vmax); + bezierPatchMeshEndStrip(global_bpm); + +#else + + REAL du, dv; + long i,j; + if(global_grid_nu == 0 || global_grid_nv == 0) + return; /*no points need to be output*/ + du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; + dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; + + if(global_grid_nu >= global_grid_nv){ + + for(i=umin; i=vmin; j--){ + REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); + + coord2f(u1, v1); + coord2f(u2, v1); + } + endqstrip(); + } + } + else{ + + for(i=vmin; i=umin; j--){ + REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); + coord2f(u1, v2); + coord2f(u1, v1); + } + endqstrip(); + } + } +#endif +} +else +{ + switch(style) { + default: + case N_MESHFILL: + glEvalMesh2((GLenum) GL_FILL, (GLint) umin, (GLint) umax, + (GLint) vmin, (GLint) vmax); + break; + case N_MESHLINE: + glEvalMesh2((GLenum) GL_LINE, (GLint) umin, (GLint) umax, + (GLint) vmin, (GLint) vmax); + break; + case N_MESHPOINT: + glEvalMesh2((GLenum) GL_POINT, (GLint) umin, (GLint) umax, + (GLint) vmin, (GLint) vmax); + break; + } + } + +#endif + +#ifdef STATISTICS + STAT_num_of_quad_strips += (umax-umin)*(vmax-vmin); +#endif +} + +/*------------------------------------------------------------------------- + * evalcoord2f - evaluate a point on a surface + *------------------------------------------------------------------------- + */ +void +OpenGLSurfaceEvaluator::evalcoord2f(long, REAL u, REAL v) +{ + + +#ifdef NO_EVALUATION +return; +#endif + + + newtmeshvert(u, v); +} + +/*------------------------------------------------------------------------- + * evalpoint2i - evaluate a grid point + *------------------------------------------------------------------------- + */ +void +OpenGLSurfaceEvaluator::evalpoint2i(long u, long v) +{ +#ifdef NO_EVALUATION +return; +#endif + + newtmeshvert(u, v); +} + +void +OpenGLSurfaceEvaluator::point2i( long u, long v ) +{ +#ifdef NO_EVALUATION +return; +#else + +#ifdef USE_INTERNAL_EVAL + inEvalPoint2( (int)u, (int)v); +#else + + +if(output_triangles) +{ + + REAL du, dv; + REAL fu,fv; + du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; + dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; + fu = (u==global_grid_nu)? global_grid_u1:(global_grid_u0 + u*du); + fv = (v == global_grid_nv)? global_grid_v1: (global_grid_v0 +v*dv); + coord2f(fu,fv); +} +else + glEvalPoint2((GLint) u, (GLint) v); + + +#endif + +#ifdef STATISTICS + STAT_num_of_eval_vertices++; +#endif + +#endif + +} + +void +OpenGLSurfaceEvaluator::coord2f( REAL u, REAL v ) +{ +#ifdef NO_EVALUATION +return; +#else + +#ifdef USE_INTERNAL_EVAL + inEvalCoord2f( u, v); +#else + + +if(output_triangles) + bezierPatchMeshInsertUV(global_bpm, u,v); +else + glEvalCoord2f((GLfloat) u, (GLfloat) v); + + +#endif + + +#ifdef STATISTICS + STAT_num_of_eval_vertices++; +#endif + +#endif +} + +void +OpenGLSurfaceEvaluator::newtmeshvert( long u, long v ) +{ +#ifdef NO_EVALUATION +return; +#else + + if (tmeshing) { + + if (vcount == 2) { + vertexCache[0]->invoke(this); + vertexCache[1]->invoke(this); + point2i( u, v); + + } else { + vcount++; + } + + vertexCache[which]->saveEvalPoint(u, v); + which = 1 - which; + } else { + point2i( u, v); + } +#endif +} + +void +OpenGLSurfaceEvaluator::newtmeshvert( REAL u, REAL v ) +{ +#ifdef NO_EVALUATION +return; +#else + if (tmeshing) { + + + if (vcount == 2) { + vertexCache[0]->invoke(this); + vertexCache[1]->invoke(this); + coord2f(u,v); + + } else { + vcount++; + } + + vertexCache[which]->saveEvalCoord(u, v); + which = 1 - which; + } else { + + coord2f( u, v); + } +#endif + +} + +#ifdef _WIN32 +void OpenGLSurfaceEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)() ) +#else +void OpenGLSurfaceEvaluator::putCallBack(GLenum which, _GLUfuncptr fn ) +#endif +{ + switch(which) + { + case GLU_NURBS_BEGIN: + beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn; + break; + case GLU_NURBS_END: + endCallBackN = (void (GLAPIENTRY *) (void)) fn; + break; + case GLU_NURBS_VERTEX: + vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_NORMAL: + normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_COLOR: + colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_TEXTURE_COORD: + texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; + break; + case GLU_NURBS_BEGIN_DATA: + beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn; + break; + case GLU_NURBS_END_DATA: + endCallBackData = (void (GLAPIENTRY *) (void*)) fn; + break; + case GLU_NURBS_VERTEX_DATA: + vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + case GLU_NURBS_NORMAL_DATA: + normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + case GLU_NURBS_COLOR_DATA: + colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + case GLU_NURBS_TEXTURE_COORD_DATA: + texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; + break; + + } +} + + +void +OpenGLSurfaceEvaluator::beginCallBack(GLenum which, void *data) +{ + if(beginCallBackData) + beginCallBackData(which, data); + else if(beginCallBackN) + beginCallBackN(which); +} + +void +OpenGLSurfaceEvaluator::endCallBack(void *data) +{ + if(endCallBackData) + endCallBackData(data); + else if(endCallBackN) + endCallBackN(); +} + +void +OpenGLSurfaceEvaluator::vertexCallBack(const GLfloat *vert, void* data) +{ + if(vertexCallBackData) + vertexCallBackData(vert, data); + else if(vertexCallBackN) + vertexCallBackN(vert); +} + + +void +OpenGLSurfaceEvaluator::normalCallBack(const GLfloat *normal, void* data) +{ + if(normalCallBackData) + normalCallBackData(normal, data); + else if(normalCallBackN) + normalCallBackN(normal); +} + +void +OpenGLSurfaceEvaluator::colorCallBack(const GLfloat *color, void* data) +{ + if(colorCallBackData) + colorCallBackData(color, data); + else if(colorCallBackN) + colorCallBackN(color); +} + +void +OpenGLSurfaceEvaluator::texcoordCallBack(const GLfloat *texcoord, void* data) +{ + if(texcoordCallBackData) + texcoordCallBackData(texcoord, data); + else if(texcoordCallBackN) + texcoordCallBackN(texcoord); +} + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/glsurfeval.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,404 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * glsurfeval.h + * + */ + +#ifndef __gluglsurfeval_h_ +#define __gluglsurfeval_h_ + +#include "basicsurfeval.h" +#include "bezierPatchMesh.h" //in case output triangles +#include +#include + +class SurfaceMap; +class OpenGLSurfaceEvaluator; +class StoredVertex; + +#define TYPECOORD 1 +#define TYPEPOINT 2 + +/* Cache up to 3 vertices from tmeshes */ +#define VERTEX_CACHE_SIZE 3 + +/*for internal evaluator callback stuff*/ +#ifndef IN_MAX_BEZIER_ORDER +#define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ +#endif + +#ifndef IN_MAX_DIMENSION +#define IN_MAX_DIMENSION 4 +#endif + +typedef struct surfEvalMachine{ + REAL uprime;//cached previusly evaluated uprime. + REAL vprime; + int k; /*the dimension*/ + REAL u1; + REAL u2; + int ustride; + int uorder; + REAL v1; + REAL v2; + int vstride; + int vorder; + REAL ctlPoints[IN_MAX_BEZIER_ORDER*IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION]; + REAL ucoeff[IN_MAX_BEZIER_ORDER]; /*cache the polynomial values*/ + REAL vcoeff[IN_MAX_BEZIER_ORDER]; + REAL ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/ + REAL vcoeffDeriv[IN_MAX_BEZIER_ORDER]; +} surfEvalMachine; + + + +class StoredVertex { +public: + StoredVertex() { type = 0; } + ~StoredVertex(void) {} + void saveEvalCoord(REAL x, REAL y) + {coord[0] = x; coord[1] = y; type = TYPECOORD; } + void saveEvalPoint(long x, long y) + {point[0] = x; point[1] = y; type = TYPEPOINT; } + void invoke(OpenGLSurfaceEvaluator *eval); + +private: + int type; + REAL coord[2]; + long point[2]; +}; + +class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { +public: + OpenGLSurfaceEvaluator(); + virtual ~OpenGLSurfaceEvaluator( void ); + void polymode( long style ); + void range2f( long, REAL *, REAL * ); + void domain2f( REAL, REAL, REAL, REAL ); + void addMap( SurfaceMap * ) { } + + void enable( long ); + void disable( long ); + void bgnmap2f( long ); + void map2f( long, REAL, REAL, long, long, + REAL, REAL, long, long, REAL * ); + void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); + void mapmesh2f( long, long, long, long, long ); + void evalcoord2f( long, REAL, REAL ); + void evalpoint2i( long, long ); + void endmap2f( void ); + + void bgnline( void ); + void endline( void ); + void bgnclosedline( void ); + void endclosedline( void ); + void bgntmesh( void ); + void swaptmesh( void ); + void endtmesh( void ); + void bgnqstrip( void ); + void endqstrip( void ); + + void bgntfan( void ); + void endtfan( void ); + void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, + int n_lower, REAL v_lower, REAL* lower_val); + void evalVStrip(int n_left, REAL u_left, REAL* left_val, + int n_right, REAL u_right, REAL* right_val); + + void coord2f( REAL, REAL ); + void point2i( long, long ); + + void newtmeshvert( REAL, REAL ); + void newtmeshvert( long, long ); + +#ifdef _WIN32 + void putCallBack(GLenum which, void (GLAPIENTRY *fn)() ); +#else + void putCallBack(GLenum which, _GLUfuncptr fn ); +#endif + + int get_vertices_call_back() + { + return output_triangles; + } + void put_vertices_call_back(int flag) + { + output_triangles = flag; + } + + void put_callback_auto_normal(int flag) + { + callback_auto_normal = flag; + } + + int get_callback_auto_normal() + { + return callback_auto_normal; + } + + void set_callback_userData(void* data) + { + userData = data; + } + + /**************begin for LOD_eval_list***********/ + void LOD_eval_list(int level); + + + + +private: + StoredVertex *vertexCache[VERTEX_CACHE_SIZE]; + int tmeshing; + int which; + int vcount; + + GLint gl_polygon_mode[2];/*to save and restore so that + *no side effect + */ + bezierPatchMesh *global_bpm; //for output triangles + int output_triangles; //true 1 or false 0 + + + + void (GLAPIENTRY *beginCallBackN) (GLenum type); + void (GLAPIENTRY *endCallBackN) (void); + void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert); + void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal); + void (GLAPIENTRY *colorCallBackN) (const GLfloat *color); + void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord); + + void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data); + void (GLAPIENTRY *endCallBackData) (void* data); + void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data); + void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data); + void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data); + void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data); + + void beginCallBack (GLenum type, void* data); + void endCallBack (void* data); + void vertexCallBack (const GLfloat *vert, void* data); + void normalCallBack (const GLfloat *normal, void* data); + void colorCallBack (const GLfloat *color, void* data); + void texcoordCallBack (const GLfloat *texcoord, void* data); + + + void* userData; //the opaque pointer for Data callback functions. + + /*LOD evaluation*/ + void LOD_triangle(REAL A[2], REAL B[2], REAL C[2], + int level); + void LOD_eval(int num_vert, REAL* verts, int type, int level); + + int LOD_eval_level; //set by LOD_eval_list() + + /*************begin for internal evaluators*****************/ + + /*the following global variables are only defined in this file. + *They are used to cache the precomputed Bezier polynomial values. + *These calues may be used consecutively in which case we don't have + *recompute these values again. + */ + int global_uorder; /*store the uorder in the previous evaluation*/ + int global_vorder; /*store the vorder in the previous evaluation*/ + REAL global_uprime; + REAL global_vprime; + REAL global_vprime_BV; + REAL global_uprime_BU; + int global_uorder_BV; /*store the uorder in the previous evaluation*/ + int global_vorder_BV; /*store the vorder in the previous evaluation*/ + int global_uorder_BU; /*store the uorder in the previous evaluation*/ + int global_vorder_BU; /*store the vorder in the previous evaluation*/ + + REAL global_ucoeff[IN_MAX_BEZIER_ORDER]; /*cache the polynomial values*/ + REAL global_vcoeff[IN_MAX_BEZIER_ORDER]; + REAL global_ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/ + REAL global_vcoeffDeriv[IN_MAX_BEZIER_ORDER]; + + REAL global_BV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; + REAL global_PBV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; + REAL global_BU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; + REAL global_PBU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; + REAL* global_baseData; + + int global_ev_k; /*the dimension*/ + REAL global_ev_u1; + REAL global_ev_u2; + int global_ev_ustride; + int global_ev_uorder; + REAL global_ev_v1; + REAL global_ev_v2; + int global_ev_vstride; + int global_ev_vorder; + REAL global_ev_ctlPoints[IN_MAX_BEZIER_ORDER*IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION]; + + REAL global_grid_u0; + REAL global_grid_u1; + int global_grid_nu; + REAL global_grid_v0; + REAL global_grid_v1; + int global_grid_nv; + +/*functions*/ + void inDoDomain2WithDerivs(int k, REAL u, REAL v, + REAL u1, REAL u2, int uorder, + REAL v1, REAL v2, int vorder, + REAL *baseData, + REAL *retPoint, REAL *retdu, REAL *retdv); + void inPreEvaluate(int order, REAL vprime, REAL *coeff); + void inPreEvaluateWithDeriv(int order, REAL vprime, REAL *coeff, REAL *coeffDeriv); + void inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv); + void inComputeNormal2(REAL *pu, REAL *pv, REAL *n); + void inDoEvalCoord2(REAL u, REAL v, + REAL *retPoint, REAL *retNormal); + void inDoEvalCoord2NOGE(REAL u, REAL v, + REAL *retPoint, REAL *retNormal); + void inMap2f(int k, + REAL ulower, + REAL uupper, + int ustride, + int uorder, + REAL vlower, + REAL vupper, + int vstride, + int vorder, + REAL *ctlPoints); + + void inMapGrid2f(int nu, REAL u0, REAL u1, + int nv, REAL v0, REAL v1); + + void inEvalMesh2(int lowU, int lowV, int highU, int highV); + void inEvalPoint2(int i, int j); + void inEvalCoord2f(REAL u, REAL v); + +void inEvalULine(int n_points, REAL v, REAL* u_vals, + int stride, REAL ret_points[][3], REAL ret_normals[][3]); + +void inEvalVLine(int n_points, REAL u, REAL* v_vals, + int stride, REAL ret_points[][3], REAL ret_normals[][3]); + +void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, + int n_lower, REAL v_lower, REAL* lower_val + ); +void inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val); + +void inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData); +void inPreEvaluateBU(int k, int uorder, int vorder, REAL uprime, REAL *baseData); +void inPreEvaluateBV_intfac(REAL v ) + { + inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints); + } + +void inPreEvaluateBU_intfac(REAL u) + { + inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); + } + +void inDoDomain2WithDerivsBV(int k, REAL u, REAL v, + REAL u1, REAL u2, int uorder, + REAL v1, REAL v2, int vorder, + REAL *baseData, + REAL *retPoint, REAL* retdu, REAL *retdv); + +void inDoDomain2WithDerivsBU(int k, REAL u, REAL v, + REAL u1, REAL u2, int uorder, + REAL v1, REAL v2, int vorder, + REAL *baseData, + REAL *retPoint, REAL* retdu, REAL *retdv); + + +void inDoEvalCoord2NOGE_BV(REAL u, REAL v, + REAL *retPoint, REAL *retNormal); + +void inDoEvalCoord2NOGE_BU(REAL u, REAL v, + REAL *retPoint, REAL *retNormal); + +void inBPMEval(bezierPatchMesh* bpm); +void inBPMListEval(bezierPatchMesh* list); + +/*-------------begin for surfEvalMachine -------------*/ +surfEvalMachine em_vertex; +surfEvalMachine em_normal; +surfEvalMachine em_color; +surfEvalMachine em_texcoord; + +int auto_normal_flag; //whether to output normla or not in callback + //determined by GL_AUTO_NORMAL and callback_auto_normal +int callback_auto_normal; //GLU_CALLBACK_AUTO_NORMAL_EXT +int vertex_flag; +int normal_flag; +int color_flag; +int texcoord_flag; + +void inMap2fEM(int which, //0:vert,1:norm,2:color,3:tex + int dimension, + REAL ulower, + REAL uupper, + int ustride, + int uorder, + REAL vlower, + REAL vupper, + int vstride, + int vorder, + REAL *ctlPoints); + +void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, + REAL *retPoint, REAL *retdu, REAL *retdv); +void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, + REAL *retPoint); + void inDoEvalCoord2EM(REAL u, REAL v); + +void inBPMEvalEM(bezierPatchMesh* bpm); +void inBPMListEvalEM(bezierPatchMesh* list); + +/*-------------end for surfEvalMachine -------------*/ + + + /*************end for internal evaluators*****************/ + +}; + +inline void StoredVertex::invoke(OpenGLSurfaceEvaluator *eval) +{ + switch(type) { + case TYPECOORD: + eval->coord2f(coord[0], coord[1]); + break; + case TYPEPOINT: + eval->point2i(point[0], point[1]); + break; + default: + break; + } +} + +#endif /* __gluglsurfeval_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/incurveeval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/incurveeval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/incurveeval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/incurveeval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,206 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include + +#include "glcurveval.h" + + +/* + *compute the Bezier polynomials C[n,j](v) for all j at v with + *return values stored in coeff[], where + * C[n,j](v) = (n,j) * v^j * (1-v)^(n-j), + * j=0,1,2,...,n. + *order : n+1 + *vprime: v + *coeff : coeff[j]=C[n,j](v), this array store the returned values. + *The algorithm is a recursive scheme: + * C[0,0]=1; + * C[n,j](v) = (1-v)*C[n-1,j](v) + v*C[n-1,j-1](v), n>=1 + *This code is copied from opengl/soft/so_eval.c:PreEvaluate + */ +void OpenGLCurveEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) +{ + int i, j; + REAL oldval, temp; + REAL oneMinusvprime; + + /* + * Minor optimization + * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to + * their i==1 loop values to avoid the initialization and the i==1 loop. + */ + if (order == 1) { + coeff[0] = 1.0; + return; + } + + oneMinusvprime = 1-vprime; + coeff[0] = oneMinusvprime; + coeff[1] = vprime; + if (order == 2) return; + + for (i = 2; i < order; i++) { + oldval = coeff[0] * vprime; + coeff[0] = oneMinusvprime * coeff[0]; + for (j = 1; j < i; j++) { + temp = oldval; + oldval = coeff[j] * vprime; + coeff[j] = temp + oneMinusvprime * coeff[j]; + } + coeff[j] = oldval; + } +} + +void OpenGLCurveEvaluator::inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex + int k, //dimension + REAL ulower, + REAL uupper, + int ustride, + int uorder, + REAL *ctlpoints) +{ + int i,x; + curveEvalMachine *temp_em; + switch(which){ + case 0: //vertex + vertex_flag = 1; + temp_em = &em_vertex; + break; + case 1: //normal + normal_flag = 1; + temp_em = &em_normal; + break; + case 2: //color + color_flag = 1; + temp_em = &em_color; + break; + default: + texcoord_flag = 1; + temp_em = &em_texcoord; + break; + } + + REAL *data = temp_em->ctlpoints; + temp_em->uprime = -1; //initialized + temp_em->k = k; + temp_em->u1 = ulower; + temp_em->u2 = uupper; + temp_em->ustride = ustride; + temp_em->uorder = uorder; + /*copy the control points*/ + for(i=0; iu2 == em->u1) + return; + the_uprime = (u-em->u1) / (em->u2-em->u1); + /*use already cached values if possible*/ + if(em->uprime != the_uprime){ + inPreEvaluate(em->uorder, the_uprime, em->ucoeff); + em->uprime = the_uprime; + } + + for(j=0; jk; j++){ + data = em->ctlpoints+j; + retPoint[j] = 0.0; + for(row=0; rowuorder; row++) + { + retPoint[j] += em->ucoeff[row] * (*data); + data += em->k; + } + } +} + +void OpenGLCurveEvaluator::inDoEvalCoord1(REAL u) +{ + REAL temp_vertex[4]; + REAL temp_normal[3]; + REAL temp_color[4]; + REAL temp_texcoord[4]; + if(texcoord_flag) //there is a texture map + { + inDoDomain1(&em_texcoord, u, temp_texcoord); + texcoordCallBack(temp_texcoord, userData); + } +#ifdef DEBUG +printf("color_flag = %i\n", color_flag); +#endif + if(color_flag) //there is a color map + { + inDoDomain1(&em_color, u, temp_color); + colorCallBack(temp_color, userData); + } + if(normal_flag) //there is a normal map + { + inDoDomain1(&em_normal, u, temp_normal); + normalCallBack(temp_normal, userData); + } + if(vertex_flag) + { + inDoDomain1(&em_vertex, u, temp_vertex); + vertexCallBack(temp_vertex, userData); + } +} + +void OpenGLCurveEvaluator::inMapMesh1f(int umin, int umax) +{ + REAL du, u; + int i; + if(global_grid_nu == 0) + return; //no points to output + du = (global_grid_u1 - global_grid_u0) / (REAL) global_grid_nu; + bgnline(); + for(i=umin; i<= umax; i++){ + u = (i==global_grid_nu)? global_grid_u1: global_grid_u0 + i*du; + inDoEvalCoord1(u); + } + endline(); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2064 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include +#include +#include + +#include "glsurfeval.h" + +//extern int surfcount; + +//#define CRACK_TEST + +#define AVOID_ZERO_NORMAL + +#ifdef AVOID_ZERO_NORMAL +#define myabs(x) ((x>0)? x: (-x)) +#define MYZERO 0.000001 +#define MYDELTA 0.001 +#endif + +//#define USE_LOD +#ifdef USE_LOD +//#define LOD_EVAL_COORD(u,v) inDoEvalCoord2EM(u,v) +#define LOD_EVAL_COORD(u,v) glEvalCoord2f(u,v) + +static void LOD_interpolate(REAL A[2], REAL B[2], REAL C[2], int j, int k, int pow2_level, + REAL& u, REAL& v) +{ + REAL a,a1,b,b1; + + a = ((REAL) j) / ((REAL) pow2_level); + a1 = 1-a; + + if(j != 0) + { + b = ((REAL) k) / ((REAL)j); + b1 = 1-b; + } + REAL x,y,z; + x = a1; + if(j==0) + { + y=0; z=0; + } + else{ + y = b1*a; + z = b *a; + } + + u = x*A[0] + y*B[0] + z*C[0]; + v = x*A[1] + y*B[1] + z*C[1]; +} + +void OpenGLSurfaceEvaluator::LOD_triangle(REAL A[2], REAL B[2], REAL C[2], + int level) +{ + int k,j; + int pow2_level; + /*compute 2^level*/ + pow2_level = 1; + + for(j=0; jnext) + { + inBPMEval(temp); + } +} + +void OpenGLSurfaceEvaluator::inBPMEval(bezierPatchMesh* bpm) +{ + int i,j,k,l; + float u,v; + + int ustride = bpm->bpatch->dimension * bpm->bpatch->vorder; + int vstride = bpm->bpatch->dimension; + inMap2f( + (bpm->bpatch->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4, + bpm->bpatch->umin, + bpm->bpatch->umax, + ustride, + bpm->bpatch->uorder, + bpm->bpatch->vmin, + bpm->bpatch->vmax, + vstride, + bpm->bpatch->vorder, + bpm->bpatch->ctlpoints); + + bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3+1); /*in case the origional dimenion is 4, then we need 4 space to pass to evaluator.*/ + assert(bpm->vertex_array); + bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); + assert(bpm->normal_array); +#ifdef CRACK_TEST +if( global_ev_u1 ==2 && global_ev_u2 == 3 + && global_ev_v1 ==2 && global_ev_v2 == 3) +{ +REAL vertex[4]; +REAL normal[4]; +#ifdef DEBUG +printf("***number 1\n"); +#endif + +beginCallBack(GL_QUAD_STRIP, NULL); +inEvalCoord2f(3.0, 3.0); +inEvalCoord2f(2.0, 3.0); +inEvalCoord2f(3.0, 2.7); +inEvalCoord2f(2.0, 2.7); +inEvalCoord2f(3.0, 2.0); +inEvalCoord2f(2.0, 2.0); +endCallBack(NULL); + + +beginCallBack(GL_TRIANGLE_STRIP, NULL); +inEvalCoord2f(2.0, 3.0); +inEvalCoord2f(2.0, 2.0); +inEvalCoord2f(2.0, 2.7); +endCallBack(NULL); + +} + +/* +if( global_ev_u1 ==2 && global_ev_u2 == 3 + && global_ev_v1 ==1 && global_ev_v2 == 2) +{ +#ifdef DEBUG +printf("***number 2\n"); +#endif +beginCallBack(GL_QUAD_STRIP); +inEvalCoord2f(2.0, 2.0); +inEvalCoord2f(2.0, 1.0); +inEvalCoord2f(3.0, 2.0); +inEvalCoord2f(3.0, 1.0); +endCallBack(); +} +*/ +if( global_ev_u1 ==1 && global_ev_u2 == 2 + && global_ev_v1 ==2 && global_ev_v2 == 3) +{ +#ifdef DEBUG +printf("***number 3\n"); +#endif +beginCallBack(GL_QUAD_STRIP, NULL); +inEvalCoord2f(2.0, 3.0); +inEvalCoord2f(1.0, 3.0); +inEvalCoord2f(2.0, 2.3); +inEvalCoord2f(1.0, 2.3); +inEvalCoord2f(2.0, 2.0); +inEvalCoord2f(1.0, 2.0); +endCallBack(NULL); + +beginCallBack(GL_TRIANGLE_STRIP, NULL); +inEvalCoord2f(2.0, 2.3); +inEvalCoord2f(2.0, 2.0); +inEvalCoord2f(2.0, 3.0); +endCallBack(NULL); + +} +return; +#endif + + k=0; + l=0; + + for(i=0; iindex_length_array; i++) + { + beginCallBack(bpm->type_array[i], userData); + for(j=0; jlength_array[i]; j++) + { + u = bpm->UVarray[k]; + v = bpm->UVarray[k+1]; + inDoEvalCoord2NOGE(u,v, + bpm->vertex_array+l, + bpm->normal_array+l); + + normalCallBack(bpm->normal_array+l, userData); + vertexCallBack(bpm->vertex_array+l, userData); + + k += 2; + l += 3; + } + endCallBack(userData); + } +} + +void OpenGLSurfaceEvaluator::inEvalPoint2(int i, int j) +{ + REAL du, dv; + REAL point[4]; + REAL normal[3]; + REAL u,v; + du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; + dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; + u = (i==global_grid_nu)? global_grid_u1:(global_grid_u0 + i*du); + v = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); + inDoEvalCoord2(u,v,point,normal); +} + +void OpenGLSurfaceEvaluator::inEvalCoord2f(REAL u, REAL v) +{ + + REAL point[4]; + REAL normal[3]; + inDoEvalCoord2(u,v,point, normal); +} + + + +/*define a grid. store the values into the global variabls: + * global_grid_* + *These values will be used later by evaluating functions + */ +void OpenGLSurfaceEvaluator::inMapGrid2f(int nu, REAL u0, REAL u1, + int nv, REAL v0, REAL v1) +{ + global_grid_u0 = u0; + global_grid_u1 = u1; + global_grid_nu = nu; + global_grid_v0 = v0; + global_grid_v1 = v1; + global_grid_nv = nv; +} + +void OpenGLSurfaceEvaluator::inEvalMesh2(int lowU, int lowV, int highU, int highV) +{ + REAL du, dv; + int i,j; + REAL point[4]; + REAL normal[3]; + if(global_grid_nu == 0 || global_grid_nv == 0) + return; /*no points need to be output*/ + du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; + dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; + + if(global_grid_nu >= global_grid_nv){ + for(i=lowU; i=lowV; j--){ + REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); + + inDoEvalCoord2(u1, v1, point, normal); + inDoEvalCoord2(u2, v1, point, normal); + } + endqstrip(); + } + } + + else{ + for(i=lowV; i=lowU; j--){ + REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); + inDoEvalCoord2(u1, v2, point, normal); + inDoEvalCoord2(u1, v1, point, normal); + } + endqstrip(); + } + } + +} + +void OpenGLSurfaceEvaluator::inMap2f(int k, + REAL ulower, + REAL uupper, + int ustride, + int uorder, + REAL vlower, + REAL vupper, + int vstride, + int vorder, + REAL *ctlPoints) +{ + int i,j,x; + REAL *data = global_ev_ctlPoints; + + + + if(k == GL_MAP2_VERTEX_3) k=3; + else if (k==GL_MAP2_VERTEX_4) k =4; + else { + printf("error in inMap2f, maptype=%i is wrong, k,map is not updated\n", k); + return; + } + + global_ev_k = k; + global_ev_u1 = ulower; + global_ev_u2 = uupper; + global_ev_ustride = ustride; + global_ev_uorder = uorder; + global_ev_v1 = vlower; + global_ev_v2 = vupper; + global_ev_vstride = vstride; + global_ev_vorder = vorder; + + /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/ + for (i=0; i 0.0) { + n[0] /= mag; + n[1] /= mag; + n[2] /= mag; + } +} + + + +/*Compute point and normal + *see the head of inDoDomain2WithDerivs + *for the meaning of the arguments + */ +void OpenGLSurfaceEvaluator::inDoEvalCoord2(REAL u, REAL v, + REAL *retPoint, REAL *retNormal) +{ + + REAL du[4]; + REAL dv[4]; + + + assert(global_ev_k>=3 && global_ev_k <= 4); + /*compute homegeneous point and partial derivatives*/ + inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); + +#ifdef AVOID_ZERO_NORMAL + + if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) + { + + REAL tempdu[4]; + REAL tempdata[4]; + REAL u1 = global_ev_u1; + REAL u2 = global_ev_u2; + if(u-MYDELTA*(u2-u1) < u1) + u = u+ MYDELTA*(u2-u1); + else + u = u-MYDELTA*(u2-u1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); + } + if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) + { + REAL tempdv[4]; + REAL tempdata[4]; + REAL v1 = global_ev_v1; + REAL v2 = global_ev_v2; + if(v-MYDELTA*(v2-v1) < v1) + v = v+ MYDELTA*(v2-v1); + else + v = v-MYDELTA*(v2-v1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); + } +#endif + + + /*compute normal*/ + switch(global_ev_k){ + case 3: + inComputeNormal2(du, dv, retNormal); + + break; + case 4: + inComputeFirstPartials(retPoint, du, dv); + inComputeNormal2(du, dv, retNormal); + /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ + retPoint[0] /= retPoint[3]; + retPoint[1] /= retPoint[3]; + retPoint[2] /= retPoint[3]; + break; + } + /*output this vertex*/ +/* inMeshStreamInsert(global_ms, retPoint, retNormal);*/ + + + + glNormal3fv(retNormal); + glVertex3fv(retPoint); + + + + + #ifdef DEBUG + printf("vertex(%f,%f,%f)\n", retPoint[0],retPoint[1],retPoint[2]); + #endif + + + +} + +/*Compute point and normal + *see the head of inDoDomain2WithDerivs + *for the meaning of the arguments + */ +void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BU(REAL u, REAL v, + REAL *retPoint, REAL *retNormal) +{ + + REAL du[4]; + REAL dv[4]; + + + assert(global_ev_k>=3 && global_ev_k <= 4); + /*compute homegeneous point and partial derivatives*/ +// inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); + inDoDomain2WithDerivsBU(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); + + +#ifdef AVOID_ZERO_NORMAL + + if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) + { + + REAL tempdu[4]; + REAL tempdata[4]; + REAL u1 = global_ev_u1; + REAL u2 = global_ev_u2; + if(u-MYDELTA*(u2-u1) < u1) + u = u+ MYDELTA*(u2-u1); + else + u = u-MYDELTA*(u2-u1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); + } + if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) + { + REAL tempdv[4]; + REAL tempdata[4]; + REAL v1 = global_ev_v1; + REAL v2 = global_ev_v2; + if(v-MYDELTA*(v2-v1) < v1) + v = v+ MYDELTA*(v2-v1); + else + v = v-MYDELTA*(v2-v1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); + } +#endif + + /*compute normal*/ + switch(global_ev_k){ + case 3: + inComputeNormal2(du, dv, retNormal); + break; + case 4: + inComputeFirstPartials(retPoint, du, dv); + inComputeNormal2(du, dv, retNormal); + /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ + retPoint[0] /= retPoint[3]; + retPoint[1] /= retPoint[3]; + retPoint[2] /= retPoint[3]; + break; + } +} + +/*Compute point and normal + *see the head of inDoDomain2WithDerivs + *for the meaning of the arguments + */ +void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BV(REAL u, REAL v, + REAL *retPoint, REAL *retNormal) +{ + + REAL du[4]; + REAL dv[4]; + + + assert(global_ev_k>=3 && global_ev_k <= 4); + /*compute homegeneous point and partial derivatives*/ +// inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints); + + inDoDomain2WithDerivsBV(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); + + +#ifdef AVOID_ZERO_NORMAL + + if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) + { + + REAL tempdu[4]; + REAL tempdata[4]; + REAL u1 = global_ev_u1; + REAL u2 = global_ev_u2; + if(u-MYDELTA*(u2-u1) < u1) + u = u+ MYDELTA*(u2-u1); + else + u = u-MYDELTA*(u2-u1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); + } + if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) + { + REAL tempdv[4]; + REAL tempdata[4]; + REAL v1 = global_ev_v1; + REAL v2 = global_ev_v2; + if(v-MYDELTA*(v2-v1) < v1) + v = v+ MYDELTA*(v2-v1); + else + v = v-MYDELTA*(v2-v1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); + } +#endif + + /*compute normal*/ + switch(global_ev_k){ + case 3: + inComputeNormal2(du, dv, retNormal); + break; + case 4: + inComputeFirstPartials(retPoint, du, dv); + inComputeNormal2(du, dv, retNormal); + /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ + retPoint[0] /= retPoint[3]; + retPoint[1] /= retPoint[3]; + retPoint[2] /= retPoint[3]; + break; + } +} + + +/*Compute point and normal + *see the head of inDoDomain2WithDerivs + *for the meaning of the arguments + */ +void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE(REAL u, REAL v, + REAL *retPoint, REAL *retNormal) +{ + + REAL du[4]; + REAL dv[4]; + + + assert(global_ev_k>=3 && global_ev_k <= 4); + /*compute homegeneous point and partial derivatives*/ + inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); + + +#ifdef AVOID_ZERO_NORMAL + + if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) + { + + REAL tempdu[4]; + REAL tempdata[4]; + REAL u1 = global_ev_u1; + REAL u2 = global_ev_u2; + if(u-MYDELTA*(u2-u1) < u1) + u = u+ MYDELTA*(u2-u1); + else + u = u-MYDELTA*(u2-u1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); + } + if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) + { + REAL tempdv[4]; + REAL tempdata[4]; + REAL v1 = global_ev_v1; + REAL v2 = global_ev_v2; + if(v-MYDELTA*(v2-v1) < v1) + v = v+ MYDELTA*(v2-v1); + else + v = v-MYDELTA*(v2-v1); + inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); + } +#endif + + /*compute normal*/ + switch(global_ev_k){ + case 3: + inComputeNormal2(du, dv, retNormal); + break; + case 4: + inComputeFirstPartials(retPoint, du, dv); + inComputeNormal2(du, dv, retNormal); + /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ + retPoint[0] /= retPoint[3]; + retPoint[1] /= retPoint[3]; + retPoint[2] /= retPoint[3]; + break; + } +// glNormal3fv(retNormal); +// glVertex3fv(retPoint); +} + +void OpenGLSurfaceEvaluator::inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData) +{ + int j,row,col; + REAL p, pdv; + REAL *data; + + if(global_vprime != vprime || global_vorder != vorder) { + inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv); + global_vprime = vprime; + global_vorder = vorder; + } + + for(j=0; j=1 + *This code is copied from opengl/soft/so_eval.c:PreEvaluate + */ +void OpenGLSurfaceEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) +{ + int i, j; + REAL oldval, temp; + REAL oneMinusvprime; + + /* + * Minor optimization + * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to + * their i==1 loop values to avoid the initialization and the i==1 loop. + */ + if (order == 1) { + coeff[0] = 1.0; + return; + } + + oneMinusvprime = 1-vprime; + coeff[0] = oneMinusvprime; + coeff[1] = vprime; + if (order == 2) return; + + for (i = 2; i < order; i++) { + oldval = coeff[0] * vprime; + coeff[0] = oneMinusvprime * coeff[0]; + for (j = 1; j < i; j++) { + temp = oldval; + oldval = coeff[j] * vprime; + coeff[j] = temp + oneMinusvprime * coeff[j]; + } + coeff[j] = oldval; + } +} + +/* + *compute the Bezier polynomials C[n,j](v) and derivatives for all j at v with + *return values stored in coeff[] and coeffDeriv[]. + *see the head of function inPreEvaluate for the definition of C[n,j](v) + *and how to compute the values. + *The algorithm to compute the derivative is: + * dC[0,0](v) = 0. + * dC[n,j](v) = n*(dC[n-1,j-1](v) - dC[n-1,j](v)). + * + *This code is copied from opengl/soft/so_eval.c:PreEvaluateWidthDeriv + */ +void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime, + REAL *coeff, REAL *coeffDeriv) +{ + int i, j; + REAL oldval, temp; + REAL oneMinusvprime; + + oneMinusvprime = 1-vprime; + /* + * Minor optimization + * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to + * their i==1 loop values to avoid the initialization and the i==1 loop. + */ + if (order == 1) { + coeff[0] = 1.0; + coeffDeriv[0] = 0.0; + return; + } else if (order == 2) { + coeffDeriv[0] = -1.0; + coeffDeriv[1] = 1.0; + coeff[0] = oneMinusvprime; + coeff[1] = vprime; + return; + } + coeff[0] = oneMinusvprime; + coeff[1] = vprime; + for (i = 2; i < order - 1; i++) { + oldval = coeff[0] * vprime; + coeff[0] = oneMinusvprime * coeff[0]; + for (j = 1; j < i; j++) { + temp = oldval; + oldval = coeff[j] * vprime; + coeff[j] = temp + oneMinusvprime * coeff[j]; + } + coeff[j] = oldval; + } + coeffDeriv[0] = -coeff[0]; + /* + ** Minor optimization: + ** Would make this a "for (j=1; j=1 + *n_lower >=1 + */ +void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val) +{ + int i,j,k,l; + REAL leftMostV[2]; + typedef REAL REAL3[3]; + + REAL3* upperXYZ = (REAL3*) malloc(sizeof(REAL3)*n_upper); + assert(upperXYZ); + REAL3* upperNormal = (REAL3*) malloc(sizeof(REAL3) * n_upper); + assert(upperNormal); + REAL3* lowerXYZ = (REAL3*) malloc(sizeof(REAL3)*n_lower); + assert(lowerXYZ); + REAL3* lowerNormal = (REAL3*) malloc(sizeof(REAL3) * n_lower); + assert(lowerNormal); + + inEvalULine(n_upper, v_upper, upper_val, 1, upperXYZ, upperNormal); + inEvalULine(n_lower, v_lower, lower_val, 1, lowerXYZ, lowerNormal); + + + + REAL* leftMostXYZ; + REAL* leftMostNormal; + + /* + *the algorithm works by scanning from left to right. + *leftMostV: the left most of the remaining verteces (on both upper and lower). + * it could an element of upperVerts or lowerVerts. + *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line */ + + /*initialize i,j,and leftMostV + */ + if(upper_val[0] <= lower_val[0]) + { + i=1; + j=0; + + leftMostV[0] = upper_val[0]; + leftMostV[1] = v_upper; + leftMostXYZ = upperXYZ[0]; + leftMostNormal = upperNormal[0]; + } + else + { + i=0; + j=1; + + leftMostV[0] = lower_val[0]; + leftMostV[1] = v_lower; + + leftMostXYZ = lowerXYZ[0]; + leftMostNormal = lowerNormal[0]; + } + + /*the main loop. + *the invariance is that: + *at the beginning of each loop, the meaning of i,j,and leftMostV are + *maintained + */ + while(1) + { + if(i >= n_upper) /*case1: no more in upper*/ + { + if(j= n_lower) /*case2: no more in lower*/ + { + if(i=i; k--) /*reverse order for two-side lighting*/ + { + glNormal3fv(upperNormal[k]); + glVertex3fv(upperXYZ[k]); + } + + endtfan(); + } + break; /*exit the main loop*/ + } + else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ + { + if(upper_val[i] <= lower_val[j]) + { + bgntfan(); + + glNormal3fv(lowerNormal[j]); + glVertex3fv(lowerXYZ[j]); + + /*find the last k>=i such that + *upperverts[k][0] <= lowerverts[j][0] + */ + k=i; + + while(k lower_val[j]) + break; + k++; + + } + k--; + + + for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ + { + glNormal3fv(upperNormal[l]); + glVertex3fv(upperXYZ[l]); + + } + glNormal3fv(leftMostNormal); + glVertex3fv(leftMostXYZ); + + endtfan(); + + /*update i and leftMostV for next loop + */ + i = k+1; + + leftMostV[0] = upper_val[k]; + leftMostV[1] = v_upper; + leftMostNormal = upperNormal[k]; + leftMostXYZ = upperXYZ[k]; + } + else /*upperVerts[i][0] > lowerVerts[j][0]*/ + { + bgntfan(); + glNormal3fv(upperNormal[i]); + glVertex3fv(upperXYZ[i]); + + glNormal3fv(leftMostNormal); + glVertex3fv(leftMostXYZ); + + + /*find the last k>=j such that + *lowerverts[k][0] < upperverts[i][0] + */ + k=j; + while(k< n_lower) + { + if(lower_val[k] >= upper_val[i]) + break; + glNormal3fv(lowerNormal[k]); + glVertex3fv(lowerXYZ[k]); + + k++; + } + endtfan(); + + /*update j and leftMostV for next loop + */ + j=k; + leftMostV[0] = lower_val[j-1]; + leftMostV[1] = v_lower; + + leftMostNormal = lowerNormal[j-1]; + leftMostXYZ = lowerXYZ[j-1]; + } + } + } + //clean up + free(upperXYZ); + free(lowerXYZ); + free(upperNormal); + free(lowerNormal); +} + +/*triangulate a strip bounded by two lines which are parallel to V-axis + *leftVerts: the verteces on the left line + *rightVertx: the verteces on the right line + *n_left >=1 + *n_right >=1 + */ +void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val) +{ + int i,j,k,l; + REAL botMostV[2]; + typedef REAL REAL3[3]; + + REAL3* leftXYZ = (REAL3*) malloc(sizeof(REAL3)*n_left); + assert(leftXYZ); + REAL3* leftNormal = (REAL3*) malloc(sizeof(REAL3) * n_left); + assert(leftNormal); + REAL3* rightXYZ = (REAL3*) malloc(sizeof(REAL3)*n_right); + assert(rightXYZ); + REAL3* rightNormal = (REAL3*) malloc(sizeof(REAL3) * n_right); + assert(rightNormal); + + inEvalVLine(n_left, u_left, left_val, 1, leftXYZ, leftNormal); + inEvalVLine(n_right, u_right, right_val, 1, rightXYZ, rightNormal); + + + + REAL* botMostXYZ; + REAL* botMostNormal; + + /* + *the algorithm works by scanning from bot to top. + *botMostV: the bot most of the remaining verteces (on both left and right). + * it could an element of leftVerts or rightVerts. + *i: leftVerts[i] is the first vertex to the top of botMostV on left line + *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */ + + /*initialize i,j,and botMostV + */ + if(left_val[0] <= right_val[0]) + { + i=1; + j=0; + + botMostV[0] = u_left; + botMostV[1] = left_val[0]; + botMostXYZ = leftXYZ[0]; + botMostNormal = leftNormal[0]; + } + else + { + i=0; + j=1; + + botMostV[0] = u_right; + botMostV[1] = right_val[0]; + + botMostXYZ = rightXYZ[0]; + botMostNormal = rightNormal[0]; + } + + /*the main loop. + *the invariance is that: + *at the beginning of each loop, the meaning of i,j,and botMostV are + *maintained + */ + while(1) + { + if(i >= n_left) /*case1: no more in left*/ + { + if(j= n_right) /*case2: no more in right*/ + { + if(i=i; k--) /*reverse order for two-side lighting*/ + { + glNormal3fv(leftNormal[k]); + glVertex3fv(leftXYZ[k]); + } + + endtfan(); + } + break; /*exit the main loop*/ + } + else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/ + { + if(left_val[i] <= right_val[j]) + { + bgntfan(); + + glNormal3fv(rightNormal[j]); + glVertex3fv(rightXYZ[j]); + + /*find the last k>=i such that + *leftverts[k][0] <= rightverts[j][0] + */ + k=i; + + while(k right_val[j]) + break; + k++; + + } + k--; + + + for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ + { + glNormal3fv(leftNormal[l]); + glVertex3fv(leftXYZ[l]); + + } + glNormal3fv(botMostNormal); + glVertex3fv(botMostXYZ); + + endtfan(); + + /*update i and botMostV for next loop + */ + i = k+1; + + botMostV[0] = u_left; + botMostV[1] = left_val[k]; + botMostNormal = leftNormal[k]; + botMostXYZ = leftXYZ[k]; + } + else /*left_val[i] > right_val[j])*/ + { + bgntfan(); + glNormal3fv(leftNormal[i]); + glVertex3fv(leftXYZ[i]); + + glNormal3fv(botMostNormal); + glVertex3fv(botMostXYZ); + + + /*find the last k>=j such that + *rightverts[k][0] < leftverts[i][0] + */ + k=j; + while(k< n_right) + { + if(right_val[k] >= left_val[i]) + break; + glNormal3fv(rightNormal[k]); + glVertex3fv(rightXYZ[k]); + + k++; + } + endtfan(); + + /*update j and botMostV for next loop + */ + j=k; + botMostV[0] = u_right; + botMostV[1] = right_val[j-1]; + + botMostNormal = rightNormal[j-1]; + botMostXYZ = rightXYZ[j-1]; + } + } + } + //clean up + free(leftXYZ); + free(rightXYZ); + free(leftNormal); + free(rightNormal); +} + +/*-----------------------begin evalMachine-------------------*/ +void OpenGLSurfaceEvaluator::inMap2fEM(int which, int k, + REAL ulower, + REAL uupper, + int ustride, + int uorder, + REAL vlower, + REAL vupper, + int vstride, + int vorder, + REAL *ctlPoints) +{ + int i,j,x; + surfEvalMachine *temp_em; + switch(which){ + case 0: //vertex + vertex_flag = 1; + temp_em = &em_vertex; + break; + case 1: //normal + normal_flag = 1; + temp_em = &em_normal; + break; + case 2: //color + color_flag = 1; + temp_em = &em_color; + break; + default: + texcoord_flag = 1; + temp_em = &em_texcoord; + break; + } + + REAL *data = temp_em->ctlPoints; + + temp_em->uprime = -1;//initilized + temp_em->vprime = -1; + + temp_em->k = k; + temp_em->u1 = ulower; + temp_em->u2 = uupper; + temp_em->ustride = ustride; + temp_em->uorder = uorder; + temp_em->v1 = vlower; + temp_em->v2 = vupper; + temp_em->vstride = vstride; + temp_em->vorder = vorder; + + /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/ + for (i=0; iu2 == em->u1) || (em->v2 == em->v1)) + return; + the_uprime = (u - em->u1) / (em->u2 - em->u1); + the_vprime = (v - em->v1) / (em->v2 - em->v1); + + /* Compute coefficients for values and derivs */ + + /* Use already cached values if possible */ + if(em->uprime != the_uprime) { + inPreEvaluateWithDeriv(em->uorder, the_uprime, em->ucoeff, em->ucoeffDeriv); + em->uprime = the_uprime; + } + if (em->vprime != the_vprime) { + inPreEvaluateWithDeriv(em->vorder, the_vprime, em->vcoeff, em->vcoeffDeriv); + em->vprime = the_vprime; + } + + for (j = 0; j < em->k; j++) { + data=em->ctlPoints+j; + retPoint[j] = retdu[j] = retdv[j] = 0.0; + for (row = 0; row < em->uorder; row++) { + /* + ** Minor optimization. + ** The col == 0 part of the loop is extracted so we don't + ** have to initialize p and pdv to 0. + */ + p = em->vcoeff[0] * (*data); + pdv = em->vcoeffDeriv[0] * (*data); + data += em->k; + for (col = 1; col < em->vorder; col++) { + /* Incrementally build up p, pdv value */ + p += em->vcoeff[col] * (*data); + pdv += em->vcoeffDeriv[col] * (*data); + data += em->k; + } + /* Use p, pdv value to incrementally add up r, du, dv */ + retPoint[j] += em->ucoeff[row] * p; + retdu[j] += em->ucoeffDeriv[row] * p; + retdv[j] += em->ucoeff[row] * pdv; + } + } +} + +void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, + REAL *retPoint) +{ + int j, row, col; + REAL the_uprime; + REAL the_vprime; + REAL p; + REAL *data; + + if((em->u2 == em->u1) || (em->v2 == em->v1)) + return; + the_uprime = (u - em->u1) / (em->u2 - em->u1); + the_vprime = (v - em->v1) / (em->v2 - em->v1); + + /* Compute coefficients for values and derivs */ + + /* Use already cached values if possible */ + if(em->uprime != the_uprime) { + inPreEvaluate(em->uorder, the_uprime, em->ucoeff); + em->uprime = the_uprime; + } + if (em->vprime != the_vprime) { + inPreEvaluate(em->vorder, the_vprime, em->vcoeff); + em->vprime = the_vprime; + } + + for (j = 0; j < em->k; j++) { + data=em->ctlPoints+j; + retPoint[j] = 0.0; + for (row = 0; row < em->uorder; row++) { + /* + ** Minor optimization. + ** The col == 0 part of the loop is extracted so we don't + ** have to initialize p and pdv to 0. + */ + p = em->vcoeff[0] * (*data); + data += em->k; + for (col = 1; col < em->vorder; col++) { + /* Incrementally build up p, pdv value */ + p += em->vcoeff[col] * (*data); + data += em->k; + } + /* Use p, pdv value to incrementally add up r, du, dv */ + retPoint[j] += em->ucoeff[row] * p; + } + } +} + + +void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) +{ + REAL temp_vertex[5]; + REAL temp_normal[3]; + REAL temp_color[4]; + REAL temp_texcoord[4]; + + if(texcoord_flag) + { + inDoDomain2EM(&em_texcoord, u,v, temp_texcoord); + texcoordCallBack(temp_texcoord, userData); + } + if(color_flag) + { + inDoDomain2EM(&em_color, u,v, temp_color); + colorCallBack(temp_color, userData); + } + + if(normal_flag) //there is a normla map + { + inDoDomain2EM(&em_normal, u,v, temp_normal); + normalCallBack(temp_normal, userData); + + if(vertex_flag) + { + inDoDomain2EM(&em_vertex, u,v,temp_vertex); + if(em_vertex.k == 4) + { + temp_vertex[0] /= temp_vertex[3]; + temp_vertex[1] /= temp_vertex[3]; + temp_vertex[2] /= temp_vertex[3]; + } + temp_vertex[3]=u; + temp_vertex[4]=v; + vertexCallBack(temp_vertex, userData); + } + } + else if(auto_normal_flag) //no normal map but there is a normal callbackfunctin + { + REAL du[4]; + REAL dv[4]; + + /*compute homegeneous point and partial derivatives*/ + inDoDomain2WithDerivsEM(&em_vertex, u,v,temp_vertex,du,dv); + + if(em_vertex.k ==4) + inComputeFirstPartials(temp_vertex, du, dv); + +#ifdef AVOID_ZERO_NORMAL + if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) + { + + REAL tempdu[4]; + REAL tempdata[4]; + REAL u1 = em_vertex.u1; + REAL u2 = em_vertex.u2; + if(u-MYDELTA*(u2-u1) < u1) + u = u+ MYDELTA*(u2-u1); + else + u = u-MYDELTA*(u2-u1); + inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, tempdu, dv); + + if(em_vertex.k ==4) + inComputeFirstPartials(temp_vertex, du, dv); + } + else if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) + { + REAL tempdv[4]; + REAL tempdata[4]; + REAL v1 = em_vertex.v1; + REAL v2 = em_vertex.v2; + if(v-MYDELTA*(v2-v1) < v1) + v = v+ MYDELTA*(v2-v1); + else + v = v-MYDELTA*(v2-v1); + inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, du, tempdv); + + if(em_vertex.k ==4) + inComputeFirstPartials(temp_vertex, du, dv); + } +#endif + + /*compute normal*/ + switch(em_vertex.k){ + case 3: + + inComputeNormal2(du, dv, temp_normal); + break; + case 4: + +// inComputeFirstPartials(temp_vertex, du, dv); + inComputeNormal2(du, dv, temp_normal); + + /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ + temp_vertex[0] /= temp_vertex[3]; + temp_vertex[1] /= temp_vertex[3]; + temp_vertex[2] /= temp_vertex[3]; + break; + } + normalCallBack(temp_normal, userData); + temp_vertex[3] = u; + temp_vertex[4] = v; + vertexCallBack(temp_vertex, userData); + + }/*end if auto_normal*/ + else //no normal map, and no normal callback function + { + if(vertex_flag) + { + inDoDomain2EM(&em_vertex, u,v,temp_vertex); + if(em_vertex.k == 4) + { + temp_vertex[0] /= temp_vertex[3]; + temp_vertex[1] /= temp_vertex[3]; + temp_vertex[2] /= temp_vertex[3]; + } + temp_vertex[3] = u; + temp_vertex[4] = v; + vertexCallBack(temp_vertex, userData); + } + } +} + + +void OpenGLSurfaceEvaluator::inBPMEvalEM(bezierPatchMesh* bpm) +{ + int i,j,k; + float u,v; + + int ustride; + int vstride; + +#ifdef USE_LOD + if(bpm->bpatch != NULL) + { + bezierPatch* p=bpm->bpatch; + ustride = p->dimension * p->vorder; + vstride = p->dimension; + + glMap2f( (p->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4, + p->umin, + p->umax, + ustride, + p->uorder, + p->vmin, + p->vmax, + vstride, + p->vorder, + p->ctlpoints); + + +/* + inMap2fEM(0, p->dimension, + p->umin, + p->umax, + ustride, + p->uorder, + p->vmin, + p->vmax, + vstride, + p->vorder, + p->ctlpoints); +*/ + } +#else + + if(bpm->bpatch != NULL){ + bezierPatch* p = bpm->bpatch; + ustride = p->dimension * p->vorder; + vstride = p->dimension; + inMap2fEM(0, p->dimension, + p->umin, + p->umax, + ustride, + p->uorder, + p->vmin, + p->vmax, + vstride, + p->vorder, + p->ctlpoints); + } + if(bpm->bpatch_normal != NULL){ + bezierPatch* p = bpm->bpatch_normal; + ustride = p->dimension * p->vorder; + vstride = p->dimension; + inMap2fEM(1, p->dimension, + p->umin, + p->umax, + ustride, + p->uorder, + p->vmin, + p->vmax, + vstride, + p->vorder, + p->ctlpoints); + } + if(bpm->bpatch_color != NULL){ + bezierPatch* p = bpm->bpatch_color; + ustride = p->dimension * p->vorder; + vstride = p->dimension; + inMap2fEM(2, p->dimension, + p->umin, + p->umax, + ustride, + p->uorder, + p->vmin, + p->vmax, + vstride, + p->vorder, + p->ctlpoints); + } + if(bpm->bpatch_texcoord != NULL){ + bezierPatch* p = bpm->bpatch_texcoord; + ustride = p->dimension * p->vorder; + vstride = p->dimension; + inMap2fEM(3, p->dimension, + p->umin, + p->umax, + ustride, + p->uorder, + p->vmin, + p->vmax, + vstride, + p->vorder, + p->ctlpoints); + } +#endif + + + k=0; + for(i=0; iindex_length_array; i++) + { +#ifdef USE_LOD + if(bpm->type_array[i] == GL_POLYGON) //a mesh + { + GLfloat *temp = bpm->UVarray+k; + GLfloat u0 = temp[0]; + GLfloat v0 = temp[1]; + GLfloat u1 = temp[2]; + GLfloat v1 = temp[3]; + GLint nu = (GLint) ( temp[4]); + GLint nv = (GLint) ( temp[5]); + GLint umin = (GLint) ( temp[6]); + GLint vmin = (GLint) ( temp[7]); + GLint umax = (GLint) ( temp[8]); + GLint vmax = (GLint) ( temp[9]); + + glMapGrid2f(LOD_eval_level*nu, u0, u1, LOD_eval_level*nv, v0, v1); + glEvalMesh2(GL_FILL, LOD_eval_level*umin, LOD_eval_level*umax, LOD_eval_level*vmin, LOD_eval_level*vmax); + } + else + { + LOD_eval(bpm->length_array[i], bpm->UVarray+k, bpm->type_array[i], + 0 + ); + } + k+= 2*bpm->length_array[i]; + +#else //undef USE_LOD + +#ifdef CRACK_TEST +if( bpm->bpatch->umin == 2 && bpm->bpatch->umax == 3 + && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3) +{ +REAL vertex[4]; +REAL normal[4]; +#ifdef DEBUG +printf("***number ****1\n"); +#endif + +beginCallBack(GL_QUAD_STRIP, NULL); +inDoEvalCoord2EM(3.0, 3.0); +inDoEvalCoord2EM(2.0, 3.0); +inDoEvalCoord2EM(3.0, 2.7); +inDoEvalCoord2EM(2.0, 2.7); +inDoEvalCoord2EM(3.0, 2.0); +inDoEvalCoord2EM(2.0, 2.0); +endCallBack(NULL); + +beginCallBack(GL_TRIANGLE_STRIP, NULL); +inDoEvalCoord2EM(2.0, 3.0); +inDoEvalCoord2EM(2.0, 2.0); +inDoEvalCoord2EM(2.0, 2.7); +endCallBack(NULL); + +} +if( bpm->bpatch->umin == 1 && bpm->bpatch->umax == 2 + && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3) +{ +#ifdef DEBUG +printf("***number 3\n"); +#endif +beginCallBack(GL_QUAD_STRIP, NULL); +inDoEvalCoord2EM(2.0, 3.0); +inDoEvalCoord2EM(1.0, 3.0); +inDoEvalCoord2EM(2.0, 2.3); +inDoEvalCoord2EM(1.0, 2.3); +inDoEvalCoord2EM(2.0, 2.0); +inDoEvalCoord2EM(1.0, 2.0); +endCallBack(NULL); + +beginCallBack(GL_TRIANGLE_STRIP, NULL); +inDoEvalCoord2EM(2.0, 2.3); +inDoEvalCoord2EM(2.0, 2.0); +inDoEvalCoord2EM(2.0, 3.0); +endCallBack(NULL); + +} +return; +#endif //CRACK_TEST + + beginCallBack(bpm->type_array[i], userData); + + for(j=0; jlength_array[i]; j++) + { + u = bpm->UVarray[k]; + v = bpm->UVarray[k+1]; +#ifdef USE_LOD + LOD_EVAL_COORD(u,v); +// glEvalCoord2f(u,v); +#else + +#ifdef GENERIC_TEST + float temp_normal[3]; + float temp_vertex[3]; + if(temp_signal == 0) + { + gTessVertexSphere(u,v, temp_normal, temp_vertex); +//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]); + normalCallBack(temp_normal, userData); + vertexCallBack(temp_vertex, userData); + } + else if(temp_signal == 1) + { + gTessVertexCyl(u,v, temp_normal, temp_vertex); +//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]); + normalCallBack(temp_normal, userData); + vertexCallBack(temp_vertex, userData); + } + else +#endif //GENERIC_TEST + + inDoEvalCoord2EM(u,v); + +#endif //USE_LOD + + k += 2; + } + endCallBack(userData); + +#endif //USE_LOD + } +} + +void OpenGLSurfaceEvaluator::inBPMListEvalEM(bezierPatchMesh* list) +{ + bezierPatchMesh* temp; + for(temp = list; temp != NULL; temp = temp->next) + { + inBPMEvalEM(temp); + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdio.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdio.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdio.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdio.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,60 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mystdio.h + * + */ + +#ifndef __glumystdio_h_ +#define __glumystdio_h_ + +#ifdef STANDALONE +inline void _glu_dprintf( const char *, ... ) { } +#endif + +#ifdef LIBRARYBUILD +#ifndef NDEBUG +#include +#define _glu_dprintf printf +#else +inline void _glu_dprintf( const char *, ... ) { } +#endif +#endif + +#ifdef GLBUILD +inline void _glu_dprintf( const char *, ... ) { } +#endif + +#ifndef NULL +#define NULL 0 +#endif + +#endif /* __glumystdio_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdlib.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdlib.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdlib.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/interface/mystdlib.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mystdlib.h + * + */ + +#ifndef __glumystdlib_h_ +#define __glumystdlib_h_ + +#ifdef STANDALONE +typedef unsigned int size_t; +extern "C" void abort( void ); +extern "C" void * malloc( size_t ); +extern "C" void free( void * ); +#endif + +#ifdef LIBRARYBUILD +#include +#endif + +#ifdef GLBUILD +typedef unsigned int size_t; +extern "C" void abort( void ); +extern "C" void * malloc( size_t ); +extern "C" void free( void * ); +#endif + +#endif /* __glumystdlib_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,347 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * arc.c++ + * + */ + +#include +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "arc.h" +#include "bin.h" +#include "bezierarc.h" +#include "pwlarc.h" +#include "simplemath.h" + +/* local preprocessor definitions */ +#define ZERO 0.00001/*0.000001*/ + +const int Arc::bezier_tag = (1<<13); +const int Arc::arc_tag = (1<<3); +const int Arc::tail_tag = (1<<6); + +/*-------------------------------------------------------------------------- + * makeSide - attach a pwl arc to an arc and mark it as a border arc + *-------------------------------------------------------------------------- + */ + +void +Arc::makeSide( PwlArc *pwl, arc_side side ) +{ + assert( pwl != 0); + assert( pwlArc == 0 ); + assert( pwl->npts > 0 ); + assert( pwl->pts != 0); + pwlArc = pwl; + clearbezier(); + setside( side ); +} + + +/*-------------------------------------------------------------------------- + * numpts - count number of points on arc loop + *-------------------------------------------------------------------------- + */ + +int +Arc::numpts( void ) +{ + Arc_ptr jarc = this; + int npts = 0; + do { + npts += jarc->pwlArc->npts; + jarc = jarc->next; + } while( jarc != this ); + return npts; +} + +/*-------------------------------------------------------------------------- + * markverts - mark each point with id of arc + *-------------------------------------------------------------------------- + */ + +void +Arc::markverts( void ) +{ + Arc_ptr jarc = this; + + do { + TrimVertex *p = jarc->pwlArc->pts; + for( int i=0; ipwlArc->npts; i++ ) + p[i].nuid = jarc->nuid; + jarc = jarc->next; + } while( jarc != this ); +} + +/*-------------------------------------------------------------------------- + * getextrema - find axis extrema on arc loop + *-------------------------------------------------------------------------- + */ + +void +Arc::getextrema( Arc_ptr extrema[4] ) +{ + REAL leftpt, botpt, rightpt, toppt; + + extrema[0] = extrema[1] = extrema[2] = extrema[3] = this; + + leftpt = rightpt = this->tail()[0]; + botpt = toppt = this->tail()[1]; + + for( Arc_ptr jarc = this->next; jarc != this; jarc = jarc->next ) { + if ( jarc->tail()[0] < leftpt || + (jarc->tail()[0] <= leftpt && jarc->rhead()[0]<=leftpt)) { + leftpt = jarc->pwlArc->pts->param[0]; + extrema[1] = jarc; + } + if ( jarc->tail()[0] > rightpt || + (jarc->tail()[0] >= rightpt && jarc->rhead()[0] >= rightpt)) { + rightpt = jarc->pwlArc->pts->param[0]; + extrema[3] = jarc; + } + if ( jarc->tail()[1] < botpt || + (jarc->tail()[1] <= botpt && jarc->rhead()[1] <= botpt )) { + botpt = jarc->pwlArc->pts->param[1]; + extrema[2] = jarc; + } + if ( jarc->tail()[1] > toppt || + (jarc->tail()[1] >= toppt && jarc->rhead()[1] >= toppt)) { + toppt = jarc->pwlArc->pts->param[1]; + extrema[0] = jarc; + } + } +} + + +/*------------------------------------------------------------------------- + * show - print to the stdout the vertices of a pwl arc + *------------------------------------------------------------------------- + */ + +void +Arc::show() +{ +#ifndef NDEBUG + _glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts ); + for( int i = 0; i < pwlArc->npts; i++ ) { + _glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0], + pwlArc->pts[i].param[1] ); + } +#endif +} + +/*------------------------------------------------------------------------- + * print - print out the vertices of all pwl arcs on a loop + *------------------------------------------------------------------------- + */ + +void +Arc::print( void ) +{ + Arc_ptr jarc = this; + +#ifndef NDEBUG + _glu_dprintf( "BGNTRIM\n" ); +#endif + do { + jarc->show( ); + jarc = jarc->next; + } while (jarc != this); +#ifndef NDEBUG + _glu_dprintf("ENDTRIM\n" ); +#endif +} + +/*------------------------------------------------------------------------- + * isDisconnected - check if tail of arc and head of prev meet + *------------------------------------------------------------------------- + */ + +int +Arc::isDisconnected( void ) +{ + if( pwlArc == 0 ) return 0; + if( prev->pwlArc == 0 ) return 0; + + REAL *p0 = tail(); + REAL *p1 = prev->rhead(); + + if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) || + ((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) { +#ifndef NDEBUG + _glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] ); + _glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] ); +#endif + return 1; + } else { + /* average two points together */ + p0[0] = p1[0] = (p1[0] + p0[0]) * 0.5; + p0[1] = p1[1] = (p1[1] + p0[1]) * 0.5; + return 0; + } +} + +/*------------------------------------------------------------------------- + * neq_vert - assert that two 2D vertices are not equal + *------------------------------------------------------------------------- + */ + +inline static int +neq_vert( REAL *v1, REAL *v2 ) +{ + return ((v1[0] != v2[0]) || (v1[1] != v2[1] )) ? 1 : 0; +} + +/*------------------------------------------------------------------------- + * check - verify consistency of a loop, including + * 1) if pwl, no two consecutive vertices are identical + * 2) the circular link pointers are valid + * 3) the geometric info at the head and tail are consistent + *------------------------------------------------------------------------- + */ + +int +Arc::check( void ) +{ + if( this == 0 ) return 1; + Arc_ptr jarc = this; + do { + assert( (jarc->pwlArc != 0) || (jarc->bezierArc != 0) ); + + if (jarc->prev == 0 || jarc->next == 0) { +#ifndef NDEBUG + _glu_dprintf( "checkjarc:null next/prev pointer\n"); + jarc->print( ); +#endif + return 0; + } + + if (jarc->next->prev != jarc) { +#ifndef NDEBUG + _glu_dprintf( "checkjarc: pointer linkage screwed up\n"); + jarc->print( ); +#endif + return 0; + } + + if( jarc->pwlArc ) { +#ifndef NDEBUG + assert( jarc->pwlArc->npts >= 1 ); + assert( jarc->pwlArc->npts < 100000 ); +/* + for( int i=0; i < jarc->pwlArc->npts-1; i++ ) + assert( neq_vert( jarc->pwlArc->pts[i].param, + jarc->pwlArc->pts[i+1].param) ); +*/ +#endif + if( jarc->prev->pwlArc ) { + if( jarc->tail()[1] != jarc->prev->rhead()[1] ) { +#ifndef NDEBUG + _glu_dprintf( "checkjarc: geometric linkage screwed up 1\n"); + jarc->prev->show(); + jarc->show(); +#endif + return 0; + } + if( jarc->tail()[0] != jarc->prev->rhead()[0] ) { + +#ifndef NDEBUG + _glu_dprintf( "checkjarc: geometric linkage screwed up 2\n"); + jarc->prev->show(); + jarc->show(); +#endif + return 0; + } + } + if( jarc->next->pwlArc ) { + if( jarc->next->tail()[0] != jarc->rhead()[0] ) { +#ifndef NDEBUG + _glu_dprintf( "checkjarc: geometric linkage screwed up 3\n"); + jarc->show(); + jarc->next->show(); +#endif + return 0; + } + if( jarc->next->tail()[1] != jarc->rhead()[1] ) { +#ifndef NDEBUG + _glu_dprintf( "checkjarc: geometric linkage screwed up 4\n"); + jarc->show(); + jarc->next->show(); +#endif + return 0; + } + } + if( jarc->isbezier() ) { + assert( jarc->pwlArc->npts == 2 ); + assert( (jarc->pwlArc->pts[0].param[0] == \ + jarc->pwlArc->pts[1].param[0]) ||\ + (jarc->pwlArc->pts[0].param[1] == \ + jarc->pwlArc->pts[1].param[1]) ); + } + } + jarc = jarc->next; + } while (jarc != this); + return 1; +} + + +#define TOL 0.00001 + +inline long tooclose( REAL x, REAL y ) +{ + return (glu_abs(x-y) < TOL) ? 1 : 0; +} + + +/*-------------------------------------------------------------------------- + * append - append a jordan arc to a circularly linked list + *-------------------------------------------------------------------------- + */ + +Arc_ptr +Arc::append( Arc_ptr jarc ) +{ + if( jarc != 0 ) { + next = jarc->next; + prev = jarc; + next->prev = prev->next = this; + } else { + next = prev = this; + } + return this; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arc.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,133 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * arc.h + * + */ + +#ifndef __gluarc_h_ +#define __gluarc_h_ + +#include "myassert.h" +#include "bufpool.h" +#include "mystdio.h" +#include "types.h" +#include "pwlarc.h" +#include "trimvertex.h" + +class Bin; +class Arc; +struct BezierArc; + +typedef class Arc *Arc_ptr; + +enum arc_side { arc_none = 0, arc_right, arc_top, arc_left, arc_bottom }; + + +class Arc: public PooledObj { /* an arc, in two list, the trim list and bin */ + +public: + static const int bezier_tag; + static const int arc_tag; + static const int tail_tag; + Arc_ptr prev; /* trim list pointer */ + Arc_ptr next; /* trim list pointer */ + Arc_ptr link; /* bin pointers */ + BezierArc * bezierArc; /* associated bezier arc */ + PwlArc * pwlArc; /* associated pwl arc */ + long type; /* curve type */ + long nuid; + + inline Arc( Arc *, PwlArc * ); + inline Arc( arc_side, long ); + + Arc_ptr append( Arc_ptr ); + int check( void ); + int isMonotone( void ); + int isDisconnected( void ); + int numpts( void ); + void markverts( void ); + void getextrema( Arc_ptr[4] ); + void print( void ); + void show( void ); + void makeSide( PwlArc *, arc_side ); + inline int isTessellated() { return pwlArc ? 1 : 0; } + inline long isbezier() { return type & bezier_tag; } + inline void setbezier() { type |= bezier_tag; } + inline void clearbezier() { type &= ~bezier_tag; } + inline long npts() { return pwlArc->npts; } + inline TrimVertex * pts() { return pwlArc->pts; } + inline REAL * tail() { return pwlArc->pts[0].param; } + inline REAL * head() { return next->pwlArc->pts[0].param; } + inline REAL * rhead() { return pwlArc->pts[pwlArc->npts-1].param; } + inline long ismarked() { return type & arc_tag; } + inline void setmark() { type |= arc_tag; } + inline void clearmark() { type &= (~arc_tag); } + inline void clearside() { type &= ~(0x7 << 8); } + inline void setside( arc_side s ) { clearside(); type |= (((long)s)<<8); } + inline arc_side getside() { return (arc_side) ((type>>8) & 0x7); } + inline int getitail() { return type & tail_tag; } + inline void setitail() { type |= tail_tag; } + inline void clearitail() { type &= (~tail_tag); } +}; + +/*-------------------------------------------------------------------------- + * Arc - initialize a new Arc with the same type and uid of + * a given Arc and a given pwl arc + *-------------------------------------------------------------------------- + */ + +inline +Arc::Arc( Arc *j, PwlArc *p ) +{ + bezierArc = NULL; + pwlArc = p; + type = j->type; + nuid = j->nuid; +} + +/*-------------------------------------------------------------------------- + * Arc - initialize a new Arc with the same type and uid of + * a given Arc and a given pwl arc + *-------------------------------------------------------------------------- + */ + +inline +Arc::Arc( arc_side side, long _nuid ) +{ + bezierArc = NULL; + pwlArc = NULL; + type = 0; + setside( side ); + nuid = _nuid; +} + +#endif /* __gluarc_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,172 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * arcsorter.c++ + * + */ + +#ifndef __gluarcsorter_c_ +#define __gluarcsorter_c_ + +#include "glimports.h" +#include "arc.h" +#include "arcsorter.h" +#include "subdivider.h" + +ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s) +{ +} + +int +ArcSorter::qscmp( char *, char * ) +{ + _glu_dprintf( "ArcSorter::qscmp: pure virtual called\n" ); + return 0; +} + +void +ArcSorter::qsort( Arc **a, int n ) +{ + Sorter::qsort( (void *) a, n ); +} + +void +ArcSorter::qsexc( char *i, char *j )// i<-j, j<-i +{ + Arc **jarc1 = (Arc **) i; + Arc **jarc2 = (Arc **) j; + Arc *tmp = *jarc1; + *jarc1 = *jarc2; + *jarc2 = tmp; +} + +void +ArcSorter::qstexc( char *i, char *j, char *k )// i<-k, k<-j, j<-i +{ + Arc **jarc1 = (Arc **) i; + Arc **jarc2 = (Arc **) j; + Arc **jarc3 = (Arc **) k; + Arc *tmp = *jarc1; + *jarc1 = *jarc3; + *jarc3 = *jarc2; + *jarc2 = tmp; +} + + +ArcSdirSorter::ArcSdirSorter( Subdivider &s ) : ArcSorter(s) +{ +} + +int +ArcSdirSorter::qscmp( char *i, char *j ) +{ + Arc *jarc1 = *(Arc **) i; + Arc *jarc2 = *(Arc **) j; + + int v1 = (jarc1->getitail() ? 0 : (jarc1->pwlArc->npts - 1)); + int v2 = (jarc2->getitail() ? 0 : (jarc2->pwlArc->npts - 1)); + + REAL diff = jarc1->pwlArc->pts[v1].param[1] - + jarc2->pwlArc->pts[v2].param[1]; + + if( diff < 0.0) + return -1; + else if( diff > 0.0) + return 1; + else { + if( v1 == 0 ) { + if( jarc2->tail()[0] < jarc1->tail()[0] ) { + return subdivider.ccwTurn_sl( jarc2, jarc1 ) ? 1 : -1; + } else { + return subdivider.ccwTurn_sr( jarc2, jarc1 ) ? -1 : 1; + } + } else { + if( jarc2->head()[0] < jarc1->head()[0] ) { + return subdivider.ccwTurn_sl( jarc1, jarc2 ) ? -1 : 1; + } else { + return subdivider.ccwTurn_sr( jarc1, jarc2 ) ? 1 : -1; + } + } + } +} + +ArcTdirSorter::ArcTdirSorter( Subdivider &s ) : ArcSorter(s) +{ +} + +/*---------------------------------------------------------------------------- + * ArcTdirSorter::qscmp - + * compare two axis monotone arcs that are incident + * to the line T == compare_value. Determine which of the + * two intersects that line with a LESSER S value. If + * jarc1 does, return 1. If jarc2 does, return -1. + *---------------------------------------------------------------------------- + */ +int +ArcTdirSorter::qscmp( char *i, char *j ) +{ + Arc *jarc1 = *(Arc **) i; + Arc *jarc2 = *(Arc **) j; + + int v1 = (jarc1->getitail() ? 0 : (jarc1->pwlArc->npts - 1)); + int v2 = (jarc2->getitail() ? 0 : (jarc2->pwlArc->npts - 1)); + + REAL diff = jarc1->pwlArc->pts[v1].param[0] - + jarc2->pwlArc->pts[v2].param[0]; + + if( diff < 0.0) + return 1; + else if( diff > 0.0) + return -1; + else { + if( v1 == 0 ) { + if (jarc2->tail()[1] < jarc1->tail()[1]) { + return subdivider.ccwTurn_tl( jarc2, jarc1 ) ? 1 : -1; + } else { + return subdivider.ccwTurn_tr( jarc2, jarc1 ) ? -1 : 1; + } + } else { + if( jarc2->head()[1] < jarc1->head()[1] ) { + return subdivider.ccwTurn_tl( jarc1, jarc2 ) ? -1 : 1; + } else { + return subdivider.ccwTurn_tr( jarc1, jarc2 ) ? 1 : -1; + } + } + } +} + + + +#endif /* __gluarcsorter_c_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arcsorter.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,73 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * arcsorter.h + * + */ + +#ifndef __gluarcsorter_h_ +#define __gluarcsorter_h_ + +#include "sorter.h" +#include "arcsorter.h" + +class Arc; +class Subdivider; + +class ArcSorter : private Sorter { +public: + ArcSorter(Subdivider &); + void qsort( Arc **a, int n ); +protected: + virtual int qscmp( char *, char * ); + Subdivider& subdivider; +private: + void qsexc( char *i, char *j ); // i<-j, j<-i + void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i +}; + + +class ArcSdirSorter : public ArcSorter { +public: + ArcSdirSorter( Subdivider & ); +private: + int qscmp( char *, char * ); +}; + + +class ArcTdirSorter : public ArcSorter { +public: + ArcTdirSorter( Subdivider & ); +private: + int qscmp( char *, char * ); +}; + +#endif /* __gluarcsorter_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,611 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * arctessellator.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "arctess.h" +#include "bufpool.h" +#include "simplemath.h" +#include "bezierarc.h" +#include "trimvertex.h" +#include "trimvertpool.h" + +#define NOELIMINATION + +#define steps_function(large, small, rate) (max(1, 1+ (int) ((large-small)/rate))); + +/*----------------------------------------------------------------------------- + * ArcTessellator - construct an ArcTessellator + *----------------------------------------------------------------------------- + */ + +ArcTessellator::ArcTessellator( TrimVertexPool& t, Pool& p ) + : pwlarcpool(p), trimvertexpool(t) +{ +} + +/*----------------------------------------------------------------------------- + * ~ArcTessellator - destroy an ArcTessellator + *----------------------------------------------------------------------------- + */ + +ArcTessellator::~ArcTessellator( void ) +{ +} + +/*----------------------------------------------------------------------------- + * bezier - construct a bezier arc and attach it to an Arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::bezier( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2 ) +{ + assert( arc != 0 ); + assert( ! arc->isTessellated() ); + +#ifndef NDEBUG + switch( arc->getside() ) { + case arc_left: + assert( s1 == s2 ); + assert( t2 < t1 ); + break; + case arc_right: + assert( s1 == s2 ); + assert( t1 < t2 ); + break; + case arc_top: + assert( t1 == t2 ); + assert( s2 < s1 ); + break; + case arc_bottom: + assert( t1 == t2 ); + assert( s1 < s2 ); + break; + case arc_none: + (void) abort(); + break; + } +#endif + + TrimVertex *p = trimvertexpool.get(2); + arc->pwlArc = new(pwlarcpool) PwlArc( 2, p ); + p[0].param[0] = s1; + p[0].param[1] = t1; + p[1].param[0] = s2; + p[1].param[1] = t2; + assert( (s1 == s2) || (t1 == t2) ); + arc->setbezier(); +} + + +/*----------------------------------------------------------------------------- + * pwl_left - construct a left boundary pwl arc and attach it to an arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::pwl_left( Arc *arc, REAL s, REAL t1, REAL t2, REAL rate ) +{ + assert( t2 < t1 ); + +/* if(rate <= 0.06) rate = 0.06;*/ +/* int nsteps = 1 + (int) ((t1 - t2) / rate ); */ + int nsteps = steps_function(t1, t2, rate); + + + REAL stepsize = (t1 - t2) / (REAL) nsteps; + + TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); + int i; + for( i = nsteps; i > 0; i-- ) { + newvert[i].param[0] = s; + newvert[i].param[1] = t2; + t2 += stepsize; + } + newvert[i].param[0] = s; + newvert[i].param[1] = t1; + + arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_left ); +} + +/*----------------------------------------------------------------------------- + * pwl_right - construct a right boundary pwl arc and attach it to an arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::pwl_right( Arc *arc, REAL s, REAL t1, REAL t2, REAL rate ) +{ + assert( t1 < t2 ); + +/* if(rate <= 0.06) rate = 0.06;*/ + +/* int nsteps = 1 + (int) ((t2 - t1) / rate ); */ + int nsteps = steps_function(t2,t1,rate); + REAL stepsize = (t2 - t1) / (REAL) nsteps; + + TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); + int i; + for( i = 0; i < nsteps; i++ ) { + newvert[i].param[0] = s; + newvert[i].param[1] = t1; + t1 += stepsize; + } + newvert[i].param[0] = s; + newvert[i].param[1] = t2; + + arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_right ); +} + + +/*----------------------------------------------------------------------------- + * pwl_top - construct a top boundary pwl arc and attach it to an arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::pwl_top( Arc *arc, REAL t, REAL s1, REAL s2, REAL rate ) +{ + assert( s2 < s1 ); + +/* if(rate <= 0.06) rate = 0.06;*/ + +/* int nsteps = 1 + (int) ((s1 - s2) / rate ); */ + int nsteps = steps_function(s1,s2,rate); + REAL stepsize = (s1 - s2) / (REAL) nsteps; + + TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); + int i; + for( i = nsteps; i > 0; i-- ) { + newvert[i].param[0] = s2; + newvert[i].param[1] = t; + s2 += stepsize; + } + newvert[i].param[0] = s1; + newvert[i].param[1] = t; + + arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_top ); +} + +/*----------------------------------------------------------------------------- + * pwl_bottom - construct a bottom boundary pwl arc and attach it to an arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::pwl_bottom( Arc *arc, REAL t, REAL s1, REAL s2, REAL rate ) +{ + assert( s1 < s2 ); + +/* if(rate <= 0.06) rate = 0.06;*/ + +/* int nsteps = 1 + (int) ((s2 - s1) / rate ); */ + int nsteps = steps_function(s2,s1,rate); + REAL stepsize = (s2 - s1) / (REAL) nsteps; + + TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); + int i; + for( i = 0; i < nsteps; i++ ) { + newvert[i].param[0] = s1; + newvert[i].param[1] = t; + s1 += stepsize; + } + newvert[i].param[0] = s2; + newvert[i].param[1] = t; + + arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_bottom ); +} + +/*----------------------------------------------------------------------------- + * pwl - construct a pwl arc and attach it to an arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::pwl( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2, REAL rate ) +{ + +/* if(rate <= 0.06) rate = 0.06;*/ + + int snsteps = 1 + (int) (glu_abs(s2 - s1) / rate ); + int tnsteps = 1 + (int) (glu_abs(t2 - t1) / rate ); + int nsteps = max(1,max( snsteps, tnsteps )); + + REAL sstepsize = (s2 - s1) / (REAL) nsteps; + REAL tstepsize = (t2 - t1) / (REAL) nsteps; + TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); + long i; + for( i = 0; i < nsteps; i++ ) { + newvert[i].param[0] = s1; + newvert[i].param[1] = t1; + s1 += sstepsize; + t1 += tstepsize; + } + newvert[i].param[0] = s2; + newvert[i].param[1] = t2; + + /* arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_bottom ); */ + arc->pwlArc = new(pwlarcpool) PwlArc( nsteps+1, newvert ); + + arc->clearbezier(); + arc->clearside( ); +} + + +/*----------------------------------------------------------------------------- + * tessellateLinear - constuct a linear pwl arc and attach it to an Arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::tessellateLinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize, int isrational ) +{ + assert( arc->pwlArc == NULL ); + REAL s1, s2, t1, t2; + + //we don't need to scale by arc_stepsize if the trim curve + //is piecewise linear. Reason: In pwl_right, pwl_left, pwl_top, pwl_left, + //and pwl, the nsteps is computed by deltaU (or V) /stepsize. + //The quantity deltaU/arc_stepsize doesn't have any meaning. And + //it causes problems: see bug 517641 + REAL stepsize = geo_stepsize; /* * arc_stepsize*/; + + BezierArc *b = arc->bezierArc; + + if( isrational ) { + s1 = b->cpts[0] / b->cpts[2]; + t1 = b->cpts[1] / b->cpts[2]; + s2 = b->cpts[b->stride+0] / b->cpts[b->stride+2]; + t2 = b->cpts[b->stride+1] / b->cpts[b->stride+2]; + } else { + s1 = b->cpts[0]; + t1 = b->cpts[1]; + s2 = b->cpts[b->stride+0]; + t2 = b->cpts[b->stride+1]; + } + if( s1 == s2 ) + if( t1 < t2 ) + pwl_right( arc, s1, t1, t2, stepsize ); + else + pwl_left( arc, s1, t1, t2, stepsize ); + else if( t1 == t2 ) + if( s1 < s2 ) + pwl_bottom( arc, t1, s1, s2, stepsize ); + else + pwl_top( arc, t1, s1, s2, stepsize ); + else + pwl( arc, s1, s2, t1, t2, stepsize ); +} + +/*----------------------------------------------------------------------------- + * tessellateNonlinear - constuct a nonlinear pwl arc and attach it to an Arc + *----------------------------------------------------------------------------- + */ + +void +ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize, int isrational ) +{ + assert( arc->pwlArc == NULL ); + + REAL stepsize = geo_stepsize * arc_stepsize; + + BezierArc *bezierArc = arc->bezierArc; + + REAL size; //bounding box size of the curve in UV + { + int i,j; + REAL min_u, min_v, max_u,max_v; + min_u = max_u = bezierArc->cpts[0]; + min_v = max_v = bezierArc->cpts[1]; + for(i=1, j=bezierArc->stride; iorder; i++, j+= bezierArc->stride) + { + if(bezierArc->cpts[j] < min_u) + min_u = bezierArc->cpts[j]; + if(bezierArc->cpts[j] > max_u) + max_u = bezierArc->cpts[j]; + if(bezierArc->cpts[j+1] < min_v) + min_v = bezierArc->cpts[j+1]; + if(bezierArc->cpts[j+1] > max_v) + max_v = bezierArc->cpts[j+1]; + } + + size = max_u - min_u; + if(size < max_v - min_v) + size = max_v - min_v; + } + + /*int nsteps = 1 + (int) (1.0/stepsize);*/ + + int nsteps = (int) (size/stepsize); + if(nsteps <=0) + nsteps=1; + + TrimVertex *vert = trimvertexpool.get( nsteps+1 ); + REAL dp = 1.0/nsteps; + + + arc->pwlArc = new(pwlarcpool) PwlArc(); + arc->pwlArc->pts = vert; + + if( isrational ) { + REAL pow_u[MAXORDER], pow_v[MAXORDER], pow_w[MAXORDER]; + trim_power_coeffs( bezierArc, pow_u, 0 ); + trim_power_coeffs( bezierArc, pow_v, 1 ); + trim_power_coeffs( bezierArc, pow_w, 2 ); + + /* compute first point exactly */ + REAL *b = bezierArc->cpts; + vert->param[0] = b[0]/b[2]; + vert->param[1] = b[1]/b[2]; + + /* strength reduction on p = dp * step would introduce error */ + int step; +#ifndef NOELIMINATION + int ocanremove = 0; +#endif + register long order = bezierArc->order; + for( step=1, ++vert; stepparam[0] = u/w; + vert->param[1] = v/w; +#ifndef NOELIMINATION + REAL ds = glu_abs(vert[0].param[0] - vert[-1].param[0]); + REAL dt = glu_abs(vert[0].param[1] - vert[-1].param[1]); + int canremove = (dsstride; + vert->param[0] = b[0]/b[2]; + vert->param[1] = b[1]/b[2]; + + } else { + REAL pow_u[MAXORDER], pow_v[MAXORDER]; + trim_power_coeffs( bezierArc, pow_u, 0 ); + trim_power_coeffs( bezierArc, pow_v, 1 ); + + /* compute first point exactly */ + REAL *b = bezierArc->cpts; + vert->param[0] = b[0]; + vert->param[1] = b[1]; + + /* strength reduction on p = dp * step would introduce error */ + int step; +#ifndef NOELIMINATION + int ocanremove = 0; +#endif + register long order = bezierArc->order; + for( step=1, ++vert; steporder; i++ ) { + u = u * p + pow_u[i]; + v = v * p + pow_v[i]; + } + vert->param[0] = u; + vert->param[1] = v; +#ifndef NOELIMINATION + REAL ds = glu_abs(vert[0].param[0] - vert[-1].param[0]); + REAL dt = glu_abs(vert[0].param[1] - vert[-1].param[1]); + int canremove = (dsstride; + vert->param[0] = b[0]; + vert->param[1] = b[1]; + } + arc->pwlArc->npts = vert - arc->pwlArc->pts + 1; +/* + for( TrimVertex *vt=pwlArc->pts; vt != vert-1; vt++ ) { + if( tooclose( vt[0].param[0], vt[1].param[0] ) ) + vt[1].param[0] = vt[0].param[0]; + if( tooclose( vt[0].param[1], vt[1].param[1] ) ) + vt[1].param[1] = vt[0].param[1]; + } +*/ +} + +const REAL ArcTessellator::gl_Bernstein[][MAXORDER][MAXORDER] = { + { + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {-1, 1, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {1, -2, 1, 0, 0, 0, 0, 0 }, + {-2, 2, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {-1, 3, -3, 1, 0, 0, 0, 0 }, + {3, -6, 3, 0, 0, 0, 0, 0 }, + {-3, 3, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {1, -4, 6, -4, 1, 0, 0, 0 }, + {-4, 12, -12, 4, 0, 0, 0, 0 }, + {6, -12, 6, 0, 0, 0, 0, 0 }, + {-4, 4, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {-1, 5, -10, 10, -5, 1, 0, 0 }, + {5, -20, 30, -20, 5, 0, 0, 0 }, + {-10, 30, -30, 10, 0, 0, 0, 0 }, + {10, -20, 10, 0, 0, 0, 0, 0 }, + {-5, 5, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {1, -6, 15, -20, 15, -6, 1, 0 }, + {-6, 30, -60, 60, -30, 6, 0, 0 }, + {15, -60, 90, -60, 15, 0, 0, 0 }, + {-20, 60, -60, 20, 0, 0, 0, 0 }, + {15, -30, 15, 0, 0, 0, 0, 0 }, + {-6, 6, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 }, + {0, 0, 0, 0, 0, 0, 0, 0 } + }, + { + {-1, 7, -21, 35, -35, 21, -7, 1 }, + {7, -42, 105, -140, 105, -42, 7, 0 }, + {-21, 105, -210, 210, -105, 21, 0, 0 }, + {35, -140, 210, -140, 35, 0, 0, 0 }, + {-35, 105, -105, 35, 0, 0, 0, 0 }, + {21, -42, 21, 0, 0, 0, 0, 0 }, + {-7, 7, 0, 0, 0, 0, 0, 0 }, + {1, 0, 0, 0, 0, 0, 0, 0 } + }}; + + +/*----------------------------------------------------------------------------- + * trim_power_coeffs - compute power basis coefficients from bezier coeffients + *----------------------------------------------------------------------------- + */ +void +ArcTessellator::trim_power_coeffs( BezierArc *bez_arc, REAL *p, int coord ) +{ + register int stride = bez_arc->stride; + register int order = bez_arc->order; + register REAL *base = bez_arc->cpts + coord; + + REAL const (*mat)[MAXORDER][MAXORDER] = &gl_Bernstein[order-1]; + REAL const (*lrow)[MAXORDER] = &(*mat)[order]; + + /* WIN32 didn't like the following line within the for-loop */ + REAL const (*row)[MAXORDER] = &(*mat)[0]; + for( ; row != lrow; row++ ) { + register REAL s = 0.0; + register REAL *point = base; + register REAL const *mlast = *row + order; + for( REAL const *m = *row; m != mlast; m++, point += stride ) + s += *(m) * (*point); + *(p++) = s; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/arctess.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,66 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * arctess.h + * + */ + +#ifndef __gluarctess_h_ +#define __gluarctess_h_ + +#include "defines.h" +#include "types.h" +#include "arc.h" + +struct BezierArc; +class Pool; +class TrimVertexPool; + +class ArcTessellator { +public: + ArcTessellator( TrimVertexPool&, Pool& ); + ~ArcTessellator( void ); + void bezier( Arc_ptr, REAL, REAL, REAL, REAL ); + void pwl( Arc_ptr, REAL, REAL, REAL, REAL, REAL ); + void pwl_left( Arc_ptr, REAL, REAL, REAL, REAL ); + void pwl_right( Arc_ptr, REAL, REAL, REAL, REAL ); + void pwl_top( Arc_ptr, REAL, REAL, REAL, REAL ); + void pwl_bottom( Arc_ptr, REAL, REAL, REAL, REAL ); + void tessellateLinear( Arc_ptr, REAL, REAL, int ); + void tessellateNonlinear( Arc_ptr, REAL, REAL, int ); +private: + static const REAL gl_Bernstein[][MAXORDER][MAXORDER]; + Pool& pwlarcpool; + TrimVertexPool& trimvertexpool; + static void trim_power_coeffs( BezierArc *, REAL[MAXORDER], int ); +}; + +#endif /* __gluarctess_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,589 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * backend.c++ + * + */ + +/* Bezier surface backend + - interprets display mode (wireframe,shaded,...) +*/ +#include +#include "glimports.h" +#include "mystdio.h" +#include "backend.h" +#include "basiccrveval.h" +#include "basicsurfeval.h" +#include "nurbsconsts.h" + +#define NOWIREFRAME + + +/*------------------------------------------------------------------------- + * bgnsurf - preamble to surface definition and evaluations + *------------------------------------------------------------------------- + */ +void +Backend::bgnsurf( int wiretris, int wirequads, long nuid ) +{ +/*#ifndef NOWIREFRAME*/ //need this for old version + wireframetris = wiretris; + wireframequads = wirequads; +/*#endif*/ + + /*in the spec, GLU_DISPLAY_MODE is either + * GLU_FILL + * GLU_OUTLINE_POLY + * GLU_OUTLINE_PATCH. + *In fact, GLU_FLL is has the same effect as + * set GL_FRONT_AND_BACK to be GL_FILL + * and GLU_OUTLINE_POLY is the same as set + * GL_FRONT_AND_BACK to be GL_LINE + *It is more efficient to do this once at the beginning of + *each surface than to do it for each primitive. + * The internal has more options: outline_triangle and outline_quad + *can be seperated. But since this is not in spec, and more importantly, + *this is not so useful, so we don't need to keep this option. + */ + + surfaceEvaluator.bgnmap2f( nuid ); + + if(wiretris) + surfaceEvaluator.polymode(N_MESHLINE); + else + surfaceEvaluator.polymode(N_MESHFILL); +} + +void +Backend::patch( REAL ulo, REAL uhi, REAL vlo, REAL vhi ) +{ + surfaceEvaluator.domain2f( ulo, uhi, vlo, vhi ); +} + +void +Backend::surfbbox( long type, REAL *from, REAL *to ) +{ + surfaceEvaluator.range2f( type, from, to ); +} + +/*------------------------------------------------------------------------- + * surfpts - pass a desription of a surface map + *------------------------------------------------------------------------- + */ +void +Backend::surfpts( + long type, /* geometry, color, texture, normal */ + REAL *pts, /* control points */ + long ustride, /* distance to next point in u direction */ + long vstride, /* distance to next point in v direction */ + int uorder, /* u parametric order */ + int vorder, /* v parametric order */ + REAL ulo, /* u lower bound */ + REAL uhi, /* u upper bound */ + REAL vlo, /* v lower bound */ + REAL vhi ) /* v upper bound */ +{ + surfaceEvaluator.map2f( type,ulo,uhi,ustride,uorder,vlo,vhi,vstride,vorder,pts ); + surfaceEvaluator.enable( type ); +} + +/*------------------------------------------------------------------------- + * surfgrid - define a lattice of points with origin and offset + *------------------------------------------------------------------------- + */ +void +Backend::surfgrid( REAL u0, REAL u1, long nu, REAL v0, REAL v1, long nv ) +{ + surfaceEvaluator.mapgrid2f( nu, u0, u1, nv, v0, v1 ); +} + +/*------------------------------------------------------------------------- + * surfmesh - evaluate a mesh of points on lattice + *------------------------------------------------------------------------- + */ +void +Backend::surfmesh( long u, long v, long n, long m ) +{ +#ifndef NOWIREFRAME + if( wireframequads ) { + long v0, v1; + long u0f = u, u1f = u+n; + long v0f = v, v1f = v+m; + long parity = (u & 1); + + for( v0 = v0f, v1 = v0f++ ; v0isGridVert() ) { + tmeshvert( v->g ); + } else { + tmeshvert( v->t ); + } +} + +void +Backend::tmeshvertNOGE(TrimVertex *t) +{ +// surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], temp, ttt); +#ifdef USE_OPTTT + surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], t->cache_point, t->cache_normal); +#endif +} + +//opt for a line with the same u. +void +Backend::tmeshvertNOGE_BU(TrimVertex *t) +{ +#ifdef USE_OPTTT + surfaceEvaluator.inDoEvalCoord2NOGE_BU( t->param[0], t->param[1], t->cache_point, t->cache_normal); +#endif +} + +//opt for a line with the same v. +void +Backend::tmeshvertNOGE_BV(TrimVertex *t) +{ +#ifdef USE_OPTTT + surfaceEvaluator.inDoEvalCoord2NOGE_BV( t->param[0], t->param[1], t->cache_point, t->cache_normal); +#endif +} + +void +Backend::preEvaluateBU(REAL u) +{ + surfaceEvaluator.inPreEvaluateBU_intfac(u); +} + +void +Backend::preEvaluateBV(REAL v) +{ + surfaceEvaluator.inPreEvaluateBV_intfac(v); +} + + +/*------------------------------------------------------------------------- + * tmeshvert - evaluate a point on a triangle mesh + *------------------------------------------------------------------------- + */ +void +Backend::tmeshvert( TrimVertex *t ) +{ + +#ifndef NOWIREFRAME + const long nuid = t->nuid; +#endif + const REAL u = t->param[0]; + const REAL v = t->param[1]; + +#ifndef NOWIREFRAME + npts++; + if( wireframetris ) { + if( npts >= 3 ) { + surfaceEvaluator.bgnclosedline(); + if( mesh[0][2] == 0 ) + surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] ); + else + surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] ); + if( mesh[1][2] == 0 ) + surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] ); + else + surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] ); + surfaceEvaluator.evalcoord2f( nuid, u, v ); + surfaceEvaluator.endclosedline(); + } + mesh[meshindex][0] = u; + mesh[meshindex][1] = v; + mesh[meshindex][2] = 0; + mesh[meshindex][3] = nuid; + meshindex = (meshindex+1) % 2; + } else { + surfaceEvaluator.evalcoord2f( nuid, u, v ); + } +#else + + surfaceEvaluator.evalcoord2f( 0, u, v ); +//for uninitial memory read surfaceEvaluator.evalcoord2f( nuid, u, v ); +#endif +} + +//the same as tmeshvert(trimvertex), for efficiency purpose +void +Backend::tmeshvert( REAL u, REAL v ) +{ +#ifndef NOWIREFRAME + const long nuid = 0; + + npts++; + if( wireframetris ) { + if( npts >= 3 ) { + surfaceEvaluator.bgnclosedline(); + if( mesh[0][2] == 0 ) + surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] ); + else + surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] ); + if( mesh[1][2] == 0 ) + surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] ); + else + surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] ); + surfaceEvaluator.evalcoord2f( nuid, u, v ); + surfaceEvaluator.endclosedline(); + } + mesh[meshindex][0] = u; + mesh[meshindex][1] = v; + mesh[meshindex][2] = 0; + mesh[meshindex][3] = nuid; + meshindex = (meshindex+1) % 2; + } else { + surfaceEvaluator.evalcoord2f( nuid, u, v ); + } +#else + + surfaceEvaluator.evalcoord2f( 0, u, v ); +#endif +} + +/*------------------------------------------------------------------------- + * tmeshvert - evaluate a grid point of a triangle mesh + *------------------------------------------------------------------------- + */ +void +Backend::tmeshvert( GridVertex *g ) +{ + const long u = g->gparam[0]; + const long v = g->gparam[1]; + +#ifndef NOWIREFRAME + npts++; + if( wireframetris ) { + if( npts >= 3 ) { + surfaceEvaluator.bgnclosedline(); + if( mesh[0][2] == 0 ) + surfaceEvaluator.evalcoord2f( (long) mesh[0][3], mesh[0][0], mesh[0][1] ); + else + surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] ); + if( mesh[1][2] == 0 ) + surfaceEvaluator.evalcoord2f( (long) mesh[1][3], mesh[1][0], mesh[1][1] ); + else + surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] ); + surfaceEvaluator.evalpoint2i( u, v ); + surfaceEvaluator.endclosedline(); + } + mesh[meshindex][0] = u; + mesh[meshindex][1] = v; + mesh[meshindex][2] = 1; + meshindex = (meshindex+1) % 2; + } else { + surfaceEvaluator.evalpoint2i( u, v ); + } +#else + surfaceEvaluator.evalpoint2i( u, v ); +#endif +} + +/*------------------------------------------------------------------------- + * swaptmesh - perform a swap of the triangle mesh pointers + *------------------------------------------------------------------------- + */ +void +Backend::swaptmesh( void ) +{ +#ifndef NOWIREFRAME + if( wireframetris ) { + meshindex = 1 - meshindex; + } else { + surfaceEvaluator.swaptmesh(); + } +#else + surfaceEvaluator.swaptmesh(); +#endif +} + +/*------------------------------------------------------------------------- + * endtmesh - postamble to triangle mesh + *------------------------------------------------------------------------- + */ +void +Backend::endtmesh( void ) +{ +#ifndef NOWIREFRAME + if( ! wireframetris ) + surfaceEvaluator.endtmesh(); +#else + surfaceEvaluator.endtmesh(); +/* surfaceEvaluator.polymode( N_MESHFILL );*/ +#endif +} + + +/*------------------------------------------------------------------------- + * bgnoutline - preamble to outlined rendering + *------------------------------------------------------------------------- + */ +void +Backend::bgnoutline( void ) +{ + surfaceEvaluator.bgnline(); +} + +/*------------------------------------------------------------------------- + * linevert - evaluate a point on an outlined contour + *------------------------------------------------------------------------- + */ +void +Backend::linevert( TrimVertex *t ) +{ + surfaceEvaluator.evalcoord2f( t->nuid, t->param[0], t->param[1] ); +} + +/*------------------------------------------------------------------------- + * linevert - evaluate a grid point of an outlined contour + *------------------------------------------------------------------------- + */ +void +Backend::linevert( GridVertex *g ) +{ + surfaceEvaluator.evalpoint2i( g->gparam[0], g->gparam[1] ); +} + +/*------------------------------------------------------------------------- + * endoutline - postamble to outlined rendering + *------------------------------------------------------------------------- + */ +void +Backend::endoutline( void ) +{ + surfaceEvaluator.endline(); +} + +/*------------------------------------------------------------------------- + * triangle - output a triangle + *------------------------------------------------------------------------- + */ +void +Backend::triangle( TrimVertex *a, TrimVertex *b, TrimVertex *c ) +{ +/* bgntmesh( "spittriangle" );*/ + bgntfan(); + tmeshvert( a ); + tmeshvert( b ); + tmeshvert( c ); + endtfan(); +/* endtmesh();*/ +} + +void +Backend::bgncurv( void ) +{ + curveEvaluator.bgnmap1f( 0 ); +} + +void +Backend::segment( REAL ulo, REAL uhi ) +{ + curveEvaluator.domain1f( ulo, uhi ); +} + +void +Backend::curvpts( + long type, /* geometry, color, texture, normal */ + REAL *pts, /* control points */ + long stride, /* distance to next point */ + int order, /* parametric order */ + REAL ulo, /* lower parametric bound */ + REAL uhi ) /* upper parametric bound */ + +{ + curveEvaluator.map1f( type, ulo, uhi, stride, order, pts ); + curveEvaluator.enable( type ); +} + +void +Backend::curvgrid( REAL u0, REAL u1, long nu ) +{ + curveEvaluator.mapgrid1f( nu, u0, u1 ); +} + +void +Backend::curvmesh( long from, long n ) +{ + curveEvaluator.mapmesh1f( N_MESHFILL, from, from+n ); +} + +void +Backend::curvpt(REAL u) +{ + curveEvaluator.evalcoord1f( 0, u ); +} + +void +Backend::bgnline( void ) +{ + curveEvaluator.bgnline(); +} + +void +Backend::endline( void ) +{ + curveEvaluator.endline(); +} + +void +Backend::endcurv( void ) +{ + curveEvaluator.endmap1f(); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/backend.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,113 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * backend.h + * + */ + +#ifndef __glubackend_h_ +#define __glubackend_h_ + +#include "trimvertex.h" +#include "gridvertex.h" +#include "gridtrimvertex.h" + +class BasicCurveEvaluator; +class BasicSurfaceEvaluator; + +class Backend { +private: + BasicCurveEvaluator& curveEvaluator; + BasicSurfaceEvaluator& surfaceEvaluator; +public: + Backend( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e ) + : curveEvaluator(c), surfaceEvaluator(e) {} + + /* surface backend routines */ + void bgnsurf( int, int, long ); + void patch( REAL, REAL, REAL, REAL ); + void surfpts( long, REAL *, long, long, int, int, + REAL, REAL, REAL, REAL ); + void surfbbox( long, REAL *, REAL * ); + void surfgrid( REAL, REAL, long, REAL, REAL, long ); + void surfmesh( long, long, long, long ); + void bgntmesh( const char * ); + void endtmesh( void ); + void swaptmesh( void ); + void tmeshvert( GridTrimVertex * ); + void tmeshvert( TrimVertex * ); + void tmeshvert( GridVertex * ); + void tmeshvert( REAL u, REAL v ); + void linevert( TrimVertex * ); + void linevert( GridVertex * ); + void bgnoutline( void ); + void endoutline( void ); + void endsurf( void ); + void triangle( TrimVertex*, TrimVertex*, TrimVertex* ); + + void bgntfan(); + void endtfan(); + void bgnqstrip(); + void endqstrip(); + void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, + int n_lower, REAL v_lower, REAL* lower_val + ); + void evalVStrip(int n_left, REAL u_left, REAL* left_val, + int n_right, REAL v_right, REAL* right_val + ); + void tmeshvertNOGE(TrimVertex *t); + void tmeshvertNOGE_BU(TrimVertex *t); + void tmeshvertNOGE_BV(TrimVertex *t); + void preEvaluateBU(REAL u); + void preEvaluateBV(REAL v); + + + /* curve backend routines */ + void bgncurv( void ); + void segment( REAL, REAL ); + void curvpts( long, REAL *, long, int, REAL, REAL ); + void curvgrid( REAL, REAL, long ); + void curvmesh( long, long ); + void curvpt( REAL ); + void bgnline( void ); + void endline( void ); + void endcurv( void ); +private: +#ifndef NOWIREFRAME + int wireframetris; + int wireframequads; + int npts; + REAL mesh[3][4]; + int meshindex; +#endif +}; + +#endif /* __glubackend_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,138 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * basiccrveval.c++ + * + */ + +#include "mystdio.h" +#include "types.h" +#include "basiccrveval.h" + +void +BasicCurveEvaluator::domain1f( REAL, REAL ) +{ +#ifndef NDEBUG + _glu_dprintf( "domain1f\n" ); +#endif +} + +void +BasicCurveEvaluator::range1f( long , REAL *, REAL * ) +{ +#ifndef NDEBUG + _glu_dprintf( "range1f\n" ); +#endif +} + +void +BasicCurveEvaluator::enable( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "enable\n" ); +#endif +} + +void +BasicCurveEvaluator::disable( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "disable\n" ); +#endif +} + +void +BasicCurveEvaluator::bgnmap1f( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnmap1f\n" ); +#endif +} + +void +BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * ) +{ +#ifndef NDEBUG + _glu_dprintf( "map1f\n" ); +#endif +} + +void +BasicCurveEvaluator::mapgrid1f( long, REAL, REAL ) +{ +#ifndef NDEBUG + _glu_dprintf( "mapgrid1f\n" ); +#endif +} + +void +BasicCurveEvaluator::mapmesh1f( long, long, long ) +{ +#ifndef NDEBUG + _glu_dprintf( "mapmesh1f\n" ); +#endif +} + +void +BasicCurveEvaluator::evalcoord1f( long, REAL ) +{ +#ifndef NDEBUG + _glu_dprintf( "evalcoord1f\n" ); +#endif +} + +void +BasicCurveEvaluator::endmap1f( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endmap1f\n" ); +#endif +} + +void +BasicCurveEvaluator::bgnline( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnline\n" ); +#endif +} + +void +BasicCurveEvaluator::endline( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endline\n" ); +#endif +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,62 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * basiccurveeval.h + * + */ + +#ifndef __glubasiccrveval_h_ +#define __glubasiccrveval_h_ + +#include "types.h" +#include "displaymode.h" +#include "cachingeval.h" + +class BasicCurveEvaluator : public CachingEvaluator { +public: + virtual ~BasicCurveEvaluator() { /* silence warning*/ } + virtual void domain1f( REAL, REAL ); + virtual void range1f( long, REAL *, REAL * ); + + virtual void enable( long ); + virtual void disable( long ); + virtual void bgnmap1f( long ); + virtual void map1f( long, REAL, REAL, long, long, REAL * ); + virtual void mapgrid1f( long, REAL, REAL ); + virtual void mapmesh1f( long, long, long ); + virtual void evalcoord1f( long, REAL ); + virtual void endmap1f( void ); + + virtual void bgnline( void ); + virtual void endline( void ); +}; + +#endif /* __glubasiccrveval_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,232 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * basicsurfaceevaluator.c++ + * + */ + +#include "mystdio.h" +#include "types.h" +#include "basicsurfeval.h" + +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif + +void +BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL ) +{ +#ifndef NDEBUG + _glu_dprintf( "domain2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::polymode( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "polymode\n" ); +#endif +} + +void +BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to ) +{ +#ifndef NDEBUG + _glu_dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n", + type, from[0], from[1], to[0], to[1] ); +#endif +} + +void +BasicSurfaceEvaluator::enable( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "enable\n" ); +#endif +} + +void +BasicSurfaceEvaluator::disable( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "disable\n" ); +#endif +} + +void +BasicSurfaceEvaluator::bgnmap2f( long ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnmap2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::endmap2f( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endmap2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long, + REAL, REAL, long, long, + REAL * ) +{ +#ifndef NDEBUG + _glu_dprintf( "map2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL ) +{ +#ifndef NDEBUG + _glu_dprintf( "mapgrid2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long ) +{ +#ifndef NDEBUG + _glu_dprintf( "mapmesh2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL ) +{ +#ifndef NDEBUG + _glu_dprintf( "evalcoord2f\n" ); +#endif +} + +void +BasicSurfaceEvaluator::evalpoint2i( long, long ) +{ +#ifndef NDEBUG + _glu_dprintf( "evalpoint2i\n" ); +#endif +} + +void +BasicSurfaceEvaluator::bgnline( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnline\n" ); +#endif +} + +void +BasicSurfaceEvaluator::endline( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endline\n" ); +#endif +} + +void +BasicSurfaceEvaluator::bgnclosedline( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnclosedline\n" ); +#endif +} + +void +BasicSurfaceEvaluator::endclosedline( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endclosedline\n" ); +#endif +} + +void +BasicSurfaceEvaluator::bgntfan( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgntfan\n" ); +#endif +} + +void +BasicSurfaceEvaluator::endtfan( void ) +{ +} + + +void +BasicSurfaceEvaluator::bgntmesh( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgntmesh\n" ); +#endif +} + +void +BasicSurfaceEvaluator::swaptmesh( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "swaptmesh\n" ); +#endif +} + +void +BasicSurfaceEvaluator::endtmesh( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endtmesh\n" ); +#endif +} + +void +BasicSurfaceEvaluator::bgnqstrip( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnqstrip\n" ); +#endif +} + +void +BasicSurfaceEvaluator::endqstrip( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endqstrip\n" ); +#endif +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,90 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * basicsurfeval.h + * + */ + +#ifndef __glubasicsurfeval_h_ +#define __glubasicsurfeval_h_ + +#include "types.h" +#include "displaymode.h" +#include "cachingeval.h" + +class BasicSurfaceEvaluator : public CachingEvaluator { +public: + virtual ~BasicSurfaceEvaluator() { /* silence warning*/ } + virtual void range2f( long, REAL *, REAL * ); + virtual void domain2f( REAL, REAL, REAL, REAL ); + + virtual void enable( long ); + virtual void disable( long ); + virtual void bgnmap2f( long ); + virtual void map2f( long, REAL, REAL, long, long, + REAL, REAL, long, long, + REAL * ); + virtual void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); + virtual void mapmesh2f( long, long, long, long, long ); + virtual void evalcoord2f( long, REAL, REAL ); + virtual void evalpoint2i( long, long ); + virtual void endmap2f( void ); + + virtual void polymode( long ); + virtual void bgnline( void ); + virtual void endline( void ); + virtual void bgnclosedline( void ); + virtual void endclosedline( void ); + virtual void bgntmesh( void ); + virtual void swaptmesh( void ); + virtual void endtmesh( void ); + virtual void bgnqstrip( void ); + virtual void endqstrip( void ); + + virtual void bgntfan( void ); + virtual void endtfan( void ); + + virtual void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, + int n_lower, REAL v_lower, REAL* lower_val + ) = 0; + + virtual void evalVStrip(int n_left, REAL u_left, REAL* left_val, + int n_right, REAL u_right, REAL* right_val + ) = 0; + virtual void inDoEvalCoord2NOGE(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; + virtual void inDoEvalCoord2NOGE_BU(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; + virtual void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; + virtual void inPreEvaluateBV_intfac(REAL v ) = 0; + virtual void inPreEvaluateBU_intfac(REAL u ) = 0; + +}; + +#endif /* __glubasicsurfeval_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bezierarc.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bezierarc.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bezierarc.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bezierarc.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,51 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * bezierarc.h + * + */ + +#ifndef __glubezierarc_h +#define __glubezierarc_h + +#include "myassert.h" + +class Mapdesc; + +struct BezierArc : public PooledObj { /* a bezier arc */ + REAL * cpts; /* control points of arc */ + int order; /* order of arc */ + int stride; /* REAL distance between points */ + long type; /* curve type */ + Mapdesc * mapdesc; +}; + +#endif /* __glubezierarc_h */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,166 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * bin.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "bin.h" + +/*---------------------------------------------------------------------------- + * Constructor and destructor + *---------------------------------------------------------------------------- + */ +Bin::Bin() +{ + head = NULL; +} + +Bin::~Bin() +{ + assert( head == NULL); +} + +/*---------------------------------------------------------------------------- + * remove_this_arc - remove given Arc_ptr from bin + *---------------------------------------------------------------------------- + */ + +void +Bin::remove_this_arc( Arc_ptr arc ) +{ + Arc_ptr *j; + for( j = &(head); (*j != 0) && (*j != arc); j = &((*j)->link) ); + + if( *j != 0 ) { + if( *j == current ) + current = (*j)->link; + *j = (*j)->link; + } +} + +/*---------------------------------------------------------------------------- + * numarcs - count number of arcs in bin + *---------------------------------------------------------------------------- + */ + +int +Bin::numarcs() +{ + long count = 0; + for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() ) + count++; + return count; +} + +/*---------------------------------------------------------------------------- + * adopt - place an orphaned arcs into their new parents bin + *---------------------------------------------------------------------------- + */ + +void +Bin::adopt() +{ + markall(); + + Arc_ptr orphan; + while( (orphan = removearc()) != NULL ) { + for( Arc_ptr parent = orphan->next; parent != orphan; parent = parent->next ) { + if (! parent->ismarked() ) { + orphan->link = parent->link; + parent->link = orphan; + orphan->clearmark(); + break; + } + } + } +} + + +/*---------------------------------------------------------------------------- + * show - print out descriptions of the arcs in the bin + *---------------------------------------------------------------------------- + */ + +void +Bin::show( char *name ) +{ +#ifndef NDEBUG + _glu_dprintf( "%s\n", name ); + for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() ) + jarc->show( ); +#endif +} + + + +/*---------------------------------------------------------------------------- + * markall - mark all arcs with an identifying tag + *---------------------------------------------------------------------------- + */ + +void +Bin::markall() +{ + for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) + jarc->setmark(); +} + +/*---------------------------------------------------------------------------- + * listBezier - print out all arcs that are untessellated border arcs + *---------------------------------------------------------------------------- + */ + +void +Bin::listBezier( void ) +{ + for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) { + if( jarc->isbezier( ) ) { + assert( jarc->pwlArc->npts == 2 ); +#ifndef NDEBUG + TrimVertex *pts = jarc->pwlArc->pts; + REAL s1 = pts[0].param[0]; + REAL t1 = pts[0].param[1]; + REAL s2 = pts[1].param[0]; + REAL t2 = pts[1].param[1]; + _glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 ); +#endif + } + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bin.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,121 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * bin.h + * + */ + +#ifndef __glubin_h_ +#define __glubin_h_ + +#include "myassert.h" +#include "arc.h" +#include "defines.h" + +class Bin +{ /* a linked list of jordan arcs */ +private: + Arc_ptr head;/*first arc on list */ + Arc_ptr current; /* current arc on list */ +public: + Bin(); + ~Bin(); + inline Arc_ptr firstarc( void ); + inline Arc_ptr nextarc( void ); + inline Arc_ptr removearc( void ); + inline int isnonempty( void ) { return (head ? 1 : 0); } + inline void addarc( Arc_ptr ); + void remove_this_arc( Arc_ptr ); + int numarcs( void ); + void adopt( void ); + void markall( void ); + void show( char * ); + void listBezier( void ); +}; + +/*---------------------------------------------------------------------------- + * Bin::addarc - add an Arc_ptr to head of linked list of Arc_ptr + *---------------------------------------------------------------------------- + */ + +inline void +Bin::addarc( Arc_ptr jarc ) +{ + jarc->link = head; + head = jarc; +} + +/*---------------------------------------------------------------------------- + * Bin::removearc - remove first Arc_ptr from bin + *---------------------------------------------------------------------------- + */ + +inline Arc_ptr +Bin::removearc( void ) +{ + Arc_ptr jarc = head; + + if( jarc ) head = jarc->link; + return jarc; +} + + +/*---------------------------------------------------------------------------- + * BinIter::nextarc - return current arc in bin and advance pointer to next arc + *---------------------------------------------------------------------------- + */ + +inline Arc_ptr +Bin::nextarc( void ) +{ + Arc_ptr jarc = current; + +#ifdef DEBUG + assert( jarc->check() != 0 ); +#endif + + if( jarc ) current = jarc->link; + return jarc; +} + +/*---------------------------------------------------------------------------- + * BinIter::firstarc - set current arc to first arc of bin advance to next arc + *---------------------------------------------------------------------------- + */ + +inline Arc_ptr +Bin::firstarc( void ) +{ + current = head; + return nextarc( ); +} + +#endif /* __glubin_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,110 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * bufpool.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "bufpool.h" + + +/*----------------------------------------------------------------------------- + * Pool - allocate a new pool of buffers + *----------------------------------------------------------------------------- + */ +Pool::Pool( int _buffersize, int initpoolsize, const char *n ) +{ + if((unsigned)_buffersize < sizeof(Buffer)) + buffersize = sizeof(Buffer); + else + buffersize = _buffersize; + initsize = initpoolsize * buffersize; + nextsize = initsize; + name = n; + magic = is_allocated; + nextblock = 0; + curblock = 0; + freelist = 0; + nextfree = 0; +} + +/*----------------------------------------------------------------------------- + * ~Pool - free a pool of buffers and the pool itself + *----------------------------------------------------------------------------- + */ + +Pool::~Pool( void ) +{ + assert( (this != 0) && (magic == is_allocated) ); + + while( nextblock ) { + delete [] blocklist[--nextblock]; + blocklist[nextblock] = 0; + } + magic = is_free; +} + + +void Pool::grow( void ) +{ + assert( (this != 0) && (magic == is_allocated) ); + curblock = new char[nextsize]; + blocklist[nextblock++] = curblock; + nextfree = nextsize; + nextsize *= 2; +} + +/*----------------------------------------------------------------------------- + * Pool::clear - free buffers associated with pool but keep pool + *----------------------------------------------------------------------------- + */ + +void +Pool::clear( void ) +{ + assert( (this != 0) && (magic == is_allocated) ); + + while( nextblock ) { + delete [] blocklist[--nextblock]; + blocklist[nextblock] = 0; + } + curblock = 0; + freelist = 0; + nextfree = 0; + if( nextsize > initsize ) + nextsize /= 2; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/bufpool.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,141 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * bufpool.h + * + */ + +#ifndef __glubufpool_h_ +#define __glubufpool_h_ + +#include "gluos.h" +#include "myassert.h" +#include "mystdlib.h" + +#define NBLOCKS 32 + +class Buffer { + friend class Pool; + Buffer * next; /* next buffer on free list */ +}; + +class Pool { +public: + Pool( int, int, const char * ); + ~Pool( void ); + inline void* new_buffer( void ); + inline void free_buffer( void * ); + void clear( void ); + +private: + void grow( void ); + +protected: + Buffer *freelist; /* linked list of free buffers */ + char *blocklist[NBLOCKS]; /* blocks of malloced memory */ + int nextblock; /* next free block index */ + char *curblock; /* last malloced block */ + int buffersize; /* bytes per buffer */ + int nextsize; /* size of next block of memory */ + int nextfree; /* byte offset past next free buffer */ + int initsize; + enum Magic { is_allocated = 0xf3a1, is_free = 0xf1a2 }; + const char *name; /* name of the pool */ + Magic magic; /* marker for valid pool */ +}; + +/*----------------------------------------------------------------------------- + * Pool::free_buffer - return a buffer to a pool + *----------------------------------------------------------------------------- + */ + +inline void +Pool::free_buffer( void *b ) +{ + assert( (this != 0) && (magic == is_allocated) ); + + /* add buffer to singly connected free list */ + + ((Buffer *) b)->next = freelist; + freelist = (Buffer *) b; +} + + +/*----------------------------------------------------------------------------- + * Pool::new_buffer - allocate a buffer from a pool + *----------------------------------------------------------------------------- + */ + +inline void * +Pool::new_buffer( void ) +{ + void *buffer; + + assert( (this != 0) && (magic == is_allocated) ); + + /* find free buffer */ + + if( freelist ) { + buffer = (void *) freelist; + freelist = freelist->next; + } else { + if( ! nextfree ) + grow( ); + nextfree -= buffersize;; + buffer = (void *) (curblock + nextfree); + } + return buffer; +} + +class PooledObj { +public: + inline void * operator new( size_t, Pool & ); + inline void * operator new( size_t, void *); + inline void * operator new( size_t s) + { return ::new char[s]; } + inline void operator delete( void * ) { assert( 0 ); } + inline void operator delete( void *, Pool & ) { assert( 0 ); } + inline void deleteMe( Pool & ); +}; + +inline void * +PooledObj::operator new( size_t, Pool& pool ) +{ + return pool.new_buffer(); +} + +inline void +PooledObj::deleteMe( Pool& pool ) +{ + pool.free_buffer( (void *) this ); +} + +#endif /* __glubufpool_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,78 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * cachingeval.c++ + * + */ + +#include "cachingeval.h" + +int +CachingEvaluator::canRecord( void ) +{ + return 0; +} + +int +CachingEvaluator::canPlayAndRecord( void ) +{ + return 0; +} + +int +CachingEvaluator::createHandle( int ) +{ + return 0; +} + +void +CachingEvaluator::beginOutput( ServiceMode, int ) +{ +} + +void +CachingEvaluator::endOutput( void ) +{ +} + +void +CachingEvaluator::discardRecording( int ) +{ +} + +void +CachingEvaluator::playRecording( int ) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/cachingeval.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,51 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * cachingeval.h + * + */ + +#ifndef __glucachingval_h_ +#define __glucachingval_h_ + +class CachingEvaluator { +public: + virtual ~CachingEvaluator() { /* silence warning*/ } + enum ServiceMode { play, record, playAndRecord }; + virtual int canRecord( void ); + virtual int canPlayAndRecord( void ); + virtual int createHandle( int handle ); + virtual void beginOutput( ServiceMode, int handle ); + virtual void endOutput( void ); + virtual void discardRecording( int handle ); + virtual void playRecording( int handle ); +}; +#endif /* __glucachingval_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/ccw.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/ccw.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/ccw.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/ccw.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,565 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * ccw.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "subdivider.h" +#include "types.h" +#include "arc.h" +#include "trimvertex.h" +#include "simplemath.h" + +inline int +Subdivider::bbox( TrimVertex *a, TrimVertex *b, TrimVertex *c, int p ) +{ + return bbox( a->param[p], b->param[p], c->param[p], + a->param[1-p], b->param[1-p], c->param[1-p] ); +} + +int +Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1 +{ + register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; + register TrimVertex *v1last = &j1->pwlArc->pts[0]; + register TrimVertex *v2 = &j2->pwlArc->pts[0]; + register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; + register TrimVertex *v1next = v1-1; + register TrimVertex *v2next = v2+1; + int sgn; + + assert( v1 != v1last ); + assert( v2 != v2last ); + +#ifndef NDEBUG + _glu_dprintf( "arc_ccw_turn, p = %d\n", 0 ); +#endif + + // the arcs lie on the line (0 == v1->param[0]) + if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] ) + return 0; + + if( v2next->param[0] < v2->param[0] || v1next->param[0] < v1->param[0] ) + ::mylongjmp( jumpbuffer, 28 ); + + if( v1->param[1] < v2->param[1] ) + return 0; + else if( v1->param[1] > v2->param[1] ) + return 1; + + while( 1 ) { + if( v1next->param[0] < v2next->param[0] ) { +#ifndef NDEBUG + _glu_dprintf( "case a\n" ); +#endif + assert( v1->param[0] <= v1next->param[0] ); + assert( v2->param[0] <= v1next->param[0] ); + switch( bbox( v2, v2next, v1next, 1 ) ) { + case -1: + return 0; + case 0: + sgn = ccw( v1next, v2, v2next ); + if( sgn != -1 ) { + return sgn; + } else { +#ifdef DEBUG + _glu_dprintf( "decr\n" ); +#endif + v1 = v1next--; + if( v1 == v1last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 1; + } + } else if( v1next->param[0] > v2next->param[0] ) { +#ifndef NDEBUG + _glu_dprintf( "case b\n" ); +#endif + assert( v1->param[0] <= v2next->param[0] ); + assert( v2->param[0] <= v2next->param[0] ); + switch( bbox( v1, v1next, v2next, 1 ) ) { + case -1: + return 1; + case 0: + sgn = ccw( v1next, v1, v2next ); + if( sgn != -1 ) { + return sgn; + } else { +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + v2 = v2next++; + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 0; + } + } else { +#ifndef NDEBUG + _glu_dprintf( "case ab\n" ); +#endif + if( v1next->param[1] < v2next->param[1] ) + return 0; + else if( v1next->param[1] > v2next->param[1] ) + return 1; + else { +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + v2 = v2next++; + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + } + } +} + +int +Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0 +{ + register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; + register TrimVertex *v1last = &j1->pwlArc->pts[0]; + register TrimVertex *v2 = &j2->pwlArc->pts[0]; + register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; + register TrimVertex *v1next = v1-1; + register TrimVertex *v2next = v2+1; + int sgn; + + assert( v1 != v1last ); + assert( v2 != v2last ); + +#ifndef NDEBUG + _glu_dprintf( "arc_ccw_turn, p = %d\n", 0 ); +#endif + + // the arcs lie on the line (0 == v1->param[0]) + if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] ) + return 0; + + if( v2next->param[0] > v2->param[0] || v1next->param[0] > v1->param[0] ) + ::mylongjmp( jumpbuffer, 28 ); + + if( v1->param[1] < v2->param[1] ) + return 1; + else if( v1->param[1] > v2->param[1] ) + return 0; + + while( 1 ) { + if( v1next->param[0] > v2next->param[0] ) { +#ifndef NDEBUG + _glu_dprintf( "case c\n" ); +#endif + assert( v1->param[0] >= v1next->param[0] ); + assert( v2->param[0] >= v1next->param[0] ); + switch( bbox( v2next, v2, v1next, 1 ) ) { + case -1: + return 1; + case 0: + sgn = ccw( v1next, v2, v2next ); + if( sgn != -1 ) + return sgn; + else { + v1 = v1next--; +#ifdef DEBUG + _glu_dprintf( "decr\n" ); +#endif + if( v1 == v1last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 0; + } + } else if( v1next->param[0] < v2next->param[0] ) { +#ifndef NDEBUG + _glu_dprintf( "case d\n" ); +#endif + assert( v1->param[0] >= v2next->param[0] ); + assert( v2->param[0] >= v2next->param[0] ); + switch( bbox( v1next, v1, v2next, 1 ) ) { + case -1: + return 0; + case 0: + sgn = ccw( v1next, v1, v2next ); + if( sgn != -1 ) + return sgn; + else { + v2 = v2next++; +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 1; + } + } else { +#ifdef DEBUG + _glu_dprintf( "case cd\n" ); +#endif + if( v1next->param[1] < v2next->param[1] ) + return 1; + else if( v1next->param[1] > v2next->param[1] ) + return 0; + else { + v2 = v2next++; +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + } + } +} + +int +Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1 +{ + register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; + register TrimVertex *v1last = &j1->pwlArc->pts[0]; + register TrimVertex *v2 = &j2->pwlArc->pts[0]; + register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; + register TrimVertex *v1next = v1-1; + register TrimVertex *v2next = v2+1; + int sgn; + + assert( v1 != v1last ); + assert( v2 != v2last ); + +#ifndef NDEBUG + _glu_dprintf( "arc_ccw_turn, p = %d\n", 1 ); +#endif + + // the arcs lie on the line (1 == v1->param[1]) + if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] ) + return 0; + + if( v2next->param[1] < v2->param[1] || v1next->param[1] < v1->param[1] ) + ::mylongjmp( jumpbuffer, 28 ); + + if( v1->param[0] < v2->param[0] ) + return 1; + else if( v1->param[0] > v2->param[0] ) + return 0; + + while( 1 ) { + if( v1next->param[1] < v2next->param[1] ) { +#ifndef NDEBUG + _glu_dprintf( "case a\n" ); +#endif + assert( v1->param[1] <= v1next->param[1] ); + assert( v2->param[1] <= v1next->param[1] ); + switch( bbox( v2, v2next, v1next, 0 ) ) { + case -1: + return 1; + case 0: + sgn = ccw( v1next, v2, v2next ); + if( sgn != -1 ) { + return sgn; + } else { +#ifdef DEBUG + _glu_dprintf( "decr\n" ); +#endif + v1 = v1next--; + if( v1 == v1last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 0; + } + } else if( v1next->param[1] > v2next->param[1] ) { +#ifndef NDEBUG + _glu_dprintf( "case b\n" ); +#endif + assert( v1->param[1] <= v2next->param[1] ); + assert( v2->param[1] <= v2next->param[1] ); + switch( bbox( v1, v1next, v2next, 0 ) ) { + case -1: + return 0; + case 0: + sgn = ccw( v1next, v1, v2next ); + if( sgn != -1 ) { + return sgn; + } else { +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + v2 = v2next++; + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 1; + } + } else { +#ifdef DEBUG + _glu_dprintf( "case ab\n" ); +#endif + if( v1next->param[0] < v2next->param[0] ) + return 1; + else if( v1next->param[0] > v2next->param[0] ) + return 0; + else { +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + v2 = v2next++; + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + } + } +} + +int +Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 ) +{ + register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; + register TrimVertex *v1last = &j1->pwlArc->pts[0]; + register TrimVertex *v2 = &j2->pwlArc->pts[0]; + register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; + register TrimVertex *v1next = v1-1; + register TrimVertex *v2next = v2+1; + int sgn; + + assert( v1 != v1last ); + assert( v2 != v2last ); + +#ifndef NDEBUG + _glu_dprintf( "arc_ccw_turn, p = %d\n", 1 ); +#endif + + // the arcs lie on the line (1 == v1->param[1]) + if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] ) + return 0; + + if( v2next->param[1] > v2->param[1] || v1next->param[1] > v1->param[1] ) + ::mylongjmp( jumpbuffer, 28 ); + + if( v1->param[0] < v2->param[0] ) + return 0; + else if( v1->param[0] > v2->param[0] ) + return 1; + + while( 1 ) { + if( v1next->param[1] > v2next->param[1] ) { +#ifndef NDEBUG + _glu_dprintf( "case c\n" ); +#endif + assert( v1->param[1] >= v1next->param[1] ); + assert( v2->param[1] >= v1next->param[1] ); + switch( bbox( v2next, v2, v1next, 0 ) ) { + case -1: + return 0; + case 0: + sgn = ccw( v1next, v2, v2next ); + if( sgn != -1 ) + return sgn; + else { + v1 = v1next--; +#ifdef DEBUG + _glu_dprintf( "decr\n" ); +#endif + if( v1 == v1last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 1; + } + } else if( v1next->param[1] < v2next->param[1] ) { +#ifndef NDEBUG + _glu_dprintf( "case d\n" ); + assert( v1->param[1] >= v2next->param[1] ); + assert( v2->param[1] >= v2next->param[1] ); +#endif + switch( bbox( v1next, v1, v2next, 0 ) ) { + case -1: + return 1; + case 0: + sgn = ccw( v1next, v1, v2next ); + if( sgn != -1 ) + return sgn; + else { + v2 = v2next++; +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + break; + case 1: + return 0; + } + } else { +#ifdef DEBUG + _glu_dprintf( "case cd\n" ); +#endif + if( v1next->param[0] < v2next->param[0] ) + return 0; + else if( v1next->param[0] > v2next->param[0] ) + return 1; + else { + v2 = v2next++; +#ifdef DEBUG + _glu_dprintf( "incr\n" ); +#endif + if( v2 == v2last ) { +#ifdef DEBUG + _glu_dprintf( "no good results\n" ); +#endif + return 0; // ill-conditioned, guess answer + } + } + } + } +} + + +#ifndef NDEBUG +int +Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc, + register REAL ta, register REAL tb, register REAL tc ) +#else +int +Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc, + register REAL , register REAL , register REAL ) +#endif +{ +#ifndef NDEBUG + assert( tc >= ta ); + assert( tc <= tb ); +#endif + + if( sa < sb ) { + if( sc <= sa ) { + return -1; + } else if( sb <= sc ) { + return 1; + } else { + return 0; + } + } else if( sa > sb ) { + if( sc >= sa ) { + return 1; + } else if( sb >= sc ) { + return -1; + } else { + return 0; + } + } else { + if( sc > sa ) { + return 1; + } else if( sb > sc ) { + return -1; + } else { + return 0; + } + } +} + +/*---------------------------------------------------------------------------- + * ccw - determine how three points are oriented by computing their + * determinant. + * Return 1 if the vertices are ccw oriented, + * 0 if they are cw oriented, or + * -1 if the computation is ill-conditioned. + *---------------------------------------------------------------------------- + */ +int +Subdivider::ccw( TrimVertex *a, TrimVertex *b, TrimVertex *c ) +{ + REAL d = det3( a, b, c ); + if( glu_abs(d) < 0.0001 ) return -1; + return (d < 0.0) ? 0 : 1; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,440 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * coveandtiler.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "coveandtiler.h" +#include "gridvertex.h" +#include "gridtrimvertex.h" +#include "uarray.h" +#include "backend.h" + + +const int CoveAndTiler::MAXSTRIPSIZE = 1000; + +CoveAndTiler::CoveAndTiler( Backend& b ) + : backend( b ) +{ } + +CoveAndTiler::~CoveAndTiler( void ) +{ } + +inline void +CoveAndTiler::output( GridVertex &gv ) +{ + backend.tmeshvert( &gv ); +} + +inline void +CoveAndTiler::output( TrimVertex *tv ) +{ + backend.tmeshvert( tv ); +} + +inline void +CoveAndTiler::output( GridTrimVertex& g ) +{ + backend.tmeshvert( &g ); +} + +void +CoveAndTiler::coveAndTile( void ) +{ + long ustart = (top.ustart >= bot.ustart) ? top.ustart : bot.ustart; + long uend = (top.uend <= bot.uend) ? top.uend : bot.uend; + if( ustart <= uend ) { + tile( bot.vindex, ustart, uend ); + if( top.ustart >= bot.ustart ) + coveUpperLeft(); + else + coveLowerLeft(); + + if( top.uend <= bot.uend ) + coveUpperRight(); + else + coveLowerRight(); + } else { + TrimVertex blv, tlv, *bl, *tl; + GridTrimVertex bllv, tllv; + TrimVertex *lf = left.first(); + TrimVertex *ll = left.last(); + if( lf->param[0] >= ll->param[0] ) { + blv.param[0] = lf->param[0]; + blv.param[1] = ll->param[1]; + blv.nuid = 0; // XXX + assert( blv.param[1] == bot.vval ); + bl = &blv; + tl = lf; + tllv.set( lf ); + if( ll->param[0] > uarray.uarray[top.ustart-1] ) { + bllv.set( ll ); + assert( ll->param[0] <= uarray.uarray[bot.ustart] ); + } else { + bllv.set( top.ustart-1, bot.vindex ); + } + coveUpperLeftNoGrid( bl ); + } else { + tlv.param[0] = ll->param[0]; + tlv.param[1] = lf->param[1]; + tlv.nuid = 0; // XXX + assert( tlv.param[1] == top.vval ); + tl = &tlv; + bl = ll; + bllv.set( ll ); + if( lf->param[0] > uarray.uarray[bot.ustart-1] ) { + assert( lf->param[0] <= uarray.uarray[bot.ustart] ); + tllv.set( lf ); + } else { + tllv.set( bot.ustart-1, top.vindex ); + } + coveLowerLeftNoGrid( tl ); + } + + TrimVertex brv, trv, *br, *tr; + GridTrimVertex brrv, trrv; + TrimVertex *rf = right.first(); + TrimVertex *rl = right.last(); + + if( rf->param[0] <= rl->param[0] ) { + brv.param[0] = rf->param[0]; + brv.param[1] = rl->param[1]; + brv.nuid = 0; // XXX + assert( brv.param[1] == bot.vval ); + br = &brv; + tr = rf; + trrv.set( rf ); + if( rl->param[0] < uarray.uarray[top.uend+1] ) { + assert( rl->param[0] >= uarray.uarray[top.uend] ); + brrv.set( rl ); + } else { + brrv.set( top.uend+1, bot.vindex ); + } + coveUpperRightNoGrid( br ); + } else { + trv.param[0] = rl->param[0]; + trv.param[1] = rf->param[1]; + trv.nuid = 0; // XXX + assert( trv.param[1] == top.vval ); + tr = &trv; + br = rl; + brrv.set( rl ); + if( rf->param[0] < uarray.uarray[bot.uend+1] ) { + assert( rf->param[0] >= uarray.uarray[bot.uend] ); + trrv.set( rf ); + } else { + trrv.set( bot.uend+1, top.vindex ); + } + coveLowerRightNoGrid( tr ); + } + + backend.bgntmesh( "doit" ); + output(trrv); + output(tllv); + output( tr ); + output( tl ); + output( br ); + output( bl ); + output(brrv); + output(bllv); + backend.endtmesh(); + } +} + +void +CoveAndTiler::tile( long vindex, long ustart, long uend ) +{ + long numsteps = uend - ustart; + + if( numsteps == 0 ) return; + + if( numsteps > MAXSTRIPSIZE ) { + long umid = ustart + (uend - ustart) / 2; + tile( vindex, ustart, umid ); + tile( vindex, umid, uend ); + } else { + backend.surfmesh( ustart, vindex-1, numsteps, 1 ); + } +} + +void +CoveAndTiler::coveUpperRight( void ) +{ + GridVertex tgv( top.uend, top.vindex ); + GridVertex gv( top.uend, bot.vindex ); + + right.first(); + backend.bgntmesh( "coveUpperRight" ); + output( right.next() ); + output( tgv ); + backend.swaptmesh(); + output( gv ); + coveUR(); + backend.endtmesh(); +} + +void +CoveAndTiler::coveUpperRightNoGrid( TrimVertex* br ) +{ + backend.bgntmesh( "coveUpperRight" ); + output( right.first() ); + output( right.next() ); + backend.swaptmesh(); + output( br ); + coveUR(); + backend.endtmesh(); +} + +void +CoveAndTiler::coveUR( ) +{ + GridVertex gv( top.uend, bot.vindex ); + TrimVertex *vert = right.next(); + if( vert == NULL ) return; + + assert( vert->param[0] >= uarray.uarray[gv.gparam[0]] ); + + if( gv.nextu() >= bot.uend ) { + for( ; vert; vert = right.next() ) { + output( vert ); + backend.swaptmesh(); + } + } else while( 1 ) { + if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { + output( vert ); + backend.swaptmesh(); + vert = right.next(); + if( vert == NULL ) break; + } else { + backend.swaptmesh(); + output( gv ); + if( gv.nextu() == bot.uend ) { + for( ; vert; vert = right.next() ) { + output( vert ); + backend.swaptmesh(); + } + break; + } + } + } +} + +void +CoveAndTiler::coveUpperLeft( void ) +{ + GridVertex tgv( top.ustart, top.vindex ); + GridVertex gv( top.ustart, bot.vindex ); + + left.first(); + backend.bgntmesh( "coveUpperLeft" ); + output( tgv ); + output( left.next() ); + output( gv ); + backend.swaptmesh(); + coveUL(); + backend.endtmesh(); +} + +void +CoveAndTiler::coveUpperLeftNoGrid( TrimVertex* bl ) +{ + backend.bgntmesh( "coveUpperLeftNoGrid" ); + output( left.first() ); + output( left.next() ); + output( bl ); + backend.swaptmesh(); + coveUL(); + backend.endtmesh(); +} + +void +CoveAndTiler::coveUL() +{ + GridVertex gv( top.ustart, bot.vindex ); + TrimVertex *vert = left.next(); + if( vert == NULL ) return; + assert( vert->param[0] <= uarray.uarray[gv.gparam[0]] ); + + if( gv.prevu() <= bot.ustart ) { + for( ; vert; vert = left.next() ) { + backend.swaptmesh(); + output( vert ); + } + } else while( 1 ) { + if( vert->param[0] > uarray.uarray[gv.gparam[0]] ) { + backend.swaptmesh(); + output( vert ); + vert = left.next(); + if( vert == NULL ) break; + } else { + output( gv ); + backend.swaptmesh(); + if( gv.prevu() == bot.ustart ) { + for( ; vert; vert = left.next() ) { + backend.swaptmesh(); + output( vert ); + } + break; + } + } + } +} + +void +CoveAndTiler::coveLowerLeft( void ) +{ + GridVertex bgv( bot.ustart, bot.vindex ); + GridVertex gv( bot.ustart, top.vindex ); + + left.last(); + backend.bgntmesh( "coveLowerLeft" ); + output( left.prev() ); + output( bgv ); + backend.swaptmesh(); + output( gv ); + coveLL(); + backend.endtmesh(); +} + +void +CoveAndTiler::coveLowerLeftNoGrid( TrimVertex* tl ) +{ + backend.bgntmesh( "coveLowerLeft" ); + output( left.last() ); + output( left.prev() ); + backend.swaptmesh(); + output( tl ); + coveLL( ); + backend.endtmesh(); +} + +void +CoveAndTiler::coveLL() +{ + GridVertex gv( bot.ustart, top.vindex ); + TrimVertex *vert = left.prev(); + if( vert == NULL ) return; + assert( vert->param[0] <= uarray.uarray[gv.gparam[0]] ); + + if( gv.prevu() <= top.ustart ) { + for( ; vert; vert = left.prev() ) { + output( vert ); + backend.swaptmesh(); + } + } else while( 1 ) { + if( vert->param[0] > uarray.uarray[gv.gparam[0]] ){ + output( vert ); + backend.swaptmesh(); + vert = left.prev(); + if( vert == NULL ) break; + } else { + backend.swaptmesh(); + output( gv ); + if( gv.prevu() == top.ustart ) { + for( ; vert; vert = left.prev() ) { + output( vert ); + backend.swaptmesh(); + } + break; + } + } + } +} + +void +CoveAndTiler::coveLowerRight( void ) +{ + GridVertex bgv( bot.uend, bot.vindex ); + GridVertex gv( bot.uend, top.vindex ); + + right.last(); + backend.bgntmesh( "coveLowerRight" ); + output( bgv ); + output( right.prev() ); + output( gv ); + backend.swaptmesh(); + coveLR(); + backend.endtmesh( ); +} + +void +CoveAndTiler::coveLowerRightNoGrid( TrimVertex* tr ) +{ + backend.bgntmesh( "coveLowerRIght" ); + output( right.last() ); + output( right.prev() ); + output( tr ); + backend.swaptmesh(); + coveLR(); + backend.endtmesh(); +} + +void +CoveAndTiler::coveLR( ) +{ + GridVertex gv( bot.uend, top.vindex ); + TrimVertex *vert = right.prev(); + if( vert == NULL ) return; + assert( vert->param[0] >= uarray.uarray[gv.gparam[0]] ); + + if( gv.nextu() >= top.uend ) { + for( ; vert; vert = right.prev() ) { + backend.swaptmesh(); + output( vert ); + } + } else while( 1 ) { + if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { + backend.swaptmesh(); + output( vert ); + vert = right.prev(); + if( vert == NULL ) break; + } else { + output( gv ); + backend.swaptmesh(); + if( gv.nextu() == top.uend ) { + for( ; vert; vert = right.prev() ) { + backend.swaptmesh(); + output( vert ); + } + break; + } + } + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/coveandtiler.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,72 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * coveandtiler.h + * + */ + +#ifndef __glucoveandtiler_h +#define __glucoveandtiler_h + +#include "trimregion.h" +#include "trimvertex.h" +#include "gridvertex.h" + +class Backend; +class GridTrimVertex; + +class CoveAndTiler : virtual public TrimRegion { +public: + CoveAndTiler( Backend& ); + ~CoveAndTiler( void ); + void coveAndTile( void ); +private: + Backend& backend; + static const int MAXSTRIPSIZE; + void tile( long, long, long ); + void coveLowerLeft( void ); + void coveLowerRight( void ); + void coveUpperLeft( void ); + void coveUpperRight( void ); + void coveUpperLeftNoGrid( TrimVertex * ); + void coveUpperRightNoGrid( TrimVertex * ); + void coveLowerLeftNoGrid( TrimVertex * ); + void coveLowerRightNoGrid( TrimVertex * ); + void coveLL( void ); + void coveLR( void ); + void coveUL( void ); + void coveUR( void ); + inline void output( GridTrimVertex& ); + inline void output( GridVertex& ); + inline void output( TrimVertex* ); +}; + +#endif /* __glucoveandtiler_h */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,198 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * curve.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "mymath.h" +#include "curve.h" +#include "mapdesc.h" +#include "types.h" +#include "quilt.h" +#include "nurbsconsts.h" + +/*-------------------------------------------------------------------------- + * Curve::Curve - copy curve from quilt and transform control points + *-------------------------------------------------------------------------- + */ + +Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) +{ + mapdesc = geo->mapdesc; + next = c; + needsSampling = mapdesc->isRangeSampling() ? 1 : 0; + cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT; + order = geo->qspec[0].order; + stride = MAXCOORDS; + + REAL *ps = geo->cpts; + Quiltspec_ptr qs = geo->qspec; + ps += qs->offset; + ps += qs->index * qs->order * qs->stride; + + if( needsSampling ) + mapdesc->xformSampling( ps, qs->order, qs->stride, spts, stride ); + + if( cullval == CULL_ACCEPT ) + mapdesc->xformCulling( ps, qs->order, qs->stride, cpts, stride ); + + /* set untrimmed curve range */ + range[0] = qs->breakpoints[qs->index]; + range[1] = qs->breakpoints[qs->index+1]; + range[2] = range[1] - range[0]; + + if( range[0] != pta ) { + Curve lower( *this, pta, 0 ); + lower.next = next; + *this = lower; + } + if( range[1] != ptb ) { + Curve lower( *this, ptb, 0 ); + } +} + +/*-------------------------------------------------------------------------- + * Curve::Curve - subdivide a curve along an isoparametric line + *-------------------------------------------------------------------------- + */ + +Curve::Curve( Curve& upper, REAL value, Curve *c ) +{ + Curve &lower = *this; + + lower.next = c; + lower.mapdesc = upper.mapdesc; + lower.needsSampling = upper.needsSampling; + lower.order = upper.order; + lower.stride = upper.stride; + lower.cullval = upper.cullval; + + REAL d = (value - upper.range[0]) / upper.range[2]; + + if( needsSampling ) + mapdesc->subdivide( upper.spts, lower.spts, d, upper.stride, upper.order ); + + if( cullval == CULL_ACCEPT ) + mapdesc->subdivide( upper.cpts, lower.cpts, d, upper.stride, upper.order ); + + lower.range[0] = upper.range[0]; + lower.range[1] = value; + lower.range[2] = value - upper.range[0]; + upper.range[0] = value; + upper.range[2] = upper.range[1] - value; +} + + +/*-------------------------------------------------------------------------- + * Curve::clamp - clamp the sampling rate to a given maximum + *-------------------------------------------------------------------------- + */ + +void +Curve::clamp( void ) +{ + if( stepsize < minstepsize ) + stepsize = mapdesc->clampfactor * minstepsize; +} + +void +Curve::setstepsize( REAL max ) +{ + stepsize = ( max >= 1.0 ) ? (range[2] / max) : range[2]; + minstepsize = stepsize; +} + +void +Curve::getstepsize( void ) +{ + minstepsize= 0; + + if( mapdesc->isConstantSampling() ) { + // fixed number of samples per patch in each direction + // maxrate is number of s samples per patch + setstepsize( mapdesc->maxrate ); + } else if( mapdesc->isDomainSampling() ) { + // maxrate is number of s samples per unit s length of domain + setstepsize( mapdesc->maxrate * range[2] ); + } else { + // upper bound on path length between sample points + + assert( order <= MAXORDER ); + + /* points have been transformed, therefore they are homogeneous */ + REAL tmp[MAXORDER][MAXCOORDS]; + const int tstride = sizeof(tmp[0]) / sizeof(REAL); + int val = mapdesc->project( spts, stride, &tmp[0][0], tstride, order ); + + if( val == 0 ) { + // control points cross infinity, therefore derivatives are undefined + setstepsize( mapdesc->maxrate ); + } else { + REAL t = mapdesc->getProperty( N_PIXEL_TOLERANCE ); + if( mapdesc->isParametricDistanceSampling() ) { + REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 2, range[2] ); + stepsize = (d > 0.0) ? sqrtf( 8.0 * t / d ) : range[2]; + minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0; + } else if( mapdesc->isPathLengthSampling() ) { + // t is upper bound on path (arc) length + REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 1, range[2] ); + stepsize = ( d > 0.0 ) ? (t / d) : range[2]; + minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0; + } else { + // control points cross infinity, therefore partials are undefined + setstepsize( mapdesc->maxrate ); + } + } + } +} + +int +Curve::needsSamplingSubdivision( void ) +{ + return ( stepsize < minstepsize ) ? 1 : 0; +} + +int +Curve::cullCheck( void ) +{ + if( cullval == CULL_ACCEPT ) + cullval = mapdesc->cullCheck( cpts, order, stride ); + return cullval; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curve.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,70 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * curve.h + * + */ + +#ifndef __glucurve_h_ +#define __glucurve_h_ + +#include "types.h" +#include "defines.h" + +class Mapdesc; +class Quilt; + + +class Curve { +public: +friend class Curvelist; + Curve( Quilt *, REAL, REAL, Curve * ); + Curve( Curve&, REAL, Curve * ); + Curve * next; +private: + Mapdesc * mapdesc; + int stride; + int order; + int cullval; + int needsSampling; + REAL cpts[MAXORDER*MAXCOORDS]; + REAL spts[MAXORDER*MAXCOORDS]; + REAL stepsize; + REAL minstepsize; + REAL range[3]; + + void clamp( void ); + void setstepsize( REAL ); + void getstepsize( void ); + int cullCheck( void ); + int needsSamplingSubdivision( void ); +}; +#endif /* __glucurve_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,110 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * curvelist.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "quilt.h" +#include "curvelist.h" +#include "curve.h" +#include "nurbsconsts.h" +#include "types.h" + +Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb ) +{ + curve = 0; + for( Quilt *q = quilts; q; q = q->next ) + curve = new Curve( q, pta, ptb, curve ); + range[0] = pta; + range[1] = ptb; + range[2] = ptb - pta; +} + +Curvelist::Curvelist( Curvelist &upper, REAL value ) +{ + Curvelist &lower = *this; + curve = 0; + for( Curve *c = upper.curve; c; c = c->next ) + curve = new Curve( *c, value, curve ); + + lower.range[0] = upper.range[0]; + lower.range[1] = value; + lower.range[2] = value - upper.range[0]; + upper.range[0] = value; + upper.range[2] = upper.range[1] - value; +} + +Curvelist::~Curvelist() +{ + while( curve ) { + Curve *c = curve; + curve = curve->next; + delete c; + } +} + +int +Curvelist::cullCheck( void ) +{ + for( Curve *c = curve; c; c = c->next ) + if( c->cullCheck() == CULL_TRIVIAL_REJECT ) + return CULL_TRIVIAL_REJECT; + return CULL_ACCEPT; +} + +void +Curvelist::getstepsize( void ) +{ + stepsize = range[2]; + Curve *c; + for( c = curve; c; c = c->next ) { + c->getstepsize(); + c->clamp(); + stepsize = ((c->stepsize < stepsize) ? c->stepsize : stepsize); + if( c->needsSamplingSubdivision() ) break; + } + needsSubdivision = ( c ) ? 1 : 0; +} + +int +Curvelist::needsSamplingSubdivision( void ) +{ + return needsSubdivision; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvelist.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,62 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * curvelist.h + * + */ + +#ifndef __glucurvelist_h_ +#define __glucurvelist_h_ + +#include "types.h" +#include "defines.h" + +class Mapdesc; +class Quilt; +class Curve; + +class Curvelist +{ +friend class Subdivider; +public: + Curvelist( Quilt *, REAL, REAL ); + Curvelist( Curvelist &, REAL ); + ~Curvelist( void ); + int cullCheck( void ); + void getstepsize( void ); + int needsSamplingSubdivision(); +private: + Curve *curve; + float range[3]; + int needsSubdivision; + float stepsize; +}; +#endif /* __glucurvelist_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvesub.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvesub.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvesub.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/curvesub.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,103 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * curvesub.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "subdivider.h" +#include "renderhints.h" +#include "backend.h" +#include "quilt.h" +#include "curvelist.h" +#include "curve.h" +#include "nurbsconsts.h" + +/*-------------------------------------------------------------------------- + * drawCurves - main curve rendering entry point + *-------------------------------------------------------------------------- + */ + +void +Subdivider::drawCurves( void ) +{ + REAL from[1], to[1]; + Flist bpts; + qlist->getRange( from, to, bpts ); + + renderhints.init( ); + + backend.bgncurv(); + for( int i=bpts.start; idownloadAll( &pta, &ptb, backend ); + + Curvelist curvelist( qlist, pta, ptb ); + samplingSplit( curvelist, renderhints.maxsubdivisions ); + } + backend.endcurv(); +} + + +/*-------------------------------------------------------------------------- + * samplingSplit - recursively subdivide patch, cull check each subpatch + *-------------------------------------------------------------------------- + */ + +void +Subdivider::samplingSplit( Curvelist& curvelist, int subdivisions ) +{ + if( curvelist.cullCheck() == CULL_TRIVIAL_REJECT ) return; + + curvelist.getstepsize(); + + if( curvelist.needsSamplingSubdivision() && (subdivisions > 0) ) { + REAL mid = ( curvelist.range[0] + curvelist.range[1] ) * 0.5; + Curvelist lowerlist( curvelist, mid ); + samplingSplit( lowerlist, subdivisions-1 ); // lower + samplingSplit( curvelist, subdivisions-1 ); // upper + } else { + long nu = 1 + ((long) (curvelist.range[2] / curvelist.stepsize)); + backend.curvgrid( curvelist.range[0], curvelist.range[1], nu ); + backend.curvmesh( 0, nu ); + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,209 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include "glimports.h" +#include "myassert.h" +#include "nurbsconsts.h" +#include "trimvertex.h" +#include "dataTransform.h" + +extern directedLine* arcLoopToDLineLoop(Arc_ptr loop); + +#if 0 // UNUSED +static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, directedLine dline_buf[], sampledLine sline_buf[], int& index_dline) +{ + directedLine *ret; + int old_index = index; + int i = index; + int j; + for(j=0; jpwlArc->npts-1; j++, i++) + { + vertArray[i][0] = loop->pwlArc->pts[j].param[0]; + vertArray[i][1] = loop->pwlArc->pts[j].param[1]; + } + loop->clearmark(); + + for(Arc_ptr jarc = loop->next; jarc != loop; jarc=jarc->next) + { + for(j=0; jpwlArc->npts-1; j++, i++) + { + vertArray[i][0] = jarc->pwlArc->pts[j].param[0]; + vertArray[i][1] = jarc->pwlArc->pts[j].param[1]; + } + jarc->clearmark(); + } + //copy the first vertex again + vertArray[i][0] = loop->pwlArc->pts[0].param[0]; + vertArray[i][1] = loop->pwlArc->pts[0].param[1]; + i++; + index=i; + + directedLine* dline; + sampledLine* sline; + sline = &sline_buf[index_dline]; + dline = &dline_buf[index_dline]; + sline->init(2, &vertArray[old_index]); + dline->init(INCREASING, sline); + ret = dline; + index_dline++; + + for(i=old_index+1; i<= index-2; i++) + { + sline = &sline_buf[index_dline]; + dline = &dline_buf[index_dline]; + sline->init(2, &vertArray[i]); + dline->init(INCREASING, sline); + ret->insert(dline); + index_dline++; + } + return ret; +} +#endif + +#if 0 // UNUSED +static int num_edges(Bin& bin) +{ + int sum=0; + for(Arc_ptr jarc = bin.firstarc(); jarc; jarc=bin.nextarc()) + sum += jarc->pwlArc->npts-1; + return sum; +} +#endif + +/* +directedLine* bin_to_DLineLoops(Bin& bin) +{ + directedLine *ret=NULL; + directedLine *temp; + + int numedges = num_edges(bin); + directedLine* dline_buf = new directedLine[numedges]; //not work for N32? + sampledLine* sline_buf=new sampledLine[numedges]; + + Real2* vertArray = new Real2[numedges*2]; + int index = 0; + int index_dline = 0; + bin.markall(); + + for(Arc_ptr jarc = bin.firstarc(); jarc; jarc=bin.nextarc()) + { + if(jarc->ismarked()) + { + assert(jarc->check() != 0); + Arc_ptr jarchead = jarc; + do { + jarc->clearmark(); + jarc = jarc->next; + } while(jarc != jarchead); + temp=copy_loop(jarchead, vertArray, index, dline_buf, sline_buf, index_dline); + ret = temp->insertPolygon(ret); + } + } + + return ret; +} +*/ + + +directedLine* bin_to_DLineLoops(Bin& bin) +{ + directedLine *ret=NULL; + directedLine *temp; + bin.markall(); + for(Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc()){ + if(jarc->ismarked()) { + assert(jarc->check() != 0); + Arc_ptr jarchead = jarc; + do { + jarc->clearmark(); + jarc = jarc->next; + } while(jarc != jarchead); + temp = arcLoopToDLineLoop(jarc); + ret = temp->insertPolygon(ret); + } + } + return ret; +} + +directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl) +{ + directedLine* ret = original; + for(Int i=0; inpts-1; i++) + { + sampledLine* sline = new sampledLine(2); + sline->setPoint(0, pwl->pts[i].param); + sline->setPoint(1, pwl->pts[i+1].param); + directedLine* dline = new directedLine(INCREASING, sline); + if(ret == NULL) + ret = dline; + else + ret->insert(dline); + } + return ret; +} + +directedLine* o_curve_to_DLineLoop(O_curve* cur) +{ + directedLine *ret; + if(cur == NULL) + return NULL; + assert(cur->curvetype == ct_pwlcurve); + ret = o_pwlcurve_to_DLines(NULL, cur->curve.o_pwlcurve); + for(O_curve* temp = cur->next; temp != NULL; temp = temp->next) + { + assert(temp->curvetype == ct_pwlcurve); + ret = o_pwlcurve_to_DLines(ret, temp->curve.o_pwlcurve); + } + return ret; +} + +directedLine* o_trim_to_DLineLoops(O_trim* trim) +{ + O_trim* temp; + directedLine *ret; + if(trim == NULL) + return NULL; + ret = o_curve_to_DLineLoop(trim->o_curve); + + for(temp=trim->next; temp != NULL; temp = temp->next) + { + ret = ret->insertPolygon(o_curve_to_DLineLoop(temp->o_curve)); + } + return ret; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/dataTransform.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,59 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _DATA_TRANSFORM_H +#define _DATA_TRANSFORM_H + +#include "reader.h" +#include "directedLine.h" +#include "bin.h" +directedLine* bin_to_DLineLoops(Bin& bin); + +/*transform the pwlcurve into a number of directedline lines + *insert these directedlines into orignal which is supposed to be + *the part of the trimming loop obtained so far. + *return the updated trimkming loop. + */ +directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl); + +/*transform a trim loop (curve) into a directedLine loop + */ +directedLine* o_curve_to_DLineLoop(O_curve* curve); + +/*transform a list of trim loops (trim) into + *a list of polygons represented as directedLine*. + */ +directedLine* o_trim_to_DLineLoops(O_trim* trim); + + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/defines.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/defines.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/defines.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/defines.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,50 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * defines.h + * + */ + +#ifndef __gludefines_h_ +#define __gludefines_h_ + +/* culling constants */ +#define CULL_TRIVIAL_REJECT 0 +#define CULL_TRIVIAL_ACCEPT 1 +#define CULL_ACCEPT 2 + +/* maximum order of a B-Spline */ +#define MAXORDER 24 + +/* maximum dimension of any B-spline range space */ +#define MAXCOORDS 5 + +#endif /* __gludefines_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,82 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * displaylist.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "nurbstess.h" +#include "displaylist.h" + + +DisplayList::DisplayList( NurbsTessellator *_nt ) : + dlnodePool( sizeof( Dlnode ), 1, "dlnodepool" ) +{ + lastNode = &nodes; + nt = _nt; +} + +DisplayList::~DisplayList( void ) +{ + for( Dlnode *nextNode; nodes; nodes = nextNode ) { + nextNode = nodes->next; + if( nodes->cleanup != 0 ) (nt->*nodes->cleanup)( nodes->arg ); + //nodes->deleteMe(dlnodePool); + } +} + +void +DisplayList::play( void ) +{ + for( Dlnode *node = nodes; node; node = node->next ) + if( node->work != 0 ) (nt->*node->work)( node->arg ); +} + +void +DisplayList::endList( void ) +{ + *lastNode = 0; +} + +void +DisplayList::append( PFVS work, void *arg, PFVS cleanup ) +{ + Dlnode *node = new(dlnodePool) Dlnode( work, arg, cleanup ); + *lastNode = node; + lastNode = &(node->next); +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaylist.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,78 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * displaylist.h + * + */ + +#ifndef __gludisplaylist_h_ +#define __gludisplaylist_h_ + +#include "glimports.h" +#include "mysetjmp.h" +#include "mystdio.h" +#include "bufpool.h" + +class NurbsTessellator; + +typedef void (NurbsTessellator::*PFVS)( void * ); + +struct Dlnode : public PooledObj { + Dlnode( PFVS, void *, PFVS ); + PFVS work; + void * arg; + PFVS cleanup; + Dlnode * next; +}; + +inline +Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) +{ + work = _work; + arg = _arg; + cleanup = _cleanup; +} + +class DisplayList { +public: + DisplayList( NurbsTessellator * ); + ~DisplayList( void ); + void play( void ); + void append( PFVS work, void *arg, PFVS cleanup ); + void endList( void ); +private: + Dlnode *nodes; + Pool dlnodePool; + Dlnode **lastNode; + NurbsTessellator *nt; +}; + +#endif /* __gludisplaylist_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaymode.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaymode.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaymode.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/displaymode.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,40 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef __gludisplaymode_h_ +#define __gludisplaymode_h_ + +#define N_MESHFILL 0 +#define N_MESHLINE 1 +#define N_MESHPOINT 2 + +#endif /* __gludisplaymode_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,118 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * flist.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "flist.h" + +/*---------------------------------------------------------------------------- + * Flist::Flist - initialize a REAL number array + *---------------------------------------------------------------------------- + */ +Flist::Flist( void ) +{ + npts = 0; + pts = 0; + start = end = 0; +} + +/*---------------------------------------------------------------------------- + * Flist::~Flist - free a REAL number array + *---------------------------------------------------------------------------- + */ +Flist::~Flist( void ) +{ + if( npts ) delete[] pts; +} + +void +Flist::add( REAL x ) +{ + pts[end++] = x; + assert( end <= npts ); +} + +/*---------------------------------------------------------------------------- + * Flist::filter - remove duplicate numbers from array + *---------------------------------------------------------------------------- + */ +void Flist::filter( void ) +{ + sorter.qsort( pts, end ); + start = 0; + + int j = 0; + for( int i = 1; i < end; i++ ) { + if( pts[i] == pts[i-j-1] ) + j++; + pts[i-j] = pts[i]; + } + end -= j; +} + +/*---------------------------------------------------------------------------- + * Flist::grow - ensure that array is large enough + *---------------------------------------------------------------------------- + */ +void Flist::grow( int maxpts ) +{ + if( npts < maxpts ) { + if( npts ) delete[] pts; + npts = 2 * maxpts; + pts = new REAL[npts]; + assert( pts != 0 ); + } + start = end = 0; +} + +/*---------------------------------------------------------------------------- + * Flist::taper - ignore head and tail of array + *---------------------------------------------------------------------------- + */ +void Flist::taper( REAL from, REAL to ) +{ + while( pts[start] != from ) + start++; + + while( pts[end-1] != to ) + end--; +} + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flist.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,59 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * flist.h + * + */ + +#ifndef __gluflist_h_ +#define __gluflist_h_ + +#include "types.h" +#include "flistsorter.h" + +class Flist { +public: + REAL * pts; /* head of array */ + int npts; /* number of points in array */ + int start; /* first important point index */ + int end; /* last important point index */ + + Flist( void ); + ~Flist( void ); + void add( REAL x ); + void filter( void ); + void grow( int); + void taper( REAL , REAL ); +protected: + FlistSorter sorter; +}; + +#endif /* __gluflist_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,81 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * flistsorter.c++ + * + */ + +#include "glimports.h" +#include "flistsorter.h" + +FlistSorter::FlistSorter( void ) : Sorter( sizeof( REAL ) ) +{ +} + +void +FlistSorter::qsort( REAL *p, int n ) +{ + Sorter::qsort( (char *)p, n ); +} + +int +FlistSorter::qscmp( char *i, char *j ) +{ + REAL f0 = *(REAL *)i; + REAL f1 = *(REAL *)j; + return (f0 < f1) ? -1 : 1; +} + +void +FlistSorter::qsexc( char *i, char *j ) +{ + REAL *f0 = (REAL *)i; + REAL *f1 = (REAL *)j; + REAL tmp = *f0; + *f0 = *f1; + *f1 = tmp; +} + +void +FlistSorter::qstexc( char *i, char *j, char *k ) +{ + REAL *f0 = (REAL *)i; + REAL *f1 = (REAL *)j; + REAL *f2 = (REAL *)k; + REAL tmp = *f0; + *f0 = *f2; + *f2 = *f1; + *f1 = tmp; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/flistsorter.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,53 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * flistsorter.h + * + */ + +#ifndef __gluflistsorter_h_ +#define __gluflistsorter_h_ + +#include "sorter.h" +#include "types.h" + +class FlistSorter : public Sorter { +public: + FlistSorter(void); + virtual ~FlistSorter() { /* silence warning*/ } + void qsort( REAL *a, int n ); + +protected: + virtual int qscmp( char *, char * ); + virtual void qsexc( char *i, char *j ); // i<-j, j<-i + virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i +}; +#endif /* __gluflistsorter_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridline.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridline.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridline.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridline.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,46 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * gridline.h + * + */ + +#ifndef __glugridline_h_ +#define __glugridline_h_ + +struct Gridline { + long v; + REAL vval; + long vindex; + long ustart; + long uend; + }; +#endif /* __glugridline_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridtrimvertex.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridtrimvertex.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridtrimvertex.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridtrimvertex.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,89 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * gridtrimvertex.h + * + */ + +#ifndef __glugridtrimvertex_h_ +#define __glugridtrimvertex_h_ + +#include "mystdlib.h" +#include "bufpool.h" +#include "trimvertex.h" +#include "gridvertex.h" + +class GridTrimVertex : public PooledObj +{ +private: + TrimVertex dummyt; + GridVertex dummyg; +public: + GridTrimVertex() { g = 0; t = 0; } + TrimVertex *t; + GridVertex *g; + + inline void set( long, long ); + inline void set( REAL, REAL ); + inline void set( TrimVertex * ); + inline void clear( void ) { t = 0; g = 0; }; + inline int isGridVert() { return g ? 1 : 0 ; } + inline int isTrimVert() { return t ? 1 : 0 ; } + inline void output(); +}; + +inline void +GridTrimVertex::set( long x, long y ) +{ + g = &dummyg; + dummyg.gparam[0] = x; + dummyg.gparam[1] = y; +} + +inline void +GridTrimVertex::set( REAL x, REAL y ) +{ + g = 0; + t = &dummyt; + dummyt.param[0] = x; + dummyt.param[1] = y; + dummyt.nuid = 0; +} + +inline void +GridTrimVertex::set( TrimVertex *v ) +{ + g = 0; + t = v; +} + +typedef GridTrimVertex *GridTrimVertex_p; +#endif /* __glugridtrimvertex_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridvertex.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridvertex.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridvertex.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/gridvertex.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,48 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * gridvertex.h + * + */ + +#ifndef __glugridvertex_h_ +#define __glugridvertex_h_ + +struct GridVertex { + long gparam[2]; + GridVertex( void ) {} + GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; } + void set( long u, long v ) { gparam[0] = u, gparam[1] = v; } + long nextu() { return gparam[0]++; } + long prevu() { return gparam[0]--; } +}; + +#endif /* __glugridvertex_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,165 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * hull.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "hull.h" +#include "gridvertex.h" +#include "gridtrimvertex.h" +#include "gridline.h" +#include "trimline.h" +#include "uarray.h" +#include "trimregion.h" + +Hull::Hull( void ) +{} + +Hull::~Hull( void ) +{} + +/*---------------------------------------------------------------------- + * Hull:init - this routine does the initialization needed before any + * calls to nextupper or nextlower can be made. + *---------------------------------------------------------------------- + */ +void +Hull::init( void ) +{ + TrimVertex *lfirst = left.first(); + TrimVertex *llast = left.last(); + if( lfirst->param[0] <= llast->param[0] ) { + fakeleft.init( left.first() ); + upper.left = &fakeleft; + lower.left = &left; + } else { + fakeleft.init( left.last() ); + lower.left = &fakeleft; + upper.left = &left; + } + upper.left->last(); + lower.left->first(); + + if( top.ustart <= top.uend ) { + upper.line = ⊤ + upper.index = top.ustart; + } else + upper.line = 0; + + if( bot.ustart <= bot.uend ) { + lower.line = ⊥ + lower.index = bot.ustart; + } else + lower.line = 0; + + TrimVertex *rfirst = right.first(); + TrimVertex *rlast = right.last(); + if( rfirst->param[0] <= rlast->param[0] ) { + fakeright.init( right.last() ); + lower.right = &fakeright; + upper.right = &right; + } else { + fakeright.init( right.first() ); + upper.right = &fakeright; + lower.right = &right; + } + upper.right->first(); + lower.right->last(); +} + +/*---------------------------------------------------------------------- + * nextupper - find next vertex on upper hull of trim region. + * - if vertex is on trim curve, set vtop point to + * that vertex. if vertex is on grid, set vtop to + * point to temporary area and stuff coordinants into + * temporary vertex. Also, place grid coords in temporary + * grid vertex. + *---------------------------------------------------------------------- + */ +GridTrimVertex * +Hull::nextupper( GridTrimVertex *gv ) +{ + if( upper.left ) { + gv->set( upper.left->prev() ); + if( gv->isTrimVert() ) return gv; + upper.left = 0; + } + + if( upper.line ) { + assert( upper.index <= upper.line->uend ); + gv->set( uarray.uarray[upper.index], upper.line->vval ); + gv->set( upper.index, upper.line->vindex ); + if( upper.index++ == upper.line->uend ) upper.line = 0; + return gv; + } + + if( upper.right ) { + gv->set( upper.right->next() ); + if( gv->isTrimVert() ) return gv; + upper.right = 0; + } + + return 0; +} + +GridTrimVertex * +Hull::nextlower( register GridTrimVertex *gv ) +{ + if( lower.left ) { + gv->set( lower.left->next() ); + if( gv->isTrimVert() ) return gv; + lower.left = 0; + } + + if( lower.line ) { + gv->set( uarray.uarray[lower.index], lower.line->vval ); + gv->set( lower.index, lower.line->vindex ); + if( lower.index++ == lower.line->uend ) lower.line = 0; + return gv; + } + + if( lower.right ) { + gv->set( lower.right->prev() ); + if( gv->isTrimVert() ) return gv; + lower.right = 0; + } + + return 0; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/hull.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,69 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * hull.h + * + */ + +#ifndef __gluhull_h_ +#define __gluhull_h_ + +#include "trimline.h" +#include "trimregion.h" +#include "trimvertex.h" +#include "gridtrimvertex.h" + +struct Gridline; +class Uarray; + +class Hull : virtual public TrimRegion { +public: + Hull( void ); + ~Hull( void ); + void init( void ); + GridTrimVertex * nextlower( GridTrimVertex * ); + GridTrimVertex * nextupper( GridTrimVertex * ); +private: + struct Side { + Trimline *left; + Gridline *line; + Trimline *right; + long index; + }; + + Side lower; + Side upper; + Trimline fakeleft; + Trimline fakeright; +}; + + +#endif /* __gluhull_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/intersect.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/intersect.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/intersect.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/intersect.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,665 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * intersect.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "subdivider.h" +#include "arc.h" +#include "bin.h" +#include "backend.h" +#include "trimvertpool.h" + +/*#define NOTDEF*/ + +enum i_result { INTERSECT_VERTEX, INTERSECT_EDGE }; + +/* local functions */ +#ifndef NDEBUG // for asserts only +static int arc_classify( Arc_ptr, int, REAL ); +#endif +static enum i_result pwlarc_intersect( PwlArc *, int, REAL, int, int[3] ); + + +void +Subdivider::partition( Bin & bin, Bin & left, Bin & intersections, + Bin & right, Bin & unknown, int param, REAL value ) +{ + Bin headonleft, headonright, tailonleft, tailonright; + + for( Arc_ptr jarc = bin.removearc(); jarc; jarc = bin.removearc() ) { + + REAL tdiff = jarc->tail()[param] - value; + REAL hdiff = jarc->head()[param] - value; + + if( tdiff > 0.0 ) { + if( hdiff > 0.0 ) { + right.addarc( jarc ); + } else if( hdiff == 0.0 ) { + tailonright.addarc( jarc ); + } else { + Arc_ptr jtemp; + switch( arc_split(jarc, param, value, 0) ) { + case 2: + tailonright.addarc( jarc ); + headonleft.addarc( jarc->next ); + break; + case 31: + assert( jarc->head()[param] > value ); + right.addarc( jarc ); + tailonright.addarc( jtemp = jarc->next ); + headonleft.addarc( jtemp->next ); + break; + case 32: + assert( jarc->head()[param] <= value ); + tailonright .addarc( jarc ); + headonleft.addarc( jtemp = jarc->next ); + left.addarc( jtemp->next ); + break; + case 4: + right.addarc( jarc ); + tailonright.addarc( jtemp = jarc->next ); + headonleft.addarc( jtemp = jtemp->next ); + left.addarc( jtemp->next ); + } + } + } else if( tdiff == 0.0 ) { + if( hdiff > 0.0 ) { + headonright.addarc( jarc ); + } else if( hdiff == 0.0 ) { + unknown.addarc( jarc ); + } else { + headonleft.addarc( jarc ); + } + } else { + if( hdiff > 0.0 ) { + Arc_ptr jtemp; + switch( arc_split(jarc, param, value, 1) ) { + case 2: + tailonleft.addarc( jarc ); + headonright.addarc( jarc->next ); + break; + case 31: + assert( jarc->head()[param] < value ); + left.addarc( jarc ); + tailonleft.addarc( jtemp = jarc->next ); + headonright.addarc( jtemp->next ); + break; + case 32: + assert( jarc->head()[param] >= value ); + tailonleft.addarc( jarc ); + headonright.addarc( jtemp = jarc->next ); + right.addarc( jtemp->next ); + break; + case 4: + left.addarc( jarc ); + tailonleft.addarc( jtemp = jarc->next ); + headonright.addarc( jtemp = jtemp->next ); + right.addarc( jtemp->next ); + } + } else if( hdiff == 0.0 ) { + tailonleft.addarc( jarc ); + } else { + left.addarc( jarc ); + } + } + } + if( param == 0 ) { + classify_headonleft_s( headonleft, intersections, left, value ); + classify_tailonleft_s( tailonleft, intersections, left, value ); + classify_headonright_s( headonright, intersections, right, value ); + classify_tailonright_s( tailonright, intersections, right, value ); + } else { + classify_headonleft_t( headonleft, intersections, left, value ); + classify_tailonleft_t( tailonleft, intersections, left, value ); + classify_headonright_t( headonright, intersections, right, value ); + classify_tailonright_t( tailonright, intersections, right, value ); + } +} + +inline static void +vert_interp( TrimVertex *n, TrimVertex *l, TrimVertex *r, int p, REAL val ) +{ + assert( val > l->param[p]); + assert( val < r->param[p]); + + n->nuid = l->nuid; + + n->param[p] = val; + if( l->param[1-p] != r->param[1-p] ) { + REAL ratio = (val - l->param[p]) / (r->param[p] - l->param[p]); + n->param[1-p] = l->param[1-p] + + ratio * (r->param[1-p] - l->param[1-p]); + } else { + n->param[1-p] = l->param[1-p]; + } +} + +int +Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir ) +{ + int maxvertex = jarc->pwlArc->npts; + Arc_ptr jarc1; + TrimVertex* v = jarc->pwlArc->pts; + + int loc[3]; + switch( pwlarc_intersect( jarc->pwlArc, param, value, dir, loc ) ) { + + // When the parameter value lands on a vertex, life is sweet + case INTERSECT_VERTEX: { + jarc1 = new(arcpool) Arc( jarc, new( pwlarcpool) PwlArc( maxvertex-loc[1], &v[loc[1]] ) ); + jarc->pwlArc->npts = loc[1] + 1; + jarc1->next = jarc->next; + jarc1->next->prev = jarc1; + jarc->next = jarc1; + jarc1->prev = jarc; + assert(jarc->check() != 0); + return 2; + } + + // When the parameter value intersects an edge, we have to + // interpolate a new vertex. There are special cases + // if the new vertex is adjacent to one or both of the + // endpoints of the arc. + case INTERSECT_EDGE: { + int i, j; + if( dir == 0 ) { + i = loc[0]; + j = loc[2]; + } else { + i = loc[2]; + j = loc[0]; + } + +#ifndef NOTDEF + // The split is between vertices at index j and i, in that + // order (j < i) + + // JEB: This code is my idea of how to do the split without + // increasing the number of links. I'm doing this so that + // the is_rect routine can recognize rectangles created by + // subdivision. In exchange for simplifying the curve list, + // however, it costs in allocated space and vertex copies. + + TrimVertex *newjunk = trimvertexpool.get(maxvertex -i+1 /*-j*/); + int k; + for(k=0; knuid; + } + + TrimVertex *vcopy = trimvertexpool.get(maxvertex); + for(k=0; kpwlArc->pts=vcopy; + + v[i].nuid = jarc->nuid; + v[j].nuid = jarc->nuid; + vert_interp( &newjunk[0], &v[loc[0]], &v[loc[2]], param, value ); + + if( showingDegenerate() ) + backend.triangle( &v[i], &newjunk[0], &v[j] ); + + vcopy[j+1].param[0]=newjunk[0].param[0]; + vcopy[j+1].param[1]=newjunk[0].param[1]; + + + jarc1 = new(arcpool) Arc( jarc, + new(pwlarcpool) PwlArc(maxvertex-i+1 , newjunk ) ); + + jarc->pwlArc->npts = j+2; + jarc1->next = jarc->next; + jarc1->next->prev = jarc1; + jarc->next = jarc1; + jarc1->prev = jarc; + assert(jarc->check() != 0); + + return 2; +#endif //not NOTDEF + // JEB: This is the original version: +#ifdef NOTDEF + Arc_ptr jarc2, jarc3; + + TrimVertex *newjunk = trimvertexpool.get(3); + v[i].nuid = jarc->nuid; + v[j].nuid = jarc->nuid; + newjunk[0] = v[j]; + newjunk[2] = v[i]; + vert_interp( &newjunk[1], &v[loc[0]], &v[loc[2]], param, value ); + + if( showingDegenerate() ) + backend.triangle( &newjunk[2], &newjunk[1], &newjunk[0] ); + + // New vertex adjacent to both endpoints + if (maxvertex == 2) { + jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); + jarc->pwlArc->npts = 2; + jarc->pwlArc->pts = newjunk; + jarc1->next = jarc->next; + jarc1->next->prev = jarc1; + jarc->next = jarc1; + jarc1->prev = jarc; + assert(jarc->check() != 0); + + return 2; + + // New vertex adjacent to ending point of arc + } else if (maxvertex - j == 2) { + jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk ) ); + jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); + jarc->pwlArc->npts = maxvertex-1; + jarc2->next = jarc->next; + jarc2->next->prev = jarc2; + jarc->next = jarc1; + jarc1->prev = jarc; + jarc1->next = jarc2; + jarc2->prev = jarc1; + assert(jarc->check() != 0); + return 31; + + // New vertex adjacent to starting point of arc + } else if (i == 1) { + jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); + jarc2 = new(arcpool) Arc( jarc, + new(pwlarcpool) PwlArc( maxvertex-1, &jarc->pwlArc->pts[1] ) ); + jarc->pwlArc->npts = 2; + jarc->pwlArc->pts = newjunk; + jarc2->next = jarc->next; + jarc2->next->prev = jarc2; + jarc->next = jarc1; + jarc1->prev = jarc; + jarc1->next = jarc2; + jarc2->prev = jarc1; + assert(jarc->check() != 0); + return 32; + + // It's somewhere in the middle + } else { + jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk ) ); + jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); + jarc3 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( maxvertex-i, v+i ) ); + jarc->pwlArc->npts = j + 1; + jarc3->next = jarc->next; + jarc3->next->prev = jarc3; + jarc->next = jarc1; + jarc1->prev = jarc; + jarc1->next = jarc2; + jarc2->prev = jarc1; + jarc2->next = jarc3; + jarc3->prev = jarc2; + assert(jarc->check() != 0); + return 4; + } +#endif // NOTDEF + } + default: + return -1; //picked -1 since it's not used + } +} + +/*---------------------------------------------------------------------------- + * pwlarc_intersect - find intersection of pwlArc and isoparametric line + *---------------------------------------------------------------------------- + */ + +static enum i_result +pwlarc_intersect( + PwlArc *pwlArc, + int param, + REAL value, + int dir, + int loc[3] ) +{ + assert( pwlArc->npts > 0 ); + + if( dir ) { + TrimVertex *v = pwlArc->pts; + int imin = 0; + int imax = pwlArc->npts - 1; + assert( value > v[imin].param[param] ); + assert( value < v[imax].param[param] ); + while( (imax - imin) > 1 ) { + int imid = (imax + imin)/2; + if( v[imid].param[param] > value ) + imax = imid; + else if( v[imid].param[param] < value ) + imin = imid; + else { + loc[1] = imid; + return INTERSECT_VERTEX; + } + } + loc[0] = imin; + loc[2] = imax; + return INTERSECT_EDGE; + } else { + TrimVertex *v = pwlArc->pts; + int imax = 0; + int imin = pwlArc->npts - 1; + assert( value > v[imin].param[param] ); + assert( value < v[imax].param[param] ); + while( (imin - imax) > 1 ) { + int imid = (imax + imin)/2; + if( v[imid].param[param] > value ) + imax = imid; + else if( v[imid].param[param] < value ) + imin = imid; + else { + loc[1] = imid; + return INTERSECT_VERTEX; + } + } + loc[0] = imin; + loc[2] = imax; + return INTERSECT_EDGE; + } +} + +/*---------------------------------------------------------------------------- + * arc_classify - determine which side of a line a jarc lies + *---------------------------------------------------------------------------- + */ + +#ifndef NDEBUG // for asserts only +static int +arc_classify( Arc_ptr jarc, int param, REAL value ) +{ + REAL tdiff, hdiff; + if( param == 0 ) { + tdiff = jarc->tail()[0] - value; + hdiff = jarc->head()[0] - value; + } else { + tdiff = jarc->tail()[1] - value; + hdiff = jarc->head()[1] - value; + } + + if( tdiff > 0.0 ) { + if( hdiff > 0.0 ) { + return 0x11; + } else if( hdiff == 0.0 ) { + return 0x12; + } else { + return 0x10; + } + } else if( tdiff == 0.0 ) { + if( hdiff > 0.0 ) { + return 0x21; + } else if( hdiff == 0.0 ) { + return 0x22; + } else { + return 0x20; + } + } else { + if( hdiff > 0.0 ) { + return 0x01; + } else if( hdiff == 0.0 ) { + return 0x02; + } else { + return 0; + } + } +} +#endif + +void +Subdivider::classify_tailonleft_s( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail at left, head on line */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 0, val ) == 0x02 ); + j->clearitail(); + + REAL diff = j->next->head()[0] - val; + if( diff > 0.0 ) { + in.addarc( j ); + } else if( diff < 0.0 ) { + if( ccwTurn_sl( j, j->next ) ) + out.addarc( j ); + else + in.addarc( j ); + } else { + if( j->next->tail()[1] > j->next->head()[1] ) + in.addarc(j); + else + out.addarc(j); + } + } +} + +void +Subdivider::classify_tailonleft_t( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail at left, head on line */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 1, val ) == 0x02 ); + j->clearitail(); + + REAL diff = j->next->head()[1] - val; + if( diff > 0.0 ) { + in.addarc( j ); + } else if( diff < 0.0 ) { + if( ccwTurn_tl( j, j->next ) ) + out.addarc( j ); + else + in.addarc( j ); + } else { + if (j->next->tail()[0] > j->next->head()[0] ) + out.addarc( j ); + else + in.addarc( j ); + } + } +} + +void +Subdivider::classify_headonleft_s( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail on line, head at left */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 0, val ) == 0x20 ); + + j->setitail(); + + REAL diff = j->prev->tail()[0] - val; + if( diff > 0.0 ) { + out.addarc( j ); + } else if( diff < 0.0 ) { + if( ccwTurn_sl( j->prev, j ) ) + out.addarc( j ); + else + in.addarc( j ); + } else { + if( j->prev->tail()[1] > j->prev->head()[1] ) + in.addarc( j ); + else + out.addarc( j ); + } + } +} + +void +Subdivider::classify_headonleft_t( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail on line, head at left */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 1, val ) == 0x20 ); + j->setitail(); + + REAL diff = j->prev->tail()[1] - val; + if( diff > 0.0 ) { + out.addarc( j ); + } else if( diff < 0.0 ) { + if( ccwTurn_tl( j->prev, j ) ) + out.addarc( j ); + else + in.addarc( j ); + } else { + if( j->prev->tail()[0] > j->prev->head()[0] ) + out.addarc( j ); + else + in.addarc( j ); + } + } +} + + +void +Subdivider::classify_tailonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail at right, head on line */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 0, val ) == 0x12); + + j->clearitail(); + + REAL diff = j->next->head()[0] - val; + if( diff > 0.0 ) { + if( ccwTurn_sr( j, j->next ) ) + out.addarc( j ); + else + in.addarc( j ); + } else if( diff < 0.0 ) { + in.addarc( j ); + } else { + if( j->next->tail()[1] > j->next->head()[1] ) + out.addarc( j ); + else + in.addarc( j ); + } + } +} + +void +Subdivider::classify_tailonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail at right, head on line */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 1, val ) == 0x12); + + j->clearitail(); + + REAL diff = j->next->head()[1] - val; + if( diff > 0.0 ) { + if( ccwTurn_tr( j, j->next ) ) + out.addarc( j ); + else + in.addarc( j ); + } else if( diff < 0.0 ) { + in.addarc( j ); + } else { + if( j->next->tail()[0] > j->next->head()[0] ) + in.addarc( j ); + else + out.addarc( j ); + } + } +} + +void +Subdivider::classify_headonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail on line, head at right */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 0, val ) == 0x21 ); + + j->setitail(); + + REAL diff = j->prev->tail()[0] - val; + if( diff > 0.0 ) { + if( ccwTurn_sr( j->prev, j ) ) + out.addarc( j ); + else + in.addarc( j ); + } else if( diff < 0.0 ) { + out.addarc( j ); + } else { + if( j->prev->tail()[1] > j->prev->head()[1] ) + out.addarc( j ); + else + in.addarc( j ); + } + } +} + +void +Subdivider::classify_headonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) +{ + /* tail on line, head at right */ + Arc_ptr j; + + while( (j = bin.removearc()) != NULL ) { + assert( arc_classify( j, 1, val ) == 0x21 ); + + j->setitail(); + + REAL diff = j->prev->tail()[1] - val; + if( diff > 0.0 ) { + if( ccwTurn_tr( j->prev, j ) ) + out.addarc( j ); + else + in.addarc( j ); + } else if( diff < 0.0 ) { + out.addarc( j ); + } else { + if( j->prev->tail()[0] > j->prev->head()[0] ) + in.addarc( j ); + else + out.addarc( j ); + } + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/jarcloc.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/jarcloc.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/jarcloc.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/jarcloc.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,87 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * jarcloc.h + * + */ + +#ifndef __glujarcloc_h_ +#define __glujarcloc_h_ + +#include "arc.h" + +class Jarcloc { +private: + Arc_ptr arc; + TrimVertex *p; + TrimVertex *plast; +public: + inline void init( Arc_ptr a, long first, long last ) { arc = a; p=&a->pwlArc->pts[first]; plast = &a->pwlArc->pts[last]; } + inline TrimVertex * getnextpt( void ); + inline TrimVertex * getprevpt( void ); + inline void reverse(); +}; + +inline void +Jarcloc::reverse() +{ + if( plast == &arc->pwlArc->pts[0] ) + plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1]; + else + plast = &arc->pwlArc->pts[0]; +} + +inline TrimVertex * +Jarcloc::getnextpt() +{ + assert( p <= plast ); + if( p == plast ) { + arc = arc->next; + p = &arc->pwlArc->pts[0]; + plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1]; + assert( p < plast ); + } + return p++; +} + +inline TrimVertex * +Jarcloc::getprevpt() +{ + assert( p >= plast ); + if( p == plast ) { + arc = arc->prev; + p = &arc->pwlArc->pts[arc->pwlArc->npts - 1]; + plast = &arc->pwlArc->pts[0]; + assert( p > plast ); + } + return p--; +} +#endif /* __glujarcloc_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/knotvector.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/knotvector.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/knotvector.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/knotvector.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,139 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * knotvector.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "knotvector.h" +#include "defines.h" + +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif + +void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knotlist ) +{ + knotcount = _knotcount; + stride = _stride; + order = _order; + knotlist = new Knot[_knotcount]; + assert( knotlist != 0 ); + + for( int i = 0; i != _knotcount; i++ ) + knotlist[i] = (Knot) _knotlist[i]; +} + +Knotvector::Knotvector( void ) +{ + knotlist = 0; +} + +Knotvector::~Knotvector( void ) +{ + if( knotlist ) delete[] knotlist; +} + +int Knotvector::validate( void ) +{ + /* kindex is used as an array index so subtract one first, + * this propagates throughout the code so study carefully */ + long kindex = knotcount-1; + + if( order < 1 || order > MAXORDER ) { + // spline order un-supported + return( 1 ); + } + + if( knotcount < (2 * order) ) { + // too few knots + return( 2 ); + } + + if( identical( knotlist[kindex-(order-1)], knotlist[order-1]) ) { + // valid knot range is empty + return( 3 ); + } + + for( long i = 0; i < kindex; i++) + if( knotlist[i] > knotlist[i+1] ) { + // decreasing knot sequence + return( 4 ); + } + + /* check for valid multiplicity */ + + /* kindex is currently the index of the last knot. + * In the next loop it is decremented to ignore the last knot + * and the loop stops when kindex is 2 so as to ignore the first + * knot as well. These knots are not used in computing + * knot multiplicities. + */ + + long multi = 1; + for( ; kindex >= 1; kindex-- ) { + if( knotlist[kindex] - knotlist[kindex-1] < TOLERANCE ) { + multi++; + continue; + } + if ( multi > order ) { + // knot multiplicity greater than order of spline + return( 5 ); + } + multi = 1; + } + + if ( multi > order ) { + // knot multiplicity greater than order of spline + return( 5 ); + } + + return 0; +} + +void Knotvector::show( const char *msg ) +{ +#ifndef NDEBUG + _glu_dprintf( "%s\n", msg ); + _glu_dprintf( "order = %ld, count = %ld\n", order, knotcount ); + + for( int i=0; i +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "mystring.h" +#include "mymath.h" +#include "backend.h" +#include "nurbsconsts.h" +#include "mapdesc.h" + +Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b ) + : backend( b ) +{ + type = _type; + isrational = _israt; + ncoords = _ncoords; + hcoords = _ncoords + (_israt ? 0 : 1 ); + inhcoords = _ncoords - (_israt ? 1 : 0 ); + mask = ((1<<(inhcoords*2))-1); + next = 0; + + assert( hcoords <= MAXCOORDS ); + assert( inhcoords >= 1 ); + + pixel_tolerance = 1.0; + error_tolerance = 1.0; + bbox_subdividing = N_NOBBOXSUBDIVISION; + culling_method = N_NOCULLING; + sampling_method = N_NOSAMPLING; + clampfactor = N_NOCLAMPING; + minsavings = N_NOSAVINGSSUBDIVISION; + s_steps = 0.0; + t_steps = 0.0; + maxrate = ( s_steps < 0.0 ) ? 0.0 : s_steps; + maxsrate = ( s_steps < 0.0 ) ? 0.0 : s_steps; + maxtrate = ( t_steps < 0.0 ) ? 0.0 : t_steps; + identify( bmat ); + identify( cmat ); + identify( smat ); + for( int i = 0; i != inhcoords; i++ ) + bboxsize[i] = 1.0; +} + +void +Mapdesc::setBboxsize( INREAL *mat ) +{ + for( int i = 0; i != inhcoords; i++ ) + bboxsize[i] = (REAL) mat[i]; +} + +void +Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] ) +{ + memset( dest, 0, sizeof( dest ) ); + for( int i=0; i != hcoords; i++ ) + dest[i][i] = 1.0; +} + +void +Mapdesc::surfbbox( REAL bb[2][MAXCOORDS] ) +{ + backend.surfbbox( type, bb[0], bb[1] ); +} + +void +Mapdesc::copy( REAL dest[MAXCOORDS][MAXCOORDS], long n, INREAL *src, + long rstride, long cstride ) +{ + assert( n >= 0 ); + for( int i=0; i != n; i++ ) + for( int j=0; j != n; j++ ) + dest[i][j] = src[i*rstride + j*cstride]; +} + +/*-------------------------------------------------------------------------- + * copyPt - copy a homogeneous point + *-------------------------------------------------------------------------- + */ +void +Mapdesc::copyPt( REAL *d, REAL *s ) +{ + assert( hcoords > 0 ); + switch( hcoords ) { + case 4: + d[3] = s[3]; + d[2] = s[2]; + d[1] = s[1]; + d[0] = s[0]; + break; + case 3: + d[2] = s[2]; + d[1] = s[1]; + d[0] = s[0]; + break; + case 2: + d[1] = s[1]; + d[0] = s[0]; + break; + case 1: + d[0] = s[0]; + break; + case 5: + d[4] = s[4]; + d[3] = s[3]; + d[2] = s[2]; + d[1] = s[1]; + d[0] = s[0]; + break; + default: + memcpy( d, s, hcoords * sizeof( REAL ) ); + break; + } +} + +/*-------------------------------------------------------------------------- + * sumPt - compute affine combination of two homogeneous points + *-------------------------------------------------------------------------- + */ +void +Mapdesc::sumPt( REAL *dst, REAL *src1, REAL *src2, register REAL alpha, register REAL beta ) +{ + assert( hcoords > 0 ); + switch( hcoords ) { + case 4: + dst[3] = src1[3] * alpha + src2[3] * beta; + dst[2] = src1[2] * alpha + src2[2] * beta; + dst[1] = src1[1] * alpha + src2[1] * beta; + dst[0] = src1[0] * alpha + src2[0] * beta; + break; + case 3: + dst[2] = src1[2] * alpha + src2[2] * beta; + dst[1] = src1[1] * alpha + src2[1] * beta; + dst[0] = src1[0] * alpha + src2[0] * beta; + break; + case 2: + dst[1] = src1[1] * alpha + src2[1] * beta; + dst[0] = src1[0] * alpha + src2[0] * beta; + break; + case 1: + dst[0] = src1[0] * alpha + src2[0] * beta; + break; + case 5: + dst[4] = src1[4] * alpha + src2[4] * beta; + dst[3] = src1[3] * alpha + src2[3] * beta; + dst[2] = src1[2] * alpha + src2[2] * beta; + dst[1] = src1[1] * alpha + src2[1] * beta; + dst[0] = src1[0] * alpha + src2[0] * beta; + break; + default: { + for( int i = 0; i != hcoords; i++ ) + dst[i] = src1[i] * alpha + src2[i] * beta; + } + break; + } +} + +/*-------------------------------------------------------------------------- + * clipbits - compute bit-vector indicating point/window position + * of a (transformed) homogeneous point + *-------------------------------------------------------------------------- + */ +unsigned int +Mapdesc::clipbits( REAL *p ) +{ + assert( inhcoords >= 0 ); + assert( inhcoords <= 3 ); + + register int nc = inhcoords; + register REAL pw = p[nc]; + register REAL nw = -pw; + register unsigned int bits = 0; + + if( pw == 0.0 ) return mask; + + if( pw > 0.0 ) { + switch( nc ) { + case 3: + if( p[2] <= pw ) bits |= (1<<5); + if( p[2] >= nw ) bits |= (1<<4); + if( p[1] <= pw ) bits |= (1<<3); + if( p[1] >= nw ) bits |= (1<<2); + if( p[0] <= pw ) bits |= (1<<1); + if( p[0] >= nw ) bits |= (1<<0); + return bits; + case 2: + if( p[1] <= pw ) bits |= (1<<3); + if( p[1] >= nw ) bits |= (1<<2); + if( p[0] <= pw ) bits |= (1<<1); + if( p[0] >= nw ) bits |= (1<<0); + return bits; + case 1: + if( p[0] <= pw ) bits |= (1<<1); + if( p[0] >= nw ) bits |= (1<<0); + return bits; + default: { + int bit = 1; + for( int i=0; i= nw ) bits |= bit; + bit <<= 1; + if( p[i] <= pw ) bits |= bit; + bit <<= 1; + } + abort(); + break; + } + } + } else { + switch( nc ) { + case 3: + if( p[2] <= nw ) bits |= (1<<5); + if( p[2] >= pw ) bits |= (1<<4); + if( p[1] <= nw ) bits |= (1<<3); + if( p[1] >= pw ) bits |= (1<<2); + if( p[0] <= nw ) bits |= (1<<1); + if( p[0] >= pw ) bits |= (1<<0); + return bits; + case 2: + if( p[1] <= nw ) bits |= (1<<3); + if( p[1] >= pw ) bits |= (1<<2); + if( p[0] <= nw ) bits |= (1<<1); + if( p[0] >= pw ) bits |= (1<<0); + return bits; + case 1: + if( p[0] <= nw ) bits |= (1<<1); + if( p[0] >= pw ) bits |= (1<<0); + return bits; + default: { + int bit = 1; + for( int i=0; i= pw ) bits |= bit; + bit <<= 1; + if( p[i] <= nw ) bits |= bit; + bit <<= 1; + } + abort(); + break; + } + } + } + return bits; +} + +/*-------------------------------------------------------------------------- + * xformRational - transform a homogeneous point + *-------------------------------------------------------------------------- + */ +void +Mapdesc::xformRational( Maxmatrix mat, REAL *d, REAL *s ) +{ + assert( hcoords >= 0 ); + + if( hcoords == 3 ) { + REAL x = s[0]; + REAL y = s[1]; + REAL z = s[2]; + d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]; + d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]; + d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]; + } else if( hcoords == 4 ) { + REAL x = s[0]; + REAL y = s[1]; + REAL z = s[2]; + REAL w = s[3]; + d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+w*mat[3][0]; + d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+w*mat[3][1]; + d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+w*mat[3][2]; + d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+w*mat[3][3]; + } else { + for( int i=0; i != hcoords; i++ ) { + d[i] = 0; + for( int j = 0; j != hcoords; j++ ) + d[i] += s[j] * mat[j][i]; + } + } +} + +/*-------------------------------------------------------------------------- + * xformNonrational - transform a inhomogeneous point to a homogeneous point + *-------------------------------------------------------------------------- + */ +void +Mapdesc::xformNonrational( Maxmatrix mat, REAL *d, REAL *s ) +{ + if( inhcoords == 2 ) { + REAL x = s[0]; + REAL y = s[1]; + d[0] = x*mat[0][0]+y*mat[1][0]+mat[2][0]; + d[1] = x*mat[0][1]+y*mat[1][1]+mat[2][1]; + d[2] = x*mat[0][2]+y*mat[1][2]+mat[2][2]; + } else if( inhcoords == 3 ) { + REAL x = s[0]; + REAL y = s[1]; + REAL z = s[2]; + d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+mat[3][0]; + d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+mat[3][1]; + d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+mat[3][2]; + d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+mat[3][3]; + } else { + assert( inhcoords >= 0 ); + for( int i=0; i != hcoords; i++ ) { + d[i] = mat[inhcoords][i]; + for( int j = 0; j < inhcoords; j++ ) + d[i] += s[j] * mat[j][i]; + } + } +} + +/*-------------------------------------------------------------------------- + * xformAndCullCheck - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description and + * check if they are either completely inside, completely outside, + * or intersecting the viewing frustrum. + *-------------------------------------------------------------------------- + */ +int +Mapdesc::xformAndCullCheck( + REAL *pts, int uorder, int ustride, int vorder, int vstride ) +{ + assert( uorder > 0 ); + assert( vorder > 0 ); + + unsigned int inbits = mask; + unsigned int outbits = 0; + + REAL *p = pts; + for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) { + REAL *q = p; + for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) { + REAL cpts[MAXCOORDS]; + xformCulling( cpts, q ); + unsigned int bits = clipbits( cpts ); + outbits |= bits; + inbits &= bits; + if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; + } + } + + if( outbits != (unsigned int)mask ) { + return CULL_TRIVIAL_REJECT; + } else if( inbits == (unsigned int)mask ) { + return CULL_TRIVIAL_ACCEPT; + } else { + return CULL_ACCEPT; + } +} + +/*-------------------------------------------------------------------------- + * cullCheck - check if a set of homogeneous transformed points are + * either completely inside, completely outside, + * or intersecting the viewing frustrum. + *-------------------------------------------------------------------------- + */ +int +Mapdesc::cullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride ) +{ + unsigned int inbits = mask; + unsigned int outbits = 0; + + REAL *p = pts; + for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) { + REAL *q = p; + for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) { + unsigned int bits = clipbits( q ); + outbits |= bits; + inbits &= bits; + if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; + } + } + + if( outbits != (unsigned int)mask ) { + return CULL_TRIVIAL_REJECT; + } else if( inbits == (unsigned int)mask ) { + return CULL_TRIVIAL_ACCEPT; + } else { + return CULL_ACCEPT; + } +} + +/*-------------------------------------------------------------------------- + * cullCheck - check if a set of homogeneous transformed points are + * either completely inside, completely outside, + * or intersecting the viewing frustrum. + *-------------------------------------------------------------------------- + */ +int +Mapdesc::cullCheck( REAL *pts, int order, int stride ) +{ + unsigned int inbits = mask; + unsigned int outbits = 0; + + REAL *p = pts; + for( REAL *pend = p + order * stride; p != pend; p += stride ) { + unsigned int bits = clipbits( p ); + outbits |= bits; + inbits &= bits; + if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; + } + + if( outbits != (unsigned int)mask ) { + return CULL_TRIVIAL_REJECT; + } else if( inbits == (unsigned int)mask ) { + return CULL_TRIVIAL_ACCEPT; + } else { + return CULL_ACCEPT; + } +} + +/*-------------------------------------------------------------------------- + * xformSampling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into sampling space + *-------------------------------------------------------------------------- + */ +void +Mapdesc::xformSampling( REAL *pts, int order, int stride, REAL *sp, int outstride ) +{ + xformMat( smat, pts, order, stride, sp, outstride ); +} + +void +Mapdesc::xformBounding( REAL *pts, int order, int stride, REAL *sp, int outstride ) +{ + xformMat( bmat, pts, order, stride, sp, outstride ); +} + +/*-------------------------------------------------------------------------- + * xformCulling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into culling space + *-------------------------------------------------------------------------- + */ +void +Mapdesc::xformCulling( REAL *pts, int order, int stride, REAL *cp, int outstride ) +{ + xformMat( cmat, pts, order, stride, cp, outstride ); +} + +/*-------------------------------------------------------------------------- + * xformCulling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into culling space + *-------------------------------------------------------------------------- + */ +void +Mapdesc::xformCulling( REAL *pts, + int uorder, int ustride, + int vorder, int vstride, + REAL *cp, int outustride, int outvstride ) +{ + xformMat( cmat, pts, uorder, ustride, vorder, vstride, cp, outustride, outvstride ); +} + +/*-------------------------------------------------------------------------- + * xformSampling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into sampling space + *-------------------------------------------------------------------------- + */ +void +Mapdesc::xformSampling( REAL *pts, + int uorder, int ustride, + int vorder, int vstride, + REAL *sp, int outustride, int outvstride ) +{ + xformMat( smat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride ); +} + +void +Mapdesc::xformBounding( REAL *pts, + int uorder, int ustride, + int vorder, int vstride, + REAL *sp, int outustride, int outvstride ) +{ + xformMat( bmat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride ); +} + +void +Mapdesc::xformMat( + Maxmatrix mat, + REAL * pts, + int order, + int stride, + REAL * cp, + int outstride ) +{ + if( isrational ) { + REAL *pend = pts + order * stride; + for( REAL *p = pts ; p != pend; p += stride ) { + xformRational( mat, cp, p ); + cp += outstride; + } + } else { + REAL *pend = pts + order * stride; + for( REAL *p = pts ; p != pend; p += stride ) { + xformNonrational( mat, cp, p ); + cp += outstride; + } + } +} + +void +Mapdesc::xformMat( Maxmatrix mat, REAL *pts, + int uorder, int ustride, + int vorder, int vstride, + REAL *cp, int outustride, int outvstride ) +{ + if( isrational ) { + REAL *pend = pts + uorder * ustride; + for( REAL *p = pts ; p != pend; p += ustride ) { + REAL *cpts2 = cp; + REAL *qend = p + vorder * vstride; + for( REAL *q = p; q != qend; q += vstride ) { + xformRational( mat, cpts2, q ); + cpts2 += outvstride; + } + cp += outustride; + } + } else { + REAL *pend = pts + uorder * ustride; + for( REAL *p = pts ; p != pend; p += ustride ) { + REAL *cpts2 = cp; + REAL *qend = p + vorder * vstride; + for( REAL *q = p; q != qend; q += vstride ) { + xformNonrational( mat, cpts2, q ); + cpts2 += outvstride; + } + cp += outustride; + } + } +} + +/*-------------------------------------------------------------------------- + * subdivide - subdivide a curve along an isoparametric line + *-------------------------------------------------------------------------- + */ + +void +Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, int stride, int order ) +{ + REAL mv = 1.0 - v; + + for( REAL *send=src+stride*order; src!=send; send-=stride, dst+=stride ) { + copyPt( dst, src ); + REAL *qpnt = src + stride; + for( REAL *qp=src; qpnt!=send; qp=qpnt, qpnt+=stride ) + sumPt( qp, qp, qpnt, mv, v ); + } +} + +/*-------------------------------------------------------------------------- + * subdivide - subdivide a patch along an isoparametric line + *-------------------------------------------------------------------------- + */ + +void +Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, + int so, int ss, int to, int ts ) +{ + REAL mv = 1.0 - v; + + for( REAL *slast = src+ss*so; src != slast; src += ss, dst += ss ) { + REAL *sp = src; + REAL *dp = dst; + for( REAL *send = src+ts*to; sp != send; send -= ts, dp += ts ) { + copyPt( dp, sp ); + REAL *qp = sp; + for( REAL *qpnt = sp+ts; qpnt != send; qp = qpnt, qpnt += ts ) + sumPt( qp, qp, qpnt, mv, v ); + } + } +} + + +#define sign(x) ((x > 0) ? 1 : ((x < 0.0) ? -1 : 0)) + +/*-------------------------------------------------------------------------- + * project - project a set of homogeneous coordinates into inhomogeneous ones + *-------------------------------------------------------------------------- + */ +int +Mapdesc::project( REAL *src, int rstride, int cstride, + REAL *dest, int trstride, int tcstride, + int nrows, int ncols ) +{ + int s = sign( src[inhcoords] ); + REAL *rlast = src + nrows * rstride; + REAL *trptr = dest; + for( REAL *rptr=src; rptr != rlast; rptr+=rstride, trptr+=trstride ) { + REAL *clast = rptr + ncols * cstride; + REAL *tcptr = trptr; + for( REAL *cptr = rptr; cptr != clast; cptr+=cstride, tcptr+=tcstride ) { + REAL *coordlast = cptr + inhcoords; + if( sign( *coordlast ) != s ) return 0; + REAL *tcoord = tcptr; + for( REAL *coord = cptr; coord != coordlast; coord++, tcoord++ ) { + *tcoord = *coord / *coordlast; + } + } + } + return 1; +} + +/*-------------------------------------------------------------------------- + * project - project a set of homogeneous coordinates into inhomogeneous ones + *-------------------------------------------------------------------------- + */ +int +Mapdesc::project( REAL *src, int stride, REAL *dest, int tstride, int ncols ) +{ + int s = sign( src[inhcoords] ); + + REAL *clast = src + ncols * stride; + for( REAL *cptr = src, *tcptr = dest; cptr != clast; cptr+=stride, tcptr+=tstride ) { + REAL *coordlast = cptr + inhcoords; + if( sign( *coordlast ) != s ) return 0; + for( REAL *coord = cptr, *tcoord = tcptr; coord != coordlast; coord++, tcoord++ ) + *tcoord = *coord / *coordlast; + } + + return 1; +} + +int +Mapdesc::bboxTooBig( + REAL *p, + int rstride, + int cstride, + int nrows, + int ncols, + REAL bb[2][MAXCOORDS] ) +{ + REAL bbpts[MAXORDER][MAXORDER][MAXCOORDS]; + const int trstride = sizeof(bbpts[0]) / sizeof(REAL); + const int tcstride = sizeof(bbpts[0][0]) / sizeof(REAL); + + // points have been transformed, therefore they are homogeneous + // project points + int val = project( p, rstride, cstride, + &bbpts[0][0][0], trstride, tcstride, nrows, ncols ); + if( val == 0 ) return -1; + + // compute bounding box + bbox( bb, &bbpts[0][0][0], trstride, tcstride, nrows, ncols ); + + // find out if bounding box can't fit in unit cube + if( bbox_subdividing == N_BBOXROUND ) { + for( int k=0; k != inhcoords; k++ ) + if( ceilf(bb[1][k]) - floorf(bb[0][k]) > bboxsize[k] ) return 1; + } else { + for( int k=0; k != inhcoords; k++ ) + if( bb[1][k] - bb[0][k] > bboxsize[k] ) return 1; + } + return 0; +} + +void +Mapdesc::bbox( + REAL bb[2][MAXCOORDS], + REAL *p, + int rstride, + int cstride, + int nrows, + int ncols ) +{ + int k; + for( k=0; k != inhcoords; k++ ) + bb[0][k] = bb[1][k] = p[k]; + + for( int i=0; i != nrows; i++ ) + for( int j=0; j != ncols; j++ ) + for( k=0; k != inhcoords; k++ ) { + REAL x = p[i*rstride + j*cstride + k]; + if( x < bb[0][k] ) bb[0][k] = x; + else if( x > bb[1][k] ) bb[1][k] = x; + } +} + +/*-------------------------------------------------------------------------- + * calcVelocityRational - calculate upper bound on first partial derivative + * of a homogeneous set of points and bounds on each row of points. + *-------------------------------------------------------------------------- + */ +REAL +Mapdesc::calcVelocityRational( REAL *p, int stride, int ncols ) +{ + REAL tmp[MAXORDER][MAXCOORDS]; + + assert( ncols <= MAXORDER ); + + const int tstride = sizeof(tmp[0]) / sizeof(REAL); + + if( project( p, stride, &tmp[0][0], tstride, ncols ) ) { + return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 ); + } else { /* XXX */ + return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 ); + } +} + +/*-------------------------------------------------------------------------- + * calcVelocityNonrational - calculate upper bound on first partial + * derivative of a inhomogeneous set of points. + *-------------------------------------------------------------------------- + */ +REAL +Mapdesc::calcVelocityNonrational( REAL *pts, int stride, int ncols ) +{ + return calcPartialVelocity( pts, stride, ncols, 1, 1.0 ); +} + +int +Mapdesc::isProperty( long property ) +{ + switch ( property ) { + case N_PIXEL_TOLERANCE: + case N_ERROR_TOLERANCE: + case N_CULLING: + case N_BBOX_SUBDIVIDING: + case N_S_STEPS: + case N_T_STEPS: + case N_SAMPLINGMETHOD: + case N_CLAMPFACTOR: + case N_MINSAVINGS: + return 1; + default: + return 0; + } +} + +REAL +Mapdesc::getProperty( long property ) +{ + switch ( property ) { + case N_PIXEL_TOLERANCE: + return pixel_tolerance; + case N_ERROR_TOLERANCE: + return error_tolerance; + case N_CULLING: + return culling_method; + case N_BBOX_SUBDIVIDING: + return bbox_subdividing; + case N_S_STEPS: + return s_steps; + case N_T_STEPS: + return t_steps; + case N_SAMPLINGMETHOD: + return sampling_method; + case N_CLAMPFACTOR: + return clampfactor; + case N_MINSAVINGS: + return minsavings; + default: + abort(); + return -1; //not necessary, needed to shut up compiler + } +} + +void +Mapdesc::setProperty( long property, REAL value ) +{ + + switch ( property ) { + case N_PIXEL_TOLERANCE: + pixel_tolerance = value; + break; + case N_ERROR_TOLERANCE: + error_tolerance = value; + break; + case N_CULLING: + culling_method = value; + break; + case N_BBOX_SUBDIVIDING: + if( value <= 0.0 ) value = N_NOBBOXSUBDIVISION; + bbox_subdividing = value; + break; + case N_S_STEPS: + if( value < 0.0 ) value = 0.0; + s_steps = value; + maxrate = ( value < 0.0 ) ? 0.0 : value; + maxsrate = ( value < 0.0 ) ? 0.0 : value; + break; + case N_T_STEPS: + if( value < 0.0 ) value = 0.0; + t_steps = value; + maxtrate = ( value < 0.0 ) ? 0.0 : value; + break; + case N_SAMPLINGMETHOD: + sampling_method = value; + break; + case N_CLAMPFACTOR: + if( value <= 0.0 ) value = N_NOCLAMPING; + clampfactor = value; + break; + case N_MINSAVINGS: + if( value <= 0.0 ) value = N_NOSAVINGSSUBDIVISION; + minsavings = value; + break; + default: + abort(); + break; + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdesc.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdesc.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdesc.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdesc.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,271 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mapdesc.h + * + */ + +#ifndef __glumapdesc_h_ +#define __glumapdesc_h_ + +#include "mystdio.h" +#include "types.h" +#include "defines.h" +#include "bufpool.h" +#include "nurbsconsts.h" + +typedef REAL Maxmatrix[MAXCOORDS][MAXCOORDS]; + +class Backend; + +class Mapdesc : public PooledObj { + friend class Maplist; + +public: + Mapdesc( long, int, int, Backend & ); + int isProperty( long ); + REAL getProperty( long ); + void setProperty( long, REAL ); + int isConstantSampling( void ); + int isDomainSampling( void ); + int isRangeSampling( void ); + int isSampling( void ); + int isParametricDistanceSampling( void ); + int isObjectSpaceParaSampling( void ); + int isObjectSpacePathSampling( void ); + int isSurfaceAreaSampling( void ); + int isPathLengthSampling( void ); + int isCulling( void ); + int isBboxSubdividing( void ); + long getType( void ); + + /* curve routines */ + void subdivide( REAL *, REAL *, REAL, int, int ); + int cullCheck( REAL *, int, int ); + void xformBounding( REAL *, int, int, REAL *, int ); + void xformCulling( REAL *, int, int, REAL *, int ); + void xformSampling( REAL *, int, int, REAL *, int ); + void xformMat( Maxmatrix, REAL *, int, int, REAL *, int ); + REAL calcPartialVelocity ( REAL *, int, int, int, REAL ); + int project( REAL *, int, REAL *, int, int ); + REAL calcVelocityRational( REAL *, int, int ); + REAL calcVelocityNonrational( REAL *, int, int ); + + /* surface routines */ + void subdivide( REAL *, REAL *, REAL, int, int, int, int ); + int cullCheck( REAL *, int, int, int, int ); + void xformBounding( REAL *, int, int, int, int, REAL *, int, int ); + void xformCulling( REAL *, int, int, int, int, REAL *, int, int ); + void xformSampling( REAL *, int, int, int, int, REAL *, int, int ); + void xformMat( Maxmatrix, REAL *, int, int, int, int, REAL *, int, int ); + REAL calcPartialVelocity ( REAL *, REAL *, int, int, int, int, int, int, REAL, REAL, int ); + int project( REAL *, int, int, REAL *, int, int, int, int); + void surfbbox( REAL bb[2][MAXCOORDS] ); + + int bboxTooBig( REAL *, int, int, int, int, REAL [2][MAXCOORDS] ); + int xformAndCullCheck( REAL *, int, int, int, int ); + + void identify( REAL[MAXCOORDS][MAXCOORDS] ); + void setBboxsize( INREAL *); + inline void setBmat( INREAL*, long, long ); + inline void setCmat( INREAL*, long, long ); + inline void setSmat( INREAL*, long, long ); + inline int isRational( void ); + inline int getNcoords( void ); + + REAL pixel_tolerance; /* pathlength sampling tolerance */ + REAL error_tolerance; /* parametric error sampling tolerance*/ + REAL object_space_error_tolerance; /* object space tess*/ + REAL clampfactor; + REAL minsavings; + REAL maxrate; + REAL maxsrate; + REAL maxtrate; + REAL bboxsize[MAXCOORDS]; + +private: + long type; + int isrational; + int ncoords; + int hcoords; + int inhcoords; + int mask; + Maxmatrix bmat; + Maxmatrix cmat; + Maxmatrix smat; + REAL s_steps; /* max samples in s direction */ + REAL t_steps; /* max samples in t direction */ + REAL sampling_method; + REAL culling_method; /* check for culling */ + REAL bbox_subdividing; + Mapdesc * next; + Backend & backend; + + void bbox( REAL [2][MAXCOORDS], REAL *, int, int, int, int ); + REAL maxDifference( int, REAL *, int ); + static void copy( Maxmatrix, long, INREAL *, long, long ); + + /* individual control point routines */ + static void transform4d( float[4], float[4], float[4][4] ); + static void multmatrix4d ( float[4][4], const float[4][4], + const float[4][4] ); + void copyPt( REAL *, REAL * ); + void sumPt( REAL *, REAL *, REAL *, REAL, REAL ); + void xformSampling( REAL *, REAL * ); + void xformCulling( REAL *, REAL * ); + void xformRational( Maxmatrix, REAL *, REAL * ); + void xformNonrational( Maxmatrix, REAL *, REAL * ); + unsigned int clipbits( REAL * ); +}; + +inline void +Mapdesc::setBmat( INREAL *mat, long rstride, long cstride ) +{ + copy( bmat, hcoords, mat, rstride, cstride ); +} + +inline void +Mapdesc::setCmat( INREAL *mat, long rstride, long cstride ) +{ + copy( cmat, hcoords, mat, rstride, cstride ); +} + +inline void +Mapdesc::setSmat( INREAL *mat, long rstride, long cstride ) +{ + copy( smat, hcoords, mat, rstride, cstride ); +} + +inline long +Mapdesc::getType( void ) +{ + return type; +} + +inline void +Mapdesc::xformCulling( REAL *d, REAL *s ) +{ + if( isrational ) + xformRational( cmat, d, s ); + else + xformNonrational( cmat, d, s ); +} + +inline void +Mapdesc::xformSampling( REAL *d, REAL *s ) +{ + if( isrational ) + xformRational( smat, d, s ); + else + xformNonrational( smat, d, s ); +} + +inline int +Mapdesc::isRational( void ) +{ + return isrational ? 1 : 0; +} + +inline int +Mapdesc::getNcoords( void ) +{ + return ncoords; +} + +inline int +Mapdesc::isConstantSampling( void ) +{ + return ((sampling_method == N_FIXEDRATE) ? 1 : 0); +} + +inline int +Mapdesc::isDomainSampling( void ) +{ + return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0); +} + +inline int +Mapdesc::isParametricDistanceSampling( void ) +{ + return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0); +} + +inline int +Mapdesc::isObjectSpaceParaSampling( void ) +{ + return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0); +} + +inline int +Mapdesc::isObjectSpacePathSampling( void ) +{ + return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0); +} + +inline int +Mapdesc::isSurfaceAreaSampling( void ) +{ + return ((sampling_method == N_SURFACEAREA) ? 1 : 0); +} + +inline int +Mapdesc::isPathLengthSampling( void ) +{ + return ((sampling_method == N_PATHLENGTH) ? 1 : 0); +} + +inline int +Mapdesc::isRangeSampling( void ) +{ + return ( isParametricDistanceSampling() || isPathLengthSampling() || + isSurfaceAreaSampling() || + isObjectSpaceParaSampling() || + isObjectSpacePathSampling()); +} + +inline int +Mapdesc::isSampling( void ) +{ + return isRangeSampling() || isConstantSampling() || isDomainSampling(); +} + +inline int +Mapdesc::isCulling( void ) +{ + return ((culling_method != N_NOCULLING) ? 1 : 0); +} + +inline int +Mapdesc::isBboxSubdividing( void ) +{ + return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0); +} +#endif /* __glumapdesc_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdescv.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdescv.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdescv.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mapdescv.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,243 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * mapdescv.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "mystring.h" +#include "mymath.h" +#include "nurbsconsts.h" +#include "mapdesc.h" + +/*-------------------------------------------------------------------------- + * calcPartialVelocity - calculate maximum magnitude of a given partial + * derivative + *-------------------------------------------------------------------------- + */ +REAL +Mapdesc::calcPartialVelocity ( + REAL *p, + int stride, + int ncols, + int partial, + REAL range ) +{ + REAL tmp[MAXORDER][MAXCOORDS]; + REAL mag[MAXORDER]; + + assert( ncols <= MAXORDER ); + + int j, k, t; + // copy inhomogeneous control points into temporary array + for( j=0; j != ncols; j++ ) + for( k=0; k != inhcoords; k++ ) + tmp[j][k] = p[j*stride + k]; + + for( t=0; t != partial; t++ ) + for( j=0; j != ncols-t-1; j++ ) + for( k=0; k != inhcoords; k++ ) + tmp[j][k] = tmp[j+1][k] - tmp[j][k]; + + // compute magnitude and store in mag array + for( j=0; j != ncols-partial; j++ ) { + mag[j] = 0.0; + for( k=0; k != inhcoords; k++ ) + mag[j] += tmp[j][k] * tmp[j][k]; + } + + // compute scale factor + REAL fac = 1; + REAL invt = 1.0 / range; + for( t = ncols-1; t != ncols-1-partial; t-- ) + fac *= t * invt; + + // compute max magnitude of all entries in array + REAL max = 0.0; + for( j=0; j != ncols-partial; j++ ) + if( mag[j] > max ) max = mag[j]; + max = fac * sqrtf( (float) max ); + + return max; +} + +/*-------------------------------------------------------------------------- + * calcPartialVelocity - calculate maximum magnitude of a given partial + * derivative + *-------------------------------------------------------------------------- + */ +REAL +Mapdesc::calcPartialVelocity ( + REAL *dist, + REAL *p, + int rstride, + int cstride, + int nrows, + int ncols, + int spartial, + int tpartial, + REAL srange, + REAL trange, + int side ) +{ + REAL tmp[MAXORDER][MAXORDER][MAXCOORDS]; + REAL mag[MAXORDER][MAXORDER]; + + assert( nrows <= MAXORDER ); + assert( ncols <= MAXORDER ); + + REAL *tp = &tmp[0][0][0]; + REAL *mp = &mag[0][0]; + const int istride = sizeof( tmp[0]) / sizeof( tmp[0][0][0] ); + const int jstride = sizeof( tmp[0][0]) / sizeof( tmp[0][0][0] ); + /* + const int kstride = sizeof( tmp[0][0][0]) / sizeof( tmp[0][0][0] ); + */ + const int mistride = sizeof( mag[0]) / sizeof( mag[0][0] ); + const int mjstride = sizeof( mag[0][0]) / sizeof( mag[0][0] ); + const int idist = nrows * istride; + const int jdist = ncols * jstride; + /* + const int kdist = inhcoords * kstride; + */ + const int id = idist - spartial * istride; + const int jd = jdist - tpartial * jstride; + + { + // copy control points + REAL *ti = tp; + REAL *qi = p; + REAL *til = tp + idist; + for( ; ti != til; ) { + REAL *tj = ti; + REAL *qj = qi; + REAL *tjl = ti + jdist; + for( ; tj != tjl; ) { + for( int k=0; k != inhcoords; k++ ) { + tj[k] = qj[k]; + } + tj += jstride; + qj += cstride; + } + ti += istride; + qi += rstride; + } + } + + { + // compute (s)-partial derivative control points + REAL *til = tp + idist - istride; + const REAL *till = til - ( spartial * istride ); + for( ; til != till; til -= istride ) + for( REAL *ti = tp; ti != til; ti += istride ) + for( REAL *tj = ti, *tjl = tj + jdist; tj != tjl; tj += jstride ) + for( int k=0; k != inhcoords; k++ ) + tj[k] = tj[k+istride] - tj[k]; + } + + { + // compute (s,t)-partial derivative control points + REAL *tjl = tp + jdist - jstride; + const REAL *tjll = tjl - ( tpartial * jstride ); + for( ; tjl != tjll; tjl -= jstride ) + for( REAL *tj = tp; tj != tjl; tj += jstride ) + for( REAL *ti = tj, *til = ti + id; ti != til; ti += istride ) + for( int k=0; k != inhcoords; k++ ) + ti[k] = ti[k+jstride] - ti[k]; + + } + + REAL max = 0.0; + { + // compute magnitude and store in mag array + memset( (void *) mp, 0, sizeof( mag ) ); + for( REAL *ti = tp, *mi = mp, *til = tp + id; ti != til; ti += istride, mi += mistride ) + for( REAL *tj = ti, *mj = mi, *tjl = ti + jd; tj != tjl; tj += jstride, mj += mjstride ) { + for( int k=0; k != inhcoords; k++ ) + *mj += tj[k] * tj[k]; + if( *mj > max ) max = *mj; + } + + } + + int i, j; + + // compute scale factor + REAL fac = 1.0; + { + REAL invs = 1.0 / srange; + REAL invt = 1.0 / trange; + for( int s = nrows-1, slast = s-spartial; s != slast; s-- ) + fac *= s * invs; + for( int t = ncols-1, tlast = t-tpartial; t != tlast; t-- ) + fac *= t * invt; + } + + if( side == 0 ) { + // compute max magnitude of first and last column + dist[0] = 0.0; + dist[1] = 0.0; + for( i=0; i != nrows-spartial; i++ ) { + j = 0; + if( mag[i][j] > dist[0] ) dist[0] = mag[i][j]; + + j = ncols-tpartial-1; + if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; + } + dist[0] = fac * sqrtf( dist[0] ); + dist[1] = fac * sqrtf( dist[1] ); + } else if( side == 1 ) { + // compute max magnitude of first and last row + dist[0] = 0.0; + dist[1] = 0.0; + for( j=0; j != ncols-tpartial; j++ ) { + i = 0; + if( mag[i][j] > dist[0] ) dist[0] = mag[i][j]; + + i = nrows-spartial-1; + if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; + } + dist[0] = fac * sqrtf( dist[0] ); + dist[1] = fac * sqrtf( dist[1] ); + } + + max = fac * sqrtf( (float) max ); + + return max; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,117 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * maplist.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "mymath.h" +#include "nurbsconsts.h" +#include "maplist.h" +#include "mapdesc.h" +#include "backend.h" + +Maplist::Maplist( Backend& b ) + : mapdescPool( sizeof( Mapdesc ), 10, "mapdesc pool" ), + backend( b ) +{ + maps = 0; lastmap = &maps; +} + +void +Maplist::initialize( void ) +{ + freeMaps(); + define( N_P2D, 0, 2 ); + define( N_P2DR, 1, 3 ); +} + +void +Maplist::add( long type, int israt, int ncoords ) +{ + *lastmap = new(mapdescPool) Mapdesc( type, israt, ncoords, backend ); + lastmap = &((*lastmap)->next); +} + +void +Maplist::define( long type, int israt, int ncoords ) +{ +#ifndef NDEBUG // to avoid warning + Mapdesc *m = locate( type ); + assert( m == NULL || ( m->isrational == israt && m->ncoords == ncoords ) ); +#endif + add( type, israt, ncoords ); +} + +void +Maplist::remove( Mapdesc *m ) +{ + for( Mapdesc **curmap = &maps; *curmap; curmap = &((*curmap)->next) ) { + if( *curmap == m ) { + *curmap = m->next; + m->deleteMe( mapdescPool ); + return; + } + } + abort(); +} + +void +Maplist::freeMaps( void ) +{ + mapdescPool.clear(); + maps = 0; + lastmap = &maps; +} + +Mapdesc * +Maplist::find( long type ) +{ + Mapdesc *val = locate( type ); + assert( val != 0 ); + return val; +} + +Mapdesc * +Maplist::locate( long type ) +{ + Mapdesc *m; + for( m = maps; m; m = m->next ) + if( m->getType() == type ) break; + return m; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/maplist.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,81 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * maplist.h + * + */ + +#ifndef __glumaplist_h_ +#define __glumaplist_h_ + +#include "types.h" +#include "defines.h" +#include "bufpool.h" + +class Backend; +class Mapdesc; + +class Maplist { +public: + Maplist( Backend & ); + void define( long, int, int ); + inline void undefine( long ); + inline int isMap( long ); + + void initialize( void ); + Mapdesc * find( long ); + Mapdesc * locate( long ); + +private: + Pool mapdescPool; + Mapdesc * maps; + Mapdesc ** lastmap; + Backend & backend; + + void add( long, int, int ); + void remove( Mapdesc * ); + void freeMaps( void ); +}; + +inline int +Maplist::isMap( long type ) +{ + return (locate( type ) ? 1 : 0); +} + +inline void +Maplist::undefine( long type ) +{ + Mapdesc *m = locate( type ); + assert( m != 0 ); + remove( m ); +} +#endif /* __glumaplist_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mesher.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mesher.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mesher.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mesher.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,486 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * mesher.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "gridvertex.h" +#include "gridtrimvertex.h" +#include "jarcloc.h" +#include "gridline.h" +#include "trimline.h" +#include "uarray.h" +#include "backend.h" +#include "mesher.h" + + +const float Mesher::ZERO = 0.0; + +Mesher::Mesher( Backend& b ) + : backend( b ), + p( sizeof( GridTrimVertex ), 100, "GridTrimVertexPool" ) +{ + stacksize = 0; + vdata = 0; + lastedge = 0; //needed to prevent purify UMR +} + +Mesher::~Mesher( void ) +{ + if( vdata ) delete[] vdata; +} + +void +Mesher::init( unsigned int npts ) +{ + p.clear(); + if( stacksize < npts ) { + stacksize = 2 * npts; + if( vdata ) delete[] vdata; + vdata = new GridTrimVertex_p[stacksize]; + } +} + +inline void +Mesher::push( GridTrimVertex *gt ) +{ + assert( itop+1 != (int)stacksize ); + vdata[++itop] = gt; +} + +inline void +Mesher::pop( long ) +{ +} + +inline void +Mesher::openMesh() +{ + backend.bgntmesh( "addedge" ); +} + +inline void +Mesher::closeMesh() +{ + backend.endtmesh(); +} + +inline void +Mesher::swapMesh() +{ + backend.swaptmesh(); +} + +inline void +Mesher::clearStack() +{ + itop = -1; + last[0] = 0; +} + +void +Mesher::finishLower( GridTrimVertex *gtlower ) +{ + for( push(gtlower); + nextlower( gtlower=new(p) GridTrimVertex ); + push(gtlower) ) + addLower(); + addLast(); +} + +void +Mesher::finishUpper( GridTrimVertex *gtupper ) +{ + for( push(gtupper); + nextupper( gtupper=new(p) GridTrimVertex ); + push(gtupper) ) + addUpper(); + addLast(); +} + +void +Mesher::mesh( void ) +{ + GridTrimVertex *gtlower, *gtupper; + + Hull::init( ); + nextupper( gtupper = new(p) GridTrimVertex ); + nextlower( gtlower = new(p) GridTrimVertex ); + + clearStack(); + openMesh(); + push(gtupper); + + nextupper( gtupper = new(p) GridTrimVertex ); + nextlower( gtlower ); + + assert( gtupper->t && gtlower->t ); + + if( gtupper->t->param[0] < gtlower->t->param[0] ) { + push(gtupper); + lastedge = 1; + if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) { + finishLower(gtlower); + return; + } + } else if( gtupper->t->param[0] > gtlower->t->param[0] ) { + push(gtlower); + lastedge = 0; + if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { + finishUpper(gtupper); + return; + } + } else { + if( lastedge == 0 ) { + push(gtupper); + lastedge = 1; + if( nextupper(gtupper=new(p) GridTrimVertex) == 0 ) { + finishLower(gtlower); + return; + } + } else { + push(gtlower); + lastedge = 0; + if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { + finishUpper(gtupper); + return; + } + } + } + + while ( 1 ) { + if( gtupper->t->param[0] < gtlower->t->param[0] ) { + push(gtupper); + addUpper(); + if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) { + finishLower(gtlower); + return; + } + } else if( gtupper->t->param[0] > gtlower->t->param[0] ) { + push(gtlower); + addLower(); + if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { + finishUpper(gtupper); + return; + } + } else { + if( lastedge == 0 ) { + push(gtupper); + addUpper(); + if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) { + finishLower(gtlower); + return; + } + } else { + push(gtlower); + addLower(); + if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { + finishUpper(gtupper); + return; + } + } + } + } +} + +inline int +Mesher::isCcw( int ilast ) +{ + REAL area = det3( vdata[ilast]->t, vdata[itop-1]->t, vdata[itop-2]->t ); + return (area < ZERO) ? 0 : 1; +} + +inline int +Mesher::isCw( int ilast ) +{ + REAL area = det3( vdata[ilast]->t, vdata[itop-1]->t, vdata[itop-2]->t ); + return (area > -ZERO) ? 0 : 1; +} + +inline int +Mesher::equal( int x, int y ) +{ + return( last[0] == vdata[x] && last[1] == vdata[y] ); +} + +inline void +Mesher::copy( int x, int y ) +{ + last[0] = vdata[x]; last[1] = vdata[y]; +} + +inline void +Mesher::move( int x, int y ) +{ + vdata[x] = vdata[y]; +} + +inline void +Mesher::output( int x ) +{ + backend.tmeshvert( vdata[x] ); +} + +/*--------------------------------------------------------------------------- + * addedge - addedge an edge to the triangulation + * + * This code has been re-written to generate large triangle meshes + * from a monotone polygon. Although smaller triangle meshes + * could be generated faster and with less code, larger meshes + * actually give better SYSTEM performance. This is because + * vertices are processed in the backend slower than they are + * generated by this code and any decrease in the number of vertices + * results in a decrease in the time spent in the backend. + *--------------------------------------------------------------------------- + */ + +void +Mesher::addLast( ) +{ + register int ilast = itop; + + if( lastedge == 0 ) { + if( equal( 0, 1 ) ) { + output( ilast ); + swapMesh(); + for( register int i = 2; i < ilast; i++ ) { + swapMesh(); + output( i ); + } + copy( ilast, ilast-1 ); + } else if( equal( ilast-2, ilast-1) ) { + swapMesh(); + output( ilast ); + for( register int i = ilast-3; i >= 0; i-- ) { + output( i ); + swapMesh(); + } + copy( 0, ilast ); + } else { + closeMesh(); openMesh(); + output( ilast ); + output( 0 ); + for( register int i = 1; i < ilast; i++ ) { + swapMesh(); + output( i ); + } + copy( ilast, ilast-1 ); + } + } else { + if( equal( 1, 0) ) { + swapMesh(); + output( ilast ); + for( register int i = 2; i < ilast; i++ ) { + output( i ); + swapMesh(); + } + copy( ilast-1, ilast ); + } else if( equal( ilast-1, ilast-2) ) { + output( ilast ); + swapMesh(); + for( register int i = ilast-3; i >= 0; i-- ) { + swapMesh(); + output( i ); + } + copy( ilast, 0 ); + } else { + closeMesh(); openMesh(); + output( 0 ); + output( ilast ); + for( register int i = 1; i < ilast; i++ ) { + output( i ); + swapMesh(); + } + copy( ilast-1, ilast ); + } + } + closeMesh(); + //for( register long k=0; k<=ilast; k++ ) pop( k ); +} + +void +Mesher::addUpper( ) +{ + register int ilast = itop; + + if( lastedge == 0 ) { + if( equal( 0, 1 ) ) { + output( ilast ); + swapMesh(); + for( register int i = 2; i < ilast; i++ ) { + swapMesh(); + output( i ); + } + copy( ilast, ilast-1 ); + } else if( equal( ilast-2, ilast-1) ) { + swapMesh(); + output( ilast ); + for( register int i = ilast-3; i >= 0; i-- ) { + output( i ); + swapMesh(); + } + copy( 0, ilast ); + } else { + closeMesh(); openMesh(); + output( ilast ); + output( 0 ); + for( register int i = 1; i < ilast; i++ ) { + swapMesh(); + output( i ); + } + copy( ilast, ilast-1 ); + } + lastedge = 1; + //for( register long k=0; k 1) && isCcw( ilast ) ); + + if( equal( ilast-1, ilast-2 ) ) { + output( ilast ); + swapMesh(); + for( register int i=ilast-3; i>=itop-1; i-- ) { + swapMesh(); + output( i ); + } + copy( ilast, itop-1 ); + } else if( equal( itop, itop-1 ) ) { + swapMesh(); + output( ilast ); + for( register int i = itop+1; i < ilast; i++ ) { + output( i ); + swapMesh(); + } + copy( ilast-1, ilast ); + } else { + closeMesh(); openMesh(); + output( ilast ); + output( ilast-1 ); + for( register int i=ilast-2; i>=itop-1; i-- ) { + swapMesh(); + output( i ); + } + copy( ilast, itop-1 ); + } + //for( register int k=itop; k= 0; i-- ) { + swapMesh(); + output( i ); + } + copy( ilast, 0 ); + } else { + closeMesh(); openMesh(); + output( 0 ); + output( ilast ); + for( register int i = 1; i < ilast; i++ ) { + output( i ); + swapMesh(); + } + copy( ilast-1, ilast ); + } + + lastedge = 0; + //for( register long k=0; k 1) && isCw( ilast ) ); + + if( equal( ilast-2, ilast-1) ) { + swapMesh(); + output( ilast ); + for( register int i=ilast-3; i>=itop-1; i--) { + output( i ); + swapMesh( ); + } + copy( itop-1, ilast ); + } else if( equal( itop-1, itop) ) { + output( ilast ); + swapMesh(); + for( register int i=itop+1; i=itop-1; i-- ) { + output( i ); + swapMesh( ); + } + copy( itop-1, ilast ); + } + //for( register int k=itop; kisTessellated() ) { + /* points have not been transformed, therefore they may be either + homogeneous or inhomogeneous */ + tessellate( jarc, geo_stepsize ); + if( jarc->isDisconnected() || jarc->next->isDisconnected() ) + return 1; + } + } + + for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + monotonize( jarc, bin ); + } + +#ifndef NDEBUG + for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + assert( isMonotone( jarc ) != 0 ); + } +#endif + + return 0; +} + +void +Subdivider::tessellate( Arc_ptr jarc, REAL geo_stepsize ) +{ + BezierArc *b = jarc->bezierArc; + Mapdesc *mapdesc = b->mapdesc; + + if( mapdesc->isRational() ) { + REAL max = mapdesc->calcVelocityRational( b->cpts, b->stride, b->order ); + REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; + if( jarc->bezierArc->order != 2 ) + arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 1 ); + else { + arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 1 ); + } + } else { + REAL max = mapdesc->calcVelocityNonrational( b->cpts, b->stride, b->order ); + REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; + if( jarc->bezierArc->order != 2 ) + arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 0 ); + else { + arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 0 ); + } + } +} + +/*------------------------------------------------------------------------- + * Subdivider::monotonize - break up a jordan arc into s,t-monotone + * components. This code will remove degenerate segments, including + * arcs of only a single point. + *------------------------------------------------------------------------- + */ +void +Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) +{ + TrimVertex *firstvert = jarc->pwlArc->pts; + TrimVertex *lastvert = firstvert + (jarc->pwlArc->npts - 1); + long uid = jarc->nuid; + arc_side side = jarc->getside(); + dir sdir = none; + dir tdir = none; + int degenerate = 1; + + int nudegenerate; + int change; + + TrimVertex *vert; + for( vert = firstvert; vert != lastvert; vert++ ) { + + nudegenerate = 1; + change = 0; + + /* check change relative to s axis, clear degenerate bit if needed */ + REAL sdiff = vert[1].param[0] - vert[0].param[0]; + if( sdiff == 0 ) { + if( sdir != same ) { + sdir = same; + change = 1; + } + } else if( sdiff < 0.0 ) { + if( sdir != down ) { + sdir = down; + change = 1; + } + nudegenerate = 0; + } else { + if( sdir != up ) { + sdir = up; + change = 1; + } + nudegenerate = 0; + } + + /* check change relative to t axis, clear degenerate bit if needed */ + REAL tdiff = vert[1].param[1] - vert[0].param[1]; + if( tdiff == 0 ) { + if( tdir != same ) { + tdir = same; + change = 1; + } + } else if( tdiff < 0.0 ) { + if( tdir != down ) { + tdir = down; + change = 1; + } + nudegenerate = 0; + } else { + if( tdir != up ) { + tdir = up; + change = 1; + } + nudegenerate = 0; + } + + if( change ) { + if( ! degenerate ) { + /* make last segment into separate pwl curve */ + jarc->pwlArc->npts = vert - firstvert + 1; + jarc = (new(arcpool) Arc( side, uid ))->append( jarc ); + jarc->pwlArc = new(pwlarcpool) PwlArc(); + bin.addarc( jarc ); + } + firstvert = jarc->pwlArc->pts = vert; + degenerate = nudegenerate; + } + } + jarc->pwlArc->npts = vert - firstvert + 1; + + if( degenerate ) { + /* remove jarc from circularly linked list */ + jarc->prev->next = jarc->next; + jarc->next->prev = jarc->prev; + + assert( jarc->prev->check( ) != 0 ); + assert( jarc->next->check( ) != 0 ); + + /* remove jarc from bin */ + bin.remove_this_arc( jarc ); + + jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; + jarc->deleteMe( arcpool ); + } +} + +/*------------------------------------------------------------------------- + * Subdivider::isMonotone - return true if arc is monotone AND non-degenerate + *------------------------------------------------------------------------- + */ +int +Subdivider::isMonotone( Arc_ptr jarc ) +{ + TrimVertex *firstvert = jarc->pwlArc->pts; + TrimVertex *lastvert = firstvert + (jarc->pwlArc->npts - 1); + + if( firstvert == lastvert ) return 1; + + TrimVertex *vert = firstvert; + enum dir sdir; + enum dir tdir; + + REAL diff = vert[1].param[0] - vert[0].param[0]; + if( diff == 0.0 ) + sdir = same; + else if( diff < 0.0 ) + sdir = down; + else + sdir = up; + + diff = vert[1].param[1] - vert[0].param[1]; + if( diff == 0.0 ) + tdir = same; + else if( diff < 0.0 ) + tdir = down; + else + tdir = up; + + if( (sdir == same) && (tdir == same) ) return 0; + + for( ++vert ; vert != lastvert; vert++ ) { + diff = vert[1].param[0] - vert[0].param[0]; + if( diff == 0.0 ) { + if( sdir != same ) return 0; + } else if( diff < 0.0 ) { + if( sdir != down ) return 0; + } else { + if( sdir != up ) return 0; + } + + diff = vert[1].param[1] - vert[0].param[1]; + if( diff == 0.0 ) { + if( tdir != same ) return 0; + } else if( diff < 0.0 ) { + if( tdir != down ) return 0; + } else { + if( tdir != up ) return 0; + } + } + return 1; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monotonizer.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monotonizer.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monotonizer.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monotonizer.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,64 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * monotonizer.h + * + */ + +#ifndef __glumonotonizer_h_ +#define __glumonotonizer_h_ + +#include "mysetjmp.h" +#include "types.h" + +class Arc; +class ArcTessellator; +class Pool; +class Bin; +class PwlArcPool; +class Mapdesc; + +class Monotonizer { + ArcTessellator& arctessellator; + Pool& arcpool; + Pool& pwlarcpool; + jmp_buf& nurbsJmpBuf; + + enum dir { down, same, up, none }; + void tessellate( Arc *, REAL ); + void monotonize( Arc *, Bin & ); + int isMonotone( Arc * ); +public: + Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j ) + : arctessellator(at), arcpool(ap), pwlarcpool(p), nurbsJmpBuf(j) {} + int decompose( Bin &, REAL ); +}; +#endif /* __glumonotonizer_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,397 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "monoTriangulation.h" +#include "polyUtil.h" +#include "backend.h" +#include "arc.h" + +void reflexChain::outputFan(Real v[2], Backend* backend) +{ + Int i; + /* + TrimVertex trimVert; + */ + backend->bgntfan(); + + /* + trimVert.param[0]=v[0]; + trimVert.param[1]=v[1]; + backend->tmeshvert(&trimVert); + */ + backend->tmeshvert(v[0], v[1]); + + if(isIncreasing) { + for(i=0; itmeshvert(&trimVert); + */ + backend->tmeshvert(queue[i][0], queue[i][1]); + } + } + else { + for(i=index_queue-1; i>=0; i--) + { + /* + trimVert.param[0]=queue[i][0]; + trimVert.param[1]=queue[i][1]; + backend->tmeshvert(&trimVert); + */ + backend->tmeshvert(queue[i][0], queue[i][1]); + } + } + backend->endtfan(); +} + +void reflexChain::processNewVertex(Real v[2], Backend* backend) +{ + Int i,j,k; + Int isReflex; + /*TrimVertex trimVert;*/ + /*if there are at most one vertex in the queue, then simply insert + */ + if(index_queue <=1){ + insert(v); + return; + } + + /*there are at least two vertices in the queue*/ + j=index_queue-1; + + for(i=j; i>=1; i--) { + if(isIncreasing) { + isReflex = (area(queue[i-1], queue[i], v) <= 0.0); + } + else /*decreasing*/{ + isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); + } + if(isReflex) { + break; + } + } + + /* + *if ibgntfan(); + /* + trimVert.param[0]=v[0]; + trimVert.param[1]=v[1]; + backend->tmeshvert(& trimVert); + */ + backend->tmeshvert(v[0], v[1]); + + if(isIncreasing) { + for(k=i; k<=j; k++) + { + /* + trimVert.param[0]=queue[k][0]; + trimVert.param[1]=queue[k][1]; + backend->tmeshvert(& trimVert); + */ + backend->tmeshvert(queue[k][0], queue[k][1]); + } + } + else { + for(k=j; k>=i; k--) + { + /* + trimVert.param[0]=queue[k][0]; + trimVert.param[1]=queue[k][1]; + backend->tmeshvert(& trimVert); + */ + backend->tmeshvert(queue[k][0], queue[k][1]); + } + } + + backend->endtfan(); + } + + /*delete vertices i+1--j from the queue*/ + index_queue = i+1; + /*finally insert v at the end of the queue*/ + insert(v); + +} + + +void monoTriangulationRec(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, + vertexArray* dec_chain, Int dec_current, + Backend* backend) +{ + assert( inc_chain != NULL && dec_chain != NULL); + assert( ! (inc_current>=inc_chain->getNumElements() && + dec_current>=dec_chain->getNumElements())); + Int inc_nVertices; + Int dec_nVertices; + Real** inc_array ; + Real** dec_array ; + Int i; + assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); + + if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ + { + + dec_array = dec_chain->getArray(); + dec_nVertices = dec_chain->getNumElements(); + reflexChain rChain(20,0); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, backend); + /*process all the vertices on the dec_chain*/ + for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ + { + inc_array = inc_chain->getArray(); + inc_nVertices= inc_chain->getNumElements(); + reflexChain rChain(20,1); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, backend); + /*process all the vertices on the inc_chain*/ + for(i=inc_current; i getArray(); + dec_array = dec_chain -> getArray(); + inc_nVertices= inc_chain->getNumElements(); + dec_nVertices= dec_chain->getNumElements(); + /*if top of inc_chain is 'lower' than top of dec_chain, process all the + *vertices on the dec_chain which are higher than top of inc_chain + */ + if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) + { + + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex, backend); + for(i=dec_current; i 0*/ + { + + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex, backend); + for(i=inc_current; i0) + rChain.processNewVertex(inc_array[i], backend); + else + break; + } + rChain.outputFan(dec_array[dec_current], backend); + monoTriangulationRec(inc_array[i-1], botVertex, + inc_chain, i, + dec_chain, dec_current, + backend); + } + }/*end case neither is empty*/ +} + + +void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Backend* backend) +{ + Int i; + /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain, + *then call monoTriangulationRec + */ + Arc_ptr tempV; + Arc_ptr topV; + Arc_ptr botV; + topV = botV = loop; + for(tempV = loop->next; tempV != loop; tempV = tempV->next) + { + if(compFun(topV->tail(), tempV->tail())<0) { + topV = tempV; + } + if(compFun(botV->tail(), tempV->tail())>0) { + botV = tempV; + } + } + + /*creat increase and decrease chains*/ + vertexArray inc_chain(20); /*this is a dynamic array*/ + for(i=1; i<=topV->pwlArc->npts-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ + inc_chain.appendVertex(topV->pwlArc->pts[i].param); + } + for(tempV = topV->next; tempV != botV; tempV = tempV->next) + { + for(i=0; i<=tempV->pwlArc->npts-2; i++){ + inc_chain.appendVertex(tempV->pwlArc->pts[i].param); + } + } + + vertexArray dec_chain(20); + for(tempV = topV->prev; tempV != botV; tempV = tempV->prev) + { + for(i=tempV->pwlArc->npts-2; i>=0; i--){ + dec_chain.appendVertex(tempV->pwlArc->pts[i].param); + } + } + for(i=botV->pwlArc->npts-2; i>=1; i--){ + dec_chain.appendVertex(tempV->pwlArc->pts[i].param); + } + + monoTriangulationRecFunBackend(topV->tail(), botV->tail(), &inc_chain, 0, &dec_chain, 0, compFun, backend); + +} + +/*if compFun == compV2InY, top to bottom: V-monotone + *if compFun == compV2InX, right to left: U-monotone + */ +void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, + vertexArray* dec_chain, Int dec_current, + Int (*compFun)(Real*, Real*), + Backend* backend) +{ + assert( inc_chain != NULL && dec_chain != NULL); + assert( ! (inc_current>=inc_chain->getNumElements() && + dec_current>=dec_chain->getNumElements())); + Int inc_nVertices; + Int dec_nVertices; + Real** inc_array ; + Real** dec_array ; + Int i; + assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); + + if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ + { + + dec_array = dec_chain->getArray(); + dec_nVertices = dec_chain->getNumElements(); + reflexChain rChain(20,0); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, backend); + /*process all the vertices on the dec_chain*/ + for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ + { + inc_array = inc_chain->getArray(); + inc_nVertices= inc_chain->getNumElements(); + reflexChain rChain(20,1); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, backend); + /*process all the vertices on the inc_chain*/ + for(i=inc_current; i getArray(); + dec_array = dec_chain -> getArray(); + inc_nVertices= inc_chain->getNumElements(); + dec_nVertices= dec_chain->getNumElements(); + /*if top of inc_chain is 'lower' than top of dec_chain, process all the + *vertices on the dec_chain which are higher than top of inc_chain + */ + if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) + { + + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex, backend); + for(i=dec_current; i 0*/ + { + + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex, backend); + for(i=inc_current; i0) + rChain.processNewVertex(inc_array[i], backend); + else + break; + } + rChain.outputFan(dec_array[dec_current], backend); + monoTriangulationRecFunBackend(inc_array[i-1], botVertex, + inc_chain, i, + dec_chain, dec_current, + compFun, + backend); + } + }/*end case neither is empty*/ +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/myassert.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/myassert.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/myassert.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/myassert.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,51 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * myassert.h + * + */ + +#ifndef __glumyassert_h_ +#define __glumyassert_h_ + +#ifdef STANDALONE +#define assert(EX) ((void)0) +#endif + +#ifdef LIBRARYBUILD +#include +#endif + +#ifdef GLBUILD +#define assert(EX) ((void)0) +#endif + +#endif /* __glumyassert_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mycode.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mycode.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mycode.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mycode.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,67 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "mymath.h" + +#ifdef NEEDCEILF + +float ceilf( float x ) +{ + if( x < 0 ) { + float nx = -x; + int ix = (int) nx; + return (float) -ix; + } else { + int ix = (int) x; + if( x == (float) ix ) return x; + return (float) (ix+1); + } +} + +float floorf( float x ) +{ + if( x < 0 ) { + float nx = -x; + int ix = (int) nx; + if( nx == (float) ix ) return x; + return (float) -(ix+1); + } else { + int ix = (int) x; + return (float) ix; + } +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mymath.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mymath.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mymath.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mymath.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,68 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mymath.h + * + */ + +#ifndef __glumymath_h_ +#define __glumymath_h_ + +#ifdef GLBUILD +#define sqrtf gl_fsqrt +#endif + +#if defined(GLBUILD) || defined(STANDALONE) +#define M_SQRT2 1.41421356237309504880 +#define ceilf myceilf +#define floorf myfloorf +#define sqrtf sqrt +extern "C" double sqrt(double); +extern "C" float ceilf(float); +extern "C" float floorf(float); +#define NEEDCEILF +#endif + +#ifdef LIBRARYBUILD +#include +#endif + +#if !defined sqrtf +# define sqrtf(x) ((float)sqrt(x)) +#endif +#if !defined ceilf +# define ceilf(x) ((float)ceil(x)) +#endif +#if !defined floorf +# define floorf(x) ((float)floor(x)) +#endif + +#endif /* __glumymath_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mysetjmp.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mysetjmp.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mysetjmp.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mysetjmp.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,85 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mysetjmp.h + * + */ + +#ifndef __glumysetjmp_h_ +#define __glumysetjmp_h_ + +#ifdef STANDALONE +struct JumpBuffer; +extern "C" JumpBuffer *newJumpbuffer( void ); +extern "C" void deleteJumpbuffer(JumpBuffer *); +extern "C" void mylongjmp( JumpBuffer *, int ); +extern "C" int mysetjmp( JumpBuffer * ); +#endif + +#ifdef GLBUILD +#define setjmp gl_setjmp +#define longjmp gl_longjmp +#endif + +#if defined(LIBRARYBUILD) || defined(GLBUILD) +#include +#include + +struct JumpBuffer { + jmp_buf buf; +}; + +inline JumpBuffer * +newJumpbuffer( void ) +{ + return (JumpBuffer *) malloc( sizeof( JumpBuffer ) ); +} + +inline void +deleteJumpbuffer(JumpBuffer *jb) +{ + free( (void *) jb); +} + +inline void +mylongjmp( JumpBuffer *j, int code ) +{ + ::longjmp( j->buf, code ); +} + +inline int +mysetjmp( JumpBuffer *j ) +{ + return setjmp( j->buf ); +} +#endif + +#endif /* __glumysetjmp_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mystring.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mystring.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mystring.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/mystring.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,56 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mystring.h + * + */ + +#ifndef __glumystring_h_ +#define __glumystring_h_ + +#ifdef STANDALONE +typedef unsigned int size_t; +extern "C" void * memcpy(void *, const void *, size_t); +extern "C" void * memset(void *, int, size_t); +#endif + +#ifdef GLBUILD +#define memcpy(a,b,c) bcopy(b,a,c) +#define memset(a,b,c) bzero(a,c) +extern "C" void bcopy(const void *, void *, int); +extern "C" void bzero(void *, int); +#endif + +#ifdef LIBRARYBUILD +#include +#endif + +#endif /* __glumystring_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsconsts.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsconsts.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsconsts.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsconsts.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,120 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * nurbsconsts.h + * + */ + +#ifndef __glunurbsconsts_h_ +#define __glunurbsconsts_h_ + +/* NURBS Properties - one set per map, + each takes a single INREAL arg */ +#define N_SAMPLING_TOLERANCE 1 +#define N_S_RATE 6 +#define N_T_RATE 7 +#define N_CLAMPFACTOR 13 +#define N_NOCLAMPING 0.0 +#define N_MINSAVINGS 14 +#define N_NOSAVINGSSUBDIVISION 0.0 + +/* NURBS Properties - one set per map, + each takes an enumerated value */ +#define N_CULLING 2 +#define N_NOCULLING 0.0 +#define N_CULLINGON 1.0 +#define N_SAMPLINGMETHOD 10 +#define N_NOSAMPLING 0.0 +#define N_FIXEDRATE 3.0 +#define N_DOMAINDISTANCE 2.0 +#define N_PARAMETRICDISTANCE 5.0 +#define N_PATHLENGTH 6.0 +#define N_SURFACEAREA 7.0 +#define N_OBJECTSPACE_PARA 8.0 +#define N_OBJECTSPACE_PATH 9.0 +#define N_BBOX_SUBDIVIDING 17 +#define N_NOBBOXSUBDIVISION 0.0 +#define N_BBOXTIGHT 1.0 +#define N_BBOXROUND 2.0 + +/* NURBS Rendering Properties - one set per renderer + each takes an enumerated value */ +#define N_DISPLAY 3 +#define N_FILL 1.0 +#define N_OUTLINE_POLY 2.0 +#define N_OUTLINE_TRI 3.0 +#define N_OUTLINE_QUAD 4.0 +#define N_OUTLINE_PATCH 5.0 +#define N_OUTLINE_PARAM 6.0 +#define N_OUTLINE_PARAM_S 7.0 +#define N_OUTLINE_PARAM_ST 8.0 +#define N_OUTLINE_SUBDIV 9.0 +#define N_OUTLINE_SUBDIV_S 10.0 +#define N_OUTLINE_SUBDIV_ST 11.0 +#define N_ISOLINE_S 12.0 +#define N_ERRORCHECKING 4 +#define N_NOMSG 0.0 +#define N_MSG 1.0 + +/* GL 4.0 propeties not defined above */ +#ifndef N_PIXEL_TOLERANCE +#define N_PIXEL_TOLERANCE N_SAMPLING_TOLERANCE +#define N_ERROR_TOLERANCE 20 +#define N_SUBDIVISIONS 5 +#define N_TILES 8 +#define N_TMP1 9 +#define N_TMP2 N_SAMPLINGMETHOD +#define N_TMP3 11 +#define N_TMP4 12 +#define N_TMP5 N_CLAMPFACTOR +#define N_TMP6 N_MINSAVINGS +#define N_S_STEPS N_S_RATE +#define N_T_STEPS N_T_RATE +#endif + +/* NURBS Rendering Properties - one set per map, + each takes an INREAL matrix argument */ +#define N_CULLINGMATRIX 1 +#define N_SAMPLINGMATRIX 2 +#define N_BBOXMATRIX 3 + + +/* NURBS Rendering Properties - one set per map, + each takes an INREAL vector argument */ +#define N_BBOXSIZE 4 + +/* type argument for trimming curves */ +#ifndef N_P2D +#define N_P2D 0x8 +#define N_P2DR 0xd +#endif + +#endif /* __glunurbsconsts_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,537 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * nurbsinterfac.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "nurbsconsts.h" +#include "nurbstess.h" +#include "bufpool.h" +#include "quilt.h" +#include "displaylist.h" +#include "knotvector.h" +#include "mapdesc.h" + +#define THREAD( work, arg, cleanup ) \ + if( dl ) {\ + arg->save = 1;\ + dl->append( (PFVS)&NurbsTessellator::work, (void *) arg, (PFVS)&NurbsTessellator::cleanup );\ + } else {\ + arg->save = 0;\ + work( arg );\ + } + +#define THREAD2( work ) \ + if( dl ) {\ + dl->append( (PFVS)&NurbsTessellator::work, 0, 0 );\ + } else {\ + work( );\ + } + +NurbsTessellator::NurbsTessellator( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e) + : maplist( backend ), + backend( c, e ), + subdivider( renderhints, backend ), + o_pwlcurvePool( sizeof( O_pwlcurve ), 32, "o_pwlcurvePool" ), + o_nurbscurvePool( sizeof( O_nurbscurve ), 32, "o_nurbscurvePool"), + o_curvePool( sizeof( O_curve ), 32, "o_curvePool" ), + o_trimPool( sizeof( O_trim ), 32, "o_trimPool" ), + o_surfacePool( sizeof( O_surface ), 1, "o_surfacePool" ), + o_nurbssurfacePool( sizeof( O_nurbssurface ), 4, "o_nurbssurfacePool" ), + propertyPool( sizeof( Property ), 32, "propertyPool" ), + quiltPool( sizeof( Quilt ), 32, "quiltPool" ) +{ + dl = 0; + inSurface = 0; + inCurve = 0; + inTrim = 0; + playBack = 0; + jumpbuffer = newJumpbuffer(); + subdivider.setJumpbuffer( jumpbuffer ); +} + +NurbsTessellator::~NurbsTessellator( void ) +{ + if( inTrim ) { + do_nurbserror( 12 ); + endtrim(); + } + + if( inSurface ) { + *nextNurbssurface = 0; + do_freeall(); + } + + if (jumpbuffer) { + deleteJumpbuffer(jumpbuffer); + jumpbuffer= 0; + } +} + +/*----------------------------------------------------------------------------- + * bgnsurface - allocate and initialize an o_surface structure + * + * Client: GL user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::bgnsurface( long nuid ) +{ + O_surface *o_surface = new(o_surfacePool) O_surface; + o_surface->nuid = nuid; + THREAD( do_bgnsurface, o_surface, do_freebgnsurface ); +} + +/*----------------------------------------------------------------------------- + * bgncurve - allocate an initialize an o_curve structure + * + * Client: GL user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::bgncurve( long nuid ) +{ + O_curve *o_curve = new(o_curvePool) O_curve; + o_curve->nuid = nuid; + THREAD( do_bgncurve, o_curve, do_freebgncurve ); +} +/*----------------------------------------------------------------------------- + * endcurve - + * + * Client: + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::endcurve( void ) +{ + THREAD2( do_endcurve ); +} + +/*----------------------------------------------------------------------------- + * endsurface - user level end of surface call + * + * Client: GL user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::endsurface( void ) +{ + THREAD2( do_endsurface ); +} + + +/*----------------------------------------------------------------------------- + * bgntrim - allocate and initialize a new trim loop structure (o_trim ) + * + * Client: GL user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::bgntrim( void ) +{ + O_trim *o_trim = new(o_trimPool) O_trim; + THREAD( do_bgntrim, o_trim, do_freebgntrim ); +} + +/*----------------------------------------------------------------------------- + * endtrim - + * + * Client: GL user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::endtrim( void ) +{ + THREAD2( do_endtrim ); +} + + +/*----------------------------------------------------------------------------- + * pwlcurve - + * + * count - number of points on curve + * array - array of points on curve + * byte_stride - distance between points in bytes + * type - valid data flag + * + * Client: Gl user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long type ) +{ + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) { + do_nurbserror( 35 ); + isDataValid = 0; + return; + } + + if ( (type != N_P2D) && (type != N_P2DR) ) { + do_nurbserror( 22 ); + isDataValid = 0; + return; + } + if( count < 0 ) { + do_nurbserror( 33 ); + isDataValid = 0; + return; + } + if( byte_stride < 0 ) { + do_nurbserror( 34 ); + isDataValid = 0; + return; + } + +#ifdef NOTDEF + if( mapdesc->isRational() ) { + INREAL *p = array; + INREAL x = p[0]; INREAL y = p[1]; INREAL w = p[2]; + p = (INREAL *) (((char *) p) + byte_stride); + for( long i = 1; i != count; i++ ) { + if( p[0] == x && p[1] == y && p[2] == w ) break; + x = p[0]; y = p[1]; w = p[2]; + p = (INREAL *) (((char *) p) + byte_stride); + } + if( i != count ) { + do_nurbserror( 37 ); + _glu_dprintf( "point %d (%f,%f)\n", i, x, y ); + isDataValid = 0; + return; + } + } else { + INREAL *p = array; + INREAL x = p[0]; INREAL y = p[1]; + p = (INREAL *) (((char *) p) + byte_stride); + for( long i = 1; i != count; i++ ) { + if( p[0] == x && p[1] == y ) break; + x = p[0]; y = p[1]; + p = (INREAL *) (((char *) p) + byte_stride); + } + if( i != count ) { + do_nurbserror( 37 ); + _glu_dprintf( "point %d (%f,%f)\n", i, x, y ); + isDataValid = 0; + return; + } + } +#endif + + O_pwlcurve *o_pwlcurve = new(o_pwlcurvePool) O_pwlcurve( type, count, array, byte_stride, extTrimVertexPool.get((int)count) ); + THREAD( do_pwlcurve, o_pwlcurve, do_freepwlcurve ); +} + + +/*----------------------------------------------------------------------------- + * nurbscurve - + * + * Client: GL user + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::nurbscurve( + long nknots, /* number of p knots */ + INREAL knot[], /* nondecreasing knot values in p */ + long byte_stride, /* distance in bytes between control points */ + INREAL ctlarray[], /* pointer to first control point */ + long order, /* order of spline */ + long type ) /* description of range space */ +{ + + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) { + do_nurbserror( 35 ); + isDataValid = 0; + return; + } + + if( ctlarray == 0 ) { + do_nurbserror( 36 ); + isDataValid = 0; + return; + } + + if( byte_stride < 0 ) { + do_nurbserror( 34 ); + isDataValid = 0; + return; + } + + Knotvector knots; + + knots.init( nknots, byte_stride, order, knot ); + if( do_check_knots( &knots, "curve" ) ) return; + + O_nurbscurve *o_nurbscurve = new(o_nurbscurvePool) O_nurbscurve(type); + o_nurbscurve->bezier_curves = new(quiltPool) Quilt(mapdesc); + o_nurbscurve->bezier_curves->toBezier( knots,ctlarray, mapdesc->getNcoords() ); + + THREAD( do_nurbscurve, o_nurbscurve, do_freenurbscurve ); +} + + +/*----------------------------------------------------------------------------- + * nurbssurface - + * + * Client: User routine + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::nurbssurface( + long sknot_count, /* number of s knots */ + INREAL sknot[], /* nondecreasing knot values in s */ + long tknot_count, /* number of t knots */ + INREAL tknot[], /* nondecreasing knot values in t */ + long s_byte_stride, /* s step size in memory bytes */ + long t_byte_stride, /* t step size in memory bytes */ + INREAL ctlarray[], /* pointer to first control point */ + long sorder, /* order of the spline in s parameter */ + long torder, /* order of the spline in t parameter */ + long type) /* description of range space */ +{ + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) { + do_nurbserror( 35 ); + isDataValid = 0; + return; + } + + if( s_byte_stride < 0 ) { + do_nurbserror( 34 ); + isDataValid = 0; + return; + } + + if( t_byte_stride < 0 ) { + do_nurbserror( 34 ); + isDataValid = 0; + return; + } + + Knotvector sknotvector, tknotvector; + + sknotvector.init( sknot_count, s_byte_stride, sorder, sknot ); + if( do_check_knots( &sknotvector, "surface" ) ) return; + + tknotvector.init( tknot_count, t_byte_stride, torder, tknot ); + if( do_check_knots( &tknotvector, "surface" ) ) return; + + O_nurbssurface *o_nurbssurface = new(o_nurbssurfacePool) O_nurbssurface(type); + o_nurbssurface->bezier_patches = new(quiltPool) Quilt(mapdesc); + + o_nurbssurface->bezier_patches->toBezier( sknotvector, tknotvector, + ctlarray, mapdesc->getNcoords() ); + THREAD( do_nurbssurface, o_nurbssurface, do_freenurbssurface ); +} + + +/*----------------------------------------------------------------------------- + * setnurbsproperty - + * + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::setnurbsproperty( long tag, INREAL value ) +{ + if( ! renderhints.isProperty( tag ) ) { + do_nurbserror( 26 ); + } else { + Property *prop = new(propertyPool) Property( tag, value ); + THREAD( do_setnurbsproperty, prop, do_freenurbsproperty ); + } +} + +/*----------------------------------------------------------------------------- + * setnurbsproperty - + * + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::setnurbsproperty( long type, long tag, INREAL value ) +{ + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) { + do_nurbserror( 35 ); + return; + } + + if( ! mapdesc->isProperty( tag ) ) { + do_nurbserror( 26 ); + return; + } + + Property *prop = new(propertyPool) Property( type, tag, value ); + THREAD( do_setnurbsproperty2, prop, do_freenurbsproperty ); +} + + +/*----------------------------------------------------------------------------- + * getnurbsproperty - + * + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::getnurbsproperty( long tag, INREAL *value ) +{ + if( renderhints.isProperty( tag ) ) { + *value = renderhints.getProperty( tag ); + } else { + do_nurbserror( 26 ); + } +} + +/*----------------------------------------------------------------------------- + * getnurbsproperty - + * + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::getnurbsproperty( long type, long tag, INREAL *value ) +{ + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) + do_nurbserror( 35 ); + + if( mapdesc->isProperty( tag ) ) { + *value = mapdesc->getProperty( tag ); + } else { + do_nurbserror( 26 ); + } +} + +/*-------------------------------------------------------------------------- + * setnurbsproperty - accept a user supplied matrix as culling or sampling mat + *-------------------------------------------------------------------------- + */ + +void +NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat ) +{ + // XXX - cannot be put in display list + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) { + do_nurbserror( 35 ); + isDataValid = 0; + } else if( purpose == N_BBOXSIZE ) { + mapdesc->setBboxsize( mat ); + } else { +#ifndef NDEBUG + _glu_dprintf( "ERRORRORRORR!!!\n"); +#endif + } +} + +/*-------------------------------------------------------------------------- + * setnurbsproperty - accept a user supplied matrix as culling or sampling mat + *-------------------------------------------------------------------------- + */ + +void +NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat, + long rstride, long cstride ) +{ + // XXX - cannot be put in display list + Mapdesc *mapdesc = maplist.locate( type ); + + if( mapdesc == 0 ) { + do_nurbserror( 35 ); + isDataValid = 0; + } else if( purpose == N_CULLINGMATRIX ) { + mapdesc->setCmat( mat, rstride, cstride ); + } else if( purpose == N_SAMPLINGMATRIX ) { + mapdesc->setSmat( mat, rstride, cstride ); + } else if( purpose == N_BBOXMATRIX ) { + mapdesc->setBmat( mat, rstride, cstride ); + } else { +#ifndef NDEBUG + _glu_dprintf( "ERRORRORRORR!!!\n"); +#endif + } +} + +void +NurbsTessellator::redefineMaps( void ) +{ + maplist.initialize(); +} + +void +NurbsTessellator::defineMap( long type, long rational, long ncoords ) +{ + maplist.define( type, (int) rational, (int) ncoords ); +} + +void +NurbsTessellator::discardRecording( void *_dl ) +{ + delete (DisplayList *) _dl; +} + +void * +NurbsTessellator::beginRecording( void ) +{ + dl = new DisplayList( this ); + return (void *) dl; +} + +void +NurbsTessellator::endRecording( void ) +{ + dl->endList(); + dl = 0; +} + +void +NurbsTessellator::playRecording( void *_dl ) +{ + playBack = 1; + bgnrender(); + ((DisplayList *)_dl)->play(); + endrender(); + playBack = 0; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,691 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * nurbstess.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mysetjmp.h" +#include "mystdio.h" +#include "nurbsconsts.h" +#include "nurbstess.h" +#include "bufpool.h" +#include "quilt.h" +#include "knotvector.h" +#include "mapdesc.h" +#include "maplist.h" + +void +NurbsTessellator::set_domain_distance_u_rate(REAL u_rate) +{ + subdivider.set_domain_distance_u_rate(u_rate); +} + +void +NurbsTessellator::set_domain_distance_v_rate(REAL v_rate) +{ + subdivider.set_domain_distance_v_rate(v_rate); +} + +void +NurbsTessellator::set_is_domain_distance_sampling(int flag) +{ + subdivider.set_is_domain_distance_sampling(flag); +} + +void +NurbsTessellator::resetObjects( void ) +{ + subdivider.clear(); +} + +void +NurbsTessellator::makeobj( int ) +{ +#ifndef NDEBUG + _glu_dprintf( "makeobj\n" ); +#endif +} + +void +NurbsTessellator::closeobj( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "closeobj\n" ); +#endif +} + +void +NurbsTessellator::bgnrender( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "bgnrender\n" ); +#endif +} + +void +NurbsTessellator::endrender( void ) +{ +#ifndef NDEBUG + _glu_dprintf( "endrender\n" ); +#endif +} + +/*----------------------------------------------------------------------------- + * do_freebgnsurface - free o_surface structure + * + * Client: do_freeall(), bgnsurface() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_freebgnsurface( O_surface *o_surface ) +{ + o_surface->deleteMe( o_surfacePool ); +} + + +/*----------------------------------------------------------------------------- + * do_bgnsurface - begin the display of a surface + * + * Client: bgnsurface() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_bgnsurface( O_surface *o_surface ) +{ + if( inSurface ) { + do_nurbserror( 27 ); + endsurface(); + } + inSurface = 1; + + if( ! playBack ) bgnrender(); + + isTrimModified = 0; + isSurfaceModified = 0; + isDataValid = 1; + numTrims = 0; + currentSurface = o_surface; + nextTrim = &( currentSurface->o_trim ); + nextNurbssurface = &( currentSurface->o_nurbssurface ); +} + +/*----------------------------------------------------------------------------- + * do_bgncurve - begin the display of a curve + * + * Client: bgncurve() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_bgncurve( O_curve *o_curve ) +{ + if ( inCurve ) { + do_nurbserror( 6 ); + endcurve(); + } + + inCurve = 1; + currentCurve = o_curve; + currentCurve->curvetype = ct_none; + + if( inTrim ) { + if( *nextCurve != o_curve ) { + isCurveModified = 1; + *nextCurve = o_curve; + } + } else { + if( ! playBack ) bgnrender(); + isDataValid = 1; + } + nextCurve = &(o_curve->next); + nextPwlcurve = &(o_curve->curve.o_pwlcurve); + nextNurbscurve = &(o_curve->curve.o_nurbscurve); +} + +/*----------------------------------------------------------------------------- + * do_endcurve - + * + * Client: endcurve() + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::do_endcurve( void ) +{ + if( ! inCurve ) { + do_nurbserror( 7 ); + return; + } + inCurve = 0; + + *nextCurve = 0; + if (currentCurve->curvetype == ct_nurbscurve) + *nextNurbscurve = 0; + else + *nextPwlcurve = 0; + + if ( ! inTrim ) { + if( ! isDataValid ) { + do_freecurveall( currentCurve ); + return; + } + + int errval; + errval = ::mysetjmp( jumpbuffer ); + if( errval == 0 ) { + if( currentCurve->curvetype == ct_nurbscurve ) { + subdivider.beginQuilts(); + for( O_nurbscurve *n = currentCurve->curve.o_nurbscurve; n != 0; n = n->next ) + subdivider.addQuilt( n->bezier_curves ); + subdivider.endQuilts(); + subdivider.drawCurves(); + if( ! playBack ) endrender(); + } else { + /* XXX */ + if( ! playBack ) endrender(); + /*do_draw_pwlcurve( currentCurve->curve.o_pwlcurve ) */; + do_nurbserror( 9 ); + } + } else { + if( ! playBack ) endrender(); + do_nurbserror( errval ); + } + do_freecurveall( currentCurve ); + resetObjects(); + } +} + +/*----------------------------------------------------------------------------- + * do_endsurface - mark end of surface, display surface, free immediate data + * + * Client: + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_endsurface( void ) +{ + if( inTrim ) { + do_nurbserror( 12 ); + endtrim(); + } + + if( ! inSurface ) { + do_nurbserror( 13 ); + return; + } + inSurface = 0; + + *nextNurbssurface = 0; + + if( ! isDataValid ) { + do_freeall( ); + return; + } + + if( *nextTrim != 0 ) { + isTrimModified = 1; + *nextTrim = 0; + } + + int errval; + + errval = ::mysetjmp( jumpbuffer ); + if( errval == 0 ) { + if( numTrims > 0 ) { + + subdivider.beginTrims(); + for( O_trim *trim = currentSurface->o_trim; trim; trim = trim->next ) { + subdivider.beginLoop(); + for( O_curve *curve = trim->o_curve; curve; curve = curve->next ) { + curve->used = 0; + assert( curve->curvetype != ct_none ); + if (curve->curvetype == ct_pwlcurve) { + O_pwlcurve *c = curve->curve.o_pwlcurve; + subdivider.addArc( c->npts, c->pts, curve->nuid ); + } else { + Quilt *quilt = curve->curve.o_nurbscurve->bezier_curves; + Quiltspec *qspec = quilt->qspec; + REAL *cpts = quilt->cpts + qspec->offset; + REAL *cptsend = cpts + (qspec->width * qspec->order * qspec->stride); + for( ; cpts != cptsend; cpts += qspec->order*qspec->stride ) + subdivider.addArc( cpts, quilt, curve->nuid ); + } + } + subdivider.endLoop(); + } + subdivider.endTrims(); + } + + subdivider.beginQuilts(); + for( O_nurbssurface *n = currentSurface->o_nurbssurface; n; n = n->next ) + subdivider.addQuilt( n->bezier_patches ); + subdivider.endQuilts(); + subdivider.drawSurfaces( currentSurface->nuid ); + if( ! playBack ) endrender(); + } else { + if( ! playBack ) endrender(); + do_nurbserror( errval ); + } + + do_freeall( ); + resetObjects(); +} + +/*----------------------------------------------------------------------------- + * do_freeall - free all data allocated in immediate mode + * + * Client: + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_freeall( void ) +{ + for( O_trim *o_trim = currentSurface->o_trim; o_trim; ) { + O_trim *next_o_trim = o_trim->next; + for( O_curve *curve = o_trim->o_curve; curve; ) { + O_curve *next_o_curve = curve->next; + do_freecurveall( curve ); + curve = next_o_curve; + } + if( o_trim->save == 0 ) do_freebgntrim( o_trim ); + o_trim = next_o_trim; + } + + O_nurbssurface *nurbss, *next_nurbss; + for( nurbss= currentSurface->o_nurbssurface; nurbss; nurbss = next_nurbss) { + next_nurbss = nurbss->next; + if( nurbss->save == 0 ) + do_freenurbssurface( nurbss ); + else + nurbss->used = 0; + } + + if( currentSurface->save == 0 ) do_freebgnsurface( currentSurface ); +} + +void +NurbsTessellator::do_freecurveall( O_curve *curve ) +{ + assert( curve->curvetype != ct_none ); + + if( curve->curvetype == ct_nurbscurve ) { + O_nurbscurve *ncurve, *next_ncurve; + for( ncurve=curve->curve.o_nurbscurve; ncurve; ncurve=next_ncurve ) { + next_ncurve = ncurve->next; + if( ncurve->save == 0 ) + do_freenurbscurve( ncurve ); + else + ncurve->used = 0; + } + } else { + O_pwlcurve *pcurve, *next_pcurve; + for( pcurve=curve->curve.o_pwlcurve; pcurve; pcurve=next_pcurve ) { + next_pcurve = pcurve->next; + if( pcurve->save == 0 ) + do_freepwlcurve( pcurve ); + else + pcurve->used = 0; + } + } + if( curve->save == 0 ) + do_freebgncurve( curve ); +} + + +/*----------------------------------------------------------------------------- + * do_freebgntrim - free the space allocated for a trim loop + * + * Client: + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_freebgntrim( O_trim *o_trim ) +{ + o_trim->deleteMe( o_trimPool ); +} + + +/*----------------------------------------------------------------------------- + * do_bgntrim - link in a trim loop to the current trimmed surface description + * + * Client: bgntrim() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_bgntrim( O_trim *o_trim ) +{ + + if( ! inSurface ) { + do_nurbserror( 15 ); + bgnsurface( 0 ); + inSurface = 2; + } + + if( inTrim ) { + do_nurbserror( 16 ); + endtrim(); + } + inTrim = 1; + + if( *nextTrim != o_trim ) { + isTrimModified = 1; + *nextTrim = o_trim; + } + + currentTrim = o_trim; + nextTrim = &(o_trim->next); + nextCurve = &(o_trim->o_curve); +} + + +/*----------------------------------------------------------------------------- + * do_endtrim - mark the end of the current trim loop + * + * Client: endtrim() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_endtrim( void ) +{ + if( ! inTrim ) { + do_nurbserror( 17 ); + return; + } + inTrim = 0; + + if( currentTrim->o_curve == 0 ) { + do_nurbserror( 18 ); + isDataValid = 0; + } + + numTrims++; + + if( *nextCurve != 0 ) { + isTrimModified = 1; + *nextCurve = 0; + } +} + +/*----------------------------------------------------------------------------- + * do_freepwlcurve - + * + * Client: + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_freepwlcurve( O_pwlcurve *o_pwlcurve ) +{ + o_pwlcurve->deleteMe( o_pwlcurvePool ); +} + +void +NurbsTessellator::do_freebgncurve( O_curve *o_curve ) +{ + o_curve->deleteMe( o_curvePool ); +} + +/*----------------------------------------------------------------------------- + * do_pwlcurve - link in pwl trim loop to the current surface description + * + * Client: pwlcurve() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve ) +{ + if( ! inTrim ) { + do_nurbserror( 19 ); + if( o_pwlcurve->save == 0 ) + do_freepwlcurve(o_pwlcurve ); + return; + } + + if( ! inCurve ) { + bgncurve( 0 ); + inCurve = 2; + } + + if( o_pwlcurve->used ) { + do_nurbserror( 20 ); + isDataValid = 0; + return; + } else + o_pwlcurve->used = 1; + + if( currentCurve->curvetype == ct_none ) { + currentCurve->curvetype = ct_pwlcurve; + } else if( currentCurve->curvetype != ct_pwlcurve ) { + do_nurbserror( 21 ); + isDataValid = 0; + return; + } + + if( *nextPwlcurve != o_pwlcurve ) { + isCurveModified = 1; + *nextPwlcurve = o_pwlcurve; + } + nextPwlcurve = &(o_pwlcurve->next); + + if( o_pwlcurve->owner != currentCurve ) { + isCurveModified = 1; + o_pwlcurve->owner = currentCurve; + } + + if( (inCurve == 2) ) + endcurve(); +} + + +/*----------------------------------------------------------------------------- + * do_freenurbscurve - + * + * Client: + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_freenurbscurve( O_nurbscurve *o_nurbscurve ) +{ + o_nurbscurve->bezier_curves->deleteMe( quiltPool ); + o_nurbscurve->deleteMe( o_nurbscurvePool ); +} + + +/*----------------------------------------------------------------------------- + * do_nurbscurve - + * + * Client: nurbscurve() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_nurbscurve( O_nurbscurve *o_nurbscurve ) +{ + if ( ! inCurve ) { + bgncurve( 0 ); + inCurve = 2; + } + + if( o_nurbscurve->used ) { + /* error - curve was already called in current surface */ + do_nurbserror( 23 ); + isDataValid = 0; + return; + } else + o_nurbscurve->used = 1; + + if( currentCurve->curvetype == ct_none ) { + currentCurve->curvetype = ct_nurbscurve; + } else if( currentCurve->curvetype != ct_nurbscurve ) { + do_nurbserror( 24 ); + isDataValid = 0; + return; + } + + if( *nextNurbscurve != o_nurbscurve ) { + isCurveModified = 1; + *nextNurbscurve = o_nurbscurve; + } + + nextNurbscurve = &(o_nurbscurve->next); + + if( o_nurbscurve->owner != currentCurve ) { + isCurveModified = 1; + o_nurbscurve->owner = currentCurve; + } + + if( o_nurbscurve->owner == 0 ) + isCurveModified = 1; + + if( inCurve == 2 ) + endcurve(); +} + + +/*----------------------------------------------------------------------------- + * do_freenurbssurface - + * + * Client: + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::do_freenurbssurface( O_nurbssurface *o_nurbssurface ) +{ + o_nurbssurface->bezier_patches->deleteMe( quiltPool ); + o_nurbssurface->deleteMe( o_nurbssurfacePool ); +} + +/*----------------------------------------------------------------------------- + * do_nurbssurface - + * + * Client: nurbssurface() + *----------------------------------------------------------------------------- + */ +void +NurbsTessellator::do_nurbssurface( O_nurbssurface *o_nurbssurface ) +{ + if( ! inSurface ) { + bgnsurface( 0 ); + inSurface = 2; + } + + if( o_nurbssurface->used ) { + /* error - surface was already called in current block */ + do_nurbserror( 25 ); + isDataValid = 0; + return; + } else + o_nurbssurface->used = 1; + + if( *nextNurbssurface != o_nurbssurface ) { + isSurfaceModified = 1; + *nextNurbssurface = o_nurbssurface; + } + + if( o_nurbssurface->owner != currentSurface ) { + isSurfaceModified = 1; + o_nurbssurface->owner = currentSurface; + } + nextNurbssurface = &(o_nurbssurface->next); + + if( inSurface == 2 ) + endsurface(); +} + + +/*----------------------------------------------------------------------------- + * do_freenurbsproperty + * + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::do_freenurbsproperty( Property *prop ) +{ + prop->deleteMe( propertyPool ); +} + + +/*----------------------------------------------------------------------------- + * do_setnurbsproperty - + * + *----------------------------------------------------------------------------- + */ + +void +NurbsTessellator::do_setnurbsproperty( Property *prop ) +{ + renderhints.setProperty( prop->tag, prop->value ); + if( prop->save == 0 ) + do_freenurbsproperty( prop ); +} + +void +NurbsTessellator::do_setnurbsproperty2( Property *prop ) +{ + Mapdesc *mapdesc = maplist.find( prop->type ); + + mapdesc->setProperty( prop->tag, prop->value ); + if( prop->save == 0 ) + do_freenurbsproperty( prop ); +} + +void +NurbsTessellator::errorHandler( int ) +{ +} + +void +NurbsTessellator::do_nurbserror( int msg ) +{ + errorHandler( msg ); +} + +int +NurbsTessellator::do_check_knots( Knotvector *knots, const char *msg ) +{ + int status = knots->validate(); + if( status ) { + do_nurbserror( status ); + if( renderhints.errorchecking != N_NOMSG ) knots->show( msg ); + } + return status; +} + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/nurbstess.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,172 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * nurbstess.h + * + */ + +#ifndef __glunurbstess_h_ +#define __glunurbstess_h_ + +#include "mysetjmp.h" +#include "subdivider.h" +#include "renderhints.h" +#include "backend.h" +#include "maplist.h" +#include "reader.h" +#include "nurbsconsts.h" + +struct Knotvector; +class Quilt; +class DisplayList; +class BasicCurveEvaluator; +class BasicSurfaceEvaluator; + +class NurbsTessellator { +public: + NurbsTessellator( BasicCurveEvaluator &c, + BasicSurfaceEvaluator &e ); + virtual ~NurbsTessellator( void ); + + void getnurbsproperty( long, INREAL * ); + void getnurbsproperty( long, long, INREAL * ); + void setnurbsproperty( long, INREAL ); + void setnurbsproperty( long, long, INREAL ); + void setnurbsproperty( long, long, INREAL * ); + void setnurbsproperty( long, long, INREAL *, long, long ); + + // called before a tessellation begins/ends + virtual void bgnrender( void ); + virtual void endrender( void ); + + // called to make a display list of the output vertices + virtual void makeobj( int n ); + virtual void closeobj( void ); + + // called when a error occurs + virtual void errorHandler( int ); + + void bgnsurface( long ); + void endsurface( void ); + void bgntrim( void ); + void endtrim( void ); + void bgncurve( long ); + void endcurve( void ); + void pwlcurve( long, INREAL[], long, long ); + void nurbscurve( long, INREAL[], long, INREAL[], long, long ); + void nurbssurface( long, INREAL[], long, INREAL[], long, long, + INREAL[], long, long, long ); + + void defineMap( long, long, long ); + void redefineMaps( void ); + + // recording of input description + void discardRecording( void * ); + void * beginRecording( void ); + void endRecording( void ); + void playRecording( void * ); + + //for optimizing untrimmed nurbs in the case of domain distance sampling + void set_domain_distance_u_rate(REAL u_rate); + void set_domain_distance_v_rate(REAL v_rate); + void set_is_domain_distance_sampling(int flag); + + +protected: + Renderhints renderhints; + Maplist maplist; + Backend backend; + +private: + + void resetObjects( void ); + int do_check_knots( Knotvector *, const char * ); + void do_nurbserror( int ); + void do_bgncurve( O_curve * ); + void do_endcurve( void ); + void do_freeall( void ); + void do_freecurveall( O_curve * ); + void do_freebgntrim( O_trim * ); + void do_freebgncurve( O_curve * ); + void do_freepwlcurve( O_pwlcurve * ); + void do_freenurbscurve( O_nurbscurve * ); + void do_freenurbssurface( O_nurbssurface * ); + void do_freebgnsurface( O_surface * ); + void do_bgnsurface( O_surface * ); + void do_endsurface( void ); + void do_bgntrim( O_trim * ); + void do_endtrim( void ); + void do_pwlcurve( O_pwlcurve * ); + void do_nurbscurve( O_nurbscurve * ); + void do_nurbssurface( O_nurbssurface * ); + void do_freenurbsproperty( Property * ); + void do_setnurbsproperty( Property * ); + void do_setnurbsproperty2( Property * ); + + Subdivider subdivider; + JumpBuffer* jumpbuffer; + Pool o_pwlcurvePool; + Pool o_nurbscurvePool; + Pool o_curvePool; + Pool o_trimPool; + Pool o_surfacePool; + Pool o_nurbssurfacePool; + Pool propertyPool; +public: + Pool quiltPool; +private: + TrimVertexPool extTrimVertexPool; + + int inSurface; /* bgnsurface seen */ + int inCurve; /* bgncurve seen */ + int inTrim; /* bgntrim seen */ + int isCurveModified; /* curve changed */ + int isTrimModified; /* trim curves changed */ + int isSurfaceModified; /* surface changed */ + int isDataValid; /* all data is good */ + int numTrims; /* valid trim regions */ + int playBack; + + O_trim** nextTrim; /* place to link o_trim */ + O_curve** nextCurve; /* place to link o_curve */ + O_nurbscurve** nextNurbscurve; /* place to link o_nurbscurve */ + O_pwlcurve** nextPwlcurve; /* place to link o_pwlcurve */ + O_nurbssurface** nextNurbssurface; /* place to link o_nurbssurface */ + + O_surface* currentSurface; + O_trim* currentTrim; + O_curve* currentCurve; + + DisplayList *dl; + +}; + +#endif /* __glunurbstess_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,504 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * patch.c++ + * + */ + +#include +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "mymath.h" +#include "mystring.h" +#include "patch.h" +#include "mapdesc.h" +#include "quilt.h" +#include "nurbsconsts.h" +#include "simplemath.h" //for glu_abs function in ::singleStep(); + + +/*-------------------------------------------------------------------------- + * Patch - copy patch from quilt and transform control points + *-------------------------------------------------------------------------- + */ + +Patch::Patch( Quilt_ptr geo, REAL *pta, REAL *ptb, Patch *n ) +{ +/* pspec[i].range is uninit here */ + mapdesc = geo->mapdesc; + cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT; + notInBbox = mapdesc->isBboxSubdividing() ? 1 : 0; + needsSampling = mapdesc->isRangeSampling() ? 1 : 0; + pspec[0].order = geo->qspec[0].order; + pspec[1].order = geo->qspec[1].order; + pspec[0].stride = pspec[1].order * MAXCOORDS; + pspec[1].stride = MAXCOORDS; + + /* transform control points to sampling and culling spaces */ + REAL *ps = geo->cpts; + geo->select( pta, ptb ); + ps += geo->qspec[0].offset; + ps += geo->qspec[1].offset; + ps += geo->qspec[0].index * geo->qspec[0].order * geo->qspec[0].stride; + ps += geo->qspec[1].index * geo->qspec[1].order * geo->qspec[1].stride; + + if( needsSampling ) { + mapdesc->xformSampling( ps, geo->qspec[0].order, geo->qspec[0].stride, + geo->qspec[1].order, geo->qspec[1].stride, + spts, pspec[0].stride, pspec[1].stride ); + } + + if( cullval == CULL_ACCEPT ) { + mapdesc->xformCulling( ps, geo->qspec[0].order, geo->qspec[0].stride, + geo->qspec[1].order, geo->qspec[1].stride, + cpts, pspec[0].stride, pspec[1].stride ); + } + + if( notInBbox ) { + mapdesc->xformBounding( ps, geo->qspec[0].order, geo->qspec[0].stride, + geo->qspec[1].order, geo->qspec[1].stride, + bpts, pspec[0].stride, pspec[1].stride ); + } + + /* set scale range */ + pspec[0].range[0] = geo->qspec[0].breakpoints[geo->qspec[0].index]; + pspec[0].range[1] = geo->qspec[0].breakpoints[geo->qspec[0].index+1]; + pspec[0].range[2] = pspec[0].range[1] - pspec[0].range[0]; + + pspec[1].range[0] = geo->qspec[1].breakpoints[geo->qspec[1].index]; + pspec[1].range[1] = geo->qspec[1].breakpoints[geo->qspec[1].index+1]; + pspec[1].range[2] = pspec[1].range[1] - pspec[1].range[0]; + + // may need to subdivide to match range of sub-patch + if( pspec[0].range[0] != pta[0] ) { + assert( pspec[0].range[0] < pta[0] ); + Patch lower( *this, 0, pta[0], 0 ); + *this = lower; + } + + if( pspec[0].range[1] != ptb[0] ) { + assert( pspec[0].range[1] > ptb[0] ); + Patch upper( *this, 0, ptb[0], 0 ); + } + + if( pspec[1].range[0] != pta[1] ) { + assert( pspec[1].range[0] < pta[1] ); + Patch lower( *this, 1, pta[1], 0 ); + *this = lower; + } + + if( pspec[1].range[1] != ptb[1] ) { + assert( pspec[1].range[1] > ptb[1] ); + Patch upper( *this, 1, ptb[1], 0 ); + } + checkBboxConstraint(); + next = n; +} + +/*-------------------------------------------------------------------------- + * Patch - subdivide a patch along an isoparametric line + *-------------------------------------------------------------------------- + */ + +Patch::Patch( Patch& upper, int param, REAL value, Patch *n ) +{ + Patch& lower = *this; + + lower.cullval = upper.cullval; + lower.mapdesc = upper.mapdesc; + lower.notInBbox = upper.notInBbox; + lower.needsSampling = upper.needsSampling; + lower.pspec[0].order = upper.pspec[0].order; + lower.pspec[1].order = upper.pspec[1].order; + lower.pspec[0].stride = upper.pspec[0].stride; + lower.pspec[1].stride = upper.pspec[1].stride; + lower.next = n; + + /* reset scale range */ + switch( param ) { + case 0: { + REAL d = (value-upper.pspec[0].range[0]) / upper.pspec[0].range[2]; + if( needsSampling ) + mapdesc->subdivide( upper.spts, lower.spts, d, pspec[1].order, + pspec[1].stride, pspec[0].order, pspec[0].stride ); + + if( cullval == CULL_ACCEPT ) + mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[1].order, + pspec[1].stride, pspec[0].order, pspec[0].stride ); + + if( notInBbox ) + mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[1].order, + pspec[1].stride, pspec[0].order, pspec[0].stride ); + + lower.pspec[0].range[0] = upper.pspec[0].range[0]; + lower.pspec[0].range[1] = value; + lower.pspec[0].range[2] = value - upper.pspec[0].range[0]; + upper.pspec[0].range[0] = value; + upper.pspec[0].range[2] = upper.pspec[0].range[1] - value; + + lower.pspec[1].range[0] = upper.pspec[1].range[0]; + lower.pspec[1].range[1] = upper.pspec[1].range[1]; + lower.pspec[1].range[2] = upper.pspec[1].range[2]; + break; + } + case 1: { + REAL d = (value-upper.pspec[1].range[0]) / upper.pspec[1].range[2]; + if( needsSampling ) + mapdesc->subdivide( upper.spts, lower.spts, d, pspec[0].order, + pspec[0].stride, pspec[1].order, pspec[1].stride ); + if( cullval == CULL_ACCEPT ) + mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[0].order, + pspec[0].stride, pspec[1].order, pspec[1].stride ); + if( notInBbox ) + mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[0].order, + pspec[0].stride, pspec[1].order, pspec[1].stride ); + lower.pspec[0].range[0] = upper.pspec[0].range[0]; + lower.pspec[0].range[1] = upper.pspec[0].range[1]; + lower.pspec[0].range[2] = upper.pspec[0].range[2]; + + lower.pspec[1].range[0] = upper.pspec[1].range[0]; + lower.pspec[1].range[1] = value; + lower.pspec[1].range[2] = value - upper.pspec[1].range[0]; + upper.pspec[1].range[0] = value; + upper.pspec[1].range[2] = upper.pspec[1].range[1] - value; + break; + } + } + + // inherit bounding box + if( mapdesc->isBboxSubdividing() && ! notInBbox ) + memcpy( lower.bb, upper.bb, sizeof( bb ) ); + + lower.checkBboxConstraint(); + upper.checkBboxConstraint(); +} + +/*-------------------------------------------------------------------------- + * clamp - clamp the sampling rate to a given maximum + *-------------------------------------------------------------------------- + */ + +void +Patch::clamp( void ) +{ + if( mapdesc->clampfactor != N_NOCLAMPING ) { + pspec[0].clamp( mapdesc->clampfactor ); + pspec[1].clamp( mapdesc->clampfactor ); + } +} + +void +Patchspec::clamp( REAL clampfactor ) +{ + if( sidestep[0] < minstepsize ) + sidestep[0] = clampfactor * minstepsize; + if( sidestep[1] < minstepsize ) + sidestep[1] = clampfactor * minstepsize; + if( stepsize < minstepsize ) + stepsize = clampfactor * minstepsize; +} + +void +Patch::checkBboxConstraint( void ) +{ + if( notInBbox && + mapdesc->bboxTooBig( bpts, pspec[0].stride, pspec[1].stride, + pspec[0].order, pspec[1].order, bb ) != 1 ) { + notInBbox = 0; + } +} + +void +Patch::bbox( void ) +{ + if( mapdesc->isBboxSubdividing() ) + mapdesc->surfbbox( bb ); +} + +/*-------------------------------------------------------------------------- + * getstepsize - compute the sampling density across the patch + * and determine if patch needs to be subdivided + *-------------------------------------------------------------------------- + */ + +void +Patch::getstepsize( void ) +{ + pspec[0].minstepsize = pspec[1].minstepsize = 0; + pspec[0].needsSubdivision = pspec[1].needsSubdivision = 0; + + if( mapdesc->isConstantSampling() ) { + // fixed number of samples per patch in each direction + // maxsrate is number of s samples per patch + // maxtrate is number of t samples per patch + pspec[0].getstepsize( mapdesc->maxsrate ); + pspec[1].getstepsize( mapdesc->maxtrate ); + + } else if( mapdesc->isDomainSampling() ) { + // maxsrate is number of s samples per unit s length of domain + // maxtrate is number of t samples per unit t length of domain + pspec[0].getstepsize( mapdesc->maxsrate * pspec[0].range[2] ); + pspec[1].getstepsize( mapdesc->maxtrate * pspec[1].range[2] ); + + } else if( ! needsSampling ) { + pspec[0].singleStep(); + pspec[1].singleStep(); + } else { + // upper bound on path length between sample points + REAL tmp[MAXORDER][MAXORDER][MAXCOORDS]; + const int trstride = sizeof(tmp[0]) / sizeof(REAL); + const int tcstride = sizeof(tmp[0][0]) / sizeof(REAL); + + assert( pspec[0].order <= MAXORDER ); + + /* points have been transformed, therefore they are homogeneous */ + + int val = mapdesc->project( spts, pspec[0].stride, pspec[1].stride, + &tmp[0][0][0], trstride, tcstride, + pspec[0].order, pspec[1].order ); + if( val == 0 ) { + // control points cross infinity, therefore partials are undefined + pspec[0].getstepsize( mapdesc->maxsrate ); + pspec[1].getstepsize( mapdesc->maxtrate ); + } else { + REAL t1 = mapdesc->getProperty( N_PIXEL_TOLERANCE ); +// REAL t2 = mapdesc->getProperty( N_ERROR_TOLERANCE ); + pspec[0].minstepsize = ( mapdesc->maxsrate > 0.0 ) ? + (pspec[0].range[2] / mapdesc->maxsrate) : 0.0; + pspec[1].minstepsize = ( mapdesc->maxtrate > 0.0 ) ? + (pspec[1].range[2] / mapdesc->maxtrate) : 0.0; + if( mapdesc->isParametricDistanceSampling() || + mapdesc->isObjectSpaceParaSampling() ) { + + REAL t2; + t2 = mapdesc->getProperty( N_ERROR_TOLERANCE ); + + // t2 is upper bound on the distance between surface and tessellant + REAL ssv[2], ttv[2]; + REAL ss = mapdesc->calcPartialVelocity( ssv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 2, 0, pspec[0].range[2], pspec[1].range[2], 0 ); + REAL st = mapdesc->calcPartialVelocity( 0, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 1, pspec[0].range[2], pspec[1].range[2], -1 ); + REAL tt = mapdesc->calcPartialVelocity( ttv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 2, pspec[0].range[2], pspec[1].range[2], 1 ); + //make sure that ss st and tt are nonnegative: + if(ss <0) ss = -ss; + if(st <0) st = -st; + if(tt <0) tt = -tt; + + if( ss != 0.0 && tt != 0.0 ) { + /* printf( "ssv[0] %g ssv[1] %g ttv[0] %g ttv[1] %g\n", + ssv[0], ssv[1], ttv[0], ttv[1] ); */ + REAL ttq = sqrtf( (float) ss ); + REAL ssq = sqrtf( (float) tt ); + REAL ds = sqrtf( 4 * t2 * ttq / ( ss * ttq + st * ssq ) ); + REAL dt = sqrtf( 4 * t2 * ssq / ( tt * ssq + st * ttq ) ); + pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; + REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); + pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; + pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; + + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; + REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); + pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; + pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; + } else if( ss != 0.0 ) { + REAL x = pspec[1].range[2] * st; + REAL ds = ( sqrtf( x * x + 8.0 * t2 * ss ) - x ) / ss; + pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; + REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); + pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; + pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; + pspec[1].singleStep(); + } else if( tt != 0.0 ) { + REAL x = pspec[0].range[2] * st; + REAL dt = ( sqrtf( x * x + 8.0 * t2 * tt ) - x ) / tt; + pspec[0].singleStep(); + REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; + pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; + pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; + } else { + if( 4.0 * t2 > st * pspec[0].range[2] * pspec[1].range[2] ) { + pspec[0].singleStep(); + pspec[1].singleStep(); + } else { + REAL area = 4.0 * t2 / st; + REAL ds = sqrtf( area * pspec[0].range[2] / pspec[1].range[2] ); + REAL dt = sqrtf( area * pspec[1].range[2] / pspec[0].range[2] ); + pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; + pspec[0].sidestep[0] = pspec[0].range[2]; + pspec[0].sidestep[1] = pspec[0].range[2]; + + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; + pspec[1].sidestep[0] = pspec[1].range[2]; + pspec[1].sidestep[1] = pspec[1].range[2]; + } + } + } else if( mapdesc->isPathLengthSampling() || + mapdesc->isObjectSpacePathSampling()) { + // t1 is upper bound on path length + REAL msv[2], mtv[2]; + REAL ms = mapdesc->calcPartialVelocity( msv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 0, pspec[0].range[2], pspec[1].range[2], 0 ); + REAL mt = mapdesc->calcPartialVelocity( mtv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 1, pspec[0].range[2], pspec[1].range[2], 1 ); + REAL side_scale = 1.0; + + if( ms != 0.0 ) { + if( mt != 0.0 ) { +/* REAL d = t1 / ( ms * ms + mt * mt );*/ +/* REAL ds = mt * d;*/ + REAL ds = t1 / (2.0*ms); +/* REAL dt = ms * d;*/ + REAL dt = t1 / (2.0*mt); + pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; + pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[0]) : pspec[0].range[2]; + pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[1]) : pspec[0].range[2]; + + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; + pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[0]) : pspec[1].range[2]; + pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[1]) : pspec[1].range[2]; + } else { + pspec[0].stepsize = ( t1 < ms * pspec[0].range[2] ) ? (t1 / ms) : pspec[0].range[2]; + pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (t1 / msv[0]) : pspec[0].range[2]; + pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (t1 / msv[1]) : pspec[0].range[2]; + + pspec[1].singleStep(); + } + } else { + if( mt != 0.0 ) { + pspec[0].singleStep(); + + pspec[1].stepsize = ( t1 < mt * pspec[1].range[2] ) ? (t1 / mt) : pspec[1].range[2]; + pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (t1 / mtv[0]) : pspec[1].range[2]; + pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (t1 / mtv[1]) : pspec[1].range[2]; + } else { + pspec[0].singleStep(); + pspec[1].singleStep(); + } + } + } else if( mapdesc->isSurfaceAreaSampling() ) { + // t is the square root of area +/* + REAL msv[2], mtv[2]; + REAL ms = mapdesc->calcPartialVelocity( msv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 0, pspec[0].range[2], pspec[1].range[2], 0 ); + REAL mt = mapdesc->calcPartialVelocity( mtv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 1, pspec[0].range[2], pspec[1].range[2], 1 ); + if( ms != 0.0 && mt != 0.0 ) { + REAL d = 1.0 / (ms * mt); + t *= M_SQRT2; + REAL ds = t * sqrtf( d * pspec[0].range[2] / pspec[1].range[2] ); + REAL dt = t * sqrtf( d * pspec[1].range[2] / pspec[0].range[2] ); + pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; + pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t ) ? (t / msv[0]) : pspec[0].range[2]; + pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t ) ? (t / msv[1]) : pspec[0].range[2]; + + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; + pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t ) ? (t / mtv[0]) : pspec[1].range[2]; + pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t ) ? (t / mtv[1]) : pspec[1].range[2]; + } else { + pspec[0].singleStep(); + pspec[1].singleStep(); + } +*/ + } else { + pspec[0].singleStep(); + pspec[1].singleStep(); + } + } + } + +#ifdef DEBUG + _glu_dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n", + pspec[0].sidestep[0], pspec[0].sidestep[1], + pspec[1].sidestep[0], pspec[1].sidestep[1], + pspec[0].stepsize, pspec[1].stepsize ); +#endif + + if( mapdesc->minsavings != N_NOSAVINGSSUBDIVISION ) { + REAL savings = 1./(pspec[0].stepsize * pspec[1].stepsize) ; + savings-= (2./( pspec[0].sidestep[0] + pspec[0].sidestep[1] )) * + (2./( pspec[1].sidestep[0] + pspec[1].sidestep[1] )); + + savings *= pspec[0].range[2] * pspec[1].range[2]; + if( savings > mapdesc->minsavings ) { + pspec[0].needsSubdivision = pspec[1].needsSubdivision = 1; + } + } + + if( pspec[0].stepsize < pspec[0].minstepsize ) pspec[0].needsSubdivision = 1; + if( pspec[1].stepsize < pspec[1].minstepsize ) pspec[1].needsSubdivision = 1; + needsSampling = (needsSampling ? needsSamplingSubdivision() : 0); +} + +void +Patchspec::singleStep() +{ + stepsize = sidestep[0] = sidestep[1] = glu_abs(range[2]); +} + +void +Patchspec::getstepsize( REAL max ) // max is number of samples for entire patch +{ + stepsize = ( max >= 1.0 ) ? range[2] / max : range[2]; + if (stepsize < 0.0) { + stepsize = -stepsize; + } + sidestep[0] = sidestep[1] = minstepsize = stepsize; +} + +int +Patch::needsSamplingSubdivision( void ) +{ + return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0; +} + +int +Patch::needsNonSamplingSubdivision( void ) +{ + return notInBbox; +} + +int +Patch::needsSubdivision( int param ) +{ + return pspec[param].needsSubdivision; +} + +int +Patch::cullCheck( void ) +{ + if( cullval == CULL_ACCEPT ) + cullval = mapdesc->cullCheck( cpts, pspec[0].order, pspec[0].stride, + pspec[1].order, pspec[1].stride ); + return cullval; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patch.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,94 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * patch.h + * + */ + +#ifndef __glupatch_h_ +#define __glupatch_h_ + +#include "types.h" +#include "defines.h" + +class Quilt; +class Mapdesc; + + +struct Pspec { + REAL range[3]; + REAL sidestep[2]; + REAL stepsize; + REAL minstepsize; + int needsSubdivision; +}; + +struct Patchspec : public Pspec { + int order; + int stride; + void clamp( REAL ); + void getstepsize( REAL ); + void singleStep( void ); +}; + +class Patch { +public: +friend class Subdivider; +friend class Quilt; +friend class Patchlist; + Patch( Quilt *, REAL*, REAL *, Patch * ); + Patch( Patch &, int, REAL, Patch * ); + void bbox( void ); + void clamp( void ); + void getstepsize( void ); + int cullCheck( void ); + int needsSubdivision( int ); + int needsSamplingSubdivision( void ); + int needsNonSamplingSubdivision( void ); + + int get_uorder() {return pspec[0].order;} + int get_vorder() {return pspec[1].order;} + +private: + + Mapdesc* mapdesc; + Patch* next; + int cullval; + int notInBbox; + int needsSampling; + REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts + REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts + REAL bpts[MAXORDER*MAXORDER*MAXCOORDS]; //bbox pts + Patchspec pspec[2]; + void checkBboxConstraint( void ); + REAL bb[2][MAXCOORDS]; +}; +#endif /* __glupatch_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,170 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * patchlist.c++ + * + */ + +#include +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "quilt.h" +#include "patchlist.h" +#include "patch.h" +#include "nurbsconsts.h" + +Patchlist::Patchlist( Quilt *quilts, REAL *pta, REAL *ptb ) +{ + patch = 0; + for( Quilt *q = quilts; q; q = q->next ) + patch = new Patch( q, pta, ptb, patch ); + pspec[0].range[0] = pta[0]; + pspec[0].range[1] = ptb[0]; + pspec[0].range[2] = ptb[0] - pta[0]; + + pspec[1].range[0] = pta[1]; + pspec[1].range[1] = ptb[1]; + pspec[1].range[2] = ptb[1] - pta[1]; +} + +Patchlist::Patchlist( Patchlist &upper, int param, REAL value) +{ + Patchlist &lower = *this; + patch = 0; + for( Patch *p = upper.patch; p; p = p->next ) + patch = new Patch( *p, param, value, patch ); + + if( param == 0 ) { + lower.pspec[0].range[0] = upper.pspec[0].range[0]; + lower.pspec[0].range[1] = value; + lower.pspec[0].range[2] = value - upper.pspec[0].range[0]; + upper.pspec[0].range[0] = value; + upper.pspec[0].range[2] = upper.pspec[0].range[1] - value; + lower.pspec[1] = upper.pspec[1]; + } else { + lower.pspec[0] = upper.pspec[0]; + lower.pspec[1].range[0] = upper.pspec[1].range[0]; + lower.pspec[1].range[1] = value; + lower.pspec[1].range[2] = value - upper.pspec[1].range[0]; + upper.pspec[1].range[0] = value; + upper.pspec[1].range[2] = upper.pspec[1].range[1] - value; + } +} + +Patchlist::~Patchlist() +{ + while( patch ) { + Patch *p = patch; + patch = patch->next; + delete p; + } +} + +int +Patchlist::cullCheck( void ) +{ + for( Patch *p = patch; p; p = p->next ) + if( p->cullCheck() == CULL_TRIVIAL_REJECT ) + return CULL_TRIVIAL_REJECT; + return CULL_ACCEPT; +} + +void +Patchlist::getRanges(REAL ranges[4]) +{ + ranges[0] = pspec[0].range[0]; + ranges[1] = pspec[0].range[1]; + ranges[2] = pspec[1].range[0]; + ranges[3] = pspec[1].range[1]; +} + +void +Patchlist::getstepsize( void ) +{ + pspec[0].stepsize = pspec[0].range[2]; + pspec[0].sidestep[0] = pspec[0].range[2]; + pspec[0].sidestep[1] = pspec[0].range[2]; + + pspec[1].stepsize = pspec[1].range[2]; + pspec[1].sidestep[0] = pspec[1].range[2]; + pspec[1].sidestep[1] = pspec[1].range[2]; + + for( Patch *p = patch; p; p = p->next ) { + p->getstepsize(); + p->clamp(); + pspec[0].stepsize = ((p->pspec[0].stepsize < pspec[0].stepsize) ? p->pspec[0].stepsize : pspec[0].stepsize); + pspec[0].sidestep[0] = ((p->pspec[0].sidestep[0] < pspec[0].sidestep[0]) ? p->pspec[0].sidestep[0] : pspec[0].sidestep[0]); + pspec[0].sidestep[1] = ((p->pspec[0].sidestep[1] < pspec[0].sidestep[1]) ? p->pspec[0].sidestep[1] : pspec[0].sidestep[1]); + pspec[1].stepsize = ((p->pspec[1].stepsize < pspec[1].stepsize) ? p->pspec[1].stepsize : pspec[1].stepsize); + pspec[1].sidestep[0] = ((p->pspec[1].sidestep[0] < pspec[1].sidestep[0]) ? p->pspec[1].sidestep[0] : pspec[1].sidestep[0]); + pspec[1].sidestep[1] = ((p->pspec[1].sidestep[1] < pspec[1].sidestep[1]) ? p->pspec[1].sidestep[1] : pspec[1].sidestep[1]); + } +} + +void +Patchlist::bbox( void ) +{ + for( Patch *p = patch; p; p = p->next ) + p->bbox(); +} + +int +Patchlist::needsNonSamplingSubdivision( void ) +{ + notInBbox = 0; + for( Patch *p = patch; p; p = p->next ) + notInBbox |= p->needsNonSamplingSubdivision(); + return notInBbox; +} + +int +Patchlist::needsSamplingSubdivision( void ) +{ + pspec[0].needsSubdivision = 0; + pspec[1].needsSubdivision = 0; + + for( Patch *p = patch; p; p = p->next ) { + pspec[0].needsSubdivision |= p->pspec[0].needsSubdivision; + pspec[1].needsSubdivision |= p->pspec[0].needsSubdivision; + } + return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0; +} + +int +Patchlist::needsSubdivision( int param ) +{ + return pspec[param].needsSubdivision; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/patchlist.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,92 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * patchlist.h + * + */ + +#ifndef __glupatchlist_h_ +#define __glupatchlist_h_ + +#include "types.h" +#include "defines.h" +#include "patch.h" + +class Quilt; + +class Patchlist { +friend class Subdivider; +public: + Patchlist( Quilt *, REAL *, REAL * ); + Patchlist( Patchlist &, int , REAL ); + ~Patchlist(); + void bbox(); + int cullCheck( void ); + void getstepsize( void ); + int needsNonSamplingSubdivision( void ); + int needsSamplingSubdivision( void ); + int needsSubdivision( int ); + REAL getStepsize( int ); + void getRanges(REAL ranges[4]); + + int get_uorder(); + int get_vorder(); +private: + Patch *patch; + int notInBbox; + int needsSampling; + Pspec pspec[2]; +}; + +inline REAL +Patchlist::getStepsize( int param ) +{ + return pspec[param].stepsize; +} + +inline int +Patchlist::get_uorder() +{ + return patch->get_uorder(); + +} + +inline int + Patchlist::get_vorder() +{ + return patch->get_vorder(); +} + + + + + +#endif /* __glupatchlist_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/pwlarc.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/pwlarc.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/pwlarc.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/pwlarc.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,78 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * pwlarc.h + * + */ + +#ifndef __glupwlarc_h_ +#define __glupwlarc_h_ + +#include "myassert.h" +#include "nurbsconsts.h" + +class TrimVertex; + +class PwlArc : public PooledObj { /* a piecewise-linear arc */ +public: + TrimVertex * pts; /* sample points */ + int npts; /* number of sample points */ + long type; /* curve type */ + inline PwlArc( void ); + inline PwlArc( int, TrimVertex * ); + inline PwlArc( int, TrimVertex *, long ); +}; + +inline +PwlArc::PwlArc( void ) +{ + type = N_P2D; + pts = 0; + npts = -1; +} + +inline +PwlArc::PwlArc( int _npts, TrimVertex *_pts ) +{ + pts = _pts; + npts = _npts; + type = N_P2D; +} + +inline +PwlArc::PwlArc( int _npts, TrimVertex *_pts, long _type ) +{ + pts = _pts; + npts = _npts; + type = _type; +} + +#endif /* __glupwlarc_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,276 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * quilt.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "quilt.h" +#include "backend.h" +#include "mapdesc.h" +#include "flist.h" +#include "knotvector.h" +#include "patchlist.h" +#include "math.h" //fglu_abs() +#include "simplemath.h" //min() + +/* local preprocessor definitions */ +#define DEF_PATCH_STEPSIZE .4 +#define fsizeof(x) (sizeof(x)/sizeof(REAL)) + + +Quilt::Quilt( Mapdesc *_mapdesc ) +{ + mapdesc = _mapdesc; +} + +void +Quilt::deleteMe( Pool& p ) +{ + for( Quiltspec *q=qspec; q != eqspec; q++ ) { +#if 1 + if( q->breakpoints) delete[] q->breakpoints; q->breakpoints = 0; +#else + if( q->breakpoints) { + delete[] q->breakpoints; + q->breakpoints = 0; +printf("in here\n"); + } +#endif + } + if( cpts ) delete[] cpts; + cpts = 0; + PooledObj::deleteMe( p ); +} + +void +Quilt::show( void ) +{ +#ifndef NDEBUG + int nc = mapdesc->getNcoords(); + REAL *ps = cpts; + ps += qspec[0].offset; + ps += qspec[1].offset; + for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) { + for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) { + for( int k=0; k < nc; k++ ) + _glu_dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] ); + _glu_dprintf( "\n" ); + } + _glu_dprintf( "\n" ); + } + _glu_dprintf( "\n" ); +#endif +} + +/*-------------------------------------------------------------------------- + * Quilt::select - find which map in each quilt contains the points + * pta and ptb with pta[i] < ptb[i] + *-------------------------------------------------------------------------- + */ + +void +Quilt::select( REAL *pta, REAL *ptb ) +{ + int dim = eqspec - qspec; + int i, j; + for( i=0; i=0; j-- ) + if( (qspec[i].breakpoints[j] <= pta[i] ) && + (ptb[i] <= qspec[i].breakpoints[j+1] ) ) + break; + assert( j != -1 ); + qspec[i].index = j; + } +} + +void +Quilt::download( Backend &backend ) +{ + if( getDimension() == 2 ) { + REAL *ps = cpts; + ps += qspec[0].offset; + ps += qspec[1].offset; + ps += qspec[0].index * qspec[0].order * qspec[0].stride; + ps += qspec[1].index * qspec[1].order * qspec[1].stride; + backend.surfpts( mapdesc->getType(), ps, + qspec[0].stride, + qspec[1].stride, + qspec[0].order, + qspec[1].order, + qspec[0].breakpoints[qspec[0].index], + qspec[0].breakpoints[qspec[0].index+1], + qspec[1].breakpoints[qspec[1].index], + qspec[1].breakpoints[qspec[1].index+1] ); + } else { + REAL *ps = cpts; + ps += qspec[0].offset; + ps += qspec[0].index * qspec[0].order * qspec[0].stride; + backend.curvpts( mapdesc->getType(), ps, + qspec[0].stride, + qspec[0].order, + qspec[0].breakpoints[qspec[0].index], + qspec[0].breakpoints[qspec[0].index+1] ); + } +} + +/*-------------------------------------------------------------------------- + * Quilt::downloadAll - download each map that contains the current patch + *-------------------------------------------------------------------------- + */ + +void +Quilt::downloadAll( REAL *pta, REAL *ptb, Backend &backend ) +{ + for( Quilt *m = this; m; m=m->next ) { + m->select( pta, ptb ); + m->download( backend ); + } +} + +/*-------------------------------------------------------------------------- + * Quilt::isCulled - determine if an entire quilt is trivially rejected. + *-------------------------------------------------------------------------- + */ + +int +Quilt::isCulled( void ) +{ + if( mapdesc->isCulling() ) + return mapdesc->xformAndCullCheck( cpts + qspec[0].offset + qspec[1].offset, + qspec[0].order * qspec[0].width, qspec[0].stride, + qspec[1].order * qspec[1].width, qspec[1].stride ); + else + return CULL_ACCEPT; +} + +/*--------------------------------------------------------------------------- + * Quilt::getRange - retrieve the valid paramater range of a set of quilts + *--------------------------------------------------------------------------- + */ +void +Quilt::getRange( REAL *from, REAL *to, Flist& slist, Flist &tlist ) +{ + getRange( from, to, 0, slist ); + getRange( from, to, 1, tlist ); +} + +/*--------------------------------------------------------------------------- + * Quilt::getRange - retrieve the valid paramater range of a set of quilts + *--------------------------------------------------------------------------- + */ +void +Quilt::getRange( REAL *from, REAL *to, int i, Flist &list ) +{ + Quilt *maps = this; + from[i] = maps->qspec[i].breakpoints[0]; + to[i] = maps->qspec[i].breakpoints[maps->qspec[i].width]; + int maxpts = 0; + Quilt_ptr m; + for( m=maps; m; m=m->next ) { + if( m->qspec[i].breakpoints[0] > from[i] ) + from[i] = m->qspec[i].breakpoints[0]; + if( m->qspec[i].breakpoints[m->qspec[i].width] < to[i] ) + to[i] = m->qspec[i].breakpoints[m->qspec[i].width]; + maxpts += m->qspec[i].width + 1; + } + + list.grow( maxpts ); + + for( m=maps; m; m=m->next ) + for( int j=0; j<=m->qspec[i].width; j++ ) { + list.add( m->qspec[i].breakpoints[j] ); + } + + list.filter( ); + list.taper( from[i], to[i] ); +} + +void +Quilt::getRange( REAL *from, REAL *to, Flist& slist ) +{ + getRange( from, to, 0, slist ); +} + +void +Quilt::findRates( Flist& slist, Flist& tlist, REAL rate[2] ) +{ + findSampleRates( slist, tlist ); + rate[0] = qspec[0].step_size; + rate[1] = qspec[1].step_size; + + for( Quilt *q = next; q; q = q->next ) { + q->findSampleRates( slist, tlist ); + if( q->qspec[0].step_size < rate[0] ) + rate[0] = q->qspec[0].step_size; + if( q->qspec[1].step_size < rate[1] ) + rate[1] = q->qspec[1].step_size; + } +} + +void +Quilt::findSampleRates( Flist& slist, Flist& tlist ) +{ + qspec[0].step_size = DEF_PATCH_STEPSIZE * + (qspec[0].breakpoints[qspec[0].width] - qspec[0].breakpoints[0]); + qspec[1].step_size = DEF_PATCH_STEPSIZE * + (qspec[1].breakpoints[qspec[1].width] - qspec[1].breakpoints[0]); + + for( int i = slist.start; i < slist.end-1; i++ ) { + for( int j = tlist.start; j < tlist.end-1; j++ ) { + + REAL pta[2], ptb[2]; + pta[0] = slist.pts[i]; + ptb[0] = slist.pts[i+1]; + pta[1] = tlist.pts[j]; + ptb[1] = tlist.pts[j+1]; + Patchlist patchlist( this, pta, ptb ); + patchlist.getstepsize(); + + { + float edge_len_s = min(glu_abs(ptb[0]-pta[0]),1.0); + float edge_len_t = min(glu_abs(ptb[1]-pta[1]),1.0); + + if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size ) + qspec[0].step_size = patchlist.getStepsize(0)/edge_len_s; + if( patchlist.getStepsize(1)/edge_len_t < qspec[1].step_size ) + qspec[1].step_size = patchlist.getStepsize(1)/edge_len_t; + } + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/quilt.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,92 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * quilt.h + * + */ + +#ifndef __gluquilt_h_ +#define __gluquilt_h_ + +#include "defines.h" +#include "bufpool.h" +#include "types.h" + +class Backend; +class Mapdesc; +class Flist; +struct Knotvector; + +/* constants for memory allocation of NURBS to Bezier conversion */ +#define MAXDIM 2 + +struct Quiltspec { /* a specification for a dimension of a quilt */ + int stride; /* words between points */ + int width; /* number of segments */ + int offset; /* words to first point */ + int order; /* order */ + int index; /* current segment number */ + int bdry[2]; /* boundary edge flag */ + REAL step_size; + Knot * breakpoints; +}; + +typedef Quiltspec *Quiltspec_ptr; + +class Quilt : public PooledObj { /* an array of bezier patches */ +public: + Quilt( Mapdesc * ); + Mapdesc * mapdesc; /* map descriptor */ + REAL * cpts; /* control points */ + Quiltspec qspec[MAXDIM]; /* the dimensional data */ + Quiltspec_ptr eqspec; /* qspec trailer */ + Quilt *next; /* next quilt in linked list */ + +public: + void deleteMe( Pool& ); + void toBezier( Knotvector &, INREAL *, long ); + void toBezier( Knotvector &, Knotvector &, INREAL *, long ); + void select( REAL *, REAL * ); + int getDimension( void ) { return eqspec - qspec; } + void download( Backend & ); + void downloadAll( REAL *, REAL *, Backend & ); + int isCulled( void ); + void getRange( REAL *, REAL *, Flist&, Flist & ); + void getRange( REAL *, REAL *, int, Flist & ); + void getRange( REAL *, REAL *, Flist& ); + void findRates( Flist& slist, Flist& tlist, REAL[2] ); + void findSampleRates( Flist& slist, Flist& tlist ); + void show(); +}; + +typedef class Quilt *Quilt_ptr; + +#endif /* __gluquilt_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,146 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * reader.c++ + * + */ + +#include +#include "glimports.h" +#include "nurbsconsts.h" +#include "reader.h" +#include "trimvertex.h" +#include "simplemath.h" + +//when read a pwlCurve, if two consecutive points are the same, then +//eliminate one of them. This makes the tessellator more robust. The spec +//assumes the application makes sure there are no redundant points. +//but in Inspector, the trim curves seem to have redundant points a lot. +//I guess other similar users may have the same problem. + +#define ELIMINATE_REDUNDANT_POINTS + +#ifdef ELIMINATE_REDUNDANT_POINTS +#define equal(x,y) ( glu_abs(x-y) <= 0.00001) +#endif + +#ifdef ELIMINATE_REDUNDANT_POINTS +O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts ) +{ + next = 0; + used = 0; + owner = 0; + pts = trimpts; + npts = (int) count; + int i; + + /* copy user data into internal trimming data structures */ + switch( _type ) { + case N_P2D: { + TrimVertex *v = pts; + TrimVertex *prev = NULL; + int num = 0; + int doit; + for(i=0; iparam[0], array[0]) && equal(prev->param[1], array[1])) + { + doit = 0; + } + } + + if(doit) + { + v->param[0] = (REAL) array[0]; + v->param[1] = (REAL) array[1]; + prev = v; + v++; + num++; + } + array = (INREAL *) (((char *) array) + byte_stride); + } + npts = num; + break; + } + case N_P2DR: { + TrimVertex *v = pts; + for( TrimVertex *lastv = v + count; v != lastv; v++ ) { + v->param[0] = (REAL) array[0] / (REAL) array[2]; + v->param[1] = (REAL) array[1] / (REAL) array[2]; + array = (INREAL *) (((char *) array) + byte_stride); + } + break; + } + } +} +#else +O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts ) +{ + next = 0; + used = 0; + owner = 0; + pts = trimpts; + npts = (int) count; + + /* copy user data into internal trimming data structures */ + switch( _type ) { + case N_P2D: { + TrimVertex *v = pts; + for( TrimVertex *lastv = v + count; v != lastv; v++ ) { + v->param[0] = (REAL) array[0]; + v->param[1] = (REAL) array[1]; + array = (INREAL *) (((char *) array) + byte_stride); + } + break; + } + case N_P2DR: { + TrimVertex *v = pts; + for( TrimVertex *lastv = v + count; v != lastv; v++ ) { + v->param[0] = (REAL) array[0] / (REAL) array[2]; + v->param[1] = (REAL) array[1] / (REAL) array[2]; + array = (INREAL *) (((char *) array) + byte_stride); + } + break; + } + } +} +#endif + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/reader.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,132 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * reader.h + * + */ + +#ifndef __glureader_h_ +#define __glureader_h_ + +#include "bufpool.h" +#include "types.h" + +enum Curvetype { ct_nurbscurve, ct_pwlcurve, ct_none }; + +struct Property; +struct O_surface; +struct O_nurbssurface; +struct O_trim; +class O_pwlcurve; +struct O_nurbscurve; +struct O_curve; +class Quilt; +class TrimVertex; + + +struct O_curve : public PooledObj { + union { + O_nurbscurve *o_nurbscurve; + O_pwlcurve *o_pwlcurve; + } curve; + Curvetype curvetype; /* arc type: pwl or nurbs */ + O_curve * next; /* next arc in loop */ + O_surface * owner; /* owning surface */ + int used; /* curve called in cur surf */ + int save; /* 1 if in display list */ + long nuid; + O_curve() { next = 0; used = 0; owner = 0; + curve.o_pwlcurve = 0; } + }; + +struct O_nurbscurve : public PooledObj { + Quilt *bezier_curves; /* array of bezier curves */ + long type; /* range descriptor */ + REAL tesselation; /* tesselation tolerance */ + int method; /* tesselation method */ + O_nurbscurve * next; /* next curve in list */ + int used; /* curve called in cur surf */ + int save; /* 1 if in display list */ + O_curve * owner; /* owning curve */ + O_nurbscurve( long _type ) + { type = _type; owner = 0; next = 0; used = 0; } + }; + +class O_pwlcurve : public PooledObj { +public: + TrimVertex *pts; /* array of trim vertices */ + int npts; /* number of trim vertices */ + O_pwlcurve * next; /* next curve in list */ + int used; /* curve called in cur surf */ + int save; /* 1 if in display list */ + O_curve * owner; /* owning curve */ + O_pwlcurve( long, long, INREAL *, long, TrimVertex * ); + }; + +struct O_trim : public PooledObj { + O_curve *o_curve; /* closed trim loop */ + O_trim * next; /* next loop along trim */ + int save; /* 1 if in display list */ + O_trim() { next = 0; o_curve = 0; } + }; + +struct O_nurbssurface : public PooledObj { + Quilt * bezier_patches;/* array of bezier patches */ + long type; /* range descriptor */ + O_surface * owner; /* owning surface */ + O_nurbssurface * next; /* next surface in chain */ + int save; /* 1 if in display list */ + int used; /* 1 if prev called in block */ + O_nurbssurface( long _type ) + { type = _type; owner = 0; next = 0; used = 0; } + }; + +struct O_surface : public PooledObj { + O_nurbssurface * o_nurbssurface; /* linked list of surfaces */ + O_trim * o_trim; /* list of trim loops */ + int save; /* 1 if in display list */ + long nuid; + O_surface() { o_trim = 0; o_nurbssurface = 0; } + }; + +struct Property : public PooledObj { + long type; + long tag; + REAL value; + int save; /* 1 if in display list */ + Property( long _type, long _tag, INREAL _value ) + { type = _type; tag = _tag; value = (REAL) _value; } + Property( long _tag, INREAL _value ) + { type = 0; tag = _tag; value = (REAL) _value; } + }; + +class NurbsTessellator; +#endif /* __glureader_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,133 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * renderhints.c++ + * + */ + +#include "glimports.h" +#include "mystdio.h" +#include "renderhints.h" +#include "defines.h" +#include "nurbsconsts.h" + + +/*-------------------------------------------------------------------------- + * Renderhints::Renderhints - set all window specific options + *-------------------------------------------------------------------------- + */ +Renderhints::Renderhints() +{ + display_method = N_FILL; + errorchecking = N_MSG; + subdivisions = 6.0; + tmp1 = 0.0; +} + +void +Renderhints::init( void ) +{ + maxsubdivisions = (int) subdivisions; + if( maxsubdivisions < 0 ) maxsubdivisions = 0; + + + if( display_method == N_FILL ) { + wiretris = 0; + wirequads = 0; + } else if( display_method == N_OUTLINE_TRI ) { + wiretris = 1; + wirequads = 0; + } else if( display_method == N_OUTLINE_QUAD ) { + wiretris = 0; + wirequads = 1; + } else { + wiretris = 1; + wirequads = 1; + } +} + +int +Renderhints::isProperty( long property ) +{ + switch ( property ) { + case N_DISPLAY: + case N_ERRORCHECKING: + case N_SUBDIVISIONS: + case N_TMP1: + return 1; + default: + return 0; + } +} + +REAL +Renderhints::getProperty( long property ) +{ + switch ( property ) { + case N_DISPLAY: + return display_method; + case N_ERRORCHECKING: + return errorchecking; + case N_SUBDIVISIONS: + return subdivisions; + case N_TMP1: + return tmp1; + default: + abort(); + return -1; //not necessary, needed to shut up compiler + } +} + +void +Renderhints::setProperty( long property, REAL value ) +{ + switch ( property ) { + case N_DISPLAY: + display_method = value; + break; + case N_ERRORCHECKING: + errorchecking = value; + break; + case N_SUBDIVISIONS: + subdivisions = value; + break; + case N_TMP1: /* unused */ + tmp1 = value; + break; + default: + abort(); + break; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/renderhints.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,60 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * renderhints.h + * + */ + +#ifndef __glurenderhints_h_ +#define __glurenderhints_h_ + +#include "types.h" + +class Renderhints { +public: + Renderhints( void ); + void init( void ); + int isProperty( long ); + REAL getProperty( long ); + void setProperty( long, REAL ); + + REAL display_method; /* display mode */ + REAL errorchecking; /* activate error checking */ + REAL subdivisions; /* maximum number of subdivisions per patch */ + REAL tmp1; /* unused */ + + int displaydomain; + int maxsubdivisions; + int wiretris; + int wirequads; +}; + +#endif /* __glurenderhints_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/simplemath.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/simplemath.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/simplemath.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/simplemath.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,50 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * simplemath.h + * + */ + +#ifndef __glusimplemath_h_ +#define __glusimplemath_h_ + +/* simple inline routines */ + +inline int +max( int x, int y ) { return ( x < y ) ? y : x; } + +inline REAL +min( REAL x, REAL y ) { return ( x > y ) ? y : x; } + +inline REAL +glu_abs( REAL x ) { return ( x < 0.0 ) ? -x : x; } + +#endif /* __glusimplemath_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1300 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * slicer.c++ + * + */ + +#include +#include +#include +#include "glimports.h" +#include "mystdio.h" +#include "myassert.h" +#include "bufpool.h" +#include "slicer.h" +#include "backend.h" +#include "arc.h" +#include "gridtrimvertex.h" +#include "simplemath.h" +#include "trimvertex.h" +#include "varray.h" + +#include "polyUtil.h" //for area() + +//static int count=0; + +/*USE_OPTTT is initiated in trimvertex.h*/ + +#ifdef USE_OPTTT + #include +#endif + +//#define USE_READ_FLAG //whether to use new or old tesselator + //if defined, it reads "flagFile", + // if the number is 1, then use new tess + // otherwise, use the old tess. + //if not defined, then use new tess. +#ifdef USE_READ_FLAG +static Int read_flag(char* name); +Int newtess_flag = read_flag("flagFile"); +#endif + +//#define COUNT_TRIANGLES +#ifdef COUNT_TRIANGLES +Int num_triangles = 0; +Int num_quads = 0; +#endif + +#define max(a,b) ((a>b)? a:b) +#define ZERO 0.00001 /*determing whether a loop is a rectngle or not*/ +#define equalRect(a,b) ((glu_abs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle + +#if 0 // UNUSED +static Int is_Convex(Arc_ptr loop) +{ + if(area(loop->tail(), loop->head(), loop->next->head()) <0 ) + return 0; + for(Arc_ptr jarc = loop->next; jarc != loop; jarc = jarc->next) + { + if(area(jarc->tail(), jarc->head(), jarc->next->head()) < 0) + return 0; + } + return 1; +} +#endif + +/******triangulate a monotone polygon**************/ +#include "monoTriangulation.h" +#if 0 // UNUSED +static int is_U_monotone(Arc_ptr loop) +{ + int n_changes=0; + int prev_sign; + int cur_sign; + Arc_ptr temp; + + cur_sign = compV2InX(loop->head(), loop->tail()); + + n_changes = (compV2InX(loop->prev->head(), loop->prev->tail()) + != cur_sign); + + for(temp=loop->next; temp != loop; temp = temp->next) + { + prev_sign = cur_sign; + cur_sign = compV2InX(temp->head(), temp->tail()); + if(cur_sign != prev_sign) + { +#ifdef DEBUG + printf("***change signe\n"); +#endif + n_changes++; + } + } + if(n_changes == 2) return 1; + else + return 0; +} +#endif + +inline int compInY(REAL a[2], REAL b[2]) +{ + if(a[1] < b[1]) + return -1; + else if (a[1] > b[1]) + return 1; + else if(a[0] > b[0]) + return 1; + else return -1; +} + +void monoTriangulationLoop(Arc_ptr loop, Backend& backend, primStream* pStream) +{ + int i; + //find the top, bottom, increasing and decreasing chain + //then call monoTrianulation + Arc_ptr jarc, temp; + Arc_ptr top; + Arc_ptr bot; + top = bot = loop; + if(compInY(loop->tail(), loop->prev->tail()) < 0) + { + //first find bot + for(temp = loop->next; temp != loop; temp = temp->next) + { + if(compInY(temp->tail(), temp->prev->tail()) > 0) + break; + } + bot = temp->prev; + //then find top + for(temp=loop->prev; temp != loop; temp = temp->prev) + { + if(compInY(temp->tail(), temp->prev->tail()) > 0) + break; + } + top = temp; + } + else //loop > loop->prev + { + for(temp=loop->next; temp != loop; temp = temp->next) + { + if(compInY(temp->tail(), temp->prev->tail()) < 0) + break; + } + top = temp->prev; + for(temp=loop->prev; temp != loop; temp = temp->prev) + { + if(compInY(temp->tail(), temp->prev->tail()) < 0) + break; + } + bot = temp; + } + //creat increase and decrease chains + vertexArray inc_chain(50); //this is a dynamci array + for(i=1; i<=top->pwlArc->npts-2; i++) + { + //the first vertex is the top which doesn't below to inc_chain + inc_chain.appendVertex(top->pwlArc->pts[i].param); + } + for(jarc=top->next; jarc != bot; jarc = jarc->next) + { + for(i=0; i<=jarc->pwlArc->npts-2; i++) + { + inc_chain.appendVertex(jarc->pwlArc->pts[i].param); + } + + } + vertexArray dec_chain(50); + for(jarc = top->prev; jarc != bot; jarc = jarc->prev) + { + for(i=jarc->pwlArc->npts-2; i>=0; i--) + { + dec_chain.appendVertex(jarc->pwlArc->pts[i].param); + } + } + for(i=bot->pwlArc->npts-2; i>=1; i--) + { + dec_chain.appendVertex(jarc->pwlArc->pts[i].param); + } + + monoTriangulationRec(top->tail(), bot->tail(), &inc_chain, 0, + &dec_chain, 0, &backend); + +} + +/********tesselate a rectanlge (OPTIMIZATION**************/ +static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend& backend); + +static Int is_rect(Arc_ptr loop) +{ + Int nlines =1; + for(Arc_ptr jarc = loop->next; jarc != loop; jarc = jarc->next) + { + nlines++; + if(nlines == 5) + break; + } + if(nlines != 4) + return 0; + + +/* +printf("here1\n"); +printf("loop->tail=(%f,%f)\n", loop->tail()[0], loop->tail()[1]); +printf("loop->head=(%f,%f)\n", loop->head()[0], loop->head()[1]); +printf("loop->next->tail=(%f,%f)\n", loop->next->tail()[0], loop->next->tail()[1]); +printf("loop->next->head=(%f,%f)\n", loop->next->head()[0], loop->next->head()[1]); +if(fglu_abs(loop->tail()[0] - loop->head()[0])<0.000001) + printf("equal 1\n"); +if(loop->next->tail()[1] == loop->next->head()[1]) + printf("equal 2\n"); +*/ + + if( (glu_abs(loop->tail()[0] - loop->head()[0])<=ZERO) && + (glu_abs(loop->next->tail()[1] - loop->next->head()[1])<=ZERO) && + (glu_abs(loop->prev->tail()[1] - loop->prev->head()[1])<=ZERO) && + (glu_abs(loop->prev->prev->tail()[0] - loop->prev->prev->head()[0])<=ZERO) + ) + return 1; + else if + ( (glu_abs(loop->tail()[1] - loop->head()[1]) <= ZERO) && + (glu_abs(loop->next->tail()[0] - loop->next->head()[0]) <= ZERO) && + (glu_abs(loop->prev->tail()[0] - loop->prev->head()[0]) <= ZERO) && + (glu_abs(loop->prev->prev->tail()[1] - loop->prev->prev->head()[1]) <= ZERO) + ) + return 1; + else + return 0; +} + + +//a line with the same u for opt +#ifdef USE_OPTTT +static void evalLineNOGE_BU(TrimVertex *verts, int n, Backend& backend) +{ + int i; + backend.preEvaluateBU(verts[0].param[0]); + for(i=0; itail()[1] == loop->head()[1]) + { + if(loop->tail()[1] > loop->prev->prev->tail()[1]) + { + + top = loop; + } + else{ + + top = loop->prev->prev; + } + } + else + { + if(loop->tail()[0] > loop->prev->prev->tail()[0]) + { + //loop is the right arc + + top = loop->next; + } + else + { + + top = loop->prev; + } + } + left = top->next; + bot = left->next; + right= bot->next; + + //if u, v are both nonlinear, then if the + //boundary is tessellated dense, we also + //sample the inside to get a better tesslletant. + if( (!ulinear) && (!vlinear)) + { + int nu = top->pwlArc->npts; + if(nu < bot->pwlArc->npts) + nu = bot->pwlArc->npts; + int nv = left->pwlArc->npts; + if(nv < right->pwlArc->npts) + nv = right->pwlArc->npts; +/* + if(nu > 2 && nv > 2) + { + triangulateRectGen(top, nu-2, nv-2, backend); + return; + } +*/ + } + + if(TB_or_LR == 1) + triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend); + else if(TB_or_LR == -1) + triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); + else + { + Int maxPointsTB = top->pwlArc->npts + bot->pwlArc->npts; + Int maxPointsLR = left->pwlArc->npts + right->pwlArc->npts; + + if(maxPointsTB < maxPointsLR) + triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); + else + triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend); + } +} + +static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* right, Backend& backend) +{ //if(maxPointsTB >= maxPointsLR) + { + + Int d, topd_left, topd_right, botd_left, botd_right, i,j; + d = left->npts /2; + +#ifdef USE_OPTTT + evalLineNOGE(top->pts, top->npts, backend); + evalLineNOGE(bot->pts, bot->npts, backend); + evalLineNOGE(left->pts, left->npts, backend); + evalLineNOGE(right->pts, right->npts, backend); +#endif + + if(top->npts == 2) { + backend.bgntfan(); + OPT_OUTVERT(top->pts[0], backend);//the root + for(i=0; inpts; i++){ + OPT_OUTVERT(left->pts[i], backend); + } + for(i=1; i<= bot->npts-2; i++){ + OPT_OUTVERT(bot->pts[i], backend); + } + backend.endtfan(); + + backend.bgntfan(); + OPT_OUTVERT(bot->pts[bot->npts-2], backend); + for(i=0; inpts; i++){ + OPT_OUTVERT(right->pts[i], backend); + } + backend.endtfan(); + } + else if(bot->npts == 2) { + backend.bgntfan(); + OPT_OUTVERT(bot->pts[0], backend);//the root + for(i=0; inpts; i++){ + OPT_OUTVERT(right->pts[i], backend); + } + for(i=1; i<= top->npts-2; i++){ + OPT_OUTVERT(top->pts[i], backend); + } + backend.endtfan(); + + backend.bgntfan(); + OPT_OUTVERT(top->pts[top->npts-2], backend); + for(i=0; inpts; i++){ + OPT_OUTVERT(left->pts[i], backend); + } + backend.endtfan(); + } + else { //both top and bot have >=3 points + + backend.bgntfan(); + + OPT_OUTVERT(top->pts[top->npts-2], backend); + + for(i=0; i<=d; i++) + { + OPT_OUTVERT(left->pts[i], backend); + } + backend.endtfan(); + + backend.bgntfan(); + + OPT_OUTVERT(bot->pts[1], backend); + + OPT_OUTVERT(top->pts[top->npts-2], backend); + + for(i=d; i< left->npts; i++) + { + OPT_OUTVERT(left->pts[i], backend); + } + backend.endtfan(); + + d = right->npts/2; + //output only when dnpts-1 and + // + if(dnpts-1) + { + backend.bgntfan(); + // backend.tmeshvert(& top->pts[1]); + OPT_OUTVERT(top->pts[1], backend); + for(i=d; i< right->npts; i++) + { + // backend.tmeshvert(& right->pts[i]); + + OPT_OUTVERT(right->pts[i], backend); + + } + backend.endtfan(); + } + + backend.bgntfan(); + // backend.tmeshvert(& bot->pts[bot->npts-2]); + OPT_OUTVERT( bot->pts[bot->npts-2], backend); + for(i=0; i<=d; i++) + { + // backend.tmeshvert(& right->pts[i]); + OPT_OUTVERT(right->pts[i], backend); + + } + + // backend.tmeshvert(& top->pts[1]); + OPT_OUTVERT(top->pts[1], backend); + + backend.endtfan(); + + + topd_left = top->npts-2; + topd_right = 1; //topd_left>= topd_right + + botd_left = 1; + botd_right = bot->npts-2; //botd_left<= bot_dright + + + if(top->npts < bot->npts) + { + int delta=bot->npts - top->npts; + int u = delta/2; + botd_left = 1+ u; + botd_right = bot->npts-2-( delta-u); + + if(botd_left >1) + { + backend.bgntfan(); + // backend.tmeshvert(& top->pts[top->npts-2]); + OPT_OUTVERT(top->pts[top->npts-2], backend); + for(i=1; i<= botd_left; i++) + { + // backend.tmeshvert(& bot->pts[i]); + OPT_OUTVERT(bot->pts[i] , backend); + } + backend.endtfan(); + } + if(botd_right < bot->npts-2) + { + backend.bgntfan(); + OPT_OUTVERT(top->pts[1], backend); + for(i=botd_right; i<= bot->npts-2; i++) + OPT_OUTVERT(bot->pts[i], backend); + backend.endtfan(); + } + } + else if(top->npts> bot->npts) + { + int delta=top->npts-bot->npts; + int u = delta/2; + topd_left = top->npts-2 - u; + topd_right = 1+delta-u; + + if(topd_left < top->npts-2) + { + backend.bgntfan(); + // backend.tmeshvert(& bot->pts[1]); + OPT_OUTVERT(bot->pts[1], backend); + for(i=topd_left; i<= top->npts-2; i++) + { + // backend.tmeshvert(& top->pts[i]); + OPT_OUTVERT(top->pts[i], backend); + } + backend.endtfan(); + } + if(topd_right > 1) + { + backend.bgntfan(); + OPT_OUTVERT(bot->pts[bot->npts-2], backend); + for(i=1; i<= topd_right; i++) + OPT_OUTVERT(top->pts[i], backend); + backend.endtfan(); + } + } + + if(topd_left <= topd_right) + return; + + backend.bgnqstrip(); + for(j=botd_left, i=topd_left; i>=topd_right; i--,j++) + { + // backend.tmeshvert(& top->pts[i]); + // backend.tmeshvert(& bot->pts[j]); + OPT_OUTVERT(top->pts[i], backend); + OPT_OUTVERT(bot->pts[j], backend); + } + backend.endqstrip(); + + } + } +} + + +static void triangulateRectCenter(int n_ulines, REAL* u_val, + int n_vlines, REAL* v_val, + Backend& backend) +{ + + // XXX this code was patched by Diego Santa Cruz + // to fix a problem in which glMapGrid2f() was called with bad parameters. + // This has beens submitted to SGI but not integrated as of May 1, 2001. + if(n_ulines>1 && n_vlines>1) { + backend.surfgrid(u_val[0], u_val[n_ulines-1], n_ulines-1, + v_val[n_vlines-1], v_val[0], n_vlines-1); + backend.surfmesh(0,0,n_ulines-1,n_vlines-1); + } + + return; + + /* + for(i=0; ipwlArc->npts); + assert(upper_val); + if(dir) + { + for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++) + { + upper_val[k] = arc->pwlArc->pts[i].param[0]; + } + backend.evalUStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], + upper_val, + n_ulines, v, u_val); + } + else + { + for(k=0,i=0; ipwlArc->npts; i++,k++) + { + upper_val[k] = arc->pwlArc->pts[i].param[0]; + + } + + backend.evalUStrip( + n_ulines, v, u_val, + arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], upper_val + ); + } + + free(upper_val); + return; + } + else //is_v + { + int i,k; + REAL* left_val = (REAL*) malloc(sizeof(REAL) * arc->pwlArc->npts); + assert(left_val); + if(dir) + { + for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++) + { + left_val[k] = arc->pwlArc->pts[i].param[1]; + } + backend.evalVStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[0], + left_val, + n_ulines, v, u_val); + } + else + { + for(k=0,i=0; ipwlArc->npts; i++,k++) + { + left_val[k] = arc->pwlArc->pts[i].param[1]; + } + backend.evalVStrip( + n_ulines, v, u_val, + arc->pwlArc->npts, arc->pwlArc->pts[0].param[0], left_val + ); + } + free(left_val); + return; + } + + //the following is a different version of the above code. If you comment + //the above code, the following code will still work. The reason to leave + //the folliwng code here is purely for testing purpose. + /* + int i,j; + PwlArc* parc = arc->pwlArc; + int d1 = parc->npts-1; + int d2 = 0; + TrimVertex trimVert; + trimVert.nuid = 0;//???? + REAL* temp_u_val = u_val; + if(dir ==0) //have to reverse u_val + { + temp_u_val = (REAL*) malloc(sizeof(REAL) * n_ulines); + assert(temp_u_val); + for(i=0; inpts > n_ulines) + { + d1 = n_ulines-1; + + backend.bgntfan(); + if(is_u){ + trimVert.param[0] = u_val[0]; + trimVert.param[1] = v; + } + else + { + trimVert.param[1] = u_val[0]; + trimVert.param[0] = v; + } + + backend.tmeshvert(& trimVert); + for(i=d1; i< parc->npts; i++) + backend.tmeshvert(& parc->pts[i]); + backend.endtfan(); + + + } + else if(parc->npts < n_ulines) + { + d2 = n_ulines-parc->npts; + + + backend.bgntfan(); + backend.tmeshvert(& parc->pts[parc->npts-1]); + for(i=0; i<= d2; i++) + { + if(is_u){ + trimVert.param[0] = u_val[i]; + trimVert.param[1] = v; + } + else + { + trimVert.param[1] = u_val[i]; + trimVert.param[0] = v; + } + backend.tmeshvert(&trimVert); + } + backend.endtfan(); + + } + if(d1>0){ + + + backend.bgnqstrip(); + for(i=d1, j=d2; i>=0; i--, j++) + { + backend.tmeshvert(& parc->pts[i]); + + if(is_u){ + trimVert.param[0] = u_val[j]; + trimVert.param[1] = v; + } + else{ + trimVert.param[1] = u_val[j]; + trimVert.param[0] = v; + } + backend.tmeshvert(&trimVert); + + + + } + backend.endqstrip(); + + + } + if(dir == 0) //temp_u_val was mallocated + free(temp_u_val); + */ +} + +//n_ulines is the number of ulines inside, and n_vlines is the number of vlines +//inside, different from meanings elsewhere!!! +static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend& backend) +{ + + int i; + //we know the loop is a rectangle, but not sure which is top + Arc_ptr top, bot, left, right; + + if(equalRect(loop->tail()[1] , loop->head()[1])) + { + + if(loop->tail()[1] > loop->prev->prev->tail()[1]) + { + + top = loop; + } + else{ + + top = loop->prev->prev; + } + } + else + { + if(loop->tail()[0] > loop->prev->prev->tail()[0]) + { + //loop is the right arc + + top = loop->next; + } + else + { + + top = loop->prev; + } + } + + left = top->next; + bot = left->next; + right= bot->next; + +#ifdef COUNT_TRIANGLES + num_triangles += loop->pwlArc->npts + + left->pwlArc->npts + + bot->pwlArc->npts + + right->pwlArc->npts + + 2*n_ulines + 2*n_vlines + -8; + num_quads += (n_ulines-1)*(n_vlines-1); +#endif +/* + backend.surfgrid(left->tail()[0], right->tail()[0], n_ulines+1, + top->tail()[1], bot->tail()[1], n_vlines+1); +// if(n_ulines>1 && n_vlines>1) + backend.surfmesh(0,0,n_ulines+1,n_vlines+1); +return; +*/ + REAL* u_val=(REAL*) malloc(sizeof(REAL)*n_ulines); + assert(u_val); + REAL* v_val=(REAL*)malloc(sizeof(REAL) * n_vlines); + assert(v_val); + REAL u_stepsize = (right->tail()[0] - left->tail()[0])/( (REAL) n_ulines+1); + REAL v_stepsize = (top->tail()[1] - bot->tail()[1])/( (REAL) n_vlines+1); + Real temp=left->tail()[0]+u_stepsize; + for(i=0; itail()[1] + v_stepsize; + for(i=0; ipwlArc->npts); + for(i=0; ipwlArc->npts; i++) + { + vert[0] = arc->pwlArc->pts[i].param[0]; + vert[1] = arc->pwlArc->pts[i].param[1]; + sline->setPoint(i, vert); + } + ret = new directedLine(INCREASING, sline); + return ret; +} + +/*an pwlArc may not be a straight line*/ +directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc) +{ + directedLine* ret = original; + int is_linear = 0; + if(arc->pwlArc->npts == 2 ) + is_linear = 1; + else if(area(arc->pwlArc->pts[0].param, arc->pwlArc->pts[1].param, arc->pwlArc->pts[arc->pwlArc->npts-1].param) == 0.0) + is_linear = 1; + + if(is_linear) + { + directedLine *dline = arcToDLine(arc); + if(ret == NULL) + ret = dline; + else + ret->insert(dline); + return ret; + } + else /*not linear*/ + { + for(Int i=0; ipwlArc->npts-1; i++) + { + Real vert[2][2]; + vert[0][0] = arc->pwlArc->pts[i].param[0]; + vert[0][1] = arc->pwlArc->pts[i].param[1]; + vert[1][0] = arc->pwlArc->pts[i+1].param[0]; + vert[1][1] = arc->pwlArc->pts[i+1].param[1]; + + sampledLine *sline = new sampledLine(2, vert); + directedLine *dline = new directedLine(INCREASING, sline); + if(ret == NULL) + ret = dline; + else + ret->insert(dline); + } + return ret; + } +} + + + +directedLine* arcLoopToDLineLoop(Arc_ptr loop) +{ + directedLine* ret; + + if(loop == NULL) + return NULL; + ret = arcToMultDLines(NULL, loop); +//ret->printSingle(); + for(Arc_ptr temp = loop->next; temp != loop; temp = temp->next){ + ret = arcToMultDLines(ret, temp); +//ret->printSingle(); + } + + return ret; +} + +/* +void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) +{ + TrimVertex *trimVert = (TrimVertex*)malloc(sizeof(TrimVertex)); + trimVert -> nuid = 0;//???? + + Real* u_values = grid->get_u_values(); + Real* v_values = grid->get_v_values(); + + Int i,j,k,l; + + for(l=0; lget_n_elements(); l++) + { + rectBlock* block = rbArray->get_element(l); + for(k=0, i=block->get_upGridLineIndex(); i>block->get_lowGridLineIndex(); i--, k++) + { + + backend.bgnqstrip(); + for(j=block->get_leftIndices()[k+1]; j<= block->get_rightIndices()[k+1]; j++) + { + trimVert->param[0] = u_values[j]; + trimVert->param[1] = v_values[i]; + backend.tmeshvert(trimVert); + + trimVert->param[1] = v_values[i-1]; + backend.tmeshvert(trimVert); + + } + backend.endqstrip(); + + } + } + + free(trimVert); +} +*/ + +void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) +{ + Int i,j,k; + + Int n_vlines=grid->get_n_vlines(); + //the reason to switch the position of v_max and v_min is because of the + //the orientation problem. glEvalMesh generates quad_strip clockwise, but + //we need counter-clockwise. + backend.surfgrid(grid->get_u_min(), grid->get_u_max(), grid->get_n_ulines()-1, + grid->get_v_max(), grid->get_v_min(), n_vlines-1); + + + for(j=0; jget_n_elements(); j++) + { + rectBlock* block = rbArray->get_element(j); + Int low = block->get_lowGridLineIndex(); + Int high = block->get_upGridLineIndex(); + + for(k=0, i=high; i>low; i--, k++) + { + backend.surfmesh(block->get_leftIndices()[k+1], n_vlines-1-i, block->get_rightIndices()[k+1]-block->get_leftIndices()[k+1], 1); + } + } +} + + +void Slicer::evalStream(primStream* pStream) +{ + Int i,j,k; + k=0; +/* TrimVertex X;*/ + TrimVertex *trimVert =/*&X*/ (TrimVertex*)malloc(sizeof(TrimVertex)); + trimVert -> nuid = 0;//??? + Real* vertices = pStream->get_vertices(); //for efficiency + for(i=0; iget_n_prims(); i++) + { + + //ith primitive has #vertices = lengths[i], type=types[i] + switch(pStream->get_type(i)){ + case PRIMITIVE_STREAM_FAN: + + backend.bgntfan(); + + for(j=0; jget_length(i); j++) + { + trimVert->param[0] = vertices[k]; + trimVert->param[1] = vertices[k+1]; + backend.tmeshvert(trimVert); + +// backend.tmeshvert(vertices[k], vertices[k+1]); + k += 2; + } + backend.endtfan(); + break; + + default: + fprintf(stderr, "evalStream: not implemented yet\n"); + exit(1); + + } + } + free(trimVert); +} + + + + +void Slicer::slice_new(Arc_ptr loop) +{ +//count++; +//if(count == 78) count=1; +//printf("count=%i\n", count); +//if( ! (4<= count && count <=4)) return; + + + Int num_ulines; + Int num_vlines; + Real uMin, uMax, vMin, vMax; + Real mydu, mydv; + uMin = uMax = loop->tail()[0]; + vMin = vMax = loop->tail()[1]; + mydu = (du>0)? du: -du; + mydv = (dv>0)? dv: -dv; + + for(Arc_ptr jarc=loop->next; jarc != loop; jarc = jarc->next) + { + + if(jarc->tail()[0] < uMin) + uMin = jarc->tail()[0]; + if(jarc->tail()[0] > uMax) + uMax = jarc->tail()[0]; + if(jarc->tail()[1] < vMin) + vMin = jarc->tail()[1]; + if(jarc->tail()[1] > vMax) + vMax = jarc->tail()[1]; + } + + if (uMax == uMin) + return; // prevent divide-by-zero. Jon Perry. 17 June 2002 + + if(mydu > uMax - uMin) + num_ulines = 2; + else + { + num_ulines = 3 + (Int) ((uMax-uMin)/mydu); + } + if(mydv>=vMax-vMin) + num_vlines = 2; + else + { + num_vlines = 2+(Int)((vMax-vMin)/mydv); + } + + Int isRect = is_rect(loop); + + if(isRect && (num_ulines<=2 || num_vlines<=2)) + { + if(vlinear) + triangulateRect(loop, backend, 1, ulinear, vlinear); + else if(ulinear) + triangulateRect(loop, backend, -1, ulinear, vlinear); + else + triangulateRect(loop, backend, 0, ulinear, vlinear); + } + + else if(isRect) + { + triangulateRectGen(loop, num_ulines-2, num_vlines-2, backend); + } + else if( (num_ulines<=2 || num_vlines <=2) && ulinear) + { + monoTriangulationFunBackend(loop, compV2InY, &backend); + } + else if( (!ulinear) && (!vlinear) && (num_ulines == 2) && (num_vlines > 2)) + { + monoTriangulationFunBackend(loop, compV2InY, &backend); + } + else + { + directedLine* poly = arcLoopToDLineLoop(loop); + + gridWrap grid(num_ulines, num_vlines, uMin, uMax, vMin, vMax); + primStream pStream(20, 20); + rectBlockArray rbArray(20); + + sampleMonoPoly(poly, &grid, ulinear, vlinear, &pStream, &rbArray); + + evalStream(&pStream); + + evalRBArray(&rbArray, &grid); + +#ifdef COUNT_TRIANGLES + num_triangles += pStream.num_triangles(); + num_quads += rbArray.num_quads(); +#endif + poly->deleteSinglePolygonWithSline(); + } + +#ifdef COUNT_TRIANGLES + printf("num_triangles=%i\n", num_triangles); + printf("num_quads = %i\n", num_quads); +#endif +} + +void Slicer::slice(Arc_ptr loop) +{ +#ifdef USE_READ_FLAG + if(read_flag("flagFile")) + slice_new(loop); + else + slice_old(loop); + +#else + slice_new(loop); +#endif + +} + + + +Slicer::Slicer( Backend &b ) + : CoveAndTiler( b ), Mesher( b ), backend( b ) +{ + ulinear = 0; + vlinear = 0; +} + +Slicer::~Slicer() +{ +} + +void +Slicer::setisolines( int x ) +{ + isolines = x; +} + +void +Slicer::setstriptessellation( REAL x, REAL y ) +{ + assert(x > 0 && y > 0); + du = x; + dv = y; + setDu( du ); +} + +void +Slicer::slice_old( Arc_ptr loop ) +{ + loop->markverts(); + + Arc_ptr extrema[4]; + loop->getextrema( extrema ); + + unsigned int npts = loop->numpts(); + TrimRegion::init( npts, extrema[0] ); + + Mesher::init( npts ); + + long ulines = uarray.init( du, extrema[1], extrema[3] ); +//printf("ulines = %i\n", ulines); + Varray varray; + long vlines = varray.init( dv, extrema[0], extrema[2] ); +//printf("vlines = %i\n", vlines); + long botv = 0; + long topv; + TrimRegion::init( varray.varray[botv] ); + getGridExtent( &extrema[0]->pwlArc->pts[0], &extrema[0]->pwlArc->pts[0] ); + + for( long quad=0; quadmarkverts(); + + if( jarc->pwlArc->npts >= 2 ) { + backend.bgnoutline(); + for( int j = jarc->pwlArc->npts-1; j >= 0; j-- ) + backend.linevert( &(jarc->pwlArc->pts[j]) ); + backend.endoutline(); + } +} + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/slicer.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,84 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * slicer.h + * + */ + +#ifndef __gluslicer_h_ +#define __gluslicer_h_ + +#include "trimregion.h" +#include "mesher.h" +#include "coveandtiler.h" +#include "primitiveStream.h" +#include "rectBlock.h" + +class Backend; +class Arc; +class TrimVertex; + +class Slicer : public CoveAndTiler, public Mesher { +public: + Slicer( Backend & ); + ~Slicer( void ); + void slice( Arc_ptr ); + void slice_old( Arc_ptr); + void slice_new( Arc_ptr ); + void evalStream(primStream* ); + void evalRBArray(rectBlockArray* rbArray, gridWrap* grid); + + void outline( Arc_ptr ); + void setstriptessellation( REAL, REAL ); + void setisolines( int ); + + void set_ulinear(int ulinear_flag) + { + ulinear = ulinear_flag; + } + void set_vlinear(int vlinear_flag) + { + vlinear = vlinear_flag; + } +private: + Backend& backend; + REAL oneOverDu; + REAL du, dv; + int isolines; + + void outline( void ); + void initGridlines( void ); + void advanceGridlines( long ); + + int ulinear; //indicate whether uorder is 2 or not + int vlinear; //indicate whether vorder is 2 or not +}; +#endif /* __gluslicer_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,139 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * sorter.c++ + * + */ + +#include "glimports.h" +#include "sorter.h" +#include "mystdio.h" + +Sorter::Sorter( int _es ) +{ + es = _es; +} + +void +Sorter::qsort( void *a, int n ) +{ + qs1( (char *)a, ((char *)a)+n*es); +} + +int +Sorter::qscmp( char *, char * ) +{ + _glu_dprintf( "Sorter::qscmp: pure virtual called\n" ); + return 0; +} + + +void +Sorter::qsexc( char *, char * ) +{ + _glu_dprintf( "Sorter::qsexc: pure virtual called\n" ); +} + + +void +Sorter::qstexc( char *, char *, char * ) +{ + _glu_dprintf( "Sorter::qstexc: pure virtual called\n" ); +} + +void +Sorter::qs1( char *a, char *l ) +{ + char *i, *j; + char *lp, *hp; + int c; + unsigned int n; + +start: + if((n=l-a) <= (unsigned int)es) + return; + n = es * (n / (2*es)); + hp = lp = a+n; + i = a; + j = l-es; + while(1) { + if(i < lp) { + if((c = qscmp(i, lp)) == 0) { + qsexc(i, lp -= es); + continue; + } + if(c < 0) { + i += es; + continue; + } + } + +loop: + if(j > hp) { + if((c = qscmp(hp, j)) == 0) { + qsexc(hp += es, j); + goto loop; + } + if(c > 0) { + if(i == lp) { + qstexc(i, hp += es, j); + i = lp += es; + goto loop; + } + qsexc(i, j); + j -= es; + i += es; + continue; + } + j -= es; + goto loop; + } + + if(i == lp) { + if(lp-a >= l-hp) { + qs1(hp+es, l); + l = lp; + } else { + qs1(a, lp); + a = hp+es; + } + goto start; + } + + qstexc(j, lp -= es, i); + j = hp -= es; + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/sorter.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,51 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef __glusorter_h_ +#define __glusorter_h_ + +class Sorter { +public: + Sorter( int es ); + virtual ~Sorter() { /* silence warning*/ } + void qsort( void *a, int n ); + +protected: + virtual int qscmp( char *, char * ); + virtual void qsexc( char *i, char *j ); // i<-j, j<-i + virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i + +private: + void qs1( char *, char * ); + int es; +}; +#endif /* __glusorter_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,293 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * splitarcs.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mysetjmp.h" +#include "mystdio.h" +#include "subdivider.h" +#include "arcsorter.h" +#include "arc.h" +#include "bin.h" + +/* local preprocessor definitions */ +#define MAXARCS 10 + +/*---------------------------------------------------------------------------- + * Subdivider::split - split trim regions in source bin by line (param == value). + *---------------------------------------------------------------------------- + */ + +void +Subdivider::split( Bin& bin, Bin& left, Bin& right, int param, REAL value ) +{ + Bin intersections, unknown; + + partition( bin, left, intersections, right, unknown, param, value ); + + int count = intersections.numarcs(); + if( count % 2 ) { +#ifndef NDEBUG + left.show( "left" ); + intersections.show( "intersections" ); + right.show( "right" ); +#endif + ::mylongjmp( jumpbuffer, 29 ); + } + + Arc_ptr arclist[MAXARCS], *list; + if( count >= MAXARCS ) { + list = new Arc_ptr[count]; + } else { + list = arclist; + } + + Arc_ptr jarc, *last, *lptr; + for( last = list; (jarc=intersections.removearc()) != NULL; last++ ) + *last = jarc; + + if( param == 0 ) { /* sort into increasing t order */ + ArcSdirSorter sorter(*this); + sorter.qsort( list, count ); + + //::qsort ((void *)list, count, sizeof(Arc_ptr), (cmpfunc)compare_s); + for( lptr=list; lptrhead()[0] <= value) && ((*lptr)->tail()[0] <= value) ) + left.addarc( *lptr ); + else + right.addarc( *lptr ); + } + } else { /* sort into decreasing s order */ + ArcTdirSorter sorter(*this); + sorter.qsort( list, count ); + //::qsort ((void *)list, count, sizeof(Arc_ptr), (cmpfunc)compare_t); + for( lptr=list; lptrhead()[1] <= value) && ((*lptr)->tail()[1] <= value) ) + left.addarc( *lptr ); + else + right.addarc( *lptr ); + } + } + + if( list != arclist ) delete[] list; + unknown.adopt(); +} + + +void +Subdivider::check_s( Arc_ptr jarc1, Arc_ptr jarc2 ) +{ + assert( jarc1->check( ) != 0 ); + assert( jarc2->check( ) != 0 ); + assert( jarc1->next->check( ) != 0 ); + assert( jarc2->next->check( ) != 0 ); + assert( jarc1 != jarc2 ); + + /* XXX - if these assertions fail, it is due to user error or + undersampling */ + if( ! ( jarc1->tail()[0] < (jarc1)->head()[0] ) ) { +#ifndef NDEBUG + _glu_dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] ); +#endif + ::mylongjmp( jumpbuffer, 28 ); + } + + if( ! ( jarc2->tail()[0] > (jarc2)->head()[0] ) ) { +#ifndef NDEBUG + _glu_dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] ); +#endif + ::mylongjmp( jumpbuffer, 28 ); + } +} + +inline void +Subdivider::link( Arc_ptr jarc1, Arc_ptr jarc2, Arc_ptr up, Arc_ptr down ) +{ + up->nuid = down->nuid = 0; // XXX + + up->next = jarc2; + down->next = jarc1; + up->prev = jarc1->prev; + down->prev = jarc2->prev; + + down->next->prev = down; + up->next->prev = up; + down->prev->next = down; + up->prev->next = up; +} + +inline void +Subdivider::simple_link( Arc_ptr jarc1, Arc_ptr jarc2 ) +{ + Arc_ptr tmp = jarc2->prev; + jarc2->prev = jarc1->prev; + jarc1->prev = tmp; + jarc2->prev->next = jarc2; + jarc1->prev->next = jarc1; +} + + +/*---------------------------------------------------------------------------- + * join - add a pair of oppositely directed jordan arcs between two arcs + *---------------------------------------------------------------------------- + */ + +void +Subdivider::join_s( Bin& left, Bin& right, Arc_ptr jarc1, Arc_ptr jarc2 ) +{ + assert( jarc1->check( ) != 0); + assert( jarc2->check( ) != 0); + assert( jarc1 != jarc2 ); + + if( ! jarc1->getitail() ) + jarc1 = jarc1->next; + + if( ! jarc2->getitail() ) + jarc2 = jarc2->next; + + REAL s = jarc1->tail()[0]; + REAL t1 = jarc1->tail()[1]; + REAL t2 = jarc2->tail()[1]; + + if( t1 == t2 ) { + simple_link( jarc1, jarc2 ); + } else { + Arc_ptr newright = new(arcpool) Arc( arc_right, 0 ); + Arc_ptr newleft = new(arcpool) Arc( arc_left, 0 ); + assert( t1 < t2 ); + if( isBezierArcType() ) { + arctessellator.bezier( newright, s, s, t1, t2 ); + arctessellator.bezier( newleft, s, s, t2, t1 ); + } else { + arctessellator.pwl_right( newright, s, t1, t2, stepsizes[0] ); + arctessellator.pwl_left( newleft, s, t2, t1, stepsizes[2] ); + } + link( jarc1, jarc2, newright, newleft ); + left.addarc( newright ); + right.addarc( newleft ); + } + + assert( jarc1->check( ) != 0 ); + assert( jarc2->check( ) != 0 ); + assert( jarc1->next->check( ) != 0); + assert( jarc2->next->check( ) != 0); +} + +void +Subdivider::check_t( Arc_ptr jarc1, Arc_ptr jarc2 ) +{ + assert( jarc1->check( ) != 0 ); + assert( jarc2->check( ) != 0 ); + assert( jarc1->next->check( ) != 0 ); + assert( jarc2->next->check( ) != 0 ); + assert( jarc1 != jarc2 ); + + /* XXX - if these assertions fail, it is due to user error or + undersampling */ + if( ! ( jarc1->tail()[1] < (jarc1)->head()[1] ) ) { +#ifndef NDEBUG + _glu_dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] ); +#endif + ::mylongjmp( jumpbuffer, 28 ); + } + + if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) { +#ifndef NDEBUG + _glu_dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] ); +#endif + ::mylongjmp( jumpbuffer, 28 ); + } +} + +/*---------------------------------------------------------------------------- + * join_t - add a pair of oppositely directed jordan arcs between two arcs + *---------------------------------------------------------------------------- + */ + +void +Subdivider::join_t( Bin& bottom, Bin& top, Arc_ptr jarc1, Arc_ptr jarc2 ) +{ + assert( jarc1->check( ) != 0 ); + assert( jarc2->check( ) != 0 ); + assert( jarc1->next->check( ) != 0 ); + assert( jarc2->next->check( ) != 0 ); + assert( jarc1 != jarc2 ); + + if( ! jarc1->getitail() ) + jarc1 = jarc1->next; + + if( ! jarc2->getitail() ) + jarc2 = jarc2->next; + + REAL s1 = jarc1->tail()[0]; + REAL s2 = jarc2->tail()[0]; + REAL t = jarc1->tail()[1]; + + if( s1 == s2 ) { + simple_link( jarc1, jarc2 ); + } else { + Arc_ptr newtop = new(arcpool) Arc( arc_top, 0 ); + Arc_ptr newbot = new(arcpool) Arc( arc_bottom, 0 ); + assert( s1 > s2 ); + if( isBezierArcType() ) { + arctessellator.bezier( newtop, s1, s2, t, t ); + arctessellator.bezier( newbot, s2, s1, t, t ); + } else { + arctessellator.pwl_top( newtop, t, s1, s2, stepsizes[1] ); + arctessellator.pwl_bottom( newbot, t, s2, s1, stepsizes[3] ); + } + link( jarc1, jarc2, newtop, newbot ); + bottom.addarc( newtop ); + top.addarc( newbot ); + } + + assert( jarc1->check( ) != 0 ); + assert( jarc2->check( ) != 0 ); + assert( jarc1->next->check( ) != 0 ); + assert( jarc2->next->check( ) != 0 ); +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,910 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * subdivider.cxx + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "subdivider.h" +#include "arc.h" +#include "bezierarc.h" +#include "bin.h" +#include "renderhints.h" +#include "backend.h" +#include "mapdesc.h" +#include "quilt.h" +#include "patchlist.h" +#include "patch.h" +#include "nurbsconsts.h" +#include "trimvertpool.h" +#include "simplemath.h" + +#include "polyUtil.h" //for function area() + +//#define PARTITION_TEST +#ifdef PARTITION_TEST +#include "partitionY.h" +#include "monoTriangulation.h" +#include "dataTransform.h" +#include "monoChain.h" + +#endif + + +#define OPTIMIZE_UNTRIMED_CASE + + +Bin* +Subdivider::makePatchBoundary( const REAL *from, const REAL *to ) +{ + Bin* ret = new Bin(); + REAL smin = from[0]; + REAL smax = to[0]; + REAL tmin = from[1]; + REAL tmax = to[1]; + + pjarc = 0; + + Arc_ptr jarc = new(arcpool) Arc( arc_bottom, 0 ); + arctessellator.bezier( jarc, smin, smax, tmin, tmin ); + ret->addarc( jarc ); + pjarc = jarc->append( pjarc ); + + jarc = new(arcpool) Arc( arc_right, 0 ); + arctessellator.bezier( jarc, smax, smax, tmin, tmax ); + ret->addarc( jarc ); + pjarc = jarc->append( pjarc ); + + jarc = new(arcpool) Arc( arc_top, 0 ); + arctessellator.bezier( jarc, smax, smin, tmax, tmax ); + ret->addarc( jarc ); + pjarc = jarc->append( pjarc ); + + jarc = new(arcpool) Arc( arc_left, 0 ); + arctessellator.bezier( jarc, smin, smin, tmax, tmin ); + ret->addarc( jarc ); + jarc->append( pjarc ); + + assert( jarc->check() != 0 ); + return ret; +} + +/*--------------------------------------------------------------------------- + * Subdivider - construct a subdivider + *--------------------------------------------------------------------------- + */ + +Subdivider::Subdivider( Renderhints& r, Backend& b ) + : slicer( b ), + arctessellator( trimvertexpool, pwlarcpool ), + arcpool( sizeof( Arc), 1, "arcpool" ), + bezierarcpool( sizeof( BezierArc ), 1, "Bezarcpool" ), + pwlarcpool( sizeof( PwlArc ), 1, "Pwlarcpool" ), + renderhints( r ), + backend( b ) +{ +} + +void +Subdivider::setJumpbuffer( JumpBuffer *j ) +{ + jumpbuffer = j; +} + +/*--------------------------------------------------------------------------- + * clear - reset all state after possible error condition + *--------------------------------------------------------------------------- + */ + +void +Subdivider::clear( void ) +{ + trimvertexpool.clear(); + arcpool.clear(); + pwlarcpool.clear(); + bezierarcpool.clear(); +} + +/*--------------------------------------------------------------------------- + * ~Subdivider - destroy a subdivider + *--------------------------------------------------------------------------- + */ + +Subdivider::~Subdivider( void ) +{ +} + +/*--------------------------------------------------------------------------- + * addArc - add a bezier arc to a trim loop and to a bin + *--------------------------------------------------------------------------- + */ +void +Subdivider::addArc( REAL *cpts, Quilt *quilt, long _nuid ) +{ + BezierArc *bezierArc = new(bezierarcpool) BezierArc; + Arc *jarc = new(arcpool) Arc( arc_none, _nuid ); + jarc->pwlArc = 0; + jarc->bezierArc = bezierArc; + bezierArc->order = quilt->qspec->order; + bezierArc->stride = quilt->qspec->stride; + bezierArc->mapdesc = quilt->mapdesc; + bezierArc->cpts = cpts; + initialbin.addarc( jarc ); + pjarc = jarc->append( pjarc ); +} + +/*--------------------------------------------------------------------------- + * addArc - add a pwl arc to a trim loop and to a bin + *--------------------------------------------------------------------------- + */ + +void +Subdivider::addArc( int npts, TrimVertex *pts, long _nuid ) +{ + Arc *jarc = new(arcpool) Arc( arc_none, _nuid ); + jarc->pwlArc = new(pwlarcpool) PwlArc( npts, pts ); + initialbin.addarc( jarc ); + pjarc = jarc->append( pjarc ); +} + +void +Subdivider::beginQuilts( void ) +{ + qlist = 0; +} + +void +Subdivider::addQuilt( Quilt *quilt ) +{ + quilt->next = qlist; + qlist = quilt; +} + +/*--------------------------------------------------------------------------- + * drawSurfaces - main entry point for surface tessellation + *--------------------------------------------------------------------------- + */ + +void +Subdivider::drawSurfaces( long nuid ) +{ + renderhints.init( ); + + if (qlist == NULL) + { + //initialbin could be nonempty due to some errors + freejarcs(initialbin); + return; + } + + for( Quilt *q = qlist; q; q = q->next ) { + if( q->isCulled( ) == CULL_TRIVIAL_REJECT ) { + freejarcs( initialbin ); + return; + } + } + + + REAL from[2], to[2]; + qlist->getRange( from, to, spbrkpts, tpbrkpts ); +#ifdef OPTIMIZE_UNTRIMED_CASE + //perform optimization only when the samplng method is + //DOMAIN_DISTANCE and the display methdo is either + //fill or outline_polygon. + int optimize = (is_domain_distance_sampling && (renderhints.display_method != N_OUTLINE_PATCH)); +#endif + + if( ! initialbin.isnonempty() ) { +#ifdef OPTIMIZE_UNTRIMED_CASE + if(! optimize ) + { + + makeBorderTrim( from, to ); + } +#else + makeBorderTrim( from, to ); +#endif + } else { + REAL rate[2]; + qlist->findRates( spbrkpts, tpbrkpts, rate ); + + if( decompose( initialbin, min(rate[0], rate[1]) ) ) + mylongjmp( jumpbuffer, 31 ); + } + + backend.bgnsurf( renderhints.wiretris, renderhints.wirequads, nuid ); + +#ifdef PARTITION_TEST + if( initialbin.isnonempty() && spbrkpts.end-2 == spbrkpts.start && + tpbrkpts.end-2 == tpbrkpts.start) +{ + for(int i=spbrkpts.start; idownloadAll(pta, ptb, backend); + + directedLine *poly; + + { + + poly = bin_to_DLineLoops(initialbin); + + poly=poly->deleteDegenerateLinesAllPolygons(); + + sampledLine* retSampledLines; +//printf("before MC_partition\n"); + poly = MC_partitionY(poly, &retSampledLines); +//printf("after MC_partition\n"); + + } + + + { + primStream pStream(5000,5000); + directedLine* temp; + + for(temp=poly; temp != NULL; temp=temp->getNextPolygon()) + + monoTriangulation(temp, &pStream); + + slicer.evalStream(&pStream); + + } + //need to clean up space + } + } + freejarcs( initialbin ); + backend.endsurf(); + return; + + /* + printf("num_polygons=%i\n", poly->numPolygons()); + printf("num_edges=%i\n", poly->numEdgesAllPolygons()); + poly->writeAllPolygons("zloutputFile"); + return; + { + primStream pStream(20,20); + for(directedLine* tempD = poly; tempD != NULL; tempD = tempD->getNextPolygon()) + monoTriangulation(tempD, &pStream); + } + return; + */ +} +#endif //PARTITION_TEST + + +#ifdef OPTIMIZE_UNTRIMED_CASE + if( (!initialbin.isnonempty()) && optimize ) + { + int i,j; + int num_u_steps; + int num_v_steps; + for(i=spbrkpts.start; idownloadAll(pta, ptb, backend); + + num_u_steps = (int) (domain_distance_u_rate * (ptb[0]-pta[0])); + num_v_steps = (int) (domain_distance_v_rate * (ptb[1]-pta[1])); + + if(num_u_steps <= 0) num_u_steps = 1; + if(num_v_steps <= 0) num_v_steps = 1; + + backend.surfgrid(pta[0], ptb[0], num_u_steps, + ptb[1], pta[1], num_v_steps); + backend.surfmesh(0,0,num_u_steps,num_v_steps); + + + + continue; + /* the following is left for reference purpose, don't delete + { + Bin* tempSource; + Patchlist patchlist(qlist, pta, ptb); + patchlist.getstepsize(); + + tempSource=makePatchBoundary(pta, ptb); + + tessellation(*tempSource, patchlist); + + render(*tempSource); + delete tempSource; + } + */ + } + } + } + else + subdivideInS( initialbin ); +#else + + subdivideInS( initialbin ); +#endif + + backend.endsurf(); + +} + +void +Subdivider::subdivideInS( Bin& source ) +{ + if( renderhints.display_method == N_OUTLINE_PARAM ) { + outline( source ); + freejarcs( source ); + } else { + setArcTypeBezier(); + setNonDegenerate(); + splitInS( source, spbrkpts.start, spbrkpts.end ); + } +} + + +/*--------------------------------------------------------------------------- + * splitInS - split a patch and a bin by an isoparametric line + *--------------------------------------------------------------------------- + */ + +void +Subdivider::splitInS( Bin& source, int start, int end ) +{ + if( source.isnonempty() ) { + if( start != end ) { + int i = start + (end - start) / 2; + Bin left, right; + split( source, left, right, 0, spbrkpts.pts[i] ); + splitInS( left, start, i ); + splitInS( right, i+1, end ); + } else { + if( start == spbrkpts.start || start == spbrkpts.end ) { + freejarcs( source ); + } else if( renderhints.display_method == N_OUTLINE_PARAM_S ) { + outline( source ); + freejarcs( source ); + } else { + setArcTypeBezier(); + setNonDegenerate(); + s_index = start; + splitInT( source, tpbrkpts.start, tpbrkpts.end ); + } + } + } +} + +/*--------------------------------------------------------------------------- + * splitInT - split a patch and a bin by an isoparametric line + *--------------------------------------------------------------------------- + */ + +void +Subdivider::splitInT( Bin& source, int start, int end ) +{ + if( source.isnonempty() ) { + if( start != end ) { + int i = start + (end - start) / 2; + Bin left, right; + split( source, left, right, 1, tpbrkpts.pts[i] ); + splitInT( left, start, i ); + splitInT( right, i+1, end ); + } else { + if( start == tpbrkpts.start || start == tpbrkpts.end ) { + freejarcs( source ); + } else if( renderhints.display_method == N_OUTLINE_PARAM_ST ) { + outline( source ); + freejarcs( source ); + } else { + t_index = start; + setArcTypeBezier(); + setDegenerate(); + + REAL pta[2], ptb[2]; + pta[0] = spbrkpts.pts[s_index-1]; + pta[1] = tpbrkpts.pts[t_index-1]; + + ptb[0] = spbrkpts.pts[s_index]; + ptb[1] = tpbrkpts.pts[t_index]; + qlist->downloadAll( pta, ptb, backend ); + + Patchlist patchlist( qlist, pta, ptb ); +/* +printf("-------samplingSplit-----\n"); +source.show("samplingSplit source"); +*/ + samplingSplit( source, patchlist, renderhints.maxsubdivisions, 0 ); + setNonDegenerate(); + setArcTypeBezier(); + } + } + } +} + +/*-------------------------------------------------------------------------- + * samplingSplit - recursively subdivide patch, cull check each subpatch + *-------------------------------------------------------------------------- + */ + +void +Subdivider::samplingSplit( + Bin& source, + Patchlist& patchlist, + int subdivisions, + int param ) +{ + if( ! source.isnonempty() ) return; + + if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) { + freejarcs( source ); + return; + } + + patchlist.getstepsize(); + + if( renderhints.display_method == N_OUTLINE_PATCH ) { + tessellation( source, patchlist ); + outline( source ); + freejarcs( source ); + return; + } + + //patchlist.clamp(); + + tessellation( source, patchlist ); + + if( patchlist.needsSamplingSubdivision() && (subdivisions > 0) ) { + if( ! patchlist.needsSubdivision( 0 ) ) + param = 1; + else if( ! patchlist.needsSubdivision( 1 ) ) + param = 0; + else + param = 1 - param; + + Bin left, right; + REAL mid = ( patchlist.pspec[param].range[0] + + patchlist.pspec[param].range[1] ) * 0.5; + split( source, left, right, param, mid ); + Patchlist subpatchlist( patchlist, param, mid ); + samplingSplit( left, subpatchlist, subdivisions-1, param ); + samplingSplit( right, patchlist, subdivisions-1, param ); + } else { + setArcTypePwl(); + setDegenerate(); + nonSamplingSplit( source, patchlist, subdivisions, param ); + setDegenerate(); + setArcTypeBezier(); + } +} + +void +Subdivider::nonSamplingSplit( + Bin& source, + Patchlist& patchlist, + int subdivisions, + int param ) +{ + if( patchlist.needsNonSamplingSubdivision() && (subdivisions > 0) ) { + param = 1 - param; + + Bin left, right; + REAL mid = ( patchlist.pspec[param].range[0] + + patchlist.pspec[param].range[1] ) * 0.5; + split( source, left, right, param, mid ); + Patchlist subpatchlist( patchlist, param, mid ); + if( left.isnonempty() ) + if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT ) + freejarcs( left ); + else + nonSamplingSplit( left, subpatchlist, subdivisions-1, param ); + if( right.isnonempty() ) + if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) + freejarcs( right ); + else + nonSamplingSplit( right, patchlist, subdivisions-1, param ); + + } else { + // make bbox calls + patchlist.bbox(); + backend.patch( patchlist.pspec[0].range[0], patchlist.pspec[0].range[1], + patchlist.pspec[1].range[0], patchlist.pspec[1].range[1] ); + + if( renderhints.display_method == N_OUTLINE_SUBDIV ) { + outline( source ); + freejarcs( source ); + } else { + setArcTypePwl(); + setDegenerate(); + findIrregularS( source ); + monosplitInS( source, smbrkpts.start, smbrkpts.end ); + } + } +} + +/*-------------------------------------------------------------------------- + * tessellation - set tessellation of interior and boundary of patch + *-------------------------------------------------------------------------- + */ + +void +Subdivider::tessellation( Bin& bin, Patchlist &patchlist ) +{ + // tessellate unsampled trim curves + tessellate( bin, patchlist.pspec[1].sidestep[1], patchlist.pspec[0].sidestep[1], + patchlist.pspec[1].sidestep[0], patchlist.pspec[0].sidestep[0] ); + + // set interior sampling rates + slicer.setstriptessellation( patchlist.pspec[0].stepsize, patchlist.pspec[1].stepsize ); + + //added by zl: set the order which will be used in slicer.c++ + slicer.set_ulinear( (patchlist.get_uorder() == 2)); + slicer.set_vlinear( (patchlist.get_vorder() == 2)); + + // set boundary sampling rates + stepsizes[0] = patchlist.pspec[1].stepsize; + stepsizes[1] = patchlist.pspec[0].stepsize; + stepsizes[2] = patchlist.pspec[1].stepsize; + stepsizes[3] = patchlist.pspec[0].stepsize; +} + +/*--------------------------------------------------------------------------- + * monosplitInS - split a patch and a bin by an isoparametric line + *--------------------------------------------------------------------------- + */ + +void +Subdivider::monosplitInS( Bin& source, int start, int end ) +{ + if( source.isnonempty() ) { + if( start != end ) { + int i = start + (end - start) / 2; + Bin left, right; + split( source, left, right, 0, smbrkpts.pts[i] ); + monosplitInS( left, start, i ); + monosplitInS( right, i+1, end ); + } else { + if( renderhints.display_method == N_OUTLINE_SUBDIV_S ) { + outline( source ); + freejarcs( source ); + } else { + setArcTypePwl(); + setDegenerate(); + findIrregularT( source ); + monosplitInT( source, tmbrkpts.start, tmbrkpts.end ); + } + } + } +} + +/*--------------------------------------------------------------------------- + * monosplitInT - split a patch and a bin by an isoparametric line + *--------------------------------------------------------------------------- + */ + +void +Subdivider::monosplitInT( Bin& source, int start, int end ) +{ + if( source.isnonempty() ) { + if( start != end ) { + int i = start + (end - start) / 2; + Bin left, right; + split( source, left, right, 1, tmbrkpts.pts[i] ); + monosplitInT( left, start, i ); + monosplitInT( right, i+1, end ); + } else { + if( renderhints.display_method == N_OUTLINE_SUBDIV_ST ) { + outline( source ); + freejarcs( source ); + } else { +/* +printf("*******render\n"); +source.show("source\n"); +*/ + render( source ); + freejarcs( source ); + } + } + } +} + + +/*---------------------------------------------------------------------------- + * findIrregularS - determine points of non-monotonicity is s direction + *---------------------------------------------------------------------------- + */ + +void +Subdivider::findIrregularS( Bin& bin ) +{ + assert( bin.firstarc()->check() != 0 ); + + smbrkpts.grow( bin.numarcs() ); + + for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + REAL *a = jarc->prev->tail(); + REAL *b = jarc->tail(); + REAL *c = jarc->head(); + + if( b[1] == a[1] && b[1] == c[1] ) continue; + + //corrected code + if((b[1]<=a[1] && b[1] <= c[1]) || + (b[1]>=a[1] && b[1] >= c[1])) + { + //each arc (jarc, jarc->prev, jarc->next) is a + //monotone arc consisting of multiple line segements. + //it may happen that jarc->prev and jarc->next are the same, + //that is, jarc->prev and jarc form a closed loop. + //In such case, a and c will be the same. + if(a[0]==c[0] && a[1] == c[1]) + { + if(jarc->pwlArc->npts >2) + { + c = jarc->pwlArc->pts[jarc->pwlArc->npts-2].param; + } + else + { + assert(jarc->prev->pwlArc->npts>2); + a = jarc->prev->pwlArc->pts[jarc->prev->pwlArc->npts-2].param; + } + + } + if(area(a,b,c) < 0) + { + smbrkpts.add(b[0]); + } + + } + + /* old code, + if( b[1] <= a[1] && b[1] <= c[1] ) { + if( ! ccwTurn_tr( jarc->prev, jarc ) ) + smbrkpts.add( b[0] ); + } else if( b[1] >= a[1] && b[1] >= c[1] ) { + if( ! ccwTurn_tl( jarc->prev, jarc ) ) + smbrkpts.add( b[0] ); + } + */ + + } + + smbrkpts.filter(); +} + +/*---------------------------------------------------------------------------- + * findIrregularT - determine points of non-monotonicity in t direction + * where one arc is parallel to the s axis. + *---------------------------------------------------------------------------- + */ + +void +Subdivider::findIrregularT( Bin& bin ) +{ + assert( bin.firstarc()->check() != 0 ); + + tmbrkpts.grow( bin.numarcs() ); + + for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + REAL *a = jarc->prev->tail(); + REAL *b = jarc->tail(); + REAL *c = jarc->head(); + + if( b[0] == a[0] && b[0] == c[0] ) continue; + + if( b[0] <= a[0] && b[0] <= c[0] ) { + if( a[1] != b[1] && b[1] != c[1] ) continue; + if( ! ccwTurn_sr( jarc->prev, jarc ) ) + tmbrkpts.add( b[1] ); + } else if ( b[0] >= a[0] && b[0] >= c[0] ) { + if( a[1] != b[1] && b[1] != c[1] ) continue; + if( ! ccwTurn_sl( jarc->prev, jarc ) ) + tmbrkpts.add( b[1] ); + } + } + tmbrkpts.filter( ); +} + +/*----------------------------------------------------------------------------- + * makeBorderTrim - if no user input trimming data then create + * a trimming curve around the boundaries of the Quilt. The curve consists of + * four Jordan arcs, one for each side of the Quilt, connected, of course, + * head to tail. + *----------------------------------------------------------------------------- + */ + +void +Subdivider::makeBorderTrim( const REAL *from, const REAL *to ) +{ + REAL smin = from[0]; + REAL smax = to[0]; + REAL tmin = from[1]; + REAL tmax = to[1]; + + pjarc = 0; + + Arc_ptr jarc = new(arcpool) Arc( arc_bottom, 0 ); + arctessellator.bezier( jarc, smin, smax, tmin, tmin ); + initialbin.addarc( jarc ); + pjarc = jarc->append( pjarc ); + + jarc = new(arcpool) Arc( arc_right, 0 ); + arctessellator.bezier( jarc, smax, smax, tmin, tmax ); + initialbin.addarc( jarc ); + pjarc = jarc->append( pjarc ); + + jarc = new(arcpool) Arc( arc_top, 0 ); + arctessellator.bezier( jarc, smax, smin, tmax, tmax ); + initialbin.addarc( jarc ); + pjarc = jarc->append( pjarc ); + + jarc = new(arcpool) Arc( arc_left, 0 ); + arctessellator.bezier( jarc, smin, smin, tmax, tmin ); + initialbin.addarc( jarc ); + jarc->append( pjarc ); + + assert( jarc->check() != 0 ); +} + +/*---------------------------------------------------------------------------- + * render - renders all monotone regions in a bin and frees the bin + *---------------------------------------------------------------------------- + */ + +void +Subdivider::render( Bin& bin ) +{ + bin.markall(); + +#ifdef N_ISOLINE_S + slicer.setisolines( ( renderhints.display_method == N_ISOLINE_S ) ? 1 : 0 ); +#else + slicer.setisolines( 0 ); +#endif + + for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + if( jarc->ismarked() ) { + assert( jarc->check( ) != 0 ); + Arc_ptr jarchead = jarc; + do { + jarc->clearmark(); + jarc = jarc->next; + } while (jarc != jarchead); + slicer.slice( jarc ); + } + } +} + +/*--------------------------------------------------------------------------- + * outline - render the trimmed patch by outlining the boundary + *--------------------------------------------------------------------------- + */ + +void +Subdivider::outline( Bin& bin ) +{ + bin.markall(); + for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + if( jarc->ismarked() ) { + assert( jarc->check( ) != 0 ); + Arc_ptr jarchead = jarc; + do { + slicer.outline( jarc ); + jarc->clearmark(); + jarc = jarc->prev; + } while (jarc != jarchead); + } + } +} + +/*--------------------------------------------------------------------------- + * freejarcs - free all arcs in a bin + *--------------------------------------------------------------------------- + */ + +void +Subdivider::freejarcs( Bin& bin ) +{ + bin.adopt(); /* XXX - should not be necessary */ + + Arc_ptr jarc; + while( (jarc = bin.removearc()) != NULL ) { + if( jarc->pwlArc ) jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; + if( jarc->bezierArc) jarc->bezierArc->deleteMe( bezierarcpool ); jarc->bezierArc = 0; + jarc->deleteMe( arcpool ); + } +} + +/*---------------------------------------------------------------------------- + * tessellate - tessellate all Bezier arcs in a bin + * 1) only accepts linear Bezier arcs as input + * 2) the Bezier arcs are stored in the pwlArc structure + * 3) only vertical or horizontal lines work + * -- should + * 1) represent Bezier arcs in BezierArc structure + * (this requires a multitude of changes to the code) + * 2) accept high degree Bezier arcs (hard) + * 3) map the curve onto the surface to determine tessellation + * 4) work for curves of arbitrary geometry + *---------------------------------------------------------------------------- + */ + + +void +Subdivider::tessellate( Bin& bin, REAL rrate, REAL trate, REAL lrate, REAL brate ) +{ + for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { + if( jarc->isbezier( ) ) { + assert( jarc->pwlArc->npts == 2 ); + TrimVertex *pts = jarc->pwlArc->pts; + REAL s1 = pts[0].param[0]; + REAL t1 = pts[0].param[1]; + REAL s2 = pts[1].param[0]; + REAL t2 = pts[1].param[1]; + + jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; + + switch( jarc->getside() ) { + case arc_left: + assert( s1 == s2 ); + arctessellator.pwl_left( jarc, s1, t1, t2, lrate ); + break; + case arc_right: + assert( s1 == s2 ); + arctessellator.pwl_right( jarc, s1, t1, t2, rrate ); + break; + case arc_top: + assert( t1 == t2 ); + arctessellator.pwl_top( jarc, t1, s1, s2, trate ); + break; + case arc_bottom: + assert( t1 == t2 ); + arctessellator.pwl_bottom( jarc, t1, s1, s2, brate ); + break; + case arc_none: + (void) abort(); + break; + } + assert( ! jarc->isbezier() ); + assert( jarc->check() != 0 ); + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/subdivider.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,200 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * subdivider.h + * + */ + +#ifndef __glusubdivider_h_ +#define __glusubdivider_h_ + +#include "mysetjmp.h" +#include "bin.h" +#include "flist.h" +#include "slicer.h" +#include "arctess.h" +#include "trimvertex.h" +#include "trimvertpool.h" + +class Arc; +class Pool; +class Renderhints; +class Quilt; +class Patchlist; +class Curvelist; +struct JumpBuffer; + +class Subdivider { +public: + Subdivider( Renderhints&, Backend& ); + ~Subdivider( void ); + void clear( void ); + + void beginTrims( void ) {} + void beginLoop( void ); + void addArc( REAL *, Quilt *, long ); + void addArc( int, TrimVertex *, long ); + void endLoop( void ) {} + void endTrims( void ) {} + + void beginQuilts( void ); + void addQuilt( Quilt * ); + void endQuilts( void ) {} + + void drawCurves( void ); + void drawSurfaces( long ); + + int ccwTurn_sl( Arc_ptr, Arc_ptr ); + int ccwTurn_sr( Arc_ptr , Arc_ptr ); + int ccwTurn_tl( Arc_ptr , Arc_ptr ); + int ccwTurn_tr( Arc_ptr , Arc_ptr ); + + void setJumpbuffer( JumpBuffer * ); + + void set_domain_distance_u_rate(REAL u_rate) + { + domain_distance_u_rate = u_rate; + } + void set_domain_distance_v_rate(REAL v_rate) + { + domain_distance_v_rate = v_rate; + } + void set_is_domain_distance_sampling(int flag) + { + is_domain_distance_sampling = flag; + } + +private: + void classify_headonleft_s( Bin &, Bin &, Bin &, REAL ); + void classify_tailonleft_s( Bin &, Bin &, Bin &, REAL ); + void classify_headonright_s( Bin &, Bin &, Bin &, REAL ); + void classify_tailonright_s( Bin &, Bin &, Bin &, REAL ); + void classify_headonleft_t( Bin &, Bin &, Bin &, REAL ); + void classify_tailonleft_t( Bin &, Bin &, Bin &, REAL ); + void classify_headonright_t( Bin &, Bin &, Bin &, REAL ); + void classify_tailonright_t( Bin &, Bin &, Bin &, REAL ); + + enum dir { down, same, up, none }; + void tessellate( Arc_ptr, REAL ); + void monotonize( Arc_ptr , Bin & ); + int isMonotone( Arc_ptr ); + int decompose( Bin &, REAL ); + + + Slicer slicer; + ArcTessellator arctessellator; + Pool arcpool; + Pool bezierarcpool; + Pool pwlarcpool; + TrimVertexPool trimvertexpool; + + JumpBuffer* jumpbuffer; + Renderhints& renderhints; + Backend& backend; + + Bin initialbin; + Arc_ptr pjarc; + int s_index; + int t_index; + Quilt * qlist; + Flist spbrkpts; + Flist tpbrkpts; + Flist smbrkpts; + Flist tmbrkpts; + REAL stepsizes[4]; + int showDegenerate; + int isArcTypeBezier; + + void samplingSplit( Curvelist&, int ); + + void subdivideInS( Bin& ); + void splitInS( Bin&, int, int ); + void splitInT( Bin&, int, int ); + void samplingSplit( Bin&, Patchlist&, int, int ); + void nonSamplingSplit( Bin&, Patchlist&, int, int ); + void tessellation( Bin&, Patchlist& ); + void monosplitInS( Bin&, int, int ); + void monosplitInT( Bin&, int, int ); + + void outline( Bin & ); + void freejarcs( Bin & ); + void render( Bin & ); + void split( Bin &, Bin &, Bin &, int, REAL ); + void tessellate( Bin &, REAL, REAL, REAL, REAL ); + + inline void setDegenerate( void ) { showDegenerate = 1; } + inline void setNonDegenerate( void ) { showDegenerate = 0; } + inline int showingDegenerate( void ) { return showDegenerate; } + inline void setArcTypeBezier( void ) { isArcTypeBezier = 1; } + inline void setArcTypePwl( void ) { isArcTypeBezier = 0; } + inline int isBezierArcType( void ) { return isArcTypeBezier; } + + void makeBorderTrim( const REAL *, const REAL * ); + void split( Bin &, int, const REAL *, int, int ); + void partition( Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL ); + void findIrregularS( Bin & ); + void findIrregularT( Bin & ); + + + inline int bbox( TrimVertex *, TrimVertex *, TrimVertex *, int ); + static int bbox( REAL, REAL, REAL, REAL, REAL, REAL ); + static int ccw( TrimVertex *, TrimVertex *, TrimVertex * ); + void join_s( Bin &, Bin &, Arc_ptr, Arc_ptr ); + void join_t( Bin &, Bin &, Arc_ptr , Arc_ptr ); + int arc_split( Arc_ptr , int, REAL, int ); + void check_s( Arc_ptr , Arc_ptr ); + void check_t( Arc_ptr , Arc_ptr ); + inline void link( Arc_ptr , Arc_ptr , Arc_ptr , Arc_ptr ); + inline void simple_link( Arc_ptr , Arc_ptr ); + + Bin* makePatchBoundary( const REAL *from, const REAL *to ); + + /*in domain distance method, the tessellation is controled by two numbers: + *GLU_U_STEP: number of u-segments per unit u length of domain + *GLU_V_STEP: number of v-segments per unit v length of domain + *These two numbers are normally stored in mapdesc->maxs(t)rate. + *I (ZL) put these two numbers here so that I can optimize the untrimmed + *case in the case of domain distance sampling. + *These two numbers are set by set_domain_distance_u_rate() and ..._v_..(). + */ + REAL domain_distance_u_rate; + REAL domain_distance_v_rate; + int is_domain_distance_sampling; +}; + +inline void +Subdivider::beginLoop( void ) +{ + pjarc = 0; +} + + +#endif /* __glusubdivider_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/tobezier.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/tobezier.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/tobezier.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/tobezier.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,687 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * tobezier.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "mystring.h" +#include "quilt.h" +#include "knotvector.h" + +/* local type definitions */ +struct Breakpt { /* breakpoints */ + Knot value; /* value */ + int multi; /* multiplicity */ + int def; /* deficit */ +}; + +struct Knotspec { /* knotvector format */ + long order; /* order of spline */ + Knot_ptr inkbegin; /* input knot sequence */ + Knot_ptr inkend; /* location after last knot */ + Knot_ptr outkbegin; /* in-process knot subsequence */ + Knot_ptr outkend; /* location after last knot */ + Knot_ptr kleft; /* */ + Knot_ptr kright; /* */ + Knot_ptr kfirst; /* */ + Knot_ptr klast; /* */ + Knot_ptr sbegin; /* conversion factor values */ + Breakpt * bbegin; /* in-process breakpoints */ + Breakpt * bend; /* last breakpoint */ + int ncoords; /* coordinates per control point */ + int prestride; /* stride between input points */ + int poststride; /* stride between output points */ + int preoffset; /* scaled point offset */ + int postoffset; /* scaled point offset */ + int prewidth; /* width of dimension */ + int postwidth; /* width of dimension */ + int istransformed; /* was dimension transformed */ + Knotspec * next; /* next knotspec */ + Knotspec * kspectotrans; /* knotspec in transformation direction */ + + Knotspec( void ); + ~Knotspec( void ); + void factors( void ); + void insert( REAL * ); + void preselect(); + void select( void ); + void copy( INREAL *, REAL * ); + void breakpoints( void ); + void knots( void ); + void transform( REAL * ); + void showpts( REAL * ); + + void pt_io_copy( REAL *, INREAL * ); + void pt_oo_copy( REAL *, REAL * ); + void pt_oo_sum( REAL*, REAL*, REAL*, Knot, Knot ); +}; + +struct Splinespec { /* a non-uniform tensor element */ + Splinespec( int ); + ~Splinespec(void); + Knotspec *kspec; /* format of each param. dir. */ + int dim; /* domain dimension */ + REAL * outcpts; /* Bezier control points */ + + void kspecinit( Knotvector & ); + void kspecinit( Knotvector &, Knotvector & ); + void select( void ); + void layout( long ); + void setupquilt( Quilt_ptr ); + void copy( INREAL * ); + void transform( void ); +}; + +/*----------------------------------------------------------------------------- + * Quilt::toBezier - convert from NURBS to rational Bezier + *----------------------------------------------------------------------------- + */ + +void +Quilt::toBezier( + Knotvector& knotvector, /* a knot vector */ + INREAL *ctlpts, /* input contol points */ + long ncoords ) /* number of coordinates per control point */ +{ + Splinespec spline( 1 ); + spline.kspecinit( knotvector ); + spline.select(); + spline.layout( ncoords ); + spline.setupquilt( this ); + spline.copy( ctlpts ); + spline.transform(); +} + +void +Quilt::toBezier( + Knotvector& sknotvector, /* a knot vector */ + Knotvector& tknotvector, /* a knot vector */ + INREAL *ctlpts, /* input contol points */ + long ncoords ) /* number of coordinates per control point */ +{ + Splinespec spline( 2 ); + spline.kspecinit( sknotvector, tknotvector ); + spline.select(); + spline.layout( ncoords ); + spline.setupquilt( this ); + spline.copy( ctlpts ); + spline.transform(); +} +Splinespec::Splinespec( int dimen ) +{ + dim = dimen; +} + +Splinespec::~Splinespec( void ) +{ + /* Note: do NOT delete 'outcpts' here since its address (not contents) + * is copied in 'cpts' in this file in function Splinespec::setupquilt(). + * This block of memory will eventually be deleted in file quilt.c++ in + * function Quilt::deleteMe() through 'cpts' so do NOT delete it here! + */ + Knotspec *ktrav= kspec; //start at beginning of list + while (ktrav != 0) { //any items to delete? + Knotspec *deleteThis= ktrav; //remember to delete this + ktrav= ktrav->next; //go to next item if any + delete deleteThis; //delete it + } +} /* ~Splinespec() */ + +/*----------------------------------------------------------------------------- + * Splinespec::kspecinit - initialize Splinespec structure + * + * Client: Quilt::toBezier + *----------------------------------------------------------------------------- + */ + +void +Splinespec::kspecinit( Knotvector& knotvector ) +{ + kspec = new Knotspec; + kspec->inkbegin = knotvector.knotlist; + kspec->inkend = knotvector.knotlist + knotvector.knotcount; + kspec->prestride = (int) knotvector.stride; + kspec->order = knotvector.order; + kspec->next = NULL; +} + +void +Splinespec::kspecinit( Knotvector& sknotvector, Knotvector& tknotvector ) +{ + kspec = new Knotspec; + Knotspec *tkspec = new Knotspec; + + kspec->inkbegin = sknotvector.knotlist; + kspec->inkend = sknotvector.knotlist + sknotvector.knotcount; + kspec->prestride = (int) sknotvector.stride; + kspec->order = sknotvector.order; + kspec->next = tkspec; + + tkspec->inkbegin = tknotvector.knotlist; + tkspec->inkend = tknotvector.knotlist + tknotvector.knotcount; + tkspec->prestride = (int) tknotvector.stride; + tkspec->order = tknotvector.order; + tkspec->next = NULL; +} + + +/*----------------------------------------------------------------------------- + * Splinespec::select - select the subsegments to copy + * + * Client: gl_quilt_to_bezier + *----------------------------------------------------------------------------- + */ + +void +Splinespec::select( ) +{ + for( Knotspec *knotspec = kspec; knotspec; knotspec = knotspec->next ) { + knotspec->preselect(); + knotspec->select(); + } +} + +/*----------------------------------------------------------------------------- + * Splinespec::layout - + * + * Client: gl_quilt_to_bezier + *----------------------------------------------------------------------------- + */ + +void +Splinespec::layout( long ncoords ) +{ + + long stride = ncoords; + for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next ) { + knotspec->poststride = (int) stride; + stride *= ((knotspec->bend-knotspec->bbegin)*knotspec->order + knotspec->postoffset); + knotspec->preoffset *= knotspec->prestride; + knotspec->prewidth *= knotspec->poststride; + knotspec->postwidth *= knotspec->poststride; + knotspec->postoffset *= knotspec->poststride; + knotspec->ncoords = (int) ncoords; + } + outcpts = new REAL[stride]; + assert( outcpts != 0 ); +} + +/*----------------------------------------------------------------------------- + * Splinespec::copy - copy the control points of current subobject + * + * Client: gl_quilt_to_bezier + *----------------------------------------------------------------------------- + */ + +void +Splinespec::copy( INREAL *incpts ) +{ + kspec->copy( incpts, outcpts ); +} + +/*----------------------------------------------------------------------------- + * Splinespec::setupquilt - assign all quilt variables from knotspec + * + * Client: gl_quilt_to_bezier + *----------------------------------------------------------------------------- + */ + +void +Splinespec::setupquilt( Quilt_ptr quilt ) +{ + Quiltspec_ptr qspec = quilt->qspec; + quilt->eqspec = qspec + dim; + for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next, qspec++ ) { + qspec->stride = knotspec->poststride; + qspec->width = knotspec->bend - knotspec->bbegin; + qspec->order = (int) knotspec->order; + qspec->offset = knotspec->postoffset; + qspec->index = 0; + qspec->bdry[0] = (knotspec->kleft == knotspec->kfirst) ? 1 : 0; + qspec->bdry[1] = (knotspec->kright == knotspec->klast) ? 1 : 0; + qspec->breakpoints = new Knot[qspec->width+1]; + Knot_ptr k = qspec->breakpoints; + for( Breakpt *bk = knotspec->bbegin; bk <= knotspec->bend; bk++ ) + *(k++) = bk->value; + } + quilt->cpts = outcpts; + quilt->next = 0; +} + +/*----------------------------------------------------------------------------- + * Splinespec::transform - convert a spline to Bezier format + * + * Client: gl_quilt_to_bezier + *----------------------------------------------------------------------------- + */ + +void +Splinespec::transform( void ) +{ + Knotspec *knotspec; + for( knotspec = kspec; knotspec; knotspec=knotspec->next ) + knotspec->istransformed = 0; + + for( knotspec = kspec; knotspec; knotspec=knotspec->next ) { + for( Knotspec *kspec2 = kspec; kspec2; kspec2=kspec2->next ) + kspec2->kspectotrans = knotspec; + kspec->transform( outcpts ); + knotspec->istransformed = 1; + } +} + + +/*----------------------------------------------------------------------------- + * Knotspec::Knotspec - constuct a knot spec + *----------------------------------------------------------------------------- + */ + +Knotspec::Knotspec( void ) +{ + bbegin = 0; + sbegin = 0; + outkbegin = 0; +} + +/*----------------------------------------------------------------------------- + * Knotspec::copy - copy the control points along minor direction + * + * Client: Splinespec::copy + *----------------------------------------------------------------------------- + */ + +void +Knotspec::copy( INREAL *inpt, REAL *outpt ) +{ + inpt = (INREAL *) (((char *) inpt) + preoffset); + + if( next ) { + for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) { + next->copy( inpt, outpt ); + inpt = (INREAL *) (((char *) inpt) + prestride); + } + } else { + for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) { + pt_io_copy( outpt, inpt ); + inpt = (INREAL *) (((char *) inpt) + prestride); + } + } +} + +/*----------------------------------------------------------------------------- + * Knotspec::showpts - print out points before transformation + * + * Client: Knotspec::select + *----------------------------------------------------------------------------- + */ +void +Knotspec::showpts( REAL *outpt ) +{ + if( next ) { + for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) + next->showpts( outpt ); + } else { + for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) + _glu_dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] ); + } +} + +/*----------------------------------------------------------------------------- + * Knotspec::factors - precompute scale factors + * - overwrites knot vector, actual new knot vector is NOT produced + * + * Client: Knotspec::select + *----------------------------------------------------------------------------- + */ + +void +Knotspec::factors( void ) +{ + Knot *mid = (outkend - 1) - order + bend->multi; + Knot_ptr fptr = sbegin; + + for( Breakpt *bpt = bend; bpt >= bbegin; bpt-- ) { + mid -= bpt->multi; // last knot less than knot to insert + int def = bpt->def - 1; // number of knots to insert + if( def <= 0 ) continue; + Knot kv = bpt->value; // knot to insert + + Knot *kf = (mid-def) + (order-1); + for( Knot *kl = kf + def; kl != kf; kl-- ) { + Knot *kh, *kt; + for( kt=kl, kh=mid; kt != kf; kh--, kt-- ) + *(fptr++) = (kv - *kh) / (*kt - *kh); + *kl = kv; + } + } +} + +/*----------------------------------------------------------------------------- + * Knotspec::insert - convert subobject in direction of kspec into Bezier + * + * Client: Knotspec::transform + *----------------------------------------------------------------------------- + */ + +void +Knotspec::insert( REAL *p ) +{ + Knot_ptr fptr = sbegin; + REAL *srcpt = p + prewidth - poststride; + REAL *dstpt = p + postwidth + postoffset - poststride; + Breakpt *bpt = bend; + + for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride ) { + REAL *p1 = srcpt; + for( REAL *p2 = srcpt-poststride; p2 != pend; p1 = p2, p2 -= poststride ) { + pt_oo_sum( p1, p1, p2, *fptr, 1.0-*fptr ); + fptr++; + } + } + + for( --bpt; bpt >= bbegin; bpt-- ) { + + for( int multi = bpt->multi; multi > 0; multi-- ) { + pt_oo_copy( dstpt, srcpt ); + dstpt -= poststride; + srcpt -= poststride; + } + + for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride, dstpt-=poststride ) { + pt_oo_copy( dstpt, srcpt ); + REAL *p1 = srcpt; + + for( REAL *p2 = srcpt-poststride; p2 != pend; p1=p2, p2 -= poststride ) { + pt_oo_sum( p1, p1, p2, *fptr, 1.0-*fptr ); + fptr++; + } + } + } +} + +/*----------------------------------------------------------------------------- + * Knotspec::preselect - initialize kspec for processing + * + * Client: Splinespec::select + *----------------------------------------------------------------------------- + */ + +void +Knotspec::preselect( void ) +{ + Knot kval; + + /* position klast after last knot of "last" breakpoint */ + for( klast = inkend - order, kval = *klast; klast != inkend; klast++ ) + if( ! identical( *klast, kval ) ) break; + + /* position kfirst after last knot of "first" breakpoint */ + for( kfirst = inkbegin+order-1, kval= *kfirst; kfirst != inkend; kfirst++ ) + if( ! identical( *kfirst, kval ) ) break; + + /* compute multiplicity of first breakpoint */ + Knot_ptr k; + for( k = kfirst - 1; k >= inkbegin; k-- ) + if( ! identical( kval, *k ) ) break; + k++; + + /* allocate space for breakpoints - + use worst case estimate on number of breakpoints */ + + bbegin = new Breakpt[(klast - kfirst)+1]; + /* record multiplicity and value of first breakpoint */ + bbegin->multi = kfirst - k; + bbegin->value = kval; + bend = bbegin; + + kleft = kright = kfirst; +} + + +/*----------------------------------------------------------------------------- + * Knotspec::select - Knotspec::select segments and precompute scale factors + * + * Client: Splinespec::select + *----------------------------------------------------------------------------- + */ + +void +Knotspec::select( void ) +{ + breakpoints(); + knots(); + factors(); + + preoffset = kleft - (inkbegin + order); + postwidth = (int)((bend - bbegin) * order); + prewidth = (int)((outkend - outkbegin) - order); + postoffset = (bbegin->def > 1) ? (bbegin->def-1) : 0; +} + +/*----------------------------------------------------------------------------- + * Knotspec::breakpoints - compute breakpoints for knotspec + * + * Client: Knotspec::select + *----------------------------------------------------------------------------- + */ + +void +Knotspec::breakpoints( void ) +{ + Breakpt *ubpt = bbegin; + Breakpt *ubend = bend; + long nfactors = 0; + + ubpt->value = ubend->value; + ubpt->multi = ubend->multi; + + kleft = kright; + + for( ; kright != klast; kright++ ) { + if ( identical(*kright,ubpt->value) ) { + (ubpt->multi)++; + } else { + ubpt->def = (int) (order - ubpt->multi); + nfactors += (ubpt->def * (ubpt->def - 1)) / 2; + (++ubpt)->value = *kright; + ubpt->multi = 1; + } + } + ubpt->def = (int) (order - ubpt->multi); + nfactors += (ubpt->def * (ubpt->def - 1)) / 2; + + bend = ubpt; + + if( nfactors ) { + sbegin = new Knot[nfactors]; + } else { + sbegin = NULL; + } +} + + +/*----------------------------------------------------------------------------- + * Knotspec::knots - copy relevant subsequence of knots into temporary area + * + * Client: Knotspec::select + *----------------------------------------------------------------------------- + */ + +void +Knotspec::knots( void ) +{ + Knot_ptr inkpt = kleft - order; + Knot_ptr inkend = kright + bend->def; + + /* allocate space for knots and factors */ + outkbegin = new Knot[inkend-inkpt]; + Knot_ptr outkpt; + for( outkpt = outkbegin; inkpt != inkend; inkpt++, outkpt++ ) + *outkpt = *inkpt; + + outkend = outkpt; +} + + +/*----------------------------------------------------------------------------- + * Knotspec::transform - convert a spline along a given direction + * + * Client: Splienspec::transform + *----------------------------------------------------------------------------- + */ + +void +Knotspec::transform( REAL *p ) +{ + if( next ) { + if( this == kspectotrans ) { + next->transform( p ); + } else { + if( istransformed ) { + p += postoffset; + for( REAL *pend = p + postwidth; p != pend; p += poststride ) + next->transform( p ); + } else { + REAL *pend = p + prewidth; + for( ; p != pend; p += poststride ) + next->transform( p ); + } + } + } else { + if( this == kspectotrans ) { + insert( p ); + } else { + if( istransformed ) { + p += postoffset; + for( REAL *pend = p + postwidth; p != pend; p += poststride ) + kspectotrans->insert( p ); + } else { + REAL *pend = p + prewidth; + for( ; p != pend; p += poststride ) + kspectotrans->insert( p ); + } + } + } +} + +/*----------------------------------------------------------------------------- + * Knotspec::~Knotspec - free space alocated for knotspec + *----------------------------------------------------------------------------- + */ + +Knotspec::~Knotspec( void ) +{ + if( bbegin ) delete[] bbegin; + if( sbegin ) delete[] sbegin; + if( outkbegin ) delete[] outkbegin; +} + + +/*----------------------------------------------------------------------------- + * pt_io_copy - make internal copy of input cntrl pt. of x coords + *----------------------------------------------------------------------------- + */ + +void +Knotspec::pt_io_copy( REAL *topt, INREAL *frompt ) +{ + switch( ncoords ) { + case 4: + topt[3] = (REAL) frompt[3]; + case 3: + topt[2] = (REAL) frompt[2]; + case 2: + topt[1] = (REAL) frompt[1]; + case 1: + topt[0] = (REAL) frompt[0]; + break; + default: { + for( int i = 0; i < ncoords; i++ ) + *topt++ = (REAL) *frompt++; + } + } +} + +/*----------------------------------------------------------------------------- + * pt_oo_copy - make internal copy of internal cntrl pt. of x coords + *----------------------------------------------------------------------------- + */ + +void +Knotspec::pt_oo_copy( REAL *topt, REAL *frompt ) +{ + switch( ncoords ) { + case 4: + topt[3] = frompt[3]; + case 3: + topt[2] = frompt[2]; + case 2: + topt[1] = frompt[1]; + case 1: + topt[0] = frompt[0]; + break; + default: + memcpy( topt, frompt, ncoords * sizeof( REAL ) ); + } +} + +/*----------------------------------------------------------------------------- + * pt_oo_sum - compute affine combination of internal cntrl pts + *----------------------------------------------------------------------------- + */ + +void +Knotspec::pt_oo_sum( REAL *x, REAL *y, REAL *z, Knot a, Knot b ) +{ + switch( ncoords ) { + case 4: + x[3] = a * y[3] + b * z[3]; + case 3: + x[2] = a * y[2] + b * z[2]; + case 2: + x[1] = a * y[1] + b * z[1]; + case 1: + x[0] = a * y[0] + b * z[0]; + break; + default: { + for( int i = 0; i < ncoords; i++ ) + *x++ = a * *y++ + b * *z++; + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,223 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * trimline.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "trimline.h" +#include "backend.h" + +Trimline::Trimline() +{ + size = 0; pts = 0; numverts = 0; + tinterp = &t; binterp = &b; +} + +Trimline::~Trimline() +{ + if( pts ) delete[] pts; +} + +void +Trimline::init( TrimVertex *v ) +{ + reset(); + grow(1); + append(v); +} + +inline void +Trimline::grow( long npts ) +{ + if( size < npts ) { + size = 2 * npts; + if( pts ) delete[] pts; + pts = new TrimVertex_p[size]; + } +} + +inline void +Trimline::append( TrimVertex *v ) +{ + assert( numverts != size ); + pts[numverts++] = v; +} + +void +Trimline::init( long npts, Arc_ptr jarc, long last ) +{ + jarcl.init( jarc, 0, last ); + grow( npts + 2 ); +} + +inline void +Trimline::swap() +{ + TrimVertex *tmp=tinterp; + tinterp=binterp; + binterp=tmp; +} + +void +Trimline::getNextPt() +{ + *binterp = *jarcl.getnextpt(); +} + +void +Trimline::getPrevPt() +{ + *binterp = *jarcl.getprevpt(); +} + +/*---------------------------------------------------------------------- + * getNextPts - make arrays of pointers to trim points on left and right + * hulls of trim strip. + *---------------------------------------------------------------------- + */ +void +Trimline::getNextPts( REAL vval, Backend& backend ) +{ + reset(); swap(); append( tinterp ); + assert( tinterp->param[1] >= vval ); + + register TrimVertex *p; + for( p=jarcl.getnextpt() ; p->param[1] >= vval; p=jarcl.getnextpt() ) { + append( p ); + } + + /* compute and copy pointer to final point on left hull */ + if( interpvert( last(), p, binterp, vval ) ) { + binterp->nuid = p->nuid; + backend.triangle( p, binterp, last() ); + append( binterp ); + } + jarcl.reverse(); + (void) jarcl.getprevpt(); /* reset jarcl to proper position */ + jarcl.reverse(); +} + +void +Trimline::getPrevPts( REAL vval, Backend& backend ) +{ + reset(); swap(); append( tinterp ); + assert( tinterp->param[1] >= vval ); + + register TrimVertex *q; + for( q=jarcl.getprevpt(); q->param[1] >= vval; q=jarcl.getprevpt() ) { + append( q ); + } + + /* compute and copy pointer to final point on right hull */ + if( interpvert( q, last(), binterp, vval ) ) { + binterp->nuid = q->nuid; + backend.triangle( last(), binterp, q ); + append( binterp ); + } + jarcl.reverse(); + (void) jarcl.getnextpt(); /* reset jarcl to proper position */ + jarcl.reverse(); +} + +void +Trimline::getNextPts( Arc_ptr botarc ) +{ + reset(); swap(); append( tinterp ); + +#ifndef NDEBUG + PwlArc *lastpwl = botarc->prev->pwlArc; + TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1]; +#endif + TrimVertex *lastpt2 = botarc->pwlArc->pts; + register TrimVertex *p = jarcl.getnextpt(); + for( append( p ); p != lastpt2; append( p ) ) { + assert( p != lastpt1 ); + p = jarcl.getnextpt(); + } +} + +void +Trimline::getPrevPts( Arc_ptr botarc ) +{ + reset(); swap(); append( tinterp ); + + PwlArc *lastpwl = botarc->prev->pwlArc; + TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1]; +#ifndef NDEBUG + TrimVertex *lastpt2 = botarc->pwlArc->pts; +#endif + + register TrimVertex *q = jarcl.getprevpt(); + for( append( q ); q != lastpt1; append( q ) ) { + assert( q != lastpt2 ); + q = jarcl.getprevpt(); + } +} + + +long +Trimline::interpvert( TrimVertex *a, TrimVertex *b, TrimVertex *c, REAL vval ) +{ + REAL denom = a->param[1] - b->param[1]; + + if(denom != 0) { + if( vval == a->param[1] ) { + c->param[0] = a->param[0]; + c->param[1] = a->param[1]; + c->nuid = a->nuid; + return 0; + } else if( vval == b->param[1] ) { + c->param[0] = b->param[0]; + c->param[1] = b->param[1]; + c->nuid = b->nuid; + return 0; + } else { + REAL r = (a->param[1] - vval)/denom; + c->param[0] = a->param[0] - r * (a->param[0] - b->param[0]); + c->param[1] = vval; + return 1; + } + } else { + c->param[0] = a->param[0]; + c->param[1] = a->param[1]; + c->nuid = a->nuid; + return 0; + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimline.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,103 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * trimline.h + * + */ + +#ifndef __glutrimline_h_ +#define __glutrimline_h_ + +class Arc; +class Backend; + +#include "trimvertex.h" +#include "jarcloc.h" + + +class Trimline { +private: + TrimVertex** pts; + long numverts; + long i; + long size; + Jarcloc jarcl; + TrimVertex t, b; + TrimVertex *tinterp, *binterp; + void reset( void ) { numverts = 0; } + inline void grow( long ); + inline void swap( void ); + inline void append( TrimVertex * ); + static long interpvert( TrimVertex *, TrimVertex *, TrimVertex *, REAL ); + + + +public: + Trimline(); + ~Trimline(); + void init( TrimVertex * ); + void init( long, Arc_ptr, long ); + void getNextPt( void ); + void getPrevPt( void ); + void getNextPts( REAL, Backend & ); + void getPrevPts( REAL, Backend & ); + void getNextPts( Arc_ptr ); + void getPrevPts( Arc_ptr ); + inline TrimVertex * next( void ); + inline TrimVertex * prev( void ); + inline TrimVertex * first( void ); + inline TrimVertex * last( void ); +}; + +inline TrimVertex * +Trimline::next( void ) +{ + if( i < numverts) return pts[i++]; else return 0; +} + +inline TrimVertex * +Trimline::prev( void ) +{ + if( i >= 0 ) return pts[i--]; else return 0; +} + +inline TrimVertex * +Trimline::first( void ) +{ + i = 0; return pts[i]; +} + +inline TrimVertex * +Trimline::last( void ) +{ + i = numverts; return pts[--i]; +} +#endif /* __glutrimline_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,114 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * trimregion.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "trimregion.h" +#include "backend.h" + +TrimRegion::TrimRegion( void ) +{ +} + +void +TrimRegion::setDu( REAL du ) +{ + oneOverDu = 1.0/du; +} + +void +TrimRegion::init( long npts, Arc_ptr extrema ) +{ + left.init( npts, extrema, extrema->pwlArc->npts - 1 ); + left.getNextPt(); + + right.init( npts, extrema, 0 ); + right.getPrevPt(); +} + +void +TrimRegion::getPts( Arc_ptr extrema ) +{ + left.getNextPts( extrema ); + right.getPrevPts( extrema ); +} + +void +TrimRegion::getPts( Backend &backend ) +{ + left.getNextPts( bot.vval, backend ); + right.getPrevPts( bot.vval, backend ); +} + +void +TrimRegion::getGridExtent( void ) +{ + getGridExtent( left.last(), right.last() ); +} + +void +TrimRegion::getGridExtent( TrimVertex *l, TrimVertex *r ) +{ + bot.ustart = (long) ((l->param[0] - uarray.uarray[0])*oneOverDu); + if( l->param[0] >= uarray.uarray[bot.ustart] ) bot.ustart++; +// if( l->param[0] > uarray.uarray[bot.ustart] ) bot.ustart++; + assert( l->param[0] <= uarray.uarray[bot.ustart] ); + assert( l->param[0] >= uarray.uarray[bot.ustart-1] ); + + bot.uend = (long) ((r->param[0] - uarray.uarray[0])*oneOverDu); + if( uarray.uarray[bot.uend] >= r->param[0] ) bot.uend--; +// if( uarray.uarray[bot.uend] > r->param[0] ) bot.uend--; + assert( r->param[0] >= uarray.uarray[bot.uend] ); + assert( r->param[0] <= uarray.uarray[bot.uend+1] ); +} + +int +TrimRegion::canTile( void ) +{ + TrimVertex *lf = left.first(); + TrimVertex *ll = left.last(); + TrimVertex *l = ( ll->param[0] > lf->param[0] ) ? ll : lf; + + TrimVertex *rf = right.first(); + TrimVertex *rl = right.last(); + TrimVertex *r = ( rl->param[0] < rf->param[0] ) ? rl : rf; + return (l->param[0] <= r->param[0]) ? 1 : 0; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimregion.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,84 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * trimregion.h + * + */ + +#ifndef __glutrimregion_h_ +#define __glutrimregion_h_ + +#include "trimline.h" +#include "gridline.h" +#include "uarray.h" + +class Arc; +class Backend; + +class TrimRegion { +public: + TrimRegion(); + Trimline left; + Trimline right; + Gridline top; + Gridline bot; + Uarray uarray; + + void init( REAL ); + void advance( REAL, REAL, REAL ); + void setDu( REAL ); + void init( long, Arc_ptr ); + void getPts( Arc_ptr ); + void getPts( Backend & ); + void getGridExtent( TrimVertex *, TrimVertex * ); + void getGridExtent( void ); + int canTile( void ); +private: + REAL oneOverDu; +}; + +inline void +TrimRegion::init( REAL vval ) +{ + bot.vval = vval; +} + +inline void +TrimRegion::advance( REAL topVindex, REAL botVindex, REAL botVval ) +{ + top.vindex = (long) topVindex; + bot.vindex = (long) botVindex; + top.vval = bot.vval; + bot.vval = botVval; + top.ustart = bot.ustart; + top.uend = bot.uend; +} +#endif /* __glutrimregion_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertex.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertex.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertex.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertex.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,63 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * trimvertex.h + * + */ + +#ifndef __glutrimvertex_h_ +#define __glutrimvertex_h_ + +#include "types.h" + +/*#define USE_OPTTT*/ + +class TrimVertex { /* a vertex on a trim curve */ +public: + REAL param[2]; /* parametric space coords */ +#ifdef USE_OPTTT + REAL cache_point[4]; //only when USE_OPTTT is on in slicer.c++ + REAL cache_normal[3]; +#endif + long nuid; +}; + +typedef class TrimVertex *TrimVertex_p; + +inline REAL +det3( TrimVertex *a, TrimVertex *b, TrimVertex *c ) +{ + return a->param[0] * (b->param[1]-c->param[1]) + + b->param[0] * (c->param[1]-a->param[1]) + + c->param[0] * (a->param[1]-b->param[1]); +} + +#endif /* __glutrimvertex_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.cc 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,119 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * trimvertexpool.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "mystring.h" +#include "trimvertex.h" +#include "trimvertpool.h" +#include "bufpool.h" + +/*---------------------------------------------------------------------------- + * TrimVertexPool::TrimVertexPool + *---------------------------------------------------------------------------- + */ +TrimVertexPool::TrimVertexPool( void ) + : pool( sizeof(TrimVertex)*3, 32, "Threevertspool" ) +{ + // initialize array of pointers to vertex lists + nextvlistslot = 0; + vlistsize = INIT_VERTLISTSIZE; + vlist = new TrimVertex_p[vlistsize]; +} + +/*---------------------------------------------------------------------------- + * TrimVertexPool::~TrimVertexPool + *---------------------------------------------------------------------------- + */ +TrimVertexPool::~TrimVertexPool( void ) +{ + // free all arrays of TrimVertices vertices + while( nextvlistslot ) { + delete [] vlist[--nextvlistslot]; + } + + // reallocate space for array of pointers to vertex lists + if( vlist ) delete[] vlist; +} + +/*---------------------------------------------------------------------------- + * TrimVertexPool::clear + *---------------------------------------------------------------------------- + */ +void +TrimVertexPool::clear( void ) +{ + // reinitialize pool of 3 vertex arrays + pool.clear(); + + // free all arrays of TrimVertices vertices + while( nextvlistslot ) { + delete [] vlist[--nextvlistslot]; + vlist[nextvlistslot] = 0; + } + + // reallocate space for array of pointers to vertex lists + if( vlist ) delete[] vlist; + vlist = new TrimVertex_p[vlistsize]; +} + + +/*---------------------------------------------------------------------------- + * TrimVertexPool::get - allocate a vertex list + *---------------------------------------------------------------------------- + */ +TrimVertex * +TrimVertexPool::get( int n ) +{ + TrimVertex *v; + if( n == 3 ) { + v = (TrimVertex *) pool.new_buffer(); + } else { + if( nextvlistslot == vlistsize ) { + vlistsize *= 2; + TrimVertex_p *nvlist = new TrimVertex_p[vlistsize]; + memcpy( nvlist, vlist, nextvlistslot * sizeof(TrimVertex_p) ); + if( vlist ) delete[] vlist; + vlist = nvlist; + } + v = vlist[nextvlistslot++] = new TrimVertex[n]; + } + return v; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/trimvertpool.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * trimvertexpool.h + * + */ + +#ifndef __glutrimvertpool_h_ +#define __glutrimvertpool_h_ + +#include "bufpool.h" + +class TrimVertex; + +#define INIT_VERTLISTSIZE 200 + +class TrimVertexPool { +public: + TrimVertexPool( void ); + ~TrimVertexPool( void ); + void clear( void ); + TrimVertex * get( int ); +private: + Pool pool; + TrimVertex ** vlist; + int nextvlistslot; + int vlistsize; +}; +#endif /* __glutrimvertpool_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/types.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/types.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/types.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/types.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,47 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * types.h + * + */ + +#ifndef __glutypes_h_ +#define __glutypes_h_ + +//typedef double INREAL; +#define INREAL float +typedef float REAL; +typedef void (*Pfvv)( void ); +typedef void (*Pfvf)( float * ); +typedef int (*cmpfunc)(const void *, const void *); +typedef REAL Knot, *Knot_ptr;/* knot values */ + +#endif /* __glutypes_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,72 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * uarray.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "uarray.h" +#include "arc.h" + +Uarray::Uarray( void ) +{ + uarray = 0; + size = 0; +} + +Uarray::~Uarray( void ) +{ + if( uarray ) delete[] uarray; +} + +long +Uarray::init( REAL delta, Arc_ptr lo, Arc_ptr hi ) +{ + ulines = (long) ((hi->tail()[0] - lo->tail()[0])/delta) + 3; + if( size < ulines ) { + size = ulines * 2; + if( uarray ) delete[] uarray; + uarray = new REAL[size]; + assert( uarray != 0); + } + uarray[0] = lo->tail()[0] - delta/2.0; + for( long i = 1 ; i != ulines; i++ ) + uarray[i] = uarray[0] + i*delta; + return ulines; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/uarray.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,55 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * uarray.h + * + */ + +#ifndef __gluuarray_h_ +#define __gluuarray_h_ + +#include "types.h" + +class Arc; +typedef class Arc *Arc_ptr; + +class Uarray { +private: + long size; + long ulines; +public: + Uarray(); + ~Uarray(); + long init( REAL, Arc_ptr, Arc_ptr ); + REAL * uarray; +}; + +#endif /* __gluuarray_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/varray.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/varray.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/varray.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/internals/varray.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,144 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +*/ + +/* + * varray.c++ + * + */ + +#include "glimports.h" +#include "myassert.h" +#include "mystdio.h" +#include "varray.h" +#include "arc.h" +#include "simplemath.h" // glu_abs() + +#define TINY 0.0001 +inline long sgn( REAL x ) +{ + return (x < -TINY) ? -1 : ((x > TINY) ? 1 : 0 ); +} + + +Varray::Varray( void ) +{ + varray = 0; + size = 0; +} + +Varray::~Varray( void ) +{ + if( varray ) delete[] varray; +} + +inline void +Varray::update( Arc_ptr arc, long dir[2], REAL val ) +{ + register long ds = sgn(arc->tail()[0] - arc->prev->tail()[0]); + register long dt = sgn(arc->tail()[1] - arc->prev->tail()[1]); + + if( dir[0] != ds || dir[1] != dt ) { + dir[0] = ds; + dir[1] = dt; + append( val ); + } +} + +void +Varray::grow( long guess ) +{ + if( size < guess ) { + size = guess * 2; + if( varray ) delete[] varray; + varray = new REAL[size]; + assert( varray != 0 ); + } +} + +long +Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc ) +{ + Arc_ptr left = toparc->next; + Arc_ptr right = toparc; + long ldir[2], rdir[2]; + + ldir[0] = sgn( left->tail()[0] - left->prev->tail()[0] ); + ldir[1] = sgn( left->tail()[1] - left->prev->tail()[1] ); + rdir[0] = sgn( right->tail()[0] - right->prev->tail()[0] ); + rdir[1] = sgn( right->tail()[1] - right->prev->tail()[1] ); + + vval[0] = toparc->tail()[1]; + numquads = 0; + + while( 1 ) { + switch( sgn( left->tail()[1] - right->prev->tail()[1] ) ) { + case 1: + left = left->next; + update( left, ldir, left->prev->tail()[1] ); + break; + case -1: + right = right->prev; + update( right, rdir, right->tail()[1] ); + break; + case 0: + if( glu_abs(left->tail()[1] - botarc->tail()[1]) < TINY) goto end; + if( glu_abs(left->tail()[0]-right->prev->tail()[0]) < TINY && + glu_abs(left->tail()[1]-right->prev->tail()[1]) < TINY) goto end; + left = left->next; + break; + } + } + +end: + append( botarc->tail()[1] ); + + grow( ((long) ((vval[0] - vval[numquads])/delta)) + numquads + 2 ); + + long i, index = 0; + for( i=0; i delta ) { + long steps = ((long) (dist/delta)) +1; + float deltav = - dist / (REAL) steps; + for( long j=1; j +#include +#include +#include "glimports.h" +#include "zlassert.h" + +#include "quicksort.h" +#include "directedLine.h" +#include "polyDBG.h" + +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif + +//we must return the newLine +directedLine* directedLine::deleteChain(directedLine* begin, directedLine* end) +{ + if(begin->head()[0] == end->tail()[0] && + begin->head()[1] == end->tail()[1] + ) + { + directedLine *ret = begin->prev; + begin->prev->next = end->next; + end->next->prev = begin->prev; + delete begin->sline; + delete end->sline; + delete begin; + delete end; + + return ret; + } + + directedLine* newLine; + sampledLine* sline = new sampledLine(begin->head(), end->tail()); + newLine = new directedLine(INCREASING, sline); + directedLine *p = begin->prev; + directedLine *n = end->next; + p->next = newLine; + n->prev = newLine; + newLine->prev = p; + newLine->next = n; + + delete begin->sline; + delete end->sline; + delete begin; + delete end; + return newLine; +} + + +void directedLine::deleteSingleLine(directedLine* dline) +{ + //make sure that dline->prev->tail is the same as + //dline->next->head. This is for numerical erros. + //for example, if we delete a line which is almost degeneate + //within (epsilon), then we want to make that the polygon after deletion + //is still a valid polygon + + dline->next->head()[0] = dline->prev->tail()[0]; + dline->next->head()[1] = dline->prev->tail()[1]; + + dline->prev->next = dline->next; + dline->next->prev = dline->prev; + + delete dline; + +} + +static Int myequal(Real a[2], Real b[2]) +{ + /* + if(a[0]==b[0] && a[1] == b[1]) + return 1; + else + return 0; + */ + + + if(fabs(a[0]-b[0]) < 0.00001 && + fabs(a[1]-b[1]) < 0.00001) + return 1; + else + return 0; + +} + +directedLine* directedLine::deleteDegenerateLines() +{ + //if there is only one edge or two edges, don't do anything + if(this->next == this) + return this; + if(this->next == this->prev) + return this; + + //find a nondegenerate line + directedLine* temp; + directedLine* first = NULL; + if(! myequal(head(), tail())) + /* + if(head()[0] != tail()[0] || + head()[1] != tail()[1]) + */ + first = this; + else + { + for(temp = this->next; temp != this; temp = temp->next) + { + /* + if(temp->head()[0] != temp->tail()[0] || + temp->head()[1] != temp->tail()[1]) + */ + if(! myequal(temp->head(), temp->tail())) + { + first = temp; + break; + } + + } + } + + //if there are no non-degenerate lines, then we simply return NULL. + if(first == NULL) + { + deleteSinglePolygonWithSline(); + return NULL; + } + + directedLine* tempNext = NULL; + for(temp =first->next; temp != first; temp = tempNext) + { + tempNext = temp->getNext(); +/* + if(temp->head()[0] == temp->tail()[0] && + temp->head()[1] == temp->tail()[1]) +*/ + + if(myequal(temp->head(), temp->tail())) + deleteSingleLine(temp); + } + return first; +} + +directedLine* directedLine::deleteDegenerateLinesAllPolygons() +{ + directedLine* temp; + directedLine *tempNext = NULL; + directedLine* ret= NULL; + directedLine* retEnd = NULL; + for(temp=this; temp != NULL; temp = tempNext) + { + tempNext = temp->nextPolygon; + temp->nextPolygon = NULL; + if(ret == NULL) + { + ret = retEnd = temp->deleteDegenerateLines(); + + } + else + { + directedLine *newPolygon = temp->deleteDegenerateLines(); + if(newPolygon != NULL) + { + retEnd->nextPolygon = temp->deleteDegenerateLines(); + retEnd = retEnd->nextPolygon; + } + } + } + return ret; +} + +directedLine* directedLine::cutIntersectionAllPoly(int &cutOccur) +{ + directedLine* temp; + directedLine *tempNext = NULL; + directedLine* ret= NULL; + directedLine* retEnd = NULL; + cutOccur = 0; + for(temp=this; temp != NULL; temp = tempNext) + { + int eachCutOccur=0; + tempNext = temp->nextPolygon; + temp->nextPolygon = NULL; + if(ret == NULL) + { + + ret = retEnd = DBG_cutIntersectionPoly(temp, eachCutOccur); + if(eachCutOccur) + cutOccur = 1; + } + else + { + + retEnd->nextPolygon = DBG_cutIntersectionPoly(temp, eachCutOccur); + retEnd = retEnd->nextPolygon; + if(eachCutOccur) + cutOccur = 1; + } + } + return ret; +} + + +void directedLine::deleteSinglePolygonWithSline() +{ + directedLine *temp, *tempNext; + prev->next = NULL; + for(temp=this; temp != NULL; temp = tempNext) + { + tempNext = temp->next; + delete temp->sline; + delete temp; + } +} + +void directedLine::deletePolygonListWithSline() +{ + directedLine *temp, *tempNext; + for(temp=this; temp != NULL; temp=tempNext) + { + tempNext = temp->nextPolygon; + temp->deleteSinglePolygonWithSline(); + } +} + +void directedLine::deleteSinglePolygon() +{ + directedLine *temp, *tempNext; + prev->next = NULL; + for(temp=this; temp != NULL; temp = tempNext) + { + tempNext = temp->next; + delete temp; + } +} + +void directedLine::deletePolygonList() +{ + directedLine *temp, *tempNext; + for(temp=this; temp != NULL; temp=tempNext) + { + tempNext = temp->nextPolygon; + temp->deleteSinglePolygon(); + } +} + + +/*a loop by itself*/ +directedLine::directedLine(short dir, sampledLine* sl) +{ + direction = dir; + sline = sl; + next = this; + prev = this; + nextPolygon = NULL; +// prevPolygon = NULL; + rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ + + rootLink = NULL; + +} + +void directedLine::init(short dir, sampledLine* sl) +{ + direction = dir; + sline = sl; +} + +directedLine::directedLine() +{ + next = this; + prev = this; + nextPolygon = NULL; + rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ + rootLink = NULL; +} + +directedLine::~directedLine() +{ +} + +Real* directedLine::head() +{ + + return (direction==INCREASING)? (sline->get_points())[0] : (sline->get_points())[sline->get_npoints()-1]; +} + +/*inline*/ Real* directedLine::getVertex(Int i) +{ + return (direction==INCREASING)? (sline->get_points())[i] : (sline->get_points())[sline->get_npoints() - 1 -i]; +} + +Real* directedLine::tail() +{ + return (direction==DECREASING)? (sline->get_points())[0] : (sline->get_points())[sline->get_npoints()-1]; +} + + /*insert a new line between prev and this*/ +void directedLine::insert(directedLine* nl) +{ + nl->next = this; + nl->prev = prev; + prev->next = nl; + prev = nl; + nl->rootLink = this; /*assuming that 'this' is the root!!!*/ +} + +Int directedLine::numEdges() +{ + Int ret=0; + directedLine* temp; + if(next == this) return 1; + + ret = 1; + for(temp = next; temp != this; temp = temp->next) + ret++; + return ret; +} + +Int directedLine::numEdgesAllPolygons() +{ + Int ret=0; + directedLine* temp; + for(temp=this; temp!= NULL; temp=temp->nextPolygon) + { + ret += temp->numEdges(); + } + return ret; +} + +/*return 1 if the double linked list forms a polygon. + */ +short directedLine::isPolygon() +{ + directedLine* temp; + + /*a polygon contains at least 3 edges*/ + if(numEdges() <=2) return 0; + + /*check this edge*/ + if(! isConnected()) return 0; + + /*check all other edges*/ + for(temp=next; temp != this; temp = temp->next){ + if(!isConnected()) return 0; + } + return 1; +} + +/*check if the head of this edge is connected to + *the tail of the prev + */ +short directedLine::isConnected() +{ + if( (head()[0] == prev->tail()[0]) && (head()[1] == prev->tail()[1])) + return 1; + else + return 0; +} + +Int compV2InY(Real A[2], Real B[2]) +{ + if(A[1] < B[1]) return -1; + if(A[1] == B[1] && A[0] < B[0]) return -1; + if(A[1] == B[1] && A[0] == B[0]) return 0; + return 1; +} + +Int compV2InX(Real A[2], Real B[2]) +{ + if(A[0] < B[0]) return -1; + if(A[0] == B[0] && A[1] < B[1]) return -1; + if(A[0] == B[0] && A[1] == B[1]) return 0; + return 1; +} + +/*compare two vertices NOT lines! + *A vertex is the head of a directed line. + *(x_1, y_1) <= (x_2, y_2) if + *either y_1 < y_2 + *or y_1 == y_2 && x_1 < x_2. + *return -1 if this->head() <= nl->head(), + *return 1 otherwise + */ +Int directedLine::compInY(directedLine* nl) +{ + if(head()[1] < nl->head()[1]) return -1; + if(head()[1] == nl->head()[1] && head()[0] < nl->head()[0]) return -1; + return 1; +} + +/*compare two vertices NOT lines! + *A vertex is the head of a directed line. + *(x_1, y_1) <= (x_2, y_2) if + *either x_1 < x_2 + *or x_1 == x_2 && y_1 < y_2. + *return -1 if this->head() <= nl->head(), + *return 1 otherwise + */ +Int directedLine::compInX(directedLine* nl) +{ + if(head()[0] < nl->head()[0]) return -1; + if(head()[0] == nl->head()[0] && head()[1] < nl->head()[1]) return -1; + return 1; +} + +/*used by sort precedures + */ +static Int compInY2(directedLine* v1, directedLine* v2) +{ + return v1->compInY(v2); +} +#ifdef NOT_USED +static Int compInX(directedLine* v1, directedLine* v2) +{ + return v1->compInX(v2); +} +#endif + +/*sort all the vertices NOT the lines! + *a vertex is the head of a directed line + */ +directedLine** directedLine::sortAllPolygons() +{ + Int total_num_edges = 0; + directedLine** array = toArrayAllPolygons(total_num_edges); + quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void *, void *)) compInY2); + + return array; +} + +void directedLine::printSingle() +{ + if(direction == INCREASING) + printf("direction is INCREASING\n"); + else + printf("direction is DECREASING\n"); + printf("head=%f,%f)\n", head()[0], head()[1]); + sline->print(); +} + +/*print one polygon*/ +void directedLine::printList() +{ + directedLine* temp; + printSingle(); + for(temp = next; temp!=this; temp=temp->next) + temp->printSingle(); +} + +/*print all the polygons*/ +void directedLine::printAllPolygons() +{ + directedLine *temp; + for(temp = this; temp!=NULL; temp = temp->nextPolygon) + { + printf("polygon:\n"); + temp->printList(); + } +} + +/*insert this polygon into the head of the old polygon List*/ +directedLine* directedLine::insertPolygon(directedLine* oldList) +{ + /*this polygon is a root*/ + setRootBit(); + if(oldList == NULL) return this; + nextPolygon = oldList; +/* oldList->prevPolygon = this;*/ + return this; +} + +/*cutoff means delete. but we don't deallocate any space, + *so we use cutoff instead of delete + */ +directedLine* directedLine::cutoffPolygon(directedLine *p) +{ + directedLine* temp; + directedLine* prev_polygon = NULL; + if(p == NULL) return this; + + for(temp=this; temp != p; temp = temp->nextPolygon) + { + if(temp == NULL) + { + fprintf(stderr, "in cutoffPolygon, not found\n"); + exit(1); + } + prev_polygon = temp; + } + +/* prev_polygon = p->prevPolygon;*/ + + p->resetRootBit(); + if(prev_polygon == NULL) /*this is the one to cutoff*/ + return nextPolygon; + else { + prev_polygon->nextPolygon = p->nextPolygon; + return this; + } +} + +Int directedLine::numPolygons() +{ + if(nextPolygon == NULL) return 1; + else return 1+nextPolygon->numPolygons(); +} + + +/*let array[index ...] denote + *all the edges in this polygon + *return the next available index of array. + */ +Int directedLine::toArraySinglePolygon(directedLine** array, Int index) +{ + directedLine *temp; + array[index++] = this; + for(temp = next; temp != this; temp = temp->next) + { + array[index++] = temp; + } + return index; +} + +/*the space is allocated. The caller is responsible for + *deallocate the space. + *total_num_edges is set to be the total number of edges of all polygons + */ +directedLine** directedLine::toArrayAllPolygons(Int& total_num_edges) +{ + total_num_edges=numEdgesAllPolygons(); + directedLine** ret = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges); + assert(ret); + + directedLine *temp; + Int index = 0; + for(temp=this; temp != NULL; temp=temp->nextPolygon) { + index = temp->toArraySinglePolygon(ret, index); + } + return ret; +} + +/*assume the polygon is a simple polygon, return + *the area enclosed by it. + *if thee order is counterclock wise, the area is positive. + */ +Real directedLine::polyArea() +{ + directedLine* temp; + Real ret=0.0; + Real x1,y1,x2,y2; + x1 = this->head()[0]; + y1 = this->head()[1]; + x2 = this->next->head()[0]; + y2 = this->next->head()[1]; + ret = -(x2*y1-x1*y2); + for(temp=this->next; temp!=this; temp = temp->next) + { + x1 = temp->head()[0]; + y1 = temp->head()[1]; + x2 = temp->next->head()[0]; + y2 = temp->next->head()[1]; + ret += -( x2*y1-x1*y2); + } + return Real(0.5)*ret; +} + +/*******************split or combine polygons begin********************/ +/*conect a diagonal of a single simple polygon or two simple polygons. + *If the two vertices v1 (head) and v2 (head) are in the same simple polygon, + *then we actually split the simple polygon into two polygons. + *If instead two vertices velong to two difference polygons, + *then we combine the two polygons into one polygon. + *It is upto the caller to decide whether this is a split or a + *combination. + * + *Case Split: + *split a single simple polygon into two simple polygons by + *connecting a diagonal (two vertices). + *v1, v2: the two vertices are the head() of the two directedLines. + * this routine generates one new sampledLine which is returned in + *generatedLine, + *and it generates two directedLines returned in ret_p1 and ret_p2. + *ret_p1 and ret_p2 are used as the entry to the two new polygons. + *Notice the caller should not deallocate the space of v2 and v2 after + *calling this function, since all of the edges are connected to + *ret_p1 or ret_p2. + * + *combine: + *combine two simpolygons into one by connecting one diagonal. + *the returned polygon is returned in ret_p1. + */ +/*ARGSUSED*/ +void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, + directedLine** ret_p1, + directedLine** ret_p2, + sampledLine** generatedLine, + directedLine* polygonList ) +{ + sampledLine *nsline = new sampledLine(2); + + + + nsline->setPoint(0, v1->head()); + nsline->setPoint(1, v2->head()); + + + + /*the increasing line is from v1 head to v2 head*/ + directedLine* newLineInc = new directedLine(INCREASING, nsline); + + + + directedLine* newLineDec = new directedLine(DECREASING, nsline); + + + directedLine* v1Prev = v1->prev; + directedLine* v2Prev = v2->prev; + + v1 ->prev = newLineDec; + v2Prev ->next = newLineDec; + newLineDec->next = v1; + newLineDec->prev = v2Prev; + + v2 ->prev = newLineInc; + v1Prev ->next = newLineInc; + newLineInc->next = v2; + newLineInc->prev = v1Prev; + + *ret_p1 = newLineDec; + *ret_p2 = newLineInc; + *generatedLine = nsline; +} + +//see the function connectDiangle +/*ARGSUSED*/ +void directedLine::connectDiagonal_2slines(directedLine* v1, directedLine* v2, + directedLine** ret_p1, + directedLine** ret_p2, + directedLine* polygonList ) +{ + sampledLine *nsline = new sampledLine(2); + sampledLine *nsline2 = new sampledLine(2); + + nsline->setPoint(0, v1->head()); + nsline->setPoint(1, v2->head()); + nsline2->setPoint(0, v1->head()); + nsline2->setPoint(1, v2->head()); + + /*the increasing line is from v1 head to v2 head*/ + directedLine* newLineInc = new directedLine(INCREASING, nsline); + + directedLine* newLineDec = new directedLine(DECREASING, nsline2); + + directedLine* v1Prev = v1->prev; + directedLine* v2Prev = v2->prev; + + v1 ->prev = newLineDec; + v2Prev ->next = newLineDec; + newLineDec->next = v1; + newLineDec->prev = v2Prev; + + v2 ->prev = newLineInc; + v1Prev ->next = newLineInc; + newLineInc->next = v2; + newLineInc->prev = v1Prev; + + *ret_p1 = newLineDec; + *ret_p2 = newLineInc; + +} + +Int directedLine::samePolygon(directedLine* v1, directedLine* v2) +{ + if(v1 == v2) return 1; + directedLine *temp; + for(temp = v1->next; temp != v1; temp = temp->next) + { + if(temp == v2) return 1; + } + return 0; +} + +directedLine* directedLine::findRoot() +{ + if(rootBit) return this; + directedLine* temp; + for(temp = next; temp != this; temp = temp->next) + if(temp -> rootBit ) return temp; + return NULL; /*should not happen*/ +} + +directedLine* directedLine::rootLinkFindRoot() +{ + directedLine* tempRoot; + directedLine* tempLink; + tempRoot = this; + tempLink = rootLink; + while(tempLink != NULL){ + tempRoot = tempLink; + tempLink = tempRoot->rootLink; + } + return tempRoot; +} + +/*******************split or combine polygons end********************/ + +/*****************IO stuff begin*******************/ + +/*format: + *#polygons + * #vertices + * vertices + * #vertices + * vertices + *... + */ +void directedLine::writeAllPolygons(char* filename) +{ + FILE* fp = fopen(filename, "w"); + assert(fp); + Int nPolygons = numPolygons(); + directedLine *root; + fprintf(fp, "%i\n", nPolygons); + for(root = this; root != NULL; root = root->nextPolygon) + { + directedLine *temp; + Int npoints=0; + npoints = root->get_npoints()-1; + for(temp = root->next; temp != root; temp=temp->next) + npoints += temp->get_npoints()-1; + fprintf(fp, "%i\n", npoints/*root->numEdges()*/); + + + for(Int i=0; iget_npoints()-1; i++){ + fprintf(fp, "%f ", root->getVertex(i)[0]); + fprintf(fp, "%f ", root->getVertex(i)[1]); + } + + for(temp=root->next; temp != root; temp = temp->next) + { + for(Int i=0; iget_npoints()-1; i++){ + + fprintf(fp, "%f ", temp->getVertex(i)[0]); + fprintf(fp, "%f ", temp->getVertex(i)[1]); + } + fprintf(fp,"\n"); + } + fprintf(fp, "\n"); + } + fclose(fp); +} + +directedLine* readAllPolygons(char* filename) +{ + Int i,j; + FILE* fp = fopen(filename, "r"); + assert(fp); + Int nPolygons; + fscanf(fp, "%i", &nPolygons); + directedLine *ret = NULL; + + for(i=0; irootLinkSet(NULL); + + directedLine *dLine; + for(j=2; jrootLinkSet(thisPoly); + thisPoly->insert(dLine); + } + + VV[0][0]=vert[1][0]; + VV[0][1]=vert[1][1]; + sLine = new sampledLine(2,VV); + dLine = new directedLine(INCREASING, sLine); +dLine->rootLinkSet(thisPoly); + thisPoly->insert(dLine); + + ret = thisPoly->insertPolygon(ret); + } + fclose(fp); + return ret; +} + + + + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,171 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _DIRECTEDLINE_H +#define _DIRECTEDLINE_H + +#include "definitions.h" +#include "sampledLine.h" + +enum {INCREASING, DECREASING}; + +class directedLine { + short direction; /*INCREASING or DECREASING*/ + sampledLine* sline; + directedLine* next; /*double linked list*/ + directedLine* prev; /*double linked list*/ + + /*in case we need a list of polygons each + *consisting of a double linked list + */ + directedLine* nextPolygon; + + /*optimization make cutoff polygon faster*/ +/* directedLine* prevPolygon;*/ + + Int rootBit; /*1 if this is a root of the polygon, set by setRootBit*/ + /*and reset by resetRootBit()*/ + + directedLine* rootLink; /*fast root-finding*/ + + + +public: + directedLine(short dir, sampledLine* sl); + directedLine(); + ~directedLine(); + + void init(short dir, sampledLine* sl); + + Real* head(); /*points[0] if INCREASING, points[n-1] otherwise*/ + Real* tail(); /*points[n-1] if INCREASING, points[0] otherwise*/ + Real* getVertex(Int i); /*points[i] if INCREASING, points[n-1-i] otherwise*/ + Int get_npoints() {return sline->get_npoints();} + directedLine* getPrev() {return prev;} + directedLine* getNext() {return next;} + directedLine* getNextPolygon() {return nextPolygon;} + sampledLine* getSampledLine() {return sline;} + + short getDirection(){return direction;} + void putDirection(short dir) {direction = dir;} + void putPrev(directedLine *p) {prev = p;} + void putNext(directedLine *p) {next = p;} + + /*insert a new line between prev and this*/ + void insert(directedLine* nl); + + /*delete all the polygons following the link: nextPolygon. + *notice that sampledLine is not deleted. The caller is + *responsible for that + */ + void deletePolygonList(); + void deleteSinglePolygon(); + + void deleteSinglePolygonWithSline(); //also delete sanmpled line + void deletePolygonListWithSline(); //also delete sanmpled line + + void deleteSingleLine(directedLine* dline); + directedLine* deleteDegenerateLines(); + directedLine* deleteDegenerateLinesAllPolygons(); + directedLine* cutIntersectionAllPoly(int& cutOccur); + + /*check to see if the list forms a closed polygon + *return 1 if yes + */ + short isPolygon(); + + Int compInY(directedLine* nl); + Int compInX(directedLine* nl); + + /*return an array of pointers. + *the + */ + directedLine** sortAllPolygons(); + + Int numEdges(); + Int numEdgesAllPolygons(); + Int numPolygons(); + + /*check if the head of this edge is connected to + *the tail of the prev + */ + short isConnected(); + + Real polyArea(); + + void printSingle(); + void printList(); + void printAllPolygons(); + void writeAllPolygons(char* filename); + + + /*insert a polygon: using nextPolygon*/ + directedLine* insertPolygon(directedLine* newpolygon); + directedLine* cutoffPolygon(directedLine *p); + + Int toArraySinglePolygon(directedLine** array, Int index); + directedLine** toArrayAllPolygons(Int& total_num_edges); + + void connectDiagonal(directedLine* v1, directedLine* v2, + directedLine** ret_p1, + directedLine** ret_p2, + sampledLine** generatedLine, directedLine* list); + + /*generate two slines + */ + void connectDiagonal_2slines(directedLine* v1, directedLine* v2, + directedLine** ret_p1, + directedLine** ret_p2, + directedLine* list); + + Int samePolygon(directedLine* v1, directedLine* v2); + void setRootBit() {rootBit = 1;} + void resetRootBit() {rootBit = 0;} + directedLine* findRoot(); + + void rootLinkSet(directedLine* r) {rootLink = r;} + directedLine* rootLinkFindRoot(); + + //the chain from begin to end is deleted (the space is deallocated) + //and a new edge(which connectes the head of begin and the tail of end) + // is inserted. The new polygon is returned. + //notice that "this" is arbitrary + directedLine* deleteChain(directedLine* begin, directedLine* end); +}; + +directedLine* readAllPolygons(char* filename); + +extern Int compV2InY(Real A[2], Real B[2]); +extern Int compV2InX(Real A[2], Real B[2]); + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/glimports.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/glimports.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/glimports.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/glimports.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * glimports.h + * + */ + +#ifndef __gluimports_h_ +#define __gluimports_h_ + +#include "mystdlib.h" +#include "mystdio.h" + +#endif /* __gluimports_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,293 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include +#include "zlassert.h" +#include "gridWrap.h" + + +/*******************grid structure****************************/ +void gridWrap::print() +{ + printf("n_ulines = %i\n", n_ulines); + printf("n_vlines = %i\n", n_vlines); + printf("u_min=%f, umax=%f, vmin=%f, vmax=%f\n", u_min, u_max, v_min, v_max); +} + +gridWrap::gridWrap(Int nUlines, Real* uvals, + Int nVlines, Real* vvals) +{ + assert(nUlines>=2); + assert(nVlines>=2); + + is_uniform = 0; + n_ulines = nUlines; + n_vlines = nVlines; + u_min = uvals[0]; + u_max = uvals[nUlines-1]; + v_min = vvals[0]; + v_max = vvals[nVlines-1]; + u_values = (Real*) malloc(sizeof(Real) * n_ulines); + assert(u_values); + v_values = (Real*) malloc(sizeof(Real) * n_vlines); + assert(v_values); + + Int i; + for(i=0; i=2); + assert(nVlines>=2); + Real du = (uMax-uMin)/(nUlines-1); + Real dv = (vMax-vMin)/(nVlines-1); + + float tempu=uMin; + u_values[0] = tempu; + for(i=1; i= uright) + return; //no triangles to output. + + pStream->begin(); + pStream->insert(vert); + + assert(vert[1] != v_values[v]); //don't output degenerate triangles + + if(vert[1] > v_values[v]) //vertex is above this grid line: notice the orientation + { + for(i=uleft; i<=uright; i++) + pStream->insert(u_values[i], v_values[v]); + } + else //vertex is below the grid line + { + for(i=uright; i>= uleft; i--) + pStream->insert(u_values[i], v_values[v]); + } + + pStream->end(PRIMITIVE_STREAM_FAN); +} + + + +/*each chain stores a number of consecutive + *V-lines within a grid. + *There is one grid vertex on each V-line. + * The total number of V-lines is: + * nVlines. + * with respect to the grid, the index of the first V-line is + * firstVlineIndex. + * So with respect to the grid, the index of the ith V-line is + * firstVlineIndex-i. + * the grid-index of the uline at the ith vline (recall that each vline has one grid point) + * is ulineIndices[i]. The u_value is cached in ulineValues[i], that is, + * ulineValues[i] = grid->get_u_value(ulineIndices[i]) + */ +gridBoundaryChain::gridBoundaryChain( + gridWrap* gr, + Int first_vline_index, + Int n_vlines, + Int* uline_indices, + Int* inner_indices + ) +: grid(gr), firstVlineIndex(first_vline_index), nVlines(n_vlines) +{ + ulineIndices = (Int*) malloc(sizeof(Int) * n_vlines); + assert(ulineIndices); + + innerIndices = (Int*) malloc(sizeof(Int) * n_vlines); + assert(innerIndices); + + vertices = (Real2*) malloc(sizeof(Real2) * n_vlines); + assert(vertices); + + + + Int i; + for(i=0; iget_u_value(ulineIndices[i]); + vertices[i][1] = gr->get_v_value(first_vline_index-i); + } +} + +void gridBoundaryChain::draw() +{ + Int i; + glBegin(GL_LINE_STRIP); + for(i=0; iget_u_value(innerIndices[i]), get_v_value(i-1) ); + glVertex2f(grid->get_u_value(innerIndices[i]), get_v_value(i) ); + glEnd(); + } +} + +Int gridBoundaryChain::lookfor(Real v, Int i1, Int i2) +{ + Int mid; + while(i1 < i2-1) + { + mid = (i1+i2)/2; + if(v > vertices[mid][1]) + { + i2 = mid; + } + else + i1 = mid; + } + return i1; +} + +/*output the fan of the right end between grid line i-1 and grid line i*/ +void gridBoundaryChain::rightEndFan(Int i, primStream* pStream) +{ + Int j; + if(getUlineIndex(i) > getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(get_vertex(i-1)); + for(j=getUlineIndex(i-1); j<= getUlineIndex(i); j++) + pStream->insert(grid->get_u_value(j), get_v_value(i)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + else if(getUlineIndex(i) < getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(get_vertex(i)); + for(j=getUlineIndex(i-1); j>= getUlineIndex(i); j--) + pStream->insert(grid->get_u_value(j), get_v_value(i-1)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + //otherside, the two are equal, so there is no fan to output +} + + +/*output the fan of the left end between grid line i-1 and grid line i*/ +void gridBoundaryChain::leftEndFan(Int i, primStream* pStream) +{ + Int j; + if(getUlineIndex(i) < getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(get_vertex(i-1)); + for(j=getUlineIndex(i); j<= getUlineIndex(i-1); j++) + pStream->insert(grid->get_u_value(j), get_v_value(i)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + else if(getUlineIndex(i) > getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(get_vertex(i)); + for(j=getUlineIndex(i); j>= getUlineIndex(i-1); j--) + pStream->insert(grid->get_u_value(j), get_v_value(i-1)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + /*otherwisem, the two are equal, so there is no fan to outout*/ +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,137 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _GRIDWRAP_H +#define _GRIDWRAP_H + +#include +#include "definitions.h" + +#include "primitiveStream.h" +#include "zlassert.h" + +class gridWrap{ + Int n_ulines; + Int n_vlines; + Real u_min, u_max; + Real v_min, v_max; + + /*cache the coordinate values for efficiency. + *these are redundant information when + *the grid is uniform. + */ + Real* u_values; /*size is n_ulines*/ + Real* v_values; /*size is n_vlines*/ + + Int is_uniform; + +public: + //uniform grid constructor + gridWrap(Int nUlines, Int nVlines, + Real uMin, Real uMax, + Real vMin, Real vMax + ); + + //nonuniform grid constructor. + gridWrap(Int nUlines, Real *uvals, + Int nVlines, Real *vvlas + ); + ~gridWrap(); + + void print(); + Int get_n_ulines() {return n_ulines;} + Int get_n_vlines() {return n_vlines;} + Real get_u_min() {return u_min;} + Real get_u_max() {return u_max;} + Real get_v_min() {return v_min;} + Real get_v_max() {return v_max;} + + Real get_u_value(Int i) + { + assert(i=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/ + return u_values[i];} + Real get_v_value(Int j) {return v_values[j];} + + Real* get_u_values() {return u_values;} + Real* get_v_values() {return v_values;} + + void outputFanWithPoint(Int v, Int uleft, Int uright, + Real vert[2], primStream* pStream); + + void draw(); + + Int isUniform() {return is_uniform;} +}; + +class gridBoundaryChain{ + gridWrap* grid; + Int firstVlineIndex; + Int nVlines; + Int* ulineIndices; /*each v line has a boundary*/ + Int* innerIndices; /*the segment of the vertical gridline from */ + /*(innerIndices[i], i) to (innerIndices[i+1], i-1) */ + /*is inside the polygon: i=1,...,nVlines-1*/ + + Real2* vertices; /*one grid point at each grid V-line, cached for efficiency*/ + +public: + gridBoundaryChain(gridWrap* gr, Int first_vline_index, Int n_vlines, Int* uline_indices, Int* inner_indices); + + ~gridBoundaryChain() + { + free(innerIndices); + free(ulineIndices); + free(vertices); + } + + /*i indexes the vlines in this chain. + */ + Int getVlineIndex(Int i) {return firstVlineIndex-i;} + Int getUlineIndex(Int i) {return ulineIndices[i];} + Real get_u_value(Int i) {return vertices[i][0];} + Real get_v_value(Int i) {return vertices[i][1];} + Int get_nVlines() {return nVlines;} + Int getInnerIndex(Int i) {return innerIndices[i];} + Real getInner_u_value(Int i) {return grid->get_u_value(innerIndices[i]);} + + Real* get_vertex(Int i) {return vertices[i];} + gridWrap* getGrid() {return grid;} + void leftEndFan(Int i, primStream* pStream); + void rightEndFan(Int i, primStream* pStream); + + Int lookfor(Real v, Int i1, Int i2); //find i in [i1,i2] so that vertices[i][1]>= v > vertices[i+1][1] + void draw(); + void drawInner(); +}; + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,934 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include + +#include "glimports.h" +#include "zlassert.h" + +#include "monoChain.h" +#include "quicksort.h" +#include "searchTree.h" +#include "polyUtil.h" + +#ifndef max +#define max(a,b) ((a>b)? a:b) +#endif +#ifndef min +#define min(a,b) ((a>b)? b:a) +#endif + +extern Int isCusp(directedLine *v); +extern Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices); + +//for debug purpose only +#if 0 // UNUSED +static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices) +{ + Int i; + for(i=0; ihead()); + glVertex2fv(diagonal_vertices[2*i+1]->head()); + glEnd(); + } +} +#endif + +/*given (x_1, y_1) and (x_2, y_2), and y + *return x such that (x,y) is on the line + */ +inline Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y) +{ + return ((y2==y1)? (x1+x2)*0.5 : x1 + ((y-y1)/(y2-y1)) * (x2-x1)); +} + +//compare the heads of the two chains +static int compChainHeadInY(monoChain* mc1, monoChain* mc2) +{ + return compV2InY(mc1->getHead()->head(), mc2->getHead()->head()); +} + +monoChain::monoChain(directedLine* cHead, directedLine* cTail) +{ + chainHead = cHead; + chainTail = cTail; + next = this; + prev = this; + + nextPolygon = NULL; + + //compute bounding box + directedLine* temp; + minX = maxX = chainTail->head()[0]; + minY = maxY = chainTail->head()[1]; + + for(temp=chainHead; temp!=cTail; temp = temp->getNext()) + { + if(temp->head()[0] < minX) + minX = temp->head()[0]; + if(temp->head()[0] > maxX) + maxX = temp->head()[0]; + + if(temp->head()[1] < minY) + minY = temp->head()[1]; + if(temp->head()[1] > maxY) + maxY = temp->head()[1]; + } + + //check whether the chain is increasing or decreasing + if(chainHead->compInY(chainTail) <0) + isIncrease = 1; + else + isIncrease = 0; + + //initilize currrent, this is used for accelerating search + if(isIncrease) + current = chainHead; + else + current = chainTail; + + isKey = 0; +} + +//insert a new line between prev and this +void monoChain::insert(monoChain* nc) +{ + nc->next = this; + nc->prev = prev; + prev->next = nc; + prev = nc; +} + +void monoChain::deleteLoop() +{ + monoChain *temp, *tempNext; + prev->next = NULL; + for(temp=this; temp != NULL; temp = tempNext) + { + tempNext = temp->next; + delete temp; + } +} + +void monoChain::deleteLoopList() +{ + monoChain *temp, *tempNext; + for(temp=this; temp != NULL; temp = tempNext) + { + tempNext = temp->nextPolygon; + temp->deleteLoop(); + } +} + +Int monoChain::toArraySingleLoop(monoChain** array, Int index) +{ + monoChain *temp; + array[index++] = this; + for(temp = next; temp != this; temp = temp->next) + { + array[index++] = temp; + } + return index; +} + +monoChain** monoChain::toArrayAllLoops(Int& num_chains) +{ + num_chains = numChainsAllLoops(); + monoChain **ret = (monoChain**) malloc(sizeof(monoChain*) * num_chains); + assert(ret); + monoChain *temp; + Int index = 0; + for(temp = this; temp != NULL; temp=temp->nextPolygon){ + index = temp->toArraySingleLoop(ret, index); + } + return ret; +} + +Int monoChain::numChainsSingleLoop() +{ + Int ret=0; + monoChain* temp; + if(next == this) return 1; + ret = 1; + for(temp=next; temp != this; temp = temp->next) + ret++; + return ret; +} + +Int monoChain::numChainsAllLoops() +{ + Int ret=0; + monoChain *temp; + for(temp =this; temp != NULL; temp = temp->nextPolygon) + ret += temp->numChainsSingleLoop(); + return ret; +} + +//update 'current' +Real monoChain::chainIntersectHoriz(Real y) +{ + directedLine* temp; + if(isIncrease) + { + for(temp= current; temp != chainTail; temp = temp->getNext()) + { + if(temp->head()[1] > y) + break; + } + current = temp->getPrev(); + } + else + { + for(temp = current; temp != chainHead; temp = temp->getPrev()) + { + if(temp->head()[1] > y) + break; + } + current = temp->getNext(); + } + return intersectHoriz(current->head()[0], current->head()[1], current->tail()[0], current->tail()[1], y); +} + +monoChain* directedLineLoopToMonoChainLoop(directedLine* loop) +{ + directedLine *temp; + monoChain *ret=NULL; + + //find the first cusp + directedLine *prevCusp=NULL; + directedLine *firstCusp; + + if(isCusp(loop)) + prevCusp = loop; + else + { + for(temp = loop->getNext(); temp != loop; temp = temp->getNext()) + if(isCusp(temp)) + break; + prevCusp = temp; + } + firstCusp = prevCusp; +//printf("first cusp is (%f,%f), (%f,%f), (%f,%f)\n", prevCusp->getPrev()->head()[0], prevCusp->getPrev()->head()[1], prevCusp->head()[0], prevCusp->head()[1], prevCusp->tail()[0], prevCusp->tail()[1]); + + for(temp = prevCusp->getNext(); temp != loop; temp = temp->getNext()) + { + if(isCusp(temp)) + { +//printf("the cusp is (%f,%f), (%f,%f), (%f,%f)\n", temp->getPrev()->head()[0], temp->getPrev()->head()[1], temp->head()[0], temp->head()[1], temp->tail()[0], temp->tail()[1]); + if(ret == NULL) + { + ret = new monoChain(prevCusp, temp); + } + else + ret->insert(new monoChain(prevCusp, temp)); + prevCusp = temp; + } + } + ret->insert(new monoChain(prevCusp, firstCusp)); + + return ret; +} + +monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list) +{ + directedLine* temp; + monoChain* mc; + monoChain* mcEnd; + mc = directedLineLoopToMonoChainLoop(list); + mcEnd = mc; + for(temp = list->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon()) + { + monoChain *newLoop = directedLineLoopToMonoChainLoop(temp); + mcEnd->setNextPolygon(newLoop); + mcEnd = newLoop; + } + return mc; +} + +/*compare two edges of a polygon. + *edge A < edge B if there is a horizontal line so that the intersection + *with A is to the left of the intersection with B. + *This function is used in sweepY for the dynamic search tree insertion to + *order the edges. + * Implementation: (x_1,y_1) and (x_2, y_2) + */ +static Int compEdges(directedLine *e1, directedLine *e2) +{ + Real* head1 = e1->head(); + Real* tail1 = e1->tail(); + Real* head2 = e2->head(); + Real* tail2 = e2->tail(); +/* + Real h10 = head1[0]; + Real h11 = head1[1]; + Real t10 = tail1[0]; + Real t11 = tail1[1]; + Real h20 = head2[0]; + Real h21 = head2[1]; + Real t20 = tail2[0]; + Real t21 = tail2[1]; +*/ + Real e1_Ymax, e1_Ymin, e2_Ymax, e2_Ymin; +/* + if(h11>t11) { + e1_Ymax= h11; + e1_Ymin= t11; + } + else{ + e1_Ymax = t11; + e1_Ymin = h11; + } + + if(h21>t21) { + e2_Ymax= h21; + e2_Ymin= t21; + } + else{ + e2_Ymax = t21; + e2_Ymin = h21; + } +*/ + + if(head1[1]>tail1[1]) { + e1_Ymax= head1[1]; + e1_Ymin= tail1[1]; + } + else{ + e1_Ymax = tail1[1]; + e1_Ymin = head1[1]; + } + + if(head2[1]>tail2[1]) { + e2_Ymax= head2[1]; + e2_Ymin= tail2[1]; + } + else{ + e2_Ymax = tail2[1]; + e2_Ymin = head2[1]; + } + + + /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ + /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ + /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ + /*Real e2_Ymin = min(head2[1], tail2[1]);*/ /*min(e2->head()[1], e2->tail()[1]);*/ + + Real Ymax = min(e1_Ymax, e2_Ymax); + Real Ymin = max(e1_Ymin, e2_Ymin); + + Real y = 0.5*(Ymax + Ymin); + +/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y); + Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y); +*/ +/* + Real x1 = intersectHoriz(h10, h11, t10, t11, y); + Real x2 = intersectHoriz(h20, h21, t20, t21, y); +*/ + Real x1 = intersectHoriz(head1[0], head1[1], tail1[0], tail1[1], y); + Real x2 = intersectHoriz(head2[0], head2[1], tail2[0], tail2[1], y); + + if(x1<= x2) return -1; + else return 1; +} + +Int compChains(monoChain* mc1, monoChain* mc2) +{ + Real y; + assert(mc1->isKey || mc2->isKey); + if(mc1->isKey) + y = mc1->keyY; + else + y = mc2->keyY; + directedLine *d1 = mc1->find(y); + directedLine *d2 = mc2->find(y); + mc2->find(y); +// Real x1 = mc1->chainIntersectHoriz(y); +// Real x2 = mc2->chainIntersectHoriz(y); + return compEdges(d1, d2); +} + +//this function modifies current for efficiency +directedLine* monoChain::find(Real y) +{ + directedLine *ret; + directedLine *temp; + assert(current->head()[1] <= y); + if(isIncrease) + { + assert(chainTail->head()[1] >=y); + for(temp=current; temp!=chainTail; temp = temp->getNext()) + { + if(temp->head()[1] > y) + break; + } + current = temp->getPrev(); + ret = current; + } + else + { + for(temp=current; temp != chainHead; temp = temp->getPrev()) + { + if(temp->head()[1] > y) + break; + } + current = temp->getNext(); + ret = temp; + } + return ret; +} + +void monoChain::printOneChain() +{ + directedLine* temp; + for(temp = chainHead; temp != chainTail; temp = temp->getNext()) + { + printf("(%f,%f) ", temp->head()[0], temp->head()[1]); + } + printf("(%f,%f) \n", chainTail->head()[0], chainTail->head()[1]); +} + +void monoChain::printChainLoop() +{ + monoChain* temp; + this->printOneChain(); + for(temp = next; temp != this; temp = temp->next) + { + temp->printOneChain(); + } + printf("\n"); +} + +void monoChain::printAllLoops() +{ + monoChain* temp; + for(temp=this; temp != NULL; temp = temp->nextPolygon) + temp->printChainLoop(); +} + +//return 1 if error occures +Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges) +{ + Int i; + Real keyY; + Int errOccur=0; +//printf("enter MC_sweepY\n"); +//printf("nVertices=%i\n", nVertices); + /*for each vertex in the sorted list, update the binary search tree. + *and store the range information for each vertex. + */ + treeNode* searchTree = NULL; +//printf("nVertices=%i\n", nVertices); + for(i=0; igetHead()->head()[1]; //the sweep line + directedLine *dline = vert->getHead(); + directedLine *dlinePrev = dline->getPrev(); + if(isBelow(dline, dline) && isBelow(dline, dlinePrev)) + { +//printf("case 1\n"); + //thisisKey = 1; + vert->keyY = keyY; + treeNode* thisNode = TreeNodeFind(searchTree, vert, (Int (*) (void *, void *))compChains); + vert->isKey = 0; + + vert->getPrev()->isKey = 1; + vert->getPrev()->keyY = keyY; + treeNode* prevNode = TreeNodeFind(searchTree, vert->getPrev(), (Int (*) (void *, void *))compChains); + vert->getPrev()->isKey = 0; + + if(cuspType(dline) == 1)//interior cusp + { + + treeNode* leftEdge = TreeNodePredecessor(prevNode); + treeNode* rightEdge = TreeNodeSuccessor(thisNode); + if(leftEdge == NULL || rightEdge == NULL) + { + errOccur = 1; + goto JUMP_HERE; + } + + directedLine* leftEdgeDline = ((monoChain* ) leftEdge->key)->find(keyY); + + + + directedLine* rightEdgeDline = ((monoChain* ) rightEdge->key)->find(keyY); + + ret_ranges[i] = sweepRangeMake(leftEdgeDline, 1, rightEdgeDline, 1); + } + else /*exterior cusp*/ + { + ret_ranges[i] = sweepRangeMake( dline, 1, dlinePrev, 1); + } + + searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode); + searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode); + + } + else if(isAbove(dline, dline) && isAbove(dline, dlinePrev)) + { +//printf("case 2\n"); + //insert both edges + treeNode* thisNode = TreeNodeMake(vert); + treeNode* prevNode = TreeNodeMake(vert->getPrev()); + + vert->isKey = 1; + vert->keyY = keyY; + searchTree = TreeNodeInsert(searchTree, thisNode, (Int (*) (void *, void *))compChains); + vert->isKey = 0; + + vert->getPrev()->isKey = 1; + vert->getPrev()->keyY = keyY; + searchTree = TreeNodeInsert(searchTree, prevNode, (Int (*) (void *, void *))compChains); + vert->getPrev()->isKey = 0; + + if(cuspType(dline) == 1) //interior cusp + { +//printf("cuspType is 1\n"); + treeNode* leftEdge = TreeNodePredecessor(thisNode); + treeNode* rightEdge = TreeNodeSuccessor(prevNode); + if(leftEdge == NULL || rightEdge == NULL) + { + errOccur = 1; + goto JUMP_HERE; + } +//printf("leftEdge is %i, rightEdge is %i\n", leftEdge, rightEdge); + directedLine* leftEdgeDline = ((monoChain*) leftEdge->key)->find(keyY); + directedLine* rightEdgeDline = ((monoChain*) rightEdge->key)->find(keyY); + ret_ranges[i] = sweepRangeMake( leftEdgeDline, 1, rightEdgeDline, 1); + } + else //exterior cusp + { +//printf("cuspType is not 1\n"); + ret_ranges[i] = sweepRangeMake(dlinePrev, 1, dline, 1); + } + } + else + { +//printf("%i,%i\n", isAbove(dline, dline), isAbove(dline, dlinePrev)); + errOccur = 1; + goto JUMP_HERE; + + fprintf(stderr, "error in MC_sweepY\n"); + exit(1); + } + } + + JUMP_HERE: + //finally clean up space: delete the search tree + TreeNodeDeleteWholeTree(searchTree); + return errOccur; +} + +void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, + sweepRange** ranges, Int& num_diagonals, + directedLine** diagonal_vertices) +{ + Int i,j,k; + k=0; + //reset 'current' of all the monoChains + for(i=0; iresetCurrent(); + + for(i=0; igetHead(); + directedLine* thisEdge = vert; + directedLine* prevEdge = vert->getPrev(); + if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge) && compEdges(prevEdge, thisEdge)<0) + { + //this is an upward interior cusp + diagonal_vertices[k++] = vert; + + directedLine* leftEdge = ranges[i]->left; + directedLine* rightEdge = ranges[i]->right; + + directedLine* leftVert = leftEdge; + directedLine* rightVert = rightEdge->getNext(); + assert(leftVert->head()[1] >= vert->head()[1]); + assert(rightVert->head()[1] >= vert->head()[1]); + directedLine* minVert = (leftVert->head()[1] <= rightVert->head()[1])?leftVert:rightVert; + Int found = 0; + for(j=i+1; jgetHead()->head()[1] > minVert->head()[1]) + break; + + if(sweepRangeEqual(ranges[i], ranges[j])) + { + found = 1; + break; + } + } + + if(found) + diagonal_vertices[k++] = sortedVertices[j]->getHead(); + else + diagonal_vertices[k++] = minVert; + } + else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge) && compEdges(prevEdge, thisEdge)>0) + { + //downward interior cusp + diagonal_vertices[k++] = vert; + directedLine* leftEdge = ranges[i]->left; + directedLine* rightEdge = ranges[i]->right; + directedLine* leftVert = leftEdge->getNext(); + directedLine* rightVert = rightEdge; + assert(leftVert->head()[1] <= vert->head()[1]); + assert(rightVert->head()[1] <= vert->head()[1]); + directedLine* maxVert = (leftVert->head()[1] > rightVert->head()[1])? leftVert:rightVert; + Int found=0; + for(j=i-1; j>=0; j--) + { + if(sortedVertices[j]->getHead()->head()[1] < maxVert->head()[1]) + break; + if(sweepRangeEqual(ranges[i], ranges[j])) + { + found = 1; + break; + } + } + if(found) + diagonal_vertices[k++] = sortedVertices[j]->getHead(); + else + diagonal_vertices[k++] = maxVert; + } + } + num_diagonals = k/2; +} + + + + +directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines) +{ +//printf("enter mc_partitionY\n"); + Int total_num_chains = 0; + monoChain* loopList = directedLineLoopListToMonoChainLoopList(polygons); + monoChain** array = loopList->toArrayAllLoops(total_num_chains); + + if(total_num_chains<=2) //there is just one single monotone polygon + { + loopList->deleteLoopList(); + free(array); + *retSampledLines = NULL; + return polygons; + } + +//loopList->printAllLoops(); +//printf("total_num_chains=%i\n", total_num_chains); + quicksort( (void**)array, 0, total_num_chains-1, (Int (*)(void*, void*))compChainHeadInY); +//printf("after quicksort\n"); + + sweepRange** ranges = (sweepRange**)malloc(sizeof(sweepRange*) * (total_num_chains)); + assert(ranges); + + if(MC_sweepY(total_num_chains, array, ranges)) + { + loopList->deleteLoopList(); + free(array); + *retSampledLines = NULL; + return NULL; + } +//printf("after MC_sweepY\n"); + + + Int num_diagonals; + /*number diagonals is < total_num_edges*total_num_edges*/ + directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_chains*2/*total_num_edges*/); + assert(diagonal_vertices); + +//printf("before call MC_findDiagonales\n"); + + MC_findDiagonals(total_num_chains, array, ranges, num_diagonals, diagonal_vertices); +//printf("after call MC_findDia, num_diagnla=%i\n", num_diagonals); + + directedLine* ret_polygons = polygons; + sampledLine* newSampledLines = NULL; + Int i,k; + + num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices); + + + +//drawDiagonals(num_diagonals, diagonal_vertices); +//printf("diagoanls are \n"); +//for(i=0; ihead()[0], diagonal_vertices[2*i]->head()[1]); +// printf("**(%f,%f)\n", diagonal_vertices[2*i+1]->head()[0], diagonal_vertices[2*i+1]->head()[1]); +// } + + Int *removedDiagonals=(Int*)malloc(sizeof(Int) * num_diagonals); + for(i=0; ifindRoot(); + directedLine *root2 = v2->findRoot(); + assert(root1); + assert(root2); +*/ + +directedLine* root1 = v1->rootLinkFindRoot(); +directedLine* root2 = v2->rootLinkFindRoot(); + + if(root1 != root2) + { + + removedDiagonals[i] = 1; + sampledLine* generatedLine; + + + + v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); + + + + newSampledLines = generatedLine->insert(newSampledLines); +/* + ret_polygons = ret_polygons->cutoffPolygon(root1); + + ret_polygons = ret_polygons->cutoffPolygon(root2); + ret_polygons = ret_p1->insertPolygon(ret_polygons); +root1->rootLinkSet(ret_p1); +root2->rootLinkSet(ret_p1); +ret_p1->rootLinkSet(NULL); +ret_p2->rootLinkSet(ret_p1); +*/ + ret_polygons = ret_polygons->cutoffPolygon(root2); + + + +root2->rootLinkSet(root1); +ret_p1->rootLinkSet(root1); +ret_p2->rootLinkSet(root1); + + /*now that we have connected the diagonal v1 and v2, + *we have to check those unprocessed diagonals which + *have v1 or v2 as an end point. Notice that the head of v1 + *has the same coodinates as the head of v2->prev, and the head of + *v2 has the same coordinate as the head of v1->prev. + *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid + *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be + *replaced by (v2->prev, x), that is, x is on the left of + * v2->prev->prev->head, v2->prev->head, v2->prev->tail. + */ + Int ii, kk; + for(ii=0, kk=0; iiprev->head:v1->head:v1->tail*/ + if(! pointLeft2Lines(v1->getPrev()->head(), + v1->head(), v1->tail(), d2->head())) + { +/* + assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), + v2->getPrev()->head(), + v2->getPrev()->tail(), d2->head())); +*/ + diagonal_vertices[kk] = v2->getPrev(); + } + } + if(d1 == v2) { + /*check if d2 is to left of v2->prev->head:v2->head:v2->tail*/ + if(! pointLeft2Lines(v2->getPrev()->head(), + v2->head(), v2->tail(), d2->head())) + { +/* + assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), + v1->getPrev()->head(), + v1->getPrev()->tail(), d2->head())); +*/ + diagonal_vertices[kk] = v1->getPrev(); + } + } + /*check d2 and replace diagonal_vertices[k+1] if necessary*/ + if(d2 == v1) { + /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/ + if(! pointLeft2Lines(v1->getPrev()->head(), + v1->head(), v1->tail(), d1->head())) + { +/* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), + v2->getPrev()->head(), + v2->getPrev()->tail(), d1->head())); +*/ + diagonal_vertices[kk+1] = v2->getPrev(); + } + } + if(d2 == v2) { + /*check if d1 is to left of v2->prev->head:v2->head:v2->tail*/ + if(! pointLeft2Lines(v2->getPrev()->head(), + v2->head(), v2->tail(), d1->head())) + { +/* assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), + v1->getPrev()->head(), + v1->getPrev()->tail(), d1->head())); +*/ + diagonal_vertices[kk+1] = v1->getPrev(); + } + } + } +}/*end if (root1 not equal to root 2)*/ +} + + /*second pass, now all diagoals should belong to the same polygon*/ +//printf("second pass: \n"); + +// for(i=0; ifindRoot(); +/* + directedLine *root2 = v2->findRoot(); + + + + assert(root1); + assert(root2); + assert(root1 == root2); + */ + sampledLine* generatedLine; + + + + v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); + newSampledLines = generatedLine->insert(newSampledLines); + + ret_polygons = ret_polygons->cutoffPolygon(root1); + + ret_polygons = ret_p1->insertPolygon(ret_polygons); + + ret_polygons = ret_p2->insertPolygon(ret_polygons); + + + + for(Int j=i+1; jsamePolygon(temp1, temp2)) + { + /*if temp1 and temp2 are in different polygons, + *then one of them must be v1 or v2. + */ + + + + assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2); + if(temp1==v1) + { + diagonal_vertices[2*j] = v2->getPrev(); + } + if(temp2==v1) + { + diagonal_vertices[2*j+1] = v2->getPrev(); + } + if(temp1==v2) + { + diagonal_vertices[2*j] = v1->getPrev(); + } + if(temp2==v2) + { + diagonal_vertices[2*j+1] = v1->getPrev(); + } + } + } + } + + } + + + //clean up + loopList->deleteLoopList(); + free(array); + free(ranges); + free(diagonal_vertices); + free(removedDiagonals); + + *retSampledLines = newSampledLines; + return ret_polygons; +} + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,103 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _MONO_CHAIN_H +#define _MONO_CHAIN_H + +#include "directedLine.h" +#include "partitionY.h" + +class monoChain; + +class monoChain{ + directedLine* chainHead; + directedLine* chainTail; + monoChain* next; + monoChain* prev; + monoChain* nextPolygon; //a list of polygons + + //cached informatin + //bounding box + Real minX, maxX, minY, maxY; + Int isIncrease; + + //for efficiently comparing two chains + + directedLine* current; + +public: + monoChain(directedLine* cHead, directedLine* cTail); + ~monoChain() {} + + inline void setNext(monoChain* n) {next = n;} + inline void setPrev(monoChain* p) {prev = p;} + inline void setNextPolygon(monoChain* np) {nextPolygon = np;} + inline monoChain* getNext() {return next;} + inline monoChain* getPrev() {return prev;} + inline directedLine* getHead() {return chainHead;} + inline directedLine* getTail() {return chainTail;} + + inline void resetCurrent() { current = ((isIncrease==1)? chainHead:chainTail);} + + void deleteLoop(); + void deleteLoopList(); + + //insert a new chain between prev and this + void insert(monoChain* nc); + + Int numChainsSingleLoop(); + Int numChainsAllLoops(); + monoChain** toArrayAllLoops(Int& num_chains); + Int toArraySingleLoop(monoChain** array, Int index); + + Int isKey; + Real keyY; //the current horizotal line + Real chainIntersectHoriz(Real y); //updates current incrementally for efficiency + directedLine* find(Real y);//find dline so that y intersects dline. + + void printOneChain(); + void printChainLoop(); + void printAllLoops(); + +}; + +monoChain* directedLineLoopToMonoChainLoop(directedLine* loop); +monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list); +Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges); + +void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, + sweepRange** ranges, Int& num_diagonals, + directedLine** diagonal_vertices); + +directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,299 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* + *monoPolyPart.C + * + *To partition a v-monotone polygon into some uv-monotone polygons. + *The algorithm is different from the general monotone partition algorithm. + *while the general monotone partition algorithm works for this special case, + *but it is more expensive (O(nlogn)). The algorithm implemented here takes + *advantage of the fact that the input is a v-monotone polygon and it is + *conceptually simpler and computationally cheaper (a linear time algorithm). + *The algorithm is described in Zicheng Liu's paper + * "Quality-Oriented Linear Time Tessellation". + */ + +#include +#include +#include "directedLine.h" +#include "monoPolyPart.h" + +/*a vertex is u_maximal if both of its two neightbors are to the left of this + *vertex + */ +static Int is_u_maximal(directedLine* v) +{ + if (compV2InX(v->getPrev()->head(), v->head()) == -1 && + compV2InX(v->getNext()->head(), v->head()) == -1) + return 1; + else + return 0; +} + +/*a vertex is u_minimal if both of its two neightbors are to the right of this + *vertex + */ +static Int is_u_minimal(directedLine* v) +{ + if (compV2InX(v->getPrev()->head(), v->head()) == 1 && + compV2InX(v->getNext()->head(), v->head()) == 1) + return 1; + else + return 0; +} + +/*poly: a v-monotone polygon + *return: a linked list of uv-monotone polygons. + */ +directedLine* monoPolyPart(directedLine* polygon) +{ + //handle special cases: + if(polygon == NULL) + return NULL; + if(polygon->getPrev() == polygon) + return polygon; + if(polygon->getPrev() == polygon->getNext()) + return polygon; + if(polygon->getPrev()->getPrev() == polygon->getNext()) + return polygon; + + //find the top and bottom vertexes + directedLine *tempV, *topV, *botV; + topV = botV = polygon; + for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) + { + if(compV2InY(topV->head(), tempV->head())<0) { + topV = tempV; + } + if(compV2InY(botV->head(), tempV->head())>0) { + botV = tempV; + } + } + + //initilization + directedLine *A, *B, *C, *D, *G, *H; + //find A:the first u_maximal vertex on the left chain + //and C: the left most vertex between top and A + A = NULL; + C = topV; + for(tempV=topV->getNext(); tempV != botV; tempV = tempV->getNext()) + { + if(tempV->head()[0] < C->head()[0]) + C = tempV; + + if(is_u_maximal(tempV)) + { + A = tempV; + break; + } + } + if(A == NULL) + { + A = botV; + if(A->head()[0] < C->head()[0]) + C = A; + } + + //find B: the first u_minimal vertex on the right chain + //and D: the right most vertex between top and B + B = NULL; + D = topV; + for(tempV=topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) + { + if(tempV->head()[0] > D->head()[0]) + D = tempV; + if(is_u_minimal(tempV)) + { + B = tempV; + break; + } + } + if(B == NULL) + { + B = botV; + if(B->head()[0] > D->head()[0]) + D = B; + } + + //error checking XXX + if(C->head()[0] >= D->head()[0]) + return polygon; + + //find G on the left chain that is right above B + for(tempV=topV; compV2InY(tempV->head(), B->head()) == 1; tempV=tempV->getNext()); + G = tempV->getPrev(); + //find H on the right chain that is right above A + for(tempV=topV; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev()); + H = tempV->getNext(); + + //Main Loop + directedLine* ret = NULL; + directedLine* currentPolygon = polygon; + while(1) + { + //if both B and D are equal to botV, then this polygon is already + //u-monotone + if(A == botV && B == botV) + { + ret = currentPolygon->insertPolygon(ret); + return ret; + } + else //not u-monotone + { + directedLine *ret_p1, *ret_p2; + if(compV2InY(A->head(),B->head()) == 1) //A is above B + { + directedLine* E = NULL; + for(tempV = C; tempV != D; tempV = tempV->getPrev()) + { + if(tempV->head()[0] >= A->head()[0]) + { + E = tempV; + break; + } + } + + if(E == NULL) + E = D; + if(E->head()[0]> H->head()[0]) + E = H; + //connect AE and output polygon ECA + polygon->connectDiagonal_2slines(A, E, + &ret_p1, + &ret_p2, + NULL); + ret = ret_p2->insertPolygon(ret); + currentPolygon = ret_p1; + + if(E == D) + D = ret_p1; + if(E == H) + H = ret_p1; + if(G->head()[1] >= A->head()[1]) + G = A; + //update A to be the next u-maxiaml vertex on left chain + //and C the leftmost vertex between the old A and the new A + C = A; + for(tempV = A->getNext(); tempV != botV; tempV = tempV->getNext()) + { + + if(tempV->head()[0] < C->head()[0]) + C = tempV; + if(is_u_maximal(tempV)) + { + A = tempV; + break; + } + } + + if(tempV == botV) + { + A = botV; + if(botV->head()[0] < C->head()[0]) + C = botV; + } + //update H + + if(A == botV) + H = botV; + else + { + for(tempV = H; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev()); + H = tempV->getNext(); + } + + } + else //A is below B + { + + directedLine* F = NULL; + for(tempV = D; tempV != C; tempV = tempV->getNext()) + { + if(tempV->head()[0] <= B->head()[0]) + { + F = tempV; + break; + } + } + if(F == NULL) + F = C; + if(F->head()[0] < G->head()[0]) + F = G; + + //connect FB + polygon->connectDiagonal_2slines(F, B, + &ret_p1, + &ret_p2, + NULL); + ret = ret_p2->insertPolygon(ret); + currentPolygon = ret_p1; + B = ret_p1; + if(H ->head()[1] >= B->head()[1]) + H = ret_p1; + + //update B to be the next u-minimal vertex on right chain + //and D the rightmost vertex between the old B and the new B + D = B; + for(tempV = B->getPrev(); tempV != botV; tempV = tempV->getPrev()) + { + if(tempV->head()[0] > D->head()[0]) + D = tempV; + if(is_u_minimal(tempV)) + { + B = tempV; + break; + } + } + if(tempV == botV) + { + B = botV; + if(botV->head()[0] > D->head()[0]) + D = botV; + } + //update G + if(B == botV) + G = botV; + else + { + for(tempV = G; compV2InY(tempV->head(), B->head()) == 1; tempV = tempV->getNext()); + G = tempV->getPrev(); + } + } //end of A is below B + } //end not u-monotone + } //end of main loop +} + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,41 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* + *monoPolyPart.h + */ + +#ifndef _MONO_POLY_PART_H +#define _MONO_POLY_PART_H + +class directedLine; + +directedLine* monoPolyPart(directedLine* polygon); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1482 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include "gluos.h" +#include "glimports.h" +#include "zlassert.h" + +#include "monoTriangulation.h" +#include "polyUtil.h" /*for area*/ +#include "partitionX.h" +#include "monoPolyPart.h" + + + +extern directedLine* polygonConvert(directedLine* polygon); + +/*poly is NOT deleted + */ +void monoTriangulationOpt(directedLine* poly, primStream* pStream) +{ + Int n_cusps; + Int n_edges = poly->numEdges(); + directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*)*n_edges); + assert(cusps); + findInteriorCuspsX(poly, n_cusps, cusps); + if(n_cusps ==0) //u monotine + { + monoTriangulationFun(poly, compV2InX, pStream); + } + else if(n_cusps == 1) // one interior cusp + { + directedLine* new_polygon = polygonConvert(cusps[0]); + directedLine* other = findDiagonal_singleCuspX(new_polygon); + // should NOT be null unless there are self-intersecting + //trim curves. In that case, we don't want to core dump, instead, + //we triangulate anyway, and print out error message. + if(other == NULL) + { + monoTriangulationFun(poly, compV2InX, pStream); + } + else + { + directedLine* ret_p1; + directedLine* ret_p2; + + new_polygon->connectDiagonal_2slines(new_polygon, other, + &ret_p1, + &ret_p2, + new_polygon); + + monoTriangulationFun(ret_p1, compV2InX, pStream); + monoTriangulationFun(ret_p2, compV2InX, pStream); + + ret_p1->deleteSinglePolygonWithSline(); + ret_p2->deleteSinglePolygonWithSline(); + } + } + else + { + //we need a general partitionX funtion (supposed to be in partitionX.C, + //not implemented yet. XXX + monoTriangulationFun(poly, compV2InY, pStream); + } + + free(cusps); +} + +void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, + vertexArray* left_chain, Int left_current, + vertexArray* right_chain, Int right_current, + primStream* pStream) +{ + Int i,j; + Int n_left = left_chain->getNumElements(); + Int n_right = right_chain->getNumElements(); + if(left_current>= n_left-1 || + right_current>= n_right-1) + { + monoTriangulationRec(topVertex, botVertex, left_chain, left_current, + right_chain, right_current, pStream); + return; + } + //now both left and right have at least two vertices each. + Real left_v = left_chain->getVertex(left_current)[1]; + Real right_v = right_chain->getVertex(right_current)[1]; + + if(left_v <= right_v) //first left vertex is below right + { + //find the last vertex of right which is above or equal to left + for(j=right_current; j<=n_right-1; j++) + { + if(right_chain->getVertex(j)[1] < left_v) + break; + } + monoTriangulationRecGen(topVertex, left_chain->getVertex(left_current), + left_chain, left_current, left_current, + right_chain, right_current, j-1, + pStream); + monoTriangulationRecOpt(right_chain->getVertex(j-1), + botVertex, + left_chain, left_current, + right_chain, j, + pStream); + } + else //first right vertex is strictly below left + { + //find the last vertex of left which is strictly above right + for(i=left_current; i<=n_left-1; i++) + { + if(left_chain->getVertex(i)[1] <= right_v) + break; + } + monoTriangulationRecGen(topVertex, right_chain->getVertex(right_current), + left_chain, left_current, i-1, + right_chain, right_current, right_current, + pStream); + monoTriangulationRecOpt(left_chain->getVertex(i-1), + botVertex, + left_chain, i, + right_chain, right_current, + pStream); + } +} + + +void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, Int inc_end, + vertexArray* dec_chain, Int dec_current, Int dec_end, + primStream* pStream) +{ + pStream->triangle(topVertex, inc_chain->getVertex(inc_current), dec_chain->getVertex(dec_current)); + +/*printf("**(%f,%f)\n", inc_chain->getArray()[0][0],inc_chain->getArray()[0][1]);*/ + triangulateXYMonoTB(inc_end-inc_current+1, inc_chain->getArray()+inc_current, dec_end-dec_current+1, dec_chain->getArray()+dec_current, pStream); + + pStream->triangle(botVertex, dec_chain->getVertex(dec_end), inc_chain->getVertex(inc_end)); +} + + +/*n_left>=1 + *n_right>=1 + *the strip is going top to bottom. compared to the funtion + * triangulateXYmono() + */ +void triangulateXYMonoTB(Int n_left, Real** leftVerts, + Int n_right, Real** rightVerts, + primStream* pStream) +{ + + + Int i,j,k,l; + Real* topMostV; + + assert(n_left>=1 && n_right>=1); + if(leftVerts[0][1] >= rightVerts[0][1]) + { + i=1; + j=0; + topMostV = leftVerts[0]; + } + else + { + i=0; + j=1; + topMostV = rightVerts[0]; + } + + while(1) + { + if(i >= n_left) /*case1: no more in left*/ + { + + if(jbegin(); + pStream->insert(topMostV); + for(k=n_right-1; k>=j; k--) + pStream->insert(rightVerts[j]); + + pStream->end(PRIMITIVE_STREAM_FAN); + + } + + break; + } + else if(j>= n_right) /*case2: no more in right*/ + { + + if(ibegin(); + pStream->insert(topMostV); + + for(k=i; kinsert(leftVerts[k]); + + pStream->end(PRIMITIVE_STREAM_FAN); + } + + break; + } + else /* case3: neither is empty, plus the topMostV, there is at least one triangle to output*/ + { + + if(leftVerts[i][1] >= rightVerts[j][1]) + { + pStream->begin(); + pStream->insert(rightVerts[j]); /*the origin of this fan*/ + + pStream->insert(topMostV); + + /*find the last k>=i such that + *leftverts[k][1] >= rightverts[j][1] + */ + k=i; + while(kinsert(leftVerts[l]); + } + + pStream->end(PRIMITIVE_STREAM_FAN); + //update i for next loop + i = k+1; + topMostV = leftVerts[k]; + + } + else /*leftVerts[i][1] < rightVerts[j][1]*/ + { + pStream->begin(); + pStream->insert(leftVerts[i]);/*the origion of this fan*/ + + /*find the last k>=j such that + *rightverts[k][1] > leftverts[i][1]*/ + k=j; + while(k< n_right) + { + if(rightVerts[k][1] <= leftVerts[i][1]) + break; + k++; + } + k--; + + for(l=k; l>= j; l--) + pStream->insert(rightVerts[l]); + + pStream->insert(topMostV); + pStream->end(PRIMITIVE_STREAM_FAN); + j=k+1; + topMostV = rightVerts[j-1]; + } + } + } +} + +static int chainConvex(vertexArray* inc_chain, Int inc_current, Int inc_end) +{ + Int i; + //if there are no more than 2 vertices, return 1 + if(inc_current >= inc_end-1) return 1; + for(i=inc_current; i<= inc_end-2; i++) + { + if(area(inc_chain->getVertex(i), inc_chain->getVertex(i+1), inc_chain->getVertex(i+2)) <0) + return 0; + } + return 1; +} + +static int chainConcave(vertexArray* dec_chain, Int dec_current, Int dec_end) +{ + Int i; + //if there are no more than 2 vertices, return 1 + if(dec_current >= dec_end -1) return 1; + for(i=dec_current; i<=dec_end-2; i++) + { + if(area(dec_chain->getVertex(i), dec_chain->getVertex(i+1), dec_chain->getVertex(i+2)) >0) + return 0; + } + return 1; +} + +void monoTriangulationRecGenInU(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, Int inc_end, + vertexArray* dec_chain, Int dec_current, Int dec_end, + primStream* pStream) +{ + +} + +void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, Int inc_end, + vertexArray* dec_chain, Int dec_current, Int dec_end, + primStream* pStream) +{ + Int i; + //copy this to a polygon: directedLine Lioop + sampledLine* sline; + directedLine* dline; + directedLine* poly; + + if(inc_current <= inc_end) //at least one vertex in inc_chain + { + sline = new sampledLine(topVertex, inc_chain->getVertex(inc_current)); + poly = new directedLine(INCREASING, sline); + for(i=inc_current; i<=inc_end-1; i++) + { + sline = new sampledLine(inc_chain->getVertex(i), inc_chain->getVertex(i+1)); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + sline = new sampledLine(inc_chain->getVertex(inc_end), botVertex); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + else //inc_chian is empty + { + sline = new sampledLine(topVertex, botVertex); + dline = new directedLine(INCREASING, sline); + poly = dline; + } + + assert(poly != NULL); + + if(dec_current <= dec_end) //at least on vertex in dec_Chain + { + sline = new sampledLine(botVertex, dec_chain->getVertex(dec_end)); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + for(i=dec_end; i>dec_current; i--) + { + sline = new sampledLine(dec_chain->getVertex(i), dec_chain->getVertex(i-1)); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + sline = new sampledLine(dec_chain->getVertex(dec_current), topVertex); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + else //dec_chain is empty + { + sline = new sampledLine(botVertex, topVertex); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + + { + Int n_cusps; + Int n_edges = poly->numEdges(); + directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*)*n_edges); + assert(cusps); + findInteriorCuspsX(poly, n_cusps, cusps); + + if(n_cusps ==0) //u monotine + { + monoTriangulationFun(poly, compV2InX, pStream); + } + else if(n_cusps == 1) // one interior cusp + { + directedLine* new_polygon = polygonConvert(cusps[0]); + directedLine* other = findDiagonal_singleCuspX(new_polygon); + // should NOT be null unless there are self-intersecting + //trim curves. In that case, we don't want to core dump, instead, + //we triangulate anyway, and print out error message. + if(other == NULL) + { + monoTriangulationFun(poly, compV2InX, pStream); + } + else + { + directedLine* ret_p1; + directedLine* ret_p2; + + new_polygon->connectDiagonal_2slines(new_polygon, other, + &ret_p1, + &ret_p2, + new_polygon); + + monoTriangulationFun(ret_p1, compV2InX, pStream); + monoTriangulationFun(ret_p2, compV2InX, pStream); + + ret_p1->deleteSinglePolygonWithSline(); + ret_p2->deleteSinglePolygonWithSline(); + } + } + else + { + //we need a general partitionX funtion (supposed to be in partitionX.C, + //not implemented yet. XXX + //monoTriangulationFun(poly, compV2InY, pStream); + + directedLine* new_polygon = polygonConvert(poly); + directedLine* list = monoPolyPart(new_polygon); + for(directedLine* temp = list; temp != NULL; temp = temp->getNextPolygon()) + { + monoTriangulationFun(temp, compV2InX, pStream); + } + //clean up + list->deletePolygonListWithSline(); + + } + + free(cusps); + /* + if(numInteriorCuspsX(poly) == 0) //is u monotone + monoTriangulationFun(poly, compV2InX, pStream); + else //it is not u motone + monoTriangulationFun(poly, compV2InY, pStream); + */ + //clean up space + poly->deleteSinglePolygonWithSline(); + return; + } + + //apparently the following code is not reachable, + //it is for test purpose + if(inc_current > inc_end || dec_current>dec_end) + { + monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end, + dec_chain, dec_current, dec_end, + pStream); + return; + } + + + if( + area(dec_chain->getVertex(dec_current), + topVertex, + inc_chain->getVertex(inc_current)) >=0 + && chainConvex(inc_chain, inc_current, inc_end) + && chainConcave(dec_chain, dec_current, dec_end) + && area(inc_chain->getVertex(inc_end), botVertex, dec_chain->getVertex(dec_end)) >=0 + ) + { + monoTriangulationRecFunGen(topVertex, botVertex, + inc_chain, inc_current, inc_end, + dec_chain, dec_current, dec_end, + compV2InX, pStream); + } + else + { + monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end, + dec_chain, dec_current, dec_end, + pStream); + } +} + +/*if inc_current>inc_end, then inc_chain has no points to be considered + *same for dec_chain + */ +void monoTriangulationRecGen(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, Int inc_end, + vertexArray* dec_chain, Int dec_current, Int dec_end, + primStream* pStream) +{ + Real** inc_array ; + Real** dec_array ; + Int i; + + if(inc_current > inc_end && dec_current>dec_end) + return; + else if(inc_current>inc_end) /*no more vertices on inc_chain*/ + { + dec_array = dec_chain->getArray(); + reflexChain rChain(100,0); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the dec_chain*/ + for(i=dec_current; i<=dec_end; i++){ + rChain.processNewVertex(dec_array[i], pStream); + } + /*process the bottom vertex*/ + rChain.processNewVertex(botVertex, pStream); + } + else if(dec_current> dec_end) /*no more vertices on dec_chain*/ + { + inc_array = inc_chain->getArray(); + + reflexChain rChain(100,1); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the inc_chain*/ + for(i=inc_current; i<=inc_end; i++){ + rChain.processNewVertex(inc_array[i], pStream); + } + /*process the bottom vertex*/ + rChain.processNewVertex(botVertex, pStream); + } + else /*neither chain is empty*/ + { + inc_array = inc_chain -> getArray(); + dec_array = dec_chain -> getArray(); + + /*if top of inc_chain is 'lower' than top of dec_chain, process all the + *vertices on the dec_chain which are higher than top of inc_chain + */ + if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) + { + + reflexChain rChain(100, 0); + rChain.processNewVertex(topVertex, pStream); + for(i=dec_current; i<=dec_end; i++) + { + if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0) + rChain.processNewVertex(dec_array[i], pStream); + else + break; + } + rChain.outputFan(inc_array[inc_current], pStream); + monoTriangulationRecGen(dec_array[i-1], botVertex, + inc_chain, inc_current, inc_end, + dec_chain, i, dec_end, + pStream); + } + else /*compV2InY(inc_array[inc_current], dec_array[dec_current]) > 0*/ + { + + reflexChain rChain(100, 1); + rChain.processNewVertex(topVertex, pStream); + for(i=inc_current; i<=inc_end; i++) + { + if(compV2InY(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], pStream); + else + break; + } + rChain.outputFan(dec_array[dec_current], pStream); + monoTriangulationRecGen(inc_array[i-1], botVertex, + inc_chain, i, inc_end, + dec_chain, dec_current,dec_end, + pStream); + } + }/*end case neither is empty*/ +} + +void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*), primStream* pStream) +{ + Int i; + /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain, + *then call monoTriangulationRec + */ + directedLine* tempV; + directedLine* topV; + directedLine* botV; + topV = botV = monoPolygon; + for(tempV = monoPolygon->getNext(); tempV != monoPolygon; tempV = tempV->getNext()) + { + if(compFun(topV->head(), tempV->head())<0) { + topV = tempV; + } + if(compFun(botV->head(), tempV->head())>0) { + botV = tempV; + } + } + + /*creat increase and decrease chains*/ + vertexArray inc_chain(20); /*this is a dynamic array*/ + for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ + inc_chain.appendVertex(topV->getVertex(i)); + } + for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) + { + for(i=0; i<=tempV->get_npoints()-2; i++){ + inc_chain.appendVertex(tempV->getVertex(i)); + } + } + + vertexArray dec_chain(20); + for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) + { + for(i=tempV->get_npoints()-2; i>=0; i--){ + dec_chain.appendVertex(tempV->getVertex(i)); + } + } + for(i=botV->get_npoints()-2; i>=1; i--){ + dec_chain.appendVertex(tempV->getVertex(i)); + } + + if (!(0 == inc_chain.getNumElements() && 0 == dec_chain.getNumElements())) { + monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, + &dec_chain, 0, compFun, pStream); + } +} + +void monoTriangulation(directedLine* monoPolygon, primStream* pStream) +{ + Int i; + /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain, + *then call monoTriangulationRec + */ + directedLine* tempV; + directedLine* topV; + directedLine* botV; + topV = botV = monoPolygon; + for(tempV = monoPolygon->getNext(); tempV != monoPolygon; tempV = tempV->getNext()) + { + if(compV2InY(topV->head(), tempV->head())<0) { + topV = tempV; + } + if(compV2InY(botV->head(), tempV->head())>0) { + botV = tempV; + } + } + /*creat increase and decrease chains*/ + vertexArray inc_chain(20); /*this is a dynamic array*/ + for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ + inc_chain.appendVertex(topV->getVertex(i)); + } + for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) + { + for(i=0; i<=tempV->get_npoints()-2; i++){ + inc_chain.appendVertex(tempV->getVertex(i)); + } + } + + vertexArray dec_chain(20); + for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) + { + for(i=tempV->get_npoints()-2; i>=0; i--){ + dec_chain.appendVertex(tempV->getVertex(i)); + } + } + for(i=botV->get_npoints()-2; i>=1; i--){ + dec_chain.appendVertex(tempV->getVertex(i)); + } + + monoTriangulationRec(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, pStream); + +} + +/*the chain could be increasing or decreasing, although we use the + * name inc_chain. + *the argument is_increase_chain indicates whether this chain + *is increasing (left chain in V-monotone case) or decreaing (right chain + *in V-monotone case). + */ +void monoTriangulation2(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_smallIndex, + Int inc_largeIndex, + Int is_increase_chain, + primStream* pStream) +{ + assert( inc_chain != NULL); + Real** inc_array ; + + if(inc_smallIndex > inc_largeIndex) + return; //no triangles + if(inc_smallIndex == inc_largeIndex) + { + if(is_increase_chain) + pStream->triangle(inc_chain->getVertex(inc_smallIndex), botVertex, topVertex); + else + pStream->triangle(inc_chain->getVertex(inc_smallIndex), topVertex, botVertex); + return; + } + Int i; + + if(is_increase_chain && botVertex[1] == inc_chain->getVertex(inc_largeIndex)[1]) + { + pStream->triangle(botVertex, inc_chain->getVertex(inc_largeIndex-1), + inc_chain->getVertex(inc_largeIndex)); + monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex, + inc_largeIndex-1, + is_increase_chain, + pStream); + return; + } + else if( (!is_increase_chain) && topVertex[1] == inc_chain->getVertex(inc_smallIndex)[1]) + { + pStream->triangle(topVertex, inc_chain->getVertex(inc_smallIndex+1), + inc_chain->getVertex(inc_smallIndex)); + monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex+1, + inc_largeIndex, is_increase_chain, pStream); + return ; + } + + inc_array = inc_chain->getArray(); + + reflexChain rChain(20,is_increase_chain); /*1 means the chain is increasing*/ + + rChain.processNewVertex(topVertex, pStream); + + for(i=inc_smallIndex; i<=inc_largeIndex; i++){ + rChain.processNewVertex(inc_array[i], pStream); + } + rChain.processNewVertex(botVertex, pStream); + +} + +/*if compFun == compV2InY, top to bottom: V-monotone + *if compFun == compV2InX, right to left: U-monotone + */ +void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, Int inc_end, + vertexArray* dec_chain, Int dec_current, Int dec_end, + Int (*compFun)(Real*, Real*), + primStream* pStream) +{ + assert( inc_chain != NULL && dec_chain != NULL); + assert( ! (inc_current> inc_end && + dec_current> dec_end)); + /* + Int inc_nVertices; + Int dec_nVertices; + */ + Real** inc_array ; + Real** dec_array ; + Int i; + assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); + + if(inc_current> inc_end) /*no more vertices on inc_chain*/ + { + + dec_array = dec_chain->getArray(); + reflexChain rChain(20,0); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the dec_chain*/ + for(i=dec_current; i<=dec_end; i++){ + rChain.processNewVertex(dec_array[i], pStream); + } + /*process the bottom vertex*/ + rChain.processNewVertex(botVertex, pStream); + + } + else if(dec_current> dec_end) /*no more vertices on dec_chain*/ + { + inc_array = inc_chain->getArray(); + reflexChain rChain(20,1); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the inc_chain*/ + for(i=inc_current; i<=inc_end; i++){ + rChain.processNewVertex(inc_array[i], pStream); + } + /*process the bottom vertex*/ + rChain.processNewVertex(botVertex, pStream); + } + else /*neither chain is empty*/ + { + inc_array = inc_chain -> getArray(); + dec_array = dec_chain -> getArray(); + + /*if top of inc_chain is 'lower' than top of dec_chain, process all the + *vertices on the dec_chain which are higher than top of inc_chain + */ + if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) + { + + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex, pStream); + for(i=dec_current; i<=dec_end; i++) + { + if(compFun(inc_array[inc_current], dec_array[i]) <= 0) + rChain.processNewVertex(dec_array[i], pStream); + else + break; + } + rChain.outputFan(inc_array[inc_current], pStream); + monoTriangulationRecFunGen(dec_array[i-1], botVertex, + inc_chain, inc_current, inc_end, + dec_chain, i, dec_end, + compFun, + pStream); + } + else /*compFun(inc_array[inc_current], dec_array[dec_current]) > 0*/ + { + + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex, pStream); + for(i=inc_current; i<=inc_end; i++) + { + if(compFun(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], pStream); + else + break; + } + rChain.outputFan(dec_array[dec_current], pStream); + monoTriangulationRecFunGen(inc_array[i-1], botVertex, + inc_chain, i,inc_end, + dec_chain, dec_current,dec_end, + compFun, + pStream); + } + }/*end case neither is empty*/ +} + +/*if compFun == compV2InY, top to bottom: V-monotone + *if compFun == compV2InX, right to left: U-monotone + */ +void monoTriangulationRecFun(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, + vertexArray* dec_chain, Int dec_current, + Int (*compFun)(Real*, Real*), + primStream* pStream) +{ + assert( inc_chain != NULL && dec_chain != NULL); + assert( ! (inc_current>=inc_chain->getNumElements() && + dec_current>=dec_chain->getNumElements())); + Int inc_nVertices; + Int dec_nVertices; + Real** inc_array ; + Real** dec_array ; + Int i; + assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); + + if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ + { + + dec_array = dec_chain->getArray(); + dec_nVertices = dec_chain->getNumElements(); + reflexChain rChain(20,0); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the dec_chain*/ + for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ + { + inc_array = inc_chain->getArray(); + inc_nVertices= inc_chain->getNumElements(); + reflexChain rChain(20,1); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the inc_chain*/ + for(i=inc_current; i getArray(); + dec_array = dec_chain -> getArray(); + inc_nVertices= inc_chain->getNumElements(); + dec_nVertices= dec_chain->getNumElements(); + /*if top of inc_chain is 'lower' than top of dec_chain, process all the + *vertices on the dec_chain which are higher than top of inc_chain + */ + if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) + { + + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex, pStream); + for(i=dec_current; i 0*/ + { + + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex, pStream); + for(i=inc_current; i0) + rChain.processNewVertex(inc_array[i], pStream); + else + break; + } + rChain.outputFan(dec_array[dec_current], pStream); + monoTriangulationRecFun(inc_array[i-1], botVertex, + inc_chain, i, + dec_chain, dec_current, + compFun, + pStream); + } + }/*end case neither is empty*/ +} + + +void monoTriangulationRec(Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, + vertexArray* dec_chain, Int dec_current, + primStream* pStream) +{ + assert( inc_chain != NULL && dec_chain != NULL); + assert( ! (inc_current>=inc_chain->getNumElements() && + dec_current>=dec_chain->getNumElements())); + Int inc_nVertices; + Int dec_nVertices; + Real** inc_array ; + Real** dec_array ; + Int i; + assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); + + if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ + { + + dec_array = dec_chain->getArray(); + dec_nVertices = dec_chain->getNumElements(); + reflexChain rChain(20,0); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the dec_chain*/ + for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ + { + inc_array = inc_chain->getArray(); + inc_nVertices= inc_chain->getNumElements(); + reflexChain rChain(20,1); + /*put the top vertex into the reflex chain*/ + rChain.processNewVertex(topVertex, pStream); + /*process all the vertices on the inc_chain*/ + for(i=inc_current; i getArray(); + dec_array = dec_chain -> getArray(); + inc_nVertices= inc_chain->getNumElements(); + dec_nVertices= dec_chain->getNumElements(); + /*if top of inc_chain is 'lower' than top of dec_chain, process all the + *vertices on the dec_chain which are higher than top of inc_chain + */ + if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) + { + + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex, pStream); + for(i=dec_current; i 0*/ + { + + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex, pStream); + for(i=inc_current; i0) + rChain.processNewVertex(inc_array[i], pStream); + else + break; + } + rChain.outputFan(dec_array[dec_current], pStream); + monoTriangulationRec(inc_array[i-1], botVertex, + inc_chain, i, + dec_chain, dec_current, + pStream); + } + }/*end case neither is empty*/ +} + + + +/* the name here assumes that the polygon is Y-monotone, but + *this function also works for X-monotone polygons. + * a monotne polygon consists of two extrem verteices: topVertex and botVertex, and + *two monotone chains: inc_chain, and dec_chain. The edges of the increasing chain (inc_chain) + *is ordered by following pointer: next, while the edges of the decreasing chain (dec_chain) + *is ordered by following pointer: prev + * inc_index index the vertex which is the toppest of the inc_chain which we are handling currently. + * dec_index index the vertex which is the toppest of the dec_chain which we are handling currently. + */ +void monoTriangulationRec(directedLine* inc_chain, Int inc_index, + directedLine* dec_chain, Int dec_index, + directedLine* topVertex, Int top_index, + directedLine* botVertex, + primStream* pStream) +{ + Int i; + directedLine *temp, *oldtemp = NULL; + Int tempIndex, oldtempIndex = 0; + + assert(inc_chain != NULL && dec_chain != NULL); + + if(inc_chain == botVertex) { + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex->getVertex(top_index), pStream); + for(i=dec_index; i< dec_chain->get_npoints(); i++){ + rChain.processNewVertex(dec_chain->getVertex(i), pStream); + } + for(temp = dec_chain->getPrev(); temp != botVertex; temp = temp->getPrev()) + { + for(i=0; iget_npoints(); i++){ + rChain.processNewVertex(temp->getVertex(i), pStream); + } + } + } + else if(dec_chain==botVertex) { + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex->getVertex(top_index), pStream); + for(i=inc_index; i< inc_chain->get_npoints(); i++){ + rChain.processNewVertex(inc_chain->getVertex(i), pStream); + } + for(temp = inc_chain->getPrev(); temp != botVertex; temp = temp->getNext()) + { + for(i=0; iget_npoints(); i++){ + rChain.processNewVertex(temp->getVertex(i), pStream); + } + } + } + else /*neither reached the bottom*/{ + if(compV2InY(inc_chain->getVertex(inc_index), dec_chain->getVertex(dec_index)) <=0) { + reflexChain rChain(20, 0); + rChain.processNewVertex(topVertex -> getVertex(top_index), pStream); + temp = dec_chain; + tempIndex = dec_index; + while( compV2InY(inc_chain->getVertex(inc_index), temp->getVertex(tempIndex))<=0) { + oldtemp = temp; + oldtempIndex = tempIndex; + rChain.processNewVertex(temp->getVertex(tempIndex), pStream); + + if(tempIndex == temp->get_npoints()-1){ + tempIndex = 0; + temp = temp->getPrev(); + } + else{ + tempIndex++; + } + } + rChain.outputFan(inc_chain->getVertex(inc_index), pStream); + monoTriangulationRec(inc_chain, inc_index, temp, tempIndex, oldtemp, oldtempIndex, botVertex, pStream); + } + else /* >0*/ { + reflexChain rChain(20, 1); + rChain.processNewVertex(topVertex -> getVertex(top_index), pStream); + temp = inc_chain; + tempIndex = inc_index; + while( compV2InY(temp->getVertex(tempIndex), dec_chain->getVertex(dec_index))>0){ + oldtemp = temp; + oldtempIndex = tempIndex; + rChain.processNewVertex(temp->getVertex(tempIndex), pStream); + + if(tempIndex == temp->get_npoints()-1){ + tempIndex = 0; + temp = temp->getNext(); + } + else{ + tempIndex++; + } + } + rChain.outputFan(dec_chain->getVertex(dec_index), pStream); + monoTriangulationRec(temp, tempIndex, dec_chain, dec_index, oldtemp, oldtempIndex, botVertex, pStream); + } + } /*end case neither reached the bottom*/ +} + +/***************************vertexArray begin here**********************************/ +vertexArray::vertexArray(Real2* vertices, Int nVertices) +{ + Int i; + size = index = nVertices; + array = (Real**) malloc(sizeof(Real*) * nVertices); + assert(array); + for(i=0; i= size){ + Real** temp = (Real**) malloc(sizeof(Real*) * (2*size +1)); + assert(temp); + for(i=0; i= v + * and array[i+1][1] v + *if sartIndex>endIndex, then return endIndex+1. + *otherwise, startIndex<=endIndex, it is assumed that + * 0<=startIndex<=endIndex endIndex) + return endIndex+1; + else if(array[endIndex][1] > v) + return endIndex+1; + else //now array[endIndex][1] <= v + { + for(i=endIndex-1; i>=startIndex; i--) + { + if(array[i][1] > v) + break; + } + return i+1; + } +} + +/*find the first i<=endIndex such that array[i-1][1] >= v + * and array[i][1] < v + *if sartIndex>endIndex, then return endIndex+1. + *otherwise, startIndex<=endIndex, it is assumed that + * 0<=startIndex<=endIndex endIndex) + return endIndex+1; + else if(array[endIndex][1] >= v) + return endIndex+1; + else //now array[endIndex][1] < v + { + for(i=endIndex-1; i>=startIndex; i--) + { + if(array[i][1] >= v) + break; + } + return i+1; + } +} + +/*find the first i>startIndex such that array[i-1][1] > v + * and array[i][1] >=v + *if sartIndex>endIndex, then return startIndex-1. + *otherwise, startIndex<=endIndex, it is assumed that + * 0<=startIndex<=endIndex endIndex) + return startIndex-1; + else if(array[startIndex][1] < v) + return startIndex-1; + else //now array[startIndex][1] >= v + { + + for(i=startIndex; i<=endIndex; i++) + { + if(array[i][1] <= v) + break; + } + if(i>endIndex) // v is strictly below all + return endIndex; + else if(array[i][1] == v) + return i; + else + return i-1; + } + +} + + +/*find the first i>=startIndex such that array[i][1] >= v + * and array[i+1][1] endIndex, then return startIndex-1. + *otherwise, startIndex<=endIndex, it is assumed that + * 0<=startIndex<=endIndex endIndex) + return startIndex-1; + else if(array[startIndex][1] < v) + return startIndex-1; + else //now array[startIndex][1] >= v + { + for(i=startIndex+1; i<=endIndex; i++) + { + if(array[i][1] < v) + break; + } + return i-1; + } +} + +Int vertexArray::findDecreaseChainFromEnd(Int begin, Int end) +{ + Int i = end; + Real prevU = array[i][0]; + Real thisU; + for(i=end-1; i>=begin; i--){ + thisU = array[i][0]; + if(thisU < prevU) + prevU = thisU; + else + break; + } + return i; +} + +//if(V(start) == v, return start, other wise return the +//last i so that V(i)==v +Int vertexArray::skipEqualityFromStart(Real v, Int start, Int end) +{ + Int i; + if(array[start][1] != v) + return start; + //now array[start][1] == v + for(i=start+1; i<= end; i++) + if(array[i][1] != v) + break; + return i-1; +} + + +/***************************vertexArray end****************************************/ + + + +/***************************relfex chain stuff begin here*****************************/ + +reflexChain::reflexChain(Int size, Int is_increasing) +{ + queue = (Real2*) malloc(sizeof(Real2) * size); + assert(queue); + index_queue = 0; + size_queue = size; + isIncreasing = is_increasing; +} + +reflexChain::~reflexChain() +{ + free(queue); +} + +/*put (u,v) at the end of the queue + *pay attention to space + */ +void reflexChain::insert(Real u, Real v) +{ + Int i; + if(index_queue >= size_queue) { + Real2 *temp = (Real2*) malloc(sizeof(Real2) * (2*size_queue+1)); + assert(temp); + + /*copy*/ + for(i=0; ibegin(); + pStream->insert(v); + if(isIncreasing) { + for(i=0; iinsert(queue[i]); + } + else { + for(i=index_queue-1; i>=0; i--) + pStream->insert(queue[i]); + } + pStream->end(PRIMITIVE_STREAM_FAN); +} + +void reflexChain::processNewVertex(Real v[2], primStream* pStream) +{ + Int i,j,k; + Int isReflex; + /*if there are at most one vertex in the queue, then simply insert + */ + if(index_queue <=1){ + insert(v); + return; + } + + /*there are at least two vertices in the queue*/ + j=index_queue-1; + + for(i=j; i>=1; i--) { + if(isIncreasing) { + isReflex = (area(queue[i-1], queue[i], v) <= 0.0); + } + else /*decreasing*/{ + isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); + } + if(isReflex) { + break; + } + } + + /* + *if ibegin(); + pStream->insert(v); + if(isIncreasing) { + for(k=i; k<=j; k++) + pStream->insert(queue[k]); + } + else { + for(k=j; k>=i; k--) + pStream->insert(queue[k]); + } + + pStream->end(PRIMITIVE_STREAM_FAN); + } + + /*delete vertices i+1--j from the queue*/ + index_queue = i+1; + /*finally insert v at the end of the queue*/ + insert(v); + +} + +void reflexChain::print() +{ + Int i; + printf("reflex chain: isIncreasing=%i\n", isIncreasing); + for(i=0; i +#define _glu_dprintf printf +#else +inline void _glu_dprintf( char *, ... ) { } +#endif +#endif + +#ifdef GLBUILD +inline void _glu_dprintf( char *, ... ) { } +#endif + +#ifndef NULL +#define NULL 0 +#endif + +#endif /* __glumystdio_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/mystdlib.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/mystdlib.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/mystdlib.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/mystdlib.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * mystdlib.h + * + */ + +#ifndef __glumystdlib_h_ +#define __glumystdlib_h_ + +#ifdef STANDALONE +typedef unsigned int size_t; +extern "C" void abort( void ); +extern "C" void * malloc( size_t ); +extern "C" void free( void * ); +#endif + +#ifdef LIBRARYBUILD +#include +#endif + +#ifdef GLBUILD +typedef unsigned int size_t; +extern "C" void abort( void ); +extern "C" void * malloc( size_t ); +extern "C" void free( void * ); +#endif + +#endif /* __glumystdlib_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,162 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include + +#include "partitionX.h" + +#define CONCAVITY_ZERO 1.0e-6 //this number is used to test whether a vertex is concave (refelx) + //or not. The test needs to compute the area of the three adjacent + //vertices to see if the are is positive or negative. + +Int isCuspX(directedLine *v) +{ + //if v->prev <= v && v->next <= v + //|| v->prev >= v && v->next >= v + Real* T = v->head(); + Real* P = v->getPrev()->head(); + Real* N = v->getNext()->head(); + if( + (compV2InX(T,P) != -1 && + compV2InX(T,N) != -1 + ) || + (compV2InX(T,P) != 1 && + compV2InX(T,N) != 1 + ) + ) + return 1; + else + return 0; +} + +Int isReflexX(directedLine* v) +{ + Real* A = v->getPrev()->head(); + Real* B = v->head(); + Real* C = v->tail(); + Real Bx,By, Cx, Cy; + //scale them in case they are too small + Bx = 10*(B[0] - A[0]); + By = 10*(B[1] - A[1]); + Cx = 10*(C[0] - A[0]); + Cy = 10*(C[1] - A[1]); + + if(Bx*Cy - Cx*By < -CONCAVITY_ZERO) return 1; + else return 0; +} + + +/*return + *0: not-cusp + *1: interior cusp + *2: exterior cusp + */ +Int cuspTypeX(directedLine *v) +{ + if(! isCuspX(v)) return 0; + else + { +//printf("isCusp,%f,%f\n", v->head()[0], v->head()[1]); + if(isReflexX(v)) + { +// printf("isReflex\n"); + return 1; + } + else + { +// printf("not isReflex\n"); + return 2; + } + } +} + +Int numInteriorCuspsX(directedLine *polygon) +{ + directedLine *temp; + int ret = 0; + if(cuspTypeX(polygon) == 1) + ret++; + for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) + if(cuspTypeX(temp) == 1) + ret++; + return ret; +} + + +void findInteriorCuspsX(directedLine *polygon, Int& ret_n_interior_cusps, + directedLine** ret_interior_cusps) +{ + directedLine *temp; + ret_n_interior_cusps = 0; + if(cuspTypeX(polygon) == 1) + { + ret_interior_cusps[ret_n_interior_cusps++] = polygon; + } + for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) + if(cuspTypeX(temp) == 1) + { + ret_interior_cusps[ret_n_interior_cusps++] = temp; + } +} + +directedLine* findDiagonal_singleCuspX(directedLine* cusp) +{ + directedLine* temp; + Int is_minimal = ((compV2InX(cusp->head(), cusp->tail()) == -1)? 1:0); + + if(is_minimal) + for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext()) + { + if(compV2InX(cusp->head(), temp->head()) == 1) + { + return temp; + } + } + else //is maxmal + for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext()) + { + if(compV2InX(cusp->head(), temp->head()) == -1) + { + return temp; + } + } + return NULL; +} + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,54 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _PARTITIONX_H +#define _PARTITIONX_H + +#include "directedLine.h" + +Int isCuspX(directedLine *v); +Int isReflexX(directedLine *v); +Int cuspTypeX(directedLine *v); + +//assuming the array of ret_interior_cusps has been allocated +void findInteriorCuspsX(directedLine* polygon, Int& ret_n_interior_cusps, + directedLine** ret_interior_cusps); + +Int numInteriorCuspsX(directedLine* polygon); + +/*a single polygon with a single cusp + *return the diagonal vertex corresponding to this cusp + */ +directedLine* findDiagonal_singleCuspX(directedLine* cusp); + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,836 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include + +#include "zlassert.h" +#include "partitionY.h" +#include "searchTree.h" +#include "quicksort.h" +#include "polyUtil.h" + + +#define max(a,b) ((a>b)? a:b) +#define min(a,b) ((a>b)? b:a) + + +/*retrurn + *-1: if A < B (YaB + */ +static Int compVertInY(Real A[2], Real B[2]) +{ + if( (A[1] < B[1]) || (A[1]==B[1] && A[0]head(); + if( compVertInY(e->head(), vert) != 1 + && compVertInY(e->tail(), vert) != 1 + ) + return 1; + else + return 0; +} + +/*v is a vertex: the head of en edge, + *e is an edge, + *return 1 if e is below v: assume v1 and v2 are the two endpoints of e: + * v1>= v, v2>=v. + */ +Int isAbove(directedLine *v, directedLine *e) +{ + Real* vert = v->head(); + if( compVertInY(e->head(), vert) != -1 + && compVertInY(e->tail(), vert) != -1 + ) + return 1; + else + return 0; +} + +Int isCusp(directedLine *v) +{ + Real *A=v->getPrev()->head(); + Real *B=v->head(); + Real *C=v->tail(); + if(A[1] < B[1] && B[1] < C[1]) + return 0; + else if(A[1] > B[1] && B[1] > C[1]) + return 0; + else if(A[1] < B[1] && C[1] < B[1]) + return 1; + else if(A[1] > B[1] && C[1] > B[1]) + return 1; + + if(isAbove(v, v) && isAbove(v, v->getPrev()) || + isBelow(v, v) && isBelow(v, v->getPrev())) + return 1; + else + return 0; +} + +/*crossproduct is strictly less than 0*/ +Int isReflex(directedLine *v) +{ + Real* A = v->getPrev()->head(); + Real* B = v->head(); + Real* C = v->tail(); + Real Bx,By, Cx, Cy; + Bx = B[0] - A[0]; + By = B[1] - A[1]; + Cx = C[0] - A[0]; + Cy = C[1] - A[1]; + + if(Bx*Cy - Cx*By < 0) return 1; + else return 0; +} + + /*return + *0: not-cusp + *1: interior cusp + *2: exterior cusp + */ +Int cuspType(directedLine *v) +{ + if(! isCusp(v)) return 0; + else if(isReflex(v)) return 1; + else + return 2; +} + +sweepRange* sweepRangeMake(directedLine* left, Int leftType, + directedLine* right, Int rightType) +{ + sweepRange* ret = (sweepRange*)malloc(sizeof(sweepRange)); + assert(ret); + ret->left = left; + ret->leftType = leftType; + ret->right = right; + ret->rightType = rightType; + return ret; +} + +void sweepRangeDelete(sweepRange* range) +{ + free(range); +} + +Int sweepRangeEqual(sweepRange* src1, sweepRange* src2) +{ + Int leftEqual; + Int rightEqual; + + + /*The case when both are vertices should not happen*/ + assert(! (src1->leftType == 0 && src2->leftType == 0)); + if(src1->leftType == 0 && src2->leftType == 1){ + if(src1->left == src2->left || + src1->left->getPrev() == src2->left + ) + leftEqual = 1; + else + leftEqual = 0; + } + else if(src1->leftType == 1 && src2->leftType == 1){ + if(src1->left == src2->left) + leftEqual = 1; + else + leftEqual = 0; + } + else /*src1->leftType == 1 && src2->leftType == 0*/{ + if(src1->left == src2->left || + src1->left == src2->left->getPrev() + ) + leftEqual = 1; + else + leftEqual = 0; + } + + /*the same thing for right*/ + /*The case when both are vertices should not happen*/ + assert(! (src1->rightType == 0 && src2->rightType == 0)); + if(src1->rightType == 0 && src2->rightType == 1){ + if(src1->right == src2->right || + src1->right->getPrev() == src2->right + ) + rightEqual = 1; + else + rightEqual = 0; + } + else if(src1->rightType == 1 && src2->rightType == 1){ + if(src1->right == src2->right) + rightEqual = 1; + else + rightEqual = 0; + } + else /*src1->rightType == 1 && src2->rightType == 0*/{ + if(src1->right == src2->right || + src1->right == src2->right->getPrev() + ) + rightEqual = 1; + else + rightEqual = 0; + } + + return (leftEqual == 1 || rightEqual == 1); +} + +/*given (x_1, y_1) and (x_2, y_2), and y + *return x such that (x,y) is on the line + */ +inline/*static*/ Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y) +{ + return ((y2==y1)? (x1+x2)*Real(0.5) : x1 + ((y-y1)/(y2-y1)) * (x2-x1)); +/* + if(y2 == y1) return (x1+x2)*0.5; + else return x1 + ((y-y1)/(y2-y1)) * (x2-x1); +*/ +} + +/*compare two edges of a polygon. + *edge A < edge B if there is a horizontal line so that the intersection + *with A is to the left of the intersection with B. + *This function is used in sweepY for the dynamic search tree insertion to + *order the edges. + * Implementation: (x_1,y_1) and (x_2, y_2) + */ +static Int compEdges(directedLine *e1, directedLine *e2) +{ + Real* head1 = e1->head(); + Real* tail1 = e1->tail(); + Real* head2 = e2->head(); + Real* tail2 = e2->tail(); +/* + Real h10 = head1[0]; + Real h11 = head1[1]; + Real t10 = tail1[0]; + Real t11 = tail1[1]; + Real h20 = head2[0]; + Real h21 = head2[1]; + Real t20 = tail2[0]; + Real t21 = tail2[1]; +*/ + Real e1_Ymax, e1_Ymin, e2_Ymax, e2_Ymin; +/* + if(h11>t11) { + e1_Ymax= h11; + e1_Ymin= t11; + } + else{ + e1_Ymax = t11; + e1_Ymin = h11; + } + + if(h21>t21) { + e2_Ymax= h21; + e2_Ymin= t21; + } + else{ + e2_Ymax = t21; + e2_Ymin = h21; + } +*/ + + if(head1[1]>tail1[1]) { + e1_Ymax= head1[1]; + e1_Ymin= tail1[1]; + } + else{ + e1_Ymax = tail1[1]; + e1_Ymin = head1[1]; + } + + if(head2[1]>tail2[1]) { + e2_Ymax= head2[1]; + e2_Ymin= tail2[1]; + } + else{ + e2_Ymax = tail2[1]; + e2_Ymin = head2[1]; + } + + + /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ + /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ + /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ + /*Real e2_Ymin = min(head2[1], tail2[1]);*/ /*min(e2->head()[1], e2->tail()[1]);*/ + + Real Ymax = min(e1_Ymax, e2_Ymax); + Real Ymin = max(e1_Ymin, e2_Ymin); + + Real y = Real(0.5)*(Ymax + Ymin); + +/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y); + Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y); +*/ +/* + Real x1 = intersectHoriz(h10, h11, t10, t11, y); + Real x2 = intersectHoriz(h20, h21, t20, t21, y); +*/ + Real x1 = intersectHoriz(head1[0], head1[1], tail1[0], tail1[1], y); + Real x2 = intersectHoriz(head2[0], head2[1], tail2[0], tail2[1], y); + + if(x1<= x2) return -1; + else return 1; +} + +/*used by sort precedures + */ +static Int compInY(directedLine* v1, directedLine* v2) +{ + return v1->compInY(v2); +} + +void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices) +{ + Int i,j,k; + + k=0; + + for(i=0; igetPrev(); +/* +printf("find i=%i\n", i); +printf("the vertex is\n"); +vert->printSingle(); +*/ + if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge) && compEdges(prevEdge, thisEdge)<0) + { + /*this is an upward interior cusp*/ + diagonal_vertices[k++] = vert; + + for(j=i+1; j0) + { + /*this is an downward interior cusp*/ + diagonal_vertices[k++] = vert; + for(j=i-1; j>=0; j--) + if(sweepRangeEqual(ranges[i], ranges[j])) + { + diagonal_vertices[k++] = sortedVertices[j]; + break; + } +/* printf("j=%i\n", j);*/ + assert(j>=0); + + + + } + } + num_diagonals = k/2; +} + +/*get rid of repeated diagonlas so that each diagonal appears only once in the array + */ +Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices) +{ + Int i,k; + Int j,l; + Int index; + index=0; + for(i=0,k=0; itoArrayAllPolygons(total_num_edges); + quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void*, void*)) compInY); + sweepRange** ranges = (sweepRange**) malloc(sizeof(sweepRange*) * total_num_edges); + assert(ranges); + + sweepY(total_num_edges, array, ranges); + + directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges); + assert(diagonal_vertices); + findDiagonals(total_num_edges, array, ranges, num_diagonals, diagonal_vertices); + + num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices); + return diagonal_vertices; + +} + + +/*partition into Y-monotone polygons*/ +directedLine* partitionY(directedLine *polygons, sampledLine **retSampledLines) +{ + Int total_num_edges = 0; + directedLine** array = polygons->toArrayAllPolygons(total_num_edges); + + quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void*, void*)) compInY); + + sweepRange** ranges = (sweepRange**) malloc(sizeof(sweepRange*) * (total_num_edges)); + assert(ranges); + + + + sweepY(total_num_edges, array, ranges); + + + + /*the diagonal vertices are stored as: + *v0-v1: 1st diagonal + *v2-v3: 2nd diagonal + *v5-v5: 3rd diagonal + *... + */ + + + Int num_diagonals; + /*number diagonals is < total_num_edges*total_num_edges*/ + directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges*2/*total_num_edges*/); + assert(diagonal_vertices); + + + + findDiagonals(total_num_edges, array, ranges, num_diagonals, diagonal_vertices); + + + + directedLine* ret_polygons = polygons; + sampledLine* newSampledLines = NULL; + Int i,k; + +num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices); + + + + Int *removedDiagonals=(Int*)malloc(sizeof(Int) * num_diagonals); + for(i=0; ifindRoot(); + directedLine *root2 = v2->findRoot(); + assert(root1); + assert(root2); +*/ + +directedLine* root1 = v1->rootLinkFindRoot(); +directedLine* root2 = v2->rootLinkFindRoot(); + + if(root1 != root2) + { + + removedDiagonals[i] = 1; + sampledLine* generatedLine; + + + + v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); + + + + newSampledLines = generatedLine->insert(newSampledLines); +/* + ret_polygons = ret_polygons->cutoffPolygon(root1); + + ret_polygons = ret_polygons->cutoffPolygon(root2); + ret_polygons = ret_p1->insertPolygon(ret_polygons); +root1->rootLinkSet(ret_p1); +root2->rootLinkSet(ret_p1); +ret_p1->rootLinkSet(NULL); +ret_p2->rootLinkSet(ret_p1); +*/ + ret_polygons = ret_polygons->cutoffPolygon(root2); + + + +root2->rootLinkSet(root1); +ret_p1->rootLinkSet(root1); +ret_p2->rootLinkSet(root1); + + /*now that we have connected the diagonal v1 and v2, + *we have to check those unprocessed diagonals which + *have v1 or v2 as an end point. Notice that the head of v1 + *has the same coodinates as the head of v2->prev, and the head of + *v2 has the same coordinate as the head of v1->prev. + *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid + *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be + *replaced by (v2->prev, x), that is, x is on the left of + * v2->prev->prev->head, v2->prev->head, v2->prev->tail. + */ + Int ii, kk; + for(ii=0, kk=0; iiprev->head:v1->head:v1->tail*/ + if(! pointLeft2Lines(v1->getPrev()->head(), + v1->head(), v1->tail(), d2->head())) + { +/* + assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), + v2->getPrev()->head(), + v2->getPrev()->tail(), d2->head())); +*/ + diagonal_vertices[kk] = v2->getPrev(); + } + } + if(d1 == v2) { + /*check if d2 is to left of v2->prev->head:v2->head:v2->tail*/ + if(! pointLeft2Lines(v2->getPrev()->head(), + v2->head(), v2->tail(), d2->head())) + { +/* + assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), + v1->getPrev()->head(), + v1->getPrev()->tail(), d2->head())); +*/ + diagonal_vertices[kk] = v1->getPrev(); + } + } + /*check d2 and replace diagonal_vertices[k+1] if necessary*/ + if(d2 == v1) { + /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/ + if(! pointLeft2Lines(v1->getPrev()->head(), + v1->head(), v1->tail(), d1->head())) + { +/* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), + v2->getPrev()->head(), + v2->getPrev()->tail(), d1->head())); +*/ + diagonal_vertices[kk+1] = v2->getPrev(); + } + } + if(d2 == v2) { + /*check if d1 is to left of v2->prev->head:v2->head:v2->tail*/ + if(! pointLeft2Lines(v2->getPrev()->head(), + v2->head(), v2->tail(), d1->head())) + { +/* assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), + v1->getPrev()->head(), + v1->getPrev()->tail(), d1->head())); +*/ + diagonal_vertices[kk+1] = v1->getPrev(); + } + } + } +}/*end if (root1 not equal to root 2)*/ +} + + /*second pass, now all diagoals should belong to the same polygon*/ + + + + for(i=0,k=0; ifindRoot(); +/* + directedLine *root2 = v2->findRoot(); + + + + assert(root1); + assert(root2); + assert(root1 == root2); + */ + sampledLine* generatedLine; + + + + v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); + newSampledLines = generatedLine->insert(newSampledLines); + + ret_polygons = ret_polygons->cutoffPolygon(root1); + + ret_polygons = ret_p1->insertPolygon(ret_polygons); + + ret_polygons = ret_p2->insertPolygon(ret_polygons); + + + + for(Int j=i+1; jsamePolygon(temp1, temp2)) + { + /*if temp1 and temp2 are in different polygons, + *then one of them must be v1 or v2. + */ + + + + assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2); + if(temp1==v1) + { + diagonal_vertices[2*j] = v2->getPrev(); + } + if(temp2==v1) + { + diagonal_vertices[2*j+1] = v2->getPrev(); + } + if(temp1==v2) + { + diagonal_vertices[2*j] = v1->getPrev(); + } + if(temp2==v2) + { + diagonal_vertices[2*j+1] = v1->getPrev(); + } + } + } + } + + } + + /*clean up spaces*/ + free(array); + free(ranges); + free(diagonal_vertices); + free(removedDiagonals); + + *retSampledLines = newSampledLines; + return ret_polygons; +} + +/*given a set of simple polygons where the interior + *is decided by left-hand principle, + *return a range (sight) for each vertex. This is called + *Trapezoidalization. + */ +void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_ranges) +{ + Int i; + /*for each vertex in the sorted list, update the binary search tree. + *and store the range information for each vertex. + */ + treeNode* searchTree = NULL; + for(i=0; igetPrev(); + + if(isBelow(vert, thisEdge) && isAbove(vert, prevEdge)) + { + + /*case 1: this < v < prev + *the polygon is going down at v, the interior is to + *the right hand side. + * find the edge to the right of thisEdge for right range. + * delete thisEdge + * insert prevEdge + */ + treeNode* thisNode = TreeNodeFind(searchTree, thisEdge, ( Int (*) (void *, void *))compEdges); + assert(thisNode); + + treeNode* succ = TreeNodeSuccessor(thisNode); + assert(succ); + searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode); + searchTree = TreeNodeInsert(searchTree, TreeNodeMake(prevEdge), ( Int (*) (void *, void *))compEdges); + + + ret_ranges[i] = sweepRangeMake(vert, 0, (directedLine*) (succ->key), 1); + + } + else if(isAbove(vert, thisEdge) && isBelow(vert, prevEdge)) + { + + /*case 2: this > v > prev + *the polygon is going up at v, the interior is to + *the left hand side. + * find the edge to the left of thisEdge for left range. + * delete prevEdge + * insert thisEdge + */ + treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges); + assert(prevNode); + treeNode* pred = TreeNodePredecessor(prevNode); + searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode); + searchTree = TreeNodeInsert(searchTree, TreeNodeMake(thisEdge), ( Int (*) (void *, void *))compEdges); + ret_ranges[i] = sweepRangeMake((directedLine*)(pred->key), 1, vert, 0); + } + else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge)) + { + + /*case 3: insert both edges*/ + treeNode* thisNode = TreeNodeMake(thisEdge); + treeNode* prevNode = TreeNodeMake(prevEdge); + searchTree = TreeNodeInsert(searchTree, thisNode, ( Int (*) (void *, void *))compEdges); + searchTree = TreeNodeInsert(searchTree, prevNode, ( Int (*) (void *, void *))compEdges); + if(compEdges(thisEdge, prevEdge)<0) /*interior cusp*/ + { + + treeNode* leftEdge = TreeNodePredecessor(thisNode); + treeNode* rightEdge = TreeNodeSuccessor(prevNode); + ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, + (directedLine*) rightEdge->key, 1 + ); + } + else /*exterior cusp*/ + { + + ret_ranges[i] = sweepRangeMake( prevEdge, 1, thisEdge, 1); + } + } + else if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge)) + { + + /*case 4: delete both edges*/ + treeNode* thisNode = TreeNodeFind(searchTree, thisEdge, ( Int (*) (void *, void *))compEdges); + treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges); + if(compEdges(thisEdge, prevEdge)>0) /*interior cusp*/ + { + treeNode* leftEdge = TreeNodePredecessor(prevNode); + treeNode* rightEdge = TreeNodeSuccessor(thisNode); + ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, + (directedLine*) rightEdge->key, 1 + ); + } + else /*exterior cusp*/ + { + ret_ranges[i] = sweepRangeMake( thisEdge, 1, prevEdge, 1); + } + searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode); + searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode); + } + else + { + fprintf(stderr,"error in partitionY.C, invalid case\n"); + printf("vert is\n"); + vert->printSingle(); + printf("thisEdge is\n"); + thisEdge->printSingle(); + printf("prevEdge is\n"); + prevEdge->printSingle(); + + exit(1); + } + } + + /*finaly clean up space: delete the search tree*/ + TreeNodeDeleteWholeTree(searchTree); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,97 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* + *partitionY.h: + *partition a polygon into a Y-monotone polygon: + * A polygon is Y-monotone if the boundary can be split into two polygon chains + *A and B such that each chain is Y-monotonic that is the intersection of any + *horizontal line intersects each chain has at most one connected componenets + * (empty, single point or a single line). + * + * A vertex is a cusp if both its ajacent vertices are either at or above v, + *or both at or below v. In addition, at least one of the ajacent verteces is + *strictly below or above v. + * A vertex is a relex vertex if the internals angle is strictly greater than + *180. In other words, if the the signed area is negative: + *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the + *order is such that left hand side is inside the polygon. Then (x2,y2) is + *reflex if: + * (x2-x1, y2-y1) cross (x3-x1, y3-y1) <0. + *A vertex is an interior cusp if it is a cusp and a reflex. + *A vertex is an exterior cusp if it is a cusp but not a reflex. + * + */ + +#ifndef _PARTITIONY_H +#define _PARTITIONY_H + +#include "directedLine.h" + +/*whether an edge is below a vertex*/ +Int isBelow(directedLine *v, directedLine *e); + +/*whether an edge is above a vertex*/ +Int isAbove(directedLine *v, directedLine *e); + +/*not-cusp, + *inerior cusp + *exterior cusp + */ +Int cuspType(directedLine *v); + +/*used in trapezoidalization*/ +typedef struct sweepRange{ + directedLine *left; + Int leftType; /*either a vertex (leftType=0) or an edge (leftType =1) */ + directedLine *right; + Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */ +} sweepRange; + +sweepRange* sweepRangeMake(directedLine* left, Int leftType, + directedLine* right, Int rightType); + +void sweepRangeDelete(sweepRange* range); +Int sweepRangeEqual(sweepRange* sr1, sweepRange* sr2); + +/*given a set of simple polygons where the interior + *is decided by left-hand principle, + *return a range (sight) for each vertex. This is called + *Trapezoidalization. + */ +void sweepY(Int nVertices, directedLine **sortedVerteces, sweepRange** ret_ranges); + + +directedLine* partitionY(directedLine *polygons, sampledLine **retSampledLines); + +void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices); + +directedLine** DBGfindDiagonals(directedLine *polygons, Int& num_diagonals); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,734 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include +#include "zlassert.h" +#include "polyDBG.h" + +#ifdef __WATCOMC__ +#pragma warning 14 10 +#pragma warning 391 10 +#pragma warning 726 10 +#endif + +static Real area(Real A[2], Real B[2], Real C[2]) +{ + Real Bx, By, Cx, Cy; + Bx = B[0] - A[0]; + By = B[1] - A[1]; + Cx = C[0] - A[0]; + Cy = C[1] - A[1]; + return Bx*Cy - Cx*By; +} + +Int DBG_isConvex(directedLine *poly) +{ + directedLine* temp; + if(area(poly->head(), poly->tail(), poly->getNext()->tail()) < 0.00000) + return 0; + for(temp = poly->getNext(); temp != poly; temp = temp->getNext()) + { + if(area(temp->head(), temp->tail(), temp->getNext()->tail()) < 0.00000) + return 0; + } + return 1; +} + +Int DBG_is_U_monotone(directedLine* poly) +{ + Int n_changes = 0; + Int prev_sign; + Int cur_sign; + directedLine* temp; + cur_sign = compV2InX(poly->tail(), poly->head()); + + n_changes = (compV2InX(poly->getPrev()->tail(), poly->getPrev()->head()) + != cur_sign); + + for(temp = poly->getNext(); temp != poly; temp = temp->getNext()) + { + prev_sign = cur_sign; + cur_sign = compV2InX(temp->tail(), temp->head()); + + if(cur_sign != prev_sign) + n_changes++; + } + + if(n_changes ==2) return 1; + else return 0; +} + +/*if u-monotone, and there is a long horizontal edge*/ +Int DBG_is_U_direction(directedLine* poly) +{ +/* + if(! DBG_is_U_monotone(poly)) + return 0; +*/ + Int V_count = 0; + Int U_count = 0; + directedLine* temp; + if( fabs(poly->head()[0] - poly->tail()[0]) <= fabs(poly->head()[1]-poly->tail()[1])) + V_count += poly->get_npoints(); + else + U_count += poly->get_npoints(); + /* + else if(poly->head()[1] == poly->tail()[1]) + U_count += poly->get_npoints(); + */ + for(temp = poly->getNext(); temp != poly; temp = temp->getNext()) + { + if( fabs(temp->head()[0] - temp->tail()[0]) <= fabs(temp->head()[1]-temp->tail()[1])) + V_count += temp->get_npoints(); + else + U_count += temp->get_npoints(); + /* + if(temp->head()[0] == temp->tail()[0]) + V_count += temp->get_npoints(); + else if(temp->head()[1] == temp->tail()[1]) + U_count += temp->get_npoints(); + */ + } + + if(U_count > V_count) return 1; + else return 0; +} + +/*given two line segments, determine whether + *they intersect each other or not. + *return 1 if they do, + *return 0 otherwise + */ +Int DBG_edgesIntersect(directedLine* l1, directedLine* l2) +{ + if(l1->getNext() == l2) + { + if(area(l1->head(), l1->tail(), l2->tail()) == 0) //colinear + { + if( (l1->tail()[0] - l1->head()[0])*(l2->tail()[0]-l2->head()[0]) + + (l1->tail()[1] - l1->head()[1])*(l2->tail()[1]-l2->head()[1]) >=0) + return 0; //not intersect + else + return 1; + } + //else we use the normal code + } + else if(l1->getPrev() == l2) + { + if(area(l2->head(), l2->tail(), l1->tail()) == 0) //colinear + { + if( (l2->tail()[0] - l2->head()[0])*(l1->tail()[0]-l1->head()[0]) + + (l2->tail()[1] - l2->head()[1])*(l1->tail()[1]-l1->head()[1]) >=0) + return 0; //not intersect + else + return 1; + } + //else we use the normal code + } + else //the two edges are not connected + { + if((l1->head()[0] == l2->head()[0] && + l1->head()[1] == l2->head()[1]) || + (l1->tail()[0] == l2->tail()[0] && + l1->tail()[1] == l2->tail()[1])) + return 1; + + } + + + if( + ( + area(l1->head(), l1->tail(), l2->head()) + * + area(l1->head(), l1->tail(), l2->tail()) + < 0 + ) + && + ( + area(l2->head(), l2->tail(), l1->head()) + *area(l2->head(), l2->tail(), l1->tail()) + < 0 + ) + ) + return 1; + else + return 0; +} + +/*whether AB and CD intersect + *return 1 if they do + *retur 0 otheriwse + */ +Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]) +{ + if( + ( + area(A, B, C) * area(A,B,D) <0 + ) + && + ( + area(C,D,A) * area(C,D,B) < 0 + ) + ) + return 1; + else + return 0; +} + +/*determien whether (A,B) interesect chain[start] to [end] + */ +Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]) +{ + Int i; + for(i=start; i<=end-2; i++) + if(DBG_edgesIntersectGen(chain->getVertex(i), chain->getVertex(i+1), A, B)) + return 1; + + return 0; +} + +/*determine whether a polygon intersect itself or not + *return 1 is it does, + * 0 otherwise + */ +Int DBG_polygonSelfIntersect(directedLine* poly) +{ + directedLine* temp1; + directedLine* temp2; + temp1=poly; + for(temp2=temp1->getNext(); temp2 != temp1; temp2=temp2->getNext()) + { + if(DBG_edgesIntersect(temp1, temp2)) + { + return 1; + } + + } + + for(temp1=poly->getNext(); temp1 != poly; temp1 = temp1->getNext()) + for(temp2=temp1->getNext(); temp2 != temp1; temp2=temp2->getNext()) + { + if(DBG_edgesIntersect(temp1, temp2)) + { + return 1; + } + } + return 0; +} + +/*check whether a line segment intersects a polygon + */ +Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly) +{ + directedLine* temp; + if(DBG_edgesIntersect(edge, poly)) + return 1; + for(temp=poly->getNext(); temp != poly; temp=temp->getNext()) + if(DBG_edgesIntersect(edge, temp)) + return 1; + return 0; +} + +/*check whether two polygons intersect + */ +Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2) +{ + directedLine* temp; + if(DBG_edgeIntersectPoly(p1, p2)) + return 1; + for(temp=p1->getNext(); temp!= p1; temp = temp->getNext()) + if(DBG_edgeIntersectPoly(temp, p2)) + return 1; + return 0; +} + +/*check whether there are polygons intersecting each other in + *a list of polygons + */ +Int DBG_polygonListIntersect(directedLine* pList) +{ + directedLine *temp; + for(temp=pList; temp != NULL; temp = temp->getNextPolygon()) + if(DBG_polygonSelfIntersect(temp)) + return 1; + directedLine* temp2; + for(temp=pList; temp!=NULL; temp=temp->getNextPolygon()) + { + for(temp2=temp->getNextPolygon(); temp2 != NULL; temp2=temp2->getNextPolygon()) + if(DBG_polygonsIntersect(temp, temp2)) + return 1; + } + + return 0; +} + + +Int DBG_isCounterclockwise(directedLine* poly) +{ + return (poly->polyArea() > 0); +} + +/*ray: v0 with direction (dx,dy). + *edge: v1-v2. + * the extra point v10[2] is given for the information at + *v1. Basically this edge is connectd to edge + * v10-v1. If v1 is on the ray, + * then we need v10 to determine whether this ray intersects + * the edge or not (that is, return 1 or return 0). + * If v1 is on the ray, then if v2 and v10 are on the same side of the ray, + * we return 0, otherwise return 1. + *For v2, if v2 is on the ray, we always return 0. + *Notice that v1 and v2 are not symmetric. So the edge is directed!!! + * The purpose for this convention is such that: a point is inside a polygon + * if and only if it intersets with odd number of edges. + */ +Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]) +{ +/* +if( (v1[1] >= v0[1] && v2[1]<= v0[1] ) + ||(v2[1] >= v0[1] && v1[1]<= v0[1] ) + ) + printf("rayIntersectEdge, *********\n"); +*/ + + Real denom = (v2[0]-v1[0])*(-dy) - (v2[1]-v1[1]) * (-dx); + Real nomRay = (v2[0]-v1[0]) * (v0[1] - v1[1]) - (v2[1]-v1[1])*(v0[0]-v1[0]); + Real nomEdge = (v0[0]-v1[0]) * (-dy) - (v0[1]-v1[1])*(-dx); + + + /*if the ray is parallel to the edge, return 0: not intersect*/ + if(denom == 0.0) + return 0; + + /*if v0 is on the edge, return 0: not intersect*/ + if(nomRay == 0.0) + return 0; + + /*if v1 is on the positive ray, and the neighbor of v1 crosses the ray + *return 1: intersect + */ + if(nomEdge == 0) + { /*v1 is on the positive or negative ray*/ + +/* + printf("v1 is on the ray\n"); +*/ + + if(dx*(v1[0]-v0[0])>=0 && dy*(v1[1]-v0[1])>=0) /*v1 on positive ray*/ + { + if(area(v0, v1, v10) * area(v0, v1, v2) >0) + return 0; + else + return 1; + } + else /*v1 on negative ray*/ + return 0; + } + + /*if v2 is on the ray, always return 0: not intersect*/ + if(nomEdge == denom) { +/* printf("v2 is on the ray\n");*/ + return 0; + } + + /*finally */ + if(denom*nomRay>0 && denom*nomEdge>0 && nomEdge/denom <=1.0) + return 1; + return 0; +} + + +/*return the number of intersections*/ +Int DBG_rayIntersectPoly(Real v0[2], Real dx, Real dy, directedLine* poly) +{ + directedLine* temp; + Int count=0; + if(DBG_rayIntersectEdge(v0, dx, dy, poly->getPrev()->head(), poly->head(), poly->tail())) + count++; + + for(temp=poly->getNext(); temp != poly; temp = temp->getNext()) + if(DBG_rayIntersectEdge(v0, dx, dy, temp->getPrev()->head(), temp->head(), temp->tail())) + count++; +/*printf("ray intersect poly: count=%i\n", count);*/ + return count; +} + +Int DBG_pointInsidePoly(Real v[2], directedLine* poly) +{ +/* +printf("enter pointInsidePoly , v=(%f,%f)\n", v[0], v[1]); +printf("the polygon is\n"); +poly->printList(); +*/ + /*for debug purpose*/ + assert( (DBG_rayIntersectPoly(v,1,0,poly) % 2 ) + == (DBG_rayIntersectPoly(v,1,Real(0.1234), poly) % 2 ) + ); + if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1) + return 1; + else + return 0; +} + +/*return the number of polygons which contain thie polygon + * as a subset + */ +Int DBG_enclosingPolygons(directedLine* poly, directedLine* list) +{ + directedLine* temp; + Int count=0; +/* +printf("%i\n", DBG_pointInsidePoly(poly->head(), + list->getNextPolygon() + ->getNextPolygon() + ->getNextPolygon() + ->getNextPolygon() +)); +*/ + + for(temp = list; temp != NULL; temp = temp->getNextPolygon()) + { + if(poly != temp) + if(DBG_pointInsidePoly(poly->head(), temp)) + count++; +/* printf("count=%i\n", count);*/ + } + return count; +} + +void DBG_reverse(directedLine* poly) +{ + if(poly->getDirection() == INCREASING) + poly->putDirection(DECREASING); + else + poly->putDirection(INCREASING); + + directedLine* oldNext = poly->getNext(); + poly->putNext(poly->getPrev()); + poly->putPrev(oldNext); + + directedLine* temp; + for(temp=oldNext; temp!=poly; temp = oldNext) + { + if(temp->getDirection() == INCREASING) + temp->putDirection(DECREASING); + else + temp->putDirection(INCREASING); + + oldNext = temp->getNext(); + temp->putNext(temp->getPrev()); + temp->putPrev(oldNext); + } + printf("reverse done\n"); +} + +Int DBG_checkConnectivity(directedLine *polygon) +{ + if(polygon == NULL) return 1; + directedLine* temp; + if(polygon->head()[0] != polygon->getPrev()->tail()[0] || + polygon->head()[1] != polygon->getPrev()->tail()[1]) + return 0; + for(temp=polygon->getNext(); temp != polygon; temp=temp->getNext()) + { + if(temp->head()[0] != temp->getPrev()->tail()[0] || + temp->head()[1] != temp->getPrev()->tail()[1]) + return 0; + } + return 1; +} + +/*print out error message. + *If it cannot modify the polygon list to make it satify the + *requirements, return 1. + *otherwise modify the polygon list, and return 0 + */ +Int DBG_check(directedLine *polyList) +{ + directedLine* temp; + if(polyList == NULL) return 0; + + /*if there are intersections, print out error message + */ + if(DBG_polygonListIntersect(polyList)) + { + fprintf(stderr, "DBG_check: there are self intersections, don't know to modify the polygons\n"); + return 1; + } + + /*check the connectivity of each polygon*/ + for(temp = polyList; temp!= NULL; temp = temp ->getNextPolygon()) + { + if(! DBG_checkConnectivity(temp)) + { + fprintf(stderr, "DBG_check, polygon not connected\n"); + return 1; + } + } + + /*check the orientation of each polygon*/ + for(temp = polyList; temp!= NULL; temp = temp ->getNextPolygon()) + { + + + Int correctDir; + + if( DBG_enclosingPolygons(temp, polyList) % 2 == 0) + correctDir = 1; /*counterclockwise*/ + else + correctDir = 0; /*clockwise*/ + + Int actualDir = DBG_isCounterclockwise(temp); + + if(correctDir != actualDir) + { + fprintf(stderr, "DBG_check: polygon with incorrect orientations. reversed\n"); + + DBG_reverse(temp); + } + + } + return 0; +} + +/**************handle self intersections*****************/ +//determine whether e interects [begin, end] or not +static directedLine* DBG_edgeIntersectChainD(directedLine *e, + directedLine *begin, directedLine *end) +{ + directedLine *temp; + for(temp=begin; temp != end; temp = temp->getNext()) + { + if(DBG_edgesIntersect(e, temp)) + return temp; + } + if(DBG_edgesIntersect(e, end)) + return end; + return NULL; +} + +//given a polygon, cut the edges off and finally obtain a +//a polygon without intersections. The cut-off edges are +//dealloated. The new polygon is returned. +directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur) +{ + directedLine *begin, *end, *next; + begin = polygon; + end = polygon; + cutOccur = 0; + while( (next = end->getNext()) != begin) + { + directedLine *interc = NULL; + if( (interc = DBG_edgeIntersectChainD(next, begin, end))) + { + int fixed = 0; + if(DBG_edgesIntersect(next, interc->getNext())) + { + //trying to fix it + Real buf[2]; + int i; + Int n=5; + buf[0] = interc->tail()[0]; + buf[1] = interc->tail()[1]; + + for(i=1; ihead()[0] + r * interc->tail()[0]; + Real v = (1-r) * interc->head()[1] + r * interc->tail()[1]; + interc->tail()[0] = interc->getNext()->head()[0] = u; + interc->tail()[1] = interc->getNext()->head()[1] = v; + if( (! DBG_edgesIntersect(next, interc)) && + (! DBG_edgesIntersect(next, interc->getNext()))) + break; //we fixed it + } + if(i==n) // we didn't fix it + { + fixed = 0; + //back to original + interc->tail()[0] = interc->getNext()->head()[0] = buf[0]; + interc->tail()[1] = interc->getNext()->head()[1] = buf[1]; + } + else + { + fixed = 1; + } + } + if(fixed == 0) + { + cutOccur = 1; + begin->deleteSingleLine(next); + + if(begin != end) + { + if(DBG_polygonSelfIntersect(begin)) + { + directedLine* newEnd = end->getPrev(); + begin->deleteSingleLine(end); + end = newEnd; + } + } + } + else + { + end = end->getNext(); + } + } + else + { + end = end->getNext(); + } + } + return begin; +} + +//given a polygon, cut the edges off and finally obtain a +//a polygon without intersections. The cut-off edges are +//dealloated. The new polygon is returned. +#if 0 // UNUSED +static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon) +{ + directedLine *crt;//current polygon + directedLine *begin; + directedLine *end; + directedLine *temp; + crt = polygon; + int find=0; + while(1) + { +//printf("loop\n"); + //if there are less than 3 edges, we should stop + if(crt->getPrev()->getPrev() == crt) + return NULL; + + if(DBG_edgesIntersect(crt, crt->getNext()) || + (crt->head()[0] == crt->getNext()->tail()[0] && + crt->head()[1] == crt->getNext()->tail()[1]) + ) + { + find = 1; + crt=crt->deleteChain(crt, crt->getNext()); + } + else + { + //now we know crt and crt->getNext do not intersect + begin = crt; + end = crt->getNext(); +//printf("begin=(%f,%f)\n", begin->head()[0], begin->head()[1]); +//printf("end=(%f,%f)\n", end->head()[0], end->head()[1]); + for(temp=end->getNext(); temp!=begin; temp= temp->getNext()) + { +//printf("temp=(%f,%f)\n", temp->head()[0], temp->head()[1]); + directedLine *intersect = DBG_edgeIntersectChainD(temp, begin, end); + if(intersect != NULL) + { + crt = crt->deleteChain(intersect, temp); + find=1; + break; //the for loop + } + else + { + end = temp; + } + } + } + if(find == 0) + return crt; + else + find = 0; //go to next loop +} +} +#endif + +directedLine* DBG_cutIntersectionAllPoly(directedLine* list) +{ + directedLine* temp; + directedLine* tempNext=NULL; + directedLine* ret = NULL; + int cutOccur=0; + for(temp=list; temp != NULL; temp = tempNext) + { + directedLine *left; + tempNext = temp->getNextPolygon(); + + left = DBG_cutIntersectionPoly(temp, cutOccur); + if(left != NULL) + ret=left->insertPolygon(ret); + } + return ret; +} + +sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList) +{ + directedLine *temp; + sampledLine* tempHead = NULL; + sampledLine* tempTail = NULL; + sampledLine* cHead = NULL; + sampledLine* cTail = NULL; + + if(polygonList == NULL) + return NULL; + + DBG_collectSampledLinesPoly(polygonList, cHead, cTail); + + assert(cHead); + assert(cTail); + for(temp = polygonList->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon()) + { + DBG_collectSampledLinesPoly(temp, tempHead, tempTail); + cTail->insert(tempHead); + cTail = tempTail; + } + return cHead; +} + +void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail) +{ + directedLine *temp; + retHead = NULL; + retTail = NULL; + if(polygon == NULL) + return; + + retHead = retTail = polygon->getSampledLine(); + for(temp = polygon->getNext(); temp != polygon; temp=temp->getNext()) + { + retHead = temp->getSampledLine()->insert(retHead); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,68 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _POLYDBG_H +#define _POLYDBG_H + +#include "definitions.h" +#include "directedLine.h" +#include "monoTriangulation.h" + +Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]); +Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]); + + +Int DBG_edgesIntersect(directedLine* l1, directedLine* l2); +Int DBG_polygonSelfIntersect(directedLine* poly); +Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly); +Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2); +Int DBG_polygonListIntersect(directedLine* pList); + +Int DBG_isCounterclockwise(directedLine* poly); +Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]); +Int DBG_pointInsidePoly(Real v[2], directedLine* poly); +Int DBG_enclosingPolygons(directedLine* poly, directedLine* list); +void DBG_reverse(directedLine* poly); +Int DBG_check(directedLine *polyList); + +Int DBG_isConvex(directedLine *poly); +Int DBG_is_U_direction(directedLine *poly); +Int DBG_is_U_monotone(directedLine* poly); + +directedLine* DBG_cutIntersectionAllPoly(directedLine* list); +directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur); + +sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList); + +void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,90 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include + +#include "polyUtil.h" + +Real area(Real A[2], Real B[2], Real C[2]) +{ + Real Bx, By, Cx, Cy; + Bx = B[0] - A[0]; + By = B[1] - A[1]; + Cx = C[0] - A[0]; + Cy = C[1] - A[1]; + return Bx*Cy - Cx*By; + +/* return (B[0]-A[0])*(C[1]-A[1]) - (C[0]-A[0])*(B[1]-A[1]);*/ +} + +/*given a directed line A->B, and a point P, + *determine whether P is to the left of AB. + *the line A->B (imagine it has beedn extended both + *end to the infinity) divides the plan into two + *half planes. When we walk from A to B, one + *half is to the left and the other half is to the right. + *return 1 if P is to the left. + *if P is on AB, 0 is returned. + */ +Int pointLeftLine(Real A[2], Real B[2], Real P[2]) +{ + if(area(A, B, P) >0) return 1; + else return 0; +} + +/*given two directed line: A -> B -> C, and another point P. + *determine whether P is to the left hand side of A->B->C. + *Think of BA and BC extended as two rays. So that the plane is + * divided into two parts. One part is to the left we walk from A + *to B and to C, the other part is to the right. + * In order for P to be the left, P must be either to the left + *of + */ +Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]) +{ + Int C_left_AB = (area(A, B, C)>0); + Int P_left_AB = (area(A, B, P)>0); + Int P_left_BC = (area(B, C, P)>0); + + if(C_left_AB) + { + return (P_left_AB && P_left_BC); + } + else + return (P_left_AB || P_left_BC); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,47 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _POLYUTIL_H +#define _POLYUTIL_H + +#include "definitions.h" +#ifdef __cplusplus +extern "C" { +#endif +Real area(Real A[2], Real B[2], Real C[2]); + +Int pointLeftLine(Real A[2], Real B[2], Real P[2]); +Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]); +#ifdef __cplusplus +} +#endif +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,190 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include +#include + +#include "primitiveStream.h" + +Int primStream::num_triangles() +{ + Int i; + Int ret=0; + for(i=0; i= size_vertices) { + Real* temp = (Real*) malloc (sizeof(Real) * (2*size_vertices + 2)); + assert(temp); + + /*copy*/ + for(Int i=0; i= size_lengths){ + Int* temp = (Int*) malloc(sizeof(Int) * (2*size_lengths + 2)); + assert(temp); + Int* tempTypes = (Int*) malloc(sizeof(Int) * (2*size_lengths + 2)); + assert(tempTypes); + + /*copy*/ + for(i=0; i + */ + +#ifndef _PRIMITIVE_STREAM_H +#define _PRIMITIVE_STREAM_H + +enum {PRIMITIVE_STREAM_FAN, PRIMITIVE_STREAM_STRIP}; + +#include "definitions.h" + +class primStream { + Int *lengths; /*length[i]=number of vertices of ith primitive*/ + Int *types; /*each primive has a type: FAN or STREAM*/ + Real *vertices; /*the size >= 2 * num_vertices, each vertex (u,v)*/ + + /*the following size information are used for dynamic arrays*/ + Int index_lengths; /*the current available entry*/ + Int size_lengths; /*the allocated size of the array: lengths*/ + Int index_vertices; + Int size_vertices; + + /*the vertex is inserted one by one. counter is used to + *count the number of vertices which have been inserted so far in + *the current primitive + */ + Int counter; + +public: + primStream(Int sizeLengths, Int sizeVertices); + ~primStream(); + + Int get_n_prims() //num of primitives + { + return index_lengths; + } + Int get_type(Int i) //the type of ith primitive + { + return types[i]; + } + Int get_length(Int i) //the length of the ith primitive + { + return lengths[i]; + } + Real* get_vertices() {return vertices;} + + /*the begining of inserting a new primitive. + *reset counter to be 0. + */ + void begin(); + void insert(Real u, Real v); + void insert(Real v[2]) {insert(v[0], v[1]);} + void end(Int type); + + Int num_triangles(); + + void triangle(Real A[2], Real B[2], Real C[2]) + { + begin(); + insert(A); + insert(B); + insert(C); + end(PRIMITIVE_STREAM_FAN); + } + void print(); + void draw(); /*using GL to draw the primitives*/ +}; + + + + + + + + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,77 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include + + +static void swap(void *v[], int i, int j) +{ + void *temp; + temp = v[i]; + v[i] = v[j]; + v[j] = temp; +} + +/*as an example to use this function to + *sort integers, you need to supply the function + *int comp(int *i1, int *i2) + *{ + * if( *i1 < * i2) return -1; + * else return 1; + *} + *and an array of pointers to integers: + * int *v[100] (allocate space for where each v[i] points to). + *then you can call: + * quicksort( (void**)v, left, right, (int (*)(void *, void *))comp) + */ +void quicksort(void *v[], int left, int right, + int (*comp) (void *, void *)) +{ + int i, last; + if(left >= right) /*do nothing if array contains */ + return; /*fewer than two elements*/ + + swap(v, left, (left+right)/2); + last = left; + for(i=left+1; i<=right; i++) + if((*comp)(v[i], v[left])<0) + swap(v, ++last, i); + swap(v, left, last); + quicksort(v, left, last-1, comp); + quicksort(v, last+1, right, comp); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _QUICKSORT_H +#define _QUICKSORT_H + +#include +#include + +void quicksort(void *v[], int left, int right, + int (*comp) (void *, void *)); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,196 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include "glimports.h" +#include "zlassert.h" +#include + +#include "rectBlock.h" + +rectBlock::rectBlock(gridBoundaryChain* left, gridBoundaryChain* right, Int beginVline, Int endVline) +{ + Int i; + + + upGridLineIndex = left->getVlineIndex(beginVline); + + lowGridLineIndex = left->getVlineIndex(endVline); + + Int n = upGridLineIndex-lowGridLineIndex+1; //number of grid lines + leftIndices = (Int*) malloc(sizeof(Int) * n); + assert(leftIndices); + rightIndices = (Int*) malloc(sizeof(Int) * n); + assert(rightIndices); + for(i=0; igetInnerIndex(i+beginVline); + rightIndices[i] = right->getInnerIndex(i+beginVline); + } +} + + +rectBlock::~rectBlock() +{ + free(leftIndices); + free(rightIndices); +} + +void rectBlock::print() +{ + Int i; + printf("block:\n"); + for(i=upGridLineIndex; i >= lowGridLineIndex; i--) + { + printf("gridline %i, (%i,%i)\n", i, leftIndices[upGridLineIndex-i], rightIndices[upGridLineIndex-i]); + } +} + + + +void rectBlock::draw(Real* u_values, Real* v_values) +{ + Int i,j,k; + //upgrid line to bot grid line +#ifdef DEBUG +printf("upGridLineIndex=%i, lowGridLineIndex=%i\n", upGridLineIndex, lowGridLineIndex); +#endif + for(k=0, i=upGridLineIndex; i > lowGridLineIndex; i--, k++) + { + glBegin(GL_QUAD_STRIP); + + for(j=leftIndices[k+1]; j<= rightIndices[k+1]; j++) + { + glVertex2f(u_values[j], v_values[i]); + glVertex2f(u_values[j], v_values[i-1]); + } + glEnd(); + } +} + + +Int rectBlock::num_quads() +{ + Int ret=0; + Int k,i; + for(k=0, i=upGridLineIndex; i>lowGridLineIndex; i--, k++) + { + ret += (rightIndices[k+1]-leftIndices[k+1]); + } + return ret; +} + +Int rectBlockArray::num_quads() +{ + Int ret=0; + for(Int i=0; inum_quads(); + return ret; +} + +rectBlockArray::rectBlockArray(Int s) +{ + Int i; + n_elements = 0; + size = s; + array = (rectBlock**) malloc(sizeof(rectBlock*) * s); + assert(array); +//initialization + for(i=0; iprint(); +} + +void rectBlockArray::draw(Real* u_values, Real* v_values) +{ + Int i; + for(i=0; idraw(u_values, v_values); +} + + + + + + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,82 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _RECTBLOCK_H +#define _RECTBLOCK_H + +#include "definitions.h" +#include "gridWrap.h" + +class rectBlock{ + Int upGridLineIndex; + Int lowGridLineIndex; + Int* leftIndices; //up to bottome + Int* rightIndices; //up to bottom +public: + //the arrays are copies. + rectBlock(gridBoundaryChain* left, gridBoundaryChain* right, Int beginVline, Int endVline); + ~rectBlock(); //free the two arrays + + Int get_upGridLineIndex() {return upGridLineIndex;} + Int get_lowGridLineIndex() {return lowGridLineIndex;} + Int* get_leftIndices() {return leftIndices;} + Int* get_rightIndices() {return rightIndices;} + + Int num_quads(); + + void print(); + void draw(Real* u_values, Real* v_values); +}; + + +class rectBlockArray{ + rectBlock** array; + Int n_elements; + Int size; +public: + rectBlockArray(Int s); + ~rectBlockArray();//delete avarything including the blocks + + Int get_n_elements() {return n_elements;} + rectBlock* get_element(Int i) {return array[i];} + void insert(rectBlock* newBlock); //only take the pointer, not ther cotent + + Int num_quads(); + + void print(); + void draw(Real* u_values, Real* v_values); +}; + + + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,844 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include "zlassert.h" +#include "sampleCompBot.h" +#include "sampleCompRight.h" + +#define max(a,b) ((a>b)? a:b) + +//return: index_mono, index_pass +//from [pass, mono] is strictly U-monotone +//from [corner, pass] is = u +//if everybost is getVertex(i)[0] >= u) + break; + ret_index_pass = i; + if(ret_index_pass <= leftEnd) + { + for(i=ret_index_pass; i< leftEnd; i++) + { + if(leftChain->getVertex(i+1)[0] <= leftChain->getVertex(i)[0]) + break; + } + ret_index_mono = i; + } + +} + +void findBotRightSegment(vertexArray* rightChain, + Int rightEnd, + Int rightCorner, + Real u, + Int& ret_index_mono, + Int& ret_index_pass) +{ + Int i; + assert(rightCorner <= rightEnd); + for(i=rightCorner; i<= rightEnd; i++) + if(rightChain->getVertex(i)[0] <= u) + break; + + + + ret_index_pass = i; + + if(ret_index_pass <= rightEnd) + { + for(i=ret_index_pass; i< rightEnd; i++) + { + if(rightChain->getVertex(i+1)[0] >= rightChain->getVertex(i)[0]) + break; + } + ret_index_mono = i; + } +} + + +void sampleBotRightWithGridLinePost(Real* botVertex, + vertexArray* rightChain, + Int rightEnd, + Int segIndexMono, + Int segIndexPass, + Int rightCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream) +{ + //the possible section which is to the right of rightU + if(segIndexPass > rightCorner) //from corner to pass-1 is > u. + { + Real *tempBot; + if(segIndexPass <= rightEnd) //there is a point to the left of u + tempBot = rightChain->getVertex(segIndexPass); + else //nothing is to the left of u. + tempBot = botVertex; + Real tempTop[2]; + tempTop[0] = grid->get_u_value(rightU); + tempTop[1] = grid->get_v_value(gridV); + + monoTriangulation2(tempTop, tempBot, + rightChain, + rightCorner, + segIndexPass-1, + 0, // a decrease chain + pStream); + } + + //the possible section which is strictly Umonotone + if(segIndexPass <= rightEnd) //segIndex pass and mono exist + { + //if there are grid points which are to the left of botVertex + //then we should use botVertex to form a fan with these points to + //optimize the triangulation + int do_optimize = 1; + if(botVertex[0] <= grid->get_u_value(leftU)) + do_optimize = 0; + else + { + //we also have to make sure that botVertex is the left most vertex on the chain + int i; + for(i=segIndexMono; i<=rightEnd; i++) + if(rightChain->getVertex(i)[0] <= botVertex[0]) + { + do_optimize = 0; + break; + } + } + + if(do_optimize) + { + //find midU so that grid->get_u_value(midU) <= botVertex[0] + //and grid->get_u_value(midU) > botVertex[0] + int midU = leftU; + while(grid->get_u_value(midU) <= botVertex[0]) + { + midU++; + if(midU > rightU) + break; + } + midU--; + + grid->outputFanWithPoint(gridV, leftU, midU, botVertex, pStream); + stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, midU, rightU, pStream, 1); + Real tempTop[2]; + tempTop[0] = grid->get_u_value(midU); + tempTop[1] = grid->get_v_value(gridV); + monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream); + } + else //not optimize + { + stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1); + Real tempTop[2]; + tempTop[0] = grid->get_u_value(leftU); + tempTop[1] = grid->get_v_value(gridV); + monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream); + } + } + else //the botVertex forms a fan witht eh grid points + grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); +} + +void sampleBotRightWithGridLine(Real* botVertex, + vertexArray* rightChain, + Int rightEnd, + Int rightCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream) +{ + //if right chaain is empty, then there is only one bot vertex with + //one grid line + if(rightEndoutputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); + return; + } + + Int segIndexMono, segIndexPass; + findBotRightSegment(rightChain, + rightEnd, + rightCorner, + grid->get_u_value(rightU), + segIndexMono, + segIndexPass); + + sampleBotRightWithGridLinePost(botVertex, + rightChain, + rightEnd, + segIndexMono, + segIndexPass, + rightCorner, + grid, + gridV, + leftU, + rightU, + pStream); +} + + +void sampleBotLeftWithGridLinePost(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + Int segIndexMono, + Int segIndexPass, + Int leftCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream) +{ + + //the possible section which is to the left of leftU + if(segIndexPass > leftCorner) //at least leftCorner is to the left of leftU + { + Real *tempBot; + if(segIndexPass <= leftEnd) //from corner to pass-1 is getVertex(segIndexPass); + else //nothing is to the rigth of u + tempBot = botVertex; + Real tempTop[2]; + tempTop[0] = grid->get_u_value(leftU); + tempTop[1] = grid->get_v_value(gridV); + monoTriangulation2(tempTop, tempBot, leftChain, leftCorner, segIndexPass-1, + 1, //a increase chain, + pStream); + } + //the possible section which is strictly Umonotone + if(segIndexPass <= leftEnd) //segIndexpass and mono exist + { + stripOfFanLeft(leftChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1); + Real tempTop[2]; + tempTop[0] = grid->get_u_value(rightU); + tempTop[1] = grid->get_v_value(gridV); + + monoTriangulation2(tempTop, botVertex, leftChain, segIndexMono, leftEnd, + 1, //increase chain + pStream); + } + else //the botVertex forms a fan with the grid points + { + grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); + } + +} + +void sampleBotLeftWithGridLine(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + Int leftCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream) +{ + + //if leftChain is empty, then there is only one botVertex with one grid line + if(leftEnd< leftCorner){ + grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); + return; + } + + Int segIndexPass, segIndexMono; + findBotLeftSegment(leftChain, leftEnd, leftCorner, grid->get_u_value(leftU), segIndexMono, segIndexPass); + + sampleBotLeftWithGridLinePost(botVertex, + leftChain, + leftEnd, + segIndexMono, + segIndexPass, + leftCorner, + grid, + gridV, + leftU, rightU, pStream); +} + +//return 1 if separator exists, 0 otherwise +Int findBotSeparator(vertexArray* leftChain, + Int leftEnd, + Int leftCorner, + vertexArray* rightChain, + Int rightEnd, + Int rightCorner, + Int& ret_sep_left, + Int& ret_sep_right) +{ + Int oldLeftI, oldRightI, newLeftI, newRightI; + Int i,j,k; + Real leftMax /*= leftChain->getVertex(leftCorner)[0]*/; + Real rightMin /*= rightChain->getVertex(rightCorner)[0]*/; + if(leftChain->getVertex(leftCorner)[1] < rightChain->getVertex(rightCorner)[1])//leftlower + { + oldLeftI = leftCorner-1; + oldRightI = rightCorner; + leftMax = leftChain->getVertex(leftCorner)[0] - Real(1.0) ; //initilize to be left of leftCorner + rightMin = rightChain->getVertex(rightCorner)[0]; + } + else //rightlower + { + oldLeftI = leftCorner; + oldRightI = rightCorner-1; + leftMax = leftChain->getVertex(leftCorner)[0]; + rightMin = rightChain->getVertex(rightCorner)[0] + Real(1.0); + } + + //i: the current working leftChain Index + //j: the curent working right chian index + //if(left(i) is lower than right(j), then the two chains above right(j) are separated. + //else the two chains below left(i) are separated. + i = leftCorner; + j = rightCorner; + while(1) + { + newLeftI = oldLeftI; + newRightI = oldRightI; + if(i> leftEnd) //left chain is doen , go through remaining right chain + { + for(k=j+1; k<= rightEnd; k++) + { + if(rightChain->getVertex(k)[0] > leftMax) //no conflict + { + //update oldRightI if necessary + if(rightChain->getVertex(k)[0] < rightMin) + { + rightMin = rightChain->getVertex(k)[0]; + oldRightI = k; + } + } + else //there is a conflict + break; //the for-loop, above right(k+1) is separated: oldLeftI, oldRightI + } + break; //the while loop + } + else if(j > rightEnd) //right Chain is doen + { + for(k=i+1; k<= leftEnd; k++) + { + if(leftChain->getVertex(k)[0] < rightMin) //no conflict + { + //update oldLeftI if necessary + if(leftChain->getVertex(k)[0] > leftMax) + { + leftMax = leftChain->getVertex(k)[0]; + oldLeftI = k; + } + } + else //there is a conflict + break; //the for-loop, above left(k+1) is separated: oldLeftI, oldRightI + } + break; //the while loop + } + else if(leftChain->getVertex(i)[1] < rightChain->getVertex(j)[1]) //left lower + { + + if(leftChain->getVertex(i)[0] > leftMax) //update leftMax amd newLeftI + { + leftMax = leftChain->getVertex(i)[0]; + newLeftI = i; + } + for(k=j+1; k<= rightEnd; k++) //update rightMin and newRightI; + { + if(rightChain->getVertex(k)[1] < leftChain->getVertex(i)[1]) //right gets lower + break; + if(rightChain->getVertex(k)[0] < rightMin) + { + rightMin = rightChain->getVertex(k)[0]; + newRightI = k; + } + } + j = k; //next working j, since j will he lower than i in next loop + if(leftMax >= rightMin) //there is a conflict + break; + else //still no conflict + { + oldLeftI = newLeftI; + oldRightI = newRightI; + + } + } + else //right lower + { + if(rightChain->getVertex(j)[0] < rightMin) + { + rightMin = rightChain->getVertex(j)[0]; + newRightI = j; + } + for(k=i+1; k<= leftEnd; k++) + { + if(leftChain->getVertex(k)[1] < rightChain->getVertex(j)[1]) + break; + if(leftChain->getVertex(k)[0] > leftMax) + { + leftMax = leftChain->getVertex(k)[0]; + newLeftI = k; + } + } + i=k; //nexct working i, since i will be lower than j next loop + if(leftMax >= rightMin) //there is conflict + break; + else //still no conflict + { + oldLeftI = newLeftI; + oldRightI = newRightI; + } + } + }//end of while loop + //now oldLeftI and oldRight I are the desired separator index notice that they are not + //necessarily valid + if(oldLeftI < leftCorner || oldRightI < rightCorner) + return 0; //no separator + else + { + ret_sep_left = oldLeftI; + ret_sep_right = oldRightI; + return 1; + } +} + +void sampleCompBot(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + vertexArray* rightChain, + Int rightEnd, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream) +{ + + if(down_leftCornerWhere == 1 && down_rightCornerWhere == 1) //the bot is botVertex with possible grid points + { + + leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), + botVertex, + pStream); + return; + } + else if(down_leftCornerWhere != 0) + { + + Real* tempBot; + Int tempRightEnd; + if(down_leftCornerWhere == 1){ + tempRightEnd = rightEnd; + tempBot = botVertex; + } + else + { + tempRightEnd = down_leftCornerIndex-1; + tempBot = rightChain->getVertex(down_leftCornerIndex); + } + + sampleBotRightWithGridLine(tempBot, + rightChain, + tempRightEnd, + down_rightCornerIndex, + rightGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), + pStream); + } + else if(down_rightCornerWhere != 2) + { + + Real* tempBot; + Int tempLeftEnd; + if(down_rightCornerWhere == 1){ + tempLeftEnd = leftEnd; + tempBot = botVertex; + } + else //right corner is on left chain + { + tempLeftEnd = down_rightCornerIndex-1; + tempBot = leftChain->getVertex(down_rightCornerIndex); + } + + + sampleBotLeftWithGridLine(tempBot, leftChain, tempLeftEnd, down_leftCornerIndex, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), + pStream); + + } + else //down_leftCornereWhere == 0, down_rightCornerwhere == 2 + { + sampleCompBotSimple(botVertex, + leftChain, + leftEnd, + rightChain, + rightEnd, + leftGridChain, + rightGridChain, + gridIndex, + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex, + pStream); + + return; + +#ifdef NOT_REACHABLE + //the following code is trying to do some optimization, but not quite working. so it is not reachable, but leave it here for reference + Int sep_left, sep_right; + if(findBotSeparator(leftChain, leftEnd, down_leftCornerIndex, + rightChain, rightEnd, down_rightCornerIndex, + sep_left, sep_right) + )//separator exiosts + { + + if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex) && + rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex)) + { + Int gridSep; + Int segLeftMono, segLeftPass, segRightMono, segRightPass; + findBotLeftSegment(leftChain, + sep_left, + down_leftCornerIndex, + leftGridChain->get_u_value(gridIndex), + segLeftMono, + segLeftPass); + findBotRightSegment(rightChain, + sep_right, + down_rightCornerIndex, + rightGridChain->get_u_value(gridIndex), + segRightMono, + segRightPass); + if(leftChain->getVertex(segLeftMono)[1] <= rightChain->getVertex(segRightMono)[1]) + { + gridSep = rightGridChain->getUlineIndex(gridIndex); + while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftMono)[0]) + gridSep--; + } + else + { + gridSep = leftGridChain->getUlineIndex(gridIndex); + while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightMono)[0]) + gridSep++; + } + + sampleBotLeftWithGridLinePost(leftChain->getVertex(segLeftMono), + leftChain, + segLeftMono-1, + segLeftMono-1, + segLeftPass, + down_leftCornerIndex, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + gridSep, + pStream); + sampleBotRightWithGridLinePost(rightChain->getVertex(segRightMono), + rightChain, + segRightMono-1, + segRightMono-1, + segRightPass, + down_rightCornerIndex, + rightGridChain->getGrid(), + rightGridChain->getVlineIndex(gridIndex), + gridSep, + rightGridChain->getUlineIndex(gridIndex), + pStream); + Real tempTop[2]; + tempTop[0] = leftGridChain->getGrid()->get_u_value(gridSep); + tempTop[1] = leftGridChain->get_v_value(gridIndex); + monoTriangulationRecGen(tempTop, botVertex, + leftChain, segLeftMono, leftEnd, + rightChain, segRightMono, rightEnd, + pStream); + }//end if both sides have vertices inside the gridboundary points + else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex)) //left n right out + + { + Int segLeftMono, segLeftPass; + findBotLeftSegment(leftChain, + sep_left, + down_leftCornerIndex, + leftGridChain->get_u_value(gridIndex), + segLeftMono, + segLeftPass); + assert(segLeftPass <= sep_left); //make sure there is a point to the right of u. + monoTriangulation2(leftGridChain->get_vertex(gridIndex), + leftChain->getVertex(segLeftPass), + leftChain, + down_leftCornerIndex, + segLeftPass-1, + 1, //a increase chain + pStream); + stripOfFanLeft(leftChain, segLeftMono, segLeftPass, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), + pStream,1 ); +/* + sampleBotLeftWithGridLinePost(leftChain->getVertex(segLeftMono), + leftChain, + segLeftMono-1, + segLeftMono-1, + segLeftPass, + down_leftCornerIndex, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), + pStream); +*/ + + monoTriangulationRecGen(rightGridChain->get_vertex(gridIndex), + botVertex, + leftChain, segLeftMono, leftEnd, + rightChain, down_rightCornerIndex, rightEnd, + pStream); + }//end left in right out + else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex))//left out right in + { + Int segRightMono, segRightPass; + findBotRightSegment(rightChain, sep_right, down_rightCornerIndex, + rightGridChain->get_u_value(gridIndex), + segRightMono, + segRightPass); + + assert(segRightPass <= sep_right); //make sure there is a point to the left of u. + monoTriangulation2(rightGridChain->get_vertex(gridIndex), + rightChain->getVertex(segRightPass), + rightChain, + down_rightCornerIndex, + segRightPass-1, + 0, // a decrease chain + pStream); + + stripOfFanRight(rightChain, segRightMono, segRightPass, + rightGridChain->getGrid(), + rightGridChain->getVlineIndex(gridIndex), + leftGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), + pStream, 1); + + + monoTriangulationRecGen(leftGridChain->get_vertex(gridIndex), + botVertex, + leftChain, down_leftCornerIndex, leftEnd, + rightChain, segRightMono, rightEnd, + pStream); + + }//end left out right in + else //left out, right out + { + sampleCompBotSimple(botVertex, + leftChain, + leftEnd, + rightChain, + rightEnd, + leftGridChain, + rightGridChain, + gridIndex, + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex, + pStream); + + }//end leftout right out + }//end if separator exists + else //no separator + { + + sampleCompBotSimple(botVertex, + leftChain, + leftEnd, + rightChain, + rightEnd, + leftGridChain, + rightGridChain, + gridIndex, + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex, + pStream); + } +#endif + }//end id 0 2 +}//end if the functin + + +void sampleCompBotSimple(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + vertexArray* rightChain, + Int rightEnd, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream) +{ + //the plan is to use monotriangulation algorithm. + Int i,k; + Real* ActualTop; + Real* ActualBot; + Int ActualLeftStart, ActualLeftEnd; + Int ActualRightStart, ActualRightEnd; + + //creat an array to store the points on the grid line + gridWrap* grid = leftGridChain->getGrid(); + Int gridV = leftGridChain->getVlineIndex(gridIndex); + Int gridLeftU = leftGridChain->getUlineIndex(gridIndex); + Int gridRightU = rightGridChain->getUlineIndex(gridIndex); + Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1)); + assert(gridPoints); + + for(k=0, i=gridRightU; i>= gridLeftU; i--, k++) + { + gridPoints[k][0] = grid->get_u_value(i); + gridPoints[k][1] = grid->get_v_value(gridV); + } + + if(down_rightCornerWhere != 0) //rightCorner is not on lef + ActualLeftEnd = leftEnd; + else + ActualLeftEnd = down_rightCornerIndex-1; //down_rightCornerIndex will be th actualBot + + if(down_leftCornerWhere != 0) //left corner is not on let chian + ActualLeftStart = leftEnd+1; //meaning that there is no actual left section + else + ActualLeftStart = down_leftCornerIndex; + + vertexArray ActualLeftChain(max(0, ActualLeftEnd - ActualLeftStart +1) + gridRightU - gridLeftU +1); + + for(i=0; igetVertex(i)); + + //determine ActualRightStart + if(down_rightCornerWhere != 2) //right is not on right + ActualRightStart = rightEnd +1; //meaning no section on right + else + ActualRightStart = down_rightCornerIndex; + + //determine actualrightEnd + if(down_leftCornerWhere != 2) //left is not on right + { + + ActualRightEnd = rightEnd; + } + else //left corner is on right + { + ActualRightEnd = down_leftCornerIndex-1; //down_leftCornerIndex will be the bot + + } + + //actual bot + if(down_rightCornerWhere == 2) + { + if(down_leftCornerWhere == 2) + ActualBot = rightChain->getVertex(down_leftCornerIndex); + else + ActualBot = botVertex; + } + else if(down_rightCornerWhere == 1) //right corner bot + ActualBot = botVertex; + else //down_rightCornerWhere == 0 + ActualBot = leftChain->getVertex(down_rightCornerIndex); + + ActualTop = gridPoints[0]; +/* +printf("in bot simple, actual leftChain is \n"); +ActualLeftChain.print(); +printf("Actual Top = %f,%f\n", ActualTop[0],ActualTop[1]); +printf("Actual Bot = %f,%f\n", ActualBot[0],ActualBot[1]); +printf("Actual right start = %i, end=%i\n",ActualRightStart, ActualRightEnd); +*/ + if(rightChain->getVertex(ActualRightStart)[1] == ActualTop[1]) + monoTriangulationRecGenOpt(rightChain->getVertex(ActualRightStart), + ActualBot, + &ActualLeftChain, + 0, + ActualLeftChain.getNumElements()-1, + rightChain, + ActualRightStart+1, + ActualRightEnd, + pStream); + else + monoTriangulationRecGenOpt(ActualTop, ActualBot, + &ActualLeftChain, + 1, //the first one is the top vertex + ActualLeftChain.getNumElements()-1, + rightChain, + ActualRightStart, + ActualRightEnd, + pStream); + free(gridPoints); +} + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,138 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SAMPLECOMPBOT_H +#define _SAMPLECOMPBOT_H + +#include "sampleMonoPoly.h" + +void findBotLeftSegment(vertexArray* leftChain, + Int leftEnd, + Int leftCorner, + Real u, + Int& ret_index_mono, + Int& ret_index_pass); + +void findBotRightSegment(vertexArray* rightChain, + Int rightEnd, + Int rightCorner, + Real u, + Int& ret_index_mono, + Int& ret_index_pass); + + +void sampleBotRightWithGridLinePost(Real* botVertex, + vertexArray* rightChain, + Int rightEnd, + Int segIndexMono, + Int segIndexPass, + Int rightCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream); + + +void sampleBotRightWithGridLine(Real* botVertex, + vertexArray* rightChain, + Int rightEnd, + Int rightCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream); + + +void sampleBotLeftWithGridLinePost(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + Int segIndexMono, + Int segIndexPass, + Int leftCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream); + + +void sampleBotLeftWithGridLine(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + Int leftCorner, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream); + + +Int findBotSeparator(vertexArray* leftChain, + Int leftEnd, + Int leftCorner, + vertexArray* rightChain, + Int rightEnd, + Int rightCorner, + Int& ret_sep_left, + Int& ret_sep_right); + +void sampleCompBot(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + vertexArray* rightChain, + Int rightEnd, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream); + +void sampleCompBotSimple(Real* botVertex, + vertexArray* leftChain, + Int leftEnd, + vertexArray* rightChain, + Int rightEnd, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,371 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include "glimports.h" +#include "sampleComp.h" +#include "sampleCompTop.h" +#include "sampleCompBot.h" +#include "sampleCompRight.h" + + + +#define max(a,b) ((a>b)? a:b) +#define min(a,b) ((a>b)? b:a) + +void sampleConnectedComp(Real* topVertex, Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, Int leftEndIndex, + vertexArray* rightChain, + Int rightStartIndex, Int rightEndIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, Int gridIndex2, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream, + rectBlockArray* rbArray + ) +{ + + sampleCompLeft(topVertex, botVertex, + leftChain, + leftStartIndex, leftEndIndex, + rightChain, + rightStartIndex, rightEndIndex, + leftGridChain, + gridIndex1, + gridIndex2, + up_leftCornerWhere, + up_leftCornerIndex, + down_leftCornerWhere, + down_leftCornerIndex, + pStream); + + + sampleCompRight(topVertex, botVertex, + leftChain, + leftStartIndex, leftEndIndex, + rightChain, + rightStartIndex, + rightEndIndex, + rightGridChain, + gridIndex1, gridIndex2, + up_rightCornerWhere, + up_rightCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex, + pStream); + + + sampleCompTop(topVertex, + leftChain, + leftStartIndex, + rightChain, + rightStartIndex, + leftGridChain, + rightGridChain, + gridIndex1, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + pStream); + + sampleCompBot(botVertex, + leftChain, + leftEndIndex, + rightChain, + rightEndIndex, + leftGridChain, + rightGridChain, + gridIndex2, + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex, + pStream); + + + //the center + + rbArray->insert(new rectBlock(leftGridChain, rightGridChain, gridIndex1, gridIndex2)); + + +} + +/*notice that we need rightChain because the + *corners could be on the rightChain. + *here comp means component. + */ +void sampleCompLeft(Real* topVertex, Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, Int leftEndIndex, + vertexArray* rightChain, + Int rightStartIndex, Int rightEndIndex, + gridBoundaryChain* leftGridChain, + Int gridIndex1, Int gridIndex2, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + primStream* pStream) +{ + /*find out whether there is a trim vertex which is + *inbetween the top and bot grid lines or not. + */ + Int midIndex1; + Int midIndex2; + Int gridMidIndex1 = 0, gridMidIndex2 = 0; + //midIndex1: array[i] <= v, array[i-1] > v + //midIndex2: array[i] >= v, array[i+1] < v + // v(gridMidIndex1) >= v(midindex1) > v(gridMidIndex1+1) + // v(gridMidIndex2-1) >= v(midIndex2) > v(gridMidIndex2) ?? + midIndex1 = leftChain->findIndexBelowGen( + leftGridChain->get_v_value(gridIndex1), + leftStartIndex, + leftEndIndex); + + midIndex2 = -1; /*initilization*/ + if(midIndex1<= leftEndIndex && gridIndex1getVertex(midIndex1)[1] >= leftGridChain->get_v_value(gridIndex2)) + { + midIndex2 = leftChain->findIndexAboveGen( + leftGridChain->get_v_value(gridIndex2), + midIndex1, //midIndex1 <= midIndex2. + leftEndIndex); + gridMidIndex1 = leftGridChain->lookfor(leftChain->getVertex(midIndex1)[1], + gridIndex1, gridIndex2); + gridMidIndex2 = 1+leftGridChain->lookfor(leftChain->getVertex(midIndex2)[1], + gridMidIndex1, gridIndex2); + } + + + /*to interprete the corner information*/ + Real* cornerTop; + Real* cornerBot; + Int cornerLeftStart; + Int cornerLeftEnd; + Int cornerRightUpEnd; + Int cornerRightDownStart; + if(up_leftCornerWhere == 0) /*left corner is on left chain*/ + { + cornerTop = leftChain->getVertex(up_leftCornerIndex); + cornerLeftStart = up_leftCornerIndex+1; + cornerRightUpEnd = -1; /*no right*/ + } + else if(up_leftCornerWhere == 1) /*left corner is on top*/ + { + cornerTop = topVertex; + cornerLeftStart = leftStartIndex; + cornerRightUpEnd = -1; /*no right*/ + } + else /*left corner is on right chain*/ + { + cornerTop = topVertex; + cornerLeftStart = leftStartIndex; + cornerRightUpEnd = up_leftCornerIndex; + } + + if(down_leftCornerWhere == 0) /*left corner is on left chain*/ + { + cornerBot = leftChain->getVertex(down_leftCornerIndex); + cornerLeftEnd = down_leftCornerIndex-1; + cornerRightDownStart = rightEndIndex+1; /*no right*/ + } + else if(down_leftCornerWhere == 1) /*left corner is on bot*/ + { + cornerBot = botVertex; + cornerLeftEnd = leftEndIndex; + cornerRightDownStart = rightEndIndex+1; /*no right*/ + } + else /*left corner is on the right chian*/ + { + cornerBot = botVertex; + cornerLeftEnd = leftEndIndex; + cornerRightDownStart = down_leftCornerIndex; + } + + + + + /*sample*/ + if(midIndex2 >= 0) /*there is a trim point inbewteen grid lines*/ + { + + sampleLeftSingleTrimEdgeRegionGen(cornerTop, leftChain->getVertex(midIndex1), + leftChain, + cornerLeftStart, + midIndex1-1, + leftGridChain, + gridIndex1, + gridMidIndex1, + rightChain, + rightStartIndex, + cornerRightUpEnd, + 0, //no right down section + -1, + pStream); + + sampleLeftSingleTrimEdgeRegionGen(leftChain->getVertex(midIndex2), + cornerBot, + leftChain, + midIndex2+1, + cornerLeftEnd, + leftGridChain, + gridMidIndex2, + gridIndex2, + rightChain, + 0, //no right up section + -1, + cornerRightDownStart, + rightEndIndex, + pStream); + + + sampleLeftStripRecF(leftChain, + midIndex1, + midIndex2, + leftGridChain, + gridMidIndex1, + gridMidIndex2, + pStream); + } + else + { + sampleLeftSingleTrimEdgeRegionGen(cornerTop, cornerBot, + leftChain, + cornerLeftStart, + cornerLeftEnd, + leftGridChain, + gridIndex1, + gridIndex2, + rightChain, + rightStartIndex, + cornerRightUpEnd, + cornerRightDownStart, + rightEndIndex, + pStream); + } +} + +void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], + vertexArray* leftChain, + Int leftStart, + Int leftEnd, + gridBoundaryChain* gridChain, + Int gridBeginIndex, + Int gridEndIndex, + vertexArray* rightChain, + Int rightUpBegin, + Int rightUpEnd, + Int rightDownBegin, + Int rightDownEnd, + primStream* pStream) +{ + Int i,j,k; + + /*creat an array to store all the up and down secments of the right chain, + *and the left end grid points + * + *although vertex array is a dynamic array, but to gain efficiency, + *it is better to initiliza the exact array size + */ + vertexArray vArray(gridEndIndex-gridBeginIndex+1 + + max(0,rightUpEnd - rightUpBegin+1)+ + max(0,rightDownEnd - rightDownBegin+1)); + + /*append the vertices on the up section of thr right chain*/ + for(i=rightUpBegin; i<= rightUpEnd; i++) + vArray.appendVertex(rightChain->getVertex(i)); + + /*append the vertices of the left extremal grid points, + *and at the same time, perform triangulation for the stair cases + */ + vArray.appendVertex(gridChain->get_vertex(gridBeginIndex)); + + for(k=1, i=gridBeginIndex+1; i<=gridEndIndex; i++, k++) + { + vArray.appendVertex(gridChain->get_vertex(i)); + + /*output the fan of the grid points of the (i)th and (i-1)th grid line. + */ + if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(gridChain->get_vertex(i-1)); + for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++) + pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + else if(gridChain->getUlineIndex(i) > gridChain->getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(gridChain->get_vertex(i)); + for(j=gridChain->getUlineIndex(i); j>= gridChain->getUlineIndex(i-1); j--) + pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + /*otherwisem, the two are equal, so there is no fan to outout*/ + } + + /*then append all the vertices on the down section of the right chain*/ + for(i=rightDownBegin; i<= rightDownEnd; i++) + vArray.appendVertex(rightChain->getVertex(i)); + + monoTriangulationRecGen(topVert, botVert, + leftChain, leftStart, leftEnd, + &vArray, 0, vArray.getNumElements()-1, + pStream); + +} + + + + + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,86 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SAMPLECOMP_H +#define _SAMPLECOMP_H + +#include "sampleMonoPoly.h" +#include "rectBlock.h" + +void sampleConnectedComp(Real* topVertex, Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, Int botLeftIndex, + vertexArray* rightChain, + Int rightStartIndex, Int botRightIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, Int gridIndex2, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream, + rectBlockArray* rbArray + ); + +void sampleCompLeft(Real* topVertex, Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, Int leftEndIndex, + vertexArray* rightChain, + Int rightStartIndex, Int rightEndIndex, + gridBoundaryChain* leftGridChain, + Int gridIndex1, Int gridIndex2, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + primStream* pStream); + +void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], + vertexArray* leftChain, + Int leftStart, + Int leftEnd, + gridBoundaryChain* gridChain, + Int gridBegindex, + Int gridEndIndex, + vertexArray* rightChain, + Int rightUpBegin, + Int rightUpEnd, + Int rightDownBegin, + Int rightDownEnd, + primStream* pStream); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,644 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include "gluos.h" +#include "glimports.h" +#include "zlassert.h" +#include "sampleCompRight.h" + +#define max(a,b) ((a>b)? a:b) +#define min(a,b) ((a>b)? b:a) + + + +#ifdef NOT_TAKEOUT + +/*notice that we need leftChain because the + *corners could be on the leftChain. + */ +void sampleCompRight(Real* topVertex, Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, Int leftEndIndex, + vertexArray* rightChain, + Int rightStartIndex, Int rightEndIndex, + gridBoundaryChain* rightGridChain, + Int gridIndex1, Int gridIndex2, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + Int down_rightCornerWhere, + Int down_rightCornerIndex, + primStream* pStream) +{ + /*find out whether there is a trim vertex which is + *inbetween the top and bot grid lines or not. + */ + Int midIndex1; + Int midIndex2; + Int gridMidIndex1 = 0, gridMidIndex2 = 0; + //midIndex1: array[i] <= v, array[i+1] > v + //midIndex2: array[i] >= v, array[i+1] < v + midIndex1 = rightChain->findIndexBelowGen(rightGridChain->get_v_value(gridIndex1), + rightStartIndex, + rightEndIndex); + midIndex2 = -1; //initilization + if(midIndex1 <= rightEndIndex && gridIndex1 < gridIndex2) + if(rightChain->getVertex(midIndex1)[1] >= rightGridChain->get_v_value(gridIndex2)) + { + //midIndex2 must exist: + midIndex2 = rightChain->findIndexAboveGen(rightGridChain->get_v_value(gridIndex2), + midIndex1, //midIndex1<=midIndex2 + rightEndIndex); + //find gridMidIndex1 so that either it=gridIndex1 when the gridline is + // at the same height as trim vertex midIndex1, or it is the last one + //which is strictly above midIndex1. + { + Real temp = rightChain->getVertex(midIndex1)[1]; + if(rightGridChain->get_v_value(gridIndex1) == temp) + gridMidIndex1 = gridIndex1; + else + { + gridMidIndex1 = gridIndex1; + while(rightGridChain->get_v_value(gridMidIndex1) > temp) + gridMidIndex1++; + gridMidIndex1--; + } + }//end of find gridMindIndex1 + //find gridMidIndex2 so that it is the (first one below or equal + //midIndex) last one above or equal midIndex2 + { + Real temp = rightChain->getVertex(midIndex2)[1]; + for(gridMidIndex2 = gridMidIndex1+1; gridMidIndex2 <= gridIndex2; gridMidIndex2++) + if(rightGridChain->get_v_value(gridMidIndex2) <= temp) + break; + + assert(gridMidIndex2 <= gridIndex2); + }//end of find gridMidIndex2 + } + + + + //to interprete the corner information + Real* cornerTop; + Real* cornerBot; + Int cornerRightStart; + Int cornerRightEnd; + Int cornerLeftUpEnd; + Int cornerLeftDownStart; + if(up_rightCornerWhere == 2) //right corner is on right chain + { + cornerTop = rightChain->getVertex(up_rightCornerIndex); + cornerRightStart = up_rightCornerIndex+1; + cornerLeftUpEnd = -1; //no left + } + else if(up_rightCornerWhere == 1) //right corner is on top + { + cornerTop = topVertex; + cornerRightStart = rightStartIndex; + cornerLeftUpEnd = -1; //no left + } + else //right corner is on left chain + { + cornerTop = topVertex; + cornerRightStart = rightStartIndex; + cornerLeftUpEnd = up_rightCornerIndex; + } + + if(down_rightCornerWhere == 2) //right corner is on right chan + { + cornerBot = rightChain->getVertex(down_rightCornerIndex); + cornerRightEnd = down_rightCornerIndex-1; + cornerLeftDownStart = leftEndIndex+1; //no left + } + else if (down_rightCornerWhere == 1) //right corner is at bot + { + cornerBot = botVertex; + cornerRightEnd = rightEndIndex; + cornerLeftDownStart = leftEndIndex+1; //no left + } + else //right corner is on the left chain + { + cornerBot = botVertex; + cornerRightEnd = rightEndIndex; + cornerLeftDownStart = down_rightCornerIndex; + } + + //sample + if(midIndex2 >= 0) //there is a trm point between grid lines + { + + sampleRightSingleTrimEdgeRegionGen(cornerTop, rightChain->getVertex(midIndex1), + rightChain, + cornerRightStart, + midIndex1-1, + rightGridChain, + gridIndex1, + gridMidIndex1, + leftChain, + leftStartIndex, + cornerLeftUpEnd, + 0, //no left down section, + -1, + pStream); + + sampleRightSingleTrimEdgeRegionGen(rightChain->getVertex(midIndex2), + cornerBot, + rightChain, + midIndex2+1, + cornerRightEnd, + rightGridChain, + gridMidIndex2, + gridIndex2, + leftChain, + 0, //no left up section + -1, + cornerLeftDownStart, + leftEndIndex, + pStream); + + sampleRightStripRecF(rightChain, + midIndex1, + midIndex2, + rightGridChain, + gridMidIndex1, + gridMidIndex2, + pStream); + + } + else + { + sampleRightSingleTrimEdgeRegionGen(cornerTop, cornerBot, + rightChain, + cornerRightStart, + cornerRightEnd, + rightGridChain, + gridIndex1, + gridIndex2, + leftChain, + leftStartIndex, + cornerLeftUpEnd, + cornerLeftDownStart, + leftEndIndex, + pStream); + } +} + +void sampleRightSingleTrimEdgeRegionGen(Real topVertex[2], Real botVertex[2], + vertexArray* rightChain, + Int rightStart, + Int rightEnd, + gridBoundaryChain* gridChain, + Int gridBeginIndex, + Int gridEndIndex, + vertexArray* leftChain, + Int leftUpBegin, + Int leftUpEnd, + Int leftDownBegin, + Int leftDownEnd, + primStream* pStream) +{ + Int i,k; + /*creat an array to store all the up and down secments of the left chain, + *and the right end grid points + * + *although vertex array is a dynamic array, but to gain efficiency, + *it is better to initiliza the exact array size + */ + vertexArray vArray(gridEndIndex-gridBeginIndex+1 + + max(0,leftUpEnd - leftUpBegin+1)+ + max(0,leftDownEnd - leftDownBegin+1)); + //append the vertices on the up section of the left chain + for(i=leftUpBegin; i<= leftUpEnd; i++) + vArray.appendVertex(leftChain->getVertex(i)); + + //append the vertices of the right extremal grid points, + //and at the same time, perform triangulation for the stair cases + vArray.appendVertex(gridChain->get_vertex(gridBeginIndex)); + + for(k=1, i=gridBeginIndex+1; i<= gridEndIndex; i++, k++) + { + vArray.appendVertex(gridChain->get_vertex(i)); + + //output the fan of the grid points of the (i)th and (i-1)th grid line. + gridChain->rightEndFan(i, pStream); + } + + //append all the vertices on the down section of the left chain + for(i=leftDownBegin; i<= leftDownEnd; i++) + vArray.appendVertex(leftChain->getVertex(i)); + monoTriangulationRecGen(topVertex, botVertex, + &vArray, 0, vArray.getNumElements()-1, + rightChain, rightStart, rightEnd, + pStream); +} + +void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], + gridBoundaryChain* gridChain, + Int beginIndex, + Int endIndex, + primStream* pStream) +{ + Int i,k; + vertexArray vArray(endIndex-beginIndex+1); + vArray.appendVertex(gridChain->get_vertex(beginIndex)); + for(k=1, i=beginIndex+1; i<= endIndex; i++, k++) + { + vArray.appendVertex(gridChain->get_vertex(i)); + //output the fan of the grid points of the (i)_th and i-1th gridLine + gridChain->rightEndFan(i, pStream); + } + monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, + 1, //increase chain (to the left) + pStream); +} + + +/*the gridlines from rightGridChainStartIndex to + *rightGridChainEndIndex are assumed to form a + *connected componenet + *the trm vertex of topRightIndex is assumed to be below + *or equal the first gridLine, and the trm vertex of + *botRightIndex is assumed to be above or equal the last gridline + **there could be multipe trm vertices equal to the last gridline, but + **only one could be equal to top gridline. shape: ____| (recall that + **for left chain recF, we allow shape: |---- + *if botRightIndex= topRightIndex, there is at least one triangles to + *output + */ +void sampleRightStripRecF(vertexArray* rightChain, + Int topRightIndex, + Int botRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + Int rightGridChainEndIndex, + primStream* pStream + ) +{ + + //sstop conditionL: if topRightIndex > botRightIndex, then stop + if(topRightIndex > botRightIndex) + return; + + //if there is only one grid line, return + if(rightGridChainStartIndex >= rightGridChainEndIndex) + return; + + + assert(rightChain->getVertex(topRightIndex)[1] <= rightGridChain->get_v_value(rightGridChainStartIndex) && + rightChain->getVertex(botRightIndex)[1] >= rightGridChain->get_v_value(rightGridChainEndIndex)); + + //firstfind the first trim vertex which is strictly below the second top + //grid line: index1. + Real secondGridChainV = rightGridChain->get_v_value(rightGridChainStartIndex+1); + Int index1 = topRightIndex; + while(rightChain->getVertex(index1)[1] >= secondGridChainV){ + index1++; + if(index1 > botRightIndex) + break; + } + //now rightChain->getVertex(index1-1)[1] >= secondGridChainV and + //rightChain->getVertex(index1)[1] < secondGridChainV and + //we should include index1-1 to perform a gridStep + index1--; + + //now we have rightChain->getVertex(index1)[1] >= secondGridChainV, and + //rightChain->getVertex(index1+1)[1] < secondGridChainV + sampleRightOneGridStep(rightChain, topRightIndex, index1, rightGridChain, rightGridChainStartIndex, pStream); + + //if rightChain->getVertex(index1)[1] ==secondGridChainV then we can + //recurvesively to the rest + if(rightChain->getVertex(index1)[1] == secondGridChainV) + { + + + sampleRightStripRecF(rightChain, index1, botRightIndex, rightGridChain, rightGridChainStartIndex+1, rightGridChainEndIndex, pStream); + } + else if(index1 < botRightIndex) + { + //otherwise, we have rightChain->getVertex(index1)[1] > secondV + //let the next trim vertex be nextTrimVertex, (which should be strictly + //below the second grid line). Find the last grid line index2 which is STRICTLY ABOVE + //nextTrimVertex. + //sample one trm edge region. + Real *uppervert, *lowervert; + uppervert = rightChain->getVertex(index1); + lowervert = rightChain->getVertex(index1+1); //okay since index1get_v_value(index2) > lowervert[1]) + { + index2++; + if(index2 > rightGridChainEndIndex) + break; + } + index2--; + + sampleRightSingleTrimEdgeRegion(uppervert, lowervert, rightGridChain, rightGridChainStartIndex+1, index2, pStream); + + //recursion + sampleRightStripRecF(rightChain, index1+1, botRightIndex, rightGridChain, index2, rightGridChainEndIndex, pStream); + } +} + +//the degenerate case of sampleRightOneGridStep +void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, + Int beginRightIndex, + Int endRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + primStream* pStream) +{ + /*since there is no middle, there is at most one point which is on the + *second grid line, there could be multiple points on the first (top) + *grid line. + */ + rightGridChain->rightEndFan(rightGridChainStartIndex+1, pStream); + monoTriangulation2(rightGridChain->get_vertex(rightGridChainStartIndex), + rightGridChain->get_vertex(rightGridChainStartIndex+1), + rightChain, + beginRightIndex, + endRightIndex, + 0, //decrease chain + pStream); +} + +//sampling the right area in between two grid lines +//shape: _________| +void sampleRightOneGridStep(vertexArray* rightChain, + Int beginRightIndex, + Int endRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + primStream* pStream) +{ + if(checkMiddle(rightChain, beginRightIndex, endRightIndex, + rightGridChain->get_v_value(rightGridChainStartIndex), + rightGridChain->get_v_value(rightGridChainStartIndex+1))<0) + { + sampleRightOneGridStepNoMiddle(rightChain, beginRightIndex, endRightIndex, rightGridChain, rightGridChainStartIndex, pStream); + return; + } + + //copy into a polygn + { + directedLine* poly = NULL; + sampledLine* sline; + directedLine* dline; + gridWrap* grid = rightGridChain->getGrid(); + float vert1[2]; + float vert2[2]; + Int i; + + Int innerInd = rightGridChain->getInnerIndex(rightGridChainStartIndex+1); + Int upperInd = rightGridChain->getUlineIndex(rightGridChainStartIndex); + Int lowerInd = rightGridChain->getUlineIndex(rightGridChainStartIndex+1); + Real upperV = rightGridChain->get_v_value(rightGridChainStartIndex); + Real lowerV = rightGridChain->get_v_value(rightGridChainStartIndex+1); + + //the upper gridline + vert1[1]=vert2[1]=upperV; + for(i=upperInd; + i>innerInd; + i--) + { + vert1[0]=grid->get_u_value(i); + vert2[0]=grid->get_u_value(i-1); + sline = new sampledLine(vert1, vert2); + dline = new directedLine(INCREASING, sline); + if(poly == NULL) + poly = dline; + else + poly->insert(dline); + } + + //the vertical grid line segment + vert1[0]=vert2[0] = grid->get_u_value(innerInd); + vert1[1]=upperV; + vert2[1]=lowerV; + sline=new sampledLine(vert1, vert2); + dline=new directedLine(INCREASING, sline); + if(poly == NULL) + poly = dline; + else + poly->insert(dline); + + //the lower grid line + vert1[1]=vert2[1]=lowerV; + for(i=innerInd; iget_u_value(i); + vert2[0] = grid->get_u_value(i+1); + sline = new sampledLine(vert1, vert2); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + + //the edge connecting lower grid to right chain + vert1[0]=grid->get_u_value(lowerInd); + sline = new sampledLine(vert1, rightChain->getVertex(endRightIndex)); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + + + //the right Chain + for(i=endRightIndex; i>beginRightIndex; i--) + { + sline = new sampledLine(rightChain->getVertex(i), rightChain->getVertex(i-1)); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + + //the edge connecting right chain with upper grid + vert2[1]=upperV; + vert2[0]=grid->get_u_value(upperInd); + sline = new sampledLine(rightChain->getVertex(beginRightIndex), vert2); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + monoTriangulationOpt(poly, pStream); + //clean up + poly->deleteSinglePolygonWithSline(); + + return; + } + + //this following code cannot be reached, but leave it for debuggig purpose. + Int i; + //find the maximal U-monotone chain of beginRightIndex, beginRightIndex+1,... + i=beginRightIndex; + Real prevU = rightChain->getVertex(i)[0]; + for(i=beginRightIndex+1; i<= endRightIndex; i++){ + Real thisU = rightChain->getVertex(i)[0]; + if(thisU < prevU) + prevU = thisU; + else + break; + } + //from beginRightIndex to i-1 is strictly U-monotne + //if(i-1==beginRightIndex and the vertex of rightchain is on the first + //gridline, then we should use 2 vertices on the right chain. Of we only + //use one (begin), we would output degenrate triangles. + if(i-1 == beginRightIndex && rightChain->getVertex(beginRightIndex)[1] == rightGridChain->get_v_value(rightGridChainStartIndex)) + i++; + + Int j = endRightIndex -1; + if(rightGridChain->getInnerIndex(rightGridChainStartIndex+1) < rightGridChain->getUlineIndex(rightGridChainStartIndex+1)) + { + j = rightChain->findDecreaseChainFromEnd(i-1/*beginRightIndex*/, endRightIndex); + Int temp = endRightIndex; + //now from j+1 to end is strictly U-monotone. + //if j+1 is on the last grid line, then we wat to skip to the vertex + //whcih is strictly above the second grid line. This vertex must exist + //since there is a middle vertex + if(j+1 == endRightIndex) + { + while(rightChain->getVertex(j+1)[1] == rightGridChain->get_v_value(rightGridChainStartIndex+1)) + j--; + + monoTriangulation2(rightChain->getVertex(j+1), + rightGridChain->get_vertex(rightGridChainStartIndex+1), + rightChain, + j+2, + endRightIndex, + 0, //a decrease chain + pStream); + + temp = j+1; + } + + stripOfFanRight(rightChain, temp, j+1, rightGridChain->getGrid(), + rightGridChain->getVlineIndex(rightGridChainStartIndex+1), + rightGridChain->getInnerIndex(rightGridChainStartIndex+1), + rightGridChain->getUlineIndex(rightGridChainStartIndex+1), + pStream, + 0 //the grid line is below the trim line + ); + + } + + + stripOfFanRight(rightChain, i-1, beginRightIndex, rightGridChain->getGrid(), + rightGridChain->getVlineIndex(rightGridChainStartIndex), + rightGridChain->getInnerIndex(rightGridChainStartIndex+1), + rightGridChain->getUlineIndex(rightGridChainStartIndex), + pStream, + 1 //the grid line is above the trm lines + ); + + //monotone triangulate the remaining rightchain together with the + //two vertices on the two grid v-lines + Real vert[2][2]; + vert[0][0] = vert[1][0] = rightGridChain->getInner_u_value(rightGridChainStartIndex+1); + vert[0][1] = rightGridChain->get_v_value(rightGridChainStartIndex); + vert[1][1] = rightGridChain->get_v_value(rightGridChainStartIndex+1); + + monoTriangulation2(&vert[0][0], + &vert[1][0], + rightChain, + i-1, + j+1, + 0, ///a decreae chain + pStream); +} + +#endif + +void stripOfFanRight(vertexArray* rightChain, + Int largeIndex, + Int smallIndex, + gridWrap* grid, + Int vlineIndex, + Int ulineSmallIndex, + Int ulineLargeIndex, + primStream* pStream, + Int gridLineUp /*1 if the grid line is above the trim lines*/ + ) +{ + assert(largeIndex >= smallIndex); + + Real grid_v_value; + grid_v_value = grid->get_v_value(vlineIndex); + + Real2* trimVerts=(Real2*) malloc(sizeof(Real2)* (largeIndex-smallIndex+1)); + assert(trimVerts); + + + Real2* gridVerts=(Real2*) malloc(sizeof(Real2)* (ulineLargeIndex-ulineSmallIndex+1)); + assert(gridVerts); + + Int k,i; + if(! gridLineUp) /*trim line is above grid line, so trim vertices are going right when index increases*/ + for(k=0, i=smallIndex; i<=largeIndex; i++, k++) + { + trimVerts[k][0] = rightChain->getVertex(i)[0]; + trimVerts[k][1] = rightChain->getVertex(i)[1]; + } + else + for(k=0, i=largeIndex; i>=smallIndex; i--, k++) + { + trimVerts[k][0] = rightChain->getVertex(i)[0]; + trimVerts[k][1] = rightChain->getVertex(i)[1]; + } + + for(k=0, i=ulineSmallIndex; i<= ulineLargeIndex; i++, k++) + { + gridVerts[k][0] = grid->get_u_value(i); + gridVerts[k][1] = grid_v_value; + } + + if(gridLineUp) + triangulateXYMono( + ulineLargeIndex-ulineSmallIndex+1, gridVerts, + largeIndex-smallIndex+1, trimVerts, + pStream); + else + triangulateXYMono(largeIndex-smallIndex+1, trimVerts, + ulineLargeIndex-ulineSmallIndex+1, gridVerts, + pStream); + free(trimVerts); + free(gridVerts); +} + + + + + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,117 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SAMPLECOMPRIGHT_H +#define _SAMPLECOMPRIGHT_H + +#define NOT_TAKEOUT + +#include "sampleMonoPoly.h" +void stripOfFanRight(vertexArray* rightChain, + Int largeIndex, + Int smallIndex, + gridWrap* grid, + Int vlineIndex, + Int ulineSmallIndex, + Int ulineLargeIndex, + primStream* pStream, + Int gridLineUp /*1 if grid line is above the trim lines */ + ); + +#ifdef NOT_TAKEOUT +void sampleRightStripRecF(vertexArray* rightChain, + Int topRightIndex, + Int botRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + Int rightGridChainEndIndex, + primStream* pStream + ); +//the degenerate case of sampleRightOneGridStep +void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, + Int beginRightIndex, + Int endRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + primStream* pStream); +//sampling the right area in between two grid lines +//shape: _________| +void sampleRightOneGridStep(vertexArray* rightChain, + Int beginRightIndex, + Int endRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + primStream* pStream); +void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], + gridBoundaryChain* gridChain, + Int beginIndex, + Int endIndex, + primStream* pStream); +//the degenerate case of sampleRightOneGridStep +void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, + Int beginRightIndex, + Int endRightIndex, + gridBoundaryChain* rightGridChain, + Int rightGridChainStartIndex, + primStream* pStream); + +void sampleCompRight(Real* topVertex, Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, Int leftEndIndex, + vertexArray* rightChain, + Int rightStartIndex, Int rightEndIndex, + gridBoundaryChain* rightGridChain, + Int gridIndex1, Int gridIndex2, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int down_leftCornerWhere, + Int down_leftCornerIndex, + primStream* pStream); + +void sampleRightSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], + vertexArray* rightChain, + Int rightStart, + Int rightEnd, + gridBoundaryChain* gridChain, + Int gridBegindex, + Int gridEndIndex, + vertexArray* leftChain, + Int leftUpBegin, + Int leftUpEnd, + Int leftDownBegin, + Int leftDownEnd, + primStream* pStream); +#endif + +#endif + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1030 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include +#include "zlassert.h" +#include "sampleCompTop.h" +#include "sampleCompRight.h" + +#define max(a,b) ((a>b)? a:b) + +//return : index_small, and index_large, +//from [small, large] is strictly U-monotne, +//from [large+1, end] is = u +//if eveybody is = leftStart; i--) + { + if(leftChain->getVertex(i)[0] >= u) + break; + } + ret_index_large = i; + if(ret_index_large >= leftStart) + { + for(i=ret_index_large; i>leftStart; i--) + { + if(leftChain->getVertex(i-1)[0] <= leftChain->getVertex(i)[0]) + break; + } + ret_index_small = i; + } +} + +void findTopRightSegment(vertexArray* rightChain, + Int rightStart, + Int rightEnd, + Real u, + Int& ret_index_small, + Int& ret_index_large) +{ + Int i; + assert(rightStart<=rightEnd); + for(i=rightEnd; i>=rightStart; i--) + { + if(rightChain->getVertex(i)[0] <= u) + break; + } + ret_index_large = i; + if(ret_index_large >= rightStart) + { + for(i=ret_index_large; i>rightStart;i--) + { + if(rightChain->getVertex(i-1)[0] >= rightChain->getVertex(i)[0]) + break; + } + ret_index_small = i; + } +} + + +void sampleTopRightWithGridLinePost(Real* topVertex, + vertexArray* rightChain, + Int rightStart, + Int segIndexSmall, + Int segIndexLarge, + Int rightEnd, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream) +{ + //the possible section which is to the right of rightU + if(segIndexLarge < rightEnd) + { + Real *tempTop; + if(segIndexLarge >= rightStart) + tempTop = rightChain->getVertex(segIndexLarge); + else + tempTop = topVertex; + Real tempBot[2]; + tempBot[0] = grid->get_u_value(rightU); + tempBot[1] = grid->get_v_value(gridV); +monoTriangulationRecGenOpt(tempTop, tempBot, + NULL, 1,0, + rightChain, segIndexLarge+1, rightEnd, + pStream); +/* + monoTriangulation2(tempTop, tempBot, + rightChain, + segIndexLarge+1, + rightEnd, + 0, //a decrease chian + pStream); +*/ + + } + + //the possible section which is strictly Umonotone + if(segIndexLarge >= rightStart) + { + stripOfFanRight(rightChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, rightU, pStream, 0); + Real tempBot[2]; + tempBot[0] = grid->get_u_value(leftU); + tempBot[1] = grid->get_v_value(gridV); + monoTriangulation2(topVertex, tempBot, rightChain, rightStart, segIndexSmall, 0, pStream); + } + else //the topVertex forms a fan with the grid points + grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); +} + +void sampleTopRightWithGridLine(Real* topVertex, + vertexArray* rightChain, + Int rightStart, + Int rightEnd, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream + ) +{ + //if right chian is empty, then there is only one topVertex with one grid line + if(rightEnd < rightStart){ + grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); + return; + } + + Int segIndexSmall, segIndexLarge; + findTopRightSegment(rightChain, + rightStart, + rightEnd, + grid->get_u_value(rightU), + segIndexSmall, + segIndexLarge + ); + sampleTopRightWithGridLinePost(topVertex, rightChain, + rightStart, + segIndexSmall, + segIndexLarge, + rightEnd, + grid, + gridV, + leftU, + rightU, + pStream); +} + + +void sampleTopLeftWithGridLinePost(Real* topVertex, + vertexArray* leftChain, + Int leftStart, + Int segIndexSmall, + Int segIndexLarge, + Int leftEnd, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream) +{ + //the possible section which is to the left of leftU + + if(segIndexLarge < leftEnd) + { + Real *tempTop; + if(segIndexLarge >= leftStart) + tempTop = leftChain->getVertex(segIndexLarge); + else + tempTop = topVertex; + Real tempBot[2]; + tempBot[0] = grid->get_u_value(leftU); + tempBot[1] = grid->get_v_value(gridV); + + monoTriangulation2(tempTop, tempBot, + leftChain, + segIndexLarge+1, + leftEnd, + 1, //a increase chian + pStream); + } + + //the possible section which is strictly Umonotone + if(segIndexLarge >= leftStart) + { + //if there are grid points which are to the right of topV, + //then we should use topVertex to form a fan with these points to + //optimize the triangualtion + int do_optimize=1; + if(topVertex[0] >= grid->get_u_value(rightU)) + do_optimize = 0; + else + { + //we also have to make sure that topVertex are the right most vertex + //on the chain. + int i; + for(i=leftStart; i<=segIndexSmall; i++) + if(leftChain->getVertex(i)[0] >= topVertex[0]) + { + do_optimize = 0; + break; + } + } + + if(do_optimize) + { + //find midU so that grid->get_u_value(midU) >= topVertex[0] + //and grid->get_u_value(midU-1) < topVertex[0] + int midU=rightU; + while(grid->get_u_value(midU) >= topVertex[0]) + { + midU--; + if(midU < leftU) + break; + } + midU++; + + grid->outputFanWithPoint(gridV, midU, rightU, topVertex, pStream); + stripOfFanLeft(leftChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, midU, pStream, 0); + Real tempBot[2]; + tempBot[0] = grid->get_u_value(midU); + tempBot[1] = grid->get_v_value(gridV); + monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream); + } + else //not optimize + { + + stripOfFanLeft(leftChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, rightU, pStream, 0); + Real tempBot[2]; + tempBot[0] = grid->get_u_value(rightU); + tempBot[1] = grid->get_v_value(gridV); + monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream); + } + } + else //the topVertex forms a fan with the grid points + grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); +} + + +void sampleTopLeftWithGridLine(Real* topVertex, + vertexArray* leftChain, + Int leftStart, + Int leftEnd, + gridWrap* grid, + Int gridV, + Int leftU, + Int rightU, + primStream* pStream + ) +{ + Int segIndexSmall, segIndexLarge; + //if left chain is empty, then there is only one top vertex with one grid + // line + if(leftEnd < leftStart) { + grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); + return; + } + findTopLeftSegment(leftChain, + leftStart, + leftEnd, + grid->get_u_value(leftU), + segIndexSmall, + segIndexLarge + ); + sampleTopLeftWithGridLinePost(topVertex, + leftChain, + leftStart, + segIndexSmall, + segIndexLarge, + leftEnd, + grid, + gridV, + leftU, + rightU, + pStream); +} + + +//return 1 if saprator exits, 0 otherwise +Int findTopSeparator(vertexArray* leftChain, + Int leftStartIndex, + Int leftEndIndex, + vertexArray* rightChain, + Int rightStartIndex, + Int rightEndIndex, + Int& ret_sep_left, + Int& ret_sep_right) +{ + + Int oldLeftI, oldRightI, newLeftI, newRightI; + Int i,j,k; + Real leftMax /*= leftChain->getVertex(leftEndIndex)[0]*/; + Real rightMin /*= rightChain->getVertex(rightEndIndex)[0]*/; + if(leftChain->getVertex(leftEndIndex)[1] > rightChain->getVertex(rightEndIndex)[1]) //left higher + { + oldLeftI = leftEndIndex+1; + oldRightI = rightEndIndex; + leftMax = leftChain->getVertex(leftEndIndex)[0] - Real(1.0); //initilza to left of leftU + rightMin = rightChain->getVertex(rightEndIndex)[0]; + } + else + { + oldLeftI = leftEndIndex; + oldRightI = rightEndIndex+1; + leftMax = leftChain->getVertex(leftEndIndex)[0]; + rightMin = rightChain->getVertex(rightEndIndex)[0] + Real(1.0); + } + + //i: the current working leftChain index, + //j: the current working rightChain index, + //if left(i) is higher than right(j), then the two chains beloew right(j) are separated. + //else the two chains below left(i) are separeated. + i=leftEndIndex; + j=rightEndIndex; + while(1) + { + newLeftI = oldLeftI; + newRightI = oldRightI; + + if(i= rightStartIndex; k--) + { + if(rightChain->getVertex(k)[0] > leftMax) //no conflict + { + //update oldRightI if necessary + if(rightChain->getVertex(k)[0] < rightMin) + { + rightMin = rightChain->getVertex(k)[0]; + oldRightI = k; + } + } + else //there is a conflict + break; //the for-loop. below right(k-1) is seperated: oldLeftI, oldRightI. + } + break; //the while loop + } + else if(j= leftStartIndex; k--) + { + if(leftChain->getVertex(k)[0] < rightMin) //no conflict + { + //update oldLeftI if necessary + if(leftChain->getVertex(k)[0] > leftMax) + { + leftMax = leftChain->getVertex(k)[0]; + oldLeftI = k; + } + } + else //there is a conflict + break; //the for loop + } + break; //the while loop + } + else if(leftChain->getVertex(i)[1] > rightChain->getVertex(j)[1]) //left hgiher + { + if(leftChain->getVertex(i)[0] > leftMax) //update leftMax and newLeftI. + { + leftMax = leftChain->getVertex(i)[0]; + newLeftI = i; + } + for(k=j-1; k>= rightStartIndex; k--) //update rightMin and newRightI. + { + if(rightChain->getVertex(k)[1] > leftChain->getVertex(i)[1]) + break; + if(rightChain->getVertex(k)[0] < rightMin) + { + rightMin = rightChain->getVertex(k)[0]; + newRightI = k; + } + } + j = k; //next working j, since j will be higher than i in next loop + if(leftMax >= rightMin) //there is a conflict + break; + else //still no conflict + { + oldLeftI = newLeftI; + oldRightI = newRightI; + } + } + else //right higher + { + if(rightChain->getVertex(j)[0] < rightMin) + { + rightMin = rightChain->getVertex(j)[0]; + newRightI = j; + } + for(k=i-1; k>= leftStartIndex; k--) + { + if(leftChain->getVertex(k)[1] > rightChain->getVertex(j)[1]) + break; + if(leftChain->getVertex(k)[0] > leftMax) + { + leftMax = leftChain->getVertex(k)[0]; + newLeftI = k; + } + } + i = k; //next working i, since i will be higher than j next loop + + if(leftMax >= rightMin) //there is a conflict + break; + else //still no conflict + { + oldLeftI = newLeftI; + oldRightI = newRightI; + } + } + }//end of while loop + //now oldLeftI and oldRightI are the desired separeator index, notice that there are not necessarily valid + if(oldLeftI > leftEndIndex || oldRightI > rightEndIndex) + return 0; + else + { + ret_sep_left = oldLeftI; + ret_sep_right = oldRightI; + return 1; + } +} + + +void sampleCompTop(Real* topVertex, + vertexArray* leftChain, + Int leftStartIndex, + vertexArray* rightChain, + Int rightStartIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + primStream* pStream) +{ + if(up_leftCornerWhere == 1 && up_rightCornerWhere == 1) //the top is topVertex with possible grid points + { + leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex1), + leftGridChain->getUlineIndex(gridIndex1), + rightGridChain->getUlineIndex(gridIndex1), + topVertex, + pStream); + return; + } + + else if(up_leftCornerWhere != 0) + { + Real* tempTop; + Int tempRightStart; + if(up_leftCornerWhere == 1){ + tempRightStart = rightStartIndex; + tempTop = topVertex; + } + else + { + tempRightStart = up_leftCornerIndex+1; + tempTop = rightChain->getVertex(up_leftCornerIndex); + } + sampleTopRightWithGridLine(tempTop, rightChain, tempRightStart, up_rightCornerIndex, + rightGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex1), + leftGridChain->getUlineIndex(gridIndex1), + rightGridChain->getUlineIndex(gridIndex1), + pStream); + } + else if(up_rightCornerWhere != 2) + { + Real* tempTop; + Int tempLeftStart; + if(up_rightCornerWhere == 1) + { + tempLeftStart = leftStartIndex; + tempTop = topVertex; + } + else //0 + { + tempLeftStart = up_rightCornerIndex+1; + tempTop = leftChain->getVertex(up_rightCornerIndex); + } +/* + sampleTopLeftWithGridLine(tempTop, leftChain, tempLeftStart, up_leftCornerIndex, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex1), + leftGridChain->getUlineIndex(gridIndex1), + rightGridChain->getUlineIndex(gridIndex1), + pStream); +*/ + sampleCompTopSimple(topVertex, + leftChain, + leftStartIndex, + rightChain, + rightStartIndex, + leftGridChain, + rightGridChain, + gridIndex1, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + pStream); + } + else //up_leftCornerWhere == 0, up_rightCornerWhere == 2. + { + sampleCompTopSimple(topVertex, + leftChain, + leftStartIndex, + rightChain, + rightStartIndex, + leftGridChain, + rightGridChain, + gridIndex1, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + pStream); + return; +#ifdef NOT_REACHABLE //code is not reachable, for test purpose only + //the following code is trying to do some optimization, but not quite working, also see sampleCompBot.C: + Int sep_left, sep_right; + if(findTopSeparator(leftChain, + leftStartIndex, + up_leftCornerIndex, + rightChain, + rightStartIndex, + up_rightCornerIndex, + sep_left, + sep_right) + ) //separator exists + { + + if( leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1) && + rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1)) + { + Int gridSep; + Int segLeftSmall, segLeftLarge, segRightSmall, segRightLarge; + Int valid=1; //whether the gridStep is valid or not. + findTopLeftSegment(leftChain, + sep_left, + up_leftCornerIndex, + leftGridChain->get_u_value(gridIndex1), + segLeftSmall, + segLeftLarge); + findTopRightSegment(rightChain, + sep_right, + up_rightCornerIndex, + rightGridChain->get_u_value(gridIndex1), + segRightSmall, + segRightLarge); + if(leftChain->getVertex(segLeftSmall)[1] >= rightChain->getVertex(segRightSmall)[1]) + { + gridSep = rightGridChain->getUlineIndex(gridIndex1); + while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftSmall)[0]) + gridSep--; + if(segLeftSmallgetGrid()->get_u_value(gridSep) < leftChain->getVertex(segLeftSmall+1)[0]) + { + valid = 0; + } + } + else + { + gridSep = leftGridChain->getUlineIndex(gridIndex1); + while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightSmall)[0]) + gridSep++; + if(segRightSmallgetGrid()->get_u_value(gridSep) > rightChain->getVertex(segRightSmall+1)[0]) + { + valid = 0; + } + } + + if(! valid) + { + sampleCompTopSimple(topVertex, + leftChain, + leftStartIndex, + rightChain, + rightStartIndex, + leftGridChain, + rightGridChain, + gridIndex1, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + pStream); + } + else + { + sampleTopLeftWithGridLinePost(leftChain->getVertex(segLeftSmall), + leftChain, + segLeftSmall+1, + segLeftSmall+1, + segLeftLarge, + up_leftCornerIndex, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex1), + leftGridChain->getUlineIndex(gridIndex1), + gridSep, + pStream); + sampleTopRightWithGridLinePost(rightChain->getVertex(segRightSmall), + rightChain, + segRightSmall+1, + segRightSmall+1, + segRightLarge, + up_rightCornerIndex, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex1), + gridSep, + rightGridChain->getUlineIndex(gridIndex1), + pStream); + Real tempBot[2]; + tempBot[0] = leftGridChain->getGrid()->get_u_value(gridSep); + tempBot[1] = leftGridChain->get_v_value(gridIndex1); + monoTriangulationRecGen(topVertex, tempBot, + leftChain, leftStartIndex, segLeftSmall, + rightChain, rightStartIndex, segRightSmall, + pStream); + } + }//end if both sides have vetices inside the gridboundary points + else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1)) //left is in, right is nout + { + + Int segLeftSmall, segLeftLarge; + findTopLeftSegment(leftChain, + sep_left, + up_leftCornerIndex, + leftGridChain->get_u_value(gridIndex1), + segLeftSmall, + segLeftLarge); + assert(segLeftLarge >= sep_left); + monoTriangulation2(leftChain->getVertex(segLeftLarge), + leftGridChain->get_vertex(gridIndex1), + leftChain, + segLeftLarge+1, + up_leftCornerIndex, + 1, //a increase chain, + pStream); + + stripOfFanLeft(leftChain, segLeftLarge, segLeftSmall, + leftGridChain->getGrid(), + leftGridChain->getVlineIndex(gridIndex1), + leftGridChain->getUlineIndex(gridIndex1), + rightGridChain->getUlineIndex(gridIndex1), + pStream, 0); + + + monoTriangulationRecGen(topVertex, rightGridChain->get_vertex(gridIndex1), + leftChain, leftStartIndex, segLeftSmall, + rightChain, rightStartIndex, up_rightCornerIndex, + pStream); + }//end left in right out + else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1)) + { + Int segRightSmall, segRightLarge; + findTopRightSegment(rightChain, + sep_right, + up_rightCornerIndex, + rightGridChain->get_u_value(gridIndex1), + segRightSmall, + segRightLarge); + assert(segRightLarge>=sep_right); + monoTriangulation2(rightChain->getVertex(segRightLarge), + rightGridChain->get_vertex(gridIndex1), + rightChain, + segRightLarge+1, + up_rightCornerIndex, + 0, //a decrease chain + pStream); + stripOfFanRight(rightChain, segRightLarge, segRightSmall, + rightGridChain->getGrid(), + rightGridChain->getVlineIndex(gridIndex1), + leftGridChain->getUlineIndex(gridIndex1), + rightGridChain->getUlineIndex(gridIndex1), + pStream, 0); + + + monoTriangulationRecGen(topVertex, leftGridChain->get_vertex(gridIndex1), + leftChain, leftStartIndex, up_leftCornerIndex, + rightChain, rightStartIndex,segRightSmall, + pStream); + + }//end left out rigth in + else //left out , right out + { + + sampleCompTopSimple(topVertex, + leftChain, + leftStartIndex, + rightChain, + rightStartIndex, + leftGridChain, + rightGridChain, + gridIndex1, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + pStream); + }//end leftout, right out + }//end if separator exixts. + else //no separator + { + + sampleCompTopSimple(topVertex, + leftChain, + leftStartIndex, + rightChain, + rightStartIndex, + leftGridChain, + rightGridChain, + gridIndex1, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + pStream); + } +#endif + }//end if 0,2 +}//end if the function + + +static void sampleCompTopSimpleOpt(gridWrap* grid, + Int gridV, + Real* topVertex, Real* botVertex, + vertexArray* inc_chain, Int inc_current, Int inc_end, + vertexArray* dec_chain, Int dec_current, Int dec_end, + primStream* pStream) +{ + if(gridV <= 0 || dec_endget_v_value(gridV+1) >= topVertex[1]) + { + monoTriangulationRecGenOpt(topVertex, botVertex, + inc_chain, inc_current, inc_end, + dec_chain, dec_current, dec_end, + pStream); + return; + } + Int i,j,k; + Real currentV = grid->get_v_value(gridV+1); + if(inc_chain->getVertex(inc_end)[1] <= currentV && + dec_chain->getVertex(dec_end)[1] < currentV) + { + //find i bottom up so that inc_chain[i]<= curentV and inc_chain[i-1] > currentV, + //find j botom up so that dec_chain[j] < currentV and dec_chain[j-1] >= currentV + for(i=inc_end; i >= inc_current; i--) + { + if(inc_chain->getVertex(i)[1] > currentV) + break; + } + i++; + for(j=dec_end; j >= dec_current; j--) + { + if(dec_chain->getVertex(j)[1] >= currentV) + break; + } + j++; + if(inc_chain->getVertex(i)[1] <= dec_chain->getVertex(j)[1]) + { + //find the k so that dec_chain[k][1] < inc_chain[i][1] + for(k=j; k<=dec_end; k++) + { + if(dec_chain->getVertex(k)[1] < inc_chain->getVertex(i)[1]) + break; + } + //we know that dec_chain[j][1] >= inc_chian[i][1] + //we know that dec_chain[k-1][1]>=inc_chain[i][1] + //we know that dec_chian[k][1] < inc_chain[i][1] + //find l in [j, k-1] so that dec_chain[l][0] 0 is closest to + // inc_chain[i] + int l; + Real tempI = Real(j); + Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]); + for(l=j+1; l<= k-1; l++) + { + if(fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]) + <= tempMin) + { + tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]); + tempI = (Real)l; + } + } + //inc_chain[i] and dec_chain[tempI] are connected. + monoTriangulationRecGenOpt(dec_chain->getVertex((int)tempI), + botVertex, + inc_chain, i, inc_end, + dec_chain, (int)(tempI+1), dec_end, + pStream); + //recursively do the rest + sampleCompTopSimpleOpt(grid, + gridV+1, + topVertex, inc_chain->getVertex(i), + inc_chain, inc_current, i-1, + dec_chain, dec_current, (int)tempI, + pStream); + } + else + { + //find the k so that inc_chain[k][1] <= dec_chain[j][1] + for(k=i; k<=inc_end; k++) + { + if(inc_chain->getVertex(k)[1] <= dec_chain->getVertex(j)[1]) + break; + } + //we know that inc_chain[i] > dec_chain[j] + //we know that inc_chain[k-1][1] > dec_chain[j][1] + //we know that inc_chain[k][1] <= dec_chain[j][1] + //so we find l between [i,k-1] so that + //inc_chain[l][0] is the closet to dec_chain[j][0] + int tempI = i; + int l; + Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]); + for(l=i+1; l<=k-1; l++) + { + if(fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]) <= tempMin) + { + tempMin = (Real)fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]); + tempI = l; + } + } + + //inc_chain[tempI] and dec_chain[j] are connected + + monoTriangulationRecGenOpt(inc_chain->getVertex(tempI), + botVertex, + inc_chain, tempI+1, inc_end, + dec_chain, j, dec_end, + pStream); + + //recurvesily do the rest + sampleCompTopSimpleOpt(grid, gridV+1, + topVertex, dec_chain->getVertex(j), + inc_chain, inc_current, tempI, + dec_chain, dec_current, j-1, + pStream); + } + } + else //go to the next higher gridV + { + sampleCompTopSimpleOpt(grid, + gridV+1, + topVertex, botVertex, + inc_chain, inc_current, inc_end, + dec_chain, dec_current, dec_end, + pStream); + } +} + +void sampleCompTopSimple(Real* topVertex, + vertexArray* leftChain, + Int leftStartIndex, + vertexArray* rightChain, + Int rightStartIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + primStream* pStream) +{ + //the plan is to use monotriangulation algortihm. + Int i,k; + Real* ActualTop; + Real* ActualBot; + Int ActualLeftStart, ActualLeftEnd; + Int ActualRightStart, ActualRightEnd; + + //creat an array to store the points on the grid line + gridWrap* grid = leftGridChain->getGrid(); + Int gridV = leftGridChain->getVlineIndex(gridIndex1); + Int gridLeftU = leftGridChain->getUlineIndex(gridIndex1); + Int gridRightU = rightGridChain->getUlineIndex(gridIndex1); + + Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1)); + assert(gridPoints); + + for(k=0, i=gridRightU; i>= gridLeftU; i--, k++) + { + gridPoints[k][0] = grid->get_u_value(i); + gridPoints[k][1] = grid->get_v_value(gridV); + } + + if(up_leftCornerWhere != 2) + ActualRightStart = rightStartIndex; + else + ActualRightStart = up_leftCornerIndex+1; //up_leftCornerIndex will be the ActualTop + + if(up_rightCornerWhere != 2) //right corner is not on right chain + ActualRightEnd = rightStartIndex-1; //meaning that there is no actual rigth section + else + ActualRightEnd = up_rightCornerIndex; + + vertexArray ActualRightChain(max(0, ActualRightEnd-ActualRightStart+1) + gridRightU-gridLeftU+1); + + for(i=ActualRightStart; i<= ActualRightEnd; i++) + ActualRightChain.appendVertex(rightChain->getVertex(i)); + for(i=0; igetVertex(up_rightCornerIndex); + else + ActualTop = topVertex; + } + else if(up_leftCornerWhere == 1) + ActualTop = topVertex; + else //up_leftCornerWhere == 2 + ActualTop = rightChain->getVertex(up_leftCornerIndex); + + ActualBot = gridPoints[gridRightU - gridLeftU]; + + + + + if(leftChain->getVertex(ActualLeftEnd)[1] == ActualBot[1]) + { +/* + monoTriangulationRecGenOpt(ActualTop, leftChain->getVertex(ActualLeftEnd), + leftChain, + ActualLeftStart, ActualLeftEnd-1, + &ActualRightChain, + 0, + ActualRightChain.getNumElements()-1, + pStream); +*/ + + sampleCompTopSimpleOpt(grid, gridV, + ActualTop, leftChain->getVertex(ActualLeftEnd), + leftChain, + ActualLeftStart, ActualLeftEnd-1, + &ActualRightChain, + 0, + ActualRightChain.getNumElements()-1, + pStream); + + } + else + { +/* + monoTriangulationRecGenOpt(ActualTop, ActualBot, leftChain, + ActualLeftStart, ActualLeftEnd, + &ActualRightChain, + 0, ActualRightChain.getNumElements()-2, //the last is the bot. + pStream); +*/ + + sampleCompTopSimpleOpt(grid, gridV, + ActualTop, ActualBot, leftChain, + ActualLeftStart, ActualLeftEnd, + &ActualRightChain, + 0, ActualRightChain.getNumElements()-2, //the last is the bot. + pStream); + + + } + + free(gridPoints); + +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,67 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SAMPLECOMPTOP_H +#define _SAMPLECOMPTOP_H + +#include "sampleMonoPoly.h" + +void sampleCompTop(Real* topVertex, + vertexArray* leftChain, + Int leftStartIndex, + vertexArray* rightChain, + Int rightStartIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + primStream* pStream); + +void sampleCompTopSimple(Real* topVertex, + vertexArray* leftChain, + Int leftStartIndex, + vertexArray* rightChain, + Int rightStartIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, + Int up_leftCornerWhere, + Int up_leftCornerIndex, + Int up_rightCornerWhere, + Int up_rightCornerIndex, + primStream* pStream); + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,179 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include //for fabs() +#include "glimports.h" +#include "zlassert.h" +#include "sampledLine.h" + +void sampledLine::setPoint(Int i, Real p[2]) +{ + points[i][0]=p[0]; + points[i][1]=p[1]; +} + + +/*insert this single line in front of the oldList*/ +sampledLine* sampledLine::insert(sampledLine *oldList) +{ + next = oldList; + return this; +} + +void sampledLine::deleteList() +{ + sampledLine *temp, *tempNext; + for(temp = this; temp != NULL; temp = tempNext) + { + tempNext = temp->next; + delete temp; + } +} + + +/*space of points[][2] is allocated*/ +sampledLine::sampledLine(Int n_points) +{ + npoints = n_points; + points = (Real2*) malloc(sizeof(Real2) * n_points); + assert(points); + next = NULL; +} + +/*space of points[][2] is allocated and + *points are copied + */ +sampledLine::sampledLine(Int n_points, Real2 pts[]) +{ + int i; + npoints = n_points; + points = (Real2*) malloc(sizeof(Real2) * n_points); + assert(points); + for(i=0; i nv) n = nu; + else + n = nv; + if(n<1) + n = 1; + //du dv could be negative + Real du = (points[npoints-1][0] - points[0][0])/n; + Real dv = (points[npoints-1][1] - points[0][1])/n; + Real2 *temp = (Real2*) malloc(sizeof(Real2) * (n+1)); + assert(temp); + + Real u,v; + for(i=0, u=points[0][0], v=points[0][1]; inext) + { + temp->tessellate(u_reso, v_reso); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,71 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SAMPLEDLINE_H +#define _SAMPLEDLINE_H + +#include "definitions.h" + +class sampledLine{ + Int npoints; + Real2 *points; + +public: + sampledLine(Int n_points); + sampledLine(Int n_points, Real pts[][2]); + sampledLine(Real pt1[2], Real pt2[2]); + sampledLine(); //special, careful about memory + ~sampledLine(); + + void init(Int n_points, Real2 *pts);//special, careful about memory + + void setPoint(Int i, Real p[2]) ; + + sampledLine* insert(sampledLine *nline); + void deleteList(); + + Int get_npoints() {return npoints;} + Real2* get_points() {return points;} + + //u_reso is number of segments (may not be integer) per unit u + void tessellate(Real u_reso, Real v_reso);//n segments + void tessellateAll(Real u_reso, Real v_reso); + + void print(); + + sampledLine* next; +}; + + + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2427 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include "gluos.h" +#include +#include +#include + +#ifndef max +#define max(a,b) ((a>b)? a:b) +#endif +#ifndef min +#define min(a,b) ((a>b)? b:a) +#endif + +#include + +#include "glimports.h" +#include "zlassert.h" +#include "sampleMonoPoly.h" +#include "sampleComp.h" +#include "polyDBG.h" +#include "partitionX.h" + + +#define ZERO 0.00001 + +//#define MYDEBUG + +//#define SHORTEN_GRID_LINE +//see work/newtess/internal/test/problems + + +/*split a polygon so that each vertex correcpond to one edge + *the head of the first edge of the returned plygon must be the head of the first + *edge of the origianl polygon. This is crucial for the code in sampleMonoPoly function + */ + directedLine* polygonConvert(directedLine* polygon) +{ + int i; + directedLine* ret; + sampledLine* sline; + sline = new sampledLine(2); + sline->setPoint(0, polygon->getVertex(0)); + sline->setPoint(1, polygon->getVertex(1)); + ret=new directedLine(INCREASING, sline); + for(i=1; i<= polygon->get_npoints()-2; i++) + { + sline = new sampledLine(2); + sline->setPoint(0, polygon->getVertex(i)); + sline->setPoint(1, polygon->getVertex(i+1)); + ret->insert(new directedLine(INCREASING, sline)); + } + + for(directedLine *temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) + { + for(i=0; i<= temp->get_npoints()-2; i++) + { + sline = new sampledLine(2); + sline->setPoint(0, temp->getVertex(i)); + sline->setPoint(1, temp->getVertex(i+1)); + ret->insert(new directedLine(INCREASING, sline)); + } + } + return ret; +} + +void triangulateConvexPolyVertical(directedLine* topV, directedLine* botV, primStream *pStream) +{ + Int i,j; + Int n_leftVerts; + Int n_rightVerts; + Real** leftVerts; + Real** rightVerts; + directedLine* tempV; + n_leftVerts = 0; + for(tempV = topV; tempV != botV; tempV = tempV->getNext()) + { + n_leftVerts += tempV->get_npoints(); + } + n_rightVerts=0; + for(tempV = botV; tempV != topV; tempV = tempV->getNext()) + { + n_rightVerts += tempV->get_npoints(); + } + + Real2* temp_leftVerts = (Real2 *) malloc(sizeof(Real2) * n_leftVerts); + assert(temp_leftVerts); + Real2* temp_rightVerts = (Real2 *) malloc(sizeof(Real2) * n_rightVerts); + assert(temp_rightVerts); + + leftVerts = (Real**) malloc(sizeof(Real2*) * n_leftVerts); + assert(leftVerts); + rightVerts = (Real**) malloc(sizeof(Real2*) * n_rightVerts); + assert(rightVerts); + for(i=0; igetNext()) + { + for(j=1; jget_npoints(); j++) + { + leftVerts[i][0] = tempV->getVertex(j)[0]; + leftVerts[i][1] = tempV->getVertex(j)[1]; + i++; + } + } + n_leftVerts = i; + i=0; + for(tempV = topV->getPrev(); tempV != botV->getPrev(); tempV = tempV->getPrev()) + { + for(j=tempV->get_npoints()-1; j>=1; j--) + { + rightVerts[i][0] = tempV->getVertex(j)[0]; + rightVerts[i][1] = tempV->getVertex(j)[1]; + i++; + } + } + n_rightVerts = i; + triangulateXYMonoTB(n_leftVerts, leftVerts, n_rightVerts, rightVerts, pStream); + free(leftVerts); + free(rightVerts); + free(temp_leftVerts); + free(temp_rightVerts); +} + +void triangulateConvexPolyHoriz(directedLine* leftV, directedLine* rightV, primStream *pStream) +{ + Int i,j; + Int n_lowerVerts; + Int n_upperVerts; + Real2 *lowerVerts; + Real2 *upperVerts; + directedLine* tempV; + n_lowerVerts=0; + for(tempV = leftV; tempV != rightV; tempV = tempV->getNext()) + { + n_lowerVerts += tempV->get_npoints(); + } + n_upperVerts=0; + for(tempV = rightV; tempV != leftV; tempV = tempV->getNext()) + { + n_upperVerts += tempV->get_npoints(); + } + lowerVerts = (Real2 *) malloc(sizeof(Real2) * n_lowerVerts); + assert(n_lowerVerts); + upperVerts = (Real2 *) malloc(sizeof(Real2) * n_upperVerts); + assert(n_upperVerts); + i=0; + for(tempV = leftV; tempV != rightV; tempV = tempV->getNext()) + { + for(j=0; jget_npoints(); j++) + { + lowerVerts[i][0] = tempV->getVertex(j)[0]; + lowerVerts[i][1] = tempV->getVertex(j)[1]; + i++; + } + } + i=0; + for(tempV = leftV->getPrev(); tempV != rightV->getPrev(); tempV = tempV->getPrev()) + { + for(j=tempV->get_npoints()-1; j>=0; j--) + { + upperVerts[i][0] = tempV->getVertex(j)[0]; + upperVerts[i][1] = tempV->getVertex(j)[1]; + i++; + } + } + triangulateXYMono(n_upperVerts, upperVerts, n_lowerVerts, lowerVerts, pStream); + free(lowerVerts); + free(upperVerts); +} +void triangulateConvexPoly(directedLine* polygon, Int ulinear, Int vlinear, primStream* pStream) +{ + /*find left, right, top , bot + */ + directedLine* tempV; + directedLine* topV; + directedLine* botV; + directedLine* leftV; + directedLine* rightV; + topV = botV = polygon; + + for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) + { + if(compV2InY(topV->head(), tempV->head())<0) { + + topV = tempV; + } + if(compV2InY(botV->head(), tempV->head())>0) { + + botV = tempV; + } + } + //find leftV + for(tempV = topV; tempV != botV; tempV = tempV->getNext()) + { + if(tempV->tail()[0] >= tempV->head()[0]) + break; + } + leftV = tempV; + //find rightV + for(tempV = botV; tempV != topV; tempV = tempV->getNext()) + { + if(tempV->tail()[0] <= tempV->head()[0]) + break; + } + rightV = tempV; + if(vlinear) + { + triangulateConvexPolyHoriz( leftV, rightV, pStream); + } + else if(ulinear) + { + triangulateConvexPolyVertical(topV, botV, pStream); + } + else + { + if(DBG_is_U_direction(polygon)) + { + triangulateConvexPolyHoriz( leftV, rightV, pStream); + } + else + triangulateConvexPolyVertical(topV, botV, pStream); + } +} + +/*for debug purpose*/ +void drawCorners( + Real* topV, Real* botV, + vertexArray* leftChain, + vertexArray* rightChain, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, + Int gridIndex2, + Int leftCornerWhere, + Int leftCornerIndex, + Int rightCornerWhere, + Int rightCornerIndex, + Int bot_leftCornerWhere, + Int bot_leftCornerIndex, + Int bot_rightCornerWhere, + Int bot_rightCornerIndex) +{ + Real* leftCornerV; + Real* rightCornerV; + Real* bot_leftCornerV; + Real* bot_rightCornerV; + + if(leftCornerWhere == 1) + leftCornerV = topV; + else if(leftCornerWhere == 0) + leftCornerV = leftChain->getVertex(leftCornerIndex); + else + leftCornerV = rightChain->getVertex(leftCornerIndex); + + if(rightCornerWhere == 1) + rightCornerV = topV; + else if(rightCornerWhere == 0) + rightCornerV = leftChain->getVertex(rightCornerIndex); + else + rightCornerV = rightChain->getVertex(rightCornerIndex); + + if(bot_leftCornerWhere == 1) + bot_leftCornerV = botV; + else if(bot_leftCornerWhere == 0) + bot_leftCornerV = leftChain->getVertex(bot_leftCornerIndex); + else + bot_leftCornerV = rightChain->getVertex(bot_leftCornerIndex); + + if(bot_rightCornerWhere == 1) + bot_rightCornerV = botV; + else if(bot_rightCornerWhere == 0) + bot_rightCornerV = leftChain->getVertex(bot_rightCornerIndex); + else + bot_rightCornerV = rightChain->getVertex(bot_rightCornerIndex); + + Real topGridV = leftGridChain->get_v_value(gridIndex1); + Real topGridU1 = leftGridChain->get_u_value(gridIndex1); + Real topGridU2 = rightGridChain->get_u_value(gridIndex1); + Real botGridV = leftGridChain->get_v_value(gridIndex2); + Real botGridU1 = leftGridChain->get_u_value(gridIndex2); + Real botGridU2 = rightGridChain->get_u_value(gridIndex2); + + glBegin(GL_LINE_STRIP); + glVertex2fv(leftCornerV); + glVertex2f(topGridU1, topGridV); + glEnd(); + + glBegin(GL_LINE_STRIP); + glVertex2fv(rightCornerV); + glVertex2f(topGridU2, topGridV); + glEnd(); + + glBegin(GL_LINE_STRIP); + glVertex2fv(bot_leftCornerV); + glVertex2f(botGridU1, botGridV); + glEnd(); + + glBegin(GL_LINE_STRIP); + glVertex2fv(bot_rightCornerV); + glVertex2f(botGridU2, botGridV); + glEnd(); + + +} + +void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain) +{ + Int i; + directedLine* tempV; + for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ + leftChain.appendVertex(topV->getVertex(i)); + } + for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) + { + for(i=0; i<=tempV->get_npoints()-2; i++){ + leftChain.appendVertex(tempV->getVertex(i)); + } + } + + for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) + { + for(i=tempV->get_npoints()-2; i>=0; i--){ + rightChain.appendVertex(tempV->getVertex(i)); + } + } + for(i=botV->get_npoints()-2; i>=1; i--){ + rightChain.appendVertex(tempV->getVertex(i)); + } +} + + +void findTopAndBot(directedLine* polygon, directedLine*& topV, directedLine*& botV) +{ + assert(polygon); + directedLine* tempV; + topV = botV = polygon; + for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) + { + if(compV2InY(topV->head(), tempV->head())<0) { + topV = tempV; + } + if(compV2InY(botV->head(), tempV->head())>0) { + botV = tempV; + } + } +} + +void findGridChains(directedLine* topV, directedLine* botV, + gridWrap* grid, + gridBoundaryChain*& leftGridChain, + gridBoundaryChain*& rightGridChain) +{ + /*find the first(top) and the last (bottom) grid line which intersect the + *this polygon + */ + Int firstGridIndex; /*the index in the grid*/ + Int lastGridIndex; + + firstGridIndex = (Int) ((topV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)); + + if(botV->head()[1] < grid->get_v_min()) + lastGridIndex = 0; + else + lastGridIndex = (Int) ((botV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)) + 1; + + /*find the interval inside the polygon for each gridline*/ + Int *leftGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(leftGridIndices); + Int *rightGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(rightGridIndices); + Int *leftGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(leftGridInnerIndices); + Int *rightGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(rightGridInnerIndices); + + findLeftGridIndices(topV, firstGridIndex, lastGridIndex, grid, leftGridIndices, leftGridInnerIndices); + + findRightGridIndices(topV, firstGridIndex, lastGridIndex, grid, rightGridIndices, rightGridInnerIndices); + + leftGridChain = new gridBoundaryChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, leftGridIndices, leftGridInnerIndices); + + rightGridChain = new gridBoundaryChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, rightGridIndices, rightGridInnerIndices); + + free(leftGridIndices); + free(rightGridIndices); + free(leftGridInnerIndices); + free(rightGridInnerIndices); +} + +void findDownCorners(Real *botVertex, + vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, + vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, + Real v, + Real uleft, + Real uright, + Int& ret_leftCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ + Int& ret_leftCornerIndex, /*useful when ret_leftCornerWhere == 0 or 2*/ + Int& ret_rightCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ + Int& ret_rightCornerIndex /*useful when ret_leftCornerWhere == 0 or 2*/ + ) +{ +#ifdef MYDEBUG +printf("*************enter find donw corner\n"); +printf("finddownCorner: v=%f, uleft=%f, uright=%f\n", v, uleft, uright); +printf("(%i,%i,%i,%i)\n", leftChainStartIndex, leftChainEndIndex,rightChainStartIndex, rightChainEndIndex); +printf("left chain is\n"); +leftChain->print(); +printf("right chain is\n"); +rightChain->print(); +#endif + + assert(v > botVertex[1]); + Real leftGridPoint[2]; + leftGridPoint[0] = uleft; + leftGridPoint[1] = v; + Real rightGridPoint[2]; + rightGridPoint[0] = uright; + rightGridPoint[1] = v; + + Int i; + Int index1, index2; + + index1 = leftChain->findIndexBelowGen(v, leftChainStartIndex, leftChainEndIndex); + index2 = rightChain->findIndexBelowGen(v, rightChainStartIndex, rightChainEndIndex); + + if(index2 <= rightChainEndIndex) //index2 was found above + index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex); + + if(index1>leftChainEndIndex && index2 > rightChainEndIndex) /*no point below v on left chain or right chain*/ + { + + /*the botVertex is the only vertex below v*/ + ret_leftCornerWhere = 1; + ret_rightCornerWhere = 1; + } + else if(index1>leftChainEndIndex ) /*index2 <= rightChainEndIndex*/ + { + + ret_rightCornerWhere = 2; /*on right chain*/ + ret_rightCornerIndex = index2; + + + Real tempMin = rightChain->getVertex(index2)[0]; + Int tempI = index2; + for(i=index2+1; i<= rightChainEndIndex; i++) + if(rightChain->getVertex(i)[0] < tempMin) + { + tempI = i; + tempMin = rightChain->getVertex(i)[0]; + } + + + //we consider whether we can use botVertex as left corner. First check + //if (leftGirdPoint, botVertex) interesects right chian or not. + if(DBG_intersectChain(rightChain, rightChainStartIndex,rightChainEndIndex, + leftGridPoint, botVertex)) + { + ret_leftCornerWhere = 2;//right + ret_leftCornerIndex = index2; //should use tempI??? + } + else if(botVertex[0] < tempMin) + ret_leftCornerWhere = 1; //bot + else + { + ret_leftCornerWhere = 2; //right + ret_leftCornerIndex = tempI; + } + } + else if(index2> rightChainEndIndex) /*index1<=leftChainEndIndex*/ + { + ret_leftCornerWhere = 0; /*left chain*/ + ret_leftCornerIndex = index1; + + /*find the vertex on the left chain with the maximum u, + *either this vertex or the botvertex can be used as the right corner + */ + + Int tempI; + //skip those points which are equal to v. (avoid degeneratcy) + for(tempI = index1; tempI <= leftChainEndIndex; tempI++) + if(leftChain->getVertex(tempI)[1] < v) + break; + if(tempI > leftChainEndIndex) + ret_rightCornerWhere = 1; + else + { + Real tempMax = leftChain->getVertex(tempI)[0]; + for(i=tempI; i<= leftChainEndIndex; i++) + if(leftChain->getVertex(i)[0] > tempMax) + { + tempI = i; + tempMax = leftChain->getVertex(i)[0]; + } + + + + //we consider whether we can use botVertex as a corner. So first we check + //whether (rightGridPoint, botVertex) interescts the left chain or not. + if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, + rightGridPoint, botVertex)) + { + ret_rightCornerWhere = 0; + ret_rightCornerIndex = index1; //should use tempI??? + } + else if(botVertex[0] > tempMax) + { + + ret_rightCornerWhere = 1; + } + else + { + ret_rightCornerWhere = 0; + ret_rightCornerIndex = tempI; + } + } + + } + else /*index1<=leftChainEndIndex and index2 <=rightChainEndIndex*/ + { + if(leftChain->getVertex(index1)[1] >= rightChain->getVertex(index2)[1]) /*left point above right point*/ + { + ret_leftCornerWhere = 0; /*on left chain*/ + ret_leftCornerIndex = index1; + + Real tempMax; + Int tempI; + + tempI = index1; + tempMax = leftChain->getVertex(index1)[0]; + + /*find the maximum u for all the points on the left above the right point index2*/ + for(i=index1+1; i<= leftChainEndIndex; i++) + { + if(leftChain->getVertex(i)[1] < rightChain->getVertex(index2)[1]) + break; + + if(leftChain->getVertex(i)[0]>tempMax) + { + tempI = i; + tempMax = leftChain->getVertex(i)[0]; + } + } + //we consider if we can use rightChain(index2) as right corner + //we check if (rightChain(index2), rightGidPoint) intersecs left chain or not. + if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2))) + { + ret_rightCornerWhere = 0; + ret_rightCornerIndex = index1; //should use tempI??? + } + else if(tempMax >= rightChain->getVertex(index2)[0] || + tempMax >= uright + ) + { + + ret_rightCornerWhere = 0; /*on left Chain*/ + ret_rightCornerIndex = tempI; + } + else + { + ret_rightCornerWhere = 2; /*on right chain*/ + ret_rightCornerIndex = index2; + } + } + else /*left below right*/ + { + ret_rightCornerWhere = 2; /*on the right*/ + ret_rightCornerIndex = index2; + + Real tempMin; + Int tempI; + + tempI = index2; + tempMin = rightChain->getVertex(index2)[0]; + + /*find the minimum u for all the points on the right above the left poitn index1*/ + for(i=index2+1; i<= rightChainEndIndex; i++) + { + if( rightChain->getVertex(i)[1] < leftChain->getVertex(index1)[1]) + break; + if(rightChain->getVertex(i)[0] < tempMin) + { + tempI = i; + tempMin = rightChain->getVertex(i)[0]; + } + } + + //we consider if we can use leftchain(index1) as left corner. + //we check if (leftChain(index1) intersects right chian or not + if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, leftGridPoint, leftChain->getVertex(index1))) + { + ret_leftCornerWhere = 2; + ret_leftCornerIndex = index2; //should use tempI??? + } + else if(tempMin <= leftChain->getVertex(index1)[0] || + tempMin <= uleft) + { + ret_leftCornerWhere = 2; /* on right chain*/ + ret_leftCornerIndex = tempI; + } + else + { + ret_leftCornerWhere = 0; /*on left chain*/ + ret_leftCornerIndex = index1; + } + } + } + +} + + +void findUpCorners(Real *topVertex, + vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, + vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, + Real v, + Real uleft, + Real uright, + Int& ret_leftCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ + Int& ret_leftCornerIndex, /*useful when ret_leftCornerWhere == 0 or 2*/ + Int& ret_rightCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ + Int& ret_rightCornerIndex /*useful when ret_leftCornerWhere == 0 or 2*/ + ) +{ +#ifdef MYDEBUG +printf("***********enter findUpCorners\n"); +#endif + + assert(v < topVertex[1]); + Real leftGridPoint[2]; + leftGridPoint[0] = uleft; + leftGridPoint[1] = v; + Real rightGridPoint[2]; + rightGridPoint[0] = uright; + rightGridPoint[1] = v; + + Int i; + Int index1, index2; + + index1 = leftChain->findIndexFirstAboveEqualGen(v, leftChainStartIndex, leftChainEndIndex); + + + index2 = rightChain->findIndexFirstAboveEqualGen(v, rightChainStartIndex, rightChainEndIndex); + + if(index2>= leftChainStartIndex) //index2 was found above + index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex); + + if(index1= rightChainStartIndex*/ + { + ret_rightCornerWhere = 2; /*on right chain*/ + ret_rightCornerIndex = index2; + + //find the minimum u on right top, either that, or top, or right[index2] is the left corner + Real tempMin = rightChain->getVertex(index2)[0]; + Int tempI = index2; + for(i=index2-1; i>=rightChainStartIndex; i--) + if(rightChain->getVertex(i)[0] < tempMin) + { + tempMin = rightChain->getVertex(i)[0]; + tempI = i; + } + //chech whether (leftGridPoint, top) intersects rightchai, + //if yes, use right corner as left corner + //if not, use top or right[tempI] as left corner + if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, + leftGridPoint, topVertex)) + { + ret_leftCornerWhere = 2; //rightChain + ret_leftCornerIndex = index2; + } + else if(topVertex[0] < tempMin) + ret_leftCornerWhere = 1; /*topvertex*/ + else + { + ret_leftCornerWhere = 2; //right chain + ret_leftCornerIndex = tempI; + } + + } + else if(index2< rightChainStartIndex) /*index1>=leftChainStartIndex*/ + { + ret_leftCornerWhere = 0; /*left chain*/ + ret_leftCornerIndex = index1; + + //find the maximum u on the left top section. either that or topvertex, or left[index1] is the right corner + Real tempMax = leftChain->getVertex(index1)[0]; + Int tempI = index1; + + for(i=index1-1; i>=leftChainStartIndex; i--){ + + if(leftChain->getVertex(i)[0] > tempMax) + { + + tempMax = leftChain->getVertex(i)[0]; + tempI = i; + } + } + //check whether (rightGridPoint, top) intersects leftChain or not + //if yes, we use leftCorner as the right corner + //if not, we use either top or left[tempI] as the right corner + if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, + rightGridPoint, topVertex)) + { + ret_rightCornerWhere = 0; //left chan + ret_rightCornerIndex = index1; + } + else if(topVertex[0] > tempMax) + ret_rightCornerWhere = 1;//topVertex + else + { + ret_rightCornerWhere = 0;//left chain + ret_rightCornerIndex = tempI; + } + } + else /*index1>=leftChainStartIndex and index2 >=rightChainStartIndex*/ + { + if(leftChain->getVertex(index1)[1] <= rightChain->getVertex(index2)[1]) /*left point below right point*/ + { + ret_leftCornerWhere = 0; /*on left chain*/ + ret_leftCornerIndex = index1; + + Real tempMax; + Int tempI; + + tempI = index1; + tempMax = leftChain->getVertex(index1)[0]; + + /*find the maximum u for all the points on the left below the right point index2*/ + for(i=index1-1; i>= leftChainStartIndex; i--) + { + if(leftChain->getVertex(i)[1] > rightChain->getVertex(index2)[1]) + break; + + if(leftChain->getVertex(i)[0]>tempMax) + { + tempI = i; + tempMax = leftChain->getVertex(i)[0]; + } + } + //chek whether (rightChain(index2), rightGridPoint) intersects leftchian or not + if(DBG_intersectChain(leftChain, leftChainStartIndex, leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2))) + { + ret_rightCornerWhere = 0; + ret_rightCornerIndex = index1; + } + else if(tempMax >= rightChain->getVertex(index2)[0] || + tempMax >= uright) + { + ret_rightCornerWhere = 0; /*on left Chain*/ + ret_rightCornerIndex = tempI; + } + else + { + ret_rightCornerWhere = 2; /*on right chain*/ + ret_rightCornerIndex = index2; + } + } + else /*left above right*/ + { + ret_rightCornerWhere = 2; /*on the right*/ + ret_rightCornerIndex = index2; + + Real tempMin; + Int tempI; + + tempI = index2; + tempMin = rightChain->getVertex(index2)[0]; + + /*find the minimum u for all the points on the right below the left poitn index1*/ + for(i=index2-1; i>= rightChainStartIndex; i--) + { + if( rightChain->getVertex(i)[1] > leftChain->getVertex(index1)[1]) + break; + if(rightChain->getVertex(i)[0] < tempMin) + { + tempI = i; + tempMin = rightChain->getVertex(i)[0]; + } + } + //check whether (leftGRidPoint,left(index1)) interesect right chain + if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, + leftGridPoint, leftChain->getVertex(index1))) + { + ret_leftCornerWhere = 2; //right + ret_leftCornerIndex = index2; + } + else if(tempMin <= leftChain->getVertex(index1)[0] || + tempMin <= uleft) + { + ret_leftCornerWhere = 2; /* on right chain*/ + ret_leftCornerIndex = tempI; + } + else + { + ret_leftCornerWhere = 0; /*on left chain*/ + ret_leftCornerIndex = index1; + } + } + } +#ifdef MYDEBUG +printf("***********leave findUpCorners\n"); +#endif +} + +//return 1 if neck exists, 0 othewise +Int findNeckF(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridStartIndex, + Int& neckLeft, + Int& neckRight) +{ +/* +printf("enter findNeckF, botleft, botright=%i,%i,gstartindex=%i\n",botLeftIndex,botRightIndex,gridStartIndex); +printf("leftChain is\n"); +leftChain->print(); +printf("rightChain is\n"); +rightChain->print(); +*/ + + Int lowerGridIndex; //the grid below leftChain and rightChian vertices + Int i; + Int n_vlines = leftGridChain->get_nVlines(); + Real v; + if(botLeftIndex >= leftChain->getNumElements() || + botRightIndex >= rightChain->getNumElements()) + return 0; //no neck exists + + v=min(leftChain->getVertex(botLeftIndex)[1], rightChain->getVertex(botRightIndex)[1]); + + + + + for(i=gridStartIndex; iget_v_value(i) <= v && + leftGridChain->getUlineIndex(i)<= rightGridChain->getUlineIndex(i)) + break; + + lowerGridIndex = i; + + if(lowerGridIndex == n_vlines) //the two trm vertex are higher than all gridlines + return 0; + else + { + Int botLeft2, botRight2; +/* +printf("leftGridChain->get_v_)value=%f\n",leftGridChain->get_v_value(lowerGridIndex), botLeftIndex); +printf("leftChain->get_vertex(0)=(%f,%f)\n", leftChain->getVertex(0)[0],leftChain->getVertex(0)[1]); +printf("leftChain->get_vertex(1)=(%f,%f)\n", leftChain->getVertex(1)[0],leftChain->getVertex(1)[1]); +printf("leftChain->get_vertex(2)=(%f,%f)\n", leftChain->getVertex(2)[0],leftChain->getVertex(2)[1]); +*/ + botLeft2 = leftChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botLeftIndex, leftChain->getNumElements()-1) -1 ; + +/* +printf("botLeft2=%i\n", botLeft2); +printf("leftChain->getNumElements=%i\n", leftChain->getNumElements()); +*/ + + botRight2 = rightChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botRightIndex, rightChain->getNumElements()-1) -1; + if(botRight2 < botRightIndex) botRight2=botRightIndex; + + if(botLeft2 < botLeftIndex) botLeft2 = botLeftIndex; + + assert(botLeft2 >= botLeftIndex); + assert(botRight2 >= botRightIndex); + //find nectLeft so that it is th erightmost vertex on letChain + + Int tempI = botLeftIndex; + Real temp = leftChain->getVertex(tempI)[0]; + for(i=botLeftIndex+1; i<= botLeft2; i++) + if(leftChain->getVertex(i)[0] > temp) + { + temp = leftChain->getVertex(i)[0]; + tempI = i; + } + neckLeft = tempI; + + tempI = botRightIndex; + temp = rightChain->getVertex(tempI)[0]; + for(i=botRightIndex+1; i<= botRight2; i++) + if(rightChain->getVertex(i)[0] < temp) + { + temp = rightChain->getVertex(i)[0]; + tempI = i; + } + neckRight = tempI; + return 1; + } +} + + + +/*find i>=botLeftIndex,j>=botRightIndex so that + *(leftChain[i], rightChain[j]) is a neck. + */ +void findNeck(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, + Int& leftLastIndex, /*left point of the neck*/ + Int& rightLastIndex /*right point of the neck*/ + ) +{ + assert(botLeftIndex < leftChain->getNumElements() && + botRightIndex < rightChain->getNumElements()); + + /*now the neck exists for sure*/ + + if(leftChain->getVertex(botLeftIndex)[1] <= rightChain->getVertex(botRightIndex)[1]) //left below right + { + + leftLastIndex = botLeftIndex; + + /*find i so that rightChain[i][1] >= leftchainbotverte[1], and i+1< + */ + rightLastIndex=rightChain->findIndexAboveGen(leftChain->getVertex(botLeftIndex)[1], botRightIndex+1, rightChain->getNumElements()-1); + } + else //left above right + { + + rightLastIndex = botRightIndex; + + leftLastIndex = leftChain->findIndexAboveGen(rightChain->getVertex(botRightIndex)[1], + botLeftIndex+1, + leftChain->getNumElements()-1); + } +} + + + +void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices) +{ + + Int i,k,isHoriz = 0; + Int n_ulines = grid->get_n_ulines(); + Real uMin = grid->get_u_min(); + Real uMax = grid->get_u_max(); + /* + Real vMin = grid->get_v_min(); + Real vMax = grid->get_v_max(); + */ + Real slop = 0.0, uinterc; + +#ifdef SHORTEN_GRID_LINE + //uintercBuf stores all the interction u value for each grid line + //notice that lastGridIndex<= firstGridIndex + Real *uintercBuf = (Real *) malloc (sizeof(Real) * (firstGridIndex-lastGridIndex+1)); + assert(uintercBuf); +#endif + + /*initialization to make vtail bigger than grid->...*/ + directedLine* dLine = topEdge; + Real vtail = grid->get_v_value(firstGridIndex) + 1.0; + Real tempMaxU = grid->get_u_min(); + + + /*for each grid line*/ + for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) + { + + Real grid_v_value = grid->get_v_value(i); + + /*check whether this grid line is below the current trim edge.*/ + if(vtail > grid_v_value) + { + /*since the grid line is below the trim edge, we + *find the trim edge which will contain the trim line + */ + while( (vtail=dLine->tail()[1]) > grid_v_value){ + + tempMaxU = max(tempMaxU, dLine->tail()[0]); + dLine = dLine -> getNext(); + } + + if( fabs(dLine->head()[1] - vtail) < ZERO) + isHoriz = 1; + else + { + isHoriz = 0; + slop = (dLine->head()[0] - dLine->tail()[0]) / (dLine->head()[1]-vtail); + } + } + + if(isHoriz) + { + uinterc = max(dLine->head()[0], dLine->tail()[0]); + } + else + { + uinterc = slop * (grid_v_value - vtail) + dLine->tail()[0]; + } + + tempMaxU = max(tempMaxU, uinterc); + + if(uinterc < uMin && uinterc >= uMin - ZERO) + uinterc = uMin; + if(uinterc > uMax && uinterc <= uMax + ZERO) + uinterc = uMax; + +#ifdef SHORTEN_GRID_LINE + uintercBuf[k] = uinterc; +#endif + + assert(uinterc >= uMin && uinterc <= uMax); + if(uinterc == uMax) + ret_indices[k] = n_ulines-1; + else + ret_indices[k] = (Int)(((uinterc-uMin)/(uMax - uMin)) * (n_ulines-1)) + 1; + if(ret_indices[k] >= n_ulines) + ret_indices[k] = n_ulines-1; + + + ret_innerIndices[k] = (Int)(((tempMaxU-uMin)/(uMax - uMin)) * (n_ulines-1)) + 1; + + /*reinitialize tempMaxU for next grdiLine*/ + tempMaxU = uinterc; + } +#ifdef SHORTEN_GRID_LINE + //for each grid line, compare the left grid point with the + //intersection point. If the two points are too close, then + //we should move the grid point one grid to the right + //and accordingly we should update the inner index. + for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) + { + //check gridLine i + //check ret_indices[k] + Real a = grid->get_u_value(ret_indices[k]-1); + Real b = grid->get_u_value(ret_indices[k]); + assert(uintercBuf[k] >= a && uintercBuf < b); + if( (b-uintercBuf[k]) <= 0.2 * (b-a)) //interc is very close to b + { + ret_indices[k]++; + } + + //check ret_innerIndices[k] + if(k>0) + { + if(ret_innerIndices[k] < ret_indices[k-1]) + ret_innerIndices[k] = ret_indices[k-1]; + if(ret_innerIndices[k] < ret_indices[k]) + ret_innerIndices[k] = ret_indices[k]; + } + } + //clean up + free(uintercBuf); +#endif +} + +void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices) +{ + + Int i,k; + Int n_ulines = grid->get_n_ulines(); + Real uMin = grid->get_u_min(); + Real uMax = grid->get_u_max(); + /* + Real vMin = grid->get_v_min(); + Real vMax = grid->get_v_max(); + */ + Real slop = 0.0, uinterc; + +#ifdef SHORTEN_GRID_LINE + //uintercBuf stores all the interction u value for each grid line + //notice that firstGridIndex >= lastGridIndex + Real *uintercBuf = (Real *) malloc (sizeof(Real) * (firstGridIndex-lastGridIndex+1)); + assert(uintercBuf); +#endif + + /*initialization to make vhead bigger than grid->v_value...*/ + directedLine* dLine = topEdge->getPrev(); + Real vhead = dLine->tail()[1]; + Real tempMinU = grid->get_u_max(); + + /*for each grid line*/ + for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) + { + + Real grid_v_value = grid->get_v_value(i); + + + /*check whether this grid line is below the current trim edge.*/ + if(vhead >= grid_v_value) + { + /*since the grid line is below the tail of the trim edge, we + *find the trim edge which will contain the trim line + */ + while( (vhead=dLine->head()[1]) > grid_v_value){ + tempMinU = min(tempMinU, dLine->head()[0]); + dLine = dLine -> getPrev(); + } + + /*skip the equality in the case of degenerat case: horizontal */ + while(dLine->head()[1] == grid_v_value) + dLine = dLine->getPrev(); + + assert( dLine->tail()[1] != dLine->head()[1]); + slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-dLine->head()[1]); + /* + if(dLine->tail()[1] == vhead) + isHoriz = 1; + else + { + isHoriz = 0; + slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-vhead); + } + */ + } + uinterc = slop * (grid_v_value - dLine->head()[1]) + dLine->head()[0]; + + //in case unterc is outside of the grid due to floating point + if(uinterc < uMin) + uinterc = uMin; + else if(uinterc > uMax) + uinterc = uMax; + +#ifdef SHORTEN_GRID_LINE + uintercBuf[k] = uinterc; +#endif + + tempMinU = min(tempMinU, uinterc); + + assert(uinterc >= uMin && uinterc <= uMax); + + if(uinterc == uMin) + ret_indices[k] = 0; + else + ret_indices[k] = (int)ceil((((uinterc-uMin)/(uMax - uMin)) * (n_ulines-1))) -1; +/* +if(ret_indices[k] >= grid->get_n_ulines()) + { + printf("ERROR3\n"); + exit(0); +} +if(ret_indices[k] < 0) + { + printf("ERROR4\n"); + exit(0); +} +*/ + ret_innerIndices[k] = (int)ceil ((((tempMinU-uMin)/(uMax - uMin)) * (n_ulines-1))) -1; + + tempMinU = uinterc; + } +#ifdef SHORTEN_GRID_LINE + //for each grid line, compare the left grid point with the + //intersection point. If the two points are too close, then + //we should move the grid point one grid to the right + //and accordingly we should update the inner index. + for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) + { + //check gridLine i + //check ret_indices[k] + Real a = grid->get_u_value(ret_indices[k]); + Real b = grid->get_u_value(ret_indices[k]+1); + assert(uintercBuf[k] > a && uintercBuf <= b); + if( (uintercBuf[k]-a) <= 0.2 * (b-a)) //interc is very close to a + { + ret_indices[k]--; + } + + //check ret_innerIndices[k] + if(k>0) + { + if(ret_innerIndices[k] > ret_indices[k-1]) + ret_innerIndices[k] = ret_indices[k-1]; + if(ret_innerIndices[k] > ret_indices[k]) + ret_innerIndices[k] = ret_indices[k]; + } + } + //clean up + free(uintercBuf); +#endif +} + + +void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlinear, primStream* pStream, rectBlockArray* rbArray) +{ +/* +{ +grid->print(); +polygon->writeAllPolygons("zloutputFile"); +exit(0); +} +*/ + +if(grid->get_n_ulines() == 2 || + grid->get_n_vlines() == 2) +{ + if(ulinear && grid->get_n_ulines() == 2) + { + monoTriangulationFun(polygon, compV2InY, pStream); + return; + } + else if(DBG_isConvex(polygon) && polygon->numEdges() >=4) + { + triangulateConvexPoly(polygon, ulinear, vlinear, pStream); + return; + } + else if(vlinear || DBG_is_U_direction(polygon)) + { + Int n_cusps;//num interior cusps + Int n_edges = polygon->numEdges(); + directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*) * n_edges); + assert(cusps); + findInteriorCuspsX(polygon, n_cusps, cusps); + + if(n_cusps == 0) //u_monotone + { + + monoTriangulationFun(polygon, compV2InX, pStream); + + free(cusps); + return; + } + else if(n_cusps == 1) //one interior cusp + { + + directedLine* new_polygon = polygonConvert(cusps[0]); + + directedLine* other = findDiagonal_singleCuspX( new_polygon); + + + + // should NOT be null unless there are self-intersecting + //trim curves. In that case, we don't want to core dump, instead, + //we triangulate anyway, and print out error message. + if(other == NULL) + { + monoTriangulationFun(polygon, compV2InX, pStream); + free(cusps); + return; + } + + directedLine* ret_p1; + directedLine* ret_p2; + + new_polygon->connectDiagonal_2slines(new_polygon, other, + &ret_p1, + &ret_p2, + new_polygon); + + monoTriangulationFun(ret_p1, compV2InX, pStream); + monoTriangulationFun(ret_p2, compV2InX, pStream); + + ret_p1->deleteSinglePolygonWithSline(); + ret_p2->deleteSinglePolygonWithSline(); + + free(cusps); + return; + } + free(cusps); + } +} + + /*find the top and bottom of the polygon. It is supposed to be + *a V-monotone polygon + */ + + directedLine* tempV; + directedLine* topV; + directedLine* botV; + topV = botV = polygon; + + for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) + { + if(compV2InY(topV->head(), tempV->head())<0) { + + topV = tempV; + } + if(compV2InY(botV->head(), tempV->head())>0) { + + botV = tempV; + } + } + + /*find the first(top) and the last (bottom) grid line which intersect the + *this polygon + */ + Int firstGridIndex; /*the index in the grid*/ + Int lastGridIndex; + firstGridIndex = (Int) ((topV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)); + lastGridIndex = (Int) ((botV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)) + 1; + + + /*find the interval inside the polygon for each gridline*/ + Int *leftGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(leftGridIndices); + Int *rightGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(rightGridIndices); + Int *leftGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(leftGridInnerIndices); + Int *rightGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); + assert(rightGridInnerIndices); + + findLeftGridIndices(topV, firstGridIndex, lastGridIndex, grid, leftGridIndices, leftGridInnerIndices); + + findRightGridIndices(topV, firstGridIndex, lastGridIndex, grid, rightGridIndices, rightGridInnerIndices); + + gridBoundaryChain leftGridChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, leftGridIndices, leftGridInnerIndices); + + gridBoundaryChain rightGridChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, rightGridIndices, rightGridInnerIndices); + + + +// leftGridChain.draw(); +// leftGridChain.drawInner(); +// rightGridChain.draw(); +// rightGridChain.drawInner(); + /*(1) determine the grid boundaries (left and right). + *(2) process polygon into two monotone chaines: use vertexArray + *(3) call sampleMonoPolyRec + */ + + /*copy the two chains into vertexArray datastructure*/ + Int i; + vertexArray leftChain(20); /*this is a dynamic array*/ + for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ + leftChain.appendVertex(topV->getVertex(i)); + } + for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) + { + for(i=0; i<=tempV->get_npoints()-2; i++){ + leftChain.appendVertex(tempV->getVertex(i)); + } + } + + vertexArray rightChain(20); + for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) + { + for(i=tempV->get_npoints()-2; i>=0; i--){ + rightChain.appendVertex(tempV->getVertex(i)); + } + } + for(i=botV->get_npoints()-2; i>=1; i--){ + rightChain.appendVertex(tempV->getVertex(i)); + } + + sampleMonoPolyRec(topV->head(), + botV->head(), + &leftChain, + 0, + &rightChain, + 0, + &leftGridChain, + &rightGridChain, + 0, + pStream, + rbArray); + + + /*cleanup space*/ + free(leftGridIndices); + free(rightGridIndices); + free(leftGridInnerIndices); + free(rightGridInnerIndices); +} + +void sampleMonoPolyRec( + Real* topVertex, + Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, + vertexArray* rightChain, + Int rightStartIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridStartIndex, + primStream* pStream, + rectBlockArray* rbArray) +{ + + /*find the first connected component, and the four corners. + */ + Int index1, index2; /*the first and last grid line of the first connected component*/ + + if(topVertex[1] <= botVertex[1]) + return; + + /*find i so that the grid line is below the top vertex*/ + Int i=gridStartIndex; + while (i < leftGridChain->get_nVlines()) + { + if(leftGridChain->get_v_value(i) < topVertex[1]) + break; + i++; + } + + /*find the first connected component starting with i*/ + /*find index1 so that left_uline_index <= right_uline_index, that is, this + *grid line contains at least one inner grid point + */ + index1=i; + int num_skipped_grid_lines=0; + while(index1 < leftGridChain->get_nVlines()) + { + if(leftGridChain->getUlineIndex(index1) <= rightGridChain->getUlineIndex(index1)) + break; + num_skipped_grid_lines++; + index1++; + } + + + + if(index1 >= leftGridChain->get_nVlines()) /*no grid line exists which has inner point*/ + { + /*stop recursion, ...*/ + /*monotone triangulate it...*/ +// printf("no grid line exists\n"); +/* + monoTriangulationRecOpt(topVertex, botVertex, leftChain, leftStartIndex, + rightChain, rightStartIndex, pStream); +*/ + +if(num_skipped_grid_lines <2) + { + monoTriangulationRecGenOpt(topVertex, botVertex, leftChain, leftStartIndex, + leftChain->getNumElements()-1, + rightChain, rightStartIndex, + rightChain->getNumElements()-1, + pStream); + } +else + { + //the optimum way to triangulate is top-down since this polygon + //is narrow-long. + monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex, + rightChain, rightStartIndex, pStream); + } + +/* + monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex, + rightChain, rightStartIndex, pStream); +*/ + +/* monoTriangulationRecGenTBOpt(topVertex, botVertex, + leftChain, leftStartIndex, leftChain->getNumElements()-1, + rightChain, rightStartIndex, rightChain->getNumElements()-1, + pStream);*/ + + + + } + else + { + + /*find index2 so that left_inner_index <= right_inner_index holds until index2*/ + index2=index1+1; + if(index2 < leftGridChain->get_nVlines()) + while(leftGridChain->getInnerIndex(index2) <= rightGridChain->getInnerIndex(index2)) + { + index2++; + if(index2 >= leftGridChain->get_nVlines()) + break; + } + + index2--; + + + + /*the neck*/ + Int neckLeftIndex; + Int neckRightIndex; + + /*the four corners*/ + Int up_leftCornerWhere; + Int up_leftCornerIndex; + Int up_rightCornerWhere; + Int up_rightCornerIndex; + Int down_leftCornerWhere; + Int down_leftCornerIndex; + Int down_rightCornerWhere; + Int down_rightCornerIndex; + + Real* tempBotVertex; /*the bottom vertex for this component*/ + Real* nextTopVertex=NULL; /*for the recursion*/ + Int nextLeftStartIndex=0; + Int nextRightStartIndex=0; + + /*find the points below the grid line index2 on both chains*/ + Int botLeftIndex = leftChain->findIndexStrictBelowGen( + leftGridChain->get_v_value(index2), + leftStartIndex, + leftChain->getNumElements()-1); + Int botRightIndex = rightChain->findIndexStrictBelowGen( + rightGridChain->get_v_value(index2), + rightStartIndex, + rightChain->getNumElements()-1); + /*if either botLeftIndex>= numelements, + * or botRightIndex >= numelemnet, + *then there is no neck exists. the bottom vertex is botVertex, + */ + if(! findNeckF(leftChain, botLeftIndex, rightChain, botRightIndex, + leftGridChain, rightGridChain, index2, neckLeftIndex, neckRightIndex)) + /* + if(botLeftIndex == leftChain->getNumElements() || + botRightIndex == rightChain->getNumElements()) + */ + { +#ifdef MYDEBUG + printf("neck NOT exists, botRightIndex=%i\n", botRightIndex); +#endif + + tempBotVertex = botVertex; + nextTopVertex = botVertex; + botLeftIndex = leftChain->getNumElements()-1; + botRightIndex = rightChain->getNumElements()-1; + } + else /*neck exists*/ + { +#ifdef MYDEBUG + printf("neck exists\n"); +#endif + + /* + findNeck(leftChain, botLeftIndex, + rightChain, botRightIndex, + neckLeftIndex, + neckRightIndex); + */ +#ifdef MYDEBUG +printf("neck is found, neckLeftIndex=%i, neckRightIndex=%i\n", neckLeftIndex, neckRightIndex); +glBegin(GL_LINES); +glVertex2fv(leftChain->getVertex(neckLeftIndex)); +glVertex2fv(rightChain->getVertex(neckRightIndex)); +glEnd(); +#endif + + if(leftChain->getVertex(neckLeftIndex)[1] <= rightChain->getVertex(neckRightIndex)[1]) + { + tempBotVertex = leftChain->getVertex(neckLeftIndex); + botLeftIndex = neckLeftIndex-1; + botRightIndex = neckRightIndex; + nextTopVertex = rightChain->getVertex(neckRightIndex); + nextLeftStartIndex = neckLeftIndex; + nextRightStartIndex = neckRightIndex+1; + } + else + { + tempBotVertex = rightChain->getVertex(neckRightIndex); + botLeftIndex = neckLeftIndex; + botRightIndex = neckRightIndex-1; + nextTopVertex = leftChain->getVertex(neckLeftIndex); + nextLeftStartIndex = neckLeftIndex+1; + nextRightStartIndex = neckRightIndex; + } + } + + findUpCorners(topVertex, + leftChain, + leftStartIndex, botLeftIndex, + rightChain, + rightStartIndex, botRightIndex, + leftGridChain->get_v_value(index1), + leftGridChain->get_u_value(index1), + rightGridChain->get_u_value(index1), + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex); + + findDownCorners(tempBotVertex, + leftChain, + leftStartIndex, botLeftIndex, + rightChain, + rightStartIndex, botRightIndex, + leftGridChain->get_v_value(index2), + leftGridChain->get_u_value(index2), + rightGridChain->get_u_value(index2), + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex); +#ifdef MYDEBUG + printf("find corners done, down_leftwhere=%i, down_righwhere=%i,\n",down_leftCornerWhere, down_rightCornerWhere ); + printf("find corners done, up_leftwhere=%i, up_righwhere=%i,\n",up_leftCornerWhere, up_rightCornerWhere ); + printf("find corners done, up_leftindex=%i, up_righindex=%i,\n",up_leftCornerIndex, up_rightCornerIndex ); + printf("find corners done, down_leftindex=%i, down_righindex=%i,\n",down_leftCornerIndex, down_rightCornerIndex ); +#endif + +/* + drawCorners(topVertex, + tempBotVertex, + leftChain, + rightChain, + leftGridChain, + rightGridChain, + index1, + index2, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex); +*/ + + + sampleConnectedComp(topVertex, tempBotVertex, + leftChain, + leftStartIndex, botLeftIndex, + rightChain, + rightStartIndex, botRightIndex, + leftGridChain, + rightGridChain, + index1, index2, + up_leftCornerWhere, + up_leftCornerIndex, + up_rightCornerWhere, + up_rightCornerIndex, + down_leftCornerWhere, + down_leftCornerIndex, + down_rightCornerWhere, + down_rightCornerIndex, + pStream, + rbArray + ); + + /*recursion*/ + + sampleMonoPolyRec( + nextTopVertex, + botVertex, + leftChain, + nextLeftStartIndex, + rightChain, + nextRightStartIndex, + leftGridChain, + rightGridChain, + index2+1, + pStream, rbArray); + + + } + +} + +void sampleLeftStrip(vertexArray* leftChain, + Int topLeftIndex, + Int botLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + Int leftGridChainEndIndex, + primStream* pStream + ) +{ + assert(leftChain->getVertex(topLeftIndex)[1] > leftGridChain->get_v_value(leftGridChainStartIndex)); + assert(leftChain->getVertex(topLeftIndex+1)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex)); + assert(leftChain->getVertex(botLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainEndIndex)); + assert(leftChain->getVertex(botLeftIndex-1)[1] > leftGridChain->get_v_value(leftGridChainEndIndex)); + + /* + *(1)find the last grid line which doesn'; pass below + * this first edge, sample this region: one trim edge and + * possily multiple grid lines. + */ + Real *upperVert, *lowerVert; /*the end points of the first trim edge*/ + upperVert = leftChain->getVertex(topLeftIndex); + lowerVert = leftChain->getVertex(topLeftIndex+1); + + Int index = leftGridChainStartIndex; + while(leftGridChain->get_v_value(index) >= lowerVert[1]){ + index++; + if(index > leftGridChainEndIndex) + break; + } + index--; + + sampleLeftSingleTrimEdgeRegion(upperVert, lowerVert, + leftGridChain, + leftGridChainStartIndex, + index, + pStream); + sampleLeftStripRec(leftChain, topLeftIndex+1, botLeftIndex, + leftGridChain, index, leftGridChainEndIndex, + pStream); + +} + +void sampleLeftStripRec(vertexArray* leftChain, + Int topLeftIndex, + Int botLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + Int leftGridChainEndIndex, + primStream* pStream + ) +{ + /*now top left trim vertex is below the top grid line. + */ + /*stop condition: if topLeftIndex >= botLeftIndex, then stop. + */ + if(topLeftIndex >= botLeftIndex) + return; + + /*find the last trim vertex which is above the second top grid line: + * index1. + *and sampleLeftOneGridStep(leftchain, topLeftIndex, index1, leftGridChain, + * leftGridChainStartIndex). + * index1 could be equal to topLeftIndex. + */ + Real secondGridChainV = leftGridChain->get_v_value(leftGridChainStartIndex+1); + assert(leftGridChainStartIndex < leftGridChainEndIndex); + Int index1 = topLeftIndex; + while(leftChain->getVertex(index1)[1] > secondGridChainV) + index1++; + index1--; + + sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream); + + + /* + * Let the next trim vertex be nextTrimVertIndex (which should be + * below the second grid line). + * Find the last grid line index2 which is above nextTrimVert. + * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], + * leftGridChain, leftGridChainStartIndex+1, index2). + */ + Real *uppervert, *lowervert; + uppervert = leftChain->getVertex(index1); + lowervert = leftChain->getVertex(index1+1); + Int index2 = leftGridChainStartIndex+1; + + while(leftGridChain->get_v_value(index2) >= lowervert[1]) + { + index2++; + if(index2 > leftGridChainEndIndex) + break; + } + index2--; + sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream); + + /* sampleLeftStripRec(leftChain, + nextTrimVertIndex, + botLeftIndex, + leftGridChain, + index2, + leftGridChainEndIndex + ) + * + */ + sampleLeftStripRec(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream); + +} + + +/***************begin RecF***********************/ +/* the gridlines from leftGridChainStartIndex to + * leftGridChainEndIndex are assumed to form a + * connected component. + * the trim vertex of topLeftIndex is assumed to + * be below the first gridline, and the tim vertex + * of botLeftIndex is assumed to be above the last + * grid line. + * If botLeftIndex < topLeftIndex, then no connected componeent exists, and this funcion returns without + * outputing any triangles. + * Otherwise botLeftIndex >= topLeftIndex, there is at least one triangle to output. + */ +void sampleLeftStripRecF(vertexArray* leftChain, + Int topLeftIndex, + Int botLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + Int leftGridChainEndIndex, + primStream* pStream + ) +{ + /*now top left trim vertex is below the top grid line. + */ + /*stop condition: if topLeftIndex > botLeftIndex, then stop. + */ + if(topLeftIndex > botLeftIndex) + return; + + /*if there is only one grid Line, return.*/ + + if(leftGridChainStartIndex>=leftGridChainEndIndex) + return; + + + assert(leftChain->getVertex(topLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex) && + leftChain->getVertex(botLeftIndex)[1] >= leftGridChain->get_v_value(leftGridChainEndIndex)); + + /*firs find the first trim vertex which is below or equal to the second top grid line: + * index1. + */ + Real secondGridChainV = leftGridChain->get_v_value(leftGridChainStartIndex+1); + + + Int index1 = topLeftIndex; + + while(leftChain->getVertex(index1)[1] > secondGridChainV){ + index1++; + if(index1>botLeftIndex) + break; + } + + /*now leftChain->getVertex(index-1)[1] > secondGridChainV and + * leftChain->getVertex(index)[1] <= secondGridChainV + *If equality holds, then we should include the vertex index1, otherwise we include only index1-1, to + *perform sampleOneGridStep. + */ + if(index1>botLeftIndex) + index1--; + else if(leftChain->getVertex(index1)[1] < secondGridChainV) + index1--; + + /*now we have leftChain->getVertex(index1)[1] >= secondGridChainV, and + * leftChain->getVertex(index1+1)[1] <= secondGridChainV + */ + + + sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream); + + + /*if leftChain->getVertex(index1)[1] == secondGridChainV, then we can recursively do the rest. + */ + if(leftChain->getVertex(index1)[1] == secondGridChainV) + { + + sampleLeftStripRecF(leftChain, index1, botLeftIndex,leftGridChain, leftGridChainStartIndex+1, leftGridChainEndIndex, pStream); + } + else if(index1 < botLeftIndex) + { + + /* Otherwise, we have leftChain->getVertex(index1)[1] > secondGridChainV, + * let the next trim vertex be nextTrimVertIndex (which should be strictly + * below the second grid line). + * Find the last grid line index2 which is above nextTrimVert. + * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], + * leftGridChain, leftGridChainStartIndex+1, index2). + */ + Real *uppervert, *lowervert; + uppervert = leftChain->getVertex(index1); + lowervert = leftChain->getVertex(index1+1); //okay since index1get_v_value(index2) >= lowervert[1]) + { + index2++; + if(index2 > leftGridChainEndIndex) + break; + } + index2--; + + + sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream); + + /*recursion*/ + + sampleLeftStripRecF(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream); + } + +} + +/***************End RecF***********************/ + +/*sample the left area in between one trim edge and multiple grid lines. + * all the grid lines should be in between the two end poins of the + *trim edge. + */ +void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], + gridBoundaryChain* gridChain, + Int beginIndex, + Int endIndex, + primStream* pStream) +{ + Int i,j,k; + + vertexArray vArray(endIndex-beginIndex+1); + vArray.appendVertex(gridChain->get_vertex(beginIndex)); + + for(k=1, i=beginIndex+1; i<=endIndex; i++, k++) + { + vArray.appendVertex(gridChain->get_vertex(i)); + + /*output the fan of the grid points of the (i)th and (i-1)th grid line. + */ + if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(gridChain->get_vertex(i-1)); + for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++) + pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + else if(gridChain->getUlineIndex(i) > gridChain->getUlineIndex(i-1)) + { + pStream->begin(); + pStream->insert(gridChain->get_vertex(i)); + for(j=gridChain->getUlineIndex(i); j>= gridChain->getUlineIndex(i-1); j--) + pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1)); + pStream->end(PRIMITIVE_STREAM_FAN); + } + /*otherwisem, the two are equal, so there is no fan to outout*/ + } + + monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, + 0, /*decreasing chain*/ + pStream); +} + +/*return i, such that from begin to i-1 the chain is strictly u-monotone. + */ +Int findIncreaseChainFromBegin(vertexArray* chain, Int begin ,Int end) +{ + Int i=begin; + Real prevU = chain->getVertex(i)[0]; + Real thisU; + for(i=begin+1; i<=end; i++){ + thisU = chain->getVertex(i)[0]; + + if(prevU < thisU){ + prevU = thisU; + } + else + break; + } + return i; +} + +/*check whether there is a vertex whose v value is strictly + *inbetween vup vbelow + *if no middle exists return -1, else return the idnex. + */ +Int checkMiddle(vertexArray* chain, Int begin, Int end, + Real vup, Real vbelow) +{ + Int i; + for(i=begin; i<=end; i++) + { + if(chain->getVertex(i)[1] < vup && chain->getVertex(i)[1]>vbelow) + return i; + } + return -1; +} + +/*the degenerat case of sampleLeftOneGridStep*/ +void sampleLeftOneGridStepNoMiddle(vertexArray* leftChain, + Int beginLeftIndex, + Int endLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + primStream* pStream) +{ + /*since there is no middle, there is at most one point which is on the + *second grid line, there could be multiple points on the first (top) + *grid line. + */ + + leftGridChain->leftEndFan(leftGridChainStartIndex+1, pStream); + + monoTriangulation2(leftGridChain->get_vertex(leftGridChainStartIndex), + leftGridChain->get_vertex(leftGridChainStartIndex+1), + leftChain, + beginLeftIndex, + endLeftIndex, + 1, //is increase chain. + pStream); +} + + + +/*sampling the left area in between two grid lines. + */ +void sampleLeftOneGridStep(vertexArray* leftChain, + Int beginLeftIndex, + Int endLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + primStream* pStream + ) +{ + if(checkMiddle(leftChain, beginLeftIndex, endLeftIndex, + leftGridChain->get_v_value(leftGridChainStartIndex), + leftGridChain->get_v_value(leftGridChainStartIndex+1))<0) + + { + + sampleLeftOneGridStepNoMiddle(leftChain, beginLeftIndex, endLeftIndex, leftGridChain, leftGridChainStartIndex, pStream); + return; + } + + //copy into a polygon + { + directedLine* poly = NULL; + sampledLine* sline; + directedLine* dline; + gridWrap* grid = leftGridChain->getGrid(); + Real vert1[2]; + Real vert2[2]; + Int i; + + Int innerInd = leftGridChain->getInnerIndex(leftGridChainStartIndex+1); + Int upperInd = leftGridChain->getUlineIndex(leftGridChainStartIndex); + Int lowerInd = leftGridChain->getUlineIndex(leftGridChainStartIndex+1); + Real upperV = leftGridChain->get_v_value(leftGridChainStartIndex); + Real lowerV = leftGridChain->get_v_value(leftGridChainStartIndex+1); + + //the upper gridline + vert1[1] = vert2[1] = upperV; + for(i=innerInd; i>upperInd; i--) + { + vert1[0]=grid->get_u_value(i); + vert2[0]=grid->get_u_value(i-1); + sline = new sampledLine(vert1, vert2); + dline = new directedLine(INCREASING, sline); + if(poly == NULL) + poly = dline; + else + poly->insert(dline); + } + + //the edge connecting upper grid with left chain + vert1[0] = grid->get_u_value(upperInd); + vert1[1] = upperV; + sline = new sampledLine(vert1, leftChain->getVertex(beginLeftIndex)); + dline = new directedLine(INCREASING, sline); + if(poly == NULL) + poly = dline; + else + poly->insert(dline); + + //the left chain + for(i=beginLeftIndex; igetVertex(i), leftChain->getVertex(i+1)); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + + //the edge connecting left chain with lower gridline + vert2[0] = grid->get_u_value(lowerInd); + vert2[1] = lowerV; + sline = new sampledLine(leftChain->getVertex(endLeftIndex), vert2); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + + //the lower grid line + vert1[1] = vert2[1] = lowerV; + for(i=lowerInd; iget_u_value(i); + vert2[0] = grid->get_u_value(i+1); + sline = new sampledLine(vert1, vert2); + dline = new directedLine(INCREASING, sline); + poly->insert(dline); + } + + //the vertical grid line segement + vert1[0]=vert2[0] = grid->get_u_value(innerInd); + vert2[1]=upperV; + vert1[1]=lowerV; + sline=new sampledLine(vert1, vert2); + dline=new directedLine(INCREASING, sline); + poly->insert(dline); + monoTriangulationOpt(poly, pStream); + //cleanup + poly->deleteSinglePolygonWithSline(); + return; + } + + + + + + Int i; + if(1/*leftGridChain->getUlineIndex(leftGridChainStartIndex) >= + leftGridChain->getUlineIndex(leftGridChainStartIndex+1)*/ + ) /*the second grid line is beyond the first one to the left*/ + { + /*find the maximal U-monotone chain + * of endLeftIndex, endLeftIndex-1, ..., + */ + i=endLeftIndex; + Real prevU = leftChain->getVertex(i)[0]; + for(i=endLeftIndex-1; i>=beginLeftIndex; i--){ + Real thisU = leftChain->getVertex(i)[0]; + if( prevU < thisU){ + prevU = thisU; + } + else + break; + } + /*from endLeftIndex to i+1 is strictly U- monotone */ + /*if i+1==endLeftIndex and the vertex and leftchain is on the second gridline, then + *we should use 2 vertices on the leftchain. If we only use one (endLeftIndex), then we + *we would output degenerate triangles + */ + if(i+1 == endLeftIndex && leftChain->getVertex(endLeftIndex)[1] == leftGridChain->get_v_value(1+leftGridChainStartIndex)) + i--; + + Int j = beginLeftIndex/*endLeftIndex*/+1; + + + if(leftGridChain->getInnerIndex(leftGridChainStartIndex+1) > leftGridChain->getUlineIndex(leftGridChainStartIndex)) + { + j = findIncreaseChainFromBegin(leftChain, beginLeftIndex, i+1/*endLeftIndex*/); + + Int temp = beginLeftIndex; + /*now from begin to j-1 is strictly u-monotone*/ + /*if j-1 is on the first grid line, then we want to skip to the vertex which is strictly + *below the grid line. This vertexmust exist since there is a 'corner turn' inbetween the two grid lines + */ + if(j-1 == beginLeftIndex) + { + while(leftChain->getVertex(j-1)[1] == leftGridChain->get_v_value(leftGridChainStartIndex)) + j++; + + Real vert[2]; + vert[0] = leftGridChain->get_u_value(leftGridChainStartIndex); + vert[1] = leftGridChain->get_v_value(leftGridChainStartIndex); + + monoTriangulation2( + vert/*leftChain->getVertex(beginLeftIndex)*/, + leftChain->getVertex(j-1), + leftChain, + beginLeftIndex, + j-2, + 1, + pStream //increase chain + ); + + temp = j-1; + } + + stripOfFanLeft(leftChain, j-1, temp/*beginLeftIndex*/, leftGridChain->getGrid(), + leftGridChain->getVlineIndex(leftGridChainStartIndex), + leftGridChain->getUlineIndex(leftGridChainStartIndex), + leftGridChain->getInnerIndex(leftGridChainStartIndex+1), + pStream, + 1 /*the grid line is above the trim line*/ + ); + } + + stripOfFanLeft(leftChain, endLeftIndex, i+1, leftGridChain->getGrid(), + leftGridChain->getVlineIndex(leftGridChainStartIndex+1), + leftGridChain->getUlineIndex(leftGridChainStartIndex+1), + leftGridChain->getInnerIndex(leftGridChainStartIndex+1), + pStream, + 0 /*the grid line is below the trim lines*/ + ); + + /*monotone triangulate the remaining left chain togther with the + *two vertices on the two grid v-lines. + */ + Real vert[2][2]; + vert[0][0]=vert[1][0] = leftGridChain->getInner_u_value(leftGridChainStartIndex+1); + vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); + vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1); + +// vertexArray right(vert, 2); + + monoTriangulation2( + &vert[0][0], /*top vertex */ + &vert[1][0], /*bottom vertex*/ + leftChain, + /*beginLeftIndex*/j-1, + i+1, + 1, /*an increasing chain*/ + pStream); + } + else /*the second one is shorter than the first one to the left*/ + { + /*find the maximal U-monotone chain of beginLeftIndex, beginLeftIndex+1,..., + */ + i=beginLeftIndex; + Real prevU = leftChain->getVertex(i)[0]; + for(i=beginLeftIndex+1; i<=endLeftIndex; i++){ + Real thisU = leftChain->getVertex(i)[0]; + + if(prevU < thisU){ + prevU = thisU; + } + else + break; + } + /*from beginLeftIndex to i-1 is strictly U-monotone*/ + + + stripOfFanLeft(leftChain, i-1, beginLeftIndex, leftGridChain->getGrid(), + leftGridChain->getVlineIndex(leftGridChainStartIndex), + leftGridChain->getUlineIndex(leftGridChainStartIndex), + leftGridChain->getUlineIndex(leftGridChainStartIndex+1), + pStream, + 1 /*the grid line is above the trim lines*/ + ); + /*monotone triangulate the remaining left chain together with the + *two vertices on the two grid v-lines. + */ + Real vert[2][2]; + vert[0][0]=vert[1][0] = leftGridChain->get_u_value(leftGridChainStartIndex+1); + vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); + vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1); + + vertexArray right(vert, 2); + + monoTriangulation2( + &vert[0][0], //top vertex + &vert[1][0], //bottom vertex + leftChain, + i-1, + endLeftIndex, + 1, /*an increase chain*/ + pStream); + + } +} + +/*n_upper>=1 + *n_lower>=1 + */ +void triangulateXYMono(Int n_upper, Real upperVerts[][2], + Int n_lower, Real lowerVerts[][2], + primStream* pStream) +{ + Int i,j,k,l; + Real* leftMostV; + + assert(n_upper>=1 && n_lower>=1); + if(upperVerts[0][0] <= lowerVerts[0][0]) + { + i=1; + j=0; + leftMostV = upperVerts[0]; + } + else + { + i=0; + j=1; + leftMostV = lowerVerts[0]; + } + + while(1) + { + if(i >= n_upper) /*case1: no more in upper*/ + { + + if(jbegin(); + pStream->insert(leftMostV); + while(jinsert(lowerVerts[j]); + j++; + } + pStream->end(PRIMITIVE_STREAM_FAN); + } + + break; + } + else if(j>= n_lower) /*case2: no more in lower*/ + { + + if(ibegin(); + pStream->insert(leftMostV); + + for(k=n_upper-1; k>=i; k--) + pStream->insert(upperVerts[k]); + + pStream->end(PRIMITIVE_STREAM_FAN); + } + + break; + } + else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ + { + + if(upperVerts[i][0] <= lowerVerts[j][0]) + { + pStream->begin(); + pStream->insert(lowerVerts[j]); /*the origin of this fan*/ + + /*find the last k>=i such that + *upperverts[k][0] <= lowerverts[j][0] + */ + k=i; + while(k lowerVerts[j][0]) + break; + k++; + } + k--; + for(l=k; l>=i; l--)/*the reverse is for two-face lighting*/ + { + pStream->insert(upperVerts[l]); + } + pStream->insert(leftMostV); + + pStream->end(PRIMITIVE_STREAM_FAN); + //update i for next loop + i = k+1; + leftMostV = upperVerts[k]; + + } + else /*upperVerts[i][0] > lowerVerts[j][0]*/ + { + pStream->begin(); + pStream->insert(upperVerts[i]);/*the origion of this fan*/ + pStream->insert(leftMostV); + /*find the last k>=j such that + *lowerverts[k][0] < upperverts[i][0]*/ + k=j; + while(k< n_lower) + { + if(lowerVerts[k][0] >= upperVerts[i][0]) + break; + pStream->insert(lowerVerts[k]); + k++; + } + pStream->end(PRIMITIVE_STREAM_FAN); + j=k; + leftMostV = lowerVerts[j-1]; + } + } + } +} + + +void stripOfFanLeft(vertexArray* leftChain, + Int largeIndex, + Int smallIndex, + gridWrap* grid, + Int vlineIndex, + Int ulineSmallIndex, + Int ulineLargeIndex, + primStream* pStream, + Int gridLineUp /*1 if the grid line is above the trim lines*/ + ) +{ + assert(largeIndex >= smallIndex); + + Real grid_v_value; + grid_v_value = grid->get_v_value(vlineIndex); + + Real2* trimVerts=(Real2*) malloc(sizeof(Real2)* (largeIndex-smallIndex+1)); + assert(trimVerts); + + + Real2* gridVerts=(Real2*) malloc(sizeof(Real2)* (ulineLargeIndex-ulineSmallIndex+1)); + assert(gridVerts); + + Int k,i; + if(gridLineUp) /*trim line is below grid line, so trim vertices are going right when index increases*/ + for(k=0, i=smallIndex; i<=largeIndex; i++, k++) + { + trimVerts[k][0] = leftChain->getVertex(i)[0]; + trimVerts[k][1] = leftChain->getVertex(i)[1]; + } + else + for(k=0, i=largeIndex; i>=smallIndex; i--, k++) + { + trimVerts[k][0] = leftChain->getVertex(i)[0]; + trimVerts[k][1] = leftChain->getVertex(i)[1]; + } + + for(k=0, i=ulineSmallIndex; i<= ulineLargeIndex; i++, k++) + { + gridVerts[k][0] = grid->get_u_value(i); + gridVerts[k][1] = grid_v_value; + } + + if(gridLineUp) + triangulateXYMono( + ulineLargeIndex-ulineSmallIndex+1, gridVerts, + largeIndex-smallIndex+1, trimVerts, + pStream); + else + triangulateXYMono(largeIndex-smallIndex+1, trimVerts, + ulineLargeIndex-ulineSmallIndex+1, gridVerts, + pStream); + free(trimVerts); + free(gridVerts); +} + + + + + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,184 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SAMPLEMONOPOLY_H +#define _SAMPLEMONOPOLY_H + +#include "monoTriangulation.h" +#include "gridWrap.h" +#include "rectBlock.h" + + +void triangulateXYMono(Int n_upper, Real upperVerts[][2], + Int n_lower, Real lowerVerts[][2], + primStream* pStream); + +void stripOfFanLeft(vertexArray* leftChain, + Int largeIndex, + Int smallIndex, + gridWrap* grid, + Int vlineIndex, + Int ulineSmallIndex, + Int ulineLargeIndex, + primStream* pStream, + Int gridLineUp + ); +void sampleLeftOneGridStep(vertexArray* leftChain, + Int beginLeftIndex, + Int endLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + primStream* pStream + ); + +void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], + gridBoundaryChain* gridChain, + Int beginIndex, + Int endIndex, + primStream* pStream); + +void sampleLeftStripRec(vertexArray* leftChain, + Int topLeftIndex, + Int botLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + Int leftGridChainEndIndex, + primStream* pStream + ); + +void sampleLeftStrip(vertexArray* leftChain, + Int topLeftIndex, + Int botLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + Int leftGridChainEndIndex, + primStream* pStream + ); + +void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_inner); + +void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_inner); + +void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlinear, primStream *pStream, rectBlockArray* rbArray); + +void sampleMonoPolyRec( + Real* topVertex, + Real* botVertex, + vertexArray* leftChain, + Int leftStartIndex, + vertexArray* rightChain, + Int rightStartIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridStartIndex, + primStream* pStream, + rectBlockArray* rbArray + ); + +void sampleLeftStripRecF(vertexArray* leftChain, + Int topLeftIndex, + Int botLeftIndex, + gridBoundaryChain* leftGridChain, + Int leftGridChainStartIndex, + Int leftGridChainEndIndex, + primStream* pStream + ); + +void findUpCorners(Real *topVertex, + vertexArray *leftChain, + Int leftChainStartIndex, Int leftChainEndIndex, + vertexArray *rightChain, + Int rightChainStartIndex, Int rightChainEndIndex, + Real v, + Real uleft, + Real uright, + Int& ret_leftCornerWhere, + Int& ret_leftCornerIndex, + Int& ret_rightCornerWhere, + Int& ret_rightCornerIndex + ); +void findDownCorners(Real *botVertex, + vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, + vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, + Real v, + Real uleft, + Real uright, + Int& ret_leftCornerWhere, + Int& ret_leftCornerIndex, + Int& ret_rightCornerWhere, + Int& ret_rightCornerIndex + ); +void findNeck(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, + Int& leftLastIndex, /*left point of the neck*/ + Int& rightLastIndex /*right point of the neck*/ + ); + +Int findNeckF(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridStartIndex, + Int& neckLeft, + Int& neckRight); + +void findTopAndBot(directedLine* polygon, + directedLine*& topV, + directedLine*& botV); +void findGridChains(directedLine* top, directedLine* bot, + gridWrap* grid, + gridBoundaryChain*& leftGridChain, + gridBoundaryChain*& rightGridChain); +void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain); + +void drawCorners( + Real* topV, Real* botV, + vertexArray* leftChain, + vertexArray* rightChain, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, + Int gridIndex1, + Int gridIndex2, + Int leftCornerWhere, + Int leftCornerIndex, + Int rightCornerWhere, + Int rightCornerIndex, + Int bot_leftCornerWhere, + Int bot_leftCornerIndex, + Int bot_rightCornerWhere, + Int bot_rightCornerIndex); + +Int checkMiddle(vertexArray* chain, Int begin, Int end, + Real vup, Real vbelow); + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.cc xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.cc --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.cc 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.cc 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,282 @@ +/* +** 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: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. 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. +** +*/ +/* +*/ + +#include +#include +#include "zlassert.h" + +#include "searchTree.h" + +#define max(a,b) ((a>b)? a:b) + +treeNode* TreeNodeMake(void *key) +{ + treeNode *ret = (treeNode*) malloc(sizeof(treeNode)); + assert(ret); + ret->key = key; + ret->parent = NULL; + ret->left = NULL; + ret->right = NULL; + return ret; +} + +void TreeNodeDeleteSingleNode(treeNode* node) +{ + free(node); +} + +void TreeNodeDeleteWholeTree(treeNode* node) +{ + if(node == NULL) return; + TreeNodeDeleteWholeTree(node->left); + TreeNodeDeleteWholeTree(node->right); + TreeNodeDeleteSingleNode(node); +} + +void TreeNodePrint(treeNode* node, + void (*keyPrint) (void*)) +{ + if(node ==NULL) return; + TreeNodePrint(node->left, keyPrint); + keyPrint(node->key); + TreeNodePrint(node->right, keyPrint); +} + +int TreeNodeDepth(treeNode* root) +{ + if(root == NULL) return 0; + else{ + int leftdepth = TreeNodeDepth(root->left); + int rightdepth = TreeNodeDepth(root->right); + return 1 + max(leftdepth, rightdepth); + } +} + +/*return the node with the key. + *NULL is returned if not found + */ +treeNode* TreeNodeFind(treeNode* tree, void* key, + int (*compkey) (void*, void*)) +{ + if(tree == NULL) + return NULL; + if(key == tree->key) + return tree; + else if(compkey(key, tree->key) < 0) + return TreeNodeFind(tree->left, key, compkey); + else + return TreeNodeFind(tree->right, key, compkey); +} + + +treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode, + int (*compkey) (void *, void *)) +{ + treeNode *y = NULL; + treeNode *x = root; + /*going down the tree from the root. + *x traces the path, y is the parent of x. + */ + while (x != NULL){ + y = x; + if(compkey(newnode->key,x->key) < 0) /*if newnode < x*/ + x = x->left; + else + x = x->right; + } + + /*now y has the property that + * if newnode < y, then y->left is NULL + * if newnode > y, then y->right is NULL. + *So we want to isnert newnode to be the child of y + */ + newnode->parent = y; + if(y == NULL) + return newnode; + else if( compkey(newnode->key, y->key) <0) + { + y->left = newnode; + } + else + { + y->right = newnode; + } + + return root; +} + +treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) +{ + treeNode* y; + treeNode* x; + treeNode* ret; + if(node==NULL) return tree; + + if(node->left == NULL || node->right == NULL) { + + y = node; + if(y->left != NULL) + x = y->left; + else + x = y->right; + + if( x != NULL) + x->parent = y->parent; + + if(y->parent == NULL) /*y is the root which has at most one child x*/ + ret = x; + else /*y is not the root*/ + { + if(y == y->parent->left) + y->parent->left = x; + else + y->parent->right = x; + ret = tree; + } + } + else { /*node has two children*/ + + y = TreeNodeSuccessor(node); + assert(y->left == NULL); + + if(y == node->right) /*y is the right child if node*/ + { + y->parent = node->parent; + y->left = node->left; + node->left->parent = y; + + } + else /*y != node->right*/ + { + x = y->right; + if(x!= NULL) + x->parent = y->parent; + + assert(y->parent != NULL); + if(y == y->parent->left) + y->parent->left = x; + else + y->parent->right = x; + /*move y to the position of node*/ + y->parent = node->parent; + y->left = node->left; + y->right = node->right; + node->left->parent = y; + node->right->parent = y; + } + if(node->parent != NULL) { + if(node->parent->left == node) + node->parent->left = y; + else + node->parent->right = y; + ret = tree; /*the root if the tree doesn't change*/ + } + else /*node->parent is NULL: node is the root*/ + ret = y; + } + + /*finally free the node, and return the new root*/ + TreeNodeDeleteSingleNode(node); + return ret; +} + + +/*the minimum node in the tree rooted by node + */ +treeNode* TreeNodeMinimum(treeNode* node) +{ + treeNode* temp = node; + if(temp == NULL) return NULL; + while(temp->left != NULL) { + temp = temp->left; + } + return temp; +} + +/*the maximum node in the tree rooted by node + */ +treeNode* TreeNodeMaximum(treeNode* node) +{ + treeNode* temp = node; + if(temp == NULL) return NULL; + while(temp->right != NULL) { + temp = temp->right; + } + return temp; +} + +/*return the first node (in sorted order) which is to the right of this node + */ +treeNode* TreeNodeSuccessor(treeNode* node) +{ + if(node == NULL) return NULL; + if(node->right != NULL) + return TreeNodeMinimum(node->right); + else{ /*node->right is NULL*/ + + /*find the first right-ancestor*/ + treeNode *y = node->parent; + treeNode* x = node; + while(y != NULL && x == y->right) /*if y is a left parent of x*/ + { + + x = y; + y = y->parent; + } + return y; + } +} + +/*return the first node (in sorted order) which is to the left of this node + */ +treeNode* TreeNodePredecessor(treeNode* node) +{ + if(node == NULL) return NULL; + if(node->left != NULL) + return TreeNodeMaximum(node->left); + else{ /*node->left is NULL*/ + /*find the first left-ancestor*/ + treeNode *y = node->parent; + treeNode *x = node; + while(y != NULL && x == y->left) /*if y is a right parent of x*/ + { + x = y; + y = y->parent; + } + return y; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,61 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +#ifndef _SEARCHTREE_H +#define _SEARCHTREE_H + +typedef struct treeNode{ + void *key; + struct treeNode* parent; + struct treeNode* left; /*children*/ + struct treeNode* right; +} treeNode; + +treeNode* TreeNodeMake(void *key); +void TreeNodeDeleteSingleNode(treeNode* node); +void TreeNodeDeleteWholeTree(treeNode* node); +void TreeNodePrint(treeNode* node, + void (*keyPrint) (void*)); +int TreeNodeDepth(treeNode* root); +treeNode* TreeNodeMinimum(treeNode* node); +treeNode* TreeNodeMaximum(treeNode* node); +treeNode* TreeNodePredecessor(treeNode* node); +treeNode* TreeNodeSuccessor(treeNode* node); +treeNode* TreeNodeFind(treeNode* tree, void* key, + int (*compkey) (void*, void*)); + +treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode, + int (*comp) (void *, void *)); +treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node); + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/zlassert.h xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/zlassert.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/zlassert.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libnurbs/nurbtess/zlassert.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,34 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +*/ + +/*XXXblythe this file should be deleted*/ +#include diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/alg-outline xpsb-glx-0.19/mesa/src/glu/sgi/libtess/alg-outline --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/alg-outline 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/alg-outline 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,228 @@ +/* +*/ + +This is only a very brief overview. There is quite a bit of +additional documentation in the source code itself. + + +Goals of robust tesselation +--------------------------- + +The tesselation algorithm is fundamentally a 2D algorithm. We +initially project all data into a plane; our goal is to robustly +tesselate the projected data. The same topological tesselation is +then applied to the input data. + +Topologically, the output should always be a tesselation. If the +input is even slightly non-planar, then some triangles will +necessarily be back-facing when viewed from some angles, but the goal +is to minimize this effect. + +The algorithm needs some capability of cleaning up the input data as +well as the numerical errors in its own calculations. One way to do +this is to specify a tolerance as defined above, and clean up the +input and output during the line sweep process. At the very least, +the algorithm must handle coincident vertices, vertices incident to an +edge, and coincident edges. + + +Phases of the algorithm +----------------------- + +1. Find the polygon normal N. +2. Project the vertex data onto a plane. It does not need to be + perpendicular to the normal, eg. we can project onto the plane + perpendicular to the coordinate axis whose dot product with N + is largest. +3. Using a line-sweep algorithm, partition the plane into x-monotone + regions. Any vertical line intersects an x-monotone region in + at most one interval. +4. Triangulate the x-monotone regions. +5. Group the triangles into strips and fans. + + +Finding the normal vector +------------------------- + +A common way to find a polygon normal is to compute the signed area +when the polygon is projected along the three coordinate axes. We +can't do this, since contours can have zero area without being +degenerate (eg. a bowtie). + +We fit a plane to the vertex data, ignoring how they are connected +into contours. Ideally this would be a least-squares fit; however for +our purpose the accuracy of the normal is not important. Instead we +find three vertices which are widely separated, and compute the normal +to the triangle they form. The vertices are chosen so that the +triangle has an area at least 1/sqrt(3) times the largest area of any +triangle formed using the input vertices. + +The contours do affect the orientation of the normal; after computing +the normal, we check that the sum of the signed contour areas is +non-negative, and reverse the normal if necessary. + + +Projecting the vertices +----------------------- + +We project the vertices onto a plane perpendicular to one of the three +coordinate axes. This helps numerical accuracy by removing a +transformation step between the original input data and the data +processed by the algorithm. The projection also compresses the input +data; the 2D distance between vertices after projection may be smaller +than the original 2D distance. However by choosing the coordinate +axis whose dot product with the normal is greatest, the compression +factor is at most 1/sqrt(3). + +Even though the *accuracy* of the normal is not that important (since +we are projecting perpendicular to a coordinate axis anyway), the +*robustness* of the computation is important. For example, if there +are many vertices which lie almost along a line, and one vertex V +which is well-separated from the line, then our normal computation +should involve V otherwise the results will be garbage. + +The advantage of projecting perpendicular to the polygon normal is +that computed intersection points will be as close as possible to +their ideal locations. To get this behavior, define TRUE_PROJECT. + + +The Line Sweep +-------------- + +There are three data structures: the mesh, the event queue, and the +edge dictionary. + +The mesh is a "quad-edge" data structure which records the topology of +the current decomposition; for details see the include file "mesh.h". + +The event queue simply holds all vertices (both original and computed +ones), organized so that we can quickly extract the vertex with the +minimum x-coord (and among those, the one with the minimum y-coord). + +The edge dictionary describes the current intersection of the sweep +line with the regions of the polygon. This is just an ordering of the +edges which intersect the sweep line, sorted by their current order of +intersection. For each pair of edges, we store some information about +the monotone region between them -- these are call "active regions" +(since they are crossed by the current sweep line). + +The basic algorithm is to sweep from left to right, processing each +vertex. The processed portion of the mesh (left of the sweep line) is +a planar decomposition. As we cross each vertex, we update the mesh +and the edge dictionary, then we check any newly adjacent pairs of +edges to see if they intersect. + +A vertex can have any number of edges. Vertices with many edges can +be created as vertices are merged and intersection points are +computed. For unprocessed vertices (right of the sweep line), these +edges are in no particular order around the vertex; for processed +vertices, the topological ordering should match the geometric ordering. + +The vertex processing happens in two phases: first we process are the +left-going edges (all these edges are currently in the edge +dictionary). This involves: + + - deleting the left-going edges from the dictionary; + - relinking the mesh if necessary, so that the order of these edges around + the event vertex matches the order in the dictionary; + - marking any terminated regions (regions which lie between two left-going + edges) as either "inside" or "outside" according to their winding number. + +When there are no left-going edges, and the event vertex is in an +"interior" region, we need to add an edge (to split the region into +monotone pieces). To do this we simply join the event vertex to the +rightmost left endpoint of the upper or lower edge of the containing +region. + +Then we process the right-going edges. This involves: + + - inserting the edges in the edge dictionary; + - computing the winding number of any newly created active regions. + We can compute this incrementally using the winding of each edge + that we cross as we walk through the dictionary. + - relinking the mesh if necessary, so that the order of these edges around + the event vertex matches the order in the dictionary; + - checking any newly adjacent edges for intersection and/or merging. + +If there are no right-going edges, again we need to add one to split +the containing region into monotone pieces. In our case it is most +convenient to add an edge to the leftmost right endpoint of either +containing edge; however we may need to change this later (see the +code for details). + + +Invariants +---------- + +These are the most important invariants maintained during the sweep. +We define a function VertLeq(v1,v2) which defines the order in which +vertices cross the sweep line, and a function EdgeLeq(e1,e2; loc) +which says whether e1 is below e2 at the sweep event location "loc". +This function is defined only at sweep event locations which lie +between the rightmost left endpoint of {e1,e2}, and the leftmost right +endpoint of {e1,e2}. + +Invariants for the Edge Dictionary. + + - Each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2) + at any valid location of the sweep event. + - If EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2 + share a common endpoint. + - For each e in the dictionary, e->Dst has been processed but not e->Org. + - Each edge e satisfies VertLeq(e->Dst,event) && VertLeq(event,e->Org) + where "event" is the current sweep line event. + - No edge e has zero length. + - No two edges have identical left and right endpoints. + +Invariants for the Mesh (the processed portion). + + - The portion of the mesh left of the sweep line is a planar graph, + ie. there is *some* way to embed it in the plane. + - No processed edge has zero length. + - No two processed vertices have identical coordinates. + - Each "inside" region is monotone, ie. can be broken into two chains + of monotonically increasing vertices according to VertLeq(v1,v2) + - a non-invariant: these chains may intersect (slightly) due to + numerical errors, but this does not affect the algorithm's operation. + +Invariants for the Sweep. + + - If a vertex has any left-going edges, then these must be in the edge + dictionary at the time the vertex is processed. + - If an edge is marked "fixUpperEdge" (it is a temporary edge introduced + by ConnectRightVertex), then it is the only right-going edge from + its associated vertex. (This says that these edges exist only + when it is necessary.) + + +Robustness +---------- + +The key to the robustness of the algorithm is maintaining the +invariants above, especially the correct ordering of the edge +dictionary. We achieve this by: + + 1. Writing the numerical computations for maximum precision rather + than maximum speed. + + 2. Making no assumptions at all about the results of the edge + intersection calculations -- for sufficiently degenerate inputs, + the computed location is not much better than a random number. + + 3. When numerical errors violate the invariants, restore them + by making *topological* changes when necessary (ie. relinking + the mesh structure). + + +Triangulation and Grouping +-------------------------- + +We finish the line sweep before doing any triangulation. This is +because even after a monotone region is complete, there can be further +changes to its vertex data because of further vertex merging. + +After triangulating all monotone regions, we want to group the +triangles into fans and strips. We do this using a greedy approach. +The triangulation itself is not optimized to reduce the number of +primitives; we just try to get a reasonable decomposition of the +computed triangulation. diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,111 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include +#include "dict-list.h" +#include "memalloc.h" + +/* really __gl_dictListNewDict */ +Dict *dictNewDict( void *frame, + int (*leq)(void *frame, DictKey key1, DictKey key2) ) +{ + Dict *dict = (Dict *) memAlloc( sizeof( Dict )); + DictNode *head; + + if (dict == NULL) return NULL; + + head = &dict->head; + + head->key = NULL; + head->next = head; + head->prev = head; + + dict->frame = frame; + dict->leq = leq; + + return dict; +} + +/* really __gl_dictListDeleteDict */ +void dictDeleteDict( Dict *dict ) +{ + DictNode *node, *next; + + for( node = dict->head.next; node != &dict->head; node = next ) { + next = node->next; + memFree( node ); + } + memFree( dict ); +} + +/* really __gl_dictListInsertBefore */ +DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key ) +{ + DictNode *newNode; + + do { + node = node->prev; + } while( node->key != NULL && ! (*dict->leq)(dict->frame, node->key, key)); + + newNode = (DictNode *) memAlloc( sizeof( DictNode )); + if (newNode == NULL) return NULL; + + newNode->key = key; + newNode->next = node->next; + node->next->prev = newNode; + newNode->prev = node; + node->next = newNode; + + return newNode; +} + +/* really __gl_dictListDelete */ +void dictDelete( Dict *dict, DictNode *node ) /*ARGSUSED*/ +{ + node->next->prev = node->prev; + node->prev->next = node->next; + memFree( node ); +} + +/* really __gl_dictListSearch */ +DictNode *dictSearch( Dict *dict, DictKey key ) +{ + DictNode *node = &dict->head; + + do { + node = node->next; + } while( node->key != NULL && ! (*dict->leq)(dict->frame, key, node->key)); + + return node; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,100 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __dict_list_h_ +#define __dict_list_h_ + +/* Use #define's so that another heap implementation can use this one */ + +#define DictKey DictListKey +#define Dict DictList +#define DictNode DictListNode + +#define dictNewDict(frame,leq) __gl_dictListNewDict(frame,leq) +#define dictDeleteDict(dict) __gl_dictListDeleteDict(dict) + +#define dictSearch(dict,key) __gl_dictListSearch(dict,key) +#define dictInsert(dict,key) __gl_dictListInsert(dict,key) +#define dictInsertBefore(dict,node,key) __gl_dictListInsertBefore(dict,node,key) +#define dictDelete(dict,node) __gl_dictListDelete(dict,node) + +#define dictKey(n) __gl_dictListKey(n) +#define dictSucc(n) __gl_dictListSucc(n) +#define dictPred(n) __gl_dictListPred(n) +#define dictMin(d) __gl_dictListMin(d) +#define dictMax(d) __gl_dictListMax(d) + + + +typedef void *DictKey; +typedef struct Dict Dict; +typedef struct DictNode DictNode; + +Dict *dictNewDict( + void *frame, + int (*leq)(void *frame, DictKey key1, DictKey key2) ); + +void dictDeleteDict( Dict *dict ); + +/* Search returns the node with the smallest key greater than or equal + * to the given key. If there is no such key, returns a node whose + * key is NULL. Similarly, Succ(Max(d)) has a NULL key, etc. + */ +DictNode *dictSearch( Dict *dict, DictKey key ); +DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key ); +void dictDelete( Dict *dict, DictNode *node ); + +#define __gl_dictListKey(n) ((n)->key) +#define __gl_dictListSucc(n) ((n)->next) +#define __gl_dictListPred(n) ((n)->prev) +#define __gl_dictListMin(d) ((d)->head.next) +#define __gl_dictListMax(d) ((d)->head.prev) +#define __gl_dictListInsert(d,k) (dictInsertBefore((d),&(d)->head,(k))) + + +/*** Private data structures ***/ + +struct DictNode { + DictKey key; + DictNode *next; + DictNode *prev; +}; + +struct Dict { + DictNode head; + void *frame; + int (*leq)(void *frame, DictKey key1, DictKey key2); +}; + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict-list.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict-list.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict-list.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/dict-list.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,100 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __dict_list_h_ +#define __dict_list_h_ + +/* Use #define's so that another heap implementation can use this one */ + +#define DictKey DictListKey +#define Dict DictList +#define DictNode DictListNode + +#define dictNewDict(frame,leq) __gl_dictListNewDict(frame,leq) +#define dictDeleteDict(dict) __gl_dictListDeleteDict(dict) + +#define dictSearch(dict,key) __gl_dictListSearch(dict,key) +#define dictInsert(dict,key) __gl_dictListInsert(dict,key) +#define dictInsertBefore(dict,node,key) __gl_dictListInsertBefore(dict,node,key) +#define dictDelete(dict,node) __gl_dictListDelete(dict,node) + +#define dictKey(n) __gl_dictListKey(n) +#define dictSucc(n) __gl_dictListSucc(n) +#define dictPred(n) __gl_dictListPred(n) +#define dictMin(d) __gl_dictListMin(d) +#define dictMax(d) __gl_dictListMax(d) + + + +typedef void *DictKey; +typedef struct Dict Dict; +typedef struct DictNode DictNode; + +Dict *dictNewDict( + void *frame, + int (*leq)(void *frame, DictKey key1, DictKey key2) ); + +void dictDeleteDict( Dict *dict ); + +/* Search returns the node with the smallest key greater than or equal + * to the given key. If there is no such key, returns a node whose + * key is NULL. Similarly, Succ(Max(d)) has a NULL key, etc. + */ +DictNode *dictSearch( Dict *dict, DictKey key ); +DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key ); +void dictDelete( Dict *dict, DictNode *node ); + +#define __gl_dictListKey(n) ((n)->key) +#define __gl_dictListSucc(n) ((n)->next) +#define __gl_dictListPred(n) ((n)->prev) +#define __gl_dictListMin(d) ((d)->head.next) +#define __gl_dictListMax(d) ((d)->head.prev) +#define __gl_dictListInsert(d,k) (dictInsertBefore((d),&(d)->head,(k))) + + +/*** Private data structures ***/ + +struct DictNode { + DictKey key; + DictNode *next; + DictNode *prev; +}; + +struct Dict { + DictNode head; + void *frame; + int (*leq)(void *frame, DictKey key1, DictKey key2); +}; + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,264 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include "mesh.h" +#include "geom.h" + +int __gl_vertLeq( GLUvertex *u, GLUvertex *v ) +{ + /* Returns TRUE if u is lexicographically <= v. */ + + return VertLeq( u, v ); +} + +GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) +{ + /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w), + * evaluates the t-coord of the edge uw at the s-coord of the vertex v. + * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v. + * If uw is vertical (and thus passes thru v), the result is zero. + * + * The calculation is extremely accurate and stable, even when v + * is very close to u or w. In particular if we set v->t = 0 and + * let r be the negated result (this evaluates (uw)(v->s)), then + * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t). + */ + GLdouble gapL, gapR; + + assert( VertLeq( u, v ) && VertLeq( v, w )); + + gapL = v->s - u->s; + gapR = w->s - v->s; + + if( gapL + gapR > 0 ) { + if( gapL < gapR ) { + return (v->t - u->t) + (u->t - w->t) * (gapL / (gapL + gapR)); + } else { + return (v->t - w->t) + (w->t - u->t) * (gapR / (gapL + gapR)); + } + } + /* vertical line */ + return 0; +} + +GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) +{ + /* Returns a number whose sign matches EdgeEval(u,v,w) but which + * is cheaper to evaluate. Returns > 0, == 0 , or < 0 + * as v is above, on, or below the edge uw. + */ + GLdouble gapL, gapR; + + assert( VertLeq( u, v ) && VertLeq( v, w )); + + gapL = v->s - u->s; + gapR = w->s - v->s; + + if( gapL + gapR > 0 ) { + return (v->t - w->t) * gapL + (v->t - u->t) * gapR; + } + /* vertical line */ + return 0; +} + + +/*********************************************************************** + * Define versions of EdgeSign, EdgeEval with s and t transposed. + */ + +GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) +{ + /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w), + * evaluates the t-coord of the edge uw at the s-coord of the vertex v. + * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v. + * If uw is vertical (and thus passes thru v), the result is zero. + * + * The calculation is extremely accurate and stable, even when v + * is very close to u or w. In particular if we set v->s = 0 and + * let r be the negated result (this evaluates (uw)(v->t)), then + * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s). + */ + GLdouble gapL, gapR; + + assert( TransLeq( u, v ) && TransLeq( v, w )); + + gapL = v->t - u->t; + gapR = w->t - v->t; + + if( gapL + gapR > 0 ) { + if( gapL < gapR ) { + return (v->s - u->s) + (u->s - w->s) * (gapL / (gapL + gapR)); + } else { + return (v->s - w->s) + (w->s - u->s) * (gapR / (gapL + gapR)); + } + } + /* vertical line */ + return 0; +} + +GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) +{ + /* Returns a number whose sign matches TransEval(u,v,w) but which + * is cheaper to evaluate. Returns > 0, == 0 , or < 0 + * as v is above, on, or below the edge uw. + */ + GLdouble gapL, gapR; + + assert( TransLeq( u, v ) && TransLeq( v, w )); + + gapL = v->t - u->t; + gapR = w->t - v->t; + + if( gapL + gapR > 0 ) { + return (v->s - w->s) * gapL + (v->s - u->s) * gapR; + } + /* vertical line */ + return 0; +} + + +int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w ) +{ + /* For almost-degenerate situations, the results are not reliable. + * Unless the floating-point arithmetic can be performed without + * rounding errors, *any* implementation will give incorrect results + * on some degenerate inputs, so the client must have some way to + * handle this situation. + */ + return (u->s*(v->t - w->t) + v->s*(w->t - u->t) + w->s*(u->t - v->t)) >= 0; +} + +/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b), + * or (x+y)/2 if a==b==0. It requires that a,b >= 0, and enforces + * this in the rare case that one argument is slightly negative. + * The implementation is extremely stable numerically. + * In particular it guarantees that the result r satisfies + * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate + * even when a and b differ greatly in magnitude. + */ +#define RealInterpolate(a,x,b,y) \ + (a = (a < 0) ? 0 : a, b = (b < 0) ? 0 : b, \ + ((a <= b) ? ((b == 0) ? ((x+y) / 2) \ + : (x + (y-x) * (a/(a+b)))) \ + : (y + (x-y) * (b/(a+b))))) + +#ifndef FOR_TRITE_TEST_PROGRAM +#define Interpolate(a,x,b,y) RealInterpolate(a,x,b,y) +#else + +/* Claim: the ONLY property the sweep algorithm relies on is that + * MIN(x,y) <= r <= MAX(x,y). This is a nasty way to test that. + */ +#include +extern int RandomInterpolate; + +GLdouble Interpolate( GLdouble a, GLdouble x, GLdouble b, GLdouble y) +{ +printf("*********************%d\n",RandomInterpolate); + if( RandomInterpolate ) { + a = 1.2 * drand48() - 0.1; + a = (a < 0) ? 0 : ((a > 1) ? 1 : a); + b = 1.0 - a; + } + return RealInterpolate(a,x,b,y); +} + +#endif + +#define Swap(a,b) if (1) { GLUvertex *t = a; a = b; b = t; } else + +void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1, + GLUvertex *o2, GLUvertex *d2, + GLUvertex *v ) +/* Given edges (o1,d1) and (o2,d2), compute their point of intersection. + * The computed point is guaranteed to lie in the intersection of the + * bounding rectangles defined by each edge. + */ +{ + GLdouble z1, z2; + + /* This is certainly not the most efficient way to find the intersection + * of two line segments, but it is very numerically stable. + * + * Strategy: find the two middle vertices in the VertLeq ordering, + * and interpolate the intersection s-value from these. Then repeat + * using the TransLeq ordering to find the intersection t-value. + */ + + if( ! VertLeq( o1, d1 )) { Swap( o1, d1 ); } + if( ! VertLeq( o2, d2 )) { Swap( o2, d2 ); } + if( ! VertLeq( o1, o2 )) { Swap( o1, o2 ); Swap( d1, d2 ); } + + if( ! VertLeq( o2, d1 )) { + /* Technically, no intersection -- do our best */ + v->s = (o2->s + d1->s) / 2; + } else if( VertLeq( d1, d2 )) { + /* Interpolate between o2 and d1 */ + z1 = EdgeEval( o1, o2, d1 ); + z2 = EdgeEval( o2, d1, d2 ); + if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } + v->s = Interpolate( z1, o2->s, z2, d1->s ); + } else { + /* Interpolate between o2 and d2 */ + z1 = EdgeSign( o1, o2, d1 ); + z2 = -EdgeSign( o1, d2, d1 ); + if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } + v->s = Interpolate( z1, o2->s, z2, d2->s ); + } + + /* Now repeat the process for t */ + + if( ! TransLeq( o1, d1 )) { Swap( o1, d1 ); } + if( ! TransLeq( o2, d2 )) { Swap( o2, d2 ); } + if( ! TransLeq( o1, o2 )) { Swap( o1, o2 ); Swap( d1, d2 ); } + + if( ! TransLeq( o2, d1 )) { + /* Technically, no intersection -- do our best */ + v->t = (o2->t + d1->t) / 2; + } else if( TransLeq( d1, d2 )) { + /* Interpolate between o2 and d1 */ + z1 = TransEval( o1, o2, d1 ); + z2 = TransEval( o2, d1, d2 ); + if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } + v->t = Interpolate( z1, o2->t, z2, d1->t ); + } else { + /* Interpolate between o2 and d2 */ + z1 = TransSign( o1, o2, d1 ); + z2 = -TransSign( o1, d2, d1 ); + if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } + v->t = Interpolate( z1, o2->t, z2, d2->t ); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/geom.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,84 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __geom_h_ +#define __geom_h_ + +#include "mesh.h" + +#ifdef NO_BRANCH_CONDITIONS +/* MIPS architecture has special instructions to evaluate boolean + * conditions -- more efficient than branching, IF you can get the + * compiler to generate the right instructions (SGI compiler doesn't) + */ +#define VertEq(u,v) (((u)->s == (v)->s) & ((u)->t == (v)->t)) +#define VertLeq(u,v) (((u)->s < (v)->s) | \ + ((u)->s == (v)->s & (u)->t <= (v)->t)) +#else +#define VertEq(u,v) ((u)->s == (v)->s && (u)->t == (v)->t) +#define VertLeq(u,v) (((u)->s < (v)->s) || \ + ((u)->s == (v)->s && (u)->t <= (v)->t)) +#endif + +#define EdgeEval(u,v,w) __gl_edgeEval(u,v,w) +#define EdgeSign(u,v,w) __gl_edgeSign(u,v,w) + +/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */ + +#define TransLeq(u,v) (((u)->t < (v)->t) || \ + ((u)->t == (v)->t && (u)->s <= (v)->s)) +#define TransEval(u,v,w) __gl_transEval(u,v,w) +#define TransSign(u,v,w) __gl_transSign(u,v,w) + + +#define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org ) +#define EdgeGoesRight(e) VertLeq( (e)->Org, (e)->Dst ) + +#undef ABS +#define ABS(x) ((x) < 0 ? -(x) : (x)) +#define VertL1dist(u,v) (ABS(u->s - v->s) + ABS(u->t - v->t)) + +#define VertCCW(u,v,w) __gl_vertCCW(u,v,w) + +int __gl_vertLeq( GLUvertex *u, GLUvertex *v ); +GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ); +GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ); +GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ); +GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ); +int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w ); +void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1, + GLUvertex *o2, GLUvertex *d2, + GLUvertex *v ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,55 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "memalloc.h" +#include "string.h" + +int __gl_memInit( size_t maxFast ) +{ +#ifndef NO_MALLOPT +/* mallopt( M_MXFAST, maxFast );*/ +#ifdef MEMORY_DEBUG + mallopt( M_DEBUG, 1 ); +#endif +#endif + return 1; +} + +#ifdef MEMORY_DEBUG +void *__gl_memAlloc( size_t n ) +{ + return memset( malloc( n ), 0xa5, n ); +} +#endif + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/memalloc.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,54 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __memalloc_simple_h_ +#define __memalloc_simple_h_ + +#include + +#define memRealloc realloc +#define memFree free + +#define memInit __gl_memInit +/*extern void __gl_memInit( size_t );*/ +extern int __gl_memInit( size_t ); + +#ifndef MEMORY_DEBUG +#define memAlloc malloc +#else +#define memAlloc __gl_memAlloc +extern void * __gl_memAlloc( size_t ); +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,789 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include +#include "mesh.h" +#include "memalloc.h" + +#define TRUE 1 +#define FALSE 0 + +static GLUvertex *allocVertex() +{ + return (GLUvertex *)memAlloc( sizeof( GLUvertex )); +} + +static GLUface *allocFace() +{ + return (GLUface *)memAlloc( sizeof( GLUface )); +} + +/************************ Utility Routines ************************/ + +/* Allocate and free half-edges in pairs for efficiency. + * The *only* place that should use this fact is allocation/free. + */ +typedef struct { GLUhalfEdge e, eSym; } EdgePair; + +/* MakeEdge creates a new pair of half-edges which form their own loop. + * No vertex or face structures are allocated, but these must be assigned + * before the current edge operation is completed. + */ +static GLUhalfEdge *MakeEdge( GLUhalfEdge *eNext ) +{ + GLUhalfEdge *e; + GLUhalfEdge *eSym; + GLUhalfEdge *ePrev; + EdgePair *pair = (EdgePair *)memAlloc( sizeof( EdgePair )); + if (pair == NULL) return NULL; + + e = &pair->e; + eSym = &pair->eSym; + + /* Make sure eNext points to the first edge of the edge pair */ + if( eNext->Sym < eNext ) { eNext = eNext->Sym; } + + /* Insert in circular doubly-linked list before eNext. + * Note that the prev pointer is stored in Sym->next. + */ + ePrev = eNext->Sym->next; + eSym->next = ePrev; + ePrev->Sym->next = e; + e->next = eNext; + eNext->Sym->next = eSym; + + e->Sym = eSym; + e->Onext = e; + e->Lnext = eSym; + e->Org = NULL; + e->Lface = NULL; + e->winding = 0; + e->activeRegion = NULL; + + eSym->Sym = e; + eSym->Onext = eSym; + eSym->Lnext = e; + eSym->Org = NULL; + eSym->Lface = NULL; + eSym->winding = 0; + eSym->activeRegion = NULL; + + return e; +} + +/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the + * CS348a notes (see mesh.h). Basically it modifies the mesh so that + * a->Onext and b->Onext are exchanged. This can have various effects + * depending on whether a and b belong to different face or vertex rings. + * For more explanation see __gl_meshSplice() below. + */ +static void Splice( GLUhalfEdge *a, GLUhalfEdge *b ) +{ + GLUhalfEdge *aOnext = a->Onext; + GLUhalfEdge *bOnext = b->Onext; + + aOnext->Sym->Lnext = b; + bOnext->Sym->Lnext = a; + a->Onext = bOnext; + b->Onext = aOnext; +} + +/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the + * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives + * a place to insert the new vertex in the global vertex list. We insert + * the new vertex *before* vNext so that algorithms which walk the vertex + * list will not see the newly created vertices. + */ +static void MakeVertex( GLUvertex *newVertex, + GLUhalfEdge *eOrig, GLUvertex *vNext ) +{ + GLUhalfEdge *e; + GLUvertex *vPrev; + GLUvertex *vNew = newVertex; + + assert(vNew != NULL); + + /* insert in circular doubly-linked list before vNext */ + vPrev = vNext->prev; + vNew->prev = vPrev; + vPrev->next = vNew; + vNew->next = vNext; + vNext->prev = vNew; + + vNew->anEdge = eOrig; + vNew->data = NULL; + /* leave coords, s, t undefined */ + + /* fix other edges on this vertex loop */ + e = eOrig; + do { + e->Org = vNew; + e = e->Onext; + } while( e != eOrig ); +} + +/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left + * face of all edges in the face loop to which eOrig belongs. "fNext" gives + * a place to insert the new face in the global face list. We insert + * the new face *before* fNext so that algorithms which walk the face + * list will not see the newly created faces. + */ +static void MakeFace( GLUface *newFace, GLUhalfEdge *eOrig, GLUface *fNext ) +{ + GLUhalfEdge *e; + GLUface *fPrev; + GLUface *fNew = newFace; + + assert(fNew != NULL); + + /* insert in circular doubly-linked list before fNext */ + fPrev = fNext->prev; + fNew->prev = fPrev; + fPrev->next = fNew; + fNew->next = fNext; + fNext->prev = fNew; + + fNew->anEdge = eOrig; + fNew->data = NULL; + fNew->trail = NULL; + fNew->marked = FALSE; + + /* The new face is marked "inside" if the old one was. This is a + * convenience for the common case where a face has been split in two. + */ + fNew->inside = fNext->inside; + + /* fix other edges on this face loop */ + e = eOrig; + do { + e->Lface = fNew; + e = e->Lnext; + } while( e != eOrig ); +} + +/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym), + * and removes from the global edge list. + */ +static void KillEdge( GLUhalfEdge *eDel ) +{ + GLUhalfEdge *ePrev, *eNext; + + /* Half-edges are allocated in pairs, see EdgePair above */ + if( eDel->Sym < eDel ) { eDel = eDel->Sym; } + + /* delete from circular doubly-linked list */ + eNext = eDel->next; + ePrev = eDel->Sym->next; + eNext->Sym->next = ePrev; + ePrev->Sym->next = eNext; + + memFree( eDel ); +} + + +/* KillVertex( vDel ) destroys a vertex and removes it from the global + * vertex list. It updates the vertex loop to point to a given new vertex. + */ +static void KillVertex( GLUvertex *vDel, GLUvertex *newOrg ) +{ + GLUhalfEdge *e, *eStart = vDel->anEdge; + GLUvertex *vPrev, *vNext; + + /* change the origin of all affected edges */ + e = eStart; + do { + e->Org = newOrg; + e = e->Onext; + } while( e != eStart ); + + /* delete from circular doubly-linked list */ + vPrev = vDel->prev; + vNext = vDel->next; + vNext->prev = vPrev; + vPrev->next = vNext; + + memFree( vDel ); +} + +/* KillFace( fDel ) destroys a face and removes it from the global face + * list. It updates the face loop to point to a given new face. + */ +static void KillFace( GLUface *fDel, GLUface *newLface ) +{ + GLUhalfEdge *e, *eStart = fDel->anEdge; + GLUface *fPrev, *fNext; + + /* change the left face of all affected edges */ + e = eStart; + do { + e->Lface = newLface; + e = e->Lnext; + } while( e != eStart ); + + /* delete from circular doubly-linked list */ + fPrev = fDel->prev; + fNext = fDel->next; + fNext->prev = fPrev; + fPrev->next = fNext; + + memFree( fDel ); +} + + +/****************** Basic Edge Operations **********************/ + +/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face). + * The loop consists of the two new half-edges. + */ +GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) +{ + GLUvertex *newVertex1= allocVertex(); + GLUvertex *newVertex2= allocVertex(); + GLUface *newFace= allocFace(); + GLUhalfEdge *e; + + /* if any one is null then all get freed */ + if (newVertex1 == NULL || newVertex2 == NULL || newFace == NULL) { + if (newVertex1 != NULL) memFree(newVertex1); + if (newVertex2 != NULL) memFree(newVertex2); + if (newFace != NULL) memFree(newFace); + return NULL; + } + + e = MakeEdge( &mesh->eHead ); + if (e == NULL) return NULL; + + MakeVertex( newVertex1, e, &mesh->vHead ); + MakeVertex( newVertex2, e->Sym, &mesh->vHead ); + MakeFace( newFace, e, &mesh->fHead ); + return e; +} + + +/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the + * mesh connectivity and topology. It changes the mesh so that + * eOrg->Onext <- OLD( eDst->Onext ) + * eDst->Onext <- OLD( eOrg->Onext ) + * where OLD(...) means the value before the meshSplice operation. + * + * This can have two effects on the vertex structure: + * - if eOrg->Org != eDst->Org, the two vertices are merged together + * - if eOrg->Org == eDst->Org, the origin is split into two vertices + * In both cases, eDst->Org is changed and eOrg->Org is untouched. + * + * Similarly (and independently) for the face structure, + * - if eOrg->Lface == eDst->Lface, one loop is split into two + * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one + * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected. + * + * Some special cases: + * If eDst == eOrg, the operation has no effect. + * If eDst == eOrg->Lnext, the new face will have a single edge. + * If eDst == eOrg->Lprev, the old face will have a single edge. + * If eDst == eOrg->Onext, the new vertex will have a single edge. + * If eDst == eOrg->Oprev, the old vertex will have a single edge. + */ +int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) +{ + int joiningLoops = FALSE; + int joiningVertices = FALSE; + + if( eOrg == eDst ) return 1; + + if( eDst->Org != eOrg->Org ) { + /* We are merging two disjoint vertices -- destroy eDst->Org */ + joiningVertices = TRUE; + KillVertex( eDst->Org, eOrg->Org ); + } + if( eDst->Lface != eOrg->Lface ) { + /* We are connecting two disjoint loops -- destroy eDst->Lface */ + joiningLoops = TRUE; + KillFace( eDst->Lface, eOrg->Lface ); + } + + /* Change the edge structure */ + Splice( eDst, eOrg ); + + if( ! joiningVertices ) { + GLUvertex *newVertex= allocVertex(); + if (newVertex == NULL) return 0; + + /* We split one vertex into two -- the new vertex is eDst->Org. + * Make sure the old vertex points to a valid half-edge. + */ + MakeVertex( newVertex, eDst, eOrg->Org ); + eOrg->Org->anEdge = eOrg; + } + if( ! joiningLoops ) { + GLUface *newFace= allocFace(); + if (newFace == NULL) return 0; + + /* We split one loop into two -- the new loop is eDst->Lface. + * Make sure the old face points to a valid half-edge. + */ + MakeFace( newFace, eDst, eOrg->Lface ); + eOrg->Lface->anEdge = eOrg; + } + + return 1; +} + + +/* __gl_meshDelete( eDel ) removes the edge eDel. There are several cases: + * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop + * eDel->Lface is deleted. Otherwise, we are splitting one loop into two; + * the newly created loop will contain eDel->Dst. If the deletion of eDel + * would create isolated vertices, those are deleted as well. + * + * This function could be implemented as two calls to __gl_meshSplice + * plus a few calls to memFree, but this would allocate and delete + * unnecessary vertices and faces. + */ +int __gl_meshDelete( GLUhalfEdge *eDel ) +{ + GLUhalfEdge *eDelSym = eDel->Sym; + int joiningLoops = FALSE; + + /* First step: disconnect the origin vertex eDel->Org. We make all + * changes to get a consistent mesh in this "intermediate" state. + */ + if( eDel->Lface != eDel->Rface ) { + /* We are joining two loops into one -- remove the left face */ + joiningLoops = TRUE; + KillFace( eDel->Lface, eDel->Rface ); + } + + if( eDel->Onext == eDel ) { + KillVertex( eDel->Org, NULL ); + } else { + /* Make sure that eDel->Org and eDel->Rface point to valid half-edges */ + eDel->Rface->anEdge = eDel->Oprev; + eDel->Org->anEdge = eDel->Onext; + + Splice( eDel, eDel->Oprev ); + if( ! joiningLoops ) { + GLUface *newFace= allocFace(); + if (newFace == NULL) return 0; + + /* We are splitting one loop into two -- create a new loop for eDel. */ + MakeFace( newFace, eDel, eDel->Lface ); + } + } + + /* Claim: the mesh is now in a consistent state, except that eDel->Org + * may have been deleted. Now we disconnect eDel->Dst. + */ + if( eDelSym->Onext == eDelSym ) { + KillVertex( eDelSym->Org, NULL ); + KillFace( eDelSym->Lface, NULL ); + } else { + /* Make sure that eDel->Dst and eDel->Lface point to valid half-edges */ + eDel->Lface->anEdge = eDelSym->Oprev; + eDelSym->Org->anEdge = eDelSym->Onext; + Splice( eDelSym, eDelSym->Oprev ); + } + + /* Any isolated vertices or faces have already been freed. */ + KillEdge( eDel ); + + return 1; +} + + +/******************** Other Edge Operations **********************/ + +/* All these routines can be implemented with the basic edge + * operations above. They are provided for convenience and efficiency. + */ + + +/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that + * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex. + * eOrg and eNew will have the same left face. + */ +GLUhalfEdge *__gl_meshAddEdgeVertex( GLUhalfEdge *eOrg ) +{ + GLUhalfEdge *eNewSym; + GLUhalfEdge *eNew = MakeEdge( eOrg ); + if (eNew == NULL) return NULL; + + eNewSym = eNew->Sym; + + /* Connect the new edge appropriately */ + Splice( eNew, eOrg->Lnext ); + + /* Set the vertex and face information */ + eNew->Org = eOrg->Dst; + { + GLUvertex *newVertex= allocVertex(); + if (newVertex == NULL) return NULL; + + MakeVertex( newVertex, eNewSym, eNew->Org ); + } + eNew->Lface = eNewSym->Lface = eOrg->Lface; + + return eNew; +} + + +/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew, + * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org. + * eOrg and eNew will have the same left face. + */ +GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg ) +{ + GLUhalfEdge *eNew; + GLUhalfEdge *tempHalfEdge= __gl_meshAddEdgeVertex( eOrg ); + if (tempHalfEdge == NULL) return NULL; + + eNew = tempHalfEdge->Sym; + + /* Disconnect eOrg from eOrg->Dst and connect it to eNew->Org */ + Splice( eOrg->Sym, eOrg->Sym->Oprev ); + Splice( eOrg->Sym, eNew ); + + /* Set the vertex and face information */ + eOrg->Dst = eNew->Org; + eNew->Dst->anEdge = eNew->Sym; /* may have pointed to eOrg->Sym */ + eNew->Rface = eOrg->Rface; + eNew->winding = eOrg->winding; /* copy old winding information */ + eNew->Sym->winding = eOrg->Sym->winding; + + return eNew; +} + + +/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst + * to eDst->Org, and returns the corresponding half-edge eNew. + * If eOrg->Lface == eDst->Lface, this splits one loop into two, + * and the newly created loop is eNew->Lface. Otherwise, two disjoint + * loops are merged into one, and the loop eDst->Lface is destroyed. + * + * If (eOrg == eDst), the new face will have only two edges. + * If (eOrg->Lnext == eDst), the old face is reduced to a single edge. + * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges. + */ +GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) +{ + GLUhalfEdge *eNewSym; + int joiningLoops = FALSE; + GLUhalfEdge *eNew = MakeEdge( eOrg ); + if (eNew == NULL) return NULL; + + eNewSym = eNew->Sym; + + if( eDst->Lface != eOrg->Lface ) { + /* We are connecting two disjoint loops -- destroy eDst->Lface */ + joiningLoops = TRUE; + KillFace( eDst->Lface, eOrg->Lface ); + } + + /* Connect the new edge appropriately */ + Splice( eNew, eOrg->Lnext ); + Splice( eNewSym, eDst ); + + /* Set the vertex and face information */ + eNew->Org = eOrg->Dst; + eNewSym->Org = eDst->Org; + eNew->Lface = eNewSym->Lface = eOrg->Lface; + + /* Make sure the old face points to a valid half-edge */ + eOrg->Lface->anEdge = eNewSym; + + if( ! joiningLoops ) { + GLUface *newFace= allocFace(); + if (newFace == NULL) return NULL; + + /* We split one loop into two -- the new loop is eNew->Lface */ + MakeFace( newFace, eNew, eOrg->Lface ); + } + return eNew; +} + + +/******************** Other Operations **********************/ + +/* __gl_meshZapFace( fZap ) destroys a face and removes it from the + * global face list. All edges of fZap will have a NULL pointer as their + * left face. Any edges which also have a NULL pointer as their right face + * are deleted entirely (along with any isolated vertices this produces). + * An entire mesh can be deleted by zapping its faces, one at a time, + * in any order. Zapped faces cannot be used in further mesh operations! + */ +void __gl_meshZapFace( GLUface *fZap ) +{ + GLUhalfEdge *eStart = fZap->anEdge; + GLUhalfEdge *e, *eNext, *eSym; + GLUface *fPrev, *fNext; + + /* walk around face, deleting edges whose right face is also NULL */ + eNext = eStart->Lnext; + do { + e = eNext; + eNext = e->Lnext; + + e->Lface = NULL; + if( e->Rface == NULL ) { + /* delete the edge -- see __gl_MeshDelete above */ + + if( e->Onext == e ) { + KillVertex( e->Org, NULL ); + } else { + /* Make sure that e->Org points to a valid half-edge */ + e->Org->anEdge = e->Onext; + Splice( e, e->Oprev ); + } + eSym = e->Sym; + if( eSym->Onext == eSym ) { + KillVertex( eSym->Org, NULL ); + } else { + /* Make sure that eSym->Org points to a valid half-edge */ + eSym->Org->anEdge = eSym->Onext; + Splice( eSym, eSym->Oprev ); + } + KillEdge( e ); + } + } while( e != eStart ); + + /* delete from circular doubly-linked list */ + fPrev = fZap->prev; + fNext = fZap->next; + fNext->prev = fPrev; + fPrev->next = fNext; + + memFree( fZap ); +} + + +/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices, + * and no loops (what we usually call a "face"). + */ +GLUmesh *__gl_meshNewMesh( void ) +{ + GLUvertex *v; + GLUface *f; + GLUhalfEdge *e; + GLUhalfEdge *eSym; + GLUmesh *mesh = (GLUmesh *)memAlloc( sizeof( GLUmesh )); + if (mesh == NULL) { + return NULL; + } + + v = &mesh->vHead; + f = &mesh->fHead; + e = &mesh->eHead; + eSym = &mesh->eHeadSym; + + v->next = v->prev = v; + v->anEdge = NULL; + v->data = NULL; + + f->next = f->prev = f; + f->anEdge = NULL; + f->data = NULL; + f->trail = NULL; + f->marked = FALSE; + f->inside = FALSE; + + e->next = e; + e->Sym = eSym; + e->Onext = NULL; + e->Lnext = NULL; + e->Org = NULL; + e->Lface = NULL; + e->winding = 0; + e->activeRegion = NULL; + + eSym->next = eSym; + eSym->Sym = e; + eSym->Onext = NULL; + eSym->Lnext = NULL; + eSym->Org = NULL; + eSym->Lface = NULL; + eSym->winding = 0; + eSym->activeRegion = NULL; + + return mesh; +} + + +/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in + * both meshes, and returns the new mesh (the old meshes are destroyed). + */ +GLUmesh *__gl_meshUnion( GLUmesh *mesh1, GLUmesh *mesh2 ) +{ + GLUface *f1 = &mesh1->fHead; + GLUvertex *v1 = &mesh1->vHead; + GLUhalfEdge *e1 = &mesh1->eHead; + GLUface *f2 = &mesh2->fHead; + GLUvertex *v2 = &mesh2->vHead; + GLUhalfEdge *e2 = &mesh2->eHead; + + /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */ + if( f2->next != f2 ) { + f1->prev->next = f2->next; + f2->next->prev = f1->prev; + f2->prev->next = f1; + f1->prev = f2->prev; + } + + if( v2->next != v2 ) { + v1->prev->next = v2->next; + v2->next->prev = v1->prev; + v2->prev->next = v1; + v1->prev = v2->prev; + } + + if( e2->next != e2 ) { + e1->Sym->next->Sym->next = e2->next; + e2->next->Sym->next = e1->Sym->next; + e2->Sym->next->Sym->next = e1; + e1->Sym->next = e2->Sym->next; + } + + memFree( mesh2 ); + return mesh1; +} + + +#ifdef DELETE_BY_ZAPPING + +/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. + */ +void __gl_meshDeleteMesh( GLUmesh *mesh ) +{ + GLUface *fHead = &mesh->fHead; + + while( fHead->next != fHead ) { + __gl_meshZapFace( fHead->next ); + } + assert( mesh->vHead.next == &mesh->vHead ); + + memFree( mesh ); +} + +#else + +/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. + */ +void __gl_meshDeleteMesh( GLUmesh *mesh ) +{ + GLUface *f, *fNext; + GLUvertex *v, *vNext; + GLUhalfEdge *e, *eNext; + + for( f = mesh->fHead.next; f != &mesh->fHead; f = fNext ) { + fNext = f->next; + memFree( f ); + } + + for( v = mesh->vHead.next; v != &mesh->vHead; v = vNext ) { + vNext = v->next; + memFree( v ); + } + + for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) { + /* One call frees both e and e->Sym (see EdgePair above) */ + eNext = e->next; + memFree( e ); + } + + memFree( mesh ); +} + +#endif + +#ifndef NDEBUG + +/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency. + */ +void __gl_meshCheckMesh( GLUmesh *mesh ) +{ + GLUface *fHead = &mesh->fHead; + GLUvertex *vHead = &mesh->vHead; + GLUhalfEdge *eHead = &mesh->eHead; + GLUface *f, *fPrev; + GLUvertex *v, *vPrev; + GLUhalfEdge *e, *ePrev; + + fPrev = fHead; + for( fPrev = fHead ; (f = fPrev->next) != fHead; fPrev = f) { + assert( f->prev == fPrev ); + e = f->anEdge; + do { + assert( e->Sym != e ); + assert( e->Sym->Sym == e ); + assert( e->Lnext->Onext->Sym == e ); + assert( e->Onext->Sym->Lnext == e ); + assert( e->Lface == f ); + e = e->Lnext; + } while( e != f->anEdge ); + } + assert( f->prev == fPrev && f->anEdge == NULL && f->data == NULL ); + + vPrev = vHead; + for( vPrev = vHead ; (v = vPrev->next) != vHead; vPrev = v) { + assert( v->prev == vPrev ); + e = v->anEdge; + do { + assert( e->Sym != e ); + assert( e->Sym->Sym == e ); + assert( e->Lnext->Onext->Sym == e ); + assert( e->Onext->Sym->Lnext == e ); + assert( e->Org == v ); + e = e->Onext; + } while( e != v->anEdge ); + } + assert( v->prev == vPrev && v->anEdge == NULL && v->data == NULL ); + + ePrev = eHead; + for( ePrev = eHead ; (e = ePrev->next) != eHead; ePrev = e) { + assert( e->Sym->next == ePrev->Sym ); + assert( e->Sym != e ); + assert( e->Sym->Sym == e ); + assert( e->Org != NULL ); + assert( e->Dst != NULL ); + assert( e->Lnext->Onext->Sym == e ); + assert( e->Onext->Sym->Lnext == e ); + } + assert( e->Sym->next == ePrev->Sym + && e->Sym == &mesh->eHeadSym + && e->Sym->Sym == e + && e->Org == NULL && e->Dst == NULL + && e->Lface == NULL && e->Rface == NULL ); +} + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/mesh.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,266 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __mesh_h_ +#define __mesh_h_ + +#include + +typedef struct GLUmesh GLUmesh; + +typedef struct GLUvertex GLUvertex; +typedef struct GLUface GLUface; +typedef struct GLUhalfEdge GLUhalfEdge; + +typedef struct ActiveRegion ActiveRegion; /* Internal data */ + +/* The mesh structure is similar in spirit, notation, and operations + * to the "quad-edge" structure (see L. Guibas and J. Stolfi, Primitives + * for the manipulation of general subdivisions and the computation of + * Voronoi diagrams, ACM Transactions on Graphics, 4(2):74-123, April 1985). + * For a simplified description, see the course notes for CS348a, + * "Mathematical Foundations of Computer Graphics", available at the + * Stanford bookstore (and taught during the fall quarter). + * The implementation also borrows a tiny subset of the graph-based approach + * use in Mantyla's Geometric Work Bench (see M. Mantyla, An Introduction + * to Sold Modeling, Computer Science Press, Rockville, Maryland, 1988). + * + * The fundamental data structure is the "half-edge". Two half-edges + * go together to make an edge, but they point in opposite directions. + * Each half-edge has a pointer to its mate (the "symmetric" half-edge Sym), + * its origin vertex (Org), the face on its left side (Lface), and the + * adjacent half-edges in the CCW direction around the origin vertex + * (Onext) and around the left face (Lnext). There is also a "next" + * pointer for the global edge list (see below). + * + * The notation used for mesh navigation: + * Sym = the mate of a half-edge (same edge, but opposite direction) + * Onext = edge CCW around origin vertex (keep same origin) + * Dnext = edge CCW around destination vertex (keep same dest) + * Lnext = edge CCW around left face (dest becomes new origin) + * Rnext = edge CCW around right face (origin becomes new dest) + * + * "prev" means to substitute CW for CCW in the definitions above. + * + * The mesh keeps global lists of all vertices, faces, and edges, + * stored as doubly-linked circular lists with a dummy header node. + * The mesh stores pointers to these dummy headers (vHead, fHead, eHead). + * + * The circular edge list is special; since half-edges always occur + * in pairs (e and e->Sym), each half-edge stores a pointer in only + * one direction. Starting at eHead and following the e->next pointers + * will visit each *edge* once (ie. e or e->Sym, but not both). + * e->Sym stores a pointer in the opposite direction, thus it is + * always true that e->Sym->next->Sym->next == e. + * + * Each vertex has a pointer to next and previous vertices in the + * circular list, and a pointer to a half-edge with this vertex as + * the origin (NULL if this is the dummy header). There is also a + * field "data" for client data. + * + * Each face has a pointer to the next and previous faces in the + * circular list, and a pointer to a half-edge with this face as + * the left face (NULL if this is the dummy header). There is also + * a field "data" for client data. + * + * Note that what we call a "face" is really a loop; faces may consist + * of more than one loop (ie. not simply connected), but there is no + * record of this in the data structure. The mesh may consist of + * several disconnected regions, so it may not be possible to visit + * the entire mesh by starting at a half-edge and traversing the edge + * structure. + * + * The mesh does NOT support isolated vertices; a vertex is deleted along + * with its last edge. Similarly when two faces are merged, one of the + * faces is deleted (see __gl_meshDelete below). For mesh operations, + * all face (loop) and vertex pointers must not be NULL. However, once + * mesh manipulation is finished, __gl_MeshZapFace can be used to delete + * faces of the mesh, one at a time. All external faces can be "zapped" + * before the mesh is returned to the client; then a NULL face indicates + * a region which is not part of the output polygon. + */ + +struct GLUvertex { + GLUvertex *next; /* next vertex (never NULL) */ + GLUvertex *prev; /* previous vertex (never NULL) */ + GLUhalfEdge *anEdge; /* a half-edge with this origin */ + void *data; /* client's data */ + + /* Internal data (keep hidden) */ + GLdouble coords[3]; /* vertex location in 3D */ + GLdouble s, t; /* projection onto the sweep plane */ + long pqHandle; /* to allow deletion from priority queue */ +}; + +struct GLUface { + GLUface *next; /* next face (never NULL) */ + GLUface *prev; /* previous face (never NULL) */ + GLUhalfEdge *anEdge; /* a half edge with this left face */ + void *data; /* room for client's data */ + + /* Internal data (keep hidden) */ + GLUface *trail; /* "stack" for conversion to strips */ + GLboolean marked; /* flag for conversion to strips */ + GLboolean inside; /* this face is in the polygon interior */ +}; + +struct GLUhalfEdge { + GLUhalfEdge *next; /* doubly-linked list (prev==Sym->next) */ + GLUhalfEdge *Sym; /* same edge, opposite direction */ + GLUhalfEdge *Onext; /* next edge CCW around origin */ + GLUhalfEdge *Lnext; /* next edge CCW around left face */ + GLUvertex *Org; /* origin vertex (Overtex too long) */ + GLUface *Lface; /* left face */ + + /* Internal data (keep hidden) */ + ActiveRegion *activeRegion; /* a region with this upper edge (sweep.c) */ + int winding; /* change in winding number when crossing + from the right face to the left face */ +}; + +#define Rface Sym->Lface +#define Dst Sym->Org + +#define Oprev Sym->Lnext +#define Lprev Onext->Sym +#define Dprev Lnext->Sym +#define Rprev Sym->Onext +#define Dnext Rprev->Sym /* 3 pointers */ +#define Rnext Oprev->Sym /* 3 pointers */ + + +struct GLUmesh { + GLUvertex vHead; /* dummy header for vertex list */ + GLUface fHead; /* dummy header for face list */ + GLUhalfEdge eHead; /* dummy header for edge list */ + GLUhalfEdge eHeadSym; /* and its symmetric counterpart */ +}; + +/* The mesh operations below have three motivations: completeness, + * convenience, and efficiency. The basic mesh operations are MakeEdge, + * Splice, and Delete. All the other edge operations can be implemented + * in terms of these. The other operations are provided for convenience + * and/or efficiency. + * + * When a face is split or a vertex is added, they are inserted into the + * global list *before* the existing vertex or face (ie. e->Org or e->Lface). + * This makes it easier to process all vertices or faces in the global lists + * without worrying about processing the same data twice. As a convenience, + * when a face is split, the "inside" flag is copied from the old face. + * Other internal data (v->data, v->activeRegion, f->data, f->marked, + * f->trail, e->winding) is set to zero. + * + * ********************** Basic Edge Operations ************************** + * + * __gl_meshMakeEdge( mesh ) creates one edge, two vertices, and a loop. + * The loop (face) consists of the two new half-edges. + * + * __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the + * mesh connectivity and topology. It changes the mesh so that + * eOrg->Onext <- OLD( eDst->Onext ) + * eDst->Onext <- OLD( eOrg->Onext ) + * where OLD(...) means the value before the meshSplice operation. + * + * This can have two effects on the vertex structure: + * - if eOrg->Org != eDst->Org, the two vertices are merged together + * - if eOrg->Org == eDst->Org, the origin is split into two vertices + * In both cases, eDst->Org is changed and eOrg->Org is untouched. + * + * Similarly (and independently) for the face structure, + * - if eOrg->Lface == eDst->Lface, one loop is split into two + * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one + * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected. + * + * __gl_meshDelete( eDel ) removes the edge eDel. There are several cases: + * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop + * eDel->Lface is deleted. Otherwise, we are splitting one loop into two; + * the newly created loop will contain eDel->Dst. If the deletion of eDel + * would create isolated vertices, those are deleted as well. + * + * ********************** Other Edge Operations ************************** + * + * __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that + * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex. + * eOrg and eNew will have the same left face. + * + * __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew, + * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org. + * eOrg and eNew will have the same left face. + * + * __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst + * to eDst->Org, and returns the corresponding half-edge eNew. + * If eOrg->Lface == eDst->Lface, this splits one loop into two, + * and the newly created loop is eNew->Lface. Otherwise, two disjoint + * loops are merged into one, and the loop eDst->Lface is destroyed. + * + * ************************ Other Operations ***************************** + * + * __gl_meshNewMesh() creates a new mesh with no edges, no vertices, + * and no loops (what we usually call a "face"). + * + * __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in + * both meshes, and returns the new mesh (the old meshes are destroyed). + * + * __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. + * + * __gl_meshZapFace( fZap ) destroys a face and removes it from the + * global face list. All edges of fZap will have a NULL pointer as their + * left face. Any edges which also have a NULL pointer as their right face + * are deleted entirely (along with any isolated vertices this produces). + * An entire mesh can be deleted by zapping its faces, one at a time, + * in any order. Zapped faces cannot be used in further mesh operations! + * + * __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency. + */ + +GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ); +int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ); +int __gl_meshDelete( GLUhalfEdge *eDel ); + +GLUhalfEdge *__gl_meshAddEdgeVertex( GLUhalfEdge *eOrg ); +GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg ); +GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ); + +GLUmesh *__gl_meshNewMesh( void ); +GLUmesh *__gl_meshUnion( GLUmesh *mesh1, GLUmesh *mesh2 ); +void __gl_meshDeleteMesh( GLUmesh *mesh ); +void __gl_meshZapFace( GLUface *fZap ); + +#ifdef NDEBUG +#define __gl_meshCheckMesh( mesh ) +#else +void __gl_meshCheckMesh( GLUmesh *mesh ); +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,253 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include "mesh.h" +#include "tess.h" +#include "normal.h" +#include +#include + +#define TRUE 1 +#define FALSE 0 + +#define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2]) + +#if 0 +static void Normalize( GLdouble v[3] ) +{ + GLdouble len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; + + assert( len > 0 ); + len = sqrt( len ); + v[0] /= len; + v[1] /= len; + v[2] /= len; +} +#endif + +#undef ABS +#define ABS(x) ((x) < 0 ? -(x) : (x)) + +static int LongAxis( GLdouble v[3] ) +{ + int i = 0; + + if( ABS(v[1]) > ABS(v[0]) ) { i = 1; } + if( ABS(v[2]) > ABS(v[i]) ) { i = 2; } + return i; +} + +static void ComputeNormal( GLUtesselator *tess, GLdouble norm[3] ) +{ + GLUvertex *v, *v1, *v2; + GLdouble c, tLen2, maxLen2; + GLdouble maxVal[3], minVal[3], d1[3], d2[3], tNorm[3]; + GLUvertex *maxVert[3], *minVert[3]; + GLUvertex *vHead = &tess->mesh->vHead; + int i; + + maxVal[0] = maxVal[1] = maxVal[2] = -2 * GLU_TESS_MAX_COORD; + minVal[0] = minVal[1] = minVal[2] = 2 * GLU_TESS_MAX_COORD; + + for( v = vHead->next; v != vHead; v = v->next ) { + for( i = 0; i < 3; ++i ) { + c = v->coords[i]; + if( c < minVal[i] ) { minVal[i] = c; minVert[i] = v; } + if( c > maxVal[i] ) { maxVal[i] = c; maxVert[i] = v; } + } + } + + /* Find two vertices separated by at least 1/sqrt(3) of the maximum + * distance between any two vertices + */ + i = 0; + if( maxVal[1] - minVal[1] > maxVal[0] - minVal[0] ) { i = 1; } + if( maxVal[2] - minVal[2] > maxVal[i] - minVal[i] ) { i = 2; } + if( minVal[i] >= maxVal[i] ) { + /* All vertices are the same -- normal doesn't matter */ + norm[0] = 0; norm[1] = 0; norm[2] = 1; + return; + } + + /* Look for a third vertex which forms the triangle with maximum area + * (Length of normal == twice the triangle area) + */ + maxLen2 = 0; + v1 = minVert[i]; + v2 = maxVert[i]; + d1[0] = v1->coords[0] - v2->coords[0]; + d1[1] = v1->coords[1] - v2->coords[1]; + d1[2] = v1->coords[2] - v2->coords[2]; + for( v = vHead->next; v != vHead; v = v->next ) { + d2[0] = v->coords[0] - v2->coords[0]; + d2[1] = v->coords[1] - v2->coords[1]; + d2[2] = v->coords[2] - v2->coords[2]; + tNorm[0] = d1[1]*d2[2] - d1[2]*d2[1]; + tNorm[1] = d1[2]*d2[0] - d1[0]*d2[2]; + tNorm[2] = d1[0]*d2[1] - d1[1]*d2[0]; + tLen2 = tNorm[0]*tNorm[0] + tNorm[1]*tNorm[1] + tNorm[2]*tNorm[2]; + if( tLen2 > maxLen2 ) { + maxLen2 = tLen2; + norm[0] = tNorm[0]; + norm[1] = tNorm[1]; + norm[2] = tNorm[2]; + } + } + + if( maxLen2 <= 0 ) { + /* All points lie on a single line -- any decent normal will do */ + norm[0] = norm[1] = norm[2] = 0; + norm[LongAxis(d1)] = 1; + } +} + + +static void CheckOrientation( GLUtesselator *tess ) +{ + GLdouble area; + GLUface *f, *fHead = &tess->mesh->fHead; + GLUvertex *v, *vHead = &tess->mesh->vHead; + GLUhalfEdge *e; + + /* When we compute the normal automatically, we choose the orientation + * so that the the sum of the signed areas of all contours is non-negative. + */ + area = 0; + for( f = fHead->next; f != fHead; f = f->next ) { + e = f->anEdge; + if( e->winding <= 0 ) continue; + do { + area += (e->Org->s - e->Dst->s) * (e->Org->t + e->Dst->t); + e = e->Lnext; + } while( e != f->anEdge ); + } + if( area < 0 ) { + /* Reverse the orientation by flipping all the t-coordinates */ + for( v = vHead->next; v != vHead; v = v->next ) { + v->t = - v->t; + } + tess->tUnit[0] = - tess->tUnit[0]; + tess->tUnit[1] = - tess->tUnit[1]; + tess->tUnit[2] = - tess->tUnit[2]; + } +} + +#ifdef FOR_TRITE_TEST_PROGRAM +#include +extern int RandomSweep; +#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0) +#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0) +#else +#if defined(SLANTED_SWEEP) +/* The "feature merging" is not intended to be complete. There are + * special cases where edges are nearly parallel to the sweep line + * which are not implemented. The algorithm should still behave + * robustly (ie. produce a reasonable tesselation) in the presence + * of such edges, however it may miss features which could have been + * merged. We could minimize this effect by choosing the sweep line + * direction to be something unusual (ie. not parallel to one of the + * coordinate axes). + */ +#define S_UNIT_X 0.50941539564955385 /* Pre-normalized */ +#define S_UNIT_Y 0.86052074622010633 +#else +#define S_UNIT_X 1.0 +#define S_UNIT_Y 0.0 +#endif +#endif + +/* Determine the polygon normal and project vertices onto the plane + * of the polygon. + */ +void __gl_projectPolygon( GLUtesselator *tess ) +{ + GLUvertex *v, *vHead = &tess->mesh->vHead; + GLdouble norm[3]; + GLdouble *sUnit, *tUnit; + int i, computedNormal = FALSE; + + norm[0] = tess->normal[0]; + norm[1] = tess->normal[1]; + norm[2] = tess->normal[2]; + if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) { + ComputeNormal( tess, norm ); + computedNormal = TRUE; + } + sUnit = tess->sUnit; + tUnit = tess->tUnit; + i = LongAxis( norm ); + +#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT) + /* Choose the initial sUnit vector to be approximately perpendicular + * to the normal. + */ + Normalize( norm ); + + sUnit[i] = 0; + sUnit[(i+1)%3] = S_UNIT_X; + sUnit[(i+2)%3] = S_UNIT_Y; + + /* Now make it exactly perpendicular */ + w = Dot( sUnit, norm ); + sUnit[0] -= w * norm[0]; + sUnit[1] -= w * norm[1]; + sUnit[2] -= w * norm[2]; + Normalize( sUnit ); + + /* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */ + tUnit[0] = norm[1]*sUnit[2] - norm[2]*sUnit[1]; + tUnit[1] = norm[2]*sUnit[0] - norm[0]*sUnit[2]; + tUnit[2] = norm[0]*sUnit[1] - norm[1]*sUnit[0]; + Normalize( tUnit ); +#else + /* Project perpendicular to a coordinate axis -- better numerically */ + sUnit[i] = 0; + sUnit[(i+1)%3] = S_UNIT_X; + sUnit[(i+2)%3] = S_UNIT_Y; + + tUnit[i] = 0; + tUnit[(i+1)%3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y; + tUnit[(i+2)%3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X; +#endif + + /* Project the vertices onto the sweep plane */ + for( v = vHead->next; v != vHead; v = v->next ) { + v->s = Dot( v->coords, sUnit ); + v->t = Dot( v->coords, tUnit ); + } + if( computedNormal ) { + CheckOrientation( tess ); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/normal.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,45 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __normal_h_ +#define __normal_h_ + +#include "tess.h" + +/* __gl_projectPolygon( tess ) determines the polygon normal + * and project vertices onto the plane of the polygon. + */ +void __gl_projectPolygon( GLUtesselator *tess ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,260 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include +#include /* LONG_MAX */ +#include "memalloc.h" + +/* Include all the code for the regular heap-based queue here. */ + +#include "priorityq-heap.c" + +/* Now redefine all the function names to map to their "Sort" versions. */ + +#include "priorityq-sort.h" + +/* really __gl_pqSortNewPriorityQ */ +PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) +{ + PriorityQ *pq = (PriorityQ *)memAlloc( sizeof( PriorityQ )); + if (pq == NULL) return NULL; + + pq->heap = __gl_pqHeapNewPriorityQ( leq ); + if (pq->heap == NULL) { + memFree(pq); + return NULL; + } + + pq->keys = (PQHeapKey *)memAlloc( INIT_SIZE * sizeof(pq->keys[0]) ); + if (pq->keys == NULL) { + __gl_pqHeapDeletePriorityQ(pq->heap); + memFree(pq); + return NULL; + } + + pq->size = 0; + pq->max = INIT_SIZE; + pq->initialized = FALSE; + pq->leq = leq; + return pq; +} + +/* really __gl_pqSortDeletePriorityQ */ +void pqDeletePriorityQ( PriorityQ *pq ) +{ + assert(pq != NULL); + if (pq->heap != NULL) __gl_pqHeapDeletePriorityQ( pq->heap ); + if (pq->order != NULL) memFree( pq->order ); + if (pq->keys != NULL) memFree( pq->keys ); + memFree( pq ); +} + + +#define LT(x,y) (! LEQ(y,x)) +#define GT(x,y) (! LEQ(x,y)) +#define Swap(a,b) if(1){PQkey *tmp = *a; *a = *b; *b = tmp;}else + +/* really __gl_pqSortInit */ +int pqInit( PriorityQ *pq ) +{ + PQkey **p, **r, **i, **j, *piv; + struct { PQkey **p, **r; } Stack[50], *top = Stack; + unsigned long seed = 2016473283; + + /* Create an array of indirect pointers to the keys, so that we + * the handles we have returned are still valid. + */ +/* + pq->order = (PQHeapKey **)memAlloc( (size_t) + (pq->size * sizeof(pq->order[0])) ); +*/ + pq->order = (PQHeapKey **)memAlloc( (size_t) + ((pq->size+1) * sizeof(pq->order[0])) ); +/* the previous line is a patch to compensate for the fact that IBM */ +/* machines return a null on a malloc of zero bytes (unlike SGI), */ +/* so we have to put in this defense to guard against a memory */ +/* fault four lines down. from fossum@austin.ibm.com. */ + if (pq->order == NULL) return 0; + + p = pq->order; + r = p + pq->size - 1; + for( piv = pq->keys, i = p; i <= r; ++piv, ++i ) { + *i = piv; + } + + /* Sort the indirect pointers in descending order, + * using randomized Quicksort + */ + top->p = p; top->r = r; ++top; + while( --top >= Stack ) { + p = top->p; + r = top->r; + while( r > p + 10 ) { + seed = seed * 1539415821 + 1; + i = p + seed % (r - p + 1); + piv = *i; + *i = *p; + *p = piv; + i = p - 1; + j = r + 1; + do { + do { ++i; } while( GT( **i, *piv )); + do { --j; } while( LT( **j, *piv )); + Swap( i, j ); + } while( i < j ); + Swap( i, j ); /* Undo last swap */ + if( i - p < r - j ) { + top->p = j+1; top->r = r; ++top; + r = i-1; + } else { + top->p = p; top->r = i-1; ++top; + p = j+1; + } + } + /* Insertion sort small lists */ + for( i = p+1; i <= r; ++i ) { + piv = *i; + for( j = i; j > p && LT( **(j-1), *piv ); --j ) { + *j = *(j-1); + } + *j = piv; + } + } + pq->max = pq->size; + pq->initialized = TRUE; + __gl_pqHeapInit( pq->heap ); /* always succeeds */ + +#ifndef NDEBUG + p = pq->order; + r = p + pq->size - 1; + for( i = p; i < r; ++i ) { + assert( LEQ( **(i+1), **i )); + } +#endif + + return 1; +} + +/* really __gl_pqSortInsert */ +/* returns LONG_MAX iff out of memory */ +PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) +{ + long curr; + + if( pq->initialized ) { + return __gl_pqHeapInsert( pq->heap, keyNew ); + } + curr = pq->size; + if( ++ pq->size >= pq->max ) { + PQkey *saveKey= pq->keys; + + /* If the heap overflows, double its size. */ + pq->max <<= 1; + pq->keys = (PQHeapKey *)memRealloc( pq->keys, + (size_t) + (pq->max * sizeof( pq->keys[0] ))); + if (pq->keys == NULL) { + pq->keys = saveKey; /* restore ptr to free upon return */ + return LONG_MAX; + } + } + assert(curr != LONG_MAX); + pq->keys[curr] = keyNew; + + /* Negative handles index the sorted array. */ + return -(curr+1); +} + +/* really __gl_pqSortExtractMin */ +PQkey pqExtractMin( PriorityQ *pq ) +{ + PQkey sortMin, heapMin; + + if( pq->size == 0 ) { + return __gl_pqHeapExtractMin( pq->heap ); + } + sortMin = *(pq->order[pq->size-1]); + if( ! __gl_pqHeapIsEmpty( pq->heap )) { + heapMin = __gl_pqHeapMinimum( pq->heap ); + if( LEQ( heapMin, sortMin )) { + return __gl_pqHeapExtractMin( pq->heap ); + } + } + do { + -- pq->size; + } while( pq->size > 0 && *(pq->order[pq->size-1]) == NULL ); + return sortMin; +} + +/* really __gl_pqSortMinimum */ +PQkey pqMinimum( PriorityQ *pq ) +{ + PQkey sortMin, heapMin; + + if( pq->size == 0 ) { + return __gl_pqHeapMinimum( pq->heap ); + } + sortMin = *(pq->order[pq->size-1]); + if( ! __gl_pqHeapIsEmpty( pq->heap )) { + heapMin = __gl_pqHeapMinimum( pq->heap ); + if( LEQ( heapMin, sortMin )) { + return heapMin; + } + } + return sortMin; +} + +/* really __gl_pqSortIsEmpty */ +int pqIsEmpty( PriorityQ *pq ) +{ + return (pq->size == 0) && __gl_pqHeapIsEmpty( pq->heap ); +} + +/* really __gl_pqSortDelete */ +void pqDelete( PriorityQ *pq, PQhandle curr ) +{ + if( curr >= 0 ) { + __gl_pqHeapDelete( pq->heap, curr ); + return; + } + curr = -(curr+1); + assert( curr < pq->max && pq->keys[curr] != NULL ); + + pq->keys[curr] = NULL; + while( pq->size > 0 && *(pq->order[pq->size-1]) == NULL ) { + -- pq->size; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,117 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __priorityq_sort_h_ +#define __priorityq_sort_h_ + +#include "priorityq-heap.h" + +#undef PQkey +#undef PQhandle +#undef PriorityQ +#undef pqNewPriorityQ +#undef pqDeletePriorityQ +#undef pqInit +#undef pqInsert +#undef pqMinimum +#undef pqExtractMin +#undef pqDelete +#undef pqIsEmpty + +/* Use #define's so that another heap implementation can use this one */ + +#define PQkey PQSortKey +#define PQhandle PQSortHandle +#define PriorityQ PriorityQSort + +#define pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq) +#define pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq) + +/* The basic operations are insertion of a new key (pqInsert), + * and examination/extraction of a key whose value is minimum + * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete); + * for this purpose pqInsert returns a "handle" which is supplied + * as the argument. + * + * An initial heap may be created efficiently by calling pqInsert + * repeatedly, then calling pqInit. In any case pqInit must be called + * before any operations other than pqInsert are used. + * + * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key. + * This may also be tested with pqIsEmpty. + */ +#define pqInit(pq) __gl_pqSortInit(pq) +#define pqInsert(pq,key) __gl_pqSortInsert(pq,key) +#define pqMinimum(pq) __gl_pqSortMinimum(pq) +#define pqExtractMin(pq) __gl_pqSortExtractMin(pq) +#define pqDelete(pq,handle) __gl_pqSortDelete(pq,handle) +#define pqIsEmpty(pq) __gl_pqSortIsEmpty(pq) + + +/* Since we support deletion the data structure is a little more + * complicated than an ordinary heap. "nodes" is the heap itself; + * active nodes are stored in the range 1..pq->size. When the + * heap exceeds its allocated size (pq->max), its size doubles. + * The children of node i are nodes 2i and 2i+1. + * + * Each node stores an index into an array "handles". Each handle + * stores a key, plus a pointer back to the node which currently + * represents that key (ie. nodes[handles[i].node].handle == i). + */ + +typedef PQHeapKey PQkey; +typedef PQHeapHandle PQhandle; +typedef struct PriorityQ PriorityQ; + +struct PriorityQ { + PriorityQHeap *heap; + PQkey *keys; + PQkey **order; + PQhandle size, max; + int initialized; + int (*leq)(PQkey key1, PQkey key2); +}; + +PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); +void pqDeletePriorityQ( PriorityQ *pq ); + +int pqInit( PriorityQ *pq ); +PQhandle pqInsert( PriorityQ *pq, PQkey key ); +PQkey pqExtractMin( PriorityQ *pq ); +void pqDelete( PriorityQ *pq, PQhandle handle ); + +PQkey pqMinimum( PriorityQ *pq ); +int pqIsEmpty( PriorityQ *pq ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,252 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include +#include +#include "priorityq-heap.h" +#include "memalloc.h" + +#define INIT_SIZE 32 + +#define TRUE 1 +#define FALSE 0 + +#ifdef FOR_TRITE_TEST_PROGRAM +#define LEQ(x,y) (*pq->leq)(x,y) +#else +/* Violates modularity, but a little faster */ +#include "geom.h" +#define LEQ(x,y) VertLeq((GLUvertex *)x, (GLUvertex *)y) +#endif + +/* really __gl_pqHeapNewPriorityQ */ +PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) +{ + PriorityQ *pq = (PriorityQ *)memAlloc( sizeof( PriorityQ )); + if (pq == NULL) return NULL; + + pq->size = 0; + pq->max = INIT_SIZE; + pq->nodes = (PQnode *)memAlloc( (INIT_SIZE + 1) * sizeof(pq->nodes[0]) ); + if (pq->nodes == NULL) { + memFree(pq); + return NULL; + } + + pq->handles = (PQhandleElem *)memAlloc( (INIT_SIZE + 1) * sizeof(pq->handles[0]) ); + if (pq->handles == NULL) { + memFree(pq->nodes); + memFree(pq); + return NULL; + } + + pq->initialized = FALSE; + pq->freeList = 0; + pq->leq = leq; + + pq->nodes[1].handle = 1; /* so that Minimum() returns NULL */ + pq->handles[1].key = NULL; + return pq; +} + +/* really __gl_pqHeapDeletePriorityQ */ +void pqDeletePriorityQ( PriorityQ *pq ) +{ + memFree( pq->handles ); + memFree( pq->nodes ); + memFree( pq ); +} + + +static void FloatDown( PriorityQ *pq, long curr ) +{ + PQnode *n = pq->nodes; + PQhandleElem *h = pq->handles; + PQhandle hCurr, hChild; + long child; + + hCurr = n[curr].handle; + for( ;; ) { + child = curr << 1; + if( child < pq->size && LEQ( h[n[child+1].handle].key, + h[n[child].handle].key )) { + ++child; + } + + assert(child <= pq->max); + + hChild = n[child].handle; + if( child > pq->size || LEQ( h[hCurr].key, h[hChild].key )) { + n[curr].handle = hCurr; + h[hCurr].node = curr; + break; + } + n[curr].handle = hChild; + h[hChild].node = curr; + curr = child; + } +} + + +static void FloatUp( PriorityQ *pq, long curr ) +{ + PQnode *n = pq->nodes; + PQhandleElem *h = pq->handles; + PQhandle hCurr, hParent; + long parent; + + hCurr = n[curr].handle; + for( ;; ) { + parent = curr >> 1; + hParent = n[parent].handle; + if( parent == 0 || LEQ( h[hParent].key, h[hCurr].key )) { + n[curr].handle = hCurr; + h[hCurr].node = curr; + break; + } + n[curr].handle = hParent; + h[hParent].node = curr; + curr = parent; + } +} + +/* really __gl_pqHeapInit */ +void pqInit( PriorityQ *pq ) +{ + long i; + + /* This method of building a heap is O(n), rather than O(n lg n). */ + + for( i = pq->size; i >= 1; --i ) { + FloatDown( pq, i ); + } + pq->initialized = TRUE; +} + +/* really __gl_pqHeapInsert */ +/* returns LONG_MAX iff out of memory */ +PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) +{ + long curr; + PQhandle free; + + curr = ++ pq->size; + if( (curr*2) > pq->max ) { + PQnode *saveNodes= pq->nodes; + PQhandleElem *saveHandles= pq->handles; + + /* If the heap overflows, double its size. */ + pq->max <<= 1; + pq->nodes = (PQnode *)memRealloc( pq->nodes, + (size_t) + ((pq->max + 1) * sizeof( pq->nodes[0] ))); + if (pq->nodes == NULL) { + pq->nodes = saveNodes; /* restore ptr to free upon return */ + return LONG_MAX; + } + pq->handles = (PQhandleElem *)memRealloc( pq->handles, + (size_t) + ((pq->max + 1) * + sizeof( pq->handles[0] ))); + if (pq->handles == NULL) { + pq->handles = saveHandles; /* restore ptr to free upon return */ + return LONG_MAX; + } + } + + if( pq->freeList == 0 ) { + free = curr; + } else { + free = pq->freeList; + pq->freeList = pq->handles[free].node; + } + + pq->nodes[curr].handle = free; + pq->handles[free].node = curr; + pq->handles[free].key = keyNew; + + if( pq->initialized ) { + FloatUp( pq, curr ); + } + assert(free != LONG_MAX); + return free; +} + +/* really __gl_pqHeapExtractMin */ +PQkey pqExtractMin( PriorityQ *pq ) +{ + PQnode *n = pq->nodes; + PQhandleElem *h = pq->handles; + PQhandle hMin = n[1].handle; + PQkey min = h[hMin].key; + + if( pq->size > 0 ) { + n[1].handle = n[pq->size].handle; + h[n[1].handle].node = 1; + + h[hMin].key = NULL; + h[hMin].node = pq->freeList; + pq->freeList = hMin; + + if( -- pq->size > 0 ) { + FloatDown( pq, 1 ); + } + } + return min; +} + +/* really __gl_pqHeapDelete */ +void pqDelete( PriorityQ *pq, PQhandle hCurr ) +{ + PQnode *n = pq->nodes; + PQhandleElem *h = pq->handles; + long curr; + + assert( hCurr >= 1 && hCurr <= pq->max && h[hCurr].key != NULL ); + + curr = h[hCurr].node; + n[curr].handle = n[pq->size].handle; + h[n[curr].handle].node = curr; + + if( curr <= -- pq->size ) { + if( curr <= 1 || LEQ( h[n[curr>>1].handle].key, h[n[curr].handle].key )) { + FloatDown( pq, curr ); + } else { + FloatUp( pq, curr ); + } + } + h[hCurr].key = NULL; + h[hCurr].node = pq->freeList; + pq->freeList = hCurr; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-heap.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,107 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __priorityq_heap_h_ +#define __priorityq_heap_h_ + +/* Use #define's so that another heap implementation can use this one */ + +#define PQkey PQHeapKey +#define PQhandle PQHeapHandle +#define PriorityQ PriorityQHeap + +#define pqNewPriorityQ(leq) __gl_pqHeapNewPriorityQ(leq) +#define pqDeletePriorityQ(pq) __gl_pqHeapDeletePriorityQ(pq) + +/* The basic operations are insertion of a new key (pqInsert), + * and examination/extraction of a key whose value is minimum + * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete); + * for this purpose pqInsert returns a "handle" which is supplied + * as the argument. + * + * An initial heap may be created efficiently by calling pqInsert + * repeatedly, then calling pqInit. In any case pqInit must be called + * before any operations other than pqInsert are used. + * + * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key. + * This may also be tested with pqIsEmpty. + */ +#define pqInit(pq) __gl_pqHeapInit(pq) +#define pqInsert(pq,key) __gl_pqHeapInsert(pq,key) +#define pqMinimum(pq) __gl_pqHeapMinimum(pq) +#define pqExtractMin(pq) __gl_pqHeapExtractMin(pq) +#define pqDelete(pq,handle) __gl_pqHeapDelete(pq,handle) +#define pqIsEmpty(pq) __gl_pqHeapIsEmpty(pq) + + +/* Since we support deletion the data structure is a little more + * complicated than an ordinary heap. "nodes" is the heap itself; + * active nodes are stored in the range 1..pq->size. When the + * heap exceeds its allocated size (pq->max), its size doubles. + * The children of node i are nodes 2i and 2i+1. + * + * Each node stores an index into an array "handles". Each handle + * stores a key, plus a pointer back to the node which currently + * represents that key (ie. nodes[handles[i].node].handle == i). + */ + +typedef void *PQkey; +typedef long PQhandle; +typedef struct PriorityQ PriorityQ; + +typedef struct { PQhandle handle; } PQnode; +typedef struct { PQkey key; PQhandle node; } PQhandleElem; + +struct PriorityQ { + PQnode *nodes; + PQhandleElem *handles; + long size, max; + PQhandle freeList; + int initialized; + int (*leq)(PQkey key1, PQkey key2); +}; + +PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); +void pqDeletePriorityQ( PriorityQ *pq ); + +void pqInit( PriorityQ *pq ); +PQhandle pqInsert( PriorityQ *pq, PQkey key ); +PQkey pqExtractMin( PriorityQ *pq ); +void pqDelete( PriorityQ *pq, PQhandle handle ); + + +#define __gl_pqHeapMinimum(pq) ((pq)->handles[(pq)->nodes[1].handle].key) +#define __gl_pqHeapIsEmpty(pq) ((pq)->size == 0) + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-sort.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-sort.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-sort.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/priorityq-sort.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,117 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __priorityq_sort_h_ +#define __priorityq_sort_h_ + +#include "priorityq-heap.h" + +#undef PQkey +#undef PQhandle +#undef PriorityQ +#undef pqNewPriorityQ +#undef pqDeletePriorityQ +#undef pqInit +#undef pqInsert +#undef pqMinimum +#undef pqExtractMin +#undef pqDelete +#undef pqIsEmpty + +/* Use #define's so that another heap implementation can use this one */ + +#define PQkey PQSortKey +#define PQhandle PQSortHandle +#define PriorityQ PriorityQSort + +#define pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq) +#define pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq) + +/* The basic operations are insertion of a new key (pqInsert), + * and examination/extraction of a key whose value is minimum + * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete); + * for this purpose pqInsert returns a "handle" which is supplied + * as the argument. + * + * An initial heap may be created efficiently by calling pqInsert + * repeatedly, then calling pqInit. In any case pqInit must be called + * before any operations other than pqInsert are used. + * + * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key. + * This may also be tested with pqIsEmpty. + */ +#define pqInit(pq) __gl_pqSortInit(pq) +#define pqInsert(pq,key) __gl_pqSortInsert(pq,key) +#define pqMinimum(pq) __gl_pqSortMinimum(pq) +#define pqExtractMin(pq) __gl_pqSortExtractMin(pq) +#define pqDelete(pq,handle) __gl_pqSortDelete(pq,handle) +#define pqIsEmpty(pq) __gl_pqSortIsEmpty(pq) + + +/* Since we support deletion the data structure is a little more + * complicated than an ordinary heap. "nodes" is the heap itself; + * active nodes are stored in the range 1..pq->size. When the + * heap exceeds its allocated size (pq->max), its size doubles. + * The children of node i are nodes 2i and 2i+1. + * + * Each node stores an index into an array "handles". Each handle + * stores a key, plus a pointer back to the node which currently + * represents that key (ie. nodes[handles[i].node].handle == i). + */ + +typedef PQHeapKey PQkey; +typedef PQHeapHandle PQhandle; +typedef struct PriorityQ PriorityQ; + +struct PriorityQ { + PriorityQHeap *heap; + PQkey *keys; + PQkey **order; + PQhandle size, max; + int initialized; + int (*leq)(PQkey key1, PQkey key2); +}; + +PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); +void pqDeletePriorityQ( PriorityQ *pq ); + +int pqInit( PriorityQ *pq ); +PQhandle pqInsert( PriorityQ *pq, PQkey key ); +PQkey pqExtractMin( PriorityQ *pq ); +void pqDelete( PriorityQ *pq, PQhandle handle ); + +PQkey pqMinimum( PriorityQ *pq ); +int pqIsEmpty( PriorityQ *pq ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/README xpsb-glx-0.19/mesa/src/glu/sgi/libtess/README --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/README 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/README 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,446 @@ +/* +*/ + +General Polygon Tesselation +--------------------------- + + This note describes a tesselator for polygons consisting of one or + more closed contours. It is backward-compatible with the current + OpenGL Utilities tesselator, and is intended to replace it. Here is + a summary of the major differences: + + - input contours can be intersecting, self-intersecting, or degenerate. + + - supports a choice of several winding rules for determining which parts + of the polygon are on the "interior". This makes it possible to do + CSG operations on polygons. + + - boundary extraction: instead of tesselating the polygon, returns a + set of closed contours which separate the interior from the exterior. + + - returns the output as a small number of triangle fans and strips, + rather than a list of independent triangles (when possible). + + - output is available as an explicit mesh (a quad-edge structure), + in addition to the normal callback interface. + + - the algorithm used is extremely robust. + + +The interface +------------- + + The tesselator state is maintained in a "tesselator object". + These are allocated and destroyed using + + GLUtesselator *gluNewTess( void ); + void gluDeleteTess( GLUtesselator *tess ); + + Several tesselator objects may be used simultaneously. + + Inputs + ------ + + The input contours are specified with the following routines: + + void gluTessBeginPolygon( GLUtesselator *tess ); + void gluTessBeginContour( GLUtesselator *tess ); + void gluTessVertex( GLUtesselator *tess, GLUcoord coords[3], void *data ); + void gluTessEndContour( GLUtesselator *tess ); + void gluTessEndPolygon( GLUtesselator *tess ); + + Within each BeginPolygon/EndPolygon pair, there can be zero or more + calls to BeginContour/EndContour. Within each contour, there are zero + or more calls to gluTessVertex(). The vertices specify a closed + contour (the last vertex of each contour is automatically linked to + the first). + + "coords" give the coordinates of the vertex in 3-space. For useful + results, all vertices should lie in some plane, since the vertices + are projected onto a plane before tesselation. "data" is a pointer + to a user-defined vertex structure, which typically contains other + information such as color, texture coordinates, normal, etc. It is + used to refer to the vertex during rendering. + + The library can be compiled in single- or double-precision; the type + GLUcoord represents either "float" or "double" accordingly. The GLU + version will be available in double-precision only. Compile with + GLU_TESS_API_FLOAT defined to get the single-precision version. + + When EndPolygon is called, the tesselation algorithm determines + which regions are interior to the given contours, according to one + of several "winding rules" described below. The interior regions + are then tesselated, and the output is provided as callbacks. + + + Rendering Callbacks + ------------------- + + Callbacks are specified by the client using + + void gluTessCallback( GLUtesselator *tess, GLenum which, void (*fn)()); + + If "fn" is NULL, any previously defined callback is discarded. + + The callbacks used to provide output are: /* which == */ + + void begin( GLenum type ); /* GLU_TESS_BEGIN */ + void edgeFlag( GLboolean flag ); /* GLU_TESS_EDGE_FLAG */ + void vertex( void *data ); /* GLU_TESS_VERTEX */ + void end( void ); /* GLU_TESS_END */ + + Any of the callbacks may be left undefined; if so, the corresponding + information will not be supplied during rendering. + + The "begin" callback indicates the start of a primitive; type is one + of GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES (but see the + notes on "boundary extraction" below). + + It is followed by any number of "vertex" callbacks, which supply the + vertices in the same order as expected by the corresponding glBegin() + call. After the last vertex of a given primitive, there is a callback + to "end". + + If the "edgeFlag" callback is provided, no triangle fans or strips + will be used. When edgeFlag is called, if "flag" is GL_TRUE then each + vertex which follows begins an edge which lies on the polygon boundary + (ie. an edge which separates an interior region from an exterior one). + If "flag" is GL_FALSE, each vertex which follows begins an edge which lies + in the polygon interior. "edgeFlag" will be called before the first + call to "vertex". + + Other Callbacks + --------------- + + void mesh( GLUmesh *mesh ); /* GLU_TESS_MESH */ + + - Returns an explicit mesh, represented using the quad-edge structure + (Guibas/Stolfi '85). Other implementations of this interface might + use a different mesh structure, so this is available only only as an + SGI extension. When the mesh is no longer needed, it should be freed + using + + void gluDeleteMesh( GLUmesh *mesh ); + + There is a brief description of this data structure in the include + file "mesh.h". For the full details, see L. Guibas and J. Stolfi, + Primitives for the manipulation of general subdivisions and the + computation of Voronoi diagrams, ACM Transactions on Graphics, + 4(2):74-123, April 1985. For an introduction, see the course notes + for CS348a, "Mathematical Foundations of Computer Graphics", + available at the Stanford bookstore (and taught during the fall + quarter). + + void error( GLenum errno ); /* GLU_TESS_ERROR */ + + - errno is one of GLU_TESS_MISSING_BEGIN_POLYGON, + GLU_TESS_MISSING_END_POLYGON, + GLU_TESS_MISSING_BEGIN_CONTOUR, + GLU_TESS_MISSING_END_CONTOUR, + GLU_TESS_COORD_TOO_LARGE, + GLU_TESS_NEED_COMBINE_CALLBACK + + The first four are obvious. The interface recovers from these + errors by inserting the missing call(s). + + GLU_TESS_COORD_TOO_LARGE says that some vertex coordinate exceeded + the predefined constant GLU_TESS_MAX_COORD in absolute value, and + that the value has been clamped. (Coordinate values must be small + enough so that two can be multiplied together without overflow.) + + GLU_TESS_NEED_COMBINE_CALLBACK says that the algorithm detected an + intersection between two edges in the input data, and the "combine" + callback (below) was not provided. No output will be generated. + + + void combine( GLUcoord coords[3], void *data[4], /* GLU_TESS_COMBINE */ + GLUcoord weight[4], void **outData ); + + - When the algorithm detects an intersection, or wishes to merge + features, it needs to create a new vertex. The vertex is defined + as a linear combination of up to 4 existing vertices, referenced + by data[0..3]. The coefficients of the linear combination are + given by weight[0..3]; these weights always sum to 1.0. All vertex + pointers are valid even when some of the weights are zero. + "coords" gives the location of the new vertex. + + The user must allocate another vertex, interpolate parameters + using "data" and "weights", and return the new vertex pointer in + "outData". This handle is supplied during rendering callbacks. + For example, if the polygon lies in an arbitrary plane in 3-space, + and we associate a color with each vertex, the combine callback might + look like this: + + void myCombine( GLUcoord coords[3], VERTEX *d[4], + GLUcoord w[4], VERTEX **dataOut ) + { + VERTEX *new = new_vertex(); + + new->x = coords[0]; + new->y = coords[1]; + new->z = coords[2]; + new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r; + new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g; + new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b; + new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a; + *dataOut = new; + } + + If the algorithm detects an intersection, then the "combine" callback + must be defined, and must write a non-NULL pointer into "dataOut". + Otherwise the GLU_TESS_NEED_COMBINE_CALLBACK error occurs, and no + output is generated. This is the only error that can occur during + tesselation and rendering. + + + Control over Tesselation + ------------------------ + + void gluTessProperty( GLUtesselator *tess, GLenum which, GLUcoord value ); + + Properties defined: + + - GLU_TESS_WINDING_RULE. Possible values: + + GLU_TESS_WINDING_ODD + GLU_TESS_WINDING_NONZERO + GLU_TESS_WINDING_POSITIVE + GLU_TESS_WINDING_NEGATIVE + GLU_TESS_WINDING_ABS_GEQ_TWO + + The input contours parition the plane into regions. A winding + rule determines which of these regions are inside the polygon. + + For a single contour C, the winding number of a point x is simply + the signed number of revolutions we make around x as we travel + once around C (where CCW is positive). When there are several + contours, the individual winding numbers are summed. This + procedure associates a signed integer value with each point x in + the plane. Note that the winding number is the same for all + points in a single region. + + The winding rule classifies a region as "inside" if its winding + number belongs to the chosen category (odd, nonzero, positive, + negative, or absolute value of at least two). The current GLU + tesselator implements the "odd" rule. The "nonzero" rule is another + common way to define the interior. The other three rules are + useful for polygon CSG operations (see below). + + - GLU_TESS_BOUNDARY_ONLY. Values: TRUE (non-zero) or FALSE (zero). + + If TRUE, returns a set of closed contours which separate the + polygon interior and exterior (rather than a tesselation). + Exterior contours are oriented CCW with respect to the normal, + interior contours are oriented CW. The GLU_TESS_BEGIN callback + uses the type GL_LINE_LOOP for each contour. + + - GLU_TESS_TOLERANCE. Value: a real number between 0.0 and 1.0. + + This specifies a tolerance for merging features to reduce the size + of the output. For example, two vertices which are very close to + each other might be replaced by a single vertex. The tolerance + is multiplied by the largest coordinate magnitude of any input vertex; + this specifies the maximum distance that any feature can move as the + result of a single merge operation. If a single feature takes part + in several merge operations, the total distance moved could be larger. + + Feature merging is completely optional; the tolerance is only a hint. + The implementation is free to merge in some cases and not in others, + or to never merge features at all. The default tolerance is zero. + + The current implementation merges vertices only if they are exactly + coincident, regardless of the current tolerance. A vertex is + spliced into an edge only if the implementation is unable to + distinguish which side of the edge the vertex lies on. + Two edges are merged only when both endpoints are identical. + + + void gluTessNormal( GLUtesselator *tess, + GLUcoord x, GLUcoord y, GLUcoord z ) + + - Lets the user supply the polygon normal, if known. All input data + is projected into a plane perpendicular to the normal before + tesselation. All output triangles are oriented CCW with + respect to the normal (CW orientation can be obtained by + reversing the sign of the supplied normal). For example, if + you know that all polygons lie in the x-y plane, call + "gluTessNormal(tess, 0.0, 0.0, 1.0)" before rendering any polygons. + + - If the supplied normal is (0,0,0) (the default value), the + normal is determined as follows. The direction of the normal, + up to its sign, is found by fitting a plane to the vertices, + without regard to how the vertices are connected. It is + expected that the input data lies approximately in plane; + otherwise projection perpendicular to the computed normal may + substantially change the geometry. The sign of the normal is + chosen so that the sum of the signed areas of all input contours + is non-negative (where a CCW contour has positive area). + + - The supplied normal persists until it is changed by another + call to gluTessNormal. + + + Backward compatibility with the GLU tesselator + ---------------------------------------------- + + The preferred interface is the one described above. The following + routines are obsolete, and are provided only for backward compatibility: + + typedef GLUtesselator GLUtriangulatorObj; /* obsolete name */ + + void gluBeginPolygon( GLUtesselator *tess ); + void gluNextContour( GLUtesselator *tess, GLenum type ); + void gluEndPolygon( GLUtesselator *tess ); + + "type" is one of GLU_EXTERIOR, GLU_INTERIOR, GLU_CCW, GLU_CW, or + GLU_UNKNOWN. It is ignored by the current GLU tesselator. + + GLU_BEGIN, GLU_VERTEX, GLU_END, GLU_ERROR, and GLU_EDGE_FLAG are defined + as synonyms for GLU_TESS_BEGIN, GLU_TESS_VERTEX, GLU_TESS_END, + GLU_TESS_ERROR, and GLU_TESS_EDGE_FLAG. + + +Polygon CSG operations +---------------------- + + The features of the tesselator make it easy to find the union, difference, + or intersection of several polygons. + + First, assume that each polygon is defined so that the winding number + is 0 for each exterior region, and 1 for each interior region. Under + this model, CCW contours define the outer boundary of the polygon, and + CW contours define holes. Contours may be nested, but a nested + contour must be oriented oppositely from the contour that contains it. + + If the original polygons do not satisfy this description, they can be + converted to this form by first running the tesselator with the + GLU_TESS_BOUNDARY_ONLY property turned on. This returns a list of + contours satisfying the restriction above. By allocating two + tesselator objects, the callbacks from one tesselator can be fed + directly to the input of another. + + Given two or more polygons of the form above, CSG operations can be + implemented as follows: + + Union + Draw all the input contours as a single polygon. The winding number + of each resulting region is the number of original polygons + which cover it. The union can be extracted using the + GLU_TESS_WINDING_NONZERO or GLU_TESS_WINDING_POSITIVE winding rules. + Note that with the nonzero rule, we would get the same result if + all contour orientations were reversed. + + Intersection (two polygons at a time only) + Draw a single polygon using the contours from both input polygons. + Extract the result using GLU_TESS_WINDING_ABS_GEQ_TWO. (Since this + winding rule looks at the absolute value, reversing all contour + orientations does not change the result.) + + Difference + + Suppose we want to compute A \ (B union C union D). Draw a single + polygon consisting of the unmodified contours from A, followed by + the contours of B,C,D with the vertex order reversed (this changes + the winding number of the interior regions to -1). To extract the + result, use the GLU_TESS_WINDING_POSITIVE rule. + + If B,C,D are the result of a GLU_TESS_BOUNDARY_ONLY call, an + alternative to reversing the vertex order is to reverse the sign of + the supplied normal. For example in the x-y plane, call + gluTessNormal( tess, 0.0, 0.0, -1.0 ). + + +Performance +----------- + + The tesselator is not intended for immediate-mode rendering; when + possible the output should be cached in a user structure or display + list. General polygon tesselation is an inherently difficult problem, + especially given the goal of extreme robustness. + + The implementation makes an effort to output a small number of fans + and strips; this should improve the rendering performance when the + output is used in a display list. + + Single-contour input polygons are first tested to see whether they can + be rendered as a triangle fan with respect to the first vertex (to + avoid running the full decomposition algorithm on convex polygons). + Non-convex polygons may be rendered by this "fast path" as well, if + the algorithm gets lucky in its choice of a starting vertex. + + For best performance follow these guidelines: + + - supply the polygon normal, if available, using gluTessNormal(). + This represents about 10% of the computation time. For example, + if all polygons lie in the x-y plane, use gluTessNormal(tess,0,0,1). + + - render many polygons using the same tesselator object, rather than + allocating a new tesselator for each one. (In a multi-threaded, + multi-processor environment you may get better performance using + several tesselators.) + + +Comparison with the GLU tesselator +---------------------------------- + + On polygons which make it through the "fast path", the tesselator is + 3 to 5 times faster than the GLU tesselator. + + On polygons which don't make it through the fast path (but which don't + have self-intersections or degeneracies), it is about 2 times slower. + + On polygons with self-intersections or degeneraces, there is nothing + to compare against. + + The new tesselator generates many more fans and strips, reducing the + number of vertices that need to be sent to the hardware. + + Key to the statistics: + + vert number of input vertices on all contours + cntr number of input contours + tri number of triangles in all output primitives + strip number of triangle strips + fan number of triangle fans + ind number of independent triangles + ms number of milliseconds for tesselation + (on a 150MHz R4400 Indy) + + Convex polygon examples: + +New: 3 vert, 1 cntr, 1 tri, 0 strip, 0 fan, 1 ind, 0.0459 ms +Old: 3 vert, 1 cntr, 1 tri, 0 strip, 0 fan, 1 ind, 0.149 ms +New: 4 vert, 1 cntr, 2 tri, 0 strip, 1 fan, 0 ind, 0.0459 ms +Old: 4 vert, 1 cntr, 2 tri, 0 strip, 0 fan, 2 ind, 0.161 ms +New: 36 vert, 1 cntr, 34 tri, 0 strip, 1 fan, 0 ind, 0.153 ms +Old: 36 vert, 1 cntr, 34 tri, 0 strip, 0 fan, 34 ind, 0.621 ms + + Concave single-contour polygons: + +New: 5 vert, 1 cntr, 3 tri, 0 strip, 1 fan, 0 ind, 0.052 ms +Old: 5 vert, 1 cntr, 3 tri, 0 strip, 0 fan, 3 ind, 0.252 ms +New: 19 vert, 1 cntr, 17 tri, 2 strip, 2 fan, 1 ind, 0.911 ms +Old: 19 vert, 1 cntr, 17 tri, 0 strip, 0 fan, 17 ind, 0.529 ms +New: 151 vert, 1 cntr, 149 tri, 13 strip, 18 fan, 3 ind, 6.82 ms +Old: 151 vert, 1 cntr, 149 tri, 0 strip, 3 fan, 143 ind, 2.7 ms +New: 574 vert, 1 cntr, 572 tri, 59 strip, 54 fan, 11 ind, 26.6 ms +Old: 574 vert, 1 cntr, 572 tri, 0 strip, 31 fan, 499 ind, 12.4 ms + + Multiple contours, but no intersections: + +New: 7 vert, 2 cntr, 7 tri, 1 strip, 0 fan, 0 ind, 0.527 ms +Old: 7 vert, 2 cntr, 7 tri, 0 strip, 0 fan, 7 ind, 0.274 ms +New: 81 vert, 6 cntr, 89 tri, 9 strip, 7 fan, 6 ind, 3.88 ms +Old: 81 vert, 6 cntr, 89 tri, 0 strip, 13 fan, 61 ind, 2.2 ms +New: 391 vert, 19 cntr, 413 tri, 37 strip, 32 fan, 26 ind, 20.2 ms +Old: 391 vert, 19 cntr, 413 tri, 0 strip, 25 fan, 363 ind, 8.68 ms + + Self-intersecting and degenerate examples: + +Bowtie: 4 vert, 1 cntr, 2 tri, 0 strip, 0 fan, 2 ind, 0.483 ms +Star: 5 vert, 1 cntr, 5 tri, 0 strip, 0 fan, 5 ind, 0.91 ms +Random: 24 vert, 7 cntr, 46 tri, 2 strip, 12 fan, 7 ind, 5.32 ms +Font: 333 vert, 2 cntr, 331 tri, 32 strip, 16 fan, 3 ind, 14.1 ms +: 167 vert, 35 cntr, 254 tri, 8 strip, 56 fan, 52 ind, 46.3 ms +: 78 vert, 1 cntr, 2675 tri, 148 strip, 207 fan, 180 ind, 243 ms +: 12480 vert, 2 cntr, 12478 tri, 736 strip,1275 fan, 5 ind, 1010 ms diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,498 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include +#include "mesh.h" +#include "tess.h" +#include "render.h" + +#define TRUE 1 +#define FALSE 0 + +/* This structure remembers the information we need about a primitive + * to be able to render it later, once we have determined which + * primitive is able to use the most triangles. + */ +struct FaceCount { + long size; /* number of triangles used */ + GLUhalfEdge *eStart; /* edge where this primitive starts */ + void (*render)(GLUtesselator *, GLUhalfEdge *, long); + /* routine to render this primitive */ +}; + +static struct FaceCount MaximumFan( GLUhalfEdge *eOrig ); +static struct FaceCount MaximumStrip( GLUhalfEdge *eOrig ); + +static void RenderFan( GLUtesselator *tess, GLUhalfEdge *eStart, long size ); +static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *eStart, long size ); +static void RenderTriangle( GLUtesselator *tess, GLUhalfEdge *eStart, + long size ); + +static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig ); +static void RenderLonelyTriangles( GLUtesselator *tess, GLUface *head ); + + + +/************************ Strips and Fans decomposition ******************/ + +/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle + * fans, strips, and separate triangles. A substantial effort is made + * to use as few rendering primitives as possible (ie. to make the fans + * and strips as large as possible). + * + * The rendering output is provided as callbacks (see the api). + */ +void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh ) +{ + GLUface *f; + + /* Make a list of separate triangles so we can render them all at once */ + tess->lonelyTriList = NULL; + + for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) { + f->marked = FALSE; + } + for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) { + + /* We examine all faces in an arbitrary order. Whenever we find + * an unprocessed face F, we output a group of faces including F + * whose size is maximum. + */ + if( f->inside && ! f->marked ) { + RenderMaximumFaceGroup( tess, f ); + assert( f->marked ); + } + } + if( tess->lonelyTriList != NULL ) { + RenderLonelyTriangles( tess, tess->lonelyTriList ); + tess->lonelyTriList = NULL; + } +} + + +static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig ) +{ + /* We want to find the largest triangle fan or strip of unmarked faces + * which includes the given face fOrig. There are 3 possible fans + * passing through fOrig (one centered at each vertex), and 3 possible + * strips (one for each CCW permutation of the vertices). Our strategy + * is to try all of these, and take the primitive which uses the most + * triangles (a greedy approach). + */ + GLUhalfEdge *e = fOrig->anEdge; + struct FaceCount max, newFace; + + max.size = 1; + max.eStart = e; + max.render = &RenderTriangle; + + if( ! tess->flagBoundary ) { + newFace = MaximumFan( e ); if( newFace.size > max.size ) { max = newFace; } + newFace = MaximumFan( e->Lnext ); if( newFace.size > max.size ) { max = newFace; } + newFace = MaximumFan( e->Lprev ); if( newFace.size > max.size ) { max = newFace; } + + newFace = MaximumStrip( e ); if( newFace.size > max.size ) { max = newFace; } + newFace = MaximumStrip( e->Lnext ); if( newFace.size > max.size ) { max = newFace; } + newFace = MaximumStrip( e->Lprev ); if( newFace.size > max.size ) { max = newFace; } + } + (*(max.render))( tess, max.eStart, max.size ); +} + + +/* Macros which keep track of faces we have marked temporarily, and allow + * us to backtrack when necessary. With triangle fans, this is not + * really necessary, since the only awkward case is a loop of triangles + * around a single origin vertex. However with strips the situation is + * more complicated, and we need a general tracking method like the + * one here. + */ +#define Marked(f) (! (f)->inside || (f)->marked) + +#define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = TRUE) + +#define FreeTrail(t) if( 1 ) { \ + while( (t) != NULL ) { \ + (t)->marked = FALSE; t = (t)->trail; \ + } \ + } else /* absorb trailing semicolon */ + + + +static struct FaceCount MaximumFan( GLUhalfEdge *eOrig ) +{ + /* eOrig->Lface is the face we want to render. We want to find the size + * of a maximal fan around eOrig->Org. To do this we just walk around + * the origin vertex as far as possible in both directions. + */ + struct FaceCount newFace = { 0, NULL, &RenderFan }; + GLUface *trail = NULL; + GLUhalfEdge *e; + + for( e = eOrig; ! Marked( e->Lface ); e = e->Onext ) { + AddToTrail( e->Lface, trail ); + ++newFace.size; + } + for( e = eOrig; ! Marked( e->Rface ); e = e->Oprev ) { + AddToTrail( e->Rface, trail ); + ++newFace.size; + } + newFace.eStart = e; + /*LINTED*/ + FreeTrail( trail ); + return newFace; +} + + +#define IsEven(n) (((n) & 1) == 0) + +static struct FaceCount MaximumStrip( GLUhalfEdge *eOrig ) +{ + /* Here we are looking for a maximal strip that contains the vertices + * eOrig->Org, eOrig->Dst, eOrig->Lnext->Dst (in that order or the + * reverse, such that all triangles are oriented CCW). + * + * Again we walk forward and backward as far as possible. However for + * strips there is a twist: to get CCW orientations, there must be + * an *even* number of triangles in the strip on one side of eOrig. + * We walk the strip starting on a side with an even number of triangles; + * if both side have an odd number, we are forced to shorten one side. + */ + struct FaceCount newFace = { 0, NULL, &RenderStrip }; + long headSize = 0, tailSize = 0; + GLUface *trail = NULL; + GLUhalfEdge *e, *eTail, *eHead; + + for( e = eOrig; ! Marked( e->Lface ); ++tailSize, e = e->Onext ) { + AddToTrail( e->Lface, trail ); + ++tailSize; + e = e->Dprev; + if( Marked( e->Lface )) break; + AddToTrail( e->Lface, trail ); + } + eTail = e; + + for( e = eOrig; ! Marked( e->Rface ); ++headSize, e = e->Dnext ) { + AddToTrail( e->Rface, trail ); + ++headSize; + e = e->Oprev; + if( Marked( e->Rface )) break; + AddToTrail( e->Rface, trail ); + } + eHead = e; + + newFace.size = tailSize + headSize; + if( IsEven( tailSize )) { + newFace.eStart = eTail->Sym; + } else if( IsEven( headSize )) { + newFace.eStart = eHead; + } else { + /* Both sides have odd length, we must shorten one of them. In fact, + * we must start from eHead to guarantee inclusion of eOrig->Lface. + */ + --newFace.size; + newFace.eStart = eHead->Onext; + } + /*LINTED*/ + FreeTrail( trail ); + return newFace; +} + + +static void RenderTriangle( GLUtesselator *tess, GLUhalfEdge *e, long size ) +{ + /* Just add the triangle to a triangle list, so we can render all + * the separate triangles at once. + */ + assert( size == 1 ); + AddToTrail( e->Lface, tess->lonelyTriList ); +} + + +static void RenderLonelyTriangles( GLUtesselator *tess, GLUface *f ) +{ + /* Now we render all the separate triangles which could not be + * grouped into a triangle fan or strip. + */ + GLUhalfEdge *e; + int newState; + int edgeState = -1; /* force edge state output for first vertex */ + + CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLES ); + + for( ; f != NULL; f = f->trail ) { + /* Loop once for each edge (there will always be 3 edges) */ + + e = f->anEdge; + do { + if( tess->flagBoundary ) { + /* Set the "edge state" to TRUE just before we output the + * first vertex of each edge on the polygon boundary. + */ + newState = ! e->Rface->inside; + if( edgeState != newState ) { + edgeState = newState; + CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA( edgeState ); + } + } + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + + e = e->Lnext; + } while( e != f->anEdge ); + } + CALL_END_OR_END_DATA(); +} + + +static void RenderFan( GLUtesselator *tess, GLUhalfEdge *e, long size ) +{ + /* Render as many CCW triangles as possible in a fan starting from + * edge "e". The fan *should* contain exactly "size" triangles + * (otherwise we've goofed up somewhere). + */ + CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + + while( ! Marked( e->Lface )) { + e->Lface->marked = TRUE; + --size; + e = e->Onext; + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + } + + assert( size == 0 ); + CALL_END_OR_END_DATA(); +} + + +static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *e, long size ) +{ + /* Render as many CCW triangles as possible in a strip starting from + * edge "e". The strip *should* contain exactly "size" triangles + * (otherwise we've goofed up somewhere). + */ + CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_STRIP ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + + while( ! Marked( e->Lface )) { + e->Lface->marked = TRUE; + --size; + e = e->Dprev; + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + if( Marked( e->Lface )) break; + + e->Lface->marked = TRUE; + --size; + e = e->Onext; + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + } + + assert( size == 0 ); + CALL_END_OR_END_DATA(); +} + + +/************************ Boundary contour decomposition ******************/ + +/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one + * contour for each face marked "inside". The rendering output is + * provided as callbacks (see the api). + */ +void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ) +{ + GLUface *f; + GLUhalfEdge *e; + + for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) { + if( f->inside ) { + CALL_BEGIN_OR_BEGIN_DATA( GL_LINE_LOOP ); + e = f->anEdge; + do { + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + e = e->Lnext; + } while( e != f->anEdge ); + CALL_END_OR_END_DATA(); + } + } +} + + +/************************ Quick-and-dirty decomposition ******************/ + +#define SIGN_INCONSISTENT 2 + +static int ComputeNormal( GLUtesselator *tess, GLdouble norm[3], int check ) +/* + * If check==FALSE, we compute the polygon normal and place it in norm[]. + * If check==TRUE, we check that each triangle in the fan from v0 has a + * consistent orientation with respect to norm[]. If triangles are + * consistently oriented CCW, return 1; if CW, return -1; if all triangles + * are degenerate return 0; otherwise (no consistent orientation) return + * SIGN_INCONSISTENT. + */ +{ + CachedVertex *v0 = tess->cache; + CachedVertex *vn = v0 + tess->cacheCount; + CachedVertex *vc; + GLdouble dot, xc, yc, zc, xp, yp, zp, n[3]; + int sign = 0; + + /* Find the polygon normal. It is important to get a reasonable + * normal even when the polygon is self-intersecting (eg. a bowtie). + * Otherwise, the computed normal could be very tiny, but perpendicular + * to the true plane of the polygon due to numerical noise. Then all + * the triangles would appear to be degenerate and we would incorrectly + * decompose the polygon as a fan (or simply not render it at all). + * + * We use a sum-of-triangles normal algorithm rather than the more + * efficient sum-of-trapezoids method (used in CheckOrientation() + * in normal.c). This lets us explicitly reverse the signed area + * of some triangles to get a reasonable normal in the self-intersecting + * case. + */ + if( ! check ) { + norm[0] = norm[1] = norm[2] = 0.0; + } + + vc = v0 + 1; + xc = vc->coords[0] - v0->coords[0]; + yc = vc->coords[1] - v0->coords[1]; + zc = vc->coords[2] - v0->coords[2]; + while( ++vc < vn ) { + xp = xc; yp = yc; zp = zc; + xc = vc->coords[0] - v0->coords[0]; + yc = vc->coords[1] - v0->coords[1]; + zc = vc->coords[2] - v0->coords[2]; + + /* Compute (vp - v0) cross (vc - v0) */ + n[0] = yp*zc - zp*yc; + n[1] = zp*xc - xp*zc; + n[2] = xp*yc - yp*xc; + + dot = n[0]*norm[0] + n[1]*norm[1] + n[2]*norm[2]; + if( ! check ) { + /* Reverse the contribution of back-facing triangles to get + * a reasonable normal for self-intersecting polygons (see above) + */ + if( dot >= 0 ) { + norm[0] += n[0]; norm[1] += n[1]; norm[2] += n[2]; + } else { + norm[0] -= n[0]; norm[1] -= n[1]; norm[2] -= n[2]; + } + } else if( dot != 0 ) { + /* Check the new orientation for consistency with previous triangles */ + if( dot > 0 ) { + if( sign < 0 ) return SIGN_INCONSISTENT; + sign = 1; + } else { + if( sign > 0 ) return SIGN_INCONSISTENT; + sign = -1; + } + } + } + return sign; +} + +/* __gl_renderCache( tess ) takes a single contour and tries to render it + * as a triangle fan. This handles convex polygons, as well as some + * non-convex polygons if we get lucky. + * + * Returns TRUE if the polygon was successfully rendered. The rendering + * output is provided as callbacks (see the api). + */ +GLboolean __gl_renderCache( GLUtesselator *tess ) +{ + CachedVertex *v0 = tess->cache; + CachedVertex *vn = v0 + tess->cacheCount; + CachedVertex *vc; + GLdouble norm[3]; + int sign; + + if( tess->cacheCount < 3 ) { + /* Degenerate contour -- no output */ + return TRUE; + } + + norm[0] = tess->normal[0]; + norm[1] = tess->normal[1]; + norm[2] = tess->normal[2]; + if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) { + ComputeNormal( tess, norm, FALSE ); + } + + sign = ComputeNormal( tess, norm, TRUE ); + if( sign == SIGN_INCONSISTENT ) { + /* Fan triangles did not have a consistent orientation */ + return FALSE; + } + if( sign == 0 ) { + /* All triangles were degenerate */ + return TRUE; + } + + /* Make sure we do the right thing for each winding rule */ + switch( tess->windingRule ) { + case GLU_TESS_WINDING_ODD: + case GLU_TESS_WINDING_NONZERO: + break; + case GLU_TESS_WINDING_POSITIVE: + if( sign < 0 ) return TRUE; + break; + case GLU_TESS_WINDING_NEGATIVE: + if( sign > 0 ) return TRUE; + break; + case GLU_TESS_WINDING_ABS_GEQ_TWO: + return TRUE; + } + + CALL_BEGIN_OR_BEGIN_DATA( tess->boundaryOnly ? GL_LINE_LOOP + : (tess->cacheCount > 3) ? GL_TRIANGLE_FAN + : GL_TRIANGLES ); + + CALL_VERTEX_OR_VERTEX_DATA( v0->data ); + if( sign > 0 ) { + for( vc = v0+1; vc < vn; ++vc ) { + CALL_VERTEX_OR_VERTEX_DATA( vc->data ); + } + } else { + for( vc = vn-1; vc > v0; --vc ) { + CALL_VERTEX_OR_VERTEX_DATA( vc->data ); + } + } + CALL_END_OR_END_DATA(); + return TRUE; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/render.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,52 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __render_h_ +#define __render_h_ + +#include "mesh.h" + +/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle + * fans, strips, and separate triangles. A substantial effort is made + * to use as few rendering primitives as possible (ie. to make the fans + * and strips as large as possible). + * + * The rendering output is provided as callbacks (see the api). + */ +void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh ); +void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ); + +GLboolean __gl_renderCache( GLUtesselator *tess ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1357 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include +#include /* longjmp */ +#include /* LONG_MAX */ + +#include "mesh.h" +#include "geom.h" +#include "tess.h" +#include "dict.h" +#include "priorityq.h" +#include "memalloc.h" +#include "sweep.h" + +#define TRUE 1 +#define FALSE 0 + +#ifdef FOR_TRITE_TEST_PROGRAM +extern void DebugEvent( GLUtesselator *tess ); +#else +#define DebugEvent( tess ) +#endif + +/* + * Invariants for the Edge Dictionary. + * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2) + * at any valid location of the sweep event + * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2 + * share a common endpoint + * - for each e, e->Dst has been processed, but not e->Org + * - each edge e satisfies VertLeq(e->Dst,event) && VertLeq(event,e->Org) + * where "event" is the current sweep line event. + * - no edge e has zero length + * + * Invariants for the Mesh (the processed portion). + * - the portion of the mesh left of the sweep line is a planar graph, + * ie. there is *some* way to embed it in the plane + * - no processed edge has zero length + * - no two processed vertices have identical coordinates + * - each "inside" region is monotone, ie. can be broken into two chains + * of monotonically increasing vertices according to VertLeq(v1,v2) + * - a non-invariant: these chains may intersect (very slightly) + * + * Invariants for the Sweep. + * - if none of the edges incident to the event vertex have an activeRegion + * (ie. none of these edges are in the edge dictionary), then the vertex + * has only right-going edges. + * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced + * by ConnectRightVertex), then it is the only right-going edge from + * its associated vertex. (This says that these edges exist only + * when it is necessary.) + */ + +#undef MAX +#undef MIN +#define MAX(x,y) ((x) >= (y) ? (x) : (y)) +#define MIN(x,y) ((x) <= (y) ? (x) : (y)) + +/* When we merge two edges into one, we need to compute the combined + * winding of the new edge. + */ +#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \ + eDst->Sym->winding += eSrc->Sym->winding) + +static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent ); +static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ); +static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp ); + +static int EdgeLeq( GLUtesselator *tess, ActiveRegion *reg1, + ActiveRegion *reg2 ) +/* + * Both edges must be directed from right to left (this is the canonical + * direction for the upper edge of each region). + * + * The strategy is to evaluate a "t" value for each edge at the + * current sweep line position, given by tess->event. The calculations + * are designed to be very stable, but of course they are not perfect. + * + * Special case: if both edge destinations are at the sweep event, + * we sort the edges by slope (they would otherwise compare equally). + */ +{ + GLUvertex *event = tess->event; + GLUhalfEdge *e1, *e2; + GLdouble t1, t2; + + e1 = reg1->eUp; + e2 = reg2->eUp; + + if( e1->Dst == event ) { + if( e2->Dst == event ) { + /* Two edges right of the sweep line which meet at the sweep event. + * Sort them by slope. + */ + if( VertLeq( e1->Org, e2->Org )) { + return EdgeSign( e2->Dst, e1->Org, e2->Org ) <= 0; + } + return EdgeSign( e1->Dst, e2->Org, e1->Org ) >= 0; + } + return EdgeSign( e2->Dst, event, e2->Org ) <= 0; + } + if( e2->Dst == event ) { + return EdgeSign( e1->Dst, event, e1->Org ) >= 0; + } + + /* General case - compute signed distance *from* e1, e2 to event */ + t1 = EdgeEval( e1->Dst, event, e1->Org ); + t2 = EdgeEval( e2->Dst, event, e2->Org ); + return (t1 >= t2); +} + + +static void DeleteRegion( GLUtesselator *tess, ActiveRegion *reg ) +{ + if( reg->fixUpperEdge ) { + /* It was created with zero winding number, so it better be + * deleted with zero winding number (ie. it better not get merged + * with a real edge). + */ + assert( reg->eUp->winding == 0 ); + } + reg->eUp->activeRegion = NULL; + dictDelete( tess->dict, reg->nodeUp ); /* __gl_dictListDelete */ + memFree( reg ); +} + + +static int FixUpperEdge( ActiveRegion *reg, GLUhalfEdge *newEdge ) +/* + * Replace an upper edge which needs fixing (see ConnectRightVertex). + */ +{ + assert( reg->fixUpperEdge ); + if ( !__gl_meshDelete( reg->eUp ) ) return 0; + reg->fixUpperEdge = FALSE; + reg->eUp = newEdge; + newEdge->activeRegion = reg; + + return 1; +} + +static ActiveRegion *TopLeftRegion( ActiveRegion *reg ) +{ + GLUvertex *org = reg->eUp->Org; + GLUhalfEdge *e; + + /* Find the region above the uppermost edge with the same origin */ + do { + reg = RegionAbove( reg ); + } while( reg->eUp->Org == org ); + + /* If the edge above was a temporary edge introduced by ConnectRightVertex, + * now is the time to fix it. + */ + if( reg->fixUpperEdge ) { + e = __gl_meshConnect( RegionBelow(reg)->eUp->Sym, reg->eUp->Lnext ); + if (e == NULL) return NULL; + if ( !FixUpperEdge( reg, e ) ) return NULL; + reg = RegionAbove( reg ); + } + return reg; +} + +static ActiveRegion *TopRightRegion( ActiveRegion *reg ) +{ + GLUvertex *dst = reg->eUp->Dst; + + /* Find the region above the uppermost edge with the same destination */ + do { + reg = RegionAbove( reg ); + } while( reg->eUp->Dst == dst ); + return reg; +} + +static ActiveRegion *AddRegionBelow( GLUtesselator *tess, + ActiveRegion *regAbove, + GLUhalfEdge *eNewUp ) +/* + * Add a new active region to the sweep line, *somewhere* below "regAbove" + * (according to where the new edge belongs in the sweep-line dictionary). + * The upper edge of the new region will be "eNewUp". + * Winding number and "inside" flag are not updated. + */ +{ + ActiveRegion *regNew = (ActiveRegion *)memAlloc( sizeof( ActiveRegion )); + if (regNew == NULL) longjmp(tess->env,1); + + regNew->eUp = eNewUp; + /* __gl_dictListInsertBefore */ + regNew->nodeUp = dictInsertBefore( tess->dict, regAbove->nodeUp, regNew ); + if (regNew->nodeUp == NULL) longjmp(tess->env,1); + regNew->fixUpperEdge = FALSE; + regNew->sentinel = FALSE; + regNew->dirty = FALSE; + + eNewUp->activeRegion = regNew; + return regNew; +} + +static GLboolean IsWindingInside( GLUtesselator *tess, int n ) +{ + switch( tess->windingRule ) { + case GLU_TESS_WINDING_ODD: + return (n & 1); + case GLU_TESS_WINDING_NONZERO: + return (n != 0); + case GLU_TESS_WINDING_POSITIVE: + return (n > 0); + case GLU_TESS_WINDING_NEGATIVE: + return (n < 0); + case GLU_TESS_WINDING_ABS_GEQ_TWO: + return (n >= 2) || (n <= -2); + } + /*LINTED*/ + assert( FALSE ); + /*NOTREACHED*/ + return GL_FALSE; /* avoid compiler complaints */ +} + + +static void ComputeWinding( GLUtesselator *tess, ActiveRegion *reg ) +{ + reg->windingNumber = RegionAbove(reg)->windingNumber + reg->eUp->winding; + reg->inside = IsWindingInside( tess, reg->windingNumber ); +} + + +static void FinishRegion( GLUtesselator *tess, ActiveRegion *reg ) +/* + * Delete a region from the sweep line. This happens when the upper + * and lower chains of a region meet (at a vertex on the sweep line). + * The "inside" flag is copied to the appropriate mesh face (we could + * not do this before -- since the structure of the mesh is always + * changing, this face may not have even existed until now). + */ +{ + GLUhalfEdge *e = reg->eUp; + GLUface *f = e->Lface; + + f->inside = reg->inside; + f->anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */ + DeleteRegion( tess, reg ); +} + + +static GLUhalfEdge *FinishLeftRegions( GLUtesselator *tess, + ActiveRegion *regFirst, ActiveRegion *regLast ) +/* + * We are given a vertex with one or more left-going edges. All affected + * edges should be in the edge dictionary. Starting at regFirst->eUp, + * we walk down deleting all regions where both edges have the same + * origin vOrg. At the same time we copy the "inside" flag from the + * active region to the face, since at this point each face will belong + * to at most one region (this was not necessarily true until this point + * in the sweep). The walk stops at the region above regLast; if regLast + * is NULL we walk as far as possible. At the same time we relink the + * mesh if necessary, so that the ordering of edges around vOrg is the + * same as in the dictionary. + */ +{ + ActiveRegion *reg, *regPrev; + GLUhalfEdge *e, *ePrev; + + regPrev = regFirst; + ePrev = regFirst->eUp; + while( regPrev != regLast ) { + regPrev->fixUpperEdge = FALSE; /* placement was OK */ + reg = RegionBelow( regPrev ); + e = reg->eUp; + if( e->Org != ePrev->Org ) { + if( ! reg->fixUpperEdge ) { + /* Remove the last left-going edge. Even though there are no further + * edges in the dictionary with this origin, there may be further + * such edges in the mesh (if we are adding left edges to a vertex + * that has already been processed). Thus it is important to call + * FinishRegion rather than just DeleteRegion. + */ + FinishRegion( tess, regPrev ); + break; + } + /* If the edge below was a temporary edge introduced by + * ConnectRightVertex, now is the time to fix it. + */ + e = __gl_meshConnect( ePrev->Lprev, e->Sym ); + if (e == NULL) longjmp(tess->env,1); + if ( !FixUpperEdge( reg, e ) ) longjmp(tess->env,1); + } + + /* Relink edges so that ePrev->Onext == e */ + if( ePrev->Onext != e ) { + if ( !__gl_meshSplice( e->Oprev, e ) ) longjmp(tess->env,1); + if ( !__gl_meshSplice( ePrev, e ) ) longjmp(tess->env,1); + } + FinishRegion( tess, regPrev ); /* may change reg->eUp */ + ePrev = reg->eUp; + regPrev = reg; + } + return ePrev; +} + + +static void AddRightEdges( GLUtesselator *tess, ActiveRegion *regUp, + GLUhalfEdge *eFirst, GLUhalfEdge *eLast, GLUhalfEdge *eTopLeft, + GLboolean cleanUp ) +/* + * Purpose: insert right-going edges into the edge dictionary, and update + * winding numbers and mesh connectivity appropriately. All right-going + * edges share a common origin vOrg. Edges are inserted CCW starting at + * eFirst; the last edge inserted is eLast->Oprev. If vOrg has any + * left-going edges already processed, then eTopLeft must be the edge + * such that an imaginary upward vertical segment from vOrg would be + * contained between eTopLeft->Oprev and eTopLeft; otherwise eTopLeft + * should be NULL. + */ +{ + ActiveRegion *reg, *regPrev; + GLUhalfEdge *e, *ePrev; + int firstTime = TRUE; + + /* Insert the new right-going edges in the dictionary */ + e = eFirst; + do { + assert( VertLeq( e->Org, e->Dst )); + AddRegionBelow( tess, regUp, e->Sym ); + e = e->Onext; + } while ( e != eLast ); + + /* Walk *all* right-going edges from e->Org, in the dictionary order, + * updating the winding numbers of each region, and re-linking the mesh + * edges to match the dictionary ordering (if necessary). + */ + if( eTopLeft == NULL ) { + eTopLeft = RegionBelow( regUp )->eUp->Rprev; + } + regPrev = regUp; + ePrev = eTopLeft; + for( ;; ) { + reg = RegionBelow( regPrev ); + e = reg->eUp->Sym; + if( e->Org != ePrev->Org ) break; + + if( e->Onext != ePrev ) { + /* Unlink e from its current position, and relink below ePrev */ + if ( !__gl_meshSplice( e->Oprev, e ) ) longjmp(tess->env,1); + if ( !__gl_meshSplice( ePrev->Oprev, e ) ) longjmp(tess->env,1); + } + /* Compute the winding number and "inside" flag for the new regions */ + reg->windingNumber = regPrev->windingNumber - e->winding; + reg->inside = IsWindingInside( tess, reg->windingNumber ); + + /* Check for two outgoing edges with same slope -- process these + * before any intersection tests (see example in __gl_computeInterior). + */ + regPrev->dirty = TRUE; + if( ! firstTime && CheckForRightSplice( tess, regPrev )) { + AddWinding( e, ePrev ); + DeleteRegion( tess, regPrev ); + if ( !__gl_meshDelete( ePrev ) ) longjmp(tess->env,1); + } + firstTime = FALSE; + regPrev = reg; + ePrev = e; + } + regPrev->dirty = TRUE; + assert( regPrev->windingNumber - e->winding == reg->windingNumber ); + + if( cleanUp ) { + /* Check for intersections between newly adjacent edges. */ + WalkDirtyRegions( tess, regPrev ); + } +} + + +static void CallCombine( GLUtesselator *tess, GLUvertex *isect, + void *data[4], GLfloat weights[4], int needed ) +{ + GLdouble coords[3]; + + /* Copy coord data in case the callback changes it. */ + coords[0] = isect->coords[0]; + coords[1] = isect->coords[1]; + coords[2] = isect->coords[2]; + + isect->data = NULL; + CALL_COMBINE_OR_COMBINE_DATA( coords, data, weights, &isect->data ); + if( isect->data == NULL ) { + if( ! needed ) { + isect->data = data[0]; + } else if( ! tess->fatalError ) { + /* The only way fatal error is when two edges are found to intersect, + * but the user has not provided the callback necessary to handle + * generated intersection points. + */ + CALL_ERROR_OR_ERROR_DATA( GLU_TESS_NEED_COMBINE_CALLBACK ); + tess->fatalError = TRUE; + } + } +} + +static void SpliceMergeVertices( GLUtesselator *tess, GLUhalfEdge *e1, + GLUhalfEdge *e2 ) +/* + * Two vertices with idential coordinates are combined into one. + * e1->Org is kept, while e2->Org is discarded. + */ +{ + void *data[4] = { NULL, NULL, NULL, NULL }; + GLfloat weights[4] = { 0.5, 0.5, 0.0, 0.0 }; + + data[0] = e1->Org->data; + data[1] = e2->Org->data; + CallCombine( tess, e1->Org, data, weights, FALSE ); + if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1); +} + +static void VertexWeights( GLUvertex *isect, GLUvertex *org, GLUvertex *dst, + GLfloat *weights ) +/* + * Find some weights which describe how the intersection vertex is + * a linear combination of "org" and "dest". Each of the two edges + * which generated "isect" is allocated 50% of the weight; each edge + * splits the weight between its org and dst according to the + * relative distance to "isect". + */ +{ + GLdouble t1 = VertL1dist( org, isect ); + GLdouble t2 = VertL1dist( dst, isect ); + + weights[0] = 0.5 * t2 / (t1 + t2); + weights[1] = 0.5 * t1 / (t1 + t2); + isect->coords[0] += weights[0]*org->coords[0] + weights[1]*dst->coords[0]; + isect->coords[1] += weights[0]*org->coords[1] + weights[1]*dst->coords[1]; + isect->coords[2] += weights[0]*org->coords[2] + weights[1]*dst->coords[2]; +} + + +static void GetIntersectData( GLUtesselator *tess, GLUvertex *isect, + GLUvertex *orgUp, GLUvertex *dstUp, + GLUvertex *orgLo, GLUvertex *dstLo ) +/* + * We've computed a new intersection point, now we need a "data" pointer + * from the user so that we can refer to this new vertex in the + * rendering callbacks. + */ +{ + void *data[4]; + GLfloat weights[4]; + + data[0] = orgUp->data; + data[1] = dstUp->data; + data[2] = orgLo->data; + data[3] = dstLo->data; + + isect->coords[0] = isect->coords[1] = isect->coords[2] = 0; + VertexWeights( isect, orgUp, dstUp, &weights[0] ); + VertexWeights( isect, orgLo, dstLo, &weights[2] ); + + CallCombine( tess, isect, data, weights, TRUE ); +} + +static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp ) +/* + * Check the upper and lower edge of "regUp", to make sure that the + * eUp->Org is above eLo, or eLo->Org is below eUp (depending on which + * origin is leftmost). + * + * The main purpose is to splice right-going edges with the same + * dest vertex and nearly identical slopes (ie. we can't distinguish + * the slopes numerically). However the splicing can also help us + * to recover from numerical errors. For example, suppose at one + * point we checked eUp and eLo, and decided that eUp->Org is barely + * above eLo. Then later, we split eLo into two edges (eg. from + * a splice operation like this one). This can change the result of + * our test so that now eUp->Org is incident to eLo, or barely below it. + * We must correct this condition to maintain the dictionary invariants. + * + * One possibility is to check these edges for intersection again + * (ie. CheckForIntersect). This is what we do if possible. However + * CheckForIntersect requires that tess->event lies between eUp and eLo, + * so that it has something to fall back on when the intersection + * calculation gives us an unusable answer. So, for those cases where + * we can't check for intersection, this routine fixes the problem + * by just splicing the offending vertex into the other edge. + * This is a guaranteed solution, no matter how degenerate things get. + * Basically this is a combinatorial solution to a numerical problem. + */ +{ + ActiveRegion *regLo = RegionBelow(regUp); + GLUhalfEdge *eUp = regUp->eUp; + GLUhalfEdge *eLo = regLo->eUp; + + if( VertLeq( eUp->Org, eLo->Org )) { + if( EdgeSign( eLo->Dst, eUp->Org, eLo->Org ) > 0 ) return FALSE; + + /* eUp->Org appears to be below eLo */ + if( ! VertEq( eUp->Org, eLo->Org )) { + /* Splice eUp->Org into eLo */ + if ( __gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eUp, eLo->Oprev ) ) longjmp(tess->env,1); + regUp->dirty = regLo->dirty = TRUE; + + } else if( eUp->Org != eLo->Org ) { + /* merge the two vertices, discarding eUp->Org */ + pqDelete( tess->pq, eUp->Org->pqHandle ); /* __gl_pqSortDelete */ + SpliceMergeVertices( tess, eLo->Oprev, eUp ); + } + } else { + if( EdgeSign( eUp->Dst, eLo->Org, eUp->Org ) < 0 ) return FALSE; + + /* eLo->Org appears to be above eUp, so splice eLo->Org into eUp */ + RegionAbove(regUp)->dirty = regUp->dirty = TRUE; + if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1); + } + return TRUE; +} + +static int CheckForLeftSplice( GLUtesselator *tess, ActiveRegion *regUp ) +/* + * Check the upper and lower edge of "regUp", to make sure that the + * eUp->Dst is above eLo, or eLo->Dst is below eUp (depending on which + * destination is rightmost). + * + * Theoretically, this should always be true. However, splitting an edge + * into two pieces can change the results of previous tests. For example, + * suppose at one point we checked eUp and eLo, and decided that eUp->Dst + * is barely above eLo. Then later, we split eLo into two edges (eg. from + * a splice operation like this one). This can change the result of + * the test so that now eUp->Dst is incident to eLo, or barely below it. + * We must correct this condition to maintain the dictionary invariants + * (otherwise new edges might get inserted in the wrong place in the + * dictionary, and bad stuff will happen). + * + * We fix the problem by just splicing the offending vertex into the + * other edge. + */ +{ + ActiveRegion *regLo = RegionBelow(regUp); + GLUhalfEdge *eUp = regUp->eUp; + GLUhalfEdge *eLo = regLo->eUp; + GLUhalfEdge *e; + + assert( ! VertEq( eUp->Dst, eLo->Dst )); + + if( VertLeq( eUp->Dst, eLo->Dst )) { + if( EdgeSign( eUp->Dst, eLo->Dst, eUp->Org ) < 0 ) return FALSE; + + /* eLo->Dst is above eUp, so splice eLo->Dst into eUp */ + RegionAbove(regUp)->dirty = regUp->dirty = TRUE; + e = __gl_meshSplitEdge( eUp ); + if (e == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eLo->Sym, e ) ) longjmp(tess->env,1); + e->Lface->inside = regUp->inside; + } else { + if( EdgeSign( eLo->Dst, eUp->Dst, eLo->Org ) > 0 ) return FALSE; + + /* eUp->Dst is below eLo, so splice eUp->Dst into eLo */ + regUp->dirty = regLo->dirty = TRUE; + e = __gl_meshSplitEdge( eLo ); + if (e == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eUp->Lnext, eLo->Sym ) ) longjmp(tess->env,1); + e->Rface->inside = regUp->inside; + } + return TRUE; +} + + +static int CheckForIntersect( GLUtesselator *tess, ActiveRegion *regUp ) +/* + * Check the upper and lower edges of the given region to see if + * they intersect. If so, create the intersection and add it + * to the data structures. + * + * Returns TRUE if adding the new intersection resulted in a recursive + * call to AddRightEdges(); in this case all "dirty" regions have been + * checked for intersections, and possibly regUp has been deleted. + */ +{ + ActiveRegion *regLo = RegionBelow(regUp); + GLUhalfEdge *eUp = regUp->eUp; + GLUhalfEdge *eLo = regLo->eUp; + GLUvertex *orgUp = eUp->Org; + GLUvertex *orgLo = eLo->Org; + GLUvertex *dstUp = eUp->Dst; + GLUvertex *dstLo = eLo->Dst; + GLdouble tMinUp, tMaxLo; + GLUvertex isect, *orgMin; + GLUhalfEdge *e; + + assert( ! VertEq( dstLo, dstUp )); + assert( EdgeSign( dstUp, tess->event, orgUp ) <= 0 ); + assert( EdgeSign( dstLo, tess->event, orgLo ) >= 0 ); + assert( orgUp != tess->event && orgLo != tess->event ); + assert( ! regUp->fixUpperEdge && ! regLo->fixUpperEdge ); + + if( orgUp == orgLo ) return FALSE; /* right endpoints are the same */ + + tMinUp = MIN( orgUp->t, dstUp->t ); + tMaxLo = MAX( orgLo->t, dstLo->t ); + if( tMinUp > tMaxLo ) return FALSE; /* t ranges do not overlap */ + + if( VertLeq( orgUp, orgLo )) { + if( EdgeSign( dstLo, orgUp, orgLo ) > 0 ) return FALSE; + } else { + if( EdgeSign( dstUp, orgLo, orgUp ) < 0 ) return FALSE; + } + + /* At this point the edges intersect, at least marginally */ + DebugEvent( tess ); + + __gl_edgeIntersect( dstUp, orgUp, dstLo, orgLo, &isect ); + /* The following properties are guaranteed: */ + assert( MIN( orgUp->t, dstUp->t ) <= isect.t ); + assert( isect.t <= MAX( orgLo->t, dstLo->t )); + assert( MIN( dstLo->s, dstUp->s ) <= isect.s ); + assert( isect.s <= MAX( orgLo->s, orgUp->s )); + + if( VertLeq( &isect, tess->event )) { + /* The intersection point lies slightly to the left of the sweep line, + * so move it until it''s slightly to the right of the sweep line. + * (If we had perfect numerical precision, this would never happen + * in the first place). The easiest and safest thing to do is + * replace the intersection by tess->event. + */ + isect.s = tess->event->s; + isect.t = tess->event->t; + } + /* Similarly, if the computed intersection lies to the right of the + * rightmost origin (which should rarely happen), it can cause + * unbelievable inefficiency on sufficiently degenerate inputs. + * (If you have the test program, try running test54.d with the + * "X zoom" option turned on). + */ + orgMin = VertLeq( orgUp, orgLo ) ? orgUp : orgLo; + if( VertLeq( orgMin, &isect )) { + isect.s = orgMin->s; + isect.t = orgMin->t; + } + + if( VertEq( &isect, orgUp ) || VertEq( &isect, orgLo )) { + /* Easy case -- intersection at one of the right endpoints */ + (void) CheckForRightSplice( tess, regUp ); + return FALSE; + } + + if( (! VertEq( dstUp, tess->event ) + && EdgeSign( dstUp, tess->event, &isect ) >= 0) + || (! VertEq( dstLo, tess->event ) + && EdgeSign( dstLo, tess->event, &isect ) <= 0 )) + { + /* Very unusual -- the new upper or lower edge would pass on the + * wrong side of the sweep event, or through it. This can happen + * due to very small numerical errors in the intersection calculation. + */ + if( dstLo == tess->event ) { + /* Splice dstLo into eUp, and process the new region(s) */ + if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eLo->Sym, eUp ) ) longjmp(tess->env,1); + regUp = TopLeftRegion( regUp ); + if (regUp == NULL) longjmp(tess->env,1); + eUp = RegionBelow(regUp)->eUp; + FinishLeftRegions( tess, RegionBelow(regUp), regLo ); + AddRightEdges( tess, regUp, eUp->Oprev, eUp, eUp, TRUE ); + return TRUE; + } + if( dstUp == tess->event ) { + /* Splice dstUp into eLo, and process the new region(s) */ + if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eUp->Lnext, eLo->Oprev ) ) longjmp(tess->env,1); + regLo = regUp; + regUp = TopRightRegion( regUp ); + e = RegionBelow(regUp)->eUp->Rprev; + regLo->eUp = eLo->Oprev; + eLo = FinishLeftRegions( tess, regLo, NULL ); + AddRightEdges( tess, regUp, eLo->Onext, eUp->Rprev, e, TRUE ); + return TRUE; + } + /* Special case: called from ConnectRightVertex. If either + * edge passes on the wrong side of tess->event, split it + * (and wait for ConnectRightVertex to splice it appropriately). + */ + if( EdgeSign( dstUp, tess->event, &isect ) >= 0 ) { + RegionAbove(regUp)->dirty = regUp->dirty = TRUE; + if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); + eUp->Org->s = tess->event->s; + eUp->Org->t = tess->event->t; + } + if( EdgeSign( dstLo, tess->event, &isect ) <= 0 ) { + regUp->dirty = regLo->dirty = TRUE; + if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); + eLo->Org->s = tess->event->s; + eLo->Org->t = tess->event->t; + } + /* leave the rest for ConnectRightVertex */ + return FALSE; + } + + /* General case -- split both edges, splice into new vertex. + * When we do the splice operation, the order of the arguments is + * arbitrary as far as correctness goes. However, when the operation + * creates a new face, the work done is proportional to the size of + * the new face. We expect the faces in the processed part of + * the mesh (ie. eUp->Lface) to be smaller than the faces in the + * unprocessed original contours (which will be eLo->Oprev->Lface). + */ + if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); + if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); + if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1); + eUp->Org->s = isect.s; + eUp->Org->t = isect.t; + eUp->Org->pqHandle = pqInsert( tess->pq, eUp->Org ); /* __gl_pqSortInsert */ + if (eUp->Org->pqHandle == LONG_MAX) { + pqDeletePriorityQ(tess->pq); /* __gl_pqSortDeletePriorityQ */ + tess->pq = NULL; + longjmp(tess->env,1); + } + GetIntersectData( tess, eUp->Org, orgUp, dstUp, orgLo, dstLo ); + RegionAbove(regUp)->dirty = regUp->dirty = regLo->dirty = TRUE; + return FALSE; +} + +static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ) +/* + * When the upper or lower edge of any region changes, the region is + * marked "dirty". This routine walks through all the dirty regions + * and makes sure that the dictionary invariants are satisfied + * (see the comments at the beginning of this file). Of course + * new dirty regions can be created as we make changes to restore + * the invariants. + */ +{ + ActiveRegion *regLo = RegionBelow(regUp); + GLUhalfEdge *eUp, *eLo; + + for( ;; ) { + /* Find the lowest dirty region (we walk from the bottom up). */ + while( regLo->dirty ) { + regUp = regLo; + regLo = RegionBelow(regLo); + } + if( ! regUp->dirty ) { + regLo = regUp; + regUp = RegionAbove( regUp ); + if( regUp == NULL || ! regUp->dirty ) { + /* We've walked all the dirty regions */ + return; + } + } + regUp->dirty = FALSE; + eUp = regUp->eUp; + eLo = regLo->eUp; + + if( eUp->Dst != eLo->Dst ) { + /* Check that the edge ordering is obeyed at the Dst vertices. */ + if( CheckForLeftSplice( tess, regUp )) { + + /* If the upper or lower edge was marked fixUpperEdge, then + * we no longer need it (since these edges are needed only for + * vertices which otherwise have no right-going edges). + */ + if( regLo->fixUpperEdge ) { + DeleteRegion( tess, regLo ); + if ( !__gl_meshDelete( eLo ) ) longjmp(tess->env,1); + regLo = RegionBelow( regUp ); + eLo = regLo->eUp; + } else if( regUp->fixUpperEdge ) { + DeleteRegion( tess, regUp ); + if ( !__gl_meshDelete( eUp ) ) longjmp(tess->env,1); + regUp = RegionAbove( regLo ); + eUp = regUp->eUp; + } + } + } + if( eUp->Org != eLo->Org ) { + if( eUp->Dst != eLo->Dst + && ! regUp->fixUpperEdge && ! regLo->fixUpperEdge + && (eUp->Dst == tess->event || eLo->Dst == tess->event) ) + { + /* When all else fails in CheckForIntersect(), it uses tess->event + * as the intersection location. To make this possible, it requires + * that tess->event lie between the upper and lower edges, and also + * that neither of these is marked fixUpperEdge (since in the worst + * case it might splice one of these edges into tess->event, and + * violate the invariant that fixable edges are the only right-going + * edge from their associated vertex). + */ + if( CheckForIntersect( tess, regUp )) { + /* WalkDirtyRegions() was called recursively; we're done */ + return; + } + } else { + /* Even though we can't use CheckForIntersect(), the Org vertices + * may violate the dictionary edge ordering. Check and correct this. + */ + (void) CheckForRightSplice( tess, regUp ); + } + } + if( eUp->Org == eLo->Org && eUp->Dst == eLo->Dst ) { + /* A degenerate loop consisting of only two edges -- delete it. */ + AddWinding( eLo, eUp ); + DeleteRegion( tess, regUp ); + if ( !__gl_meshDelete( eUp ) ) longjmp(tess->env,1); + regUp = RegionAbove( regLo ); + } + } +} + + +static void ConnectRightVertex( GLUtesselator *tess, ActiveRegion *regUp, + GLUhalfEdge *eBottomLeft ) +/* + * Purpose: connect a "right" vertex vEvent (one where all edges go left) + * to the unprocessed portion of the mesh. Since there are no right-going + * edges, two regions (one above vEvent and one below) are being merged + * into one. "regUp" is the upper of these two regions. + * + * There are two reasons for doing this (adding a right-going edge): + * - if the two regions being merged are "inside", we must add an edge + * to keep them separated (the combined region would not be monotone). + * - in any case, we must leave some record of vEvent in the dictionary, + * so that we can merge vEvent with features that we have not seen yet. + * For example, maybe there is a vertical edge which passes just to + * the right of vEvent; we would like to splice vEvent into this edge. + * + * However, we don't want to connect vEvent to just any vertex. We don''t + * want the new edge to cross any other edges; otherwise we will create + * intersection vertices even when the input data had no self-intersections. + * (This is a bad thing; if the user's input data has no intersections, + * we don't want to generate any false intersections ourselves.) + * + * Our eventual goal is to connect vEvent to the leftmost unprocessed + * vertex of the combined region (the union of regUp and regLo). + * But because of unseen vertices with all right-going edges, and also + * new vertices which may be created by edge intersections, we don''t + * know where that leftmost unprocessed vertex is. In the meantime, we + * connect vEvent to the closest vertex of either chain, and mark the region + * as "fixUpperEdge". This flag says to delete and reconnect this edge + * to the next processed vertex on the boundary of the combined region. + * Quite possibly the vertex we connected to will turn out to be the + * closest one, in which case we won''t need to make any changes. + */ +{ + GLUhalfEdge *eNew; + GLUhalfEdge *eTopLeft = eBottomLeft->Onext; + ActiveRegion *regLo = RegionBelow(regUp); + GLUhalfEdge *eUp = regUp->eUp; + GLUhalfEdge *eLo = regLo->eUp; + int degenerate = FALSE; + + if( eUp->Dst != eLo->Dst ) { + (void) CheckForIntersect( tess, regUp ); + } + + /* Possible new degeneracies: upper or lower edge of regUp may pass + * through vEvent, or may coincide with new intersection vertex + */ + if( VertEq( eUp->Org, tess->event )) { + if ( !__gl_meshSplice( eTopLeft->Oprev, eUp ) ) longjmp(tess->env,1); + regUp = TopLeftRegion( regUp ); + if (regUp == NULL) longjmp(tess->env,1); + eTopLeft = RegionBelow( regUp )->eUp; + FinishLeftRegions( tess, RegionBelow(regUp), regLo ); + degenerate = TRUE; + } + if( VertEq( eLo->Org, tess->event )) { + if ( !__gl_meshSplice( eBottomLeft, eLo->Oprev ) ) longjmp(tess->env,1); + eBottomLeft = FinishLeftRegions( tess, regLo, NULL ); + degenerate = TRUE; + } + if( degenerate ) { + AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE ); + return; + } + + /* Non-degenerate situation -- need to add a temporary, fixable edge. + * Connect to the closer of eLo->Org, eUp->Org. + */ + if( VertLeq( eLo->Org, eUp->Org )) { + eNew = eLo->Oprev; + } else { + eNew = eUp; + } + eNew = __gl_meshConnect( eBottomLeft->Lprev, eNew ); + if (eNew == NULL) longjmp(tess->env,1); + + /* Prevent cleanup, otherwise eNew might disappear before we've even + * had a chance to mark it as a temporary edge. + */ + AddRightEdges( tess, regUp, eNew, eNew->Onext, eNew->Onext, FALSE ); + eNew->Sym->activeRegion->fixUpperEdge = TRUE; + WalkDirtyRegions( tess, regUp ); +} + +/* Because vertices at exactly the same location are merged together + * before we process the sweep event, some degenerate cases can't occur. + * However if someone eventually makes the modifications required to + * merge features which are close together, the cases below marked + * TOLERANCE_NONZERO will be useful. They were debugged before the + * code to merge identical vertices in the main loop was added. + */ +#define TOLERANCE_NONZERO FALSE + +static void ConnectLeftDegenerate( GLUtesselator *tess, + ActiveRegion *regUp, GLUvertex *vEvent ) +/* + * The event vertex lies exacty on an already-processed edge or vertex. + * Adding the new vertex involves splicing it into the already-processed + * part of the mesh. + */ +{ + GLUhalfEdge *e, *eTopLeft, *eTopRight, *eLast; + ActiveRegion *reg; + + e = regUp->eUp; + if( VertEq( e->Org, vEvent )) { + /* e->Org is an unprocessed vertex - just combine them, and wait + * for e->Org to be pulled from the queue + */ + assert( TOLERANCE_NONZERO ); + SpliceMergeVertices( tess, e, vEvent->anEdge ); + return; + } + + if( ! VertEq( e->Dst, vEvent )) { + /* General case -- splice vEvent into edge e which passes through it */ + if (__gl_meshSplitEdge( e->Sym ) == NULL) longjmp(tess->env,1); + if( regUp->fixUpperEdge ) { + /* This edge was fixable -- delete unused portion of original edge */ + if ( !__gl_meshDelete( e->Onext ) ) longjmp(tess->env,1); + regUp->fixUpperEdge = FALSE; + } + if ( !__gl_meshSplice( vEvent->anEdge, e ) ) longjmp(tess->env,1); + SweepEvent( tess, vEvent ); /* recurse */ + return; + } + + /* vEvent coincides with e->Dst, which has already been processed. + * Splice in the additional right-going edges. + */ + assert( TOLERANCE_NONZERO ); + regUp = TopRightRegion( regUp ); + reg = RegionBelow( regUp ); + eTopRight = reg->eUp->Sym; + eTopLeft = eLast = eTopRight->Onext; + if( reg->fixUpperEdge ) { + /* Here e->Dst has only a single fixable edge going right. + * We can delete it since now we have some real right-going edges. + */ + assert( eTopLeft != eTopRight ); /* there are some left edges too */ + DeleteRegion( tess, reg ); + if ( !__gl_meshDelete( eTopRight ) ) longjmp(tess->env,1); + eTopRight = eTopLeft->Oprev; + } + if ( !__gl_meshSplice( vEvent->anEdge, eTopRight ) ) longjmp(tess->env,1); + if( ! EdgeGoesLeft( eTopLeft )) { + /* e->Dst had no left-going edges -- indicate this to AddRightEdges() */ + eTopLeft = NULL; + } + AddRightEdges( tess, regUp, eTopRight->Onext, eLast, eTopLeft, TRUE ); +} + + +static void ConnectLeftVertex( GLUtesselator *tess, GLUvertex *vEvent ) +/* + * Purpose: connect a "left" vertex (one where both edges go right) + * to the processed portion of the mesh. Let R be the active region + * containing vEvent, and let U and L be the upper and lower edge + * chains of R. There are two possibilities: + * + * - the normal case: split R into two regions, by connecting vEvent to + * the rightmost vertex of U or L lying to the left of the sweep line + * + * - the degenerate case: if vEvent is close enough to U or L, we + * merge vEvent into that edge chain. The subcases are: + * - merging with the rightmost vertex of U or L + * - merging with the active edge of U or L + * - merging with an already-processed portion of U or L + */ +{ + ActiveRegion *regUp, *regLo, *reg; + GLUhalfEdge *eUp, *eLo, *eNew; + ActiveRegion tmp; + + /* assert( vEvent->anEdge->Onext->Onext == vEvent->anEdge ); */ + + /* Get a pointer to the active region containing vEvent */ + tmp.eUp = vEvent->anEdge->Sym; + /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */ + regUp = (ActiveRegion *)dictKey( dictSearch( tess->dict, &tmp )); + regLo = RegionBelow( regUp ); + eUp = regUp->eUp; + eLo = regLo->eUp; + + /* Try merging with U or L first */ + if( EdgeSign( eUp->Dst, vEvent, eUp->Org ) == 0 ) { + ConnectLeftDegenerate( tess, regUp, vEvent ); + return; + } + + /* Connect vEvent to rightmost processed vertex of either chain. + * e->Dst is the vertex that we will connect to vEvent. + */ + reg = VertLeq( eLo->Dst, eUp->Dst ) ? regUp : regLo; + + if( regUp->inside || reg->fixUpperEdge) { + if( reg == regUp ) { + eNew = __gl_meshConnect( vEvent->anEdge->Sym, eUp->Lnext ); + if (eNew == NULL) longjmp(tess->env,1); + } else { + GLUhalfEdge *tempHalfEdge= __gl_meshConnect( eLo->Dnext, vEvent->anEdge); + if (tempHalfEdge == NULL) longjmp(tess->env,1); + + eNew = tempHalfEdge->Sym; + } + if( reg->fixUpperEdge ) { + if ( !FixUpperEdge( reg, eNew ) ) longjmp(tess->env,1); + } else { + ComputeWinding( tess, AddRegionBelow( tess, regUp, eNew )); + } + SweepEvent( tess, vEvent ); + } else { + /* The new vertex is in a region which does not belong to the polygon. + * We don''t need to connect this vertex to the rest of the mesh. + */ + AddRightEdges( tess, regUp, vEvent->anEdge, vEvent->anEdge, NULL, TRUE ); + } +} + + +static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent ) +/* + * Does everything necessary when the sweep line crosses a vertex. + * Updates the mesh and the edge dictionary. + */ +{ + ActiveRegion *regUp, *reg; + GLUhalfEdge *e, *eTopLeft, *eBottomLeft; + + tess->event = vEvent; /* for access in EdgeLeq() */ + DebugEvent( tess ); + + /* Check if this vertex is the right endpoint of an edge that is + * already in the dictionary. In this case we don't need to waste + * time searching for the location to insert new edges. + */ + e = vEvent->anEdge; + while( e->activeRegion == NULL ) { + e = e->Onext; + if( e == vEvent->anEdge ) { + /* All edges go right -- not incident to any processed edges */ + ConnectLeftVertex( tess, vEvent ); + return; + } + } + + /* Processing consists of two phases: first we "finish" all the + * active regions where both the upper and lower edges terminate + * at vEvent (ie. vEvent is closing off these regions). + * We mark these faces "inside" or "outside" the polygon according + * to their winding number, and delete the edges from the dictionary. + * This takes care of all the left-going edges from vEvent. + */ + regUp = TopLeftRegion( e->activeRegion ); + if (regUp == NULL) longjmp(tess->env,1); + reg = RegionBelow( regUp ); + eTopLeft = reg->eUp; + eBottomLeft = FinishLeftRegions( tess, reg, NULL ); + + /* Next we process all the right-going edges from vEvent. This + * involves adding the edges to the dictionary, and creating the + * associated "active regions" which record information about the + * regions between adjacent dictionary edges. + */ + if( eBottomLeft->Onext == eTopLeft ) { + /* No right-going edges -- add a temporary "fixable" edge */ + ConnectRightVertex( tess, regUp, eBottomLeft ); + } else { + AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE ); + } +} + + +/* Make the sentinel coordinates big enough that they will never be + * merged with real input features. (Even with the largest possible + * input contour and the maximum tolerance of 1.0, no merging will be + * done with coordinates larger than 3 * GLU_TESS_MAX_COORD). + */ +#define SENTINEL_COORD (4 * GLU_TESS_MAX_COORD) + +static void AddSentinel( GLUtesselator *tess, GLdouble t ) +/* + * We add two sentinel edges above and below all other edges, + * to avoid special cases at the top and bottom. + */ +{ + GLUhalfEdge *e; + ActiveRegion *reg = (ActiveRegion *)memAlloc( sizeof( ActiveRegion )); + if (reg == NULL) longjmp(tess->env,1); + + e = __gl_meshMakeEdge( tess->mesh ); + if (e == NULL) longjmp(tess->env,1); + + e->Org->s = SENTINEL_COORD; + e->Org->t = t; + e->Dst->s = -SENTINEL_COORD; + e->Dst->t = t; + tess->event = e->Dst; /* initialize it */ + + reg->eUp = e; + reg->windingNumber = 0; + reg->inside = FALSE; + reg->fixUpperEdge = FALSE; + reg->sentinel = TRUE; + reg->dirty = FALSE; + reg->nodeUp = dictInsert( tess->dict, reg ); /* __gl_dictListInsertBefore */ + if (reg->nodeUp == NULL) longjmp(tess->env,1); +} + + +static void InitEdgeDict( GLUtesselator *tess ) +/* + * We maintain an ordering of edge intersections with the sweep line. + * This order is maintained in a dynamic dictionary. + */ +{ + /* __gl_dictListNewDict */ + tess->dict = dictNewDict( tess, (int (*)(void *, DictKey, DictKey)) EdgeLeq ); + if (tess->dict == NULL) longjmp(tess->env,1); + + AddSentinel( tess, -SENTINEL_COORD ); + AddSentinel( tess, SENTINEL_COORD ); +} + + +static void DoneEdgeDict( GLUtesselator *tess ) +{ + ActiveRegion *reg; +#ifndef NDEBUG + int fixedEdges = 0; +#endif + + /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */ + while( (reg = (ActiveRegion *)dictKey( dictMin( tess->dict ))) != NULL ) { + /* + * At the end of all processing, the dictionary should contain + * only the two sentinel edges, plus at most one "fixable" edge + * created by ConnectRightVertex(). + */ + if( ! reg->sentinel ) { + assert( reg->fixUpperEdge ); + assert( ++fixedEdges == 1 ); + } + assert( reg->windingNumber == 0 ); + DeleteRegion( tess, reg ); +/* __gl_meshDelete( reg->eUp );*/ + } + dictDeleteDict( tess->dict ); /* __gl_dictListDeleteDict */ +} + + +static void RemoveDegenerateEdges( GLUtesselator *tess ) +/* + * Remove zero-length edges, and contours with fewer than 3 vertices. + */ +{ + GLUhalfEdge *e, *eNext, *eLnext; + GLUhalfEdge *eHead = &tess->mesh->eHead; + + /*LINTED*/ + for( e = eHead->next; e != eHead; e = eNext ) { + eNext = e->next; + eLnext = e->Lnext; + + if( VertEq( e->Org, e->Dst ) && e->Lnext->Lnext != e ) { + /* Zero-length edge, contour has at least 3 edges */ + + SpliceMergeVertices( tess, eLnext, e ); /* deletes e->Org */ + if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1); /* e is a self-loop */ + e = eLnext; + eLnext = e->Lnext; + } + if( eLnext->Lnext == e ) { + /* Degenerate contour (one or two edges) */ + + if( eLnext != e ) { + if( eLnext == eNext || eLnext == eNext->Sym ) { eNext = eNext->next; } + if ( !__gl_meshDelete( eLnext ) ) longjmp(tess->env,1); + } + if( e == eNext || e == eNext->Sym ) { eNext = eNext->next; } + if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1); + } + } +} + +static int InitPriorityQ( GLUtesselator *tess ) +/* + * Insert all vertices into the priority queue which determines the + * order in which vertices cross the sweep line. + */ +{ + PriorityQ *pq; + GLUvertex *v, *vHead; + + /* __gl_pqSortNewPriorityQ */ + pq = tess->pq = pqNewPriorityQ( (int (*)(PQkey, PQkey)) __gl_vertLeq ); + if (pq == NULL) return 0; + + vHead = &tess->mesh->vHead; + for( v = vHead->next; v != vHead; v = v->next ) { + v->pqHandle = pqInsert( pq, v ); /* __gl_pqSortInsert */ + if (v->pqHandle == LONG_MAX) break; + } + if (v != vHead || !pqInit( pq ) ) { /* __gl_pqSortInit */ + pqDeletePriorityQ(tess->pq); /* __gl_pqSortDeletePriorityQ */ + tess->pq = NULL; + return 0; + } + + return 1; +} + + +static void DonePriorityQ( GLUtesselator *tess ) +{ + pqDeletePriorityQ( tess->pq ); /* __gl_pqSortDeletePriorityQ */ +} + + +static int RemoveDegenerateFaces( GLUmesh *mesh ) +/* + * Delete any degenerate faces with only two edges. WalkDirtyRegions() + * will catch almost all of these, but it won't catch degenerate faces + * produced by splice operations on already-processed edges. + * The two places this can happen are in FinishLeftRegions(), when + * we splice in a "temporary" edge produced by ConnectRightVertex(), + * and in CheckForLeftSplice(), where we splice already-processed + * edges to ensure that our dictionary invariants are not violated + * by numerical errors. + * + * In both these cases it is *very* dangerous to delete the offending + * edge at the time, since one of the routines further up the stack + * will sometimes be keeping a pointer to that edge. + */ +{ + GLUface *f, *fNext; + GLUhalfEdge *e; + + /*LINTED*/ + for( f = mesh->fHead.next; f != &mesh->fHead; f = fNext ) { + fNext = f->next; + e = f->anEdge; + assert( e->Lnext != e ); + + if( e->Lnext->Lnext == e ) { + /* A face with only two edges */ + AddWinding( e->Onext, e ); + if ( !__gl_meshDelete( e ) ) return 0; + } + } + return 1; +} + +int __gl_computeInterior( GLUtesselator *tess ) +/* + * __gl_computeInterior( tess ) computes the planar arrangement specified + * by the given contours, and further subdivides this arrangement + * into regions. Each region is marked "inside" if it belongs + * to the polygon, according to the rule given by tess->windingRule. + * Each interior region is guaranteed be monotone. + */ +{ + GLUvertex *v, *vNext; + + tess->fatalError = FALSE; + + /* Each vertex defines an event for our sweep line. Start by inserting + * all the vertices in a priority queue. Events are processed in + * lexicographic order, ie. + * + * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y) + */ + RemoveDegenerateEdges( tess ); + if ( !InitPriorityQ( tess ) ) return 0; /* if error */ + InitEdgeDict( tess ); + + /* __gl_pqSortExtractMin */ + while( (v = (GLUvertex *)pqExtractMin( tess->pq )) != NULL ) { + for( ;; ) { + vNext = (GLUvertex *)pqMinimum( tess->pq ); /* __gl_pqSortMinimum */ + if( vNext == NULL || ! VertEq( vNext, v )) break; + + /* Merge together all vertices at exactly the same location. + * This is more efficient than processing them one at a time, + * simplifies the code (see ConnectLeftDegenerate), and is also + * important for correct handling of certain degenerate cases. + * For example, suppose there are two identical edges A and B + * that belong to different contours (so without this code they would + * be processed by separate sweep events). Suppose another edge C + * crosses A and B from above. When A is processed, we split it + * at its intersection point with C. However this also splits C, + * so when we insert B we may compute a slightly different + * intersection point. This might leave two edges with a small + * gap between them. This kind of error is especially obvious + * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY). + */ + vNext = (GLUvertex *)pqExtractMin( tess->pq ); /* __gl_pqSortExtractMin*/ + SpliceMergeVertices( tess, v->anEdge, vNext->anEdge ); + } + SweepEvent( tess, v ); + } + + /* Set tess->event for debugging purposes */ + /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */ + tess->event = ((ActiveRegion *) dictKey( dictMin( tess->dict )))->eUp->Org; + DebugEvent( tess ); + DoneEdgeDict( tess ); + DonePriorityQ( tess ); + + if ( !RemoveDegenerateFaces( tess->mesh ) ) return 0; + __gl_meshCheckMesh( tess->mesh ); + + return 1; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/sweep.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,77 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __sweep_h_ +#define __sweep_h_ + +#include "mesh.h" + +/* __gl_computeInterior( tess ) computes the planar arrangement specified + * by the given contours, and further subdivides this arrangement + * into regions. Each region is marked "inside" if it belongs + * to the polygon, according to the rule given by tess->windingRule. + * Each interior region is guaranteed be monotone. + */ +int __gl_computeInterior( GLUtesselator *tess ); + + +/* The following is here *only* for access by debugging routines */ + +#include "dict.h" + +/* For each pair of adjacent edges crossing the sweep line, there is + * an ActiveRegion to represent the region between them. The active + * regions are kept in sorted order in a dynamic dictionary. As the + * sweep line crosses each vertex, we update the affected regions. + */ + +struct ActiveRegion { + GLUhalfEdge *eUp; /* upper edge, directed right to left */ + DictNode *nodeUp; /* dictionary node corresponding to eUp */ + int windingNumber; /* used to determine which regions are + * inside the polygon */ + GLboolean inside; /* is this region inside the polygon? */ + GLboolean sentinel; /* marks fake edges at t = +/-infinity */ + GLboolean dirty; /* marks regions where the upper or lower + * edge has changed, but we haven't checked + * whether they intersect yet */ + GLboolean fixUpperEdge; /* marks temporary edges introduced when + * we process a "right vertex" (one without + * any edges leaving to the right) */ +}; + +#define RegionBelow(r) ((ActiveRegion *) dictKey(dictPred((r)->nodeUp))) +#define RegionAbove(r) ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp))) + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,628 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include +#include +#include "memalloc.h" +#include "tess.h" +#include "mesh.h" +#include "normal.h" +#include "sweep.h" +#include "tessmono.h" +#include "render.h" + +#define GLU_TESS_DEFAULT_TOLERANCE 0.0 +#define GLU_TESS_MESH 100112 /* void (*)(GLUmesh *mesh) */ + +#define TRUE 1 +#define FALSE 0 + +/*ARGSUSED*/ static void GLAPIENTRY noBegin( GLenum type ) {} +/*ARGSUSED*/ static void GLAPIENTRY noEdgeFlag( GLboolean boundaryEdge ) {} +/*ARGSUSED*/ static void GLAPIENTRY noVertex( void *data ) {} +/*ARGSUSED*/ static void GLAPIENTRY noEnd( void ) {} +/*ARGSUSED*/ static void GLAPIENTRY noError( GLenum errnum ) {} +/*ARGSUSED*/ static void GLAPIENTRY noCombine( GLdouble coords[3], void *data[4], + GLfloat weight[4], void **dataOut ) {} +/*ARGSUSED*/ static void GLAPIENTRY noMesh( GLUmesh *mesh ) {} + + +/*ARGSUSED*/ void GLAPIENTRY __gl_noBeginData( GLenum type, + void *polygonData ) {} +/*ARGSUSED*/ void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, + void *polygonData ) {} +/*ARGSUSED*/ void GLAPIENTRY __gl_noVertexData( void *data, + void *polygonData ) {} +/*ARGSUSED*/ void GLAPIENTRY __gl_noEndData( void *polygonData ) {} +/*ARGSUSED*/ void GLAPIENTRY __gl_noErrorData( GLenum errnum, + void *polygonData ) {} +/*ARGSUSED*/ void GLAPIENTRY __gl_noCombineData( GLdouble coords[3], + void *data[4], + GLfloat weight[4], + void **outData, + void *polygonData ) {} + +/* Half-edges are allocated in pairs (see mesh.c) */ +typedef struct { GLUhalfEdge e, eSym; } EdgePair; + +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \ + MAX(sizeof(GLUvertex),sizeof(GLUface)))) + + +GLUtesselator * GLAPIENTRY +gluNewTess( void ) +{ + GLUtesselator *tess; + + /* Only initialize fields which can be changed by the api. Other fields + * are initialized where they are used. + */ + + if (memInit( MAX_FAST_ALLOC ) == 0) { + return 0; /* out of memory */ + } + tess = (GLUtesselator *)memAlloc( sizeof( GLUtesselator )); + if (tess == NULL) { + return 0; /* out of memory */ + } + + tess->state = T_DORMANT; + + tess->normal[0] = 0; + tess->normal[1] = 0; + tess->normal[2] = 0; + + tess->relTolerance = GLU_TESS_DEFAULT_TOLERANCE; + tess->windingRule = GLU_TESS_WINDING_ODD; + tess->flagBoundary = FALSE; + tess->boundaryOnly = FALSE; + + tess->callBegin = &noBegin; + tess->callEdgeFlag = &noEdgeFlag; + tess->callVertex = &noVertex; + tess->callEnd = &noEnd; + + tess->callError = &noError; + tess->callCombine = &noCombine; + tess->callMesh = &noMesh; + + tess->callBeginData= &__gl_noBeginData; + tess->callEdgeFlagData= &__gl_noEdgeFlagData; + tess->callVertexData= &__gl_noVertexData; + tess->callEndData= &__gl_noEndData; + tess->callErrorData= &__gl_noErrorData; + tess->callCombineData= &__gl_noCombineData; + + tess->polygonData= NULL; + + return tess; +} + +static void MakeDormant( GLUtesselator *tess ) +{ + /* Return the tessellator to its original dormant state. */ + + if( tess->mesh != NULL ) { + __gl_meshDeleteMesh( tess->mesh ); + } + tess->state = T_DORMANT; + tess->lastEdge = NULL; + tess->mesh = NULL; +} + +#define RequireState( tess, s ) if( tess->state != s ) GotoState(tess,s) + +static void GotoState( GLUtesselator *tess, enum TessState newState ) +{ + while( tess->state != newState ) { + /* We change the current state one level at a time, to get to + * the desired state. + */ + if( tess->state < newState ) { + switch( tess->state ) { + case T_DORMANT: + CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_POLYGON ); + gluTessBeginPolygon( tess, NULL ); + break; + case T_IN_POLYGON: + CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_CONTOUR ); + gluTessBeginContour( tess ); + break; + default: + ; + } + } else { + switch( tess->state ) { + case T_IN_CONTOUR: + CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_CONTOUR ); + gluTessEndContour( tess ); + break; + case T_IN_POLYGON: + CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_POLYGON ); + /* gluTessEndPolygon( tess ) is too much work! */ + MakeDormant( tess ); + break; + default: + ; + } + } + } +} + + +void GLAPIENTRY +gluDeleteTess( GLUtesselator *tess ) +{ + RequireState( tess, T_DORMANT ); + memFree( tess ); +} + + +void GLAPIENTRY +gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value ) +{ + GLenum windingRule; + + switch( which ) { + case GLU_TESS_TOLERANCE: + if( value < 0.0 || value > 1.0 ) break; + tess->relTolerance = value; + return; + + case GLU_TESS_WINDING_RULE: + windingRule = (GLenum) value; + if( windingRule != value ) break; /* not an integer */ + + switch( windingRule ) { + case GLU_TESS_WINDING_ODD: + case GLU_TESS_WINDING_NONZERO: + case GLU_TESS_WINDING_POSITIVE: + case GLU_TESS_WINDING_NEGATIVE: + case GLU_TESS_WINDING_ABS_GEQ_TWO: + tess->windingRule = windingRule; + return; + default: + break; + } + + case GLU_TESS_BOUNDARY_ONLY: + tess->boundaryOnly = (value != 0); + return; + + default: + CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM ); + return; + } + CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_VALUE ); +} + +/* Returns tessellator property */ +void GLAPIENTRY +gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ) +{ + switch (which) { + case GLU_TESS_TOLERANCE: + /* tolerance should be in range [0..1] */ + assert(0.0 <= tess->relTolerance && tess->relTolerance <= 1.0); + *value= tess->relTolerance; + break; + case GLU_TESS_WINDING_RULE: + assert(tess->windingRule == GLU_TESS_WINDING_ODD || + tess->windingRule == GLU_TESS_WINDING_NONZERO || + tess->windingRule == GLU_TESS_WINDING_POSITIVE || + tess->windingRule == GLU_TESS_WINDING_NEGATIVE || + tess->windingRule == GLU_TESS_WINDING_ABS_GEQ_TWO); + *value= tess->windingRule; + break; + case GLU_TESS_BOUNDARY_ONLY: + assert(tess->boundaryOnly == TRUE || tess->boundaryOnly == FALSE); + *value= tess->boundaryOnly; + break; + default: + *value= 0.0; + CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM ); + break; + } +} /* gluGetTessProperty() */ + +void GLAPIENTRY +gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z ) +{ + tess->normal[0] = x; + tess->normal[1] = y; + tess->normal[2] = z; +} + +void GLAPIENTRY +gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn) +{ + switch( which ) { + case GLU_TESS_BEGIN: + tess->callBegin = (fn == NULL) ? &noBegin : (void (GLAPIENTRY *)(GLenum)) fn; + return; + case GLU_TESS_BEGIN_DATA: + tess->callBeginData = (fn == NULL) ? + &__gl_noBeginData : (void (GLAPIENTRY *)(GLenum, void *)) fn; + return; + case GLU_TESS_EDGE_FLAG: + tess->callEdgeFlag = (fn == NULL) ? &noEdgeFlag : + (void (GLAPIENTRY *)(GLboolean)) fn; + /* If the client wants boundary edges to be flagged, + * we render everything as separate triangles (no strips or fans). + */ + tess->flagBoundary = (fn != NULL); + return; + case GLU_TESS_EDGE_FLAG_DATA: + tess->callEdgeFlagData= (fn == NULL) ? + &__gl_noEdgeFlagData : (void (GLAPIENTRY *)(GLboolean, void *)) fn; + /* If the client wants boundary edges to be flagged, + * we render everything as separate triangles (no strips or fans). + */ + tess->flagBoundary = (fn != NULL); + return; + case GLU_TESS_VERTEX: + tess->callVertex = (fn == NULL) ? &noVertex : + (void (GLAPIENTRY *)(void *)) fn; + return; + case GLU_TESS_VERTEX_DATA: + tess->callVertexData = (fn == NULL) ? + &__gl_noVertexData : (void (GLAPIENTRY *)(void *, void *)) fn; + return; + case GLU_TESS_END: + tess->callEnd = (fn == NULL) ? &noEnd : (void (GLAPIENTRY *)(void)) fn; + return; + case GLU_TESS_END_DATA: + tess->callEndData = (fn == NULL) ? &__gl_noEndData : + (void (GLAPIENTRY *)(void *)) fn; + return; + case GLU_TESS_ERROR: + tess->callError = (fn == NULL) ? &noError : (void (GLAPIENTRY *)(GLenum)) fn; + return; + case GLU_TESS_ERROR_DATA: + tess->callErrorData = (fn == NULL) ? + &__gl_noErrorData : (void (GLAPIENTRY *)(GLenum, void *)) fn; + return; + case GLU_TESS_COMBINE: + tess->callCombine = (fn == NULL) ? &noCombine : + (void (GLAPIENTRY *)(GLdouble [3],void *[4], GLfloat [4], void ** )) fn; + return; + case GLU_TESS_COMBINE_DATA: + tess->callCombineData = (fn == NULL) ? &__gl_noCombineData : + (void (GLAPIENTRY *)(GLdouble [3], + void *[4], + GLfloat [4], + void **, + void *)) fn; + return; + case GLU_TESS_MESH: + tess->callMesh = (fn == NULL) ? &noMesh : (void (GLAPIENTRY *)(GLUmesh *)) fn; + return; + default: + CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM ); + return; + } +} + +static int AddVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) +{ + GLUhalfEdge *e; + + e = tess->lastEdge; + if( e == NULL ) { + /* Make a self-loop (one vertex, one edge). */ + + e = __gl_meshMakeEdge( tess->mesh ); + if (e == NULL) return 0; + if ( !__gl_meshSplice( e, e->Sym ) ) return 0; + } else { + /* Create a new vertex and edge which immediately follow e + * in the ordering around the left face. + */ + if (__gl_meshSplitEdge( e ) == NULL) return 0; + e = e->Lnext; + } + + /* The new vertex is now e->Org. */ + e->Org->data = data; + e->Org->coords[0] = coords[0]; + e->Org->coords[1] = coords[1]; + e->Org->coords[2] = coords[2]; + + /* The winding of an edge says how the winding number changes as we + * cross from the edge''s right face to its left face. We add the + * vertices in such an order that a CCW contour will add +1 to + * the winding number of the region inside the contour. + */ + e->winding = 1; + e->Sym->winding = -1; + + tess->lastEdge = e; + + return 1; +} + + +static void CacheVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) +{ + CachedVertex *v = &tess->cache[tess->cacheCount]; + + v->data = data; + v->coords[0] = coords[0]; + v->coords[1] = coords[1]; + v->coords[2] = coords[2]; + ++tess->cacheCount; +} + + +static int EmptyCache( GLUtesselator *tess ) +{ + CachedVertex *v = tess->cache; + CachedVertex *vLast; + + tess->mesh = __gl_meshNewMesh(); + if (tess->mesh == NULL) return 0; + + for( vLast = v + tess->cacheCount; v < vLast; ++v ) { + if ( !AddVertex( tess, v->coords, v->data ) ) return 0; + } + tess->cacheCount = 0; + tess->emptyCache = FALSE; + + return 1; +} + + +void GLAPIENTRY +gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) +{ + int i, tooLarge = FALSE; + GLdouble x, clamped[3]; + + RequireState( tess, T_IN_CONTOUR ); + + if( tess->emptyCache ) { + if ( !EmptyCache( tess ) ) { + CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); + return; + } + tess->lastEdge = NULL; + } + for( i = 0; i < 3; ++i ) { + x = coords[i]; + if( x < - GLU_TESS_MAX_COORD ) { + x = - GLU_TESS_MAX_COORD; + tooLarge = TRUE; + } + if( x > GLU_TESS_MAX_COORD ) { + x = GLU_TESS_MAX_COORD; + tooLarge = TRUE; + } + clamped[i] = x; + } + if( tooLarge ) { + CALL_ERROR_OR_ERROR_DATA( GLU_TESS_COORD_TOO_LARGE ); + } + + if( tess->mesh == NULL ) { + if( tess->cacheCount < TESS_MAX_CACHE ) { + CacheVertex( tess, clamped, data ); + return; + } + if ( !EmptyCache( tess ) ) { + CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); + return; + } + } + if ( !AddVertex( tess, clamped, data ) ) { + CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); + } +} + + +void GLAPIENTRY +gluTessBeginPolygon( GLUtesselator *tess, void *data ) +{ + RequireState( tess, T_DORMANT ); + + tess->state = T_IN_POLYGON; + tess->cacheCount = 0; + tess->emptyCache = FALSE; + tess->mesh = NULL; + + tess->polygonData= data; +} + + +void GLAPIENTRY +gluTessBeginContour( GLUtesselator *tess ) +{ + RequireState( tess, T_IN_POLYGON ); + + tess->state = T_IN_CONTOUR; + tess->lastEdge = NULL; + if( tess->cacheCount > 0 ) { + /* Just set a flag so we don't get confused by empty contours + * -- these can be generated accidentally with the obsolete + * NextContour() interface. + */ + tess->emptyCache = TRUE; + } +} + + +void GLAPIENTRY +gluTessEndContour( GLUtesselator *tess ) +{ + RequireState( tess, T_IN_CONTOUR ); + tess->state = T_IN_POLYGON; +} + +void GLAPIENTRY +gluTessEndPolygon( GLUtesselator *tess ) +{ + GLUmesh *mesh; + + if (setjmp(tess->env) != 0) { + /* come back here if out of memory */ + CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); + return; + } + + RequireState( tess, T_IN_POLYGON ); + tess->state = T_DORMANT; + + if( tess->mesh == NULL ) { + if( ! tess->flagBoundary && tess->callMesh == &noMesh ) { + + /* Try some special code to make the easy cases go quickly + * (eg. convex polygons). This code does NOT handle multiple contours, + * intersections, edge flags, and of course it does not generate + * an explicit mesh either. + */ + if( __gl_renderCache( tess )) { + tess->polygonData= NULL; + return; + } + } + if ( !EmptyCache( tess ) ) longjmp(tess->env,1); /* could've used a label*/ + } + + /* Determine the polygon normal and project vertices onto the plane + * of the polygon. + */ + __gl_projectPolygon( tess ); + + /* __gl_computeInterior( tess ) computes the planar arrangement specified + * by the given contours, and further subdivides this arrangement + * into regions. Each region is marked "inside" if it belongs + * to the polygon, according to the rule given by tess->windingRule. + * Each interior region is guaranteed be monotone. + */ + if ( !__gl_computeInterior( tess ) ) { + longjmp(tess->env,1); /* could've used a label */ + } + + mesh = tess->mesh; + if( ! tess->fatalError ) { + int rc = 1; + + /* If the user wants only the boundary contours, we throw away all edges + * except those which separate the interior from the exterior. + * Otherwise we tessellate all the regions marked "inside". + */ + if( tess->boundaryOnly ) { + rc = __gl_meshSetWindingNumber( mesh, 1, TRUE ); + } else { + rc = __gl_meshTessellateInterior( mesh ); + } + if (rc == 0) longjmp(tess->env,1); /* could've used a label */ + + __gl_meshCheckMesh( mesh ); + + if( tess->callBegin != &noBegin || tess->callEnd != &noEnd + || tess->callVertex != &noVertex || tess->callEdgeFlag != &noEdgeFlag + || tess->callBeginData != &__gl_noBeginData + || tess->callEndData != &__gl_noEndData + || tess->callVertexData != &__gl_noVertexData + || tess->callEdgeFlagData != &__gl_noEdgeFlagData ) + { + if( tess->boundaryOnly ) { + __gl_renderBoundary( tess, mesh ); /* output boundary contours */ + } else { + __gl_renderMesh( tess, mesh ); /* output strips and fans */ + } + } + if( tess->callMesh != &noMesh ) { + + /* Throw away the exterior faces, so that all faces are interior. + * This way the user doesn't have to check the "inside" flag, + * and we don't need to even reveal its existence. It also leaves + * the freedom for an implementation to not generate the exterior + * faces in the first place. + */ + __gl_meshDiscardExterior( mesh ); + (*tess->callMesh)( mesh ); /* user wants the mesh itself */ + tess->mesh = NULL; + tess->polygonData= NULL; + return; + } + } + __gl_meshDeleteMesh( mesh ); + tess->polygonData= NULL; + tess->mesh = NULL; +} + + +/*XXXblythe unused function*/ +#if 0 +void GLAPIENTRY +gluDeleteMesh( GLUmesh *mesh ) +{ + __gl_meshDeleteMesh( mesh ); +} +#endif + + + +/*******************************************************/ + +/* Obsolete calls -- for backward compatibility */ + +void GLAPIENTRY +gluBeginPolygon( GLUtesselator *tess ) +{ + gluTessBeginPolygon( tess, NULL ); + gluTessBeginContour( tess ); +} + + +/*ARGSUSED*/ +void GLAPIENTRY +gluNextContour( GLUtesselator *tess, GLenum type ) +{ + gluTessEndContour( tess ); + gluTessBeginContour( tess ); +} + + +void GLAPIENTRY +gluEndPolygon( GLUtesselator *tess ) +{ + gluTessEndContour( tess ); + gluTessEndPolygon( tess ); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tess.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,165 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __tess_h_ +#define __tess_h_ + +#include +#include +#include "mesh.h" +#include "dict.h" +#include "priorityq.h" + +/* The begin/end calls must be properly nested. We keep track of + * the current state to enforce the ordering. + */ +enum TessState { T_DORMANT, T_IN_POLYGON, T_IN_CONTOUR }; + +/* We cache vertex data for single-contour polygons so that we can + * try a quick-and-dirty decomposition first. + */ +#define TESS_MAX_CACHE 100 + +typedef struct CachedVertex { + GLdouble coords[3]; + void *data; +} CachedVertex; + +struct GLUtesselator { + + /*** state needed for collecting the input data ***/ + + enum TessState state; /* what begin/end calls have we seen? */ + + GLUhalfEdge *lastEdge; /* lastEdge->Org is the most recent vertex */ + GLUmesh *mesh; /* stores the input contours, and eventually + the tessellation itself */ + + void (GLAPIENTRY *callError)( GLenum errnum ); + + /*** state needed for projecting onto the sweep plane ***/ + + GLdouble normal[3]; /* user-specified normal (if provided) */ + GLdouble sUnit[3]; /* unit vector in s-direction (debugging) */ + GLdouble tUnit[3]; /* unit vector in t-direction (debugging) */ + + /*** state needed for the line sweep ***/ + + GLdouble relTolerance; /* tolerance for merging features */ + GLenum windingRule; /* rule for determining polygon interior */ + GLboolean fatalError; /* fatal error: needed combine callback */ + + Dict *dict; /* edge dictionary for sweep line */ + PriorityQ *pq; /* priority queue of vertex events */ + GLUvertex *event; /* current sweep event being processed */ + + void (GLAPIENTRY *callCombine)( GLdouble coords[3], void *data[4], + GLfloat weight[4], void **outData ); + + /*** state needed for rendering callbacks (see render.c) ***/ + + GLboolean flagBoundary; /* mark boundary edges (use EdgeFlag) */ + GLboolean boundaryOnly; /* Extract contours, not triangles */ + GLUface *lonelyTriList; + /* list of triangles which could not be rendered as strips or fans */ + + void (GLAPIENTRY *callBegin)( GLenum type ); + void (GLAPIENTRY *callEdgeFlag)( GLboolean boundaryEdge ); + void (GLAPIENTRY *callVertex)( void *data ); + void (GLAPIENTRY *callEnd)( void ); + void (GLAPIENTRY *callMesh)( GLUmesh *mesh ); + + + /*** state needed to cache single-contour polygons for renderCache() */ + + GLboolean emptyCache; /* empty cache on next vertex() call */ + int cacheCount; /* number of cached vertices */ + CachedVertex cache[TESS_MAX_CACHE]; /* the vertex data */ + + /*** rendering callbacks that also pass polygon data ***/ + void (GLAPIENTRY *callBeginData)( GLenum type, void *polygonData ); + void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, + void *polygonData ); + void (GLAPIENTRY *callVertexData)( void *data, void *polygonData ); + void (GLAPIENTRY *callEndData)( void *polygonData ); + void (GLAPIENTRY *callErrorData)( GLenum errnum, void *polygonData ); + void (GLAPIENTRY *callCombineData)( GLdouble coords[3], void *data[4], + GLfloat weight[4], void **outData, + void *polygonData ); + + jmp_buf env; /* place to jump to when memAllocs fail */ + + void *polygonData; /* client data for current polygon */ +}; + +void GLAPIENTRY __gl_noBeginData( GLenum type, void *polygonData ); +void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, void *polygonData ); +void GLAPIENTRY __gl_noVertexData( void *data, void *polygonData ); +void GLAPIENTRY __gl_noEndData( void *polygonData ); +void GLAPIENTRY __gl_noErrorData( GLenum errnum, void *polygonData ); +void GLAPIENTRY __gl_noCombineData( GLdouble coords[3], void *data[4], + GLfloat weight[4], void **outData, + void *polygonData ); + +#define CALL_BEGIN_OR_BEGIN_DATA(a) \ + if (tess->callBeginData != &__gl_noBeginData) \ + (*tess->callBeginData)((a),tess->polygonData); \ + else (*tess->callBegin)((a)); + +#define CALL_VERTEX_OR_VERTEX_DATA(a) \ + if (tess->callVertexData != &__gl_noVertexData) \ + (*tess->callVertexData)((a),tess->polygonData); \ + else (*tess->callVertex)((a)); + +#define CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA(a) \ + if (tess->callEdgeFlagData != &__gl_noEdgeFlagData) \ + (*tess->callEdgeFlagData)((a),tess->polygonData); \ + else (*tess->callEdgeFlag)((a)); + +#define CALL_END_OR_END_DATA() \ + if (tess->callEndData != &__gl_noEndData) \ + (*tess->callEndData)(tess->polygonData); \ + else (*tess->callEnd)(); + +#define CALL_COMBINE_OR_COMBINE_DATA(a,b,c,d) \ + if (tess->callCombineData != &__gl_noCombineData) \ + (*tess->callCombineData)((a),(b),(c),(d),tess->polygonData); \ + else (*tess->callCombine)((a),(b),(c),(d)); + +#define CALL_ERROR_OR_ERROR_DATA(a) \ + if (tess->callErrorData != &__gl_noErrorData) \ + (*tess->callErrorData)((a),tess->polygonData); \ + else (*tess->callError)((a)); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.c xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,201 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#include "gluos.h" +#include +#include "geom.h" +#include "mesh.h" +#include "tessmono.h" +#include + +#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \ + eDst->Sym->winding += eSrc->Sym->winding) + +/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region + * (what else would it do??) The region must consist of a single + * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this + * case means that any vertical line intersects the interior of the + * region in a single interval. + * + * Tessellation consists of adding interior edges (actually pairs of + * half-edges), to split the region into non-overlapping triangles. + * + * The basic idea is explained in Preparata and Shamos (which I don''t + * have handy right now), although their implementation is more + * complicated than this one. The are two edge chains, an upper chain + * and a lower chain. We process all vertices from both chains in order, + * from right to left. + * + * The algorithm ensures that the following invariant holds after each + * vertex is processed: the untessellated region consists of two + * chains, where one chain (say the upper) is a single edge, and + * the other chain is concave. The left vertex of the single edge + * is always to the left of all vertices in the concave chain. + * + * Each step consists of adding the rightmost unprocessed vertex to one + * of the two chains, and forming a fan of triangles from the rightmost + * of two chain endpoints. Determining whether we can add each triangle + * to the fan is a simple orientation test. By making the fan as large + * as possible, we restore the invariant (check it yourself). + */ +int __gl_meshTessellateMonoRegion( GLUface *face ) +{ + GLUhalfEdge *up, *lo; + + /* All edges are oriented CCW around the boundary of the region. + * First, find the half-edge whose origin vertex is rightmost. + * Since the sweep goes from left to right, face->anEdge should + * be close to the edge we want. + */ + up = face->anEdge; + assert( up->Lnext != up && up->Lnext->Lnext != up ); + + for( ; VertLeq( up->Dst, up->Org ); up = up->Lprev ) + ; + for( ; VertLeq( up->Org, up->Dst ); up = up->Lnext ) + ; + lo = up->Lprev; + + while( up->Lnext != lo ) { + if( VertLeq( up->Dst, lo->Org )) { + /* up->Dst is on the left. It is safe to form triangles from lo->Org. + * The EdgeGoesLeft test guarantees progress even when some triangles + * are CW, given that the upper and lower chains are truly monotone. + */ + while( lo->Lnext != up && (EdgeGoesLeft( lo->Lnext ) + || EdgeSign( lo->Org, lo->Dst, lo->Lnext->Dst ) <= 0 )) { + GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo ); + if (tempHalfEdge == NULL) return 0; + lo = tempHalfEdge->Sym; + } + lo = lo->Lprev; + } else { + /* lo->Org is on the left. We can make CCW triangles from up->Dst. */ + while( lo->Lnext != up && (EdgeGoesRight( up->Lprev ) + || EdgeSign( up->Dst, up->Org, up->Lprev->Org ) >= 0 )) { + GLUhalfEdge *tempHalfEdge= __gl_meshConnect( up, up->Lprev ); + if (tempHalfEdge == NULL) return 0; + up = tempHalfEdge->Sym; + } + up = up->Lnext; + } + } + + /* Now lo->Org == up->Dst == the leftmost vertex. The remaining region + * can be tessellated in a fan from this leftmost vertex. + */ + assert( lo->Lnext != up ); + while( lo->Lnext->Lnext != up ) { + GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo ); + if (tempHalfEdge == NULL) return 0; + lo = tempHalfEdge->Sym; + } + + return 1; +} + + +/* __gl_meshTessellateInterior( mesh ) tessellates each region of + * the mesh which is marked "inside" the polygon. Each such region + * must be monotone. + */ +int __gl_meshTessellateInterior( GLUmesh *mesh ) +{ + GLUface *f, *next; + + /*LINTED*/ + for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) { + /* Make sure we don''t try to tessellate the new triangles. */ + next = f->next; + if( f->inside ) { + if ( !__gl_meshTessellateMonoRegion( f ) ) return 0; + } + } + + return 1; +} + + +/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces + * which are not marked "inside" the polygon. Since further mesh operations + * on NULL faces are not allowed, the main purpose is to clean up the + * mesh so that exterior loops are not represented in the data structure. + */ +void __gl_meshDiscardExterior( GLUmesh *mesh ) +{ + GLUface *f, *next; + + /*LINTED*/ + for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) { + /* Since f will be destroyed, save its next pointer. */ + next = f->next; + if( ! f->inside ) { + __gl_meshZapFace( f ); + } + } +} + +#define MARKED_FOR_DELETION 0x7fffffff + +/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the + * winding numbers on all edges so that regions marked "inside" the + * polygon have a winding number of "value", and regions outside + * have a winding number of 0. + * + * If keepOnlyBoundary is TRUE, it also deletes all edges which do not + * separate an interior region from an exterior one. + */ +int __gl_meshSetWindingNumber( GLUmesh *mesh, int value, + GLboolean keepOnlyBoundary ) +{ + GLUhalfEdge *e, *eNext; + + for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) { + eNext = e->next; + if( e->Rface->inside != e->Lface->inside ) { + + /* This is a boundary edge (one side is interior, one is exterior). */ + e->winding = (e->Lface->inside) ? value : -value; + } else { + + /* Both regions are interior, or both are exterior. */ + if( ! keepOnlyBoundary ) { + e->winding = 0; + } else { + if ( !__gl_meshDelete( e ) ) return 0; + } + } + } + return 1; +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.h xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libtess/tessmono.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,71 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ +/* +** Author: Eric Veach, July 1994. +** +*/ + +#ifndef __tessmono_h_ +#define __tessmono_h_ + +/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region + * (what else would it do??) The region must consist of a single + * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this + * case means that any vertical line intersects the interior of the + * region in a single interval. + * + * Tessellation consists of adding interior edges (actually pairs of + * half-edges), to split the region into non-overlapping triangles. + * + * __gl_meshTessellateInterior( mesh ) tessellates each region of + * the mesh which is marked "inside" the polygon. Each such region + * must be monotone. + * + * __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces + * which are not marked "inside" the polygon. Since further mesh operations + * on NULL faces are not allowed, the main purpose is to clean up the + * mesh so that exterior loops are not represented in the data structure. + * + * __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the + * winding numbers on all edges so that regions marked "inside" the + * polygon have a winding number of "value", and regions outside + * have a winding number of 0. + * + * If keepOnlyBoundary is TRUE, it also deletes all edges which do not + * separate an interior region from an exterior one. + */ + +int __gl_meshTessellateMonoRegion( GLUface *face ); +int __gl_meshTessellateInterior( GLUmesh *mesh ); +void __gl_meshDiscardExterior( GLUmesh *mesh ); +int __gl_meshSetWindingNumber( GLUmesh *mesh, int value, + GLboolean keepOnlyBoundary ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/error.c xpsb-glx-0.19/mesa/src/glu/sgi/libutil/error.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/error.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/error.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,83 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "gluos.h" +#include "gluint.h" +#include +#include +#include + + +struct token_string +{ + GLuint Token; + const char *String; +}; + +static const struct token_string Errors[] = { + { GL_NO_ERROR, "no error" }, + { GL_INVALID_ENUM, "invalid enumerant" }, + { GL_INVALID_VALUE, "invalid value" }, + { GL_INVALID_OPERATION, "invalid operation" }, + { GL_STACK_OVERFLOW, "stack overflow" }, + { GL_STACK_UNDERFLOW, "stack underflow" }, + { GL_OUT_OF_MEMORY, "out of memory" }, + { GL_TABLE_TOO_LARGE, "table too large" }, +#ifdef GL_EXT_framebuffer_object + { GL_INVALID_FRAMEBUFFER_OPERATION_EXT, "invalid framebuffer operation" }, +#endif + /* GLU */ + { GLU_INVALID_ENUM, "invalid enumerant" }, + { GLU_INVALID_VALUE, "invalid value" }, + { GLU_OUT_OF_MEMORY, "out of memory" }, + { GLU_INCOMPATIBLE_GL_VERSION, "incompatible gl version" }, + { GLU_INVALID_OPERATION, "invalid operation" }, + { ~0, NULL } /* end of list indicator */ +}; + + + +const GLubyte* GLAPIENTRY +gluErrorString(GLenum errorCode) +{ + int i; + for (i = 0; Errors[i].String; i++) { + if (Errors[i].Token == errorCode) + return (const GLubyte *) Errors[i].String; + } + if ((errorCode >= GLU_NURBS_ERROR1) && (errorCode <= GLU_NURBS_ERROR37)) { + return (const GLubyte *) __gluNURBSErrorString(errorCode - (GLU_NURBS_ERROR1 - 1)); + } + if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR6)) { + return (const GLubyte *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1)); + } + return (const GLubyte *) 0; +} + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/glue.c xpsb-glx-0.19/mesa/src/glu/sgi/libutil/glue.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/glue.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/glue.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,93 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include +#include "gluint.h" + +static unsigned char *__gluNurbsErrors[] = { + (unsigned char*) " ", + (unsigned char*) "spline order un-supported", + (unsigned char*) "too few knots", + (unsigned char*) "valid knot range is empty", + (unsigned char*) "decreasing knot sequence knot", + (unsigned char*) "knot multiplicity greater than order of spline", + (unsigned char*) "gluEndCurve() must follow gluBeginCurve()", + (unsigned char*) "gluBeginCurve() must precede gluEndCurve()", + (unsigned char*) "missing or extra geometric data", + (unsigned char*) "can't draw piecewise linear trimming curves", + (unsigned char*) "missing or extra domain data", + (unsigned char*) "missing or extra domain data", + (unsigned char*) "gluEndTrim() must precede gluEndSurface()", + (unsigned char*) "gluBeginSurface() must precede gluEndSurface()", + (unsigned char*) "curve of improper type passed as trim curve", + (unsigned char*) "gluBeginSurface() must precede gluBeginTrim()", + (unsigned char*) "gluEndTrim() must follow gluBeginTrim()", + (unsigned char*) "gluBeginTrim() must precede gluEndTrim()", + (unsigned char*) "invalid or missing trim curve", + (unsigned char*) "gluBeginTrim() must precede gluPwlCurve()", + (unsigned char*) "piecewise linear trimming curve referenced twice", + (unsigned char*) "piecewise linear trimming curve and nurbs curve mixed", + (unsigned char*) "improper usage of trim data type", + (unsigned char*) "nurbs curve referenced twice", + (unsigned char*) "nurbs curve and piecewise linear trimming curve mixed", + (unsigned char*) "nurbs surface referenced twice", + (unsigned char*) "invalid property", + (unsigned char*) "gluEndSurface() must follow gluBeginSurface()", + (unsigned char*) "intersecting or misoriented trim curves", + (unsigned char*) "intersecting trim curves", + (unsigned char*) "UNUSED", + (unsigned char*) "unconnected trim curves", + (unsigned char*) "unknown knot error", + (unsigned char*) "negative vertex count encountered", + (unsigned char*) "negative byte-stride encounteed", + (unsigned char*) "unknown type descriptor", + (unsigned char*) "null control point reference", + (unsigned char*) "duplicate point on piecewise linear trimming curve", +}; + +const unsigned char *__gluNURBSErrorString( int errnum ) +{ + return __gluNurbsErrors[errnum]; +} + +static unsigned char *__gluTessErrors[] = { + (unsigned char*) " ", + (unsigned char*) "gluTessBeginPolygon() must precede a gluTessEndPolygon()", + (unsigned char*) "gluTessBeginContour() must precede a gluTessEndContour()", + (unsigned char*) "gluTessEndPolygon() must follow a gluTessBeginPolygon()", + (unsigned char*) "gluTessEndContour() must follow a gluTessBeginContour()", + (unsigned char*) "a coordinate is too large", + (unsigned char*) "need combine callback", +}; + +const unsigned char *__gluTessErrorString( int errnum ) +{ + return __gluTessErrors[errnum]; +} /* __glTessErrorString() */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/gluint.h xpsb-glx-0.19/mesa/src/glu/sgi/libutil/gluint.h --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/gluint.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/gluint.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,48 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#ifndef __gluint_h__ +#define __gluint_h__ + +extern const unsigned char *__gluNURBSErrorString( int errnum ); + +extern const unsigned char *__gluTessErrorString( int errnum ); + +#ifdef _EXTENSIONS_ +#define COS cosf +#define SIN sinf +#define SQRT sqrtf +#else +#define COS cos +#define SIN sin +#define SQRT sqrt +#endif + +#endif /* __gluint_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/mipmap.c xpsb-glx-0.19/mesa/src/glu/sgi/libutil/mipmap.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/mipmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/mipmap.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,8931 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "gluos.h" +#include +#include +#include +#include +#include +#include /* UINT_MAX */ +#include +#include "gluint.h" + +typedef union { + unsigned char ub[4]; + unsigned short us[2]; + unsigned int ui; + char b[4]; + short s[2]; + int i; + float f; +} Type_Widget; + +/* Pixel storage modes */ +typedef struct { + GLint pack_alignment; + GLint pack_row_length; + GLint pack_skip_rows; + GLint pack_skip_pixels; + GLint pack_lsb_first; + GLint pack_swap_bytes; + GLint pack_skip_images; + GLint pack_image_height; + + GLint unpack_alignment; + GLint unpack_row_length; + GLint unpack_skip_rows; + GLint unpack_skip_pixels; + GLint unpack_lsb_first; + GLint unpack_swap_bytes; + GLint unpack_skip_images; + GLint unpack_image_height; +} PixelStorageModes; + +static int gluBuild1DMipmapLevelsCore(GLenum, GLint, + GLsizei, + GLsizei, + GLenum, GLenum, GLint, GLint, GLint, + const void *); +static int gluBuild2DMipmapLevelsCore(GLenum, GLint, + GLsizei, GLsizei, + GLsizei, GLsizei, + GLenum, GLenum, GLint, GLint, GLint, + const void *); +static int gluBuild3DMipmapLevelsCore(GLenum, GLint, + GLsizei, GLsizei, GLsizei, + GLsizei, GLsizei, GLsizei, + GLenum, GLenum, GLint, GLint, GLint, + const void *); + +/* + * internal function declarations + */ +static GLfloat bytes_per_element(GLenum type); +static GLint elements_per_group(GLenum format, GLenum type); +static GLint is_index(GLenum format); +static GLint image_size(GLint width, GLint height, GLenum format, GLenum type); +static void fill_image(const PixelStorageModes *, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, + const void *userdata, GLushort *newimage); +static void empty_image(const PixelStorageModes *, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, + const GLushort *oldimage, void *userdata); +static void scale_internal(GLint components, GLint widthin, GLint heightin, + const GLushort *datain, + GLint widthout, GLint heightout, + GLushort *dataout); + +static void scale_internal_ubyte(GLint components, GLint widthin, + GLint heightin, const GLubyte *datain, + GLint widthout, GLint heightout, + GLubyte *dataout, GLint element_size, + GLint ysize, GLint group_size); +static void scale_internal_byte(GLint components, GLint widthin, + GLint heightin, const GLbyte *datain, + GLint widthout, GLint heightout, + GLbyte *dataout, GLint element_size, + GLint ysize, GLint group_size); +static void scale_internal_ushort(GLint components, GLint widthin, + GLint heightin, const GLushort *datain, + GLint widthout, GLint heightout, + GLushort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); +static void scale_internal_short(GLint components, GLint widthin, + GLint heightin, const GLshort *datain, + GLint widthout, GLint heightout, + GLshort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); +static void scale_internal_uint(GLint components, GLint widthin, + GLint heightin, const GLuint *datain, + GLint widthout, GLint heightout, + GLuint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); +static void scale_internal_int(GLint components, GLint widthin, + GLint heightin, const GLint *datain, + GLint widthout, GLint heightout, + GLint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); +static void scale_internal_float(GLint components, GLint widthin, + GLint heightin, const GLfloat *datain, + GLint widthout, GLint heightout, + GLfloat *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); + +static int checkMipmapArgs(GLenum, GLenum, GLenum); +static GLboolean legalFormat(GLenum); +static GLboolean legalType(GLenum); +static GLboolean isTypePackedPixel(GLenum); +static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum); +static GLboolean isLegalLevels(GLint, GLint, GLint, GLint); +static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum, + GLint *, GLint *); + +/* all extract/shove routines must return double to handle unsigned ints */ +static GLdouble extractUbyte(int, const void *); +static void shoveUbyte(GLdouble, int, void *); +static GLdouble extractSbyte(int, const void *); +static void shoveSbyte(GLdouble, int, void *); +static GLdouble extractUshort(int, const void *); +static void shoveUshort(GLdouble, int, void *); +static GLdouble extractSshort(int, const void *); +static void shoveSshort(GLdouble, int, void *); +static GLdouble extractUint(int, const void *); +static void shoveUint(GLdouble, int, void *); +static GLdouble extractSint(int, const void *); +static void shoveSint(GLdouble, int, void *); +static GLdouble extractFloat(int, const void *); +static void shoveFloat(GLdouble, int, void *); +static void halveImageSlice(int, GLdouble (*)(int, const void *), + void (*)(GLdouble, int, void *), + GLint, GLint, GLint, + const void *, void *, + GLint, GLint, GLint, GLint, GLint); +static void halveImage3D(int, GLdouble (*)(int, const void *), + void (*)(GLdouble, int, void *), + GLint, GLint, GLint, + const void *, void *, + GLint, GLint, GLint, GLint, GLint); + +/* packedpixel type scale routines */ +static void extract332(int,const void *, GLfloat []); +static void shove332(const GLfloat [],int ,void *); +static void extract233rev(int,const void *, GLfloat []); +static void shove233rev(const GLfloat [],int ,void *); +static void extract565(int,const void *, GLfloat []); +static void shove565(const GLfloat [],int ,void *); +static void extract565rev(int,const void *, GLfloat []); +static void shove565rev(const GLfloat [],int ,void *); +static void extract4444(int,const void *, GLfloat []); +static void shove4444(const GLfloat [],int ,void *); +static void extract4444rev(int,const void *, GLfloat []); +static void shove4444rev(const GLfloat [],int ,void *); +static void extract5551(int,const void *, GLfloat []); +static void shove5551(const GLfloat [],int ,void *); +static void extract1555rev(int,const void *, GLfloat []); +static void shove1555rev(const GLfloat [],int ,void *); +static void extract8888(int,const void *, GLfloat []); +static void shove8888(const GLfloat [],int ,void *); +static void extract8888rev(int,const void *, GLfloat []); +static void shove8888rev(const GLfloat [],int ,void *); +static void extract1010102(int,const void *, GLfloat []); +static void shove1010102(const GLfloat [],int ,void *); +static void extract2101010rev(int,const void *, GLfloat []); +static void shove2101010rev(const GLfloat [],int ,void *); +static void scaleInternalPackedPixel(int, + void (*)(int, const void *,GLfloat []), + void (*)(const GLfloat [],int, void *), + GLint,GLint, const void *, + GLint,GLint,void *,GLint,GLint,GLint); +static void halveImagePackedPixel(int, + void (*)(int, const void *,GLfloat []), + void (*)(const GLfloat [],int, void *), + GLint, GLint, const void *, + void *, GLint, GLint, GLint); +static void halve1DimagePackedPixel(int, + void (*)(int, const void *,GLfloat []), + void (*)(const GLfloat [],int, void *), + GLint, GLint, const void *, + void *, GLint, GLint, GLint); + +static void halve1Dimage_ubyte(GLint, GLuint, GLuint,const GLubyte *, + GLubyte *, GLint, GLint, GLint); +static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *, + GLint, GLint, GLint); +static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *, + GLushort *, GLint, GLint, GLint, GLint); +static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *, + GLint, GLint, GLint, GLint); +static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *, + GLint, GLint, GLint, GLint); +static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *, + GLint, GLint, GLint, GLint); +static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *, + GLint, GLint, GLint, GLint); + +static GLint imageSize3D(GLint, GLint, GLint, GLenum,GLenum); +static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum, + GLenum, GLboolean, const void *, GLushort *); +static void emptyImage3D(const PixelStorageModes *, + GLint, GLint, GLint, GLenum, + GLenum, GLboolean, + const GLushort *, void *); +static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *, + GLint, GLint, GLint, GLushort *); + +static void retrieveStoreModes(PixelStorageModes *psm) +{ + glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment); + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels); + glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first); + glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes); + + glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment); + glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length); + glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows); + glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels); + glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first); + glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes); +} + +static void retrieveStoreModes3D(PixelStorageModes *psm) +{ + glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment); + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels); + glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first); + glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes); + glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &psm->unpack_skip_images); + glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, &psm->unpack_image_height); + + glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment); + glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length); + glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows); + glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels); + glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first); + glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes); + glGetIntegerv(GL_PACK_SKIP_IMAGES, &psm->pack_skip_images); + glGetIntegerv(GL_PACK_IMAGE_HEIGHT, &psm->pack_image_height); +} + +static int computeLog(GLuint value) +{ + int i; + + i = 0; + + /* Error! */ + if (value == 0) return -1; + + for (;;) { + if (value & 1) { + /* Error ! */ + if (value != 1) return -1; + return i; + } + value = value >> 1; + i++; + } +} + +/* +** Compute the nearest power of 2 number. This algorithm is a little +** strange, but it works quite well. +*/ +static int nearestPower(GLuint value) +{ + int i; + + i = 1; + + /* Error! */ + if (value == 0) return -1; + + for (;;) { + if (value == 1) { + return i; + } else if (value == 3) { + return i*4; + } + value = value >> 1; + i *= 2; + } +} + +#define __GLU_SWAP_2_BYTES(s)\ +(GLushort)(((GLushort)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0]) + +#define __GLU_SWAP_4_BYTES(s)\ +(GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \ + ((GLuint)((const GLubyte*)(s))[2])<<16 | \ + ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0]) + +static void halveImage(GLint components, GLuint width, GLuint height, + const GLushort *datain, GLushort *dataout) +{ + int i, j, k; + int newwidth, newheight; + int delta; + GLushort *s; + const GLushort *t; + + newwidth = width / 2; + newheight = height / 2; + delta = width * components; + s = dataout; + t = datain; + + /* Piece o' cake! */ + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (t[0] + t[components] + t[delta] + + t[delta+components] + 2) / 4; + s++; t++; + } + t += components; + } + t += delta; + } +} + +static void halveImage_ubyte(GLint components, GLuint width, GLuint height, + const GLubyte *datain, GLubyte *dataout, + GLint element_size, GLint ysize, GLint group_size) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLubyte *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_ubyte(components,width,height,datain,dataout, + element_size,ysize,group_size); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (*(const GLubyte*)t + + *(const GLubyte*)(t+group_size) + + *(const GLubyte*)(t+ysize) + + *(const GLubyte*)(t+ysize+group_size) + 2) / 4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +/* */ +static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, + const GLubyte *dataIn, GLubyte *dataOut, + GLint element_size, GLint ysize, + GLint group_size) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLubyte *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { + *dest= (*(const GLubyte*)src + + *(const GLubyte*)(src+group_size)) / 2; + + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { + *dest= (*(const GLubyte*)src + *(const GLubyte*)(src+ysize)) / 2; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; + } + } + + assert(src == &((const char *)dataIn)[ysize*height]); + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); +} /* halve1Dimage_ubyte() */ + +static void halveImage_byte(GLint components, GLuint width, GLuint height, + const GLbyte *datain, GLbyte *dataout, + GLint element_size, + GLint ysize, GLint group_size) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLbyte *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_byte(components,width,height,datain,dataout, + element_size,ysize,group_size); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (*(const GLbyte*)t + + *(const GLbyte*)(t+group_size) + + *(const GLbyte*)(t+ysize) + + *(const GLbyte*)(t+ysize+group_size) + 2) / 4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, + const GLbyte *dataIn, GLbyte *dataOut, + GLint element_size,GLint ysize, GLint group_size) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLbyte *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { + *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+group_size)) / 2; + + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { + *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+ysize)) / 2; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; + } + + assert(src == &((const char *)dataIn)[ysize*height]); + } + + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); +} /* halve1Dimage_byte() */ + +static void halveImage_ushort(GLint components, GLuint width, GLuint height, + const GLushort *datain, GLushort *dataout, + GLint element_size, GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLushort *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_ushort(components,width,height,datain,dataout, + element_size,ysize,group_size, myswap_bytes); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + if (!myswap_bytes) + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (*(const GLushort*)t + + *(const GLushort*)(t+group_size) + + *(const GLushort*)(t+ysize) + + *(const GLushort*)(t+ysize+group_size) + 2) / 4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } + else + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (__GLU_SWAP_2_BYTES(t) + + __GLU_SWAP_2_BYTES(t+group_size) + + __GLU_SWAP_2_BYTES(t+ysize) + + __GLU_SWAP_2_BYTES(t+ysize+group_size)+ 2)/4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, + const GLushort *dataIn, GLushort *dataOut, + GLint element_size, GLint ysize, + GLint group_size, GLint myswap_bytes) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLushort *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLushort ushort[BOX2]; + if (myswap_bytes) { + ushort[0]= __GLU_SWAP_2_BYTES(src); + ushort[1]= __GLU_SWAP_2_BYTES(src+group_size); + } + else { + ushort[0]= *(const GLushort*)src; + ushort[1]= *(const GLushort*)(src+group_size); + } + + *dest= (ushort[0] + ushort[1]) / 2; + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLushort ushort[BOX2]; + if (myswap_bytes) { + ushort[0]= __GLU_SWAP_2_BYTES(src); + ushort[1]= __GLU_SWAP_2_BYTES(src+ysize); + } + else { + ushort[0]= *(const GLushort*)src; + ushort[1]= *(const GLushort*)(src+ysize); + } + *dest= (ushort[0] + ushort[1]) / 2; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; + } + + assert(src == &((const char *)dataIn)[ysize*height]); + } + + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); + +} /* halve1Dimage_ushort() */ + + +static void halveImage_short(GLint components, GLuint width, GLuint height, + const GLshort *datain, GLshort *dataout, + GLint element_size, GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLshort *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_short(components,width,height,datain,dataout, + element_size,ysize,group_size, myswap_bytes); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + if (!myswap_bytes) + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (*(const GLshort*)t + + *(const GLshort*)(t+group_size) + + *(const GLshort*)(t+ysize) + + *(const GLshort*)(t+ysize+group_size) + 2) / 4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } + else + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + GLushort b; + GLint buf; + b = __GLU_SWAP_2_BYTES(t); + buf = *(const GLshort*)&b; + b = __GLU_SWAP_2_BYTES(t+group_size); + buf += *(const GLshort*)&b; + b = __GLU_SWAP_2_BYTES(t+ysize); + buf += *(const GLshort*)&b; + b = __GLU_SWAP_2_BYTES(t+ysize+group_size); + buf += *(const GLshort*)&b; + s[0] = (GLshort)((buf+2)/4); + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +static void halve1Dimage_short(GLint components, GLuint width, GLuint height, + const GLshort *dataIn, GLshort *dataOut, + GLint element_size, GLint ysize, + GLint group_size, GLint myswap_bytes) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLshort *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLshort sshort[BOX2]; + if (myswap_bytes) { + sshort[0]= __GLU_SWAP_2_BYTES(src); + sshort[1]= __GLU_SWAP_2_BYTES(src+group_size); + } + else { + sshort[0]= *(const GLshort*)src; + sshort[1]= *(const GLshort*)(src+group_size); + } + + *dest= (sshort[0] + sshort[1]) / 2; + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLshort sshort[BOX2]; + if (myswap_bytes) { + sshort[0]= __GLU_SWAP_2_BYTES(src); + sshort[1]= __GLU_SWAP_2_BYTES(src+ysize); + } + else { + sshort[0]= *(const GLshort*)src; + sshort[1]= *(const GLshort*)(src+ysize); + } + *dest= (sshort[0] + sshort[1]) / 2; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; + } + + assert(src == &((const char *)dataIn)[ysize*height]); + } + + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); + +} /* halve1Dimage_short() */ + + +static void halveImage_uint(GLint components, GLuint width, GLuint height, + const GLuint *datain, GLuint *dataout, + GLint element_size, GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLuint *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_uint(components,width,height,datain,dataout, + element_size,ysize,group_size, myswap_bytes); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + if (!myswap_bytes) + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + /* need to cast to double to hold large unsigned ints */ + s[0] = ((double)*(const GLuint*)t + + (double)*(const GLuint*)(t+group_size) + + (double)*(const GLuint*)(t+ysize) + + (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5; + s++; t += element_size; + + } + t += group_size; + } + t += padBytes; + t += ysize; + } + else + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + /* need to cast to double to hold large unsigned ints */ + GLdouble buf; + buf = (GLdouble)__GLU_SWAP_4_BYTES(t) + + (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) + + (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) + + (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size); + s[0] = (GLuint)(buf/4 + 0.5); + + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +/* */ +static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, + const GLuint *dataIn, GLuint *dataOut, + GLint element_size, GLint ysize, + GLint group_size, GLint myswap_bytes) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLuint *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLuint uint[BOX2]; + if (myswap_bytes) { + uint[0]= __GLU_SWAP_4_BYTES(src); + uint[1]= __GLU_SWAP_4_BYTES(src+group_size); + } + else { + uint[0]= *(const GLuint*)src; + uint[1]= *(const GLuint*)(src+group_size); + } + *dest= ((double)uint[0]+(double)uint[1])/2.0; + + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLuint uint[BOX2]; + if (myswap_bytes) { + uint[0]= __GLU_SWAP_4_BYTES(src); + uint[1]= __GLU_SWAP_4_BYTES(src+ysize); + } + else { + uint[0]= *(const GLuint*)src; + uint[1]= *(const GLuint*)(src+ysize); + } + *dest= ((double)uint[0]+(double)uint[1])/2.0; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; + } + + assert(src == &((const char *)dataIn)[ysize*height]); + } + + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); + +} /* halve1Dimage_uint() */ + +static void halveImage_int(GLint components, GLuint width, GLuint height, + const GLint *datain, GLint *dataout, GLint element_size, + GLint ysize, GLint group_size, GLint myswap_bytes) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLint *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_int(components,width,height,datain,dataout, + element_size,ysize,group_size, myswap_bytes); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + if (!myswap_bytes) + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = ((float)*(const GLint*)t + + (float)*(const GLint*)(t+group_size) + + (float)*(const GLint*)(t+ysize) + + (float)*(const GLint*)(t+ysize+group_size))/4 + 0.5; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } + else + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + GLuint b; + GLfloat buf; + b = __GLU_SWAP_4_BYTES(t); + buf = *(GLint*)&b; + b = __GLU_SWAP_4_BYTES(t+group_size); + buf += *(GLint*)&b; + b = __GLU_SWAP_4_BYTES(t+ysize); + buf += *(GLint*)&b; + b = __GLU_SWAP_4_BYTES(t+ysize+group_size); + buf += *(GLint*)&b; + s[0] = (GLint)(buf/4 + 0.5); + + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +/* */ +static void halve1Dimage_int(GLint components, GLuint width, GLuint height, + const GLint *dataIn, GLint *dataOut, + GLint element_size, GLint ysize, + GLint group_size, GLint myswap_bytes) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLint *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLuint uint[BOX2]; + if (myswap_bytes) { + uint[0]= __GLU_SWAP_4_BYTES(src); + uint[1]= __GLU_SWAP_4_BYTES(src+group_size); + } + else { + uint[0]= *(const GLuint*)src; + uint[1]= *(const GLuint*)(src+group_size); + } + *dest= ((float)uint[0]+(float)uint[1])/2.0; + + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLuint uint[BOX2]; + if (myswap_bytes) { + uint[0]= __GLU_SWAP_4_BYTES(src); + uint[1]= __GLU_SWAP_4_BYTES(src+ysize); + } + else { + uint[0]= *(const GLuint*)src; + uint[1]= *(const GLuint*)(src+ysize); + } + *dest= ((float)uint[0]+(float)uint[1])/2.0; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; + } + + assert(src == &((const char *)dataIn)[ysize*height]); + } + + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); + +} /* halve1Dimage_int() */ + + +static void halveImage_float(GLint components, GLuint width, GLuint height, + const GLfloat *datain, GLfloat *dataout, + GLint element_size, GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + int i, j, k; + int newwidth, newheight; + int padBytes; + GLfloat *s; + const char *t; + + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ + halve1Dimage_float(components,width,height,datain,dataout, + element_size,ysize,group_size, myswap_bytes); + return; + } + + newwidth = width / 2; + newheight = height / 2; + padBytes = ysize - (width*group_size); + s = dataout; + t = (const char *)datain; + + /* Piece o' cake! */ + if (!myswap_bytes) + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + s[0] = (*(const GLfloat*)t + + *(const GLfloat*)(t+group_size) + + *(const GLfloat*)(t+ysize) + + *(const GLfloat*)(t+ysize+group_size)) / 4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } + else + for (i = 0; i < newheight; i++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + union { GLuint b; GLfloat f; } swapbuf; + swapbuf.b = __GLU_SWAP_4_BYTES(t); + s[0] = swapbuf.f; + swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size); + s[0] += swapbuf.f; + swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize); + s[0] += swapbuf.f; + swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size); + s[0] += swapbuf.f; + s[0] /= 4; + s++; t += element_size; + } + t += group_size; + } + t += padBytes; + t += ysize; + } +} + +/* */ +static void halve1Dimage_float(GLint components, GLuint width, GLuint height, + const GLfloat *dataIn, GLfloat *dataOut, + GLint element_size, GLint ysize, + GLint group_size, GLint myswap_bytes) +{ + GLint halfWidth= width / 2; + GLint halfHeight= height / 2; + const char *src= (const char *) dataIn; + GLfloat *dest= dataOut; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + for (jj= 0; jj< halfWidth; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLfloat sfloat[BOX2]; + if (myswap_bytes) { + sfloat[0]= __GLU_SWAP_4_BYTES(src); + sfloat[1]= __GLU_SWAP_4_BYTES(src+group_size); + } + else { + sfloat[0]= *(const GLfloat*)src; + sfloat[1]= *(const GLfloat*)(src+group_size); + } + + *dest= (sfloat[0] + sfloat[1]) / 2.0; + src+= element_size; + dest++; + } + src+= group_size; /* skip to next 2 */ + } + { + int padBytes= ysize - (width*group_size); + src+= padBytes; /* for assertion only */ + } + } + else if (width == 1) { /* 1 column */ + int padBytes= ysize - (width * group_size); + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { + int kk; + for (kk= 0; kk< components; kk++) { +#define BOX2 2 + GLfloat sfloat[BOX2]; + if (myswap_bytes) { + sfloat[0]= __GLU_SWAP_4_BYTES(src); + sfloat[1]= __GLU_SWAP_4_BYTES(src+ysize); + } + else { + sfloat[0]= *(const GLfloat*)src; + sfloat[1]= *(const GLfloat*)(src+ysize); + } + *dest= (sfloat[0] + sfloat[1]) / 2.0; + + src+= element_size; + dest++; + } + src+= padBytes; /* add pad bytes, if any, to get to end to row */ + src+= ysize; /* skip to odd row */ + } + } + + assert(src == &((const char *)dataIn)[ysize*height]); + assert((char *)dest == &((char *)dataOut) + [components * element_size * halfWidth * halfHeight]); +} /* halve1Dimage_float() */ + +static void scale_internal(GLint components, GLint widthin, GLint heightin, + const GLushort *datain, + GLint widthout, GLint heightout, + GLushort *dataout) +{ + float x, lowx, highx, convx, halfconvx; + float y, lowy, highy, convy, halfconvy; + float xpercent,ypercent; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,yint,xint,xindex,yindex; + int temp; + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage(components, widthin, heightin, datain, dataout); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + halfconvx = convx/2; + halfconvy = convy/2; + for (i = 0; i < heightout; i++) { + y = convy * (i+0.5); + if (heightin > heightout) { + highy = y + halfconvy; + lowy = y - halfconvy; + } else { + highy = y + 0.5; + lowy = y - 0.5; + } + for (j = 0; j < widthout; j++) { + x = convx * (j+0.5); + if (widthin > widthout) { + highx = x + halfconvx; + lowx = x - halfconvx; + } else { + highx = x + 0.5; + lowx = x - 0.5; + } + + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + area = 0.0; + + y = lowy; + yint = floor(y); + while (y < highy) { + yindex = (yint + heightin) % heightin; + if (highy < yint+1) { + ypercent = highy - y; + } else { + ypercent = yint+1 - y; + } + + x = lowx; + xint = floor(x); + + while (x < highx) { + xindex = (xint + widthin) % widthin; + if (highx < xint+1) { + xpercent = highx - x; + } else { + xpercent = xint+1 - x; + } + + percent = xpercent * ypercent; + area += percent; + temp = (xindex + (yindex * widthin)) * components; + for (k = 0; k < components; k++) { + totals[k] += datain[temp + k] * percent; + } + + xint++; + x = xint; + } + yint++; + y = yint; + } + + temp = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + /* totals[] should be rounded in the case of enlarging an RGB + * ramp when the type is 332 or 4444 + */ + dataout[temp + k] = (totals[k]+0.5)/area; + } + } + } +} + +static void scale_internal_ubyte(GLint components, GLint widthin, + GLint heightin, const GLubyte *datain, + GLint widthout, GLint heightout, + GLubyte *dataout, GLint element_size, + GLint ysize, GLint group_size) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_ubyte(components, widthin, heightin, + (const GLubyte *)datain, (GLubyte *)dataout, + element_size, ysize, group_size); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + totals[k] += (GLubyte)(*(left))*(1-lowx_float) + +(GLubyte)(*(right))*highx_float; + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * x_percent; + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * percent; + } + } + + + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)); + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + +static void scale_internal_byte(GLint components, GLint widthin, + GLint heightin, const GLbyte *datain, + GLint widthout, GLint heightout, + GLbyte *dataout, GLint element_size, + GLint ysize, GLint group_size) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_byte(components, widthin, heightin, + (const GLbyte *)datain, (GLbyte *)dataout, + element_size, ysize, group_size); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + totals[k] += (GLbyte)(*(left))*(1-lowx_float) + +(GLbyte)(*(right))*highx_float; + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * x_percent; + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * percent; + } + } + + + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)); + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + +static void scale_internal_ushort(GLint components, GLint widthin, + GLint heightin, const GLushort *datain, + GLint widthout, GLint heightout, + GLushort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_ushort(components, widthin, heightin, + (const GLushort *)datain, (GLushort *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + + __GLU_SWAP_2_BYTES(right) * highx_float; + } else { + totals[k] += *(const GLushort*)left * (1-lowx_float) + + *(const GLushort*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * x_percent; + } else { + totals[k] += *(const GLushort*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index); + } else { + totals[k] += *(const GLushort*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + +static void scale_internal_short(GLint components, GLint widthin, + GLint heightin, const GLshort *datain, + GLint widthout, GLint heightout, + GLshort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + GLushort swapbuf; /* unsigned buffer */ + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_short(components, widthin, heightin, + (const GLshort *)datain, (GLshort *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLshort*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLshort*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(left); + totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float); + swapbuf = __GLU_SWAP_2_BYTES(right); + totals[k] += *(const GLshort*)&swapbuf * highx_float; + } else { + totals[k] += *(const GLshort*)left * (1-lowx_float) + + *(const GLshort*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * x_percent; + } else { + totals[k] += *(const GLshort*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLshort*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_2_BYTES(temp_index); + totals[k] += *(const GLshort*)&swapbuf; + } else { + totals[k] += *(const GLshort*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + +static void scale_internal_uint(GLint components, GLint widthin, + GLint heightin, const GLuint *datain, + GLint widthout, GLint heightout, + GLuint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_uint(components, widthin, heightin, + (const GLuint *)datain, (GLuint *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLuint*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLuint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(left) * (1-lowx_float) + + __GLU_SWAP_4_BYTES(right) * highx_float; + } else { + totals[k] += *(const GLuint*)left * (1-lowx_float) + + *(const GLuint*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * x_percent; + } else { + totals[k] += *(const GLuint*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLuint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index); + } else { + totals[k] += *(const GLuint*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + /* clamp at UINT_MAX */ + float value= totals[k]/area; + if (value >= (float) UINT_MAX) { /* need '=' */ + dataout[outindex + k] = UINT_MAX; + } + else dataout[outindex + k] = value; + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + + + +static void scale_internal_int(GLint components, GLint widthin, + GLint heightin, const GLint *datain, + GLint widthout, GLint heightout, + GLint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + GLuint swapbuf; /* unsigned buffer */ + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_int(components, widthin, heightin, + (const GLint *)datain, (GLint *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLint*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(left); + totals[k] += *(const GLint*)&swapbuf * (1-lowx_float); + swapbuf = __GLU_SWAP_4_BYTES(right); + totals[k] += *(const GLint*)&swapbuf * highx_float; + } else { + totals[k] += *(const GLint*)left * (1-lowx_float) + + *(const GLint*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * x_percent; + } else { + totals[k] += *(const GLint*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf; + } else { + totals[k] += *(const GLint*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + + + +static void scale_internal_float(GLint components, GLint widthin, + GLint heightin, const GLfloat *datain, + GLint widthout, GLint heightout, + GLfloat *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + union { GLuint b; GLfloat f; } swapbuf; + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_float(components, widthin, heightin, + (const GLfloat *)datain, (GLfloat *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + /* Clamp here to be sure we don't read beyond input buffer. */ + if (highy_int >= heightin) + highy_int = heightin - 1; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * y_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * y_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(left); + totals[k] += swapbuf.f * (1-lowx_float); + swapbuf.b = __GLU_SWAP_4_BYTES(right); + totals[k] += swapbuf.f * highx_float; + } else { + totals[k] += *(const GLfloat*)left * (1-lowx_float) + + *(const GLfloat*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * x_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * y_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += swapbuf.f; + } else { + totals[k] += *(const GLfloat*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + +static int checkMipmapArgs(GLenum internalFormat, GLenum format, GLenum type) +{ + if (!legalFormat(format) || !legalType(type)) { + return GLU_INVALID_ENUM; + } + if (format == GL_STENCIL_INDEX) { + return GLU_INVALID_ENUM; + } + + if (!isLegalFormatForPackedPixelType(format, type)) { + return GLU_INVALID_OPERATION; + } + + return 0; +} /* checkMipmapArgs() */ + +static GLboolean legalFormat(GLenum format) +{ + switch(format) { + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_RGB: + case GL_RGBA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_BGR: + case GL_BGRA: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +static GLboolean legalType(GLenum type) +{ + switch(type) { + case GL_BITMAP: + case GL_BYTE: + case GL_UNSIGNED_BYTE: + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + 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 GL_TRUE; + default: + return GL_FALSE; + } +} + +/* */ +static GLboolean isTypePackedPixel(GLenum type) +{ + assert(legalType(type)); + + if (type == GL_UNSIGNED_BYTE_3_3_2 || + type == GL_UNSIGNED_BYTE_2_3_3_REV || + type == GL_UNSIGNED_SHORT_5_6_5 || + type == GL_UNSIGNED_SHORT_5_6_5_REV || + type == GL_UNSIGNED_SHORT_4_4_4_4 || + type == GL_UNSIGNED_SHORT_4_4_4_4_REV || + type == GL_UNSIGNED_SHORT_5_5_5_1 || + type == GL_UNSIGNED_SHORT_1_5_5_5_REV || + type == GL_UNSIGNED_INT_8_8_8_8 || + type == GL_UNSIGNED_INT_8_8_8_8_REV || + type == GL_UNSIGNED_INT_10_10_10_2 || + type == GL_UNSIGNED_INT_2_10_10_10_REV) { + return 1; + } + else return 0; +} /* isTypePackedPixel() */ + +/* Determines if the packed pixel type is compatible with the format */ +static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type) +{ + /* if not a packed pixel type then return true */ + if (!isTypePackedPixel(type)) { + return GL_TRUE; + } + + /* 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB */ + if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV|| + type == GL_UNSIGNED_SHORT_5_6_5|| type == GL_UNSIGNED_SHORT_5_6_5_REV) + && format != GL_RGB) + return GL_FALSE; + + /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV & + * 10_10_10_2/2_10_10_10_REV are only compatible with RGBA, BGRA & ABGR_EXT. + */ + if ((type == GL_UNSIGNED_SHORT_4_4_4_4 || + type == GL_UNSIGNED_SHORT_4_4_4_4_REV || + type == GL_UNSIGNED_SHORT_5_5_5_1 || + type == GL_UNSIGNED_SHORT_1_5_5_5_REV || + type == GL_UNSIGNED_INT_8_8_8_8 || + type == GL_UNSIGNED_INT_8_8_8_8_REV || + type == GL_UNSIGNED_INT_10_10_10_2 || + type == GL_UNSIGNED_INT_2_10_10_10_REV) && + (format != GL_RGBA && + format != GL_BGRA)) { + return GL_FALSE; + } + + return GL_TRUE; +} /* isLegalFormatForPackedPixelType() */ + +static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel, + GLint totalLevels) +{ + if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel || + totalLevels < maxLevel) + return GL_FALSE; + else return GL_TRUE; +} /* isLegalLevels() */ + +/* Given user requested texture size, determine if it fits. If it + * doesn't then halve both sides and make the determination again + * until it does fit (for IR only). + * Note that proxy textures are not implemented in RE* even though + * they advertise the texture extension. + * Note that proxy textures are implemented but not according to spec in + * IMPACT*. + */ +static void closestFit(GLenum target, GLint width, GLint height, + GLint internalFormat, GLenum format, GLenum type, + GLint *newWidth, GLint *newHeight) +{ + /* Use proxy textures if OpenGL version is >= 1.1 */ + if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1) + ) { + GLint widthPowerOf2= nearestPower(width); + GLint heightPowerOf2= nearestPower(height); + GLint proxyWidth; + + do { + /* compute level 1 width & height, clamping each at 1 */ + GLint widthAtLevelOne= (widthPowerOf2 > 1) ? + widthPowerOf2 >> 1 : + widthPowerOf2; + GLint heightAtLevelOne= (heightPowerOf2 > 1) ? + heightPowerOf2 >> 1 : + heightPowerOf2; + GLenum proxyTarget; + assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0); + + /* does width x height at level 1 & all their mipmaps fit? */ + if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) { + proxyTarget = GL_PROXY_TEXTURE_2D; + glTexImage2D(proxyTarget, 1, /* must be non-zero */ + internalFormat, + widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); + } else +#if defined(GL_ARB_texture_cube_map) + if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) || + (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) || + (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) || + (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) || + (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) || + (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { + proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB; + glTexImage2D(proxyTarget, 1, /* must be non-zero */ + internalFormat, + widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); + } else +#endif /* GL_ARB_texture_cube_map */ + { + assert(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D); + proxyTarget = GL_PROXY_TEXTURE_1D; + glTexImage1D(proxyTarget, 1, /* must be non-zero */ + internalFormat,widthAtLevelOne,0,format,type,NULL); + } + glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth); + /* does it fit??? */ + if (proxyWidth == 0) { /* nope, so try again with these sizes */ + if (widthPowerOf2 == 1 && heightPowerOf2 == 1) { + /* An 1x1 texture couldn't fit for some reason, so + * break out. This should never happen. But things + * happen. The disadvantage with this if-statement is + * that we will never be aware of when this happens + * since it will silently branch out. + */ + goto noProxyTextures; + } + widthPowerOf2= widthAtLevelOne; + heightPowerOf2= heightAtLevelOne; + } + /* else it does fit */ + } while (proxyWidth == 0); + /* loop must terminate! */ + + /* return the width & height at level 0 that fits */ + *newWidth= widthPowerOf2; + *newHeight= heightPowerOf2; +/*printf("Proxy Textures\n");*/ + } /* if gluCheckExtension() */ + else { /* no texture extension, so do this instead */ + GLint maxsize; + +noProxyTextures: + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); + /* clamp user's texture sizes to maximum sizes, if necessary */ + *newWidth = nearestPower(width); + if (*newWidth > maxsize) *newWidth = maxsize; + *newHeight = nearestPower(height); + if (*newHeight > maxsize) *newHeight = maxsize; +/*printf("NO proxy textures\n");*/ + } +} /* closestFit() */ + +GLint GLAPIENTRY +gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, + GLenum typein, const void *datain, + GLsizei widthout, GLsizei heightout, GLenum typeout, + void *dataout) +{ + int components; + GLushort *beforeImage; + GLushort *afterImage; + PixelStorageModes psm; + + if (widthin == 0 || heightin == 0 || widthout == 0 || heightout == 0) { + return 0; + } + if (widthin < 0 || heightin < 0 || widthout < 0 || heightout < 0) { + return GLU_INVALID_VALUE; + } + if (!legalFormat(format) || !legalType(typein) || !legalType(typeout)) { + return GLU_INVALID_ENUM; + } + if (!isLegalFormatForPackedPixelType(format, typein)) { + return GLU_INVALID_OPERATION; + } + if (!isLegalFormatForPackedPixelType(format, typeout)) { + return GLU_INVALID_OPERATION; + } + beforeImage = + malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT)); + afterImage = + malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); + if (beforeImage == NULL || afterImage == NULL) { + return GLU_OUT_OF_MEMORY; + } + + retrieveStoreModes(&psm); + fill_image(&psm,widthin, heightin, format, typein, is_index(format), + datain, beforeImage); + components = elements_per_group(format, 0); + scale_internal(components, widthin, heightin, beforeImage, + widthout, heightout, afterImage); + empty_image(&psm,widthout, heightout, format, typeout, + is_index(format), afterImage, dataout); + free((GLbyte *) beforeImage); + free((GLbyte *) afterImage); + + return 0; +} + +int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, + GLsizei width, + GLsizei widthPowerOf2, + GLenum format, GLenum type, + GLint userLevel, GLint baseLevel,GLint maxLevel, + const void *data) +{ + GLint newwidth; + GLint level, levels; + GLushort *newImage; + GLint newImage_width; + GLushort *otherImage; + GLushort *imageTemp; + GLint memreq; + GLint cmpts; + PixelStorageModes psm; + + assert(checkMipmapArgs(internalFormat,format,type) == 0); + assert(width >= 1); + + otherImage = NULL; + + newwidth= widthPowerOf2; + levels = computeLog(newwidth); + + levels+= userLevel; + + retrieveStoreModes(&psm); + newImage = (GLushort *) + malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT)); + newImage_width = width; + if (newImage == NULL) { + return GLU_OUT_OF_MEMORY; + } + fill_image(&psm,width, 1, format, type, is_index(format), + data, newImage); + cmpts = elements_per_group(format,type); + glPixelStorei(GL_UNPACK_ALIGNMENT, 2); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + /* + ** If swap_bytes was set, swapping occurred in fill_image. + */ + glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); + + for (level = userLevel; level <= levels; level++) { + if (newImage_width == newwidth) { + /* Use newImage for this level */ + if (baseLevel <= level && level <= maxLevel) { + glTexImage1D(target, level, internalFormat, newImage_width, + 0, format, GL_UNSIGNED_SHORT, (void *) newImage); + } + } else { + if (otherImage == NULL) { + memreq = image_size(newwidth, 1, format, GL_UNSIGNED_SHORT); + otherImage = (GLushort *) malloc(memreq); + if (otherImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + } + scale_internal(cmpts, newImage_width, 1, newImage, + newwidth, 1, otherImage); + /* Swap newImage and otherImage */ + imageTemp = otherImage; + otherImage = newImage; + newImage = imageTemp; + + newImage_width = newwidth; + if (baseLevel <= level && level <= maxLevel) { + glTexImage1D(target, level, internalFormat, newImage_width, + 0, format, GL_UNSIGNED_SHORT, (void *) newImage); + } + } + if (newwidth > 1) newwidth /= 2; + } + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + + free((GLbyte *) newImage); + if (otherImage) { + free((GLbyte *) otherImage); + } + return 0; +} + +GLint GLAPIENTRY +gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, + GLsizei width, + GLenum format, GLenum type, + GLint userLevel, GLint baseLevel, GLint maxLevel, + const void *data) +{ + int levels; + + int rc= checkMipmapArgs(internalFormat,format,type); + if (rc != 0) return rc; + + if (width < 1) { + return GLU_INVALID_VALUE; + } + + levels = computeLog(width); + + levels+= userLevel; + if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) + return GLU_INVALID_VALUE; + + return gluBuild1DMipmapLevelsCore(target, internalFormat, + width, + width,format, type, + userLevel, baseLevel, maxLevel, + data); +} /* gluBuild1DMipmapLevels() */ + +GLint GLAPIENTRY +gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, + GLenum format, GLenum type, + const void *data) +{ + GLint widthPowerOf2; + int levels; + GLint dummy; + + int rc= checkMipmapArgs(internalFormat,format,type); + if (rc != 0) return rc; + + if (width < 1) { + return GLU_INVALID_VALUE; + } + + closestFit(target,width,1,internalFormat,format,type,&widthPowerOf2,&dummy); + levels = computeLog(widthPowerOf2); + + return gluBuild1DMipmapLevelsCore(target,internalFormat, + width, + widthPowerOf2, + format,type,0,0,levels,data); +} + +static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, + GLint width, GLint height, GLenum format, + GLenum type, const void *data) +{ + GLint newwidth, newheight; + GLint level, levels; + GLushort *newImage; + GLint newImage_width; + GLint newImage_height; + GLushort *otherImage; + GLushort *imageTemp; + GLint memreq; + GLint cmpts; + PixelStorageModes psm; + + retrieveStoreModes(&psm); + +#if 0 + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); + newwidth = nearestPower(width); + if (newwidth > maxsize) newwidth = maxsize; + newheight = nearestPower(height); + if (newheight > maxsize) newheight = maxsize; +#else + closestFit(target,width,height,internalFormat,format,type, + &newwidth,&newheight); +#endif + levels = computeLog(newwidth); + level = computeLog(newheight); + if (level > levels) levels=level; + + otherImage = NULL; + newImage = (GLushort *) + malloc(image_size(width, height, format, GL_UNSIGNED_SHORT)); + newImage_width = width; + newImage_height = height; + if (newImage == NULL) { + return GLU_OUT_OF_MEMORY; + } + + fill_image(&psm,width, height, format, type, is_index(format), + data, newImage); + + cmpts = elements_per_group(format,type); + glPixelStorei(GL_UNPACK_ALIGNMENT, 2); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + /* + ** If swap_bytes was set, swapping occurred in fill_image. + */ + glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); + + for (level = 0; level <= levels; level++) { + if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */ + glTexImage2D(target, level, internalFormat, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_SHORT, + (void *) newImage); + } else { + if (otherImage == NULL) { + memreq = + image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT); + otherImage = (GLushort *) malloc(memreq); + if (otherImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + } + scale_internal(cmpts, newImage_width, newImage_height, newImage, + newwidth, newheight, otherImage); + /* Swap newImage and otherImage */ + imageTemp = otherImage; + otherImage = newImage; + newImage = imageTemp; + + newImage_width = newwidth; + newImage_height = newheight; + glTexImage2D(target, level, internalFormat, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_SHORT, + (void *) newImage); + } + if (newwidth > 1) newwidth /= 2; + if (newheight > 1) newheight /= 2; + } + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + + free((GLbyte *) newImage); + if (otherImage) { + free((GLbyte *) otherImage); + } + return 0; +} + +/* To make swapping images less error prone */ +#define __GLU_INIT_SWAP_IMAGE void *tmpImage +#define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage; + +static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei widthPowerOf2, + GLsizei heightPowerOf2, + GLenum format, GLenum type, + GLint userLevel, + GLint baseLevel,GLint maxLevel, + const void *data) +{ + GLint newwidth, newheight; + GLint level, levels; + const void *usersImage; /* passed from user. Don't touch! */ + void *srcImage, *dstImage; /* scratch area to build mipmapped images */ + __GLU_INIT_SWAP_IMAGE; + GLint memreq; + GLint cmpts; + + GLint myswap_bytes, groups_per_line, element_size, group_size; + GLint rowsize, padding; + PixelStorageModes psm; + + assert(checkMipmapArgs(internalFormat,format,type) == 0); + assert(width >= 1 && height >= 1); + + if(type == GL_BITMAP) { + return bitmapBuild2DMipmaps(target, internalFormat, width, height, + format, type, data); + } + + srcImage = dstImage = NULL; + + newwidth= widthPowerOf2; + newheight= heightPowerOf2; + levels = computeLog(newwidth); + level = computeLog(newheight); + if (level > levels) levels=level; + + levels+= userLevel; + + retrieveStoreModes(&psm); + myswap_bytes = psm.unpack_swap_bytes; + cmpts = elements_per_group(format,type); + if (psm.unpack_row_length > 0) { + groups_per_line = psm.unpack_row_length; + } else { + groups_per_line = width; + } + + element_size = bytes_per_element(type); + group_size = element_size * cmpts; + if (element_size == 1) myswap_bytes = 0; + + rowsize = groups_per_line * group_size; + padding = (rowsize % psm.unpack_alignment); + if (padding) { + rowsize += psm.unpack_alignment - padding; + } + usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize + + psm.unpack_skip_pixels * group_size; + + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + + level = userLevel; + + /* already power-of-two square */ + if (width == newwidth && height == newheight) { + /* Use usersImage for level userLevel */ + if (baseLevel <= level && level <= maxLevel) { + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glTexImage2D(target, level, internalFormat, width, + height, 0, format, type, + usersImage); + } + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + if(levels == 0) { /* we're done. clean up and return */ + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return 0; + } + { + int nextWidth= newwidth/2; + int nextHeight= newheight/2; + + /* clamp to 1 */ + if (nextWidth < 1) nextWidth= 1; + if (nextHeight < 1) nextHeight= 1; + memreq = image_size(nextWidth, nextHeight, format, type); + } + + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memreq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memreq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memreq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memreq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memreq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memreq); + break; + 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: + dstImage = (GLuint *)malloc(memreq); + break; + default: + return GLU_INVALID_ENUM; + } + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + else + switch(type) { + case GL_UNSIGNED_BYTE: + halveImage_ubyte(cmpts, width, height, + (const GLubyte *)usersImage, (GLubyte *)dstImage, + element_size, rowsize, group_size); + break; + case GL_BYTE: + halveImage_byte(cmpts, width, height, + (const GLbyte *)usersImage, (GLbyte *)dstImage, + element_size, rowsize, group_size); + break; + case GL_UNSIGNED_SHORT: + halveImage_ushort(cmpts, width, height, + (const GLushort *)usersImage, (GLushort *)dstImage, + element_size, rowsize, group_size, myswap_bytes); + break; + case GL_SHORT: + halveImage_short(cmpts, width, height, + (const GLshort *)usersImage, (GLshort *)dstImage, + element_size, rowsize, group_size, myswap_bytes); + break; + case GL_UNSIGNED_INT: + halveImage_uint(cmpts, width, height, + (const GLuint *)usersImage, (GLuint *)dstImage, + element_size, rowsize, group_size, myswap_bytes); + break; + case GL_INT: + halveImage_int(cmpts, width, height, + (const GLint *)usersImage, (GLint *)dstImage, + element_size, rowsize, group_size, myswap_bytes); + break; + case GL_FLOAT: + halveImage_float(cmpts, width, height, + (const GLfloat *)usersImage, (GLfloat *)dstImage, + element_size, rowsize, group_size, myswap_bytes); + break; + case GL_UNSIGNED_BYTE_3_3_2: + assert(format == GL_RGB); + halveImagePackedPixel(3,extract332,shove332, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + assert(format == GL_RGB); + halveImagePackedPixel(3,extract233rev,shove233rev, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_6_5: + halveImagePackedPixel(3,extract565,shove565, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + halveImagePackedPixel(3,extract565rev,shove565rev, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + halveImagePackedPixel(4,extract4444,shove4444, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + halveImagePackedPixel(4,extract4444rev,shove4444rev, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + halveImagePackedPixel(4,extract5551,shove5551, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + halveImagePackedPixel(4,extract1555rev,shove1555rev, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_8_8_8_8: + halveImagePackedPixel(4,extract8888,shove8888, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + halveImagePackedPixel(4,extract8888rev,shove8888rev, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_10_10_10_2: + halveImagePackedPixel(4,extract1010102,shove1010102, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + halveImagePackedPixel(4,extract2101010rev,shove2101010rev, + width,height,usersImage,dstImage, + element_size,rowsize,myswap_bytes); + break; + default: + assert(0); + break; + } + newwidth = width/2; + newheight = height/2; + /* clamp to 1 */ + if (newwidth < 1) newwidth= 1; + if (newheight < 1) newheight= 1; + + myswap_bytes = 0; + rowsize = newwidth * group_size; + memreq = image_size(newwidth, newheight, format, type); + /* Swap srcImage and dstImage */ + __GLU_SWAP_IMAGE(srcImage,dstImage); + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memreq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memreq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memreq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memreq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memreq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memreq); + break; + 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: + dstImage = (GLuint *)malloc(memreq); + break; + default: + return GLU_INVALID_ENUM; + } + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + /* level userLevel+1 is in srcImage; level userLevel already saved */ + level = userLevel+1; + } else { /* user's image is *not* nice power-of-2 sized square */ + memreq = image_size(newwidth, newheight, format, type); + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memreq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memreq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memreq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memreq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memreq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memreq); + break; + 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: + dstImage = (GLuint *)malloc(memreq); + break; + default: + return GLU_INVALID_ENUM; + } + + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + + switch(type) { + case GL_UNSIGNED_BYTE: + scale_internal_ubyte(cmpts, width, height, + (const GLubyte *)usersImage, newwidth, newheight, + (GLubyte *)dstImage, element_size, + rowsize, group_size); + break; + case GL_BYTE: + scale_internal_byte(cmpts, width, height, + (const GLbyte *)usersImage, newwidth, newheight, + (GLbyte *)dstImage, element_size, + rowsize, group_size); + break; + case GL_UNSIGNED_SHORT: + scale_internal_ushort(cmpts, width, height, + (const GLushort *)usersImage, newwidth, newheight, + (GLushort *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_SHORT: + scale_internal_short(cmpts, width, height, + (const GLshort *)usersImage, newwidth, newheight, + (GLshort *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_UNSIGNED_INT: + scale_internal_uint(cmpts, width, height, + (const GLuint *)usersImage, newwidth, newheight, + (GLuint *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_INT: + scale_internal_int(cmpts, width, height, + (const GLint *)usersImage, newwidth, newheight, + (GLint *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_FLOAT: + scale_internal_float(cmpts, width, height, + (const GLfloat *)usersImage, newwidth, newheight, + (GLfloat *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_UNSIGNED_BYTE_3_3_2: + scaleInternalPackedPixel(3,extract332,shove332, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + scaleInternalPackedPixel(3,extract233rev,shove233rev, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_6_5: + scaleInternalPackedPixel(3,extract565,shove565, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + scaleInternalPackedPixel(3,extract565rev,shove565rev, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + scaleInternalPackedPixel(4,extract4444,shove4444, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + scaleInternalPackedPixel(4,extract4444rev,shove4444rev, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + scaleInternalPackedPixel(4,extract5551,shove5551, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + scaleInternalPackedPixel(4,extract1555rev,shove1555rev, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_8_8_8_8: + scaleInternalPackedPixel(4,extract8888,shove8888, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + scaleInternalPackedPixel(4,extract8888rev,shove8888rev, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_10_10_10_2: + scaleInternalPackedPixel(4,extract1010102,shove1010102, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + scaleInternalPackedPixel(4,extract2101010rev,shove2101010rev, + width, height,usersImage, + newwidth,newheight,(void *)dstImage, + element_size,rowsize,myswap_bytes); + break; + default: + assert(0); + break; + } + myswap_bytes = 0; + rowsize = newwidth * group_size; + /* Swap dstImage and srcImage */ + __GLU_SWAP_IMAGE(srcImage,dstImage); + + if(levels != 0) { /* use as little memory as possible */ + { + int nextWidth= newwidth/2; + int nextHeight= newheight/2; + if (nextWidth < 1) nextWidth= 1; + if (nextHeight < 1) nextHeight= 1; + + memreq = image_size(nextWidth, nextHeight, format, type); + } + + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memreq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memreq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memreq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memreq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memreq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memreq); + break; + 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: + dstImage = (GLuint *)malloc(memreq); + break; + default: + return GLU_INVALID_ENUM; + } + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + } + /* level userLevel is in srcImage; nothing saved yet */ + level = userLevel; + } + + glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); + if (baseLevel <= level && level <= maxLevel) { + glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, + format, type, (void *)srcImage); + } + + level++; /* update current level for the loop */ + for (; level <= levels; level++) { + switch(type) { + case GL_UNSIGNED_BYTE: + halveImage_ubyte(cmpts, newwidth, newheight, + (GLubyte *)srcImage, (GLubyte *)dstImage, element_size, + rowsize, group_size); + break; + case GL_BYTE: + halveImage_byte(cmpts, newwidth, newheight, + (GLbyte *)srcImage, (GLbyte *)dstImage, element_size, + rowsize, group_size); + break; + case GL_UNSIGNED_SHORT: + halveImage_ushort(cmpts, newwidth, newheight, + (GLushort *)srcImage, (GLushort *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_SHORT: + halveImage_short(cmpts, newwidth, newheight, + (GLshort *)srcImage, (GLshort *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_UNSIGNED_INT: + halveImage_uint(cmpts, newwidth, newheight, + (GLuint *)srcImage, (GLuint *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_INT: + halveImage_int(cmpts, newwidth, newheight, + (GLint *)srcImage, (GLint *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_FLOAT: + halveImage_float(cmpts, newwidth, newheight, + (GLfloat *)srcImage, (GLfloat *)dstImage, element_size, + rowsize, group_size, myswap_bytes); + break; + case GL_UNSIGNED_BYTE_3_3_2: + halveImagePackedPixel(3,extract332,shove332, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + halveImagePackedPixel(3,extract233rev,shove233rev, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_6_5: + halveImagePackedPixel(3,extract565,shove565, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + halveImagePackedPixel(3,extract565rev,shove565rev, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + halveImagePackedPixel(4,extract4444,shove4444, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + halveImagePackedPixel(4,extract4444rev,shove4444rev, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + halveImagePackedPixel(4,extract5551,shove5551, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + halveImagePackedPixel(4,extract1555rev,shove1555rev, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_INT_8_8_8_8: + halveImagePackedPixel(4,extract8888,shove8888, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + halveImagePackedPixel(4,extract8888rev,shove8888rev, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_INT_10_10_10_2: + halveImagePackedPixel(4,extract1010102,shove1010102, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + halveImagePackedPixel(4,extract2101010rev,shove2101010rev, + newwidth,newheight, + srcImage,dstImage,element_size,rowsize, + myswap_bytes); + break; + default: + assert(0); + break; + } + + __GLU_SWAP_IMAGE(srcImage,dstImage); + + if (newwidth > 1) { newwidth /= 2; rowsize /= 2;} + if (newheight > 1) newheight /= 2; + { + /* compute amount to pad per row, if any */ + int rowPad= rowsize % psm.unpack_alignment; + + /* should row be padded? */ + if (rowPad == 0) { /* nope, row should not be padded */ + /* call tex image with srcImage untouched since it's not padded */ + if (baseLevel <= level && level <= maxLevel) { + glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, + format, type, (void *) srcImage); + } + } + else { /* yes, row should be padded */ + /* compute length of new row in bytes, including padding */ + int newRowLength= rowsize + psm.unpack_alignment - rowPad; + int ii; unsigned char *dstTrav, *srcTrav; /* indices for copying */ + + /* allocate new image for mipmap of size newRowLength x newheight */ + void *newMipmapImage= malloc((size_t) (newRowLength*newheight)); + if (newMipmapImage == NULL) { + /* out of memory so return */ + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + + /* copy image from srcImage into newMipmapImage by rows */ + for (ii= 0, + dstTrav= (unsigned char *) newMipmapImage, + srcTrav= (unsigned char *) srcImage; + ii< newheight; + ii++, + dstTrav+= newRowLength, /* make sure the correct distance... */ + srcTrav+= rowsize) { /* ...is skipped */ + memcpy(dstTrav,srcTrav,rowsize); + /* note that the pad bytes are not visited and will contain + * garbage, which is ok. + */ + } + + /* ...and use this new image for mipmapping instead */ + if (baseLevel <= level && level <= maxLevel) { + glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, + format, type, newMipmapImage); + } + free(newMipmapImage); /* don't forget to free it! */ + } /* else */ + } + } /* for level */ + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + + free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/ + if (dstImage) { /* if it's non-rectangular and only 1 level */ + free(dstImage); + } + return 0; +} /* gluBuild2DMipmapLevelsCore() */ + +GLint GLAPIENTRY +gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLint userLevel, GLint baseLevel, GLint maxLevel, + const void *data) +{ + int level, levels; + + int rc= checkMipmapArgs(internalFormat,format,type); + if (rc != 0) return rc; + + if (width < 1 || height < 1) { + return GLU_INVALID_VALUE; + } + + levels = computeLog(width); + level = computeLog(height); + if (level > levels) levels=level; + + levels+= userLevel; + if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) + return GLU_INVALID_VALUE; + + return gluBuild2DMipmapLevelsCore(target, internalFormat, + width, height, + width, height, + format, type, + userLevel, baseLevel, maxLevel, + data); +} /* gluBuild2DMipmapLevels() */ + +GLint GLAPIENTRY +gluBuild2DMipmaps(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const void *data) +{ + GLint widthPowerOf2, heightPowerOf2; + int level, levels; + + int rc= checkMipmapArgs(internalFormat,format,type); + if (rc != 0) return rc; + + if (width < 1 || height < 1) { + return GLU_INVALID_VALUE; + } + + closestFit(target,width,height,internalFormat,format,type, + &widthPowerOf2,&heightPowerOf2); + + levels = computeLog(widthPowerOf2); + level = computeLog(heightPowerOf2); + if (level > levels) levels=level; + + return gluBuild2DMipmapLevelsCore(target,internalFormat, + width, height, + widthPowerOf2,heightPowerOf2, + format,type, + 0,0,levels,data); +} /* gluBuild2DMipmaps() */ + +#if 0 +/* +** This routine is for the limited case in which +** type == GL_UNSIGNED_BYTE && format != index && +** unpack_alignment = 1 && unpack_swap_bytes == false +** +** so all of the work data can be kept as ubytes instead of shorts. +*/ +static int fastBuild2DMipmaps(const PixelStorageModes *psm, + GLenum target, GLint components, GLint width, + GLint height, GLenum format, + GLenum type, void *data) +{ + GLint newwidth, newheight; + GLint level, levels; + GLubyte *newImage; + GLint newImage_width; + GLint newImage_height; + GLubyte *otherImage; + GLubyte *imageTemp; + GLint memreq; + GLint cmpts; + + +#if 0 + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); + newwidth = nearestPower(width); + if (newwidth > maxsize) newwidth = maxsize; + newheight = nearestPower(height); + if (newheight > maxsize) newheight = maxsize; +#else + closestFit(target,width,height,components,format,type, + &newwidth,&newheight); +#endif + levels = computeLog(newwidth); + level = computeLog(newheight); + if (level > levels) levels=level; + + cmpts = elements_per_group(format,type); + + otherImage = NULL; + /** + ** No need to copy the user data if its in the packed correctly. + ** Make sure that later routines don't change that data. + */ + if (psm->unpack_skip_rows == 0 && psm->unpack_skip_pixels == 0) { + newImage = (GLubyte *)data; + newImage_width = width; + newImage_height = height; + } else { + GLint rowsize; + GLint groups_per_line; + GLint elements_per_line; + const GLubyte *start; + const GLubyte *iter; + GLubyte *iter2; + GLint i, j; + + newImage = (GLubyte *) + malloc(image_size(width, height, format, GL_UNSIGNED_BYTE)); + newImage_width = width; + newImage_height = height; + if (newImage == NULL) { + return GLU_OUT_OF_MEMORY; + } + + /* + ** Abbreviated version of fill_image for this restricted case. + */ + if (psm->unpack_row_length > 0) { + groups_per_line = psm->unpack_row_length; + } else { + groups_per_line = width; + } + rowsize = groups_per_line * cmpts; + elements_per_line = width * cmpts; + start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize + + psm->unpack_skip_pixels * cmpts; + iter2 = newImage; + + for (i = 0; i < height; i++) { + iter = start; + for (j = 0; j < elements_per_line; j++) { + *iter2 = *iter; + iter++; + iter2++; + } + start += rowsize; + } + } + + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); + + for (level = 0; level <= levels; level++) { + if (newImage_width == newwidth && newImage_height == newheight) { + /* Use newImage for this level */ + glTexImage2D(target, level, components, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_BYTE, + (void *) newImage); + } else { + if (otherImage == NULL) { + memreq = + image_size(newwidth, newheight, format, GL_UNSIGNED_BYTE); + otherImage = (GLubyte *) malloc(memreq); + if (otherImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH,psm->unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES,psm->unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + } +/* + scale_internal_ubyte(cmpts, newImage_width, newImage_height, + newImage, newwidth, newheight, otherImage); +*/ + /* Swap newImage and otherImage */ + imageTemp = otherImage; + otherImage = newImage; + newImage = imageTemp; + + newImage_width = newwidth; + newImage_height = newheight; + glTexImage2D(target, level, components, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_BYTE, + (void *) newImage); + } + if (newwidth > 1) newwidth /= 2; + if (newheight > 1) newheight /= 2; + } + glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm->unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm->unpack_swap_bytes); + + if (newImage != (const GLubyte *)data) { + free((GLbyte *) newImage); + } + if (otherImage && otherImage != (const GLubyte *)data) { + free((GLbyte *) otherImage); + } + return 0; +} +#endif + +/* + * Utility Routines + */ +static GLint elements_per_group(GLenum format, GLenum type) +{ + /* + * Return the number of elements per group of a specified format + */ + + /* If the type is packedpixels then answer is 1 (ignore format) */ + if (type == GL_UNSIGNED_BYTE_3_3_2 || + type == GL_UNSIGNED_BYTE_2_3_3_REV || + type == GL_UNSIGNED_SHORT_5_6_5 || + type == GL_UNSIGNED_SHORT_5_6_5_REV || + type == GL_UNSIGNED_SHORT_4_4_4_4 || + type == GL_UNSIGNED_SHORT_4_4_4_4_REV || + type == GL_UNSIGNED_SHORT_5_5_5_1 || + type == GL_UNSIGNED_SHORT_1_5_5_5_REV || + type == GL_UNSIGNED_INT_8_8_8_8 || + type == GL_UNSIGNED_INT_8_8_8_8_REV || + type == GL_UNSIGNED_INT_10_10_10_2 || + type == GL_UNSIGNED_INT_2_10_10_10_REV) { + return 1; + } + + /* Types are not packed pixels, so get elements per group */ + switch(format) { + case GL_RGB: + case GL_BGR: + return 3; + case GL_LUMINANCE_ALPHA: + return 2; + case GL_RGBA: + case GL_BGRA: + return 4; + default: + return 1; + } +} + +static GLfloat bytes_per_element(GLenum type) +{ + /* + * Return the number of bytes per element, based on the element type + */ + switch(type) { + case GL_BITMAP: + return 1.0 / 8.0; + case GL_UNSIGNED_SHORT: + return(sizeof(GLushort)); + case GL_SHORT: + return(sizeof(GLshort)); + case GL_UNSIGNED_BYTE: + return(sizeof(GLubyte)); + case GL_BYTE: + return(sizeof(GLbyte)); + case GL_INT: + return(sizeof(GLint)); + case GL_UNSIGNED_INT: + return(sizeof(GLuint)); + case GL_FLOAT: + return(sizeof(GLfloat)); + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + return(sizeof(GLubyte)); + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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(sizeof(GLushort)); + 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(sizeof(GLuint)); + default: + return 4; + } +} + +static GLint is_index(GLenum format) +{ + return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX; +} + +/* +** Compute memory required for internal packed array of data of given type +** and format. +*/ +static GLint image_size(GLint width, GLint height, GLenum format, GLenum type) +{ + int bytes_per_row; + int components; + +assert(width > 0); +assert(height > 0); + components = elements_per_group(format,type); + if (type == GL_BITMAP) { + bytes_per_row = (width + 7) / 8; + } else { + bytes_per_row = bytes_per_element(type) * width; + } + return bytes_per_row * height * components; +} + +/* +** Extract array from user's data applying all pixel store modes. +** The internal format used is an array of unsigned shorts. +*/ +static void fill_image(const PixelStorageModes *psm, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, + const void *userdata, GLushort *newimage) +{ + GLint components; + GLint element_size; + GLint rowsize; + GLint padding; + GLint groups_per_line; + GLint group_size; + GLint elements_per_line; + const GLubyte *start; + const GLubyte *iter; + GLushort *iter2; + GLint i, j, k; + GLint myswap_bytes; + + myswap_bytes = psm->unpack_swap_bytes; + components = elements_per_group(format,type); + if (psm->unpack_row_length > 0) { + groups_per_line = psm->unpack_row_length; + } else { + groups_per_line = width; + } + + /* All formats except GL_BITMAP fall out trivially */ + if (type == GL_BITMAP) { + GLint bit_offset; + GLint current_bit; + + rowsize = (groups_per_line * components + 7) / 8; + padding = (rowsize % psm->unpack_alignment); + if (padding) { + rowsize += psm->unpack_alignment - padding; + } + start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + + (psm->unpack_skip_pixels * components / 8); + elements_per_line = width * components; + iter2 = newimage; + for (i = 0; i < height; i++) { + iter = start; + bit_offset = (psm->unpack_skip_pixels * components) % 8; + for (j = 0; j < elements_per_line; j++) { + /* Retrieve bit */ + if (psm->unpack_lsb_first) { + current_bit = iter[0] & (1 << bit_offset); + } else { + current_bit = iter[0] & (1 << (7 - bit_offset)); + } + if (current_bit) { + if (index_format) { + *iter2 = 1; + } else { + *iter2 = 65535; + } + } else { + *iter2 = 0; + } + bit_offset++; + if (bit_offset == 8) { + bit_offset = 0; + iter++; + } + iter2++; + } + start += rowsize; + } + } else { + element_size = bytes_per_element(type); + group_size = element_size * components; + if (element_size == 1) myswap_bytes = 0; + + rowsize = groups_per_line * group_size; + padding = (rowsize % psm->unpack_alignment); + if (padding) { + rowsize += psm->unpack_alignment - padding; + } + start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + + psm->unpack_skip_pixels * group_size; + elements_per_line = width * components; + + iter2 = newimage; + for (i = 0; i < height; i++) { + iter = start; + for (j = 0; j < elements_per_line; j++) { + Type_Widget widget; + float extractComponents[4]; + + switch(type) { + case GL_UNSIGNED_BYTE_3_3_2: + extract332(0,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + extract233rev(0,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_BYTE: + if (index_format) { + *iter2++ = *iter; + } else { + *iter2++ = (*iter) * 257; + } + break; + case GL_BYTE: + if (index_format) { + *iter2++ = *((const GLbyte *) iter); + } else { + /* rough approx */ + *iter2++ = (*((const GLbyte *) iter)) * 516; + } + break; + case GL_UNSIGNED_SHORT_5_6_5: + extract565(myswap_bytes,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + extract565rev(myswap_bytes,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + extract4444(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + extract4444rev(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + extract5551(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + extract1555rev(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT: + case GL_SHORT: + if (myswap_bytes) { + widget.ub[0] = iter[1]; + widget.ub[1] = iter[0]; + } else { + widget.ub[0] = iter[0]; + widget.ub[1] = iter[1]; + } + if (type == GL_SHORT) { + if (index_format) { + *iter2++ = widget.s[0]; + } else { + /* rough approx */ + *iter2++ = widget.s[0]*2; + } + } else { + *iter2++ = widget.us[0]; + } + break; + case GL_UNSIGNED_INT_8_8_8_8: + extract8888(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + extract8888rev(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_INT_10_10_10_2: + extract1010102(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + extract2101010rev(myswap_bytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + if (myswap_bytes) { + widget.ub[0] = iter[3]; + widget.ub[1] = iter[2]; + widget.ub[2] = iter[1]; + widget.ub[3] = iter[0]; + } else { + widget.ub[0] = iter[0]; + widget.ub[1] = iter[1]; + widget.ub[2] = iter[2]; + widget.ub[3] = iter[3]; + } + if (type == GL_FLOAT) { + if (index_format) { + *iter2++ = widget.f; + } else { + *iter2++ = 65535 * widget.f; + } + } else if (type == GL_UNSIGNED_INT) { + if (index_format) { + *iter2++ = widget.ui; + } else { + *iter2++ = widget.ui >> 16; + } + } else { + if (index_format) { + *iter2++ = widget.i; + } else { + *iter2++ = widget.i >> 15; + } + } + break; + } + iter += element_size; + } /* for j */ + start += rowsize; +#if 1 + /* want 'iter' pointing at start, not within, row for assertion + * purposes + */ + iter= start; +#endif + } /* for i */ + + /* iterators should be one byte past end */ + if (!isTypePackedPixel(type)) { + assert(iter2 == &newimage[width*height*components]); + } + else { + assert(iter2 == &newimage[width*height* + elements_per_group(format,0)]); + } + assert( iter == &((const GLubyte *)userdata)[rowsize*height + + psm->unpack_skip_rows * rowsize + + psm->unpack_skip_pixels * group_size] ); + + } /* else */ +} /* fill_image() */ + +/* +** Insert array into user's data applying all pixel store modes. +** The internal format is an array of unsigned shorts. +** empty_image() because it is the opposite of fill_image(). +*/ +static void empty_image(const PixelStorageModes *psm, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, + const GLushort *oldimage, void *userdata) +{ + GLint components; + GLint element_size; + GLint rowsize; + GLint padding; + GLint groups_per_line; + GLint group_size; + GLint elements_per_line; + GLubyte *start; + GLubyte *iter; + const GLushort *iter2; + GLint i, j, k; + GLint myswap_bytes; + + myswap_bytes = psm->pack_swap_bytes; + components = elements_per_group(format,type); + if (psm->pack_row_length > 0) { + groups_per_line = psm->pack_row_length; + } else { + groups_per_line = width; + } + + /* All formats except GL_BITMAP fall out trivially */ + if (type == GL_BITMAP) { + GLint bit_offset; + GLint current_bit; + + rowsize = (groups_per_line * components + 7) / 8; + padding = (rowsize % psm->pack_alignment); + if (padding) { + rowsize += psm->pack_alignment - padding; + } + start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + + (psm->pack_skip_pixels * components / 8); + elements_per_line = width * components; + iter2 = oldimage; + for (i = 0; i < height; i++) { + iter = start; + bit_offset = (psm->pack_skip_pixels * components) % 8; + for (j = 0; j < elements_per_line; j++) { + if (index_format) { + current_bit = iter2[0] & 1; + } else { + if (iter2[0] > 32767) { + current_bit = 1; + } else { + current_bit = 0; + } + } + + if (current_bit) { + if (psm->pack_lsb_first) { + *iter |= (1 << bit_offset); + } else { + *iter |= (1 << (7 - bit_offset)); + } + } else { + if (psm->pack_lsb_first) { + *iter &= ~(1 << bit_offset); + } else { + *iter &= ~(1 << (7 - bit_offset)); + } + } + + bit_offset++; + if (bit_offset == 8) { + bit_offset = 0; + iter++; + } + iter2++; + } + start += rowsize; + } + } else { + float shoveComponents[4]; + + element_size = bytes_per_element(type); + group_size = element_size * components; + if (element_size == 1) myswap_bytes = 0; + + rowsize = groups_per_line * group_size; + padding = (rowsize % psm->pack_alignment); + if (padding) { + rowsize += psm->pack_alignment - padding; + } + start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + + psm->pack_skip_pixels * group_size; + elements_per_line = width * components; + + iter2 = oldimage; + for (i = 0; i < height; i++) { + iter = start; + for (j = 0; j < elements_per_line; j++) { + Type_Widget widget; + + switch(type) { + case GL_UNSIGNED_BYTE_3_3_2: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove332(shoveComponents,0,(void *)iter); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove233rev(shoveComponents,0,(void *)iter); + break; + case GL_UNSIGNED_BYTE: + if (index_format) { + *iter = *iter2++; + } else { + *iter = *iter2++ >> 8; + } + break; + case GL_BYTE: + if (index_format) { + *((GLbyte *) iter) = *iter2++; + } else { + *((GLbyte *) iter) = *iter2++ >> 9; + } + break; + case GL_UNSIGNED_SHORT_5_6_5: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove565(shoveComponents,0,(void *)&widget.us[0]); + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } + else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove565rev(shoveComponents,0,(void *)&widget.us[0]); + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } + else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove4444(shoveComponents,0,(void *)&widget.us[0]); + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove4444rev(shoveComponents,0,(void *)&widget.us[0]); + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove5551(shoveComponents,0,(void *)&widget.us[0]); + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove1555rev(shoveComponents,0,(void *)&widget.us[0]); + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT: + case GL_SHORT: + if (type == GL_SHORT) { + if (index_format) { + widget.s[0] = *iter2++; + } else { + widget.s[0] = *iter2++ >> 1; + } + } else { + widget.us[0] = *iter2++; + } + if (myswap_bytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + iter[0] = widget.ub[0]; + iter[1] = widget.ub[1]; + } + break; + case GL_UNSIGNED_INT_8_8_8_8: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove8888(shoveComponents,0,(void *)&widget.ui); + if (myswap_bytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove8888rev(shoveComponents,0,(void *)&widget.ui); + if (myswap_bytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_UNSIGNED_INT_10_10_10_2: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove1010102(shoveComponents,0,(void *)&widget.ui); + if (myswap_bytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove2101010rev(shoveComponents,0,(void *)&widget.ui); + if (myswap_bytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + if (type == GL_FLOAT) { + if (index_format) { + widget.f = *iter2++; + } else { + widget.f = *iter2++ / (float) 65535.0; + } + } else if (type == GL_UNSIGNED_INT) { + if (index_format) { + widget.ui = *iter2++; + } else { + widget.ui = (unsigned int) *iter2++ * 65537; + } + } else { + if (index_format) { + widget.i = *iter2++; + } else { + widget.i = ((unsigned int) *iter2++ * 65537)/2; + } + } + if (myswap_bytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + iter[0] = widget.ub[0]; + iter[1] = widget.ub[1]; + iter[2] = widget.ub[2]; + iter[3] = widget.ub[3]; + } + break; + } + iter += element_size; + } /* for j */ + start += rowsize; +#if 1 + /* want 'iter' pointing at start, not within, row for assertion + * purposes + */ + iter= start; +#endif + } /* for i */ + + /* iterators should be one byte past end */ + if (!isTypePackedPixel(type)) { + assert(iter2 == &oldimage[width*height*components]); + } + else { + assert(iter2 == &oldimage[width*height* + elements_per_group(format,0)]); + } + assert( iter == &((GLubyte *)userdata)[rowsize*height + + psm->pack_skip_rows * rowsize + + psm->pack_skip_pixels * group_size] ); + + } /* else */ +} /* empty_image() */ + +/*-------------------------------------------------------------------------- + * Decimation of packed pixel types + *-------------------------------------------------------------------------- + */ +static void extract332(int isSwap, + const void *packedPixel, GLfloat extractComponents[]) +{ + GLubyte ubyte= *(const GLubyte *)packedPixel; + + isSwap= isSwap; /* turn off warnings */ + + /* 11100000 == 0xe0 */ + /* 00011100 == 0x1c */ + /* 00000011 == 0x03 */ + + extractComponents[0]= (float)((ubyte & 0xe0) >> 5) / 7.0; + extractComponents[1]= (float)((ubyte & 0x1c) >> 2) / 7.0; /* 7 = 2^3-1 */ + extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */ +} /* extract332() */ + +static void shove332(const GLfloat shoveComponents[], + int index, void *packedPixel) +{ + /* 11100000 == 0xe0 */ + /* 00011100 == 0x1c */ + /* 00000011 == 0x03 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLubyte *)packedPixel)[index] = + ((GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0; + ((GLubyte *)packedPixel)[index] |= + ((GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c; + ((GLubyte *)packedPixel)[index] |= + ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03; +} /* shove332() */ + +static void extract233rev(int isSwap, + const void *packedPixel, GLfloat extractComponents[]) +{ + GLubyte ubyte= *(const GLubyte *)packedPixel; + + isSwap= isSwap; /* turn off warnings */ + + /* 0000,0111 == 0x07 */ + /* 0011,1000 == 0x38 */ + /* 1100,0000 == 0xC0 */ + + extractComponents[0]= (float)((ubyte & 0x07) ) / 7.0; + extractComponents[1]= (float)((ubyte & 0x38) >> 3) / 7.0; + extractComponents[2]= (float)((ubyte & 0xC0) >> 6) / 3.0; +} /* extract233rev() */ + +static void shove233rev(const GLfloat shoveComponents[], + int index, void *packedPixel) +{ + /* 0000,0111 == 0x07 */ + /* 0011,1000 == 0x38 */ + /* 1100,0000 == 0xC0 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLubyte *)packedPixel)[index] = + ((GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07; + ((GLubyte *)packedPixel)[index]|= + ((GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38; + ((GLubyte *)packedPixel)[index]|= + ((GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0; +} /* shove233rev() */ + +static void extract565(int isSwap, + const void *packedPixel, GLfloat extractComponents[]) +{ + GLushort ushort= *(const GLushort *)packedPixel; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(packedPixel); + } + else { + ushort= *(const GLushort *)packedPixel; + } + + /* 11111000,00000000 == 0xf800 */ + /* 00000111,11100000 == 0x07e0 */ + /* 00000000,00011111 == 0x001f */ + + extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/ + extractComponents[1]=(float)((ushort & 0x07e0) >> 5) / 63.0;/* 63 = 2^6-1*/ + extractComponents[2]=(float)((ushort & 0x001f) ) / 31.0; +} /* extract565() */ + +static void shove565(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 11111000,00000000 == 0xf800 */ + /* 00000111,11100000 == 0x07e0 */ + /* 00000000,00011111 == 0x001f */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLushort *)packedPixel)[index] = + ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f; +} /* shove565() */ + +static void extract565rev(int isSwap, + const void *packedPixel, GLfloat extractComponents[]) +{ + GLushort ushort= *(const GLushort *)packedPixel; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(packedPixel); + } + else { + ushort= *(const GLushort *)packedPixel; + } + + /* 00000000,00011111 == 0x001f */ + /* 00000111,11100000 == 0x07e0 */ + /* 11111000,00000000 == 0xf800 */ + + extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; + extractComponents[1]= (float)((ushort & 0x07E0) >> 5) / 63.0; + extractComponents[2]= (float)((ushort & 0xF800) >> 11) / 31.0; +} /* extract565rev() */ + +static void shove565rev(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 00000000,00011111 == 0x001f */ + /* 00000111,11100000 == 0x07e0 */ + /* 11111000,00000000 == 0xf800 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLushort *)packedPixel)[index] = + ((GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800; +} /* shove565rev() */ + +static void extract4444(int isSwap,const void *packedPixel, + GLfloat extractComponents[]) +{ + GLushort ushort; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(packedPixel); + } + else { + ushort= *(const GLushort *)packedPixel; + } + + /* 11110000,00000000 == 0xf000 */ + /* 00001111,00000000 == 0x0f00 */ + /* 00000000,11110000 == 0x00f0 */ + /* 00000000,00001111 == 0x000f */ + + extractComponents[0]= (float)((ushort & 0xf000) >> 12) / 15.0;/* 15=2^4-1 */ + extractComponents[1]= (float)((ushort & 0x0f00) >> 8) / 15.0; + extractComponents[2]= (float)((ushort & 0x00f0) >> 4) / 15.0; + extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0; +} /* extract4444() */ + +static void shove4444(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLushort *)packedPixel)[index] = + ((GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f; +} /* shove4444() */ + +static void extract4444rev(int isSwap,const void *packedPixel, + GLfloat extractComponents[]) +{ + GLushort ushort; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(packedPixel); + } + else { + ushort= *(const GLushort *)packedPixel; + } + + /* 00000000,00001111 == 0x000f */ + /* 00000000,11110000 == 0x00f0 */ + /* 00001111,00000000 == 0x0f00 */ + /* 11110000,00000000 == 0xf000 */ + + /* 15 = 2^4-1 */ + extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0; + extractComponents[1]= (float)((ushort & 0x00F0) >> 4) / 15.0; + extractComponents[2]= (float)((ushort & 0x0F00) >> 8) / 15.0; + extractComponents[3]= (float)((ushort & 0xF000) >> 12) / 15.0; +} /* extract4444rev() */ + +static void shove4444rev(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 00000000,00001111 == 0x000f */ + /* 00000000,11110000 == 0x00f0 */ + /* 00001111,00000000 == 0x0f00 */ + /* 11110000,00000000 == 0xf000 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLushort *)packedPixel)[index] = + ((GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000; +} /* shove4444rev() */ + +static void extract5551(int isSwap,const void *packedPixel, + GLfloat extractComponents[]) +{ + GLushort ushort; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(packedPixel); + } + else { + ushort= *(const GLushort *)packedPixel; + } + + /* 11111000,00000000 == 0xf800 */ + /* 00000111,11000000 == 0x07c0 */ + /* 00000000,00111110 == 0x003e */ + /* 00000000,00000001 == 0x0001 */ + + extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/ + extractComponents[1]=(float)((ushort & 0x07c0) >> 6) / 31.0; + extractComponents[2]=(float)((ushort & 0x003e) >> 1) / 31.0; + extractComponents[3]=(float)((ushort & 0x0001) ); +} /* extract5551() */ + +static void shove5551(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 11111000,00000000 == 0xf800 */ + /* 00000111,11000000 == 0x07c0 */ + /* 00000000,00111110 == 0x003e */ + /* 00000000,00000001 == 0x0001 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLushort *)packedPixel)[index] = + ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001; +} /* shove5551() */ + +static void extract1555rev(int isSwap,const void *packedPixel, + GLfloat extractComponents[]) +{ + GLushort ushort; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(packedPixel); + } + else { + ushort= *(const GLushort *)packedPixel; + } + + /* 00000000,00011111 == 0x001F */ + /* 00000011,11100000 == 0x03E0 */ + /* 01111100,00000000 == 0x7C00 */ + /* 10000000,00000000 == 0x8000 */ + + /* 31 = 2^5-1 */ + extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; + extractComponents[1]= (float)((ushort & 0x03E0) >> 5) / 31.0; + extractComponents[2]= (float)((ushort & 0x7C00) >> 10) / 31.0; + extractComponents[3]= (float)((ushort & 0x8000) >> 15); +} /* extract1555rev() */ + +static void shove1555rev(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 00000000,00011111 == 0x001F */ + /* 00000011,11100000 == 0x03E0 */ + /* 01111100,00000000 == 0x7C00 */ + /* 10000000,00000000 == 0x8000 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLushort *)packedPixel)[index] = + ((GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000; +} /* shove1555rev() */ + +static void extract8888(int isSwap, + const void *packedPixel, GLfloat extractComponents[]) +{ + GLuint uint; + + if (isSwap) { + uint= __GLU_SWAP_4_BYTES(packedPixel); + } + else { + uint= *(const GLuint *)packedPixel; + } + + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + + /* 255 = 2^8-1 */ + extractComponents[0]= (float)((uint & 0xff000000) >> 24) / 255.0; + extractComponents[1]= (float)((uint & 0x00ff0000) >> 16) / 255.0; + extractComponents[2]= (float)((uint & 0x0000ff00) >> 8) / 255.0; + extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0; +} /* extract8888() */ + +static void shove8888(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLuint *)packedPixel)[index] = + ((GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff; +} /* shove8888() */ + +static void extract8888rev(int isSwap, + const void *packedPixel,GLfloat extractComponents[]) +{ + GLuint uint; + + if (isSwap) { + uint= __GLU_SWAP_4_BYTES(packedPixel); + } + else { + uint= *(const GLuint *)packedPixel; + } + + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + + /* 255 = 2^8-1 */ + extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0; + extractComponents[1]= (float)((uint & 0x0000FF00) >> 8) / 255.0; + extractComponents[2]= (float)((uint & 0x00FF0000) >> 16) / 255.0; + extractComponents[3]= (float)((uint & 0xFF000000) >> 24) / 255.0; +} /* extract8888rev() */ + +static void shove8888rev(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLuint *)packedPixel)[index] = + ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000; +} /* shove8888rev() */ + +static void extract1010102(int isSwap, + const void *packedPixel,GLfloat extractComponents[]) +{ + GLuint uint; + + if (isSwap) { + uint= __GLU_SWAP_4_BYTES(packedPixel); + } + else { + uint= *(const GLuint *)packedPixel; + } + + /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ + /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ + /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ + /* 00000000,00000000,00000000,00000011 == 0x00000003 */ + + /* 1023 = 2^10-1 */ + extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0; + extractComponents[1]= (float)((uint & 0x003ff000) >> 12) / 1023.0; + extractComponents[2]= (float)((uint & 0x00000ffc) >> 2) / 1023.0; + extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0; +} /* extract1010102() */ + +static void shove1010102(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ + /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ + /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ + /* 00000000,00000000,00000000,00000011 == 0x00000003 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLuint *)packedPixel)[index] = + ((GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003; +} /* shove1010102() */ + +static void extract2101010rev(int isSwap, + const void *packedPixel, + GLfloat extractComponents[]) +{ + GLuint uint; + + if (isSwap) { + uint= __GLU_SWAP_4_BYTES(packedPixel); + } + else { + uint= *(const GLuint *)packedPixel; + } + + /* 00000000,00000000,00000011,11111111 == 0x000003FF */ + /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ + /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ + /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ + + /* 1023 = 2^10-1 */ + extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0; + extractComponents[1]= (float)((uint & 0x000FFC00) >> 10) / 1023.0; + extractComponents[2]= (float)((uint & 0x3FF00000) >> 20) / 1023.0; + extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0; + /* 3 = 2^2-1 */ +} /* extract2101010rev() */ + +static void shove2101010rev(const GLfloat shoveComponents[], + int index,void *packedPixel) +{ + /* 00000000,00000000,00000011,11111111 == 0x000003FF */ + /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ + /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ + /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ + + assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); + assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); + assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); + assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); + + /* due to limited precision, need to round before shoving */ + ((GLuint *)packedPixel)[index] = + ((GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000; +} /* shove2101010rev() */ + +static void scaleInternalPackedPixel(int components, + void (*extractPackedPixel) + (int, const void *,GLfloat []), + void (*shovePackedPixel) + (const GLfloat [], int, void *), + GLint widthIn,GLint heightIn, + const void *dataIn, + GLint widthOut,GLint heightOut, + void *dataOut, + GLint pixelSizeInBytes, + GLint rowSizeInBytes,GLint isSwap) +{ + float convx; + float convy; + float percent; + + /* Max components in a format is 4, so... */ + float totals[4]; + float extractTotals[4], extractMoreTotals[4], shoveTotals[4]; + + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + if (widthIn == widthOut*2 && heightIn == heightOut*2) { + halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel, + widthIn, heightIn, dataIn, dataOut, + pixelSizeInBytes,rowSizeInBytes,isSwap); + return; + } + convy = (float) heightIn/heightOut; + convx = (float) widthIn/widthOut; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightOut; i++) { + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthOut; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*pixelSizeInBytes; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; + percent = y_percent * (1-lowx_float); +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += pixelSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * y_percent; + } +#endif + } + temp += pixelSizeInBytes; + right = temp; + percent = y_percent * highx_float; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + + /* calculate the value for pixels in the last row */ + + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + for(l = lowx_int+1; l < highx_int; l++) { + temp += pixelSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * y_percent; + } +#endif + + } + temp += pixelSizeInBytes; + percent = y_percent * highx_float; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += rowSizeInBytes; + right += rowSizeInBytes; +#if 0 + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + + __GLU_SWAP_2_BYTES(right) * highx_float; + } else { + totals[k] += *(const GLushort*)left * (1-lowx_float) + + *(const GLushort*)right * highx_float; + } + } +#else + (*extractPackedPixel)(isSwap,left,extractTotals); + (*extractPackedPixel)(isSwap,right,extractMoreTotals); + for (k = 0; k < components; k++) { + totals[k]+= (extractTotals[k]*(1-lowx_float) + + extractMoreTotals[k]*highx_float); + } +#endif + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + for(m = lowy_int+1; m < highy_int; m++) { + temp += rowSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * x_percent; + } else { + totals[k] += *(const GLushort*)temp_index * x_percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * x_percent; + } +#endif + } + percent = x_percent * highy_float; + temp += rowSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + for (l = lowx_int+1; l < highx_int; l++) { + temp += pixelSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * y_percent; + } +#endif + } + temp += pixelSizeInBytes; + percent = y_percent * highx_float; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k] * percent; + } +#endif + } + + /* this is for the pixels in the body */ + temp0 = (const char *)dataIn + xindex + pixelSizeInBytes + (lowy_int+1)*rowSizeInBytes; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { +#if 0 + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index); + } else { + totals[k] += *(const GLushort*)temp_index; + } + } +#else + (*extractPackedPixel)(isSwap,temp,extractTotals); + for (k = 0; k < components; k++) { + totals[k]+= extractTotals[k]; + } +#endif + temp += pixelSizeInBytes; + } + temp0 += rowSizeInBytes; + } + + outindex = (j + (i * widthOut)); /* * (components == 1) */ +#if 0 + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } +#else + for (k = 0; k < components; k++) { + shoveTotals[k]= totals[k]/area; + } + (*shovePackedPixel)(shoveTotals,outindex,(void *)dataOut); +#endif + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } + + assert(outindex == (widthOut*heightOut - 1)); +} /* scaleInternalPackedPixel() */ + +/* rowSizeInBytes is at least the width (in bytes) due to padding on + * inputs; not always equal. Output NEVER has row padding. + */ +static void halveImagePackedPixel(int components, + void (*extractPackedPixel) + (int, const void *,GLfloat []), + void (*shovePackedPixel) + (const GLfloat [],int, void *), + GLint width, GLint height, + const void *dataIn, void *dataOut, + GLint pixelSizeInBytes, + GLint rowSizeInBytes, GLint isSwap) +{ + /* handle case where there is only 1 column/row */ + if (width == 1 || height == 1) { + assert(!(width == 1 && height == 1)); /* can't be 1x1 */ + halve1DimagePackedPixel(components,extractPackedPixel,shovePackedPixel, + width,height,dataIn,dataOut,pixelSizeInBytes, + rowSizeInBytes,isSwap); + return; + } + + { + int ii, jj; + + int halfWidth= width / 2; + int halfHeight= height / 2; + const char *src= (const char *) dataIn; + int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); + int outIndex= 0; + + for (ii= 0; ii< halfHeight; ii++) { + for (jj= 0; jj< halfWidth; jj++) { +#define BOX4 4 + float totals[4]; /* 4 is maximum components */ + float extractTotals[BOX4][4]; /* 4 is maximum components */ + int cc; + + (*extractPackedPixel)(isSwap,src, + &extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), + &extractTotals[1][0]); + (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), + &extractTotals[2][0]); + (*extractPackedPixel)(isSwap, + (src+rowSizeInBytes+pixelSizeInBytes), + &extractTotals[3][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* grab 4 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]; + * totals[RED]/= 4.0; + */ + for (kk = 0; kk < BOX4; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX4; + } + (*shovePackedPixel)(totals,outIndex,dataOut); + + outIndex++; + /* skip over to next square of 4 */ + src+= pixelSizeInBytes + pixelSizeInBytes; + } + /* skip past pad bytes, if any, to get to next row */ + src+= padBytes; + + /* src is at beginning of a row here, but it's the second row of + * the square block of 4 pixels that we just worked on so we + * need to go one more row. + * i.e., + * OO... + * here -->OO... + * but want -->OO... + * OO... + * ... + */ + src+= rowSizeInBytes; + } + + /* both pointers must reach one byte after the end */ + assert(src == &((const char *)dataIn)[rowSizeInBytes*height]); + assert(outIndex == halfWidth * halfHeight); + } +} /* halveImagePackedPixel() */ + +static void halve1DimagePackedPixel(int components, + void (*extractPackedPixel) + (int, const void *,GLfloat []), + void (*shovePackedPixel) + (const GLfloat [],int, void *), + GLint width, GLint height, + const void *dataIn, void *dataOut, + GLint pixelSizeInBytes, + GLint rowSizeInBytes, GLint isSwap) +{ + int halfWidth= width / 2; + int halfHeight= height / 2; + const char *src= (const char *) dataIn; + int jj; + + assert(width == 1 || height == 1); /* must be 1D */ + assert(width != height); /* can't be square */ + + if (height == 1) { /* 1 row */ + int outIndex= 0; + + assert(width != 1); /* widthxheight can't be 1x1 */ + halfHeight= 1; + + /* one horizontal row with possible pad bytes */ + + for (jj= 0; jj< halfWidth; jj++) { +#define BOX2 2 + float totals[4]; /* 4 is maximum components */ + float extractTotals[BOX2][4]; /* 4 is maximum components */ + int cc; + + /* average two at a time, instead of four */ + (*extractPackedPixel)(isSwap,src, + &extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), + &extractTotals[1][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* grab 2 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; + * totals[RED]/= 2.0; + */ + for (kk = 0; kk < BOX2; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX2; + } + (*shovePackedPixel)(totals,outIndex,dataOut); + + outIndex++; + /* skip over to next group of 2 */ + src+= pixelSizeInBytes + pixelSizeInBytes; + } + + { + int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); + src+= padBytes; /* for assertion only */ + } + assert(src == &((const char *)dataIn)[rowSizeInBytes]); + assert(outIndex == halfWidth * halfHeight); + } + else if (width == 1) { /* 1 column */ + int outIndex= 0; + + assert(height != 1); /* widthxheight can't be 1x1 */ + halfWidth= 1; + /* one vertical column with possible pad bytes per row */ + /* average two at a time */ + + for (jj= 0; jj< halfHeight; jj++) { +#define BOX2 2 + float totals[4]; /* 4 is maximum components */ + float extractTotals[BOX2][4]; /* 4 is maximum components */ + int cc; + + /* average two at a time, instead of four */ + (*extractPackedPixel)(isSwap,src, + &extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), + &extractTotals[1][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* grab 2 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; + * totals[RED]/= 2.0; + */ + for (kk = 0; kk < BOX2; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX2; + } + (*shovePackedPixel)(totals,outIndex,dataOut); + + outIndex++; + src+= rowSizeInBytes + rowSizeInBytes; /* go to row after next */ + } + + assert(src == &((const char *)dataIn)[rowSizeInBytes*height]); + assert(outIndex == halfWidth * halfHeight); + } +} /* halve1DimagePackedPixel() */ + +/*===========================================================================*/ + +#ifdef RESOLVE_3D_TEXTURE_SUPPORT +/* + * This section ensures that GLU 1.3 will load and run on + * a GL 1.1 implementation. It dynamically resolves the + * call to glTexImage3D() which might not be available. + * Or is it might be supported as an extension. + * Contributed by Gerk Huisma . + */ + +typedef void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level, + GLenum internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +static TexImage3Dproc pTexImage3D = 0; + +#if !defined(_WIN32) && !defined(__WIN32__) +# include +# include +#else + WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR); +#endif + +static void gluTexImage3D( GLenum target, GLint level, + GLenum internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ) +{ + if (!pTexImage3D) { +#if defined(_WIN32) || defined(__WIN32__) + pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D"); + if (!pTexImage3D) + pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT"); +#else + void *libHandle = dlopen("libgl.so", RTLD_LAZY); + pTexImage3D = TexImage3Dproc) dlsym(libHandle, "glTexImage3D" ); + if (!pTexImage3D) + pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT"); + dlclose(libHandle); +#endif + } + + /* Now call glTexImage3D */ + if (pTexImage3D) + pTexImage3D(target, level, internalFormat, width, height, + depth, border, format, type, pixels); +} + +#else + +/* Only bind to a GL 1.2 implementation: */ +#define gluTexImage3D glTexImage3D + +#endif + +static GLint imageSize3D(GLint width, GLint height, GLint depth, + GLenum format, GLenum type) +{ + int components= elements_per_group(format,type); + int bytes_per_row= bytes_per_element(type) * width; + +assert(width > 0 && height > 0 && depth > 0); +assert(type != GL_BITMAP); + + return bytes_per_row * height * depth * components; +} /* imageSize3D() */ + +static void fillImage3D(const PixelStorageModes *psm, + GLint width, GLint height, GLint depth, GLenum format, + GLenum type, GLboolean indexFormat, + const void *userImage, GLushort *newImage) +{ + int myswapBytes; + int components; + int groupsPerLine; + int elementSize; + int groupSize; + int rowSize; + int padding; + int elementsPerLine; + int rowsPerImage; + int imageSize; + const GLubyte *start, *rowStart, *iter; + GLushort *iter2; + int ww, hh, dd, k; + + myswapBytes= psm->unpack_swap_bytes; + components= elements_per_group(format,type); + if (psm->unpack_row_length > 0) { + groupsPerLine= psm->unpack_row_length; + } + else { + groupsPerLine= width; + } + elementSize= bytes_per_element(type); + groupSize= elementSize * components; + if (elementSize == 1) myswapBytes= 0; + + /* 3dstuff begin */ + if (psm->unpack_image_height > 0) { + rowsPerImage= psm->unpack_image_height; + } + else { + rowsPerImage= height; + } + /* 3dstuff end */ + + rowSize= groupsPerLine * groupSize; + padding= rowSize % psm->unpack_alignment; + if (padding) { + rowSize+= psm->unpack_alignment - padding; + } + + imageSize= rowsPerImage * rowSize; /* 3dstuff */ + + start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize + + psm->unpack_skip_pixels * groupSize + + /*3dstuff*/ + psm->unpack_skip_images * imageSize; + elementsPerLine = width * components; + + iter2= newImage; + for (dd= 0; dd < depth; dd++) { + rowStart= start; + + for (hh= 0; hh < height; hh++) { + iter= rowStart; + + for (ww= 0; ww < elementsPerLine; ww++) { + Type_Widget widget; + float extractComponents[4]; + + switch(type) { + case GL_UNSIGNED_BYTE: + if (indexFormat) { + *iter2++ = *iter; + } else { + *iter2++ = (*iter) * 257; + } + break; + case GL_BYTE: + if (indexFormat) { + *iter2++ = *((const GLbyte *) iter); + } else { + /* rough approx */ + *iter2++ = (*((const GLbyte *) iter)) * 516; + } + break; + case GL_UNSIGNED_BYTE_3_3_2: + extract332(0,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + extract233rev(0,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_5_6_5: + extract565(myswapBytes,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + extract565rev(myswapBytes,iter,extractComponents); + for (k = 0; k < 3; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + extract4444(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + extract4444rev(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + extract5551(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + extract1555rev(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_SHORT: + case GL_SHORT: + if (myswapBytes) { + widget.ub[0] = iter[1]; + widget.ub[1] = iter[0]; + } else { + widget.ub[0] = iter[0]; + widget.ub[1] = iter[1]; + } + if (type == GL_SHORT) { + if (indexFormat) { + *iter2++ = widget.s[0]; + } else { + /* rough approx */ + *iter2++ = widget.s[0]*2; + } + } else { + *iter2++ = widget.us[0]; + } + break; + case GL_UNSIGNED_INT_8_8_8_8: + extract8888(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + extract8888rev(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_INT_10_10_10_2: + extract1010102(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + extract2101010rev(myswapBytes,iter,extractComponents); + for (k = 0; k < 4; k++) { + *iter2++ = (GLushort)(extractComponents[k]*65535); + } + break; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + if (myswapBytes) { + widget.ub[0] = iter[3]; + widget.ub[1] = iter[2]; + widget.ub[2] = iter[1]; + widget.ub[3] = iter[0]; + } else { + widget.ub[0] = iter[0]; + widget.ub[1] = iter[1]; + widget.ub[2] = iter[2]; + widget.ub[3] = iter[3]; + } + if (type == GL_FLOAT) { + if (indexFormat) { + *iter2++ = widget.f; + } else { + *iter2++ = 65535 * widget.f; + } + } else if (type == GL_UNSIGNED_INT) { + if (indexFormat) { + *iter2++ = widget.ui; + } else { + *iter2++ = widget.ui >> 16; + } + } else { + if (indexFormat) { + *iter2++ = widget.i; + } else { + *iter2++ = widget.i >> 15; + } + } + break; + default: + assert(0); + } + + iter+= elementSize; + } /* for ww */ + rowStart+= rowSize; + + iter= rowStart; /* for assertion purposes */ + } /* for hh */ + + start+= imageSize; + } /* for dd */ + + /* iterators should be one byte past end */ + if (!isTypePackedPixel(type)) { + assert(iter2 == &newImage[width*height*depth*components]); + } + else { + assert(iter2 == &newImage[width*height*depth* + elements_per_group(format,0)]); + } + assert( iter == &((const GLubyte *)userImage)[rowSize*height*depth + + psm->unpack_skip_rows * rowSize + + psm->unpack_skip_pixels * groupSize + + /*3dstuff*/ + psm->unpack_skip_images * imageSize] ); +} /* fillImage3D () */ + +static void scaleInternal3D(GLint components, + GLint widthIn, GLint heightIn, GLint depthIn, + const GLushort *dataIn, + GLint widthOut, GLint heightOut, GLint depthOut, + GLushort *dataOut) +{ + float x, lowx, highx, convx, halfconvx; + float y, lowy, highy, convy, halfconvy; + float z, lowz, highz, convz, halfconvz; + float xpercent,ypercent,zpercent; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float volume; + int i,j,d,k,zint,yint,xint,xindex,yindex,zindex; + int temp; + + convz = (float) depthIn/depthOut; + convy = (float) heightIn/heightOut; + convx = (float) widthIn/widthOut; + halfconvx = convx/2; + halfconvy = convy/2; + halfconvz = convz/2; + for (d = 0; d < depthOut; d++) { + z = convz * (d+0.5); + if (depthIn > depthOut) { + highz = z + halfconvz; + lowz = z - halfconvz; + } else { + highz = z + 0.5; + lowz = z - 0.5; + } + for (i = 0; i < heightOut; i++) { + y = convy * (i+0.5); + if (heightIn > heightOut) { + highy = y + halfconvy; + lowy = y - halfconvy; + } else { + highy = y + 0.5; + lowy = y - 0.5; + } + for (j = 0; j < widthOut; j++) { + x = convx * (j+0.5); + if (widthIn > widthOut) { + highx = x + halfconvx; + lowx = x - halfconvx; + } else { + highx = x + 0.5; + lowx = x - 0.5; + } + + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy, + ** lowz) to (highx, highy, highz) on input data into this pixel + ** on output data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + volume = 0.0; + + z = lowz; + zint = floor(z); + while (z < highz) { + zindex = (zint + depthIn) % depthIn; + if (highz < zint+1) { + zpercent = highz - z; + } else { + zpercent = zint+1 - z; + } + + y = lowy; + yint = floor(y); + while (y < highy) { + yindex = (yint + heightIn) % heightIn; + if (highy < yint+1) { + ypercent = highy - y; + } else { + ypercent = yint+1 - y; + } + + x = lowx; + xint = floor(x); + + while (x < highx) { + xindex = (xint + widthIn) % widthIn; + if (highx < xint+1) { + xpercent = highx - x; + } else { + xpercent = xint+1 - x; + } + + percent = xpercent * ypercent * zpercent; + volume += percent; + + temp = (xindex + (yindex*widthIn) + + (zindex*widthIn*heightIn)) * components; + for (k = 0; k < components; k++) { + assert(0 <= (temp+k) && + (temp+k) < + (widthIn*heightIn*depthIn*components)); + totals[k] += dataIn[temp + k] * percent; + } + + xint++; + x = xint; + } /* while x */ + + yint++; + y = yint; + } /* while y */ + + zint++; + z = zint; + } /* while z */ + + temp = (j + (i * widthOut) + + (d*widthOut*heightOut)) * components; + for (k = 0; k < components; k++) { + /* totals[] should be rounded in the case of enlarging an + * RGB ramp when the type is 332 or 4444 + */ + assert(0 <= (temp+k) && + (temp+k) < (widthOut*heightOut*depthOut*components)); + dataOut[temp + k] = (totals[k]+0.5)/volume; + } + } /* for j */ + } /* for i */ + } /* for d */ +} /* scaleInternal3D() */ + +static void emptyImage3D(const PixelStorageModes *psm, + GLint width, GLint height, GLint depth, + GLenum format, GLenum type, GLboolean indexFormat, + const GLushort *oldImage, void *userImage) +{ + int myswapBytes; + int components; + int groupsPerLine; + int elementSize; + int groupSize; + int rowSize; + int padding; + GLubyte *start, *rowStart, *iter; + int elementsPerLine; + const GLushort *iter2; + int ii, jj, dd, k; + int rowsPerImage; + int imageSize; + + myswapBytes= psm->pack_swap_bytes; + components = elements_per_group(format,type); + if (psm->pack_row_length > 0) { + groupsPerLine = psm->pack_row_length; + } + else { + groupsPerLine = width; + } + + elementSize= bytes_per_element(type); + groupSize= elementSize * components; + if (elementSize == 1) myswapBytes= 0; + + /* 3dstuff begin */ + if (psm->pack_image_height > 0) { + rowsPerImage= psm->pack_image_height; + } + else { + rowsPerImage= height; + } + + /* 3dstuff end */ + + rowSize = groupsPerLine * groupSize; + padding = rowSize % psm->pack_alignment; + if (padding) { + rowSize+= psm->pack_alignment - padding; + } + + imageSize= rowsPerImage * rowSize; /* 3dstuff */ + + start = (GLubyte *)userImage + psm->pack_skip_rows * rowSize + + psm->pack_skip_pixels * groupSize + + /*3dstuff*/ + psm->pack_skip_images * imageSize; + elementsPerLine= width * components; + + iter2 = oldImage; + for (dd= 0; dd < depth; dd++) { + rowStart= start; + + for (ii= 0; ii< height; ii++) { + iter = rowStart; + + for (jj = 0; jj < elementsPerLine; jj++) { + Type_Widget widget; + float shoveComponents[4]; + + switch(type){ + case GL_UNSIGNED_BYTE: + if (indexFormat) { + *iter = *iter2++; + } else { + *iter = *iter2++ >> 8; + } + break; + case GL_BYTE: + if (indexFormat) { + *((GLbyte *) iter) = *iter2++; + } else { + *((GLbyte *) iter) = *iter2++ >> 9; + } + break; + case GL_UNSIGNED_BYTE_3_3_2: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove332(shoveComponents,0,(void *)iter); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove233rev(shoveComponents,0,(void *)iter); + break; + case GL_UNSIGNED_SHORT_5_6_5: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove565(shoveComponents,0,(void *)&widget.us[0]); + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } + else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + for (k = 0; k < 3; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove565rev(shoveComponents,0,(void *)&widget.us[0]); + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } + else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove4444(shoveComponents,0,(void *)&widget.us[0]); + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove4444rev(shoveComponents,0,(void *)&widget.us[0]); + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove5551(shoveComponents,0,(void *)&widget.us[0]); + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove1555rev(shoveComponents,0,(void *)&widget.us[0]); + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + *(GLushort *)iter = widget.us[0]; + } + break; + case GL_UNSIGNED_SHORT: + case GL_SHORT: + if (type == GL_SHORT) { + if (indexFormat) { + widget.s[0] = *iter2++; + } else { + widget.s[0] = *iter2++ >> 1; + } + } else { + widget.us[0] = *iter2++; + } + if (myswapBytes) { + iter[0] = widget.ub[1]; + iter[1] = widget.ub[0]; + } else { + iter[0] = widget.ub[0]; + iter[1] = widget.ub[1]; + } + break; + case GL_UNSIGNED_INT_8_8_8_8: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove8888(shoveComponents,0,(void *)&widget.ui); + if (myswapBytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove8888rev(shoveComponents,0,(void *)&widget.ui); + if (myswapBytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_UNSIGNED_INT_10_10_10_2: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove1010102(shoveComponents,0,(void *)&widget.ui); + if (myswapBytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + for (k = 0; k < 4; k++) { + shoveComponents[k]= *iter2++ / 65535.0; + } + shove2101010rev(shoveComponents,0,(void *)&widget.ui); + if (myswapBytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + *(GLuint *)iter= widget.ui; + } + break; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + if (type == GL_FLOAT) { + if (indexFormat) { + widget.f = *iter2++; + } else { + widget.f = *iter2++ / (float) 65535.0; + } + } else if (type == GL_UNSIGNED_INT) { + if (indexFormat) { + widget.ui = *iter2++; + } else { + widget.ui = (unsigned int) *iter2++ * 65537; + } + } else { + if (indexFormat) { + widget.i = *iter2++; + } else { + widget.i = ((unsigned int) *iter2++ * 65537)/2; + } + } + if (myswapBytes) { + iter[3] = widget.ub[0]; + iter[2] = widget.ub[1]; + iter[1] = widget.ub[2]; + iter[0] = widget.ub[3]; + } else { + iter[0] = widget.ub[0]; + iter[1] = widget.ub[1]; + iter[2] = widget.ub[2]; + iter[3] = widget.ub[3]; + } + break; + default: + assert(0); + } + + iter+= elementSize; + } /* for jj */ + + rowStart+= rowSize; + } /* for ii */ + + start+= imageSize; + } /* for dd */ + + /* iterators should be one byte past end */ + if (!isTypePackedPixel(type)) { + assert(iter2 == &oldImage[width*height*depth*components]); + } + else { + assert(iter2 == &oldImage[width*height*depth* + elements_per_group(format,0)]); + } + assert( iter == &((GLubyte *)userImage)[rowSize*height*depth + + psm->unpack_skip_rows * rowSize + + psm->unpack_skip_pixels * groupSize + + /*3dstuff*/ + psm->unpack_skip_images * imageSize] ); +} /* emptyImage3D() */ + +static +int gluScaleImage3D(GLenum format, + GLint widthIn, GLint heightIn, GLint depthIn, + GLenum typeIn, const void *dataIn, + GLint widthOut, GLint heightOut, GLint depthOut, + GLenum typeOut, void *dataOut) +{ + int components; + GLushort *beforeImage, *afterImage; + PixelStorageModes psm; + + if (widthIn == 0 || heightIn == 0 || depthIn == 0 || + widthOut == 0 || heightOut == 0 || depthOut == 0) { + return 0; + } + + if (widthIn < 0 || heightIn < 0 || depthIn < 0 || + widthOut < 0 || heightOut < 0 || depthOut < 0) { + return GLU_INVALID_VALUE; + } + + if (!legalFormat(format) || !legalType(typeIn) || !legalType(typeOut) || + typeIn == GL_BITMAP || typeOut == GL_BITMAP) { + return GLU_INVALID_ENUM; + } + if (!isLegalFormatForPackedPixelType(format, typeIn)) { + return GLU_INVALID_OPERATION; + } + if (!isLegalFormatForPackedPixelType(format, typeOut)) { + return GLU_INVALID_OPERATION; + } + + beforeImage = malloc(imageSize3D(widthIn, heightIn, depthIn, format, + GL_UNSIGNED_SHORT)); + afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format, + GL_UNSIGNED_SHORT)); + if (beforeImage == NULL || afterImage == NULL) { + return GLU_OUT_OF_MEMORY; + } + retrieveStoreModes3D(&psm); + + fillImage3D(&psm,widthIn,heightIn,depthIn,format,typeIn, is_index(format), + dataIn, beforeImage); + components = elements_per_group(format,0); + scaleInternal3D(components,widthIn,heightIn,depthIn,beforeImage, + widthOut,heightOut,depthOut,afterImage); + emptyImage3D(&psm,widthOut,heightOut,depthOut,format,typeOut, + is_index(format),afterImage, dataOut); + free((void *) beforeImage); + free((void *) afterImage); + + return 0; +} /* gluScaleImage3D() */ + + +static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, + GLint internalFormat, GLenum format, GLenum type, + GLint *newWidth, GLint *newHeight, GLint *newDepth) +{ + GLint widthPowerOf2= nearestPower(width); + GLint heightPowerOf2= nearestPower(height); + GLint depthPowerOf2= nearestPower(depth); + GLint proxyWidth; + + do { + /* compute level 1 width & height & depth, clamping each at 1 */ + GLint widthAtLevelOne= (widthPowerOf2 > 1) ? + widthPowerOf2 >> 1 : + widthPowerOf2; + GLint heightAtLevelOne= (heightPowerOf2 > 1) ? + heightPowerOf2 >> 1 : + heightPowerOf2; + GLint depthAtLevelOne= (depthPowerOf2 > 1) ? + depthPowerOf2 >> 1 : + depthPowerOf2; + GLenum proxyTarget = GL_PROXY_TEXTURE_3D; + assert(widthAtLevelOne > 0); + assert(heightAtLevelOne > 0); + assert(depthAtLevelOne > 0); + + /* does width x height x depth at level 1 & all their mipmaps fit? */ + assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D); + gluTexImage3D(proxyTarget, 1, /* must be non-zero */ + internalFormat, + widthAtLevelOne,heightAtLevelOne,depthAtLevelOne, + 0,format,type,NULL); + glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth); + /* does it fit??? */ + if (proxyWidth == 0) { /* nope, so try again with these sizes */ + if (widthPowerOf2 == 1 && heightPowerOf2 == 1 && + depthPowerOf2 == 1) { + *newWidth= *newHeight= *newDepth= 1; /* must fit 1x1x1 texture */ + return; + } + widthPowerOf2= widthAtLevelOne; + heightPowerOf2= heightAtLevelOne; + depthPowerOf2= depthAtLevelOne; + } + /* else it does fit */ + } while (proxyWidth == 0); + /* loop must terminate! */ + + /* return the width & height at level 0 that fits */ + *newWidth= widthPowerOf2; + *newHeight= heightPowerOf2; + *newDepth= depthPowerOf2; +/*printf("Proxy Textures\n");*/ +} /* closestFit3D() */ + +static void halveImagePackedPixelSlice(int components, + void (*extractPackedPixel) + (int, const void *,GLfloat []), + void (*shovePackedPixel) + (const GLfloat [],int, void *), + GLint width, GLint height, GLint depth, + const void *dataIn, void *dataOut, + GLint pixelSizeInBytes, + GLint rowSizeInBytes, + GLint imageSizeInBytes, + GLint isSwap) +{ + int ii, jj; + int halfWidth= width / 2; + int halfHeight= height / 2; + int halfDepth= depth / 2; + const char *src= (const char *)dataIn; + int outIndex= 0; + + assert((width == 1 || height == 1) && depth >= 2); + + if (width == height) { /* a 1-pixel column viewed from top */ + assert(width == 1 && height == 1); + assert(depth >= 2); + + for (ii= 0; ii< halfDepth; ii++) { + float totals[4]; + float extractTotals[BOX2][4]; + int cc; + + (*extractPackedPixel)(isSwap,src,&extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), + &extractTotals[1][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* average 2 pixels since only a column */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; + * totals[RED]/= 2.0; + */ + for (kk = 0; kk < BOX2; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX2; + } /* for cc */ + + (*shovePackedPixel)(totals,outIndex,dataOut); + outIndex++; + /* skip over to next group of 2 */ + src+= imageSizeInBytes + imageSizeInBytes; + } /* for ii */ + } + else if (height == 1) { /* horizontal slice viewed from top */ + assert(width != 1); + + for (ii= 0; ii< halfDepth; ii++) { + for (jj= 0; jj< halfWidth; jj++) { + float totals[4]; + float extractTotals[BOX4][4]; + int cc; + + (*extractPackedPixel)(isSwap,src, + &extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), + &extractTotals[1][0]); + (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), + &extractTotals[2][0]); + (*extractPackedPixel)(isSwap, + (src+imageSizeInBytes+pixelSizeInBytes), + &extractTotals[3][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* grab 4 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]; + * totals[RED]/= 4.0; + */ + for (kk = 0; kk < BOX4; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX4; + } + (*shovePackedPixel)(totals,outIndex,dataOut); + + outIndex++; + /* skip over to next horizontal square of 4 */ + src+= imageSizeInBytes + imageSizeInBytes; + } + } + + /* assert() */ + } + else if (width == 1) { /* vertical slice viewed from top */ + assert(height != 1); + + for (ii= 0; ii< halfDepth; ii++) { + for (jj= 0; jj< halfHeight; jj++) { + float totals[4]; + float extractTotals[BOX4][4]; + int cc; + + (*extractPackedPixel)(isSwap,src, + &extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), + &extractTotals[1][0]); + (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), + &extractTotals[2][0]); + (*extractPackedPixel)(isSwap, + (src+imageSizeInBytes+rowSizeInBytes), + &extractTotals[3][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* grab 4 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]; + * totals[RED]/= 4.0; + */ + for (kk = 0; kk < BOX4; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX4; + } + (*shovePackedPixel)(totals,outIndex,dataOut); + + outIndex++; + + /* skip over to next vertical square of 4 */ + src+= imageSizeInBytes + imageSizeInBytes; + } + } + /* assert() */ + } + +} /* halveImagePackedPixelSlice() */ + +static void halveImagePackedPixel3D(int components, + void (*extractPackedPixel) + (int, const void *,GLfloat []), + void (*shovePackedPixel) + (const GLfloat [],int, void *), + GLint width, GLint height, GLint depth, + const void *dataIn, void *dataOut, + GLint pixelSizeInBytes, + GLint rowSizeInBytes, + GLint imageSizeInBytes, + GLint isSwap) +{ + if (depth == 1) { + assert(1 <= width && 1 <= height); + + halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel, + width,height,dataIn,dataOut,pixelSizeInBytes, + rowSizeInBytes,isSwap); + return; + } + /* a horizontal or vertical slice viewed from top */ + else if (width == 1 || height == 1) { + assert(1 <= depth); + + halveImagePackedPixelSlice(components, + extractPackedPixel,shovePackedPixel, + width, height, depth, dataIn, dataOut, + pixelSizeInBytes, rowSizeInBytes, + imageSizeInBytes, isSwap); + return; + } + { + int ii, jj, dd; + + int halfWidth= width / 2; + int halfHeight= height / 2; + int halfDepth= depth / 2; + const char *src= (const char *) dataIn; + int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); + int outIndex= 0; + + for (dd= 0; dd < halfDepth; dd++) { + for (ii= 0; ii< halfHeight; ii++) { + for (jj= 0; jj< halfWidth; jj++) { +#define BOX8 8 + float totals[4]; /* 4 is maximum components */ + float extractTotals[BOX8][4]; /* 4 is maximum components */ + int cc; + + (*extractPackedPixel)(isSwap,src, + &extractTotals[0][0]); + (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), + &extractTotals[1][0]); + (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), + &extractTotals[2][0]); + (*extractPackedPixel)(isSwap, + (src+rowSizeInBytes+pixelSizeInBytes), + &extractTotals[3][0]); + + (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), + &extractTotals[4][0]); + (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes+imageSizeInBytes), + &extractTotals[5][0]); + (*extractPackedPixel)(isSwap,(src+rowSizeInBytes+imageSizeInBytes), + &extractTotals[6][0]); + (*extractPackedPixel)(isSwap, + (src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes), + &extractTotals[7][0]); + for (cc = 0; cc < components; cc++) { + int kk; + + /* grab 8 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]+ + * extractTotals[4][RED]+extractTotals[5][RED]+ + * extractTotals[6][RED]+extractTotals[7][RED]; + * totals[RED]/= 8.0; + */ + for (kk = 0; kk < BOX8; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (float)BOX8; + } + (*shovePackedPixel)(totals,outIndex,dataOut); + + outIndex++; + /* skip over to next square of 4 */ + src+= pixelSizeInBytes + pixelSizeInBytes; + } + /* skip past pad bytes, if any, to get to next row */ + src+= padBytes; + + /* src is at beginning of a row here, but it's the second row of + * the square block of 4 pixels that we just worked on so we + * need to go one more row. + * i.e., + * OO... + * here -->OO... + * but want -->OO... + * OO... + * ... + */ + src+= rowSizeInBytes; + } + + src+= imageSizeInBytes; + } /* for dd */ + + /* both pointers must reach one byte after the end */ + assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); + assert(outIndex == halfWidth * halfHeight * halfDepth); + } /* for dd */ + +} /* halveImagePackedPixel3D() */ + +static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLsizei widthPowerOf2, + GLsizei heightPowerOf2, + GLsizei depthPowerOf2, + GLenum format, GLenum type, + GLint userLevel, + GLint baseLevel,GLint maxLevel, + const void *data) +{ + GLint newWidth, newHeight, newDepth; + GLint level, levels; + const void *usersImage; + void *srcImage, *dstImage; + __GLU_INIT_SWAP_IMAGE; + GLint memReq; + GLint cmpts; + + GLint myswapBytes, groupsPerLine, elementSize, groupSize; + GLint rowsPerImage, imageSize; + GLint rowSize, padding; + PixelStorageModes psm; + + assert(checkMipmapArgs(internalFormat,format,type) == 0); + assert(width >= 1 && height >= 1 && depth >= 1); + assert(type != GL_BITMAP); + + srcImage = dstImage = NULL; + + newWidth= widthPowerOf2; + newHeight= heightPowerOf2; + newDepth= depthPowerOf2; + levels = computeLog(newWidth); + level = computeLog(newHeight); + if (level > levels) levels=level; + level = computeLog(newDepth); + if (level > levels) levels=level; + + levels+= userLevel; + + retrieveStoreModes3D(&psm); + myswapBytes = psm.unpack_swap_bytes; + cmpts = elements_per_group(format,type); + if (psm.unpack_row_length > 0) { + groupsPerLine = psm.unpack_row_length; + } else { + groupsPerLine = width; + } + + elementSize = bytes_per_element(type); + groupSize = elementSize * cmpts; + if (elementSize == 1) myswapBytes = 0; + + /* 3dstuff begin */ + if (psm.unpack_image_height > 0) { + rowsPerImage= psm.unpack_image_height; + } + else { + rowsPerImage= height; + } + + /* 3dstuff end */ + rowSize = groupsPerLine * groupSize; + padding = (rowSize % psm.unpack_alignment); + if (padding) { + rowSize += psm.unpack_alignment - padding; + } + + imageSize= rowsPerImage * rowSize; /* 3dstuff */ + + usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize + + psm.unpack_skip_pixels * groupSize + + /* 3dstuff */ + psm.unpack_skip_images * imageSize; + + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0); + + level = userLevel; + + if (width == newWidth && height == newHeight && depth == newDepth) { + /* Use usersImage for level userLevel */ + if (baseLevel <= level && level <= maxLevel) { + gluTexImage3D(target, level, internalFormat, width, + height, depth, 0, format, type, + usersImage); + } + if(levels == 0) { /* we're done. clean up and return */ + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + return 0; + } + { + int nextWidth= newWidth/2; + int nextHeight= newHeight/2; + int nextDepth= newDepth/2; + + /* clamp to 1 */ + if (nextWidth < 1) nextWidth= 1; + if (nextHeight < 1) nextHeight= 1; + if (nextDepth < 1) nextDepth= 1; + memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); + } + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memReq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memReq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memReq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memReq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memReq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memReq); + break; + 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: + dstImage = (GLuint *)malloc(memReq); + break; + default: + return GLU_INVALID_ENUM; /* assertion */ + } + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + return GLU_OUT_OF_MEMORY; + } + else + switch(type) { + case GL_UNSIGNED_BYTE: + if (depth > 1) { + halveImage3D(cmpts,extractUbyte,shoveUbyte, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_ubyte(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize); + } + break; + case GL_BYTE: + if (depth > 1) { + halveImage3D(cmpts,extractSbyte,shoveSbyte, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_byte(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize); + } + break; + case GL_UNSIGNED_SHORT: + if (depth > 1) { + halveImage3D(cmpts,extractUshort,shoveUshort, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_ushort(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_SHORT: + if (depth > 1) { + halveImage3D(cmpts,extractSshort,shoveSshort, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_short(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_UNSIGNED_INT: + if (depth > 1) { + halveImage3D(cmpts,extractUint,shoveUint, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_uint(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_INT: + if (depth > 1) { + halveImage3D(cmpts,extractSint,shoveSint, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_int(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_FLOAT: + if (depth > 1 ) { + halveImage3D(cmpts,extractFloat,shoveFloat, + width,height,depth, + usersImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_float(cmpts,width,height,usersImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_UNSIGNED_BYTE_3_3_2: + assert(format == GL_RGB); + halveImagePackedPixel3D(3,extract332,shove332, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + assert(format == GL_RGB); + halveImagePackedPixel3D(3,extract233rev,shove233rev, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_5_6_5: + halveImagePackedPixel3D(3,extract565,shove565, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + halveImagePackedPixel3D(3,extract565rev,shove565rev, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + halveImagePackedPixel3D(4,extract4444,shove4444, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + halveImagePackedPixel3D(4,extract4444rev,shove4444rev, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + halveImagePackedPixel3D(4,extract5551,shove5551, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + halveImagePackedPixel3D(4,extract1555rev,shove1555rev, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_8_8_8_8: + halveImagePackedPixel3D(4,extract8888,shove8888, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + halveImagePackedPixel3D(4,extract8888rev,shove8888rev, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_10_10_10_2: + halveImagePackedPixel3D(4,extract1010102,shove1010102, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev, + width,height,depth,usersImage,dstImage, + elementSize,rowSize,imageSize,myswapBytes); + break; + default: + assert(0); + break; + } + newWidth = width/2; + newHeight = height/2; + newDepth = depth/2; + /* clamp to 1 */ + if (newWidth < 1) newWidth= 1; + if (newHeight < 1) newHeight= 1; + if (newDepth < 1) newDepth= 1; + + myswapBytes = 0; + rowSize = newWidth * groupSize; + imageSize= rowSize * newHeight; /* 3dstuff */ + memReq = imageSize3D(newWidth, newHeight, newDepth, format, type); + /* Swap srcImage and dstImage */ + __GLU_SWAP_IMAGE(srcImage,dstImage); + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memReq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memReq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memReq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memReq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memReq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memReq); + break; + 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: + dstImage = (GLuint *)malloc(memReq); + break; + default: + return GLU_INVALID_ENUM; /* assertion */ + } + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + return GLU_OUT_OF_MEMORY; + } + /* level userLevel+1 is in srcImage; level userLevel already saved */ + level = userLevel+1; + } else {/* user's image is *not* nice power-of-2 sized square */ + memReq = imageSize3D(newWidth, newHeight, newDepth, format, type); + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memReq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memReq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memReq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memReq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memReq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memReq); + break; + 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: + dstImage = (GLuint *)malloc(memReq); + break; + default: + return GLU_INVALID_ENUM; /* assertion */ + } + + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + return GLU_OUT_OF_MEMORY; + } + /*printf("Build3DMipmaps(): ScaleImage3D %d %d %d->%d %d %d\n", + width,height,depth,newWidth,newHeight,newDepth);*/ + + gluScaleImage3D(format, width, height, depth, type, usersImage, + newWidth, newHeight, newDepth, type, dstImage); + + myswapBytes = 0; + rowSize = newWidth * groupSize; + imageSize = rowSize * newHeight; /* 3dstuff */ + /* Swap dstImage and srcImage */ + __GLU_SWAP_IMAGE(srcImage,dstImage); + + if(levels != 0) { /* use as little memory as possible */ + { + int nextWidth= newWidth/2; + int nextHeight= newHeight/2; + int nextDepth= newDepth/2; + if (nextWidth < 1) nextWidth= 1; + if (nextHeight < 1) nextHeight= 1; + if (nextDepth < 1) nextDepth= 1; + + memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); + } + switch(type) { + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memReq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memReq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memReq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memReq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memReq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memReq); + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + dstImage = (GLushort *)malloc(memReq); + break; + 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: + dstImage = (GLuint *)malloc(memReq); + break; + default: + return GLU_INVALID_ENUM; /* assertion */ + } + if (dstImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + return GLU_OUT_OF_MEMORY; + } + } + /* level userLevel is in srcImage; nothing saved yet */ + level = userLevel; + } + + glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); + if (baseLevel <= level && level <= maxLevel) { + gluTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth, + 0,format, type, (void *)srcImage); + } + level++; /* update current level for the loop */ + for (; level <= levels; level++) { + switch(type) { + case GL_UNSIGNED_BYTE: + if (newDepth > 1) { + halveImage3D(cmpts,extractUbyte,shoveUbyte, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_ubyte(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize); + } + break; + case GL_BYTE: + if (newDepth > 1) { + halveImage3D(cmpts,extractSbyte,shoveSbyte, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_byte(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize); + } + break; + case GL_UNSIGNED_SHORT: + if (newDepth > 1) { + halveImage3D(cmpts,extractUshort,shoveUshort, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_ushort(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_SHORT: + if (newDepth > 1) { + halveImage3D(cmpts,extractSshort,shoveSshort, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_short(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_UNSIGNED_INT: + if (newDepth > 1) { + halveImage3D(cmpts,extractUint,shoveUint, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_uint(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_INT: + if (newDepth > 1) { + halveImage3D(cmpts,extractSint,shoveSint, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_int(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_FLOAT: + if (newDepth > 1) { + halveImage3D(cmpts,extractFloat,shoveFloat, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,groupSize,rowSize, + imageSize,myswapBytes); + } + else { + halveImage_float(cmpts,newWidth,newHeight,srcImage,dstImage, + elementSize,rowSize,groupSize,myswapBytes); + } + break; + case GL_UNSIGNED_BYTE_3_3_2: + halveImagePackedPixel3D(3,extract332,shove332, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + halveImagePackedPixel3D(3,extract233rev,shove233rev, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_5_6_5: + halveImagePackedPixel3D(3,extract565,shove565, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + halveImagePackedPixel3D(3,extract565rev,shove565rev, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + halveImagePackedPixel3D(4,extract4444,shove4444, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + halveImagePackedPixel3D(4,extract4444rev,shove4444rev, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + halveImagePackedPixel3D(4,extract5551,shove5551, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + halveImagePackedPixel3D(4,extract1555rev,shove1555rev, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_8_8_8_8: + halveImagePackedPixel3D(4,extract8888,shove8888, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + halveImagePackedPixel3D(4,extract8888rev,shove8888rev, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_10_10_10_2: + halveImagePackedPixel3D(4,extract1010102,shove1010102, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: + halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev, + newWidth,newHeight,newDepth, + srcImage,dstImage,elementSize,rowSize, + imageSize,myswapBytes); + break; + default: + assert(0); + break; + } + + __GLU_SWAP_IMAGE(srcImage,dstImage); + + if (newWidth > 1) { newWidth /= 2; rowSize /= 2;} + if (newHeight > 1) { newHeight /= 2; imageSize = rowSize * newHeight; } + if (newDepth > 1) newDepth /= 2; + { + /* call tex image with srcImage untouched since it's not padded */ + if (baseLevel <= level && level <= maxLevel) { + gluTexImage3D(target, level, internalFormat, newWidth, newHeight, + newDepth,0, format, type, (void *) srcImage); + } + } + } /* for level */ + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + + free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/ + if (dstImage) { /* if it's non-rectangular and only 1 level */ + free(dstImage); + } + return 0; +} /* gluBuild3DMipmapLevelsCore() */ + +GLint GLAPIENTRY +gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + GLint userLevel, GLint baseLevel, GLint maxLevel, + const void *data) +{ + int level, levels; + + int rc= checkMipmapArgs(internalFormat,format,type); + if (rc != 0) return rc; + + if (width < 1 || height < 1 || depth < 1) { + return GLU_INVALID_VALUE; + } + + if(type == GL_BITMAP) { + return GLU_INVALID_ENUM; + } + + levels = computeLog(width); + level = computeLog(height); + if (level > levels) levels=level; + level = computeLog(depth); + if (level > levels) levels=level; + + levels+= userLevel; + if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) + return GLU_INVALID_VALUE; + + return gluBuild3DMipmapLevelsCore(target, internalFormat, + width, height, depth, + width, height, depth, + format, type, + userLevel, baseLevel, maxLevel, + data); +} /* gluBuild3DMipmapLevels() */ + +GLint GLAPIENTRY +gluBuild3DMipmaps(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, const void *data) +{ + GLint widthPowerOf2, heightPowerOf2, depthPowerOf2; + int level, levels; + + int rc= checkMipmapArgs(internalFormat,format,type); + if (rc != 0) return rc; + + if (width < 1 || height < 1 || depth < 1) { + return GLU_INVALID_VALUE; + } + + if(type == GL_BITMAP) { + return GLU_INVALID_ENUM; + } + + closestFit3D(target,width,height,depth,internalFormat,format,type, + &widthPowerOf2,&heightPowerOf2,&depthPowerOf2); + + levels = computeLog(widthPowerOf2); + level = computeLog(heightPowerOf2); + if (level > levels) levels=level; + level = computeLog(depthPowerOf2); + if (level > levels) levels=level; + + return gluBuild3DMipmapLevelsCore(target, internalFormat, + width, height, depth, + widthPowerOf2, heightPowerOf2, + depthPowerOf2, + format, type, 0, 0, levels, + data); +} /* gluBuild3DMipmaps() */ + +static GLdouble extractUbyte(int isSwap, const void *ubyte) +{ + isSwap= isSwap; /* turn off warnings */ + + assert(*((const GLubyte *)ubyte) <= 255); + + return (GLdouble)(*((const GLubyte *)ubyte)); +} /* extractUbyte() */ + +static void shoveUbyte(GLdouble value, int index, void *data) +{ + assert(0.0 <= value && value < 256.0); + + ((GLubyte *)data)[index]= (GLubyte)value; +} /* shoveUbyte() */ + +static GLdouble extractSbyte(int isSwap, const void *sbyte) +{ + isSwap= isSwap; /* turn off warnings */ + + assert(*((const GLbyte *)sbyte) <= 127); + + return (GLdouble)(*((const GLbyte *)sbyte)); +} /* extractSbyte() */ + +static void shoveSbyte(GLdouble value, int index, void *data) +{ + ((GLbyte *)data)[index]= (GLbyte)value; +} /* shoveSbyte() */ + +static GLdouble extractUshort(int isSwap, const void *uitem) +{ + GLushort ushort; + + if (isSwap) { + ushort= __GLU_SWAP_2_BYTES(uitem); + } + else { + ushort= *(const GLushort *)uitem; + } + + assert(ushort <= 65535); + + return (GLdouble)ushort; +} /* extractUshort() */ + +static void shoveUshort(GLdouble value, int index, void *data) +{ + assert(0.0 <= value && value < 65536.0); + + ((GLushort *)data)[index]= (GLushort)value; +} /* shoveUshort() */ + +static GLdouble extractSshort(int isSwap, const void *sitem) +{ + GLshort sshort; + + if (isSwap) { + sshort= __GLU_SWAP_2_BYTES(sitem); + } + else { + sshort= *(const GLshort *)sitem; + } + + assert(sshort <= 32767); + + return (GLdouble)sshort; +} /* extractSshort() */ + +static void shoveSshort(GLdouble value, int index, void *data) +{ + assert(0.0 <= value && value < 32768.0); + + ((GLshort *)data)[index]= (GLshort)value; +} /* shoveSshort() */ + +static GLdouble extractUint(int isSwap, const void *uitem) +{ + GLuint uint; + + if (isSwap) { + uint= __GLU_SWAP_4_BYTES(uitem); + } + else { + uint= *(const GLuint *)uitem; + } + + assert(uint <= 0xffffffff); + + return (GLdouble)uint; +} /* extractUint() */ + +static void shoveUint(GLdouble value, int index, void *data) +{ + assert(0.0 <= value && value <= (GLdouble) UINT_MAX); + + ((GLuint *)data)[index]= (GLuint)value; +} /* shoveUint() */ + +static GLdouble extractSint(int isSwap, const void *sitem) +{ + GLint sint; + + if (isSwap) { + sint= __GLU_SWAP_4_BYTES(sitem); + } + else { + sint= *(const GLint *)sitem; + } + + assert(sint <= 0x7fffffff); + + return (GLdouble)sint; +} /* extractSint() */ + +static void shoveSint(GLdouble value, int index, void *data) +{ + assert(0.0 <= value && value <= (GLdouble) INT_MAX); + + ((GLint *)data)[index]= (GLint)value; +} /* shoveSint() */ + +static GLdouble extractFloat(int isSwap, const void *item) +{ + GLfloat ffloat; + + if (isSwap) { + ffloat= __GLU_SWAP_4_BYTES(item); + } + else { + ffloat= *(const GLfloat *)item; + } + + assert(ffloat <= 1.0); + + return (GLdouble)ffloat; +} /* extractFloat() */ + +static void shoveFloat(GLdouble value, int index, void *data) +{ + assert(0.0 <= value && value <= 1.0); + + ((GLfloat *)data)[index]= value; +} /* shoveFloat() */ + +static void halveImageSlice(int components, + GLdouble (*extract)(int, const void *), + void (*shove)(GLdouble, int, void *), + GLint width, GLint height, GLint depth, + const void *dataIn, void *dataOut, + GLint elementSizeInBytes, + GLint groupSizeInBytes, + GLint rowSizeInBytes, + GLint imageSizeInBytes, + GLint isSwap) +{ + int ii, jj; + int halfWidth= width / 2; + int halfHeight= height / 2; + int halfDepth= depth / 2; + const char *src= (const char *)dataIn; + int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes); + int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); + int outIndex= 0; + + assert((width == 1 || height == 1) && depth >= 2); + + if (width == height) { /* a 1-pixel column viewed from top */ + /* printf("1-column\n");*/ + assert(width == 1 && height == 1); + assert(depth >= 2); + + for (ii= 0; ii< halfDepth; ii++) { + int cc; + + for (cc = 0; cc < components; cc++) { + double totals[4]; + double extractTotals[BOX2][4]; + int kk; + + extractTotals[0][cc]= (*extract)(isSwap,src); + extractTotals[1][cc]= (*extract)(isSwap,(src+imageSizeInBytes)); + + /* average 2 pixels since only a column */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; + * totals[RED]/= 2.0; + */ + for (kk = 0; kk < BOX2; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (double)BOX2; + + (*shove)(totals[cc],outIndex,dataOut); + outIndex++; + src+= elementSizeInBytes; + } /* for cc */ + + /* skip over to next group of 2 */ + src+= rowSizeInBytes; + } /* for ii */ + + assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); + assert(outIndex == halfDepth * components); + } + else if (height == 1) { /* horizontal slice viewed from top */ + /* printf("horizontal slice\n"); */ + assert(width != 1); + + for (ii= 0; ii< halfDepth; ii++) { + for (jj= 0; jj< halfWidth; jj++) { + int cc; + + for (cc = 0; cc < components; cc++) { + int kk; + double totals[4]; + double extractTotals[BOX4][4]; + + extractTotals[0][cc]=(*extract)(isSwap,src); + extractTotals[1][cc]=(*extract)(isSwap, + (src+groupSizeInBytes)); + extractTotals[2][cc]=(*extract)(isSwap, + (src+imageSizeInBytes)); + extractTotals[3][cc]=(*extract)(isSwap, + (src+imageSizeInBytes+groupSizeInBytes)); + + /* grab 4 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]; + * totals[RED]/= 4.0; + */ + for (kk = 0; kk < BOX4; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (double)BOX4; + + (*shove)(totals[cc],outIndex,dataOut); + outIndex++; + + src+= elementSizeInBytes; + } /* for cc */ + + /* skip over to next horizontal square of 4 */ + src+= groupSizeInBytes; + } /* for jj */ + src+= rowPadBytes; + + src+= rowSizeInBytes; + } /* for ii */ + + assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); + assert(outIndex == halfWidth * halfDepth * components); + } + else if (width == 1) { /* vertical slice viewed from top */ + /* printf("vertical slice\n"); */ + assert(height != 1); + + for (ii= 0; ii< halfDepth; ii++) { + for (jj= 0; jj< halfHeight; jj++) { + int cc; + + for (cc = 0; cc < components; cc++) { + int kk; + double totals[4]; + double extractTotals[BOX4][4]; + + extractTotals[0][cc]=(*extract)(isSwap,src); + extractTotals[1][cc]=(*extract)(isSwap, + (src+rowSizeInBytes)); + extractTotals[2][cc]=(*extract)(isSwap, + (src+imageSizeInBytes)); + extractTotals[3][cc]=(*extract)(isSwap, + (src+imageSizeInBytes+rowSizeInBytes)); + + /* grab 4 pixels to average */ + totals[cc]= 0.0; + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]; + * totals[RED]/= 4.0; + */ + for (kk = 0; kk < BOX4; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (double)BOX4; + + (*shove)(totals[cc],outIndex,dataOut); + outIndex++; + + src+= elementSizeInBytes; + } /* for cc */ + src+= rowPadBytes; + + /* skip over to next vertical square of 4 */ + src+= rowSizeInBytes; + } /* for jj */ + src+= imagePadBytes; + + src+= imageSizeInBytes; + } /* for ii */ + + assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); + assert(outIndex == halfHeight * halfDepth * components); + } + +} /* halveImageSlice() */ + +static void halveImage3D(int components, + GLdouble (*extract)(int, const void *), + void (*shove)(GLdouble, int, void *), + GLint width, GLint height, GLint depth, + const void *dataIn, void *dataOut, + GLint elementSizeInBytes, + GLint groupSizeInBytes, + GLint rowSizeInBytes, + GLint imageSizeInBytes, + GLint isSwap) +{ + assert(depth > 1); + + /* a horizontal/vertical/one-column slice viewed from top */ + if (width == 1 || height == 1) { + assert(1 <= depth); + + halveImageSlice(components,extract,shove, width, height, depth, + dataIn, dataOut, elementSizeInBytes, groupSizeInBytes, + rowSizeInBytes, imageSizeInBytes, isSwap); + return; + } + { + int ii, jj, dd; + + int halfWidth= width / 2; + int halfHeight= height / 2; + int halfDepth= depth / 2; + const char *src= (const char *) dataIn; + int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes); + int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); + int outIndex= 0; + + for (dd= 0; dd < halfDepth; dd++) { + for (ii= 0; ii< halfHeight; ii++) { + for (jj= 0; jj< halfWidth; jj++) { + int cc; + + for (cc= 0; cc < components; cc++) { + int kk; +#define BOX8 8 + double totals[4]; /* 4 is maximum components */ + double extractTotals[BOX8][4]; /* 4 is maximum components */ + + extractTotals[0][cc]= (*extract)(isSwap,src); + extractTotals[1][cc]= (*extract)(isSwap, + (src+groupSizeInBytes)); + extractTotals[2][cc]= (*extract)(isSwap, + (src+rowSizeInBytes)); + extractTotals[3][cc]= (*extract)(isSwap, + (src+rowSizeInBytes+groupSizeInBytes)); + + extractTotals[4][cc]= (*extract)(isSwap, + (src+imageSizeInBytes)); + + extractTotals[5][cc]= (*extract)(isSwap, + (src+groupSizeInBytes+imageSizeInBytes)); + extractTotals[6][cc]= (*extract)(isSwap, + (src+rowSizeInBytes+imageSizeInBytes)); + extractTotals[7][cc]= (*extract)(isSwap, + (src+rowSizeInBytes+groupSizeInBytes+imageSizeInBytes)); + + totals[cc]= 0.0; + + /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ + * extractTotals[2][RED]+extractTotals[3][RED]+ + * extractTotals[4][RED]+extractTotals[5][RED]+ + * extractTotals[6][RED]+extractTotals[7][RED]; + * totals[RED]/= 8.0; + */ + for (kk = 0; kk < BOX8; kk++) { + totals[cc]+= extractTotals[kk][cc]; + } + totals[cc]/= (double)BOX8; + + (*shove)(totals[cc],outIndex,dataOut); + + outIndex++; + + src+= elementSizeInBytes; /* go to next component */ + } /* for cc */ + + /* skip over to next square of 4 */ + src+= groupSizeInBytes; + } /* for jj */ + /* skip past pad bytes, if any, to get to next row */ + src+= rowPadBytes; + + /* src is at beginning of a row here, but it's the second row of + * the square block of 4 pixels that we just worked on so we + * need to go one more row. + * i.e., + * OO... + * here -->OO... + * but want -->OO... + * OO... + * ... + */ + src+= rowSizeInBytes; + } /* for ii */ + + /* skip past pad bytes, if any, to get to next image */ + src+= imagePadBytes; + + src+= imageSizeInBytes; + } /* for dd */ + + /* both pointers must reach one byte after the end */ + assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); + assert(outIndex == halfWidth * halfHeight * halfDepth * components); + } +} /* halveImage3D() */ + + + +/*** mipmap.c ***/ + diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/project.c xpsb-glx-0.19/mesa/src/glu/sgi/libutil/project.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/project.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/project.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,359 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "gluos.h" +#include +#include +#include +#include "gluint.h" + +/* +** Make m an identity matrix +*/ +static void __gluMakeIdentityd(GLdouble m[16]) +{ + m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; + m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; + m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; + m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +} + +static void __gluMakeIdentityf(GLfloat m[16]) +{ + m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; + m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; + m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; + m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +} + +void GLAPIENTRY +gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) +{ + glOrtho(left, right, bottom, top, -1, 1); +} + +#define __glPi 3.14159265358979323846 + +void GLAPIENTRY +gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLdouble m[4][4]; + double sine, cotangent, deltaZ; + double radians = fovy / 2 * __glPi / 180; + + deltaZ = zFar - zNear; + sine = sin(radians); + if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { + return; + } + cotangent = COS(radians) / sine; + + __gluMakeIdentityd(&m[0][0]); + m[0][0] = cotangent / aspect; + m[1][1] = cotangent; + m[2][2] = -(zFar + zNear) / deltaZ; + m[2][3] = -1; + m[3][2] = -2 * zNear * zFar / deltaZ; + m[3][3] = 0; + glMultMatrixd(&m[0][0]); +} + +static void normalize(float v[3]) +{ + float r; + + r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); + if (r == 0.0) return; + + v[0] /= r; + v[1] /= r; + v[2] /= r; +} + +static void cross(float v1[3], float v2[3], float result[3]) +{ + result[0] = v1[1]*v2[2] - v1[2]*v2[1]; + result[1] = v1[2]*v2[0] - v1[0]*v2[2]; + result[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +void GLAPIENTRY +gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, + GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, + GLdouble upz) +{ + float forward[3], side[3], up[3]; + GLfloat m[4][4]; + + forward[0] = centerx - eyex; + forward[1] = centery - eyey; + forward[2] = centerz - eyez; + + up[0] = upx; + up[1] = upy; + up[2] = upz; + + normalize(forward); + + /* Side = forward x up */ + cross(forward, up, side); + normalize(side); + + /* Recompute up as: up = side x forward */ + cross(side, forward, up); + + __gluMakeIdentityf(&m[0][0]); + m[0][0] = side[0]; + m[1][0] = side[1]; + m[2][0] = side[2]; + + m[0][1] = up[0]; + m[1][1] = up[1]; + m[2][1] = up[2]; + + m[0][2] = -forward[0]; + m[1][2] = -forward[1]; + m[2][2] = -forward[2]; + + glMultMatrixf(&m[0][0]); + glTranslated(-eyex, -eyey, -eyez); +} + +static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], + GLdouble out[4]) +{ + int i; + + for (i=0; i<4; i++) { + out[i] = + in[0] * matrix[0*4+i] + + in[1] * matrix[1*4+i] + + in[2] * matrix[2*4+i] + + in[3] * matrix[3*4+i]; + } +} + +/* +** Invert 4x4 matrix. +** Contributed by David Moore (See Mesa bug #6748) +*/ +static int __gluInvertMatrixd(const GLdouble m[16], GLdouble invOut[16]) +{ + double inv[16], det; + int i; + + inv[0] = m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15] + + m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10]; + inv[4] = -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15] + - m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10]; + inv[8] = m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15] + + m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9]; + inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14] + - m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9]; + inv[1] = -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15] + - m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10]; + inv[5] = m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15] + + m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10]; + inv[9] = -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15] + - m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9]; + inv[13] = m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14] + + m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9]; + inv[2] = m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15] + + m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6]; + inv[6] = -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15] + - m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6]; + inv[10] = m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15] + + m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5]; + inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14] + - m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5]; + inv[3] = -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11] + - m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6]; + inv[7] = m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11] + + m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6]; + inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11] + - m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5]; + inv[15] = m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10] + + m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5]; + + det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12]; + if (det == 0) + return GL_FALSE; + + det = 1.0 / det; + + for (i = 0; i < 16; i++) + invOut[i] = inv[i] * det; + + return GL_TRUE; +} + +static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], + GLdouble r[16]) +{ + int i, j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + r[i*4+j] = + a[i*4+0]*b[0*4+j] + + a[i*4+1]*b[1*4+j] + + a[i*4+2]*b[2*4+j] + + a[i*4+3]*b[3*4+j]; + } + } +} + +GLint GLAPIENTRY +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *winx, GLdouble *winy, GLdouble *winz) +{ + double in[4]; + double out[4]; + + in[0]=objx; + in[1]=objy; + in[2]=objz; + in[3]=1.0; + __gluMultMatrixVecd(modelMatrix, in, out); + __gluMultMatrixVecd(projMatrix, out, in); + if (in[3] == 0.0) return(GL_FALSE); + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + /* Map x, y and z to range 0-1 */ + in[0] = in[0] * 0.5 + 0.5; + in[1] = in[1] * 0.5 + 0.5; + in[2] = in[2] * 0.5 + 0.5; + + /* Map x,y to viewport */ + in[0] = in[0] * viewport[2] + viewport[0]; + in[1] = in[1] * viewport[3] + viewport[1]; + + *winx=in[0]; + *winy=in[1]; + *winz=in[2]; + return(GL_TRUE); +} + +GLint GLAPIENTRY +gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *objx, GLdouble *objy, GLdouble *objz) +{ + double finalMatrix[16]; + double in[4]; + double out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); + + in[0]=winx; + in[1]=winy; + in[2]=winz; + in[3]=1.0; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) return(GL_FALSE); + out[0] /= out[3]; + out[1] /= out[3]; + out[2] /= out[3]; + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + return(GL_TRUE); +} + +GLint GLAPIENTRY +gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLclampd nearVal, GLclampd farVal, + GLdouble *objx, GLdouble *objy, GLdouble *objz, + GLdouble *objw) +{ + double finalMatrix[16]; + double in[4]; + double out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); + + in[0]=winx; + in[1]=winy; + in[2]=winz; + in[3]=clipw; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + in[2] = (in[2] - nearVal) / (farVal - nearVal); + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) return(GL_FALSE); + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + *objw = out[3]; + return(GL_TRUE); +} + +void GLAPIENTRY +gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, + GLint viewport[4]) +{ + if (deltax <= 0 || deltay <= 0) { + return; + } + + /* Translate and scale the picked region to the entire window */ + glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, + (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); + glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/quad.c xpsb-glx-0.19/mesa/src/glu/sgi/libutil/quad.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/quad.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/quad.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,1155 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "gluos.h" +#include "gluint.h" +#include +#include +#include +#include +#include + +/* Make it not a power of two to avoid cache thrashing on the chip */ +#define CACHE_SIZE 240 + +#undef PI +#define PI 3.14159265358979323846 + +struct GLUquadric { + GLint normals; + GLboolean textureCoords; + GLint orientation; + GLint drawStyle; + void (GLAPIENTRY *errorCallback)( GLint ); +}; + +GLUquadric * GLAPIENTRY +gluNewQuadric(void) +{ + GLUquadric *newstate; + + newstate = (GLUquadric *) malloc(sizeof(GLUquadric)); + if (newstate == NULL) { + /* Can't report an error at this point... */ + return NULL; + } + newstate->normals = GLU_SMOOTH; + newstate->textureCoords = GL_FALSE; + newstate->orientation = GLU_OUTSIDE; + newstate->drawStyle = GLU_FILL; + newstate->errorCallback = NULL; + return newstate; +} + + +void GLAPIENTRY +gluDeleteQuadric(GLUquadric *state) +{ + free(state); +} + +static void gluQuadricError(GLUquadric *qobj, GLenum which) +{ + if (qobj->errorCallback) { + qobj->errorCallback(which); + } +} + +void GLAPIENTRY +gluQuadricCallback(GLUquadric *qobj, GLenum which, _GLUfuncptr fn) +{ + switch (which) { + case GLU_ERROR: + qobj->errorCallback = (void (GLAPIENTRY *)(GLint)) fn; + break; + default: + gluQuadricError(qobj, GLU_INVALID_ENUM); + return; + } +} + +void GLAPIENTRY +gluQuadricNormals(GLUquadric *qobj, GLenum normals) +{ + switch (normals) { + case GLU_SMOOTH: + case GLU_FLAT: + case GLU_NONE: + break; + default: + gluQuadricError(qobj, GLU_INVALID_ENUM); + return; + } + qobj->normals = normals; +} + +void GLAPIENTRY +gluQuadricTexture(GLUquadric *qobj, GLboolean textureCoords) +{ + qobj->textureCoords = textureCoords; +} + +void GLAPIENTRY +gluQuadricOrientation(GLUquadric *qobj, GLenum orientation) +{ + switch(orientation) { + case GLU_OUTSIDE: + case GLU_INSIDE: + break; + default: + gluQuadricError(qobj, GLU_INVALID_ENUM); + return; + } + qobj->orientation = orientation; +} + +void GLAPIENTRY +gluQuadricDrawStyle(GLUquadric *qobj, GLenum drawStyle) +{ + switch(drawStyle) { + case GLU_POINT: + case GLU_LINE: + case GLU_FILL: + case GLU_SILHOUETTE: + break; + default: + gluQuadricError(qobj, GLU_INVALID_ENUM); + return; + } + qobj->drawStyle = drawStyle; +} + +void GLAPIENTRY +gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, + GLdouble height, GLint slices, GLint stacks) +{ + GLint i,j; + GLfloat sinCache[CACHE_SIZE]; + GLfloat cosCache[CACHE_SIZE]; + GLfloat sinCache2[CACHE_SIZE]; + GLfloat cosCache2[CACHE_SIZE]; + GLfloat sinCache3[CACHE_SIZE]; + GLfloat cosCache3[CACHE_SIZE]; + GLfloat angle; + GLfloat zLow, zHigh; + GLfloat sintemp, costemp; + GLfloat length; + GLfloat deltaRadius; + GLfloat zNormal; + GLfloat xyNormalRatio; + GLfloat radiusLow, radiusHigh; + int needCache2, needCache3; + + if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1; + + if (slices < 2 || stacks < 1 || baseRadius < 0.0 || topRadius < 0.0 || + height < 0.0) { + gluQuadricError(qobj, GLU_INVALID_VALUE); + return; + } + + /* Compute length (needed for normal calculations) */ + deltaRadius = baseRadius - topRadius; + length = SQRT(deltaRadius*deltaRadius + height*height); + if (length == 0.0) { + gluQuadricError(qobj, GLU_INVALID_VALUE); + return; + } + + /* Cache is the vertex locations cache */ + /* Cache2 is the various normals at the vertices themselves */ + /* Cache3 is the various normals for the faces */ + needCache2 = needCache3 = 0; + if (qobj->normals == GLU_SMOOTH) { + needCache2 = 1; + } + + if (qobj->normals == GLU_FLAT) { + if (qobj->drawStyle != GLU_POINT) { + needCache3 = 1; + } + if (qobj->drawStyle == GLU_LINE) { + needCache2 = 1; + } + } + + zNormal = deltaRadius / length; + xyNormalRatio = height / length; + + for (i = 0; i < slices; i++) { + angle = 2 * PI * i / slices; + if (needCache2) { + if (qobj->orientation == GLU_OUTSIDE) { + sinCache2[i] = xyNormalRatio * SIN(angle); + cosCache2[i] = xyNormalRatio * COS(angle); + } else { + sinCache2[i] = -xyNormalRatio * SIN(angle); + cosCache2[i] = -xyNormalRatio * COS(angle); + } + } + sinCache[i] = SIN(angle); + cosCache[i] = COS(angle); + } + + if (needCache3) { + for (i = 0; i < slices; i++) { + angle = 2 * PI * (i-0.5) / slices; + if (qobj->orientation == GLU_OUTSIDE) { + sinCache3[i] = xyNormalRatio * SIN(angle); + cosCache3[i] = xyNormalRatio * COS(angle); + } else { + sinCache3[i] = -xyNormalRatio * SIN(angle); + cosCache3[i] = -xyNormalRatio * COS(angle); + } + } + } + + sinCache[slices] = sinCache[0]; + cosCache[slices] = cosCache[0]; + if (needCache2) { + sinCache2[slices] = sinCache2[0]; + cosCache2[slices] = cosCache2[0]; + } + if (needCache3) { + sinCache3[slices] = sinCache3[0]; + cosCache3[slices] = cosCache3[0]; + } + + switch (qobj->drawStyle) { + case GLU_FILL: + /* Note: + ** An argument could be made for using a TRIANGLE_FAN for the end + ** of the cylinder of either radii is 0.0 (a cone). However, a + ** TRIANGLE_FAN would not work in smooth shading mode (the common + ** case) because the normal for the apex is different for every + ** triangle (and TRIANGLE_FAN doesn't let me respecify that normal). + ** Now, my choice is GL_TRIANGLES, or leave the GL_QUAD_STRIP and + ** just let the GL trivially reject one of the two triangles of the + ** QUAD. GL_QUAD_STRIP is probably faster, so I will leave this code + ** alone. + */ + for (j = 0; j < stacks; j++) { + zLow = j * height / stacks; + zHigh = (j + 1) * height / stacks; + radiusLow = baseRadius - deltaRadius * ((float) j / stacks); + radiusHigh = baseRadius - deltaRadius * ((float) (j + 1) / stacks); + + glBegin(GL_QUAD_STRIP); + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + glNormal3f(sinCache3[i], cosCache3[i], zNormal); + break; + case GLU_SMOOTH: + glNormal3f(sinCache2[i], cosCache2[i], zNormal); + break; + case GLU_NONE: + default: + break; + } + if (qobj->orientation == GLU_OUTSIDE) { + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) j / stacks); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], zLow); + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) (j+1) / stacks); + } + glVertex3f(radiusHigh * sinCache[i], + radiusHigh * cosCache[i], zHigh); + } else { + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) (j+1) / stacks); + } + glVertex3f(radiusHigh * sinCache[i], + radiusHigh * cosCache[i], zHigh); + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) j / stacks); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], zLow); + } + } + glEnd(); + } + break; + case GLU_POINT: + glBegin(GL_POINTS); + for (i = 0; i < slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + glNormal3f(sinCache2[i], cosCache2[i], zNormal); + break; + case GLU_NONE: + default: + break; + } + sintemp = sinCache[i]; + costemp = cosCache[i]; + for (j = 0; j <= stacks; j++) { + zLow = j * height / stacks; + radiusLow = baseRadius - deltaRadius * ((float) j / stacks); + + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) j / stacks); + } + glVertex3f(radiusLow * sintemp, + radiusLow * costemp, zLow); + } + } + glEnd(); + break; + case GLU_LINE: + for (j = 1; j < stacks; j++) { + zLow = j * height / stacks; + radiusLow = baseRadius - deltaRadius * ((float) j / stacks); + + glBegin(GL_LINE_STRIP); + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + glNormal3f(sinCache3[i], cosCache3[i], zNormal); + break; + case GLU_SMOOTH: + glNormal3f(sinCache2[i], cosCache2[i], zNormal); + break; + case GLU_NONE: + default: + break; + } + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) j / stacks); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], zLow); + } + glEnd(); + } + /* Intentionally fall through here... */ + case GLU_SILHOUETTE: + for (j = 0; j <= stacks; j += stacks) { + zLow = j * height / stacks; + radiusLow = baseRadius - deltaRadius * ((float) j / stacks); + + glBegin(GL_LINE_STRIP); + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + glNormal3f(sinCache3[i], cosCache3[i], zNormal); + break; + case GLU_SMOOTH: + glNormal3f(sinCache2[i], cosCache2[i], zNormal); + break; + case GLU_NONE: + default: + break; + } + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) j / stacks); + } + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], + zLow); + } + glEnd(); + } + for (i = 0; i < slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + glNormal3f(sinCache2[i], cosCache2[i], 0.0); + break; + case GLU_NONE: + default: + break; + } + sintemp = sinCache[i]; + costemp = cosCache[i]; + glBegin(GL_LINE_STRIP); + for (j = 0; j <= stacks; j++) { + zLow = j * height / stacks; + radiusLow = baseRadius - deltaRadius * ((float) j / stacks); + + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + (float) j / stacks); + } + glVertex3f(radiusLow * sintemp, + radiusLow * costemp, zLow); + } + glEnd(); + } + break; + default: + break; + } +} + +void GLAPIENTRY +gluDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, + GLint slices, GLint loops) +{ + gluPartialDisk(qobj, innerRadius, outerRadius, slices, loops, 0.0, 360.0); +} + +void GLAPIENTRY +gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, + GLdouble outerRadius, GLint slices, GLint loops, + GLdouble startAngle, GLdouble sweepAngle) +{ + GLint i,j; + GLfloat sinCache[CACHE_SIZE]; + GLfloat cosCache[CACHE_SIZE]; + GLfloat angle; + GLfloat sintemp, costemp; + GLfloat deltaRadius; + GLfloat radiusLow, radiusHigh; + GLfloat texLow = 0.0, texHigh = 0.0; + GLfloat angleOffset; + GLint slices2; + GLint finish; + + if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1; + if (slices < 2 || loops < 1 || outerRadius <= 0.0 || innerRadius < 0.0 || + innerRadius > outerRadius) { + gluQuadricError(qobj, GLU_INVALID_VALUE); + return; + } + + if (sweepAngle < -360.0) sweepAngle = 360.0; + if (sweepAngle > 360.0) sweepAngle = 360.0; + if (sweepAngle < 0) { + startAngle += sweepAngle; + sweepAngle = -sweepAngle; + } + + if (sweepAngle == 360.0) { + slices2 = slices; + } else { + slices2 = slices + 1; + } + + /* Compute length (needed for normal calculations) */ + deltaRadius = outerRadius - innerRadius; + + /* Cache is the vertex locations cache */ + + angleOffset = startAngle / 180.0 * PI; + for (i = 0; i <= slices; i++) { + angle = angleOffset + ((PI * sweepAngle) / 180.0) * i / slices; + sinCache[i] = SIN(angle); + cosCache[i] = COS(angle); + } + + if (sweepAngle == 360.0) { + sinCache[slices] = sinCache[0]; + cosCache[slices] = cosCache[0]; + } + + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + if (qobj->orientation == GLU_OUTSIDE) { + glNormal3f(0.0, 0.0, 1.0); + } else { + glNormal3f(0.0, 0.0, -1.0); + } + break; + default: + case GLU_NONE: + break; + } + + switch (qobj->drawStyle) { + case GLU_FILL: + if (innerRadius == 0.0) { + finish = loops - 1; + /* Triangle strip for inner polygons */ + glBegin(GL_TRIANGLE_FAN); + if (qobj->textureCoords) { + glTexCoord2f(0.5, 0.5); + } + glVertex3f(0.0, 0.0, 0.0); + radiusLow = outerRadius - + deltaRadius * ((float) (loops-1) / loops); + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + } + + if (qobj->orientation == GLU_OUTSIDE) { + for (i = slices; i >= 0; i--) { + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], 0.0); + } + } else { + for (i = 0; i <= slices; i++) { + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], 0.0); + } + } + glEnd(); + } else { + finish = loops; + } + for (j = 0; j < finish; j++) { + radiusLow = outerRadius - deltaRadius * ((float) j / loops); + radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops); + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + texHigh = radiusHigh / outerRadius / 2; + } + + glBegin(GL_QUAD_STRIP); + for (i = 0; i <= slices; i++) { + if (qobj->orientation == GLU_OUTSIDE) { + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], 0.0); + + if (qobj->textureCoords) { + glTexCoord2f(texHigh * sinCache[i] + 0.5, + texHigh * cosCache[i] + 0.5); + } + glVertex3f(radiusHigh * sinCache[i], + radiusHigh * cosCache[i], 0.0); + } else { + if (qobj->textureCoords) { + glTexCoord2f(texHigh * sinCache[i] + 0.5, + texHigh * cosCache[i] + 0.5); + } + glVertex3f(radiusHigh * sinCache[i], + radiusHigh * cosCache[i], 0.0); + + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], 0.0); + } + } + glEnd(); + } + break; + case GLU_POINT: + glBegin(GL_POINTS); + for (i = 0; i < slices2; i++) { + sintemp = sinCache[i]; + costemp = cosCache[i]; + for (j = 0; j <= loops; j++) { + radiusLow = outerRadius - deltaRadius * ((float) j / loops); + + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0); + } + } + glEnd(); + break; + case GLU_LINE: + if (innerRadius == outerRadius) { + glBegin(GL_LINE_STRIP); + + for (i = 0; i <= slices; i++) { + if (qobj->textureCoords) { + glTexCoord2f(sinCache[i] / 2 + 0.5, + cosCache[i] / 2 + 0.5); + } + glVertex3f(innerRadius * sinCache[i], + innerRadius * cosCache[i], 0.0); + } + glEnd(); + break; + } + for (j = 0; j <= loops; j++) { + radiusLow = outerRadius - deltaRadius * ((float) j / loops); + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + } + + glBegin(GL_LINE_STRIP); + for (i = 0; i <= slices; i++) { + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], 0.0); + } + glEnd(); + } + for (i=0; i < slices2; i++) { + sintemp = sinCache[i]; + costemp = cosCache[i]; + glBegin(GL_LINE_STRIP); + for (j = 0; j <= loops; j++) { + radiusLow = outerRadius - deltaRadius * ((float) j / loops); + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + } + + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0); + } + glEnd(); + } + break; + case GLU_SILHOUETTE: + if (sweepAngle < 360.0) { + for (i = 0; i <= slices; i+= slices) { + sintemp = sinCache[i]; + costemp = cosCache[i]; + glBegin(GL_LINE_STRIP); + for (j = 0; j <= loops; j++) { + radiusLow = outerRadius - deltaRadius * ((float) j / loops); + + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0); + } + glEnd(); + } + } + for (j = 0; j <= loops; j += loops) { + radiusLow = outerRadius - deltaRadius * ((float) j / loops); + if (qobj->textureCoords) { + texLow = radiusLow / outerRadius / 2; + } + + glBegin(GL_LINE_STRIP); + for (i = 0; i <= slices; i++) { + if (qobj->textureCoords) { + glTexCoord2f(texLow * sinCache[i] + 0.5, + texLow * cosCache[i] + 0.5); + } + glVertex3f(radiusLow * sinCache[i], + radiusLow * cosCache[i], 0.0); + } + glEnd(); + if (innerRadius == outerRadius) break; + } + break; + default: + break; + } +} + +void GLAPIENTRY +gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) +{ + GLint i,j; + GLfloat sinCache1a[CACHE_SIZE]; + GLfloat cosCache1a[CACHE_SIZE]; + GLfloat sinCache2a[CACHE_SIZE]; + GLfloat cosCache2a[CACHE_SIZE]; + GLfloat sinCache3a[CACHE_SIZE]; + GLfloat cosCache3a[CACHE_SIZE]; + GLfloat sinCache1b[CACHE_SIZE]; + GLfloat cosCache1b[CACHE_SIZE]; + GLfloat sinCache2b[CACHE_SIZE]; + GLfloat cosCache2b[CACHE_SIZE]; + GLfloat sinCache3b[CACHE_SIZE]; + GLfloat cosCache3b[CACHE_SIZE]; + GLfloat angle; + GLfloat zLow, zHigh; + GLfloat sintemp1 = 0.0, sintemp2 = 0.0, sintemp3 = 0.0, sintemp4 = 0.0; + GLfloat costemp1 = 0.0, costemp2 = 0.0, costemp3 = 0.0, costemp4 = 0.0; + GLboolean needCache2, needCache3; + GLint start, finish; + + if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1; + if (stacks >= CACHE_SIZE) stacks = CACHE_SIZE-1; + if (slices < 2 || stacks < 1 || radius < 0.0) { + gluQuadricError(qobj, GLU_INVALID_VALUE); + return; + } + + /* Cache is the vertex locations cache */ + /* Cache2 is the various normals at the vertices themselves */ + /* Cache3 is the various normals for the faces */ + needCache2 = needCache3 = GL_FALSE; + + if (qobj->normals == GLU_SMOOTH) { + needCache2 = GL_TRUE; + } + + if (qobj->normals == GLU_FLAT) { + if (qobj->drawStyle != GLU_POINT) { + needCache3 = GL_TRUE; + } + if (qobj->drawStyle == GLU_LINE) { + needCache2 = GL_TRUE; + } + } + + for (i = 0; i < slices; i++) { + angle = 2 * PI * i / slices; + sinCache1a[i] = SIN(angle); + cosCache1a[i] = COS(angle); + if (needCache2) { + sinCache2a[i] = sinCache1a[i]; + cosCache2a[i] = cosCache1a[i]; + } + } + + for (j = 0; j <= stacks; j++) { + angle = PI * j / stacks; + if (needCache2) { + if (qobj->orientation == GLU_OUTSIDE) { + sinCache2b[j] = SIN(angle); + cosCache2b[j] = COS(angle); + } else { + sinCache2b[j] = -SIN(angle); + cosCache2b[j] = -COS(angle); + } + } + sinCache1b[j] = radius * SIN(angle); + cosCache1b[j] = radius * COS(angle); + } + /* Make sure it comes to a point */ + sinCache1b[0] = 0; + sinCache1b[stacks] = 0; + + if (needCache3) { + for (i = 0; i < slices; i++) { + angle = 2 * PI * (i-0.5) / slices; + sinCache3a[i] = SIN(angle); + cosCache3a[i] = COS(angle); + } + for (j = 0; j <= stacks; j++) { + angle = PI * (j - 0.5) / stacks; + if (qobj->orientation == GLU_OUTSIDE) { + sinCache3b[j] = SIN(angle); + cosCache3b[j] = COS(angle); + } else { + sinCache3b[j] = -SIN(angle); + cosCache3b[j] = -COS(angle); + } + } + } + + sinCache1a[slices] = sinCache1a[0]; + cosCache1a[slices] = cosCache1a[0]; + if (needCache2) { + sinCache2a[slices] = sinCache2a[0]; + cosCache2a[slices] = cosCache2a[0]; + } + if (needCache3) { + sinCache3a[slices] = sinCache3a[0]; + cosCache3a[slices] = cosCache3a[0]; + } + + switch (qobj->drawStyle) { + case GLU_FILL: + /* Do ends of sphere as TRIANGLE_FAN's (if not texturing) + ** We don't do it when texturing because we need to respecify the + ** texture coordinates of the apex for every adjacent vertex (because + ** it isn't a constant for that point) + */ + if (!(qobj->textureCoords)) { + start = 1; + finish = stacks - 1; + + /* Low end first (j == 0 iteration) */ + sintemp2 = sinCache1b[1]; + zHigh = cosCache1b[1]; + switch(qobj->normals) { + case GLU_FLAT: + sintemp3 = sinCache3b[1]; + costemp3 = cosCache3b[1]; + break; + case GLU_SMOOTH: + sintemp3 = sinCache2b[1]; + costemp3 = cosCache2b[1]; + glNormal3f(sinCache2a[0] * sinCache2b[0], + cosCache2a[0] * sinCache2b[0], + cosCache2b[0]); + break; + default: + break; + } + glBegin(GL_TRIANGLE_FAN); + glVertex3f(0.0, 0.0, radius); + if (qobj->orientation == GLU_OUTSIDE) { + for (i = slices; i >= 0; i--) { + switch(qobj->normals) { + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp3, + cosCache2a[i] * sintemp3, + costemp3); + break; + case GLU_FLAT: + if (i != slices) { + glNormal3f(sinCache3a[i+1] * sintemp3, + cosCache3a[i+1] * sintemp3, + costemp3); + } + break; + case GLU_NONE: + default: + break; + } + glVertex3f(sintemp2 * sinCache1a[i], + sintemp2 * cosCache1a[i], zHigh); + } + } else { + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp3, + cosCache2a[i] * sintemp3, + costemp3); + break; + case GLU_FLAT: + glNormal3f(sinCache3a[i] * sintemp3, + cosCache3a[i] * sintemp3, + costemp3); + break; + case GLU_NONE: + default: + break; + } + glVertex3f(sintemp2 * sinCache1a[i], + sintemp2 * cosCache1a[i], zHigh); + } + } + glEnd(); + + /* High end next (j == stacks-1 iteration) */ + sintemp2 = sinCache1b[stacks-1]; + zHigh = cosCache1b[stacks-1]; + switch(qobj->normals) { + case GLU_FLAT: + sintemp3 = sinCache3b[stacks]; + costemp3 = cosCache3b[stacks]; + break; + case GLU_SMOOTH: + sintemp3 = sinCache2b[stacks-1]; + costemp3 = cosCache2b[stacks-1]; + glNormal3f(sinCache2a[stacks] * sinCache2b[stacks], + cosCache2a[stacks] * sinCache2b[stacks], + cosCache2b[stacks]); + break; + default: + break; + } + glBegin(GL_TRIANGLE_FAN); + glVertex3f(0.0, 0.0, -radius); + if (qobj->orientation == GLU_OUTSIDE) { + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp3, + cosCache2a[i] * sintemp3, + costemp3); + break; + case GLU_FLAT: + glNormal3f(sinCache3a[i] * sintemp3, + cosCache3a[i] * sintemp3, + costemp3); + break; + case GLU_NONE: + default: + break; + } + glVertex3f(sintemp2 * sinCache1a[i], + sintemp2 * cosCache1a[i], zHigh); + } + } else { + for (i = slices; i >= 0; i--) { + switch(qobj->normals) { + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp3, + cosCache2a[i] * sintemp3, + costemp3); + break; + case GLU_FLAT: + if (i != slices) { + glNormal3f(sinCache3a[i+1] * sintemp3, + cosCache3a[i+1] * sintemp3, + costemp3); + } + break; + case GLU_NONE: + default: + break; + } + glVertex3f(sintemp2 * sinCache1a[i], + sintemp2 * cosCache1a[i], zHigh); + } + } + glEnd(); + } else { + start = 0; + finish = stacks; + } + for (j = start; j < finish; j++) { + zLow = cosCache1b[j]; + zHigh = cosCache1b[j+1]; + sintemp1 = sinCache1b[j]; + sintemp2 = sinCache1b[j+1]; + switch(qobj->normals) { + case GLU_FLAT: + sintemp4 = sinCache3b[j+1]; + costemp4 = cosCache3b[j+1]; + break; + case GLU_SMOOTH: + if (qobj->orientation == GLU_OUTSIDE) { + sintemp3 = sinCache2b[j+1]; + costemp3 = cosCache2b[j+1]; + sintemp4 = sinCache2b[j]; + costemp4 = cosCache2b[j]; + } else { + sintemp3 = sinCache2b[j]; + costemp3 = cosCache2b[j]; + sintemp4 = sinCache2b[j+1]; + costemp4 = cosCache2b[j+1]; + } + break; + default: + break; + } + + glBegin(GL_QUAD_STRIP); + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp3, + cosCache2a[i] * sintemp3, + costemp3); + break; + case GLU_FLAT: + case GLU_NONE: + default: + break; + } + if (qobj->orientation == GLU_OUTSIDE) { + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) (j+1) / stacks); + } + glVertex3f(sintemp2 * sinCache1a[i], + sintemp2 * cosCache1a[i], zHigh); + } else { + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) j / stacks); + } + glVertex3f(sintemp1 * sinCache1a[i], + sintemp1 * cosCache1a[i], zLow); + } + switch(qobj->normals) { + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp4, + cosCache2a[i] * sintemp4, + costemp4); + break; + case GLU_FLAT: + glNormal3f(sinCache3a[i] * sintemp4, + cosCache3a[i] * sintemp4, + costemp4); + break; + case GLU_NONE: + default: + break; + } + if (qobj->orientation == GLU_OUTSIDE) { + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) j / stacks); + } + glVertex3f(sintemp1 * sinCache1a[i], + sintemp1 * cosCache1a[i], zLow); + } else { + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) (j+1) / stacks); + } + glVertex3f(sintemp2 * sinCache1a[i], + sintemp2 * cosCache1a[i], zHigh); + } + } + glEnd(); + } + break; + case GLU_POINT: + glBegin(GL_POINTS); + for (j = 0; j <= stacks; j++) { + sintemp1 = sinCache1b[j]; + costemp1 = cosCache1b[j]; + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + sintemp2 = sinCache2b[j]; + costemp2 = cosCache2b[j]; + break; + default: + break; + } + for (i = 0; i < slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp2, + cosCache2a[i] * sintemp2, + costemp2); + break; + case GLU_NONE: + default: + break; + } + + zLow = j * radius / stacks; + + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) j / stacks); + } + glVertex3f(sintemp1 * sinCache1a[i], + sintemp1 * cosCache1a[i], costemp1); + } + } + glEnd(); + break; + case GLU_LINE: + case GLU_SILHOUETTE: + for (j = 1; j < stacks; j++) { + sintemp1 = sinCache1b[j]; + costemp1 = cosCache1b[j]; + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + sintemp2 = sinCache2b[j]; + costemp2 = cosCache2b[j]; + break; + default: + break; + } + + glBegin(GL_LINE_STRIP); + for (i = 0; i <= slices; i++) { + switch(qobj->normals) { + case GLU_FLAT: + glNormal3f(sinCache3a[i] * sintemp2, + cosCache3a[i] * sintemp2, + costemp2); + break; + case GLU_SMOOTH: + glNormal3f(sinCache2a[i] * sintemp2, + cosCache2a[i] * sintemp2, + costemp2); + break; + case GLU_NONE: + default: + break; + } + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) j / stacks); + } + glVertex3f(sintemp1 * sinCache1a[i], + sintemp1 * cosCache1a[i], costemp1); + } + glEnd(); + } + for (i = 0; i < slices; i++) { + sintemp1 = sinCache1a[i]; + costemp1 = cosCache1a[i]; + switch(qobj->normals) { + case GLU_FLAT: + case GLU_SMOOTH: + sintemp2 = sinCache2a[i]; + costemp2 = cosCache2a[i]; + break; + default: + break; + } + + glBegin(GL_LINE_STRIP); + for (j = 0; j <= stacks; j++) { + switch(qobj->normals) { + case GLU_FLAT: + glNormal3f(sintemp2 * sinCache3b[j], + costemp2 * sinCache3b[j], + cosCache3b[j]); + break; + case GLU_SMOOTH: + glNormal3f(sintemp2 * sinCache2b[j], + costemp2 * sinCache2b[j], + cosCache2b[j]); + break; + case GLU_NONE: + default: + break; + } + + if (qobj->textureCoords) { + glTexCoord2f(1 - (float) i / slices, + 1 - (float) j / stacks); + } + glVertex3f(sintemp1 * sinCache1b[j], + costemp1 * sinCache1b[j], cosCache1b[j]); + } + glEnd(); + } + break; + default: + break; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/libutil/registry.c xpsb-glx-0.19/mesa/src/glu/sgi/libutil/registry.c --- xpsb-glx-0.19/mesa/src/glu/sgi/libutil/registry.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/libutil/registry.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,91 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "gluos.h" +#include +#include +#include +#include + +static const GLubyte versionString[] = "1.3"; +static const GLubyte extensionString[] = + "GLU_EXT_nurbs_tessellator " + "GLU_EXT_object_space_tess " + ; + +const GLubyte * GLAPIENTRY +gluGetString(GLenum name) +{ + + if (name == GLU_VERSION) { + return versionString; + } else if (name == GLU_EXTENSIONS) { + return extensionString; + } + return NULL; +} + +/* extName is an extension name. + * extString is a string of extensions separated by blank(s). There may or + * may not be leading or trailing blank(s) in extString. + * This works in cases of extensions being prefixes of another like + * GL_EXT_texture and GL_EXT_texture3D. + * Returns GL_TRUE if extName is found otherwise it returns GL_FALSE. + */ +GLboolean GLAPIENTRY +gluCheckExtension(const GLubyte *extName, const GLubyte *extString) +{ + GLboolean flag = GL_FALSE; + char *word; + char *lookHere; + char *deleteThis; + + if (extString == NULL) return GL_FALSE; + + deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1); + if (lookHere == NULL) + return GL_FALSE; + /* strtok() will modify string, so copy it somewhere */ + strcpy(lookHere,(const char *)extString); + + while ((word= strtok(lookHere," ")) != NULL) { + if (strcmp(word,(const char *)extName) == 0) { + flag = GL_TRUE; + break; + } + lookHere = NULL; /* get next token */ + } + free((void *)deleteThis); + return flag; +} /* gluCheckExtension() */ + + + +/*** registry.c ***/ diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/Makefile xpsb-glx-0.19/mesa/src/glu/sgi/Makefile --- xpsb-glx-0.19/mesa/src/glu/sgi/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,149 @@ +# src/glu/sgi/Makefile + +.SUFFIXES : .cc + +TOP = ../../.. + +include $(TOP)/configs/current + +GLU_MAJOR = 1 +GLU_MINOR = 3 +GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +INCDIRS = -I$(TOP)/include -Iinclude -Iinternals -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess + +C_SOURCES = \ + libutil/error.c \ + libutil/glue.c \ + libutil/mipmap.c \ + libutil/project.c \ + libutil/quad.c \ + libutil/registry.c \ + libtess/dict.c \ + libtess/geom.c \ + libtess/memalloc.c \ + libtess/mesh.c \ + libtess/normal.c \ + libtess/priorityq.c \ + libtess/render.c \ + libtess/sweep.c \ + libtess/tess.c \ + libtess/tessmono.c + +CC_SOURCES = \ + libnurbs/interface/bezierEval.cc \ + libnurbs/interface/bezierPatch.cc \ + libnurbs/interface/bezierPatchMesh.cc \ + libnurbs/interface/glcurveval.cc \ + libnurbs/interface/glinterface.cc \ + libnurbs/interface/glrenderer.cc \ + libnurbs/interface/glsurfeval.cc \ + libnurbs/interface/incurveeval.cc \ + libnurbs/interface/insurfeval.cc \ + libnurbs/internals/arc.cc \ + libnurbs/internals/arcsorter.cc \ + libnurbs/internals/arctess.cc \ + libnurbs/internals/backend.cc \ + libnurbs/internals/basiccrveval.cc \ + libnurbs/internals/basicsurfeval.cc \ + libnurbs/internals/bin.cc \ + libnurbs/internals/bufpool.cc \ + libnurbs/internals/cachingeval.cc \ + libnurbs/internals/ccw.cc \ + libnurbs/internals/coveandtiler.cc \ + libnurbs/internals/curve.cc \ + libnurbs/internals/curvelist.cc \ + libnurbs/internals/curvesub.cc \ + libnurbs/internals/dataTransform.cc \ + libnurbs/internals/displaylist.cc \ + libnurbs/internals/flist.cc \ + libnurbs/internals/flistsorter.cc \ + libnurbs/internals/hull.cc \ + libnurbs/internals/intersect.cc \ + libnurbs/internals/knotvector.cc \ + libnurbs/internals/mapdesc.cc \ + libnurbs/internals/mapdescv.cc \ + libnurbs/internals/maplist.cc \ + libnurbs/internals/mesher.cc \ + libnurbs/internals/monoTriangulationBackend.cc \ + libnurbs/internals/monotonizer.cc \ + libnurbs/internals/mycode.cc \ + libnurbs/internals/nurbsinterfac.cc \ + libnurbs/internals/nurbstess.cc \ + libnurbs/internals/patch.cc \ + libnurbs/internals/patchlist.cc \ + libnurbs/internals/quilt.cc \ + libnurbs/internals/reader.cc \ + libnurbs/internals/renderhints.cc \ + libnurbs/internals/slicer.cc \ + libnurbs/internals/sorter.cc \ + libnurbs/internals/splitarcs.cc \ + libnurbs/internals/subdivider.cc \ + libnurbs/internals/tobezier.cc \ + libnurbs/internals/trimline.cc \ + libnurbs/internals/trimregion.cc \ + libnurbs/internals/trimvertpool.cc \ + libnurbs/internals/uarray.cc \ + libnurbs/internals/varray.cc \ + libnurbs/nurbtess/directedLine.cc \ + libnurbs/nurbtess/gridWrap.cc \ + libnurbs/nurbtess/monoChain.cc \ + libnurbs/nurbtess/monoPolyPart.cc \ + libnurbs/nurbtess/monoTriangulation.cc \ + libnurbs/nurbtess/partitionX.cc \ + libnurbs/nurbtess/partitionY.cc \ + libnurbs/nurbtess/polyDBG.cc \ + libnurbs/nurbtess/polyUtil.cc \ + libnurbs/nurbtess/primitiveStream.cc \ + libnurbs/nurbtess/quicksort.cc \ + libnurbs/nurbtess/rectBlock.cc \ + libnurbs/nurbtess/sampleComp.cc \ + libnurbs/nurbtess/sampleCompBot.cc \ + libnurbs/nurbtess/sampleCompRight.cc \ + libnurbs/nurbtess/sampleCompTop.cc \ + libnurbs/nurbtess/sampleMonoPoly.cc \ + libnurbs/nurbtess/sampledLine.cc \ + libnurbs/nurbtess/searchTree.cc + +SOURCES = $(C_SOURCES) $(CC_SOURCES) + +C_OBJECTS = $(C_SOURCES:.c=.o) +CC_OBJECTS = $(CC_SOURCES:.cc=.o) +OBJECTS = $(C_OBJECTS) $(CC_OBJECTS) + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCDIRS) $(CFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@ + +.cc.o: + $(CXX) -c $(INCDIRS) $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@ + + +##### TARGETS ##### + +default: + @if [ "${CONFIG_NAME}" = "beos" ] ; then \ + echo "$(GLU_LIB_NAME) not build under BeOS, but integrated into ${GL_LIB_NAME}." ; \ + exit 0 ; \ + else \ + $(MAKE) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) || exit 1 ; \ + fi + +$(TOP)/$(LIB_DIR): + -mkdir $(TOP)/$(LIB_DIR) + +# Make the library: +$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) + $(MKLIB) -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ + -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ + -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + -exports glu.exports -id $(INSTALL_LIB_DIR)/lib$(GLU_LIB).$(GLU_MAJOR).dylib \ + $(GLU_LIB_DEPS) $(OBJECTS) + + +clean: + -rm -f *.o */*.o */*/*.o + -rm -f *.lo */*.lo */*/*.lo + -rm -f *.la */*.la */*/*.la diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.DJ xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.DJ --- xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.DJ 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.DJ 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,188 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 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. + +# DOS/DJGPP glu makefile v1.5 for Mesa +# +# Copyright (C) 2002 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# Targets: +# all: build GLU +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = ../../.. +LIBDIR = $(TOP)/lib +GLU_LIB = libglu.a +GLU_DXE = glu.dxe +GLU_IMP = libiglu.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib + +CC = gcc +CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude +CXX = gpp +CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess + +AR = ar +ARFLAGS = crus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +C_SOURCES = \ + libutil/error.c \ + libutil/glue.c \ + libutil/mipmap.c \ + libutil/project.c \ + libutil/quad.c \ + libutil/registry.c \ + libtess/dict.c \ + libtess/geom.c \ + libtess/memalloc.c \ + libtess/mesh.c \ + libtess/normal.c \ + libtess/priorityq.c \ + libtess/render.c \ + libtess/sweep.c \ + libtess/tess.c \ + libtess/tessmono.c + +CC_SOURCES = \ + libnurbs/interface/bezierEval.cc \ + libnurbs/interface/bezierPatch.cc \ + libnurbs/interface/bezierPatchMesh.cc \ + libnurbs/interface/glcurveval.cc \ + libnurbs/interface/glinterface.cc \ + libnurbs/interface/glrenderer.cc \ + libnurbs/interface/glsurfeval.cc \ + libnurbs/interface/incurveeval.cc \ + libnurbs/interface/insurfeval.cc \ + libnurbs/internals/arc.cc \ + libnurbs/internals/arcsorter.cc \ + libnurbs/internals/arctess.cc \ + libnurbs/internals/backend.cc \ + libnurbs/internals/basiccrveval.cc \ + libnurbs/internals/basicsurfeval.cc \ + libnurbs/internals/bin.cc \ + libnurbs/internals/bufpool.cc \ + libnurbs/internals/cachingeval.cc \ + libnurbs/internals/ccw.cc \ + libnurbs/internals/coveandtiler.cc \ + libnurbs/internals/curve.cc \ + libnurbs/internals/curvelist.cc \ + libnurbs/internals/curvesub.cc \ + libnurbs/internals/dataTransform.cc \ + libnurbs/internals/displaylist.cc \ + libnurbs/internals/flist.cc \ + libnurbs/internals/flistsorter.cc \ + libnurbs/internals/hull.cc \ + libnurbs/internals/intersect.cc \ + libnurbs/internals/knotvector.cc \ + libnurbs/internals/mapdesc.cc \ + libnurbs/internals/mapdescv.cc \ + libnurbs/internals/maplist.cc \ + libnurbs/internals/mesher.cc \ + libnurbs/internals/monoTriangulationBackend.cc \ + libnurbs/internals/monotonizer.cc \ + libnurbs/internals/mycode.cc \ + libnurbs/internals/nurbsinterfac.cc \ + libnurbs/internals/nurbstess.cc \ + libnurbs/internals/patch.cc \ + libnurbs/internals/patchlist.cc \ + libnurbs/internals/quilt.cc \ + libnurbs/internals/reader.cc \ + libnurbs/internals/renderhints.cc \ + libnurbs/internals/slicer.cc \ + libnurbs/internals/sorter.cc \ + libnurbs/internals/splitarcs.cc \ + libnurbs/internals/subdivider.cc \ + libnurbs/internals/tobezier.cc \ + libnurbs/internals/trimline.cc \ + libnurbs/internals/trimregion.cc \ + libnurbs/internals/trimvertpool.cc \ + libnurbs/internals/uarray.cc \ + libnurbs/internals/varray.cc \ + libnurbs/nurbtess/directedLine.cc \ + libnurbs/nurbtess/gridWrap.cc \ + libnurbs/nurbtess/monoChain.cc \ + libnurbs/nurbtess/monoPolyPart.cc \ + libnurbs/nurbtess/monoTriangulation.cc \ + libnurbs/nurbtess/partitionX.cc \ + libnurbs/nurbtess/partitionY.cc \ + libnurbs/nurbtess/polyDBG.cc \ + libnurbs/nurbtess/polyUtil.cc \ + libnurbs/nurbtess/primitiveStream.cc \ + libnurbs/nurbtess/quicksort.cc \ + libnurbs/nurbtess/rectBlock.cc \ + libnurbs/nurbtess/sampleComp.cc \ + libnurbs/nurbtess/sampleCompBot.cc \ + libnurbs/nurbtess/sampleCompRight.cc \ + libnurbs/nurbtess/sampleCompTop.cc \ + libnurbs/nurbtess/sampleMonoPoly.cc \ + libnurbs/nurbtess/sampledLine.cc \ + libnurbs/nurbtess/searchTree.cc + +SOURCES = $(C_SOURCES) $(CC_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.cc.o: + $(CXX) -o $@ $(CXXFLAGS) -c $< + +all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) + +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GLU_DXE)) +else + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $^ +endif + +clean: + -$(call UNLINK,libutil/*.o) + -$(call UNLINK,libtess/*.o) + -$(call UNLINK,libnurbs/interface/*.o) + -$(call UNLINK,libnurbs/internals/*.o) + -$(call UNLINK,libnurbs/nurbtess/*.o) diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.mgw xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.mgw --- xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.mgw 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.mgw 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,230 @@ +# Mesa 3-D graphics library +# Version: 5.1 +# +# Copyright (C) 1999-2003 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. + +# MinGW core makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + +# MinGW core-glu makefile updated for Mesa 7.0 +# +# Updated : by Heromyth, on 2007-7-21 +# Email : zxpmyth@yahoo.com.cn +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# The others havn't been tested yet. +# 2) The generated DLLs are *not* compatible with the ones built +# with the other compilers like VC8, especially for GLUT. +# 3) Although more tests are needed, it can be used individually! + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most WMesa code and requires fxMesa. +# As a consequence, you'll need the Win32 Glide3 +# library to build any application. +# default = no +# ICD=1 build the installable client driver interface +# (windows opengl driver interface) +# default = no +# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). +# default = no +# +# Targets: +# all: build GL +# clean: remove object files +# + + + +.PHONY: all clean +.INTERMEDIATE: x86/gen_matypes.exe +.SUFFIXES: .rc .res + +# Set this to the prefix of your build tools, i.e. mingw32- +TOOLS_PREFIX = mingw32- + +TOP = ../../.. +LIBDIR = $(TOP)/lib + +LIB_NAME = glu32 +DLL_EXT = .dll +IMP_EXT = .a +LIB_PRE = lib +STRIP = -s + +AR = ar +ARFLAGS = crus +DLLTOOL = dlltool + +GLU_DLL = $(LIB_NAME)$(DLL_EXT) +GLU_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT) +GLU_DEF = $(LIB_NAME).def + +LDLIBS = -L$(LIBDIR) -lopengl32 +LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at + +CFLAGS += -DBUILD_GLU32 -D_DLL + + +CC = $(TOOLS_PREFIX)gcc +CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude +CXX = $(TOOLS_PREFIX)g++ +CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess + +AR = ar +ARFLAGS = crus + +UNLINK = del $(subst /,\,$(1)) +ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = $(RM) $(1) +endif +ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) +UNLINK = $(RM) $(1) +endif + +C_SOURCES = \ + libutil/error.c \ + libutil/glue.c \ + libutil/mipmap.c \ + libutil/project.c \ + libutil/quad.c \ + libutil/registry.c \ + libtess/dict.c \ + libtess/geom.c \ + libtess/memalloc.c \ + libtess/mesh.c \ + libtess/normal.c \ + libtess/priorityq.c \ + libtess/render.c \ + libtess/sweep.c \ + libtess/tess.c \ + libtess/tessmono.c + +CC_SOURCES = \ + libnurbs/interface/bezierEval.cc \ + libnurbs/interface/bezierPatch.cc \ + libnurbs/interface/bezierPatchMesh.cc \ + libnurbs/interface/glcurveval.cc \ + libnurbs/interface/glinterface.cc \ + libnurbs/interface/glrenderer.cc \ + libnurbs/interface/glsurfeval.cc \ + libnurbs/interface/incurveeval.cc \ + libnurbs/interface/insurfeval.cc \ + libnurbs/internals/arc.cc \ + libnurbs/internals/arcsorter.cc \ + libnurbs/internals/arctess.cc \ + libnurbs/internals/backend.cc \ + libnurbs/internals/basiccrveval.cc \ + libnurbs/internals/basicsurfeval.cc \ + libnurbs/internals/bin.cc \ + libnurbs/internals/bufpool.cc \ + libnurbs/internals/cachingeval.cc \ + libnurbs/internals/ccw.cc \ + libnurbs/internals/coveandtiler.cc \ + libnurbs/internals/curve.cc \ + libnurbs/internals/curvelist.cc \ + libnurbs/internals/curvesub.cc \ + libnurbs/internals/dataTransform.cc \ + libnurbs/internals/displaylist.cc \ + libnurbs/internals/flist.cc \ + libnurbs/internals/flistsorter.cc \ + libnurbs/internals/hull.cc \ + libnurbs/internals/intersect.cc \ + libnurbs/internals/knotvector.cc \ + libnurbs/internals/mapdesc.cc \ + libnurbs/internals/mapdescv.cc \ + libnurbs/internals/maplist.cc \ + libnurbs/internals/mesher.cc \ + libnurbs/internals/monoTriangulationBackend.cc \ + libnurbs/internals/monotonizer.cc \ + libnurbs/internals/mycode.cc \ + libnurbs/internals/nurbsinterfac.cc \ + libnurbs/internals/nurbstess.cc \ + libnurbs/internals/patch.cc \ + libnurbs/internals/patchlist.cc \ + libnurbs/internals/quilt.cc \ + libnurbs/internals/reader.cc \ + libnurbs/internals/renderhints.cc \ + libnurbs/internals/slicer.cc \ + libnurbs/internals/sorter.cc \ + libnurbs/internals/splitarcs.cc \ + libnurbs/internals/subdivider.cc \ + libnurbs/internals/tobezier.cc \ + libnurbs/internals/trimline.cc \ + libnurbs/internals/trimregion.cc \ + libnurbs/internals/trimvertpool.cc \ + libnurbs/internals/uarray.cc \ + libnurbs/internals/varray.cc \ + libnurbs/nurbtess/directedLine.cc \ + libnurbs/nurbtess/gridWrap.cc \ + libnurbs/nurbtess/monoChain.cc \ + libnurbs/nurbtess/monoPolyPart.cc \ + libnurbs/nurbtess/monoTriangulation.cc \ + libnurbs/nurbtess/partitionX.cc \ + libnurbs/nurbtess/partitionY.cc \ + libnurbs/nurbtess/polyDBG.cc \ + libnurbs/nurbtess/polyUtil.cc \ + libnurbs/nurbtess/primitiveStream.cc \ + libnurbs/nurbtess/quicksort.cc \ + libnurbs/nurbtess/rectBlock.cc \ + libnurbs/nurbtess/sampleComp.cc \ + libnurbs/nurbtess/sampleCompBot.cc \ + libnurbs/nurbtess/sampleCompRight.cc \ + libnurbs/nurbtess/sampleCompTop.cc \ + libnurbs/nurbtess/sampleMonoPoly.cc \ + libnurbs/nurbtess/sampledLine.cc \ + libnurbs/nurbtess/searchTree.cc + +SOURCES = $(C_SOURCES) $(CC_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.cc.o: + $(CXX) -o $@ $(CXXFLAGS) -c $< + + +all: $(LIBDIR) $(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP) + +$(LIBDIR): + mkdir -p $(LIBDIR) + +$(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) + $(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLU_DLL) $^ $(LDLIBS) + $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLU_DEF) $^ + $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLU_IMP) --def $(LIBDIR)/$(GLU_DEF) + + +clean: + -$(call UNLINK,libutil/*.o) + -$(call UNLINK,libtess/*.o) + -$(call UNLINK,libnurbs/interface/*.o) + -$(call UNLINK,libnurbs/internals/*.o) + -$(call UNLINK,libnurbs/nurbtess/*.o) diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.win xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.win --- xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.win 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/Makefile.win 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,149 @@ +# Makefile for Win32 + +!include + +.SUFFIXES : .cc + +TOP = .. + +GLU_SRCS_CC = \ + libnurbs\interface\bezierEval.cc \ + libnurbs\interface\bezierPatch.cc \ + libnurbs\interface\bezierPatchMesh.cc \ + libnurbs\interface\glcurveval.cc \ + libnurbs\interface\glinterface.cc \ + libnurbs\interface\glrenderer.cc \ + libnurbs\interface\glsurfeval.cc \ + libnurbs\interface\incurveeval.cc \ + libnurbs\interface\insurfeval.cc \ + libnurbs\internals\arc.cc \ + libnurbs\internals\arcsorter.cc \ + libnurbs\internals\arctess.cc \ + libnurbs\internals\backend.cc \ + libnurbs\internals\basiccrveval.cc \ + libnurbs\internals\basicsurfeval.cc \ + libnurbs\internals\bin.cc \ + libnurbs\internals\bufpool.cc \ + libnurbs\internals\cachingeval.cc \ + libnurbs\internals\ccw.cc \ + libnurbs\internals\coveandtiler.cc \ + libnurbs\internals\curve.cc \ + libnurbs\internals\curvelist.cc \ + libnurbs\internals\curvesub.cc \ + libnurbs\internals\dataTransform.cc \ + libnurbs\internals\displaylist.cc \ + libnurbs\internals\flist.cc \ + libnurbs\internals\flistsorter.cc \ + libnurbs\internals\hull.cc \ + libnurbs\internals\intersect.cc \ + libnurbs\internals\knotvector.cc \ + libnurbs\internals\mapdesc.cc \ + libnurbs\internals\mapdescv.cc \ + libnurbs\internals\maplist.cc \ + libnurbs\internals\mesher.cc \ + libnurbs\internals\monoTriangulationBackend.cc \ + libnurbs\internals\monotonizer.cc \ + libnurbs\internals\mycode.cc \ + libnurbs\internals\nurbsinterfac.cc \ + libnurbs\internals\nurbstess.cc \ + libnurbs\internals\patch.cc \ + libnurbs\internals\patchlist.cc \ + libnurbs\internals\quilt.cc \ + libnurbs\internals\reader.cc \ + libnurbs\internals\renderhints.cc \ + libnurbs\internals\slicer.cc \ + libnurbs\internals\sorter.cc \ + libnurbs\internals\splitarcs.cc \ + libnurbs\internals\subdivider.cc \ + libnurbs\internals\tobezier.cc \ + libnurbs\internals\trimline.cc \ + libnurbs\internals\trimregion.cc \ + libnurbs\internals\trimvertpool.cc \ + libnurbs\internals\uarray.cc \ + libnurbs\internals\varray.cc \ + libnurbs\nurbtess\directedLine.cc \ + libnurbs\nurbtess\gridWrap.cc \ + libnurbs\nurbtess\monoChain.cc \ + libnurbs\nurbtess\monoPolyPart.cc \ + libnurbs\nurbtess\monoTriangulation.cc \ + libnurbs\nurbtess\partitionX.cc \ + libnurbs\nurbtess\partitionY.cc \ + libnurbs\nurbtess\polyDBG.cc \ + libnurbs\nurbtess\polyUtil.cc \ + libnurbs\nurbtess\primitiveStream.cc \ + libnurbs\nurbtess\quicksort.cc \ + libnurbs\nurbtess\rectBlock.cc \ + libnurbs\nurbtess\sampleComp.cc \ + libnurbs\nurbtess\sampleCompBot.cc \ + libnurbs\nurbtess\sampleCompRight.cc \ + libnurbs\nurbtess\sampleCompTop.cc \ + libnurbs\nurbtess\sampleMonoPoly.cc \ + libnurbs\nurbtess\sampledLine.cc \ + libnurbs\nurbtess\searchTree.cc + +GLU_SRCS = \ + libtess\dict.c \ + libtess\geom.c \ + libtess\memalloc.c \ + libtess\mesh.c \ + libtess\normal.c \ + libtess\priorityq.c \ + libtess\render.c \ + libtess\sweep.c \ + libtess\tess.c \ + libtess\tessmono.c \ + libutil\error.c \ + libutil\glue.c \ + libutil\mipmap.c \ + libutil\project.c \ + libutil\quad.c \ + libutil\registry.c + +SRCS = $(GLU_SRCS) + +all : gludll + +!include "$(TOP)/mesawin32.mak" + +gludll : $(GLUDLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -Iinclude -DBUILD_GL32 -DLIBRARYBUILD +LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS) + +LIBS = ../lib/$(MESALIB) winmm.lib $(guilibsdll) + +OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj) +NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess +CFLAGS = $(CFLAGS) $(NURBSINC) + +$(GLUDLL): $(OBJS) glu.def + $(link) $(LFLAGS) -out:$(GLUDLL) -def:glu.def $(OBJS) $(LIBS) + @echo "copying Mesa GLU dynamic link library to library directory..." + -copy $(GLUDLL) $(TOP)\lib + @echo "copying Mesa GLU import library to library directory..." + -copy $(GLULIB) $(TOP)\lib + +install : $(GLUDLL) $(GLULIB) + @echo "copying Mesa GLU dynamic link library to system directory..." + -copy $(GLUDLL) $(DLLINSTALL) + @echo "copying Mesa GLU header files to include directory..." + -copy ..\..\include\GL\glu.h $(INCLUDEINSTALL) + @echo "copying Mesa GLU import library to system library directory..." + -copy $(GLULIB) $(LIBINSTALL) + +clean :: + @del /f libtess\*.obj libutil\*.obj + @del /f libnurbs\interface\*.obj libnurbs\internals\*.obj + @del /f libnurbs\nurbtess\*.obj + +# override default inference rule with one that writes the object to +# the same subdir as the c file. + +.c.obj : + $(cc) $(CFLAGS) -I. $< /Fo$*.obj + +# /TP is needed for C++ files because MS compiler +# does not recognize .cc as a C++ file. + +.cc.obj : + $(cc) $(CFLAGS) -I. $< /TP /Fo$*.obj diff -Nru xpsb-glx-0.19/mesa/src/glu/sgi/mesaglu.opt xpsb-glx-0.19/mesa/src/glu/sgi/mesaglu.opt --- xpsb-glx-0.19/mesa/src/glu/sgi/mesaglu.opt 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glu/sgi/mesaglu.opt 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,67 @@ +! +! ### UNIVERSAL procedures and global definitions extracted from MESAGL.MAP +! +case_sensitive=YES +symbol_vector = (gluErrorString = PROCEDURE) +symbol_vector = (__gluNURBSErrorString = PROCEDURE) +symbol_vector = (__gluTessErrorString = PROCEDURE) +symbol_vector = (gluBuild3DMipmaps = PROCEDURE) +symbol_vector = (gluBuild3DMipmapLevels = PROCEDURE) +symbol_vector = (gluBuild2DMipmaps = PROCEDURE) +symbol_vector = (gluBuild2DMipmapLevels = PROCEDURE) +symbol_vector = (gluBuild1DMipmaps = PROCEDURE) +symbol_vector = (gluBuild1DMipmapLevels = PROCEDURE) +symbol_vector = (gluScaleImage = PROCEDURE) +symbol_vector = (gluPickMatrix = PROCEDURE) +symbol_vector = (gluUnProject4 = PROCEDURE) +symbol_vector = (gluUnProject = PROCEDURE) +symbol_vector = (gluProject = PROCEDURE) +symbol_vector = (gluLookAt = PROCEDURE) +symbol_vector = (gluPerspective = PROCEDURE) +symbol_vector = (gluOrtho2D = PROCEDURE) +symbol_vector = (gluNewQuadric = PROCEDURE) +symbol_vector = (gluSphere = PROCEDURE) +symbol_vector = (gluPartialDisk = PROCEDURE) +symbol_vector = (gluDisk = PROCEDURE) +symbol_vector = (gluCylinder = PROCEDURE) +symbol_vector = (gluQuadricDrawStyle = PROCEDURE) +symbol_vector = (gluQuadricOrientation = PROCEDURE) +symbol_vector = (gluQuadricTexture = PROCEDURE) +symbol_vector = (gluQuadricNormals = PROCEDURE) +symbol_vector = (gluQuadricCallback = PROCEDURE) +symbol_vector = (gluDeleteQuadric = PROCEDURE) +symbol_vector = (gluGetString = PROCEDURE) +symbol_vector = (gluCheckExtension = PROCEDURE) +symbol_vector = (gluTessEndContour = PROCEDURE) +symbol_vector = (gluTessBeginContour = PROCEDURE) +symbol_vector = (gluTessBeginPolygon = PROCEDURE) +symbol_vector = (gluTessEndPolygon = PROCEDURE) +symbol_vector = (gluEndPolygon = PROCEDURE) +symbol_vector = (gluNextContour = PROCEDURE) +symbol_vector = (gluBeginPolygon = PROCEDURE) +symbol_vector = (gluTessVertex = PROCEDURE) +symbol_vector = (gluTessCallback = PROCEDURE) +symbol_vector = (gluTessNormal = PROCEDURE) +symbol_vector = (gluGetTessProperty = PROCEDURE) +symbol_vector = (gluTessProperty = PROCEDURE) +symbol_vector = (gluDeleteTess = PROCEDURE) +symbol_vector = (gluNewTess = PROCEDURE) +symbol_vector = (gluNurbsCallbackDataEXT = PROCEDURE) +symbol_vector = (gluNurbsCallbackData = PROCEDURE) +symbol_vector = (gluNurbsCallback = PROCEDURE) +symbol_vector = (gluGetNurbsProperty = PROCEDURE) +symbol_vector = (gluNurbsProperty = PROCEDURE) +symbol_vector = (gluLoadSamplingMatrices = PROCEDURE) +symbol_vector = (gluNurbsSurface = PROCEDURE) +symbol_vector = (gluNurbsCurve = PROCEDURE) +symbol_vector = (gluPwlCurve = PROCEDURE) +symbol_vector = (gluEndTrim = PROCEDURE) +symbol_vector = (gluBeginTrim = PROCEDURE) +symbol_vector = (gluEndSurface = PROCEDURE) +symbol_vector = (gluEndCurve = PROCEDURE) +symbol_vector = (gluBeginCurve = PROCEDURE) +symbol_vector = (gluBeginSurface = PROCEDURE) +symbol_vector = (gluDeleteNurbsTessellatorEXT = PROCEDURE) +symbol_vector = (gluDeleteNurbsRenderer = PROCEDURE) +symbol_vector = (gluNewNurbsRenderer = PROCEDURE) +symbol_vector = (glu_LOD_eval_list = PROCEDURE) diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.cpp xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,180 @@ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include "beos_x11.h" + +/* NOTE: These functions require a BApplication to be instantiated first */ +int DisplayWidth() { + BScreen s; + return s.Frame().IntegerWidth() + 1; +} + +int DisplayHeight() { + BScreen s; + return s.Frame().IntegerHeight() + 1; +} + +/* the following function was stolen from the X sources as indicated. */ + +/* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */ + +/* +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. +*/ + +#if 0 // Not used currently... + +/* + *Returns pointer to first char ins search which is also in what, else NULL. + */ +static char *strscan (char *search, char *what) +{ + int i, len = strlen (what); + char c; + + while ((c = *(search++))) { + for (i = 0; i < len; i++) + if (c == what [i]) + return (--search); + } + return (NULL); +} + +#endif + +/* + * XParseGeometry parses strings of the form + * "=x{+-}{+-}", where + * width, height, xoffset, and yoffset are unsigned integers. + * Example: "=80x24+300-49" + * The equal sign is optional. + * It returns a bitmask that indicates which of the four values + * were actually found in the string. For each value found, + * the corresponding argument is updated; for each value + * not found, the corresponding argument is left unchanged. + */ + +static int +ReadInteger(char *string, char **NextString) +{ + register int Result = 0; + int Sign = 1; + + if (*string == '+') + string++; + else if (*string == '-') + { + string++; + Sign = -1; + } + for (; (*string >= '0') && (*string <= '9'); string++) + { + Result = (Result * 10) + (*string - '0'); + } + *NextString = string; + if (Sign >= 0) + return (Result); + else + return (-Result); +} + +int XParseGeometry (char *string, int *x, int *y, + unsigned int *width, unsigned int *height) +{ + int mask = NoValue; + register char *strind; + unsigned int tempWidth=0, tempHeight=0; + int tempX=0, tempY=0; + char *nextCharacter; + + if ( (string == NULL) || (*string == '\0')) return(mask); + if (*string == '=') + string++; /* ignore possible '=' at beg of geometry spec */ + + strind = (char *)string; + if (*strind != '+' && *strind != '-' && *strind != 'x') { + tempWidth = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= WidthValue; + } + + if (*strind == 'x' || *strind == 'X') { + strind++; + tempHeight = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= HeightValue; + } + + if ((*strind == '+') || (*strind == '-')) { + if (*strind == '-') { + strind++; + tempX = -ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= XNegative; + + } + else + { strind++; + tempX = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + } + mask |= XValue; + if ((*strind == '+') || (*strind == '-')) { + if (*strind == '-') { + strind++; + tempY = -ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + mask |= YNegative; + + } + else + { + strind++; + tempY = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + } + mask |= YValue; + } + } + + /* If strind isn't at the end of the string the it's an invalid + geometry specification. */ + + if (*strind != '\0') return (0); + + if (mask & XValue) + *x = tempX; + if (mask & YValue) + *y = tempY; + if (mask & WidthValue) + *width = tempWidth; + if (mask & HeightValue) + *height = tempHeight; + return (mask); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.h xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.h --- xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/beos_x11.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,33 @@ +#ifndef __beos_x11_h__ +#define __beos_x11_h__ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* + * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding + * value (x, y, width, height) was found in the parsed string. +*/ +#define NoValue 0x0000 +#define XValue 0x0001 +#define YValue 0x0002 +#define WidthValue 0x0004 +#define HeightValue 0x0008 +#define AllValues 0x000F +#define XNegative 0x0010 +#define YNegative 0x0020 + +/* Function prototypes. */ + +extern int DisplayWidth(); +extern int DisplayHeight(); + +extern int XParseGeometry( + char* string, + int* x, int* y, + unsigned int* width, unsigned int* height); + +#endif /* __beos_x11_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_8x13.c xpsb-glx-0.19/mesa/src/glut/beos/glut_8x13.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_8x13.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_8x13.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2073 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmap8By13 XXX +#include "glutbitmap.h" +#undef glutBitmap8By13 + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch0data[] = { 0x0 }; +static const BitmapCharRec ch0 = {1,1,0,0,8,ch0data}; +#else +static const BitmapCharRec ch0 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,8,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch127data[] = { 0x0 }; +static const BitmapCharRec ch127 = {1,1,0,0,8,ch127data}; +#else +static const BitmapCharRec ch127 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,8,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,8,0}; +#endif + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch255 = {6,12,-1,2,8,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {6,10,-1,2,8,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {6,12,-1,2,8,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch252 = {6,10,-1,0,8,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch251 = {6,10,-1,0,8,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch250 = {6,10,-1,0,8,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch249 = {6,10,-1,0,8,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x78,0xc4,0xa4,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch248 = {6,8,-1,1,8,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x20,0x0,0xf8,0x0,0x20,0x20, +}; + +static const BitmapCharRec ch247 = {5,7,-1,-1,8,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch246 = {6,10,-1,0,8,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {6,10,-1,0,8,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch244 = {6,10,-1,0,8,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {6,10,-1,0,8,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch242 = {6,10,-1,0,8,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {6,10,-1,0,8,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x8,0x50,0x30,0x48, +}; + +static const BitmapCharRec ch240 = {6,10,-1,0,8,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch239 = {5,10,-1,0,8,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x90,0x60, +}; + +static const BitmapCharRec ch238 = {5,10,-1,0,8,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch237 = {5,10,-1,0,8,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch236 = {5,10,-1,0,8,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch235 = {6,10,-1,0,8,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch234 = {6,10,-1,0,8,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch233 = {6,10,-1,0,8,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch232 = {6,10,-1,0,8,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x20,0x10,0x78,0x84,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch231 = {6,8,-1,2,8,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6c,0x92,0x90,0x7c,0x12,0x6c, +}; + +static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch229 = {6,10,-1,0,8,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch228 = {6,10,-1,0,8,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {6,10,-1,0,8,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch226 = {6,10,-1,0,8,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {6,10,-1,0,8,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch224 = {6,10,-1,0,8,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0x80,0xb8,0xc4,0x84,0x84,0xf8,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch223 = {6,9,-1,1,8,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80, +}; + +static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x20,0x20,0x20,0x20,0x50,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch221 = {5,10,-1,0,8,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch219 = {6,10,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch218 = {6,10,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,10,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x78,0xc4,0xa4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch216 = {6,11,-1,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch215 = {6,6,-1,-1,8,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch214 = {7,10,0,0,8,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch213 = {7,10,0,0,8,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18, +}; + +static const BitmapCharRec ch212 = {7,10,0,0,8,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {7,10,0,0,8,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10, +}; + +static const BitmapCharRec ch210 = {7,10,0,0,8,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch208 = {7,9,0,0,8,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch207 = {5,10,-1,0,8,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch206 = {5,10,-1,0,8,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch205 = {5,10,-1,0,8,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch204 = {5,10,-1,0,8,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch203 = {6,10,-1,0,8,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch202 = {6,10,-1,0,8,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {6,10,-1,0,8,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch200 = {6,10,-1,0,8,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x20,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch199 = {6,11,-1,2,8,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e, +}; + +static const BitmapCharRec ch198 = {7,9,0,0,8,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch197 = {6,10,-1,0,8,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch196 = {6,10,-1,0,8,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch195 = {6,10,-1,0,8,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch194 = {6,10,-1,0,8,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch193 = {6,10,-1,0,8,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {6,10,-1,0,8,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x78,0x84,0x84,0x80,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {6,9,-1,0,8,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch190 = {7,10,0,0,8,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch189 = {7,10,0,0,8,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch188 = {7,10,0,0,8,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0x48,0x24,0x12,0x24,0x48,0x90, +}; + +static const BitmapCharRec ch187 = {7,7,0,-1,8,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf0,0x0,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch186 = {4,6,-1,-3,8,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,6,-1,-4,8,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x40, +}; + +static const BitmapCharRec ch184 = {2,2,-3,2,8,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0, +}; + +static const BitmapCharRec ch183 = {2,1,-3,-4,8,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,9,-1,0,8,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0xb4,0xcc,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch181 = {6,7,-1,1,8,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,-3,-8,8,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x60,0x90,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch179 = {4,6,-1,-4,8,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x80,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,6,-1,-4,8,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,-1,-1,8,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,-2,-5,8,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc, +}; + +static const BitmapCharRec ch175 = {6,1,-1,-8,8,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,9,0,-1,8,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfc, +}; + +static const BitmapCharRec ch173 = {6,1,-1,-4,8,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-1,8,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x24,0x48,0x90,0x48,0x24,0x12, +}; + +static const BitmapCharRec ch171 = {7,7,0,-1,8,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x78,0x88,0x78,0x8,0x70, +}; + +static const BitmapCharRec ch170 = {5,7,-1,-2,8,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,9,0,-1,8,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xd8, +}; + +static const BitmapCharRec ch168 = {5,1,-1,-8,8,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x60,0x90,0x10,0x60,0x90,0x90,0x60,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch167 = {4,10,-2,0,8,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,9,-3,0,8,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch165 = {7,9,0,0,8,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x84,0x78,0x48,0x48,0x78,0x84, +}; + +static const BitmapCharRec ch164 = {6,6,-1,-1,8,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch163 = {7,9,0,0,8,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x20,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch162 = {5,8,-1,-1,8,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,9,-3,0,8,ch161data}; + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x90,0xa8,0x48, +}; + +static const BitmapCharRec ch126 = {5,3,-1,-6,8,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x10,0x10,0x20,0x18,0x20,0x10,0x10,0xe0, +}; + +static const BitmapCharRec ch125 = {5,9,-1,0,8,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,9,-3,0,8,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x38,0x40,0x40,0x20,0xc0,0x20,0x40,0x40,0x38, +}; + +static const BitmapCharRec ch123 = {5,9,-2,0,8,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfc,0x40,0x20,0x10,0x8,0xfc, +}; + +static const BitmapCharRec ch122 = {6,6,-1,0,8,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch121 = {6,8,-1,2,8,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch120 = {6,6,-1,0,8,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x44,0xaa,0x92,0x92,0x82,0x82, +}; + +static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x50,0x50,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,6,-1,0,8,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x74,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch117 = {6,6,-1,0,8,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x38,0x44,0x40,0x40,0x40,0xf8,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {6,8,-1,0,8,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x78,0x84,0x18,0x60,0x84,0x78, +}; + +static const BitmapCharRec ch115 = {6,6,-1,0,8,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x40,0x40,0x40,0x40,0x44,0xb8, +}; + +static const BitmapCharRec ch114 = {6,6,-1,0,8,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x4,0x4,0x4,0x74,0x8c,0x84,0x8c,0x74, +}; + +static const BitmapCharRec ch113 = {6,8,-1,2,8,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xb8,0xc4,0x84,0xc4,0xb8, +}; + +static const BitmapCharRec ch112 = {6,8,-1,2,8,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x78,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch111 = {6,6,-1,0,8,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8, +}; + +static const BitmapCharRec ch110 = {6,6,-1,0,8,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x82,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, +}; + +static const BitmapCharRec ch108 = {5,9,-1,0,8,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x84,0x88,0x90,0xe0,0x90,0x88,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {6,9,-1,0,8,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x18,0x0,0x8, +}; + +static const BitmapCharRec ch106 = {5,10,-1,2,8,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x20, +}; + +static const BitmapCharRec ch105 = {5,8,-1,0,8,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {6,9,-1,0,8,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x78,0x84,0x78,0x80,0x70,0x88,0x88,0x74, +}; + +static const BitmapCharRec ch103 = {6,8,-1,2,8,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0xf8,0x40,0x40,0x44,0x38, +}; + +static const BitmapCharRec ch102 = {6,9,-1,0,8,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78, +}; + +static const BitmapCharRec ch101 = {6,6,-1,0,8,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x74,0x8c,0x84,0x84,0x8c,0x74,0x4,0x4,0x4, +}; + +static const BitmapCharRec ch100 = {6,9,-1,0,8,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x78,0x84,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch99 = {6,6,-1,0,8,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {6,9,-1,0,8,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78, +}; + +static const BitmapCharRec ch97 = {6,6,-1,0,8,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x10,0x60,0xe0, +}; + +static const BitmapCharRec ch96 = {4,3,-2,-6,8,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfe, +}; + +static const BitmapCharRec ch95 = {7,1,0,1,8,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x20, +}; + +static const BitmapCharRec ch94 = {5,3,-1,-6,8,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch93 = {4,9,-1,0,8,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {7,9,0,0,8,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, +}; + +static const BitmapCharRec ch91 = {4,9,-2,0,8,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfc,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch90 = {6,9,-1,0,8,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,9,0,0,8,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch88 = {7,9,0,0,8,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch87 = {7,9,0,0,8,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,9,0,0,8,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,9,0,0,8,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x78,0x84,0x4,0x4,0x78,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x84,0x88,0x90,0xa0,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x4,0x78,0x94,0xa4,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch81 = {6,10,-1,1,8,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch79 = {6,9,-1,0,8,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x84,0x84,0x84,0x8c,0x94,0xa4,0xc4,0x84,0x84, +}; + +static const BitmapCharRec ch78 = {6,9,-1,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82, +}; + +static const BitmapCharRec ch77 = {7,9,0,0,8,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xfc,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {6,9,-1,0,8,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x84,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x84, +}; + +static const BitmapCharRec ch75 = {6,9,-1,0,8,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x70,0x88,0x8,0x8,0x8,0x8,0x8,0x8,0x3c, +}; + +static const BitmapCharRec ch74 = {6,9,-1,0,8,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch73 = {5,9,-1,0,8,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch72 = {6,9,-1,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x74,0x8c,0x84,0x9c,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch71 = {6,9,-1,0,8,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfc,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch68 = {7,9,0,0,8,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch67 = {6,9,-1,0,8,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch66 = {7,9,0,0,8,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x48,0x30, +}; + +static const BitmapCharRec ch65 = {6,9,-1,0,8,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x78,0x80,0x94,0xac,0xa4,0x9c,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch64 = {6,9,-1,0,8,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x10,0x0,0x10,0x10,0x8,0x4,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch63 = {6,9,-1,0,8,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x10,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {5,9,-1,0,8,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfc,0x0,0x0,0xfc, +}; + +static const BitmapCharRec ch61 = {6,4,-1,-2,8,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x8,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x8, +}; + +static const BitmapCharRec ch60 = {5,9,-2,0,8,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x60,0x70,0x0,0x0,0x20,0x70,0x20, +}; + +static const BitmapCharRec ch59 = {4,8,-1,1,8,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x40,0xe0,0x40,0x0,0x0,0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch58 = {3,8,-2,1,8,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x8,0x4,0x4,0x74,0x8c,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch57 = {6,9,-1,0,8,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x78,0x84,0x84,0x84,0x78,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch56 = {6,9,-1,0,8,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch55 = {6,9,-1,0,8,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x78,0x84,0x84,0xc4,0xb8,0x80,0x80,0x40,0x38, +}; + +static const BitmapCharRec ch54 = {6,9,-1,0,8,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x78,0x84,0x4,0x4,0xc4,0xb8,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch53 = {6,9,-1,0,8,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x8,0x8,0xfc,0x88,0x88,0x48,0x28,0x18,0x8, +}; + +static const BitmapCharRec ch52 = {6,9,-1,0,8,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x78,0x84,0x4,0x4,0x38,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch51 = {6,9,-1,0,8,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xfc,0x80,0x40,0x30,0x8,0x4,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch50 = {6,9,-1,0,8,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, +}; + +static const BitmapCharRec ch49 = {5,9,-1,0,8,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30, +}; + +static const BitmapCharRec ch48 = {6,9,-1,0,8,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2, +}; + +static const BitmapCharRec ch47 = {7,9,0,0,8,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch46 = {3,3,-2,1,8,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xfc, +}; + +static const BitmapCharRec ch45 = {6,1,-1,-4,8,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x60,0x70, +}; + +static const BitmapCharRec ch44 = {4,3,-1,1,8,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,-1,-2,8,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x48,0x30,0xfc,0x30,0x48, +}; + +static const BitmapCharRec ch42 = {6,5,-1,-2,8,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,9,-2,0,8,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,9,-3,0,8,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x60,0x70, +}; + +static const BitmapCharRec ch39 = {4,3,-1,-6,8,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x74,0x88,0x94,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch38 = {6,7,-1,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x88,0x54,0x48,0x20,0x10,0x10,0x48,0xa4,0x44, +}; + +static const BitmapCharRec ch37 = {6,9,-1,0,8,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0xf0,0x28,0x70,0xa0,0x78,0x20, +}; + +static const BitmapCharRec ch36 = {5,7,-1,-1,8,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x48,0x48,0xfc,0x48,0xfc,0x48,0x48, +}; + +static const BitmapCharRec ch35 = {6,7,-1,-1,8,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0x90, +}; + +static const BitmapCharRec ch34 = {4,3,-2,-6,8,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,9,-3,0,8,ch33data}; + +/* char: 0x1f */ + +static const GLubyte ch31data[] = { +0x80, +}; + +static const BitmapCharRec ch31 = {1,1,-3,-3,8,ch31data}; + +/* char: 0x1e */ + +static const GLubyte ch30data[] = { +0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch30 = {7,9,0,0,8,ch30data}; + +/* char: 0x1d */ + +static const GLubyte ch29data[] = { +0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, +}; + +static const BitmapCharRec ch29 = {7,7,0,0,8,ch29data}; + +/* char: 0x1c */ + +static const GLubyte ch28data[] = { +0x88,0x48,0x48,0x48,0x48,0xfc, +}; + +static const BitmapCharRec ch28 = {6,6,-1,0,8,ch28data}; + +/* char: 0x1b */ + +static const GLubyte ch27data[] = { +0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80, +}; + +static const BitmapCharRec ch27 = {7,8,0,0,8,ch27data}; + +/* char: 0x1a */ + +static const GLubyte ch26data[] = { +0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2, +}; + +static const BitmapCharRec ch26 = {7,8,0,0,8,ch26data}; + +/* char: 0x19 */ + +static const GLubyte ch25data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch25 = {1,13,-3,2,8,ch25data}; + +/* char: 0x18 */ + +static const GLubyte ch24data[] = { +0x10,0x10,0x10,0x10,0x10,0xff, +}; + +static const BitmapCharRec ch24 = {8,6,0,2,8,ch24data}; + +/* char: 0x17 */ + +static const GLubyte ch23data[] = { +0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch23 = {8,8,0,-3,8,ch23data}; + +/* char: 0x16 */ + +static const GLubyte ch22data[] = { +0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch22 = {4,13,0,2,8,ch22data}; + +/* char: 0x15 */ + +static const GLubyte ch21data[] = { +0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch21 = {5,13,-3,2,8,ch21data}; + +/* char: 0x14 */ + +static const GLubyte ch20data[] = { +0xff, +}; + +static const BitmapCharRec ch20 = {8,1,0,1,8,ch20data}; + +/* char: 0x13 */ + +static const GLubyte ch19data[] = { +0xff, +}; + +static const BitmapCharRec ch19 = {8,1,0,-1,8,ch19data}; + +/* char: 0x12 */ + +static const GLubyte ch18data[] = { +0xff, +}; + +static const BitmapCharRec ch18 = {8,1,0,-3,8,ch18data}; + +/* char: 0x11 */ + +static const GLubyte ch17data[] = { +0xff, +}; + +static const BitmapCharRec ch17 = {8,1,0,-5,8,ch17data}; + +/* char: 0x10 */ + +static const GLubyte ch16data[] = { +0xff, +}; + +static const BitmapCharRec ch16 = {8,1,0,-7,8,ch16data}; + +/* char: 0xf */ + +static const GLubyte ch15data[] = { +0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch15 = {8,13,0,2,8,ch15data}; + +/* char: 0xe */ + +static const GLubyte ch14data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch14 = {5,8,-3,-3,8,ch14data}; + +/* char: 0xd */ + +static const GLubyte ch13data[] = { +0x80,0x80,0x80,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch13 = {5,6,-3,2,8,ch13data}; + +/* char: 0xc */ + +static const GLubyte ch12data[] = { +0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch12 = {4,6,0,2,8,ch12data}; + +/* char: 0xb */ + +static const GLubyte ch11data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch11 = {4,8,0,-3,8,ch11data}; + +/* char: 0xa */ + +static const GLubyte ch10data[] = { +0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch10 = {7,9,0,2,8,ch10data}; + +/* char: 0x9 */ + +static const GLubyte ch9data[] = { +0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, +}; + +static const BitmapCharRec ch9 = {7,9,0,2,8,ch9data}; + +/* char: 0x8 */ + +static const GLubyte ch8data[] = { +0xfe,0x10,0x10,0xfe,0x10,0x10, +}; + +static const BitmapCharRec ch8 = {7,6,0,0,8,ch8data}; + +/* char: 0x7 */ + +static const GLubyte ch7data[] = { +0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch7 = {5,4,-1,-5,8,ch7data}; + +/* char: 0x6 */ + +static const GLubyte ch6data[] = { +0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch6 = {7,9,0,2,8,ch6data}; + +/* char: 0x5 */ + +static const GLubyte ch5data[] = { +0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78, +}; + +static const BitmapCharRec ch5 = {7,9,0,2,8,ch5data}; + +/* char: 0x4 */ + +static const GLubyte ch4data[] = { +0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0, +}; + +static const BitmapCharRec ch4 = {7,9,0,2,8,ch4data}; + +/* char: 0x3 */ + +static const GLubyte ch3data[] = { +0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88, +}; + +static const BitmapCharRec ch3 = {7,9,0,2,8,ch3data}; + +/* char: 0x2 */ + +static const GLubyte ch2data[] = { +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +}; + +static const BitmapCharRec ch2 = {8,12,0,2,8,ch2data}; + +/* char: 0x1 */ + +static const GLubyte ch1data[] = { +0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, +}; + +static const BitmapCharRec ch1 = {7,7,0,-1,8,ch1data}; + +static const BitmapCharRec * const chars[] = { +&ch0, +&ch1, +&ch2, +&ch3, +&ch4, +&ch5, +&ch6, +&ch7, +&ch8, +&ch9, +&ch10, +&ch11, +&ch12, +&ch13, +&ch14, +&ch15, +&ch16, +&ch17, +&ch18, +&ch19, +&ch20, +&ch21, +&ch22, +&ch23, +&ch24, +&ch25, +&ch26, +&ch27, +&ch28, +&ch29, +&ch30, +&ch31, +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +&ch127, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmap8By13 = { +"-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1", +256, +0, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_9x15.c xpsb-glx-0.19/mesa/src/glut/beos/glut_9x15.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_9x15.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_9x15.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2075 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmap9By15 XXX +#include "glutbitmap.h" +#undef glutBitmap9By15 + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch0data[] = { 0x0 }; +static const BitmapCharRec ch0 = {1,1,0,0,9,ch0data}; +#else +static const BitmapCharRec ch0 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,9,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch127data[] = { 0x0 }; +static const BitmapCharRec ch127 = {1,1,0,0,9,ch127data}; +#else +static const BitmapCharRec ch127 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,9,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,9,0}; +#endif + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch255 = {6,14,-1,3,9,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {7,12,-1,3,9,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch253 = {6,14,-1,3,9,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch252 = {7,11,-1,0,9,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch251 = {7,11,-1,0,9,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch250 = {7,11,-1,0,9,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch249 = {7,11,-1,0,9,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x7c,0xa2,0xa2,0x92,0x8a,0x8a,0x7c,0x2, +}; + +static const BitmapCharRec ch248 = {7,9,-1,1,9,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x10,0x38,0x10,0x0,0xfe,0x0,0x10,0x38,0x10, +}; + +static const BitmapCharRec ch247 = {7,9,-1,0,9,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch246 = {7,11,-1,0,9,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {7,11,-1,0,9,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch244 = {7,11,-1,0,9,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch243 = {7,11,-1,0,9,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch242 = {7,11,-1,0,9,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {7,11,-1,0,9,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x8,0x50,0x30,0x48, +}; + +static const BitmapCharRec ch240 = {7,11,-1,0,9,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch239 = {5,11,-2,0,9,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x90,0x60, +}; + +static const BitmapCharRec ch238 = {5,11,-2,0,9,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60,0x10, +}; + +static const BitmapCharRec ch237 = {5,11,-2,0,9,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x30,0x40, +}; + +static const BitmapCharRec ch236 = {5,11,-2,0,9,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch235 = {7,11,-1,0,9,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch234 = {7,11,-1,0,9,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch233 = {7,11,-1,0,9,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch232 = {7,11,-1,0,9,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch231 = {7,10,-1,3,9,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6e,0x92,0x90,0x7c,0x12,0x92,0x6c, +}; + +static const BitmapCharRec ch230 = {7,7,-1,0,9,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x18,0x24,0x18, +}; + +static const BitmapCharRec ch229 = {7,11,-1,0,9,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch228 = {7,11,-1,0,9,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {7,11,-1,0,9,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch226 = {7,11,-1,0,9,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch225 = {7,11,-1,0,9,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch224 = {7,11,-1,0,9,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0x80,0xbc,0xc2,0x82,0x82,0xfc,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch223 = {7,9,-1,1,9,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {7,10,-1,0,9,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch221 = {7,11,-1,0,9,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch220 = {7,11,-1,0,9,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch219 = {7,11,-1,0,9,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch218 = {7,11,-1,0,9,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch217 = {7,11,-1,0,9,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x7c,0xc2,0xa2,0xa2,0x92,0x92,0x8a,0x8a,0x86,0x7c,0x2, +}; + +static const BitmapCharRec ch216 = {7,12,-1,1,9,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x82,0x44,0x28,0x10,0x28,0x44,0x82, +}; + +static const BitmapCharRec ch215 = {7,7,-1,-1,9,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch214 = {7,11,-1,0,9,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {7,11,-1,0,9,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch212 = {7,11,-1,0,9,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch211 = {7,11,-1,0,9,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch210 = {7,11,-1,0,9,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x92,0x92,0xa2,0xc2,0x82,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {7,11,-1,0,9,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xfc,0x42,0x42,0x42,0x42,0xf2,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch208 = {7,10,-1,0,9,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch207 = {5,11,-2,0,9,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x88,0x70, +}; + +static const BitmapCharRec ch206 = {5,11,-2,0,9,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x60,0x10, +}; + +static const BitmapCharRec ch205 = {5,11,-2,0,9,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x30,0x40, +}; + +static const BitmapCharRec ch204 = {5,11,-2,0,9,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch203 = {7,11,-1,0,9,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch202 = {7,11,-1,0,9,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch201 = {7,11,-1,0,9,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch200 = {7,11,-1,0,9,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch199 = {7,13,-1,3,9,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x9e,0x90,0x90,0x90,0xfc,0x90,0x90,0x90,0x90,0x6e, +}; + +static const BitmapCharRec ch198 = {7,10,-1,0,9,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,11,-1,0,9,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch195 = {7,11,-1,0,9,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch194 = {7,11,-1,0,9,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch193 = {7,11,-1,0,9,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch192 = {7,11,-1,0,9,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x7c,0x82,0x82,0x80,0x40,0x20,0x10,0x10,0x0,0x10, +}; + +static const BitmapCharRec ch191 = {7,10,-1,0,9,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch190 = {7,10,-1,0,9,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch189 = {7,10,-1,0,9,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch188 = {7,10,-1,0,9,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0x48,0x24,0x12,0x12,0x24,0x48,0x90, +}; + +static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf8,0x0,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch186 = {5,6,-1,-5,9,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,6,-1,-4,9,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0x60,0x90,0x30, +}; + +static const BitmapCharRec ch184 = {4,3,-2,3,9,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-4,-4,9,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0xa,0xa,0xa,0xa,0xa,0x7a,0x8a,0x8a,0x8a,0x7e, +}; + +static const BitmapCharRec ch182 = {7,10,-1,0,9,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xba,0xc6,0x82,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch181 = {7,9,-1,2,9,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0xc0,0x20, +}; + +static const BitmapCharRec ch180 = {3,2,-3,-9,9,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x60,0x90,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch179 = {4,6,-1,-4,9,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x80,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,6,-1,-4,9,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xfe,0x0,0x10,0x10,0x10,0xfe,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch177 = {7,9,-1,-1,9,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,-3,-6,9,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc, +}; + +static const BitmapCharRec ch175 = {6,1,-1,-9,9,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x3c,0x42,0xa5,0xa9,0xbd,0xa5,0xb9,0x42,0x3c, +}; + +static const BitmapCharRec ch174 = {8,9,0,-1,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfc, +}; + +static const BitmapCharRec ch173 = {6,1,-1,-4,9,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-2,9,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x24,0x48,0x90,0x90,0x48,0x24,0x12, +}; + +static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x78,0x90,0x70,0x90,0x60, +}; + +static const BitmapCharRec ch170 = {5,7,-3,-3,9,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x3c,0x42,0x99,0xa5,0xa1,0xa5,0x99,0x42,0x3c, +}; + +static const BitmapCharRec ch169 = {8,9,0,-1,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch168 = {3,2,-3,-9,9,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x8,0x70,0x88,0x88,0x88,0x70,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,11,-2,1,9,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,11,-4,1,9,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x10,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch165 = {7,10,-1,0,9,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x82,0x7c,0x44,0x44,0x7c,0x82, +}; + +static const BitmapCharRec ch164 = {7,6,-1,-3,9,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch163 = {7,10,-1,0,9,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x78,0xa4,0xa0,0x90,0x94,0x78,0x8, +}; + +static const BitmapCharRec ch162 = {6,8,-1,0,9,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80, +}; + +static const BitmapCharRec ch161 = {1,11,-4,0,9,ch161data}; + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x8c,0x92,0x62, +}; + +static const BitmapCharRec ch126 = {7,3,-1,-7,9,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x10,0x10,0x10,0x20,0x18,0x18,0x20,0x10,0x10,0x10,0xe0, +}; + +static const BitmapCharRec ch125 = {5,12,-1,1,9,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,12,-4,1,9,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x38,0x40,0x40,0x40,0x20,0xc0,0xc0,0x20,0x40,0x40,0x40,0x38, +}; + +static const BitmapCharRec ch123 = {5,12,-3,1,9,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfe,0x40,0x20,0x10,0x8,0x4,0xfe, +}; + +static const BitmapCharRec ch122 = {7,7,-1,0,9,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch121 = {6,10,-1,3,9,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x82,0x44,0x28,0x10,0x28,0x44,0x82, +}; + +static const BitmapCharRec ch120 = {7,7,-1,0,9,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x44,0xaa,0x92,0x92,0x92,0x82,0x82, +}; + +static const BitmapCharRec ch119 = {7,7,-1,0,9,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x10,0x28,0x28,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch118 = {7,7,-1,0,9,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch117 = {7,7,-1,0,9,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x1c,0x22,0x20,0x20,0x20,0x20,0xfc,0x20,0x20, +}; + +static const BitmapCharRec ch116 = {7,9,-1,0,9,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x7c,0x82,0x2,0x7c,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch115 = {7,7,-1,0,9,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x40,0x40,0x40,0x40,0x42,0x62,0x9c, +}; + +static const BitmapCharRec ch114 = {7,7,-1,0,9,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x2,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x86,0x7a, +}; + +static const BitmapCharRec ch113 = {7,10,-1,3,9,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc, +}; + +static const BitmapCharRec ch112 = {7,10,-1,3,9,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch111 = {7,7,-1,0,9,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc, +}; + +static const BitmapCharRec ch110 = {7,7,-1,0,9,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x82,0x92,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0, +}; + +static const BitmapCharRec ch108 = {5,10,-2,0,9,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x82,0x8c,0xb0,0xc0,0xb0,0x8c,0x82,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {7,10,-1,0,9,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x78,0x84,0x84,0x84,0x4,0x4,0x4,0x4,0x4,0x1c,0x0,0x0,0xc, +}; + +static const BitmapCharRec ch106 = {6,13,-1,3,9,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60, +}; + +static const BitmapCharRec ch105 = {5,10,-2,0,9,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {7,10,-1,0,9,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x7c,0x82,0x82,0x7c,0x80,0x78,0x84,0x84,0x84,0x7a, +}; + +static const BitmapCharRec ch103 = {7,10,-1,3,9,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x20,0x20,0x20,0x20,0xf8,0x20,0x20,0x22,0x22,0x1c, +}; + +static const BitmapCharRec ch102 = {7,10,-1,0,9,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch101 = {7,7,-1,0,9,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x7a,0x86,0x82,0x82,0x82,0x86,0x7a,0x2,0x2,0x2, +}; + +static const BitmapCharRec ch100 = {7,10,-1,0,9,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch99 = {7,7,-1,0,9,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {7,10,-1,0,9,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c, +}; + +static const BitmapCharRec ch97 = {7,7,-1,0,9,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x10,0x20,0x40,0xc0, +}; + +static const BitmapCharRec ch96 = {4,4,-3,-6,9,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff, +}; + +static const BitmapCharRec ch95 = {8,1,0,1,9,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x82,0x44,0x28,0x10, +}; + +static const BitmapCharRec ch94 = {7,4,-1,-6,9,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch93 = {4,12,-2,1,9,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x2,0x4,0x4,0x8,0x10,0x10,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch92 = {7,10,-1,0,9,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, +}; + +static const BitmapCharRec ch91 = {4,12,-3,1,9,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfe,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch90 = {7,10,-1,0,9,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,10,-1,0,9,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x82,0x44,0x28,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch88 = {7,10,-1,0,9,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x44,0xaa,0x92,0x92,0x92,0x92,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch87 = {7,10,-1,0,9,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,10,-1,0,9,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch85 = {7,10,-1,0,9,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,10,-1,0,9,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x7c,0x82,0x82,0x2,0xc,0x70,0x80,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch83 = {7,10,-1,0,9,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x82,0x82,0x84,0x88,0x90,0xfc,0x82,0x82,0x82,0xfc, +}; + +static const BitmapCharRec ch82 = {7,10,-1,0,9,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x6,0x8,0x7c,0x92,0xa2,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch81 = {7,12,-1,2,9,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc, +}; + +static const BitmapCharRec ch80 = {7,10,-1,0,9,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch79 = {7,10,-1,0,9,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x82,0x82,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x82, +}; + +static const BitmapCharRec ch78 = {7,10,-1,0,9,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x82,0x82,0x82,0x92,0x92,0xaa,0xaa,0xc6,0x82,0x82, +}; + +static const BitmapCharRec ch77 = {7,10,-1,0,9,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xfe,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {7,10,-1,0,9,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x82,0x84,0x88,0x90,0xa0,0xe0,0x90,0x88,0x84,0x82, +}; + +static const BitmapCharRec ch75 = {7,10,-1,0,9,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x78,0x84,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x1e, +}; + +static const BitmapCharRec ch74 = {7,10,-1,0,9,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch73 = {5,10,-2,0,9,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x82,0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch72 = {7,10,-1,0,9,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x7c,0x82,0x82,0x82,0x8e,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch71 = {7,10,-1,0,9,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x40,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, +}; + +static const BitmapCharRec ch70 = {7,10,-1,0,9,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfe,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, +}; + +static const BitmapCharRec ch69 = {7,10,-1,0,9,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch68 = {7,10,-1,0,9,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch67 = {7,10,-1,0,9,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xfc,0x42,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch66 = {7,10,-1,0,9,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x44,0x28,0x10, +}; + +static const BitmapCharRec ch65 = {7,10,-1,0,9,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x7c,0x80,0x80,0x9a,0xa6,0xa2,0x9e,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch64 = {7,10,-1,0,9,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x10,0x0,0x10,0x10,0x8,0x4,0x2,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch63 = {7,10,-1,0,9,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {5,10,-2,0,9,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfe,0x0,0x0,0xfe, +}; + +static const BitmapCharRec ch61 = {7,4,-1,-2,9,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x8,0x10,0x20,0x40,0x80,0x80,0x40,0x20,0x10,0x8, +}; + +static const BitmapCharRec ch60 = {5,10,-2,0,9,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {2,10,-4,3,9,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,7,-4,0,9,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x78,0x4,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch57 = {7,10,-1,0,9,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch56 = {7,10,-1,0,9,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x8,0x4,0x2,0x2,0xfe, +}; + +static const BitmapCharRec ch55 = {7,10,-1,0,9,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x7c,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x40,0x3c, +}; + +static const BitmapCharRec ch54 = {7,10,-1,0,9,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7c,0x82,0x2,0x2,0x2,0xc2,0xbc,0x80,0x80,0xfe, +}; + +static const BitmapCharRec ch53 = {7,10,-1,0,9,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x4,0x4,0x4,0xfe,0x84,0x44,0x24,0x14,0xc,0x4, +}; + +static const BitmapCharRec ch52 = {7,10,-1,0,9,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x7c,0x82,0x2,0x2,0x2,0x1c,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch51 = {7,10,-1,0,9,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xfe,0x80,0x40,0x30,0x8,0x4,0x2,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch50 = {7,10,-1,0,9,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xfe,0x10,0x10,0x10,0x10,0x10,0x90,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch49 = {7,10,-1,0,9,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch48 = {7,10,-1,0,9,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x40,0x40,0x20,0x10,0x10,0x8,0x4,0x4,0x2, +}; + +static const BitmapCharRec ch47 = {7,10,-1,0,9,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-4,0,9,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xfe, +}; + +static const BitmapCharRec ch45 = {7,1,-1,-4,9,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch44 = {2,5,-4,3,9,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x10,0x10,0x10,0xfe,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch43 = {7,7,-1,-1,9,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x10,0x92,0x54,0x38,0x54,0x92,0x10, +}; + +static const BitmapCharRec ch42 = {7,7,-1,-1,9,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,12,-3,1,9,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,12,-3,1,9,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x20,0x30, +}; + +static const BitmapCharRec ch39 = {4,4,-3,-6,9,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x62,0x94,0x88,0x94,0x62,0x60,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch38 = {7,10,-1,0,9,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x84,0x4a,0x4a,0x24,0x10,0x10,0x48,0xa4,0xa4,0x42, +}; + +static const BitmapCharRec ch37 = {7,10,-1,0,9,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x10,0x7c,0x92,0x12,0x12,0x14,0x38,0x50,0x90,0x92,0x7c,0x10, +}; + +static const BitmapCharRec ch36 = {7,12,-1,1,9,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48, +}; + +static const BitmapCharRec ch35 = {6,8,-1,-1,9,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0x90, +}; + +static const BitmapCharRec ch34 = {4,3,-3,-7,9,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,11,-4,0,9,ch33data}; + +/* char: 0x1f */ + +static const GLubyte ch31data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch31 = {2,2,-4,-2,9,ch31data}; + +/* char: 0x1e */ + +static const GLubyte ch30data[] = { +0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch30 = {7,10,-1,0,9,ch30data}; + +/* char: 0x1d */ + +static const GLubyte ch29data[] = { +0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, +}; + +static const BitmapCharRec ch29 = {7,7,-1,0,9,ch29data}; + +/* char: 0x1c */ + +static const GLubyte ch28data[] = { +0x44,0x24,0x24,0x24,0x24,0x24,0xfe, +}; + +static const BitmapCharRec ch28 = {7,7,-1,0,9,ch28data}; + +/* char: 0x1b */ + +static const GLubyte ch27data[] = { +0xfe,0x0,0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch27 = {7,12,-1,2,9,ch27data}; + +/* char: 0x1a */ + +static const GLubyte ch26data[] = { +0xfc,0x0,0x4,0x8,0x10,0x20,0x40,0x40,0x20,0x10,0x8,0x4, +}; + +static const BitmapCharRec ch26 = {6,12,-2,2,9,ch26data}; + +/* char: 0x19 */ + +static const GLubyte ch25data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch25 = {1,15,-4,3,9,ch25data}; + +/* char: 0x18 */ + +static const GLubyte ch24data[] = { +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80, +}; + +static const BitmapCharRec ch24 = {9,7,0,3,9,ch24data}; + +/* char: 0x17 */ + +static const GLubyte ch23data[] = { +0xff,0x80,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch23 = {9,9,0,-3,9,ch23data}; + +/* char: 0x16 */ + +static const GLubyte ch22data[] = { +0x8,0x8,0x8,0x8,0x8,0x8,0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch22 = {5,15,0,3,9,ch22data}; + +/* char: 0x15 */ + +static const GLubyte ch21data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch21 = {5,15,-4,3,9,ch21data}; + +/* char: 0x14 */ + +static const GLubyte ch20data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch20 = {9,1,0,1,9,ch20data}; + +/* char: 0x13 */ + +static const GLubyte ch19data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch19 = {9,1,0,-1,9,ch19data}; + +/* char: 0x12 */ + +static const GLubyte ch18data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch18 = {9,1,0,-3,9,ch18data}; + +/* char: 0x11 */ + +static const GLubyte ch17data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch17 = {9,1,0,-5,9,ch17data}; + +/* char: 0x10 */ + +static const GLubyte ch16data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch16 = {9,1,0,-7,9,ch16data}; + +/* char: 0xf */ + +static const GLubyte ch15data[] = { +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0, +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, +}; + +static const BitmapCharRec ch15 = {9,15,0,3,9,ch15data}; + +/* char: 0xe */ + +static const GLubyte ch14data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch14 = {5,9,-4,-3,9,ch14data}; + +/* char: 0xd */ + +static const GLubyte ch13data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch13 = {5,7,-4,3,9,ch13data}; + +/* char: 0xc */ + +static const GLubyte ch12data[] = { +0x8,0x8,0x8,0x8,0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch12 = {5,7,0,3,9,ch12data}; + +/* char: 0xb */ + +static const GLubyte ch11data[] = { +0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch11 = {5,9,0,-3,9,ch11data}; + +/* char: 0xa */ + +static const GLubyte ch10data[] = { +0x8,0x8,0x8,0x8,0x3e,0x0,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch10 = {7,10,-1,2,9,ch10data}; + +/* char: 0x9 */ + +static const GLubyte ch9data[] = { +0x3e,0x20,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, +}; + +static const BitmapCharRec ch9 = {7,10,-1,2,9,ch9data}; + +/* char: 0x8 */ + +static const GLubyte ch8data[] = { +0xfe,0x10,0x10,0xfe,0x10,0x10, +}; + +static const BitmapCharRec ch8 = {7,6,-1,0,9,ch8data}; + +/* char: 0x7 */ + +static const GLubyte ch7data[] = { +0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch7 = {5,4,-2,-6,9,ch7data}; + +/* char: 0x6 */ + +static const GLubyte ch6data[] = { +0x20,0x20,0x3c,0x20,0x3e,0x0,0xf8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch6 = {7,10,-1,2,9,ch6data}; + +/* char: 0x5 */ + +static const GLubyte ch5data[] = { +0x22,0x22,0x3c,0x22,0x3c,0x0,0x78,0x80,0x80,0x78, +}; + +static const BitmapCharRec ch5 = {7,10,-1,2,9,ch5data}; + +/* char: 0x4 */ + +static const GLubyte ch4data[] = { +0x10,0x10,0x1c,0x10,0x1e,0x80,0x80,0xe0,0x80,0xf0, +}; + +static const BitmapCharRec ch4 = {7,10,-1,2,9,ch4data}; + +/* char: 0x3 */ + +static const GLubyte ch3data[] = { +0x8,0x8,0x8,0x3e,0x0,0x88,0x88,0xf8,0x88,0x88, +}; + +static const BitmapCharRec ch3 = {7,10,-1,2,9,ch3data}; + +/* char: 0x2 */ + +static const GLubyte ch2data[] = { +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +}; + +static const BitmapCharRec ch2 = {8,14,0,3,9,ch2data}; + +/* char: 0x1 */ + +static const GLubyte ch1data[] = { +0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, +}; + +static const BitmapCharRec ch1 = {7,7,-1,0,9,ch1data}; + +static const BitmapCharRec * const chars[] = { +&ch0, +&ch1, +&ch2, +&ch3, +&ch4, +&ch5, +&ch6, +&ch7, +&ch8, +&ch9, +&ch10, +&ch11, +&ch12, +&ch13, +&ch14, +&ch15, +&ch16, +&ch17, +&ch18, +&ch19, +&ch20, +&ch21, +&ch22, +&ch23, +&ch24, +&ch25, +&ch26, +&ch27, +&ch28, +&ch29, +&ch30, +&ch31, +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +&ch127, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmap9By15 = { +"-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1", +256, +0, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_bitmap.c xpsb-glx-0.19/mesa/src/glut/beos/glut_bitmap.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_bitmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_bitmap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutbitmap.h" + +void APIENTRY +glutBitmapCharacter(GLUTbitmapFont font, int c) +{ + const BitmapCharRec *ch; + BitmapFontPtr fontinfo; + GLint swapbytes, lsbfirst, rowlength; + GLint skiprows, skippixels, alignment; + +#if defined(_WIN32) + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + if (c < fontinfo->first || + c >= fontinfo->first + fontinfo->num_chars) + return; + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) { + /* Save current modes. */ + 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); + /* Little endian machines (DEC Alpha for example) could + benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE + instead of GL_FALSE, but this would require changing the + generated bitmaps too. */ + 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); + glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, + ch->advance, 0, ch->bitmap); + /* Restore saved 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 -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutbitmap.h xpsb-glx-0.19/mesa/src/glut/beos/glutbitmap.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutbitmap.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutbitmap.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,30 @@ +#ifndef __glutbitmap_h__ +#define __glutbitmap_h__ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +typedef struct { + const GLsizei width; + const GLsizei height; + const GLfloat xorig; + const GLfloat yorig; + const GLfloat advance; + const GLubyte *bitmap; +} BitmapCharRec, *BitmapCharPtr; + +typedef struct { + const char *name; + const int num_chars; + const int first; + const BitmapCharRec * const *ch; +} BitmapFontRec, *BitmapFontPtr; + +typedef void *GLUTbitmapFont; + +#endif /* __glutbitmap_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,69 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * FILE: glutBlocker.cpp + * + * DESCRIPTION: helper class for GLUT event loop. + * if a window receives an event, wake up the event loop. + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include "glutBlocker.h" + +/*********************************************************** + * Global variable + ***********************************************************/ +GlutBlocker gBlock; + +/*********************************************************** + * Member functions + ***********************************************************/ +GlutBlocker::GlutBlocker() { + gSem = create_sem(1, "gSem"); + eSem = create_sem(0, "eSem"); + events = false; + sleeping = false; +} + +GlutBlocker::~GlutBlocker() { + delete_sem(eSem); + delete_sem(gSem); +} + +void GlutBlocker::WaitEvent() { + acquire_sem(gSem); + if(!events) { // wait for new event + sleeping = true; + release_sem(gSem); + acquire_sem(eSem); // next event will release eSem + } else { + release_sem(gSem); + } +} + +void GlutBlocker::WaitEvent(bigtime_t usecs) { + acquire_sem(gSem); + if(!events) { // wait for new event + sleeping = true; + release_sem(gSem); + acquire_sem_etc(eSem, 1, B_TIMEOUT, usecs); // wait for next event or timeout + } else { + release_sem(gSem); + } +} + +void GlutBlocker::NewEvent() { + acquire_sem(gSem); + events = true; // next call to WaitEvent returns immediately + if(sleeping) { + sleeping = false; + release_sem(eSem); // if event loop is blocking, wake it up + } + release_sem(gSem); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.h xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutBlocker.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,47 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * FILE: glutBlocker.h + * + * DESCRIPTION: helper class for GLUT event loop. + * if a window receives an event, wake up the event loop. + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include + +/*********************************************************** + * CLASS: GlutBlocker + * + * DESCRIPTION: Fairly naive, but safe implementation. + * global semaphore controls access to state + * event semaphore blocks WaitEvent() call if necessary + * (this is basically a condition variable class) + ***********************************************************/ +class GlutBlocker { +public: + GlutBlocker(); + ~GlutBlocker(); + void WaitEvent(); // wait for new event + void WaitEvent(bigtime_t usecs); // wait with timeout + void NewEvent(); // new event from a window (may need to wakeup main thread) + void QuickNewEvent() { events = true; } // new event from main thread + void ClearEvents() { events = false; } // clear counter at beginning of event loop + bool PendingEvent() { return events; } // XPending() equivalent +private: + sem_id gSem; + sem_id eSem; + bool events; // are there any new events? + bool sleeping; // is someone sleeping on eSem? +}; + +/*********************************************************** + * Global variable + ***********************************************************/ +extern GlutBlocker gBlock; diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_bwidth.c xpsb-glx-0.19/mesa/src/glut/beos/glut_bwidth.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_bwidth.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_bwidth.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,58 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutbitmap.h" + +/* CENTRY */ +int APIENTRY +glutBitmapWidth(GLUTbitmapFont font, int c) +{ + BitmapFontPtr fontinfo; + const BitmapCharRec *ch; + +#ifdef _WIN32 + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + if (c < fontinfo->first || c >= fontinfo->first + fontinfo->num_chars) + return 0; + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) + return ch->advance; + else + return 0; +} + +int APIENTRY +glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) +{ + int c, length; + BitmapFontPtr fontinfo; + const BitmapCharRec *ch; + +#ifdef _WIN32 + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + length = 0; + for (; *string != '\0'; string++) { + c = *string; + if (c >= fontinfo->first && c < fontinfo->first + fontinfo->num_chars) { + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) + length += ch->advance; + } + } + return length; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutCallback.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutCallback.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutCallback.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutCallback.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,171 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutCallback.cpp + * + * DESCRIPTION: put all the callback setting routines in + * one place + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include "glutint.h" +#include "glutState.h" + +/*********************************************************** + * Window related callbacks + ***********************************************************/ +void APIENTRY +glutDisplayFunc(GLUTdisplayCB displayFunc) +{ + /* XXX Remove the warning after GLUT 3.0. */ + if (!displayFunc) + __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code."); + gState.currentWindow->display = displayFunc; +} + +void APIENTRY +glutKeyboardFunc(GLUTkeyboardCB keyboardFunc) +{ + gState.currentWindow->keyboard = keyboardFunc; +} + +void APIENTRY +glutSpecialFunc(GLUTspecialCB specialFunc) +{ + gState.currentWindow->special = specialFunc; +} + +void APIENTRY +glutMouseFunc(GLUTmouseCB mouseFunc) +{ + gState.currentWindow->mouse = mouseFunc; +} + +void APIENTRY +glutMotionFunc(GLUTmotionCB motionFunc) +{ + gState.currentWindow->motion = motionFunc; +} + +void APIENTRY +glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc) +{ + gState.currentWindow->passive = passiveMotionFunc; +} + +void APIENTRY +glutEntryFunc(GLUTentryCB entryFunc) +{ + gState.currentWindow->entry = entryFunc; + if (!entryFunc) { + gState.currentWindow->entryState = -1; + } +} + +void APIENTRY +glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc) +{ + gState.currentWindow->windowStatus = windowStatusFunc; +} + +static void +visibilityHelper(int status) +{ + if (status == GLUT_HIDDEN || status == GLUT_FULLY_COVERED) + gState.currentWindow->visibility(GLUT_NOT_VISIBLE); + else + gState.currentWindow->visibility(GLUT_VISIBLE); +} + +void APIENTRY +glutVisibilityFunc(GLUTvisibilityCB visibilityFunc) +{ + gState.currentWindow->visibility = visibilityFunc; + if (visibilityFunc) + glutWindowStatusFunc(visibilityHelper); + else + glutWindowStatusFunc(NULL); +} + +void APIENTRY +glutReshapeFunc(GLUTreshapeCB reshapeFunc) +{ + if (reshapeFunc) { + gState.currentWindow->reshape = reshapeFunc; + } else { + gState.currentWindow->reshape = __glutDefaultReshape; + } +} + +/*********************************************************** + * General callbacks (timer callback in glutEvent.cpp) + ***********************************************************/ +/* DEPRICATED, use glutMenuStatusFunc instead. */ +void APIENTRY +glutMenuStateFunc(GLUTmenuStateCB menuStateFunc) +{ + gState.menuStatus = (GLUTmenuStatusCB) menuStateFunc; +} + +void APIENTRY +glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc) +{ + gState.menuStatus = menuStatusFunc; +} + +void APIENTRY +glutIdleFunc(GLUTidleCB idleFunc) +{ + gState.idle = idleFunc; +} + +/*********************************************************** + * Unsupported callbacks + ***********************************************************/ +void APIENTRY +glutOverlayDisplayFunc(GLUTdisplayCB displayFunc) +{ +} + +void APIENTRY +glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc) +{ +} + +void APIENTRY +glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc) +{ +} + +void APIENTRY +glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc) +{ +} + +void APIENTRY +glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc) +{ +} + +void APIENTRY +glutDialsFunc(GLUTdialsCB dialsFunc) +{ +} + +void APIENTRY +glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc) +{ +} + +void APIENTRY +glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutColor.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutColor.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutColor.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutColor.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,32 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutColor.cpp + * + * DESCRIPTION: we don't support indexed color, so this code is + * really simple + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include "glutint.h" + +void glutSetColor(int cell, GLfloat red, GLfloat green, GLfloat blue) { + __glutWarning("glutSetColor: current window is RGBA"); +} + +GLfloat glutGetColor(int cell, int component) { + __glutWarning("glutGetColor: current window is RGBA"); + return -1.0; +} + +void glutCopyColormap(int win) { + __glutWarning("glutCopyColormap: color index not supported in BeOS"); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutCursor.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutCursor.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutCursor.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutCursor.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,90 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutCursor.cpp + * + * DESCRIPTION: code for handling custom mouse cursors + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include "glutint.h" +#include "glutState.h" +#include "glutCursors.h" + +static const unsigned char *cursorTable[] = { + XC_arrow, /* GLUT_CURSOR_RIGHT_ARROW */ + XC_top_left_arrow, /* GLUT_CURSOR_LEFT_ARROW */ + XC_hand1, /* GLUT_CURSOR_INFO */ + XC_pirate, /* GLUT_CURSOR_DESTROY */ + XC_question_arrow, /* GLUT_CURSOR_HELP */ + XC_exchange, /* GLUT_CURSOR_CYCLE */ + XC_spraycan, /* GLUT_CURSOR_SPRAY */ + XC_watch, /* GLUT_CURSOR_WAIT */ + XC_xterm, /* GLUT_CURSOR_TEXT */ + XC_crosshair, /* GLUT_CURSOR_CROSSHAIR */ + XC_sb_v_double_arrow, /* GLUT_CURSOR_UP_DOWN */ + XC_sb_h_double_arrow, /* GLUT_CURSOR_LEFT_RIGHT */ + XC_top_side, /* GLUT_CURSOR_TOP_SIDE */ + XC_bottom_side, /* GLUT_CURSOR_BOTTOM_SIDE */ + XC_left_side, /* GLUT_CURSOR_LEFT_SIDE */ + XC_right_side, /* GLUT_CURSOR_RIGHT_SIDE */ + XC_top_left_corner, /* GLUT_CURSOR_TOP_LEFT_CORNER */ + XC_top_right_corner, /* GLUT_CURSOR_TOP_RIGHT_CORNER */ + XC_bottom_right_corner, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */ + XC_bottom_left_corner, /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */ +}; + +/*********************************************************** + * FUNCTION: glutSetCursor (4.13) + * + * DESCRIPTION: set a new mouse cursor for current window + ***********************************************************/ +void glutSetCursor(int cursor) { + gState.currentWindow->Window()->Lock(); + gState.currentWindow->cursor = cursor; + __glutSetCursor(cursor); + gState.currentWindow->Window()->Unlock(); +} + +/*********************************************************** + * FUNCTION: __glutSetCursor + * + * DESCRIPTION: the actual cursor changing routine + ***********************************************************/ +void __glutSetCursor(int cursor) { + int realcursor = cursor; + if (cursor < 0 || cursor > GLUT_CURSOR_BOTTOM_LEFT_CORNER) { + switch(cursor) { + case GLUT_CURSOR_INHERIT: + return; // don't change cursor + case GLUT_CURSOR_NONE: + // this hides the cursor until the user moves the mouse + // change it to HideCursor() AT YOUR OWN RISK! + be_app->ObscureCursor(); + return; + case GLUT_CURSOR_FULL_CROSSHAIR: + realcursor = GLUT_CURSOR_CROSSHAIR; + break; + default: + __glutWarning("unknown cursor\n"); + return; + } + } + be_app->SetCursor(cursorTable[realcursor]); +} + +/*********************************************************** + * FUNCTION: glutWarpPointer (x.xx) + * + * DESCRIPTION: move the mouse pointer to a new location + * (note: can't do this in BeOS!) + ***********************************************************/ +void glutWarpPointer(int x, int y) { } diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutCursors.h xpsb-glx-0.19/mesa/src/glut/beos/glutCursors.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutCursors.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutCursors.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,3083 @@ +/* cursors.h: X Window standard cursor shapes */ +/* Generated by bdftobcursor */ + +const unsigned char XC_X_cursor[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x70, 0xe, + 0x78, 0x1e, + 0x7c, 0x3e, + 0x3e, 0x7c, + 0x1f, 0xf8, + 0xf, 0xf0, + 0x7, 0xe0, + 0x7, 0xe0, + 0xf, 0xf0, + 0x1f, 0xf8, + 0x3e, 0x7c, + 0x7c, 0x3e, + 0x78, 0x1e, + 0x70, 0xe, + 0x0, 0x0, + /* mask */ + 0xf0, 0xf, + 0xf8, 0x1f, + 0xfc, 0x3f, + 0xfe, 0x7f, + 0x7f, 0xfe, + 0x3f, 0xfc, + 0x1f, 0xf8, + 0xf, 0xf0, + 0xf, 0xf0, + 0x1f, 0xf8, + 0x3f, 0xfc, + 0x7f, 0xfe, + 0xfe, 0x7f, + 0xfc, 0x3f, + 0xf8, 0x1f, + 0xf0, 0xf, +}; + +const unsigned char XC_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 2, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x60, 0x0, + 0x78, 0x0, + 0x3e, 0x0, + 0x3f, 0x80, + 0x1f, 0xe0, + 0x1f, 0xf8, + 0xf, 0x80, + 0xf, 0xc0, + 0x6, 0xe0, + 0x6, 0x70, + 0x2, 0x38, + 0x2, 0x1c, + 0x0, 0xe, + 0x0, 0x4, + 0x0, 0x0, + /* mask */ + 0xe0, 0x0, + 0xf8, 0x0, + 0xfe, 0x0, + 0x7f, 0x80, + 0x7f, 0xe0, + 0x3f, 0xf8, + 0x3f, 0xfc, + 0x1f, 0xfc, + 0x1f, 0xe0, + 0xf, 0xf0, + 0xf, 0xf8, + 0x7, 0x7c, + 0x7, 0x3e, + 0x2, 0x1f, + 0x0, 0xe, + 0x0, 0x4, +}; + +const unsigned char XC_based_arrow_down[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 12, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0xf, 0xf0, + 0x0, 0x0, + 0xf, 0xf0, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x5, 0xa0, + 0x3, 0xc0, + 0x1, 0x80, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x3, 0xc0, + 0x3, 0xc0, + 0xf, 0xf0, + 0xf, 0xf0, + 0xf, 0xf0, + 0x7, 0xe0, + 0x3, 0xc0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_based_arrow_up[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 12, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x1, 0x80, + 0x3, 0xc0, + 0x5, 0xa0, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0xf, 0xf0, + 0x0, 0x0, + 0xf, 0xf0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x1, 0x80, + 0x3, 0xc0, + 0xf, 0xf0, + 0xf, 0xf0, + 0xf, 0xf0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_boat[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 2, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x80, + 0x3, 0xe0, + 0x6, 0x11, + 0xff, 0xff, + 0x18, 0x0, + 0x4, 0x0, + 0x2, 0x0, + 0x3, 0xff, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0xe0, + 0x3, 0xf0, + 0x7, 0xf9, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x1f, 0xff, + 0x7, 0xff, + 0x3, 0xff, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_bogosity[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x38, 0x8e, + 0x8, 0x88, + 0x8, 0x88, + 0x8, 0x88, + 0x3f, 0xfe, + 0x28, 0x8a, + 0x28, 0x8a, + 0x28, 0x8a, + 0x28, 0x8a, + 0x3f, 0xfe, + 0x8, 0x88, + 0x8, 0x88, + 0x8, 0x88, + 0x38, 0x8e, + 0x0, 0x0, + /* mask */ + 0x7d, 0xdf, + 0x7d, 0xdf, + 0x7d, 0xdf, + 0x1d, 0xdc, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7d, 0xdf, + 0x7d, 0xdf, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x1d, 0xdc, + 0x7d, 0xdf, + 0x7d, 0xdf, + 0x7d, 0xdf, +}; + +const unsigned char XC_bottom_left_corner[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 14, 15, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x6, + 0x0, 0x6, + 0x10, 0x46, + 0x8, 0x46, + 0x4, 0x46, + 0x2, 0x46, + 0x1, 0x46, + 0x0, 0xc6, + 0x1f, 0xc6, + 0x0, 0x6, + 0x0, 0x6, + 0x0, 0x6, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x0, 0x0, + /* mask */ + 0x0, 0xf, + 0x0, 0xf, + 0x30, 0xef, + 0x38, 0xef, + 0x1c, 0xef, + 0xe, 0xef, + 0x7, 0xef, + 0x3, 0xef, + 0x3f, 0xef, + 0x3f, 0xef, + 0x3f, 0xef, + 0x0, 0xf, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, +}; + +const unsigned char XC_bottom_right_corner[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 14, 2, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x60, 0x0, + 0x60, 0x0, + 0x62, 0x8, + 0x62, 0x10, + 0x62, 0x20, + 0x62, 0x40, + 0x62, 0x80, + 0x63, 0x0, + 0x63, 0xf8, + 0x60, 0x0, + 0x60, 0x0, + 0x60, 0x0, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x0, 0x0, + /* mask */ + 0xf0, 0x0, + 0xf0, 0x0, + 0xf7, 0xc, + 0xf7, 0x1c, + 0xf7, 0x38, + 0xf7, 0x70, + 0xf7, 0xe0, + 0xf7, 0xc0, + 0xf7, 0xfc, + 0xf7, 0xfc, + 0xf7, 0xfc, + 0xf0, 0x0, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, +}; + +const unsigned char XC_bottom_side[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 14, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x8, 0x88, + 0x4, 0x90, + 0x2, 0xa0, + 0x1, 0xc0, + 0x0, 0x80, + 0x0, 0x0, + 0x3f, 0xfe, + 0x3f, 0xfe, + 0x0, 0x0, + /* mask */ + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x19, 0xcc, + 0x1d, 0xdc, + 0xf, 0xf8, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, +}; + +const unsigned char XC_bottom_tee[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 12, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_box_spiral[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 7, /* y,x of hotspot */ + /* data */ + 0xff, 0xff, + 0x0, 0x1, + 0x7f, 0xfd, + 0x40, 0x5, + 0x5f, 0xf5, + 0x50, 0x15, + 0x57, 0xd5, + 0x54, 0x55, + 0x55, 0x55, + 0x55, 0xd5, + 0x54, 0x15, + 0x57, 0xf5, + 0x50, 0x5, + 0x5f, 0xfd, + 0x40, 0x1, + 0x7f, 0xff, + /* mask */ + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, +}; + +const unsigned char XC_center_ptr[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x81, 0x80, + 0x1, 0x80, + 0x3, 0xc0, + 0x3, 0xc0, + 0x7, 0xe0, + 0x7, 0xe0, + 0xf, 0xf0, + 0xf, 0xf0, + 0x19, 0x98, + 0x11, 0x88, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x0, 0x0, + /* mask */ + 0x83, 0xc0, + 0x3, 0xc0, + 0x7, 0xe0, + 0x7, 0xe0, + 0xf, 0xf0, + 0xf, 0xf0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3b, 0xdc, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, +}; + +const unsigned char XC_circle[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x3, 0xc0, + 0xf, 0xf0, + 0x1f, 0xf8, + 0x3c, 0x3c, + 0x38, 0x1c, + 0x70, 0xe, + 0x70, 0xe, + 0x70, 0xe, + 0x70, 0xe, + 0x38, 0x1c, + 0x3c, 0x3c, + 0x1f, 0xf8, + 0xf, 0xf0, + 0x3, 0xc0, + 0x0, 0x0, + /* mask */ + 0x7, 0xe0, + 0x1f, 0xf8, + 0x3f, 0xfc, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0xfc, 0x3f, + 0xf8, 0x1f, + 0xf8, 0x1f, + 0xf8, 0x1f, + 0xf8, 0x1f, + 0xfc, 0x3f, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x3f, 0xfc, + 0x1f, 0xf8, + 0x7, 0xe0, +}; + +const unsigned char XC_clock[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 3, 9, /* y,x of hotspot */ + /* data */ + 0x1f, 0xf8, + 0x33, 0xcc, + 0x66, 0x26, + 0x49, 0x92, + 0x48, 0xf2, + 0x44, 0x22, + 0x63, 0xc6, + 0x3f, 0xfc, + 0x29, 0x94, + 0x29, 0x94, + 0x29, 0x94, + 0x2b, 0xd4, + 0x69, 0x96, + 0x78, 0x1e, + 0x7f, 0xfe, + 0x7f, 0xfe, + /* mask */ + 0x1f, 0xfe, + 0x39, 0xf7, + 0x77, 0xdb, + 0x6d, 0xed, + 0x6f, 0xfd, + 0x66, 0xf9, + 0x73, 0xf3, + 0x3f, 0xff, + 0x35, 0xeb, + 0x35, 0xeb, + 0x35, 0xeb, + 0x37, 0xfb, + 0x75, 0xeb, + 0x7c, 0xcf, + 0x7f, 0xff, + 0x7f, 0xff, +}; + +const unsigned char XC_coffee_mug[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 9, 8, /* y,x of hotspot */ + /* data */ + 0x8f, 0xf8, + 0x10, 0x4, + 0x60, 0x6, + 0x58, 0xa, + 0x47, 0xf2, + 0x40, 0x3, + 0x40, 0x3, + 0x40, 0x2, + 0x40, 0x2, + 0x58, 0x9a, + 0x55, 0x56, + 0x55, 0xd7, + 0x59, 0x5b, + 0x40, 0x2, + 0x40, 0x2, + 0x3f, 0xfc, + /* mask */ + 0xf, 0xf8, + 0x1f, 0xfc, + 0xff, 0xfe, + 0xff, 0xfe, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xfe, + 0xff, 0xfe, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xfe, + 0x3f, 0xfc, +}; + +const unsigned char XC_cross[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 9, /* y,x of hotspot */ + /* data */ + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0xff, 0x7f, + 0x0, 0x0, + 0xff, 0x7f, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x0, 0x0, + /* mask */ + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, +}; + +const unsigned char XC_cross_reverse[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 9, /* y,x of hotspot */ + /* data */ + 0x21, 0x42, + 0x51, 0x45, + 0x29, 0x4a, + 0x15, 0x54, + 0xb, 0x68, + 0x5, 0x50, + 0xfe, 0xbf, + 0x1, 0x40, + 0xfe, 0xbf, + 0x5, 0x50, + 0xb, 0x68, + 0x15, 0x54, + 0x29, 0x4a, + 0x51, 0x45, + 0x21, 0x42, + 0x0, 0x0, + /* mask */ + 0x33, 0x66, + 0xdb, 0x6d, + 0x6f, 0x7b, + 0x37, 0x76, + 0x1b, 0x6c, + 0xfd, 0x5f, + 0xfe, 0x3f, + 0x0, 0x80, + 0xfe, 0x3f, + 0xfd, 0x5f, + 0x1b, 0x6c, + 0x37, 0x76, + 0x6f, 0x7b, + 0xdb, 0x6d, + 0x33, 0x66, + 0x0, 0x0, +}; + +const unsigned char XC_crosshair[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0xff, 0x7f, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x0, + /* mask */ + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, +}; + +const unsigned char XC_diamond_cross[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x81, 0x40, + 0x3, 0x60, + 0x5, 0x50, + 0x9, 0x48, + 0x11, 0x44, + 0x21, 0x42, + 0x7f, 0x7f, + 0x0, 0x0, + 0x7f, 0x7f, + 0x21, 0x42, + 0x11, 0x44, + 0x9, 0x48, + 0x5, 0x50, + 0x3, 0x60, + 0x1, 0x40, + 0x0, 0x0, + /* mask */ + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0x1d, 0xdc, + 0x39, 0xce, + 0x71, 0xc7, + 0xff, 0xff, + 0xff, 0x7f, + 0xff, 0xff, + 0x71, 0xc7, + 0x39, 0xce, + 0x1d, 0xdc, + 0xf, 0xf8, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, +}; + +const unsigned char XC_dot[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x83, 0xc0, + 0xf, 0xf0, + 0xf, 0xf0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0xf, 0xf0, + 0xf, 0xf0, + 0x3, 0xc0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x87, 0xe0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x7, 0xe0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_dotbox[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x7f, 0xfc, + 0x20, 0x4, + 0x20, 0x4, + 0x20, 0x4, + 0x20, 0x4, + 0x21, 0x84, + 0x21, 0x84, + 0x20, 0x4, + 0x20, 0x4, + 0x20, 0x4, + 0x20, 0x4, + 0x3f, 0xfc, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x70, 0xe, + 0x70, 0xe, + 0x73, 0xce, + 0x73, 0xce, + 0x73, 0xce, + 0x73, 0xce, + 0x70, 0xe, + 0x70, 0xe, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x0, 0x0, +}; + +const unsigned char XC_double_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x81, 0x80, + 0x3, 0xc0, + 0x7, 0xe0, + 0xd, 0xb0, + 0x19, 0x98, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x19, 0x98, + 0xd, 0xb0, + 0x7, 0xe0, + 0x3, 0xc0, + 0x1, 0x80, + 0x0, 0x0, + /* mask */ + 0x83, 0xc0, + 0x7, 0xe0, + 0xf, 0xf0, + 0x1f, 0xf8, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x1f, 0xf8, + 0xf, 0xf0, + 0x7, 0xe0, + 0x3, 0xc0, +}; + +const unsigned char XC_draft_large[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 1, /* y,x of hotspot */ + /* data */ + 0xc0, 0x0, + 0x30, 0x0, + 0x3c, 0x0, + 0x1f, 0x0, + 0x1f, 0xc0, + 0xf, 0xf0, + 0xf, 0xfc, + 0x7, 0x80, + 0x7, 0x40, + 0x3, 0x20, + 0x3, 0x10, + 0x1, 0x8, + 0x1, 0x4, + 0x0, 0x2, + 0x0, 0x1, + 0x0, 0x0, + /* mask */ + 0x60, 0x0, + 0x78, 0x0, + 0x7e, 0x0, + 0x3f, 0x80, + 0x1f, 0xe0, + 0x1f, 0xf8, + 0xf, 0xfe, + 0xf, 0xfe, + 0x7, 0xe0, + 0x7, 0xf0, + 0x3, 0xb8, + 0x3, 0x9c, + 0x1, 0x8e, + 0x1, 0x87, + 0x0, 0x3, + 0x0, 0x1, +}; + +const unsigned char XC_draft_small[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 1, /* y,x of hotspot */ + /* data */ + 0x40, 0x0, + 0x30, 0x0, + 0x3c, 0x0, + 0x1f, 0x0, + 0x1f, 0xc0, + 0xe, 0x0, + 0xd, 0x0, + 0x4, 0x80, + 0x4, 0x40, + 0x0, 0x20, + 0x0, 0x10, + 0x0, 0x8, + 0x0, 0x4, + 0x0, 0x2, + 0x0, 0x1, + 0x0, 0x0, + /* mask */ + 0x60, 0x0, + 0x78, 0x0, + 0x3e, 0x0, + 0x3f, 0x80, + 0x1f, 0xe0, + 0x1f, 0xe0, + 0xf, 0x80, + 0xf, 0xc0, + 0x6, 0xe0, + 0x2, 0x70, + 0x0, 0x38, + 0x0, 0x1c, + 0x0, 0xe, + 0x0, 0x7, + 0x0, 0x3, + 0x0, 0x0, +}; + +const unsigned char XC_draped_box[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x7f, 0xfc, + 0x22, 0x44, + 0x26, 0x64, + 0x2c, 0x34, + 0x38, 0x1c, + 0x21, 0x84, + 0x21, 0x84, + 0x38, 0x1c, + 0x2c, 0x34, + 0x26, 0x64, + 0x22, 0x44, + 0x3f, 0xfc, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x67, 0xe6, + 0x6f, 0xf6, + 0x7e, 0x7e, + 0x7d, 0xbe, + 0x7b, 0xde, + 0x7b, 0xde, + 0x7d, 0xbe, + 0x7e, 0x7e, + 0x6f, 0xf6, + 0x67, 0xe6, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x0, 0x0, +}; + +const unsigned char XC_exchange[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x7, 0xe2, + 0xf, 0xf6, + 0x18, 0x3e, + 0x10, 0x12, + 0x0, 0x32, + 0x0, 0x7e, + 0x0, 0x0, + 0x0, 0x0, + 0x7e, 0x0, + 0x4c, 0x0, + 0x48, 0x8, + 0x7c, 0x18, + 0x6f, 0xf0, + 0x47, 0xe0, + 0x0, 0x0, + /* mask */ + 0x7, 0xe3, + 0xf, 0xf7, + 0x1f, 0xff, + 0x3f, 0xff, + 0x38, 0x3f, + 0x30, 0xff, + 0x0, 0xff, + 0x0, 0xff, + 0xff, 0x0, + 0xff, 0x0, + 0xfe, 0xc, + 0xfc, 0x1c, + 0xff, 0xfc, + 0xff, 0xf8, + 0xef, 0xf0, + 0xc7, 0xe0, +}; + +const unsigned char XC_fleur[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x1, 0x80, + 0x3, 0xc0, + 0x7, 0xe0, + 0x1, 0x80, + 0x11, 0x88, + 0x31, 0x8c, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x31, 0x8c, + 0x11, 0x88, + 0x1, 0x80, + 0x7, 0xe0, + 0x3, 0xc0, + 0x1, 0x80, + 0x0, 0x0, + /* mask */ + 0x3, 0xc0, + 0x7, 0xc0, + 0x7, 0xe0, + 0xf, 0xf0, + 0x17, 0xe8, + 0x3b, 0xdc, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x3b, 0xdc, + 0x17, 0xe8, + 0xf, 0xf0, + 0x7, 0xe0, + 0x3, 0xc0, + 0x3, 0xc0, +}; + +const unsigned char XC_gobbler[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 2, 2, /* y,x of hotspot */ + /* data */ + 0x1e, 0x0, + 0xe, 0x0, + 0xcc, 0x1, + 0xd, 0xf9, + 0xf, 0xff, + 0xc, 0x7f, + 0xc, 0x3f, + 0x1c, 0x6, + 0xf, 0x0, + 0x7, 0xf8, + 0x0, 0x10, + 0x0, 0x10, + 0x0, 0x10, + 0x0, 0x10, + 0x0, 0x78, + 0x0, 0x0, + /* mask */ + 0x3f, 0x0, + 0x3f, 0x0, + 0xff, 0x3, + 0xff, 0xff, + 0xff, 0xff, + 0x3f, 0xff, + 0x3f, 0xff, + 0x3f, 0xff, + 0x3f, 0xff, + 0x3f, 0xff, + 0x1f, 0xfe, + 0xf, 0xf8, + 0x0, 0x38, + 0x0, 0x38, + 0x0, 0xfc, + 0x0, 0xfc, +}; + +const unsigned char XC_gumby[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 14, /* y,x of hotspot */ + /* data */ + 0x0, 0xfc, + 0x1, 0x8, + 0x2, 0x13, + 0x5, 0x57, + 0x4, 0x13, + 0x5, 0xd3, + 0x3c, 0x1f, + 0xfc, 0x1c, + 0xe4, 0x10, + 0xe4, 0x10, + 0xf4, 0x90, + 0xe4, 0x90, + 0x4, 0x90, + 0x8, 0x88, + 0x10, 0x84, + 0x1f, 0x7c, + /* mask */ + 0x0, 0xfc, + 0x1, 0xfb, + 0x3, 0xf7, + 0x7, 0xff, + 0x7, 0xf7, + 0x3f, 0xf7, + 0x7f, 0xff, + 0xff, 0xff, + 0xf7, 0xfc, + 0xf7, 0xf0, + 0xff, 0xf0, + 0xf7, 0xf0, + 0xe7, 0xf0, + 0xf, 0xf8, + 0x1f, 0xfc, + 0x1f, 0x7c, +}; + +const unsigned char XC_hand1[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 2, /* y,x of hotspot */ + /* data */ + 0x30, 0x0, + 0x3c, 0x0, + 0xf, 0x0, + 0x7, 0x80, + 0x3, 0xc0, + 0x7, 0xe0, + 0xf, 0xf0, + 0x7, 0xf4, + 0xf, 0xfe, + 0xf, 0xfa, + 0x7, 0xe0, + 0x3, 0xe0, + 0x0, 0x52, + 0x0, 0x46, + 0x0, 0x2c, + 0x0, 0x18, + /* mask */ + 0xb8, 0x0, + 0x3e, 0x0, + 0x1f, 0x80, + 0xf, 0xc0, + 0x7, 0xe0, + 0xf, 0xf0, + 0x1f, 0xfc, + 0x1f, 0xfe, + 0x1f, 0xfe, + 0x1f, 0xfe, + 0xf, 0xfe, + 0x7, 0xfe, + 0x3, 0xfe, + 0x0, 0xfe, + 0x0, 0x7e, + 0x0, 0x3c, +}; + +const unsigned char XC_hand2[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 15, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x1, 0xfe, + 0x2, 0x1, + 0x4, 0x7e, + 0x8, 0x8, + 0x8, 0x70, + 0x8, 0x8, + 0x14, 0x70, + 0x22, 0x8, + 0x41, 0x30, + 0x20, 0xc0, + 0x12, 0x40, + 0x8, 0x80, + 0x5, 0x0, + 0x2, 0x0, + 0x0, 0x0, + /* mask */ + 0x1, 0xfe, + 0x3, 0xff, + 0x7, 0xff, + 0xf, 0xff, + 0x1f, 0xfe, + 0x1f, 0xf8, + 0x1f, 0xfc, + 0x3f, 0xf8, + 0x7f, 0xfc, + 0xff, 0xf8, + 0x7f, 0xf0, + 0x3f, 0xe0, + 0x1f, 0xc0, + 0xf, 0x80, + 0x7, 0x0, + 0x2, 0x0, +}; + +const unsigned char XC_heart[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 9, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x1f, 0x7c, + 0x31, 0xc6, + 0x60, 0x83, + 0x40, 0x1, + 0x40, 0x1, + 0x40, 0x1, + 0x40, 0x1, + 0x60, 0x3, + 0x30, 0x6, + 0x18, 0xc, + 0xc, 0x18, + 0x6, 0x30, + 0x3, 0x60, + 0x1, 0xc0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x9f, 0x7c, + 0x3f, 0xfe, + 0x71, 0xc7, + 0x60, 0x83, + 0x60, 0x3, + 0x60, 0x3, + 0x61, 0x43, + 0x70, 0x87, + 0x38, 0xe, + 0x1c, 0x1c, + 0xe, 0x38, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x0, 0x0, +}; + +const unsigned char XC_icon[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0xff, 0xff, + 0xaa, 0xab, + 0xd5, 0x55, + 0xaa, 0xab, + 0xd0, 0x5, + 0xa0, 0xb, + 0xd0, 0x5, + 0xa0, 0xb, + 0xd0, 0x5, + 0xa0, 0xb, + 0xd0, 0x5, + 0xa0, 0xb, + 0xd5, 0x55, + 0xaa, 0xab, + 0xd5, 0x55, + 0xff, 0xff, + /* mask */ + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, +}; + +const unsigned char XC_iron_cross[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x3f, 0xfc, + 0x1f, 0xf8, + 0x4f, 0xf2, + 0x67, 0xe6, + 0x73, 0xce, + 0x79, 0x9e, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x79, 0x9e, + 0x73, 0xce, + 0x67, 0xe6, + 0x4f, 0xf2, + 0x1f, 0xf8, + 0x3f, 0xfc, + 0x0, 0x0, + /* mask */ + 0x3f, 0xfc, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x7f, 0xfe, + 0x7f, 0xfe, + 0x3f, 0xfc, +}; + +const unsigned char XC_left_ptr[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 12, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x10, + 0x0, 0x30, + 0x0, 0x70, + 0x0, 0xf0, + 0x1, 0xf0, + 0x3, 0xf0, + 0x7, 0xf0, + 0xf, 0xf0, + 0x1, 0xf0, + 0x1, 0xb0, + 0x3, 0x10, + 0x3, 0x0, + 0x6, 0x0, + 0x6, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x18, + 0x0, 0x38, + 0x0, 0x78, + 0x0, 0xf8, + 0x1, 0xf8, + 0x3, 0xf8, + 0x7, 0xf8, + 0xf, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x3, 0xf8, + 0x7, 0xb8, + 0x7, 0x98, + 0xf, 0x0, + 0xf, 0x0, + 0x6, 0x0, +}; + +const unsigned char XC_left_side[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 15, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x6, + 0x0, 0x6, + 0x1, 0x6, + 0x0, 0x86, + 0x0, 0x46, + 0x0, 0x26, + 0x7f, 0xf6, + 0x0, 0x26, + 0x0, 0x46, + 0x0, 0x86, + 0x1, 0x6, + 0x0, 0x6, + 0x0, 0x6, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0xf, + 0x0, 0xf, + 0x3, 0xf, + 0x3, 0x8f, + 0x1, 0xcf, + 0x0, 0xef, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x0, 0xef, + 0x1, 0xcf, + 0x3, 0x8f, + 0x3, 0xf, + 0x0, 0xf, + 0x0, 0xf, + 0x0, 0x0, +}; + +const unsigned char XC_left_tee[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 13, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x80, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x0, + /* mask */ + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, +}; + +const unsigned char XC_leftbutton[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0xc0, 0x1, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xa2, 0x22, + 0xaa, 0xa2, + 0xaa, 0xa2, + 0xaa, 0xa2, + 0xaa, 0xa2, + 0xa2, 0x22, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xc0, 0x1, + /* mask */ + 0xbf, 0xfe, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x3f, 0xfe, +}; + +const unsigned char XC_ll_angle[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 12, 13, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x80, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_lr_angle[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 12, 4, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x98, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_man[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 5, 2, /* y,x of hotspot */ + /* data */ + 0x1, 0xc0, + 0xf, 0x78, + 0x1, 0x40, + 0x0, 0x81, + 0xe1, 0xc2, + 0xd2, 0x24, + 0xe, 0xb8, + 0x2, 0xa0, + 0x2, 0x20, + 0x1, 0x40, + 0x2, 0x20, + 0x4, 0x90, + 0x9, 0x48, + 0xa, 0x28, + 0x3c, 0x1e, + 0xfc, 0x1f, + /* mask */ + 0x7, 0xf8, + 0xf, 0xfc, + 0x1f, 0xfc, + 0x41, 0xc3, + 0xe3, 0xe7, + 0xff, 0xfe, + 0xdf, 0xfc, + 0xf, 0xf8, + 0x7, 0xe0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0x1f, 0xfc, + 0x3f, 0x7e, + 0xfe, 0x3f, + 0xfe, 0x3f, +}; + +const unsigned char XC_middlebutton[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0xc0, 0x1, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xa2, 0x22, + 0xaa, 0x2a, + 0xaa, 0x2a, + 0xaa, 0x2a, + 0xaa, 0x2a, + 0xa2, 0x22, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xc0, 0x1, + /* mask */ + 0xbf, 0xfe, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x3f, 0xfe, +}; + +const unsigned char XC_mouse[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 2, 11, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0xe0, + 0x0, 0x30, + 0x0, 0x60, + 0x0, 0xc0, + 0x1f, 0xfe, + 0x20, 0x1, + 0x6c, 0xcd, + 0x6c, 0xcd, + 0x6c, 0xcd, + 0x60, 0x1, + 0x60, 0x1, + 0x38, 0x6, + 0x6, 0x18, + 0x1, 0xe0, + 0x0, 0x0, + /* mask */ + 0x1, 0xf0, + 0x0, 0x78, + 0x0, 0xf0, + 0x0, 0xe0, + 0x1f, 0xfe, + 0x3f, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xef, 0xfc, + 0x7, 0xf8, + 0x3, 0xf0, + 0x1, 0xe0, +}; + +const unsigned char XC_pencil[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 15, 3, /* y,x of hotspot */ + /* data */ + 0x40, 0x38, + 0x0, 0x44, + 0x0, 0xc4, + 0x1, 0x48, + 0x1, 0x78, + 0x2, 0x10, + 0x2, 0x20, + 0x4, 0x20, + 0x4, 0x40, + 0x8, 0xc0, + 0x8, 0x80, + 0x11, 0x0, + 0x1e, 0x0, + 0x1c, 0x0, + 0x18, 0x0, + 0x10, 0x0, + /* mask */ + 0x80, 0x7e, + 0x0, 0xfe, + 0x1, 0xfe, + 0x1, 0xfc, + 0x3, 0xf8, + 0x3, 0xf8, + 0x7, 0xf0, + 0x7, 0xe0, + 0xf, 0xe0, + 0xf, 0xc0, + 0x1f, 0xc0, + 0x3f, 0x80, + 0x3f, 0x0, + 0x3e, 0x0, + 0x3c, 0x0, + 0x38, 0x0, +}; + +const unsigned char XC_pirate[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 12, 8, /* y,x of hotspot */ + /* data */ + 0x1, 0xe0, + 0x3, 0xf0, + 0x7, 0xf8, + 0xc, 0xcc, + 0xc, 0xcc, + 0x7, 0xf8, + 0x3, 0xf0, + 0x1, 0xe0, + 0x21, 0xe1, + 0x61, 0xe1, + 0x10, 0xc2, + 0xe, 0x1c, + 0x1, 0xe0, + 0x47, 0xf8, + 0x7c, 0xf, + 0x20, 0x1, + /* mask */ + 0x3, 0xf0, + 0x7, 0xf8, + 0xf, 0xfc, + 0x1f, 0xfe, + 0x1f, 0xfe, + 0xf, 0xfc, + 0x7, 0xf8, + 0x83, 0xf1, + 0xe3, 0xf1, + 0xf3, 0xf3, + 0x39, 0xef, + 0x1e, 0x1e, + 0x1, 0xe0, + 0xc7, 0xfe, + 0xff, 0xff, + 0x7c, 0xf, +}; + +const unsigned char XC_plus[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x81, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_question_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x83, 0xe0, + 0x7, 0xf0, + 0xe, 0x38, + 0xc, 0x18, + 0xc, 0x38, + 0xe, 0x30, + 0x7, 0x0, + 0x3, 0xc0, + 0x1, 0xc0, + 0x1, 0x40, + 0x1, 0x40, + 0x7, 0x70, + 0x3, 0x60, + 0x1, 0xc0, + 0x0, 0x80, + 0x0, 0x0, + /* mask */ + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0x1f, 0xfc, + 0x1e, 0x3c, + 0x1e, 0x7c, + 0x1f, 0x78, + 0xf, 0xf0, + 0x7, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, +}; + +const unsigned char XC_right_ptr[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 5, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x8, 0x0, + 0xc, 0x0, + 0xe, 0x0, + 0xf, 0x0, + 0xf, 0x80, + 0xf, 0xc0, + 0xf, 0xe0, + 0xf, 0xf0, + 0xf, 0x80, + 0xd, 0x80, + 0x8, 0xc0, + 0x0, 0xc0, + 0x0, 0x60, + 0x0, 0x60, + 0x0, 0x0, + /* mask */ + 0x18, 0x0, + 0x1c, 0x0, + 0x1e, 0x0, + 0x1f, 0x0, + 0x1f, 0x80, + 0x1f, 0xc0, + 0x1f, 0xe0, + 0x1f, 0xf0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x1f, 0xc0, + 0x1d, 0xe0, + 0x19, 0xe0, + 0x0, 0xf0, + 0x0, 0xf0, + 0x0, 0x60, +}; + +const unsigned char XC_right_side[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 2, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x60, 0x0, + 0x60, 0x0, + 0x60, 0x80, + 0x61, 0x0, + 0x62, 0x0, + 0x64, 0x0, + 0x6f, 0xfe, + 0x64, 0x0, + 0x62, 0x0, + 0x61, 0x0, + 0x60, 0x80, + 0x60, 0x0, + 0x60, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0xf0, 0x0, + 0xf0, 0x0, + 0xf0, 0xc0, + 0xf1, 0xc0, + 0xf3, 0x80, + 0xf7, 0x0, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xf7, 0x0, + 0xf3, 0x80, + 0xf1, 0xc0, + 0xf0, 0xc0, + 0xf0, 0x0, + 0xf0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_right_tee[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 4, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x98, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x0, 0x0, + /* mask */ + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, +}; + +const unsigned char XC_rightbutton[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0xc0, 0x1, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xa2, 0x22, + 0xa2, 0xaa, + 0xa2, 0xaa, + 0xa2, 0xaa, + 0xa2, 0xaa, + 0xa2, 0x22, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xbf, 0xfe, + 0xc0, 0x1, + /* mask */ + 0xbf, 0xfe, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x3f, 0xfe, +}; + +const unsigned char XC_rtl_logo[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 9, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x7f, 0xfe, + 0x44, 0x2, + 0x44, 0x2, + 0x44, 0x2, + 0x47, 0xfe, + 0x44, 0x22, + 0x44, 0x22, + 0x44, 0x22, + 0x44, 0x22, + 0x7f, 0xe2, + 0x40, 0x22, + 0x40, 0x22, + 0x40, 0x22, + 0x7f, 0xfe, + 0x0, 0x0, + /* mask */ + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xee, 0x7, + 0xef, 0xff, + 0xef, 0xff, + 0xef, 0xff, + 0xee, 0x77, + 0xee, 0x77, + 0xff, 0xf7, + 0xff, 0xf7, + 0xff, 0xf7, + 0xe0, 0x77, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, +}; + +const unsigned char XC_sailboat[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x42, 0x0, + 0x2, 0x0, + 0x6, 0x80, + 0x6, 0x80, + 0x6, 0xc0, + 0xe, 0xc0, + 0xe, 0xe0, + 0xe, 0xe0, + 0x1e, 0xf0, + 0x1e, 0xf0, + 0x1e, 0xf8, + 0x3e, 0xf8, + 0x1c, 0x7c, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x3, 0x0, + 0x7, 0x0, + 0x7, 0x80, + 0xf, 0xc0, + 0xf, 0xc0, + 0xf, 0xe0, + 0x1f, 0xe0, + 0x1f, 0xf0, + 0x1f, 0xf0, + 0x3f, 0xf8, + 0x3f, 0xf8, + 0x3f, 0xfc, + 0xff, 0xfc, + 0xff, 0xfe, + 0x1f, 0xff, + 0x7, 0xfe, +}; + +const unsigned char XC_sb_down_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 15, 8, /* y,x of hotspot */ + /* data */ + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x0, 0x80, + 0x0, 0x0, + /* mask */ + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0xf, 0xf8, + 0xf, 0xf8, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x0, 0x80, +}; + +const unsigned char XC_sb_h_double_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x8, 0x8, + 0x18, 0xc, + 0x3f, 0xfe, + 0x78, 0xf, + 0x3f, 0xfe, + 0x18, 0xc, + 0x8, 0x8, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x8c, 0x18, + 0x1c, 0x1c, + 0x3f, 0xfe, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x3f, 0xfe, + 0x1c, 0x1c, + 0xc, 0x18, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_sb_left_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 16, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x8, + 0x0, 0xc, + 0x7f, 0xfe, + 0x0, 0xf, + 0x7f, 0xfe, + 0x0, 0xc, + 0x0, 0x8, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x30, + 0x0, 0x38, + 0xff, 0xfc, + 0xff, 0xfe, + 0xff, 0xff, + 0xff, 0xfe, + 0xff, 0xfc, + 0x0, 0x38, + 0x0, 0x30, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_sb_right_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 0, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x8, 0x0, + 0x18, 0x0, + 0x3f, 0xff, + 0x78, 0x0, + 0x3f, 0xff, + 0x18, 0x0, + 0x8, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0xc, 0x0, + 0x1c, 0x0, + 0x3f, 0xff, + 0x7f, 0xff, + 0xff, 0xff, + 0x7f, 0xff, + 0x3f, 0xff, + 0x1c, 0x0, + 0xc, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_sb_up_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x80, + 0x9, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x0, 0x0, + /* mask */ + 0x0, 0x80, + 0x1, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0xf, 0xf8, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, +}; + +const unsigned char XC_sb_v_double_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x80, + 0x9, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x0, 0x80, + 0x0, 0x0, + /* mask */ + 0x1, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0xf, 0xf8, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0x3, 0xe0, + 0xf, 0xf8, + 0xf, 0xf8, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x0, 0x0, +}; + +const unsigned char XC_shuttle[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 5, /* y,x of hotspot */ + /* data */ + 0x84, 0x0, + 0xe, 0x0, + 0x1f, 0x0, + 0x7b, 0x80, + 0x7b, 0xa0, + 0x7b, 0x90, + 0x7b, 0x88, + 0x7b, 0x88, + 0x7b, 0x88, + 0x7b, 0x88, + 0x7b, 0x8c, + 0x7b, 0x8e, + 0x7b, 0xbf, + 0x11, 0x18, + 0x1e, 0x0, + 0xc, 0x0, + /* mask */ + 0x1c, 0x0, + 0x3e, 0x0, + 0x7f, 0x0, + 0xff, 0x0, + 0xff, 0x60, + 0xff, 0x70, + 0xff, 0x78, + 0xff, 0x78, + 0xff, 0x78, + 0xff, 0x78, + 0xff, 0x7c, + 0xff, 0x7e, + 0xff, 0x7f, + 0x7f, 0x7e, + 0x7e, 0x30, + 0x3c, 0x0, +}; + +const unsigned char XC_sizing[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x81, 0xfe, + 0x0, 0x2, + 0x0, 0x2, + 0x0, 0x2, + 0x7, 0xe2, + 0x4, 0x22, + 0x44, 0x22, + 0x44, 0x22, + 0x44, 0x20, + 0x47, 0xe0, + 0x48, 0x0, + 0x50, 0x0, + 0x60, 0x0, + 0x7f, 0x80, + 0x0, 0x0, + /* mask */ + 0x3, 0xff, + 0x3, 0xff, + 0x3, 0xff, + 0x0, 0x7, + 0xf, 0xf7, + 0xf, 0xf7, + 0xef, 0xf7, + 0xee, 0x77, + 0xee, 0x77, + 0xef, 0xf7, + 0xef, 0xf0, + 0xff, 0xf0, + 0xf8, 0x0, + 0xff, 0xc0, + 0xff, 0xc0, + 0xff, 0xc0, +}; + +const unsigned char XC_spider[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 10, /* y,x of hotspot */ + /* data */ + 0x8, 0x4, + 0x4, 0x8, + 0x4, 0x8, + 0x2, 0x10, + 0x2, 0x10, + 0xe1, 0xe1, + 0x19, 0xe6, + 0x7, 0xf8, + 0x7, 0xf8, + 0x19, 0xe6, + 0xe1, 0xe1, + 0x2, 0x10, + 0x2, 0x10, + 0x4, 0x8, + 0x4, 0x8, + 0x8, 0x4, + /* mask */ + 0x18, 0x6, + 0xc, 0xc, + 0x4, 0x8, + 0x6, 0x18, + 0x83, 0xf1, + 0xf3, 0xf3, + 0x3b, 0xf6, + 0xf, 0xfc, + 0x7, 0xfc, + 0x1f, 0xf6, + 0xf3, 0xf3, + 0x83, 0xf1, + 0x2, 0x18, + 0x6, 0x18, + 0xc, 0xc, + 0x18, 0x6, +}; + +const unsigned char XC_spraycan[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 2, 4, /* y,x of hotspot */ + /* data */ + 0x98, 0x0, + 0x2, 0x0, + 0x18, 0xb0, + 0x2, 0x78, + 0x18, 0x58, + 0x0, 0xfc, + 0x0, 0x84, + 0x0, 0x9c, + 0x0, 0x94, + 0x0, 0x9c, + 0x0, 0x94, + 0x0, 0x9c, + 0x0, 0x9c, + 0x0, 0x84, + 0x0, 0x84, + 0x0, 0xfc, + /* mask */ + 0x30, 0x0, + 0x34, 0x60, + 0x35, 0xf0, + 0x35, 0xf0, + 0x35, 0xf8, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, + 0x3, 0xfc, +}; + +const unsigned char XC_star[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x80, 0x80, + 0x1, 0x40, + 0x1, 0x40, + 0x1, 0x40, + 0x2, 0x20, + 0x2, 0x20, + 0x2, 0x20, + 0x1c, 0x9c, + 0x60, 0x3, + 0x1c, 0x1c, + 0x4, 0x90, + 0x9, 0x48, + 0x12, 0x24, + 0x14, 0x14, + 0x18, 0xc, + 0x10, 0x4, + /* mask */ + 0x0, 0x80, + 0x1, 0xc0, + 0x1, 0xc0, + 0x3, 0x60, + 0x3, 0x60, + 0x6, 0x30, + 0x1e, 0x38, + 0x7c, 0x9f, + 0xe0, 0x3, + 0x7c, 0x1f, + 0x1c, 0x9c, + 0x19, 0xcc, + 0x33, 0x66, + 0x36, 0x36, + 0x3c, 0x1e, + 0x38, 0xe, +}; + +const unsigned char XC_target[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x81, 0xc0, + 0x7, 0xf0, + 0xe, 0x38, + 0x18, 0xc, + 0x30, 0x6, + 0x60, 0x83, + 0x61, 0x43, + 0x60, 0x83, + 0x30, 0x6, + 0x18, 0xc, + 0xe, 0x38, + 0x7, 0xf0, + 0x1, 0xc0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0x1e, 0x3c, + 0x38, 0xe, + 0x70, 0x87, + 0xe1, 0xc3, + 0xe3, 0x63, + 0xe1, 0xc3, + 0x70, 0x87, + 0x38, 0xe, + 0x1e, 0x3c, + 0xf, 0xf8, + 0x3, 0xe0, + 0x0, 0x0, +}; + +const unsigned char XC_tcross[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 7, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0xc0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x3f, 0xfe, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x0, 0x0, +}; + +const unsigned char XC_top_left_arrow[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 15, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x80, 0x6, + 0x0, 0x1e, + 0x0, 0x7c, + 0x1, 0xfc, + 0x7, 0xf8, + 0x1f, 0xf8, + 0x1, 0xf0, + 0x1, 0xf0, + 0x2, 0x60, + 0x4, 0x60, + 0x8, 0x40, + 0x10, 0x40, + 0x20, 0x0, + 0x40, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x7, + 0x0, 0x1f, + 0x0, 0x7f, + 0x1, 0xfe, + 0x7, 0xfe, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xf8, + 0x3, 0xf8, + 0x7, 0xf0, + 0xe, 0xf0, + 0x1c, 0xe0, + 0x38, 0xe0, + 0x70, 0xe0, + 0xe0, 0x0, + 0xc0, 0x0, +}; + +const unsigned char XC_top_left_corner[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 15, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0xff, 0xfe, + 0x7f, 0xfe, + 0x0, 0x6, + 0x0, 0x6, + 0x0, 0x6, + 0x1f, 0xc6, + 0x0, 0xc6, + 0x1, 0x46, + 0x2, 0x46, + 0x4, 0x46, + 0x8, 0x46, + 0x10, 0x46, + 0x0, 0x6, + 0x0, 0x6, + 0x0, 0x0, + /* mask */ + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x0, 0xf, + 0x3f, 0xef, + 0x3f, 0xef, + 0x3f, 0xef, + 0x3, 0xef, + 0x7, 0xef, + 0xe, 0xef, + 0x1c, 0xef, + 0x38, 0xef, + 0x30, 0xef, + 0x0, 0xf, + 0x0, 0xf, +}; + +const unsigned char XC_top_right_corner[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 2, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0xff, 0xfe, + 0x7f, 0xfe, + 0x60, 0x0, + 0x60, 0x0, + 0x60, 0x0, + 0x63, 0xf8, + 0x63, 0x0, + 0x62, 0x80, + 0x62, 0x40, + 0x62, 0x20, + 0x62, 0x10, + 0x62, 0x8, + 0x60, 0x0, + 0x60, 0x0, + 0x0, 0x0, + /* mask */ + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xf0, 0x0, + 0xf7, 0xfc, + 0xf7, 0xfc, + 0xf7, 0xfc, + 0xf7, 0xc0, + 0xf7, 0xe0, + 0xf7, 0x70, + 0xf7, 0x38, + 0xf7, 0x1c, + 0xf7, 0xc, + 0xf0, 0x0, + 0xf0, 0x0, +}; + +const unsigned char XC_top_side[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 1, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0xff, 0xfe, + 0x3f, 0xfe, + 0x0, 0x0, + 0x0, 0x80, + 0x1, 0xc0, + 0x2, 0xa0, + 0x4, 0x90, + 0x8, 0x88, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x0, + /* mask */ + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x7f, 0xff, + 0x1, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0x1d, 0xdc, + 0x19, 0xcc, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, +}; + +const unsigned char XC_top_tee[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 3, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0xff, 0xfe, + 0x7f, 0xfe, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x1, 0x80, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x3, 0xc0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_trek[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 0, 8, /* y,x of hotspot */ + /* data */ + 0x8, 0x80, + 0x8, 0x0, + 0x1, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0x7, 0x70, + 0x7, 0xf0, + 0x3, 0xe0, + 0x1, 0xc0, + 0x0, 0x80, + 0x5, 0xd0, + 0x6, 0xb0, + 0x4, 0x90, + 0x4, 0x10, + 0x4, 0x10, + 0x4, 0x10, + /* mask */ + 0x1, 0xc0, + 0x1, 0xc0, + 0x3, 0xe0, + 0x7, 0xf0, + 0xf, 0xf8, + 0xf, 0xf8, + 0xf, 0xf8, + 0x7, 0xf0, + 0x3, 0xe0, + 0x5, 0xd0, + 0xf, 0xf8, + 0xf, 0xf8, + 0xf, 0xf8, + 0xe, 0xb8, + 0xe, 0xb8, + 0xe, 0x38, +}; + +const unsigned char XC_ul_angle[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 3, 13, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x18, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x3c, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_umbrella[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 3, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x89, 0x10, + 0x14, 0x40, + 0x65, 0x92, + 0x13, 0xe4, + 0xc, 0x98, + 0x30, 0x86, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x2, 0x80, + 0x2, 0x80, + 0x1, 0x0, + 0x0, 0x0, + /* mask */ + 0x76, 0xe8, + 0xdf, 0xfb, + 0x3f, 0xfd, + 0xff, 0xfe, + 0x3f, 0xff, + 0xff, 0xff, + 0x79, 0xcf, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x7, 0xc0, + 0x7, 0xc0, + 0x7, 0xc0, + 0x7, 0xc0, + 0x3, 0x80, +}; + +const unsigned char XC_ur_angle[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 3, 4, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x1f, 0xf8, + 0x1f, 0xf8, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x18, 0x0, + 0x0, 0x0, + 0x0, 0x0, + 0x0, 0x0, + /* mask */ + 0x0, 0x0, + 0x0, 0x0, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3f, 0xfc, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x3c, 0x0, + 0x0, 0x0, + 0x0, 0x0, +}; + +const unsigned char XC_watch[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 9, 1, /* y,x of hotspot */ + /* data */ + 0x7, 0xf8, + 0x7, 0xf8, + 0x7, 0xf8, + 0xf, 0xfc, + 0x18, 0x86, + 0x30, 0x83, + 0xe0, 0x81, + 0xe1, 0xc1, + 0xe1, 0xc1, + 0xe0, 0x21, + 0x30, 0x13, + 0x18, 0x6, + 0xf, 0xfc, + 0x7, 0xf8, + 0x7, 0xf8, + 0x7, 0xf8, + /* mask */ + 0xf, 0xfc, + 0xf, 0xfc, + 0xf, 0xfc, + 0x1f, 0xfe, + 0x3f, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0xff, 0xff, + 0x3f, 0xff, + 0x1f, 0xfe, + 0xf, 0xfc, + 0xf, 0xfc, + 0xf, 0xfc, +}; + +const unsigned char XC_xterm[] = { + 16, /* 16x16 size */ + 1, /* 1 bit depth */ + 8, 8, /* y,x of hotspot */ + /* data */ + 0x0, 0x0, + 0xf, 0x70, + 0x9, 0xc0, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x0, 0x80, + 0x1, 0xc0, + 0x7, 0x70, + 0x0, 0x0, + /* mask */ + 0xf, 0x78, + 0xf, 0xf8, + 0xf, 0xf8, + 0x3, 0xe0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x1, 0xc0, + 0x3, 0xe0, + 0xf, 0xf8, + 0xf, 0xf8, + 0xf, 0x78, +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutDstr.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutDstr.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutDstr.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutDstr.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,83 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutDstr.cpp + * + * DESCRIPTION: convert display string into a Be options variable + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include +#include "glutint.h" +#include "glutState.h" + +/*********************************************************** + * FUNCTION: glutInitDisplayString + * + * DESCRIPTION: sets the display string variable + ***********************************************************/ +void APIENTRY +glutInitDisplayString(const char *string) +{ + if (gState.displayString) { + free(gState.displayString); + } + if (string) { + gState.displayString = strdup(string); + if (!gState.displayString) + __glutFatalError("out of memory."); + } else + gState.displayString = NULL; +} + +/*********************************************************** + * FUNCTION: __glutConvertDisplayModeFromString + * + * DESCRIPTION: converts the current display mode into a BGLView + * display mode, printing warnings as appropriate. + * + * PARAMETERS: if options is non-NULL, the current display mode is + * returned in it. + * + * RETURNS: 1 if the current display mode is possible, else 0 + ***********************************************************/ +int __glutConvertDisplayModeFromString(unsigned long *options) { + ulong newoptions = 0; + + char *word = strtok(gState.displayString, " \t"); + do { + char *cstr = strpbrk(word, "=> +#include "glutint.h" +#include "glutState.h" +#include "glutBlocker.h" + +/*********************************************************** + * CLASS: GLUTtimer + * + * DESCRIPTION: list of timer callbacks + ***********************************************************/ +struct GLUTtimer { + GLUTtimer *next; // list of timers + bigtime_t timeout; // time to be called + GLUTtimerCB func; // function to call + int value; // value +}; + +/*********************************************************** + * Private variables + ***********************************************************/ +static GLUTtimer *__glutTimerList = 0; // list of timer callbacks +static GLUTtimer *freeTimerList = 0; + +/*********************************************************** + * FUNCTION: glutTimerFunc (7.19) + * + * DESCRIPTION: register a new timer callback + ***********************************************************/ +void APIENTRY +glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value) +{ + GLUTtimer *timer, *other; + GLUTtimer **prevptr; + + if (!timerFunc) + return; + + if (freeTimerList) { + timer = freeTimerList; + freeTimerList = timer->next; + } else { + timer = new GLUTtimer(); + if (!timer) + __glutFatalError("out of memory."); + } + + timer->func = timerFunc; + timer->value = value; + timer->next = NULL; + timer->timeout = system_time() + (interval*1000); // 1000 ticks in a millisecond + prevptr = &__glutTimerList; + other = *prevptr; + while (other && (other->timeout < timer->timeout)) { + prevptr = &other->next; + other = *prevptr; + } + timer->next = other; + *prevptr = timer; +} + +/*********************************************************** + * FUNCTION: handleTimeouts + * + * DESCRIPTION: private function to handle outstanding timeouts + ***********************************************************/ +static void +handleTimeouts(void) +{ + bigtime_t now; + GLUTtimer *timer; + + /* Assumption is that __glutTimerList is already determined + to be non-NULL. */ + now = system_time(); + while (__glutTimerList->timeout <= now) { + timer = __glutTimerList; + if(gState.currentWindow) + gState.currentWindow->LockGL(); + timer->func(timer->value); + if(gState.currentWindow) + gState.currentWindow->UnlockGL(); + __glutTimerList = timer->next; + timer->next = freeTimerList; + freeTimerList = timer; + if (!__glutTimerList) + break; + } +} + + +/*********************************************************** + * FUNCTION: processEventsAndTimeouts + * + * DESCRIPTION: clear gBlock, then check all windows for events + ***********************************************************/ +static void +processEventsAndTimeouts(void) +{ + gBlock.WaitEvent(); // if there is already an event, returns + // immediately, otherwise wait forever + gBlock.ClearEvents(); + + if(gState.quitAll) + exit(0); // exit handler cleans up windows and quits nicely + + if (gState.currentWindow) + gState.currentWindow->LockGL(); + for(int i=0; ianyevents) { + win->anyevents = false; + if (win->reshapeEvent) { + win->reshapeEvent = false; + __glutSetWindow(win); + win->reshape(win->m_width, win->m_height); + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->displayEvent) { + win->displayEvent = false; + __glutSetWindow(win); + win->display(); + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->mouseEvent) { + win->mouseEvent = false; + __glutSetWindow(win); + if (win->mouse) { + gState.modifierKeys = win->modifierKeys; + win->mouse(win->button, win->mouseState, win->mouseX, win->mouseY); + gState.modifierKeys = ~0; + } + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->menuEvent) { + win->menuEvent = false; + __glutSetWindow(win); + GlutMenu *menu = __glutGetMenuByNum(win->menuNumber); + if (menu) { + gState.currentMenu = menu; + menu->select(win->menuValue); + } + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->statusEvent) { + win->statusEvent = false; + __glutSetWindow(win); + if (gState.menuStatus) { + gState.currentMenu = __glutGetMenuByNum(win->menuNumber); + gState.menuStatus(win->menuStatus, win->statusX, win->statusY); + } + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->motionEvent) { + win->motionEvent = false; + __glutSetWindow(win); + if (win->motion) + win->motion(win->motionX, win->motionY); + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->passiveEvent) { + win->passiveEvent = false; + __glutSetWindow(win); + if (win->passive) + win->passive(win->passiveX, win->passiveY); + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->keybEvent) { + win->keybEvent = false; + __glutSetWindow(win); + if (win->keyboard) { + gState.modifierKeys = win->modifierKeys; + win->keyboard(win->key, win->keyX, win->keyY); + gState.modifierKeys = ~0; + } + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->specialEvent) { + win->specialEvent = false; + __glutSetWindow(win); + if (win->special) { + gState.modifierKeys = win->modifierKeys; + win->special(win->specialKey, win->specialX, win->specialY); + gState.modifierKeys = ~0; + } + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->entryEvent) { + win->entryEvent = false; + __glutSetWindow(win); + if (win->entry) + win->entry(win->entryState); + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + + if (win->windowStatusEvent) { + win->windowStatusEvent = false; + __glutSetWindow(win); + if (win->windowStatus) + win->windowStatus(win->visState); + } + if (!gState.windowList[i]) + continue; // window was destroyed by callback! + } + } + } + if (gState.currentWindow) + gState.currentWindow->UnlockGL(); + + // This code isn't necessary since BGLView automatically traps errors +#if 0 + if(gState.debug) { + for(int i=0; iLockGL(); + glutReportErrors(); + gState.windowList[i]->UnlockGL(); + } + } + } +#endif + if (__glutTimerList) { + handleTimeouts(); + } +} + +/*********************************************************** + * FUNCTION: waitForSomething + * + * DESCRIPTION: use gBlock to wait for a new event or timeout + ***********************************************************/ +static void +waitForSomething(void) +{ + bigtime_t timeout = __glutTimerList->timeout; + bigtime_t now = system_time(); + + if (gBlock.PendingEvent()) + goto immediatelyHandleEvent; + + if(timeout>now) + gBlock.WaitEvent(timeout-now); + if (gBlock.PendingEvent()) { + immediatelyHandleEvent: + processEventsAndTimeouts(); + } else { + if (__glutTimerList) + handleTimeouts(); + } +} + +/*********************************************************** + * FUNCTION: idleWait + * + * DESCRIPTION: check for events, then call idle function + ***********************************************************/ +static void +idleWait(void) +{ + if (gBlock.PendingEvent()) { + processEventsAndTimeouts(); + } else { + if (__glutTimerList) + handleTimeouts(); + } + /* Make sure idle func still exists! */ + if(gState.currentWindow) + gState.currentWindow->LockGL(); + if (gState.idle) { + gState.idle(); + } + if(gState.currentWindow) + gState.currentWindow->UnlockGL(); +} + +/*********************************************************** + * FUNCTION: glutMainLoop (3.1) + * + * DESCRIPTION: enter the event processing loop + ***********************************************************/ +void glutMainLoop() +{ + if (!gState.windowListSize) + __glutFatalUsage("main loop entered with no windows created."); + + if(gState.currentWindow) + gState.currentWindow->UnlockGL(); + + for (;;) { + if (gState.idle) { + idleWait(); + } else { + if (__glutTimerList) { + waitForSomething(); + } else { + processEventsAndTimeouts(); + } + } + } +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: KeyDown + * + * DESCRIPTION: handles keyboard and special events + ***********************************************************/ +void GlutWindow::KeyDown(const char *s, int32 slen) +{ + ulong aChar = s[0]; + BGLView::KeyDown(s,slen); + + BPoint p; + + switch (aChar) { + case B_FUNCTION_KEY: + switch(Window()->CurrentMessage()->FindInt32("key")) { + case B_F1_KEY: + aChar = GLUT_KEY_F1; + goto specialLabel; + case B_F2_KEY: + aChar = GLUT_KEY_F2; + goto specialLabel; + case B_F3_KEY: + aChar = GLUT_KEY_F3; + goto specialLabel; + case B_F4_KEY: + aChar = GLUT_KEY_F4; + goto specialLabel; + case B_F5_KEY: + aChar = GLUT_KEY_F5; + goto specialLabel; + case B_F6_KEY: + aChar = GLUT_KEY_F6; + goto specialLabel; + case B_F7_KEY: + aChar = GLUT_KEY_F7; + goto specialLabel; + case B_F8_KEY: + aChar = GLUT_KEY_F8; + goto specialLabel; + case B_F9_KEY: + aChar = GLUT_KEY_F9; + goto specialLabel; + case B_F10_KEY: + aChar = GLUT_KEY_F10; + goto specialLabel; + case B_F11_KEY: + aChar = GLUT_KEY_F11; + goto specialLabel; + case B_F12_KEY: + aChar = GLUT_KEY_F12; + goto specialLabel; + default: + return; + } + case B_LEFT_ARROW: + aChar = GLUT_KEY_LEFT; + goto specialLabel; + case B_UP_ARROW: + aChar = GLUT_KEY_UP; + goto specialLabel; + case B_RIGHT_ARROW: + aChar = GLUT_KEY_RIGHT; + goto specialLabel; + case B_DOWN_ARROW: + aChar = GLUT_KEY_DOWN; + goto specialLabel; + case B_PAGE_UP: + aChar = GLUT_KEY_PAGE_UP; + goto specialLabel; + case B_PAGE_DOWN: + aChar = GLUT_KEY_PAGE_DOWN; + goto specialLabel; + case B_HOME: + aChar = GLUT_KEY_HOME; + goto specialLabel; + case B_END: + aChar = GLUT_KEY_END; + goto specialLabel; + case B_INSERT: + aChar = GLUT_KEY_INSERT; +specialLabel: + if (special) { + anyevents = specialEvent = true; + GetMouse(&p,&m_buttons); + specialKey = aChar; + specialX = (int)p.x; + specialY = (int)p.y; + goto setModifiers; // set the modifier variable + } + return; + + default: + break; + } + + if (keyboard) { + anyevents = keybEvent = true; + GetMouse(&p,&m_buttons); + key = aChar; + keyX = (int)p.x; + keyY = (int)p.y; +setModifiers: + modifierKeys = 0; + uint32 beMod = Window()->CurrentMessage()->FindInt32("modifiers"); + if(beMod & B_SHIFT_KEY) + modifierKeys |= GLUT_ACTIVE_SHIFT; + if(beMod & B_CONTROL_KEY) + modifierKeys |= GLUT_ACTIVE_CTRL; + if(beMod & B_OPTION_KEY) { + // since the window traps B_COMMAND_KEY, we'll have to settle + // for the option key.. but we need to get the raw character, + // not the Unicode-enhanced version + key = Window()->CurrentMessage()->FindInt32("raw_char"); + modifierKeys |= GLUT_ACTIVE_ALT; + } + gBlock.NewEvent(); + } +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: MouseDown + * + * DESCRIPTION: handles mouse and menustatus events + ***********************************************************/ +void GlutWindow::MouseDown(BPoint point) +{ + BGLView::MouseDown(point); + MouseCheck(); +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: MouseCheck + * + * DESCRIPTION: checks for button state changes + ***********************************************************/ +void GlutWindow::MouseCheck() +{ + if (mouseEvent) + return; // we already have an outstanding mouse event + + BPoint point; + uint32 newButtons; + GetMouse(&point, &newButtons); + if (m_buttons != newButtons) { + if (newButtons&B_PRIMARY_MOUSE_BUTTON && !(m_buttons&B_PRIMARY_MOUSE_BUTTON)) { + button = GLUT_LEFT_BUTTON; + mouseState = GLUT_DOWN; + } else if (m_buttons&B_PRIMARY_MOUSE_BUTTON && !(newButtons&B_PRIMARY_MOUSE_BUTTON)) { + button = GLUT_LEFT_BUTTON; + mouseState = GLUT_UP; + } else if (newButtons&B_SECONDARY_MOUSE_BUTTON && !(m_buttons&B_SECONDARY_MOUSE_BUTTON)) { + button = GLUT_RIGHT_BUTTON; + mouseState = GLUT_DOWN; + } else if (m_buttons&B_SECONDARY_MOUSE_BUTTON && !(newButtons&B_SECONDARY_MOUSE_BUTTON)) { + button = GLUT_RIGHT_BUTTON; + mouseState = GLUT_UP; + } else if (newButtons&B_TERTIARY_MOUSE_BUTTON && !(m_buttons&B_TERTIARY_MOUSE_BUTTON)) { + button = GLUT_MIDDLE_BUTTON; + mouseState = GLUT_DOWN; + } else if (m_buttons&B_TERTIARY_MOUSE_BUTTON && !(newButtons&B_TERTIARY_MOUSE_BUTTON)) { + button = GLUT_MIDDLE_BUTTON; + mouseState = GLUT_UP; + } + } else { + return; // no change, return + } + m_buttons = newButtons; + + if (mouseState == GLUT_DOWN) { + BWindow *w = Window(); + GlutMenu *m = __glutGetMenuByNum(menu[button]); + if (m) { + if (gState.menuStatus) { + anyevents = statusEvent = true; + menuNumber = menu[button]; + menuStatus = GLUT_MENU_IN_USE; + statusX = (int)point.x; + statusY = (int)point.y; + gBlock.NewEvent(); + } + BRect bounds = w->Frame(); + point.x += bounds.left; + point.y += bounds.top; + GlutPopUp *bmenu = static_cast(m->CreateBMenu()); // start menu + bmenu->point = point; + bmenu->win = this; + thread_id menu_thread = spawn_thread(MenuThread, "menu thread", B_NORMAL_PRIORITY, bmenu); + resume_thread(menu_thread); + return; + } + } + + if (mouse) { + anyevents = mouseEvent = true; + mouseX = (int)point.x; + mouseY = (int)point.y; + modifierKeys = 0; + uint32 beMod = modifiers(); + if(beMod & B_SHIFT_KEY) + modifierKeys |= GLUT_ACTIVE_SHIFT; + if(beMod & B_CONTROL_KEY) + modifierKeys |= GLUT_ACTIVE_CTRL; + if(beMod & B_OPTION_KEY) { + modifierKeys |= GLUT_ACTIVE_ALT; + } + gBlock.NewEvent(); + } +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: MouseMoved + * + * DESCRIPTION: handles entry, motion, and passive events + ***********************************************************/ +void GlutWindow::MouseMoved(BPoint point, + ulong transit, const BMessage *msg) +{ + BGLView::MouseMoved(point,transit,msg); + + if(transit != B_INSIDE_VIEW) { + if (entry) { + anyevents = entryEvent = true; + gBlock.NewEvent(); + } + if (transit == B_ENTERED_VIEW) { + entryState = GLUT_ENTERED; + MakeFocus(); // make me the current focus + __glutSetCursor(cursor); + } else + entryState = GLUT_LEFT; + } + + MouseCheck(); + if(m_buttons) { + if(motion) { + anyevents = motionEvent = true; + motionX = (int)point.x; + motionY = (int)point.y; + gBlock.NewEvent(); + } + } else { + if(passive) { + anyevents = passiveEvent = true; + passiveX = (int)point.x; + passiveY = (int)point.y; + gBlock.NewEvent(); + } + } +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: FrameResized + * + * DESCRIPTION: handles reshape event + ***********************************************************/ +void GlutWindow::FrameResized(float width, float height) +{ + BGLView::FrameResized(width, height); + if (visible) { + anyevents = reshapeEvent = true; + m_width = (int)(width)+1; + m_height = (int)(height)+1; + gBlock.NewEvent(); + } +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: Draw + * + * DESCRIPTION: handles reshape and display events + ***********************************************************/ +void GlutWindow::Draw(BRect updateRect) +{ + BGLView::Draw(updateRect); + BRect frame = Frame(); + if (m_width != (frame.Width()+1) || m_height != (frame.Height()+1)) { + FrameResized(frame.Width(), frame.Height()); + } + Window()->Lock(); + if (visible) { + anyevents = displayEvent = true; + gBlock.NewEvent(); + } + Window()->Unlock(); +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: Pulse + * + * DESCRIPTION: handles mouse up event (MouseUp is broken) + ***********************************************************/ +void GlutWindow::Pulse() +{ + BGLView::Pulse(); + if (m_buttons) { // if there are buttons pressed + MouseCheck(); + } +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: ErrorCallback + * + * DESCRIPTION: handles GL error messages + ***********************************************************/ +void GlutWindow::ErrorCallback(GLenum errorCode) { + __glutWarning("GL error: %s", gluErrorString(errorCode)); +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: MenuThread + * + * DESCRIPTION: a new thread to launch popup menu, wait + * wait for response, then clean up afterwards and + * send appropriate messages + ***********************************************************/ +long GlutWindow::MenuThread(void *m) { + GlutPopUp *bmenu = static_cast(m); + GlutWindow *win = bmenu->win; // my window + GlutBMenuItem *result = (GlutBMenuItem*)bmenu->Go(bmenu->point); + win->Window()->Lock(); + win->anyevents = win->statusEvent = true; + win->menuStatus = GLUT_MENU_NOT_IN_USE; + win->menuNumber = bmenu->menu; + BPoint cursor; + uint32 buttons; + win->GetMouse(&cursor, &buttons); + win->statusX = (int)cursor.x; + win->statusY = (int)cursor.y; + if(result && result->menu) { + win->menuEvent = true; + win->menuNumber = result->menu; // in case it was a submenu + win->menuValue = result->value; + } + win->Window()->Unlock(); + gBlock.NewEvent(); + delete bmenu; + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_ext.c xpsb-glx-0.19/mesa/src/glut/beos/glut_ext.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_ext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_ext.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,201 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include + +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutExtensionSupported(const char *extension) +{ + static const GLubyte *extensions = NULL; + const GLubyte *start; + GLubyte *where, *terminator; + + /* Extension names should not have spaces. */ + where = (GLubyte *) strchr(extension, ' '); + if (where || *extension == '\0') + return 0; + + if (!extensions) { + extensions = glGetString(GL_EXTENSIONS); + } + /* It takes a bit of care to be fool-proof about parsing the + OpenGL extensions string. Don't be fooled by sub-strings, + etc. */ + start = extensions; + for (;;) { + /* If your application crashes in the strstr routine below, + you are probably calling glutExtensionSupported without + having a current window. Calling glGetString without + a current OpenGL context has unpredictable results. + Please fix your program. */ + where = (GLubyte *) strstr((const char *) start, extension); + if (!where) + break; + terminator = where + strlen(extension); + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { + return 1; + } + } + start = terminator; + } + return 0; +} + + +struct name_address_pair { + const char *name; + const GLUTproc address; +}; + +static struct name_address_pair glut_functions[] = { + { "glutInit", (const GLUTproc) glutInit }, + { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, + { "glutInitDisplayString", (const GLUTproc) glutInitDisplayString }, + { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, + { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, + { "glutMainLoop", (const GLUTproc) glutMainLoop }, + { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, + { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, + { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, + { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, + { "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay }, + { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, + { "glutGetWindow", (const GLUTproc) glutGetWindow }, + { "glutSetWindow", (const GLUTproc) glutSetWindow }, + { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, + { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, + { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, + { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, + { "glutPopWindow", (const GLUTproc) glutPopWindow }, + { "glutPushWindow", (const GLUTproc) glutPushWindow }, + { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, + { "glutShowWindow", (const GLUTproc) glutShowWindow }, + { "glutHideWindow", (const GLUTproc) glutHideWindow }, + { "glutFullScreen", (const GLUTproc) glutFullScreen }, + { "glutSetCursor", (const GLUTproc) glutSetCursor }, + { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, + { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, + { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, + { "glutUseLayer", (const GLUTproc) glutUseLayer }, + { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, + { "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay }, + { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, + { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, + { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, + { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, + { "glutGetMenu", (const GLUTproc) glutGetMenu }, + { "glutSetMenu", (const GLUTproc) glutSetMenu }, + { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, + { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, + { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, + { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, + { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, + { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, + { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, + { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, + { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, + { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, + { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, + { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, + { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, + { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, + { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, + { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, + { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, + { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, + { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, + { "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc }, + { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, + { "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc }, + { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, + { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, + { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, + { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, + { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, + { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, + { "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc }, +// { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc }, +// { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc }, +// { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc }, + { "glutSetColor", (const GLUTproc) glutSetColor }, + { "glutGetColor", (const GLUTproc) glutGetColor }, + { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, + { "glutGet", (const GLUTproc) glutGet }, + { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, + { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, + { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, + { "glutLayerGet", (const GLUTproc) glutLayerGet }, + { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, + { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, + { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, + { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, + { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, + { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, + { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, + { "glutWireSphere", (const GLUTproc) glutWireSphere }, + { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, + { "glutWireCone", (const GLUTproc) glutWireCone }, + { "glutSolidCone", (const GLUTproc) glutSolidCone }, + { "glutWireCube", (const GLUTproc) glutWireCube }, + { "glutSolidCube", (const GLUTproc) glutSolidCube }, + { "glutWireTorus", (const GLUTproc) glutWireTorus }, + { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, + { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, + { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, + { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, + { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, + { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, + { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, + { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, + { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, + { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, + { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, + { "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet }, + { "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing }, + { "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing }, + { "glutVideoResize", (const GLUTproc) glutVideoResize }, + { "glutVideoPan", (const GLUTproc) glutVideoPan }, + { "glutReportErrors", (const GLUTproc) glutReportErrors }, +// { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat }, +// { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat }, +// { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc }, +// { "glutGameModeString", (const GLUTproc) glutGameModeString }, +// { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode }, +// { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode }, +// { "glutGameModeGet", (const GLUTproc) glutGameModeGet }, + { NULL, NULL } +}; + + +/* XXX This isn't an official GLUT function, yet */ +GLUTproc GLUTAPIENTRY +glutGetProcAddress(const char *procName) +{ + /* Try GLUT functions first */ + int i; + for (i = 0; glut_functions[i].name; i++) { + if (strcmp(glut_functions[i].name, procName) == 0) + return glut_functions[i].address; + } + + /* Try core GL functions */ +#if defined(_WIN32) + return (GLUTProc) wglGetProcAddress((LPCSTR) procName); +#elif defined(GLX_ARB_get_proc_address) + return (GLUTProc) glXGetProcAddressARB((const GLubyte *) procName); +#else + return NULL; +#endif +} + + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutGet.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutGet.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutGet.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutGet.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,211 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutGet.cpp + * + * DESCRIPTION: get state information from GL + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include +#include + +#include "glutint.h" +#include "glutState.h" + +/*********************************************************** + * Global variables + ***********************************************************/ +// rough guess, since we don't know how big the monitor really is +const float dots_per_mm = (72/25.4); // dots per millimeter + +/*********************************************************** + * FUNCTION: glutGet (9.1) + * + * DESCRIPTION: retrieve window and GL state + ***********************************************************/ +int glutGet(GLenum state) { + switch(state) { + case GLUT_WINDOW_X: + {BAutolock winlock(gState.currentWindow->Window()); // need to lock the window + if (gState.currentWindow->parent) + return (int)gState.currentWindow->Frame().left; + else + return (int)gState.currentWindow->Window()->Frame().left; + } + case GLUT_WINDOW_Y: + {BAutolock winlock(gState.currentWindow->Window()); + if (gState.currentWindow->parent) + return (int)gState.currentWindow->Frame().top; + else + return (int)gState.currentWindow->Window()->Frame().top; + } + case GLUT_WINDOW_WIDTH: + {BAutolock winlock(gState.currentWindow->Window()); + return gState.currentWindow->m_width; + } + case GLUT_WINDOW_HEIGHT: + {BAutolock winlock(gState.currentWindow->Window()); + return gState.currentWindow->m_height; + } + case GLUT_WINDOW_PARENT: + {BAutolock winlock(gState.currentWindow->Window()); + if(gState.currentWindow->parent) + return gState.currentWindow->parent->num + 1; + else + return 0; + } + case GLUT_WINDOW_NUM_CHILDREN: + {BAutolock winlock(gState.currentWindow->Window()); + int num = 0; + GlutWindow *children = gState.currentWindow->children; + while (children) { + num++; + children = children->siblings; + } + return num; + } + case GLUT_WINDOW_BUFFER_SIZE: // best guesses + case GLUT_WINDOW_DEPTH_SIZE: + return 32; + + case GLUT_WINDOW_STENCIL_SIZE: + case GLUT_WINDOW_RED_SIZE: // always 24-bit color + case GLUT_WINDOW_GREEN_SIZE: + case GLUT_WINDOW_BLUE_SIZE: + case GLUT_WINDOW_ALPHA_SIZE: + case GLUT_WINDOW_ACCUM_RED_SIZE: + case GLUT_WINDOW_ACCUM_GREEN_SIZE: + case GLUT_WINDOW_ACCUM_BLUE_SIZE: + case GLUT_WINDOW_ACCUM_ALPHA_SIZE: + return 8; + + case GLUT_WINDOW_DOUBLEBUFFER: // always double-buffered RGBA + case GLUT_WINDOW_RGBA: + return 1; + + case GLUT_WINDOW_COLORMAP_SIZE: // don't support these + case GLUT_WINDOW_NUM_SAMPLES: + case GLUT_WINDOW_STEREO: + return 0; + + case GLUT_WINDOW_CURSOR: + return gState.currentWindow->cursor; // don't need to lock window since it won't change + + case GLUT_SCREEN_WIDTH: + return (int)(BScreen().Frame().Width()) + 1; + case GLUT_SCREEN_HEIGHT: + return (int)(BScreen().Frame().Height()) + 1; + case GLUT_SCREEN_WIDTH_MM: + return (int)((BScreen().Frame().Width() + 1) / dots_per_mm); + case GLUT_SCREEN_HEIGHT_MM: + return (int)((BScreen().Frame().Height() + 1) / dots_per_mm); + case GLUT_MENU_NUM_ITEMS: + return gState.currentMenu->num; + case GLUT_DISPLAY_MODE_POSSIBLE: + return __glutConvertDisplayMode(0); // returns 1 if possible + case GLUT_INIT_DISPLAY_MODE: + return gState.displayMode; + case GLUT_INIT_WINDOW_X: + return gState.initX; + case GLUT_INIT_WINDOW_Y: + return gState.initY; + case GLUT_INIT_WINDOW_WIDTH: + return gState.initWidth; + case GLUT_INIT_WINDOW_HEIGHT: + return gState.initHeight; + case GLUT_ELAPSED_TIME: + bigtime_t elapsed, beginning, now; + __glutInitTime(&beginning); + now = system_time(); + elapsed = now - beginning; + return (int) (elapsed / 1000); // 1000 ticks in a millisecond + default: + __glutWarning("invalid glutGet parameter: %d", state); + return -1; + } +} + +/*********************************************************** + * FUNCTION: glutLayerGet (9.2) + * + * DESCRIPTION: since we don't support layers, this is easy + ***********************************************************/ +int glutLayerGet(GLenum info) { + switch(info) { + case GLUT_OVERLAY_POSSIBLE: + case GLUT_HAS_OVERLAY: + return 0; + case GLUT_LAYER_IN_USE: + return GLUT_NORMAL; + case GLUT_TRANSPARENT_INDEX: + return -1; + case GLUT_NORMAL_DAMAGED: + return gState.currentWindow->displayEvent; + case GLUT_OVERLAY_DAMAGED: + return -1; + default: + __glutWarning("invalid glutLayerGet param: %d", info); + return -1; + } +} + +/*********************************************************** + * FUNCTION: glutDeviceGet (9.3) + * + * DESCRIPTION: get info about I/O devices we support + * easy, since BeOS only supports a keyboard and mouse now + ***********************************************************/ +int glutDeviceGet(GLenum info) { + switch(info) { + case GLUT_HAS_KEYBOARD: + case GLUT_HAS_MOUSE: + return 1; + + case GLUT_HAS_SPACEBALL: + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + case GLUT_HAS_TABLET: + case GLUT_NUM_SPACEBALL_BUTTONS: + case GLUT_NUM_BUTTON_BOX_BUTTONS: + case GLUT_NUM_DIALS: + case GLUT_NUM_TABLET_BUTTONS: + return 0; + + case GLUT_NUM_MOUSE_BUTTONS: + { + int32 mouseButtons = 3; // good guess + if(get_mouse_type(&mouseButtons) != B_OK) { + __glutWarning("error getting number of mouse buttons"); + } + return mouseButtons; + } + + default: + __glutWarning("invalid glutDeviceGet parameter: %d", info); + return -1; + } +} + +/*********************************************************** + * FUNCTION: glutGetModifiers (9.4) + * + * DESCRIPTION: get the modifier key state for the current window + ***********************************************************/ +int glutGetModifiers() { + if(gState.modifierKeys == (int) ~0) { + __glutWarning( + "glutCurrentModifiers: do not call outside core input callback."); + return 0; + } + return gState.modifierKeys; +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_hel10.c xpsb-glx-0.19/mesa/src/glut/beos/glut_hel10.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_hel10.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_hel10.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1778 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica10 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica10 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch255 = {4,10,0,2,5,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {5,10,0,2,6,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {4,11,0,2,5,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {4,8,0,0,5,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {4,9,0,0,5,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch250 = {4,9,0,0,5,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {4,9,0,0,5,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x70,0x88,0xc8,0xa8,0x98,0x74, +}; + +static const BitmapCharRec ch248 = {6,6,0,0,6,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,0,-1,6,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch246 = {5,8,0,0,6,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {5,9,0,0,6,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch244 = {5,9,0,0,6,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {5,9,0,0,6,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {5,9,0,0,6,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch241 = {4,9,0,0,5,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50, +}; + +static const BitmapCharRec ch240 = {5,9,0,0,6,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,8,0,0,2,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,9,1,0,2,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch237 = {2,9,0,0,2,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {2,9,1,0,2,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50, +}; + +static const BitmapCharRec ch235 = {4,8,0,0,5,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch234 = {4,9,0,0,5,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch233 = {4,9,0,0,5,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch232 = {4,9,0,0,5,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch231 = {4,8,0,2,5,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6c,0x92,0x90,0x7e,0x12,0xec, +}; + +static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20, +}; + +static const BitmapCharRec ch229 = {5,9,0,0,5,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50, +}; + +static const BitmapCharRec ch228 = {5,8,0,0,5,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch227 = {5,9,0,0,5,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch226 = {5,9,0,0,5,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {5,9,0,0,5,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch224 = {5,9,0,0,5,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch223 = {4,8,0,0,5,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {5,8,-1,0,7,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,11,0,0,7,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, +}; + +static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {6,11,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch218 = {6,11,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,11,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch216 = {6,10,-1,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,0,-1,6,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48, +}; + +static const BitmapCharRec ch214 = {6,10,-1,0,8,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {6,11,-1,0,8,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch212 = {6,11,-1,0,8,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {6,11,-1,0,8,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch210 = {6,11,-1,0,8,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {6,11,-1,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78, +}; + +static const BitmapCharRec ch208 = {7,8,0,0,8,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,10,0,0,3,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,11,0,0,3,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch205 = {2,11,-1,0,3,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {2,11,0,0,3,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50, +}; + +static const BitmapCharRec ch203 = {5,10,-1,0,7,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch202 = {5,11,-1,0,7,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {5,11,-1,0,7,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch200 = {5,11,-1,0,7,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch199 = {6,10,-1,2,8,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80, +}; + +static const BitmapCharRec ch198 = {9,8,0,0,10,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,11,0,0,7,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,10,0,0,7,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,11,0,0,7,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,11,0,0,7,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,11,0,0,7,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,11,0,0,7,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {4,8,-1,2,6,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0, +}; + +static const BitmapCharRec ch190 = {9,8,0,0,9,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42, +}; + +static const BitmapCharRec ch189 = {8,8,0,0,9,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0, +}; + +static const BitmapCharRec ch188 = {9,8,0,0,9,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x28,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {5,5,0,0,6,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0xe0,0xa0,0xe0, +}; + +static const BitmapCharRec ch186 = {3,5,0,-3,4,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {2,4,0,-3,3,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x40, +}; + +static const BitmapCharRec ch184 = {2,2,0,2,3,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0, +}; + +static const BitmapCharRec ch183 = {2,1,0,-3,3,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,10,0,2,6,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch181 = {4,8,0,2,5,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-6,3,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0xe0, +}; + +static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xe0,0x40,0xa0,0x60, +}; + +static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xe0, +}; + +static const BitmapCharRec ch175 = {3,1,0,-7,3,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xba,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xe0, +}; + +static const BitmapCharRec ch173 = {3,1,0,-3,4,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch172 = {5,3,-1,-2,7,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x28,0x50,0xa0,0x50,0x28, +}; + +static const BitmapCharRec ch171 = {5,5,0,0,6,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xe0, +}; + +static const BitmapCharRec ch170 = {3,5,0,-3,4,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,0,-7,3,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,10,0,2,6,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,10,-1,2,3,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch165 = {5,8,0,0,6,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x90,0x60,0x90,0x90,0x60,0x90, +}; + +static const BitmapCharRec ch164 = {4,6,0,-1,5,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30, +}; + +static const BitmapCharRec ch163 = {5,8,0,0,6,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {5,8,0,1,6,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,8,-1,2,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,3,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,3,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch125 = {3,10,0,2,3,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,10,-1,2,3,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch123 = {3,10,0,2,3,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x80,0x40,0x20,0x10,0xf0, +}; + +static const BitmapCharRec ch122 = {4,6,0,0,5,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90, +}; + +static const BitmapCharRec ch121 = {4,8,0,2,5,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x88,0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch120 = {5,6,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x28,0x28,0x54,0x54,0x92,0x92, +}; + +static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x20,0x50,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,6,0,0,6,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x70,0x90,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch117 = {4,6,0,0,5,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {3,8,0,0,4,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x60,0x90,0x10,0x60,0x90,0x60, +}; + +static const BitmapCharRec ch115 = {4,6,0,0,5,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x80,0x80,0x80,0x80,0xc0,0xa0, +}; + +static const BitmapCharRec ch114 = {3,6,0,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch113 = {5,8,0,2,6,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch112 = {5,8,0,2,6,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x70,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch111 = {5,6,0,0,6,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x88,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch110 = {5,6,0,0,6,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x92,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch108 = {1,8,0,0,2,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {4,8,0,0,5,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch106 = {1,9,0,1,2,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch105 = {1,8,0,0,2,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,8,0,0,6,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch103 = {5,8,0,2,6,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,8,0,0,4,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60, +}; + +static const BitmapCharRec ch101 = {4,6,0,0,5,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8, +}; + +static const BitmapCharRec ch100 = {5,8,0,0,6,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x60,0x90,0x80,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch99 = {4,6,0,0,5,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {5,8,0,0,6,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0, +}; + +static const BitmapCharRec ch97 = {5,6,0,0,5,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x80,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,3,0,-5,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfc, +}; + +static const BitmapCharRec ch95 = {6,1,0,2,6,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x50,0x20,0x20, +}; + +static const BitmapCharRec ch94 = {5,5,0,-3,6,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,10,0,2,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {3,8,0,0,3,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,10,-1,2,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch90 = {5,8,-1,0,7,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82, +}; + +static const BitmapCharRec ch89 = {7,8,0,0,7,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch88 = {5,8,-1,0,7,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +}; + +static const BitmapCharRec ch87 = {9,8,0,0,9,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,8,0,0,7,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,8,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch84 = {5,8,0,0,5,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch83 = {5,8,-1,0,7,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch82 = {5,8,-1,0,7,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch81 = {7,9,-1,1,8,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch80 = {5,8,-1,0,7,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch79 = {6,8,-1,0,8,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4, +}; + +static const BitmapCharRec ch78 = {6,8,-1,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82, +}; + +static const BitmapCharRec ch77 = {7,8,-1,0,9,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {4,8,-1,0,6,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88, +}; + +static const BitmapCharRec ch75 = {5,8,-1,0,7,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch74 = {4,8,0,0,5,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch73 = {1,8,-1,0,3,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch72 = {6,8,-1,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch71 = {6,8,-1,0,8,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch70 = {5,8,-1,0,6,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch69 = {5,8,-1,0,7,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0, +}; + +static const BitmapCharRec ch68 = {6,8,-1,0,8,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch67 = {6,8,-1,0,8,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch66 = {5,8,-1,0,7,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10, +}; + +static const BitmapCharRec ch65 = {7,8,0,0,7,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40, +0x20,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch64 = {10,10,0,2,11,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch63 = {4,8,-1,0,6,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {3,5,-1,-1,6,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf0,0x0,0xf0, +}; + +static const BitmapCharRec ch61 = {4,3,0,-2,5,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x20,0x40,0x80,0x40,0x20, +}; + +static const BitmapCharRec ch60 = {3,5,-1,-1,6,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, +}; + +static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch57 = {5,8,0,0,6,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch56 = {5,8,0,0,6,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch55 = {5,8,0,0,6,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch54 = {5,8,0,0,6,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch53 = {5,8,0,0,6,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch52 = {5,8,0,0,6,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch51 = {5,8,0,0,6,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch50 = {5,8,0,0,6,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch49 = {2,8,-1,0,6,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch48 = {5,8,0,0,6,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20, +}; + +static const BitmapCharRec ch47 = {3,8,0,0,3,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf8, +}; + +static const BitmapCharRec ch45 = {5,1,-1,-3,7,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch44 = {2,3,0,2,3,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,0,-1,6,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,0,-5,4,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,10,-1,2,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,10,0,2,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch39 = {2,3,-1,-5,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20, +}; + +static const BitmapCharRec ch38 = {6,8,-1,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64, +}; + +static const BitmapCharRec ch37 = {8,8,0,0,9,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {5,9,0,1,6,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0xf8,0x28,0x7c,0x28,0x28, +}; + +static const BitmapCharRec ch35 = {6,7,0,0,6,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,2,-1,-6,4,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,8,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {0,0,0,0,3,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,3,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapHelvetica10 = { +"-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_hel12.c xpsb-glx-0.19/mesa/src/glut/beos/glut_hel12.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_hel12.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_hel12.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1788 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica12 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica12 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50, +}; + +static const BitmapCharRec ch255 = {5,12,-1,3,7,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {5,12,-1,3,7,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {5,13,-1,3,7,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {5,9,-1,0,7,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {5,10,-1,0,7,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch250 = {5,10,-1,0,7,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {5,10,-1,0,7,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a, +}; + +static const BitmapCharRec ch248 = {7,7,0,0,7,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,-1,-1,7,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch246 = {5,9,-1,0,7,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {5,10,-1,0,7,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch244 = {5,10,-1,0,7,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {5,10,-1,0,7,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {5,10,-1,0,7,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {5,10,-1,0,7,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68, +}; + +static const BitmapCharRec ch240 = {5,10,-1,0,7,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,9,0,0,3,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,10,0,0,3,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch237 = {2,10,-1,0,3,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {2,10,0,0,3,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch235 = {5,9,-1,0,7,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch234 = {5,10,-1,0,7,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch233 = {5,10,-1,0,7,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch232 = {5,10,-1,0,7,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch231 = {5,10,-1,3,7,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0, +}; + +static const BitmapCharRec ch230 = {9,7,-1,0,11,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch229 = {6,10,-1,0,7,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch228 = {6,9,-1,0,7,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {6,10,-1,0,7,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch226 = {6,10,-1,0,7,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {6,10,-1,0,7,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch224 = {6,10,-1,0,7,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch223 = {5,9,-1,0,7,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,12,-1,0,9,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, +}; + +static const BitmapCharRec ch220 = {6,11,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {6,12,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch218 = {6,12,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,12,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80, +0x21,0x0,0x1e,0x80,0x0,0x40, +}; + +static const BitmapCharRec ch216 = {10,11,0,1,10,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,-1,-1,7,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24, +}; + +static const BitmapCharRec ch214 = {8,11,-1,0,10,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch213 = {8,12,-1,0,10,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8, +}; + +static const BitmapCharRec ch212 = {8,12,-1,0,10,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4, +}; + +static const BitmapCharRec ch211 = {8,12,-1,0,10,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10, +}; + +static const BitmapCharRec ch210 = {8,12,-1,0,10,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch209 = {7,12,-1,0,9,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c, +}; + +static const BitmapCharRec ch208 = {8,9,0,0,9,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,11,0,0,3,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,12,0,0,3,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch205 = {2,12,-1,0,3,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {2,12,0,0,3,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28, +}; + +static const BitmapCharRec ch203 = {6,11,-1,0,8,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch202 = {6,12,-1,0,8,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch201 = {6,12,-1,0,8,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch200 = {6,12,-1,0,8,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch199 = {7,12,-1,3,9,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0, +0x1f,0x80, +}; + +static const BitmapCharRec ch198 = {9,9,-1,0,11,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,12,-1,0,9,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,12,-1,0,9,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,12,-1,0,9,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,12,-1,0,9,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,12,-1,0,9,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {5,9,-1,3,7,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0, +0xe1,0x0, +}; + +static const BitmapCharRec ch190 = {9,9,0,0,10,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0, +0x41,0x0, +}; + +static const BitmapCharRec ch189 = {9,9,0,0,10,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0, +0x41,0x0, +}; + +static const BitmapCharRec ch188 = {9,9,0,0,10,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x28,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {5,5,-1,-1,7,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0xe0,0xa0,0xe0, +}; + +static const BitmapCharRec ch186 = {3,5,-1,-4,5,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {2,5,-1,-3,4,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x20,0x20,0x40, +}; + +static const BitmapCharRec ch184 = {3,4,0,3,3,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0x80, +}; + +static const BitmapCharRec ch183 = {1,1,-1,-3,3,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c, +}; + +static const BitmapCharRec ch182 = {6,12,0,3,7,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch181 = {5,10,-1,3,7,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-8,2,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0x20,0xe0, +}; + +static const BitmapCharRec ch179 = {3,5,0,-3,4,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x40,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,5,0,-3,4,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,-1,0,7,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-4,5,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xf0, +}; + +static const BitmapCharRec ch175 = {4,1,0,-8,4,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0, +0x3e,0x0, +}; + +static const BitmapCharRec ch174 = {9,9,-1,0,11,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xf0, +}; + +static const BitmapCharRec ch173 = {4,1,0,-3,5,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-2,8,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x28,0x50,0xa0,0x50,0x28, +}; + +static const BitmapCharRec ch171 = {5,5,-1,-1,7,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xe0, +}; + +static const BitmapCharRec ch170 = {3,5,-1,-4,5,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0, +0x3e,0x0, +}; + +static const BitmapCharRec ch169 = {9,9,-1,0,11,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,0,-8,3,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,12,0,3,6,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,11,-1,2,3,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch165 = {5,9,-1,0,7,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x84,0x78,0x48,0x48,0x78,0x84, +}; + +static const BitmapCharRec ch164 = {6,6,0,-1,7,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30, +}; + +static const BitmapCharRec ch163 = {5,9,-1,0,7,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {5,9,-1,1,7,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,10,-1,3,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,4,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,4,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0, +}; + +static const BitmapCharRec ch125 = {4,12,0,3,4,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,12,-1,3,3,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, +}; + +static const BitmapCharRec ch123 = {4,12,0,3,4,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x80,0x40,0x40,0x20,0x10,0xf0, +}; + +static const BitmapCharRec ch122 = {4,7,-1,0,6,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch121 = {5,10,-1,3,7,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x84,0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch120 = {6,7,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +}; + +static const BitmapCharRec ch119 = {9,7,0,0,9,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x20,0x50,0x50,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,7,-1,0,7,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch117 = {5,7,-1,0,7,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {3,9,0,0,3,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x60,0x90,0x10,0x60,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch115 = {4,7,-1,0,6,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x80,0x80,0x80,0x80,0x80,0xc0,0xa0, +}; + +static const BitmapCharRec ch114 = {3,7,-1,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch113 = {5,10,-1,3,7,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch112 = {5,10,-1,3,7,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch111 = {5,7,-1,0,7,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch110 = {5,7,-1,0,7,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x92,0x92,0x92,0x92,0x92,0xda,0xa4, +}; + +static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch108 = {1,9,-1,0,3,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {5,9,-1,0,6,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40, +}; + +static const BitmapCharRec ch106 = {2,12,0,3,3,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch105 = {1,9,-1,0,3,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,9,-1,0,7,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch103 = {5,10,-1,3,7,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,9,0,0,3,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch101 = {5,7,-1,0,7,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8, +}; + +static const BitmapCharRec ch100 = {5,9,-1,0,7,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x70,0x88,0x80,0x80,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch99 = {5,7,-1,0,7,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {5,9,-1,0,7,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch97 = {6,7,-1,0,7,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,3,0,-6,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfe, +}; + +static const BitmapCharRec ch95 = {7,1,0,2,7,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x20, +}; + +static const BitmapCharRec ch94 = {5,3,0,-5,6,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,12,0,3,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {4,9,0,0,4,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,12,-1,3,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch90 = {7,9,-1,0,9,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,9,-1,0,9,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82, +}; + +static const BitmapCharRec ch88 = {7,9,-1,0,9,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +0x88,0x80, +}; + +static const BitmapCharRec ch87 = {9,9,-1,0,11,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,9,-1,0,9,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,9,0,0,7,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c, +}; + +static const BitmapCharRec ch81 = {8,9,-1,0,10,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c, +}; + +static const BitmapCharRec ch79 = {8,9,-1,0,10,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82, +}; + +static const BitmapCharRec ch78 = {7,9,-1,0,9,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80, +0x80,0x80, +}; + +static const BitmapCharRec ch77 = {9,9,-1,0,11,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {5,9,-1,0,7,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84, +}; + +static const BitmapCharRec ch75 = {7,9,-1,0,8,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch74 = {5,9,-1,0,7,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch73 = {1,9,-1,0,3,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch72 = {7,9,-1,0,9,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch71 = {7,9,-1,0,9,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8, +}; + +static const BitmapCharRec ch68 = {7,9,-1,0,9,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch67 = {7,9,-1,0,9,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch66 = {6,9,-1,0,8,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10, +}; + +static const BitmapCharRec ch65 = {7,9,-1,0,9,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40, +0x60,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch64 = {10,10,-1,1,12,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch63 = {5,9,-1,0,7,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0x30,0xc,0x30,0xc0, +}; + +static const BitmapCharRec ch62 = {6,5,-1,-1,7,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf8,0x0,0xf8, +}; + +static const BitmapCharRec ch61 = {5,3,-1,-2,7,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0xc,0x30,0xc0,0x30,0xc, +}; + +static const BitmapCharRec ch60 = {6,5,0,-1,7,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, +}; + +static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch57 = {5,9,-1,0,7,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch56 = {5,9,-1,0,7,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch55 = {5,9,-1,0,7,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch54 = {5,9,-1,0,7,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch53 = {5,9,-1,0,7,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8, +}; + +static const BitmapCharRec ch52 = {6,9,0,0,7,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch51 = {5,9,-1,0,7,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch50 = {5,9,-1,0,7,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20, +}; + +static const BitmapCharRec ch49 = {3,9,-1,0,7,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch48 = {5,9,-1,0,7,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10, +}; + +static const BitmapCharRec ch47 = {4,9,0,0,4,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf8, +}; + +static const BitmapCharRec ch45 = {5,1,-1,-3,8,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch44 = {2,3,-1,2,4,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,-1,-1,7,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,-1,-6,5,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,12,0,3,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,12,-1,3,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0xc0, +}; + +static const BitmapCharRec ch39 = {2,3,-1,-6,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30, +}; + +static const BitmapCharRec ch38 = {7,9,-1,0,9,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0, +0x62,0x0, +}; + +static const BitmapCharRec ch37 = {9,9,-1,0,11,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {5,10,-1,1,7,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28, +}; + +static const BitmapCharRec ch35 = {6,8,0,0,7,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,3,-1,-6,5,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,9,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,4,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,4,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapHelvetica12 = { +"-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_hel18.c xpsb-glx-0.19/mesa/src/glut/beos/glut_hel18.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_hel18.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_hel18.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1897 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica18 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica18 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66, +0x66, +}; + +static const BitmapCharRec ch255 = {8,17,-1,4,10,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch254 = {9,18,-1,4,11,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18, +0xc,0x6, +}; + +static const BitmapCharRec ch253 = {8,18,-1,4,10,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66, +}; + +static const BitmapCharRec ch252 = {8,13,-1,0,10,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch251 = {8,14,-1,0,10,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6, +}; + +static const BitmapCharRec ch250 = {8,14,-1,0,10,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30, +}; + +static const BitmapCharRec ch249 = {8,14,-1,0,10,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80, +0x3f,0xc0,0xe,0x60, +}; + +static const BitmapCharRec ch248 = {11,10,0,0,11,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18, +}; + +static const BitmapCharRec ch247 = {8,8,-1,-1,10,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0, +}; + +static const BitmapCharRec ch246 = {9,13,-1,0,11,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0, +}; + +static const BitmapCharRec ch245 = {9,14,-1,0,11,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch244 = {9,14,-1,0,11,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch243 = {9,14,-1,0,11,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0, +}; + +static const BitmapCharRec ch242 = {9,14,-1,0,11,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32, +}; + +static const BitmapCharRec ch241 = {8,14,-1,0,10,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0, +}; + +static const BitmapCharRec ch240 = {9,14,-1,0,11,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8, +}; + +static const BitmapCharRec ch239 = {5,13,0,0,4,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30, +}; + +static const BitmapCharRec ch238 = {6,14,1,0,4,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30, +}; + +static const BitmapCharRec ch237 = {4,14,0,0,4,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0, +}; + +static const BitmapCharRec ch236 = {4,14,0,0,4,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36, +}; + +static const BitmapCharRec ch235 = {8,13,-1,0,10,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch234 = {8,14,-1,0,10,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6, +}; + +static const BitmapCharRec ch233 = {8,14,-1,0,10,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60, +}; + +static const BitmapCharRec ch232 = {8,14,-1,0,10,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, +}; + +static const BitmapCharRec ch231 = {8,14,-1,4,10,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18, +0xef,0xf0,0x7d,0xe0, +}; + +static const BitmapCharRec ch230 = {13,10,-1,0,15,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38, +}; + +static const BitmapCharRec ch229 = {7,14,-1,0,9,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c, +}; + +static const BitmapCharRec ch228 = {7,13,-1,0,9,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32, +}; + +static const BitmapCharRec ch227 = {7,14,-1,0,9,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch226 = {7,14,-1,0,9,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc, +}; + +static const BitmapCharRec ch225 = {7,14,-1,0,9,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60, +}; + +static const BitmapCharRec ch224 = {7,14,-1,0,9,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38, +}; + +static const BitmapCharRec ch223 = {7,14,-1,0,9,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch222 = {10,14,-1,0,12,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0, +0x3,0x0,0x1,0x80, +}; + +static const BitmapCharRec ch221 = {12,18,-1,0,14,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, +0x19,0x80, +}; + +static const BitmapCharRec ch220 = {11,17,-1,0,13,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, +0xf,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch219 = {11,18,-1,0,13,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0, +0x6,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch218 = {11,18,-1,0,13,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0, +0xc,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch217 = {11,18,-1,0,13,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c, +0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc, +}; + +static const BitmapCharRec ch216 = {14,14,0,0,15,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80, +0xc0,0xc0, +}; + +static const BitmapCharRec ch215 = {10,9,0,0,10,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80, +0xd,0x80, +}; + +static const BitmapCharRec ch214 = {13,17,-1,0,15,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80, +0xb,0x40,0x6,0x40, +}; + +static const BitmapCharRec ch213 = {13,18,-1,0,15,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0, +0x7,0x80,0x3,0x0, +}; + +static const BitmapCharRec ch212 = {13,18,-1,0,15,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, +0x1,0x80,0x0,0xc0, +}; + +static const BitmapCharRec ch211 = {13,18,-1,0,15,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, +0x6,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch210 = {13,18,-1,0,15,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, +0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0, +0x16,0x80,0xc,0x80, +}; + +static const BitmapCharRec ch209 = {11,18,-1,0,13,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30, +0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80, +}; + +static const BitmapCharRec ch208 = {12,14,0,0,13,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, +0xcc, +}; + +static const BitmapCharRec ch207 = {6,17,0,0,6,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, +0x78,0x30, +}; + +static const BitmapCharRec ch206 = {6,18,0,0,6,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0, +0x60,0x30, +}; + +static const BitmapCharRec ch205 = {4,18,-2,0,6,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30, +0x60,0xc0, +}; + +static const BitmapCharRec ch204 = {4,18,0,0,6,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, +0x33,0x0, +}; + +static const BitmapCharRec ch203 = {9,17,-1,0,11,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, +0x1e,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch202 = {9,18,-1,0,11,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, +0x6,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch201 = {9,18,-1,0,11,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, +0x18,0x0,0x30,0x0, +}; + +static const BitmapCharRec ch200 = {9,18,-1,0,11,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30, +0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70, +0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch199 = {12,18,-1,4,14,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe, +0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff, +}; + +static const BitmapCharRec ch198 = {16,14,-1,0,18,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x19,0x80,0xf,0x0, +}; + +static const BitmapCharRec ch197 = {12,18,0,0,12,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, +0x19,0x80, +}; + +static const BitmapCharRec ch196 = {12,17,0,0,12,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0, +0x16,0x80,0xc,0x80, +}; + +static const BitmapCharRec ch195 = {12,18,0,0,12,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, +0xf,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch194 = {12,18,0,0,12,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, +0x3,0x0,0x1,0x80, +}; + +static const BitmapCharRec ch193 = {12,18,0,0,12,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, +0xc,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch192 = {12,18,0,0,12,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18, +}; + +static const BitmapCharRec ch191 = {7,14,-1,4,10,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88, +0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30, +}; + +static const BitmapCharRec ch190 = {14,13,0,0,15,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70, +0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, +}; + +static const BitmapCharRec ch189 = {13,13,-1,0,15,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10, +0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, +}; + +static const BitmapCharRec ch188 = {13,13,-1,0,15,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90, +}; + +static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70, +}; + +static const BitmapCharRec ch186 = {5,8,-1,-6,7,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60, +}; + +static const BitmapCharRec ch185 = {3,8,-1,-5,6,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xf0,0xd8,0x18,0x70,0x60, +}; + +static const BitmapCharRec ch184 = {5,5,0,4,5,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-1,-4,4,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2, +0x72,0x3f, +}; + +static const BitmapCharRec ch182 = {8,18,-1,4,10,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch181 = {8,14,-1,4,10,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0xc0,0x60,0x30, +}; + +static const BitmapCharRec ch180 = {4,3,0,-11,4,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70, +}; + +static const BitmapCharRec ch179 = {5,8,0,-5,6,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70, +}; + +static const BitmapCharRec ch178 = {5,8,0,-5,6,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18, +}; + +static const BitmapCharRec ch177 = {8,11,-1,0,10,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x70,0xd8,0x88,0xd8,0x70, +}; + +static const BitmapCharRec ch176 = {5,5,-1,-8,7,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xf8, +}; + +static const BitmapCharRec ch175 = {5,1,0,-12,5,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48, +0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80, +}; + +static const BitmapCharRec ch174 = {13,13,-1,0,14,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xf8,0xf8, +}; + +static const BitmapCharRec ch173 = {5,2,-1,-4,7,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch172 = {9,5,-1,-3,11,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12, +}; + +static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70, +}; + +static const BitmapCharRec ch170 = {5,8,-1,-6,7,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8, +0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80, +}; + +static const BitmapCharRec ch169 = {13,13,-1,0,15,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xd8,0xd8, +}; + +static const BitmapCharRec ch168 = {5,2,0,-11,6,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3, +0x7e,0x3c, +}; + +static const BitmapCharRec ch167 = {8,18,-1,4,10,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch166 = {2,17,-1,3,4,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3, +}; + +static const BitmapCharRec ch165 = {8,13,-1,0,10,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0xc3,0xff,0x66,0x66,0x66,0xff,0xc3, +}; + +static const BitmapCharRec ch164 = {8,7,-1,-3,10,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0, +0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0, +}; + +static const BitmapCharRec ch163 = {9,13,0,0,10,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4, +}; + +static const BitmapCharRec ch162 = {8,14,-1,2,10,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch161 = {2,14,-2,4,6,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,5,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,5,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0xcc,0x7e,0x33, +}; + +static const BitmapCharRec ch126 = {8,3,-1,-4,10,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30, +0x60,0xc0, +}; + +static const BitmapCharRec ch125 = {6,18,0,4,6,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0, +}; + +static const BitmapCharRec ch124 = {2,18,-1,4,4,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30, +0x18,0xc, +}; + +static const BitmapCharRec ch123 = {6,18,0,4,6,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe, +}; + +static const BitmapCharRec ch122 = {7,10,-1,0,9,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch121 = {8,14,-1,4,10,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3, +}; + +static const BitmapCharRec ch120 = {8,10,-1,0,10,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30, +0xc6,0x30,0xc6,0x30, +}; + +static const BitmapCharRec ch119 = {12,10,-1,0,14,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch118 = {8,10,-1,0,10,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch117 = {8,10,-1,0,10,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30, +}; + +static const BitmapCharRec ch116 = {6,13,0,0,6,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c, +}; + +static const BitmapCharRec ch115 = {7,10,-1,0,9,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8, +}; + +static const BitmapCharRec ch114 = {5,10,-1,0,6,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80, +}; + +static const BitmapCharRec ch113 = {9,14,-1,4,11,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0, +}; + +static const BitmapCharRec ch112 = {9,14,-1,4,11,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0, +}; + +static const BitmapCharRec ch111 = {9,10,-1,0,11,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce, +}; + +static const BitmapCharRec ch110 = {8,10,-1,0,10,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30, +0xde,0xf0,0xcc,0x60, +}; + +static const BitmapCharRec ch109 = {12,10,-1,0,14,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch108 = {2,14,-1,0,4,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch107 = {8,14,-1,0,9,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0, +0x30,0x30, +}; + +static const BitmapCharRec ch106 = {4,18,1,4,4,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch105 = {2,14,-1,0,4,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch104 = {8,14,-1,0,10,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80, +}; + +static const BitmapCharRec ch103 = {9,14,-1,4,11,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c, +}; + +static const BitmapCharRec ch102 = {6,14,0,0,6,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c, +}; + +static const BitmapCharRec ch101 = {8,10,-1,0,10,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80, +0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, +}; + +static const BitmapCharRec ch100 = {9,14,-1,0,11,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, +}; + +static const BitmapCharRec ch99 = {8,10,-1,0,10,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0, +0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch98 = {9,14,-1,0,11,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c, +}; + +static const BitmapCharRec ch97 = {7,10,-1,0,9,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0xc0,0x80,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,5,-1,-9,4,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch95 = {10,2,0,4,10,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x82,0xc6,0x6c,0x38,0x10, +}; + +static const BitmapCharRec ch94 = {7,5,-1,-8,9,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xf0,0xf0, +}; + +static const BitmapCharRec ch93 = {4,18,0,4,5,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch92 = {5,14,0,0,5,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xf0,0xf0, +}; + +static const BitmapCharRec ch91 = {4,18,-1,4,5,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0, +0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch90 = {10,14,-1,0,12,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, +}; + +static const BitmapCharRec ch89 = {12,14,-1,0,14,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0, +0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60, +}; + +static const BitmapCharRec ch88 = {11,14,-1,0,13,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66, +0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83, +}; + +static const BitmapCharRec ch87 = {16,14,-1,0,18,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0, +0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, +}; + +static const BitmapCharRec ch86 = {12,14,-1,0,14,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch85 = {11,14,-1,0,13,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0, +0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch84 = {10,14,-1,0,12,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0, +0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0, +}; + +static const BitmapCharRec ch83 = {11,14,-1,0,13,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80, +0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch82 = {10,14,-1,0,12,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch81 = {13,15,-1,1,15,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80, +0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch80 = {10,14,-1,0,12,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch79 = {13,14,-1,0,15,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, +0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch78 = {11,14,-1,0,13,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c, +0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc, +}; + +static const BitmapCharRec ch77 = {14,14,-1,0,16,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch76 = {8,14,-1,0,10,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0, +0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0, +}; + +static const BitmapCharRec ch75 = {12,14,-1,0,13,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3, +}; + +static const BitmapCharRec ch74 = {8,14,-1,0,10,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch73 = {2,14,-2,0,6,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch72 = {11,14,-1,0,13,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0, +0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch71 = {12,14,-1,0,14,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch70 = {9,14,-1,0,11,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch69 = {9,14,-1,0,11,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch68 = {11,14,-1,0,13,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch67 = {12,14,-1,0,14,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80, +0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch66 = {11,14,-1,0,13,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch65 = {12,14,0,0,12,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66, +0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc, +0x3,0xf0, +}; + +static const BitmapCharRec ch64 = {16,17,-1,3,18,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c, +}; + +static const BitmapCharRec ch63 = {7,14,-1,0,10,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0, +}; + +static const BitmapCharRec ch62 = {8,9,-1,0,10,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfe,0xfe,0x0,0x0,0xfe,0xfe, +}; + +static const BitmapCharRec ch61 = {7,6,-2,-2,11,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3, +}; + +static const BitmapCharRec ch60 = {8,9,-1,0,10,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {2,13,-1,3,5,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,10,-1,0,5,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c, +}; + +static const BitmapCharRec ch57 = {8,13,-1,0,10,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c, +}; + +static const BitmapCharRec ch56 = {8,13,-1,0,10,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff, +}; + +static const BitmapCharRec ch55 = {8,13,-1,0,10,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c, +}; + +static const BitmapCharRec ch54 = {8,13,-1,0,10,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe, +}; + +static const BitmapCharRec ch53 = {8,13,-1,0,10,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0, +0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch52 = {9,13,-1,0,10,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c, +}; + +static const BitmapCharRec ch51 = {8,13,-1,0,10,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c, +}; + +static const BitmapCharRec ch50 = {8,13,-1,0,10,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18, +}; + +static const BitmapCharRec ch49 = {5,13,-2,0,10,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c, +}; + +static const BitmapCharRec ch48 = {8,13,-1,0,10,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18, +}; + +static const BitmapCharRec ch47 = {5,14,0,0,5,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-1,0,5,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xff,0xff, +}; + +static const BitmapCharRec ch45 = {8,2,-1,-4,11,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch44 = {2,5,-1,3,5,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18, +}; + +static const BitmapCharRec ch43 = {8,10,-1,0,10,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x88,0x70,0x70,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch42 = {5,6,-1,-8,7,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60, +0xc0,0x80, +}; + +static const BitmapCharRec ch41 = {4,18,-1,4,6,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60, +0x30,0x10, +}; + +static const BitmapCharRec ch40 = {4,18,-1,4,6,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch39 = {2,5,-1,-9,4,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0, +0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0, +}; + +static const BitmapCharRec ch38 = {12,13,-1,0,13,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0, +0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60, +}; + +static const BitmapCharRec ch37 = {14,13,-1,0,16,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0, +0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0, +}; + +static const BitmapCharRec ch36 = {9,16,-1,2,10,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0, +0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0, +}; + +static const BitmapCharRec ch35 = {10,13,0,0,10,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0xd8,0xd8,0xd8, +}; + +static const BitmapCharRec ch34 = {5,5,0,-9,5,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch33 = {2,14,-2,0,6,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,5,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,5,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapHelvetica18 = { +"-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutInit.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutInit.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutInit.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutInit.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,263 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutInit.cpp + * + * DESCRIPTION: initialize GLUT state + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include +#include +#include "glutint.h" +#include "glutState.h" +#include "glutBlocker.h" +#include "beos_x11.h" + +/*********************************************************** + * Global variables + ***********************************************************/ +GlutState gState; +char *__glutProgramName = NULL; + +/*********************************************************** + * Private variables + ***********************************************************/ +static int __glutArgc; +static char **__glutArgv; + +/*********************************************************** + * FUNCTION: __glutInitTime + * + * DESCRIPTION: set up start time variable + ***********************************************************/ +void __glutInitTime(bigtime_t *beginning) +{ + static int beenhere = 0; + static bigtime_t genesis; + + if (!beenhere) { + genesis = system_time(); + beenhere = 1; + } + *beginning = genesis; +} + +/*********************************************************** + * FUNCTION: removeArgs + * + * DESCRIPTION: helper function for glutInit to remove args + * from argv variable passed in + ***********************************************************/ +static void +removeArgs(int *argcp, char **argv, int numToRemove) +{ + int i, j; + + for (i = 0, j = numToRemove; argv[j]; i++, j++) { + argv[i] = argv[j]; + } + argv[i] = NULL; + *argcp -= numToRemove; +} + +/*********************************************************** + * FUNCTION: bAppThread + * + * DESCRIPTION: starts the BApplication message loop running + ***********************************************************/ +static int32 bAppThread(void *arg) { + be_app->Lock(); + return be_app->Run(); +} + +/*********************************************************** + * FUNCTION: sigHandler + * + * DESCRIPTION: shuts down the app on CTRL-C + ***********************************************************/ +static void sigHandler(int) { + gState.quitAll = true; + gBlock.NewEvent(); +} + +/*********************************************************** + * FUNCTION: glutInit (2.1) + * + * DESCRIPTION: create BApplication, parse cmd-line arguments, + * and set up gState structure. + ***********************************************************/ +void glutInit(int *argcp, char **argv) { + char *str, *geometry = NULL; + int i; + + if (gState.display) { + __glutWarning("glutInit being called a second time."); + return; + } + /* Determine temporary program name. */ + str = strrchr(argv[0], '/'); + if (str == NULL) { + __glutProgramName = argv[0]; + } else { + __glutProgramName = str + 1; + } + + /* Make private copy of command line arguments. */ + __glutArgc = *argcp; + __glutArgv = (char **) malloc(__glutArgc * sizeof(char *)); + if (!__glutArgv) + __glutFatalError("out of memory."); + for (i = 0; i < __glutArgc; i++) { + __glutArgv[i] = strdup(argv[i]); + if (!__glutArgv[i]) + __glutFatalError("out of memory."); + } + + /* determine permanent program name */ + str = strrchr(__glutArgv[0], '/'); + if (str == NULL) { + __glutProgramName = __glutArgv[0]; + } else { + __glutProgramName = str + 1; + } + + /* parse arguments for standard options */ + for (i = 1; i < __glutArgc; i++) { + if (!strcmp(__glutArgv[i], "-display")) { + __glutWarning("-display option only valid for X glut."); + if (++i >= __glutArgc) { + __glutFatalError( + "follow -display option with X display name."); + } + removeArgs(argcp, &argv[1], 2); + } else if (!strcmp(__glutArgv[i], "-geometry")) { + if (++i >= __glutArgc) { + __glutFatalError( + "follow -geometry option with geometry parameter."); + } + geometry = __glutArgv[i]; + removeArgs(argcp, &argv[1], 2); + } else if (!strcmp(__glutArgv[i], "-direct")) { + __glutWarning("-direct option only valid for X glut."); + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-indirect")) { + __glutWarning("-indirect option only valid for X glut."); + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-iconic")) { + __glutWarning("-iconic option doesn't make sense in BeOS."); + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-gldebug")) { + gState.debug = true; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-sync")) { + __glutWarning("-sync option only valid for X glut."); + removeArgs(argcp, &argv[1], 1); + } else { + /* Once unknown option encountered, stop command line + processing. */ + break; + } + } + + __glutInit(); /* Create BApplication first so DisplayWidth() works */ + if (geometry) { + int flags, x, y, width, height; + + /* Fix bogus "{width|height} may be used before set" + warning */ + width = 0; + height = 0; + + flags = XParseGeometry(geometry, &x, &y, + (unsigned int *) &width, (unsigned int *) &height); + if (WidthValue & flags) { + /* Careful because X does not allow zero or negative + width windows */ + if (width > 0) + gState.initWidth = width; + } + if (HeightValue & flags) { + /* Careful because X does not allow zero or negative + height windows */ + if (height > 0) + gState.initHeight = height; + } + if (XValue & flags) { + if (XNegative & flags) + x = DisplayWidth() + x - gState.initWidth; + /* Play safe: reject negative X locations */ + if (x >= 0) + gState.initX = x; + } + if (YValue & flags) { + if (YNegative & flags) + y = DisplayHeight() + y - gState.initHeight; + /* Play safe: reject negative Y locations */ + if (y >= 0) + gState.initY = y; + } + } +} + +/*********************************************************** + * FUNCTION: __glutInit + * + * DESCRIPTION: create BApplication, parse cmd-line arguments, + * and set up gState structure. + ***********************************************************/ +void __glutInit() { + // open BApplication + gState.display = new BApplication("application/x-glut-demo"); + be_app->Unlock(); + gState.appthread = spawn_thread(bAppThread, "BApplication", B_NORMAL_PRIORITY, 0); + resume_thread(gState.appthread); + + bigtime_t unused; + __glutInitTime(&unused); + + /* set atexit() function to destroy all windows before exiting */ + if(atexit(__glutDestroyAllWindows)) + __glutFatalError("can't set exit handler"); + + /* similarly, destroy all windows on CTRL-C */ + signal(SIGINT, sigHandler); +} + +/*********************************************************** + * FUNCTION: glutInitWindowPosition (2.2) + * + * DESCRIPTION: set initial window position + ***********************************************************/ +void glutInitWindowPosition(int x, int y) { + gState.initX = x; + gState.initY = y; +} + +/*********************************************************** + * FUNCTION: glutInitWindowSize (2.2) + * + * DESCRIPTION: set initial window size + ***********************************************************/ +void glutInitWindowSize(int width, int height) { + gState.initWidth = width; + gState.initHeight = height; +} + +/*********************************************************** + * FUNCTION: glutInitDisplayMode (2.3) + * + * DESCRIPTION: set initial display mode + ***********************************************************/ +void glutInitDisplayMode(unsigned int mode) { + gState.displayMode = mode; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutint.h xpsb-glx-0.19/mesa/src/glut/beos/glutint.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutint.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutint.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,814 @@ +#ifndef __glutint_h__ +#define __glutint_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#if defined(__CYGWIN32__) +#include +#endif + +#if defined(_WIN32) +#include "glutwin32.h" +#elif !defined(__BEOS__) +#ifdef __sgi +#define SUPPORT_FORTRAN +#endif +#include +#include +#include +#endif + +#include + +/* Non-Win32 platforms need APIENTRY defined to nothing + because all the GLUT routines have the APIENTRY prefix + to make Win32 happy. */ +#ifndef APIENTRY +#define APIENTRY +#endif + +#ifdef __vms +#if ( __VMS_VER < 70000000 ) +struct timeval { + __int64 val; +}; +extern int sys$gettim(struct timeval *); +#else +#include +#endif +#else +#include +#if !defined(_WIN32) +#include +#else +#include +#endif +#endif +#if defined(__vms) && ( __VMS_VER < 70000000 ) + +/* For VMS6.2 or lower : + One TICK on VMS is 100 nanoseconds; 0.1 microseconds or + 0.0001 milliseconds. This means that there are 0.01 + ticks/ns, 10 ticks/us, 10,000 ticks/ms and 10,000,000 + ticks/second. */ + +#define TICKS_PER_MILLISECOND 10000 +#define TICKS_PER_SECOND 10000000 + +#define GETTIMEOFDAY(_x) (void) sys$gettim (_x); + +#define ADD_TIME(dest, src1, src2) { \ + (dest).val = (src1).val + (src2).val; \ +} + +#define TIMEDELTA(dest, src1, src2) { \ + (dest).val = (src1).val - (src2).val; \ +} + +#define IS_AFTER(t1, t2) ((t2).val > (t1).val) + +#define IS_AT_OR_AFTER(t1, t2) ((t2).val >= (t1).val) + +#else +#if defined(SVR4) && !defined(sun) /* Sun claims SVR4, but + wants 2 args. */ +#define GETTIMEOFDAY(_x) gettimeofday(_x) +#else +#define GETTIMEOFDAY(_x) gettimeofday(_x, NULL) +#endif +#define ADD_TIME(dest, src1, src2) { \ + if(((dest).tv_usec = \ + (src1).tv_usec + (src2).tv_usec) >= 1000000) { \ + (dest).tv_usec -= 1000000; \ + (dest).tv_sec = (src1).tv_sec + (src2).tv_sec + 1; \ + } else { \ + (dest).tv_sec = (src1).tv_sec + (src2).tv_sec; \ + if(((dest).tv_sec >= 1) && (((dest).tv_usec <0))) { \ + (dest).tv_sec --;(dest).tv_usec += 1000000; \ + } \ + } \ +} +#define TIMEDELTA(dest, src1, src2) { \ + if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \ + (dest).tv_usec += 1000000; \ + (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \ + } else { \ + (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \ + } \ +} +#define IS_AFTER(t1, t2) \ + (((t2).tv_sec > (t1).tv_sec) || \ + (((t2).tv_sec == (t1).tv_sec) && \ + ((t2).tv_usec > (t1).tv_usec))) +#define IS_AT_OR_AFTER(t1, t2) \ + (((t2).tv_sec > (t1).tv_sec) || \ + (((t2).tv_sec == (t1).tv_sec) && \ + ((t2).tv_usec >= (t1).tv_usec))) +#endif + +#define IGNORE_IN_GAME_MODE() \ + { if (__glutGameModeWindow) return; } + +/* BeOS doesn't need most of this file */ +#ifndef __BEOS__ + +#define GLUT_WIND_IS_RGB(x) (((x) & GLUT_INDEX) == 0) +#define GLUT_WIND_IS_INDEX(x) (((x) & GLUT_INDEX) != 0) +#define GLUT_WIND_IS_SINGLE(x) (((x) & GLUT_DOUBLE) == 0) +#define GLUT_WIND_IS_DOUBLE(x) (((x) & GLUT_DOUBLE) != 0) +#define GLUT_WIND_HAS_ACCUM(x) (((x) & GLUT_ACCUM) != 0) +#define GLUT_WIND_HAS_ALPHA(x) (((x) & GLUT_ALPHA) != 0) +#define GLUT_WIND_HAS_DEPTH(x) (((x) & GLUT_DEPTH) != 0) +#define GLUT_WIND_HAS_STENCIL(x) (((x) & GLUT_STENCIL) != 0) +#define GLUT_WIND_IS_MULTISAMPLE(x) (((x) & GLUT_MULTISAMPLE) != 0) +#define GLUT_WIND_IS_STEREO(x) (((x) & GLUT_STEREO) != 0) +#define GLUT_WIND_IS_LUMINANCE(x) (((x) & GLUT_LUMINANCE) != 0) +#define GLUT_MAP_WORK (1 << 0) +#define GLUT_EVENT_MASK_WORK (1 << 1) +#define GLUT_REDISPLAY_WORK (1 << 2) +#define GLUT_CONFIGURE_WORK (1 << 3) +#define GLUT_COLORMAP_WORK (1 << 4) +#define GLUT_DEVICE_MASK_WORK (1 << 5) +#define GLUT_FINISH_WORK (1 << 6) +#define GLUT_DEBUG_WORK (1 << 7) +#define GLUT_DUMMY_WORK (1 << 8) +#define GLUT_FULL_SCREEN_WORK (1 << 9) +#define GLUT_OVERLAY_REDISPLAY_WORK (1 << 10) +#define GLUT_REPAIR_WORK (1 << 11) +#define GLUT_OVERLAY_REPAIR_WORK (1 << 12) + +/* Frame buffer capability macros and types. */ +#define RGBA 0 +#define BUFFER_SIZE 1 +#define DOUBLEBUFFER 2 +#define STEREO 3 +#define AUX_BUFFERS 4 +#define RED_SIZE 5 /* Used as mask bit for + "color selected". */ +#define GREEN_SIZE 6 +#define BLUE_SIZE 7 +#define ALPHA_SIZE 8 +#define DEPTH_SIZE 9 +#define STENCIL_SIZE 10 +#define ACCUM_RED_SIZE 11 /* Used as mask bit for + "acc selected". */ +#define ACCUM_GREEN_SIZE 12 +#define ACCUM_BLUE_SIZE 13 +#define ACCUM_ALPHA_SIZE 14 +#define LEVEL 15 + +#define NUM_GLXCAPS (LEVEL + 1) + +#define XVISUAL (NUM_GLXCAPS + 0) +#define TRANSPARENT (NUM_GLXCAPS + 1) +#define SAMPLES (NUM_GLXCAPS + 2) +#define XSTATICGRAY (NUM_GLXCAPS + 3) /* Used as + mask bit + for "any + visual type + selected". */ +#define XGRAYSCALE (NUM_GLXCAPS + 4) +#define XSTATICCOLOR (NUM_GLXCAPS + 5) +#define XPSEUDOCOLOR (NUM_GLXCAPS + 6) +#define XTRUECOLOR (NUM_GLXCAPS + 7) +#define XDIRECTCOLOR (NUM_GLXCAPS + 8) +#define SLOW (NUM_GLXCAPS + 9) +#define CONFORMANT (NUM_GLXCAPS + 10) + +#define NUM_CAPS (NUM_GLXCAPS + 11) + +/* Frame buffer capablities that don't have a corresponding + FrameBufferMode entry. These get used as mask bits. */ +#define NUM (NUM_CAPS + 0) +#define RGBA_MODE (NUM_CAPS + 1) +#define CI_MODE (NUM_CAPS + 2) +#define LUMINANCE_MODE (NUM_CAPS + 3) + +#define NONE 0 +#define EQ 1 +#define NEQ 2 +#define LTE 3 +#define GTE 4 +#define GT 5 +#define LT 6 +#define MIN 7 + +typedef struct _Criterion { + int capability; + int comparison; + int value; +} Criterion; + +typedef struct _FrameBufferMode { + XVisualInfo *vi; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + + /* fbc is non-NULL when the XVisualInfo* is not OpenGL-capable + (ie, GLX_USE_GL is false), but the SGIX_fbconfig extension shows + the visual's fbconfig is OpenGL-capable. The reason for this is typically + an RGBA luminance fbconfig such as 16-bit StaticGray that could + not be advertised as a GLX visual since StaticGray visuals are + required (by the GLX specification) to be color index. The + SGIX_fbconfig allows StaticGray visuals to instead advertised as + fbconfigs that can provide RGBA luminance support. */ + + GLXFBConfigSGIX fbc; +#endif + int valid; + int cap[NUM_CAPS]; +} FrameBufferMode; + +/* DisplayMode capability macros for game mode. */ +#define DM_WIDTH 0 /* "width" */ +#define DM_HEIGHT 1 /* "height" */ +#define DM_PIXEL_DEPTH 2 /* "bpp" (bits per pixel) */ +#define DM_HERTZ 3 /* "hertz" */ +#define DM_NUM 4 /* "num" */ + +#define NUM_DM_CAPS (DM_NUM+1) + +typedef struct _DisplayMode { +#ifdef _WIN32 + DEVMODE devmode; +#else + /* XXX The X Window System does not have a standard + mechanism for display setting changes. On SGI + systems, GLUT could use the XSGIvc (SGI X video + control extension). Perhaps this can be done in + a future release of GLUT. */ +#endif + int valid; + int cap[NUM_DM_CAPS]; +} DisplayMode; + +#endif /* BeOS */ + +/* GLUT function types */ +typedef void (*GLUTdisplayCB) (void); +typedef void (*GLUTreshapeCB) (int, int); +typedef void (*GLUTkeyboardCB) (unsigned char, int, int); +typedef void (*GLUTmouseCB) (int, int, int, int); +typedef void (*GLUTmotionCB) (int, int); +typedef void (*GLUTpassiveCB) (int, int); +typedef void (*GLUTentryCB) (int); +typedef void (*GLUTvisibilityCB) (int); +typedef void (*GLUTwindowStatusCB) (int); +typedef void (*GLUTidleCB) (void); +typedef void (*GLUTtimerCB) (int); +typedef void (*GLUTmenuStateCB) (int); /* DEPRICATED. */ +typedef void (*GLUTmenuStatusCB) (int, int, int); +typedef void (*GLUTselectCB) (int); +typedef void (*GLUTspecialCB) (int, int, int); +typedef void (*GLUTspaceMotionCB) (int, int, int); +typedef void (*GLUTspaceRotateCB) (int, int, int); +typedef void (*GLUTspaceButtonCB) (int, int); +typedef void (*GLUTdialsCB) (int, int); +typedef void (*GLUTbuttonBoxCB) (int, int); +typedef void (*GLUTtabletMotionCB) (int, int); +typedef void (*GLUTtabletButtonCB) (int, int, int, int); +typedef void (*GLUTjoystickCB) (unsigned int buttonMask, int x, int y, int z); +#ifdef SUPPORT_FORTRAN +typedef void (*GLUTdisplayFCB) (void); +typedef void (*GLUTreshapeFCB) (int *, int *); +/* NOTE the pressed key is int, not unsigned char for Fortran! */ +typedef void (*GLUTkeyboardFCB) (int *, int *, int *); +typedef void (*GLUTmouseFCB) (int *, int *, int *, int *); +typedef void (*GLUTmotionFCB) (int *, int *); +typedef void (*GLUTpassiveFCB) (int *, int *); +typedef void (*GLUTentryFCB) (int *); +typedef void (*GLUTvisibilityFCB) (int *); +typedef void (*GLUTwindowStatusFCB) (int *); +typedef void (*GLUTidleFCB) (void); +typedef void (*GLUTtimerFCB) (int *); +typedef void (*GLUTmenuStateFCB) (int *); /* DEPRICATED. */ +typedef void (*GLUTmenuStatusFCB) (int *, int *, int *); +typedef void (*GLUTselectFCB) (int *); +typedef void (*GLUTspecialFCB) (int *, int *, int *); +typedef void (*GLUTspaceMotionFCB) (int *, int *, int *); +typedef void (*GLUTspaceRotateFCB) (int *, int *, int *); +typedef void (*GLUTspaceButtonFCB) (int *, int *); +typedef void (*GLUTdialsFCB) (int *, int *); +typedef void (*GLUTbuttonBoxFCB) (int *, int *); +typedef void (*GLUTtabletMotionFCB) (int *, int *); +typedef void (*GLUTtabletButtonFCB) (int *, int *, int *, int *); +typedef void (*GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); +#endif + +#ifndef __BEOS__ + +typedef struct _GLUTcolorcell GLUTcolorcell; +struct _GLUTcolorcell { + /* GLUT_RED, GLUT_GREEN, GLUT_BLUE */ + GLfloat component[3]; +}; + +typedef struct _GLUTcolormap GLUTcolormap; +struct _GLUTcolormap { + Visual *visual; /* visual of the colormap */ + Colormap cmap; /* X colormap ID */ + int refcnt; /* number of windows using colormap */ + int size; /* number of cells in colormap */ + int transparent; /* transparent pixel, or -1 if opaque */ + GLUTcolorcell *cells; /* array of cells */ + GLUTcolormap *next; /* next colormap in list */ +}; + +typedef struct _GLUTwindow GLUTwindow; +typedef struct _GLUToverlay GLUToverlay; +struct _GLUTwindow { + int num; /* Small integer window id (0-based). */ + + /* Window system related state. */ +#if defined(_WIN32) + int pf; /* Pixel format. */ + HDC hdc; /* Window's Win32 device context. */ +#endif + Window win; /* X window for GLUT window */ + GLXContext ctx; /* OpenGL context GLUT glut window */ + XVisualInfo *vis; /* visual for window */ + Bool visAlloced; /* if vis needs deallocate on destroy */ + Colormap cmap; /* RGB colormap for window; None if CI */ + GLUTcolormap *colormap; /* colormap; NULL if RGBA */ + GLUToverlay *overlay; /* overlay; NULL if no overlay */ +#if defined(_WIN32) + HDC renderDc; /* Win32's device context for rendering. */ +#endif + Window renderWin; /* X window for rendering (might be + overlay) */ + GLXContext renderCtx; /* OpenGL context for rendering (might + be overlay) */ + /* GLUT settable or visible window state. */ + int width; /* window width in pixels */ + int height; /* window height in pixels */ + int cursor; /* cursor name */ + int visState; /* visibility state (-1 is unknown) */ + int shownState; /* if window mapped */ + int entryState; /* entry state (-1 is unknown) */ +#define GLUT_MAX_MENUS 3 + + int menu[GLUT_MAX_MENUS]; /* attatched menu nums */ + /* Window relationship state. */ + GLUTwindow *parent; /* parent window */ + GLUTwindow *children; /* list of children */ + GLUTwindow *siblings; /* list of siblings */ + /* Misc. non-API visible (hidden) state. */ + Bool treatAsSingle; /* treat this window as single-buffered + (it might be "fake" though) */ + Bool forceReshape; /* force reshape before display */ +#if !defined(_WIN32) + Bool isDirect; /* if direct context (X11 only) */ +#endif + Bool usedSwapBuffers; /* if swap buffers used last display */ + long eventMask; /* mask of X events selected for */ + int buttonUses; /* number of button uses, ref cnt */ + int tabletPos[2]; /* tablet position (-1 is invalid) */ + /* Work list related state. */ + unsigned int workMask; /* mask of window work to be done */ + GLUTwindow *prevWorkWin; /* link list of windows to work on */ + Bool desiredMapState; /* how to mapped window if on map work + list */ + Bool ignoreKeyRepeat; /* if window ignores autorepeat */ + int desiredConfMask; /* mask of desired window configuration + */ + int desiredX; /* desired X location */ + int desiredY; /* desired Y location */ + int desiredWidth; /* desired window width */ + int desiredHeight; /* desired window height */ + int desiredStack; /* desired window stack */ + /* Per-window callbacks. */ + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ + GLUTwindowStatusCB windowStatus; /* window status */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + GLUTspecialCB specialUp; /* special up key */ + GLUTbuttonBoxCB buttonBox; /* button box */ + GLUTdialsCB dials; /* dials */ + GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ + GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ + GLUTspaceButtonCB spaceButton; /* Spaceball button */ + GLUTtabletMotionCB tabletMotion; /* tablet motion */ + GLUTtabletButtonCB tabletButton; /* tablet button */ +#ifdef _WIN32 + GLUTjoystickCB joystick; /* joystick */ + int joyPollInterval; /* joystick polling interval */ +#endif +#ifdef SUPPORT_FORTRAN + /* Special Fortran display unneeded since no + parameters! */ + GLUTreshapeFCB freshape; /* Fortran reshape */ + GLUTmouseFCB fmouse; /* Fortran mouse */ + GLUTmotionFCB fmotion; /* Fortran motion */ + GLUTpassiveFCB fpassive; /* Fortran passive */ + GLUTentryFCB fentry; /* Fortran entry */ + GLUTkeyboardFCB fkeyboard; /* Fortran keyboard */ + GLUTkeyboardFCB fkeyboardUp; /* Fortran keyboard up */ + GLUTwindowStatusFCB fwindowStatus; /* Fortran visibility + */ + GLUTvisibilityFCB fvisibility; /* Fortran visibility + */ + GLUTspecialFCB fspecial; /* special key */ + GLUTspecialFCB fspecialUp; /* special key up */ + GLUTbuttonBoxFCB fbuttonBox; /* button box */ + GLUTdialsFCB fdials; /* dials */ + GLUTspaceMotionFCB fspaceMotion; /* Spaceball motion + */ + GLUTspaceRotateFCB fspaceRotate; /* Spaceball rotate + */ + GLUTspaceButtonFCB fspaceButton; /* Spaceball button + */ + GLUTtabletMotionFCB ftabletMotion; /* tablet motion + */ + GLUTtabletButtonFCB ftabletButton; /* tablet button + */ +#ifdef _WIN32 + GLUTjoystickFCB fjoystick; /* joystick */ +#endif +#endif +}; + +struct _GLUToverlay { +#if defined(_WIN32) + int pf; + HDC hdc; +#endif + Window win; + GLXContext ctx; + XVisualInfo *vis; /* visual for window */ + Bool visAlloced; /* if vis needs deallocate on destroy */ + Colormap cmap; /* RGB colormap for window; None if CI */ + GLUTcolormap *colormap; /* colormap; NULL if RGBA */ + int shownState; /* if overlay window mapped */ + Bool treatAsSingle; /* treat as single-buffered */ +#if !defined(_WIN32) + Bool isDirect; /* if direct context */ +#endif + int transparentPixel; /* transparent pixel value */ + GLUTdisplayCB display; /* redraw */ + /* Special Fortran display unneeded since no + parameters! */ +}; + +typedef struct _GLUTstale GLUTstale; +struct _GLUTstale { + GLUTwindow *window; + Window win; + GLUTstale *next; +}; + +extern GLUTstale *__glutStaleWindowList; + +#define GLUT_OVERLAY_EVENT_FILTER_MASK \ + (ExposureMask | \ + StructureNotifyMask | \ + EnterWindowMask | \ + LeaveWindowMask) +#define GLUT_DONT_PROPAGATE_FILTER_MASK \ + (ButtonReleaseMask | \ + ButtonPressMask | \ + KeyPressMask | \ + KeyReleaseMask | \ + PointerMotionMask | \ + Button1MotionMask | \ + Button2MotionMask | \ + Button3MotionMask) +#define GLUT_HACK_STOP_PROPAGATE_MASK \ + (KeyPressMask | \ + KeyReleaseMask) + +typedef struct _GLUTmenu GLUTmenu; +typedef struct _GLUTmenuItem GLUTmenuItem; +struct _GLUTmenu { + int id; /* small integer menu id (0-based) */ + Window win; /* X window for the menu */ + GLUTselectCB select; /* function of menu */ + GLUTmenuItem *list; /* list of menu entries */ + int num; /* number of entries */ +#if !defined(_WIN32) + Bool managed; /* are the InputOnly windows size + validated? */ + Bool searched; /* help detect menu loops */ + int pixheight; /* height of menu in pixels */ + int pixwidth; /* width of menu in pixels */ +#endif + int submenus; /* number of submenu entries */ + GLUTmenuItem *highlighted; /* pointer to highlighted menu + entry, NULL not highlighted */ + GLUTmenu *cascade; /* currently cascading this menu */ + GLUTmenuItem *anchor; /* currently anchored to this entry */ + int x; /* current x origin relative to the + root window */ + int y; /* current y origin relative to the + root window */ +#ifdef SUPPORT_FORTRAN + GLUTselectFCB fselect; /* function of menu */ +#endif +}; + +struct _GLUTmenuItem { + Window win; /* InputOnly X window for entry */ + GLUTmenu *menu; /* menu entry belongs to */ + Bool isTrigger; /* is a submenu trigger? */ + int value; /* value to return for selecting this + entry; doubles as submenu id + (0-base) if submenu trigger */ +#if defined(_WIN32) + UINT unique; /* unique menu item id (Win32 only) */ +#endif + char *label; /* __glutStrdup'ed label string */ + int len; /* length of label string */ + int pixwidth; /* width of X window in pixels */ + GLUTmenuItem *next; /* next menu entry on list for menu */ +}; + +typedef struct _GLUTtimer GLUTtimer; +struct _GLUTtimer { + GLUTtimer *next; /* list of timers */ + struct timeval timeout; /* time to be called */ + GLUTtimerCB func; /* timer (value) */ + int value; /* return value */ +#ifdef SUPPORT_FORTRAN + GLUTtimerFCB ffunc; /* Fortran timer */ +#endif +}; + +typedef struct _GLUTeventParser GLUTeventParser; +struct _GLUTeventParser { + int (*func) (XEvent *); + GLUTeventParser *next; +}; + +/* Declarations to implement glutFullScreen support with + mwm/4Dwm. */ + +/* The following X property format is defined in Motif 1.1's + Xm/MwmUtils.h, but GLUT should not depend on that header + file. Note: Motif 1.2 expanded this structure with + uninteresting fields (to GLUT) so just stick with the + smaller Motif 1.1 structure. */ +typedef struct { +#define MWM_HINTS_DECORATIONS 2 + long flags; + long functions; + long decorations; + long input_mode; +} MotifWmHints; + +/* Make current and buffer swap macros. */ +#ifdef _WIN32 +#define MAKE_CURRENT_LAYER(window) \ + { \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ + \ + if (currentContext != window->renderCtx \ + || currentDc != window->renderDc) { \ + wglMakeCurrent(window->renderDc, window->renderCtx); \ + } \ + } +#define MAKE_CURRENT_WINDOW(window) \ + { \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ + \ + if (currentContext != window->ctx || currentDc != window->hdc) { \ + wglMakeCurrent(window->hdc, window->ctx); \ + } \ + } +#define MAKE_CURRENT_OVERLAY(overlay) \ + wglMakeCurrent(overlay->hdc, overlay->ctx) +#define UNMAKE_CURRENT() \ + wglMakeCurrent(NULL, NULL) +#define SWAP_BUFFERS_WINDOW(window) \ + SwapBuffers(window->hdc) +#define SWAP_BUFFERS_LAYER(window) \ + SwapBuffers(window->renderDc) +#else +#define MAKE_CURRENT_LAYER(window) \ + glXMakeCurrent(__glutDisplay, window->renderWin, window->renderCtx) +#define MAKE_CURRENT_WINDOW(window) \ + glXMakeCurrent(__glutDisplay, window->win, window->ctx) +#define MAKE_CURRENT_OVERLAY(overlay) \ + glXMakeCurrent(__glutDisplay, overlay->win, overlay->ctx) +#define UNMAKE_CURRENT() \ + glXMakeCurrent(__glutDisplay, None, NULL) +#define SWAP_BUFFERS_WINDOW(window) \ + glXSwapBuffers(__glutDisplay, window->win) +#define SWAP_BUFFERS_LAYER(window) \ + glXSwapBuffers(__glutDisplay, window->renderWin) +#endif + +/* private variables from glut_event.c */ +extern GLUTwindow *__glutWindowWorkList; +extern int __glutWindowDamaged; +#ifdef SUPPORT_FORTRAN +extern GLUTtimer *__glutTimerList; +extern GLUTtimer *__glutNewTimer; +#endif +extern GLUTmenu *__glutMappedMenu; + +extern void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *); +#if !defined(_WIN32) +extern void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item, + int num, int type); +extern void (*__glutFinishMenu)(Window win, int x, int y); +extern void (*__glutPaintMenu)(GLUTmenu * menu); +extern void (*__glutStartMenu)(GLUTmenu * menu, + GLUTwindow * window, int x, int y, int x_win, int y_win); +extern GLUTmenu * (*__glutGetMenuByNum)(int menunum); +extern GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu, + Window win, int *which); +extern GLUTmenu * (*__glutGetMenu)(Window win); +#endif + +/* private variables from glut_init.c */ +extern Atom __glutWMDeleteWindow; +extern Display *__glutDisplay; +extern unsigned int __glutDisplayMode; +extern char *__glutDisplayString; +extern XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask, void **fbc); +extern GLboolean __glutDebug; +extern GLboolean __glutForceDirect; +extern GLboolean __glutIconic; +extern GLboolean __glutTryDirect; +extern Window __glutRoot; +extern XSizeHints __glutSizeHints; +extern char **__glutArgv; +#endif /* BeOS */ +extern char *__glutProgramName; +#ifndef __BEOS__ +extern int __glutArgc; +extern int __glutConnectionFD; +extern int __glutInitHeight; +extern int __glutInitWidth; +extern int __glutInitX; +extern int __glutInitY; +extern int __glutScreen; +extern int __glutScreenHeight; +extern int __glutScreenWidth; +extern Atom __glutMotifHints; +extern unsigned int __glutModifierMask; + +/* private variables from glut_menu.c */ +extern GLUTmenuItem *__glutItemSelected; +extern GLUTmenu **__glutMenuList; +extern void (*__glutMenuStatusFunc) (int, int, int); +extern void __glutMenuModificationError(void); +extern void __glutSetMenuItem(GLUTmenuItem * item, + const char *label, int value, Bool isTrigger); + +/* private variables from glut_win.c */ +extern GLUTwindow **__glutWindowList; +extern GLUTwindow *__glutCurrentWindow; +extern GLUTwindow *__glutMenuWindow; +extern GLUTmenu *__glutCurrentMenu; +extern int __glutWindowListSize; +extern void (*__glutFreeOverlayFunc) (GLUToverlay *); +extern XVisualInfo *__glutDetermineWindowVisual(Bool * treatAsSingle, + Bool * visAlloced, void **fbc); + +/* private variables from glut_mesa.c */ +extern int __glutMesaSwapHackSupport; + +/* private variables from glut_gamemode.c */ +extern GLUTwindow *__glutGameModeWindow; + +/* private routines from glut_cindex.c */ +extern GLUTcolormap * __glutAssociateNewColormap(XVisualInfo * vis); +extern void __glutFreeColormap(GLUTcolormap *); + +/* private routines from glut_cmap.c */ +extern void __glutSetupColormap( + XVisualInfo * vi, + GLUTcolormap ** colormap, + Colormap * cmap); +#if !defined(_WIN32) +extern void __glutEstablishColormapsProperty( + GLUTwindow * window); +extern GLUTwindow *__glutToplevelOf(GLUTwindow * window); +#endif + +/* private routines from glut_cursor.c */ +extern void __glutSetCursor(GLUTwindow *window); + +/* private routines from glut_event.c */ +extern void __glutPutOnWorkList(GLUTwindow * window, + int work_mask); +extern void __glutRegisterEventParser(GLUTeventParser * parser); +extern void __glutPostRedisplay(GLUTwindow * window, int layerMask); + +/* private routines from glut_init.c */ +#if !defined(_WIN32) +extern void __glutOpenXConnection(char *display); +#else +extern void __glutOpenWin32Connection(char *display); +#endif +extern void __glutInitTime(struct timeval *beginning); + +/* private routines for glut_menu.c (or win32_menu.c) */ +#if defined(_WIN32) +extern GLUTmenu *__glutGetMenu(Window win); +extern GLUTmenu *__glutGetMenuByNum(int menunum); +extern GLUTmenuItem *__glutGetMenuItem(GLUTmenu * menu, + Window win, int *which); +extern void __glutStartMenu(GLUTmenu * menu, + GLUTwindow * window, int x, int y, int x_win, int y_win); +extern void __glutFinishMenu(Window win, int x, int y); +#endif +extern void __glutSetMenu(GLUTmenu * menu); + +#endif /* BeOS */ +#ifdef __cplusplus +extern "C" { +#endif +/* private routines from glut_util.c */ +extern char * __glutStrdup(const char *string); +extern void __glutWarning(char *format,...); +extern void __glutFatalError(char *format,...); +extern void __glutFatalUsage(char *format,...); +#ifdef __cplusplus +} +#endif +#ifndef __BEOS__ + +/* private routines from glut_win.c */ +extern GLUTwindow *__glutGetWindow(Window win); +extern void __glutChangeWindowEventMask(long mask, Bool add); +extern XVisualInfo *__glutDetermineVisual( + unsigned int mode, + Bool * fakeSingle, + XVisualInfo * (getVisualInfo) (unsigned int)); +extern XVisualInfo *__glutGetVisualInfo(unsigned int mode); +extern void __glutSetWindow(GLUTwindow * window); +extern void __glutReshapeFunc(GLUTreshapeCB reshapeFunc, + int callingConvention); +extern void __glutDefaultReshape(int, int); +extern GLUTwindow *__glutCreateWindow( + GLUTwindow * parent, + int x, int y, int width, int height, int gamemode); +extern void __glutDestroyWindow( + GLUTwindow * window, + GLUTwindow * initialWindow); + +#if !defined(_WIN32) +/* private routines from glut_glxext.c */ +extern int __glutIsSupportedByGLX(char *); +#endif + +/* private routines from glut_input.c */ +extern void __glutUpdateInputDeviceMask(GLUTwindow * window); + +/* private routines from glut_mesa.c */ +extern void __glutDetermineMesaSwapHackSupport(void); + +/* private routines from glut_gameglut.c */ +extern void __glutCloseDownGameMode(void); + +#if defined(_WIN32) +/* private routines from win32_*.c */ +extern LONG WINAPI __glutWindowProc(HWND win, UINT msg, WPARAM w, LPARAM l); +extern HDC XHDC; +#endif + +#else /* BeOS */ +/* BeOS specific C++ function prototypes */ +#ifdef __cplusplus + +#include + +/* private routines from glutInit.cpp */ +void __glutInitTime(bigtime_t *beginning); +void __glutInit(); + +/* private routines from glutMenu.cpp */ +class GlutMenu; // avoid including glutMenu.h +GlutMenu *__glutGetMenuByNum(int menunum); + +/* private routines from glutWindow.cpp */ +int __glutConvertDisplayMode(unsigned long *options); +void __glutDefaultReshape(int width, int height); +class GlutWindow; // avoid including glutWindow.h in every source file +void __glutSetWindow(GlutWindow * window); +void __glutDestroyAllWindows(); + +/* private routines from glutDstr.cpp */ +int __glutConvertDisplayModeFromString(unsigned long *options); + +/* private routines from glutCursor.cpp */ +void __glutSetCursor(int cursor); + +#endif /* __cplusplus */ +#endif /* BeOS */ + +#endif /* __glutint_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,326 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * FILE: glutMenu.cpp + * + * DESCRIPTION: code for popup menu handling + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include +#include "glutint.h" +#include "glutState.h" + +/*********************************************************** + * Private variables + ***********************************************************/ +static GlutMenu **menuList = 0; +static int menuListSize = 0; + +/*********************************************************** + * FUNCTION: getUnusedMenuSlot + * + * DESCRIPTION: helper function to get a new menu slot + ***********************************************************/ +GlutMenu *__glutGetMenuByNum(int menunum) +{ + if (menunum < 1 || menunum > menuListSize) { + return NULL; + } + return menuList[menunum - 1]; +} + +/*********************************************************** + * FUNCTION: getUnusedMenuSlot + * + * DESCRIPTION: helper function to get a new menu slot + ***********************************************************/ +static int +getUnusedMenuSlot(void) +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < menuListSize; i++) { + if (!menuList[i]) { + return i; + } + } + /* Allocate a new slot. */ + menuListSize++; + menuList = (GlutMenu **) + realloc(menuList, menuListSize * sizeof(GlutMenu *)); + if (!menuList) + __glutFatalError("out of memory."); + menuList[menuListSize - 1] = NULL; + return menuListSize - 1; +} + +/*********************************************************** + * FUNCTION: glutCreateMenu (6.1) + * + * DESCRIPTION: create a new menu + ***********************************************************/ +int APIENTRY +glutCreateMenu(GLUTselectCB selectFunc) +{ + GlutMenu *menu; + int menuid; + + menuid = getUnusedMenuSlot(); + menu = new GlutMenu(menuid, selectFunc); // constructor sets up members + menuList[menuid] = menu; + gState.currentMenu = menu; + return menuid + 1; +} + +/*********************************************************** + * FUNCTION: glutSetMenu (6.2) + * glutGetMenu + * + * DESCRIPTION: set and get the current menu + ***********************************************************/ +int APIENTRY +glutGetMenu(void) +{ + if (gState.currentMenu) { + return gState.currentMenu->id + 1; + } else { + return 0; + } +} + +void APIENTRY +glutSetMenu(int menuid) +{ + GlutMenu *menu; + + if (menuid < 1 || menuid > menuListSize) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + menu = menuList[menuid - 1]; + if (!menu) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + gState.currentMenu = menu; +} + +/*********************************************************** + * FUNCTION: glutDestroyMenu (6.3) + * + * DESCRIPTION: destroy the specified menu + ***********************************************************/ +void APIENTRY +glutDestroyMenu(int menunum) +{ + GlutMenu *menu = __glutGetMenuByNum(menunum); + menuList[menunum - 1] = 0; + if (gState.currentMenu == menu) { + gState.currentMenu = 0; + } + delete menu; +} + +/*********************************************************** + * FUNCTION: glutAddMenuEntry (6.4) + * + * DESCRIPTION: add a new menu item + ***********************************************************/ +void +glutAddMenuEntry(const char *label, int value) +{ + new GlutMenuItem(gState.currentMenu, false, value, label); +} + +/*********************************************************** + * FUNCTION: glutAddSubMenu (6.5) + * + * DESCRIPTION: add a new submenu + ***********************************************************/ +void +glutAddSubMenu(const char *label, int menu) +{ + new GlutMenuItem(gState.currentMenu, true, menu-1, label); +} + +/*********************************************************** + * FUNCTION: glutChangeToMenuEntry (6.6) + * + * DESCRIPTION: change menuitem into a menu entry + ***********************************************************/ +void +glutChangeToMenuEntry(int num, const char *label, int value) +{ + GlutMenuItem *item; + int i; + + i = gState.currentMenu->num; + item = gState.currentMenu->list; + while (item) { + if (i == num) { + free(item->label); + item->label = strdup(label); + item->isTrigger = false; + item->value = value; + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +/*********************************************************** + * FUNCTION: glutChangeToSubMenu (6.7) + * + * DESCRIPTION: change menuitem into a submenu + ***********************************************************/ +void +glutChangeToSubMenu(int num, const char *label, int menu) +{ + GlutMenuItem *item; + int i; + + i = gState.currentMenu->num; + item = gState.currentMenu->list; + while (item) { + if (i == num) { + free(item->label); + item->label = strdup(label); + item->isTrigger = true; + item->value = menu-1; + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +/*********************************************************** + * FUNCTION: glutRemoveMenuItem (6.8) + * + * DESCRIPTION: remove a menu item + ***********************************************************/ +void +glutRemoveMenuItem(int num) +{ + GlutMenuItem *item, **prev; + int i; + + i = gState.currentMenu->num; + prev = &gState.currentMenu->list; + item = gState.currentMenu->list; + + while (item) { + if (i == num) { + gState.currentMenu->num--; + + /* Patch up menu's item list. */ + *prev = item->next; + + free(item->label); + delete item; + return; + } + i--; + prev = &item->next; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +/*********************************************************** + * FUNCTION: glutAttachMenu (6.9) + * glutDetachMenu + * + * DESCRIPTION: attach and detach menu from view + ***********************************************************/ +void +glutAttachMenu(int button) +{ + gState.currentWindow->menu[button] = gState.currentMenu->id + 1; +} + +void +glutDetachMenu(int button) +{ + gState.currentWindow->menu[button] = 0; +} + +/*********************************************************** + * CLASS: GlutMenu + * + * FUNCTION: CreateBMenu + * + * DESCRIPTION: construct a BPopupMenu for this menu + ***********************************************************/ +BMenu *GlutMenu::CreateBMenu(bool toplevel) { + BMenu *bpopup; + if(toplevel) { + bpopup = new GlutPopUp(id+1); + } else { + bpopup = new BMenu(""); + } + GlutMenuItem *item = list; + while (item) { + GlutBMenuItem *bitem; + if(item->isTrigger) { + // recursively call CreateBMenu + bitem = new GlutBMenuItem(menuList[item->value]->CreateBMenu(false)); + bitem->SetLabel(item->label); + bitem->menu = 0; // real menu items start at 1 + bitem->value = 0; + } else { + bitem = new GlutBMenuItem(item->label); + bitem->menu = id + 1; + bitem->value = item->value; + } + bpopup->AddItem(bitem, 0); + item = item->next; + } + return bpopup; +} + +/*********************************************************** + * CLASS: GlutMenu + * + * FUNCTION: (destructor) + * + * DESCRIPTION: destroy the menu and its items (but not submenus!) + ***********************************************************/ +GlutMenu::~GlutMenu() { + while (list) { + GlutMenuItem *next = list->next; + delete list; + list = next; + } +} + +/*********************************************************** + * CLASS: GlutMenuItem + * + * FUNCTION: (constructor) + * + * DESCRIPTION: construct the new menu item and add to parent + ***********************************************************/ +GlutMenuItem::GlutMenuItem(GlutMenu *n_menu, bool n_trig, int n_value, const char *n_label) +{ + menu = n_menu; + isTrigger = n_trig; + value = n_value; + label = strdup(n_label); + next = menu->list; + menu->list = this; + menu->num++; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.h xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutMenu.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,84 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * FILE: glutMenu.h + * + * DESCRIPTION: the GlutMenu class is a simple popup menu + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include +#include + +/*********************************************************** + * Definitions + ***********************************************************/ +const int32 MENU_ITEM = 'menu'; + +/*********************************************************** + * CLASS: GlutMenu + ***********************************************************/ +class GlutMenuItem; +class GlutPopUp; +class GlutMenu { +public: + GlutMenu(int n_id, GLUTselectCB n_select) { + id = n_id; + select = n_select; + list = 0; + num = 0; + } + ~GlutMenu(); + BMenu *CreateBMenu(bool toplevel=true); // construct BPopUpMenu + + // public data + int id; + GLUTselectCB select; // callback function + GlutMenuItem *list; // list of menu items + int num; // number of items +}; + +/*********************************************************** + * CLASS: GlutMenuItem + ***********************************************************/ +class GlutMenuItem { +public: + GlutMenuItem(GlutMenu *n_menu, bool n_trig, int n_value, const char *n_label); + + // public data + GlutMenu *menu; // parent menu + bool isTrigger; // are we a submenu? + int value; // value to send, or submenu id if isTrigger + char *label; // strdup'ed label string + GlutMenuItem *next; // next menu entry on list +}; + +/*********************************************************** + * CLASS: GlutPopUp + ***********************************************************/ +class GlutPopUp : public BPopUpMenu { +public: + GlutPopUp(int m) : BPopUpMenu(0, false, false) { menu = m;} + + BPoint point; // point to start menu + GlutWindow *win; // pointer to my window + int menu; // my menu number +}; + +/*********************************************************** + * CLASS: GlutBMenuItem + ***********************************************************/ +class GlutBMenuItem : public BMenuItem { +public: + GlutBMenuItem(const char *name) : BMenuItem(name, 0) {} + GlutBMenuItem(BMenu* menu) : BMenuItem(menu) {} + int menu, value; +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_mroman.c xpsb-glx-0.19/mesa/src/glut/beos/glut_mroman.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_mroman.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_mroman.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2451 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "glutstroke.h" + +/* char: 33 '!' */ + +static const CoordRec char33_stroke0[] = { + { 52.381, 100 }, + { 52.381, 33.3333 }, +}; + +static const CoordRec char33_stroke1[] = { + { 52.381, 9.5238 }, + { 47.6191, 4.7619 }, + { 52.381, 0 }, + { 57.1429, 4.7619 }, + { 52.381, 9.5238 }, +}; + +static const StrokeRec char33[] = { + { 2, char33_stroke0 }, + { 5, char33_stroke1 }, +}; + +/* char: 34 '"' */ + +static const CoordRec char34_stroke0[] = { + { 33.3334, 100 }, + { 33.3334, 66.6667 }, +}; + +static const CoordRec char34_stroke1[] = { + { 71.4286, 100 }, + { 71.4286, 66.6667 }, +}; + +static const StrokeRec char34[] = { + { 2, char34_stroke0 }, + { 2, char34_stroke1 }, +}; + +/* char: 35 '#' */ + +static const CoordRec char35_stroke0[] = { + { 54.7619, 119.048 }, + { 21.4286, -33.3333 }, +}; + +static const CoordRec char35_stroke1[] = { + { 83.3334, 119.048 }, + { 50, -33.3333 }, +}; + +static const CoordRec char35_stroke2[] = { + { 21.4286, 57.1429 }, + { 88.0952, 57.1429 }, +}; + +static const CoordRec char35_stroke3[] = { + { 16.6667, 28.5714 }, + { 83.3334, 28.5714 }, +}; + +static const StrokeRec char35[] = { + { 2, char35_stroke0 }, + { 2, char35_stroke1 }, + { 2, char35_stroke2 }, + { 2, char35_stroke3 }, +}; + +/* char: 36 '$' */ + +static const CoordRec char36_stroke0[] = { + { 42.8571, 119.048 }, + { 42.8571, -19.0476 }, +}; + +static const CoordRec char36_stroke1[] = { + { 61.9047, 119.048 }, + { 61.9047, -19.0476 }, +}; + +static const CoordRec char36_stroke2[] = { + { 85.7143, 85.7143 }, + { 76.1905, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, + { 28.5714, 95.2381 }, + { 19.0476, 85.7143 }, + { 19.0476, 76.1905 }, + { 23.8095, 66.6667 }, + { 28.5714, 61.9048 }, + { 38.0952, 57.1429 }, + { 66.6666, 47.619 }, + { 76.1905, 42.8571 }, + { 80.9524, 38.0952 }, + { 85.7143, 28.5714 }, + { 85.7143, 14.2857 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 19.0476, 14.2857 }, +}; + +static const StrokeRec char36[] = { + { 2, char36_stroke0 }, + { 2, char36_stroke1 }, + { 20, char36_stroke2 }, +}; + +/* char: 37 '%' */ + +static const CoordRec char37_stroke0[] = { + { 95.2381, 100 }, + { 9.5238, 0 }, +}; + +static const CoordRec char37_stroke1[] = { + { 33.3333, 100 }, + { 42.8571, 90.4762 }, + { 42.8571, 80.9524 }, + { 38.0952, 71.4286 }, + { 28.5714, 66.6667 }, + { 19.0476, 66.6667 }, + { 9.5238, 76.1905 }, + { 9.5238, 85.7143 }, + { 14.2857, 95.2381 }, + { 23.8095, 100 }, + { 33.3333, 100 }, + { 42.8571, 95.2381 }, + { 57.1428, 90.4762 }, + { 71.4286, 90.4762 }, + { 85.7143, 95.2381 }, + { 95.2381, 100 }, +}; + +static const CoordRec char37_stroke2[] = { + { 76.1905, 33.3333 }, + { 66.6667, 28.5714 }, + { 61.9048, 19.0476 }, + { 61.9048, 9.5238 }, + { 71.4286, 0 }, + { 80.9524, 0 }, + { 90.4762, 4.7619 }, + { 95.2381, 14.2857 }, + { 95.2381, 23.8095 }, + { 85.7143, 33.3333 }, + { 76.1905, 33.3333 }, +}; + +static const StrokeRec char37[] = { + { 2, char37_stroke0 }, + { 16, char37_stroke1 }, + { 11, char37_stroke2 }, +}; + +/* char: 38 '&' */ + +static const CoordRec char38_stroke0[] = { + { 100, 57.1429 }, + { 100, 61.9048 }, + { 95.2381, 66.6667 }, + { 90.4762, 66.6667 }, + { 85.7143, 61.9048 }, + { 80.9524, 52.381 }, + { 71.4286, 28.5714 }, + { 61.9048, 14.2857 }, + { 52.3809, 4.7619 }, + { 42.8571, 0 }, + { 23.8095, 0 }, + { 14.2857, 4.7619 }, + { 9.5238, 9.5238 }, + { 4.7619, 19.0476 }, + { 4.7619, 28.5714 }, + { 9.5238, 38.0952 }, + { 14.2857, 42.8571 }, + { 47.619, 61.9048 }, + { 52.3809, 66.6667 }, + { 57.1429, 76.1905 }, + { 57.1429, 85.7143 }, + { 52.3809, 95.2381 }, + { 42.8571, 100 }, + { 33.3333, 95.2381 }, + { 28.5714, 85.7143 }, + { 28.5714, 76.1905 }, + { 33.3333, 61.9048 }, + { 42.8571, 47.619 }, + { 66.6667, 14.2857 }, + { 76.1905, 4.7619 }, + { 85.7143, 0 }, + { 95.2381, 0 }, + { 100, 4.7619 }, + { 100, 9.5238 }, +}; + +static const StrokeRec char38[] = { + { 34, char38_stroke0 }, +}; + +/* char: 39 ''' */ + +static const CoordRec char39_stroke0[] = { + { 52.381, 100 }, + { 52.381, 66.6667 }, +}; + +static const StrokeRec char39[] = { + { 2, char39_stroke0 }, +}; + +/* char: 40 '(' */ + +static const CoordRec char40_stroke0[] = { + { 69.0476, 119.048 }, + { 59.5238, 109.524 }, + { 50, 95.2381 }, + { 40.4762, 76.1905 }, + { 35.7143, 52.381 }, + { 35.7143, 33.3333 }, + { 40.4762, 9.5238 }, + { 50, -9.5238 }, + { 59.5238, -23.8095 }, + { 69.0476, -33.3333 }, +}; + +static const StrokeRec char40[] = { + { 10, char40_stroke0 }, +}; + +/* char: 41 ')' */ + +static const CoordRec char41_stroke0[] = { + { 35.7143, 119.048 }, + { 45.2381, 109.524 }, + { 54.7619, 95.2381 }, + { 64.2857, 76.1905 }, + { 69.0476, 52.381 }, + { 69.0476, 33.3333 }, + { 64.2857, 9.5238 }, + { 54.7619, -9.5238 }, + { 45.2381, -23.8095 }, + { 35.7143, -33.3333 }, +}; + +static const StrokeRec char41[] = { + { 10, char41_stroke0 }, +}; + +/* char: 42 '*' */ + +static const CoordRec char42_stroke0[] = { + { 52.381, 71.4286 }, + { 52.381, 14.2857 }, +}; + +static const CoordRec char42_stroke1[] = { + { 28.5715, 57.1429 }, + { 76.1905, 28.5714 }, +}; + +static const CoordRec char42_stroke2[] = { + { 76.1905, 57.1429 }, + { 28.5715, 28.5714 }, +}; + +static const StrokeRec char42[] = { + { 2, char42_stroke0 }, + { 2, char42_stroke1 }, + { 2, char42_stroke2 }, +}; + +/* char: 43 '+' */ + +static const CoordRec char43_stroke0[] = { + { 52.3809, 85.7143 }, + { 52.3809, 0 }, +}; + +static const CoordRec char43_stroke1[] = { + { 9.5238, 42.8571 }, + { 95.2381, 42.8571 }, +}; + +static const StrokeRec char43[] = { + { 2, char43_stroke0 }, + { 2, char43_stroke1 }, +}; + +/* char: 44 ',' */ + +static const CoordRec char44_stroke0[] = { + { 57.1429, 4.7619 }, + { 52.381, 0 }, + { 47.6191, 4.7619 }, + { 52.381, 9.5238 }, + { 57.1429, 4.7619 }, + { 57.1429, -4.7619 }, + { 52.381, -14.2857 }, + { 47.6191, -19.0476 }, +}; + +static const StrokeRec char44[] = { + { 8, char44_stroke0 }, +}; + +/* char: 45 '-' */ + +static const CoordRec char45_stroke0[] = { + { 9.5238, 42.8571 }, + { 95.2381, 42.8571 }, +}; + +static const StrokeRec char45[] = { + { 2, char45_stroke0 }, +}; + +/* char: 46 '.' */ + +static const CoordRec char46_stroke0[] = { + { 52.381, 9.5238 }, + { 47.6191, 4.7619 }, + { 52.381, 0 }, + { 57.1429, 4.7619 }, + { 52.381, 9.5238 }, +}; + +static const StrokeRec char46[] = { + { 5, char46_stroke0 }, +}; + +/* char: 47 '/' */ + +static const CoordRec char47_stroke0[] = { + { 19.0476, -14.2857 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char47[] = { + { 2, char47_stroke0 }, +}; + +/* char: 48 '0' */ + +static const CoordRec char48_stroke0[] = { + { 47.619, 100 }, + { 33.3333, 95.2381 }, + { 23.8095, 80.9524 }, + { 19.0476, 57.1429 }, + { 19.0476, 42.8571 }, + { 23.8095, 19.0476 }, + { 33.3333, 4.7619 }, + { 47.619, 0 }, + { 57.1428, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 19.0476 }, + { 85.7143, 42.8571 }, + { 85.7143, 57.1429 }, + { 80.9524, 80.9524 }, + { 71.4286, 95.2381 }, + { 57.1428, 100 }, + { 47.619, 100 }, +}; + +static const StrokeRec char48[] = { + { 17, char48_stroke0 }, +}; + +/* char: 49 '1' */ + +static const CoordRec char49_stroke0[] = { + { 40.4762, 80.9524 }, + { 50, 85.7143 }, + { 64.2857, 100 }, + { 64.2857, 0 }, +}; + +static const StrokeRec char49[] = { + { 4, char49_stroke0 }, +}; + +/* char: 50 '2' */ + +static const CoordRec char50_stroke0[] = { + { 23.8095, 76.1905 }, + { 23.8095, 80.9524 }, + { 28.5714, 90.4762 }, + { 33.3333, 95.2381 }, + { 42.8571, 100 }, + { 61.9047, 100 }, + { 71.4286, 95.2381 }, + { 76.1905, 90.4762 }, + { 80.9524, 80.9524 }, + { 80.9524, 71.4286 }, + { 76.1905, 61.9048 }, + { 66.6666, 47.619 }, + { 19.0476, 0 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char50[] = { + { 14, char50_stroke0 }, +}; + +/* char: 51 '3' */ + +static const CoordRec char51_stroke0[] = { + { 28.5714, 100 }, + { 80.9524, 100 }, + { 52.3809, 61.9048 }, + { 66.6666, 61.9048 }, + { 76.1905, 57.1429 }, + { 80.9524, 52.381 }, + { 85.7143, 38.0952 }, + { 85.7143, 28.5714 }, + { 80.9524, 14.2857 }, + { 71.4286, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 23.8095, 9.5238 }, + { 19.0476, 19.0476 }, +}; + +static const StrokeRec char51[] = { + { 15, char51_stroke0 }, +}; + +/* char: 52 '4' */ + +static const CoordRec char52_stroke0[] = { + { 64.2857, 100 }, + { 16.6667, 33.3333 }, + { 88.0952, 33.3333 }, +}; + +static const CoordRec char52_stroke1[] = { + { 64.2857, 100 }, + { 64.2857, 0 }, +}; + +static const StrokeRec char52[] = { + { 3, char52_stroke0 }, + { 2, char52_stroke1 }, +}; + +/* char: 53 '5' */ + +static const CoordRec char53_stroke0[] = { + { 76.1905, 100 }, + { 28.5714, 100 }, + { 23.8095, 57.1429 }, + { 28.5714, 61.9048 }, + { 42.8571, 66.6667 }, + { 57.1428, 66.6667 }, + { 71.4286, 61.9048 }, + { 80.9524, 52.381 }, + { 85.7143, 38.0952 }, + { 85.7143, 28.5714 }, + { 80.9524, 14.2857 }, + { 71.4286, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 23.8095, 9.5238 }, + { 19.0476, 19.0476 }, +}; + +static const StrokeRec char53[] = { + { 17, char53_stroke0 }, +}; + +/* char: 54 '6' */ + +static const CoordRec char54_stroke0[] = { + { 78.5714, 85.7143 }, + { 73.8096, 95.2381 }, + { 59.5238, 100 }, + { 50, 100 }, + { 35.7143, 95.2381 }, + { 26.1905, 80.9524 }, + { 21.4286, 57.1429 }, + { 21.4286, 33.3333 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 50, 0 }, + { 54.7619, 0 }, + { 69.0476, 4.7619 }, + { 78.5714, 14.2857 }, + { 83.3334, 28.5714 }, + { 83.3334, 33.3333 }, + { 78.5714, 47.619 }, + { 69.0476, 57.1429 }, + { 54.7619, 61.9048 }, + { 50, 61.9048 }, + { 35.7143, 57.1429 }, + { 26.1905, 47.619 }, + { 21.4286, 33.3333 }, +}; + +static const StrokeRec char54[] = { + { 23, char54_stroke0 }, +}; + +/* char: 55 '7' */ + +static const CoordRec char55_stroke0[] = { + { 85.7143, 100 }, + { 38.0952, 0 }, +}; + +static const CoordRec char55_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char55[] = { + { 2, char55_stroke0 }, + { 2, char55_stroke1 }, +}; + +/* char: 56 '8' */ + +static const CoordRec char56_stroke0[] = { + { 42.8571, 100 }, + { 28.5714, 95.2381 }, + { 23.8095, 85.7143 }, + { 23.8095, 76.1905 }, + { 28.5714, 66.6667 }, + { 38.0952, 61.9048 }, + { 57.1428, 57.1429 }, + { 71.4286, 52.381 }, + { 80.9524, 42.8571 }, + { 85.7143, 33.3333 }, + { 85.7143, 19.0476 }, + { 80.9524, 9.5238 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 23.8095, 9.5238 }, + { 19.0476, 19.0476 }, + { 19.0476, 33.3333 }, + { 23.8095, 42.8571 }, + { 33.3333, 52.381 }, + { 47.619, 57.1429 }, + { 66.6666, 61.9048 }, + { 76.1905, 66.6667 }, + { 80.9524, 76.1905 }, + { 80.9524, 85.7143 }, + { 76.1905, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, +}; + +static const StrokeRec char56[] = { + { 29, char56_stroke0 }, +}; + +/* char: 57 '9' */ + +static const CoordRec char57_stroke0[] = { + { 83.3334, 66.6667 }, + { 78.5714, 52.381 }, + { 69.0476, 42.8571 }, + { 54.7619, 38.0952 }, + { 50, 38.0952 }, + { 35.7143, 42.8571 }, + { 26.1905, 52.381 }, + { 21.4286, 66.6667 }, + { 21.4286, 71.4286 }, + { 26.1905, 85.7143 }, + { 35.7143, 95.2381 }, + { 50, 100 }, + { 54.7619, 100 }, + { 69.0476, 95.2381 }, + { 78.5714, 85.7143 }, + { 83.3334, 66.6667 }, + { 83.3334, 42.8571 }, + { 78.5714, 19.0476 }, + { 69.0476, 4.7619 }, + { 54.7619, 0 }, + { 45.2381, 0 }, + { 30.9524, 4.7619 }, + { 26.1905, 14.2857 }, +}; + +static const StrokeRec char57[] = { + { 23, char57_stroke0 }, +}; + +/* char: 58 ':' */ + +static const CoordRec char58_stroke0[] = { + { 52.381, 66.6667 }, + { 47.6191, 61.9048 }, + { 52.381, 57.1429 }, + { 57.1429, 61.9048 }, + { 52.381, 66.6667 }, +}; + +static const CoordRec char58_stroke1[] = { + { 52.381, 9.5238 }, + { 47.6191, 4.7619 }, + { 52.381, 0 }, + { 57.1429, 4.7619 }, + { 52.381, 9.5238 }, +}; + +static const StrokeRec char58[] = { + { 5, char58_stroke0 }, + { 5, char58_stroke1 }, +}; + +/* char: 59 ';' */ + +static const CoordRec char59_stroke0[] = { + { 52.381, 66.6667 }, + { 47.6191, 61.9048 }, + { 52.381, 57.1429 }, + { 57.1429, 61.9048 }, + { 52.381, 66.6667 }, +}; + +static const CoordRec char59_stroke1[] = { + { 57.1429, 4.7619 }, + { 52.381, 0 }, + { 47.6191, 4.7619 }, + { 52.381, 9.5238 }, + { 57.1429, 4.7619 }, + { 57.1429, -4.7619 }, + { 52.381, -14.2857 }, + { 47.6191, -19.0476 }, +}; + +static const StrokeRec char59[] = { + { 5, char59_stroke0 }, + { 8, char59_stroke1 }, +}; + +/* char: 60 '<' */ + +static const CoordRec char60_stroke0[] = { + { 90.4762, 85.7143 }, + { 14.2857, 42.8571 }, + { 90.4762, 0 }, +}; + +static const StrokeRec char60[] = { + { 3, char60_stroke0 }, +}; + +/* char: 61 '=' */ + +static const CoordRec char61_stroke0[] = { + { 9.5238, 57.1429 }, + { 95.2381, 57.1429 }, +}; + +static const CoordRec char61_stroke1[] = { + { 9.5238, 28.5714 }, + { 95.2381, 28.5714 }, +}; + +static const StrokeRec char61[] = { + { 2, char61_stroke0 }, + { 2, char61_stroke1 }, +}; + +/* char: 62 '>' */ + +static const CoordRec char62_stroke0[] = { + { 14.2857, 85.7143 }, + { 90.4762, 42.8571 }, + { 14.2857, 0 }, +}; + +static const StrokeRec char62[] = { + { 3, char62_stroke0 }, +}; + +/* char: 63 '?' */ + +static const CoordRec char63_stroke0[] = { + { 23.8095, 76.1905 }, + { 23.8095, 80.9524 }, + { 28.5714, 90.4762 }, + { 33.3333, 95.2381 }, + { 42.8571, 100 }, + { 61.9047, 100 }, + { 71.4285, 95.2381 }, + { 76.1905, 90.4762 }, + { 80.9524, 80.9524 }, + { 80.9524, 71.4286 }, + { 76.1905, 61.9048 }, + { 71.4285, 57.1429 }, + { 52.3809, 47.619 }, + { 52.3809, 33.3333 }, +}; + +static const CoordRec char63_stroke1[] = { + { 52.3809, 9.5238 }, + { 47.619, 4.7619 }, + { 52.3809, 0 }, + { 57.1428, 4.7619 }, + { 52.3809, 9.5238 }, +}; + +static const StrokeRec char63[] = { + { 14, char63_stroke0 }, + { 5, char63_stroke1 }, +}; + +/* char: 64 '@' */ + +static const CoordRec char64_stroke0[] = { + { 64.2857, 52.381 }, + { 54.7619, 57.1429 }, + { 45.2381, 57.1429 }, + { 40.4762, 47.619 }, + { 40.4762, 42.8571 }, + { 45.2381, 33.3333 }, + { 54.7619, 33.3333 }, + { 64.2857, 38.0952 }, +}; + +static const CoordRec char64_stroke1[] = { + { 64.2857, 57.1429 }, + { 64.2857, 38.0952 }, + { 69.0476, 33.3333 }, + { 78.5714, 33.3333 }, + { 83.3334, 42.8571 }, + { 83.3334, 47.619 }, + { 78.5714, 61.9048 }, + { 69.0476, 71.4286 }, + { 54.7619, 76.1905 }, + { 50, 76.1905 }, + { 35.7143, 71.4286 }, + { 26.1905, 61.9048 }, + { 21.4286, 47.619 }, + { 21.4286, 42.8571 }, + { 26.1905, 28.5714 }, + { 35.7143, 19.0476 }, + { 50, 14.2857 }, + { 54.7619, 14.2857 }, + { 69.0476, 19.0476 }, +}; + +static const StrokeRec char64[] = { + { 8, char64_stroke0 }, + { 19, char64_stroke1 }, +}; + +/* char: 65 'A' */ + +static const CoordRec char65_stroke0[] = { + { 52.3809, 100 }, + { 14.2857, 0 }, +}; + +static const CoordRec char65_stroke1[] = { + { 52.3809, 100 }, + { 90.4762, 0 }, +}; + +static const CoordRec char65_stroke2[] = { + { 28.5714, 33.3333 }, + { 76.1905, 33.3333 }, +}; + +static const StrokeRec char65[] = { + { 2, char65_stroke0 }, + { 2, char65_stroke1 }, + { 2, char65_stroke2 }, +}; + +/* char: 66 'B' */ + +static const CoordRec char66_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char66_stroke1[] = { + { 19.0476, 100 }, + { 61.9047, 100 }, + { 76.1905, 95.2381 }, + { 80.9524, 90.4762 }, + { 85.7143, 80.9524 }, + { 85.7143, 71.4286 }, + { 80.9524, 61.9048 }, + { 76.1905, 57.1429 }, + { 61.9047, 52.381 }, +}; + +static const CoordRec char66_stroke2[] = { + { 19.0476, 52.381 }, + { 61.9047, 52.381 }, + { 76.1905, 47.619 }, + { 80.9524, 42.8571 }, + { 85.7143, 33.3333 }, + { 85.7143, 19.0476 }, + { 80.9524, 9.5238 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 19.0476, 0 }, +}; + +static const StrokeRec char66[] = { + { 2, char66_stroke0 }, + { 9, char66_stroke1 }, + { 10, char66_stroke2 }, +}; + +/* char: 67 'C' */ + +static const CoordRec char67_stroke0[] = { + { 88.0952, 76.1905 }, + { 83.3334, 85.7143 }, + { 73.8096, 95.2381 }, + { 64.2857, 100 }, + { 45.2381, 100 }, + { 35.7143, 95.2381 }, + { 26.1905, 85.7143 }, + { 21.4286, 76.1905 }, + { 16.6667, 61.9048 }, + { 16.6667, 38.0952 }, + { 21.4286, 23.8095 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 45.2381, 0 }, + { 64.2857, 0 }, + { 73.8096, 4.7619 }, + { 83.3334, 14.2857 }, + { 88.0952, 23.8095 }, +}; + +static const StrokeRec char67[] = { + { 18, char67_stroke0 }, +}; + +/* char: 68 'D' */ + +static const CoordRec char68_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char68_stroke1[] = { + { 19.0476, 100 }, + { 52.3809, 100 }, + { 66.6666, 95.2381 }, + { 76.1905, 85.7143 }, + { 80.9524, 76.1905 }, + { 85.7143, 61.9048 }, + { 85.7143, 38.0952 }, + { 80.9524, 23.8095 }, + { 76.1905, 14.2857 }, + { 66.6666, 4.7619 }, + { 52.3809, 0 }, + { 19.0476, 0 }, +}; + +static const StrokeRec char68[] = { + { 2, char68_stroke0 }, + { 12, char68_stroke1 }, +}; + +/* char: 69 'E' */ + +static const CoordRec char69_stroke0[] = { + { 21.4286, 100 }, + { 21.4286, 0 }, +}; + +static const CoordRec char69_stroke1[] = { + { 21.4286, 100 }, + { 83.3334, 100 }, +}; + +static const CoordRec char69_stroke2[] = { + { 21.4286, 52.381 }, + { 59.5238, 52.381 }, +}; + +static const CoordRec char69_stroke3[] = { + { 21.4286, 0 }, + { 83.3334, 0 }, +}; + +static const StrokeRec char69[] = { + { 2, char69_stroke0 }, + { 2, char69_stroke1 }, + { 2, char69_stroke2 }, + { 2, char69_stroke3 }, +}; + +/* char: 70 'F' */ + +static const CoordRec char70_stroke0[] = { + { 21.4286, 100 }, + { 21.4286, 0 }, +}; + +static const CoordRec char70_stroke1[] = { + { 21.4286, 100 }, + { 83.3334, 100 }, +}; + +static const CoordRec char70_stroke2[] = { + { 21.4286, 52.381 }, + { 59.5238, 52.381 }, +}; + +static const StrokeRec char70[] = { + { 2, char70_stroke0 }, + { 2, char70_stroke1 }, + { 2, char70_stroke2 }, +}; + +/* char: 71 'G' */ + +static const CoordRec char71_stroke0[] = { + { 88.0952, 76.1905 }, + { 83.3334, 85.7143 }, + { 73.8096, 95.2381 }, + { 64.2857, 100 }, + { 45.2381, 100 }, + { 35.7143, 95.2381 }, + { 26.1905, 85.7143 }, + { 21.4286, 76.1905 }, + { 16.6667, 61.9048 }, + { 16.6667, 38.0952 }, + { 21.4286, 23.8095 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 45.2381, 0 }, + { 64.2857, 0 }, + { 73.8096, 4.7619 }, + { 83.3334, 14.2857 }, + { 88.0952, 23.8095 }, + { 88.0952, 38.0952 }, +}; + +static const CoordRec char71_stroke1[] = { + { 64.2857, 38.0952 }, + { 88.0952, 38.0952 }, +}; + +static const StrokeRec char71[] = { + { 19, char71_stroke0 }, + { 2, char71_stroke1 }, +}; + +/* char: 72 'H' */ + +static const CoordRec char72_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char72_stroke1[] = { + { 85.7143, 100 }, + { 85.7143, 0 }, +}; + +static const CoordRec char72_stroke2[] = { + { 19.0476, 52.381 }, + { 85.7143, 52.381 }, +}; + +static const StrokeRec char72[] = { + { 2, char72_stroke0 }, + { 2, char72_stroke1 }, + { 2, char72_stroke2 }, +}; + +/* char: 73 'I' */ + +static const CoordRec char73_stroke0[] = { + { 52.381, 100 }, + { 52.381, 0 }, +}; + +static const StrokeRec char73[] = { + { 2, char73_stroke0 }, +}; + +/* char: 74 'J' */ + +static const CoordRec char74_stroke0[] = { + { 76.1905, 100 }, + { 76.1905, 23.8095 }, + { 71.4286, 9.5238 }, + { 66.6667, 4.7619 }, + { 57.1429, 0 }, + { 47.6191, 0 }, + { 38.0953, 4.7619 }, + { 33.3334, 9.5238 }, + { 28.5715, 23.8095 }, + { 28.5715, 33.3333 }, +}; + +static const StrokeRec char74[] = { + { 10, char74_stroke0 }, +}; + +/* char: 75 'K' */ + +static const CoordRec char75_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char75_stroke1[] = { + { 85.7143, 100 }, + { 19.0476, 33.3333 }, +}; + +static const CoordRec char75_stroke2[] = { + { 42.8571, 57.1429 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char75[] = { + { 2, char75_stroke0 }, + { 2, char75_stroke1 }, + { 2, char75_stroke2 }, +}; + +/* char: 76 'L' */ + +static const CoordRec char76_stroke0[] = { + { 23.8095, 100 }, + { 23.8095, 0 }, +}; + +static const CoordRec char76_stroke1[] = { + { 23.8095, 0 }, + { 80.9524, 0 }, +}; + +static const StrokeRec char76[] = { + { 2, char76_stroke0 }, + { 2, char76_stroke1 }, +}; + +/* char: 77 'M' */ + +static const CoordRec char77_stroke0[] = { + { 14.2857, 100 }, + { 14.2857, 0 }, +}; + +static const CoordRec char77_stroke1[] = { + { 14.2857, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char77_stroke2[] = { + { 90.4762, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char77_stroke3[] = { + { 90.4762, 100 }, + { 90.4762, 0 }, +}; + +static const StrokeRec char77[] = { + { 2, char77_stroke0 }, + { 2, char77_stroke1 }, + { 2, char77_stroke2 }, + { 2, char77_stroke3 }, +}; + +/* char: 78 'N' */ + +static const CoordRec char78_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char78_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 0 }, +}; + +static const CoordRec char78_stroke2[] = { + { 85.7143, 100 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char78[] = { + { 2, char78_stroke0 }, + { 2, char78_stroke1 }, + { 2, char78_stroke2 }, +}; + +/* char: 79 'O' */ + +static const CoordRec char79_stroke0[] = { + { 42.8571, 100 }, + { 33.3333, 95.2381 }, + { 23.8095, 85.7143 }, + { 19.0476, 76.1905 }, + { 14.2857, 61.9048 }, + { 14.2857, 38.0952 }, + { 19.0476, 23.8095 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 42.8571, 0 }, + { 61.9047, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 23.8095 }, + { 90.4762, 38.0952 }, + { 90.4762, 61.9048 }, + { 85.7143, 76.1905 }, + { 80.9524, 85.7143 }, + { 71.4286, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, +}; + +static const StrokeRec char79[] = { + { 21, char79_stroke0 }, +}; + +/* char: 80 'P' */ + +static const CoordRec char80_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char80_stroke1[] = { + { 19.0476, 100 }, + { 61.9047, 100 }, + { 76.1905, 95.2381 }, + { 80.9524, 90.4762 }, + { 85.7143, 80.9524 }, + { 85.7143, 66.6667 }, + { 80.9524, 57.1429 }, + { 76.1905, 52.381 }, + { 61.9047, 47.619 }, + { 19.0476, 47.619 }, +}; + +static const StrokeRec char80[] = { + { 2, char80_stroke0 }, + { 10, char80_stroke1 }, +}; + +/* char: 81 'Q' */ + +static const CoordRec char81_stroke0[] = { + { 42.8571, 100 }, + { 33.3333, 95.2381 }, + { 23.8095, 85.7143 }, + { 19.0476, 76.1905 }, + { 14.2857, 61.9048 }, + { 14.2857, 38.0952 }, + { 19.0476, 23.8095 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 42.8571, 0 }, + { 61.9047, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 23.8095 }, + { 90.4762, 38.0952 }, + { 90.4762, 61.9048 }, + { 85.7143, 76.1905 }, + { 80.9524, 85.7143 }, + { 71.4286, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, +}; + +static const CoordRec char81_stroke1[] = { + { 57.1428, 19.0476 }, + { 85.7143, -9.5238 }, +}; + +static const StrokeRec char81[] = { + { 21, char81_stroke0 }, + { 2, char81_stroke1 }, +}; + +/* char: 82 'R' */ + +static const CoordRec char82_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char82_stroke1[] = { + { 19.0476, 100 }, + { 61.9047, 100 }, + { 76.1905, 95.2381 }, + { 80.9524, 90.4762 }, + { 85.7143, 80.9524 }, + { 85.7143, 71.4286 }, + { 80.9524, 61.9048 }, + { 76.1905, 57.1429 }, + { 61.9047, 52.381 }, + { 19.0476, 52.381 }, +}; + +static const CoordRec char82_stroke2[] = { + { 52.3809, 52.381 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char82[] = { + { 2, char82_stroke0 }, + { 10, char82_stroke1 }, + { 2, char82_stroke2 }, +}; + +/* char: 83 'S' */ + +static const CoordRec char83_stroke0[] = { + { 85.7143, 85.7143 }, + { 76.1905, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, + { 28.5714, 95.2381 }, + { 19.0476, 85.7143 }, + { 19.0476, 76.1905 }, + { 23.8095, 66.6667 }, + { 28.5714, 61.9048 }, + { 38.0952, 57.1429 }, + { 66.6666, 47.619 }, + { 76.1905, 42.8571 }, + { 80.9524, 38.0952 }, + { 85.7143, 28.5714 }, + { 85.7143, 14.2857 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 19.0476, 14.2857 }, +}; + +static const StrokeRec char83[] = { + { 20, char83_stroke0 }, +}; + +/* char: 84 'T' */ + +static const CoordRec char84_stroke0[] = { + { 52.3809, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char84_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char84[] = { + { 2, char84_stroke0 }, + { 2, char84_stroke1 }, +}; + +/* char: 85 'U' */ + +static const CoordRec char85_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 28.5714 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 47.619, 0 }, + { 57.1428, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 28.5714 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char85[] = { + { 10, char85_stroke0 }, +}; + +/* char: 86 'V' */ + +static const CoordRec char86_stroke0[] = { + { 14.2857, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char86_stroke1[] = { + { 90.4762, 100 }, + { 52.3809, 0 }, +}; + +static const StrokeRec char86[] = { + { 2, char86_stroke0 }, + { 2, char86_stroke1 }, +}; + +/* char: 87 'W' */ + +static const CoordRec char87_stroke0[] = { + { 4.7619, 100 }, + { 28.5714, 0 }, +}; + +static const CoordRec char87_stroke1[] = { + { 52.3809, 100 }, + { 28.5714, 0 }, +}; + +static const CoordRec char87_stroke2[] = { + { 52.3809, 100 }, + { 76.1905, 0 }, +}; + +static const CoordRec char87_stroke3[] = { + { 100, 100 }, + { 76.1905, 0 }, +}; + +static const StrokeRec char87[] = { + { 2, char87_stroke0 }, + { 2, char87_stroke1 }, + { 2, char87_stroke2 }, + { 2, char87_stroke3 }, +}; + +/* char: 88 'X' */ + +static const CoordRec char88_stroke0[] = { + { 19.0476, 100 }, + { 85.7143, 0 }, +}; + +static const CoordRec char88_stroke1[] = { + { 85.7143, 100 }, + { 19.0476, 0 }, +}; + +static const StrokeRec char88[] = { + { 2, char88_stroke0 }, + { 2, char88_stroke1 }, +}; + +/* char: 89 'Y' */ + +static const CoordRec char89_stroke0[] = { + { 14.2857, 100 }, + { 52.3809, 52.381 }, + { 52.3809, 0 }, +}; + +static const CoordRec char89_stroke1[] = { + { 90.4762, 100 }, + { 52.3809, 52.381 }, +}; + +static const StrokeRec char89[] = { + { 3, char89_stroke0 }, + { 2, char89_stroke1 }, +}; + +/* char: 90 'Z' */ + +static const CoordRec char90_stroke0[] = { + { 85.7143, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char90_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 100 }, +}; + +static const CoordRec char90_stroke2[] = { + { 19.0476, 0 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char90[] = { + { 2, char90_stroke0 }, + { 2, char90_stroke1 }, + { 2, char90_stroke2 }, +}; + +/* char: 91 '[' */ + +static const CoordRec char91_stroke0[] = { + { 35.7143, 119.048 }, + { 35.7143, -33.3333 }, +}; + +static const CoordRec char91_stroke1[] = { + { 40.4762, 119.048 }, + { 40.4762, -33.3333 }, +}; + +static const CoordRec char91_stroke2[] = { + { 35.7143, 119.048 }, + { 69.0476, 119.048 }, +}; + +static const CoordRec char91_stroke3[] = { + { 35.7143, -33.3333 }, + { 69.0476, -33.3333 }, +}; + +static const StrokeRec char91[] = { + { 2, char91_stroke0 }, + { 2, char91_stroke1 }, + { 2, char91_stroke2 }, + { 2, char91_stroke3 }, +}; + +/* char: 92 '\' */ + +static const CoordRec char92_stroke0[] = { + { 19.0476, 100 }, + { 85.7143, -14.2857 }, +}; + +static const StrokeRec char92[] = { + { 2, char92_stroke0 }, +}; + +/* char: 93 ']' */ + +static const CoordRec char93_stroke0[] = { + { 64.2857, 119.048 }, + { 64.2857, -33.3333 }, +}; + +static const CoordRec char93_stroke1[] = { + { 69.0476, 119.048 }, + { 69.0476, -33.3333 }, +}; + +static const CoordRec char93_stroke2[] = { + { 35.7143, 119.048 }, + { 69.0476, 119.048 }, +}; + +static const CoordRec char93_stroke3[] = { + { 35.7143, -33.3333 }, + { 69.0476, -33.3333 }, +}; + +static const StrokeRec char93[] = { + { 2, char93_stroke0 }, + { 2, char93_stroke1 }, + { 2, char93_stroke2 }, + { 2, char93_stroke3 }, +}; + +/* char: 94 '^' */ + +static const CoordRec char94_stroke0[] = { + { 52.3809, 109.524 }, + { 14.2857, 42.8571 }, +}; + +static const CoordRec char94_stroke1[] = { + { 52.3809, 109.524 }, + { 90.4762, 42.8571 }, +}; + +static const StrokeRec char94[] = { + { 2, char94_stroke0 }, + { 2, char94_stroke1 }, +}; + +/* char: 95 '_' */ + +static const CoordRec char95_stroke0[] = { + { 0, -33.3333 }, + { 104.762, -33.3333 }, + { 104.762, -28.5714 }, + { 0, -28.5714 }, + { 0, -33.3333 }, +}; + +static const StrokeRec char95[] = { + { 5, char95_stroke0 }, +}; + +/* char: 96 '`' */ + +static const CoordRec char96_stroke0[] = { + { 42.8572, 100 }, + { 66.6667, 71.4286 }, +}; + +static const CoordRec char96_stroke1[] = { + { 42.8572, 100 }, + { 38.0953, 95.2381 }, + { 66.6667, 71.4286 }, +}; + +static const StrokeRec char96[] = { + { 2, char96_stroke0 }, + { 3, char96_stroke1 }, +}; + +/* char: 97 'a' */ + +static const CoordRec char97_stroke0[] = { + { 80.9524, 66.6667 }, + { 80.9524, 0 }, +}; + +static const CoordRec char97_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char97[] = { + { 2, char97_stroke0 }, + { 14, char97_stroke1 }, +}; + +/* char: 98 'b' */ + +static const CoordRec char98_stroke0[] = { + { 23.8095, 100 }, + { 23.8095, 0 }, +}; + +static const CoordRec char98_stroke1[] = { + { 23.8095, 52.381 }, + { 33.3333, 61.9048 }, + { 42.8571, 66.6667 }, + { 57.1428, 66.6667 }, + { 66.6666, 61.9048 }, + { 76.1905, 52.381 }, + { 80.9524, 38.0952 }, + { 80.9524, 28.5714 }, + { 76.1905, 14.2857 }, + { 66.6666, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 33.3333, 4.7619 }, + { 23.8095, 14.2857 }, +}; + +static const StrokeRec char98[] = { + { 2, char98_stroke0 }, + { 14, char98_stroke1 }, +}; + +/* char: 99 'c' */ + +static const CoordRec char99_stroke0[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char99[] = { + { 14, char99_stroke0 }, +}; + +/* char: 100 'd' */ + +static const CoordRec char100_stroke0[] = { + { 80.9524, 100 }, + { 80.9524, 0 }, +}; + +static const CoordRec char100_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char100[] = { + { 2, char100_stroke0 }, + { 14, char100_stroke1 }, +}; + +/* char: 101 'e' */ + +static const CoordRec char101_stroke0[] = { + { 23.8095, 38.0952 }, + { 80.9524, 38.0952 }, + { 80.9524, 47.619 }, + { 76.1905, 57.1429 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char101[] = { + { 17, char101_stroke0 }, +}; + +/* char: 102 'f' */ + +static const CoordRec char102_stroke0[] = { + { 71.4286, 100 }, + { 61.9048, 100 }, + { 52.381, 95.2381 }, + { 47.6191, 80.9524 }, + { 47.6191, 0 }, +}; + +static const CoordRec char102_stroke1[] = { + { 33.3334, 66.6667 }, + { 66.6667, 66.6667 }, +}; + +static const StrokeRec char102[] = { + { 5, char102_stroke0 }, + { 2, char102_stroke1 }, +}; + +/* char: 103 'g' */ + +static const CoordRec char103_stroke0[] = { + { 80.9524, 66.6667 }, + { 80.9524, -9.5238 }, + { 76.1905, -23.8095 }, + { 71.4285, -28.5714 }, + { 61.9047, -33.3333 }, + { 47.619, -33.3333 }, + { 38.0952, -28.5714 }, +}; + +static const CoordRec char103_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char103[] = { + { 7, char103_stroke0 }, + { 14, char103_stroke1 }, +}; + +/* char: 104 'h' */ + +static const CoordRec char104_stroke0[] = { + { 26.1905, 100 }, + { 26.1905, 0 }, +}; + +static const CoordRec char104_stroke1[] = { + { 26.1905, 47.619 }, + { 40.4762, 61.9048 }, + { 50, 66.6667 }, + { 64.2857, 66.6667 }, + { 73.8095, 61.9048 }, + { 78.5715, 47.619 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char104[] = { + { 2, char104_stroke0 }, + { 7, char104_stroke1 }, +}; + +/* char: 105 'i' */ + +static const CoordRec char105_stroke0[] = { + { 47.6191, 100 }, + { 52.381, 95.2381 }, + { 57.1429, 100 }, + { 52.381, 104.762 }, + { 47.6191, 100 }, +}; + +static const CoordRec char105_stroke1[] = { + { 52.381, 66.6667 }, + { 52.381, 0 }, +}; + +static const StrokeRec char105[] = { + { 5, char105_stroke0 }, + { 2, char105_stroke1 }, +}; + +/* char: 106 'j' */ + +static const CoordRec char106_stroke0[] = { + { 57.1429, 100 }, + { 61.9048, 95.2381 }, + { 66.6667, 100 }, + { 61.9048, 104.762 }, + { 57.1429, 100 }, +}; + +static const CoordRec char106_stroke1[] = { + { 61.9048, 66.6667 }, + { 61.9048, -14.2857 }, + { 57.1429, -28.5714 }, + { 47.6191, -33.3333 }, + { 38.0953, -33.3333 }, +}; + +static const StrokeRec char106[] = { + { 5, char106_stroke0 }, + { 5, char106_stroke1 }, +}; + +/* char: 107 'k' */ + +static const CoordRec char107_stroke0[] = { + { 26.1905, 100 }, + { 26.1905, 0 }, +}; + +static const CoordRec char107_stroke1[] = { + { 73.8095, 66.6667 }, + { 26.1905, 19.0476 }, +}; + +static const CoordRec char107_stroke2[] = { + { 45.2381, 38.0952 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char107[] = { + { 2, char107_stroke0 }, + { 2, char107_stroke1 }, + { 2, char107_stroke2 }, +}; + +/* char: 108 'l' */ + +static const CoordRec char108_stroke0[] = { + { 52.381, 100 }, + { 52.381, 0 }, +}; + +static const StrokeRec char108[] = { + { 2, char108_stroke0 }, +}; + +/* char: 109 'm' */ + +static const CoordRec char109_stroke0[] = { + { 0, 66.6667 }, + { 0, 0 }, +}; + +static const CoordRec char109_stroke1[] = { + { 0, 47.619 }, + { 14.2857, 61.9048 }, + { 23.8095, 66.6667 }, + { 38.0952, 66.6667 }, + { 47.619, 61.9048 }, + { 52.381, 47.619 }, + { 52.381, 0 }, +}; + +static const CoordRec char109_stroke2[] = { + { 52.381, 47.619 }, + { 66.6667, 61.9048 }, + { 76.1905, 66.6667 }, + { 90.4762, 66.6667 }, + { 100, 61.9048 }, + { 104.762, 47.619 }, + { 104.762, 0 }, +}; + +static const StrokeRec char109[] = { + { 2, char109_stroke0 }, + { 7, char109_stroke1 }, + { 7, char109_stroke2 }, +}; + +/* char: 110 'n' */ + +static const CoordRec char110_stroke0[] = { + { 26.1905, 66.6667 }, + { 26.1905, 0 }, +}; + +static const CoordRec char110_stroke1[] = { + { 26.1905, 47.619 }, + { 40.4762, 61.9048 }, + { 50, 66.6667 }, + { 64.2857, 66.6667 }, + { 73.8095, 61.9048 }, + { 78.5715, 47.619 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char110[] = { + { 2, char110_stroke0 }, + { 7, char110_stroke1 }, +}; + +/* char: 111 'o' */ + +static const CoordRec char111_stroke0[] = { + { 45.2381, 66.6667 }, + { 35.7143, 61.9048 }, + { 26.1905, 52.381 }, + { 21.4286, 38.0952 }, + { 21.4286, 28.5714 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 45.2381, 0 }, + { 59.5238, 0 }, + { 69.0476, 4.7619 }, + { 78.5714, 14.2857 }, + { 83.3334, 28.5714 }, + { 83.3334, 38.0952 }, + { 78.5714, 52.381 }, + { 69.0476, 61.9048 }, + { 59.5238, 66.6667 }, + { 45.2381, 66.6667 }, +}; + +static const StrokeRec char111[] = { + { 17, char111_stroke0 }, +}; + +/* char: 112 'p' */ + +static const CoordRec char112_stroke0[] = { + { 23.8095, 66.6667 }, + { 23.8095, -33.3333 }, +}; + +static const CoordRec char112_stroke1[] = { + { 23.8095, 52.381 }, + { 33.3333, 61.9048 }, + { 42.8571, 66.6667 }, + { 57.1428, 66.6667 }, + { 66.6666, 61.9048 }, + { 76.1905, 52.381 }, + { 80.9524, 38.0952 }, + { 80.9524, 28.5714 }, + { 76.1905, 14.2857 }, + { 66.6666, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 33.3333, 4.7619 }, + { 23.8095, 14.2857 }, +}; + +static const StrokeRec char112[] = { + { 2, char112_stroke0 }, + { 14, char112_stroke1 }, +}; + +/* char: 113 'q' */ + +static const CoordRec char113_stroke0[] = { + { 80.9524, 66.6667 }, + { 80.9524, -33.3333 }, +}; + +static const CoordRec char113_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char113[] = { + { 2, char113_stroke0 }, + { 14, char113_stroke1 }, +}; + +/* char: 114 'r' */ + +static const CoordRec char114_stroke0[] = { + { 33.3334, 66.6667 }, + { 33.3334, 0 }, +}; + +static const CoordRec char114_stroke1[] = { + { 33.3334, 38.0952 }, + { 38.0953, 52.381 }, + { 47.6191, 61.9048 }, + { 57.1429, 66.6667 }, + { 71.4286, 66.6667 }, +}; + +static const StrokeRec char114[] = { + { 2, char114_stroke0 }, + { 5, char114_stroke1 }, +}; + +/* char: 115 's' */ + +static const CoordRec char115_stroke0[] = { + { 78.5715, 52.381 }, + { 73.8095, 61.9048 }, + { 59.5238, 66.6667 }, + { 45.2381, 66.6667 }, + { 30.9524, 61.9048 }, + { 26.1905, 52.381 }, + { 30.9524, 42.8571 }, + { 40.4762, 38.0952 }, + { 64.2857, 33.3333 }, + { 73.8095, 28.5714 }, + { 78.5715, 19.0476 }, + { 78.5715, 14.2857 }, + { 73.8095, 4.7619 }, + { 59.5238, 0 }, + { 45.2381, 0 }, + { 30.9524, 4.7619 }, + { 26.1905, 14.2857 }, +}; + +static const StrokeRec char115[] = { + { 17, char115_stroke0 }, +}; + +/* char: 116 't' */ + +static const CoordRec char116_stroke0[] = { + { 47.6191, 100 }, + { 47.6191, 19.0476 }, + { 52.381, 4.7619 }, + { 61.9048, 0 }, + { 71.4286, 0 }, +}; + +static const CoordRec char116_stroke1[] = { + { 33.3334, 66.6667 }, + { 66.6667, 66.6667 }, +}; + +static const StrokeRec char116[] = { + { 5, char116_stroke0 }, + { 2, char116_stroke1 }, +}; + +/* char: 117 'u' */ + +static const CoordRec char117_stroke0[] = { + { 26.1905, 66.6667 }, + { 26.1905, 19.0476 }, + { 30.9524, 4.7619 }, + { 40.4762, 0 }, + { 54.7619, 0 }, + { 64.2857, 4.7619 }, + { 78.5715, 19.0476 }, +}; + +static const CoordRec char117_stroke1[] = { + { 78.5715, 66.6667 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char117[] = { + { 7, char117_stroke0 }, + { 2, char117_stroke1 }, +}; + +/* char: 118 'v' */ + +static const CoordRec char118_stroke0[] = { + { 23.8095, 66.6667 }, + { 52.3809, 0 }, +}; + +static const CoordRec char118_stroke1[] = { + { 80.9524, 66.6667 }, + { 52.3809, 0 }, +}; + +static const StrokeRec char118[] = { + { 2, char118_stroke0 }, + { 2, char118_stroke1 }, +}; + +/* char: 119 'w' */ + +static const CoordRec char119_stroke0[] = { + { 14.2857, 66.6667 }, + { 33.3333, 0 }, +}; + +static const CoordRec char119_stroke1[] = { + { 52.3809, 66.6667 }, + { 33.3333, 0 }, +}; + +static const CoordRec char119_stroke2[] = { + { 52.3809, 66.6667 }, + { 71.4286, 0 }, +}; + +static const CoordRec char119_stroke3[] = { + { 90.4762, 66.6667 }, + { 71.4286, 0 }, +}; + +static const StrokeRec char119[] = { + { 2, char119_stroke0 }, + { 2, char119_stroke1 }, + { 2, char119_stroke2 }, + { 2, char119_stroke3 }, +}; + +/* char: 120 'x' */ + +static const CoordRec char120_stroke0[] = { + { 26.1905, 66.6667 }, + { 78.5715, 0 }, +}; + +static const CoordRec char120_stroke1[] = { + { 78.5715, 66.6667 }, + { 26.1905, 0 }, +}; + +static const StrokeRec char120[] = { + { 2, char120_stroke0 }, + { 2, char120_stroke1 }, +}; + +/* char: 121 'y' */ + +static const CoordRec char121_stroke0[] = { + { 26.1905, 66.6667 }, + { 54.7619, 0 }, +}; + +static const CoordRec char121_stroke1[] = { + { 83.3334, 66.6667 }, + { 54.7619, 0 }, + { 45.2381, -19.0476 }, + { 35.7143, -28.5714 }, + { 26.1905, -33.3333 }, + { 21.4286, -33.3333 }, +}; + +static const StrokeRec char121[] = { + { 2, char121_stroke0 }, + { 6, char121_stroke1 }, +}; + +/* char: 122 'z' */ + +static const CoordRec char122_stroke0[] = { + { 78.5715, 66.6667 }, + { 26.1905, 0 }, +}; + +static const CoordRec char122_stroke1[] = { + { 26.1905, 66.6667 }, + { 78.5715, 66.6667 }, +}; + +static const CoordRec char122_stroke2[] = { + { 26.1905, 0 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char122[] = { + { 2, char122_stroke0 }, + { 2, char122_stroke1 }, + { 2, char122_stroke2 }, +}; + +/* char: 123 '{' */ + +static const CoordRec char123_stroke0[] = { + { 64.2857, 119.048 }, + { 54.7619, 114.286 }, + { 50, 109.524 }, + { 45.2381, 100 }, + { 45.2381, 90.4762 }, + { 50, 80.9524 }, + { 54.7619, 76.1905 }, + { 59.5238, 66.6667 }, + { 59.5238, 57.1429 }, + { 50, 47.619 }, +}; + +static const CoordRec char123_stroke1[] = { + { 54.7619, 114.286 }, + { 50, 104.762 }, + { 50, 95.2381 }, + { 54.7619, 85.7143 }, + { 59.5238, 80.9524 }, + { 64.2857, 71.4286 }, + { 64.2857, 61.9048 }, + { 59.5238, 52.381 }, + { 40.4762, 42.8571 }, + { 59.5238, 33.3333 }, + { 64.2857, 23.8095 }, + { 64.2857, 14.2857 }, + { 59.5238, 4.7619 }, + { 54.7619, 0 }, + { 50, -9.5238 }, + { 50, -19.0476 }, + { 54.7619, -28.5714 }, +}; + +static const CoordRec char123_stroke2[] = { + { 50, 38.0952 }, + { 59.5238, 28.5714 }, + { 59.5238, 19.0476 }, + { 54.7619, 9.5238 }, + { 50, 4.7619 }, + { 45.2381, -4.7619 }, + { 45.2381, -14.2857 }, + { 50, -23.8095 }, + { 54.7619, -28.5714 }, + { 64.2857, -33.3333 }, +}; + +static const StrokeRec char123[] = { + { 10, char123_stroke0 }, + { 17, char123_stroke1 }, + { 10, char123_stroke2 }, +}; + +/* char: 124 '|' */ + +static const CoordRec char124_stroke0[] = { + { 52.381, 119.048 }, + { 52.381, -33.3333 }, +}; + +static const StrokeRec char124[] = { + { 2, char124_stroke0 }, +}; + +/* char: 125 '}' */ + +static const CoordRec char125_stroke0[] = { + { 40.4762, 119.048 }, + { 50, 114.286 }, + { 54.7619, 109.524 }, + { 59.5238, 100 }, + { 59.5238, 90.4762 }, + { 54.7619, 80.9524 }, + { 50, 76.1905 }, + { 45.2381, 66.6667 }, + { 45.2381, 57.1429 }, + { 54.7619, 47.619 }, +}; + +static const CoordRec char125_stroke1[] = { + { 50, 114.286 }, + { 54.7619, 104.762 }, + { 54.7619, 95.2381 }, + { 50, 85.7143 }, + { 45.2381, 80.9524 }, + { 40.4762, 71.4286 }, + { 40.4762, 61.9048 }, + { 45.2381, 52.381 }, + { 64.2857, 42.8571 }, + { 45.2381, 33.3333 }, + { 40.4762, 23.8095 }, + { 40.4762, 14.2857 }, + { 45.2381, 4.7619 }, + { 50, 0 }, + { 54.7619, -9.5238 }, + { 54.7619, -19.0476 }, + { 50, -28.5714 }, +}; + +static const CoordRec char125_stroke2[] = { + { 54.7619, 38.0952 }, + { 45.2381, 28.5714 }, + { 45.2381, 19.0476 }, + { 50, 9.5238 }, + { 54.7619, 4.7619 }, + { 59.5238, -4.7619 }, + { 59.5238, -14.2857 }, + { 54.7619, -23.8095 }, + { 50, -28.5714 }, + { 40.4762, -33.3333 }, +}; + +static const StrokeRec char125[] = { + { 10, char125_stroke0 }, + { 17, char125_stroke1 }, + { 10, char125_stroke2 }, +}; + +/* char: 126 '~' */ + +static const CoordRec char126_stroke0[] = { + { 9.5238, 28.5714 }, + { 9.5238, 38.0952 }, + { 14.2857, 52.381 }, + { 23.8095, 57.1429 }, + { 33.3333, 57.1429 }, + { 42.8571, 52.381 }, + { 61.9048, 38.0952 }, + { 71.4286, 33.3333 }, + { 80.9524, 33.3333 }, + { 90.4762, 38.0952 }, + { 95.2381, 47.619 }, +}; + +static const CoordRec char126_stroke1[] = { + { 9.5238, 38.0952 }, + { 14.2857, 47.619 }, + { 23.8095, 52.381 }, + { 33.3333, 52.381 }, + { 42.8571, 47.619 }, + { 61.9048, 33.3333 }, + { 71.4286, 28.5714 }, + { 80.9524, 28.5714 }, + { 90.4762, 33.3333 }, + { 95.2381, 47.619 }, + { 95.2381, 57.1429 }, +}; + +static const StrokeRec char126[] = { + { 11, char126_stroke0 }, + { 11, char126_stroke1 }, +}; + +/* char: 127 */ + +static const CoordRec char127_stroke0[] = { + { 71.4286, 100 }, + { 33.3333, -33.3333 }, +}; + +static const CoordRec char127_stroke1[] = { + { 47.619, 66.6667 }, + { 33.3333, 61.9048 }, + { 23.8095, 52.381 }, + { 19.0476, 38.0952 }, + { 19.0476, 23.8095 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 47.619, 0 }, + { 57.1428, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 28.5714 }, + { 85.7143, 42.8571 }, + { 80.9524, 52.381 }, + { 71.4286, 61.9048 }, + { 57.1428, 66.6667 }, + { 47.619, 66.6667 }, +}; + +static const StrokeRec char127[] = { + { 2, char127_stroke0 }, + { 17, char127_stroke1 }, +}; + +static const StrokeCharRec chars[] = { + { 0, /* char0 */ 0, 0, 0 }, + { 0, /* char1 */ 0, 0, 0 }, + { 0, /* char2 */ 0, 0, 0 }, + { 0, /* char3 */ 0, 0, 0 }, + { 0, /* char4 */ 0, 0, 0 }, + { 0, /* char5 */ 0, 0, 0 }, + { 0, /* char6 */ 0, 0, 0 }, + { 0, /* char7 */ 0, 0, 0 }, + { 0, /* char8 */ 0, 0, 0 }, + { 0, /* char9 */ 0, 0, 0 }, + { 0, /* char10 */ 0, 0, 0 }, + { 0, /* char11 */ 0, 0, 0 }, + { 0, /* char12 */ 0, 0, 0 }, + { 0, /* char13 */ 0, 0, 0 }, + { 0, /* char14 */ 0, 0, 0 }, + { 0, /* char15 */ 0, 0, 0 }, + { 0, /* char16 */ 0, 0, 0 }, + { 0, /* char17 */ 0, 0, 0 }, + { 0, /* char18 */ 0, 0, 0 }, + { 0, /* char19 */ 0, 0, 0 }, + { 0, /* char20 */ 0, 0, 0 }, + { 0, /* char21 */ 0, 0, 0 }, + { 0, /* char22 */ 0, 0, 0 }, + { 0, /* char23 */ 0, 0, 0 }, + { 0, /* char24 */ 0, 0, 0 }, + { 0, /* char25 */ 0, 0, 0 }, + { 0, /* char26 */ 0, 0, 0 }, + { 0, /* char27 */ 0, 0, 0 }, + { 0, /* char28 */ 0, 0, 0 }, + { 0, /* char29 */ 0, 0, 0 }, + { 0, /* char30 */ 0, 0, 0 }, + { 0, /* char31 */ 0, 0, 0 }, + { 0, /* char32 */ 0, 52.381, 104.762 }, + { 2, char33, 52.381, 104.762 }, + { 2, char34, 52.381, 104.762 }, + { 4, char35, 52.381, 104.762 }, + { 3, char36, 52.381, 104.762 }, + { 3, char37, 52.381, 104.762 }, + { 1, char38, 52.381, 104.762 }, + { 1, char39, 52.381, 104.762 }, + { 1, char40, 52.381, 104.762 }, + { 1, char41, 52.381, 104.762 }, + { 3, char42, 52.381, 104.762 }, + { 2, char43, 52.381, 104.762 }, + { 1, char44, 52.381, 104.762 }, + { 1, char45, 52.381, 104.762 }, + { 1, char46, 52.381, 104.762 }, + { 1, char47, 52.381, 104.762 }, + { 1, char48, 52.381, 104.762 }, + { 1, char49, 52.381, 104.762 }, + { 1, char50, 52.381, 104.762 }, + { 1, char51, 52.381, 104.762 }, + { 2, char52, 52.381, 104.762 }, + { 1, char53, 52.381, 104.762 }, + { 1, char54, 52.381, 104.762 }, + { 2, char55, 52.381, 104.762 }, + { 1, char56, 52.381, 104.762 }, + { 1, char57, 52.381, 104.762 }, + { 2, char58, 52.381, 104.762 }, + { 2, char59, 52.381, 104.762 }, + { 1, char60, 52.381, 104.762 }, + { 2, char61, 52.381, 104.762 }, + { 1, char62, 52.381, 104.762 }, + { 2, char63, 52.381, 104.762 }, + { 2, char64, 52.381, 104.762 }, + { 3, char65, 52.381, 104.762 }, + { 3, char66, 52.381, 104.762 }, + { 1, char67, 52.381, 104.762 }, + { 2, char68, 52.381, 104.762 }, + { 4, char69, 52.381, 104.762 }, + { 3, char70, 52.381, 104.762 }, + { 2, char71, 52.381, 104.762 }, + { 3, char72, 52.381, 104.762 }, + { 1, char73, 52.381, 104.762 }, + { 1, char74, 52.381, 104.762 }, + { 3, char75, 52.381, 104.762 }, + { 2, char76, 52.381, 104.762 }, + { 4, char77, 52.381, 104.762 }, + { 3, char78, 52.381, 104.762 }, + { 1, char79, 52.381, 104.762 }, + { 2, char80, 52.381, 104.762 }, + { 2, char81, 52.381, 104.762 }, + { 3, char82, 52.381, 104.762 }, + { 1, char83, 52.381, 104.762 }, + { 2, char84, 52.381, 104.762 }, + { 1, char85, 52.381, 104.762 }, + { 2, char86, 52.381, 104.762 }, + { 4, char87, 52.381, 104.762 }, + { 2, char88, 52.381, 104.762 }, + { 2, char89, 52.381, 104.762 }, + { 3, char90, 52.381, 104.762 }, + { 4, char91, 52.381, 104.762 }, + { 1, char92, 52.381, 104.762 }, + { 4, char93, 52.381, 104.762 }, + { 2, char94, 52.381, 104.762 }, + { 1, char95, 52.381, 104.762 }, + { 2, char96, 52.381, 104.762 }, + { 2, char97, 52.381, 104.762 }, + { 2, char98, 52.381, 104.762 }, + { 1, char99, 52.381, 104.762 }, + { 2, char100, 52.381, 104.762 }, + { 1, char101, 52.381, 104.762 }, + { 2, char102, 52.381, 104.762 }, + { 2, char103, 52.381, 104.762 }, + { 2, char104, 52.381, 104.762 }, + { 2, char105, 52.381, 104.762 }, + { 2, char106, 52.381, 104.762 }, + { 3, char107, 52.381, 104.762 }, + { 1, char108, 52.381, 104.762 }, + { 3, char109, 52.381, 104.762 }, + { 2, char110, 52.381, 104.762 }, + { 1, char111, 52.381, 104.762 }, + { 2, char112, 52.381, 104.762 }, + { 2, char113, 52.381, 104.762 }, + { 2, char114, 52.381, 104.762 }, + { 1, char115, 52.381, 104.762 }, + { 2, char116, 52.381, 104.762 }, + { 2, char117, 52.381, 104.762 }, + { 2, char118, 52.381, 104.762 }, + { 4, char119, 52.381, 104.762 }, + { 2, char120, 52.381, 104.762 }, + { 2, char121, 52.381, 104.762 }, + { 3, char122, 52.381, 104.762 }, + { 3, char123, 52.381, 104.762 }, + { 1, char124, 52.381, 104.762 }, + { 3, char125, 52.381, 104.762 }, + { 2, char126, 52.381, 104.762 }, + { 2, char127, 52.381, 104.762 }, +}; + +StrokeFontRec glutStrokeMonoRoman = { "Roman", 128, chars, 119.048, -33.3333 }; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutOverlay.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutOverlay.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutOverlay.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutOverlay.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,47 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutOverlay.cpp + * + * DESCRIPTION: we don't support overlays, so this code is + * really simple + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include "glutint.h" + +void glutEstablishOverlay() { + __glutFatalError("BeOS lacks overlay support."); +} + +void glutUseLayer(GLenum layer) { + // ignore +} + +void glutRemoveOverlay() { + // ignore +} + +void glutPostOverlayRedisplay() { + // ignore +} + +void glutShowOverlay() { + // ignore +} + +void glutHideOverlay() { + // ignore +} + +void glutPostWindowOverlayRedisplay(int win) { + // ignore +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_roman.c xpsb-glx-0.19/mesa/src/glut/beos/glut_roman.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_roman.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_roman.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2451 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "glutstroke.h" + +/* char: 33 '!' */ + +static const CoordRec char33_stroke0[] = { + { 13.3819, 100 }, + { 13.3819, 33.3333 }, +}; + +static const CoordRec char33_stroke1[] = { + { 13.3819, 9.5238 }, + { 8.62, 4.7619 }, + { 13.3819, 0 }, + { 18.1438, 4.7619 }, + { 13.3819, 9.5238 }, +}; + +static const StrokeRec char33[] = { + { 2, char33_stroke0 }, + { 5, char33_stroke1 }, +}; + +/* char: 34 '"' */ + +static const CoordRec char34_stroke0[] = { + { 4.02, 100 }, + { 4.02, 66.6667 }, +}; + +static const CoordRec char34_stroke1[] = { + { 42.1152, 100 }, + { 42.1152, 66.6667 }, +}; + +static const StrokeRec char34[] = { + { 2, char34_stroke0 }, + { 2, char34_stroke1 }, +}; + +/* char: 35 '#' */ + +static const CoordRec char35_stroke0[] = { + { 41.2952, 119.048 }, + { 7.9619, -33.3333 }, +}; + +static const CoordRec char35_stroke1[] = { + { 69.8667, 119.048 }, + { 36.5333, -33.3333 }, +}; + +static const CoordRec char35_stroke2[] = { + { 7.9619, 57.1429 }, + { 74.6286, 57.1429 }, +}; + +static const CoordRec char35_stroke3[] = { + { 3.2, 28.5714 }, + { 69.8667, 28.5714 }, +}; + +static const StrokeRec char35[] = { + { 2, char35_stroke0 }, + { 2, char35_stroke1 }, + { 2, char35_stroke2 }, + { 2, char35_stroke3 }, +}; + +/* char: 36 '$' */ + +static const CoordRec char36_stroke0[] = { + { 28.6295, 119.048 }, + { 28.6295, -19.0476 }, +}; + +static const CoordRec char36_stroke1[] = { + { 47.6771, 119.048 }, + { 47.6771, -19.0476 }, +}; + +static const CoordRec char36_stroke2[] = { + { 71.4867, 85.7143 }, + { 61.9629, 95.2381 }, + { 47.6771, 100 }, + { 28.6295, 100 }, + { 14.3438, 95.2381 }, + { 4.82, 85.7143 }, + { 4.82, 76.1905 }, + { 9.5819, 66.6667 }, + { 14.3438, 61.9048 }, + { 23.8676, 57.1429 }, + { 52.439, 47.619 }, + { 61.9629, 42.8571 }, + { 66.7248, 38.0952 }, + { 71.4867, 28.5714 }, + { 71.4867, 14.2857 }, + { 61.9629, 4.7619 }, + { 47.6771, 0 }, + { 28.6295, 0 }, + { 14.3438, 4.7619 }, + { 4.82, 14.2857 }, +}; + +static const StrokeRec char36[] = { + { 2, char36_stroke0 }, + { 2, char36_stroke1 }, + { 20, char36_stroke2 }, +}; + +/* char: 37 '%' */ + +static const CoordRec char37_stroke0[] = { + { 92.0743, 100 }, + { 6.36, 0 }, +}; + +static const CoordRec char37_stroke1[] = { + { 30.1695, 100 }, + { 39.6933, 90.4762 }, + { 39.6933, 80.9524 }, + { 34.9314, 71.4286 }, + { 25.4076, 66.6667 }, + { 15.8838, 66.6667 }, + { 6.36, 76.1905 }, + { 6.36, 85.7143 }, + { 11.1219, 95.2381 }, + { 20.6457, 100 }, + { 30.1695, 100 }, + { 39.6933, 95.2381 }, + { 53.979, 90.4762 }, + { 68.2648, 90.4762 }, + { 82.5505, 95.2381 }, + { 92.0743, 100 }, +}; + +static const CoordRec char37_stroke2[] = { + { 73.0267, 33.3333 }, + { 63.5029, 28.5714 }, + { 58.741, 19.0476 }, + { 58.741, 9.5238 }, + { 68.2648, 0 }, + { 77.7886, 0 }, + { 87.3124, 4.7619 }, + { 92.0743, 14.2857 }, + { 92.0743, 23.8095 }, + { 82.5505, 33.3333 }, + { 73.0267, 33.3333 }, +}; + +static const StrokeRec char37[] = { + { 2, char37_stroke0 }, + { 16, char37_stroke1 }, + { 11, char37_stroke2 }, +}; + +/* char: 38 '&' */ + +static const CoordRec char38_stroke0[] = { + { 101.218, 57.1429 }, + { 101.218, 61.9048 }, + { 96.4562, 66.6667 }, + { 91.6943, 66.6667 }, + { 86.9324, 61.9048 }, + { 82.1705, 52.381 }, + { 72.6467, 28.5714 }, + { 63.1229, 14.2857 }, + { 53.599, 4.7619 }, + { 44.0752, 0 }, + { 25.0276, 0 }, + { 15.5038, 4.7619 }, + { 10.7419, 9.5238 }, + { 5.98, 19.0476 }, + { 5.98, 28.5714 }, + { 10.7419, 38.0952 }, + { 15.5038, 42.8571 }, + { 48.8371, 61.9048 }, + { 53.599, 66.6667 }, + { 58.361, 76.1905 }, + { 58.361, 85.7143 }, + { 53.599, 95.2381 }, + { 44.0752, 100 }, + { 34.5514, 95.2381 }, + { 29.7895, 85.7143 }, + { 29.7895, 76.1905 }, + { 34.5514, 61.9048 }, + { 44.0752, 47.619 }, + { 67.8848, 14.2857 }, + { 77.4086, 4.7619 }, + { 86.9324, 0 }, + { 96.4562, 0 }, + { 101.218, 4.7619 }, + { 101.218, 9.5238 }, +}; + +static const StrokeRec char38[] = { + { 34, char38_stroke0 }, +}; + +/* char: 39 ''' */ + +static const CoordRec char39_stroke0[] = { + { 4.44, 100 }, + { 4.44, 66.6667 }, +}; + +static const StrokeRec char39[] = { + { 2, char39_stroke0 }, +}; + +/* char: 40 '(' */ + +static const CoordRec char40_stroke0[] = { + { 40.9133, 119.048 }, + { 31.3895, 109.524 }, + { 21.8657, 95.2381 }, + { 12.3419, 76.1905 }, + { 7.58, 52.381 }, + { 7.58, 33.3333 }, + { 12.3419, 9.5238 }, + { 21.8657, -9.5238 }, + { 31.3895, -23.8095 }, + { 40.9133, -33.3333 }, +}; + +static const StrokeRec char40[] = { + { 10, char40_stroke0 }, +}; + +/* char: 41 ')' */ + +static const CoordRec char41_stroke0[] = { + { 5.28, 119.048 }, + { 14.8038, 109.524 }, + { 24.3276, 95.2381 }, + { 33.8514, 76.1905 }, + { 38.6133, 52.381 }, + { 38.6133, 33.3333 }, + { 33.8514, 9.5238 }, + { 24.3276, -9.5238 }, + { 14.8038, -23.8095 }, + { 5.28, -33.3333 }, +}; + +static const StrokeRec char41[] = { + { 10, char41_stroke0 }, +}; + +/* char: 42 '*' */ + +static const CoordRec char42_stroke0[] = { + { 30.7695, 71.4286 }, + { 30.7695, 14.2857 }, +}; + +static const CoordRec char42_stroke1[] = { + { 6.96, 57.1429 }, + { 54.579, 28.5714 }, +}; + +static const CoordRec char42_stroke2[] = { + { 54.579, 57.1429 }, + { 6.96, 28.5714 }, +}; + +static const StrokeRec char42[] = { + { 2, char42_stroke0 }, + { 2, char42_stroke1 }, + { 2, char42_stroke2 }, +}; + +/* char: 43 '+' */ + +static const CoordRec char43_stroke0[] = { + { 48.8371, 85.7143 }, + { 48.8371, 0 }, +}; + +static const CoordRec char43_stroke1[] = { + { 5.98, 42.8571 }, + { 91.6943, 42.8571 }, +}; + +static const StrokeRec char43[] = { + { 2, char43_stroke0 }, + { 2, char43_stroke1 }, +}; + +/* char: 44 ',' */ + +static const CoordRec char44_stroke0[] = { + { 18.2838, 4.7619 }, + { 13.5219, 0 }, + { 8.76, 4.7619 }, + { 13.5219, 9.5238 }, + { 18.2838, 4.7619 }, + { 18.2838, -4.7619 }, + { 13.5219, -14.2857 }, + { 8.76, -19.0476 }, +}; + +static const StrokeRec char44[] = { + { 8, char44_stroke0 }, +}; + +/* char: 45 '-' */ + +static const CoordRec char45_stroke0[] = { + { 7.38, 42.8571 }, + { 93.0943, 42.8571 }, +}; + +static const StrokeRec char45[] = { + { 2, char45_stroke0 }, +}; + +/* char: 46 '.' */ + +static const CoordRec char46_stroke0[] = { + { 13.1019, 9.5238 }, + { 8.34, 4.7619 }, + { 13.1019, 0 }, + { 17.8638, 4.7619 }, + { 13.1019, 9.5238 }, +}; + +static const StrokeRec char46[] = { + { 5, char46_stroke0 }, +}; + +/* char: 47 '/' */ + +static const CoordRec char47_stroke0[] = { + { 7.24, -14.2857 }, + { 73.9067, 100 }, +}; + +static const StrokeRec char47[] = { + { 2, char47_stroke0 }, +}; + +/* char: 48 '0' */ + +static const CoordRec char48_stroke0[] = { + { 33.5514, 100 }, + { 19.2657, 95.2381 }, + { 9.7419, 80.9524 }, + { 4.98, 57.1429 }, + { 4.98, 42.8571 }, + { 9.7419, 19.0476 }, + { 19.2657, 4.7619 }, + { 33.5514, 0 }, + { 43.0752, 0 }, + { 57.361, 4.7619 }, + { 66.8848, 19.0476 }, + { 71.6467, 42.8571 }, + { 71.6467, 57.1429 }, + { 66.8848, 80.9524 }, + { 57.361, 95.2381 }, + { 43.0752, 100 }, + { 33.5514, 100 }, +}; + +static const StrokeRec char48[] = { + { 17, char48_stroke0 }, +}; + +/* char: 49 '1' */ + +static const CoordRec char49_stroke0[] = { + { 11.82, 80.9524 }, + { 21.3438, 85.7143 }, + { 35.6295, 100 }, + { 35.6295, 0 }, +}; + +static const StrokeRec char49[] = { + { 4, char49_stroke0 }, +}; + +/* char: 50 '2' */ + +static const CoordRec char50_stroke0[] = { + { 10.1819, 76.1905 }, + { 10.1819, 80.9524 }, + { 14.9438, 90.4762 }, + { 19.7057, 95.2381 }, + { 29.2295, 100 }, + { 48.2771, 100 }, + { 57.801, 95.2381 }, + { 62.5629, 90.4762 }, + { 67.3248, 80.9524 }, + { 67.3248, 71.4286 }, + { 62.5629, 61.9048 }, + { 53.039, 47.619 }, + { 5.42, 0 }, + { 72.0867, 0 }, +}; + +static const StrokeRec char50[] = { + { 14, char50_stroke0 }, +}; + +/* char: 51 '3' */ + +static const CoordRec char51_stroke0[] = { + { 14.5238, 100 }, + { 66.9048, 100 }, + { 38.3333, 61.9048 }, + { 52.619, 61.9048 }, + { 62.1429, 57.1429 }, + { 66.9048, 52.381 }, + { 71.6667, 38.0952 }, + { 71.6667, 28.5714 }, + { 66.9048, 14.2857 }, + { 57.381, 4.7619 }, + { 43.0952, 0 }, + { 28.8095, 0 }, + { 14.5238, 4.7619 }, + { 9.7619, 9.5238 }, + { 5, 19.0476 }, +}; + +static const StrokeRec char51[] = { + { 15, char51_stroke0 }, +}; + +/* char: 52 '4' */ + +static const CoordRec char52_stroke0[] = { + { 51.499, 100 }, + { 3.88, 33.3333 }, + { 75.3086, 33.3333 }, +}; + +static const CoordRec char52_stroke1[] = { + { 51.499, 100 }, + { 51.499, 0 }, +}; + +static const StrokeRec char52[] = { + { 3, char52_stroke0 }, + { 2, char52_stroke1 }, +}; + +/* char: 53 '5' */ + +static const CoordRec char53_stroke0[] = { + { 62.0029, 100 }, + { 14.3838, 100 }, + { 9.6219, 57.1429 }, + { 14.3838, 61.9048 }, + { 28.6695, 66.6667 }, + { 42.9552, 66.6667 }, + { 57.241, 61.9048 }, + { 66.7648, 52.381 }, + { 71.5267, 38.0952 }, + { 71.5267, 28.5714 }, + { 66.7648, 14.2857 }, + { 57.241, 4.7619 }, + { 42.9552, 0 }, + { 28.6695, 0 }, + { 14.3838, 4.7619 }, + { 9.6219, 9.5238 }, + { 4.86, 19.0476 }, +}; + +static const StrokeRec char53[] = { + { 17, char53_stroke0 }, +}; + +/* char: 54 '6' */ + +static const CoordRec char54_stroke0[] = { + { 62.7229, 85.7143 }, + { 57.961, 95.2381 }, + { 43.6752, 100 }, + { 34.1514, 100 }, + { 19.8657, 95.2381 }, + { 10.3419, 80.9524 }, + { 5.58, 57.1429 }, + { 5.58, 33.3333 }, + { 10.3419, 14.2857 }, + { 19.8657, 4.7619 }, + { 34.1514, 0 }, + { 38.9133, 0 }, + { 53.199, 4.7619 }, + { 62.7229, 14.2857 }, + { 67.4848, 28.5714 }, + { 67.4848, 33.3333 }, + { 62.7229, 47.619 }, + { 53.199, 57.1429 }, + { 38.9133, 61.9048 }, + { 34.1514, 61.9048 }, + { 19.8657, 57.1429 }, + { 10.3419, 47.619 }, + { 5.58, 33.3333 }, +}; + +static const StrokeRec char54[] = { + { 23, char54_stroke0 }, +}; + +/* char: 55 '7' */ + +static const CoordRec char55_stroke0[] = { + { 72.2267, 100 }, + { 24.6076, 0 }, +}; + +static const CoordRec char55_stroke1[] = { + { 5.56, 100 }, + { 72.2267, 100 }, +}; + +static const StrokeRec char55[] = { + { 2, char55_stroke0 }, + { 2, char55_stroke1 }, +}; + +/* char: 56 '8' */ + +static const CoordRec char56_stroke0[] = { + { 29.4095, 100 }, + { 15.1238, 95.2381 }, + { 10.3619, 85.7143 }, + { 10.3619, 76.1905 }, + { 15.1238, 66.6667 }, + { 24.6476, 61.9048 }, + { 43.6952, 57.1429 }, + { 57.981, 52.381 }, + { 67.5048, 42.8571 }, + { 72.2667, 33.3333 }, + { 72.2667, 19.0476 }, + { 67.5048, 9.5238 }, + { 62.7429, 4.7619 }, + { 48.4571, 0 }, + { 29.4095, 0 }, + { 15.1238, 4.7619 }, + { 10.3619, 9.5238 }, + { 5.6, 19.0476 }, + { 5.6, 33.3333 }, + { 10.3619, 42.8571 }, + { 19.8857, 52.381 }, + { 34.1714, 57.1429 }, + { 53.219, 61.9048 }, + { 62.7429, 66.6667 }, + { 67.5048, 76.1905 }, + { 67.5048, 85.7143 }, + { 62.7429, 95.2381 }, + { 48.4571, 100 }, + { 29.4095, 100 }, +}; + +static const StrokeRec char56[] = { + { 29, char56_stroke0 }, +}; + +/* char: 57 '9' */ + +static const CoordRec char57_stroke0[] = { + { 68.5048, 66.6667 }, + { 63.7429, 52.381 }, + { 54.219, 42.8571 }, + { 39.9333, 38.0952 }, + { 35.1714, 38.0952 }, + { 20.8857, 42.8571 }, + { 11.3619, 52.381 }, + { 6.6, 66.6667 }, + { 6.6, 71.4286 }, + { 11.3619, 85.7143 }, + { 20.8857, 95.2381 }, + { 35.1714, 100 }, + { 39.9333, 100 }, + { 54.219, 95.2381 }, + { 63.7429, 85.7143 }, + { 68.5048, 66.6667 }, + { 68.5048, 42.8571 }, + { 63.7429, 19.0476 }, + { 54.219, 4.7619 }, + { 39.9333, 0 }, + { 30.4095, 0 }, + { 16.1238, 4.7619 }, + { 11.3619, 14.2857 }, +}; + +static const StrokeRec char57[] = { + { 23, char57_stroke0 }, +}; + +/* char: 58 ':' */ + +static const CoordRec char58_stroke0[] = { + { 14.0819, 66.6667 }, + { 9.32, 61.9048 }, + { 14.0819, 57.1429 }, + { 18.8438, 61.9048 }, + { 14.0819, 66.6667 }, +}; + +static const CoordRec char58_stroke1[] = { + { 14.0819, 9.5238 }, + { 9.32, 4.7619 }, + { 14.0819, 0 }, + { 18.8438, 4.7619 }, + { 14.0819, 9.5238 }, +}; + +static const StrokeRec char58[] = { + { 5, char58_stroke0 }, + { 5, char58_stroke1 }, +}; + +/* char: 59 ';' */ + +static const CoordRec char59_stroke0[] = { + { 12.9619, 66.6667 }, + { 8.2, 61.9048 }, + { 12.9619, 57.1429 }, + { 17.7238, 61.9048 }, + { 12.9619, 66.6667 }, +}; + +static const CoordRec char59_stroke1[] = { + { 17.7238, 4.7619 }, + { 12.9619, 0 }, + { 8.2, 4.7619 }, + { 12.9619, 9.5238 }, + { 17.7238, 4.7619 }, + { 17.7238, -4.7619 }, + { 12.9619, -14.2857 }, + { 8.2, -19.0476 }, +}; + +static const StrokeRec char59[] = { + { 5, char59_stroke0 }, + { 8, char59_stroke1 }, +}; + +/* char: 60 '<' */ + +static const CoordRec char60_stroke0[] = { + { 79.2505, 85.7143 }, + { 3.06, 42.8571 }, + { 79.2505, 0 }, +}; + +static const StrokeRec char60[] = { + { 3, char60_stroke0 }, +}; + +/* char: 61 '=' */ + +static const CoordRec char61_stroke0[] = { + { 5.7, 57.1429 }, + { 91.4143, 57.1429 }, +}; + +static const CoordRec char61_stroke1[] = { + { 5.7, 28.5714 }, + { 91.4143, 28.5714 }, +}; + +static const StrokeRec char61[] = { + { 2, char61_stroke0 }, + { 2, char61_stroke1 }, +}; + +/* char: 62 '>' */ + +static const CoordRec char62_stroke0[] = { + { 2.78, 85.7143 }, + { 78.9705, 42.8571 }, + { 2.78, 0 }, +}; + +static const StrokeRec char62[] = { + { 3, char62_stroke0 }, +}; + +/* char: 63 '?' */ + +static const CoordRec char63_stroke0[] = { + { 8.42, 76.1905 }, + { 8.42, 80.9524 }, + { 13.1819, 90.4762 }, + { 17.9438, 95.2381 }, + { 27.4676, 100 }, + { 46.5152, 100 }, + { 56.039, 95.2381 }, + { 60.801, 90.4762 }, + { 65.5629, 80.9524 }, + { 65.5629, 71.4286 }, + { 60.801, 61.9048 }, + { 56.039, 57.1429 }, + { 36.9914, 47.619 }, + { 36.9914, 33.3333 }, +}; + +static const CoordRec char63_stroke1[] = { + { 36.9914, 9.5238 }, + { 32.2295, 4.7619 }, + { 36.9914, 0 }, + { 41.7533, 4.7619 }, + { 36.9914, 9.5238 }, +}; + +static const StrokeRec char63[] = { + { 14, char63_stroke0 }, + { 5, char63_stroke1 }, +}; + +/* char: 64 '@' */ + +static const CoordRec char64_stroke0[] = { + { 49.2171, 52.381 }, + { 39.6933, 57.1429 }, + { 30.1695, 57.1429 }, + { 25.4076, 47.619 }, + { 25.4076, 42.8571 }, + { 30.1695, 33.3333 }, + { 39.6933, 33.3333 }, + { 49.2171, 38.0952 }, +}; + +static const CoordRec char64_stroke1[] = { + { 49.2171, 57.1429 }, + { 49.2171, 38.0952 }, + { 53.979, 33.3333 }, + { 63.5029, 33.3333 }, + { 68.2648, 42.8571 }, + { 68.2648, 47.619 }, + { 63.5029, 61.9048 }, + { 53.979, 71.4286 }, + { 39.6933, 76.1905 }, + { 34.9314, 76.1905 }, + { 20.6457, 71.4286 }, + { 11.1219, 61.9048 }, + { 6.36, 47.619 }, + { 6.36, 42.8571 }, + { 11.1219, 28.5714 }, + { 20.6457, 19.0476 }, + { 34.9314, 14.2857 }, + { 39.6933, 14.2857 }, + { 53.979, 19.0476 }, +}; + +static const StrokeRec char64[] = { + { 8, char64_stroke0 }, + { 19, char64_stroke1 }, +}; + +/* char: 65 'A' */ + +static const CoordRec char65_stroke0[] = { + { 40.5952, 100 }, + { 2.5, 0 }, +}; + +static const CoordRec char65_stroke1[] = { + { 40.5952, 100 }, + { 78.6905, 0 }, +}; + +static const CoordRec char65_stroke2[] = { + { 16.7857, 33.3333 }, + { 64.4048, 33.3333 }, +}; + +static const StrokeRec char65[] = { + { 2, char65_stroke0 }, + { 2, char65_stroke1 }, + { 2, char65_stroke2 }, +}; + +/* char: 66 'B' */ + +static const CoordRec char66_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char66_stroke1[] = { + { 11.42, 100 }, + { 54.2771, 100 }, + { 68.5629, 95.2381 }, + { 73.3248, 90.4762 }, + { 78.0867, 80.9524 }, + { 78.0867, 71.4286 }, + { 73.3248, 61.9048 }, + { 68.5629, 57.1429 }, + { 54.2771, 52.381 }, +}; + +static const CoordRec char66_stroke2[] = { + { 11.42, 52.381 }, + { 54.2771, 52.381 }, + { 68.5629, 47.619 }, + { 73.3248, 42.8571 }, + { 78.0867, 33.3333 }, + { 78.0867, 19.0476 }, + { 73.3248, 9.5238 }, + { 68.5629, 4.7619 }, + { 54.2771, 0 }, + { 11.42, 0 }, +}; + +static const StrokeRec char66[] = { + { 2, char66_stroke0 }, + { 9, char66_stroke1 }, + { 10, char66_stroke2 }, +}; + +/* char: 67 'C' */ + +static const CoordRec char67_stroke0[] = { + { 78.0886, 76.1905 }, + { 73.3267, 85.7143 }, + { 63.8029, 95.2381 }, + { 54.279, 100 }, + { 35.2314, 100 }, + { 25.7076, 95.2381 }, + { 16.1838, 85.7143 }, + { 11.4219, 76.1905 }, + { 6.66, 61.9048 }, + { 6.66, 38.0952 }, + { 11.4219, 23.8095 }, + { 16.1838, 14.2857 }, + { 25.7076, 4.7619 }, + { 35.2314, 0 }, + { 54.279, 0 }, + { 63.8029, 4.7619 }, + { 73.3267, 14.2857 }, + { 78.0886, 23.8095 }, +}; + +static const StrokeRec char67[] = { + { 18, char67_stroke0 }, +}; + +/* char: 68 'D' */ + +static const CoordRec char68_stroke0[] = { + { 11.96, 100 }, + { 11.96, 0 }, +}; + +static const CoordRec char68_stroke1[] = { + { 11.96, 100 }, + { 45.2933, 100 }, + { 59.579, 95.2381 }, + { 69.1029, 85.7143 }, + { 73.8648, 76.1905 }, + { 78.6267, 61.9048 }, + { 78.6267, 38.0952 }, + { 73.8648, 23.8095 }, + { 69.1029, 14.2857 }, + { 59.579, 4.7619 }, + { 45.2933, 0 }, + { 11.96, 0 }, +}; + +static const StrokeRec char68[] = { + { 2, char68_stroke0 }, + { 12, char68_stroke1 }, +}; + +/* char: 69 'E' */ + +static const CoordRec char69_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char69_stroke1[] = { + { 11.42, 100 }, + { 73.3248, 100 }, +}; + +static const CoordRec char69_stroke2[] = { + { 11.42, 52.381 }, + { 49.5152, 52.381 }, +}; + +static const CoordRec char69_stroke3[] = { + { 11.42, 0 }, + { 73.3248, 0 }, +}; + +static const StrokeRec char69[] = { + { 2, char69_stroke0 }, + { 2, char69_stroke1 }, + { 2, char69_stroke2 }, + { 2, char69_stroke3 }, +}; + +/* char: 70 'F' */ + +static const CoordRec char70_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char70_stroke1[] = { + { 11.42, 100 }, + { 73.3248, 100 }, +}; + +static const CoordRec char70_stroke2[] = { + { 11.42, 52.381 }, + { 49.5152, 52.381 }, +}; + +static const StrokeRec char70[] = { + { 2, char70_stroke0 }, + { 2, char70_stroke1 }, + { 2, char70_stroke2 }, +}; + +/* char: 71 'G' */ + +static const CoordRec char71_stroke0[] = { + { 78.4886, 76.1905 }, + { 73.7267, 85.7143 }, + { 64.2029, 95.2381 }, + { 54.679, 100 }, + { 35.6314, 100 }, + { 26.1076, 95.2381 }, + { 16.5838, 85.7143 }, + { 11.8219, 76.1905 }, + { 7.06, 61.9048 }, + { 7.06, 38.0952 }, + { 11.8219, 23.8095 }, + { 16.5838, 14.2857 }, + { 26.1076, 4.7619 }, + { 35.6314, 0 }, + { 54.679, 0 }, + { 64.2029, 4.7619 }, + { 73.7267, 14.2857 }, + { 78.4886, 23.8095 }, + { 78.4886, 38.0952 }, +}; + +static const CoordRec char71_stroke1[] = { + { 54.679, 38.0952 }, + { 78.4886, 38.0952 }, +}; + +static const StrokeRec char71[] = { + { 19, char71_stroke0 }, + { 2, char71_stroke1 }, +}; + +/* char: 72 'H' */ + +static const CoordRec char72_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char72_stroke1[] = { + { 78.0867, 100 }, + { 78.0867, 0 }, +}; + +static const CoordRec char72_stroke2[] = { + { 11.42, 52.381 }, + { 78.0867, 52.381 }, +}; + +static const StrokeRec char72[] = { + { 2, char72_stroke0 }, + { 2, char72_stroke1 }, + { 2, char72_stroke2 }, +}; + +/* char: 73 'I' */ + +static const CoordRec char73_stroke0[] = { + { 10.86, 100 }, + { 10.86, 0 }, +}; + +static const StrokeRec char73[] = { + { 2, char73_stroke0 }, +}; + +/* char: 74 'J' */ + +static const CoordRec char74_stroke0[] = { + { 50.119, 100 }, + { 50.119, 23.8095 }, + { 45.3571, 9.5238 }, + { 40.5952, 4.7619 }, + { 31.0714, 0 }, + { 21.5476, 0 }, + { 12.0238, 4.7619 }, + { 7.2619, 9.5238 }, + { 2.5, 23.8095 }, + { 2.5, 33.3333 }, +}; + +static const StrokeRec char74[] = { + { 10, char74_stroke0 }, +}; + +/* char: 75 'K' */ + +static const CoordRec char75_stroke0[] = { + { 11.28, 100 }, + { 11.28, 0 }, +}; + +static const CoordRec char75_stroke1[] = { + { 77.9467, 100 }, + { 11.28, 33.3333 }, +}; + +static const CoordRec char75_stroke2[] = { + { 35.0895, 57.1429 }, + { 77.9467, 0 }, +}; + +static const StrokeRec char75[] = { + { 2, char75_stroke0 }, + { 2, char75_stroke1 }, + { 2, char75_stroke2 }, +}; + +/* char: 76 'L' */ + +static const CoordRec char76_stroke0[] = { + { 11.68, 100 }, + { 11.68, 0 }, +}; + +static const CoordRec char76_stroke1[] = { + { 11.68, 0 }, + { 68.8229, 0 }, +}; + +static const StrokeRec char76[] = { + { 2, char76_stroke0 }, + { 2, char76_stroke1 }, +}; + +/* char: 77 'M' */ + +static const CoordRec char77_stroke0[] = { + { 10.86, 100 }, + { 10.86, 0 }, +}; + +static const CoordRec char77_stroke1[] = { + { 10.86, 100 }, + { 48.9552, 0 }, +}; + +static const CoordRec char77_stroke2[] = { + { 87.0505, 100 }, + { 48.9552, 0 }, +}; + +static const CoordRec char77_stroke3[] = { + { 87.0505, 100 }, + { 87.0505, 0 }, +}; + +static const StrokeRec char77[] = { + { 2, char77_stroke0 }, + { 2, char77_stroke1 }, + { 2, char77_stroke2 }, + { 2, char77_stroke3 }, +}; + +/* char: 78 'N' */ + +static const CoordRec char78_stroke0[] = { + { 11.14, 100 }, + { 11.14, 0 }, +}; + +static const CoordRec char78_stroke1[] = { + { 11.14, 100 }, + { 77.8067, 0 }, +}; + +static const CoordRec char78_stroke2[] = { + { 77.8067, 100 }, + { 77.8067, 0 }, +}; + +static const StrokeRec char78[] = { + { 2, char78_stroke0 }, + { 2, char78_stroke1 }, + { 2, char78_stroke2 }, +}; + +/* char: 79 'O' */ + +static const CoordRec char79_stroke0[] = { + { 34.8114, 100 }, + { 25.2876, 95.2381 }, + { 15.7638, 85.7143 }, + { 11.0019, 76.1905 }, + { 6.24, 61.9048 }, + { 6.24, 38.0952 }, + { 11.0019, 23.8095 }, + { 15.7638, 14.2857 }, + { 25.2876, 4.7619 }, + { 34.8114, 0 }, + { 53.859, 0 }, + { 63.3829, 4.7619 }, + { 72.9067, 14.2857 }, + { 77.6686, 23.8095 }, + { 82.4305, 38.0952 }, + { 82.4305, 61.9048 }, + { 77.6686, 76.1905 }, + { 72.9067, 85.7143 }, + { 63.3829, 95.2381 }, + { 53.859, 100 }, + { 34.8114, 100 }, +}; + +static const StrokeRec char79[] = { + { 21, char79_stroke0 }, +}; + +/* char: 80 'P' */ + +static const CoordRec char80_stroke0[] = { + { 12.1, 100 }, + { 12.1, 0 }, +}; + +static const CoordRec char80_stroke1[] = { + { 12.1, 100 }, + { 54.9571, 100 }, + { 69.2429, 95.2381 }, + { 74.0048, 90.4762 }, + { 78.7667, 80.9524 }, + { 78.7667, 66.6667 }, + { 74.0048, 57.1429 }, + { 69.2429, 52.381 }, + { 54.9571, 47.619 }, + { 12.1, 47.619 }, +}; + +static const StrokeRec char80[] = { + { 2, char80_stroke0 }, + { 10, char80_stroke1 }, +}; + +/* char: 81 'Q' */ + +static const CoordRec char81_stroke0[] = { + { 33.8714, 100 }, + { 24.3476, 95.2381 }, + { 14.8238, 85.7143 }, + { 10.0619, 76.1905 }, + { 5.3, 61.9048 }, + { 5.3, 38.0952 }, + { 10.0619, 23.8095 }, + { 14.8238, 14.2857 }, + { 24.3476, 4.7619 }, + { 33.8714, 0 }, + { 52.919, 0 }, + { 62.4429, 4.7619 }, + { 71.9667, 14.2857 }, + { 76.7286, 23.8095 }, + { 81.4905, 38.0952 }, + { 81.4905, 61.9048 }, + { 76.7286, 76.1905 }, + { 71.9667, 85.7143 }, + { 62.4429, 95.2381 }, + { 52.919, 100 }, + { 33.8714, 100 }, +}; + +static const CoordRec char81_stroke1[] = { + { 48.1571, 19.0476 }, + { 76.7286, -9.5238 }, +}; + +static const StrokeRec char81[] = { + { 21, char81_stroke0 }, + { 2, char81_stroke1 }, +}; + +/* char: 82 'R' */ + +static const CoordRec char82_stroke0[] = { + { 11.68, 100 }, + { 11.68, 0 }, +}; + +static const CoordRec char82_stroke1[] = { + { 11.68, 100 }, + { 54.5371, 100 }, + { 68.8229, 95.2381 }, + { 73.5848, 90.4762 }, + { 78.3467, 80.9524 }, + { 78.3467, 71.4286 }, + { 73.5848, 61.9048 }, + { 68.8229, 57.1429 }, + { 54.5371, 52.381 }, + { 11.68, 52.381 }, +}; + +static const CoordRec char82_stroke2[] = { + { 45.0133, 52.381 }, + { 78.3467, 0 }, +}; + +static const StrokeRec char82[] = { + { 2, char82_stroke0 }, + { 10, char82_stroke1 }, + { 2, char82_stroke2 }, +}; + +/* char: 83 'S' */ + +static const CoordRec char83_stroke0[] = { + { 74.6667, 85.7143 }, + { 65.1429, 95.2381 }, + { 50.8571, 100 }, + { 31.8095, 100 }, + { 17.5238, 95.2381 }, + { 8, 85.7143 }, + { 8, 76.1905 }, + { 12.7619, 66.6667 }, + { 17.5238, 61.9048 }, + { 27.0476, 57.1429 }, + { 55.619, 47.619 }, + { 65.1429, 42.8571 }, + { 69.9048, 38.0952 }, + { 74.6667, 28.5714 }, + { 74.6667, 14.2857 }, + { 65.1429, 4.7619 }, + { 50.8571, 0 }, + { 31.8095, 0 }, + { 17.5238, 4.7619 }, + { 8, 14.2857 }, +}; + +static const StrokeRec char83[] = { + { 20, char83_stroke0 }, +}; + +/* char: 84 'T' */ + +static const CoordRec char84_stroke0[] = { + { 35.6933, 100 }, + { 35.6933, 0 }, +}; + +static const CoordRec char84_stroke1[] = { + { 2.36, 100 }, + { 69.0267, 100 }, +}; + +static const StrokeRec char84[] = { + { 2, char84_stroke0 }, + { 2, char84_stroke1 }, +}; + +/* char: 85 'U' */ + +static const CoordRec char85_stroke0[] = { + { 11.54, 100 }, + { 11.54, 28.5714 }, + { 16.3019, 14.2857 }, + { 25.8257, 4.7619 }, + { 40.1114, 0 }, + { 49.6352, 0 }, + { 63.921, 4.7619 }, + { 73.4448, 14.2857 }, + { 78.2067, 28.5714 }, + { 78.2067, 100 }, +}; + +static const StrokeRec char85[] = { + { 10, char85_stroke0 }, +}; + +/* char: 86 'V' */ + +static const CoordRec char86_stroke0[] = { + { 2.36, 100 }, + { 40.4552, 0 }, +}; + +static const CoordRec char86_stroke1[] = { + { 78.5505, 100 }, + { 40.4552, 0 }, +}; + +static const StrokeRec char86[] = { + { 2, char86_stroke0 }, + { 2, char86_stroke1 }, +}; + +/* char: 87 'W' */ + +static const CoordRec char87_stroke0[] = { + { 2.22, 100 }, + { 26.0295, 0 }, +}; + +static const CoordRec char87_stroke1[] = { + { 49.839, 100 }, + { 26.0295, 0 }, +}; + +static const CoordRec char87_stroke2[] = { + { 49.839, 100 }, + { 73.6486, 0 }, +}; + +static const CoordRec char87_stroke3[] = { + { 97.4581, 100 }, + { 73.6486, 0 }, +}; + +static const StrokeRec char87[] = { + { 2, char87_stroke0 }, + { 2, char87_stroke1 }, + { 2, char87_stroke2 }, + { 2, char87_stroke3 }, +}; + +/* char: 88 'X' */ + +static const CoordRec char88_stroke0[] = { + { 2.5, 100 }, + { 69.1667, 0 }, +}; + +static const CoordRec char88_stroke1[] = { + { 69.1667, 100 }, + { 2.5, 0 }, +}; + +static const StrokeRec char88[] = { + { 2, char88_stroke0 }, + { 2, char88_stroke1 }, +}; + +/* char: 89 'Y' */ + +static const CoordRec char89_stroke0[] = { + { 1.52, 100 }, + { 39.6152, 52.381 }, + { 39.6152, 0 }, +}; + +static const CoordRec char89_stroke1[] = { + { 77.7105, 100 }, + { 39.6152, 52.381 }, +}; + +static const StrokeRec char89[] = { + { 3, char89_stroke0 }, + { 2, char89_stroke1 }, +}; + +/* char: 90 'Z' */ + +static const CoordRec char90_stroke0[] = { + { 69.1667, 100 }, + { 2.5, 0 }, +}; + +static const CoordRec char90_stroke1[] = { + { 2.5, 100 }, + { 69.1667, 100 }, +}; + +static const CoordRec char90_stroke2[] = { + { 2.5, 0 }, + { 69.1667, 0 }, +}; + +static const StrokeRec char90[] = { + { 2, char90_stroke0 }, + { 2, char90_stroke1 }, + { 2, char90_stroke2 }, +}; + +/* char: 91 '[' */ + +static const CoordRec char91_stroke0[] = { + { 7.78, 119.048 }, + { 7.78, -33.3333 }, +}; + +static const CoordRec char91_stroke1[] = { + { 12.5419, 119.048 }, + { 12.5419, -33.3333 }, +}; + +static const CoordRec char91_stroke2[] = { + { 7.78, 119.048 }, + { 41.1133, 119.048 }, +}; + +static const CoordRec char91_stroke3[] = { + { 7.78, -33.3333 }, + { 41.1133, -33.3333 }, +}; + +static const StrokeRec char91[] = { + { 2, char91_stroke0 }, + { 2, char91_stroke1 }, + { 2, char91_stroke2 }, + { 2, char91_stroke3 }, +}; + +/* char: 92 '\' */ + +static const CoordRec char92_stroke0[] = { + { 5.84, 100 }, + { 72.5067, -14.2857 }, +}; + +static const StrokeRec char92[] = { + { 2, char92_stroke0 }, +}; + +/* char: 93 ']' */ + +static const CoordRec char93_stroke0[] = { + { 33.0114, 119.048 }, + { 33.0114, -33.3333 }, +}; + +static const CoordRec char93_stroke1[] = { + { 37.7733, 119.048 }, + { 37.7733, -33.3333 }, +}; + +static const CoordRec char93_stroke2[] = { + { 4.44, 119.048 }, + { 37.7733, 119.048 }, +}; + +static const CoordRec char93_stroke3[] = { + { 4.44, -33.3333 }, + { 37.7733, -33.3333 }, +}; + +static const StrokeRec char93[] = { + { 2, char93_stroke0 }, + { 2, char93_stroke1 }, + { 2, char93_stroke2 }, + { 2, char93_stroke3 }, +}; + +/* char: 94 '^' */ + +static const CoordRec char94_stroke0[] = { + { 44.0752, 109.524 }, + { 5.98, 42.8571 }, +}; + +static const CoordRec char94_stroke1[] = { + { 44.0752, 109.524 }, + { 82.1705, 42.8571 }, +}; + +static const StrokeRec char94[] = { + { 2, char94_stroke0 }, + { 2, char94_stroke1 }, +}; + +/* char: 95 '_' */ + +static const CoordRec char95_stroke0[] = { + { -1.1, -33.3333 }, + { 103.662, -33.3333 }, + { 103.662, -28.5714 }, + { -1.1, -28.5714 }, + { -1.1, -33.3333 }, +}; + +static const StrokeRec char95[] = { + { 5, char95_stroke0 }, +}; + +/* char: 96 '`' */ + +static const CoordRec char96_stroke0[] = { + { 33.0219, 100 }, + { 56.8314, 71.4286 }, +}; + +static const CoordRec char96_stroke1[] = { + { 33.0219, 100 }, + { 28.26, 95.2381 }, + { 56.8314, 71.4286 }, +}; + +static const StrokeRec char96[] = { + { 2, char96_stroke0 }, + { 3, char96_stroke1 }, +}; + +/* char: 97 'a' */ + +static const CoordRec char97_stroke0[] = { + { 63.8229, 66.6667 }, + { 63.8229, 0 }, +}; + +static const CoordRec char97_stroke1[] = { + { 63.8229, 52.381 }, + { 54.299, 61.9048 }, + { 44.7752, 66.6667 }, + { 30.4895, 66.6667 }, + { 20.9657, 61.9048 }, + { 11.4419, 52.381 }, + { 6.68, 38.0952 }, + { 6.68, 28.5714 }, + { 11.4419, 14.2857 }, + { 20.9657, 4.7619 }, + { 30.4895, 0 }, + { 44.7752, 0 }, + { 54.299, 4.7619 }, + { 63.8229, 14.2857 }, +}; + +static const StrokeRec char97[] = { + { 2, char97_stroke0 }, + { 14, char97_stroke1 }, +}; + +/* char: 98 'b' */ + +static const CoordRec char98_stroke0[] = { + { 8.76, 100 }, + { 8.76, 0 }, +}; + +static const CoordRec char98_stroke1[] = { + { 8.76, 52.381 }, + { 18.2838, 61.9048 }, + { 27.8076, 66.6667 }, + { 42.0933, 66.6667 }, + { 51.6171, 61.9048 }, + { 61.141, 52.381 }, + { 65.9029, 38.0952 }, + { 65.9029, 28.5714 }, + { 61.141, 14.2857 }, + { 51.6171, 4.7619 }, + { 42.0933, 0 }, + { 27.8076, 0 }, + { 18.2838, 4.7619 }, + { 8.76, 14.2857 }, +}; + +static const StrokeRec char98[] = { + { 2, char98_stroke0 }, + { 14, char98_stroke1 }, +}; + +/* char: 99 'c' */ + +static const CoordRec char99_stroke0[] = { + { 62.6629, 52.381 }, + { 53.139, 61.9048 }, + { 43.6152, 66.6667 }, + { 29.3295, 66.6667 }, + { 19.8057, 61.9048 }, + { 10.2819, 52.381 }, + { 5.52, 38.0952 }, + { 5.52, 28.5714 }, + { 10.2819, 14.2857 }, + { 19.8057, 4.7619 }, + { 29.3295, 0 }, + { 43.6152, 0 }, + { 53.139, 4.7619 }, + { 62.6629, 14.2857 }, +}; + +static const StrokeRec char99[] = { + { 14, char99_stroke0 }, +}; + +/* char: 100 'd' */ + +static const CoordRec char100_stroke0[] = { + { 61.7829, 100 }, + { 61.7829, 0 }, +}; + +static const CoordRec char100_stroke1[] = { + { 61.7829, 52.381 }, + { 52.259, 61.9048 }, + { 42.7352, 66.6667 }, + { 28.4495, 66.6667 }, + { 18.9257, 61.9048 }, + { 9.4019, 52.381 }, + { 4.64, 38.0952 }, + { 4.64, 28.5714 }, + { 9.4019, 14.2857 }, + { 18.9257, 4.7619 }, + { 28.4495, 0 }, + { 42.7352, 0 }, + { 52.259, 4.7619 }, + { 61.7829, 14.2857 }, +}; + +static const StrokeRec char100[] = { + { 2, char100_stroke0 }, + { 14, char100_stroke1 }, +}; + +/* char: 101 'e' */ + +static const CoordRec char101_stroke0[] = { + { 5.72, 38.0952 }, + { 62.8629, 38.0952 }, + { 62.8629, 47.619 }, + { 58.101, 57.1429 }, + { 53.339, 61.9048 }, + { 43.8152, 66.6667 }, + { 29.5295, 66.6667 }, + { 20.0057, 61.9048 }, + { 10.4819, 52.381 }, + { 5.72, 38.0952 }, + { 5.72, 28.5714 }, + { 10.4819, 14.2857 }, + { 20.0057, 4.7619 }, + { 29.5295, 0 }, + { 43.8152, 0 }, + { 53.339, 4.7619 }, + { 62.8629, 14.2857 }, +}; + +static const StrokeRec char101[] = { + { 17, char101_stroke0 }, +}; + +/* char: 102 'f' */ + +static const CoordRec char102_stroke0[] = { + { 38.7752, 100 }, + { 29.2514, 100 }, + { 19.7276, 95.2381 }, + { 14.9657, 80.9524 }, + { 14.9657, 0 }, +}; + +static const CoordRec char102_stroke1[] = { + { 0.68, 66.6667 }, + { 34.0133, 66.6667 }, +}; + +static const StrokeRec char102[] = { + { 5, char102_stroke0 }, + { 2, char102_stroke1 }, +}; + +/* char: 103 'g' */ + +static const CoordRec char103_stroke0[] = { + { 62.5029, 66.6667 }, + { 62.5029, -9.5238 }, + { 57.741, -23.8095 }, + { 52.979, -28.5714 }, + { 43.4552, -33.3333 }, + { 29.1695, -33.3333 }, + { 19.6457, -28.5714 }, +}; + +static const CoordRec char103_stroke1[] = { + { 62.5029, 52.381 }, + { 52.979, 61.9048 }, + { 43.4552, 66.6667 }, + { 29.1695, 66.6667 }, + { 19.6457, 61.9048 }, + { 10.1219, 52.381 }, + { 5.36, 38.0952 }, + { 5.36, 28.5714 }, + { 10.1219, 14.2857 }, + { 19.6457, 4.7619 }, + { 29.1695, 0 }, + { 43.4552, 0 }, + { 52.979, 4.7619 }, + { 62.5029, 14.2857 }, +}; + +static const StrokeRec char103[] = { + { 7, char103_stroke0 }, + { 14, char103_stroke1 }, +}; + +/* char: 104 'h' */ + +static const CoordRec char104_stroke0[] = { + { 9.6, 100 }, + { 9.6, 0 }, +}; + +static const CoordRec char104_stroke1[] = { + { 9.6, 47.619 }, + { 23.8857, 61.9048 }, + { 33.4095, 66.6667 }, + { 47.6952, 66.6667 }, + { 57.219, 61.9048 }, + { 61.981, 47.619 }, + { 61.981, 0 }, +}; + +static const StrokeRec char104[] = { + { 2, char104_stroke0 }, + { 7, char104_stroke1 }, +}; + +/* char: 105 'i' */ + +static const CoordRec char105_stroke0[] = { + { 10.02, 100 }, + { 14.7819, 95.2381 }, + { 19.5438, 100 }, + { 14.7819, 104.762 }, + { 10.02, 100 }, +}; + +static const CoordRec char105_stroke1[] = { + { 14.7819, 66.6667 }, + { 14.7819, 0 }, +}; + +static const StrokeRec char105[] = { + { 5, char105_stroke0 }, + { 2, char105_stroke1 }, +}; + +/* char: 106 'j' */ + +static const CoordRec char106_stroke0[] = { + { 17.3876, 100 }, + { 22.1495, 95.2381 }, + { 26.9114, 100 }, + { 22.1495, 104.762 }, + { 17.3876, 100 }, +}; + +static const CoordRec char106_stroke1[] = { + { 22.1495, 66.6667 }, + { 22.1495, -14.2857 }, + { 17.3876, -28.5714 }, + { 7.8638, -33.3333 }, + { -1.66, -33.3333 }, +}; + +static const StrokeRec char106[] = { + { 5, char106_stroke0 }, + { 5, char106_stroke1 }, +}; + +/* char: 107 'k' */ + +static const CoordRec char107_stroke0[] = { + { 9.6, 100 }, + { 9.6, 0 }, +}; + +static const CoordRec char107_stroke1[] = { + { 57.219, 66.6667 }, + { 9.6, 19.0476 }, +}; + +static const CoordRec char107_stroke2[] = { + { 28.6476, 38.0952 }, + { 61.981, 0 }, +}; + +static const StrokeRec char107[] = { + { 2, char107_stroke0 }, + { 2, char107_stroke1 }, + { 2, char107_stroke2 }, +}; + +/* char: 108 'l' */ + +static const CoordRec char108_stroke0[] = { + { 10.02, 100 }, + { 10.02, 0 }, +}; + +static const StrokeRec char108[] = { + { 2, char108_stroke0 }, +}; + +/* char: 109 'm' */ + +static const CoordRec char109_stroke0[] = { + { 9.6, 66.6667 }, + { 9.6, 0 }, +}; + +static const CoordRec char109_stroke1[] = { + { 9.6, 47.619 }, + { 23.8857, 61.9048 }, + { 33.4095, 66.6667 }, + { 47.6952, 66.6667 }, + { 57.219, 61.9048 }, + { 61.981, 47.619 }, + { 61.981, 0 }, +}; + +static const CoordRec char109_stroke2[] = { + { 61.981, 47.619 }, + { 76.2667, 61.9048 }, + { 85.7905, 66.6667 }, + { 100.076, 66.6667 }, + { 109.6, 61.9048 }, + { 114.362, 47.619 }, + { 114.362, 0 }, +}; + +static const StrokeRec char109[] = { + { 2, char109_stroke0 }, + { 7, char109_stroke1 }, + { 7, char109_stroke2 }, +}; + +/* char: 110 'n' */ + +static const CoordRec char110_stroke0[] = { + { 9.18, 66.6667 }, + { 9.18, 0 }, +}; + +static const CoordRec char110_stroke1[] = { + { 9.18, 47.619 }, + { 23.4657, 61.9048 }, + { 32.9895, 66.6667 }, + { 47.2752, 66.6667 }, + { 56.799, 61.9048 }, + { 61.561, 47.619 }, + { 61.561, 0 }, +}; + +static const StrokeRec char110[] = { + { 2, char110_stroke0 }, + { 7, char110_stroke1 }, +}; + +/* char: 111 'o' */ + +static const CoordRec char111_stroke0[] = { + { 28.7895, 66.6667 }, + { 19.2657, 61.9048 }, + { 9.7419, 52.381 }, + { 4.98, 38.0952 }, + { 4.98, 28.5714 }, + { 9.7419, 14.2857 }, + { 19.2657, 4.7619 }, + { 28.7895, 0 }, + { 43.0752, 0 }, + { 52.599, 4.7619 }, + { 62.1229, 14.2857 }, + { 66.8848, 28.5714 }, + { 66.8848, 38.0952 }, + { 62.1229, 52.381 }, + { 52.599, 61.9048 }, + { 43.0752, 66.6667 }, + { 28.7895, 66.6667 }, +}; + +static const StrokeRec char111[] = { + { 17, char111_stroke0 }, +}; + +/* char: 112 'p' */ + +static const CoordRec char112_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, -33.3333 }, +}; + +static const CoordRec char112_stroke1[] = { + { 9.46, 52.381 }, + { 18.9838, 61.9048 }, + { 28.5076, 66.6667 }, + { 42.7933, 66.6667 }, + { 52.3171, 61.9048 }, + { 61.841, 52.381 }, + { 66.6029, 38.0952 }, + { 66.6029, 28.5714 }, + { 61.841, 14.2857 }, + { 52.3171, 4.7619 }, + { 42.7933, 0 }, + { 28.5076, 0 }, + { 18.9838, 4.7619 }, + { 9.46, 14.2857 }, +}; + +static const StrokeRec char112[] = { + { 2, char112_stroke0 }, + { 14, char112_stroke1 }, +}; + +/* char: 113 'q' */ + +static const CoordRec char113_stroke0[] = { + { 61.9829, 66.6667 }, + { 61.9829, -33.3333 }, +}; + +static const CoordRec char113_stroke1[] = { + { 61.9829, 52.381 }, + { 52.459, 61.9048 }, + { 42.9352, 66.6667 }, + { 28.6495, 66.6667 }, + { 19.1257, 61.9048 }, + { 9.6019, 52.381 }, + { 4.84, 38.0952 }, + { 4.84, 28.5714 }, + { 9.6019, 14.2857 }, + { 19.1257, 4.7619 }, + { 28.6495, 0 }, + { 42.9352, 0 }, + { 52.459, 4.7619 }, + { 61.9829, 14.2857 }, +}; + +static const StrokeRec char113[] = { + { 2, char113_stroke0 }, + { 14, char113_stroke1 }, +}; + +/* char: 114 'r' */ + +static const CoordRec char114_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, 0 }, +}; + +static const CoordRec char114_stroke1[] = { + { 9.46, 38.0952 }, + { 14.2219, 52.381 }, + { 23.7457, 61.9048 }, + { 33.2695, 66.6667 }, + { 47.5552, 66.6667 }, +}; + +static const StrokeRec char114[] = { + { 2, char114_stroke0 }, + { 5, char114_stroke1 }, +}; + +/* char: 115 's' */ + +static const CoordRec char115_stroke0[] = { + { 57.081, 52.381 }, + { 52.319, 61.9048 }, + { 38.0333, 66.6667 }, + { 23.7476, 66.6667 }, + { 9.4619, 61.9048 }, + { 4.7, 52.381 }, + { 9.4619, 42.8571 }, + { 18.9857, 38.0952 }, + { 42.7952, 33.3333 }, + { 52.319, 28.5714 }, + { 57.081, 19.0476 }, + { 57.081, 14.2857 }, + { 52.319, 4.7619 }, + { 38.0333, 0 }, + { 23.7476, 0 }, + { 9.4619, 4.7619 }, + { 4.7, 14.2857 }, +}; + +static const StrokeRec char115[] = { + { 17, char115_stroke0 }, +}; + +/* char: 116 't' */ + +static const CoordRec char116_stroke0[] = { + { 14.8257, 100 }, + { 14.8257, 19.0476 }, + { 19.5876, 4.7619 }, + { 29.1114, 0 }, + { 38.6352, 0 }, +}; + +static const CoordRec char116_stroke1[] = { + { 0.54, 66.6667 }, + { 33.8733, 66.6667 }, +}; + +static const StrokeRec char116[] = { + { 5, char116_stroke0 }, + { 2, char116_stroke1 }, +}; + +/* char: 117 'u' */ + +static const CoordRec char117_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, 19.0476 }, + { 14.2219, 4.7619 }, + { 23.7457, 0 }, + { 38.0314, 0 }, + { 47.5552, 4.7619 }, + { 61.841, 19.0476 }, +}; + +static const CoordRec char117_stroke1[] = { + { 61.841, 66.6667 }, + { 61.841, 0 }, +}; + +static const StrokeRec char117[] = { + { 7, char117_stroke0 }, + { 2, char117_stroke1 }, +}; + +/* char: 118 'v' */ + +static const CoordRec char118_stroke0[] = { + { 1.8, 66.6667 }, + { 30.3714, 0 }, +}; + +static const CoordRec char118_stroke1[] = { + { 58.9429, 66.6667 }, + { 30.3714, 0 }, +}; + +static const StrokeRec char118[] = { + { 2, char118_stroke0 }, + { 2, char118_stroke1 }, +}; + +/* char: 119 'w' */ + +static const CoordRec char119_stroke0[] = { + { 2.5, 66.6667 }, + { 21.5476, 0 }, +}; + +static const CoordRec char119_stroke1[] = { + { 40.5952, 66.6667 }, + { 21.5476, 0 }, +}; + +static const CoordRec char119_stroke2[] = { + { 40.5952, 66.6667 }, + { 59.6429, 0 }, +}; + +static const CoordRec char119_stroke3[] = { + { 78.6905, 66.6667 }, + { 59.6429, 0 }, +}; + +static const StrokeRec char119[] = { + { 2, char119_stroke0 }, + { 2, char119_stroke1 }, + { 2, char119_stroke2 }, + { 2, char119_stroke3 }, +}; + +/* char: 120 'x' */ + +static const CoordRec char120_stroke0[] = { + { 1.66, 66.6667 }, + { 54.041, 0 }, +}; + +static const CoordRec char120_stroke1[] = { + { 54.041, 66.6667 }, + { 1.66, 0 }, +}; + +static const StrokeRec char120[] = { + { 2, char120_stroke0 }, + { 2, char120_stroke1 }, +}; + +/* char: 121 'y' */ + +static const CoordRec char121_stroke0[] = { + { 6.5619, 66.6667 }, + { 35.1333, 0 }, +}; + +static const CoordRec char121_stroke1[] = { + { 63.7048, 66.6667 }, + { 35.1333, 0 }, + { 25.6095, -19.0476 }, + { 16.0857, -28.5714 }, + { 6.5619, -33.3333 }, + { 1.8, -33.3333 }, +}; + +static const StrokeRec char121[] = { + { 2, char121_stroke0 }, + { 6, char121_stroke1 }, +}; + +/* char: 122 'z' */ + +static const CoordRec char122_stroke0[] = { + { 56.821, 66.6667 }, + { 4.44, 0 }, +}; + +static const CoordRec char122_stroke1[] = { + { 4.44, 66.6667 }, + { 56.821, 66.6667 }, +}; + +static const CoordRec char122_stroke2[] = { + { 4.44, 0 }, + { 56.821, 0 }, +}; + +static const StrokeRec char122[] = { + { 2, char122_stroke0 }, + { 2, char122_stroke1 }, + { 2, char122_stroke2 }, +}; + +/* char: 123 '{' */ + +static const CoordRec char123_stroke0[] = { + { 31.1895, 119.048 }, + { 21.6657, 114.286 }, + { 16.9038, 109.524 }, + { 12.1419, 100 }, + { 12.1419, 90.4762 }, + { 16.9038, 80.9524 }, + { 21.6657, 76.1905 }, + { 26.4276, 66.6667 }, + { 26.4276, 57.1429 }, + { 16.9038, 47.619 }, +}; + +static const CoordRec char123_stroke1[] = { + { 21.6657, 114.286 }, + { 16.9038, 104.762 }, + { 16.9038, 95.2381 }, + { 21.6657, 85.7143 }, + { 26.4276, 80.9524 }, + { 31.1895, 71.4286 }, + { 31.1895, 61.9048 }, + { 26.4276, 52.381 }, + { 7.38, 42.8571 }, + { 26.4276, 33.3333 }, + { 31.1895, 23.8095 }, + { 31.1895, 14.2857 }, + { 26.4276, 4.7619 }, + { 21.6657, 0 }, + { 16.9038, -9.5238 }, + { 16.9038, -19.0476 }, + { 21.6657, -28.5714 }, +}; + +static const CoordRec char123_stroke2[] = { + { 16.9038, 38.0952 }, + { 26.4276, 28.5714 }, + { 26.4276, 19.0476 }, + { 21.6657, 9.5238 }, + { 16.9038, 4.7619 }, + { 12.1419, -4.7619 }, + { 12.1419, -14.2857 }, + { 16.9038, -23.8095 }, + { 21.6657, -28.5714 }, + { 31.1895, -33.3333 }, +}; + +static const StrokeRec char123[] = { + { 10, char123_stroke0 }, + { 17, char123_stroke1 }, + { 10, char123_stroke2 }, +}; + +/* char: 124 '|' */ + +static const CoordRec char124_stroke0[] = { + { 11.54, 119.048 }, + { 11.54, -33.3333 }, +}; + +static const StrokeRec char124[] = { + { 2, char124_stroke0 }, +}; + +/* char: 125 '}' */ + +static const CoordRec char125_stroke0[] = { + { 9.18, 119.048 }, + { 18.7038, 114.286 }, + { 23.4657, 109.524 }, + { 28.2276, 100 }, + { 28.2276, 90.4762 }, + { 23.4657, 80.9524 }, + { 18.7038, 76.1905 }, + { 13.9419, 66.6667 }, + { 13.9419, 57.1429 }, + { 23.4657, 47.619 }, +}; + +static const CoordRec char125_stroke1[] = { + { 18.7038, 114.286 }, + { 23.4657, 104.762 }, + { 23.4657, 95.2381 }, + { 18.7038, 85.7143 }, + { 13.9419, 80.9524 }, + { 9.18, 71.4286 }, + { 9.18, 61.9048 }, + { 13.9419, 52.381 }, + { 32.9895, 42.8571 }, + { 13.9419, 33.3333 }, + { 9.18, 23.8095 }, + { 9.18, 14.2857 }, + { 13.9419, 4.7619 }, + { 18.7038, 0 }, + { 23.4657, -9.5238 }, + { 23.4657, -19.0476 }, + { 18.7038, -28.5714 }, +}; + +static const CoordRec char125_stroke2[] = { + { 23.4657, 38.0952 }, + { 13.9419, 28.5714 }, + { 13.9419, 19.0476 }, + { 18.7038, 9.5238 }, + { 23.4657, 4.7619 }, + { 28.2276, -4.7619 }, + { 28.2276, -14.2857 }, + { 23.4657, -23.8095 }, + { 18.7038, -28.5714 }, + { 9.18, -33.3333 }, +}; + +static const StrokeRec char125[] = { + { 10, char125_stroke0 }, + { 17, char125_stroke1 }, + { 10, char125_stroke2 }, +}; + +/* char: 126 '~' */ + +static const CoordRec char126_stroke0[] = { + { 2.92, 28.5714 }, + { 2.92, 38.0952 }, + { 7.6819, 52.381 }, + { 17.2057, 57.1429 }, + { 26.7295, 57.1429 }, + { 36.2533, 52.381 }, + { 55.301, 38.0952 }, + { 64.8248, 33.3333 }, + { 74.3486, 33.3333 }, + { 83.8724, 38.0952 }, + { 88.6343, 47.619 }, +}; + +static const CoordRec char126_stroke1[] = { + { 2.92, 38.0952 }, + { 7.6819, 47.619 }, + { 17.2057, 52.381 }, + { 26.7295, 52.381 }, + { 36.2533, 47.619 }, + { 55.301, 33.3333 }, + { 64.8248, 28.5714 }, + { 74.3486, 28.5714 }, + { 83.8724, 33.3333 }, + { 88.6343, 47.619 }, + { 88.6343, 57.1429 }, +}; + +static const StrokeRec char126[] = { + { 11, char126_stroke0 }, + { 11, char126_stroke1 }, +}; + +/* char: 127 */ + +static const CoordRec char127_stroke0[] = { + { 52.381, 100 }, + { 14.2857, -33.3333 }, +}; + +static const CoordRec char127_stroke1[] = { + { 28.5714, 66.6667 }, + { 14.2857, 61.9048 }, + { 4.7619, 52.381 }, + { 0, 38.0952 }, + { 0, 23.8095 }, + { 4.7619, 14.2857 }, + { 14.2857, 4.7619 }, + { 28.5714, 0 }, + { 38.0952, 0 }, + { 52.381, 4.7619 }, + { 61.9048, 14.2857 }, + { 66.6667, 28.5714 }, + { 66.6667, 42.8571 }, + { 61.9048, 52.381 }, + { 52.381, 61.9048 }, + { 38.0952, 66.6667 }, + { 28.5714, 66.6667 }, +}; + +static const StrokeRec char127[] = { + { 2, char127_stroke0 }, + { 17, char127_stroke1 }, +}; + +static const StrokeCharRec chars[] = { + { 0, /* char0 */ 0, 0, 0 }, + { 0, /* char1 */ 0, 0, 0 }, + { 0, /* char2 */ 0, 0, 0 }, + { 0, /* char3 */ 0, 0, 0 }, + { 0, /* char4 */ 0, 0, 0 }, + { 0, /* char5 */ 0, 0, 0 }, + { 0, /* char6 */ 0, 0, 0 }, + { 0, /* char7 */ 0, 0, 0 }, + { 0, /* char8 */ 0, 0, 0 }, + { 0, /* char9 */ 0, 0, 0 }, + { 0, /* char10 */ 0, 0, 0 }, + { 0, /* char11 */ 0, 0, 0 }, + { 0, /* char12 */ 0, 0, 0 }, + { 0, /* char13 */ 0, 0, 0 }, + { 0, /* char14 */ 0, 0, 0 }, + { 0, /* char15 */ 0, 0, 0 }, + { 0, /* char16 */ 0, 0, 0 }, + { 0, /* char17 */ 0, 0, 0 }, + { 0, /* char18 */ 0, 0, 0 }, + { 0, /* char19 */ 0, 0, 0 }, + { 0, /* char20 */ 0, 0, 0 }, + { 0, /* char21 */ 0, 0, 0 }, + { 0, /* char22 */ 0, 0, 0 }, + { 0, /* char23 */ 0, 0, 0 }, + { 0, /* char24 */ 0, 0, 0 }, + { 0, /* char25 */ 0, 0, 0 }, + { 0, /* char26 */ 0, 0, 0 }, + { 0, /* char27 */ 0, 0, 0 }, + { 0, /* char28 */ 0, 0, 0 }, + { 0, /* char29 */ 0, 0, 0 }, + { 0, /* char30 */ 0, 0, 0 }, + { 0, /* char31 */ 0, 0, 0 }, + { 0, /* char32 */ 0, 52.381, 104.762 }, + { 2, char33, 13.3819, 26.6238 }, + { 2, char34, 23.0676, 51.4352 }, + { 4, char35, 36.5333, 79.4886 }, + { 3, char36, 38.1533, 76.2067 }, + { 3, char37, 49.2171, 96.5743 }, + { 1, char38, 53.599, 101.758 }, + { 1, char39, 4.44, 13.62 }, + { 1, char40, 21.8657, 47.1733 }, + { 1, char41, 24.3276, 47.5333 }, + { 3, char42, 30.7695, 59.439 }, + { 2, char43, 48.8371, 97.2543 }, + { 1, char44, 13.5219, 26.0638 }, + { 1, char45, 50.2371, 100.754 }, + { 1, char46, 13.1019, 26.4838 }, + { 1, char47, 40.5733, 82.1067 }, + { 1, char48, 38.3133, 77.0667 }, + { 1, char49, 30.8676, 66.5295 }, + { 1, char50, 38.7533, 77.6467 }, + { 1, char51, 38.3333, 77.0467 }, + { 2, char52, 37.2133, 80.1686 }, + { 1, char53, 38.1933, 77.6867 }, + { 1, char54, 34.1514, 73.8048 }, + { 2, char55, 38.8933, 77.2267 }, + { 1, char56, 38.9333, 77.6667 }, + { 1, char57, 39.9333, 74.0648 }, + { 2, char58, 14.0819, 26.2238 }, + { 2, char59, 12.9619, 26.3038 }, + { 1, char60, 41.1552, 81.6105 }, + { 2, char61, 48.5571, 97.2543 }, + { 1, char62, 40.8752, 81.6105 }, + { 2, char63, 36.9914, 73.9029 }, + { 2, char64, 34.9314, 74.3648 }, + { 3, char65, 40.5952, 80.4905 }, + { 3, char66, 44.7533, 83.6267 }, + { 1, char67, 39.9933, 84.4886 }, + { 2, char68, 45.2933, 85.2867 }, + { 4, char69, 39.9914, 78.1848 }, + { 3, char70, 39.9914, 78.7448 }, + { 2, char71, 40.3933, 89.7686 }, + { 3, char72, 44.7533, 89.0867 }, + { 1, char73, 10.86, 21.3 }, + { 1, char74, 31.0714, 59.999 }, + { 3, char75, 44.6133, 79.3267 }, + { 2, char76, 40.2514, 71.3229 }, + { 4, char77, 48.9552, 97.2105 }, + { 3, char78, 44.4733, 88.8067 }, + { 1, char79, 44.3352, 88.8305 }, + { 2, char80, 45.4333, 85.6667 }, + { 2, char81, 43.3952, 88.0905 }, + { 3, char82, 45.0133, 82.3667 }, + { 1, char83, 41.3333, 80.8267 }, + { 2, char84, 35.6933, 71.9467 }, + { 1, char85, 44.8733, 89.4867 }, + { 2, char86, 40.4552, 81.6105 }, + { 4, char87, 49.839, 100.518 }, + { 2, char88, 35.8333, 72.3667 }, + { 2, char89, 39.6152, 79.6505 }, + { 3, char90, 35.8333, 73.7467 }, + { 4, char91, 22.0657, 46.1133 }, + { 1, char92, 39.1733, 78.2067 }, + { 4, char93, 23.4876, 46.3933 }, + { 2, char94, 44.0752, 90.2305 }, + { 1, char95, 51.281, 104.062 }, + { 2, char96, 42.5457, 83.5714 }, + { 2, char97, 35.2514, 66.6029 }, + { 2, char98, 37.3314, 70.4629 }, + { 1, char99, 34.0914, 68.9229 }, + { 2, char100, 33.2114, 70.2629 }, + { 1, char101, 34.2914, 68.5229 }, + { 2, char102, 14.9657, 38.6552 }, + { 2, char103, 33.9314, 70.9829 }, + { 2, char104, 33.4095, 71.021 }, + { 2, char105, 14.7819, 28.8638 }, + { 2, char106, 17.3876, 36.2314 }, + { 3, char107, 33.4095, 62.521 }, + { 1, char108, 10.02, 19.34 }, + { 3, char109, 61.981, 123.962 }, + { 2, char110, 32.9895, 70.881 }, + { 1, char111, 33.5514, 71.7448 }, + { 2, char112, 38.0314, 70.8029 }, + { 2, char113, 33.4114, 70.7429 }, + { 2, char114, 23.7457, 49.4952 }, + { 1, char115, 28.5095, 62.321 }, + { 2, char116, 14.8257, 39.3152 }, + { 2, char117, 33.2695, 71.161 }, + { 2, char118, 30.3714, 60.6029 }, + { 4, char119, 40.5952, 80.4905 }, + { 2, char120, 25.4695, 56.401 }, + { 2, char121, 35.1333, 66.0648 }, + { 3, char122, 28.2495, 61.821 }, + { 3, char123, 21.6657, 41.6295 }, + { 1, char124, 11.54, 23.78 }, + { 3, char125, 18.7038, 41.4695 }, + { 2, char126, 45.7771, 91.2743 }, + { 2, char127, 33.3333, 66.6667 }, +}; + +StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 }; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_shapes.c xpsb-glx-0.19/mesa/src/glut/beos/glut_shapes.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_shapes.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_shapes.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,596 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include "glutint.h" + +/* Some files do not define M_PI... */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +static GLUquadricObj *quadObj; + +#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } + +static void +initQuadObj(void) +{ + quadObj = gluNewQuadric(); + if (!quadObj) + __glutFatalError("out of memory."); +} + +/* CENTRY */ +void APIENTRY +glutWireSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void APIENTRY +glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void APIENTRY +glutWireCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +void APIENTRY +glutSolidCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +/* ENDCENTRY */ + +static void +drawBox(GLfloat size, GLenum type) +{ + static GLfloat n[6][3] = + { + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {1.0, 0.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} + }; + static GLint faces[6][4] = + { + {0, 1, 2, 3}, + {3, 2, 6, 7}, + {7, 6, 5, 4}, + {4, 5, 1, 0}, + {5, 6, 2, 1}, + {7, 4, 0, 3} + }; + GLfloat v[8][3]; + GLint i; + + v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; + v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; + v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; + v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; + v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; + v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; + + for (i = 5; i >= 0; i--) { + glBegin(type); + glNormal3fv(&n[i][0]); + glVertex3fv(&v[faces[i][0]][0]); + glVertex3fv(&v[faces[i][1]][0]); + glVertex3fv(&v[faces[i][2]][0]); + glVertex3fv(&v[faces[i][3]][0]); + glEnd(); + } +} + +/* CENTRY */ +void APIENTRY +glutWireCube(GLdouble size) +{ + drawBox(size, GL_LINE_LOOP); +} + +void APIENTRY +glutSolidCube(GLdouble size) +{ + drawBox(size, GL_QUADS); +} + +/* ENDCENTRY */ + +static void +doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) +{ + int i, j; + GLfloat theta, phi, theta1; + GLfloat cosTheta, sinTheta; + GLfloat cosTheta1, sinTheta1; + GLfloat ringDelta, sideDelta; + + ringDelta = 2.0 * M_PI / rings; + sideDelta = 2.0 * M_PI / nsides; + + theta = 0.0; + cosTheta = 1.0; + sinTheta = 0.0; + for (i = rings - 1; i >= 0; i--) { + theta1 = theta + ringDelta; + cosTheta1 = cos(theta1); + sinTheta1 = sin(theta1); + glBegin(GL_QUAD_STRIP); + phi = 0.0; + for (j = nsides; j >= 0; j--) { + GLfloat cosPhi, sinPhi, dist; + + phi += sideDelta; + cosPhi = cos(phi); + sinPhi = sin(phi); + dist = R + r * cosPhi; + + glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); + glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); + glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); + glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); + } + glEnd(); + theta = theta1; + cosTheta = cosTheta1; + sinTheta = sinTheta1; + } +} + +/* CENTRY */ +void APIENTRY +glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + doughnut(innerRadius, outerRadius, nsides, rings); + glPopAttrib(); +} + +void APIENTRY +glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + doughnut(innerRadius, outerRadius, nsides, rings); +} + +/* ENDCENTRY */ + +static GLfloat dodec[20][3]; + +static void +initDodecahedron(void) +{ + GLfloat alpha, beta; + + alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); + beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - + 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); + /* *INDENT-OFF* */ + dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; + dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; + dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; + dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; + dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; + dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; + dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; + dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; + dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; + dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; + dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; + dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; + dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; + dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; + dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; + dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; + dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; + dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; + dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; + dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; + /* *INDENT-ON* */ + +} + +#define DIFF3(_a,_b,_c) { \ + (_c)[0] = (_a)[0] - (_b)[0]; \ + (_c)[1] = (_a)[1] - (_b)[1]; \ + (_c)[2] = (_a)[2] - (_b)[2]; \ +} + +static void +crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) +{ + GLfloat p[3]; /* in case prod == v1 or v2 */ + + p[0] = v1[1] * v2[2] - v2[1] * v1[2]; + p[1] = v1[2] * v2[0] - v2[2] * v1[0]; + p[2] = v1[0] * v2[1] - v2[0] * v1[1]; + prod[0] = p[0]; + prod[1] = p[1]; + prod[2] = p[2]; +} + +static void +normalize(GLfloat v[3]) +{ + GLfloat d; + + d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + if (d == 0.0) { + __glutWarning("normalize: zero length vector"); + v[0] = d = 1.0; + } + d = 1 / d; + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +static void +pentagon(int a, int b, int c, int d, int e, GLenum shadeType) +{ + GLfloat n0[3], d1[3], d2[3]; + + DIFF3(dodec[a], dodec[b], d1); + DIFF3(dodec[b], dodec[c], d2); + crossprod(d1, d2, n0); + normalize(n0); + + glBegin(shadeType); + glNormal3fv(n0); + glVertex3fv(&dodec[a][0]); + glVertex3fv(&dodec[b][0]); + glVertex3fv(&dodec[c][0]); + glVertex3fv(&dodec[d][0]); + glVertex3fv(&dodec[e][0]); + glEnd(); +} + +static void +dodecahedron(GLenum type) +{ + static int inited = 0; + + if (inited == 0) { + inited = 1; + initDodecahedron(); + } + pentagon(0, 1, 9, 16, 5, type); + pentagon(1, 0, 3, 18, 7, type); + pentagon(1, 7, 11, 10, 9, type); + pentagon(11, 7, 18, 19, 6, type); + pentagon(8, 17, 16, 9, 10, type); + pentagon(2, 14, 15, 6, 19, type); + pentagon(2, 13, 12, 4, 14, type); + pentagon(2, 19, 18, 3, 13, type); + pentagon(3, 0, 5, 12, 13, type); + pentagon(6, 15, 8, 10, 11, type); + pentagon(4, 17, 8, 15, 14, type); + pentagon(4, 12, 5, 16, 17, type); +} + +/* CENTRY */ +void APIENTRY +glutWireDodecahedron(void) +{ + dodecahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidDodecahedron(void) +{ + dodecahedron(GL_TRIANGLE_FAN); +} + +/* ENDCENTRY */ + +static void +recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, + GLenum shadeType) +{ + GLfloat q0[3], q1[3]; + + DIFF3(n1, n2, q0); + DIFF3(n2, n3, q1); + crossprod(q0, q1, q1); + normalize(q1); + + glBegin(shadeType); + glNormal3fv(q1); + glVertex3fv(n1); + glVertex3fv(n2); + glVertex3fv(n3); + glEnd(); +} + +static void +subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, + GLenum shadeType) +{ + int depth; + GLfloat w0[3], w1[3], w2[3]; + GLfloat l; + int i, j, k, n; + + depth = 1; + for (i = 0; i < depth; i++) { + for (j = 0; i + j < depth; j++) { + k = depth - i - j; + for (n = 0; n < 3; n++) { + w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; + w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) + / depth; + w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) + / depth; + } + l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); + w0[0] /= l; + w0[1] /= l; + w0[2] /= l; + l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); + w1[0] /= l; + w1[1] /= l; + w1[2] /= l; + l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); + w2[0] /= l; + w2[1] /= l; + w2[2] /= l; + recorditem(w1, w0, w2, shadeType); + } + } +} + +static void +drawtriangle(int i, GLfloat data[][3], int ndx[][3], + GLenum shadeType) +{ + GLfloat *x0, *x1, *x2; + + x0 = data[ndx[i][0]]; + x1 = data[ndx[i][1]]; + x2 = data[ndx[i][2]]; + subdivide(x0, x1, x2, shadeType); +} + +/* octahedron data: The octahedron produced is centered at the + origin and has radius 1.0 */ +static GLfloat odata[6][3] = +{ + {1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} +}; + +static int ondex[8][3] = +{ + {0, 4, 2}, + {1, 2, 4}, + {0, 3, 4}, + {1, 4, 3}, + {0, 2, 5}, + {1, 5, 2}, + {0, 5, 3}, + {1, 3, 5} +}; + +static void +octahedron(GLenum shadeType) +{ + int i; + + for (i = 7; i >= 0; i--) { + drawtriangle(i, odata, ondex, shadeType); + } +} + +/* CENTRY */ +void APIENTRY +glutWireOctahedron(void) +{ + octahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidOctahedron(void) +{ + octahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* icosahedron data: These numbers are rigged to make an + icosahedron of radius 1.0 */ + +#define X .525731112119133606 +#define Z .850650808352039932 + +static GLfloat idata[12][3] = +{ + {-X, 0, Z}, + {X, 0, Z}, + {-X, 0, -Z}, + {X, 0, -Z}, + {0, Z, X}, + {0, Z, -X}, + {0, -Z, X}, + {0, -Z, -X}, + {Z, X, 0}, + {-Z, X, 0}, + {Z, -X, 0}, + {-Z, -X, 0} +}; + +static int index[20][3] = +{ + {0, 4, 1}, + {0, 9, 4}, + {9, 5, 4}, + {4, 5, 8}, + {4, 8, 1}, + {8, 10, 1}, + {8, 3, 10}, + {5, 3, 8}, + {5, 2, 3}, + {2, 7, 3}, + {7, 10, 3}, + {7, 6, 10}, + {7, 11, 6}, + {11, 0, 6}, + {0, 1, 6}, + {6, 1, 10}, + {9, 0, 11}, + {9, 11, 2}, + {9, 2, 5}, + {7, 2, 11}, +}; + +static void +icosahedron(GLenum shadeType) +{ + int i; + + for (i = 19; i >= 0; i--) { + drawtriangle(i, idata, index, shadeType); + } +} + +/* CENTRY */ +void APIENTRY +glutWireIcosahedron(void) +{ + icosahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidIcosahedron(void) +{ + icosahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* tetrahedron data: */ + +#define T 1.73205080756887729 + +static GLfloat tdata[4][3] = +{ + {T, T, T}, + {T, -T, -T}, + {-T, T, -T}, + {-T, -T, T} +}; + +static int tndex[4][3] = +{ + {0, 1, 3}, + {2, 1, 0}, + {3, 2, 0}, + {1, 2, 3} +}; + +static void +tetrahedron(GLenum shadeType) +{ + int i; + + for (i = 3; i >= 0; i--) + drawtriangle(i, tdata, tndex, shadeType); +} + +/* CENTRY */ +void APIENTRY +glutWireTetrahedron(void) +{ + tetrahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidTetrahedron(void) +{ + tetrahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutState.h xpsb-glx-0.19/mesa/src/glut/beos/glutState.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutState.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutState.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,71 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutState.h + * + * DESCRIPTION: the global state for GLUT + * (takes the place of glutint.h in the C version) + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include "glutWindow.h" +#include "glutMenu.h" + +/*********************************************************** + * CLASS: GlutState + * + * DESCRIPTION: all the global state variables + ***********************************************************/ +struct GlutState { + BApplication *display; + thread_id appthread; + + int initX, initY; // initial window position + int initWidth, initHeight; // initial window size + unsigned int displayMode; // initial display mode + char *displayString; // verbose display mode + + GlutWindow *currentWindow; // current window + GlutMenu *currentMenu; // current menu + + GlutWindow **windowList; // array of pointers to windows + int windowListSize; // size of window list + + GLUTidleCB idle; // idle callback + GLUTmenuStatusCB menuStatus; // menu status callback + int modifierKeys; // only valid during keyboard callback + + bool debug; // call glGetError + bool quitAll; // quit + + GlutState() { + display = 0; + appthread = 0; + initX = initY = -1; + initWidth = initHeight = 300; + displayMode = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH; + displayString = 0; + currentWindow = 0; + currentMenu = 0; + windowList = 0; + windowListSize = 0; + idle = 0; + menuStatus = 0; + modifierKeys = ~0; + debug = quitAll = false; + } +}; + +/*********************************************************** + * Global variable (declared in glutInit.cpp) + ***********************************************************/ +extern GlutState gState; diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_stroke.c xpsb-glx-0.19/mesa/src/glut/beos/glut_stroke.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_stroke.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_stroke.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutstroke.h" + +void APIENTRY +glutStrokeCharacter(GLUTstrokeFont font, int c) +{ + const StrokeCharRec *ch; + const StrokeRec *stroke; + const CoordRec *coord; + StrokeFontPtr fontinfo; + int i, j; + + +#if defined(_WIN32) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + if (c < 0 || c >= fontinfo->num_chars) + return; + ch = &(fontinfo->ch[c]); + if (ch) { + for (i = ch->num_strokes, stroke = ch->stroke; + i > 0; i--, stroke++) { + glBegin(GL_LINE_STRIP); + for (j = stroke->num_coords, coord = stroke->coord; + j > 0; j--, coord++) { + glVertex2f(coord->x, coord->y); + } + glEnd(); + } + glTranslatef(ch->right, 0.0, 0.0); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutstroke.h xpsb-glx-0.19/mesa/src/glut/beos/glutstroke.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutstroke.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutstroke.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ +#ifndef __glutstroke_h__ +#define __glutstroke_h__ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#if defined(_WIN32) +#pragma warning (disable:4244) /* disable bogus conversion warnings */ +#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +#endif + +typedef struct { + float x; + float y; +} CoordRec, *CoordPtr; + +typedef struct { + int num_coords; + const CoordRec *coord; +} StrokeRec, *StrokePtr; + +typedef struct { + int num_strokes; + const StrokeRec *stroke; + float center; + float right; +} StrokeCharRec, *StrokeCharPtr; + +typedef struct { + const char *name; + int num_chars; + const StrokeCharRec *ch; + float top; + float bottom; +} StrokeFontRec, *StrokeFontPtr; + +typedef void *GLUTstrokeFont; + +#endif /* __glutstroke_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_swidth.c xpsb-glx-0.19/mesa/src/glut/beos/glut_swidth.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_swidth.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_swidth.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,58 @@ + +/* Copyright (c) Mark J. Kilgard, 1995. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutstroke.h" + +/* CENTRY */ +int APIENTRY +glutStrokeWidth(GLUTstrokeFont font, int c) +{ + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + +#if defined(_WIN32) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + if (c < 0 || c >= fontinfo->num_chars) + return 0; + ch = &(fontinfo->ch[c]); + if (ch) + return ch->right; + else + return 0; +} + +int APIENTRY +glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) +{ + int c, length; + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + +#if defined(_WIN32) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + length = 0; + for (; *string != '\0'; string++) { + c = *string; + if (c >= 0 && c < fontinfo->num_chars) { + ch = &(fontinfo->ch[c]); + if (ch) + length += ch->right; + } + } + return length; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_teapot.c xpsb-glx-0.19/mesa/src/glut/beos/glut_teapot.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_teapot.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_teapot.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,210 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include "glutint.h" + +/* Rim, body, lid, and bottom data must be reflected in x and + y; handle and spout data across the y axis only. */ + +static int patchdata[][16] = +{ + /* rim */ + {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}, + /* body */ + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27}, + {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40}, + /* lid */ + {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, + 101, 0, 1, 2, 3,}, + {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117}, + /* bottom */ + {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, + 125, 120, 40, 39, 38, 37}, + /* handle */ + {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56}, + {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 28, 65, 66, 67}, + /* spout */ + {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83}, + {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95} +}; +/* *INDENT-OFF* */ + +static float cpdata[][3] = +{ + {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, + -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, + {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, + 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, + 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, + 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, + {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, + 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, + {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, + 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, + 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, + {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, + {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, + -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, + -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, + 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, + 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, + 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, + {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, + -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, + 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, + -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, + 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, + 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, + 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, + {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, + -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, + 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, + {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, + {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, + {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, + 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, + 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, + -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, + 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, + 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, + 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, + {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, + -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, + 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, + {0.84, -1.5, 0.075} +}; + +static float tex[2][2][2] = +{ + { {0, 0}, + {1, 0}}, + { {0, 1}, + {1, 1}} +}; + +/* *INDENT-ON* */ + +static void +teapot(GLint grid, GLdouble scale, GLenum type) +{ + float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; + long i, j, k, l; + + glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_MAP2_VERTEX_3); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glPushMatrix(); + glRotatef(270.0, 1.0, 0.0, 0.0); + glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); + glTranslatef(0.0, 0.0, -1.5); + for (i = 0; i < 10; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + for (l = 0; l < 3; l++) { + p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 1) + q[j][k][l] *= -1.0; + if (i < 6) { + r[j][k][l] = + cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 0) + r[j][k][l] *= -1.0; + s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + if (l == 0) + s[j][k][l] *= -1.0; + if (l == 1) + s[j][k][l] *= -1.0; + } + } + } + } + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, + &tex[0][0][0]); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &p[0][0][0]); + glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &q[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + if (i < 6) { + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &r[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &s[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + } + } + glPopMatrix(); + glPopAttrib(); +} + +/* CENTRY */ +void APIENTRY +glutSolidTeapot(GLdouble scale) +{ + teapot(14, scale, GL_FILL); +} + +void APIENTRY +glutWireTeapot(GLdouble scale) +{ + teapot(10, scale, GL_LINE); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_tr10.c xpsb-glx-0.19/mesa/src/glut/beos/glut_tr10.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_tr10.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_tr10.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1777 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapTimesRoman10 XXX +#include "glutbitmap.h" +#undef glutBitmapTimesRoman10 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0xa0, +}; + +static const BitmapCharRec ch255 = {5,9,0,2,5,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {4,9,0,2,5,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {5,10,0,2,5,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {5,7,0,0,5,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {5,8,0,0,5,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch250 = {5,8,0,0,5,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {5,8,0,0,5,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x70,0x48,0x48,0x48,0x38,0x4, +}; + +static const BitmapCharRec ch248 = {6,7,1,1,5,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,0,0,6,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0xa0, +}; + +static const BitmapCharRec ch246 = {4,7,0,0,5,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch245 = {4,8,0,0,5,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch244 = {4,8,0,0,5,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch243 = {4,8,0,0,5,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {4,8,0,0,5,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xd8,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch241 = {5,8,0,0,5,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x60,0x90,0x90,0x90,0x70,0xa0,0x70,0x40, +}; + +static const BitmapCharRec ch240 = {4,8,0,0,5,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,7,0,0,4,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,8,0,0,4,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch237 = {3,8,0,0,4,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {3,8,0,0,4,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0, +}; + +static const BitmapCharRec ch235 = {3,7,0,0,4,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch234 = {3,8,0,0,4,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch233 = {3,8,0,0,4,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch232 = {3,8,0,0,4,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0xc0,0x20,0x40,0x60,0x80,0x80,0x80,0x60, +}; + +static const BitmapCharRec ch231 = {3,8,0,3,4,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0xd8,0xa0,0x70,0x28,0xd8, +}; + +static const BitmapCharRec ch230 = {5,5,0,0,6,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x40,0xa0,0x40, +}; + +static const BitmapCharRec ch229 = {3,8,0,0,4,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0, +}; + +static const BitmapCharRec ch228 = {3,7,0,0,4,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch227 = {4,8,0,0,4,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch226 = {3,8,0,0,4,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch225 = {3,8,0,0,4,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch224 = {3,8,0,0,4,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xe0,0x50,0x50,0x60,0x50,0x50,0x20, +}; + +static const BitmapCharRec ch223 = {4,7,0,0,5,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xe0,0x40,0x70,0x48,0x70,0x40,0xe0, +}; + +static const BitmapCharRec ch222 = {5,7,0,0,6,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x38,0x10,0x10,0x28,0x28,0x44,0xee,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,10,0,0,8,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28, +}; + +static const BitmapCharRec ch220 = {7,9,0,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {7,10,0,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch218 = {7,10,0,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {7,10,0,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x7c,0x66,0x52,0x52,0x4a,0x66,0x3e,0x1, +}; + +static const BitmapCharRec ch216 = {8,9,0,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,0,0,6,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50, +}; + +static const BitmapCharRec ch214 = {6,9,0,0,7,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {6,10,0,0,7,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch212 = {6,10,0,0,7,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {6,10,0,0,7,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch210 = {6,10,0,0,7,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xf8,0x4c,0x44,0xe4,0x44,0x4c,0xf8, +}; + +static const BitmapCharRec ch208 = {6,7,0,0,7,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,9,0,0,4,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,10,0,0,4,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch205 = {3,10,0,0,4,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {3,10,0,0,4,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50, +}; + +static const BitmapCharRec ch203 = {5,9,0,0,6,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch202 = {5,10,0,0,6,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {5,10,0,0,6,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch200 = {5,10,0,0,6,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x60,0x10,0x20,0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c, +}; + +static const BitmapCharRec ch199 = {6,10,0,3,7,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xef,0x49,0x78,0x2e,0x28,0x39,0x1f, +}; + +static const BitmapCharRec ch198 = {8,7,0,0,9,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,10,0,0,8,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,9,0,0,8,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,10,0,0,8,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,10,0,0,8,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,10,0,0,8,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,10,0,0,8,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0xe0,0xa0,0x80,0x40,0x40,0x0,0x40, +}; + +static const BitmapCharRec ch191 = {3,7,0,2,4,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x44,0x3e,0x2c,0xd4,0x28,0x48,0xe4, +}; + +static const BitmapCharRec ch190 = {7,7,0,0,8,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x4e,0x24,0x2a,0xf6,0x48,0xc8,0x44, +}; + +static const BitmapCharRec ch189 = {7,7,0,0,8,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x44,0x3e,0x2c,0xf4,0x48,0xc8,0x44, +}; + +static const BitmapCharRec ch188 = {7,7,0,0,8,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {4,4,0,-1,5,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0x40,0xa0,0x40, +}; + +static const BitmapCharRec ch186 = {3,5,0,-2,4,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,4,0,-3,3,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x20,0x40, +}; + +static const BitmapCharRec ch184 = {3,3,0,3,4,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0x80, +}; + +static const BitmapCharRec ch183 = {1,1,0,-2,2,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,9,0,2,6,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xe8,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch181 = {5,7,0,2,5,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-5,3,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0xe0, +}; + +static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xe0,0x40,0xa0,0x60, +}; + +static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xe0, +}; + +static const BitmapCharRec ch175 = {3,1,0,-6,4,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xba,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xe0, +}; + +static const BitmapCharRec ch173 = {3,1,0,-2,4,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch172 = {5,3,-1,-1,7,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x50,0xa0,0xa0,0x50, +}; + +static const BitmapCharRec ch171 = {4,4,0,-1,5,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xc0, +}; + +static const BitmapCharRec ch170 = {3,5,0,-2,4,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,-1,-6,5,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0xe0,0x90,0x20,0x50,0x90,0xa0,0x40,0x90,0x70, +}; + +static const BitmapCharRec ch167 = {4,9,0,1,5,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x0,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,7,0,0,2,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x70,0x20,0xf8,0x20,0xd8,0x50,0x88, +}; + +static const BitmapCharRec ch165 = {5,7,0,0,5,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x88,0x70,0x50,0x50,0x70,0x88, +}; + +static const BitmapCharRec ch164 = {5,6,0,-1,5,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xf0,0xc8,0x40,0xe0,0x40,0x50,0x30, +}; + +static const BitmapCharRec ch163 = {5,7,0,0,5,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x80,0xe0,0x90,0x80,0x90,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {4,7,0,1,5,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,7,-1,2,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,2,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,2,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-2,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0x80,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch125 = {3,9,0,2,4,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,9,0,2,2,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x20,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch123 = {3,9,0,2,4,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x90,0x40,0x20,0xf0, +}; + +static const BitmapCharRec ch122 = {4,5,0,0,5,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x40,0x40,0x20,0x30,0x50,0x48,0xdc, +}; + +static const BitmapCharRec ch121 = {6,7,1,2,5,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xd8,0x50,0x20,0x50,0xd8, +}; + +static const BitmapCharRec ch120 = {5,5,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x28,0x6c,0x54,0x92,0xdb, +}; + +static const BitmapCharRec ch119 = {8,5,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x60,0x50,0x90,0xd8, +}; + +static const BitmapCharRec ch118 = {5,5,0,0,5,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x68,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch117 = {5,5,0,0,5,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x30,0x40,0x40,0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch116 = {4,6,0,0,4,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0xe0,0x20,0x60,0x80,0xe0, +}; + +static const BitmapCharRec ch115 = {3,5,0,0,4,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xe0,0x40,0x40,0x60,0xa0, +}; + +static const BitmapCharRec ch114 = {3,5,0,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x38,0x10,0x70,0x90,0x90,0x90,0x70, +}; + +static const BitmapCharRec ch113 = {5,7,0,2,5,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0, +}; + +static const BitmapCharRec ch112 = {4,7,0,2,5,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x60,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch111 = {4,5,0,0,5,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xd8,0x90,0x90,0x90,0xe0, +}; + +static const BitmapCharRec ch110 = {5,5,0,0,5,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xdb,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {8,5,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch108 = {3,7,0,0,4,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x98,0x90,0xe0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {5,7,0,0,5,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x40,0x40,0x40,0x40,0x40,0xc0,0x0,0x40, +}; + +static const BitmapCharRec ch106 = {2,9,0,2,3,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x40,0x40,0x40,0x40,0xc0,0x0,0x40, +}; + +static const BitmapCharRec ch105 = {2,7,0,0,3,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xd8,0x90,0x90,0x90,0xe0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,7,0,0,5,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0xe0,0x90,0x60,0x40,0xa0,0xa0,0x70, +}; + +static const BitmapCharRec ch103 = {4,7,0,2,5,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0xe0,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,7,0,0,4,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x60,0x80,0xc0,0xa0,0x60, +}; + +static const BitmapCharRec ch101 = {3,5,0,0,4,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x90,0x90,0x90,0x70,0x10,0x30, +}; + +static const BitmapCharRec ch100 = {5,7,0,0,5,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x60,0x80,0x80,0x80,0x60, +}; + +static const BitmapCharRec ch99 = {3,5,0,0,4,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xe0,0x90,0x90,0x90,0xe0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {4,7,0,0,5,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0xe0,0xa0,0x60,0x20,0xc0, +}; + +static const BitmapCharRec ch97 = {3,5,0,0,4,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0x80, +}; + +static const BitmapCharRec ch96 = {2,2,0,-5,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xf8, +}; + +static const BitmapCharRec ch95 = {5,1,0,3,5,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0xa0,0xa0,0x40, +}; + +static const BitmapCharRec ch94 = {3,3,-1,-4,5,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,9,0,2,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x20,0x20,0x40,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {3,7,0,0,3,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,9,0,2,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xf8,0x88,0x40,0x20,0x10,0x88,0xf8, +}; + +static const BitmapCharRec ch90 = {5,7,0,0,6,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x38,0x10,0x10,0x28,0x28,0x44,0xee, +}; + +static const BitmapCharRec ch89 = {7,7,0,0,8,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xee,0x44,0x28,0x10,0x28,0x44,0xee, +}; + +static const BitmapCharRec ch88 = {7,7,0,0,8,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0xc9,0x80,0x88,0x80,0xdd,0xc0, +}; + +static const BitmapCharRec ch87 = {10,7,0,0,10,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x10,0x28,0x28,0x6c,0x44,0xee, +}; + +static const BitmapCharRec ch86 = {7,7,0,0,8,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee, +}; + +static const BitmapCharRec ch85 = {7,7,0,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x70,0x20,0x20,0x20,0x20,0xa8,0xf8, +}; + +static const BitmapCharRec ch84 = {5,7,0,0,6,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0xe0,0x90,0x10,0x60,0xc0,0x90,0x70, +}; + +static const BitmapCharRec ch83 = {4,7,0,0,5,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xec,0x48,0x50,0x70,0x48,0x48,0xf0, +}; + +static const BitmapCharRec ch82 = {6,7,0,0,7,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0xc,0x18,0x70,0xcc,0x84,0x84,0x84,0xcc,0x78, +}; + +static const BitmapCharRec ch81 = {6,9,0,2,7,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xe0,0x40,0x40,0x70,0x48,0x48,0xf0, +}; + +static const BitmapCharRec ch80 = {5,7,0,0,6,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78, +}; + +static const BitmapCharRec ch79 = {6,7,0,0,7,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee, +}; + +static const BitmapCharRec ch78 = {7,7,0,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xeb,0x80,0x49,0x0,0x55,0x0,0x55,0x0,0x63,0x0,0x63,0x0,0xe3,0x80, +}; + +static const BitmapCharRec ch77 = {9,7,0,0,10,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf8,0x48,0x40,0x40,0x40,0x40,0xe0, +}; + +static const BitmapCharRec ch76 = {5,7,0,0,6,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xec,0x48,0x50,0x60,0x50,0x48,0xec, +}; + +static const BitmapCharRec ch75 = {6,7,0,0,7,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0xc0,0xa0,0x20,0x20,0x20,0x20,0x70, +}; + +static const BitmapCharRec ch74 = {4,7,0,0,4,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0, +}; + +static const BitmapCharRec ch73 = {3,7,0,0,4,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xee,0x44,0x44,0x7c,0x44,0x44,0xee, +}; + +static const BitmapCharRec ch72 = {7,7,0,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x78,0xc4,0x84,0x9c,0x80,0xc4,0x7c, +}; + +static const BitmapCharRec ch71 = {6,7,0,0,7,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xe0,0x40,0x40,0x70,0x40,0x48,0xf8, +}; + +static const BitmapCharRec ch70 = {5,7,0,0,6,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8, +}; + +static const BitmapCharRec ch69 = {5,7,0,0,6,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf8,0x4c,0x44,0x44,0x44,0x4c,0xf8, +}; + +static const BitmapCharRec ch68 = {6,7,0,0,7,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c, +}; + +static const BitmapCharRec ch67 = {6,7,0,0,7,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf0,0x48,0x48,0x70,0x48,0x48,0xf0, +}; + +static const BitmapCharRec ch66 = {5,7,0,0,6,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10, +}; + +static const BitmapCharRec ch65 = {7,7,0,0,8,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x40,0x92,0xad,0xa5,0xa5,0x9d,0x42,0x3c, +}; + +static const BitmapCharRec ch64 = {8,9,0,2,9,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x40,0x0,0x40,0x40,0x20,0xa0,0xe0, +}; + +static const BitmapCharRec ch63 = {3,7,0,0,4,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {3,5,0,0,5,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf8,0x0,0xf8, +}; + +static const BitmapCharRec ch61 = {5,3,0,-1,6,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x20,0x40,0x80,0x40,0x20, +}; + +static const BitmapCharRec ch60 = {3,5,-1,0,5,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x80,0x80,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch59 = {1,7,-1,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,5,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0xc0,0x20,0x70,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch57 = {4,7,0,0,5,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x60,0x90,0x90,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch56 = {4,7,0,0,5,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x40,0x20,0x20,0x90,0xf0, +}; + +static const BitmapCharRec ch55 = {4,7,0,0,5,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x60,0x90,0x90,0x90,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch54 = {4,7,0,0,5,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0xe0,0x90,0x10,0x10,0xe0,0x40,0x70, +}; + +static const BitmapCharRec ch53 = {4,7,0,0,5,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x10,0x10,0xf8,0x90,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch52 = {5,7,0,0,5,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0xe0,0x10,0x10,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch51 = {4,7,0,0,5,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf0,0x40,0x20,0x20,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch50 = {4,7,0,0,5,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xe0,0x40,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch49 = {3,7,-1,0,5,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x60,0x90,0x90,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch48 = {4,7,0,0,5,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x20,0x20, +}; + +static const BitmapCharRec ch47 = {3,7,0,0,3,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf0, +}; + +static const BitmapCharRec ch45 = {4,1,-1,-2,7,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x80,0x80, +}; + +static const BitmapCharRec ch44 = {1,3,-1,2,3,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,0,0,6,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,0,-4,5,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,9,0,2,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,9,0,2,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x40,0xc0, +}; + +static const BitmapCharRec ch39 = {2,2,0,-5,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x76,0x8d,0x98,0x74,0x6e,0x50,0x30, +}; + +static const BitmapCharRec ch38 = {8,7,0,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x44,0x2a,0x2a,0x56,0xa8,0xa4,0x7e, +}; + +static const BitmapCharRec ch37 = {7,7,0,0,8,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0xe0,0x90,0x10,0x60,0x80,0x90,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {4,9,0,1,5,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0xf8,0x50,0xf8,0x50,0x50, +}; + +static const BitmapCharRec ch35 = {5,7,0,0,5,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,2,0,-5,4,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,7,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,2,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,2,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapTimesRoman10 = { +"-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_tr24.c xpsb-glx-0.19/mesa/src/glut/beos/glut_tr24.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_tr24.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_tr24.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2060 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapTimesRoman24 XXX +#include "glutbitmap.h" +#undef glutBitmapTimesRoman24 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch255 = {11,21,0,5,11,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, +0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0, +}; + +static const BitmapCharRec ch254 = {10,22,-1,5,12,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80, +}; + +static const BitmapCharRec ch253 = {11,22,0,5,11,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch252 = {11,16,-1,0,13,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch251 = {11,17,-1,0,13,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, +0x1,0x80, +}; + +static const BitmapCharRec ch250 = {11,17,-1,0,13,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch249 = {11,17,-1,0,13,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0, +0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0, +}; + +static const BitmapCharRec ch248 = {10,14,-1,1,12,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0, +0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch247 = {12,10,-1,-2,14,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch246 = {10,16,-1,0,12,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, +}; + +static const BitmapCharRec ch245 = {10,16,-1,0,12,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch244 = {10,17,-1,0,12,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, +0x1,0x80, +}; + +static const BitmapCharRec ch243 = {10,17,-1,0,12,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch242 = {10,17,-1,0,12,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, +}; + +static const BitmapCharRec ch241 = {11,16,-1,0,13,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80, +0xc0,0x0, +}; + +static const BitmapCharRec ch240 = {10,17,-1,0,12,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc, +}; + +static const BitmapCharRec ch239 = {6,16,0,0,6,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78, +0x30, +}; + +static const BitmapCharRec ch238 = {6,17,0,0,6,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38, +0x18, +}; + +static const BitmapCharRec ch237 = {5,17,-1,0,6,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0, +0xc0, +}; + +static const BitmapCharRec ch236 = {5,17,0,0,6,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch235 = {9,16,-1,0,11,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch234 = {9,17,-1,0,11,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch233 = {9,17,-1,0,11,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, +0x60,0x0, +}; + +static const BitmapCharRec ch232 = {9,17,-1,0,11,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0, +0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80, +0x63,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch231 = {9,18,-1,6,11,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc, +0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0, +}; + +static const BitmapCharRec ch230 = {14,12,-1,0,16,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch229 = {9,17,-1,0,11,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0, +}; + +static const BitmapCharRec ch228 = {9,16,-1,0,11,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0, +}; + +static const BitmapCharRec ch227 = {9,16,-1,0,11,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0, +0x18,0x0, +}; + +static const BitmapCharRec ch226 = {9,17,-1,0,11,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch225 = {9,17,-1,0,11,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, +0x60,0x0, +}; + +static const BitmapCharRec ch224 = {9,17,-1,0,11,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80, +0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch223 = {10,17,-1,0,12,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18, +0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0, +0xfc,0x0, +}; + +static const BitmapCharRec ch222 = {13,17,-1,0,15,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, +0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, +0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch221 = {16,22,0,0,16,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30, +}; + +static const BitmapCharRec ch220 = {16,21,-1,0,18,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, +}; + +static const BitmapCharRec ch219 = {16,22,-1,0,18,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch218 = {16,22,-1,0,18,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch217 = {16,22,-1,0,18,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3, +0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c, +0x1c,0x38,0x7,0xe4,0x0,0x4, +}; + +static const BitmapCharRec ch216 = {16,19,-1,1,18,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0, +0x61,0x80,0xc0,0xc0,0x80,0x40, +}; + +static const BitmapCharRec ch215 = {10,11,-2,-1,14,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60, +}; + +static const BitmapCharRec ch214 = {16,21,-1,0,18,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, +}; + +static const BitmapCharRec ch213 = {16,21,-1,0,18,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, +}; + +static const BitmapCharRec ch212 = {16,22,-1,0,18,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch211 = {16,22,-1,0,18,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch210 = {16,22,-1,0,18,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, +0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, +0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, +}; + +static const BitmapCharRec ch209 = {16,21,-1,0,18,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3, +0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38, +0x7f,0xe0, +}; + +static const BitmapCharRec ch208 = {16,17,0,0,17,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x0,0xcc,0xcc, +}; + +static const BitmapCharRec ch207 = {6,21,-1,0,8,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x7e,0x0,0x81,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch206 = {8,22,-1,0,8,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x40,0x30,0x1c,0xc, +}; + +static const BitmapCharRec ch205 = {6,22,-1,0,8,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x8,0x30,0xe0,0xc0, +}; + +static const BitmapCharRec ch204 = {6,22,-1,0,8,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80, +}; + +static const BitmapCharRec ch203 = {13,21,-1,0,15,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0, +}; + +static const BitmapCharRec ch202 = {13,22,-1,0,15,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0, +}; + +static const BitmapCharRec ch201 = {13,22,-1,0,15,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch200 = {13,22,-1,0,15,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38, +0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4, +}; + +static const BitmapCharRec ch199 = {14,23,-1,6,16,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8, +0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60, +0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60, +0x3,0xff,0xe0, +}; + +static const BitmapCharRec ch198 = {20,17,0,0,21,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0, +}; + +static const BitmapCharRec ch197 = {17,21,0,0,17,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0, +}; + +static const BitmapCharRec ch196 = {17,21,0,0,17,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0, +}; + +static const BitmapCharRec ch195 = {17,21,0,0,17,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1, +0x80,0x0, +}; + +static const BitmapCharRec ch194 = {17,22,0,0,17,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch193 = {17,22,0,0,17,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3, +0x0,0x0, +}; + +static const BitmapCharRec ch192 = {17,22,0,0,17,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc, +0xc, +}; + +static const BitmapCharRec ch191 = {8,17,-1,5,11,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3, +0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60, +0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0, +0x38,0x4,0x0, +}; + +static const BitmapCharRec ch190 = {17,17,0,0,18,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46, +0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, +0x20,0x8, +}; + +static const BitmapCharRec ch189 = {15,17,-1,0,18,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c, +0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, +0x20,0x8, +}; + +static const BitmapCharRec ch188 = {16,17,-1,0,18,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0, +0xcc,0x0,0x88,0x0, +}; + +static const BitmapCharRec ch187 = {9,10,-2,-1,12,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78, +}; + +static const BitmapCharRec ch186 = {6,9,-1,-8,8,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, +}; + +static const BitmapCharRec ch185 = {5,10,-1,-7,7,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0x78,0xcc,0xc,0x3c,0x30,0x10, +}; + +static const BitmapCharRec ch184 = {6,6,-1,6,8,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-2,-6,6,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0, +0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0, +0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80, +}; + +static const BitmapCharRec ch182 = {9,22,-1,5,11,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0xe1,0xc0, +}; + +static const BitmapCharRec ch181 = {11,17,-1,5,13,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x60,0x38,0x18, +}; + +static const BitmapCharRec ch180 = {5,4,-2,-13,8,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38, +}; + +static const BitmapCharRec ch179 = {6,10,0,-7,7,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38, +}; + +static const BitmapCharRec ch178 = {6,10,0,-7,7,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch177 = {12,15,-1,0,14,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x38,0x44,0x82,0x82,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch176 = {7,7,-1,-10,9,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc,0xfc, +}; + +static const BitmapCharRec ch175 = {6,2,-1,-14,8,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2, +0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10, +0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, +0x7,0xf0,0x0, +}; + +static const BitmapCharRec ch174 = {17,17,-1,0,19,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfe,0xfe, +}; + +static const BitmapCharRec ch173 = {7,2,-1,-5,9,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch172 = {12,7,-1,-3,14,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0, +0x19,0x80,0x8,0x80, +}; + +static const BitmapCharRec ch171 = {9,10,-2,-1,13,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78, +}; + +static const BitmapCharRec ch170 = {7,9,0,-8,8,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4, +0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0, +0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, +0x7,0xf0,0x0, +}; + +static const BitmapCharRec ch169 = {17,17,-1,0,19,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xcc,0xcc, +}; + +static const BitmapCharRec ch168 = {6,2,-1,-14,8,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70, +0x60,0x46,0x26,0x1c, +}; + +static const BitmapCharRec ch167 = {8,20,-2,2,12,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch166 = {2,17,-2,0,6,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0, +0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30, +0xf8,0x7c, +}; + +static const BitmapCharRec ch165 = {14,17,0,0,14,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60, +}; + +static const BitmapCharRec ch164 = {11,12,-1,-3,13,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80, +0xf,0x0, +}; + +static const BitmapCharRec ch163 = {10,17,-1,0,12,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0, +0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0, +}; + +static const BitmapCharRec ch162 = {9,16,-1,2,12,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch161 = {2,17,-4,5,8,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,6,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,6,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20, +}; + +static const BitmapCharRec ch126 = {11,4,-1,-5,13,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18, +0x18,0x18,0x18,0x18,0x30,0xe0, +}; + +static const BitmapCharRec ch125 = {8,22,-1,5,10,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch124 = {2,17,-2,0,6,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18, +0x18,0x18,0x18,0x18,0xc,0x7, +}; + +static const BitmapCharRec ch123 = {8,22,-1,5,10,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff, +}; + +static const BitmapCharRec ch122 = {8,12,-1,0,10,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0, +}; + +static const BitmapCharRec ch121 = {11,17,0,5,11,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0, +0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0, +}; + +static const BitmapCharRec ch120 = {11,12,-1,0,13,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19, +0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3, +0x0,0xf1,0xe7,0x80, +}; + +static const BitmapCharRec ch119 = {17,12,0,0,17,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80, +0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0, +}; + +static const BitmapCharRec ch118 = {11,12,0,0,11,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0, +}; + +static const BitmapCharRec ch117 = {11,12,-1,0,13,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10, +}; + +static const BitmapCharRec ch116 = {7,15,0,0,7,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e, +}; + +static const BitmapCharRec ch115 = {8,12,-1,0,10,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6, +}; + +static const BitmapCharRec ch114 = {7,12,-1,0,8,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80, +0x1d,0x80, +}; + +static const BitmapCharRec ch113 = {10,17,-1,5,12,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, +0xee,0x0, +}; + +static const BitmapCharRec ch112 = {10,17,-1,5,12,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0, +}; + +static const BitmapCharRec ch111 = {10,12,-1,0,12,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0, +}; + +static const BitmapCharRec ch110 = {11,12,-1,0,13,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60, +0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f, +0x0,0xe7,0xe,0x0, +}; + +static const BitmapCharRec ch109 = {18,12,-1,0,20,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, +0xe0, +}; + +static const BitmapCharRec ch108 = {4,17,-1,0,6,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0, +0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch107 = {11,17,-1,0,12,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0x70,0x0,0x0,0x0,0x30,0x30, +}; + +static const BitmapCharRec ch106 = {4,22,0,5,6,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60, +0x60, +}; + +static const BitmapCharRec ch105 = {4,17,-1,0,6,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch104 = {11,17,-1,0,13,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0, +0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1f,0xc0, +}; + +static const BitmapCharRec ch103 = {11,17,-1,5,12,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16, +0xe, +}; + +static const BitmapCharRec ch102 = {7,17,0,0,7,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0, +}; + +static const BitmapCharRec ch101 = {9,12,-1,0,11,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80, +0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, +0x3,0x80, +}; + +static const BitmapCharRec ch100 = {10,17,-1,0,12,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch99 = {9,12,-1,0,11,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch98 = {10,17,-1,0,12,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0, +}; + +static const BitmapCharRec ch97 = {9,12,-1,0,11,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x60,0xe0,0x80,0xc0,0x60, +}; + +static const BitmapCharRec ch96 = {3,5,-2,-12,7,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff,0xf8,0xff,0xf8, +}; + +static const BitmapCharRec ch95 = {13,2,0,5,13,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch94 = {9,9,-1,-8,11,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0xf8, +}; + +static const BitmapCharRec ch93 = {5,21,-1,4,8,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0, +0xc0, +}; + +static const BitmapCharRec ch92 = {7,17,0,0,7,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xf8, +}; + +static const BitmapCharRec ch91 = {5,21,-2,4,8,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0, +0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70, +0xff,0xf0, +}; + +static const BitmapCharRec ch90 = {13,17,-1,0,15,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, +0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, +0xfc,0x3f, +}; + +static const BitmapCharRec ch89 = {16,17,0,0,16,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6, +0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0, +0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0, +0x7e,0xf,0x80, +}; + +static const BitmapCharRec ch88 = {18,17,0,0,18,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3, +0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c, +0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18, +0xfc,0x7e,0x7e, +}; + +static const BitmapCharRec ch87 = {23,17,0,0,23,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3, +0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18, +0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0, +0xfc,0x1f,0x80, +}; + +static const BitmapCharRec ch86 = {17,17,0,0,17,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f, +}; + +static const BitmapCharRec ch85 = {16,17,-1,0,18,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0, +0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc, +0xff,0xfc, +}; + +static const BitmapCharRec ch84 = {14,17,-1,0,16,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0, +0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0, +0x1e,0x40, +}; + +static const BitmapCharRec ch83 = {11,17,-1,0,13,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80, +0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch82 = {15,17,-1,0,16,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c, +0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0, +}; + +static const BitmapCharRec ch81 = {16,22,-1,5,18,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch80 = {13,17,-1,0,15,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0, +}; + +static const BitmapCharRec ch79 = {16,17,-1,0,18,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, +0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, +0xf0,0x1f, +}; + +static const BitmapCharRec ch78 = {16,17,-1,0,18,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21, +0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2, +0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0, +0xf0,0x0,0xf8, +}; + +static const BitmapCharRec ch77 = {21,17,-1,0,22,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0xfc,0x0, +}; + +static const BitmapCharRec ch76 = {13,17,-1,0,14,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80, +0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18, +0xfc,0x7e, +}; + +static const BitmapCharRec ch75 = {16,17,-1,0,17,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0x1f,0x80, +}; + +static const BitmapCharRec ch74 = {9,17,-1,0,11,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc, +}; + +static const BitmapCharRec ch73 = {6,17,-1,0,8,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30, +0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6, +0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0, +0xfc,0x1f,0x80, +}; + +static const BitmapCharRec ch72 = {17,17,-1,0,19,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, +0x7,0xe4, +}; + +static const BitmapCharRec ch71 = {16,17,-1,0,18,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20, +0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0, +}; + +static const BitmapCharRec ch70 = {12,17,-1,0,14,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0, +}; + +static const BitmapCharRec ch69 = {13,17,-1,0,15,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6, +0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch68 = {15,17,-1,0,17,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, +0x7,0xe4, +}; + +static const BitmapCharRec ch67 = {14,17,-1,0,16,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38, +0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch66 = {14,17,-1,0,16,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0, +}; + +static const BitmapCharRec ch65 = {17,17,0,0,17,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63, +0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc, +0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80, +0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0, +}; + +static const BitmapCharRec ch64 = {18,20,-2,3,22,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6, +0x7c, +}; + +static const BitmapCharRec ch63 = {8,17,-2,0,11,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0, +0x1c,0x0,0x70,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch62 = {11,11,-1,-1,13,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch61 = {12,6,-1,-4,14,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0, +0x7,0x0,0x1,0xc0,0x0,0x60, +}; + +static const BitmapCharRec ch60 = {11,11,-1,-1,13,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {3,14,-2,3,7,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,11,-2,0,6,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0, +0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80, +0x1e,0x0, +}; + +static const BitmapCharRec ch57 = {10,17,-1,0,12,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80, +0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch56 = {10,17,-1,0,12,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0, +0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0, +0x7f,0xc0, +}; + +static const BitmapCharRec ch55 = {10,17,-1,0,12,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0, +0x3,0xc0, +}; + +static const BitmapCharRec ch54 = {10,17,-1,0,12,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0, +0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80, +0x1f,0xc0, +}; + +static const BitmapCharRec ch53 = {10,17,-1,0,12,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0, +0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch52 = {10,17,-1,0,12,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80, +0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch51 = {9,17,-1,0,12,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0, +0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch50 = {10,17,-1,0,12,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18, +0x8, +}; + +static const BitmapCharRec ch49 = {8,17,-2,0,12,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch48 = {10,17,-1,0,12,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6, +0x6,0x3,0x3,0x3, +}; + +static const BitmapCharRec ch47 = {8,20,1,3,7,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-2,0,6,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch45 = {12,2,-1,-6,14,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0xc0,0x60,0x20,0xe0,0xc0, +}; + +static const BitmapCharRec ch44 = {3,5,-2,3,7,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0, +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch43 = {12,12,-1,-1,14,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch42 = {9,9,-2,-8,12,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18, +0x18,0x10,0x30,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {6,22,-1,5,8,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60, +0x60,0x20,0x30,0x10,0x8,0x4, +}; + +static const BitmapCharRec ch40 = {6,22,-1,5,8,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0xc0,0x60,0x20,0xe0,0xc0, +}; + +static const BitmapCharRec ch39 = {3,5,-3,-12,8,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10, +0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0, +0x7,0x80, +}; + +static const BitmapCharRec ch38 = {16,17,-1,0,18,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3, +0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60, +0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0, +}; + +static const BitmapCharRec ch37 = {17,16,-1,0,19,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60, +0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20, +0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0, +}; + +static const BitmapCharRec ch36 = {11,21,0,2,12,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0, +0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80, +0x8,0x80, +}; + +static const BitmapCharRec ch35 = {11,17,-1,0,13,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x88,0xcc,0xcc,0xcc,0xcc, +}; + +static const BitmapCharRec ch34 = {6,5,-1,-12,10,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch33 = {2,17,-3,0,8,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,6,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,6,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapTimesRoman24 = { +"-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_util.c xpsb-glx-0.19/mesa/src/glut/beos/glut_util.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_util.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_util.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,81 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include +#include + +#include "glutint.h" + +/* strdup is actually not a standard ANSI C or POSIX routine + so implement a private one for GLUT. OpenVMS does not have a + strdup; Linux's standard libc doesn't declare strdup by default + (unless BSD or SVID interfaces are requested). */ +char * +__glutStrdup(const char *string) +{ + char *copy; + + copy = (char*) malloc(strlen(string) + 1); + if (copy == NULL) + return NULL; + strcpy(copy, string); + return copy; +} + +void +__glutWarning(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Warning in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); +} + +/* CENTRY */ +void APIENTRY +glutReportErrors(void) +{ + GLenum error; + + while ((error = glGetError()) != GL_NO_ERROR) + __glutWarning("GL error: %s", gluErrorString(error)); +} +/* ENDCENTRY */ + +void +__glutFatalError(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal Error in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + exit(1); +} + +void +__glutFatalUsage(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal API Usage in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + abort(); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glut_vidresize.c xpsb-glx-0.19/mesa/src/glut/beos/glut_vidresize.c --- xpsb-glx-0.19/mesa/src/glut/beos/glut_vidresize.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glut_vidresize.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,230 @@ + +/* Copyright (c) Mark J. Kilgard, 1996. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#if !defined(_WIN32) && !defined(__BEOS__) +#include +#endif + +#ifdef __sgi +#include +#endif + +#include "glutint.h" + +/* Grumble. The IRIX 6.3 and early IRIX 6.4 OpenGL headers + support the video resize extension, but failed to define + GLX_SGIX_video_resize. */ +#ifdef GLX_SYNC_FRAME_SGIX +#define GLX_SGIX_video_resize 1 +#endif + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) +static int canVideoResize = -1; +static int videoResizeChannel; +#else +static int canVideoResize = 0; +#endif +static int videoResizeInUse = 0; +static int dx = -1, dy = -1, dw = -1, dh = -1; + +/* XXX Note that IRIX 6.2, 6.3, and some 6.4 versions have a + bug where programs seg-fault when they attempt video + resizing from an indirect OpenGL context (either local or + over a network). */ + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + +static volatile int errorCaught; + +/* ARGSUSED */ +static +catchXSGIvcErrors(Display * dpy, XErrorEvent * event) +{ + errorCaught = 1; + return 0; +} +#endif + +/* CENTRY */ +int APIENTRY +glutVideoResizeGet(GLenum param) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (canVideoResize < 0) { + canVideoResize = __glutIsSupportedByGLX("GLX_SGIX_video_resize"); + if (canVideoResize) { +#if __sgi + /* This is a hack because IRIX 6.2, 6.3, and some 6.4 + versions were released with GLX_SGIX_video_resize + being advertised by the X server though the video + resize extension is not actually supported. We try to + determine if the libGL.so we are using actually has a + video resize entrypoint before we try to use the + feature. */ + void (*func) (void); + void *glxDso = dlopen("libGL.so", RTLD_LAZY); + + func = (void (*)(void)) dlsym(glxDso, "glXQueryChannelDeltasSGIX"); + if (!func) { + canVideoResize = 0; + } else +#endif + { + char *channelString; + int (*handler) (Display *, XErrorEvent *); + + channelString = getenv("GLUT_VIDEO_RESIZE_CHANNEL"); + videoResizeChannel = channelString ? atoi(channelString) : 0; + + /* Work around another annoying problem with SGI's + GLX_SGIX_video_resize implementation. Early IRIX + 6.4 OpenGL's advertise the extension and have the + video resize API, but an XSGIvc X protocol errors + result trying to use the API. Set up an error + handler to intercept what would otherwise be a fatal + error. If an error was recieved, do not report that + video resize is possible. */ + handler = XSetErrorHandler(catchXSGIvcErrors); + + errorCaught = 0; + + glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, &dx, &dy, &dw, &dh); + + /* glXQueryChannelDeltasSGIX is an inherent X server + round-trip so we know we will have gotten either the + correct reply or and error by this time. */ + XSetErrorHandler(handler); + + /* Still yet another work around. In IRIX 6.4 betas, + glXQueryChannelDeltasSGIX will return as if it + succeeded, but the values are filled with junk. + Watch to make sure the delta variables really make + sense. */ + if (errorCaught || + dx < 0 || dy < 0 || dw < 0 || dh < 0 || + dx > 2048 || dy > 2048 || dw > 2048 || dh > 2048) { + canVideoResize = 0; + } + } + } + } +#endif /* GLX_SGIX_video_resize */ + + switch (param) { + case GLUT_VIDEO_RESIZE_POSSIBLE: + return canVideoResize; + case GLUT_VIDEO_RESIZE_IN_USE: + return videoResizeInUse; + case GLUT_VIDEO_RESIZE_X_DELTA: + return dx; + case GLUT_VIDEO_RESIZE_Y_DELTA: + return dy; + case GLUT_VIDEO_RESIZE_WIDTH_DELTA: + return dw; + case GLUT_VIDEO_RESIZE_HEIGHT_DELTA: + return dh; + case GLUT_VIDEO_RESIZE_X: + case GLUT_VIDEO_RESIZE_Y: + case GLUT_VIDEO_RESIZE_WIDTH: + case GLUT_VIDEO_RESIZE_HEIGHT: +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { + int x, y, width, height; + + glXQueryChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, &x, &y, &width, &height); + switch (param) { + case GLUT_VIDEO_RESIZE_X: + return x; + case GLUT_VIDEO_RESIZE_Y: + return y; + case GLUT_VIDEO_RESIZE_WIDTH: + return width; + case GLUT_VIDEO_RESIZE_HEIGHT: + return height; + } + } +#endif + return -1; + default: + __glutWarning("invalid glutVideoResizeGet parameter: %d", param); + return -1; + } +} + +void APIENTRY +glutSetupVideoResizing(void) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { + glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, __glutCurrentWindow->win); + videoResizeInUse = 1; + } else +#endif + __glutFatalError("glutEstablishVideoResizing: video resizing not possible.\n"); +} + +void APIENTRY +glutStopVideoResizing(void) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { + if (videoResizeInUse) { + glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, None); + videoResizeInUse = 0; + } + } +#endif +} + +/* ARGSUSED */ +void APIENTRY +glutVideoResize(int x, int y, int width, int height) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { +#ifdef GLX_SYNC_SWAP_SGIX + /* glXChannelRectSyncSGIX introduced in a patch to IRIX + 6.2; the original unpatched IRIX 6.2 behavior is always + GLX_SYNC_SWAP_SGIX. */ + glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, GLX_SYNC_SWAP_SGIX); +#endif + glXChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, x, y, width, height); + } +#endif +} + +/* ARGSUSED */ +void APIENTRY +glutVideoPan(int x, int y, int width, int height) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { +#ifdef GLX_SYNC_FRAME_SGIX + /* glXChannelRectSyncSGIX introduced in a patch to IRIX + 6.2; the original unpatched IRIX 6.2 behavior is always + GLX_SYNC_SWAP_SGIX. We just ignore that we cannot + accomplish GLX_SYNC_FRAME_SGIX on IRIX unpatched 6.2; + this means you'd need a glutSwapBuffers to actually + realize the video resize. */ + glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, GLX_SYNC_FRAME_SGIX); +#endif + glXChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, x, y, width, height); + } +#endif +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.cpp xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.cpp --- xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,633 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutWindow.cpp + * + * DESCRIPTION: all the routines for dealing with GlutWindows + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include "glutint.h" +#include "glutState.h" +#include "glutBlocker.h" + +/*********************************************************** + * FUNCTION: getUnusedWindowSlot + * + * DESCRIPTION: helper function to get a new window slot + ***********************************************************/ +static int +getUnusedWindowSlot() +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < gState.windowListSize; i++) { + if (!gState.windowList[i]) { + return i; + } + } + /* Allocate a new slot. */ + gState.windowListSize++; + gState.windowList = (GlutWindow **) + realloc(gState.windowList, + gState.windowListSize * sizeof(GlutWindow *)); + + if (!gState.windowList) + __glutFatalError("out of memory."); + gState.windowList[gState.windowListSize - 1] = NULL; + return gState.windowListSize - 1; +} + +/*********************************************************** + * FUNCTION: __glutDefaultDisplay + * __glutDefaultReshape + * + * DESCRIPTION: default display and reshape functions + ***********************************************************/ +static void +__glutDefaultDisplay(void) +{ + /* XXX Remove the warning after GLUT 3.0. */ + __glutWarning("The following is a new check for GLUT 3.0; update your code."); + __glutFatalError( + "redisplay needed for window %d, but no display callback.", + gState.currentWindow->num + 1); +} + +void +__glutDefaultReshape(int width, int height) +{ + /* Adjust the viewport of the window */ + glViewport(0, 0, (GLsizei) width, (GLsizei) height); +} + +/*********************************************************** + * CLASS: GlutWindow + * + * FUNCTION: (constructor) + * + * DESCRIPTION: creates a new GLUT window + * note: subwindows don't resize, but top-level windows + * follow all sides + ***********************************************************/ +GlutWindow::GlutWindow(GlutWindow *nparent, char *name, + int x, int y, int width, int height, ulong options) : + BGLView( + (nparent ? BRect(x,y,x+width-1,y+height-1) : + BRect(0,0,width-1,height-1)), name, + (nparent ? B_FOLLOW_NONE : B_FOLLOW_ALL_SIDES), + B_WILL_DRAW|B_FRAME_EVENTS|B_FULL_UPDATE_ON_RESIZE|B_PULSE_NEEDED, + options) +{ + // add myself to window list + num = getUnusedWindowSlot(); + gState.windowList[num] = this; + + // set up parent/children relationships + parent = nparent; + if (parent) { + siblings = parent->children; + parent->children = this; + } else { + siblings = 0; + } + children = 0; + + // initialize variables + cursor = GLUT_CURSOR_INHERIT; // default cursor + for (int i = 0; i < GLUT_MAX_MENUS; i++) { + menu[i] = 0; + } + m_width = width; + m_height = height; + m_buttons = 0; + + // clear callbacks + display = __glutDefaultDisplay; + reshape = __glutDefaultReshape; + mouse = 0; + motion = 0; + passive = 0; + entry = 0; + keyboard = 0; + visibility = 0; + special = 0; + windowStatus = 0; + + // clear event counters + anyevents = 1; + displayEvent = 1; // get a reshape and a display event right away + reshapeEvent = 1; + mouseEvent = 0; + motionEvent = 0; + passiveEvent = 0; + entryEvent = 0; + keybEvent = 0; + windowStatusEvent = 0; // DirectConnected() will report change in + visState = -1; // visibility + specialEvent = 0; + statusEvent = 0; + menuEvent = 0; + visible = true; + gBlock.QuickNewEvent(); + + // if i'm a subwindow, add me to my parent view + if (parent) { + parent->Window()->Lock(); + parent->AddChild(this); + parent->Window()->Unlock(); + } else { + // if I'm a top-level window, create my BWindow + GlutBWindow *mybwindow = new GlutBWindow( + BRect(x,y,x+width-1,y+height-1), name); + mybwindow->AddChild(this); + mybwindow->bgl = this; + mybwindow->Show(); + } + + // give me the keyboard focus (focus follows mouse, X style, as + // implemented in GlutWindow::MouseMoved()) + Window()->Lock(); + MakeFocus(); + Window()->Unlock(); + + // make myself the default window + __glutSetWindow(this); +} + +/*********************************************************** + * FUNCTION: glutCreateWindow (4.1) + * + * DESCRIPTION: creates a new GLUT window + ***********************************************************/ +int glutCreateWindow(const char *name) { + if (!be_app) + __glutInit(); + + ulong options; + if (!__glutConvertDisplayMode(&options)) { + __glutWarning("visual with necessary capabilities not found."); + } + + // if X or Y is negative, then start at a reasonable position + bool defaultxy = (gState.initX < 0) || (gState.initY < 0); + + GlutWindow *window = new GlutWindow(0, const_cast(name), + (defaultxy ? 50 : gState.initX), (defaultxy ? 50 : gState.initY), + gState.initWidth, gState.initHeight, options); + + return window->num + 1; +} + +/*********************************************************** + * FUNCTION: glutCreateSubWindow (4.2) + * + * DESCRIPTION: creates a new GLUT subwindow + * Note: a subwindow is a GlutWindow (which is actually + * a BGLView) without its own BWindow + ***********************************************************/ +int glutCreateSubWindow(int win, int x, int y, int width, int height) { + ulong options; + if (!__glutConvertDisplayMode(&options)) { + __glutFatalError("visual with necessary capabilities not found."); + } + + GlutWindow *window = new GlutWindow(gState.windowList[win-1], "child", + x, y, width, height, options); + + return window->num + 1; +} + +/*********************************************************** + * FUNCTION: __glutSetWindow + * + * DESCRIPTION: set the current window (utility function) + ***********************************************************/ +void +__glutSetWindow(GlutWindow * window) +{ + if (gState.currentWindow) + gState.currentWindow->UnlockGL(); + gState.currentWindow = window; + gState.currentWindow->LockGL(); +} + +/*********************************************************** + * FUNCTION: glutSetWindow (4.3) + * glutGetWindow + * + * DESCRIPTION: set and get the current window + ***********************************************************/ +void glutSetWindow(int win) { + GlutWindow *window; + + if (win < 1 || win > gState.windowListSize) { + __glutWarning("glutSetWindow attempted on bogus window."); + return; + } + window = gState.windowList[win - 1]; + if (!window) { + __glutWarning("glutSetWindow attempted on bogus window."); + return; + } + __glutSetWindow(window); +} + +int glutGetWindow() { + if (gState.currentWindow) { + return gState.currentWindow->num + 1; + } else { + return 0; + } +} + +/*********************************************************** + * FUNCTION: __glutDestroyWindow + * + * DESCRIPTION: recursively set entries to 0 + ***********************************************************/ +static void +__glutDestroyWindow(GlutWindow *window, GlutWindow *initialWindow) { + // first, find all children recursively and set their entries to 0 + GlutWindow *cur = window->children; + while (cur) { + GlutWindow *siblings = cur->siblings; + __glutDestroyWindow(cur, initialWindow); + cur = siblings; + } + + /* Remove from parent's children list (only necessary for + non-initial windows and subwindows!). */ + GlutWindow *parent = window->parent; + if (parent && parent == initialWindow->parent) { + GlutWindow **prev = &parent->children; + cur = parent->children; + while (cur) { + if (cur == window) { + *prev = cur->siblings; + break; + } + prev = &(cur->siblings); + cur = cur->siblings; + } + } + + // finally, check if we are the current window, and set to 0 + if (gState.currentWindow == window) { + gState.currentWindow = 0; + } + gState.windowList[window->num] = 0; +} + +/*********************************************************** + * FUNCTION: glutDestroyWindow (4.4) + * + * DESCRIPTION: destroy window and all its children + ***********************************************************/ +void glutDestroyWindow(int win) { + // can't destroy a window if another window has the GL context + if (gState.currentWindow) + gState.currentWindow->UnlockGL(); + + // lock the window + GlutWindow *window = gState.windowList[win-1]; + BWindow *bwindow = window->Window(); + bwindow->Lock(); + + // if win is the current window, set current window to 0 + if (gState.currentWindow == window) { + gState.currentWindow = 0; + } + + // recursively set child entries to 0 + __glutDestroyWindow(window, window); + + // try flushing OpenGL + window->LockGL(); + glFlush(); + window->UnlockGL(); + + // now, if the window was top-level, delete its BWindow + if(!window->parent) { + bwindow->Quit(); + } else { + // else, detach it from the BWindow and delete it + window->RemoveSelf(); + delete window; + bwindow->Unlock(); + } + // relock GL if the current window is still valid + if(gState.currentWindow) + gState.currentWindow->LockGL(); +} + +/*********************************************************** + * FUNCTION: __glutDestroyAllWindows + * + * DESCRIPTION: destroy all windows when exit() is called + * this seems to be necessary to avoid delays + * and crashes when using BDirectWindow + ***********************************************************/ +void __glutDestroyAllWindows() { + for(int i=0; iLock(); + gState.display->Quit(); + status_t ignored; + wait_for_thread(gState.appthread, &ignored); +} + +/*********************************************************** + * FUNCTION: glutPostRedisplay (4.5) + * + * DESCRIPTION: mark window as needing redisplay + ***********************************************************/ +void glutPostRedisplay() { + gState.currentWindow->Window()->Lock(); + gState.currentWindow->anyevents = true; + gState.currentWindow->displayEvent = true; + gState.currentWindow->Window()->Unlock(); + gBlock.QuickNewEvent(); +} + +/*********************************************************** + * FUNCTION: glutPostWindowRedisplay + * + * DESCRIPTION: mark window as needing redisplay + ***********************************************************/ +void glutPostWindowRedisplay(int win) { + GlutWindow *gwin = gState.windowList[win - 1]; + gwin->Window()->Lock(); + gwin->anyevents = true; + gwin->displayEvent = true; + gwin->Window()->Unlock(); + gBlock.QuickNewEvent(); +} + +/*********************************************************** + * FUNCTION: glutSwapBuffers (4.6) + * + * DESCRIPTION: swap buffers + ***********************************************************/ +void glutSwapBuffers() { + gState.currentWindow->SwapBuffers(); +} + +/*********************************************************** + * FUNCTION: glutPositionWindow (4.7) + * + * DESCRIPTION: move window + ***********************************************************/ +void glutPositionWindow(int x, int y) { + BDirectWindow *win = dynamic_cast(gState.currentWindow->Window()); + win->Lock(); + if (gState.currentWindow->parent) + gState.currentWindow->MoveTo(x, y); // move the child view + else { + if(win->IsFullScreen()) { + win->SetFullScreen(false); + } + win->MoveTo(x, y); // move the window + } + win->Unlock(); +} + +/*********************************************************** + * FUNCTION: glutReshapeWindow (4.8) + * + * DESCRIPTION: reshape window (we'll catch the callback + * when the view gets a Draw() message + ***********************************************************/ +void glutReshapeWindow(int width, int height) { + BDirectWindow *win = dynamic_cast(gState.currentWindow->Window()); + win->Lock(); + if (gState.currentWindow->parent) + gState.currentWindow->ResizeTo(width-1, height-1); // resize the child + else { + if(win->IsFullScreen()) { + win->SetFullScreen(false); + } + win->ResizeTo(width-1, height-1); // resize the parent + } + win->Unlock(); +} + +/*********************************************************** + * FUNCTION: glutFullScreen (4.9) + * + * DESCRIPTION: makes the window full screen + ***********************************************************/ +void glutFullScreen() { + BDirectWindow *win = dynamic_cast(gState.currentWindow->Window()); + win->Lock(); + win->SetFullScreen(true); + win->Unlock(); +} + +/*********************************************************** + * FUNCTION: glutPopWindow (4.10) + * glutPushWindow + * + * DESCRIPTION: change the stacking order of the current window + * NOTE: I can't figure out how to do this for windows, + * and there is no concept of "stacking order" for + * subwindows, so these are currently no-ops. + ***********************************************************/ +void glutPopWindow() { } +void glutPushWindow() { } + +/*********************************************************** + * FUNCTION: glutShowWindow (4.11) + * glutHideWindow + * glutIconifyWindow + * + * DESCRIPTION: change display status of current window + ***********************************************************/ +void glutShowWindow() { + gState.currentWindow->Window()->Lock(); + if (gState.currentWindow->parent) // subwindow + gState.currentWindow->Show(); + else { + if(gState.currentWindow->Window()->IsHidden()) + gState.currentWindow->Window()->Show(); // show the actual BWindow + gState.currentWindow->Window()->Minimize(false); + } + gState.currentWindow->Window()->Unlock(); +} + +void glutHideWindow() { + gState.currentWindow->Window()->Lock(); + if (gState.currentWindow->parent) // subwindow + gState.currentWindow->Hide(); + else + gState.currentWindow->Window()->Hide(); // show the actual BWindow + gState.currentWindow->Window()->Unlock(); +} + +void glutIconifyWindow() { + if(gState.currentWindow->parent) + __glutFatalError("can't iconify a subwindow"); + + gState.currentWindow->Window()->Lock(); + gState.currentWindow->Window()->Minimize(true); + gState.currentWindow->Window()->Unlock(); +} + +/*********************************************************** + * FUNCTION: glutSetWindowTitle (4.12) + * glutSetIconTitle + * + * DESCRIPTION: set the window title (icon title is same) + ***********************************************************/ +void glutSetWindowTitle(const char *name) { + if (gState.currentWindow->parent) + __glutFatalError("glutSetWindowTitle: isn't a top-level window"); + + gState.currentWindow->Window()->Lock(); + gState.currentWindow->Window()->SetTitle(name); + gState.currentWindow->Window()->Unlock(); +} + +void glutSetIconTitle(const char *name) { + glutSetWindowTitle(name); +} + +/*********************************************************** + * FUNCTION: __glutConvertDisplayMode + * + * DESCRIPTION: converts the current display mode into a BGLView + * display mode, printing warnings as appropriate. + * + * PARAMETERS: if options is non-NULL, the current display mode is + * returned in it. + * + * RETURNS: 1 if the current display mode is possible, else 0 + ***********************************************************/ +int __glutConvertDisplayMode(unsigned long *options) { + if (gState.displayString) { + /* __glutDisplayString should be NULL except if + glutInitDisplayString has been called to register a + different display string. Calling glutInitDisplayString + means using a string instead of an integer mask determine + the visual to use. This big ugly code is in glutDstr.cpp */ + return __glutConvertDisplayModeFromString(options); + } + + if(options) { + ulong newoptions = 0; + if(gState.displayMode & GLUT_ACCUM) + newoptions |= BGL_ACCUM; + if(gState.displayMode & GLUT_ALPHA) + newoptions |= BGL_ALPHA; + if(gState.displayMode & GLUT_DEPTH) + newoptions |= BGL_DEPTH; + if(gState.displayMode & GLUT_DOUBLE) + newoptions |= BGL_DOUBLE; + if(gState.displayMode & GLUT_STENCIL) + newoptions |= BGL_STENCIL; + *options = newoptions; + } + + if(gState.displayMode & GLUT_INDEX) { + __glutWarning("BeOS doesn't support indexed color"); + return 0; + } + if(gState.displayMode & GLUT_MULTISAMPLE) { + return 1; // try to go without multisampling + } + if(gState.displayMode & GLUT_STEREO) { + __glutWarning("BeOS doesn't support stereo windows"); + return 0; + } + if(gState.displayMode & GLUT_LUMINANCE) { + __glutWarning("BeOS doesn't support luminance color model"); + return 0; + } + return 1; // visual supported +} + +/*********************************************************** + * CLASS: GlutBWindow + * + * DESCRIPTION: very thin wrapper around BWindow + ***********************************************************/ +GlutBWindow::GlutBWindow(BRect frame, char *name) : + BDirectWindow(frame, name, B_TITLED_WINDOW, 0) { + fConnectionDisabled = false; + bgl = 0; + SetPulseRate(100000); + + if (!SupportsWindowMode()) { + __glutFatalError("video card doesn't support windowed operation"); + } +} + +void GlutBWindow::DirectConnected( direct_buffer_info *info ) { + bgl->DirectConnected(info); + if(bgl && !fConnectionDisabled) { + bgl->EnableDirectMode(true); + } + int newVisState; + if((info->buffer_state & B_DIRECT_MODE_MASK) == B_DIRECT_START) { + bgl->visible = true; + } + if(!bgl->visible || info->buffer_state == B_DIRECT_STOP) + newVisState = GLUT_HIDDEN; + else { + if (info->clip_list_count == 0) + newVisState = GLUT_FULLY_COVERED; + else if (info->clip_list_count == 1) + newVisState = GLUT_FULLY_RETAINED; + else + newVisState = GLUT_PARTIALLY_RETAINED; + } + if(newVisState != bgl->visState) { + bgl->visState = newVisState; + bgl->anyevents = bgl->windowStatusEvent = true; + gBlock.NewEvent(); + } +} + +GlutBWindow::~GlutBWindow() { + fConnectionDisabled = true; + if(bgl) { + bgl->EnableDirectMode(false); + } + if(!IsHidden()) + Hide(); + Sync(); +} + +bool GlutBWindow::QuitRequested() { + gState.quitAll = true; + gBlock.NewEvent(); + return false; // don't quit now, wait for main thread to do it +} + +void GlutBWindow::Minimize(bool minimize) { + bgl->visible = !minimize; + BWindow::Minimize(minimize); +} + +void GlutBWindow::Hide() { + BWindow::Hide(); + bgl->visible = false; +} + +void GlutBWindow::Show() { + BWindow::Show(); + bgl->visible = true; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.h xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.h --- xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/glutWindow.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,119 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. + * + * This program is freely distributable without licensing fees + * and is provided without guarantee or warrantee expressed or + * implied. This program is -not- in the public domain. + * + * + * FILE: glutWindow.h + * + * DESCRIPTION: the GlutWindow class saves all events for + * handling by main thread + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include + +/*********************************************************** + * CLASS: GlutWindow + * + * INHERITS FROM: BGLView (NOT BWindow!) + * + * DESCRIPTION: all information needed for windows and + * subwindows (handled as similarly as possible) + ***********************************************************/ +class GlutWindow : public BGLView { +public: + GlutWindow(GlutWindow *nparent, char *name, int x, int y, int width, + int height, ulong options); + + void KeyDown(const char *bytes, int32 numBytes); + void MouseDown(BPoint point); + void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + void FrameResized(float width, float height); + void Draw(BRect updateRect); + void Pulse(); // needed since MouseUp() is broken + void MouseCheck(); // check for button state changes + void ErrorCallback(GLenum errorCode); + + static long MenuThread(void *menu); + + int num; // window number returned to user + int cursor; // my cursor +#define GLUT_MAX_MENUS 3 + int menu[GLUT_MAX_MENUS]; // my popup menus + int m_width, m_height; // the last width and height reported to GLUT + uint32 m_buttons; // the last mouse button state + + /* Window relationship state. */ + GlutWindow *parent; /* parent window */ + GlutWindow *children; /* first child window */ + GlutWindow *siblings; /* next sibling */ + + // leave out buttons and dials callbacks that we don't support + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + GLUTwindowStatusCB windowStatus; /* window status */ + + bool anyevents; // were any events received? + bool displayEvent; // call display + bool reshapeEvent; // call reshape + bool mouseEvent; // call mouse + bool motionEvent; // call motion + bool passiveEvent; // call passive + bool entryEvent; // call entry + bool keybEvent; // call keyboard + bool windowStatusEvent; // call visibility + bool specialEvent; // call special + bool statusEvent; // menu status changed + bool menuEvent; // menu selected + + int button, mouseState; // for mouse callback + int mouseX, mouseY; // for mouse callback + int motionX, motionY; // for motion callback + int passiveX, passiveY; // for passive callback + int entryState; // for entry callback + unsigned char key; // for keyboard callback + int keyX, keyY; // for keyboard callback + int visState; // for visibility callback + int specialKey; // for special key callback + int specialX, specialY; // for special callback + int modifierKeys; // modifier key state + int menuStatus; // for status callback + int statusX, statusY; // for status callback + int menuNumber; // for menu and status callbacks + int menuValue; // for menu callback + bool visible; // for visibility callback +}; + +/*********************************************************** + * CLASS: GlutBWindow + * + * INHERITS FROM: BDirectWindow + * + * DESCRIPTION: basically a BWindow that won't quit + ***********************************************************/ +class GlutBWindow : public BDirectWindow { +public: + GlutBWindow(BRect frame, char *name); + ~GlutBWindow(); + void DirectConnected(direct_buffer_info *info); + bool QuitRequested(); // exits app + void Minimize(bool minimized); // minimized windows are not visible + void Hide(); + void Show(); + GlutWindow *bgl; + bool fConnectionDisabled; +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/beos/Makefile xpsb-glx-0.19/mesa/src/glut/beos/Makefile --- xpsb-glx-0.19/mesa/src/glut/beos/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/beos/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,98 @@ +# Makefile for GLUT +# +# NOTICE: The OpenGL Utility Toolkit (GLUT) distribution contains source +# code published in a book titled "Programming OpenGL for the X Window +# System" (ISBN: 0-201-48359-9) published by Addison-Wesley. The +# programs and associated files contained in the distribution were +# developed by Mark J. Kilgard and are Copyright 1994, 1995, 1996 by Mark +# J. Kilgard (unless otherwise noted). The programs are not in the +# public domain, but they are freely distributable without licensing +# fees. These programs are provided without guarantee or warrantee +# expressed or implied. +# +# GLUT source included with Mesa with permission from Mark Kilgard. + +# src/glut/beos/Makefile + +TOP = ../../.. +include $(TOP)/configs/current + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 1 + +CPP_SOURCES = \ + glutBlocker.cpp \ + glutInit.cpp \ + glutWindow.cpp \ + glutEvent.cpp \ + glutCallback.cpp \ + glutOverlay.cpp \ + glutGet.cpp \ + glutColor.cpp \ + glutCursor.cpp \ + glutMenu.cpp \ + glutDstr.cpp \ + beos_x11.cpp + +C_SOURCES = \ + glut_8x13.c \ + glut_9x15.c \ + glut_bitmap.c \ + glut_bwidth.c \ + glut_hel10.c \ + glut_hel12.c \ + glut_hel18.c \ + glut_tr10.c \ + glut_tr24.c \ + glut_mroman.c \ + glut_roman.c \ + glut_stroke.c \ + glut_swidth.c \ + glut_shapes.c \ + glut_teapot.c \ + glut_vidresize.c \ + glut_util.c \ + glut_ext.c + +OBJECTS = \ + $(CPP_SOURCES:.cpp=.o) \ + $(C_SOURCES:.c=.o) + +INCLUDES = \ + -I. \ + -I- \ + -I$(TOP)/include + +# Rules + +.cpp.o: + $(CC) -c $< $(INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) -o $@ + +.c.o: + $(CC) -c $< $(INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) -o $@ + + +# ---- TARGETS + +default: $(TOP)/$(LIB_DIR) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + +# Create the lib directory if missing +$(TOP)/$(LIB_DIR): + mkdir $(TOP)/$(LIB_DIR) + +# Make the library +$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + @$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + $(GLUT_LIB_DEPS) $(OBJECTS) + +clean: + -rm -f *.o + +depend: $(SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/callback.c xpsb-glx-0.19/mesa/src/glut/directfb/callback.c --- xpsb-glx-0.19/mesa/src/glut/directfb/callback.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/callback.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,300 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include +#include + +#include "internal.h" + + +typedef void (GLUTCALLBACK *__GlutTimerCallback) ( int value ); + +typedef struct __GlutTimer_s { + struct timeval interval; + struct timeval expire; + + __GlutTimerCallback func; + int value; + + struct __GlutTimer_s *next; +} __GlutTimer; + +/*****************************************************************************/ + +static __GlutTimer *g_timers = NULL; + +/*****************************************************************************/ + + +void GLUTAPIENTRY +glutDisplayFunc( void (GLUTCALLBACK *func) (void) ) +{ + display_func = func; +} + + +void GLUTAPIENTRY +glutReshapeFunc( void (GLUTCALLBACK *func) (int width, int height) ) +{ + reshape_func = func; +} + + +void GLUTAPIENTRY +glutKeyboardFunc( void (GLUTCALLBACK *func) (unsigned char key, int x, int y) ) +{ + keyboard_func = func; +} + + +void GLUTAPIENTRY +glutMouseFunc( void (GLUTCALLBACK *func) (int button, int state, int x, int y) ) +{ + mouse_func = func; +} + + +void GLUTAPIENTRY +glutMotionFunc( void (GLUTCALLBACK *func) (int x, int y) ) +{ + motion_func = func; +} + + +void GLUTAPIENTRY +glutPassiveMotionFunc( void (GLUTCALLBACK *func) (int x, int y) ) +{ + passive_motion_func = func; +} + + +void GLUTAPIENTRY +glutEntryFunc( void (GLUTCALLBACK *func) (int state) ) +{ + entry_func = func; +} + + +void GLUTAPIENTRY +glutVisibilityFunc( void (GLUTCALLBACK *func) (int state) ) +{ + visibility_func = func; +} + + +void GLUTAPIENTRY +glutMenuStateFunc( void (GLUTCALLBACK *func) (int state) ) +{ + menu_state_func = func; +} + + +void GLUTAPIENTRY +glutSpecialFunc( void (GLUTCALLBACK *func) (int key, int x, int y) ) +{ + special_func = func; +} + + +void GLUTAPIENTRY +glutSpaceballMotionFunc( void (GLUTCALLBACK *func) (int x, int y, int z) ) +{ +} + + +void GLUTAPIENTRY +glutSpaceballRotateFunc( void (GLUTCALLBACK *func) (int x, int y, int z) ) +{ +} + + +void GLUTAPIENTRY +glutSpaceballButtonFunc( void (GLUTCALLBACK *func) (int button, int state) ) +{ +} + + +void GLUTAPIENTRY +glutButtonBoxFunc( void (GLUTCALLBACK *func) (int button, int state) ) +{ +} + + +void GLUTAPIENTRY +glutDialsFunc( void (GLUTCALLBACK *func) (int dial, int value) ) +{ +} + + +void GLUTAPIENTRY +glutTabletMotionFunc( void (GLUTCALLBACK *func) (int x, int y) ) +{ +} + + +void GLUTAPIENTRY +glutTabletButtonFunc( void (GLUTCALLBACK *func) (int button, int state, int x, int y) ) +{ +} + + +void GLUTAPIENTRY +glutMenuStatusFunc( void (GLUTCALLBACK *func) (int status, int x, int y) ) +{ +} + + +void GLUTAPIENTRY +glutOverlayDisplayFunc( void (GLUTCALLBACK *func) (void) ) +{ +} + + +void GLUTAPIENTRY +glutWindowStatusFunc( void (GLUTCALLBACK *func) (int state) ) +{ +} + + +void GLUTAPIENTRY +glutKeyboardUpFunc( void (GLUTCALLBACK *func) (unsigned char key, int x, int y) ) +{ + keyboard_up_func = func; +} + + +void GLUTAPIENTRY +glutSpecialUpFunc( void (GLUTCALLBACK *func) (int key, int x, int y) ) +{ + special_up_func = func; +} + + +void GLUTAPIENTRY +glutJoystickFunc( void (GLUTCALLBACK *func)(unsigned int buttons, int x, int y, int z), int pollInterval ) +{ + joystick_func = func; + /* FIXME: take care of pollInterval */ +} + + +void GLUTAPIENTRY +glutIdleFunc( void (GLUTCALLBACK *func) (void) ) +{ + idle_func = func; +} + + +void GLUTAPIENTRY +glutTimerFunc( unsigned int msec, void (GLUTCALLBACK *func) (int value), int value ) +{ + __GlutTimer *timer; + + if (!func) + return; + + timer = calloc( 1, sizeof(__GlutTimer) ); + if (!timer) + __glutFatalError( "out of memory" ); + + timer->interval.tv_sec = msec / 1000; + timer->interval.tv_usec = (msec % 1000) * 1000; + + gettimeofday( &timer->expire, NULL ); + timer->expire.tv_usec += timer->interval.tv_usec; + timer->expire.tv_sec += timer->interval.tv_sec + timer->expire.tv_usec/1000000; + timer->expire.tv_usec %= 1000000; + + timer->func = func; + timer->value = value; + + timer->next = g_timers; + g_timers = timer; +} + + +void +__glutHandleTimers( void ) +{ + __GlutTimer *cur; + struct timeval now; + + for (cur = g_timers; cur; cur = cur->next ) { + gettimeofday( &now, NULL ); + + if (cur->expire.tv_sec > now.tv_sec || + (cur->expire.tv_sec == now.tv_sec && + cur->expire.tv_usec >= now.tv_usec)) + { + g_idle = GL_FALSE; + + cur->func( cur->value ); + + cur->expire.tv_usec += cur->interval.tv_usec; + cur->expire.tv_sec += cur->interval.tv_sec + cur->expire.tv_usec/1000000; + cur->expire.tv_usec %= 1000000; + } + } +} + + +GLboolean +__glutGetTimeout( int *ret_msec ) +{ + __GlutTimer *cur; + struct timeval *time = NULL; + struct timeval now; + + for (cur = g_timers; cur; cur = cur->next) { + if (time == NULL || + time->tv_sec > cur->expire.tv_sec || + (time->tv_sec == cur->expire.tv_sec && + time->tv_usec > cur->expire.tv_usec)) { + time = &cur->expire; + } + } + + if (time == NULL) + return GL_FALSE; + + gettimeofday( &now, NULL ); + + *ret_msec = (time->tv_sec - now.tv_sec) * 1000 + + (time->tv_usec - now.tv_usec + 999) / 1000; + + return GL_TRUE; +} + + +void +__glutFreeTimers( void ) +{ + __GlutTimer *cur = g_timers; + + while (cur) { + __GlutTimer *next = cur->next; + free( cur ); + cur = next; + } + + g_timers = NULL; +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/color.c xpsb-glx-0.19/mesa/src/glut/directfb/color.c --- xpsb-glx-0.19/mesa/src/glut/directfb/color.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/color.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "internal.h" + + +void GLUTAPIENTRY +glutSetColor( int index, GLfloat red, GLfloat green, GLfloat blue ) +{ +} + + +GLfloat GLUTAPIENTRY +glutGetColor( int index, int component ) +{ + return 0.0; +} + + +void GLUTAPIENTRY +glutCopyColormap( int win ) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/cursor.c xpsb-glx-0.19/mesa/src/glut/directfb/cursor.c --- xpsb-glx-0.19/mesa/src/glut/directfb/cursor.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/cursor.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include + +#include "internal.h" + +#include "cursors.h" + + +void GLUTAPIENTRY +glutSetCursor( int type ) +{ + const unsigned char *cursor; + DFBSurfaceDescription dsc; + IDirectFBSurface *shape; + + if (!g_current || !g_current->window) + return; + + if (g_current->cursor == type) + return; + + switch (type) { + case GLUT_CURSOR_RIGHT_ARROW: + cursor = &cur_right_arrow[0]; + break; + case GLUT_CURSOR_LEFT_ARROW: + cursor = &cur_left_arrow[0]; + break; + case GLUT_CURSOR_INFO: + cursor = &cur_info[0]; + break; + case GLUT_CURSOR_DESTROY: + cursor = &cur_destroy[0]; + break; + case GLUT_CURSOR_HELP: + cursor = &cur_help[0]; + break; + case GLUT_CURSOR_CYCLE: + cursor = &cur_cycle[0]; + break; + case GLUT_CURSOR_SPRAY: + cursor = &cur_spray[0]; + break; + case GLUT_CURSOR_WAIT: + cursor = &cur_wait[0]; + break; + case GLUT_CURSOR_TEXT: + cursor = &cur_text[0]; + break; + case GLUT_CURSOR_CROSSHAIR: + cursor = &cur_crosshair[0]; + break; + case GLUT_CURSOR_UP_DOWN: + cursor = &cur_up_down[0]; + break; + case GLUT_CURSOR_LEFT_RIGHT: + cursor = &cur_left_right[0]; + break; + case GLUT_CURSOR_TOP_SIDE: + cursor = &cur_top_side[0]; + break; + case GLUT_CURSOR_BOTTOM_SIDE: + cursor = &cur_bottom_side[0]; + break; + case GLUT_CURSOR_LEFT_SIDE: + cursor = &cur_left_side[0]; + break; + case GLUT_CURSOR_RIGHT_SIDE: + cursor = &cur_right_side[0]; + break; + case GLUT_CURSOR_TOP_LEFT_CORNER: + cursor = &cur_top_left[0]; + break; + case GLUT_CURSOR_TOP_RIGHT_CORNER: + cursor = &cur_top_right[0]; + break; + case GLUT_CURSOR_BOTTOM_RIGHT_CORNER: + cursor = &cur_bottom_right[0]; + break; + case GLUT_CURSOR_BOTTOM_LEFT_CORNER: + cursor = &cur_bottom_left[0]; + break; + case GLUT_CURSOR_NONE: + cursor = NULL; + break; + default: + cursor = &cur_right_arrow[0]; + break; + } + + dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; + dsc.width = + dsc.height = cursor ? cursor[0] : 8; + dsc.pixelformat = DSPF_ARGB; + + if (dfb->CreateSurface( dfb, &dsc, &shape )) + return; + + if (cursor) { + __u8 *src = (__u8*) &cursor[3]; + __u8 *msk = src + cursor[0]*cursor[0]/8; + void *dst; + int pitch; + int x, y; + + if (shape->Lock( shape, DSLF_WRITE, &dst, &pitch )) { + shape->Release( shape ); + return; + } + + for (y = 0; y < cursor[0]; y++) { + for (x = 0; x < cursor[0]; x++) { + ((__u32*)dst)[x] = + ((src[x>>3] & (0x80 >> (x&7))) ? 0 : 0x00ffffff) | + ((msk[x>>3] & (0x80 >> (x&7))) ? 0xff000000 : 0); + } + + dst += pitch; + src += cursor[0]/8; + msk += cursor[0]/8; + } + + shape->Unlock( shape ); + } + else { + /* Invisible cursor */ + shape->Clear( shape, 0, 0, 0, 0 ); + } + + g_current->window->SetCursorShape( g_current->window, shape, + cursor ? cursor[1] : 0, + cursor ? cursor[2] : 0 ); + g_current->cursor = type; + + shape->Release( shape ); +} + + +void GLUTAPIENTRY +glutWarpPointer( int x, int y ) +{ + if (g_current) { + if (!g_game) { + int wx, wy; + g_current->window->GetPosition( g_current->window, &wx, &wy ); + primary->WarpCursor( primary, wx+x, wy+y ); + } + else { + g_current->cx = x; + g_current->cy = y; + } + } +} + + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/cursors.h xpsb-glx-0.19/mesa/src/glut/directfb/cursors.h --- xpsb-glx-0.19/mesa/src/glut/directfb/cursors.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/cursors.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,306 @@ +#ifndef __GLUT_CURSORS_H__ +#define __GLUT_CURSORS_H__ + + +static const unsigned char cur_right_arrow[] = { + 16, /* size */ + 1, 2, /* hotspot */ + /* data */ + 0x00, 0x00, 0x60, 0x00, 0x78, 0x00, 0x3e, 0x00, + 0x3f, 0x80, 0x1f, 0xe0, 0x1f, 0xf8, 0x0f, 0x80, + 0x0f, 0xc0, 0x06, 0xe0, 0x06, 0x70, 0x02, 0x38, + 0x02, 0x1c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, + /* mask */ + 0xe0, 0x00, 0xf8, 0x00, 0xfe, 0x00, 0x7f, 0x80, + 0x7f, 0xe0, 0x3f, 0xf8, 0x3f, 0xfc, 0x1f, 0xfc, + 0x1f, 0xe0, 0x0f, 0xf0, 0x0f, 0xf8, 0x07, 0x7c, + 0x07, 0x3e, 0x02, 0x1f, 0x00, 0x0e, 0x00, 0x04, +}; + +static const unsigned char cur_left_arrow[] = { + 16, /* size */ + 1, 15, /* hotspot */ + /* data */ + 0x00, 0x00, 0x80, 0x06, 0x00, 0x1e, 0x00, 0x7c, + 0x01, 0xfc, 0x07, 0xf8, 0x1f, 0xf8, 0x01, 0xf0, + 0x01, 0xf0, 0x02, 0x60, 0x04, 0x60, 0x08, 0x40, + 0x10, 0x40, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, + /* mask */ + 0x00, 0x07, 0x00, 0x1f, 0x00, 0x7f, 0x01, 0xfe, + 0x07, 0xfe, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, + 0x03, 0xf8, 0x07, 0xf0, 0x0e, 0xf0, 0x1c, 0xe0, + 0x38, 0xe0, 0x70, 0xe0, 0xe0, 0x00, 0xc0, 0x00, +}; + +static const unsigned char cur_info[] = { + 16, /* size */ + 0, 2, /* hotspot */ + /* data */ + 0x30, 0x00, 0x3c, 0x00, 0x0f, 0x00, 0x07, 0x80, + 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x07, 0xf4, + 0x0f, 0xfe, 0x0f, 0xfa, 0x07, 0xe0, 0x03, 0xe0, + 0x00, 0x52, 0x00, 0x46, 0x00, 0x2c, 0x00, 0x18, + /* mask */ + 0xb8, 0x00, 0x3e, 0x00, 0x1f, 0x80, 0x0f, 0xc0, + 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xfc, 0x1f, 0xfe, + 0x1f, 0xfe, 0x1f, 0xfe, 0x0f, 0xfe, 0x07, 0xfe, + 0x03, 0xfe, 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x3c, +}; + +static const unsigned char cur_destroy[] = { + 16, /* size */ + 12, 8, /* hotspot */ + /* data */ + 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0c, 0xcc, + 0x0c, 0xcc, 0x07, 0xf8, 0x03, 0xf0, 0x01, 0xe0, + 0x21, 0xe1, 0x61, 0xe1, 0x10, 0xc2, 0x0e, 0x1c, + 0x01, 0xe0, 0x47, 0xf8, 0x7c, 0x0f, 0x20, 0x01, + /* mask */ + 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe, + 0x1f, 0xfe, 0x0f, 0xfc, 0x07, 0xf8, 0x83, 0xf1, + 0xe3, 0xf1, 0xf3, 0xf3, 0x39, 0xef, 0x1e, 0x1e, + 0x01, 0xe0, 0xc7, 0xfe, 0xff, 0xff, 0x7c, 0x0f, +}; + +static const unsigned char cur_help[] = { + 16, /* size */ + 7, 8, /* hotspot */ + /* data */ + 0x83, 0xe0, 0x07, 0xf0, 0x0e, 0x38, 0x0c, 0x18, + 0x0c, 0x38, 0x0e, 0x30, 0x07, 0x00, 0x03, 0xc0, + 0x01, 0xc0, 0x01, 0x40, 0x01, 0x40, 0x07, 0x70, + 0x03, 0x60, 0x01, 0xc0, 0x00, 0x80, 0x00, 0x00, + /* mask */ + 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, + 0x1e, 0x3c, 0x1e, 0x7c, 0x1f, 0x78, 0x0f, 0xf0, + 0x07, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x07, 0xf0, + 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, +}; + +static const unsigned char cur_cycle[] = { + 16, /* size */ + 7, 9, /* hotspot */ + /* data */ + 0x00, 0x00, 0x07, 0xe2, 0x0f, 0xf6, 0x18, 0x3e, + 0x10, 0x12, 0x00, 0x32, 0x00, 0x7e, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x00, 0x4c, 0x00, 0x48, 0x08, + 0x7c, 0x18, 0x6f, 0xf0, 0x47, 0xe0, 0x00, 0x00, + /* mask */ + 0x07, 0xe3, 0x0f, 0xf7, 0x1f, 0xff, 0x3f, 0xff, + 0x38, 0x3f, 0x30, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0xff, 0x00, 0xfe, 0x0c, 0xfc, 0x1c, + 0xff, 0xfc, 0xff, 0xf8, 0xef, 0xf0, 0xc7, 0xe0, +}; + +static const unsigned char cur_spray[] = { + 16, /* size */ + 2, 4, /* hotspot */ + /* data */ + 0x98, 0x00, 0x02, 0x00, 0x18, 0xb0, 0x02, 0x78, + 0x18, 0x58, 0x00, 0xfc, 0x00, 0x84, 0x00, 0x9c, + 0x00, 0x94, 0x00, 0x9c, 0x00, 0x94, 0x00, 0x9c, + 0x00, 0x9c, 0x00, 0x84, 0x00, 0x84, 0x00, 0xfc, + /* mask */ + 0x30, 0x00, 0x34, 0x60, 0x35, 0xf0, 0x35, 0xf0, + 0x35, 0xf8, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, + 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, + 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, +}; + +static const unsigned char cur_wait[] = { + 16, /* size */ + 9, 1, /* hotspot */ + /* data */ + 0x07, 0xf8, 0x07, 0xf8, 0x07, 0xf8, 0x0f, 0xfc, + 0x18, 0x86, 0x30, 0x83, 0xe0, 0x81, 0xe1, 0xc1, + 0xe1, 0xc1, 0xe0, 0x21, 0x30, 0x13, 0x18, 0x06, + 0x0f, 0xfc, 0x07, 0xf8, 0x07, 0xf8, 0x07, 0xf8, + /* mask */ + 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x1f, 0xfe, + 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, + 0x1f, 0xfe, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, +}; + +static const unsigned char cur_text[] = { + 16, /* size */ + 8, 8, /* hotspot */ + /* data */ + 0x00, 0x00, 0x0f, 0x70, 0x09, 0xc0, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x01, 0xc0, 0x07, 0x70, 0x00, 0x00, + /* mask */ + 0x0f, 0x78, 0x0f, 0xf8, 0x0f, 0xf8, 0x03, 0xe0, + 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, + 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, + 0x03, 0xe0, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0x78, +}; + +static const unsigned char cur_crosshair[] = { + 16, /* size */ + 7, 9, /* hotspot */ + /* data */ + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0xff, 0x7f, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, + /* mask */ + 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, + 0x01, 0xc0, 0x01, 0xc0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, + 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, +}; + +static const unsigned char cur_up_down[] = { + 16, /* size */ + 7, 8, /* hotspot */ + /* data */ + 0x00, 0x80, 0x09, 0xc0, 0x03, 0xe0, 0x07, 0xf0, + 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, + 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x07, 0xf0, + 0x03, 0xe0, 0x01, 0xc0, 0x00, 0x80, 0x00, 0x00, + /* mask */ + 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, + 0x0f, 0xf8, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, + 0x03, 0xe0, 0x03, 0xe0, 0x0f, 0xf8, 0x0f, 0xf8, + 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, 0x00, 0x00, +}; + +static const unsigned char cur_left_right[] = { + 16, /* size */ + 7, 8, /* hotspot */ + /* data */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x18, 0x0c, 0x3f, 0xfe, 0x78, 0x0f, + 0x3f, 0xfe, 0x18, 0x0c, 0x08, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* mask */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x18, + 0x1c, 0x1c, 0x3f, 0xfe, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x3f, 0xfe, 0x1c, 0x1c, 0x0c, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const unsigned char cur_top_side[] = { + 16, /* size */ + 1, 8, /* hotspot */ + /* data */ + 0x00, 0x00, 0xff, 0xfe, 0x3f, 0xfe, 0x00, 0x00, + 0x00, 0x80, 0x01, 0xc0, 0x02, 0xa0, 0x04, 0x90, + 0x08, 0x88, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, + /* mask */ + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, + 0x1d, 0xdc, 0x19, 0xcc, 0x01, 0xc0, 0x01, 0xc0, + 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, +}; + +static const unsigned char cur_bottom_side[] = { + 16, /* size */ + 14, 8, /* hotspot */ + /* data */ + 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x08, 0x88, + 0x04, 0x90, 0x02, 0xa0, 0x01, 0xc0, 0x00, 0x80, + 0x00, 0x00, 0x3f, 0xfe, 0x3f, 0xfe, 0x00, 0x00, + /* mask */ + 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, + 0x01, 0xc0, 0x01, 0xc0, 0x19, 0xcc, 0x1d, 0xdc, + 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, +}; + +static const unsigned char cur_left_side[] = { + 16, /* size */ + 7, 15, /* hotspot */ + /* data */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x01, 0x06, + 0x00, 0x86, 0x00, 0x46, 0x00, 0x26, 0x7f, 0xf6, + 0x00, 0x26, 0x00, 0x46, 0x00, 0x86, 0x01, 0x06, + 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, + /* mask */ + 0x00, 0x0f, 0x00, 0x0f, 0x03, 0x0f, 0x03, 0x8f, + 0x01, 0xcf, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0xef, 0x01, 0xcf, 0x03, 0x8f, + 0x03, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00, +}; + +static const unsigned char cur_right_side[] = { + 16, /* size */ + 7, 2, /* hotspot */ + /* data */ + 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x80, + 0x61, 0x00, 0x62, 0x00, 0x64, 0x00, 0x6f, 0xfe, + 0x64, 0x00, 0x62, 0x00, 0x61, 0x00, 0x60, 0x80, + 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + /* mask */ + 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0xc0, 0xf1, 0xc0, + 0xf3, 0x80, 0xf7, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf7, 0x00, 0xf3, 0x80, 0xf1, 0xc0, + 0xf0, 0xc0, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, +}; + +static const unsigned char cur_top_left[] = { + 16, /* size */ + 1, 15, /* hotspot */ + /* data */ + 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfe, 0x00, 0x06, + 0x00, 0x06, 0x00, 0x06, 0x1f, 0xc6, 0x00, 0xc6, + 0x01, 0x46, 0x02, 0x46, 0x04, 0x46, 0x08, 0x46, + 0x10, 0x46, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, + /* mask */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x0f, 0x3f, 0xef, 0x3f, 0xef, 0x3f, 0xef, + 0x03, 0xef, 0x07, 0xef, 0x0e, 0xef, 0x1c, 0xef, + 0x38, 0xef, 0x30, 0xef, 0x00, 0x0f, 0x00, 0x0f, +}; + +static const unsigned char cur_top_right[] = { + 16, /* size */ + 1, 2, /* hotspot */ + /* data */ + 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfe, 0x60, 0x00, + 0x60, 0x00, 0x60, 0x00, 0x63, 0xf8, 0x63, 0x00, + 0x62, 0x80, 0x62, 0x40, 0x62, 0x20, 0x62, 0x10, + 0x62, 0x08, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, + /* mask */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf0, 0x00, 0xf7, 0xfc, 0xf7, 0xfc, 0xf7, 0xfc, + 0xf7, 0xc0, 0xf7, 0xe0, 0xf7, 0x70, 0xf7, 0x38, + 0xf7, 0x1c, 0xf7, 0x0c, 0xf0, 0x00, 0xf0, 0x00, +}; + +static const unsigned char cur_bottom_right[] = { + 16, /* size */ + 14, 2, /* hotspot */ + /* data */ + 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x62, 0x08, + 0x62, 0x10, 0x62, 0x20, 0x62, 0x40, 0x62, 0x80, + 0x63, 0x00, 0x63, 0xf8, 0x60, 0x00, 0x60, 0x00, + 0x60, 0x00, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00, + /* mask */ + 0xf0, 0x00, 0xf0, 0x00, 0xf7, 0x0c, 0xf7, 0x1c, + 0xf7, 0x38, 0xf7, 0x70, 0xf7, 0xe0, 0xf7, 0xc0, + 0xf7, 0xfc, 0xf7, 0xfc, 0xf7, 0xfc, 0xf0, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +static const unsigned char cur_bottom_left[] = { + 16, /* size */ + 14, 15, /* hotspot */ + /* data */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x10, 0x46, + 0x08, 0x46, 0x04, 0x46, 0x02, 0x46, 0x01, 0x46, + 0x00, 0xc6, 0x1f, 0xc6, 0x00, 0x06, 0x00, 0x06, + 0x00, 0x06, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00, + /* mask */ + 0x00, 0x0f, 0x00, 0x0f, 0x30, 0xef, 0x38, 0xef, + 0x1c, 0xef, 0x0e, 0xef, 0x07, 0xef, 0x03, 0xef, + 0x3f, 0xef, 0x3f, 0xef, 0x3f, 0xef, 0x00, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + + +#endif /* __GLUT_CURSORS_H__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/events.c xpsb-glx-0.19/mesa/src/glut/directfb/events.c --- xpsb-glx-0.19/mesa/src/glut/directfb/events.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/events.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,492 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include + +#include "internal.h" + + +/*****************************************************************************/ + +static int g_ignore_key_repeat = 0; + +/*****************************************************************************/ + + +int GLUTAPIENTRY +glutDeviceGet( GLenum type ) +{ + switch (type) { + case GLUT_HAS_KEYBOARD: + return (keyboard != NULL); + case GLUT_HAS_MOUSE: + return (mouse != NULL); + case GLUT_NUM_MOUSE_BUTTONS: + if (mouse) { + DFBInputDeviceDescription dsc; + mouse->GetDescription( mouse, &dsc ); + return dsc.max_button+1; + } + break; + case GLUT_DEVICE_IGNORE_KEY_REPEAT: + return g_ignore_key_repeat; + case GLUT_DEVICE_KEY_REPEAT: + return (g_ignore_key_repeat) ? GLUT_KEY_REPEAT_OFF + : GLUT_KEY_REPEAT_ON; + case GLUT_HAS_JOYSTICK: + case GLUT_OWNS_JOYSTICK: + return (g_game && joystick); /* only available in game mode */ + case GLUT_JOYSTICK_BUTTONS: + if (joystick) { + DFBInputDeviceDescription dsc; + joystick->GetDescription( joystick, &dsc ); + return dsc.max_button+1; + } + break; + case GLUT_JOYSTICK_AXES: + if (joystick) { + DFBInputDeviceDescription dsc; + joystick->GetDescription( joystick, &dsc ); + return dsc.max_axis+1; + } + break; + case GLUT_JOYSTICK_POLL_RATE: + if (joystick) + return 1; /* hack */ + break; + default: + break; + } + + return 0; +} + + +int GLUTAPIENTRY +glutGetModifiers( void ) +{ + if (g_current) + return g_current->modifiers; + return 0; +} + + +void GLUTAPIENTRY +glutIgnoreKeyRepeat( int ignore ) +{ + g_ignore_key_repeat = ignore; +} + + +void GLUTAPIENTRY +glutSetKeyRepeat( int mode ) +{ + g_ignore_key_repeat = (mode == GLUT_KEY_REPEAT_OFF); +} + + +void GLUTAPIENTRY +glutForceJoystickFunc( void ) +{ + if (g_game && joystick && joystick_func) { + joystick_func( g_game->buttons, + g_game->jx, g_game->jy, g_game->jz ); + } +} + + +static int +__glutSpecialKey( DFBInputDeviceKeySymbol key ) +{ + switch (key) { + case DIKS_F1: + return GLUT_KEY_F1; + case DIKS_F2: + return GLUT_KEY_F2; + case DIKS_F3: + return GLUT_KEY_F3; + case DIKS_F4: + return GLUT_KEY_F4; + case DIKS_F5: + return GLUT_KEY_F5; + case DIKS_F6: + return GLUT_KEY_F6; + case DIKS_F7: + return GLUT_KEY_F7; + case DIKS_F8: + return GLUT_KEY_F8; + case DIKS_F9: + return GLUT_KEY_F9; + case DIKS_F10: + return GLUT_KEY_F10; + case DIKS_F11: + return GLUT_KEY_F11; + case DIKS_F12: + return GLUT_KEY_F12; + case DIKS_CURSOR_LEFT: + return GLUT_KEY_LEFT; + case DIKS_CURSOR_UP: + return GLUT_KEY_UP; + case DIKS_CURSOR_RIGHT: + return GLUT_KEY_RIGHT; + case DIKS_CURSOR_DOWN: + return GLUT_KEY_DOWN; + case DIKS_PAGE_UP: + return GLUT_KEY_PAGE_UP; + case DIKS_PAGE_DOWN: + return GLUT_KEY_PAGE_DOWN; + case DIKS_HOME: + return GLUT_KEY_HOME; + case DIKS_END: + return GLUT_KEY_END; + case DIKS_INSERT: + return GLUT_KEY_INSERT; + default: + break; + } + + return 0; +} + + +static int +__glutButton( DFBInputDeviceButtonIdentifier button ) +{ + switch (button) { + case DIBI_LEFT: + return GLUT_LEFT_BUTTON; + case DIBI_MIDDLE: + return GLUT_MIDDLE_BUTTON; + case DIBI_RIGHT: + return GLUT_RIGHT_BUTTON; + default: + break; + } + + return 0; +} + + +static int +__glutModifiers( DFBInputDeviceModifierMask mask ) +{ + return ((mask & DIMM_SHIFT) ? GLUT_ACTIVE_SHIFT : 0) | + ((mask & DIMM_CONTROL) ? GLUT_ACTIVE_CTRL : 0) | + ((mask & DIMM_ALT) ? GLUT_ACTIVE_ALT : 0); +} + + +static void +__glutWindowEvent( DFBWindowEvent *e, DFBWindowEvent *p ) +{ + __GlutWindow *window; + + window = __glutFindWindow( e->window_id ); + if (!window) /* window was destroyed */ + return; + + switch (e->type) { + case DWET_KEYDOWN: + window->modifiers = __glutModifiers( e->modifiers ); + if (g_ignore_key_repeat && p) { + if (p->type == DWET_KEYDOWN && + p->window_id == e->window_id && + p->key_symbol == e->key_symbol) + break; + } + if (DFB_KEY_IS_ASCII( e->key_symbol )) { + if (keyboard_func) { + __glutSetWindow( window ); + keyboard_func( e->key_symbol, e->x, e->y ); + } + } + else { + int key = __glutSpecialKey( e->key_symbol ); + if (key && special_func) { + __glutSetWindow( window ); + special_func( key, e->x, e->y ); + } + } + break; + case DWET_KEYUP: + window->modifiers = __glutModifiers( e->modifiers ); + if (DFB_KEY_IS_ASCII( e->key_symbol )) { + if (keyboard_up_func) { + __glutSetWindow( window ); + keyboard_up_func( e->key_symbol, e->x, e->y ); + } + } + else { + int key = __glutSpecialKey( e->key_symbol ); + if (key && special_up_func) { + __glutSetWindow( window ); + special_up_func( key, e->x, e->y ); + } + } + break; + case DWET_BUTTONDOWN: + if (mouse_func) { + __glutSetWindow( window ); + mouse_func( __glutButton( e->button ), GLUT_DOWN, e->x, e->y ); + } + break; + case DWET_BUTTONUP: + if (mouse_func) { + __glutSetWindow( window ); + mouse_func( __glutButton( e->button ), GLUT_UP, e->x, e->y ); + } + break; + case DWET_MOTION: + if (e->buttons) { + if (motion_func) { + __glutSetWindow( window ); + motion_func( e->cx, e->cy ); + } + } + else { + if (passive_motion_func) { + __glutSetWindow( window ); + passive_motion_func( e->cx, e->cy ); + } + } + break; + case DWET_ENTER: + if (entry_func) { + __glutSetWindow( window ); + entry_func( GLUT_ENTERED ); + } + break; + case DWET_LEAVE: + if (entry_func) { + __glutSetWindow( window ); + entry_func( GLUT_LEFT ); + } + break; + case DWET_SIZE: + window->reshape = GL_TRUE; + window->redisplay = GL_TRUE; + break; + default: + break; + } +} + + +static void +__glutInputEvent( DFBInputEvent *e, DFBInputEvent *p ) +{ + __glutAssert( g_game != NULL ); + + switch (e->type) { + case DIET_KEYPRESS: + g_game->modifiers = __glutModifiers( e->modifiers ); + if (g_ignore_key_repeat && p) { + if (p->type == DIET_KEYPRESS && + p->key_symbol == e->key_symbol) + break; + } + if (DFB_KEY_IS_ASCII( e->key_symbol )) { + if (keyboard_func) { + __glutSetWindow( g_game ); + keyboard_func( e->key_symbol, g_game->cx, g_game->cy ); + } + } + else { + int key = __glutSpecialKey( e->key_symbol ); + if (key && special_func) { + __glutSetWindow( g_game ); + special_func( key, g_game->cx, g_game->cy ); + } + } + break; + case DIET_KEYRELEASE: + g_game->modifiers = __glutModifiers( e->modifiers ); + if (DFB_KEY_IS_ASCII( e->key_symbol )) { + if (keyboard_up_func) { + __glutSetWindow( g_game ); + keyboard_up_func( e->key_symbol, g_game->cx, g_game->cy ); + } + } + else { + int key = __glutSpecialKey( e->key_symbol ); + if (key && special_up_func) { + __glutSetWindow( g_game ); + special_up_func( key, g_game->cx, g_game->cy ); + } + } + break; + case DIET_BUTTONPRESS: + if (e->device_id == DIDID_JOYSTICK) { + g_game->buttons = e->buttons; + if (joystick_func) { + __glutSetWindow( g_game ); + joystick_func( g_game->buttons, + g_game->jx, g_game->jy, g_game->jz ); + } + } + else { + if (mouse_func) { + __glutSetWindow( g_game ); + mouse_func( __glutButton( e->button ), + GLUT_DOWN, g_game->cx, g_game->cy ); + } + } + break; + case DIET_BUTTONRELEASE: + if (e->device_id == DIDID_JOYSTICK) { + g_game->buttons = e->buttons; + if (joystick_func) { + __glutSetWindow( g_game ); + joystick_func( g_game->buttons, + g_game->jx, g_game->jy, g_game->jz ); + } + } + else { + if (mouse_func) { + __glutSetWindow( g_game ); + mouse_func( __glutButton( e->button ), + GLUT_UP, g_game->cx, g_game->cy ); + } + } + break; + case DIET_AXISMOTION: + if (e->device_id == DIDID_JOYSTICK) { + switch (e->axis) { + case DIAI_X: + if (e->flags & DIEF_AXISABS) + g_game->jx = e->axisabs; + else if (e->flags & DIEF_AXISREL) + g_game->jx += e->axisrel; + break; + case DIAI_Y: + if (e->flags & DIEF_AXISABS) + g_game->jy = e->axisabs; + else if (e->flags & DIEF_AXISREL) + g_game->jy += e->axisrel; + break; + case DIAI_Z: + if (e->flags & DIEF_AXISABS) + g_game->jz = e->axisabs; + else if (e->flags & DIEF_AXISREL) + g_game->jz += e->axisrel; + break; + default: + break; + } + if (joystick_func) { + __glutSetWindow( g_game ); + joystick_func( g_game->buttons, + g_game->jx, g_game->jy, g_game->jz ); + } + } + else { + switch (e->axis) { + case DIAI_X: + if (e->flags & DIEF_AXISABS) + g_game->cx = e->axisabs; + else if (e->flags & DIEF_AXISREL) + g_game->cx += e->axisrel; + break; + case DIAI_Y: + if (e->flags & DIEF_AXISABS) + g_game->cy = e->axisabs; + else if (e->flags & DIEF_AXISREL) + g_game->cy += e->axisrel; + break; + default: + return; + } + if (e->buttons && motion_func) { + __glutSetWindow( g_game ); + motion_func( g_game->cx, g_game->cy ); + } + else if (!e->buttons && passive_motion_func) { + __glutSetWindow( g_game ); + passive_motion_func( g_game->cx, g_game->cy ); + } + } + break; + default: + break; + } +} + + +void GLUTAPIENTRY +glutMainLoop( void ) +{ + __glutAssert( events != NULL ); + + __glutHandleWindows(); + + while (GL_TRUE) { + DFBEvent evt, prev; + + g_idle = GL_TRUE; + + __glutHandleTimers(); + + prev.clazz = DFEC_NONE; + + while (events->GetEvent( events, &evt ) == DFB_OK) { + g_idle = GL_FALSE; + + switch (evt.clazz) { + case DFEC_WINDOW: + if (prev.clazz == DFEC_WINDOW) + __glutWindowEvent( &evt.window, &prev.window ); + else + __glutWindowEvent( &evt.window, NULL ); + break; + case DFEC_INPUT: + if (prev.clazz == DFEC_INPUT) + __glutInputEvent( &evt.input, &prev.input ); + else + __glutInputEvent( &evt.input, NULL ); + break; + default: + __glutWarning( "unexpected event class %d!\n", evt.clazz ); + break; + } + + prev = evt; + + __glutHandleTimers(); + } + + __glutHandleWindows(); + + if (g_idle) { + if (idle_func) { + idle_func(); + } + else { + int msec; + __glutSetWindow( NULL ); + if (__glutGetTimeout( &msec )) + events->WaitForEventWithTimeout( events, msec/1000, msec%1000 ); + else + events->WaitForEvent( events ); + } + } + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/ext.c xpsb-glx-0.19/mesa/src/glut/directfb/ext.c --- xpsb-glx-0.19/mesa/src/glut/directfb/ext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/ext.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include + +#include "internal.h" + + +static const struct { + const char *name; + const GLUTproc address; +} glut_functions[] = { + { "glutInit", (const GLUTproc) glutInit }, + { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, + { "glutInitDisplayString", (const GLUTproc) glutInitDisplayString }, + { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, + { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, + { "glutMainLoop", (const GLUTproc) glutMainLoop }, + { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, + { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, + { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, + { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, + { "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay }, + { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, + { "glutGetWindow", (const GLUTproc) glutGetWindow }, + { "glutSetWindow", (const GLUTproc) glutSetWindow }, + { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, + { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, + { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, + { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, + { "glutPopWindow", (const GLUTproc) glutPopWindow }, + { "glutPushWindow", (const GLUTproc) glutPushWindow }, + { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, + { "glutShowWindow", (const GLUTproc) glutShowWindow }, + { "glutHideWindow", (const GLUTproc) glutHideWindow }, + { "glutFullScreen", (const GLUTproc) glutFullScreen }, + { "glutSetCursor", (const GLUTproc) glutSetCursor }, + { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, + { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, + { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, + { "glutUseLayer", (const GLUTproc) glutUseLayer }, + { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, + { "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay }, + { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, + { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, + { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, + { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, + { "glutGetMenu", (const GLUTproc) glutGetMenu }, + { "glutSetMenu", (const GLUTproc) glutSetMenu }, + { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, + { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, + { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, + { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, + { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, + { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, + { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, + { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, + { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, + { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, + { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, + { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, + { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, + { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, + { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, + { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, + { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, + { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, + { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, + { "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc }, + { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, + { "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc }, + { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, + { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, + { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, + { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, + { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, + { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, + { "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc }, + { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc }, + { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc }, + { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc }, + { "glutSetColor", (const GLUTproc) glutSetColor }, + { "glutGetColor", (const GLUTproc) glutGetColor }, + { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, + { "glutGet", (const GLUTproc) glutGet }, + { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, + { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, + { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, + { "glutLayerGet", (const GLUTproc) glutLayerGet }, + { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, + { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, + { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, + { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, + { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, + { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, + { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, + { "glutWireSphere", (const GLUTproc) glutWireSphere }, + { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, + { "glutWireCone", (const GLUTproc) glutWireCone }, + { "glutSolidCone", (const GLUTproc) glutSolidCone }, + { "glutWireCube", (const GLUTproc) glutWireCube }, + { "glutSolidCube", (const GLUTproc) glutSolidCube }, + { "glutWireTorus", (const GLUTproc) glutWireTorus }, + { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, + { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, + { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, + { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, + { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, + { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, + { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, + { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, + { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, + { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, + { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, +// { "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet }, +// { "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing }, +// { "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing }, +// { "glutVideoResize", (const GLUTproc) glutVideoResize }, +// { "glutVideoPan", (const GLUTproc) glutVideoPan }, + { "glutReportErrors", (const GLUTproc) glutReportErrors }, + { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat }, + { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat }, + { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc }, + { "glutGameModeString", (const GLUTproc) glutGameModeString }, + { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode }, + { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode }, + { "glutGameModeGet", (const GLUTproc) glutGameModeGet }, +}; + + +GLUTproc GLUTAPIENTRY +glutGetProcAddress( const char *name ) +{ + int i; + + for (i = 0; i < sizeof(glut_functions)/sizeof(glut_functions[0]); i++) { + if (!strcmp( name, glut_functions[i].name )) + return glut_functions[i].address; + } + +#if DIRECTFBGL_INTERFACE_VERSION >= 1 + if (g_current) { + void *address = NULL; + g_current->gl->GetProcAddress( g_current->gl, name, &address ); + return address; + } +#endif + return NULL; +} + + +int GLUTAPIENTRY +glutExtensionSupported( const char *name ) +{ + GLubyte *extensions; + int length; + + if (!name || !*name) + return 0; + + length = strlen( name ); + extensions = (GLubyte*) glGetString( GL_EXTENSIONS ); + + while (extensions && *extensions) { + GLubyte *next; + + next = strchr( extensions, ' ' ); + if (next) { + if (length == (int)(next - extensions)) { + if (!strncmp( extensions, name, length )) + return 1; + } + extensions = next+1; + } + else { + if (!strcmp( extensions, name )) + return 1; + break; + } + } + + return 0; +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/font.c xpsb-glx-0.19/mesa/src/glut/directfb/font.c --- xpsb-glx-0.19/mesa/src/glut/directfb/font.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/font.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,213 @@ +/* Copyright (c) Mark J. Kilgard, 1994, 1998. + + This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "internal.h" +#include "font.h" + + +#if defined(_WIN32) || defined (GLUT_IMPORT_LIB) + +static inline void* +__glutFont( void *font ) +{ + switch((long)font) { + case (long)GLUT_STROKE_ROMAN: + return &glutStrokeRoman; + case (long)GLUT_STROKE_MONO_ROMAN: + return &glutStrokeMonoRoman; + case (long)GLUT_BITMAP_9_BY_15: + return &glutBitmap9By15; + case (long)GLUT_BITMAP_8_BY_13: + return &glutBitmap8By13; + case (long)GLUT_BITMAP_TIMES_ROMAN_10: + return &glutBitmapTimesRoman10; + case (long)GLUT_BITMAP_TIMES_ROMAN_24: + return &glutBitmapTimesRoman24; + case (long)GLUT_BITMAP_HELVETICA_10: + return &glutBitmapHelvetica10; + case (long)GLUT_BITMAP_HELVETICA_12: + return &glutBitmapHelvetica12; + case (long)GLUT_BITMAP_HELVETICA_18: + return &glutBitmapHelvetica18; + } + + return NULL; +} + +#else + +static inline void* +__glutFont( void *font ) +{ + return font; +} + +#endif + + +void GLUTAPIENTRY +glutBitmapCharacter( GLUTbitmapFont font, int c ) +{ + const BitmapCharRec *ch; + BitmapFontPtr fontinfo; + GLint swapbytes, lsbfirst, rowlength; + GLint skiprows, skippixels, alignment; + + fontinfo = (BitmapFontPtr) __glutFont( font ); + + if (!fontinfo || c < fontinfo->first || + c >= fontinfo->first + fontinfo->num_chars) + return; + + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) { + /* Save current modes. */ + 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); + /* Little endian machines (DEC Alpha for example) could + benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE + instead of GL_FALSE, but this would require changing the + generated bitmaps too. */ + 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); + glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, + ch->advance, 0, ch->bitmap); + /* Restore saved 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); + } +} + + +int GLUTAPIENTRY +glutBitmapWidth( GLUTbitmapFont font, int c ) +{ + BitmapFontPtr fontinfo; + const BitmapCharRec *ch; + + fontinfo = (BitmapFontPtr) __glutFont( font ); + + if (!fontinfo || c < fontinfo->first || + c >= fontinfo->first + fontinfo->num_chars) + return 0; + + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) + return ch->advance; + + return 0; +} + + +int GLUTAPIENTRY +glutBitmapLength( GLUTbitmapFont font, const unsigned char *string ) +{ + int c, length; + BitmapFontPtr fontinfo; + const BitmapCharRec *ch; + + fontinfo = (BitmapFontPtr) __glutFont( font ); + if (!fontinfo) + return 0; + + for (length = 0; *string != '\0'; string++) { + c = *string; + if (c >= fontinfo->first && + c < fontinfo->first + fontinfo->num_chars) { + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) + length += ch->advance; + } + } + + return length; +} + + +void GLUTAPIENTRY +glutStrokeCharacter( GLUTstrokeFont font, int c ) +{ + const StrokeCharRec *ch; + const StrokeRec *stroke; + const CoordRec *coord; + StrokeFontPtr fontinfo; + int i, j; + + fontinfo = (StrokeFontPtr) __glutFont( font ); + + if (!fontinfo || c < 0 || c >= fontinfo->num_chars) + return; + + ch = &(fontinfo->ch[c]); + if (ch) { + for (i = ch->num_strokes, stroke = ch->stroke; + i > 0; i--, stroke++) { + glBegin(GL_LINE_STRIP); + for (j = stroke->num_coords, coord = stroke->coord; + j > 0; j--, coord++) { + glVertex2f(coord->x, coord->y); + } + glEnd(); + } + glTranslatef(ch->right, 0.0, 0.0); + } +} + + +int GLUTAPIENTRY +glutStrokeWidth( GLUTstrokeFont font, int c ) +{ + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + + fontinfo = (StrokeFontPtr) __glutFont( font ); + + if (!fontinfo || c < 0 || c >= fontinfo->num_chars) + return 0; + + ch = &(fontinfo->ch[c]); + if (ch) + return ch->right; + + return 0; +} + + +int GLUTAPIENTRY +glutStrokeLength( GLUTstrokeFont font, const unsigned char *string ) +{ + int c, length; + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + + fontinfo = (StrokeFontPtr) __glutFont( font ); + if (!fontinfo) + return 0; + + for (length = 0; *string != '\0'; string++) { + c = *string; + if (c >= 0 && c < fontinfo->num_chars) { + ch = &(fontinfo->ch[c]); + if (ch) + length += ch->right; + } + } + + return length; +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/font.h xpsb-glx-0.19/mesa/src/glut/directfb/font.h --- xpsb-glx-0.19/mesa/src/glut/directfb/font.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/font.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,58 @@ +/* Copyright (c) Mark J. Kilgard, 1994, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifndef __GLUT_FONT_H__ +#define __GLUT_FONT_H__ + + +typedef struct { + const GLsizei width; + const GLsizei height; + const GLfloat xorig; + const GLfloat yorig; + const GLfloat advance; + const GLubyte *bitmap; +} BitmapCharRec, *BitmapCharPtr; + +typedef struct { + const char *name; + const int num_chars; + const int first; + const BitmapCharRec * const *ch; +} BitmapFontRec, *BitmapFontPtr; + +typedef void *GLUTbitmapFont; + + +typedef struct { + float x; + float y; +} CoordRec, *CoordPtr; + +typedef struct { + int num_coords; + const CoordRec *coord; +} StrokeRec, *StrokePtr; + +typedef struct { + int num_strokes; + const StrokeRec *stroke; + float center; + float right; +} StrokeCharRec, *StrokeCharPtr; + +typedef struct { + const char *name; + int num_chars; + const StrokeCharRec *ch; + float top; + float bottom; +} StrokeFontRec, *StrokeFontPtr; + +typedef void *GLUTstrokeFont; + + +#endif /* __GLUT_FONT_H__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/game.c xpsb-glx-0.19/mesa/src/glut/directfb/game.c --- xpsb-glx-0.19/mesa/src/glut/directfb/game.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/game.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include + +#include "internal.h" + + +/*****************************************************************************/ + +static int g_display_changed = 0; + +/*****************************************************************************/ + + +void GLUTAPIENTRY +glutGameModeString( const char *string ) +{ + int x, y, bpp; + char *tmp; + + if (!string) + return; + + tmp = strchr( string, 'x' ); + if (tmp) { + x = strtol( string, NULL, 10 ); + y = strtol( tmp+1, NULL, 10 ); + + if (x > 0 && y > 0) { + g_width = x; + g_height = y; + } + } + + tmp = strchr( string, ':' ); + if (tmp) { + bpp = strtol( tmp+1, NULL, 10 ); + + if (bpp > 0) + g_bpp = bpp; + } +} + + +int GLUTAPIENTRY +glutEnterGameMode( void ) +{ + DFBDisplayLayerConfig prev, cur; + + glutInit( NULL, NULL ); + + primary->GetConfiguration( primary, &prev ); + primary->SetCooperativeLevel( primary, DLSCL_EXCLUSIVE ); + + if (g_game) + __glutDestroyWindow( g_game ); + + g_game = __glutCreateWindow( GL_TRUE ); + if (!g_game) + return 0; + + __glutSetWindow( g_game ); + g_game->cursor = GLUT_CURSOR_NONE; + + primary->GetConfiguration( primary, &cur ); + g_display_changed = (cur.width != prev.width || + cur.height != prev.height || + cur.pixelformat != prev.pixelformat); + + return g_game->id; +} + + +void GLUTAPIENTRY +glutLeaveGameMode( void ) +{ + if (g_game) + __glutDestroyWindow( g_game ); + + primary->SetCooperativeLevel( primary, DLSCL_ADMINISTRATIVE ); +} + + +int GLUTAPIENTRY +glutGameModeGet( GLenum type ) +{ + switch (type) { + case GLUT_GAME_MODE_ACTIVE: + return (g_game != NULL); + case GLUT_GAME_MODE_POSSIBLE: + if (primary) { + DFBDisplayLayerConfig c; + c.flags = DLCONF_WIDTH | DLCONF_HEIGHT; + c.width = g_width; + c.height = g_height; + /* XXX: bpp */ + if (primary->TestConfiguration( primary, &c, 0 ) == DFB_OK) + return 1; + } + break; + case GLUT_GAME_MODE_WIDTH: + if (g_game) { + int w; + g_game->surface->GetSize( g_game->surface, &w, 0 ); + return w; + } + break; + case GLUT_GAME_MODE_HEIGHT: + if (g_game) { + int h; + g_game->surface->GetSize( g_game->surface, 0, &h ); + return h; + } + break; + case GLUT_GAME_MODE_PIXEL_DEPTH: + if (g_game) { + DFBSurfacePixelFormat f; + g_game->surface->GetPixelFormat( g_game->surface, &f ); + return DFB_COLOR_BITS_PER_PIXEL( f ); + } + break; + case GLUT_GAME_MODE_REFRESH_RATE: + return 60; /* assume 60hz */ + case GLUT_GAME_MODE_DISPLAY_CHANGED: + return g_display_changed; + default: + break; + } + + return 0; +} + + + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/globals.c xpsb-glx-0.19/mesa/src/glut/directfb/globals.c --- xpsb-glx-0.19/mesa/src/glut/directfb/globals.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/globals.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "internal.h" + +IDirectFB *dfb = NULL; +IDirectFBDisplayLayer *primary = NULL; +IDirectFBEventBuffer *events = NULL; +IDirectFBInputDevice *keyboard = NULL; +IDirectFBInputDevice *mouse = NULL; +IDirectFBInputDevice *joystick = NULL; + +GLenum g_display_mode = 0; +GLuint g_width = DEFAULT_WIDTH; +GLuint g_height = DEFAULT_HEIGHT; +GLint g_xpos = 0; +GLint g_ypos = 0; +GLint g_bpp = 0; +GLboolean g_idle = GL_TRUE; +__GlutWindow *g_current = NULL; +__GlutWindow *g_game = NULL; + + +void (GLUTCALLBACK *display_func) (void) = 0; +void (GLUTCALLBACK *reshape_func) (int width, int height) = 0; +void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y) = 0; +void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y) = 0; +void (GLUTCALLBACK *motion_func) (int x, int y) = 0; +void (GLUTCALLBACK *passive_motion_func) (int x, int y) = 0; +void (GLUTCALLBACK *entry_func) (int state) = 0; +void (GLUTCALLBACK *visibility_func) (int state) = 0; +void (GLUTCALLBACK *idle_func) (void) = 0; +void (GLUTCALLBACK *menu_state_func) (int state) = 0; +void (GLUTCALLBACK *special_func) (int key, int x, int y) = 0; +void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z) = 0; +void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z) = 0; +void (GLUTCALLBACK *spaceball_button_func) (int button, int state) = 0; +void (GLUTCALLBACK *button_box_func) (int button, int state) = 0; +void (GLUTCALLBACK *dials_func) (int dial, int value) = 0; +void (GLUTCALLBACK *tablet_motion_func) (int x, int y) = 0; +void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y) = 0; +void (GLUTCALLBACK *menu_status_func) (int status, int x, int y) = 0; +void (GLUTCALLBACK *overlay_display_func) (void) = 0; +void (GLUTCALLBACK *window_status_func) (int state) = 0; +void (GLUTCALLBACK *keyboard_up_func) (unsigned char key, int x, int y) = 0; +void (GLUTCALLBACK *special_up_func) (int key, int x, int y) = 0; +void (GLUTCALLBACK *joystick_func) (unsigned int buttons, int x, int y, int z) = 0; diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/init.c xpsb-glx-0.19/mesa/src/glut/directfb/init.c --- xpsb-glx-0.19/mesa/src/glut/directfb/init.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/init.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include + +#include "internal.h" + + +static void +__glutExit( void ) +{ + __glutFreeTimers(); + __glutDestroyWindows(); + + if (events) { + events->Release( events ); + events = NULL; + } + + if (joystick) { + joystick->Release( joystick ); + joystick = NULL; + } + + if (mouse) { + mouse->Release( mouse ); + mouse = NULL; + } + + if (keyboard) { + keyboard->Release( keyboard ); + keyboard = NULL; + } + + if (primary) { + primary->Release( primary ); + primary = NULL; + } + + if (dfb) { + dfb->Release( dfb ); + dfb = NULL; + } +} + + +void GLUTAPIENTRY +glutInit( int *argcp, char **argv ) +{ + DFBResult ret; + + if (dfb) + return; + + glutGet( GLUT_ELAPSED_TIME ); + + ret = DirectFBInit( argcp, argv ? &argv : NULL ); + if (ret) + DirectFBErrorFatal( "DirectFBInit()", ret ); + + ret = DirectFBCreate( &dfb ); + if (ret) + DirectFBErrorFatal( "DirectFBCreate()", ret ); + + ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &primary ); + if (ret) + DirectFBErrorFatal( "IDirectFB::GetDisplayLayer()", ret ); + + ret = dfb->CreateEventBuffer( dfb, &events ); + if (ret) + DirectFBErrorFatal( "IDirectFB::CreateEventBuffer()", ret ); + + dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ); + dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse ); + dfb->GetInputDevice( dfb, DIDID_JOYSTICK, &joystick ); + + primary->SetCooperativeLevel( primary, DLSCL_ADMINISTRATIVE ); + + atexit( __glutExit ); +} + + +void GLUTAPIENTRY +glutInitDisplayMode( unsigned int mode ) +{ + g_display_mode = mode; +} + + +void GLUTAPIENTRY +glutInitWindowPosition( int x, int y ) +{ + g_xpos = x; + g_ypos = y; +} + + +void GLUTAPIENTRY +glutInitWindowSize( int width, int height ) +{ + g_width = width; + g_height = height; +} + + +void GLUTAPIENTRY +glutInitDisplayString( const char *string ) +{ +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/internal.h xpsb-glx-0.19/mesa/src/glut/directfb/internal.h --- xpsb-glx-0.19/mesa/src/glut/directfb/internal.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/internal.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __GLUT_INTERNAL_H__ +#define __GLUT_INTERNAL_H__ + +#include +#include + +#include +#include + +#include + +#include "GL/glut.h" + + +#define VERSION_CODE( M, m, r ) (((M) << 16) | ((m) << 8) | ((r))) + +#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ + DIRECTFB_MINOR_VERSION, \ + DIRECTFB_MICRO_VERSION ) + + +#define DEFAULT_WIDTH 640 +#define DEFAULT_HEIGHT 480 + +/* + * Window request flags + */ +#define WINDOW_REQUEST_POSITION 0x00000001 +#define WINDOW_REQUEST_RESIZE 0x00000002 +#define WINDOW_REQUEST_RESTACK 0x00000004 +#define WINDOW_REQUEST_SHOW 0x00000008 +#define WINDOW_REQUEST_HIDE 0x00000010 +#define WINDOW_REQUEST_DESTROY 0x00000020 + +/* + * GLUT Window implementation + */ +typedef struct __GlutWindow_s { + int id; + DFBWindowID wid; + + IDirectFBWindow *window; /* NULL = fullscreen (game mode) */ + IDirectFBSurface *surface; + IDirectFBGL *gl; + + /* display mode */ + GLenum mode; + + /* cursor position in fullscreen mode */ + int cx; + int cy; + /* joystick position */ + int jx; + int jy; + int jz; + /* pressed modifiers */ + int modifiers; + /* pressed buttons */ + int buttons; + /* current cursor shape */ + int cursor; + + struct { + int flags; + int x; + int y; + int w; + int h; + int z; + } req; + + GLboolean visible; + GLboolean redisplay; + GLboolean reshape; + GLboolean visibility; + + struct __GlutWindow_s *next; + struct __GlutWindow_s *prev; +} __GlutWindow; + + +/* Global Vars */ +extern IDirectFB *dfb; +extern IDirectFBDisplayLayer *primary; +extern IDirectFBEventBuffer *events; +extern IDirectFBInputDevice *keyboard; +extern IDirectFBInputDevice *mouse; +extern IDirectFBInputDevice *joystick; + +extern GLenum g_display_mode; +extern GLuint g_width; +extern GLuint g_height; +extern GLint g_xpos; +extern GLint g_ypos; +extern GLint g_bpp; +extern GLboolean g_idle; +extern __GlutWindow *g_current; +extern __GlutWindow *g_game; + + +/* Global Funcs */ +/* window.c */ +extern __GlutWindow* __glutCreateWindow( GLboolean fullscreen ); +extern __GlutWindow* __glutFindWindow( DFBWindowID id ); +extern void __glutSetWindow( __GlutWindow *window ); +extern void __glutHandleWindows( void ); +extern void __glutDestroyWindow( __GlutWindow *window ); +extern void __glutDestroyWindows( void ); +/* callback.c */ +extern void __glutHandleTimers( void ); +extern GLboolean __glutGetTimeout( int *ret_msec ); +extern void __glutFreeTimers( void ); + + +/* Global Callbacks */ +extern void (GLUTCALLBACK *display_func) (void); +extern void (GLUTCALLBACK *reshape_func) (int width, int height); +extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y); +extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y); +extern void (GLUTCALLBACK *motion_func) (int x, int y); +extern void (GLUTCALLBACK *passive_motion_func) (int x, int y); +extern void (GLUTCALLBACK *entry_func) (int state); +extern void (GLUTCALLBACK *visibility_func) (int state); +extern void (GLUTCALLBACK *idle_func) (void); +extern void (GLUTCALLBACK *menu_state_func) (int state); +extern void (GLUTCALLBACK *special_func) (int key, int x, int y); +extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z); +extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z); +extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state); +extern void (GLUTCALLBACK *button_box_func) (int button, int state); +extern void (GLUTCALLBACK *dials_func) (int dial, int value); +extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y); +extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y); +extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y); +extern void (GLUTCALLBACK *overlay_display_func) (void); +extern void (GLUTCALLBACK *window_status_func) (int state); +extern void (GLUTCALLBACK *keyboard_up_func) (unsigned char key, int x, int y); +extern void (GLUTCALLBACK *special_up_func) (int key, int x, int y); +extern void (GLUTCALLBACK *joystick_func) (unsigned int buttons, int x, int y, int z); + + +#ifdef DEBUG +# define __glutAssert( exp ) {\ + if (!(exp)) {\ + fprintf( stderr, "(!!) *** Assertion [%s] failed in %s() ***\n",\ + #exp, __FUNCTION__ ); + fflush( stderr );\ + exit( -1 );\ + }\ + } +#else +# define __glutAssert( exp ) +#endif + +#define __glutWarning( format, ... ) {\ + fprintf( stderr, "(!) GLUT: " format "!\n", ## __VA_ARGS__ );\ + fflush( stderr );\ +} + +#define __glutFatalError( format, ... ) {\ + fprintf( stderr, "(!) GLUT: " format "!\n", ## __VA_ARGS__ );\ + fprintf( stderr, "\t-> from %s() at line %d\n", __FUNCTION__, __LINE__ );\ + fflush( stderr );\ + exit( -1 );\ +} + + +#endif /* __GLUT_INTERNAL_H__ */ + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/Makefile xpsb-glx-0.19/mesa/src/glut/directfb/Makefile --- xpsb-glx-0.19/mesa/src/glut/directfb/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,86 @@ +# subset glut + +TOP = ../../.. +include $(TOP)/configs/current + +MARK = $(TOP)/src/glut/glx + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 1 + +INCLUDES = -I$(TOP)/include -I$(MARK) $(shell pkg-config --cflags directfb) + +GLUT_LIB_DEPS += $(shell pkg-config --libs directfb) + +CORE_SOURCES = \ + callback.c \ + color.c \ + cursor.c \ + ext.c \ + events.c \ + font.c \ + game.c \ + globals.c \ + init.c \ + menu.c \ + models.c \ + overlay.c \ + state.c \ + teapot.c \ + window.c \ + + +MARK_SOURCES = \ + $(MARK)/glut_8x13.c \ + $(MARK)/glut_9x15.c \ + $(MARK)/glut_hel10.c \ + $(MARK)/glut_hel12.c \ + $(MARK)/glut_hel18.c \ + $(MARK)/glut_tr10.c \ + $(MARK)/glut_tr24.c + +SOURCES = $(CORE_SOURCES) $(MARK_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + + +# Make the library +$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ + $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ + $(MKLIB_OPTIONS) $(OBJECTS) + + +# Run 'make -f Makefile.solo dep' to update the dependencies if you change +# what's included by any source file. +depend: $(SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# Remove .o and backup files +clean: depend + -rm -f depend depend.bak + -rm -f *.o *~ *.o *~ *.so libglut.so.3.7 + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/menu.c xpsb-glx-0.19/mesa/src/glut/directfb/menu.c --- xpsb-glx-0.19/mesa/src/glut/directfb/menu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/menu.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "internal.h" + + +int GLUTAPIENTRY +glutCreateMenu( void (GLUTCALLBACK *func) (int) ) +{ + return 0; +} + +void GLUTAPIENTRY +glutDestroyMenu( int menu ) +{ +} + + +int GLUTAPIENTRY +glutGetMenu( void ) +{ + return 0; +} + + +void GLUTAPIENTRY +glutSetMenu( int menu ) +{ +} + + +void GLUTAPIENTRY +glutAddMenuEntry( const char *label, int value ) +{ +} + + +void GLUTAPIENTRY +glutAddSubMenu( const char *label, int submenu ) +{ +} + + +void GLUTAPIENTRY +glutChangeToMenuEntry( int item, const char *label, int value ) +{ +} + + +void GLUTAPIENTRY +glutChangeToSubMenu( int item, const char *label, int submenu ) +{ +} + + +void GLUTAPIENTRY +glutRemoveMenuItem( int item ) +{ +} + + +void GLUTAPIENTRY +glutAttachMenu( int button ) +{ +} + + +void GLUTAPIENTRY +glutDetachMenu( int button ) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/models.c xpsb-glx-0.19/mesa/src/glut/directfb/models.c --- xpsb-glx-0.19/mesa/src/glut/directfb/models.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/models.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,599 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include +#include + +#include "internal.h" + +/* Some files do not define M_PI... */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +static GLUquadricObj *quadObj; + +#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } + +static void +initQuadObj(void) +{ + quadObj = gluNewQuadric(); + if (!quadObj) + __glutFatalError("out of memory"); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void GLUTAPIENTRY +glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void GLUTAPIENTRY +glutWireCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +void GLUTAPIENTRY +glutSolidCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +/* ENDCENTRY */ + +static void +drawBox(GLfloat size, GLenum type) +{ + static GLfloat n[6][3] = + { + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {1.0, 0.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} + }; + static GLint faces[6][4] = + { + {0, 1, 2, 3}, + {3, 2, 6, 7}, + {7, 6, 5, 4}, + {4, 5, 1, 0}, + {5, 6, 2, 1}, + {7, 4, 0, 3} + }; + GLfloat v[8][3]; + GLint i; + + v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; + v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; + v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; + v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; + v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; + v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; + + for (i = 5; i >= 0; i--) { + glBegin(type); +/* glNormal3fv(&n[i][0]); */ + glVertex3fv(&v[faces[i][0]][0]); + glVertex3fv(&v[faces[i][1]][0]); + glVertex3fv(&v[faces[i][2]][0]); + glVertex3fv(&v[faces[i][3]][0]); + glEnd(); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireCube(GLdouble size) +{ + drawBox(size, GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidCube(GLdouble size) +{ + drawBox(size, GL_QUADS); +} + +/* ENDCENTRY */ + +static void +doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) +{ + int i, j; + GLfloat theta, phi, theta1; + GLfloat cosTheta, sinTheta; + GLfloat cosTheta1, sinTheta1; + GLfloat ringDelta, sideDelta; + + ringDelta = 2.0 * M_PI / rings; + sideDelta = 2.0 * M_PI / nsides; + + theta = 0.0; + cosTheta = 1.0; + sinTheta = 0.0; + for (i = rings - 1; i >= 0; i--) { + theta1 = theta + ringDelta; + cosTheta1 = cos(theta1); + sinTheta1 = sin(theta1); + glBegin(GL_QUAD_STRIP); + phi = 0.0; + for (j = nsides; j >= 0; j--) { + GLfloat cosPhi, sinPhi, dist; + + phi += sideDelta; + cosPhi = cos(phi); + sinPhi = sin(phi); + dist = R + r * cosPhi; + +/* glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); */ + glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); +/* glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); */ + glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); + } + glEnd(); + theta = theta1; + cosTheta = cosTheta1; + sinTheta = sinTheta1; + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ +/* glPushAttrib(GL_POLYGON_BIT); */ +/* glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); */ + doughnut(innerRadius, outerRadius, nsides, rings); +/* glPopAttrib(); */ +} + +void GLUTAPIENTRY +glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + doughnut(innerRadius, outerRadius, nsides, rings); +} + +/* ENDCENTRY */ + +static GLfloat dodec[20][3]; + +static void +initDodecahedron(void) +{ + GLfloat alpha, beta; + + alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); + beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - + 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); + /* *INDENT-OFF* */ + dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; + dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; + dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; + dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; + dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; + dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; + dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; + dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; + dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; + dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; + dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; + dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; + dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; + dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; + dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; + dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; + dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; + dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; + dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; + dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; + /* *INDENT-ON* */ + +} + +#define DIFF3(_a,_b,_c) { \ + (_c)[0] = (_a)[0] - (_b)[0]; \ + (_c)[1] = (_a)[1] - (_b)[1]; \ + (_c)[2] = (_a)[2] - (_b)[2]; \ +} + +static void +crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) +{ + GLfloat p[3]; /* in case prod == v1 or v2 */ + + p[0] = v1[1] * v2[2] - v2[1] * v1[2]; + p[1] = v1[2] * v2[0] - v2[2] * v1[0]; + p[2] = v1[0] * v2[1] - v2[0] * v1[1]; + prod[0] = p[0]; + prod[1] = p[1]; + prod[2] = p[2]; +} + +static void +normalize(GLfloat v[3]) +{ + GLfloat d; + + d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + if (d == 0.0) { +/* __glutWarning("normalize: zero length vector"); */ + v[0] = d = 1.0; + } + d = 1 / d; + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +static void +pentagon(int a, int b, int c, int d, int e, GLenum shadeType) +{ + GLfloat n0[3], d1[3], d2[3]; + + DIFF3(dodec[a], dodec[b], d1); + DIFF3(dodec[b], dodec[c], d2); + crossprod(d1, d2, n0); + normalize(n0); + + glBegin(shadeType); +/* glNormal3fv(n0); */ + glVertex3fv(&dodec[a][0]); + glVertex3fv(&dodec[b][0]); + glVertex3fv(&dodec[c][0]); + glVertex3fv(&dodec[d][0]); + glVertex3fv(&dodec[e][0]); + glEnd(); +} + +static void +dodecahedron(GLenum type) +{ + static int inited = 0; + + if (inited == 0) { + inited = 1; + initDodecahedron(); + } + pentagon(0, 1, 9, 16, 5, type); + pentagon(1, 0, 3, 18, 7, type); + pentagon(1, 7, 11, 10, 9, type); + pentagon(11, 7, 18, 19, 6, type); + pentagon(8, 17, 16, 9, 10, type); + pentagon(2, 14, 15, 6, 19, type); + pentagon(2, 13, 12, 4, 14, type); + pentagon(2, 19, 18, 3, 13, type); + pentagon(3, 0, 5, 12, 13, type); + pentagon(6, 15, 8, 10, 11, type); + pentagon(4, 17, 8, 15, 14, type); + pentagon(4, 12, 5, 16, 17, type); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireDodecahedron(void) +{ + dodecahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidDodecahedron(void) +{ + dodecahedron(GL_TRIANGLE_FAN); +} + +/* ENDCENTRY */ + +static void +recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, + GLenum shadeType) +{ + GLfloat q0[3], q1[3]; + + DIFF3(n1, n2, q0); + DIFF3(n2, n3, q1); + crossprod(q0, q1, q1); + normalize(q1); + + glBegin(shadeType); +/* glNormal3fv(q1); */ + glVertex3fv(n1); + glVertex3fv(n2); + glVertex3fv(n3); + glEnd(); +} + +static void +subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, + GLenum shadeType) +{ + int depth; + GLfloat w0[3], w1[3], w2[3]; + GLfloat l; + int i, j, k, n; + + depth = 1; + for (i = 0; i < depth; i++) { + for (j = 0; i + j < depth; j++) { + k = depth - i - j; + for (n = 0; n < 3; n++) { + w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; + w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) + / depth; + w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) + / depth; + } + l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); + w0[0] /= l; + w0[1] /= l; + w0[2] /= l; + l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); + w1[0] /= l; + w1[1] /= l; + w1[2] /= l; + l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); + w2[0] /= l; + w2[1] /= l; + w2[2] /= l; + recorditem(w1, w0, w2, shadeType); + } + } +} + +static void +drawtriangle(int i, GLfloat data[][3], int ndx[][3], + GLenum shadeType) +{ + GLfloat *x0, *x1, *x2; + + x0 = data[ndx[i][0]]; + x1 = data[ndx[i][1]]; + x2 = data[ndx[i][2]]; + subdivide(x0, x1, x2, shadeType); +} + +/* octahedron data: The octahedron produced is centered at the + origin and has radius 1.0 */ +static GLfloat odata[6][3] = +{ + {1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} +}; + +static int ondex[8][3] = +{ + {0, 4, 2}, + {1, 2, 4}, + {0, 3, 4}, + {1, 4, 3}, + {0, 2, 5}, + {1, 5, 2}, + {0, 5, 3}, + {1, 3, 5} +}; + +static void +octahedron(GLenum shadeType) +{ + int i; + + for (i = 7; i >= 0; i--) { + drawtriangle(i, odata, ondex, shadeType); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireOctahedron(void) +{ + octahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidOctahedron(void) +{ + octahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* icosahedron data: These numbers are rigged to make an + icosahedron of radius 1.0 */ + +#define X .525731112119133606 +#define Z .850650808352039932 + +static GLfloat idata[12][3] = +{ + {-X, 0, Z}, + {X, 0, Z}, + {-X, 0, -Z}, + {X, 0, -Z}, + {0, Z, X}, + {0, Z, -X}, + {0, -Z, X}, + {0, -Z, -X}, + {Z, X, 0}, + {-Z, X, 0}, + {Z, -X, 0}, + {-Z, -X, 0} +}; + +static int index[20][3] = +{ + {0, 4, 1}, + {0, 9, 4}, + {9, 5, 4}, + {4, 5, 8}, + {4, 8, 1}, + {8, 10, 1}, + {8, 3, 10}, + {5, 3, 8}, + {5, 2, 3}, + {2, 7, 3}, + {7, 10, 3}, + {7, 6, 10}, + {7, 11, 6}, + {11, 0, 6}, + {0, 1, 6}, + {6, 1, 10}, + {9, 0, 11}, + {9, 11, 2}, + {9, 2, 5}, + {7, 2, 11}, +}; + +static void +icosahedron(GLenum shadeType) +{ + int i; + + for (i = 19; i >= 0; i--) { + drawtriangle(i, idata, index, shadeType); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireIcosahedron(void) +{ + icosahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidIcosahedron(void) +{ + icosahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* tetrahedron data: */ + +#define T 1.73205080756887729 + +static GLfloat tdata[4][3] = +{ + {T, T, T}, + {T, -T, -T}, + {-T, T, -T}, + {-T, -T, T} +}; + +static int tndex[4][3] = +{ + {0, 1, 3}, + {2, 1, 0}, + {3, 2, 0}, + {1, 2, 3} +}; + +static void +tetrahedron(GLenum shadeType) +{ + int i; + + for (i = 3; i >= 0; i--) + drawtriangle(i, tdata, tndex, shadeType); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireTetrahedron(void) +{ + tetrahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidTetrahedron(void) +{ + tetrahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/NOTES xpsb-glx-0.19/mesa/src/glut/directfb/NOTES --- xpsb-glx-0.19/mesa/src/glut/directfb/NOTES 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/NOTES 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,9 @@ +DirectFB GLUT Implementation NOTES +---------------------------------- + +* To have high performance rendering, it's really important to + use glutEnterGameMode() instead of glutCreateWindow()/glutFullScreen(). + You can also force a windowed application to game mode by setting + the environment variable "__GLUT_GAME_MODE". + + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/overlay.c xpsb-glx-0.19/mesa/src/glut/directfb/overlay.c --- xpsb-glx-0.19/mesa/src/glut/directfb/overlay.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/overlay.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "internal.h" + + +void GLUTAPIENTRY +glutEstablishOverlay( void ) +{ +} + + +void GLUTAPIENTRY +glutRemoveOverlay( void ) +{ +} + + +void GLUTAPIENTRY +glutUseLayer( GLenum layer ) +{ +} + + +void GLUTAPIENTRY +glutPostOverlayRedisplay( void ) +{ +} + + +void GLUTAPIENTRY +glutPostWindowOverlayRedisplay( int win ) +{ +} + + +void GLUTAPIENTRY +glutShowOverlay( void ) +{ +} + + +void GLUTAPIENTRY +glutHideOverlay( void ) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/state.c xpsb-glx-0.19/mesa/src/glut/directfb/state.c --- xpsb-glx-0.19/mesa/src/glut/directfb/state.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/state.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include + +#include "GL/glu.h" + +#include "internal.h" + + +int GLUTAPIENTRY +glutGet( GLenum type ) +{ + switch (type) { + case GLUT_WINDOW_X: + if (g_current && g_current->window) { + int x; + g_current->window->GetPosition( g_current->window, &x, 0 ); + return x; + } + break; + case GLUT_WINDOW_Y: + if (g_current && g_current->window) { + int y; + g_current->window->GetPosition( g_current->window, 0, &y ); + return y; + } + break; + + case GLUT_WINDOW_WIDTH: + if (g_current) { + int w; + g_current->surface->GetSize( g_current->surface, &w, 0 ); + return w; + } + break; + case GLUT_WINDOW_HEIGHT: + if (g_current) { + int h; + g_current->surface->GetSize( g_current->surface, 0, &h ); + return h; + } + break; + + case GLUT_WINDOW_BUFFER_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.buffer_size; + } + break; + case GLUT_WINDOW_STENCIL_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.stencil_size; + } + break; + case GLUT_WINDOW_DEPTH_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.depth_size; + } + break; + case GLUT_WINDOW_RED_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.red_size; + } + break; + case GLUT_WINDOW_GREEN_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.green_size; + } + break; + case GLUT_WINDOW_BLUE_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.blue_size; + } + break; + case GLUT_WINDOW_ALPHA_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.alpha_size; + } + break; + case GLUT_WINDOW_ACCUM_RED_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.accum_red_size; + } + break; + case GLUT_WINDOW_ACCUM_GREEN_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.accum_green_size; + } + break; + case GLUT_WINDOW_ACCUM_BLUE_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.accum_blue_size; + } + break; + case GLUT_WINDOW_ACCUM_ALPHA_SIZE: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.accum_alpha_size; + } + break; + case GLUT_WINDOW_DOUBLEBUFFER: + if (g_current) { + DFBGLAttributes a; + g_current->gl->GetAttributes( g_current->gl, &a ); + return a.double_buffer; + } + break; + + case GLUT_WINDOW_RGBA: + return 1; + + case GLUT_WINDOW_CURSOR: + if (g_current) + return g_current->cursor; + break; + + case GLUT_SCREEN_WIDTH: + if (primary) { + DFBDisplayLayerConfig c; + primary->GetConfiguration( primary, &c ); + return c.width; + } + break; + case GLUT_SCREEN_HEIGHT: + if (primary) { + DFBDisplayLayerConfig c; + primary->GetConfiguration( primary, &c ); + return c.height; + } + break; + + case GLUT_INIT_DISPLAY_MODE: + return g_display_mode; + case GLUT_INIT_WINDOW_X: + return g_xpos; + case GLUT_INIT_WINDOW_Y: + return g_ypos; + case GLUT_INIT_WINDOW_WIDTH: + return g_width; + case GLUT_INIT_WINDOW_HEIGHT: + return g_height; + + case GLUT_ELAPSED_TIME: + { + static long long start = -1; + struct timeval t; + + gettimeofday( &t, NULL ); + if (start == -1) { + start = t.tv_sec * 1000ll + t.tv_usec / 1000ll; + return 0; + } + return (t.tv_sec * 1000ll + t.tv_usec / 1000ll - start); + } + break; + + default: + break; + } + + return 0; +} + + +int GLUTAPIENTRY +glutLayerGet( GLenum type ) +{ + return 0; +} + +void GLUTAPIENTRY +glutReportErrors( void ) +{ + GLenum error; + + while ((error = glGetError()) != GL_NO_ERROR) + __glutWarning( "**OpenGL Error** %s", gluErrorString( error ) ); +} + + diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/teapot.c xpsb-glx-0.19/mesa/src/glut/directfb/teapot.c --- xpsb-glx-0.19/mesa/src/glut/directfb/teapot.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/teapot.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,212 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include +#include "GL/glut.h" + +/* Rim, body, lid, and bottom data must be reflected in x and + y; handle and spout data across the y axis only. */ + +static int patchdata[][16] = +{ + /* rim */ + {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}, + /* body */ + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27}, + {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40}, + /* lid */ + {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, + 101, 0, 1, 2, 3,}, + {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117}, + /* bottom */ + {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, + 125, 120, 40, 39, 38, 37}, + /* handle */ + {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56}, + {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 28, 65, 66, 67}, + /* spout */ + {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83}, + {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95} +}; +/* *INDENT-OFF* */ + +static float cpdata[][3] = +{ + {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, + -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, + {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, + 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, + 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, + 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, + {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, + 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, + {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, + 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, + 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, + {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, + {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, + -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, + -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, + 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, + 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, + 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, + {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, + -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, + 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, + -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, + 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, + 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, + 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, + {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, + -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, + 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, + {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, + {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, + {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, + 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, + 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, + -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, + 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, + 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, + 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, + {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, + -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, + 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, + {0.84, -1.5, 0.075} +}; + +static float tex[2][2][2] = +{ + { {0, 0}, + {1, 0}}, + { {0, 1}, + {1, 1}} +}; + +/* *INDENT-ON* */ + +static void +teapot(GLint grid, GLdouble scale, GLenum type) +{ + float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; + long i, j, k, l; + + glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_MAP2_VERTEX_3); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glPushMatrix(); + glRotatef(270.0, 1.0, 0.0, 0.0); + glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); + glTranslatef(0.0, 0.0, -1.5); + for (i = 0; i < 10; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + for (l = 0; l < 3; l++) { + p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 1) + q[j][k][l] *= -1.0; + if (i < 6) { + r[j][k][l] = + cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 0) + r[j][k][l] *= -1.0; + s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + if (l == 0) + s[j][k][l] *= -1.0; + if (l == 1) + s[j][k][l] *= -1.0; + } + } + } + } + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, + &tex[0][0][0]); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &p[0][0][0]); + glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &q[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + if (i < 6) { + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &r[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &s[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + } + } + glPopMatrix(); + glPopAttrib(); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSolidTeapot(GLdouble scale) +{ + teapot(7, scale, GL_FILL); +} + +void GLUTAPIENTRY +glutWireTeapot(GLdouble scale) +{ + teapot(10, scale, GL_LINE); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/directfb/window.c xpsb-glx-0.19/mesa/src/glut/directfb/window.c --- xpsb-glx-0.19/mesa/src/glut/directfb/window.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/directfb/window.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,597 @@ +/* + * Copyright (C) 2006 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include +#include + +#include "internal.h" + + +/*****************************************************************************/ + +static __GlutWindow *g_stack = NULL; + +/*****************************************************************************/ + + +__GlutWindow* +__glutCreateWindow( GLboolean fullscreen ) +{ + __GlutWindow *new; + DFBResult ret; + static int curid = 1; + + new = calloc( 1, sizeof(__GlutWindow) ); + if (!new) + __glutFatalError( "out of memory" ); + + new->id = curid++; + + if (fullscreen) { + DFBDisplayLayerConfig config; + DFBDisplayLayerConfigFlags fail = 0; + + config.flags = DLCONF_WIDTH | DLCONF_HEIGHT | + DLCONF_BUFFERMODE; + config.width = g_width; + config.height = g_height; + + if (g_display_mode & GLUT_DOUBLE) + config.buffermode = DLBM_BACKVIDEO; + else + config.buffermode = DLBM_FRONTONLY; + + if (g_bpp) { + config.flags |= DLCONF_PIXELFORMAT; + + switch (g_bpp) { + case 8: + config.pixelformat = DSPF_RGB332; + break; + case 12: + config.pixelformat = DSPF_ARGB4444; + break; + case 15: + config.pixelformat = DSPF_ARGB1555; + break; + case 16: + config.pixelformat = DSPF_RGB16; + break; + case 24: + case 32: + config.pixelformat = DSPF_RGB32; + break; + default: + config.flags &= ~DLCONF_PIXELFORMAT; + break; + } + } + + primary->TestConfiguration( primary, &config, &fail ); + config.flags &= ~fail; + primary->SetConfiguration( primary, &config ); + + ret = primary->GetSurface( primary, &new->surface ); + if (ret) { + DirectFBError( "IDirectFBDisplayLayer::GetSurface()", ret ); + free( new ); + return NULL; + } + + ret = new->surface->GetGL( new->surface, &new->gl ); + if (ret) { + DirectFBError( "IDirectFBSurface::GetGL()", ret ); + new->surface->Release( new->surface ); + free( new ); + return NULL; + } + + events->Reset( events ); + if (keyboard) + keyboard->AttachEventBuffer( keyboard, events ); + if (mouse) + mouse->AttachEventBuffer( mouse, events ); + if (joystick) + joystick->AttachEventBuffer( joystick, events ); + + new->visible = GL_TRUE; + } + else { + DFBWindowDescription dsc; + + dsc.flags = DWDESC_CAPS | DWDESC_POSX | DWDESC_POSY | + DWDESC_WIDTH | DWDESC_HEIGHT; + dsc.caps = DWCAPS_NONE; + dsc.posx = g_xpos; + dsc.posy = g_ypos; + dsc.width = g_width; + dsc.height = g_height; + + if (g_display_mode & GLUT_DOUBLE) + dsc.caps |= DWCAPS_DOUBLEBUFFER; + if (g_display_mode & GLUT_ALPHA) + dsc.caps |= DWCAPS_ALPHACHANNEL; + + ret = primary->CreateWindow( primary, &dsc, &new->window ); + if (ret) { + DirectFBError( "IDirectFBDisplayLayer::CreateWindow()", ret ); + free( new ); + return NULL; + } + + new->window->GetID( new->window, &new->wid ); + + ret = new->window->GetSurface( new->window, &new->surface ); + if (ret) { + DirectFBError( "IDirectFBWindow::GetSurface()", ret ); + new->window->Release( new->window ); + free( new ); + return NULL; + } + + ret = new->surface->GetGL( new->surface, &new->gl ); + if (ret) { + DirectFBError( "IDirectFBSurface::GetGl()", ret ); + new->surface->Release( new->surface ); + new->window->Release( new->window ); + free( new ); + return NULL; + } + + new->window->AttachEventBuffer( new->window, events ); + /* enable only handled events */ + new->window->DisableEvents( new->window, DWET_ALL ); + new->window->EnableEvents( new->window, DWET_KEYDOWN | DWET_KEYUP | + DWET_BUTTONDOWN | DWET_BUTTONUP | + DWET_ENTER | DWET_LEAVE | + DWET_MOTION | DWET_SIZE ); + + new->req.flags |= WINDOW_REQUEST_SHOW; + } + + new->mode = g_display_mode; + + new->reshape = GL_TRUE; + new->visibility = GL_TRUE; + new->redisplay = GL_TRUE; + + if (g_stack) { + new->prev = g_stack->prev; + g_stack->prev->next = new; + g_stack->prev = new; + } + else { + new->prev = new; + g_stack = new; + } + + return new; +} + + +__GlutWindow* +__glutFindWindow( DFBWindowID id ) +{ + __GlutWindow *cur; + + for (cur = g_stack; cur; cur = cur->next) { + if (cur->wid == id) + return cur; + } + + __glutFatalError( "Window %d not found", id ); + + return NULL; +} + + +void +__glutSetWindow( __GlutWindow *window ) +{ + if (g_current) { + if (g_current == window) + return; + g_current->gl->Unlock( g_current->gl ); + } + + if (window) + window->gl->Lock( window->gl ); + g_current = window; +} + + +void +__glutHandleWindows( void ) +{ + __GlutWindow *cur = g_stack; + + while (cur) { + __GlutWindow *next = cur->next; + GLboolean displayed = GL_FALSE; + + if (cur->window && cur->req.flags) { + if (cur == g_current) + cur->gl->Unlock( cur->gl ); + + if (cur->req.flags & WINDOW_REQUEST_DESTROY) { + __glutDestroyWindow( cur ); + cur = next; + continue; + } + + if (cur->req.flags & WINDOW_REQUEST_POSITION) { + cur->window->MoveTo( cur->window, + cur->req.x, cur->req.y ); + } + + if (cur->req.flags & WINDOW_REQUEST_RESIZE) { + cur->window->Resize( cur->window, + cur->req.w, cur->req.h ); + cur->reshape = GL_TRUE; + cur->redisplay = GL_TRUE; + } + + if (cur->req.flags & WINDOW_REQUEST_RESTACK) { + while (cur->req.z > 0) { + if (cur->req.z >= +1000) { + cur->window->RaiseToTop( cur->window ); + cur->req.z = 0; + break; + } + + cur->window->Raise( cur->window ); + cur->req.z--; + } + + while (cur->req.z < 0) { + if (cur->req.z <= -1000) { + cur->window->LowerToBottom( cur->window ); + cur->req.z = 0; + break; + } + + cur->window->Lower( cur->window ); + cur->req.z++; + } + } + + if (cur->req.flags & WINDOW_REQUEST_SHOW) { + cur->window->SetOpacity( cur->window, 0xff ); + cur->visible = GL_TRUE; + cur->visibility = GL_TRUE; + } + else if (cur->req.flags & WINDOW_REQUEST_HIDE) { + cur->window->SetOpacity( cur->window, 0x00 ); + cur->visible = GL_FALSE; + cur->visibility = GL_TRUE; + } + + cur->req.flags = 0; + + if (cur == g_current) + cur->gl->Lock( cur->gl ); + } + + if (cur->reshape && reshape_func) { + int w, h; + g_idle = GL_FALSE; + cur->surface->GetSize( cur->surface, &w, &h ); + __glutSetWindow( cur ); + reshape_func( w, h ); + displayed = GL_TRUE; + } + + if (cur->visibility && visibility_func) { + g_idle = GL_FALSE; + __glutSetWindow( cur ); + visibility_func( cur->visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE ); + displayed = GL_TRUE; + } + + if (cur->redisplay && display_func) { + g_idle = GL_FALSE; + __glutSetWindow( cur ); + display_func(); + displayed = GL_TRUE; + } + + if (displayed && cur->window && cur->visible) { + if (!(cur->mode & GLUT_DOUBLE)) { + cur->gl->Unlock( cur->gl ); + cur->surface->Flip( cur->surface, NULL, 0 ); + cur->gl->Lock( cur->gl ); + } + } + + cur->reshape = GL_FALSE; + cur->visibility = GL_FALSE; + cur->redisplay = GL_FALSE; + + cur = next; + } +} + + +void +__glutDestroyWindow( __GlutWindow *window ) +{ + __GlutWindow *next = window->next; + __GlutWindow *prev = window->prev; + + __glutAssert( window != NULL ); + + if (window == g_current) + g_current = NULL; + if (window == g_game) + g_game = NULL; + + window->gl->Unlock( window->gl ); + window->gl->Release( window->gl ); + window->surface->Release( window->surface ); + + if (window->window) { +#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,26) + window->window->DetachEventBuffer( window->window, events ); +#else + window->window->Destroy( window->window ); +#endif + window->window->Release( window->window ); + } + else { +#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,26) + if (joystick) + joystick->DetachEventBuffer( joystick, events ); + if (mouse) + mouse->DetachEventBuffer( mouse, events ); + if (keyboard) + keyboard->DetachEventBuffer( keyboard, events ); +#endif + events->Reset( events ); + } + + free( window ); + + if (next) + next->prev = prev; + else + g_stack->prev = prev; + + if (window == g_stack) + g_stack = next; + else + prev->next = next; +} + + +void +__glutDestroyWindows( void ) +{ + __GlutWindow *cur = g_stack; + + while (cur) { + __GlutWindow *next = cur->next; + __glutDestroyWindow( cur ); + cur = next; + } +} + + +int GLUTAPIENTRY +glutCreateWindow( const char *title ) +{ + __GlutWindow *window; + + if (getenv( "__GLUT_GAME_MODE" )) + return glutEnterGameMode(); + + glutInit( NULL, NULL ); + + window = __glutCreateWindow( GL_FALSE ); + if (!window) + return 0; + + __glutSetWindow( window ); + glutSetCursor( GLUT_CURSOR_INHERIT ); + + return window->id; +} + + +int GLUTAPIENTRY +glutCreateSubWindow( int win, int x, int y, int width, int height ) +{ + return GL_FALSE; +} + + +void GLUTAPIENTRY +glutDestroyWindow( int win ) +{ + __GlutWindow *cur; + + for (cur = g_stack; cur; cur = cur->next) { + if (cur->id == win) { + if (cur->window) + cur->window->Destroy( cur->window ); + + cur->req.flags |= WINDOW_REQUEST_DESTROY; + break; + } + } +} + + +void GLUTAPIENTRY +glutPostRedisplay( void ) +{ + if (g_current) + g_current->redisplay = GL_TRUE; +} + + +void GLUTAPIENTRY +glutPostWindowRedisplay( int win ) +{ + __GlutWindow *cur; + + for (cur = g_stack; cur; cur = cur->next) { + if (cur->id == win) { + cur->redisplay = GL_TRUE; + break; + } + } +} + + +void GLUTAPIENTRY +glutSwapBuffers( void ) +{ + if (g_current) { + g_current->gl->Unlock( g_current->gl ); + g_current->surface->Flip( g_current->surface, NULL, 0 ); + g_current->gl->Lock( g_current->gl ); + } +} + + +int GLUTAPIENTRY +glutGetWindow( void ) +{ + return (g_current) ? g_current->id : 0; +} + + +void GLUTAPIENTRY +glutSetWindow( int win ) +{ + __GlutWindow *cur; + + if (g_current && g_current->id == win) + return; + + for (cur = g_stack; cur; cur = cur->next) { + if (cur->id == win) { + __glutSetWindow( cur ); + break; + } + } +} + + +void GLUTAPIENTRY +glutSetWindowTitle( const char *title ) +{ +} + + +void GLUTAPIENTRY +glutSetIconTitle( const char *title ) +{ +} + + +void GLUTAPIENTRY +glutFullScreen( void ) +{ + if (g_current && !g_game) { + DFBDisplayLayerConfig config; + + primary->GetConfiguration( primary, &config ); + + g_current->req.flags |= WINDOW_REQUEST_POSITION | + WINDOW_REQUEST_RESIZE | + WINDOW_REQUEST_RESTACK; + g_current->req.x = 0; + g_current->req.y = 0; + g_current->req.w = config.width; + g_current->req.h = config.height; + g_current->req.z = 1000; + } +} + + +void GLUTAPIENTRY +glutPositionWindow( int x, int y ) +{ + if (g_current && !g_game) { + g_current->req.flags |= WINDOW_REQUEST_POSITION; + g_current->req.x = x; + g_current->req.y = y; + } +} + + +void GLUTAPIENTRY +glutReshapeWindow( int width, int height ) +{ + if (g_current && !g_game) { + g_current->req.flags |= WINDOW_REQUEST_RESIZE; + g_current->req.w = width; + g_current->req.h = height; + } +} + + +void GLUTAPIENTRY +glutPopWindow( void ) +{ + if (g_current && !g_game) { + g_current->req.flags |= WINDOW_REQUEST_RESTACK; + g_current->req.z--; + } +} + + +void GLUTAPIENTRY +glutPushWindow( void ) +{ + if (g_current && !g_game) { + g_current->req.flags |= WINDOW_REQUEST_RESTACK; + g_current->req.z++; + } +} + + +void GLUTAPIENTRY +glutIconifyWindow( void ) +{ +} + + +void GLUTAPIENTRY +glutShowWindow( void ) +{ + if (g_current && !g_game) { + g_current->req.flags |= WINDOW_REQUEST_SHOW; + g_current->req.flags &= ~WINDOW_REQUEST_HIDE; + } +} + + +void GLUTAPIENTRY +glutHideWindow( void ) +{ + if (g_current && !g_game) { + g_current->req.flags |= WINDOW_REQUEST_HIDE; + g_current->req.flags &= ~WINDOW_REQUEST_SHOW; + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/bitmap.c xpsb-glx-0.19/mesa/src/glut/dos/bitmap.c --- xpsb-glx-0.19/mesa/src/glut/dos/bitmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/bitmap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,115 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +void APIENTRY +glutBitmapCharacter (void *font, int c) +{ + const GLUTBitmapFont *bfp = _glut_font(font); + const GLUTBitmapChar *bcp; + + if (c >= bfp->num || !(bcp = bfp->table[c])) + return; + + glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + + 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); + glBitmap(bcp->width, bcp->height, bcp->xorig, bcp->yorig, + bcp->xmove, 0, bcp->bitmap); + + glPopClientAttrib(); +} + + +void APIENTRY +glutBitmapString (void *font, const unsigned char *string) +{ + const GLUTBitmapFont *bfp = _glut_font(font); + const GLUTBitmapChar *bcp; + unsigned char c; + + glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + + 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); + + while ((c = *(string++))) { + if (c < bfp->num && (bcp = bfp->table[c])) + glBitmap(bcp->width, bcp->height, bcp->xorig, + bcp->yorig, bcp->xmove, 0, bcp->bitmap); + } + + glPopClientAttrib(); +} + + +int APIENTRY +glutBitmapWidth (void *font, int c) +{ + const GLUTBitmapFont *bfp = _glut_font(font); + const GLUTBitmapChar *bcp; + + if (c >= bfp->num || !(bcp = bfp->table[c])) + return 0; + + return bcp->xmove; +} + + +int APIENTRY +glutBitmapLength (void *font, const unsigned char *string) +{ + const GLUTBitmapFont *bfp = _glut_font(font); + const GLUTBitmapChar *bcp; + unsigned char c; + int length = 0; + + while ((c = *(string++))) { + if (c < bfp->num && (bcp = bfp->table[c])) + length += bcp->xmove; + } + + return length; +} + + +int APIENTRY +glutBitmapHeight (void *font) +{ + const GLUTBitmapFont *bfp = _glut_font(font); + + return bfp->height; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/callback.c xpsb-glx-0.19/mesa/src/glut/dos/callback.c --- xpsb-glx-0.19/mesa/src/glut/dos/callback.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/callback.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,204 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +GLUTSShotCB _glut_timer_cb[MAX_TIMER_CB]; + +GLUTidleCB _glut_idle_func = NULL; + + +void APIENTRY +glutDisplayFunc (GLUTdisplayCB func) +{ + _glut_current->display = func; +} + + +void APIENTRY +glutReshapeFunc (GLUTreshapeCB func) +{ + _glut_current->reshape = func; +} + + +void APIENTRY +glutKeyboardFunc (GLUTkeyboardCB func) +{ + _glut_current->keyboard = func; +} + + +void APIENTRY +glutMouseFunc (GLUTmouseCB func) +{ + _glut_current->mouse = func; +} + + +void APIENTRY +glutMotionFunc (GLUTmotionCB func) +{ + _glut_current->motion = func; +} + + +void APIENTRY +glutPassiveMotionFunc (GLUTpassiveCB func) +{ + _glut_current->passive = func; +} + + +void APIENTRY +glutEntryFunc (GLUTentryCB func) +{ + _glut_current->entry = func; +} + + +void APIENTRY +glutVisibilityFunc (GLUTvisibilityCB func) +{ + _glut_current->visibility = func; +} + + +void APIENTRY +glutWindowStatusFunc (GLUTwindowStatusCB func) +{ + _glut_current->windowStatus = func; +} + + +void APIENTRY +glutIdleFunc (GLUTidleCB func) +{ + _glut_idle_func = func; +} + + +void APIENTRY +glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value) +{ + int i; + + if (millis > 0) { + for (i = 0; i < MAX_TIMER_CB; i++) { + GLUTSShotCB *cb = &_glut_timer_cb[i]; + if (cb->func == NULL) { + cb->value = value; + cb->func = func; + cb->time = glutGet(GLUT_ELAPSED_TIME) + millis; + break; + } + } + } +} + + +void APIENTRY +glutSpecialFunc (GLUTspecialCB func) +{ + _glut_current->special = func; +} + + +void APIENTRY +glutSpaceballMotionFunc (GLUTspaceMotionCB func) +{ + _glut_current->spaceMotion = func; +} + + +void APIENTRY +glutSpaceballRotateFunc (GLUTspaceRotateCB func) +{ + _glut_current->spaceRotate = func; +} + + +void APIENTRY +glutSpaceballButtonFunc (GLUTspaceButtonCB func) +{ + _glut_current->spaceButton = func; +} + + +void APIENTRY +glutDialsFunc (GLUTdialsCB func) +{ + _glut_current->dials = func; +} + + +void APIENTRY +glutButtonBoxFunc (GLUTbuttonBoxCB func) +{ + _glut_current->buttonBox = func; +} + + +void APIENTRY +glutTabletMotionFunc (GLUTtabletMotionCB func) +{ + _glut_current->tabletMotion = func; +} + + +void APIENTRY +glutTabletButtonFunc (GLUTtabletButtonCB func) +{ + _glut_current->tabletButton = func; +} + + +void APIENTRY +glutJoystickFunc (GLUTjoystickCB func, int interval) +{ + _glut_current->joystick = func; +} + + +void APIENTRY +glutKeyboardUpFunc (GLUTkeyboardCB func) +{ + _glut_current->keyboardUp = func; +} + + +void APIENTRY +glutSpecialUpFunc (GLUTspecialCB func) +{ + _glut_current->specialUp = func; +} + + +void APIENTRY +glutMouseWheelFunc (GLUTmouseWheelCB func) +{ + _glut_current->mouseWheel = func; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/color.c xpsb-glx-0.19/mesa/src/glut/dos/color.c --- xpsb-glx-0.19/mesa/src/glut/dos/color.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/color.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,53 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +#define CLAMP(i) ((i) > 1.0F ? 1.0F : ((i) < 0.0F ? 0.0F : (i))) + + +void APIENTRY +glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ + if (_glut_default.mode & GLUT_INDEX) { + if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) { + DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); + } + } +} + + +GLfloat APIENTRY +glutGetColor (int ndx, int component) +{ + return 0.0; +} + + +void APIENTRY +glutCopyColormap (int win) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/extens.c xpsb-glx-0.19/mesa/src/glut/dos/extens.c --- xpsb-glx-0.19/mesa/src/glut/dos/extens.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/extens.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,70 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 + +#include "internal.h" + + +int APIENTRY +glutExtensionSupported (const char *extension) +{ + static const GLubyte *extensions = NULL; + const GLubyte *last, *where; + + /* Extension names should not have spaces. */ + if (strchr(extension, ' ') || *extension == '\0') { + return GL_FALSE; + } + + /* Not my problem if you don't have a valid OpenGL context */ + if (!extensions) { + extensions = glGetString(GL_EXTENSIONS); + } + if (!extensions) { + return GL_FALSE; + } + + /* Take care of sub-strings etc. */ + for (last = extensions;;) { + if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) { + return GL_FALSE; + } + last = where + strlen(extension); + if (where == extensions || *(where - 1) == ' ') { + if (*last == ' ' || *last == '\0') { + return GL_TRUE; + } + } + } +} + + +GLUTproc APIENTRY +glutGetProcAddress (const char *procName) +{ + /* TODO - handle glut namespace */ + return (GLUTproc)DMesaGetProcAddress(procName); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/f8x13.c xpsb-glx-0.19/mesa/src/glut/dos/f8x13.c --- xpsb-glx-0.19/mesa/src/glut/dos/f8x13.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/f8x13.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1183 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Public domain font. Share and enjoy." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch0data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch0 = { 8, 13, 0, 2, 8, ch0data }; + +static const unsigned char ch1data[] = { + 0x0,0x0,0x0,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch1 = { 8, 13, 0, 2, 8, ch1data }; + +static const unsigned char ch2data[] = { + 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x0 +}; +static const GLUTBitmapChar ch2 = { 8, 13, 0, 2, 8, ch2data }; + +static const unsigned char ch3data[] = { + 0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch3 = { 8, 13, 0, 2, 8, ch3data }; + +static const unsigned char ch4data[] = { + 0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch4 = { 8, 13, 0, 2, 8, ch4data }; + +static const unsigned char ch5data[] = { + 0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch5 = { 8, 13, 0, 2, 8, ch5data }; + +static const unsigned char ch6data[] = { + 0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch6 = { 8, 13, 0, 2, 8, ch6data }; + +static const unsigned char ch7data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x44,0x44,0x38,0x0,0x0 +}; +static const GLUTBitmapChar ch7 = { 8, 13, 0, 2, 8, ch7data }; + +static const unsigned char ch8data[] = { + 0x0,0x0,0xfe,0x10,0x10,0xfe,0x10,0x10,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch8 = { 8, 13, 0, 2, 8, ch8data }; + +static const unsigned char ch9data[] = { + 0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch9 = { 8, 13, 0, 2, 8, ch9data }; + +static const unsigned char ch10data[] = { + 0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch10 = { 8, 13, 0, 2, 8, ch10data }; + +static const unsigned char ch11data[] = { + 0x0,0x0,0x0,0x0,0x0,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch11 = { 8, 13, 0, 2, 8, ch11data }; + +static const unsigned char ch12data[] = { + 0x10,0x10,0x10,0x10,0x10,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch12 = { 8, 13, 0, 2, 8, ch12data }; + +static const unsigned char ch13data[] = { + 0x10,0x10,0x10,0x10,0x10,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch13 = { 8, 13, 0, 2, 8, ch13data }; + +static const unsigned char ch14data[] = { + 0x0,0x0,0x0,0x0,0x0,0x1f,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch14 = { 8, 13, 0, 2, 8, ch14data }; + +static const unsigned char ch15data[] = { + 0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch15 = { 8, 13, 0, 2, 8, ch15data }; + +static const unsigned char ch16data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch16 = { 8, 13, 0, 2, 8, ch16data }; + +static const unsigned char ch17data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch17 = { 8, 13, 0, 2, 8, ch17data }; + +static const unsigned char ch18data[] = { + 0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch18 = { 8, 13, 0, 2, 8, ch18data }; + +static const unsigned char ch19data[] = { + 0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch19 = { 8, 13, 0, 2, 8, ch19data }; + +static const unsigned char ch20data[] = { + 0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch20 = { 8, 13, 0, 2, 8, ch20data }; + +static const unsigned char ch21data[] = { + 0x10,0x10,0x10,0x10,0x10,0x1f,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch21 = { 8, 13, 0, 2, 8, ch21data }; + +static const unsigned char ch22data[] = { + 0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch22 = { 8, 13, 0, 2, 8, ch22data }; + +static const unsigned char ch23data[] = { + 0x0,0x0,0x0,0x0,0x0,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch23 = { 8, 13, 0, 2, 8, ch23data }; + +static const unsigned char ch24data[] = { + 0x10,0x10,0x10,0x10,0x10,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch24 = { 8, 13, 0, 2, 8, ch24data }; + +static const unsigned char ch25data[] = { + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch25 = { 8, 13, 0, 2, 8, ch25data }; + +static const unsigned char ch26data[] = { + 0x0,0x0,0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch26 = { 8, 13, 0, 2, 8, ch26data }; + +static const unsigned char ch27data[] = { + 0x0,0x0,0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch27 = { 8, 13, 0, 2, 8, ch27data }; + +static const unsigned char ch28data[] = { + 0x0,0x0,0x44,0x24,0x24,0x24,0x24,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch28 = { 8, 13, 0, 2, 8, ch28data }; + +static const unsigned char ch29data[] = { + 0x0,0x0,0x80,0x40,0xfe,0x10,0xfe,0x4,0x2,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch29 = { 8, 13, 0, 2, 8, ch29data }; + +static const unsigned char ch30data[] = { + 0x0,0x0,0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c,0x0,0x0 +}; +static const GLUTBitmapChar ch30 = { 8, 13, 0, 2, 8, ch30data }; + +static const unsigned char ch31data[] = { + 0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch31 = { 8, 13, 0, 2, 8, ch31data }; + +static const unsigned char ch32data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch32 = { 8, 13, 0, 2, 8, ch32data }; + +static const unsigned char ch33data[] = { + 0x0,0x0,0x10,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch33 = { 8, 13, 0, 2, 8, ch33data }; + +static const unsigned char ch34data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x24,0x24,0x0,0x0 +}; +static const GLUTBitmapChar ch34 = { 8, 13, 0, 2, 8, ch34data }; + +static const unsigned char ch35data[] = { + 0x0,0x0,0x0,0x24,0x24,0x7e,0x24,0x7e,0x24,0x24,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch35 = { 8, 13, 0, 2, 8, ch35data }; + +static const unsigned char ch36data[] = { + 0x0,0x0,0x0,0x10,0x78,0x14,0x38,0x50,0x3c,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch36 = { 8, 13, 0, 2, 8, ch36data }; + +static const unsigned char ch37data[] = { + 0x0,0x0,0x44,0x2a,0x24,0x10,0x8,0x8,0x24,0x52,0x22,0x0,0x0 +}; +static const GLUTBitmapChar ch37 = { 8, 13, 0, 2, 8, ch37data }; + +static const unsigned char ch38data[] = { + 0x0,0x0,0x3a,0x44,0x4a,0x30,0x48,0x48,0x30,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch38 = { 8, 13, 0, 2, 8, ch38data }; + +static const unsigned char ch39data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x30,0x38,0x0,0x0 +}; +static const GLUTBitmapChar ch39 = { 8, 13, 0, 2, 8, ch39data }; + +static const unsigned char ch40data[] = { + 0x0,0x0,0x4,0x8,0x8,0x10,0x10,0x10,0x8,0x8,0x4,0x0,0x0 +}; +static const GLUTBitmapChar ch40 = { 8, 13, 0, 2, 8, ch40data }; + +static const unsigned char ch41data[] = { + 0x0,0x0,0x20,0x10,0x10,0x8,0x8,0x8,0x10,0x10,0x20,0x0,0x0 +}; +static const GLUTBitmapChar ch41 = { 8, 13, 0, 2, 8, ch41data }; + +static const unsigned char ch42data[] = { + 0x0,0x0,0x0,0x0,0x24,0x18,0x7e,0x18,0x24,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch42 = { 8, 13, 0, 2, 8, ch42data }; + +static const unsigned char ch43data[] = { + 0x0,0x0,0x0,0x0,0x10,0x10,0x7c,0x10,0x10,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch43 = { 8, 13, 0, 2, 8, ch43data }; + +static const unsigned char ch44data[] = { + 0x0,0x40,0x30,0x38,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch44 = { 8, 13, 0, 2, 8, ch44data }; + +static const unsigned char ch45data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch45 = { 8, 13, 0, 2, 8, ch45data }; + +static const unsigned char ch46data[] = { + 0x0,0x10,0x38,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch46 = { 8, 13, 0, 2, 8, ch46data }; + +static const unsigned char ch47data[] = { + 0x0,0x0,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2,0x0,0x0 +}; +static const GLUTBitmapChar ch47 = { 8, 13, 0, 2, 8, ch47data }; + +static const unsigned char ch48data[] = { + 0x0,0x0,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x0,0x0 +}; +static const GLUTBitmapChar ch48 = { 8, 13, 0, 2, 8, ch48data }; + +static const unsigned char ch49data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x50,0x30,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch49 = { 8, 13, 0, 2, 8, ch49data }; + +static const unsigned char ch50data[] = { + 0x0,0x0,0x7e,0x40,0x20,0x18,0x4,0x2,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch50 = { 8, 13, 0, 2, 8, ch50data }; + +static const unsigned char ch51data[] = { + 0x0,0x0,0x3c,0x42,0x2,0x2,0x1c,0x8,0x4,0x2,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch51 = { 8, 13, 0, 2, 8, ch51data }; + +static const unsigned char ch52data[] = { + 0x0,0x0,0x4,0x4,0x7e,0x44,0x44,0x24,0x14,0xc,0x4,0x0,0x0 +}; +static const GLUTBitmapChar ch52 = { 8, 13, 0, 2, 8, ch52data }; + +static const unsigned char ch53data[] = { + 0x0,0x0,0x3c,0x42,0x2,0x2,0x62,0x5c,0x40,0x40,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch53 = { 8, 13, 0, 2, 8, ch53data }; + +static const unsigned char ch54data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x62,0x5c,0x40,0x40,0x20,0x1c,0x0,0x0 +}; +static const GLUTBitmapChar ch54 = { 8, 13, 0, 2, 8, ch54data }; + +static const unsigned char ch55data[] = { + 0x0,0x0,0x20,0x20,0x10,0x10,0x8,0x8,0x4,0x2,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch55 = { 8, 13, 0, 2, 8, ch55data }; + +static const unsigned char ch56data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x3c,0x42,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch56 = { 8, 13, 0, 2, 8, ch56data }; + +static const unsigned char ch57data[] = { + 0x0,0x0,0x38,0x4,0x2,0x2,0x3a,0x46,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch57 = { 8, 13, 0, 2, 8, ch57data }; + +static const unsigned char ch58data[] = { + 0x0,0x10,0x38,0x10,0x0,0x0,0x10,0x38,0x10,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch58 = { 8, 13, 0, 2, 8, ch58data }; + +static const unsigned char ch59data[] = { + 0x0,0x40,0x30,0x38,0x0,0x0,0x10,0x38,0x10,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch59 = { 8, 13, 0, 2, 8, ch59data }; + +static const unsigned char ch60data[] = { + 0x0,0x0,0x2,0x4,0x8,0x10,0x20,0x10,0x8,0x4,0x2,0x0,0x0 +}; +static const GLUTBitmapChar ch60 = { 8, 13, 0, 2, 8, ch60data }; + +static const unsigned char ch61data[] = { + 0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch61 = { 8, 13, 0, 2, 8, ch61data }; + +static const unsigned char ch62data[] = { + 0x0,0x0,0x40,0x20,0x10,0x8,0x4,0x8,0x10,0x20,0x40,0x0,0x0 +}; +static const GLUTBitmapChar ch62 = { 8, 13, 0, 2, 8, ch62data }; + +static const unsigned char ch63data[] = { + 0x0,0x0,0x8,0x0,0x8,0x8,0x4,0x2,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch63 = { 8, 13, 0, 2, 8, ch63data }; + +static const unsigned char ch64data[] = { + 0x0,0x0,0x3c,0x40,0x4a,0x56,0x52,0x4e,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch64 = { 8, 13, 0, 2, 8, ch64data }; + +static const unsigned char ch65data[] = { + 0x0,0x0,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x24,0x18,0x0,0x0 +}; +static const GLUTBitmapChar ch65 = { 8, 13, 0, 2, 8, ch65data }; + +static const unsigned char ch66data[] = { + 0x0,0x0,0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc,0x0,0x0 +}; +static const GLUTBitmapChar ch66 = { 8, 13, 0, 2, 8, ch66data }; + +static const unsigned char ch67data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x40,0x40,0x40,0x40,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch67 = { 8, 13, 0, 2, 8, ch67data }; + +static const unsigned char ch68data[] = { + 0x0,0x0,0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc,0x0,0x0 +}; +static const GLUTBitmapChar ch68 = { 8, 13, 0, 2, 8, ch68data }; + +static const unsigned char ch69data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch69 = { 8, 13, 0, 2, 8, ch69data }; + +static const unsigned char ch70data[] = { + 0x0,0x0,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch70 = { 8, 13, 0, 2, 8, ch70data }; + +static const unsigned char ch71data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x4e,0x40,0x40,0x40,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch71 = { 8, 13, 0, 2, 8, ch71data }; + +static const unsigned char ch72data[] = { + 0x0,0x0,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x0,0x0 +}; +static const GLUTBitmapChar ch72 = { 8, 13, 0, 2, 8, ch72data }; + +static const unsigned char ch73data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x0 +}; +static const GLUTBitmapChar ch73 = { 8, 13, 0, 2, 8, ch73data }; + +static const unsigned char ch74data[] = { + 0x0,0x0,0x38,0x44,0x4,0x4,0x4,0x4,0x4,0x4,0x1e,0x0,0x0 +}; +static const GLUTBitmapChar ch74 = { 8, 13, 0, 2, 8, ch74data }; + +static const unsigned char ch75data[] = { + 0x0,0x0,0x42,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x42,0x0,0x0 +}; +static const GLUTBitmapChar ch75 = { 8, 13, 0, 2, 8, ch75data }; + +static const unsigned char ch76data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x0 +}; +static const GLUTBitmapChar ch76 = { 8, 13, 0, 2, 8, ch76data }; + +static const unsigned char ch77data[] = { + 0x0,0x0,0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82,0x0,0x0 +}; +static const GLUTBitmapChar ch77 = { 8, 13, 0, 2, 8, ch77data }; + +static const unsigned char ch78data[] = { + 0x0,0x0,0x42,0x42,0x42,0x46,0x4a,0x52,0x62,0x42,0x42,0x0,0x0 +}; +static const GLUTBitmapChar ch78 = { 8, 13, 0, 2, 8, ch78data }; + +static const unsigned char ch79data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch79 = { 8, 13, 0, 2, 8, ch79data }; + +static const unsigned char ch80data[] = { + 0x0,0x0,0x40,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x7c,0x0,0x0 +}; +static const GLUTBitmapChar ch80 = { 8, 13, 0, 2, 8, ch80data }; + +static const unsigned char ch81data[] = { + 0x0,0x2,0x3c,0x4a,0x52,0x42,0x42,0x42,0x42,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch81 = { 8, 13, 0, 2, 8, ch81data }; + +static const unsigned char ch82data[] = { + 0x0,0x0,0x42,0x44,0x48,0x50,0x7c,0x42,0x42,0x42,0x7c,0x0,0x0 +}; +static const GLUTBitmapChar ch82 = { 8, 13, 0, 2, 8, ch82data }; + +static const unsigned char ch83data[] = { + 0x0,0x0,0x3c,0x42,0x2,0x2,0x3c,0x40,0x40,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch83 = { 8, 13, 0, 2, 8, ch83data }; + +static const unsigned char ch84data[] = { + 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe,0x0,0x0 +}; +static const GLUTBitmapChar ch84 = { 8, 13, 0, 2, 8, ch84data }; + +static const unsigned char ch85data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x0 +}; +static const GLUTBitmapChar ch85 = { 8, 13, 0, 2, 8, ch85data }; + +static const unsigned char ch86data[] = { + 0x0,0x0,0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x0,0x0 +}; +static const GLUTBitmapChar ch86 = { 8, 13, 0, 2, 8, ch86data }; + +static const unsigned char ch87data[] = { + 0x0,0x0,0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82,0x0,0x0 +}; +static const GLUTBitmapChar ch87 = { 8, 13, 0, 2, 8, ch87data }; + +static const unsigned char ch88data[] = { + 0x0,0x0,0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82,0x0,0x0 +}; +static const GLUTBitmapChar ch88 = { 8, 13, 0, 2, 8, ch88data }; + +static const unsigned char ch89data[] = { + 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x0 +}; +static const GLUTBitmapChar ch89 = { 8, 13, 0, 2, 8, ch89data }; + +static const unsigned char ch90data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x20,0x10,0x8,0x4,0x2,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch90 = { 8, 13, 0, 2, 8, ch90data }; + +static const unsigned char ch91data[] = { + 0x0,0x0,0x3c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch91 = { 8, 13, 0, 2, 8, ch91data }; + +static const unsigned char ch92data[] = { + 0x0,0x0,0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80,0x0,0x0 +}; +static const GLUTBitmapChar ch92 = { 8, 13, 0, 2, 8, ch92data }; + +static const unsigned char ch93data[] = { + 0x0,0x0,0x78,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x78,0x0,0x0 +}; +static const GLUTBitmapChar ch93 = { 8, 13, 0, 2, 8, ch93data }; + +static const unsigned char ch94data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x44,0x28,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch94 = { 8, 13, 0, 2, 8, ch94data }; + +static const unsigned char ch95data[] = { + 0x0,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch95 = { 8, 13, 0, 2, 8, ch95data }; + +static const unsigned char ch96data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x18,0x38,0x0,0x0 +}; +static const GLUTBitmapChar ch96 = { 8, 13, 0, 2, 8, ch96data }; + +static const unsigned char ch97data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch97 = { 8, 13, 0, 2, 8, ch97data }; + +static const unsigned char ch98data[] = { + 0x0,0x0,0x5c,0x62,0x42,0x42,0x62,0x5c,0x40,0x40,0x40,0x0,0x0 +}; +static const GLUTBitmapChar ch98 = { 8, 13, 0, 2, 8, ch98data }; + +static const unsigned char ch99data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x40,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch99 = { 8, 13, 0, 2, 8, ch99data }; + +static const unsigned char ch100data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x42,0x46,0x3a,0x2,0x2,0x2,0x0,0x0 +}; +static const GLUTBitmapChar ch100 = { 8, 13, 0, 2, 8, ch100data }; + +static const unsigned char ch101data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch101 = { 8, 13, 0, 2, 8, ch101data }; + +static const unsigned char ch102data[] = { + 0x0,0x0,0x20,0x20,0x20,0x20,0x7c,0x20,0x20,0x22,0x1c,0x0,0x0 +}; +static const GLUTBitmapChar ch102 = { 8, 13, 0, 2, 8, ch102data }; + +static const unsigned char ch103data[] = { + 0x3c,0x42,0x3c,0x40,0x38,0x44,0x44,0x3a,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch103 = { 8, 13, 0, 2, 8, ch103data }; + +static const unsigned char ch104data[] = { + 0x0,0x0,0x42,0x42,0x42,0x42,0x62,0x5c,0x40,0x40,0x40,0x0,0x0 +}; +static const GLUTBitmapChar ch104 = { 8, 13, 0, 2, 8, ch104data }; + +static const unsigned char ch105data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch105 = { 8, 13, 0, 2, 8, ch105data }; + +static const unsigned char ch106data[] = { + 0x38,0x44,0x44,0x4,0x4,0x4,0x4,0xc,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch106 = { 8, 13, 0, 2, 8, ch106data }; + +static const unsigned char ch107data[] = { + 0x0,0x0,0x42,0x44,0x48,0x70,0x48,0x44,0x40,0x40,0x40,0x0,0x0 +}; +static const GLUTBitmapChar ch107 = { 8, 13, 0, 2, 8, ch107data }; + +static const unsigned char ch108data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x30,0x0,0x0 +}; +static const GLUTBitmapChar ch108 = { 8, 13, 0, 2, 8, ch108data }; + +static const unsigned char ch109data[] = { + 0x0,0x0,0x82,0x92,0x92,0x92,0x92,0xec,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch109 = { 8, 13, 0, 2, 8, ch109data }; + +static const unsigned char ch110data[] = { + 0x0,0x0,0x42,0x42,0x42,0x42,0x62,0x5c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch110 = { 8, 13, 0, 2, 8, ch110data }; + +static const unsigned char ch111data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch111 = { 8, 13, 0, 2, 8, ch111data }; + +static const unsigned char ch112data[] = { + 0x40,0x40,0x40,0x5c,0x62,0x42,0x62,0x5c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch112 = { 8, 13, 0, 2, 8, ch112data }; + +static const unsigned char ch113data[] = { + 0x2,0x2,0x2,0x3a,0x46,0x42,0x46,0x3a,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch113 = { 8, 13, 0, 2, 8, ch113data }; + +static const unsigned char ch114data[] = { + 0x0,0x0,0x20,0x20,0x20,0x20,0x22,0x5c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch114 = { 8, 13, 0, 2, 8, ch114data }; + +static const unsigned char ch115data[] = { + 0x0,0x0,0x3c,0x42,0xc,0x30,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch115 = { 8, 13, 0, 2, 8, ch115data }; + +static const unsigned char ch116data[] = { + 0x0,0x0,0x1c,0x22,0x20,0x20,0x20,0x7c,0x20,0x20,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch116 = { 8, 13, 0, 2, 8, ch116data }; + +static const unsigned char ch117data[] = { + 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch117 = { 8, 13, 0, 2, 8, ch117data }; + +static const unsigned char ch118data[] = { + 0x0,0x0,0x10,0x28,0x28,0x44,0x44,0x44,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch118 = { 8, 13, 0, 2, 8, ch118data }; + +static const unsigned char ch119data[] = { + 0x0,0x0,0x44,0xaa,0x92,0x92,0x82,0x82,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch119 = { 8, 13, 0, 2, 8, ch119data }; + +static const unsigned char ch120data[] = { + 0x0,0x0,0x42,0x24,0x18,0x18,0x24,0x42,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch120 = { 8, 13, 0, 2, 8, ch120data }; + +static const unsigned char ch121data[] = { + 0x3c,0x42,0x2,0x3a,0x46,0x42,0x42,0x42,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch121 = { 8, 13, 0, 2, 8, ch121data }; + +static const unsigned char ch122data[] = { + 0x0,0x0,0x7e,0x20,0x10,0x8,0x4,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch122 = { 8, 13, 0, 2, 8, ch122data }; + +static const unsigned char ch123data[] = { + 0x0,0x0,0xe,0x10,0x10,0x8,0x30,0x8,0x10,0x10,0xe,0x0,0x0 +}; +static const GLUTBitmapChar ch123 = { 8, 13, 0, 2, 8, ch123data }; + +static const unsigned char ch124data[] = { + 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch124 = { 8, 13, 0, 2, 8, ch124data }; + +static const unsigned char ch125data[] = { + 0x0,0x0,0x70,0x8,0x8,0x10,0xc,0x10,0x8,0x8,0x70,0x0,0x0 +}; +static const GLUTBitmapChar ch125 = { 8, 13, 0, 2, 8, ch125data }; + +static const unsigned char ch126data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x48,0x54,0x24,0x0,0x0 +}; +static const GLUTBitmapChar ch126 = { 8, 13, 0, 2, 8, ch126data }; + +static const unsigned char ch127data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch127 = { 8, 13, 0, 2, 8, ch127data }; + +static const unsigned char ch160data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch160 = { 8, 13, 0, 2, 8, ch160data }; + +static const unsigned char ch161data[] = { + 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch161 = { 8, 13, 0, 2, 8, ch161data }; + +static const unsigned char ch162data[] = { + 0x0,0x0,0x0,0x10,0x38,0x54,0x50,0x50,0x54,0x38,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch162 = { 8, 13, 0, 2, 8, ch162data }; + +static const unsigned char ch163data[] = { + 0x0,0x0,0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c,0x0,0x0 +}; +static const GLUTBitmapChar ch163 = { 8, 13, 0, 2, 8, ch163data }; + +static const unsigned char ch164data[] = { + 0x0,0x0,0x0,0x42,0x3c,0x24,0x24,0x3c,0x42,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch164 = { 8, 13, 0, 2, 8, ch164data }; + +static const unsigned char ch165data[] = { + 0x0,0x0,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82,0x0,0x0 +}; +static const GLUTBitmapChar ch165 = { 8, 13, 0, 2, 8, ch165data }; + +static const unsigned char ch166data[] = { + 0x0,0x0,0x10,0x10,0x10,0x10,0x0,0x10,0x10,0x10,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch166 = { 8, 13, 0, 2, 8, ch166data }; + +static const unsigned char ch167data[] = { + 0x0,0x0,0x18,0x24,0x4,0x18,0x24,0x24,0x18,0x20,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch167 = { 8, 13, 0, 2, 8, ch167data }; + +static const unsigned char ch168data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6c,0x0,0x0 +}; +static const GLUTBitmapChar ch168 = { 8, 13, 0, 2, 8, ch168data }; + +static const unsigned char ch169data[] = { + 0x0,0x0,0x0,0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38,0x0 +}; +static const GLUTBitmapChar ch169 = { 8, 13, 0, 2, 8, ch169data }; + +static const unsigned char ch170data[] = { + 0x0,0x0,0x0,0x0,0x7c,0x0,0x3c,0x44,0x3c,0x4,0x38,0x0,0x0 +}; +static const GLUTBitmapChar ch170 = { 8, 13, 0, 2, 8, ch170data }; + +static const unsigned char ch171data[] = { + 0x0,0x0,0x0,0x12,0x24,0x48,0x90,0x48,0x24,0x12,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch171 = { 8, 13, 0, 2, 8, ch171data }; + +static const unsigned char ch172data[] = { + 0x0,0x0,0x0,0x2,0x2,0x2,0x7e,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch172 = { 8, 13, 0, 2, 8, ch172data }; + +static const unsigned char ch173data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch173 = { 8, 13, 0, 2, 8, ch173data }; + +static const unsigned char ch174data[] = { + 0x0,0x0,0x0,0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38,0x0 +}; +static const GLUTBitmapChar ch174 = { 8, 13, 0, 2, 8, ch174data }; + +static const unsigned char ch175data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0 +}; +static const GLUTBitmapChar ch175 = { 8, 13, 0, 2, 8, ch175data }; + +static const unsigned char ch176data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x24,0x24,0x18,0x0,0x0 +}; +static const GLUTBitmapChar ch176 = { 8, 13, 0, 2, 8, ch176data }; + +static const unsigned char ch177data[] = { + 0x0,0x0,0x0,0x7c,0x0,0x10,0x10,0x7c,0x10,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch177 = { 8, 13, 0, 2, 8, ch177data }; + +static const unsigned char ch178data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x78,0x40,0x30,0x8,0x48,0x30,0x0 +}; +static const GLUTBitmapChar ch178 = { 8, 13, 0, 2, 8, ch178data }; + +static const unsigned char ch179data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x30,0x48,0x8,0x10,0x48,0x30,0x0 +}; +static const GLUTBitmapChar ch179 = { 8, 13, 0, 2, 8, ch179data }; + +static const unsigned char ch180data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch180 = { 8, 13, 0, 2, 8, ch180data }; + +static const unsigned char ch181data[] = { + 0x0,0x40,0x5a,0x66,0x42,0x42,0x42,0x42,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch181 = { 8, 13, 0, 2, 8, ch181data }; + +static const unsigned char ch182data[] = { + 0x0,0x0,0x14,0x14,0x14,0x14,0x34,0x74,0x74,0x74,0x3e,0x0,0x0 +}; +static const GLUTBitmapChar ch182 = { 8, 13, 0, 2, 8, ch182data }; + +static const unsigned char ch183data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch183 = { 8, 13, 0, 2, 8, ch183data }; + +static const unsigned char ch184data[] = { + 0x18,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch184 = { 8, 13, 0, 2, 8, ch184data }; + +static const unsigned char ch185data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x70,0x20,0x20,0x20,0x60,0x20,0x0 +}; +static const GLUTBitmapChar ch185 = { 8, 13, 0, 2, 8, ch185data }; + +static const unsigned char ch186data[] = { + 0x0,0x0,0x0,0x0,0x0,0x78,0x0,0x30,0x48,0x48,0x30,0x0,0x0 +}; +static const GLUTBitmapChar ch186 = { 8, 13, 0, 2, 8, ch186data }; + +static const unsigned char ch187data[] = { + 0x0,0x0,0x0,0x90,0x48,0x24,0x12,0x24,0x48,0x90,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch187 = { 8, 13, 0, 2, 8, ch187data }; + +static const unsigned char ch188data[] = { + 0x0,0x0,0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40,0x0 +}; +static const GLUTBitmapChar ch188 = { 8, 13, 0, 2, 8, ch188data }; + +static const unsigned char ch189data[] = { + 0x0,0x0,0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40,0x0 +}; +static const GLUTBitmapChar ch189 = { 8, 13, 0, 2, 8, ch189data }; + +static const unsigned char ch190data[] = { + 0x0,0x0,0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60,0x0 +}; +static const GLUTBitmapChar ch190 = { 8, 13, 0, 2, 8, ch190data }; + +static const unsigned char ch191data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x40,0x20,0x10,0x10,0x0,0x10,0x0,0x0 +}; +static const GLUTBitmapChar ch191 = { 8, 13, 0, 2, 8, ch191data }; + +static const unsigned char ch192data[] = { + 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch192 = { 8, 13, 0, 2, 8, ch192data }; + +static const unsigned char ch193data[] = { + 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch193 = { 8, 13, 0, 2, 8, ch193data }; + +static const unsigned char ch194data[] = { + 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch194 = { 8, 13, 0, 2, 8, ch194data }; + +static const unsigned char ch195data[] = { + 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x28,0x14,0x0 +}; +static const GLUTBitmapChar ch195 = { 8, 13, 0, 2, 8, ch195data }; + +static const unsigned char ch196data[] = { + 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch196 = { 8, 13, 0, 2, 8, ch196data }; + +static const unsigned char ch197data[] = { + 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x18,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch197 = { 8, 13, 0, 2, 8, ch197data }; + +static const unsigned char ch198data[] = { + 0x0,0x0,0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e,0x0,0x0 +}; +static const GLUTBitmapChar ch198 = { 8, 13, 0, 2, 8, ch198data }; + +static const unsigned char ch199data[] = { + 0x10,0x8,0x3c,0x42,0x40,0x40,0x40,0x40,0x40,0x42,0x3c,0x0,0x0 +}; +static const GLUTBitmapChar ch199 = { 8, 13, 0, 2, 8, ch199data }; + +static const unsigned char ch200data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch200 = { 8, 13, 0, 2, 8, ch200data }; + +static const unsigned char ch201data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch201 = { 8, 13, 0, 2, 8, ch201data }; + +static const unsigned char ch202data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch202 = { 8, 13, 0, 2, 8, ch202data }; + +static const unsigned char ch203data[] = { + 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch203 = { 8, 13, 0, 2, 8, ch203data }; + +static const unsigned char ch204data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch204 = { 8, 13, 0, 2, 8, ch204data }; + +static const unsigned char ch205data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch205 = { 8, 13, 0, 2, 8, ch205data }; + +static const unsigned char ch206data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch206 = { 8, 13, 0, 2, 8, ch206data }; + +static const unsigned char ch207data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x28,0x28,0x0 +}; +static const GLUTBitmapChar ch207 = { 8, 13, 0, 2, 8, ch207data }; + +static const unsigned char ch208data[] = { + 0x0,0x0,0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc,0x0,0x0 +}; +static const GLUTBitmapChar ch208 = { 8, 13, 0, 2, 8, ch208data }; + +static const unsigned char ch209data[] = { + 0x0,0x0,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14,0x0 +}; +static const GLUTBitmapChar ch209 = { 8, 13, 0, 2, 8, ch209data }; + +static const unsigned char ch210data[] = { + 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch210 = { 8, 13, 0, 2, 8, ch210data }; + +static const unsigned char ch211data[] = { + 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch211 = { 8, 13, 0, 2, 8, ch211data }; + +static const unsigned char ch212data[] = { + 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch212 = { 8, 13, 0, 2, 8, ch212data }; + +static const unsigned char ch213data[] = { + 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14,0x0 +}; +static const GLUTBitmapChar ch213 = { 8, 13, 0, 2, 8, ch213data }; + +static const unsigned char ch214data[] = { + 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28,0x0 +}; +static const GLUTBitmapChar ch214 = { 8, 13, 0, 2, 8, ch214data }; + +static const unsigned char ch215data[] = { + 0x0,0x0,0x0,0x42,0x24,0x18,0x18,0x24,0x42,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch215 = { 8, 13, 0, 2, 8, ch215data }; + +static const unsigned char ch216data[] = { + 0x0,0x40,0x3c,0x62,0x52,0x52,0x52,0x4a,0x4a,0x46,0x3c,0x2,0x0 +}; +static const GLUTBitmapChar ch216 = { 8, 13, 0, 2, 8, ch216data }; + +static const unsigned char ch217data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch217 = { 8, 13, 0, 2, 8, ch217data }; + +static const unsigned char ch218data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch218 = { 8, 13, 0, 2, 8, ch218data }; + +static const unsigned char ch219data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch219 = { 8, 13, 0, 2, 8, ch219data }; + +static const unsigned char ch220data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch220 = { 8, 13, 0, 2, 8, ch220data }; + +static const unsigned char ch221data[] = { + 0x0,0x0,0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch221 = { 8, 13, 0, 2, 8, ch221data }; + +static const unsigned char ch222data[] = { + 0x0,0x0,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x7c,0x40,0x0,0x0 +}; +static const GLUTBitmapChar ch222 = { 8, 13, 0, 2, 8, ch222data }; + +static const unsigned char ch223data[] = { + 0x0,0x40,0x5c,0x62,0x42,0x42,0x7c,0x42,0x42,0x3c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch223 = { 8, 13, 0, 2, 8, ch223data }; + +static const unsigned char ch224data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch224 = { 8, 13, 0, 2, 8, ch224data }; + +static const unsigned char ch225data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch225 = { 8, 13, 0, 2, 8, ch225data }; + +static const unsigned char ch226data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch226 = { 8, 13, 0, 2, 8, ch226data }; + +static const unsigned char ch227data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x28,0x14,0x0 +}; +static const GLUTBitmapChar ch227 = { 8, 13, 0, 2, 8, ch227data }; + +static const unsigned char ch228data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch228 = { 8, 13, 0, 2, 8, ch228data }; + +static const unsigned char ch229data[] = { + 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x18,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch229 = { 8, 13, 0, 2, 8, ch229data }; + +static const unsigned char ch230data[] = { + 0x0,0x0,0x6c,0x92,0x90,0x7c,0x12,0x6c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch230 = { 8, 13, 0, 2, 8, ch230data }; + +static const unsigned char ch231data[] = { + 0x10,0x8,0x3c,0x42,0x40,0x40,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch231 = { 8, 13, 0, 2, 8, ch231data }; + +static const unsigned char ch232data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch232 = { 8, 13, 0, 2, 8, ch232data }; + +static const unsigned char ch233data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch233 = { 8, 13, 0, 2, 8, ch233data }; + +static const unsigned char ch234data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch234 = { 8, 13, 0, 2, 8, ch234data }; + +static const unsigned char ch235data[] = { + 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch235 = { 8, 13, 0, 2, 8, ch235data }; + +static const unsigned char ch236data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x10,0x20,0x0 +}; +static const GLUTBitmapChar ch236 = { 8, 13, 0, 2, 8, ch236data }; + +static const unsigned char ch237data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x20,0x10,0x0 +}; +static const GLUTBitmapChar ch237 = { 8, 13, 0, 2, 8, ch237data }; + +static const unsigned char ch238data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x48,0x30,0x0 +}; +static const GLUTBitmapChar ch238 = { 8, 13, 0, 2, 8, ch238data }; + +static const unsigned char ch239data[] = { + 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x28,0x28,0x0 +}; +static const GLUTBitmapChar ch239 = { 8, 13, 0, 2, 8, ch239data }; + +static const unsigned char ch240data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x4,0x28,0x18,0x24,0x0 +}; +static const GLUTBitmapChar ch240 = { 8, 13, 0, 2, 8, ch240data }; + +static const unsigned char ch241data[] = { + 0x0,0x0,0x42,0x42,0x42,0x42,0x62,0x5c,0x0,0x0,0x28,0x14,0x0 +}; +static const GLUTBitmapChar ch241 = { 8, 13, 0, 2, 8, ch241data }; + +static const unsigned char ch242data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch242 = { 8, 13, 0, 2, 8, ch242data }; + +static const unsigned char ch243data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch243 = { 8, 13, 0, 2, 8, ch243data }; + +static const unsigned char ch244data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch244 = { 8, 13, 0, 2, 8, ch244data }; + +static const unsigned char ch245data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x28,0x14,0x0 +}; +static const GLUTBitmapChar ch245 = { 8, 13, 0, 2, 8, ch245data }; + +static const unsigned char ch246data[] = { + 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch246 = { 8, 13, 0, 2, 8, ch246data }; + +static const unsigned char ch247data[] = { + 0x0,0x0,0x0,0x10,0x10,0x0,0x7c,0x0,0x10,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch247 = { 8, 13, 0, 2, 8, ch247data }; + +static const unsigned char ch248data[] = { + 0x0,0x40,0x3c,0x62,0x52,0x4a,0x46,0x3c,0x2,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch248 = { 8, 13, 0, 2, 8, ch248data }; + +static const unsigned char ch249data[] = { + 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x8,0x10,0x0 +}; +static const GLUTBitmapChar ch249 = { 8, 13, 0, 2, 8, ch249data }; + +static const unsigned char ch250data[] = { + 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch250 = { 8, 13, 0, 2, 8, ch250data }; + +static const unsigned char ch251data[] = { + 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x24,0x18,0x0 +}; +static const GLUTBitmapChar ch251 = { 8, 13, 0, 2, 8, ch251data }; + +static const unsigned char ch252data[] = { + 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch252 = { 8, 13, 0, 2, 8, ch252data }; + +static const unsigned char ch253data[] = { + 0x3c,0x42,0x2,0x3a,0x46,0x42,0x42,0x42,0x0,0x0,0x10,0x8,0x0 +}; +static const GLUTBitmapChar ch253 = { 8, 13, 0, 2, 8, ch253data }; + +static const unsigned char ch254data[] = { + 0x40,0x40,0x5c,0x62,0x42,0x42,0x62,0x5c,0x40,0x40,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch254 = { 8, 13, 0, 2, 8, ch254data }; + +static const unsigned char ch255data[] = { + 0x3c,0x42,0x2,0x3a,0x46,0x42,0x42,0x42,0x0,0x0,0x24,0x24,0x0 +}; +static const GLUTBitmapChar ch255 = { 8, 13, 0, 2, 8, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + &ch0, &ch1, &ch2, &ch3, &ch4, &ch5, &ch6, &ch7, + &ch8, &ch9, &ch10, &ch11, &ch12, &ch13, &ch14, &ch15, + &ch16, &ch17, &ch18, &ch19, &ch20, &ch21, &ch22, &ch23, + &ch24, &ch25, &ch26, &ch27, &ch28, &ch29, &ch30, &ch31, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, &ch127, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmap8By13 = { + "-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO8859-1", + 13, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/f9x15.c xpsb-glx-0.19/mesa/src/glut/dos/f9x15.c --- xpsb-glx-0.19/mesa/src/glut/dos/f9x15.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/f9x15.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1407 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Public domain terminal emulator font. Share and enjoy." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch0data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch0 = { 9, 15, 0, 3, 9, ch0data }; + +static const unsigned char ch1data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x1c,0x0,0x3e,0x0,0x7f,0x0,0x3e,0x0, + 0x1c,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch1 = { 9, 15, 0, 3, 9, ch1data }; + +static const unsigned char ch2data[] = { + 0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0, + 0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch2 = { 9, 15, 0, 3, 9, ch2data }; + +static const unsigned char ch3data[] = { + 0x0,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x1f,0x0,0x0,0x0,0x44,0x0,0x44,0x0, + 0x7c,0x0,0x44,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch3 = { 9, 15, 0, 3, 9, ch3data }; + +static const unsigned char ch4data[] = { + 0x0,0x0,0x8,0x0,0x8,0x0,0xe,0x0,0x8,0x0,0xf,0x0,0x40,0x0,0x40,0x0, + 0x70,0x0,0x40,0x0,0x78,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch4 = { 9, 15, 0, 3, 9, ch4data }; + +static const unsigned char ch5data[] = { + 0x0,0x0,0x11,0x0,0x11,0x0,0x1e,0x0,0x11,0x0,0x1e,0x0,0x0,0x0,0x3c,0x0, + 0x40,0x0,0x40,0x0,0x3c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch5 = { 9, 15, 0, 3, 9, ch5data }; + +static const unsigned char ch6data[] = { + 0x0,0x0,0x10,0x0,0x10,0x0,0x1e,0x0,0x10,0x0,0x1f,0x0,0x0,0x0,0x7c,0x0, + 0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch6 = { 9, 15, 0, 3, 9, ch6data }; + +static const unsigned char ch7data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch7 = { 9, 15, 0, 3, 9, ch7data }; + +static const unsigned char ch8data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x8,0x0,0x8,0x0,0x7f,0x0,0x8,0x0, + 0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch8 = { 9, 15, 0, 3, 9, ch8data }; + +static const unsigned char ch9data[] = { + 0x0,0x0,0x1f,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x44,0x0,0x4c,0x0, + 0x54,0x0,0x64,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch9 = { 9, 15, 0, 3, 9, ch9data }; + +static const unsigned char ch10data[] = { + 0x0,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x1f,0x0,0x0,0x0,0x10,0x0, + 0x28,0x0,0x44,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch10 = { 9, 15, 0, 3, 9, ch10data }; + +static const unsigned char ch11data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch11 = { 9, 15, 0, 3, 9, ch11data }; + +static const unsigned char ch12data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf8,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch12 = { 9, 15, 0, 3, 9, ch12data }; + +static const unsigned char ch13data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf,0x80,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch13 = { 9, 15, 0, 3, 9, ch13data }; + +static const unsigned char ch14data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0x80,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch14 = { 9, 15, 0, 3, 9, ch14data }; + +static const unsigned char ch15data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch15 = { 9, 15, 0, 3, 9, ch15data }; + +static const unsigned char ch16data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch16 = { 9, 15, 0, 3, 9, ch16data }; + +static const unsigned char ch17data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch17 = { 9, 15, 0, 3, 9, ch17data }; + +static const unsigned char ch18data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch18 = { 9, 15, 0, 3, 9, ch18data }; + +static const unsigned char ch19data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch19 = { 9, 15, 0, 3, 9, ch19data }; + +static const unsigned char ch20data[] = { + 0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch20 = { 9, 15, 0, 3, 9, ch20data }; + +static const unsigned char ch21data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf,0x80,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch21 = { 9, 15, 0, 3, 9, ch21data }; + +static const unsigned char ch22data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch22 = { 9, 15, 0, 3, 9, ch22data }; + +static const unsigned char ch23data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x80,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch23 = { 9, 15, 0, 3, 9, ch23data }; + +static const unsigned char ch24data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch24 = { 9, 15, 0, 3, 9, ch24data }; + +static const unsigned char ch25data[] = { + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch25 = { 9, 15, 0, 3, 9, ch25data }; + +static const unsigned char ch26data[] = { + 0x0,0x0,0x3f,0x0,0x0,0x0,0x1,0x0,0x2,0x0,0x4,0x0,0x8,0x0,0x10,0x0, + 0x10,0x0,0x8,0x0,0x4,0x0,0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch26 = { 9, 15, 0, 3, 9, ch26data }; + +static const unsigned char ch27data[] = { + 0x0,0x0,0x7f,0x0,0x0,0x0,0x40,0x0,0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0, + 0x4,0x0,0x8,0x0,0x10,0x0,0x20,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch27 = { 9, 15, 0, 3, 9, ch27data }; + +static const unsigned char ch28data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x12,0x0,0x12,0x0,0x12,0x0,0x12,0x0, + 0x12,0x0,0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch28 = { 9, 15, 0, 3, 9, ch28data }; + +static const unsigned char ch29data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x20,0x0,0x7f,0x0,0x8,0x0,0x7f,0x0, + 0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch29 = { 9, 15, 0, 3, 9, ch29data }; + +static const unsigned char ch30data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x2e,0x0,0x51,0x0,0x30,0x0,0x10,0x0,0x10,0x0, + 0x7c,0x0,0x10,0x0,0x10,0x0,0x11,0x0,0xe,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch30 = { 9, 15, 0, 3, 9, ch30data }; + +static const unsigned char ch31data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch31 = { 9, 15, 0, 3, 9, ch31data }; + +static const unsigned char ch32data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch32 = { 9, 15, 0, 3, 9, ch32data }; + +static const unsigned char ch33data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch33 = { 9, 15, 0, 3, 9, ch33data }; + +static const unsigned char ch34data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x12,0x0,0x12,0x0,0x12,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch34 = { 9, 15, 0, 3, 9, ch34data }; + +static const unsigned char ch35data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x0,0x24,0x0,0x7e,0x0,0x24,0x0, + 0x24,0x0,0x7e,0x0,0x24,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch35 = { 9, 15, 0, 3, 9, ch35data }; + +static const unsigned char ch36data[] = { + 0x0,0x0,0x0,0x0,0x8,0x0,0x3e,0x0,0x49,0x0,0x9,0x0,0x9,0x0,0xa,0x0, + 0x1c,0x0,0x28,0x0,0x48,0x0,0x49,0x0,0x3e,0x0,0x8,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch36 = { 9, 15, 0, 3, 9, ch36data }; + +static const unsigned char ch37data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x42,0x0,0x25,0x0,0x25,0x0,0x12,0x0,0x8,0x0, + 0x8,0x0,0x24,0x0,0x52,0x0,0x52,0x0,0x21,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch37 = { 9, 15, 0, 3, 9, ch37data }; + +static const unsigned char ch38data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x31,0x0,0x4a,0x0,0x44,0x0,0x4a,0x0,0x31,0x0, + 0x30,0x0,0x48,0x0,0x48,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch38 = { 9, 15, 0, 3, 9, ch38data }; + +static const unsigned char ch39data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x10,0x0,0x8,0x0,0x4,0x0,0x6,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch39 = { 9, 15, 0, 3, 9, ch39data }; + +static const unsigned char ch40data[] = { + 0x0,0x0,0x0,0x0,0x4,0x0,0x8,0x0,0x8,0x0,0x10,0x0,0x10,0x0,0x10,0x0, + 0x10,0x0,0x10,0x0,0x10,0x0,0x8,0x0,0x8,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch40 = { 9, 15, 0, 3, 9, ch40data }; + +static const unsigned char ch41data[] = { + 0x0,0x0,0x0,0x0,0x10,0x0,0x8,0x0,0x8,0x0,0x4,0x0,0x4,0x0,0x4,0x0, + 0x4,0x0,0x4,0x0,0x4,0x0,0x8,0x0,0x8,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch41 = { 9, 15, 0, 3, 9, ch41data }; + +static const unsigned char ch42data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x49,0x0,0x2a,0x0,0x1c,0x0, + 0x2a,0x0,0x49,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch42 = { 9, 15, 0, 3, 9, ch42data }; + +static const unsigned char ch43data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x7f,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch43 = { 9, 15, 0, 3, 9, ch43data }; + +static const unsigned char ch44data[] = { + 0x8,0x0,0x4,0x0,0x4,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch44 = { 9, 15, 0, 3, 9, ch44data }; + +static const unsigned char ch45data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch45 = { 9, 15, 0, 3, 9, ch45data }; + +static const unsigned char ch46data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch46 = { 9, 15, 0, 3, 9, ch46data }; + +static const unsigned char ch47data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x20,0x0,0x20,0x0,0x10,0x0,0x8,0x0, + 0x8,0x0,0x4,0x0,0x2,0x0,0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch47 = { 9, 15, 0, 3, 9, ch47data }; + +static const unsigned char ch48data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch48 = { 9, 15, 0, 3, 9, ch48data }; + +static const unsigned char ch49data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x48,0x0,0x28,0x0,0x18,0x0,0x8,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch49 = { 9, 15, 0, 3, 9, ch49data }; + +static const unsigned char ch50data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x40,0x0,0x20,0x0,0x18,0x0,0x4,0x0, + 0x2,0x0,0x1,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch50 = { 9, 15, 0, 3, 9, ch50data }; + +static const unsigned char ch51data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x1,0x0,0x1,0x0,0x1,0x0, + 0xe,0x0,0x4,0x0,0x2,0x0,0x1,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch51 = { 9, 15, 0, 3, 9, ch51data }; + +static const unsigned char ch52data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x2,0x0,0x2,0x0,0x7f,0x0,0x42,0x0, + 0x22,0x0,0x12,0x0,0xa,0x0,0x6,0x0,0x2,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch52 = { 9, 15, 0, 3, 9, ch52data }; + +static const unsigned char ch53data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x1,0x0,0x1,0x0,0x1,0x0, + 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch53 = { 9, 15, 0, 3, 9, ch53data }; + +static const unsigned char ch54data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x61,0x0, + 0x5e,0x0,0x40,0x0,0x40,0x0,0x20,0x0,0x1e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch54 = { 9, 15, 0, 3, 9, ch54data }; + +static const unsigned char ch55data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x10,0x0,0x10,0x0,0x8,0x0, + 0x4,0x0,0x2,0x0,0x1,0x0,0x1,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch55 = { 9, 15, 0, 3, 9, ch55data }; + +static const unsigned char ch56data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x22,0x0, + 0x1c,0x0,0x22,0x0,0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch56 = { 9, 15, 0, 3, 9, ch56data }; + +static const unsigned char ch57data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x2,0x0,0x1,0x0,0x1,0x0,0x3d,0x0, + 0x43,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch57 = { 9, 15, 0, 3, 9, ch57data }; + +static const unsigned char ch58data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch58 = { 9, 15, 0, 3, 9, ch58data }; + +static const unsigned char ch59data[] = { + 0x8,0x0,0x4,0x0,0x4,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch59 = { 9, 15, 0, 3, 9, ch59data }; + +static const unsigned char ch60data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x4,0x0,0x8,0x0,0x10,0x0,0x20,0x0, + 0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0,0x2,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch60 = { 9, 15, 0, 3, 9, ch60data }; + +static const unsigned char ch61data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0x0,0x0, + 0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch61 = { 9, 15, 0, 3, 9, ch61data }; + +static const unsigned char ch62data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0,0x2,0x0, + 0x2,0x0,0x4,0x0,0x8,0x0,0x10,0x0,0x20,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch62 = { 9, 15, 0, 3, 9, ch62data }; + +static const unsigned char ch63data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x4,0x0, + 0x2,0x0,0x1,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch63 = { 9, 15, 0, 3, 9, ch63data }; + +static const unsigned char ch64data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x4d,0x0,0x53,0x0, + 0x51,0x0,0x4f,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch64 = { 9, 15, 0, 3, 9, ch64data }; + +static const unsigned char ch65data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch65 = { 9, 15, 0, 3, 9, ch65data }; + +static const unsigned char ch66data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0, + 0x3e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch66 = { 9, 15, 0, 3, 9, ch66data }; + +static const unsigned char ch67data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, + 0x40,0x0,0x40,0x0,0x40,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch67 = { 9, 15, 0, 3, 9, ch67data }; + +static const unsigned char ch68data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0, + 0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch68 = { 9, 15, 0, 3, 9, ch68data }; + +static const unsigned char ch69data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0, + 0x3c,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch69 = { 9, 15, 0, 3, 9, ch69data }; + +static const unsigned char ch70data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0, + 0x3c,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch70 = { 9, 15, 0, 3, 9, ch70data }; + +static const unsigned char ch71data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x47,0x0, + 0x40,0x0,0x40,0x0,0x40,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch71 = { 9, 15, 0, 3, 9, ch71data }; + +static const unsigned char ch72data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x7f,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch72 = { 9, 15, 0, 3, 9, ch72data }; + +static const unsigned char ch73data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch73 = { 9, 15, 0, 3, 9, ch73data }; + +static const unsigned char ch74data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x42,0x0,0x2,0x0,0x2,0x0,0x2,0x0, + 0x2,0x0,0x2,0x0,0x2,0x0,0x2,0x0,0xf,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch74 = { 9, 15, 0, 3, 9, ch74data }; + +static const unsigned char ch75data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x42,0x0,0x44,0x0,0x48,0x0,0x50,0x0, + 0x70,0x0,0x48,0x0,0x44,0x0,0x42,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch75 = { 9, 15, 0, 3, 9, ch75data }; + +static const unsigned char ch76data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0, + 0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch76 = { 9, 15, 0, 3, 9, ch76data }; + +static const unsigned char ch77data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x49,0x0,0x49,0x0, + 0x55,0x0,0x55,0x0,0x63,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch77 = { 9, 15, 0, 3, 9, ch77data }; + +static const unsigned char ch78data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x43,0x0,0x45,0x0, + 0x49,0x0,0x51,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch78 = { 9, 15, 0, 3, 9, ch78data }; + +static const unsigned char ch79data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch79 = { 9, 15, 0, 3, 9, ch79data }; + +static const unsigned char ch80data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0, + 0x7e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch80 = { 9, 15, 0, 3, 9, ch80data }; + +static const unsigned char ch81data[] = { + 0x0,0x0,0x3,0x0,0x4,0x0,0x3e,0x0,0x49,0x0,0x51,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch81 = { 9, 15, 0, 3, 9, ch81data }; + +static const unsigned char ch82data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x42,0x0,0x44,0x0,0x48,0x0, + 0x7e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch82 = { 9, 15, 0, 3, 9, ch82data }; + +static const unsigned char ch83data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x1,0x0,0x6,0x0, + 0x38,0x0,0x40,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch83 = { 9, 15, 0, 3, 9, ch83data }; + +static const unsigned char ch84data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch84 = { 9, 15, 0, 3, 9, ch84data }; + +static const unsigned char ch85data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch85 = { 9, 15, 0, 3, 9, ch85data }; + +static const unsigned char ch86data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x14,0x0,0x14,0x0,0x14,0x0,0x22,0x0, + 0x22,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch86 = { 9, 15, 0, 3, 9, ch86data }; + +static const unsigned char ch87data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x49,0x0, + 0x49,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch87 = { 9, 15, 0, 3, 9, ch87data }; + +static const unsigned char ch88data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0, + 0x8,0x0,0x14,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch88 = { 9, 15, 0, 3, 9, ch88data }; + +static const unsigned char ch89data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x14,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch89 = { 9, 15, 0, 3, 9, ch89data }; + +static const unsigned char ch90data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x40,0x0,0x40,0x0,0x20,0x0,0x10,0x0, + 0x8,0x0,0x4,0x0,0x2,0x0,0x1,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch90 = { 9, 15, 0, 3, 9, ch90data }; + +static const unsigned char ch91data[] = { + 0x0,0x0,0x0,0x0,0x1e,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0, + 0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x1e,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch91 = { 9, 15, 0, 3, 9, ch91data }; + +static const unsigned char ch92data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x2,0x0,0x2,0x0,0x4,0x0,0x8,0x0, + 0x8,0x0,0x10,0x0,0x20,0x0,0x20,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch92 = { 9, 15, 0, 3, 9, ch92data }; + +static const unsigned char ch93data[] = { + 0x0,0x0,0x0,0x0,0x3c,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0, + 0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x3c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch93 = { 9, 15, 0, 3, 9, ch93data }; + +static const unsigned char ch94data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch94 = { 9, 15, 0, 3, 9, ch94data }; + +static const unsigned char ch95data[] = { + 0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch95 = { 9, 15, 0, 3, 9, ch95data }; + +static const unsigned char ch96data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x2,0x0,0x4,0x0,0x8,0x0,0x18,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch96 = { 9, 15, 0, 3, 9, ch96data }; + +static const unsigned char ch97data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch97 = { 9, 15, 0, 3, 9, ch97data }; + +static const unsigned char ch98data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch98 = { 9, 15, 0, 3, 9, ch98data }; + +static const unsigned char ch99data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch99 = { 9, 15, 0, 3, 9, ch99data }; + +static const unsigned char ch100data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x43,0x0,0x3d,0x0,0x1,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch100 = { 9, 15, 0, 3, 9, ch100data }; + +static const unsigned char ch101data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch101 = { 9, 15, 0, 3, 9, ch101data }; + +static const unsigned char ch102data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x7c,0x0, + 0x10,0x0,0x10,0x0,0x11,0x0,0x11,0x0,0xe,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch102 = { 9, 15, 0, 3, 9, ch102data }; + +static const unsigned char ch103data[] = { + 0x3e,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x40,0x0,0x3c,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x3d,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch103 = { 9, 15, 0, 3, 9, ch103data }; + +static const unsigned char ch104data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch104 = { 9, 15, 0, 3, 9, ch104data }; + +static const unsigned char ch105data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch105 = { 9, 15, 0, 3, 9, ch105data }; + +static const unsigned char ch106data[] = { + 0x3c,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x2,0x0,0x2,0x0,0x2,0x0,0x2,0x0, + 0x2,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch106 = { 9, 15, 0, 3, 9, ch106data }; + +static const unsigned char ch107data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x46,0x0,0x58,0x0,0x60,0x0,0x58,0x0, + 0x46,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch107 = { 9, 15, 0, 3, 9, ch107data }; + +static const unsigned char ch108data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch108 = { 9, 15, 0, 3, 9, ch108data }; + +static const unsigned char ch109data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x49,0x0,0x49,0x0,0x49,0x0,0x49,0x0, + 0x49,0x0,0x76,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch109 = { 9, 15, 0, 3, 9, ch109data }; + +static const unsigned char ch110data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x61,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch110 = { 9, 15, 0, 3, 9, ch110data }; + +static const unsigned char ch111data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch111 = { 9, 15, 0, 3, 9, ch111data }; + +static const unsigned char ch112data[] = { + 0x40,0x0,0x40,0x0,0x40,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x61,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch112 = { 9, 15, 0, 3, 9, ch112data }; + +static const unsigned char ch113data[] = { + 0x1,0x0,0x1,0x0,0x1,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x43,0x0,0x3d,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch113 = { 9, 15, 0, 3, 9, ch113data }; + +static const unsigned char ch114data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x21,0x0, + 0x31,0x0,0x4e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch114 = { 9, 15, 0, 3, 9, ch114data }; + +static const unsigned char ch115data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x1,0x0,0x3e,0x0,0x40,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch115 = { 9, 15, 0, 3, 9, ch115data }; + +static const unsigned char ch116data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x11,0x0,0x10,0x0,0x10,0x0,0x10,0x0, + 0x10,0x0,0x7e,0x0,0x10,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch116 = { 9, 15, 0, 3, 9, ch116data }; + +static const unsigned char ch117data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch117 = { 9, 15, 0, 3, 9, ch117data }; + +static const unsigned char ch118data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x14,0x0,0x14,0x0,0x22,0x0,0x22,0x0, + 0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch118 = { 9, 15, 0, 3, 9, ch118data }; + +static const unsigned char ch119data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x49,0x0, + 0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch119 = { 9, 15, 0, 3, 9, ch119data }; + +static const unsigned char ch120data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0,0x14,0x0, + 0x22,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch120 = { 9, 15, 0, 3, 9, ch120data }; + +static const unsigned char ch121data[] = { + 0x3c,0x0,0x42,0x0,0x2,0x0,0x3a,0x0,0x46,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch121 = { 9, 15, 0, 3, 9, ch121data }; + +static const unsigned char ch122data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0, + 0x2,0x0,0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch122 = { 9, 15, 0, 3, 9, ch122data }; + +static const unsigned char ch123data[] = { + 0x0,0x0,0x0,0x0,0x7,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x4,0x0,0x18,0x0, + 0x18,0x0,0x4,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x7,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch123 = { 9, 15, 0, 3, 9, ch123data }; + +static const unsigned char ch124data[] = { + 0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch124 = { 9, 15, 0, 3, 9, ch124data }; + +static const unsigned char ch125data[] = { + 0x0,0x0,0x0,0x0,0x70,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x10,0x0,0xc,0x0, + 0xc,0x0,0x10,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x70,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch125 = { 9, 15, 0, 3, 9, ch125data }; + +static const unsigned char ch126data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x46,0x0,0x49,0x0,0x31,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch126 = { 9, 15, 0, 3, 9, ch126data }; + +static const unsigned char ch127data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch127 = { 9, 15, 0, 3, 9, ch127data }; + +static const unsigned char ch160data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch160 = { 9, 15, 0, 3, 9, ch160data }; + +static const unsigned char ch161data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch161 = { 9, 15, 0, 3, 9, ch161data }; + +static const unsigned char ch162data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x3c,0x0,0x52,0x0,0x50,0x0,0x48,0x0, + 0x4a,0x0,0x3c,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch162 = { 9, 15, 0, 3, 9, ch162data }; + +static const unsigned char ch163data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x2e,0x0,0x51,0x0,0x30,0x0,0x10,0x0,0x10,0x0, + 0x7c,0x0,0x10,0x0,0x10,0x0,0x11,0x0,0xe,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch163 = { 9, 15, 0, 3, 9, ch163data }; + +static const unsigned char ch164data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x3e,0x0, + 0x22,0x0,0x22,0x0,0x3e,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch164 = { 9, 15, 0, 3, 9, ch164data }; + +static const unsigned char ch165data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x3e,0x0,0x8,0x0, + 0x3e,0x0,0x14,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch165 = { 9, 15, 0, 3, 9, ch165data }; + +static const unsigned char ch166data[] = { + 0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0, + 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch166 = { 9, 15, 0, 3, 9, ch166data }; + +static const unsigned char ch167data[] = { + 0x0,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x2,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, + 0x22,0x0,0x1c,0x0,0x20,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch167 = { 9, 15, 0, 3, 9, ch167data }; + +static const unsigned char ch168data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch168 = { 9, 15, 0, 3, 9, ch168data }; + +static const unsigned char ch169data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x42,0x0,0x99,0x0,0xa5,0x0, + 0xa1,0x0,0xa5,0x0,0x99,0x0,0x42,0x0,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch169 = { 9, 15, 0, 3, 9, ch169data }; + +static const unsigned char ch170data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0, + 0xf,0x0,0x12,0x0,0xe,0x0,0x12,0x0,0xc,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch170 = { 9, 15, 0, 3, 9, ch170data }; + +static const unsigned char ch171data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x12,0x0,0x24,0x0,0x48,0x0, + 0x48,0x0,0x24,0x0,0x12,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch171 = { 9, 15, 0, 3, 9, ch171data }; + +static const unsigned char ch172data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x2,0x0,0x2,0x0, + 0x7e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch172 = { 9, 15, 0, 3, 9, ch172data }; + +static const unsigned char ch173data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch173 = { 9, 15, 0, 3, 9, ch173data }; + +static const unsigned char ch174data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x42,0x0,0xa5,0x0,0xa9,0x0, + 0xbd,0x0,0xa5,0x0,0xb9,0x0,0x42,0x0,0x3c,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch174 = { 9, 15, 0, 3, 9, ch174data }; + +static const unsigned char ch175data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch175 = { 9, 15, 0, 3, 9, ch175data }; + +static const unsigned char ch176data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0xc,0x0,0x12,0x0,0x12,0x0,0xc,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch176 = { 9, 15, 0, 3, 9, ch176data }; + +static const unsigned char ch177data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x7f,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch177 = { 9, 15, 0, 3, 9, ch177data }; + +static const unsigned char ch178data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x78,0x0, + 0x40,0x0,0x30,0x0,0x8,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch178 = { 9, 15, 0, 3, 9, ch178data }; + +static const unsigned char ch179data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x30,0x0, + 0x48,0x0,0x8,0x0,0x10,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch179 = { 9, 15, 0, 3, 9, ch179data }; + +static const unsigned char ch180data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch180 = { 9, 15, 0, 3, 9, ch180data }; + +static const unsigned char ch181data[] = { + 0x0,0x0,0x40,0x0,0x40,0x0,0x5d,0x0,0x63,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch181 = { 9, 15, 0, 3, 9, ch181data }; + +static const unsigned char ch182data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x5,0x0,0x5,0x0,0x5,0x0,0x5,0x0,0x5,0x0, + 0x3d,0x0,0x45,0x0,0x45,0x0,0x45,0x0,0x3f,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch182 = { 9, 15, 0, 3, 9, ch182data }; + +static const unsigned char ch183data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0, + 0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch183 = { 9, 15, 0, 3, 9, ch183data }; + +static const unsigned char ch184data[] = { + 0x18,0x0,0x24,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch184 = { 9, 15, 0, 3, 9, ch184data }; + +static const unsigned char ch185data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x70,0x0, + 0x20,0x0,0x20,0x0,0x20,0x0,0x60,0x0,0x20,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch185 = { 9, 15, 0, 3, 9, ch185data }; + +static const unsigned char ch186data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x7c,0x0,0x0,0x0,0x38,0x0,0x44,0x0,0x44,0x0,0x38,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch186 = { 9, 15, 0, 3, 9, ch186data }; + +static const unsigned char ch187data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x48,0x0,0x24,0x0,0x12,0x0,0x9,0x0, + 0x9,0x0,0x12,0x0,0x24,0x0,0x48,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch187 = { 9, 15, 0, 3, 9, ch187data }; + +static const unsigned char ch188data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0xd,0x0,0x9,0x0,0x5,0x0,0x73,0x0, + 0x21,0x0,0x20,0x0,0x20,0x0,0x60,0x0,0x20,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch188 = { 9, 15, 0, 3, 9, ch188data }; + +static const unsigned char ch189data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0xf,0x0,0x8,0x0,0x6,0x0,0x1,0x0,0x79,0x0, + 0x26,0x0,0x20,0x0,0x20,0x0,0x60,0x0,0x20,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch189 = { 9, 15, 0, 3, 9, ch189data }; + +static const unsigned char ch190data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0xd,0x0,0x9,0x0,0x5,0x0,0x33,0x0, + 0x49,0x0,0x8,0x0,0x10,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch190 = { 9, 15, 0, 3, 9, ch190data }; + +static const unsigned char ch191data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x40,0x0,0x20,0x0, + 0x10,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch191 = { 9, 15, 0, 3, 9, ch191data }; + +static const unsigned char ch192data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch192 = { 9, 15, 0, 3, 9, ch192data }; + +static const unsigned char ch193data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch193 = { 9, 15, 0, 3, 9, ch193data }; + +static const unsigned char ch194data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch194 = { 9, 15, 0, 3, 9, ch194data }; + +static const unsigned char ch195data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch195 = { 9, 15, 0, 3, 9, ch195data }; + +static const unsigned char ch196data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch196 = { 9, 15, 0, 3, 9, ch196data }; + +static const unsigned char ch197data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x22,0x0,0x1c,0x0,0x8,0x0,0x14,0x0,0x8,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch197 = { 9, 15, 0, 3, 9, ch197data }; + +static const unsigned char ch198data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x4f,0x0,0x48,0x0,0x48,0x0,0x48,0x0,0x7e,0x0, + 0x48,0x0,0x48,0x0,0x48,0x0,0x48,0x0,0x37,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch198 = { 9, 15, 0, 3, 9, ch198data }; + +static const unsigned char ch199data[] = { + 0x18,0x0,0x24,0x0,0xc,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, + 0x40,0x0,0x40,0x0,0x40,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch199 = { 9, 15, 0, 3, 9, ch199data }; + +static const unsigned char ch200data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, + 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch200 = { 9, 15, 0, 3, 9, ch200data }; + +static const unsigned char ch201data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, + 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch201 = { 9, 15, 0, 3, 9, ch201data }; + +static const unsigned char ch202data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, + 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch202 = { 9, 15, 0, 3, 9, ch202data }; + +static const unsigned char ch203data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, + 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch203 = { 9, 15, 0, 3, 9, ch203data }; + +static const unsigned char ch204data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch204 = { 9, 15, 0, 3, 9, ch204data }; + +static const unsigned char ch205data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch205 = { 9, 15, 0, 3, 9, ch205data }; + +static const unsigned char ch206data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch206 = { 9, 15, 0, 3, 9, ch206data }; + +static const unsigned char ch207data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch207 = { 9, 15, 0, 3, 9, ch207data }; + +static const unsigned char ch208data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0, + 0x79,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch208 = { 9, 15, 0, 3, 9, ch208data }; + +static const unsigned char ch209data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x43,0x0,0x45,0x0,0x49,0x0,0x49,0x0, + 0x51,0x0,0x61,0x0,0x41,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch209 = { 9, 15, 0, 3, 9, ch209data }; + +static const unsigned char ch210data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch210 = { 9, 15, 0, 3, 9, ch210data }; + +static const unsigned char ch211data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch211 = { 9, 15, 0, 3, 9, ch211data }; + +static const unsigned char ch212data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch212 = { 9, 15, 0, 3, 9, ch212data }; + +static const unsigned char ch213data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch213 = { 9, 15, 0, 3, 9, ch213data }; + +static const unsigned char ch214data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch214 = { 9, 15, 0, 3, 9, ch214data }; + +static const unsigned char ch215data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0, + 0x14,0x0,0x22,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch215 = { 9, 15, 0, 3, 9, ch215data }; + +static const unsigned char ch216data[] = { + 0x0,0x0,0x0,0x0,0x40,0x0,0x3e,0x0,0x61,0x0,0x51,0x0,0x51,0x0,0x49,0x0, + 0x49,0x0,0x45,0x0,0x45,0x0,0x43,0x0,0x3e,0x0,0x1,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch216 = { 9, 15, 0, 3, 9, ch216data }; + +static const unsigned char ch217data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch217 = { 9, 15, 0, 3, 9, ch217data }; + +static const unsigned char ch218data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch218 = { 9, 15, 0, 3, 9, ch218data }; + +static const unsigned char ch219data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch219 = { 9, 15, 0, 3, 9, ch219data }; + +static const unsigned char ch220data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch220 = { 9, 15, 0, 3, 9, ch220data }; + +static const unsigned char ch221data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x14,0x0, + 0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch221 = { 9, 15, 0, 3, 9, ch221data }; + +static const unsigned char ch222data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x7e,0x0,0x41,0x0, + 0x41,0x0,0x41,0x0,0x7e,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch222 = { 9, 15, 0, 3, 9, ch222data }; + +static const unsigned char ch223data[] = { + 0x0,0x0,0x0,0x0,0x40,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x7e,0x0, + 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch223 = { 9, 15, 0, 3, 9, ch223data }; + +static const unsigned char ch224data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch224 = { 9, 15, 0, 3, 9, ch224data }; + +static const unsigned char ch225data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch225 = { 9, 15, 0, 3, 9, ch225data }; + +static const unsigned char ch226data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch226 = { 9, 15, 0, 3, 9, ch226data }; + +static const unsigned char ch227data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch227 = { 9, 15, 0, 3, 9, ch227data }; + +static const unsigned char ch228data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch228 = { 9, 15, 0, 3, 9, ch228data }; + +static const unsigned char ch229data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, + 0x1,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x12,0x0,0xc,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch229 = { 9, 15, 0, 3, 9, ch229data }; + +static const unsigned char ch230data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x37,0x0,0x49,0x0,0x48,0x0,0x3e,0x0,0x9,0x0, + 0x49,0x0,0x36,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch230 = { 9, 15, 0, 3, 9, ch230data }; + +static const unsigned char ch231data[] = { + 0x18,0x0,0x24,0x0,0xc,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch231 = { 9, 15, 0, 3, 9, ch231data }; + +static const unsigned char ch232data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch232 = { 9, 15, 0, 3, 9, ch232data }; + +static const unsigned char ch233data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch233 = { 9, 15, 0, 3, 9, ch233data }; + +static const unsigned char ch234data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch234 = { 9, 15, 0, 3, 9, ch234data }; + +static const unsigned char ch235data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch235 = { 9, 15, 0, 3, 9, ch235data }; + +static const unsigned char ch236data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch236 = { 9, 15, 0, 3, 9, ch236data }; + +static const unsigned char ch237data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch237 = { 9, 15, 0, 3, 9, ch237data }; + +static const unsigned char ch238data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x24,0x0,0x18,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch238 = { 9, 15, 0, 3, 9, ch238data }; + +static const unsigned char ch239data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, + 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch239 = { 9, 15, 0, 3, 9, ch239data }; + +static const unsigned char ch240data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x4,0x0,0x28,0x0,0x18,0x0,0x24,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch240 = { 9, 15, 0, 3, 9, ch240data }; + +static const unsigned char ch241data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x61,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch241 = { 9, 15, 0, 3, 9, ch241data }; + +static const unsigned char ch242data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch242 = { 9, 15, 0, 3, 9, ch242data }; + +static const unsigned char ch243data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch243 = { 9, 15, 0, 3, 9, ch243data }; + +static const unsigned char ch244data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch244 = { 9, 15, 0, 3, 9, ch244data }; + +static const unsigned char ch245data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch245 = { 9, 15, 0, 3, 9, ch245data }; + +static const unsigned char ch246data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch246 = { 9, 15, 0, 3, 9, ch246data }; + +static const unsigned char ch247data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x1c,0x0,0x8,0x0,0x0,0x0,0x7f,0x0, + 0x0,0x0,0x8,0x0,0x1c,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch247 = { 9, 15, 0, 3, 9, ch247data }; + +static const unsigned char ch248data[] = { + 0x0,0x0,0x0,0x0,0x40,0x0,0x3e,0x0,0x51,0x0,0x51,0x0,0x49,0x0,0x45,0x0, + 0x45,0x0,0x3e,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch248 = { 9, 15, 0, 3, 9, ch248data }; + +static const unsigned char ch249data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch249 = { 9, 15, 0, 3, 9, ch249data }; + +static const unsigned char ch250data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch250 = { 9, 15, 0, 3, 9, ch250data }; + +static const unsigned char ch251data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch251 = { 9, 15, 0, 3, 9, ch251data }; + +static const unsigned char ch252data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch252 = { 9, 15, 0, 3, 9, ch252data }; + +static const unsigned char ch253data[] = { + 0x3c,0x0,0x42,0x0,0x2,0x0,0x3a,0x0,0x46,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch253 = { 9, 15, 0, 3, 9, ch253data }; + +static const unsigned char ch254data[] = { + 0x40,0x0,0x40,0x0,0x40,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x41,0x0, + 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch254 = { 9, 15, 0, 3, 9, ch254data }; + +static const unsigned char ch255data[] = { + 0x3c,0x0,0x42,0x0,0x2,0x0,0x3a,0x0,0x46,0x0,0x42,0x0,0x42,0x0,0x42,0x0, + 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 +}; +static const GLUTBitmapChar ch255 = { 9, 15, 0, 3, 9, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + &ch0, &ch1, &ch2, &ch3, &ch4, &ch5, &ch6, &ch7, + &ch8, &ch9, &ch10, &ch11, &ch12, &ch13, &ch14, &ch15, + &ch16, &ch17, &ch18, &ch19, &ch20, &ch21, &ch22, &ch23, + &ch24, &ch25, &ch26, &ch27, &ch28, &ch29, &ch30, &ch31, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, &ch127, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmap9By15 = { + "-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1", + 15, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/hel10.c xpsb-glx-0.19/mesa/src/glut/dos/hel10.c --- xpsb-glx-0.19/mesa/src/glut/dos/hel10.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/hel10.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1019 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch32data[] = { + 0x0 +}; +static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 3, ch32data }; + +static const unsigned char ch33data[] = { + 0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch33 = { 1, 8, -1, 0, 3, ch33data }; + +static const unsigned char ch34data[] = { + 0xa0,0xa0 +}; +static const GLUTBitmapChar ch34 = { 3, 2, -1, -6, 4, ch34data }; + +static const unsigned char ch35data[] = { + 0x50,0x50,0xf8,0x28,0x7c,0x28,0x28 +}; +static const GLUTBitmapChar ch35 = { 6, 7, 0, 0, 6, ch35data }; + +static const unsigned char ch36data[] = { + 0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20 +}; +static const GLUTBitmapChar ch36 = { 5, 9, 0, 1, 6, ch36data }; + +static const unsigned char ch37data[] = { + 0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64 +}; +static const GLUTBitmapChar ch37 = { 8, 8, 0, 0, 9, ch37data }; + +static const unsigned char ch38data[] = { + 0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20 +}; +static const GLUTBitmapChar ch38 = { 6, 8, -1, 0, 8, ch38data }; + +static const unsigned char ch39data[] = { + 0x80,0x40,0x40 +}; +static const GLUTBitmapChar ch39 = { 2, 3, -1, -5, 3, ch39data }; + +static const unsigned char ch40data[] = { + 0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20 +}; +static const GLUTBitmapChar ch40 = { 3, 10, 0, 2, 4, ch40data }; + +static const unsigned char ch41data[] = { + 0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80 +}; +static const GLUTBitmapChar ch41 = { 3, 10, -1, 2, 4, ch41data }; + +static const unsigned char ch42data[] = { + 0xa0,0x40,0xa0 +}; +static const GLUTBitmapChar ch42 = { 3, 3, 0, -5, 4, ch42data }; + +static const unsigned char ch43data[] = { + 0x20,0x20,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch43 = { 5, 5, 0, -1, 6, ch43data }; + +static const unsigned char ch44data[] = { + 0x80,0x40,0x40 +}; +static const GLUTBitmapChar ch44 = { 2, 3, 0, 2, 3, ch44data }; + +static const unsigned char ch45data[] = { + 0xf8 +}; +static const GLUTBitmapChar ch45 = { 5, 1, -1, -3, 7, ch45data }; + +static const unsigned char ch46data[] = { + 0x80 +}; +static const GLUTBitmapChar ch46 = { 1, 1, -1, 0, 3, ch46data }; + +static const unsigned char ch47data[] = { + 0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20 +}; +static const GLUTBitmapChar ch47 = { 3, 8, 0, 0, 3, ch47data }; + +static const unsigned char ch48data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch48 = { 5, 8, 0, 0, 6, ch48data }; + +static const unsigned char ch49data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40 +}; +static const GLUTBitmapChar ch49 = { 2, 8, -1, 0, 6, ch49data }; + +static const unsigned char ch50data[] = { + 0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70 +}; +static const GLUTBitmapChar ch50 = { 5, 8, 0, 0, 6, ch50data }; + +static const unsigned char ch51data[] = { + 0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70 +}; +static const GLUTBitmapChar ch51 = { 5, 8, 0, 0, 6, ch51data }; + +static const unsigned char ch52data[] = { + 0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10 +}; +static const GLUTBitmapChar ch52 = { 5, 8, 0, 0, 6, ch52data }; + +static const unsigned char ch53data[] = { + 0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8 +}; +static const GLUTBitmapChar ch53 = { 5, 8, 0, 0, 6, ch53data }; + +static const unsigned char ch54data[] = { + 0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70 +}; +static const GLUTBitmapChar ch54 = { 5, 8, 0, 0, 6, ch54data }; + +static const unsigned char ch55data[] = { + 0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8 +}; +static const GLUTBitmapChar ch55 = { 5, 8, 0, 0, 6, ch55data }; + +static const unsigned char ch56data[] = { + 0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch56 = { 5, 8, 0, 0, 6, ch56data }; + +static const unsigned char ch57data[] = { + 0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch57 = { 5, 8, 0, 0, 6, ch57data }; + +static const unsigned char ch58data[] = { + 0x80,0x0,0x0,0x0,0x0,0x80 +}; +static const GLUTBitmapChar ch58 = { 1, 6, -1, 0, 3, ch58data }; + +static const unsigned char ch59data[] = { + 0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40 +}; +static const GLUTBitmapChar ch59 = { 2, 8, 0, 2, 3, ch59data }; + +static const unsigned char ch60data[] = { + 0x20,0x40,0x80,0x40,0x20 +}; +static const GLUTBitmapChar ch60 = { 3, 5, -1, -1, 6, ch60data }; + +static const unsigned char ch61data[] = { + 0xf0,0x0,0xf0 +}; +static const GLUTBitmapChar ch61 = { 4, 3, 0, -2, 5, ch61data }; + +static const unsigned char ch62data[] = { + 0x80,0x40,0x20,0x40,0x80 +}; +static const GLUTBitmapChar ch62 = { 3, 5, -1, -1, 6, ch62data }; + +static const unsigned char ch63data[] = { + 0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60 +}; +static const GLUTBitmapChar ch63 = { 4, 8, -1, 0, 6, ch63data }; + +static const unsigned char ch64data[] = { + 0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40, + 0x20,0x80,0x1f,0x0 +}; +static const GLUTBitmapChar ch64 = { 10, 10, 0, 2, 11, ch64data }; + +static const unsigned char ch65data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10 +}; +static const GLUTBitmapChar ch65 = { 7, 8, 0, 0, 7, ch65data }; + +static const unsigned char ch66data[] = { + 0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0 +}; +static const GLUTBitmapChar ch66 = { 5, 8, -1, 0, 7, ch66data }; + +static const unsigned char ch67data[] = { + 0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78 +}; +static const GLUTBitmapChar ch67 = { 6, 8, -1, 0, 8, ch67data }; + +static const unsigned char ch68data[] = { + 0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0 +}; +static const GLUTBitmapChar ch68 = { 6, 8, -1, 0, 8, ch68data }; + +static const unsigned char ch69data[] = { + 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8 +}; +static const GLUTBitmapChar ch69 = { 5, 8, -1, 0, 7, ch69data }; + +static const unsigned char ch70data[] = { + 0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8 +}; +static const GLUTBitmapChar ch70 = { 5, 8, -1, 0, 6, ch70data }; + +static const unsigned char ch71data[] = { + 0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78 +}; +static const GLUTBitmapChar ch71 = { 6, 8, -1, 0, 8, ch71data }; + +static const unsigned char ch72data[] = { + 0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84 +}; +static const GLUTBitmapChar ch72 = { 6, 8, -1, 0, 8, ch72data }; + +static const unsigned char ch73data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch73 = { 1, 8, -1, 0, 3, ch73data }; + +static const unsigned char ch74data[] = { + 0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10 +}; +static const GLUTBitmapChar ch74 = { 4, 8, 0, 0, 5, ch74data }; + +static const unsigned char ch75data[] = { + 0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88 +}; +static const GLUTBitmapChar ch75 = { 5, 8, -1, 0, 7, ch75data }; + +static const unsigned char ch76data[] = { + 0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch76 = { 4, 8, -1, 0, 6, ch76data }; + +static const unsigned char ch77data[] = { + 0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82 +}; +static const GLUTBitmapChar ch77 = { 7, 8, -1, 0, 9, ch77data }; + +static const unsigned char ch78data[] = { + 0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4 +}; +static const GLUTBitmapChar ch78 = { 6, 8, -1, 0, 8, ch78data }; + +static const unsigned char ch79data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78 +}; +static const GLUTBitmapChar ch79 = { 6, 8, -1, 0, 8, ch79data }; + +static const unsigned char ch80data[] = { + 0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0 +}; +static const GLUTBitmapChar ch80 = { 5, 8, -1, 0, 7, ch80data }; + +static const unsigned char ch81data[] = { + 0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78 +}; +static const GLUTBitmapChar ch81 = { 7, 9, -1, 1, 8, ch81data }; + +static const unsigned char ch82data[] = { + 0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0 +}; +static const GLUTBitmapChar ch82 = { 5, 8, -1, 0, 7, ch82data }; + +static const unsigned char ch83data[] = { + 0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70 +}; +static const GLUTBitmapChar ch83 = { 5, 8, -1, 0, 7, ch83data }; + +static const unsigned char ch84data[] = { + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8 +}; +static const GLUTBitmapChar ch84 = { 5, 8, 0, 0, 5, ch84data }; + +static const unsigned char ch85data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84 +}; +static const GLUTBitmapChar ch85 = { 6, 8, -1, 0, 8, ch85data }; + +static const unsigned char ch86data[] = { + 0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82 +}; +static const GLUTBitmapChar ch86 = { 7, 8, 0, 0, 7, ch86data }; + +static const unsigned char ch87data[] = { + 0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80 +}; +static const GLUTBitmapChar ch87 = { 9, 8, 0, 0, 9, ch87data }; + +static const unsigned char ch88data[] = { + 0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88 +}; +static const GLUTBitmapChar ch88 = { 5, 8, -1, 0, 7, ch88data }; + +static const unsigned char ch89data[] = { + 0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82 +}; +static const GLUTBitmapChar ch89 = { 7, 8, 0, 0, 7, ch89data }; + +static const unsigned char ch90data[] = { + 0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8 +}; +static const GLUTBitmapChar ch90 = { 5, 8, -1, 0, 7, ch90data }; + +static const unsigned char ch91data[] = { + 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 +}; +static const GLUTBitmapChar ch91 = { 2, 10, -1, 2, 3, ch91data }; + +static const unsigned char ch92data[] = { + 0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80 +}; +static const GLUTBitmapChar ch92 = { 3, 8, 0, 0, 3, ch92data }; + +static const unsigned char ch93data[] = { + 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0 +}; +static const GLUTBitmapChar ch93 = { 2, 10, 0, 2, 3, ch93data }; + +static const unsigned char ch94data[] = { + 0x88,0x50,0x50,0x20,0x20 +}; +static const GLUTBitmapChar ch94 = { 5, 5, 0, -3, 6, ch94data }; + +static const unsigned char ch95data[] = { + 0xfc +}; +static const GLUTBitmapChar ch95 = { 6, 1, 0, 2, 6, ch95data }; + +static const unsigned char ch96data[] = { + 0x80,0x80,0x40 +}; +static const GLUTBitmapChar ch96 = { 2, 3, 0, -5, 3, ch96data }; + +static const unsigned char ch97data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0 +}; +static const GLUTBitmapChar ch97 = { 5, 6, 0, 0, 5, ch97data }; + +static const unsigned char ch98data[] = { + 0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80 +}; +static const GLUTBitmapChar ch98 = { 5, 8, 0, 0, 6, ch98data }; + +static const unsigned char ch99data[] = { + 0x60,0x90,0x80,0x80,0x90,0x60 +}; +static const GLUTBitmapChar ch99 = { 4, 6, 0, 0, 5, ch99data }; + +static const unsigned char ch100data[] = { + 0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8 +}; +static const GLUTBitmapChar ch100 = { 5, 8, 0, 0, 6, ch100data }; + +static const unsigned char ch101data[] = { + 0x60,0x90,0x80,0xf0,0x90,0x60 +}; +static const GLUTBitmapChar ch101 = { 4, 6, 0, 0, 5, ch101data }; + +static const unsigned char ch102data[] = { + 0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30 +}; +static const GLUTBitmapChar ch102 = { 4, 8, 0, 0, 4, ch102data }; + +static const unsigned char ch103data[] = { + 0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68 +}; +static const GLUTBitmapChar ch103 = { 5, 8, 0, 2, 6, ch103data }; + +static const unsigned char ch104data[] = { + 0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 +}; +static const GLUTBitmapChar ch104 = { 5, 8, 0, 0, 6, ch104data }; + +static const unsigned char ch105data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 +}; +static const GLUTBitmapChar ch105 = { 1, 8, 0, 0, 2, ch105data }; + +static const unsigned char ch106data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 +}; +static const GLUTBitmapChar ch106 = { 1, 9, 0, 1, 2, ch106data }; + +static const unsigned char ch107data[] = { + 0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80 +}; +static const GLUTBitmapChar ch107 = { 4, 8, 0, 0, 5, ch107data }; + +static const unsigned char ch108data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch108 = { 1, 8, 0, 0, 2, ch108data }; + +static const unsigned char ch109data[] = { + 0x92,0x92,0x92,0x92,0x92,0xec +}; +static const GLUTBitmapChar ch109 = { 7, 6, 0, 0, 8, ch109data }; + +static const unsigned char ch110data[] = { + 0x88,0x88,0x88,0x88,0xc8,0xb0 +}; +static const GLUTBitmapChar ch110 = { 5, 6, 0, 0, 6, ch110data }; + +static const unsigned char ch111data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch111 = { 5, 6, 0, 0, 6, ch111data }; + +static const unsigned char ch112data[] = { + 0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0 +}; +static const GLUTBitmapChar ch112 = { 5, 8, 0, 2, 6, ch112data }; + +static const unsigned char ch113data[] = { + 0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68 +}; +static const GLUTBitmapChar ch113 = { 5, 8, 0, 2, 6, ch113data }; + +static const unsigned char ch114data[] = { + 0x80,0x80,0x80,0x80,0xc0,0xa0 +}; +static const GLUTBitmapChar ch114 = { 3, 6, 0, 0, 4, ch114data }; + +static const unsigned char ch115data[] = { + 0x60,0x90,0x10,0x60,0x90,0x60 +}; +static const GLUTBitmapChar ch115 = { 4, 6, 0, 0, 5, ch115data }; + +static const unsigned char ch116data[] = { + 0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40 +}; +static const GLUTBitmapChar ch116 = { 3, 8, 0, 0, 4, ch116data }; + +static const unsigned char ch117data[] = { + 0x70,0x90,0x90,0x90,0x90,0x90 +}; +static const GLUTBitmapChar ch117 = { 4, 6, 0, 0, 5, ch117data }; + +static const unsigned char ch118data[] = { + 0x20,0x20,0x50,0x50,0x88,0x88 +}; +static const GLUTBitmapChar ch118 = { 5, 6, 0, 0, 6, ch118data }; + +static const unsigned char ch119data[] = { + 0x28,0x28,0x54,0x54,0x92,0x92 +}; +static const GLUTBitmapChar ch119 = { 7, 6, 0, 0, 8, ch119data }; + +static const unsigned char ch120data[] = { + 0x88,0x88,0x50,0x20,0x50,0x88 +}; +static const GLUTBitmapChar ch120 = { 5, 6, 0, 0, 6, ch120data }; + +static const unsigned char ch121data[] = { + 0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90 +}; +static const GLUTBitmapChar ch121 = { 4, 8, 0, 2, 5, ch121data }; + +static const unsigned char ch122data[] = { + 0xf0,0x80,0x40,0x20,0x10,0xf0 +}; +static const GLUTBitmapChar ch122 = { 4, 6, 0, 0, 5, ch122data }; + +static const unsigned char ch123data[] = { + 0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20 +}; +static const GLUTBitmapChar ch123 = { 3, 10, 0, 2, 3, ch123data }; + +static const unsigned char ch124data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch124 = { 1, 10, -1, 2, 3, ch124data }; + +static const unsigned char ch125data[] = { + 0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80 +}; +static const GLUTBitmapChar ch125 = { 3, 10, 0, 2, 3, ch125data }; + +static const unsigned char ch126data[] = { + 0x98,0x64 +}; +static const GLUTBitmapChar ch126 = { 6, 2, 0, -3, 7, ch126data }; + +static const unsigned char ch160data[] = { + 0x0 +}; +static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 3, ch160data }; + +static const unsigned char ch161data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 +}; +static const GLUTBitmapChar ch161 = { 1, 8, -1, 2, 3, ch161data }; + +static const unsigned char ch162data[] = { + 0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10 +}; +static const GLUTBitmapChar ch162 = { 5, 8, 0, 1, 6, ch162data }; + +static const unsigned char ch163data[] = { + 0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30 +}; +static const GLUTBitmapChar ch163 = { 5, 8, 0, 0, 6, ch163data }; + +static const unsigned char ch164data[] = { + 0x90,0x60,0x90,0x90,0x60,0x90 +}; +static const GLUTBitmapChar ch164 = { 4, 6, 0, -1, 5, ch164data }; + +static const unsigned char ch165data[] = { + 0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88 +}; +static const GLUTBitmapChar ch165 = { 5, 8, 0, 0, 6, ch165data }; + +static const unsigned char ch166data[] = { + 0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch166 = { 1, 10, -1, 2, 3, ch166data }; + +static const unsigned char ch167data[] = { + 0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70 +}; +static const GLUTBitmapChar ch167 = { 5, 10, 0, 2, 6, ch167data }; + +static const unsigned char ch168data[] = { + 0xa0 +}; +static const GLUTBitmapChar ch168 = { 3, 1, 0, -7, 3, ch168data }; + +static const unsigned char ch169data[] = { + 0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38 +}; +static const GLUTBitmapChar ch169 = { 7, 7, -1, 0, 9, ch169data }; + +static const unsigned char ch170data[] = { + 0xe0,0x0,0xa0,0x20,0xe0 +}; +static const GLUTBitmapChar ch170 = { 3, 5, 0, -3, 4, ch170data }; + +static const unsigned char ch171data[] = { + 0x28,0x50,0xa0,0x50,0x28 +}; +static const GLUTBitmapChar ch171 = { 5, 5, 0, 0, 6, ch171data }; + +static const unsigned char ch172data[] = { + 0x8,0x8,0xf8 +}; +static const GLUTBitmapChar ch172 = { 5, 3, -1, -2, 7, ch172data }; + +static const unsigned char ch173data[] = { + 0xe0 +}; +static const GLUTBitmapChar ch173 = { 3, 1, 0, -3, 4, ch173data }; + +static const unsigned char ch174data[] = { + 0x38,0x44,0xaa,0xb2,0xba,0x44,0x38 +}; +static const GLUTBitmapChar ch174 = { 7, 7, -1, 0, 9, ch174data }; + +static const unsigned char ch175data[] = { + 0xe0 +}; +static const GLUTBitmapChar ch175 = { 3, 1, 0, -7, 3, ch175data }; + +static const unsigned char ch176data[] = { + 0x60,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch176 = { 4, 4, 0, -3, 4, ch176data }; + +static const unsigned char ch177data[] = { + 0xf8,0x0,0x20,0x20,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch177 = { 5, 7, 0, 0, 6, ch177data }; + +static const unsigned char ch178data[] = { + 0xe0,0x40,0xa0,0x60 +}; +static const GLUTBitmapChar ch178 = { 3, 4, 0, -3, 3, ch178data }; + +static const unsigned char ch179data[] = { + 0xc0,0x20,0x40,0xe0 +}; +static const GLUTBitmapChar ch179 = { 3, 4, 0, -3, 3, ch179data }; + +static const unsigned char ch180data[] = { + 0x80,0x40 +}; +static const GLUTBitmapChar ch180 = { 2, 2, 0, -6, 3, ch180data }; + +static const unsigned char ch181data[] = { + 0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90 +}; +static const GLUTBitmapChar ch181 = { 4, 8, 0, 2, 5, ch181data }; + +static const unsigned char ch182data[] = { + 0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c +}; +static const GLUTBitmapChar ch182 = { 6, 10, 0, 2, 6, ch182data }; + +static const unsigned char ch183data[] = { + 0xc0 +}; +static const GLUTBitmapChar ch183 = { 2, 1, 0, -3, 3, ch183data }; + +static const unsigned char ch184data[] = { + 0xc0,0x40 +}; +static const GLUTBitmapChar ch184 = { 2, 2, 0, 2, 3, ch184data }; + +static const unsigned char ch185data[] = { + 0x40,0x40,0xc0,0x40 +}; +static const GLUTBitmapChar ch185 = { 2, 4, 0, -3, 3, ch185data }; + +static const unsigned char ch186data[] = { + 0xe0,0x0,0xe0,0xa0,0xe0 +}; +static const GLUTBitmapChar ch186 = { 3, 5, 0, -3, 4, ch186data }; + +static const unsigned char ch187data[] = { + 0xa0,0x50,0x28,0x50,0xa0 +}; +static const GLUTBitmapChar ch187 = { 5, 5, 0, 0, 6, ch187data }; + +static const unsigned char ch188data[] = { + 0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0 +}; +static const GLUTBitmapChar ch188 = { 9, 8, 0, 0, 9, ch188data }; + +static const unsigned char ch189data[] = { + 0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42 +}; +static const GLUTBitmapChar ch189 = { 8, 8, 0, 0, 9, ch189data }; + +static const unsigned char ch190data[] = { + 0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0 +}; +static const GLUTBitmapChar ch190 = { 9, 8, 0, 0, 9, ch190data }; + +static const unsigned char ch191data[] = { + 0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20 +}; +static const GLUTBitmapChar ch191 = { 4, 8, -1, 2, 6, ch191data }; + +static const unsigned char ch192data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch192 = { 7, 11, 0, 0, 7, ch192data }; + +static const unsigned char ch193data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch193 = { 7, 11, 0, 0, 7, ch193data }; + +static const unsigned char ch194data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch194 = { 7, 11, 0, 0, 7, ch194data }; + +static const unsigned char ch195data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14 +}; +static const GLUTBitmapChar ch195 = { 7, 11, 0, 0, 7, ch195data }; + +static const unsigned char ch196data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28 +}; +static const GLUTBitmapChar ch196 = { 7, 10, 0, 0, 7, ch196data }; + +static const unsigned char ch197data[] = { + 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10 +}; +static const GLUTBitmapChar ch197 = { 7, 11, 0, 0, 7, ch197data }; + +static const unsigned char ch198data[] = { + 0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80 +}; +static const GLUTBitmapChar ch198 = { 9, 8, 0, 0, 10, ch198data }; + +static const unsigned char ch199data[] = { + 0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78 +}; +static const GLUTBitmapChar ch199 = { 6, 10, -1, 2, 8, ch199data }; + +static const unsigned char ch200data[] = { + 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch200 = { 5, 11, -1, 0, 7, ch200data }; + +static const unsigned char ch201data[] = { + 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch201 = { 5, 11, -1, 0, 7, ch201data }; + +static const unsigned char ch202data[] = { + 0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch202 = { 5, 11, -1, 0, 7, ch202data }; + +static const unsigned char ch203data[] = { + 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50 +}; +static const GLUTBitmapChar ch203 = { 5, 10, -1, 0, 7, ch203data }; + +static const unsigned char ch204data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch204 = { 2, 11, 0, 0, 3, ch204data }; + +static const unsigned char ch205data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 +}; +static const GLUTBitmapChar ch205 = { 2, 11, -1, 0, 3, ch205data }; + +static const unsigned char ch206data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch206 = { 3, 11, 0, 0, 3, ch206data }; + +static const unsigned char ch207data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 +}; +static const GLUTBitmapChar ch207 = { 3, 10, 0, 0, 3, ch207data }; + +static const unsigned char ch208data[] = { + 0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78 +}; +static const GLUTBitmapChar ch208 = { 7, 8, 0, 0, 8, ch208data }; + +static const unsigned char ch209data[] = { + 0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch209 = { 6, 11, -1, 0, 8, ch209data }; + +static const unsigned char ch210data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch210 = { 6, 11, -1, 0, 8, ch210data }; + +static const unsigned char ch211data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch211 = { 6, 11, -1, 0, 8, ch211data }; + +static const unsigned char ch212data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch212 = { 6, 11, -1, 0, 8, ch212data }; + +static const unsigned char ch213data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch213 = { 6, 11, -1, 0, 8, ch213data }; + +static const unsigned char ch214data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48 +}; +static const GLUTBitmapChar ch214 = { 6, 10, -1, 0, 8, ch214data }; + +static const unsigned char ch215data[] = { + 0x88,0x50,0x20,0x50,0x88 +}; +static const GLUTBitmapChar ch215 = { 5, 5, 0, -1, 6, ch215data }; + +static const unsigned char ch216data[] = { + 0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4 +}; +static const GLUTBitmapChar ch216 = { 6, 10, -1, 1, 8, ch216data }; + +static const unsigned char ch217data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch217 = { 6, 11, -1, 0, 8, ch217data }; + +static const unsigned char ch218data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch218 = { 6, 11, -1, 0, 8, ch218data }; + +static const unsigned char ch219data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch219 = { 6, 11, -1, 0, 8, ch219data }; + +static const unsigned char ch220data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48 +}; +static const GLUTBitmapChar ch220 = { 6, 10, -1, 0, 8, ch220data }; + +static const unsigned char ch221data[] = { + 0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch221 = { 7, 11, 0, 0, 7, ch221data }; + +static const unsigned char ch222data[] = { + 0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80 +}; +static const GLUTBitmapChar ch222 = { 5, 8, -1, 0, 7, ch222data }; + +static const unsigned char ch223data[] = { + 0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch223 = { 4, 8, 0, 0, 5, ch223data }; + +static const unsigned char ch224data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch224 = { 5, 9, 0, 0, 5, ch224data }; + +static const unsigned char ch225data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch225 = { 5, 9, 0, 0, 5, ch225data }; + +static const unsigned char ch226data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch226 = { 5, 9, 0, 0, 5, ch226data }; + +static const unsigned char ch227data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50 +}; +static const GLUTBitmapChar ch227 = { 5, 9, 0, 0, 5, ch227data }; + +static const unsigned char ch228data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50 +}; +static const GLUTBitmapChar ch228 = { 5, 8, 0, 0, 5, ch228data }; + +static const unsigned char ch229data[] = { + 0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20 +}; +static const GLUTBitmapChar ch229 = { 5, 9, 0, 0, 5, ch229data }; + +static const unsigned char ch230data[] = { + 0x6c,0x92,0x90,0x7e,0x12,0xec +}; +static const GLUTBitmapChar ch230 = { 7, 6, 0, 0, 8, ch230data }; + +static const unsigned char ch231data[] = { + 0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60 +}; +static const GLUTBitmapChar ch231 = { 4, 8, 0, 2, 5, ch231data }; + +static const unsigned char ch232data[] = { + 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch232 = { 4, 9, 0, 0, 5, ch232data }; + +static const unsigned char ch233data[] = { + 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch233 = { 4, 9, 0, 0, 5, ch233data }; + +static const unsigned char ch234data[] = { + 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch234 = { 4, 9, 0, 0, 5, ch234data }; + +static const unsigned char ch235data[] = { + 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50 +}; +static const GLUTBitmapChar ch235 = { 4, 8, 0, 0, 5, ch235data }; + +static const unsigned char ch236data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch236 = { 2, 9, 1, 0, 2, ch236data }; + +static const unsigned char ch237data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 +}; +static const GLUTBitmapChar ch237 = { 2, 9, 0, 0, 2, ch237data }; + +static const unsigned char ch238data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch238 = { 3, 9, 1, 0, 2, ch238data }; + +static const unsigned char ch239data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 +}; +static const GLUTBitmapChar ch239 = { 3, 8, 0, 0, 2, ch239data }; + +static const unsigned char ch240data[] = { + 0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50 +}; +static const GLUTBitmapChar ch240 = { 5, 9, 0, 0, 6, ch240data }; + +static const unsigned char ch241data[] = { + 0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50 +}; +static const GLUTBitmapChar ch241 = { 4, 9, 0, 0, 5, ch241data }; + +static const unsigned char ch242data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch242 = { 5, 9, 0, 0, 6, ch242data }; + +static const unsigned char ch243data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch243 = { 5, 9, 0, 0, 6, ch243data }; + +static const unsigned char ch244data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch244 = { 5, 9, 0, 0, 6, ch244data }; + +static const unsigned char ch245data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch245 = { 5, 9, 0, 0, 6, ch245data }; + +static const unsigned char ch246data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50 +}; +static const GLUTBitmapChar ch246 = { 5, 8, 0, 0, 6, ch246data }; + +static const unsigned char ch247data[] = { + 0x20,0x0,0xf8,0x0,0x20 +}; +static const GLUTBitmapChar ch247 = { 5, 5, 0, -1, 6, ch247data }; + +static const unsigned char ch248data[] = { + 0x70,0x88,0xc8,0xa8,0x98,0x74 +}; +static const GLUTBitmapChar ch248 = { 6, 6, 0, 0, 6, ch248data }; + +static const unsigned char ch249data[] = { + 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch249 = { 4, 9, 0, 0, 5, ch249data }; + +static const unsigned char ch250data[] = { + 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch250 = { 4, 9, 0, 0, 5, ch250data }; + +static const unsigned char ch251data[] = { + 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch251 = { 4, 9, 0, 0, 5, ch251data }; + +static const unsigned char ch252data[] = { + 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50 +}; +static const GLUTBitmapChar ch252 = { 4, 8, 0, 0, 5, ch252data }; + +static const unsigned char ch253data[] = { + 0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch253 = { 4, 11, 0, 2, 5, ch253data }; + +static const unsigned char ch254data[] = { + 0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80 +}; +static const GLUTBitmapChar ch254 = { 5, 10, 0, 2, 6, ch254data }; + +static const unsigned char ch255data[] = { + 0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50 +}; +static const GLUTBitmapChar ch255 = { 4, 10, 0, 2, 5, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmapHelvetica10 = { + "-Adobe-Helvetica-Medium-R-Normal--10-100-75-75-P-56-ISO8859-1", + 13, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/hel12.c xpsb-glx-0.19/mesa/src/glut/dos/hel12.c --- xpsb-glx-0.19/mesa/src/glut/dos/hel12.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/hel12.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1029 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch32data[] = { + 0x0 +}; +static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 4, ch32data }; + +static const unsigned char ch33data[] = { + 0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch33 = { 1, 9, -1, 0, 3, ch33data }; + +static const unsigned char ch34data[] = { + 0xa0,0xa0,0xa0 +}; +static const GLUTBitmapChar ch34 = { 3, 3, -1, -6, 5, ch34data }; + +static const unsigned char ch35data[] = { + 0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28 +}; +static const GLUTBitmapChar ch35 = { 6, 8, 0, 0, 7, ch35data }; + +static const unsigned char ch36data[] = { + 0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20 +}; +static const GLUTBitmapChar ch36 = { 5, 10, -1, 1, 7, ch36data }; + +static const unsigned char ch37data[] = { + 0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0, + 0x62,0x0 +}; +static const GLUTBitmapChar ch37 = { 9, 9, -1, 0, 11, ch37data }; + +static const unsigned char ch38data[] = { + 0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30 +}; +static const GLUTBitmapChar ch38 = { 7, 9, -1, 0, 9, ch38data }; + +static const unsigned char ch39data[] = { + 0x80,0x40,0xc0 +}; +static const GLUTBitmapChar ch39 = { 2, 3, -1, -6, 3, ch39data }; + +static const unsigned char ch40data[] = { + 0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20 +}; +static const GLUTBitmapChar ch40 = { 3, 12, -1, 3, 4, ch40data }; + +static const unsigned char ch41data[] = { + 0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80 +}; +static const GLUTBitmapChar ch41 = { 3, 12, 0, 3, 4, ch41data }; + +static const unsigned char ch42data[] = { + 0xa0,0x40,0xa0 +}; +static const GLUTBitmapChar ch42 = { 3, 3, -1, -6, 5, ch42data }; + +static const unsigned char ch43data[] = { + 0x20,0x20,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch43 = { 5, 5, -1, -1, 7, ch43data }; + +static const unsigned char ch44data[] = { + 0x80,0x40,0x40 +}; +static const GLUTBitmapChar ch44 = { 2, 3, -1, 2, 4, ch44data }; + +static const unsigned char ch45data[] = { + 0xf8 +}; +static const GLUTBitmapChar ch45 = { 5, 1, -1, -3, 8, ch45data }; + +static const unsigned char ch46data[] = { + 0x80 +}; +static const GLUTBitmapChar ch46 = { 1, 1, -1, 0, 3, ch46data }; + +static const unsigned char ch47data[] = { + 0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10 +}; +static const GLUTBitmapChar ch47 = { 4, 9, 0, 0, 4, ch47data }; + +static const unsigned char ch48data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch48 = { 5, 9, -1, 0, 7, ch48data }; + +static const unsigned char ch49data[] = { + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20 +}; +static const GLUTBitmapChar ch49 = { 3, 9, -1, 0, 7, ch49data }; + +static const unsigned char ch50data[] = { + 0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70 +}; +static const GLUTBitmapChar ch50 = { 5, 9, -1, 0, 7, ch50data }; + +static const unsigned char ch51data[] = { + 0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70 +}; +static const GLUTBitmapChar ch51 = { 5, 9, -1, 0, 7, ch51data }; + +static const unsigned char ch52data[] = { + 0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8 +}; +static const GLUTBitmapChar ch52 = { 6, 9, 0, 0, 7, ch52data }; + +static const unsigned char ch53data[] = { + 0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8 +}; +static const GLUTBitmapChar ch53 = { 5, 9, -1, 0, 7, ch53data }; + +static const unsigned char ch54data[] = { + 0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70 +}; +static const GLUTBitmapChar ch54 = { 5, 9, -1, 0, 7, ch54data }; + +static const unsigned char ch55data[] = { + 0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8 +}; +static const GLUTBitmapChar ch55 = { 5, 9, -1, 0, 7, ch55data }; + +static const unsigned char ch56data[] = { + 0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch56 = { 5, 9, -1, 0, 7, ch56data }; + +static const unsigned char ch57data[] = { + 0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch57 = { 5, 9, -1, 0, 7, ch57data }; + +static const unsigned char ch58data[] = { + 0x80,0x0,0x0,0x0,0x0,0x80 +}; +static const GLUTBitmapChar ch58 = { 1, 6, -1, 0, 3, ch58data }; + +static const unsigned char ch59data[] = { + 0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40 +}; +static const GLUTBitmapChar ch59 = { 2, 8, 0, 2, 3, ch59data }; + +static const unsigned char ch60data[] = { + 0xc,0x30,0xc0,0x30,0xc +}; +static const GLUTBitmapChar ch60 = { 6, 5, 0, -1, 7, ch60data }; + +static const unsigned char ch61data[] = { + 0xf8,0x0,0xf8 +}; +static const GLUTBitmapChar ch61 = { 5, 3, -1, -2, 7, ch61data }; + +static const unsigned char ch62data[] = { + 0xc0,0x30,0xc,0x30,0xc0 +}; +static const GLUTBitmapChar ch62 = { 6, 5, -1, -1, 7, ch62data }; + +static const unsigned char ch63data[] = { + 0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch63 = { 5, 9, -1, 0, 7, ch63data }; + +static const unsigned char ch64data[] = { + 0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40, + 0x60,0x80,0x1f,0x0 +}; +static const GLUTBitmapChar ch64 = { 10, 10, -1, 1, 12, ch64data }; + +static const unsigned char ch65data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10 +}; +static const GLUTBitmapChar ch65 = { 7, 9, -1, 0, 9, ch65data }; + +static const unsigned char ch66data[] = { + 0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8 +}; +static const GLUTBitmapChar ch66 = { 6, 9, -1, 0, 8, ch66data }; + +static const unsigned char ch67data[] = { + 0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c +}; +static const GLUTBitmapChar ch67 = { 7, 9, -1, 0, 9, ch67data }; + +static const unsigned char ch68data[] = { + 0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8 +}; +static const GLUTBitmapChar ch68 = { 7, 9, -1, 0, 9, ch68data }; + +static const unsigned char ch69data[] = { + 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc +}; +static const GLUTBitmapChar ch69 = { 6, 9, -1, 0, 8, ch69data }; + +static const unsigned char ch70data[] = { + 0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc +}; +static const GLUTBitmapChar ch70 = { 6, 9, -1, 0, 8, ch70data }; + +static const unsigned char ch71data[] = { + 0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c +}; +static const GLUTBitmapChar ch71 = { 7, 9, -1, 0, 9, ch71data }; + +static const unsigned char ch72data[] = { + 0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82 +}; +static const GLUTBitmapChar ch72 = { 7, 9, -1, 0, 9, ch72data }; + +static const unsigned char ch73data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch73 = { 1, 9, -1, 0, 3, ch73data }; + +static const unsigned char ch74data[] = { + 0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8 +}; +static const GLUTBitmapChar ch74 = { 5, 9, -1, 0, 7, ch74data }; + +static const unsigned char ch75data[] = { + 0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84 +}; +static const GLUTBitmapChar ch75 = { 7, 9, -1, 0, 8, ch75data }; + +static const unsigned char ch76data[] = { + 0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch76 = { 5, 9, -1, 0, 7, ch76data }; + +static const unsigned char ch77data[] = { + 0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80, + 0x80,0x80 +}; +static const GLUTBitmapChar ch77 = { 9, 9, -1, 0, 11, ch77data }; + +static const unsigned char ch78data[] = { + 0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82 +}; +static const GLUTBitmapChar ch78 = { 7, 9, -1, 0, 9, ch78data }; + +static const unsigned char ch79data[] = { + 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c +}; +static const GLUTBitmapChar ch79 = { 8, 9, -1, 0, 10, ch79data }; + +static const unsigned char ch80data[] = { + 0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8 +}; +static const GLUTBitmapChar ch80 = { 6, 9, -1, 0, 8, ch80data }; + +static const unsigned char ch81data[] = { + 0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c +}; +static const GLUTBitmapChar ch81 = { 8, 9, -1, 0, 10, ch81data }; + +static const unsigned char ch82data[] = { + 0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8 +}; +static const GLUTBitmapChar ch82 = { 6, 9, -1, 0, 8, ch82data }; + +static const unsigned char ch83data[] = { + 0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78 +}; +static const GLUTBitmapChar ch83 = { 6, 9, -1, 0, 8, ch83data }; + +static const unsigned char ch84data[] = { + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe +}; +static const GLUTBitmapChar ch84 = { 7, 9, 0, 0, 7, ch84data }; + +static const unsigned char ch85data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84 +}; +static const GLUTBitmapChar ch85 = { 6, 9, -1, 0, 8, ch85data }; + +static const unsigned char ch86data[] = { + 0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82 +}; +static const GLUTBitmapChar ch86 = { 7, 9, -1, 0, 9, ch86data }; + +static const unsigned char ch87data[] = { + 0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80, + 0x88,0x80 +}; +static const GLUTBitmapChar ch87 = { 9, 9, -1, 0, 11, ch87data }; + +static const unsigned char ch88data[] = { + 0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82 +}; +static const GLUTBitmapChar ch88 = { 7, 9, -1, 0, 9, ch88data }; + +static const unsigned char ch89data[] = { + 0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82 +}; +static const GLUTBitmapChar ch89 = { 7, 9, -1, 0, 9, ch89data }; + +static const unsigned char ch90data[] = { + 0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe +}; +static const GLUTBitmapChar ch90 = { 7, 9, -1, 0, 9, ch90data }; + +static const unsigned char ch91data[] = { + 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 +}; +static const GLUTBitmapChar ch91 = { 2, 12, -1, 3, 3, ch91data }; + +static const unsigned char ch92data[] = { + 0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80 +}; +static const GLUTBitmapChar ch92 = { 4, 9, 0, 0, 4, ch92data }; + +static const unsigned char ch93data[] = { + 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0 +}; +static const GLUTBitmapChar ch93 = { 2, 12, 0, 3, 3, ch93data }; + +static const unsigned char ch94data[] = { + 0x88,0x50,0x20 +}; +static const GLUTBitmapChar ch94 = { 5, 3, 0, -5, 6, ch94data }; + +static const unsigned char ch95data[] = { + 0xfe +}; +static const GLUTBitmapChar ch95 = { 7, 1, 0, 2, 7, ch95data }; + +static const unsigned char ch96data[] = { + 0xc0,0x80,0x40 +}; +static const GLUTBitmapChar ch96 = { 2, 3, 0, -6, 3, ch96data }; + +static const unsigned char ch97data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70 +}; +static const GLUTBitmapChar ch97 = { 6, 7, -1, 0, 7, ch97data }; + +static const unsigned char ch98data[] = { + 0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 +}; +static const GLUTBitmapChar ch98 = { 5, 9, -1, 0, 7, ch98data }; + +static const unsigned char ch99data[] = { + 0x70,0x88,0x80,0x80,0x80,0x88,0x70 +}; +static const GLUTBitmapChar ch99 = { 5, 7, -1, 0, 7, ch99data }; + +static const unsigned char ch100data[] = { + 0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8 +}; +static const GLUTBitmapChar ch100 = { 5, 9, -1, 0, 7, ch100data }; + +static const unsigned char ch101data[] = { + 0x70,0x88,0x80,0xf8,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch101 = { 5, 7, -1, 0, 7, ch101data }; + +static const unsigned char ch102data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30 +}; +static const GLUTBitmapChar ch102 = { 4, 9, 0, 0, 3, ch102data }; + +static const unsigned char ch103data[] = { + 0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68 +}; +static const GLUTBitmapChar ch103 = { 5, 10, -1, 3, 7, ch103data }; + +static const unsigned char ch104data[] = { + 0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 +}; +static const GLUTBitmapChar ch104 = { 5, 9, -1, 0, 7, ch104data }; + +static const unsigned char ch105data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 +}; +static const GLUTBitmapChar ch105 = { 1, 9, -1, 0, 3, ch105data }; + +static const unsigned char ch106data[] = { + 0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40 +}; +static const GLUTBitmapChar ch106 = { 2, 12, 0, 3, 3, ch106data }; + +static const unsigned char ch107data[] = { + 0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80 +}; +static const GLUTBitmapChar ch107 = { 5, 9, -1, 0, 6, ch107data }; + +static const unsigned char ch108data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch108 = { 1, 9, -1, 0, 3, ch108data }; + +static const unsigned char ch109data[] = { + 0x92,0x92,0x92,0x92,0x92,0xda,0xa4 +}; +static const GLUTBitmapChar ch109 = { 7, 7, -1, 0, 9, ch109data }; + +static const unsigned char ch110data[] = { + 0x88,0x88,0x88,0x88,0x88,0xc8,0xb0 +}; +static const GLUTBitmapChar ch110 = { 5, 7, -1, 0, 7, ch110data }; + +static const unsigned char ch111data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch111 = { 5, 7, -1, 0, 7, ch111data }; + +static const unsigned char ch112data[] = { + 0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0 +}; +static const GLUTBitmapChar ch112 = { 5, 10, -1, 3, 7, ch112data }; + +static const unsigned char ch113data[] = { + 0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68 +}; +static const GLUTBitmapChar ch113 = { 5, 10, -1, 3, 7, ch113data }; + +static const unsigned char ch114data[] = { + 0x80,0x80,0x80,0x80,0x80,0xc0,0xa0 +}; +static const GLUTBitmapChar ch114 = { 3, 7, -1, 0, 4, ch114data }; + +static const unsigned char ch115data[] = { + 0x60,0x90,0x10,0x60,0x80,0x90,0x60 +}; +static const GLUTBitmapChar ch115 = { 4, 7, -1, 0, 6, ch115data }; + +static const unsigned char ch116data[] = { + 0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40 +}; +static const GLUTBitmapChar ch116 = { 3, 9, 0, 0, 3, ch116data }; + +static const unsigned char ch117data[] = { + 0x68,0x98,0x88,0x88,0x88,0x88,0x88 +}; +static const GLUTBitmapChar ch117 = { 5, 7, -1, 0, 7, ch117data }; + +static const unsigned char ch118data[] = { + 0x20,0x20,0x50,0x50,0x88,0x88,0x88 +}; +static const GLUTBitmapChar ch118 = { 5, 7, -1, 0, 7, ch118data }; + +static const unsigned char ch119data[] = { + 0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80 +}; +static const GLUTBitmapChar ch119 = { 9, 7, 0, 0, 9, ch119data }; + +static const unsigned char ch120data[] = { + 0x84,0x84,0x48,0x30,0x30,0x48,0x84 +}; +static const GLUTBitmapChar ch120 = { 6, 7, 0, 0, 6, ch120data }; + +static const unsigned char ch121data[] = { + 0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88 +}; +static const GLUTBitmapChar ch121 = { 5, 10, -1, 3, 7, ch121data }; + +static const unsigned char ch122data[] = { + 0xf0,0x80,0x40,0x40,0x20,0x10,0xf0 +}; +static const GLUTBitmapChar ch122 = { 4, 7, -1, 0, 6, ch122data }; + +static const unsigned char ch123data[] = { + 0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30 +}; +static const GLUTBitmapChar ch123 = { 4, 12, 0, 3, 4, ch123data }; + +static const unsigned char ch124data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch124 = { 1, 12, -1, 3, 3, ch124data }; + +static const unsigned char ch125data[] = { + 0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0 +}; +static const GLUTBitmapChar ch125 = { 4, 12, 0, 3, 4, ch125data }; + +static const unsigned char ch126data[] = { + 0x98,0x64 +}; +static const GLUTBitmapChar ch126 = { 6, 2, 0, -3, 7, ch126data }; + +static const unsigned char ch160data[] = { + 0x0 +}; +static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 4, ch160data }; + +static const unsigned char ch161data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 +}; +static const GLUTBitmapChar ch161 = { 1, 10, -1, 3, 3, ch161data }; + +static const unsigned char ch162data[] = { + 0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10 +}; +static const GLUTBitmapChar ch162 = { 5, 9, -1, 1, 7, ch162data }; + +static const unsigned char ch163data[] = { + 0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30 +}; +static const GLUTBitmapChar ch163 = { 5, 9, -1, 0, 7, ch163data }; + +static const unsigned char ch164data[] = { + 0x84,0x78,0x48,0x48,0x78,0x84 +}; +static const GLUTBitmapChar ch164 = { 6, 6, 0, -1, 7, ch164data }; + +static const unsigned char ch165data[] = { + 0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88 +}; +static const GLUTBitmapChar ch165 = { 5, 9, -1, 0, 7, ch165data }; + +static const unsigned char ch166data[] = { + 0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch166 = { 1, 11, -1, 2, 3, ch166data }; + +static const unsigned char ch167data[] = { + 0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70 +}; +static const GLUTBitmapChar ch167 = { 5, 12, 0, 3, 6, ch167data }; + +static const unsigned char ch168data[] = { + 0xa0 +}; +static const GLUTBitmapChar ch168 = { 3, 1, 0, -8, 3, ch168data }; + +static const unsigned char ch169data[] = { + 0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0, + 0x3e,0x0 +}; +static const GLUTBitmapChar ch169 = { 9, 9, -1, 0, 11, ch169data }; + +static const unsigned char ch170data[] = { + 0xe0,0x0,0xa0,0x20,0xe0 +}; +static const GLUTBitmapChar ch170 = { 3, 5, -1, -4, 5, ch170data }; + +static const unsigned char ch171data[] = { + 0x28,0x50,0xa0,0x50,0x28 +}; +static const GLUTBitmapChar ch171 = { 5, 5, -1, -1, 7, ch171data }; + +static const unsigned char ch172data[] = { + 0x4,0x4,0x4,0xfc +}; +static const GLUTBitmapChar ch172 = { 6, 4, -1, -2, 8, ch172data }; + +static const unsigned char ch173data[] = { + 0xf0 +}; +static const GLUTBitmapChar ch173 = { 4, 1, 0, -3, 5, ch173data }; + +static const unsigned char ch174data[] = { + 0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0, + 0x3e,0x0 +}; +static const GLUTBitmapChar ch174 = { 9, 9, -1, 0, 11, ch174data }; + +static const unsigned char ch175data[] = { + 0xf0 +}; +static const GLUTBitmapChar ch175 = { 4, 1, 0, -8, 4, ch175data }; + +static const unsigned char ch176data[] = { + 0x60,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch176 = { 4, 4, 0, -4, 5, ch176data }; + +static const unsigned char ch177data[] = { + 0xf8,0x0,0x20,0x20,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch177 = { 5, 7, -1, 0, 7, ch177data }; + +static const unsigned char ch178data[] = { + 0xf0,0x40,0x20,0x90,0x60 +}; +static const GLUTBitmapChar ch178 = { 4, 5, 0, -3, 4, ch178data }; + +static const unsigned char ch179data[] = { + 0xc0,0x20,0x40,0x20,0xe0 +}; +static const GLUTBitmapChar ch179 = { 3, 5, 0, -3, 4, ch179data }; + +static const unsigned char ch180data[] = { + 0x80,0x40 +}; +static const GLUTBitmapChar ch180 = { 2, 2, 0, -8, 2, ch180data }; + +static const unsigned char ch181data[] = { + 0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88 +}; +static const GLUTBitmapChar ch181 = { 5, 10, -1, 3, 7, ch181data }; + +static const unsigned char ch182data[] = { + 0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c +}; +static const GLUTBitmapChar ch182 = { 6, 12, 0, 3, 7, ch182data }; + +static const unsigned char ch183data[] = { + 0x80 +}; +static const GLUTBitmapChar ch183 = { 1, 1, -1, -3, 3, ch183data }; + +static const unsigned char ch184data[] = { + 0xc0,0x20,0x20,0x40 +}; +static const GLUTBitmapChar ch184 = { 3, 4, 0, 3, 3, ch184data }; + +static const unsigned char ch185data[] = { + 0x40,0x40,0x40,0xc0,0x40 +}; +static const GLUTBitmapChar ch185 = { 2, 5, -1, -3, 4, ch185data }; + +static const unsigned char ch186data[] = { + 0xe0,0x0,0xe0,0xa0,0xe0 +}; +static const GLUTBitmapChar ch186 = { 3, 5, -1, -4, 5, ch186data }; + +static const unsigned char ch187data[] = { + 0xa0,0x50,0x28,0x50,0xa0 +}; +static const GLUTBitmapChar ch187 = { 5, 5, -1, -1, 7, ch187data }; + +static const unsigned char ch188data[] = { + 0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0, + 0x41,0x0 +}; +static const GLUTBitmapChar ch188 = { 9, 9, 0, 0, 10, ch188data }; + +static const unsigned char ch189data[] = { + 0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0, + 0x41,0x0 +}; +static const GLUTBitmapChar ch189 = { 9, 9, 0, 0, 10, ch189data }; + +static const unsigned char ch190data[] = { + 0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0, + 0xe1,0x0 +}; +static const GLUTBitmapChar ch190 = { 9, 9, 0, 0, 10, ch190data }; + +static const unsigned char ch191data[] = { + 0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20 +}; +static const GLUTBitmapChar ch191 = { 5, 9, -1, 3, 7, ch191data }; + +static const unsigned char ch192data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch192 = { 7, 12, -1, 0, 9, ch192data }; + +static const unsigned char ch193data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch193 = { 7, 12, -1, 0, 9, ch193data }; + +static const unsigned char ch194data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch194 = { 7, 12, -1, 0, 9, ch194data }; + +static const unsigned char ch195data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14 +}; +static const GLUTBitmapChar ch195 = { 7, 12, -1, 0, 9, ch195data }; + +static const unsigned char ch196data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28 +}; +static const GLUTBitmapChar ch196 = { 7, 11, -1, 0, 9, ch196data }; + +static const unsigned char ch197data[] = { + 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10 +}; +static const GLUTBitmapChar ch197 = { 7, 12, -1, 0, 9, ch197data }; + +static const unsigned char ch198data[] = { + 0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0, + 0x1f,0x80 +}; +static const GLUTBitmapChar ch198 = { 9, 9, -1, 0, 11, ch198data }; + +static const unsigned char ch199data[] = { + 0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c +}; +static const GLUTBitmapChar ch199 = { 7, 12, -1, 3, 9, ch199data }; + +static const unsigned char ch200data[] = { + 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch200 = { 6, 12, -1, 0, 8, ch200data }; + +static const unsigned char ch201data[] = { + 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch201 = { 6, 12, -1, 0, 8, ch201data }; + +static const unsigned char ch202data[] = { + 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch202 = { 6, 12, -1, 0, 8, ch202data }; + +static const unsigned char ch203data[] = { + 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28 +}; +static const GLUTBitmapChar ch203 = { 6, 11, -1, 0, 8, ch203data }; + +static const unsigned char ch204data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch204 = { 2, 12, 0, 0, 3, ch204data }; + +static const unsigned char ch205data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 +}; +static const GLUTBitmapChar ch205 = { 2, 12, -1, 0, 3, ch205data }; + +static const unsigned char ch206data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch206 = { 3, 12, 0, 0, 3, ch206data }; + +static const unsigned char ch207data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 +}; +static const GLUTBitmapChar ch207 = { 3, 11, 0, 0, 3, ch207data }; + +static const unsigned char ch208data[] = { + 0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c +}; +static const GLUTBitmapChar ch208 = { 8, 9, 0, 0, 9, ch208data }; + +static const unsigned char ch209data[] = { + 0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14 +}; +static const GLUTBitmapChar ch209 = { 7, 12, -1, 0, 9, ch209data }; + +static const unsigned char ch210data[] = { + 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10 +}; +static const GLUTBitmapChar ch210 = { 8, 12, -1, 0, 10, ch210data }; + +static const unsigned char ch211data[] = { + 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4 +}; +static const GLUTBitmapChar ch211 = { 8, 12, -1, 0, 10, ch211data }; + +static const unsigned char ch212data[] = { + 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8 +}; +static const GLUTBitmapChar ch212 = { 8, 12, -1, 0, 10, ch212data }; + +static const unsigned char ch213data[] = { + 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14 +}; +static const GLUTBitmapChar ch213 = { 8, 12, -1, 0, 10, ch213data }; + +static const unsigned char ch214data[] = { + 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24 +}; +static const GLUTBitmapChar ch214 = { 8, 11, -1, 0, 10, ch214data }; + +static const unsigned char ch215data[] = { + 0x88,0x50,0x20,0x50,0x88 +}; +static const GLUTBitmapChar ch215 = { 5, 5, -1, -1, 7, ch215data }; + +static const unsigned char ch216data[] = { + 0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80, + 0x21,0x0,0x1e,0x80,0x0,0x40 +}; +static const GLUTBitmapChar ch216 = { 10, 11, 0, 1, 10, ch216data }; + +static const unsigned char ch217data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch217 = { 6, 12, -1, 0, 8, ch217data }; + +static const unsigned char ch218data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch218 = { 6, 12, -1, 0, 8, ch218data }; + +static const unsigned char ch219data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch219 = { 6, 12, -1, 0, 8, ch219data }; + +static const unsigned char ch220data[] = { + 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48 +}; +static const GLUTBitmapChar ch220 = { 6, 11, -1, 0, 8, ch220data }; + +static const unsigned char ch221data[] = { + 0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch221 = { 7, 12, -1, 0, 9, ch221data }; + +static const unsigned char ch222data[] = { + 0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80 +}; +static const GLUTBitmapChar ch222 = { 6, 9, -1, 0, 8, ch222data }; + +static const unsigned char ch223data[] = { + 0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70 +}; +static const GLUTBitmapChar ch223 = { 5, 9, -1, 0, 7, ch223data }; + +static const unsigned char ch224data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch224 = { 6, 10, -1, 0, 7, ch224data }; + +static const unsigned char ch225data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch225 = { 6, 10, -1, 0, 7, ch225data }; + +static const unsigned char ch226data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch226 = { 6, 10, -1, 0, 7, ch226data }; + +static const unsigned char ch227data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch227 = { 6, 10, -1, 0, 7, ch227data }; + +static const unsigned char ch228data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50 +}; +static const GLUTBitmapChar ch228 = { 6, 9, -1, 0, 7, ch228data }; + +static const unsigned char ch229data[] = { + 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30 +}; +static const GLUTBitmapChar ch229 = { 6, 10, -1, 0, 7, ch229data }; + +static const unsigned char ch230data[] = { + 0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0 +}; +static const GLUTBitmapChar ch230 = { 9, 7, -1, 0, 11, ch230data }; + +static const unsigned char ch231data[] = { + 0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70 +}; +static const GLUTBitmapChar ch231 = { 5, 10, -1, 3, 7, ch231data }; + +static const unsigned char ch232data[] = { + 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch232 = { 5, 10, -1, 0, 7, ch232data }; + +static const unsigned char ch233data[] = { + 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch233 = { 5, 10, -1, 0, 7, ch233data }; + +static const unsigned char ch234data[] = { + 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch234 = { 5, 10, -1, 0, 7, ch234data }; + +static const unsigned char ch235data[] = { + 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50 +}; +static const GLUTBitmapChar ch235 = { 5, 9, -1, 0, 7, ch235data }; + +static const unsigned char ch236data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch236 = { 2, 10, 0, 0, 3, ch236data }; + +static const unsigned char ch237data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 +}; +static const GLUTBitmapChar ch237 = { 2, 10, -1, 0, 3, ch237data }; + +static const unsigned char ch238data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch238 = { 3, 10, 0, 0, 3, ch238data }; + +static const unsigned char ch239data[] = { + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 +}; +static const GLUTBitmapChar ch239 = { 3, 9, 0, 0, 3, ch239data }; + +static const unsigned char ch240data[] = { + 0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68 +}; +static const GLUTBitmapChar ch240 = { 5, 10, -1, 0, 7, ch240data }; + +static const unsigned char ch241data[] = { + 0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch241 = { 5, 10, -1, 0, 7, ch241data }; + +static const unsigned char ch242data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch242 = { 5, 10, -1, 0, 7, ch242data }; + +static const unsigned char ch243data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch243 = { 5, 10, -1, 0, 7, ch243data }; + +static const unsigned char ch244data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch244 = { 5, 10, -1, 0, 7, ch244data }; + +static const unsigned char ch245data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch245 = { 5, 10, -1, 0, 7, ch245data }; + +static const unsigned char ch246data[] = { + 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50 +}; +static const GLUTBitmapChar ch246 = { 5, 9, -1, 0, 7, ch246data }; + +static const unsigned char ch247data[] = { + 0x20,0x0,0xf8,0x0,0x20 +}; +static const GLUTBitmapChar ch247 = { 5, 5, -1, -1, 7, ch247data }; + +static const unsigned char ch248data[] = { + 0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a +}; +static const GLUTBitmapChar ch248 = { 7, 7, 0, 0, 7, ch248data }; + +static const unsigned char ch249data[] = { + 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch249 = { 5, 10, -1, 0, 7, ch249data }; + +static const unsigned char ch250data[] = { + 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch250 = { 5, 10, -1, 0, 7, ch250data }; + +static const unsigned char ch251data[] = { + 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch251 = { 5, 10, -1, 0, 7, ch251data }; + +static const unsigned char ch252data[] = { + 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50 +}; +static const GLUTBitmapChar ch252 = { 5, 9, -1, 0, 7, ch252data }; + +static const unsigned char ch253data[] = { + 0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch253 = { 5, 13, -1, 3, 7, ch253data }; + +static const unsigned char ch254data[] = { + 0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 +}; +static const GLUTBitmapChar ch254 = { 5, 12, -1, 3, 7, ch254data }; + +static const unsigned char ch255data[] = { + 0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50 +}; +static const GLUTBitmapChar ch255 = { 5, 12, -1, 3, 7, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmapHelvetica12 = { + "-Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO8859-1", + 15, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/hel18.c xpsb-glx-0.19/mesa/src/glut/dos/hel18.c --- xpsb-glx-0.19/mesa/src/glut/dos/hel18.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/hel18.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1138 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch32data[] = { + 0x0 +}; +static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 5, ch32data }; + +static const unsigned char ch33data[] = { + 0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch33 = { 2, 14, -2, 0, 6, ch33data }; + +static const unsigned char ch34data[] = { + 0x90,0x90,0xd8,0xd8,0xd8 +}; +static const GLUTBitmapChar ch34 = { 5, 5, 0, -9, 5, ch34data }; + +static const unsigned char ch35data[] = { + 0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0, + 0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0 +}; +static const GLUTBitmapChar ch35 = { 10, 13, 0, 0, 10, ch35data }; + +static const unsigned char ch36data[] = { + 0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0, + 0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0 +}; +static const GLUTBitmapChar ch36 = { 9, 16, -1, 2, 10, ch36data }; + +static const unsigned char ch37data[] = { + 0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0, + 0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60 +}; +static const GLUTBitmapChar ch37 = { 14, 13, -1, 0, 16, ch37data }; + +static const unsigned char ch38data[] = { + 0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0, + 0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0 +}; +static const GLUTBitmapChar ch38 = { 12, 13, -1, 0, 13, ch38data }; + +static const unsigned char ch39data[] = { + 0x80,0x40,0x40,0xc0,0xc0 +}; +static const GLUTBitmapChar ch39 = { 2, 5, -1, -9, 4, ch39data }; + +static const unsigned char ch40data[] = { + 0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60, + 0x30,0x10 +}; +static const GLUTBitmapChar ch40 = { 4, 18, -1, 4, 6, ch40data }; + +static const unsigned char ch41data[] = { + 0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60, + 0xc0,0x80 +}; +static const GLUTBitmapChar ch41 = { 4, 18, -1, 4, 6, ch41data }; + +static const unsigned char ch42data[] = { + 0x88,0x70,0x70,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch42 = { 5, 6, -1, -8, 7, ch42data }; + +static const unsigned char ch43data[] = { + 0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18 +}; +static const GLUTBitmapChar ch43 = { 8, 10, -1, 0, 10, ch43data }; + +static const unsigned char ch44data[] = { + 0x80,0x40,0x40,0xc0,0xc0 +}; +static const GLUTBitmapChar ch44 = { 2, 5, -1, 3, 5, ch44data }; + +static const unsigned char ch45data[] = { + 0xff,0xff +}; +static const GLUTBitmapChar ch45 = { 8, 2, -1, -4, 11, ch45data }; + +static const unsigned char ch46data[] = { + 0xc0,0xc0 +}; +static const GLUTBitmapChar ch46 = { 2, 2, -1, 0, 5, ch46data }; + +static const unsigned char ch47data[] = { + 0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18 +}; +static const GLUTBitmapChar ch47 = { 5, 14, 0, 0, 5, ch47data }; + +static const unsigned char ch48data[] = { + 0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c +}; +static const GLUTBitmapChar ch48 = { 8, 13, -1, 0, 10, ch48data }; + +static const unsigned char ch49data[] = { + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18 +}; +static const GLUTBitmapChar ch49 = { 5, 13, -2, 0, 10, ch49data }; + +static const unsigned char ch50data[] = { + 0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c +}; +static const GLUTBitmapChar ch50 = { 8, 13, -1, 0, 10, ch50data }; + +static const unsigned char ch51data[] = { + 0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c +}; +static const GLUTBitmapChar ch51 = { 8, 13, -1, 0, 10, ch51data }; + +static const unsigned char ch52data[] = { + 0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0, + 0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0 +}; +static const GLUTBitmapChar ch52 = { 9, 13, -1, 0, 10, ch52data }; + +static const unsigned char ch53data[] = { + 0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe +}; +static const GLUTBitmapChar ch53 = { 8, 13, -1, 0, 10, ch53data }; + +static const unsigned char ch54data[] = { + 0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c +}; +static const GLUTBitmapChar ch54 = { 8, 13, -1, 0, 10, ch54data }; + +static const unsigned char ch55data[] = { + 0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff +}; +static const GLUTBitmapChar ch55 = { 8, 13, -1, 0, 10, ch55data }; + +static const unsigned char ch56data[] = { + 0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c +}; +static const GLUTBitmapChar ch56 = { 8, 13, -1, 0, 10, ch56data }; + +static const unsigned char ch57data[] = { + 0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c +}; +static const GLUTBitmapChar ch57 = { 8, 13, -1, 0, 10, ch57data }; + +static const unsigned char ch58data[] = { + 0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch58 = { 2, 10, -1, 0, 5, ch58data }; + +static const unsigned char ch59data[] = { + 0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch59 = { 2, 13, -1, 3, 5, ch59data }; + +static const unsigned char ch60data[] = { + 0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3 +}; +static const GLUTBitmapChar ch60 = { 8, 9, -1, 0, 10, ch60data }; + +static const unsigned char ch61data[] = { + 0xfe,0xfe,0x0,0x0,0xfe,0xfe +}; +static const GLUTBitmapChar ch61 = { 7, 6, -2, -2, 11, ch61data }; + +static const unsigned char ch62data[] = { + 0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0 +}; +static const GLUTBitmapChar ch62 = { 8, 9, -1, 0, 10, ch62data }; + +static const unsigned char ch63data[] = { + 0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c +}; +static const GLUTBitmapChar ch63 = { 7, 14, -1, 0, 10, ch63data }; + +static const unsigned char ch64data[] = { + 0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66, + 0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc, + 0x3,0xf0 +}; +static const GLUTBitmapChar ch64 = { 16, 17, -1, 3, 18, ch64data }; + +static const unsigned char ch65data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch65 = { 12, 14, 0, 0, 12, ch65data }; + +static const unsigned char ch66data[] = { + 0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80, + 0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 +}; +static const GLUTBitmapChar ch66 = { 11, 14, -1, 0, 13, ch66data }; + +static const unsigned char ch67data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, + 0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 +}; +static const GLUTBitmapChar ch67 = { 12, 14, -1, 0, 14, ch67data }; + +static const unsigned char ch68data[] = { + 0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, + 0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 +}; +static const GLUTBitmapChar ch68 = { 11, 14, -1, 0, 13, ch68data }; + +static const unsigned char ch69data[] = { + 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80 +}; +static const GLUTBitmapChar ch69 = { 9, 14, -1, 0, 11, ch69data }; + +static const unsigned char ch70data[] = { + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80 +}; +static const GLUTBitmapChar ch70 = { 9, 14, -1, 0, 11, ch70data }; + +static const unsigned char ch71data[] = { + 0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0, + 0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 +}; +static const GLUTBitmapChar ch71 = { 12, 14, -1, 0, 14, ch71data }; + +static const unsigned char ch72data[] = { + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0, + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60 +}; +static const GLUTBitmapChar ch72 = { 11, 14, -1, 0, 13, ch72data }; + +static const unsigned char ch73data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch73 = { 2, 14, -2, 0, 6, ch73data }; + +static const unsigned char ch74data[] = { + 0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3 +}; +static const GLUTBitmapChar ch74 = { 8, 14, -1, 0, 10, ch74data }; + +static const unsigned char ch75data[] = { + 0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0, + 0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0 +}; +static const GLUTBitmapChar ch75 = { 12, 14, -1, 0, 13, ch75data }; + +static const unsigned char ch76data[] = { + 0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch76 = { 8, 14, -1, 0, 10, ch76data }; + +static const unsigned char ch77data[] = { + 0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c, + 0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc +}; +static const GLUTBitmapChar ch77 = { 14, 14, -1, 0, 16, ch77data }; + +static const unsigned char ch78data[] = { + 0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, + 0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60 +}; +static const GLUTBitmapChar ch78 = { 11, 14, -1, 0, 13, ch78data }; + +static const unsigned char ch79data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 +}; +static const GLUTBitmapChar ch79 = { 13, 14, -1, 0, 15, ch79data }; + +static const unsigned char ch80data[] = { + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80, + 0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 +}; +static const GLUTBitmapChar ch80 = { 10, 14, -1, 0, 12, ch80data }; + +static const unsigned char ch81data[] = { + 0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 +}; +static const GLUTBitmapChar ch81 = { 13, 15, -1, 1, 15, ch81data }; + +static const unsigned char ch82data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80, + 0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 +}; +static const GLUTBitmapChar ch82 = { 10, 14, -1, 0, 12, ch82data }; + +static const unsigned char ch83data[] = { + 0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0, + 0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0 +}; +static const GLUTBitmapChar ch83 = { 11, 14, -1, 0, 13, ch83data }; + +static const unsigned char ch84data[] = { + 0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0, + 0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0 +}; +static const GLUTBitmapChar ch84 = { 10, 14, -1, 0, 12, ch84data }; + +static const unsigned char ch85data[] = { + 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60 +}; +static const GLUTBitmapChar ch85 = { 11, 14, -1, 0, 13, ch85data }; + +static const unsigned char ch86data[] = { + 0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0, + 0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30 +}; +static const GLUTBitmapChar ch86 = { 12, 14, -1, 0, 14, ch86data }; + +static const unsigned char ch87data[] = { + 0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66, + 0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83 +}; +static const GLUTBitmapChar ch87 = { 16, 14, -1, 0, 18, ch87data }; + +static const unsigned char ch88data[] = { + 0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0, + 0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60 +}; +static const GLUTBitmapChar ch88 = { 11, 14, -1, 0, 13, ch88data }; + +static const unsigned char ch89data[] = { + 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, + 0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30 +}; +static const GLUTBitmapChar ch89 = { 12, 14, -1, 0, 14, ch89data }; + +static const unsigned char ch90data[] = { + 0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0, + 0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0 +}; +static const GLUTBitmapChar ch90 = { 10, 14, -1, 0, 12, ch90data }; + +static const unsigned char ch91data[] = { + 0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xf0,0xf0 +}; +static const GLUTBitmapChar ch91 = { 4, 18, -1, 4, 5, ch91data }; + +static const unsigned char ch92data[] = { + 0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0 +}; +static const GLUTBitmapChar ch92 = { 5, 14, 0, 0, 5, ch92data }; + +static const unsigned char ch93data[] = { + 0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0xf0,0xf0 +}; +static const GLUTBitmapChar ch93 = { 4, 18, 0, 4, 5, ch93data }; + +static const unsigned char ch94data[] = { + 0x82,0xc6,0x6c,0x38,0x10 +}; +static const GLUTBitmapChar ch94 = { 7, 5, -1, -8, 9, ch94data }; + +static const unsigned char ch95data[] = { + 0xff,0xc0,0xff,0xc0 +}; +static const GLUTBitmapChar ch95 = { 10, 2, 0, 4, 10, ch95data }; + +static const unsigned char ch96data[] = { + 0xc0,0xc0,0x80,0x80,0x40 +}; +static const GLUTBitmapChar ch96 = { 2, 5, -1, -9, 4, ch96data }; + +static const unsigned char ch97data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c +}; +static const GLUTBitmapChar ch97 = { 7, 10, -1, 0, 9, ch97data }; + +static const unsigned char ch98data[] = { + 0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0, + 0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0 +}; +static const GLUTBitmapChar ch98 = { 9, 14, -1, 0, 11, ch98data }; + +static const unsigned char ch99data[] = { + 0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e +}; +static const GLUTBitmapChar ch99 = { 8, 10, -1, 0, 10, ch99data }; + +static const unsigned char ch100data[] = { + 0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80, + 0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80 +}; +static const GLUTBitmapChar ch100 = { 9, 14, -1, 0, 11, ch100data }; + +static const unsigned char ch101data[] = { + 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c +}; +static const GLUTBitmapChar ch101 = { 8, 10, -1, 0, 10, ch101data }; + +static const unsigned char ch102data[] = { + 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c +}; +static const GLUTBitmapChar ch102 = { 6, 14, 0, 0, 6, ch102data }; + +static const unsigned char ch103data[] = { + 0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, + 0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80 +}; +static const GLUTBitmapChar ch103 = { 9, 14, -1, 4, 11, ch103data }; + +static const unsigned char ch104data[] = { + 0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch104 = { 8, 14, -1, 0, 10, ch104data }; + +static const unsigned char ch105data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch105 = { 2, 14, -1, 0, 4, ch105data }; + +static const unsigned char ch106data[] = { + 0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0, + 0x30,0x30 +}; +static const GLUTBitmapChar ch106 = { 4, 18, 1, 4, 4, ch106data }; + +static const unsigned char ch107data[] = { + 0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch107 = { 8, 14, -1, 0, 9, ch107data }; + +static const unsigned char ch108data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch108 = { 2, 14, -1, 0, 4, ch108data }; + +static const unsigned char ch109data[] = { + 0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30, + 0xde,0xf0,0xcc,0x60 +}; +static const GLUTBitmapChar ch109 = { 12, 10, -1, 0, 14, ch109data }; + +static const unsigned char ch110data[] = { + 0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce +}; +static const GLUTBitmapChar ch110 = { 8, 10, -1, 0, 10, ch110data }; + +static const unsigned char ch111data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0 +}; +static const GLUTBitmapChar ch111 = { 9, 10, -1, 0, 11, ch111data }; + +static const unsigned char ch112data[] = { + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, + 0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0 +}; +static const GLUTBitmapChar ch112 = { 9, 14, -1, 4, 11, ch112data }; + +static const unsigned char ch113data[] = { + 0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, + 0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80 +}; +static const GLUTBitmapChar ch113 = { 9, 14, -1, 4, 11, ch113data }; + +static const unsigned char ch114data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8 +}; +static const GLUTBitmapChar ch114 = { 5, 10, -1, 0, 6, ch114data }; + +static const unsigned char ch115data[] = { + 0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c +}; +static const GLUTBitmapChar ch115 = { 7, 10, -1, 0, 9, ch115data }; + +static const unsigned char ch116data[] = { + 0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30 +}; +static const GLUTBitmapChar ch116 = { 6, 13, 0, 0, 6, ch116data }; + +static const unsigned char ch117data[] = { + 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3 +}; +static const GLUTBitmapChar ch117 = { 8, 10, -1, 0, 10, ch117data }; + +static const unsigned char ch118data[] = { + 0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3 +}; +static const GLUTBitmapChar ch118 = { 8, 10, -1, 0, 10, ch118data }; + +static const unsigned char ch119data[] = { + 0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30, + 0xc6,0x30,0xc6,0x30 +}; +static const GLUTBitmapChar ch119 = { 12, 10, -1, 0, 14, ch119data }; + +static const unsigned char ch120data[] = { + 0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3 +}; +static const GLUTBitmapChar ch120 = { 8, 10, -1, 0, 10, ch120data }; + +static const unsigned char ch121data[] = { + 0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3 +}; +static const GLUTBitmapChar ch121 = { 8, 14, -1, 4, 10, ch121data }; + +static const unsigned char ch122data[] = { + 0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe +}; +static const GLUTBitmapChar ch122 = { 7, 10, -1, 0, 9, ch122data }; + +static const unsigned char ch123data[] = { + 0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30, + 0x18,0xc +}; +static const GLUTBitmapChar ch123 = { 6, 18, 0, 4, 6, ch123data }; + +static const unsigned char ch124data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0 +}; +static const GLUTBitmapChar ch124 = { 2, 18, -1, 4, 4, ch124data }; + +static const unsigned char ch125data[] = { + 0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30, + 0x60,0xc0 +}; +static const GLUTBitmapChar ch125 = { 6, 18, 0, 4, 6, ch125data }; + +static const unsigned char ch126data[] = { + 0xcc,0x7e,0x33 +}; +static const GLUTBitmapChar ch126 = { 8, 3, -1, -4, 10, ch126data }; + +static const unsigned char ch160data[] = { + 0x0 +}; +static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 5, ch160data }; + +static const unsigned char ch161data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch161 = { 2, 14, -2, 4, 6, ch161data }; + +static const unsigned char ch162data[] = { + 0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4 +}; +static const GLUTBitmapChar ch162 = { 8, 14, -1, 2, 10, ch162data }; + +static const unsigned char ch163data[] = { + 0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0, + 0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0 +}; +static const GLUTBitmapChar ch163 = { 9, 13, 0, 0, 10, ch163data }; + +static const unsigned char ch164data[] = { + 0xc3,0xff,0x66,0x66,0x66,0xff,0xc3 +}; +static const GLUTBitmapChar ch164 = { 8, 7, -1, -3, 10, ch164data }; + +static const unsigned char ch165data[] = { + 0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3 +}; +static const GLUTBitmapChar ch165 = { 8, 13, -1, 0, 10, ch165data }; + +static const unsigned char ch166data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0 +}; +static const GLUTBitmapChar ch166 = { 2, 17, -1, 3, 4, ch166data }; + +static const unsigned char ch167data[] = { + 0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3, + 0x7e,0x3c +}; +static const GLUTBitmapChar ch167 = { 8, 18, -1, 4, 10, ch167data }; + +static const unsigned char ch168data[] = { + 0xd8,0xd8 +}; +static const GLUTBitmapChar ch168 = { 5, 2, 0, -11, 6, ch168data }; + +static const unsigned char ch169data[] = { + 0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8, + 0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80 +}; +static const GLUTBitmapChar ch169 = { 13, 13, -1, 0, 15, ch169data }; + +static const unsigned char ch170data[] = { + 0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70 +}; +static const GLUTBitmapChar ch170 = { 5, 8, -1, -6, 7, ch170data }; + +static const unsigned char ch171data[] = { + 0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12 +}; +static const GLUTBitmapChar ch171 = { 7, 8, -1, -1, 9, ch171data }; + +static const unsigned char ch172data[] = { + 0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80 +}; +static const GLUTBitmapChar ch172 = { 9, 5, -1, -3, 11, ch172data }; + +static const unsigned char ch173data[] = { + 0xf8,0xf8 +}; +static const GLUTBitmapChar ch173 = { 5, 2, -1, -4, 7, ch173data }; + +static const unsigned char ch174data[] = { + 0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48, + 0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80 +}; +static const GLUTBitmapChar ch174 = { 13, 13, -1, 0, 14, ch174data }; + +static const unsigned char ch175data[] = { + 0xf8 +}; +static const GLUTBitmapChar ch175 = { 5, 1, 0, -12, 5, ch175data }; + +static const unsigned char ch176data[] = { + 0x70,0xd8,0x88,0xd8,0x70 +}; +static const GLUTBitmapChar ch176 = { 5, 5, -1, -8, 7, ch176data }; + +static const unsigned char ch177data[] = { + 0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18 +}; +static const GLUTBitmapChar ch177 = { 8, 11, -1, 0, 10, ch177data }; + +static const unsigned char ch178data[] = { + 0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70 +}; +static const GLUTBitmapChar ch178 = { 5, 8, 0, -5, 6, ch178data }; + +static const unsigned char ch179data[] = { + 0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70 +}; +static const GLUTBitmapChar ch179 = { 5, 8, 0, -5, 6, ch179data }; + +static const unsigned char ch180data[] = { + 0xc0,0x60,0x30 +}; +static const GLUTBitmapChar ch180 = { 4, 3, 0, -11, 4, ch180data }; + +static const unsigned char ch181data[] = { + 0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3 +}; +static const GLUTBitmapChar ch181 = { 8, 14, -1, 4, 10, ch181data }; + +static const unsigned char ch182data[] = { + 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2, + 0x72,0x3f +}; +static const GLUTBitmapChar ch182 = { 8, 18, -1, 4, 10, ch182data }; + +static const unsigned char ch183data[] = { + 0xc0,0xc0 +}; +static const GLUTBitmapChar ch183 = { 2, 2, -1, -4, 4, ch183data }; + +static const unsigned char ch184data[] = { + 0xf0,0xd8,0x18,0x70,0x60 +}; +static const GLUTBitmapChar ch184 = { 5, 5, 0, 4, 5, ch184data }; + +static const unsigned char ch185data[] = { + 0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60 +}; +static const GLUTBitmapChar ch185 = { 3, 8, -1, -5, 6, ch185data }; + +static const unsigned char ch186data[] = { + 0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70 +}; +static const GLUTBitmapChar ch186 = { 5, 8, -1, -6, 7, ch186data }; + +static const unsigned char ch187data[] = { + 0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90 +}; +static const GLUTBitmapChar ch187 = { 7, 8, -1, -1, 9, ch187data }; + +static const unsigned char ch188data[] = { + 0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10, + 0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60 +}; +static const GLUTBitmapChar ch188 = { 13, 13, -1, 0, 15, ch188data }; + +static const unsigned char ch189data[] = { + 0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70, + 0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60 +}; +static const GLUTBitmapChar ch189 = { 13, 13, -1, 0, 15, ch189data }; + +static const unsigned char ch190data[] = { + 0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88, + 0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30 +}; +static const GLUTBitmapChar ch190 = { 14, 13, 0, 0, 15, ch190data }; + +static const unsigned char ch191data[] = { + 0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18 +}; +static const GLUTBitmapChar ch191 = { 7, 14, -1, 4, 10, ch191data }; + +static const unsigned char ch192data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, + 0xc,0x0,0x18,0x0 +}; +static const GLUTBitmapChar ch192 = { 12, 18, 0, 0, 12, ch192data }; + +static const unsigned char ch193data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, + 0x3,0x0,0x1,0x80 +}; +static const GLUTBitmapChar ch193 = { 12, 18, 0, 0, 12, ch193data }; + +static const unsigned char ch194data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, + 0xf,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch194 = { 12, 18, 0, 0, 12, ch194data }; + +static const unsigned char ch195data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0, + 0x16,0x80,0xc,0x80 +}; +static const GLUTBitmapChar ch195 = { 12, 18, 0, 0, 12, ch195data }; + +static const unsigned char ch196data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, + 0x19,0x80 +}; +static const GLUTBitmapChar ch196 = { 12, 17, 0, 0, 12, ch196data }; + +static const unsigned char ch197data[] = { + 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, + 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, + 0x19,0x80,0xf,0x0 +}; +static const GLUTBitmapChar ch197 = { 12, 18, 0, 0, 12, ch197data }; + +static const unsigned char ch198data[] = { + 0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe, + 0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff +}; +static const GLUTBitmapChar ch198 = { 16, 14, -1, 0, 18, ch198data }; + +static const unsigned char ch199data[] = { + 0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30, + 0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70, + 0x3f,0xe0,0xf,0x80 +}; +static const GLUTBitmapChar ch199 = { 12, 18, -1, 4, 14, ch199data }; + +static const unsigned char ch200data[] = { + 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, + 0x18,0x0,0x30,0x0 +}; +static const GLUTBitmapChar ch200 = { 9, 18, -1, 0, 11, ch200data }; + +static const unsigned char ch201data[] = { + 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, + 0x6,0x0,0x3,0x0 +}; +static const GLUTBitmapChar ch201 = { 9, 18, -1, 0, 11, ch201data }; + +static const unsigned char ch202data[] = { + 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, + 0x1e,0x0,0xc,0x0 +}; +static const GLUTBitmapChar ch202 = { 9, 18, -1, 0, 11, ch202data }; + +static const unsigned char ch203data[] = { + 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, + 0x33,0x0 +}; +static const GLUTBitmapChar ch203 = { 9, 17, -1, 0, 11, ch203data }; + +static const unsigned char ch204data[] = { + 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30, + 0x60,0xc0 +}; +static const GLUTBitmapChar ch204 = { 4, 18, 0, 0, 6, ch204data }; + +static const unsigned char ch205data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0, + 0x60,0x30 +}; +static const GLUTBitmapChar ch205 = { 4, 18, -2, 0, 6, ch205data }; + +static const unsigned char ch206data[] = { + 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, + 0x78,0x30 +}; +static const GLUTBitmapChar ch206 = { 6, 18, 0, 0, 6, ch206data }; + +static const unsigned char ch207data[] = { + 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, + 0xcc +}; +static const GLUTBitmapChar ch207 = { 6, 17, 0, 0, 6, ch207data }; + +static const unsigned char ch208data[] = { + 0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30, + 0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80 +}; +static const GLUTBitmapChar ch208 = { 12, 14, 0, 0, 13, ch208data }; + +static const unsigned char ch209data[] = { + 0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, + 0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0, + 0x16,0x80,0xc,0x80 +}; +static const GLUTBitmapChar ch209 = { 11, 18, -1, 0, 13, ch209data }; + +static const unsigned char ch210data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, + 0x6,0x0,0xc,0x0 +}; +static const GLUTBitmapChar ch210 = { 13, 18, -1, 0, 15, ch210data }; + +static const unsigned char ch211data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, + 0x1,0x80,0x0,0xc0 +}; +static const GLUTBitmapChar ch211 = { 13, 18, -1, 0, 15, ch211data }; + +static const unsigned char ch212data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0, + 0x7,0x80,0x3,0x0 +}; +static const GLUTBitmapChar ch212 = { 13, 18, -1, 0, 15, ch212data }; + +static const unsigned char ch213data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80, + 0xb,0x40,0x6,0x40 +}; +static const GLUTBitmapChar ch213 = { 13, 18, -1, 0, 15, ch213data }; + +static const unsigned char ch214data[] = { + 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, + 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80, + 0xd,0x80 +}; +static const GLUTBitmapChar ch214 = { 13, 17, -1, 0, 15, ch214data }; + +static const unsigned char ch215data[] = { + 0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80, + 0xc0,0xc0 +}; +static const GLUTBitmapChar ch215 = { 10, 9, 0, 0, 10, ch215data }; + +static const unsigned char ch216data[] = { + 0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c, + 0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc +}; +static const GLUTBitmapChar ch216 = { 14, 14, 0, 0, 15, ch216data }; + +static const unsigned char ch217data[] = { + 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0, + 0xc,0x0,0x18,0x0 +}; +static const GLUTBitmapChar ch217 = { 11, 18, -1, 0, 13, ch217data }; + +static const unsigned char ch218data[] = { + 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0, + 0x6,0x0,0x3,0x0 +}; +static const GLUTBitmapChar ch218 = { 11, 18, -1, 0, 13, ch218data }; + +static const unsigned char ch219data[] = { + 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, + 0xf,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch219 = { 11, 18, -1, 0, 13, ch219data }; + +static const unsigned char ch220data[] = { + 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, + 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, + 0x19,0x80 +}; +static const GLUTBitmapChar ch220 = { 11, 17, -1, 0, 13, ch220data }; + +static const unsigned char ch221data[] = { + 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, + 0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0, + 0x3,0x0,0x1,0x80 +}; +static const GLUTBitmapChar ch221 = { 12, 18, -1, 0, 14, ch221data }; + +static const unsigned char ch222data[] = { + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0 +}; +static const GLUTBitmapChar ch222 = { 10, 14, -1, 0, 12, ch222data }; + +static const unsigned char ch223data[] = { + 0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38 +}; +static const GLUTBitmapChar ch223 = { 7, 14, -1, 0, 9, ch223data }; + +static const unsigned char ch224data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60 +}; +static const GLUTBitmapChar ch224 = { 7, 14, -1, 0, 9, ch224data }; + +static const unsigned char ch225data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc +}; +static const GLUTBitmapChar ch225 = { 7, 14, -1, 0, 9, ch225data }; + +static const unsigned char ch226data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18 +}; +static const GLUTBitmapChar ch226 = { 7, 14, -1, 0, 9, ch226data }; + +static const unsigned char ch227data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32 +}; +static const GLUTBitmapChar ch227 = { 7, 14, -1, 0, 9, ch227data }; + +static const unsigned char ch228data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c +}; +static const GLUTBitmapChar ch228 = { 7, 13, -1, 0, 9, ch228data }; + +static const unsigned char ch229data[] = { + 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38 +}; +static const GLUTBitmapChar ch229 = { 7, 14, -1, 0, 9, ch229data }; + +static const unsigned char ch230data[] = { + 0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18, + 0xef,0xf0,0x7d,0xe0 +}; +static const GLUTBitmapChar ch230 = { 13, 10, -1, 0, 15, ch230data }; + +static const unsigned char ch231data[] = { + 0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e +}; +static const GLUTBitmapChar ch231 = { 8, 14, -1, 4, 10, ch231data }; + +static const unsigned char ch232data[] = { + 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60 +}; +static const GLUTBitmapChar ch232 = { 8, 14, -1, 0, 10, ch232data }; + +static const unsigned char ch233data[] = { + 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6 +}; +static const GLUTBitmapChar ch233 = { 8, 14, -1, 0, 10, ch233data }; + +static const unsigned char ch234data[] = { + 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18 +}; +static const GLUTBitmapChar ch234 = { 8, 14, -1, 0, 10, ch234data }; + +static const unsigned char ch235data[] = { + 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36 +}; +static const GLUTBitmapChar ch235 = { 8, 13, -1, 0, 10, ch235data }; + +static const unsigned char ch236data[] = { + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0 +}; +static const GLUTBitmapChar ch236 = { 4, 14, 0, 0, 4, ch236data }; + +static const unsigned char ch237data[] = { + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30 +}; +static const GLUTBitmapChar ch237 = { 4, 14, 0, 0, 4, ch237data }; + +static const unsigned char ch238data[] = { + 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30 +}; +static const GLUTBitmapChar ch238 = { 6, 14, 1, 0, 4, ch238data }; + +static const unsigned char ch239data[] = { + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8 +}; +static const GLUTBitmapChar ch239 = { 5, 13, 0, 0, 4, ch239data }; + +static const unsigned char ch240data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0 +}; +static const GLUTBitmapChar ch240 = { 9, 14, -1, 0, 11, ch240data }; + +static const unsigned char ch241data[] = { + 0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32 +}; +static const GLUTBitmapChar ch241 = { 8, 14, -1, 0, 10, ch241data }; + +static const unsigned char ch242data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0 +}; +static const GLUTBitmapChar ch242 = { 9, 14, -1, 0, 11, ch242data }; + +static const unsigned char ch243data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch243 = { 9, 14, -1, 0, 11, ch243data }; + +static const unsigned char ch244data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0 +}; +static const GLUTBitmapChar ch244 = { 9, 14, -1, 0, 11, ch244data }; + +static const unsigned char ch245data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0 +}; +static const GLUTBitmapChar ch245 = { 9, 14, -1, 0, 11, ch245data }; + +static const unsigned char ch246data[] = { + 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, + 0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0 +}; +static const GLUTBitmapChar ch246 = { 9, 13, -1, 0, 11, ch246data }; + +static const unsigned char ch247data[] = { + 0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18 +}; +static const GLUTBitmapChar ch247 = { 8, 8, -1, -1, 10, ch247data }; + +static const unsigned char ch248data[] = { + 0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80, + 0x3f,0xc0,0xe,0x60 +}; +static const GLUTBitmapChar ch248 = { 11, 10, 0, 0, 11, ch248data }; + +static const unsigned char ch249data[] = { + 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30 +}; +static const GLUTBitmapChar ch249 = { 8, 14, -1, 0, 10, ch249data }; + +static const unsigned char ch250data[] = { + 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6 +}; +static const GLUTBitmapChar ch250 = { 8, 14, -1, 0, 10, ch250data }; + +static const unsigned char ch251data[] = { + 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18 +}; +static const GLUTBitmapChar ch251 = { 8, 14, -1, 0, 10, ch251data }; + +static const unsigned char ch252data[] = { + 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66 +}; +static const GLUTBitmapChar ch252 = { 8, 13, -1, 0, 10, ch252data }; + +static const unsigned char ch253data[] = { + 0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18, + 0xc,0x6 +}; +static const GLUTBitmapChar ch253 = { 8, 18, -1, 4, 10, ch253data }; + +static const unsigned char ch254data[] = { + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, + 0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0, + 0xc0,0x0,0xc0,0x0 +}; +static const GLUTBitmapChar ch254 = { 9, 18, -1, 4, 11, ch254data }; + +static const unsigned char ch255data[] = { + 0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66, + 0x66 +}; +static const GLUTBitmapChar ch255 = { 8, 17, -1, 4, 10, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmapHelvetica18 = { + "-Adobe-Helvetica-Medium-R-Normal--18-180-75-75-P-98-ISO8859-1", + 22, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/init.c xpsb-glx-0.19/mesa/src/glut/dos/init.c --- xpsb-glx-0.19/mesa/src/glut/dos/init.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/init.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,223 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 +#include +#include +#include + +#include "internal.h" + + +char *__glutProgramName = NULL; + +GLUTvisual _glut_visual = { + 16, 8, 16, 8, 16, /* bpp, alpha, depth, stencil, accum */ + + { 0, 0 }, 0, /* geometry */ + + 0 /* flags */ +}; + +GLUTdefault _glut_default = { + 0, 0, /* glutInitWindowPosition */ + 300, 300, /* glutInitWindowSize */ + 0 /* glutInitDisplayMode */ +}; + +GLuint _glut_fps = 0; + +static char *init_string; + + +void +_glut_fatal (char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal Error in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + exit(1); +} + + +/* strdup is actually not a standard ANSI C or POSIX routine + * so implement a private one for GLUT. + */ +static char * +_glut_strdup (const char *string) +{ + if (string != NULL) { + int len = strlen(string) + 1; + char *p = malloc(len); + if (p != NULL) { + return strcpy(p, string); + } + } + return NULL; +} + + +void APIENTRY +glutInit (int *argc, char **argv) +{ + char *str; + const char *env; + + if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { + _glut_visual.bpp = atoi(env); + } + if ((env = getenv("DMESA_GLUT_ALPHA")) != NULL) { + _glut_visual.alpha = atoi(env); + } + if ((env = getenv("DMESA_GLUT_DEPTH")) != NULL) { + _glut_visual.depth = atoi(env); + } + if ((env = getenv("DMESA_GLUT_STENCIL")) != NULL) { + _glut_visual.stencil = atoi(env); + } + if ((env = getenv("DMESA_GLUT_ACCUM")) != NULL) { + _glut_visual.accum = atoi(env); + } + if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) { + _glut_visual.refresh = atoi(env); + } + + /* Determine program name. */ + str = strrchr(argv[0], '/'); + if (str == NULL) { + str = argv[0]; + } else { + str++; + } + __glutProgramName = _glut_strdup(str); + + /* check if GLUT_FPS env var is set */ + if ((env = getenv("GLUT_FPS")) != NULL) { + if ((_glut_fps = atoi(env)) <= 0) { + _glut_fps = 5000; /* 5000 milliseconds */ + } + } + + /* Initialize timer */ + glutGet(GLUT_ELAPSED_TIME); +} + + +void APIENTRY +glutInitDisplayMode (unsigned int mode) +{ + _glut_default.mode = mode; +} + + +void APIENTRY +glutInitWindowPosition (int x, int y) +{ + _glut_default.x = x; + _glut_default.y = y; +} + + +void APIENTRY +glutInitWindowSize (int width, int height) +{ + _glut_default.width = width; + _glut_default.height = height; +} + + +void APIENTRY +glutInitDisplayString (const char *string) +{ + init_string = _glut_strdup(string); +} + + +void APIENTRY +glutSetOption (GLenum pname, int value) +{ + switch (pname) { + case GLUT_INIT_WINDOW_X: + _glut_default.x = value; + break; + case GLUT_INIT_WINDOW_Y: + _glut_default.y = value; + break; + } +} + + +void APIENTRY +glutForceJoystickFunc (void) +{ +} + + +void APIENTRY +glutIgnoreKeyRepeat (int ignore) +{ +} + + +void APIENTRY +glutSetKeyRepeat (int repeatMode) +{ +} + + +void APIENTRY +glutVideoPan (int x, int y, int w, int h) +{ +} + + +int APIENTRY +glutVideoResizeGet( GLenum eWhat ) +{ + return 0; +} + + +void APIENTRY +glutSetupVideoResizing (void) +{ +} + + +void APIENTRY +glutStopVideoResizing (void) +{ +} + + +void APIENTRY +glutVideoResize (int x, int y, int w, int h) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/internal.h xpsb-glx-0.19/mesa/src/glut/dos/internal.h --- xpsb-glx-0.19/mesa/src/glut/dos/internal.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/internal.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,197 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 INTERNAL_H_included +#define INTERNAL_H_included + +#include + +#include "GL/dmesa.h" + + +#define MAX_WINDOWS 2 +#define MAX_TIMER_CB 8 +#define RESERVED_COLORS 0 + + +/* GLUT function types */ +typedef void (GLUTCALLBACK *GLUTdisplayCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int); +typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int); +typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int); +typedef void (GLUTCALLBACK *GLUTentryCB) (int); +typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int); +typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int); +typedef void (GLUTCALLBACK *GLUTidleCB) (void); +typedef void (GLUTCALLBACK *GLUTtimerCB) (int); +typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTselectCB) (int); +typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int); +typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int); +typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int); + +typedef void (GLUTCALLBACK *GLUTdestroyCB) (void); +typedef void (GLUTCALLBACK *GLUTmouseWheelCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTmenuDestroyCB) (void); + + +typedef struct { + GLuint bpp, alpha; + GLuint depth, stencil; + GLuint accum; + + GLint geometry[2]; + GLuint refresh; + + GLint flags; +} GLUTvisual; + +typedef struct { + GLint x, y; + GLint width, height; + GLuint mode; +} GLUTdefault; + +typedef struct { + void (*func) (int); + int value; + int time; +} GLUTSShotCB; + +typedef struct GLUTwindow { + int num; /* window id */ + + DMesaContext context; + DMesaBuffer buffer; + + int show_mouse; + GLboolean redisplay; + + /* GLUT settable or visible window state. */ + int xpos; + int ypos; + int width; /* window width in pixels */ + int height; /* window height in pixels */ + + /* Per-window callbacks. */ + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ + GLUTwindowStatusCB windowStatus; /* window status */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + GLUTspecialCB specialUp; /* special up key */ + GLUTbuttonBoxCB buttonBox; /* button box */ + GLUTdialsCB dials; /* dials */ + GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ + GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ + GLUTspaceButtonCB spaceButton; /* Spaceball button */ + GLUTtabletMotionCB tabletMotion; /* tablet motion */ + GLUTtabletButtonCB tabletButton; /* tablet button */ + GLUTjoystickCB joystick; /* joystick */ + + GLUTdestroyCB destroy; /* destroy */ + GLUTmouseWheelCB mouseWheel; /* mouse wheel */ + + /* specific data */ + void *data; +} GLUTwindow; + +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; + +typedef struct { + const GLfloat x, y; +} GLUTStrokeVertex; + +typedef struct { + const unsigned num; + const GLUTStrokeVertex *vertex; +} GLUTStrokeStrip; + +typedef struct { + const GLfloat right; + const unsigned num; + const GLUTStrokeStrip *strip; +} GLUTStrokeChar; + +typedef struct { + const char *name; + const unsigned num; + const GLUTStrokeChar *const *table; + const GLfloat height; + const GLfloat descent; +} GLUTStrokeFont; + + +extern char *__glutProgramName; + +extern GLUTvisual _glut_visual; +extern GLUTdefault _glut_default; + +extern GLuint _glut_fps; +extern GLUTidleCB _glut_idle_func; +extern GLUTmenuStatusCB _glut_menu_status_func; +extern GLUTSShotCB _glut_timer_cb[]; + +extern GLUTwindow *_glut_current, *_glut_windows[]; + +extern int _glut_mouse; /* number of buttons, if mouse installed */ +extern int _glut_mouse_x, _glut_mouse_y; /* mouse coords, relative to current win */ + + +extern void _glut_mouse_init (void); +extern void _glut_fatal(char *format,...); +extern void *_glut_font (void *font); + + +#include "pc_hw/pc_hw.h" + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/loop.c xpsb-glx-0.19/mesa/src/glut/dos/loop.c --- xpsb-glx-0.19/mesa/src/glut/dos/loop.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/loop.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,245 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 + +#include +#include "GL/dmesa.h" + +#include "PC_HW/pc_hw.h" +#include "internal.h" + + +static int looping = 0; + + +#define DO_REDISPLAY(w, ccin, ccout) \ + do { \ + if (w->redisplay && w->display) { \ + int rv = GL_TRUE; \ + \ + idle = GL_FALSE; \ + w->redisplay = GL_FALSE; \ + \ + /* test IN condition (whether we need to `MakeCurrent') */\ + if (ccin) { \ + rv = DMesaMakeCurrent(w->context, w->buffer); \ + } \ + \ + /* do the display only if `MakeCurrent' didn't failed */ \ + if (rv) { \ + if (w->show_mouse && !(_glut_default.mode & GLUT_DOUBLE)) {\ + /* XXX scare mouse */ \ + w->display(); \ + /* XXX unscare mouse */ \ + } else { \ + w->display(); \ + } \ + \ + /* update OUT condition */ \ + ccout; \ + } \ + } \ + } while (0) + + +void APIENTRY +glutMainLoopEvent (void) +{ + int i, n; + GLUTwindow *w; + GLboolean idle; + static int old_mouse_x = 0; + static int old_mouse_y = 0; + static int old_mouse_b = 0; + + static GLboolean virgin = GL_TRUE; + if (virgin) { + pc_install_keyb(); + _glut_mouse_init(); + + for (i = 0; i < MAX_WINDOWS; i++) { + w = _glut_windows[i]; + if (w != NULL) { + glutSetWindow(w->num); + glutPostRedisplay(); + if (w->reshape) { + w->reshape(w->width, w->height); + } + if (w->visibility) { + w->visibility(GLUT_VISIBLE); + } + } + } + virgin = GL_FALSE; + } + + idle = GL_TRUE; + + n = 0; + for (i = 0; i < MAX_WINDOWS; i++) { + w = _glut_windows[i]; + if ((w != NULL) && (w != _glut_current)) { + /* 1) redisplay `w' + * 2) `MakeCurrent' always + * 3) update number of non-default windows + */ + DO_REDISPLAY(w, GL_TRUE, n++); + } + } + /* 1) redisplay `_glut_current' + * 2) `MakeCurrent' only if we previously did non-default windows + * 3) don't update anything + */ + DO_REDISPLAY(_glut_current, n, n); + + if (_glut_mouse) { + int mouse_x; + int mouse_y; + int mouse_z; + int mouse_b; + + /* query mouse */ + mouse_b = pc_query_mouse(&mouse_x, &mouse_y, &mouse_z); + + /* relative to window coordinates */ + _glut_mouse_x = mouse_x - _glut_current->xpos; + _glut_mouse_y = mouse_y - _glut_current->ypos; + + /* mouse was moved? */ + if ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y)) { + idle = GL_FALSE; + old_mouse_x = mouse_x; + old_mouse_y = mouse_y; + + if (mouse_b) { + /* any button pressed */ + if (_glut_current->motion) { + _glut_current->motion(_glut_mouse_x, _glut_mouse_y); + } + } else { + /* no button pressed */ + if (_glut_current->passive) { + _glut_current->passive(_glut_mouse_x, _glut_mouse_y); + } + } + } + + /* button state changed? */ + if (mouse_b != old_mouse_b) { + GLUTmouseCB mouse_func; + + if ((mouse_func = _glut_current->mouse)) { + if ((old_mouse_b & 1) && !(mouse_b & 1)) + mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, _glut_mouse_x, _glut_mouse_y); + else if (!(old_mouse_b & 1) && (mouse_b & 1)) + mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, _glut_mouse_x, _glut_mouse_y); + + if ((old_mouse_b & 2) && !(mouse_b & 2)) + mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, _glut_mouse_x, _glut_mouse_y); + else if (!(old_mouse_b & 2) && (mouse_b & 2)) + mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, _glut_mouse_x, _glut_mouse_y); + + if ((old_mouse_b & 4) && !(mouse_b & 4)) + mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, _glut_mouse_x, _glut_mouse_y); + else if (!(old_mouse_b & 3) && (mouse_b & 4)) + mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, _glut_mouse_x, _glut_mouse_y); + } + + idle = GL_FALSE; + old_mouse_b = mouse_b; + } + } + + if (pc_keypressed()) { + int key; + int glut_key; + + idle = GL_FALSE; + key = pc_readkey(); + + switch (key>>16) { + case KEY_F1: glut_key = GLUT_KEY_F1; goto special; + case KEY_F2: glut_key = GLUT_KEY_F2; goto special; + case KEY_F3: glut_key = GLUT_KEY_F3; goto special; + case KEY_F4: glut_key = GLUT_KEY_F4; goto special; + case KEY_F5: glut_key = GLUT_KEY_F5; goto special; + case KEY_F6: glut_key = GLUT_KEY_F6; goto special; + case KEY_F7: glut_key = GLUT_KEY_F7; goto special; + case KEY_F8: glut_key = GLUT_KEY_F8; goto special; + case KEY_F9: glut_key = GLUT_KEY_F9; goto special; + case KEY_F10: glut_key = GLUT_KEY_F10; goto special; + case KEY_F11: glut_key = GLUT_KEY_F11; goto special; + case KEY_F12: glut_key = GLUT_KEY_F12; goto special; + case KEY_LEFT: glut_key = GLUT_KEY_LEFT; goto special; + case KEY_UP: glut_key = GLUT_KEY_UP; goto special; + case KEY_RIGHT: glut_key = GLUT_KEY_RIGHT; goto special; + case KEY_DOWN: glut_key = GLUT_KEY_DOWN; goto special; + case KEY_PGUP: glut_key = GLUT_KEY_PAGE_UP; goto special; + case KEY_PGDN: glut_key = GLUT_KEY_PAGE_DOWN; goto special; + case KEY_HOME: glut_key = GLUT_KEY_HOME; goto special; + case KEY_END: glut_key = GLUT_KEY_END; goto special; + case KEY_INSERT: glut_key = GLUT_KEY_INSERT; goto special; + special: + if (_glut_current->special) { + _glut_current->special(glut_key, _glut_mouse_x, _glut_mouse_y); + } + break; + default: + if (_glut_current->keyboard) { + _glut_current->keyboard(key & 0xFF, _glut_mouse_x, _glut_mouse_y); + } + } + } + + if (idle && _glut_idle_func) + _glut_idle_func(); + + for (i = 0; i < MAX_TIMER_CB; i++) { + int time = glutGet(GLUT_ELAPSED_TIME); + GLUTSShotCB *cb = &_glut_timer_cb[i]; + if (cb->func && (time >= cb->time)) { + cb->func(cb->value); + cb->func = NULL; + } + } +} + + +void APIENTRY +glutMainLoop (void) +{ + looping++; + while (looping) { + glutMainLoopEvent(); + } +} + + +void APIENTRY +glutLeaveMainLoop (void) +{ + looping--; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/Makefile.DJ xpsb-glx-0.19/mesa/src/glut/dos/Makefile.DJ --- xpsb-glx-0.19/mesa/src/glut/dos/Makefile.DJ 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/Makefile.DJ 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,126 @@ +# DOS/DJGPP Mesa Utility Toolkit +# Version: 1.0 +# +# Copyright (C) 2005 Daniel Borca 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 +# DANIEL BORCA 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. + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# GLIDE path to Glide3 SDK; used to resolve DXEs. +# default = $(TOP)/glide3 +# +# Targets: +# all: build GLUT +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = ../../.. +GLIDE ?= $(TOP)/glide3 +LIBDIR = $(TOP)/lib +GLUT_LIB = libglut.a +GLUT_DXE = glut.dxe +GLUT_IMP = libiglut.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib + +CC = gcc +CFLAGS += -I$(TOP)/include -I. -IPC_HW +CFLAGS += -DGLUT_IMPORT_LIB + +AR = ar +ARFLAGS = crus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +CORE_SOURCES = \ + loop.c \ + callback.c \ + color.c \ + extens.c \ + init.c \ + menu.c \ + mouse.c \ + overlay.c \ + state.c \ + util.c \ + window.c \ + f8x13.c \ + f9x15.c \ + hel10.c \ + hel12.c \ + hel18.c \ + tr10.c \ + tr24.c \ + mroman.c \ + roman.c \ + bitmap.c \ + stroke.c \ + teapot.c \ + shapes.c + +PC_HW_SOURCES = \ + PC_HW/pc_hw.c \ + PC_HW/pc_keyb.c \ + PC_HW/pc_mouse.c \ + PC_HW/pc_timer.c \ + PC_HW/pc_irq.S + +SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.S.o: + $(CC) -o $@ $(CFLAGS) -c $< +.s.o: + $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< + +all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP) + +$(LIBDIR)/$(GLUT_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GLUT_DXE)) +else + -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -U $^ +endif + +clean: + -$(call UNLINK,*.o) + -$(call UNLINK,PC_HW/*.o) + +-include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/menu.c xpsb-glx-0.19/mesa/src/glut/dos/menu.c --- xpsb-glx-0.19/mesa/src/glut/dos/menu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/menu.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,130 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +GLUTmenuStatusCB _glut_menu_status_func = NULL; + + +void APIENTRY +glutMenuStateFunc (GLUTmenuStateCB func) +{ + _glut_menu_status_func = (GLUTmenuStatusCB)func; +} + + +void APIENTRY +glutMenuStatusFunc (GLUTmenuStatusCB func) +{ + _glut_menu_status_func = func; +} + + +int APIENTRY +glutCreateMenu (GLUTselectCB func) +{ + return 0; +} + + +void APIENTRY +glutDestroyMenu (int menu) +{ +} + + +int APIENTRY +glutGetMenu (void) +{ + return 0; +} + + +void APIENTRY +glutSetMenu (int menu) +{ +} + + +void APIENTRY +glutAddMenuEntry (const char *label, int value) +{ +} + + +void APIENTRY +glutAddSubMenu (const char *label, int submenu) +{ +} + + +void APIENTRY +glutChangeToMenuEntry (int item, const char *label, int value) +{ +} + + +void APIENTRY +glutChangeToSubMenu (int item, const char *label, int submenu) +{ +} + + +void APIENTRY +glutRemoveMenuItem (int item) +{ +} + + +void APIENTRY +glutAttachMenu (int button) +{ +} + + +void APIENTRY +glutDetachMenu (int button) +{ +} + + +void APIENTRY +glutMenuDestroyFunc ( void (* callback)( void ) ) +{ +} + + +void * APIENTRY +glutGetMenuData (void) +{ + return NULL; +} + + +void APIENTRY +glutSetMenuData (void *data) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/mouse.c xpsb-glx-0.19/mesa/src/glut/dos/mouse.c --- xpsb-glx-0.19/mesa/src/glut/dos/mouse.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/mouse.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,55 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +int _glut_mouse; +int _glut_mouse_x = 0, _glut_mouse_y = 0; + + +void +_glut_mouse_init (void) +{ + if ((_glut_mouse = pc_install_mouse())) { + pc_mouse_area(_glut_current->xpos, _glut_current->ypos, _glut_current->xpos + _glut_current->width - 1, _glut_current->ypos + _glut_current->height - 1); + + _glut_current->show_mouse = (_glut_current->mouse || _glut_current->motion || _glut_current->passive); + } +} + + +void APIENTRY +glutSetCursor (int cursor) +{ + /* XXX completely futile until full mouse support (maybe never) */ +} + + +void APIENTRY +glutWarpPointer (int x, int y) +{ + pc_warp_mouse(x, y); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/mroman.c xpsb-glx-0.19/mesa/src/glut/dos/mroman.c --- xpsb-glx-0.19/mesa/src/glut/dos/mroman.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/mroman.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2779 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "internal.h" + +/* char: 0x20 */ + +static const GLUTStrokeChar ch32 = {104.7619f,0,NULL}; + +/* char: 0x21 */ + +static const GLUTStrokeVertex ch33st0[] = +{ + {52.3810f,100.0000f}, + {52.3810f,33.3333f} +}; + +static const GLUTStrokeVertex ch33st1[] = +{ + {52.3810f,9.5238f}, + {47.6191f,4.7619f}, + {52.3810f,0.0000f}, + {57.1429f,4.7619f}, + {52.3810f,9.5238f} +}; + +static const GLUTStrokeStrip ch33st[] = +{ + {2,ch33st0}, + {5,ch33st1} +}; + +static const GLUTStrokeChar ch33 = {104.7619f,2,ch33st}; + +/* char: 0x22 */ + +static const GLUTStrokeVertex ch34st0[] = +{ + {33.3334f,100.0000f}, + {33.3334f,66.6667f} +}; + +static const GLUTStrokeVertex ch34st1[] = +{ + {71.4286f,100.0000f}, + {71.4286f,66.6667f} +}; + +static const GLUTStrokeStrip ch34st[] = +{ + {2,ch34st0}, + {2,ch34st1} +}; + +static const GLUTStrokeChar ch34 = {104.7619f,2,ch34st}; + +/* char: 0x23 */ + +static const GLUTStrokeVertex ch35st0[] = +{ + {54.7619f,119.0476f}, + {21.4286f,-33.3333f} +}; + +static const GLUTStrokeVertex ch35st1[] = +{ + {83.3334f,119.0476f}, + {50.0000f,-33.3333f} +}; + +static const GLUTStrokeVertex ch35st2[] = +{ + {21.4286f,57.1429f}, + {88.0952f,57.1429f} +}; + +static const GLUTStrokeVertex ch35st3[] = +{ + {16.6667f,28.5714f}, + {83.3334f,28.5714f} +}; + +static const GLUTStrokeStrip ch35st[] = +{ + {2,ch35st0}, + {2,ch35st1}, + {2,ch35st2}, + {2,ch35st3} +}; + +static const GLUTStrokeChar ch35 = {104.7619f,4,ch35st}; + +/* char: 0x24 */ + +static const GLUTStrokeVertex ch36st0[] = +{ + {42.8571f,119.0476f}, + {42.8571f,-19.0476f} +}; + +static const GLUTStrokeVertex ch36st1[] = +{ + {61.9047f,119.0476f}, + {61.9047f,-19.0476f} +}; + +static const GLUTStrokeVertex ch36st2[] = +{ + {85.7143f,85.7143f}, + {76.1905f,95.2381f}, + {61.9047f,100.0000f}, + {42.8571f,100.0000f}, + {28.5714f,95.2381f}, + {19.0476f,85.7143f}, + {19.0476f,76.1905f}, + {23.8095f,66.6667f}, + {28.5714f,61.9048f}, + {38.0952f,57.1429f}, + {66.6666f,47.6190f}, + {76.1905f,42.8571f}, + {80.9524f,38.0952f}, + {85.7143f,28.5714f}, + {85.7143f,14.2857f}, + {76.1905f,4.7619f}, + {61.9047f,0.0000f}, + {42.8571f,0.0000f}, + {28.5714f,4.7619f}, + {19.0476f,14.2857f} +}; + +static const GLUTStrokeStrip ch36st[] = +{ + {2,ch36st0}, + {2,ch36st1}, + {20,ch36st2} +}; + +static const GLUTStrokeChar ch36 = {104.7619f,3,ch36st}; + +/* char: 0x25 */ + +static const GLUTStrokeVertex ch37st0[] = +{ + {95.2381f,100.0000f}, + {9.5238f,0.0000f} +}; + +static const GLUTStrokeVertex ch37st1[] = +{ + {33.3333f,100.0000f}, + {42.8571f,90.4762f}, + {42.8571f,80.9524f}, + {38.0952f,71.4286f}, + {28.5714f,66.6667f}, + {19.0476f,66.6667f}, + {9.5238f,76.1905f}, + {9.5238f,85.7143f}, + {14.2857f,95.2381f}, + {23.8095f,100.0000f}, + {33.3333f,100.0000f}, + {42.8571f,95.2381f}, + {57.1428f,90.4762f}, + {71.4286f,90.4762f}, + {85.7143f,95.2381f}, + {95.2381f,100.0000f} +}; + +static const GLUTStrokeVertex ch37st2[] = +{ + {76.1905f,33.3333f}, + {66.6667f,28.5714f}, + {61.9048f,19.0476f}, + {61.9048f,9.5238f}, + {71.4286f,0.0000f}, + {80.9524f,0.0000f}, + {90.4762f,4.7619f}, + {95.2381f,14.2857f}, + {95.2381f,23.8095f}, + {85.7143f,33.3333f}, + {76.1905f,33.3333f} +}; + +static const GLUTStrokeStrip ch37st[] = +{ + {2,ch37st0}, + {16,ch37st1}, + {11,ch37st2} +}; + +static const GLUTStrokeChar ch37 = {104.7619f,3,ch37st}; + +/* char: 0x26 */ + +static const GLUTStrokeVertex ch38st0[] = +{ + {100.0000f,57.1429f}, + {100.0000f,61.9048f}, + {95.2381f,66.6667f}, + {90.4762f,66.6667f}, + {85.7143f,61.9048f}, + {80.9524f,52.3810f}, + {71.4286f,28.5714f}, + {61.9048f,14.2857f}, + {52.3809f,4.7619f}, + {42.8571f,0.0000f}, + {23.8095f,0.0000f}, + {14.2857f,4.7619f}, + {9.5238f,9.5238f}, + {4.7619f,19.0476f}, + {4.7619f,28.5714f}, + {9.5238f,38.0952f}, + {14.2857f,42.8571f}, + {47.6190f,61.9048f}, + {52.3809f,66.6667f}, + {57.1429f,76.1905f}, + {57.1429f,85.7143f}, + {52.3809f,95.2381f}, + {42.8571f,100.0000f}, + {33.3333f,95.2381f}, + {28.5714f,85.7143f}, + {28.5714f,76.1905f}, + {33.3333f,61.9048f}, + {42.8571f,47.6190f}, + {66.6667f,14.2857f}, + {76.1905f,4.7619f}, + {85.7143f,0.0000f}, + {95.2381f,0.0000f}, + {100.0000f,4.7619f}, + {100.0000f,9.5238f} +}; + +static const GLUTStrokeStrip ch38st[] = +{ + {34,ch38st0} +}; + +static const GLUTStrokeChar ch38 = {104.7619f,1,ch38st}; + +/* char: 0x27 */ + +static const GLUTStrokeVertex ch39st0[] = +{ + {52.3810f,100.0000f}, + {52.3810f,66.6667f} +}; + +static const GLUTStrokeStrip ch39st[] = +{ + {2,ch39st0} +}; + +static const GLUTStrokeChar ch39 = {104.7619f,1,ch39st}; + +/* char: 0x28 */ + +static const GLUTStrokeVertex ch40st0[] = +{ + {69.0476f,119.0476f}, + {59.5238f,109.5238f}, + {50.0000f,95.2381f}, + {40.4762f,76.1905f}, + {35.7143f,52.3810f}, + {35.7143f,33.3333f}, + {40.4762f,9.5238f}, + {50.0000f,-9.5238f}, + {59.5238f,-23.8095f}, + {69.0476f,-33.3333f} +}; + +static const GLUTStrokeStrip ch40st[] = +{ + {10,ch40st0} +}; + +static const GLUTStrokeChar ch40 = {104.7619f,1,ch40st}; + +/* char: 0x29 */ + +static const GLUTStrokeVertex ch41st0[] = +{ + {35.7143f,119.0476f}, + {45.2381f,109.5238f}, + {54.7619f,95.2381f}, + {64.2857f,76.1905f}, + {69.0476f,52.3810f}, + {69.0476f,33.3333f}, + {64.2857f,9.5238f}, + {54.7619f,-9.5238f}, + {45.2381f,-23.8095f}, + {35.7143f,-33.3333f} +}; + +static const GLUTStrokeStrip ch41st[] = +{ + {10,ch41st0} +}; + +static const GLUTStrokeChar ch41 = {104.7619f,1,ch41st}; + +/* char: 0x2a */ + +static const GLUTStrokeVertex ch42st0[] = +{ + {52.3810f,71.4286f}, + {52.3810f,14.2857f} +}; + +static const GLUTStrokeVertex ch42st1[] = +{ + {28.5715f,57.1429f}, + {76.1905f,28.5714f} +}; + +static const GLUTStrokeVertex ch42st2[] = +{ + {76.1905f,57.1429f}, + {28.5715f,28.5714f} +}; + +static const GLUTStrokeStrip ch42st[] = +{ + {2,ch42st0}, + {2,ch42st1}, + {2,ch42st2} +}; + +static const GLUTStrokeChar ch42 = {104.7619f,3,ch42st}; + +/* char: 0x2b */ + +static const GLUTStrokeVertex ch43st0[] = +{ + {52.3809f,85.7143f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch43st1[] = +{ + {9.5238f,42.8571f}, + {95.2381f,42.8571f} +}; + +static const GLUTStrokeStrip ch43st[] = +{ + {2,ch43st0}, + {2,ch43st1} +}; + +static const GLUTStrokeChar ch43 = {104.7619f,2,ch43st}; + +/* char: 0x2c */ + +static const GLUTStrokeVertex ch44st0[] = +{ + {57.1429f,4.7619f}, + {52.3810f,0.0000f}, + {47.6191f,4.7619f}, + {52.3810f,9.5238f}, + {57.1429f,4.7619f}, + {57.1429f,-4.7619f}, + {52.3810f,-14.2857f}, + {47.6191f,-19.0476f} +}; + +static const GLUTStrokeStrip ch44st[] = +{ + {8,ch44st0} +}; + +static const GLUTStrokeChar ch44 = {104.7619f,1,ch44st}; + +/* char: 0x2d */ + +static const GLUTStrokeVertex ch45st0[] = +{ + {9.5238f,42.8571f}, + {95.2381f,42.8571f} +}; + +static const GLUTStrokeStrip ch45st[] = +{ + {2,ch45st0} +}; + +static const GLUTStrokeChar ch45 = {104.7619f,1,ch45st}; + +/* char: 0x2e */ + +static const GLUTStrokeVertex ch46st0[] = +{ + {52.3810f,9.5238f}, + {47.6191f,4.7619f}, + {52.3810f,0.0000f}, + {57.1429f,4.7619f}, + {52.3810f,9.5238f} +}; + +static const GLUTStrokeStrip ch46st[] = +{ + {5,ch46st0} +}; + +static const GLUTStrokeChar ch46 = {104.7619f,1,ch46st}; + +/* char: 0x2f */ + +static const GLUTStrokeVertex ch47st0[] = +{ + {19.0476f,-14.2857f}, + {85.7143f,100.0000f} +}; + +static const GLUTStrokeStrip ch47st[] = +{ + {2,ch47st0} +}; + +static const GLUTStrokeChar ch47 = {104.7619f,1,ch47st}; + +/* char: 0x30 */ + +static const GLUTStrokeVertex ch48st0[] = +{ + {47.6190f,100.0000f}, + {33.3333f,95.2381f}, + {23.8095f,80.9524f}, + {19.0476f,57.1429f}, + {19.0476f,42.8571f}, + {23.8095f,19.0476f}, + {33.3333f,4.7619f}, + {47.6190f,0.0000f}, + {57.1428f,0.0000f}, + {71.4286f,4.7619f}, + {80.9524f,19.0476f}, + {85.7143f,42.8571f}, + {85.7143f,57.1429f}, + {80.9524f,80.9524f}, + {71.4286f,95.2381f}, + {57.1428f,100.0000f}, + {47.6190f,100.0000f} +}; + +static const GLUTStrokeStrip ch48st[] = +{ + {17,ch48st0} +}; + +static const GLUTStrokeChar ch48 = {104.7619f,1,ch48st}; + +/* char: 0x31 */ + +static const GLUTStrokeVertex ch49st0[] = +{ + {40.4762f,80.9524f}, + {50.0000f,85.7143f}, + {64.2857f,100.0000f}, + {64.2857f,0.0000f} +}; + +static const GLUTStrokeStrip ch49st[] = +{ + {4,ch49st0} +}; + +static const GLUTStrokeChar ch49 = {104.7619f,1,ch49st}; + +/* char: 0x32 */ + +static const GLUTStrokeVertex ch50st0[] = +{ + {23.8095f,76.1905f}, + {23.8095f,80.9524f}, + {28.5714f,90.4762f}, + {33.3333f,95.2381f}, + {42.8571f,100.0000f}, + {61.9047f,100.0000f}, + {71.4286f,95.2381f}, + {76.1905f,90.4762f}, + {80.9524f,80.9524f}, + {80.9524f,71.4286f}, + {76.1905f,61.9048f}, + {66.6666f,47.6190f}, + {19.0476f,0.0000f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeStrip ch50st[] = +{ + {14,ch50st0} +}; + +static const GLUTStrokeChar ch50 = {104.7619f,1,ch50st}; + +/* char: 0x33 */ + +static const GLUTStrokeVertex ch51st0[] = +{ + {28.5714f,100.0000f}, + {80.9524f,100.0000f}, + {52.3809f,61.9048f}, + {66.6666f,61.9048f}, + {76.1905f,57.1429f}, + {80.9524f,52.3810f}, + {85.7143f,38.0952f}, + {85.7143f,28.5714f}, + {80.9524f,14.2857f}, + {71.4286f,4.7619f}, + {57.1428f,0.0000f}, + {42.8571f,0.0000f}, + {28.5714f,4.7619f}, + {23.8095f,9.5238f}, + {19.0476f,19.0476f} +}; + +static const GLUTStrokeStrip ch51st[] = +{ + {15,ch51st0} +}; + +static const GLUTStrokeChar ch51 = {104.7619f,1,ch51st}; + +/* char: 0x34 */ + +static const GLUTStrokeVertex ch52st0[] = +{ + {64.2857f,100.0000f}, + {16.6667f,33.3333f}, + {88.0952f,33.3333f} +}; + +static const GLUTStrokeVertex ch52st1[] = +{ + {64.2857f,100.0000f}, + {64.2857f,0.0000f} +}; + +static const GLUTStrokeStrip ch52st[] = +{ + {3,ch52st0}, + {2,ch52st1} +}; + +static const GLUTStrokeChar ch52 = {104.7619f,2,ch52st}; + +/* char: 0x35 */ + +static const GLUTStrokeVertex ch53st0[] = +{ + {76.1905f,100.0000f}, + {28.5714f,100.0000f}, + {23.8095f,57.1429f}, + {28.5714f,61.9048f}, + {42.8571f,66.6667f}, + {57.1428f,66.6667f}, + {71.4286f,61.9048f}, + {80.9524f,52.3810f}, + {85.7143f,38.0952f}, + {85.7143f,28.5714f}, + {80.9524f,14.2857f}, + {71.4286f,4.7619f}, + {57.1428f,0.0000f}, + {42.8571f,0.0000f}, + {28.5714f,4.7619f}, + {23.8095f,9.5238f}, + {19.0476f,19.0476f} +}; + +static const GLUTStrokeStrip ch53st[] = +{ + {17,ch53st0} +}; + +static const GLUTStrokeChar ch53 = {104.7619f,1,ch53st}; + +/* char: 0x36 */ + +static const GLUTStrokeVertex ch54st0[] = +{ + {78.5714f,85.7143f}, + {73.8096f,95.2381f}, + {59.5238f,100.0000f}, + {50.0000f,100.0000f}, + {35.7143f,95.2381f}, + {26.1905f,80.9524f}, + {21.4286f,57.1429f}, + {21.4286f,33.3333f}, + {26.1905f,14.2857f}, + {35.7143f,4.7619f}, + {50.0000f,0.0000f}, + {54.7619f,0.0000f}, + {69.0476f,4.7619f}, + {78.5714f,14.2857f}, + {83.3334f,28.5714f}, + {83.3334f,33.3333f}, + {78.5714f,47.6190f}, + {69.0476f,57.1429f}, + {54.7619f,61.9048f}, + {50.0000f,61.9048f}, + {35.7143f,57.1429f}, + {26.1905f,47.6190f}, + {21.4286f,33.3333f} +}; + +static const GLUTStrokeStrip ch54st[] = +{ + {23,ch54st0} +}; + +static const GLUTStrokeChar ch54 = {104.7619f,1,ch54st}; + +/* char: 0x37 */ + +static const GLUTStrokeVertex ch55st0[] = +{ + {85.7143f,100.0000f}, + {38.0952f,0.0000f} +}; + +static const GLUTStrokeVertex ch55st1[] = +{ + {19.0476f,100.0000f}, + {85.7143f,100.0000f} +}; + +static const GLUTStrokeStrip ch55st[] = +{ + {2,ch55st0}, + {2,ch55st1} +}; + +static const GLUTStrokeChar ch55 = {104.7619f,2,ch55st}; + +/* char: 0x38 */ + +static const GLUTStrokeVertex ch56st0[] = +{ + {42.8571f,100.0000f}, + {28.5714f,95.2381f}, + {23.8095f,85.7143f}, + {23.8095f,76.1905f}, + {28.5714f,66.6667f}, + {38.0952f,61.9048f}, + {57.1428f,57.1429f}, + {71.4286f,52.3810f}, + {80.9524f,42.8571f}, + {85.7143f,33.3333f}, + {85.7143f,19.0476f}, + {80.9524f,9.5238f}, + {76.1905f,4.7619f}, + {61.9047f,0.0000f}, + {42.8571f,0.0000f}, + {28.5714f,4.7619f}, + {23.8095f,9.5238f}, + {19.0476f,19.0476f}, + {19.0476f,33.3333f}, + {23.8095f,42.8571f}, + {33.3333f,52.3810f}, + {47.6190f,57.1429f}, + {66.6666f,61.9048f}, + {76.1905f,66.6667f}, + {80.9524f,76.1905f}, + {80.9524f,85.7143f}, + {76.1905f,95.2381f}, + {61.9047f,100.0000f}, + {42.8571f,100.0000f} +}; + +static const GLUTStrokeStrip ch56st[] = +{ + {29,ch56st0} +}; + +static const GLUTStrokeChar ch56 = {104.7619f,1,ch56st}; + +/* char: 0x39 */ + +static const GLUTStrokeVertex ch57st0[] = +{ + {83.3334f,66.6667f}, + {78.5714f,52.3810f}, + {69.0476f,42.8571f}, + {54.7619f,38.0952f}, + {50.0000f,38.0952f}, + {35.7143f,42.8571f}, + {26.1905f,52.3810f}, + {21.4286f,66.6667f}, + {21.4286f,71.4286f}, + {26.1905f,85.7143f}, + {35.7143f,95.2381f}, + {50.0000f,100.0000f}, + {54.7619f,100.0000f}, + {69.0476f,95.2381f}, + {78.5714f,85.7143f}, + {83.3334f,66.6667f}, + {83.3334f,42.8571f}, + {78.5714f,19.0476f}, + {69.0476f,4.7619f}, + {54.7619f,0.0000f}, + {45.2381f,0.0000f}, + {30.9524f,4.7619f}, + {26.1905f,14.2857f} +}; + +static const GLUTStrokeStrip ch57st[] = +{ + {23,ch57st0} +}; + +static const GLUTStrokeChar ch57 = {104.7619f,1,ch57st}; + +/* char: 0x3a */ + +static const GLUTStrokeVertex ch58st0[] = +{ + {52.3810f,66.6667f}, + {47.6191f,61.9048f}, + {52.3810f,57.1429f}, + {57.1429f,61.9048f}, + {52.3810f,66.6667f} +}; + +static const GLUTStrokeVertex ch58st1[] = +{ + {52.3810f,9.5238f}, + {47.6191f,4.7619f}, + {52.3810f,0.0000f}, + {57.1429f,4.7619f}, + {52.3810f,9.5238f} +}; + +static const GLUTStrokeStrip ch58st[] = +{ + {5,ch58st0}, + {5,ch58st1} +}; + +static const GLUTStrokeChar ch58 = {104.7619f,2,ch58st}; + +/* char: 0x3b */ + +static const GLUTStrokeVertex ch59st0[] = +{ + {52.3810f,66.6667f}, + {47.6191f,61.9048f}, + {52.3810f,57.1429f}, + {57.1429f,61.9048f}, + {52.3810f,66.6667f} +}; + +static const GLUTStrokeVertex ch59st1[] = +{ + {57.1429f,4.7619f}, + {52.3810f,0.0000f}, + {47.6191f,4.7619f}, + {52.3810f,9.5238f}, + {57.1429f,4.7619f}, + {57.1429f,-4.7619f}, + {52.3810f,-14.2857f}, + {47.6191f,-19.0476f} +}; + +static const GLUTStrokeStrip ch59st[] = +{ + {5,ch59st0}, + {8,ch59st1} +}; + +static const GLUTStrokeChar ch59 = {104.7619f,2,ch59st}; + +/* char: 0x3c */ + +static const GLUTStrokeVertex ch60st0[] = +{ + {90.4762f,85.7143f}, + {14.2857f,42.8571f}, + {90.4762f,0.0000f} +}; + +static const GLUTStrokeStrip ch60st[] = +{ + {3,ch60st0} +}; + +static const GLUTStrokeChar ch60 = {104.7619f,1,ch60st}; + +/* char: 0x3d */ + +static const GLUTStrokeVertex ch61st0[] = +{ + {9.5238f,57.1429f}, + {95.2381f,57.1429f} +}; + +static const GLUTStrokeVertex ch61st1[] = +{ + {9.5238f,28.5714f}, + {95.2381f,28.5714f} +}; + +static const GLUTStrokeStrip ch61st[] = +{ + {2,ch61st0}, + {2,ch61st1} +}; + +static const GLUTStrokeChar ch61 = {104.7619f,2,ch61st}; + +/* char: 0x3e */ + +static const GLUTStrokeVertex ch62st0[] = +{ + {14.2857f,85.7143f}, + {90.4762f,42.8571f}, + {14.2857f,0.0000f} +}; + +static const GLUTStrokeStrip ch62st[] = +{ + {3,ch62st0} +}; + +static const GLUTStrokeChar ch62 = {104.7619f,1,ch62st}; + +/* char: 0x3f */ + +static const GLUTStrokeVertex ch63st0[] = +{ + {23.8095f,76.1905f}, + {23.8095f,80.9524f}, + {28.5714f,90.4762f}, + {33.3333f,95.2381f}, + {42.8571f,100.0000f}, + {61.9047f,100.0000f}, + {71.4285f,95.2381f}, + {76.1905f,90.4762f}, + {80.9524f,80.9524f}, + {80.9524f,71.4286f}, + {76.1905f,61.9048f}, + {71.4285f,57.1429f}, + {52.3809f,47.6190f}, + {52.3809f,33.3333f} +}; + +static const GLUTStrokeVertex ch63st1[] = +{ + {52.3809f,9.5238f}, + {47.6190f,4.7619f}, + {52.3809f,0.0000f}, + {57.1428f,4.7619f}, + {52.3809f,9.5238f} +}; + +static const GLUTStrokeStrip ch63st[] = +{ + {14,ch63st0}, + {5,ch63st1} +}; + +static const GLUTStrokeChar ch63 = {104.7619f,2,ch63st}; + +/* char: 0x40 */ + +static const GLUTStrokeVertex ch64st0[] = +{ + {64.2857f,52.3810f}, + {54.7619f,57.1429f}, + {45.2381f,57.1429f}, + {40.4762f,47.6190f}, + {40.4762f,42.8571f}, + {45.2381f,33.3333f}, + {54.7619f,33.3333f}, + {64.2857f,38.0952f} +}; + +static const GLUTStrokeVertex ch64st1[] = +{ + {64.2857f,57.1429f}, + {64.2857f,38.0952f}, + {69.0476f,33.3333f}, + {78.5714f,33.3333f}, + {83.3334f,42.8571f}, + {83.3334f,47.6190f}, + {78.5714f,61.9048f}, + {69.0476f,71.4286f}, + {54.7619f,76.1905f}, + {50.0000f,76.1905f}, + {35.7143f,71.4286f}, + {26.1905f,61.9048f}, + {21.4286f,47.6190f}, + {21.4286f,42.8571f}, + {26.1905f,28.5714f}, + {35.7143f,19.0476f}, + {50.0000f,14.2857f}, + {54.7619f,14.2857f}, + {69.0476f,19.0476f} +}; + +static const GLUTStrokeStrip ch64st[] = +{ + {8,ch64st0}, + {19,ch64st1} +}; + +static const GLUTStrokeChar ch64 = {104.7619f,2,ch64st}; + +/* char: 0x41 */ + +static const GLUTStrokeVertex ch65st0[] = +{ + {52.3809f,100.0000f}, + {14.2857f,0.0000f} +}; + +static const GLUTStrokeVertex ch65st1[] = +{ + {52.3809f,100.0000f}, + {90.4762f,0.0000f} +}; + +static const GLUTStrokeVertex ch65st2[] = +{ + {28.5714f,33.3333f}, + {76.1905f,33.3333f} +}; + +static const GLUTStrokeStrip ch65st[] = +{ + {2,ch65st0}, + {2,ch65st1}, + {2,ch65st2} +}; + +static const GLUTStrokeChar ch65 = {104.7619f,3,ch65st}; + +/* char: 0x42 */ + +static const GLUTStrokeVertex ch66st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch66st1[] = +{ + {19.0476f,100.0000f}, + {61.9047f,100.0000f}, + {76.1905f,95.2381f}, + {80.9524f,90.4762f}, + {85.7143f,80.9524f}, + {85.7143f,71.4286f}, + {80.9524f,61.9048f}, + {76.1905f,57.1429f}, + {61.9047f,52.3810f} +}; + +static const GLUTStrokeVertex ch66st2[] = +{ + {19.0476f,52.3810f}, + {61.9047f,52.3810f}, + {76.1905f,47.6190f}, + {80.9524f,42.8571f}, + {85.7143f,33.3333f}, + {85.7143f,19.0476f}, + {80.9524f,9.5238f}, + {76.1905f,4.7619f}, + {61.9047f,0.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeStrip ch66st[] = +{ + {2,ch66st0}, + {9,ch66st1}, + {10,ch66st2} +}; + +static const GLUTStrokeChar ch66 = {104.7619f,3,ch66st}; + +/* char: 0x43 */ + +static const GLUTStrokeVertex ch67st0[] = +{ + {88.0952f,76.1905f}, + {83.3334f,85.7143f}, + {73.8096f,95.2381f}, + {64.2857f,100.0000f}, + {45.2381f,100.0000f}, + {35.7143f,95.2381f}, + {26.1905f,85.7143f}, + {21.4286f,76.1905f}, + {16.6667f,61.9048f}, + {16.6667f,38.0952f}, + {21.4286f,23.8095f}, + {26.1905f,14.2857f}, + {35.7143f,4.7619f}, + {45.2381f,0.0000f}, + {64.2857f,0.0000f}, + {73.8096f,4.7619f}, + {83.3334f,14.2857f}, + {88.0952f,23.8095f} +}; + +static const GLUTStrokeStrip ch67st[] = +{ + {18,ch67st0} +}; + +static const GLUTStrokeChar ch67 = {104.7619f,1,ch67st}; + +/* char: 0x44 */ + +static const GLUTStrokeVertex ch68st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch68st1[] = +{ + {19.0476f,100.0000f}, + {52.3809f,100.0000f}, + {66.6666f,95.2381f}, + {76.1905f,85.7143f}, + {80.9524f,76.1905f}, + {85.7143f,61.9048f}, + {85.7143f,38.0952f}, + {80.9524f,23.8095f}, + {76.1905f,14.2857f}, + {66.6666f,4.7619f}, + {52.3809f,0.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeStrip ch68st[] = +{ + {2,ch68st0}, + {12,ch68st1} +}; + +static const GLUTStrokeChar ch68 = {104.7619f,2,ch68st}; + +/* char: 0x45 */ + +static const GLUTStrokeVertex ch69st0[] = +{ + {21.4286f,100.0000f}, + {21.4286f,0.0000f} +}; + +static const GLUTStrokeVertex ch69st1[] = +{ + {21.4286f,100.0000f}, + {83.3334f,100.0000f} +}; + +static const GLUTStrokeVertex ch69st2[] = +{ + {21.4286f,52.3810f}, + {59.5238f,52.3810f} +}; + +static const GLUTStrokeVertex ch69st3[] = +{ + {21.4286f,0.0000f}, + {83.3334f,0.0000f} +}; + +static const GLUTStrokeStrip ch69st[] = +{ + {2,ch69st0}, + {2,ch69st1}, + {2,ch69st2}, + {2,ch69st3} +}; + +static const GLUTStrokeChar ch69 = {104.7619f,4,ch69st}; + +/* char: 0x46 */ + +static const GLUTStrokeVertex ch70st0[] = +{ + {21.4286f,100.0000f}, + {21.4286f,0.0000f} +}; + +static const GLUTStrokeVertex ch70st1[] = +{ + {21.4286f,100.0000f}, + {83.3334f,100.0000f} +}; + +static const GLUTStrokeVertex ch70st2[] = +{ + {21.4286f,52.3810f}, + {59.5238f,52.3810f} +}; + +static const GLUTStrokeStrip ch70st[] = +{ + {2,ch70st0}, + {2,ch70st1}, + {2,ch70st2} +}; + +static const GLUTStrokeChar ch70 = {104.7619f,3,ch70st}; + +/* char: 0x47 */ + +static const GLUTStrokeVertex ch71st0[] = +{ + {88.0952f,76.1905f}, + {83.3334f,85.7143f}, + {73.8096f,95.2381f}, + {64.2857f,100.0000f}, + {45.2381f,100.0000f}, + {35.7143f,95.2381f}, + {26.1905f,85.7143f}, + {21.4286f,76.1905f}, + {16.6667f,61.9048f}, + {16.6667f,38.0952f}, + {21.4286f,23.8095f}, + {26.1905f,14.2857f}, + {35.7143f,4.7619f}, + {45.2381f,0.0000f}, + {64.2857f,0.0000f}, + {73.8096f,4.7619f}, + {83.3334f,14.2857f}, + {88.0952f,23.8095f}, + {88.0952f,38.0952f} +}; + +static const GLUTStrokeVertex ch71st1[] = +{ + {64.2857f,38.0952f}, + {88.0952f,38.0952f} +}; + +static const GLUTStrokeStrip ch71st[] = +{ + {19,ch71st0}, + {2,ch71st1} +}; + +static const GLUTStrokeChar ch71 = {104.7619f,2,ch71st}; + +/* char: 0x48 */ + +static const GLUTStrokeVertex ch72st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch72st1[] = +{ + {85.7143f,100.0000f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeVertex ch72st2[] = +{ + {19.0476f,52.3810f}, + {85.7143f,52.3810f} +}; + +static const GLUTStrokeStrip ch72st[] = +{ + {2,ch72st0}, + {2,ch72st1}, + {2,ch72st2} +}; + +static const GLUTStrokeChar ch72 = {104.7619f,3,ch72st}; + +/* char: 0x49 */ + +static const GLUTStrokeVertex ch73st0[] = +{ + {52.3810f,100.0000f}, + {52.3810f,0.0000f} +}; + +static const GLUTStrokeStrip ch73st[] = +{ + {2,ch73st0} +}; + +static const GLUTStrokeChar ch73 = {104.7619f,1,ch73st}; + +/* char: 0x4a */ + +static const GLUTStrokeVertex ch74st0[] = +{ + {76.1905f,100.0000f}, + {76.1905f,23.8095f}, + {71.4286f,9.5238f}, + {66.6667f,4.7619f}, + {57.1429f,0.0000f}, + {47.6191f,0.0000f}, + {38.0953f,4.7619f}, + {33.3334f,9.5238f}, + {28.5715f,23.8095f}, + {28.5715f,33.3333f} +}; + +static const GLUTStrokeStrip ch74st[] = +{ + {10,ch74st0} +}; + +static const GLUTStrokeChar ch74 = {104.7619f,1,ch74st}; + +/* char: 0x4b */ + +static const GLUTStrokeVertex ch75st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch75st1[] = +{ + {85.7143f,100.0000f}, + {19.0476f,33.3333f} +}; + +static const GLUTStrokeVertex ch75st2[] = +{ + {42.8571f,57.1429f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeStrip ch75st[] = +{ + {2,ch75st0}, + {2,ch75st1}, + {2,ch75st2} +}; + +static const GLUTStrokeChar ch75 = {104.7619f,3,ch75st}; + +/* char: 0x4c */ + +static const GLUTStrokeVertex ch76st0[] = +{ + {23.8095f,100.0000f}, + {23.8095f,0.0000f} +}; + +static const GLUTStrokeVertex ch76st1[] = +{ + {23.8095f,0.0000f}, + {80.9524f,0.0000f} +}; + +static const GLUTStrokeStrip ch76st[] = +{ + {2,ch76st0}, + {2,ch76st1} +}; + +static const GLUTStrokeChar ch76 = {104.7619f,2,ch76st}; + +/* char: 0x4d */ + +static const GLUTStrokeVertex ch77st0[] = +{ + {14.2857f,100.0000f}, + {14.2857f,0.0000f} +}; + +static const GLUTStrokeVertex ch77st1[] = +{ + {14.2857f,100.0000f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch77st2[] = +{ + {90.4762f,100.0000f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch77st3[] = +{ + {90.4762f,100.0000f}, + {90.4762f,0.0000f} +}; + +static const GLUTStrokeStrip ch77st[] = +{ + {2,ch77st0}, + {2,ch77st1}, + {2,ch77st2}, + {2,ch77st3} +}; + +static const GLUTStrokeChar ch77 = {104.7619f,4,ch77st}; + +/* char: 0x4e */ + +static const GLUTStrokeVertex ch78st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch78st1[] = +{ + {19.0476f,100.0000f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeVertex ch78st2[] = +{ + {85.7143f,100.0000f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeStrip ch78st[] = +{ + {2,ch78st0}, + {2,ch78st1}, + {2,ch78st2} +}; + +static const GLUTStrokeChar ch78 = {104.7619f,3,ch78st}; + +/* char: 0x4f */ + +static const GLUTStrokeVertex ch79st0[] = +{ + {42.8571f,100.0000f}, + {33.3333f,95.2381f}, + {23.8095f,85.7143f}, + {19.0476f,76.1905f}, + {14.2857f,61.9048f}, + {14.2857f,38.0952f}, + {19.0476f,23.8095f}, + {23.8095f,14.2857f}, + {33.3333f,4.7619f}, + {42.8571f,0.0000f}, + {61.9047f,0.0000f}, + {71.4286f,4.7619f}, + {80.9524f,14.2857f}, + {85.7143f,23.8095f}, + {90.4762f,38.0952f}, + {90.4762f,61.9048f}, + {85.7143f,76.1905f}, + {80.9524f,85.7143f}, + {71.4286f,95.2381f}, + {61.9047f,100.0000f}, + {42.8571f,100.0000f} +}; + +static const GLUTStrokeStrip ch79st[] = +{ + {21,ch79st0} +}; + +static const GLUTStrokeChar ch79 = {104.7619f,1,ch79st}; + +/* char: 0x50 */ + +static const GLUTStrokeVertex ch80st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch80st1[] = +{ + {19.0476f,100.0000f}, + {61.9047f,100.0000f}, + {76.1905f,95.2381f}, + {80.9524f,90.4762f}, + {85.7143f,80.9524f}, + {85.7143f,66.6667f}, + {80.9524f,57.1429f}, + {76.1905f,52.3810f}, + {61.9047f,47.6190f}, + {19.0476f,47.6190f} +}; + +static const GLUTStrokeStrip ch80st[] = +{ + {2,ch80st0}, + {10,ch80st1} +}; + +static const GLUTStrokeChar ch80 = {104.7619f,2,ch80st}; + +/* char: 0x51 */ + +static const GLUTStrokeVertex ch81st0[] = +{ + {42.8571f,100.0000f}, + {33.3333f,95.2381f}, + {23.8095f,85.7143f}, + {19.0476f,76.1905f}, + {14.2857f,61.9048f}, + {14.2857f,38.0952f}, + {19.0476f,23.8095f}, + {23.8095f,14.2857f}, + {33.3333f,4.7619f}, + {42.8571f,0.0000f}, + {61.9047f,0.0000f}, + {71.4286f,4.7619f}, + {80.9524f,14.2857f}, + {85.7143f,23.8095f}, + {90.4762f,38.0952f}, + {90.4762f,61.9048f}, + {85.7143f,76.1905f}, + {80.9524f,85.7143f}, + {71.4286f,95.2381f}, + {61.9047f,100.0000f}, + {42.8571f,100.0000f} +}; + +static const GLUTStrokeVertex ch81st1[] = +{ + {57.1428f,19.0476f}, + {85.7143f,-9.5238f} +}; + +static const GLUTStrokeStrip ch81st[] = +{ + {21,ch81st0}, + {2,ch81st1} +}; + +static const GLUTStrokeChar ch81 = {104.7619f,2,ch81st}; + +/* char: 0x52 */ + +static const GLUTStrokeVertex ch82st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch82st1[] = +{ + {19.0476f,100.0000f}, + {61.9047f,100.0000f}, + {76.1905f,95.2381f}, + {80.9524f,90.4762f}, + {85.7143f,80.9524f}, + {85.7143f,71.4286f}, + {80.9524f,61.9048f}, + {76.1905f,57.1429f}, + {61.9047f,52.3810f}, + {19.0476f,52.3810f} +}; + +static const GLUTStrokeVertex ch82st2[] = +{ + {52.3809f,52.3810f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeStrip ch82st[] = +{ + {2,ch82st0}, + {10,ch82st1}, + {2,ch82st2} +}; + +static const GLUTStrokeChar ch82 = {104.7619f,3,ch82st}; + +/* char: 0x53 */ + +static const GLUTStrokeVertex ch83st0[] = +{ + {85.7143f,85.7143f}, + {76.1905f,95.2381f}, + {61.9047f,100.0000f}, + {42.8571f,100.0000f}, + {28.5714f,95.2381f}, + {19.0476f,85.7143f}, + {19.0476f,76.1905f}, + {23.8095f,66.6667f}, + {28.5714f,61.9048f}, + {38.0952f,57.1429f}, + {66.6666f,47.6190f}, + {76.1905f,42.8571f}, + {80.9524f,38.0952f}, + {85.7143f,28.5714f}, + {85.7143f,14.2857f}, + {76.1905f,4.7619f}, + {61.9047f,0.0000f}, + {42.8571f,0.0000f}, + {28.5714f,4.7619f}, + {19.0476f,14.2857f} +}; + +static const GLUTStrokeStrip ch83st[] = +{ + {20,ch83st0} +}; + +static const GLUTStrokeChar ch83 = {104.7619f,1,ch83st}; + +/* char: 0x54 */ + +static const GLUTStrokeVertex ch84st0[] = +{ + {52.3809f,100.0000f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch84st1[] = +{ + {19.0476f,100.0000f}, + {85.7143f,100.0000f} +}; + +static const GLUTStrokeStrip ch84st[] = +{ + {2,ch84st0}, + {2,ch84st1} +}; + +static const GLUTStrokeChar ch84 = {104.7619f,2,ch84st}; + +/* char: 0x55 */ + +static const GLUTStrokeVertex ch85st0[] = +{ + {19.0476f,100.0000f}, + {19.0476f,28.5714f}, + {23.8095f,14.2857f}, + {33.3333f,4.7619f}, + {47.6190f,0.0000f}, + {57.1428f,0.0000f}, + {71.4286f,4.7619f}, + {80.9524f,14.2857f}, + {85.7143f,28.5714f}, + {85.7143f,100.0000f} +}; + +static const GLUTStrokeStrip ch85st[] = +{ + {10,ch85st0} +}; + +static const GLUTStrokeChar ch85 = {104.7619f,1,ch85st}; + +/* char: 0x56 */ + +static const GLUTStrokeVertex ch86st0[] = +{ + {14.2857f,100.0000f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch86st1[] = +{ + {90.4762f,100.0000f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeStrip ch86st[] = +{ + {2,ch86st0}, + {2,ch86st1} +}; + +static const GLUTStrokeChar ch86 = {104.7619f,2,ch86st}; + +/* char: 0x57 */ + +static const GLUTStrokeVertex ch87st0[] = +{ + {4.7619f,100.0000f}, + {28.5714f,0.0000f} +}; + +static const GLUTStrokeVertex ch87st1[] = +{ + {52.3809f,100.0000f}, + {28.5714f,0.0000f} +}; + +static const GLUTStrokeVertex ch87st2[] = +{ + {52.3809f,100.0000f}, + {76.1905f,0.0000f} +}; + +static const GLUTStrokeVertex ch87st3[] = +{ + {100.0000f,100.0000f}, + {76.1905f,0.0000f} +}; + +static const GLUTStrokeStrip ch87st[] = +{ + {2,ch87st0}, + {2,ch87st1}, + {2,ch87st2}, + {2,ch87st3} +}; + +static const GLUTStrokeChar ch87 = {104.7619f,4,ch87st}; + +/* char: 0x58 */ + +static const GLUTStrokeVertex ch88st0[] = +{ + {19.0476f,100.0000f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeVertex ch88st1[] = +{ + {85.7143f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeStrip ch88st[] = +{ + {2,ch88st0}, + {2,ch88st1} +}; + +static const GLUTStrokeChar ch88 = {104.7619f,2,ch88st}; + +/* char: 0x59 */ + +static const GLUTStrokeVertex ch89st0[] = +{ + {14.2857f,100.0000f}, + {52.3809f,52.3810f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch89st1[] = +{ + {90.4762f,100.0000f}, + {52.3809f,52.3810f} +}; + +static const GLUTStrokeStrip ch89st[] = +{ + {3,ch89st0}, + {2,ch89st1} +}; + +static const GLUTStrokeChar ch89 = {104.7619f,2,ch89st}; + +/* char: 0x5a */ + +static const GLUTStrokeVertex ch90st0[] = +{ + {85.7143f,100.0000f}, + {19.0476f,0.0000f} +}; + +static const GLUTStrokeVertex ch90st1[] = +{ + {19.0476f,100.0000f}, + {85.7143f,100.0000f} +}; + +static const GLUTStrokeVertex ch90st2[] = +{ + {19.0476f,0.0000f}, + {85.7143f,0.0000f} +}; + +static const GLUTStrokeStrip ch90st[] = +{ + {2,ch90st0}, + {2,ch90st1}, + {2,ch90st2} +}; + +static const GLUTStrokeChar ch90 = {104.7619f,3,ch90st}; + +/* char: 0x5b */ + +static const GLUTStrokeVertex ch91st0[] = +{ + {35.7143f,119.0476f}, + {35.7143f,-33.3333f} +}; + +static const GLUTStrokeVertex ch91st1[] = +{ + {40.4762f,119.0476f}, + {40.4762f,-33.3333f} +}; + +static const GLUTStrokeVertex ch91st2[] = +{ + {35.7143f,119.0476f}, + {69.0476f,119.0476f} +}; + +static const GLUTStrokeVertex ch91st3[] = +{ + {35.7143f,-33.3333f}, + {69.0476f,-33.3333f} +}; + +static const GLUTStrokeStrip ch91st[] = +{ + {2,ch91st0}, + {2,ch91st1}, + {2,ch91st2}, + {2,ch91st3} +}; + +static const GLUTStrokeChar ch91 = {104.7619f,4,ch91st}; + +/* char: 0x5c */ + +static const GLUTStrokeVertex ch92st0[] = +{ + {19.0476f,100.0000f}, + {85.7143f,-14.2857f} +}; + +static const GLUTStrokeStrip ch92st[] = +{ + {2,ch92st0} +}; + +static const GLUTStrokeChar ch92 = {104.7619f,1,ch92st}; + +/* char: 0x5d */ + +static const GLUTStrokeVertex ch93st0[] = +{ + {64.2857f,119.0476f}, + {64.2857f,-33.3333f} +}; + +static const GLUTStrokeVertex ch93st1[] = +{ + {69.0476f,119.0476f}, + {69.0476f,-33.3333f} +}; + +static const GLUTStrokeVertex ch93st2[] = +{ + {35.7143f,119.0476f}, + {69.0476f,119.0476f} +}; + +static const GLUTStrokeVertex ch93st3[] = +{ + {35.7143f,-33.3333f}, + {69.0476f,-33.3333f} +}; + +static const GLUTStrokeStrip ch93st[] = +{ + {2,ch93st0}, + {2,ch93st1}, + {2,ch93st2}, + {2,ch93st3} +}; + +static const GLUTStrokeChar ch93 = {104.7619f,4,ch93st}; + +/* char: 0x5e */ + +static const GLUTStrokeVertex ch94st0[] = +{ + {52.3809f,109.5238f}, + {14.2857f,42.8571f} +}; + +static const GLUTStrokeVertex ch94st1[] = +{ + {52.3809f,109.5238f}, + {90.4762f,42.8571f} +}; + +static const GLUTStrokeStrip ch94st[] = +{ + {2,ch94st0}, + {2,ch94st1} +}; + +static const GLUTStrokeChar ch94 = {104.7619f,2,ch94st}; + +/* char: 0x5f */ + +static const GLUTStrokeVertex ch95st0[] = +{ + {0.0000f,-33.3333f}, + {104.7619f,-33.3333f}, + {104.7619f,-28.5714f}, + {0.0000f,-28.5714f}, + {0.0000f,-33.3333f} +}; + +static const GLUTStrokeStrip ch95st[] = +{ + {5,ch95st0} +}; + +static const GLUTStrokeChar ch95 = {104.7619f,1,ch95st}; + +/* char: 0x60 */ + +static const GLUTStrokeVertex ch96st0[] = +{ + {42.8572f,100.0000f}, + {66.6667f,71.4286f} +}; + +static const GLUTStrokeVertex ch96st1[] = +{ + {42.8572f,100.0000f}, + {38.0953f,95.2381f}, + {66.6667f,71.4286f} +}; + +static const GLUTStrokeStrip ch96st[] = +{ + {2,ch96st0}, + {3,ch96st1} +}; + +static const GLUTStrokeChar ch96 = {104.7619f,2,ch96st}; + +/* char: 0x61 */ + +static const GLUTStrokeVertex ch97st0[] = +{ + {80.9524f,66.6667f}, + {80.9524f,0.0000f} +}; + +static const GLUTStrokeVertex ch97st1[] = +{ + {80.9524f,52.3810f}, + {71.4285f,61.9048f}, + {61.9047f,66.6667f}, + {47.6190f,66.6667f}, + {38.0952f,61.9048f}, + {28.5714f,52.3810f}, + {23.8095f,38.0952f}, + {23.8095f,28.5714f}, + {28.5714f,14.2857f}, + {38.0952f,4.7619f}, + {47.6190f,0.0000f}, + {61.9047f,0.0000f}, + {71.4285f,4.7619f}, + {80.9524f,14.2857f} +}; + +static const GLUTStrokeStrip ch97st[] = +{ + {2,ch97st0}, + {14,ch97st1} +}; + +static const GLUTStrokeChar ch97 = {104.7619f,2,ch97st}; + +/* char: 0x62 */ + +static const GLUTStrokeVertex ch98st0[] = +{ + {23.8095f,100.0000f}, + {23.8095f,0.0000f} +}; + +static const GLUTStrokeVertex ch98st1[] = +{ + {23.8095f,52.3810f}, + {33.3333f,61.9048f}, + {42.8571f,66.6667f}, + {57.1428f,66.6667f}, + {66.6666f,61.9048f}, + {76.1905f,52.3810f}, + {80.9524f,38.0952f}, + {80.9524f,28.5714f}, + {76.1905f,14.2857f}, + {66.6666f,4.7619f}, + {57.1428f,0.0000f}, + {42.8571f,0.0000f}, + {33.3333f,4.7619f}, + {23.8095f,14.2857f} +}; + +static const GLUTStrokeStrip ch98st[] = +{ + {2,ch98st0}, + {14,ch98st1} +}; + +static const GLUTStrokeChar ch98 = {104.7619f,2,ch98st}; + +/* char: 0x63 */ + +static const GLUTStrokeVertex ch99st0[] = +{ + {80.9524f,52.3810f}, + {71.4285f,61.9048f}, + {61.9047f,66.6667f}, + {47.6190f,66.6667f}, + {38.0952f,61.9048f}, + {28.5714f,52.3810f}, + {23.8095f,38.0952f}, + {23.8095f,28.5714f}, + {28.5714f,14.2857f}, + {38.0952f,4.7619f}, + {47.6190f,0.0000f}, + {61.9047f,0.0000f}, + {71.4285f,4.7619f}, + {80.9524f,14.2857f} +}; + +static const GLUTStrokeStrip ch99st[] = +{ + {14,ch99st0} +}; + +static const GLUTStrokeChar ch99 = {104.7619f,1,ch99st}; + +/* char: 0x64 */ + +static const GLUTStrokeVertex ch100st0[] = +{ + {80.9524f,100.0000f}, + {80.9524f,0.0000f} +}; + +static const GLUTStrokeVertex ch100st1[] = +{ + {80.9524f,52.3810f}, + {71.4285f,61.9048f}, + {61.9047f,66.6667f}, + {47.6190f,66.6667f}, + {38.0952f,61.9048f}, + {28.5714f,52.3810f}, + {23.8095f,38.0952f}, + {23.8095f,28.5714f}, + {28.5714f,14.2857f}, + {38.0952f,4.7619f}, + {47.6190f,0.0000f}, + {61.9047f,0.0000f}, + {71.4285f,4.7619f}, + {80.9524f,14.2857f} +}; + +static const GLUTStrokeStrip ch100st[] = +{ + {2,ch100st0}, + {14,ch100st1} +}; + +static const GLUTStrokeChar ch100 = {104.7619f,2,ch100st}; + +/* char: 0x65 */ + +static const GLUTStrokeVertex ch101st0[] = +{ + {23.8095f,38.0952f}, + {80.9524f,38.0952f}, + {80.9524f,47.6190f}, + {76.1905f,57.1429f}, + {71.4285f,61.9048f}, + {61.9047f,66.6667f}, + {47.6190f,66.6667f}, + {38.0952f,61.9048f}, + {28.5714f,52.3810f}, + {23.8095f,38.0952f}, + {23.8095f,28.5714f}, + {28.5714f,14.2857f}, + {38.0952f,4.7619f}, + {47.6190f,0.0000f}, + {61.9047f,0.0000f}, + {71.4285f,4.7619f}, + {80.9524f,14.2857f} +}; + +static const GLUTStrokeStrip ch101st[] = +{ + {17,ch101st0} +}; + +static const GLUTStrokeChar ch101 = {104.7619f,1,ch101st}; + +/* char: 0x66 */ + +static const GLUTStrokeVertex ch102st0[] = +{ + {71.4286f,100.0000f}, + {61.9048f,100.0000f}, + {52.3810f,95.2381f}, + {47.6191f,80.9524f}, + {47.6191f,0.0000f} +}; + +static const GLUTStrokeVertex ch102st1[] = +{ + {33.3334f,66.6667f}, + {66.6667f,66.6667f} +}; + +static const GLUTStrokeStrip ch102st[] = +{ + {5,ch102st0}, + {2,ch102st1} +}; + +static const GLUTStrokeChar ch102 = {104.7619f,2,ch102st}; + +/* char: 0x67 */ + +static const GLUTStrokeVertex ch103st0[] = +{ + {80.9524f,66.6667f}, + {80.9524f,-9.5238f}, + {76.1905f,-23.8095f}, + {71.4285f,-28.5714f}, + {61.9047f,-33.3333f}, + {47.6190f,-33.3333f}, + {38.0952f,-28.5714f} +}; + +static const GLUTStrokeVertex ch103st1[] = +{ + {80.9524f,52.3810f}, + {71.4285f,61.9048f}, + {61.9047f,66.6667f}, + {47.6190f,66.6667f}, + {38.0952f,61.9048f}, + {28.5714f,52.3810f}, + {23.8095f,38.0952f}, + {23.8095f,28.5714f}, + {28.5714f,14.2857f}, + {38.0952f,4.7619f}, + {47.6190f,0.0000f}, + {61.9047f,0.0000f}, + {71.4285f,4.7619f}, + {80.9524f,14.2857f} +}; + +static const GLUTStrokeStrip ch103st[] = +{ + {7,ch103st0}, + {14,ch103st1} +}; + +static const GLUTStrokeChar ch103 = {104.7619f,2,ch103st}; + +/* char: 0x68 */ + +static const GLUTStrokeVertex ch104st0[] = +{ + {26.1905f,100.0000f}, + {26.1905f,0.0000f} +}; + +static const GLUTStrokeVertex ch104st1[] = +{ + {26.1905f,47.6190f}, + {40.4762f,61.9048f}, + {50.0000f,66.6667f}, + {64.2857f,66.6667f}, + {73.8095f,61.9048f}, + {78.5715f,47.6190f}, + {78.5715f,0.0000f} +}; + +static const GLUTStrokeStrip ch104st[] = +{ + {2,ch104st0}, + {7,ch104st1} +}; + +static const GLUTStrokeChar ch104 = {104.7619f,2,ch104st}; + +/* char: 0x69 */ + +static const GLUTStrokeVertex ch105st0[] = +{ + {47.6191f,100.0000f}, + {52.3810f,95.2381f}, + {57.1429f,100.0000f}, + {52.3810f,104.7619f}, + {47.6191f,100.0000f} +}; + +static const GLUTStrokeVertex ch105st1[] = +{ + {52.3810f,66.6667f}, + {52.3810f,0.0000f} +}; + +static const GLUTStrokeStrip ch105st[] = +{ + {5,ch105st0}, + {2,ch105st1} +}; + +static const GLUTStrokeChar ch105 = {104.7619f,2,ch105st}; + +/* char: 0x6a */ + +static const GLUTStrokeVertex ch106st0[] = +{ + {57.1429f,100.0000f}, + {61.9048f,95.2381f}, + {66.6667f,100.0000f}, + {61.9048f,104.7619f}, + {57.1429f,100.0000f} +}; + +static const GLUTStrokeVertex ch106st1[] = +{ + {61.9048f,66.6667f}, + {61.9048f,-14.2857f}, + {57.1429f,-28.5714f}, + {47.6191f,-33.3333f}, + {38.0953f,-33.3333f} +}; + +static const GLUTStrokeStrip ch106st[] = +{ + {5,ch106st0}, + {5,ch106st1} +}; + +static const GLUTStrokeChar ch106 = {104.7619f,2,ch106st}; + +/* char: 0x6b */ + +static const GLUTStrokeVertex ch107st0[] = +{ + {26.1905f,100.0000f}, + {26.1905f,0.0000f} +}; + +static const GLUTStrokeVertex ch107st1[] = +{ + {73.8095f,66.6667f}, + {26.1905f,19.0476f} +}; + +static const GLUTStrokeVertex ch107st2[] = +{ + {45.2381f,38.0952f}, + {78.5715f,0.0000f} +}; + +static const GLUTStrokeStrip ch107st[] = +{ + {2,ch107st0}, + {2,ch107st1}, + {2,ch107st2} +}; + +static const GLUTStrokeChar ch107 = {104.7619f,3,ch107st}; + +/* char: 0x6c */ + +static const GLUTStrokeVertex ch108st0[] = +{ + {52.3810f,100.0000f}, + {52.3810f,0.0000f} +}; + +static const GLUTStrokeStrip ch108st[] = +{ + {2,ch108st0} +}; + +static const GLUTStrokeChar ch108 = {104.7619f,1,ch108st}; + +/* char: 0x6d */ + +static const GLUTStrokeVertex ch109st0[] = +{ + {0.0000f,66.6667f}, + {0.0000f,0.0000f} +}; + +static const GLUTStrokeVertex ch109st1[] = +{ + {0.0000f,47.6190f}, + {14.2857f,61.9048f}, + {23.8095f,66.6667f}, + {38.0952f,66.6667f}, + {47.6190f,61.9048f}, + {52.3810f,47.6190f}, + {52.3810f,0.0000f} +}; + +static const GLUTStrokeVertex ch109st2[] = +{ + {52.3810f,47.6190f}, + {66.6667f,61.9048f}, + {76.1905f,66.6667f}, + {90.4762f,66.6667f}, + {100.0000f,61.9048f}, + {104.7619f,47.6190f}, + {104.7619f,0.0000f} +}; + +static const GLUTStrokeStrip ch109st[] = +{ + {2,ch109st0}, + {7,ch109st1}, + {7,ch109st2} +}; + +static const GLUTStrokeChar ch109 = {104.7619f,3,ch109st}; + +/* char: 0x6e */ + +static const GLUTStrokeVertex ch110st0[] = +{ + {26.1905f,66.6667f}, + {26.1905f,0.0000f} +}; + +static const GLUTStrokeVertex ch110st1[] = +{ + {26.1905f,47.6190f}, + {40.4762f,61.9048f}, + {50.0000f,66.6667f}, + {64.2857f,66.6667f}, + {73.8095f,61.9048f}, + {78.5715f,47.6190f}, + {78.5715f,0.0000f} +}; + +static const GLUTStrokeStrip ch110st[] = +{ + {2,ch110st0}, + {7,ch110st1} +}; + +static const GLUTStrokeChar ch110 = {104.7619f,2,ch110st}; + +/* char: 0x6f */ + +static const GLUTStrokeVertex ch111st0[] = +{ + {45.2381f,66.6667f}, + {35.7143f,61.9048f}, + {26.1905f,52.3810f}, + {21.4286f,38.0952f}, + {21.4286f,28.5714f}, + {26.1905f,14.2857f}, + {35.7143f,4.7619f}, + {45.2381f,0.0000f}, + {59.5238f,0.0000f}, + {69.0476f,4.7619f}, + {78.5714f,14.2857f}, + {83.3334f,28.5714f}, + {83.3334f,38.0952f}, + {78.5714f,52.3810f}, + {69.0476f,61.9048f}, + {59.5238f,66.6667f}, + {45.2381f,66.6667f} +}; + +static const GLUTStrokeStrip ch111st[] = +{ + {17,ch111st0} +}; + +static const GLUTStrokeChar ch111 = {104.7619f,1,ch111st}; + +/* char: 0x70 */ + +static const GLUTStrokeVertex ch112st0[] = +{ + {23.8095f,66.6667f}, + {23.8095f,-33.3333f} +}; + +static const GLUTStrokeVertex ch112st1[] = +{ + {23.8095f,52.3810f}, + {33.3333f,61.9048f}, + {42.8571f,66.6667f}, + {57.1428f,66.6667f}, + {66.6666f,61.9048f}, + {76.1905f,52.3810f}, + {80.9524f,38.0952f}, + {80.9524f,28.5714f}, + {76.1905f,14.2857f}, + {66.6666f,4.7619f}, + {57.1428f,0.0000f}, + {42.8571f,0.0000f}, + {33.3333f,4.7619f}, + {23.8095f,14.2857f} +}; + +static const GLUTStrokeStrip ch112st[] = +{ + {2,ch112st0}, + {14,ch112st1} +}; + +static const GLUTStrokeChar ch112 = {104.7619f,2,ch112st}; + +/* char: 0x71 */ + +static const GLUTStrokeVertex ch113st0[] = +{ + {80.9524f,66.6667f}, + {80.9524f,-33.3333f} +}; + +static const GLUTStrokeVertex ch113st1[] = +{ + {80.9524f,52.3810f}, + {71.4285f,61.9048f}, + {61.9047f,66.6667f}, + {47.6190f,66.6667f}, + {38.0952f,61.9048f}, + {28.5714f,52.3810f}, + {23.8095f,38.0952f}, + {23.8095f,28.5714f}, + {28.5714f,14.2857f}, + {38.0952f,4.7619f}, + {47.6190f,0.0000f}, + {61.9047f,0.0000f}, + {71.4285f,4.7619f}, + {80.9524f,14.2857f} +}; + +static const GLUTStrokeStrip ch113st[] = +{ + {2,ch113st0}, + {14,ch113st1} +}; + +static const GLUTStrokeChar ch113 = {104.7619f,2,ch113st}; + +/* char: 0x72 */ + +static const GLUTStrokeVertex ch114st0[] = +{ + {33.3334f,66.6667f}, + {33.3334f,0.0000f} +}; + +static const GLUTStrokeVertex ch114st1[] = +{ + {33.3334f,38.0952f}, + {38.0953f,52.3810f}, + {47.6191f,61.9048f}, + {57.1429f,66.6667f}, + {71.4286f,66.6667f} +}; + +static const GLUTStrokeStrip ch114st[] = +{ + {2,ch114st0}, + {5,ch114st1} +}; + +static const GLUTStrokeChar ch114 = {104.7619f,2,ch114st}; + +/* char: 0x73 */ + +static const GLUTStrokeVertex ch115st0[] = +{ + {78.5715f,52.3810f}, + {73.8095f,61.9048f}, + {59.5238f,66.6667f}, + {45.2381f,66.6667f}, + {30.9524f,61.9048f}, + {26.1905f,52.3810f}, + {30.9524f,42.8571f}, + {40.4762f,38.0952f}, + {64.2857f,33.3333f}, + {73.8095f,28.5714f}, + {78.5715f,19.0476f}, + {78.5715f,14.2857f}, + {73.8095f,4.7619f}, + {59.5238f,0.0000f}, + {45.2381f,0.0000f}, + {30.9524f,4.7619f}, + {26.1905f,14.2857f} +}; + +static const GLUTStrokeStrip ch115st[] = +{ + {17,ch115st0} +}; + +static const GLUTStrokeChar ch115 = {104.7619f,1,ch115st}; + +/* char: 0x74 */ + +static const GLUTStrokeVertex ch116st0[] = +{ + {47.6191f,100.0000f}, + {47.6191f,19.0476f}, + {52.3810f,4.7619f}, + {61.9048f,0.0000f}, + {71.4286f,0.0000f} +}; + +static const GLUTStrokeVertex ch116st1[] = +{ + {33.3334f,66.6667f}, + {66.6667f,66.6667f} +}; + +static const GLUTStrokeStrip ch116st[] = +{ + {5,ch116st0}, + {2,ch116st1} +}; + +static const GLUTStrokeChar ch116 = {104.7619f,2,ch116st}; + +/* char: 0x75 */ + +static const GLUTStrokeVertex ch117st0[] = +{ + {26.1905f,66.6667f}, + {26.1905f,19.0476f}, + {30.9524f,4.7619f}, + {40.4762f,0.0000f}, + {54.7619f,0.0000f}, + {64.2857f,4.7619f}, + {78.5715f,19.0476f} +}; + +static const GLUTStrokeVertex ch117st1[] = +{ + {78.5715f,66.6667f}, + {78.5715f,0.0000f} +}; + +static const GLUTStrokeStrip ch117st[] = +{ + {7,ch117st0}, + {2,ch117st1} +}; + +static const GLUTStrokeChar ch117 = {104.7619f,2,ch117st}; + +/* char: 0x76 */ + +static const GLUTStrokeVertex ch118st0[] = +{ + {23.8095f,66.6667f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeVertex ch118st1[] = +{ + {80.9524f,66.6667f}, + {52.3809f,0.0000f} +}; + +static const GLUTStrokeStrip ch118st[] = +{ + {2,ch118st0}, + {2,ch118st1} +}; + +static const GLUTStrokeChar ch118 = {104.7619f,2,ch118st}; + +/* char: 0x77 */ + +static const GLUTStrokeVertex ch119st0[] = +{ + {14.2857f,66.6667f}, + {33.3333f,0.0000f} +}; + +static const GLUTStrokeVertex ch119st1[] = +{ + {52.3809f,66.6667f}, + {33.3333f,0.0000f} +}; + +static const GLUTStrokeVertex ch119st2[] = +{ + {52.3809f,66.6667f}, + {71.4286f,0.0000f} +}; + +static const GLUTStrokeVertex ch119st3[] = +{ + {90.4762f,66.6667f}, + {71.4286f,0.0000f} +}; + +static const GLUTStrokeStrip ch119st[] = +{ + {2,ch119st0}, + {2,ch119st1}, + {2,ch119st2}, + {2,ch119st3} +}; + +static const GLUTStrokeChar ch119 = {104.7619f,4,ch119st}; + +/* char: 0x78 */ + +static const GLUTStrokeVertex ch120st0[] = +{ + {26.1905f,66.6667f}, + {78.5715f,0.0000f} +}; + +static const GLUTStrokeVertex ch120st1[] = +{ + {78.5715f,66.6667f}, + {26.1905f,0.0000f} +}; + +static const GLUTStrokeStrip ch120st[] = +{ + {2,ch120st0}, + {2,ch120st1} +}; + +static const GLUTStrokeChar ch120 = {104.7619f,2,ch120st}; + +/* char: 0x79 */ + +static const GLUTStrokeVertex ch121st0[] = +{ + {26.1905f,66.6667f}, + {54.7619f,0.0000f} +}; + +static const GLUTStrokeVertex ch121st1[] = +{ + {83.3334f,66.6667f}, + {54.7619f,0.0000f}, + {45.2381f,-19.0476f}, + {35.7143f,-28.5714f}, + {26.1905f,-33.3333f}, + {21.4286f,-33.3333f} +}; + +static const GLUTStrokeStrip ch121st[] = +{ + {2,ch121st0}, + {6,ch121st1} +}; + +static const GLUTStrokeChar ch121 = {104.7619f,2,ch121st}; + +/* char: 0x7a */ + +static const GLUTStrokeVertex ch122st0[] = +{ + {78.5715f,66.6667f}, + {26.1905f,0.0000f} +}; + +static const GLUTStrokeVertex ch122st1[] = +{ + {26.1905f,66.6667f}, + {78.5715f,66.6667f} +}; + +static const GLUTStrokeVertex ch122st2[] = +{ + {26.1905f,0.0000f}, + {78.5715f,0.0000f} +}; + +static const GLUTStrokeStrip ch122st[] = +{ + {2,ch122st0}, + {2,ch122st1}, + {2,ch122st2} +}; + +static const GLUTStrokeChar ch122 = {104.7619f,3,ch122st}; + +/* char: 0x7b */ + +static const GLUTStrokeVertex ch123st0[] = +{ + {64.2857f,119.0476f}, + {54.7619f,114.2857f}, + {50.0000f,109.5238f}, + {45.2381f,100.0000f}, + {45.2381f,90.4762f}, + {50.0000f,80.9524f}, + {54.7619f,76.1905f}, + {59.5238f,66.6667f}, + {59.5238f,57.1429f}, + {50.0000f,47.6190f} +}; + +static const GLUTStrokeVertex ch123st1[] = +{ + {54.7619f,114.2857f}, + {50.0000f,104.7619f}, + {50.0000f,95.2381f}, + {54.7619f,85.7143f}, + {59.5238f,80.9524f}, + {64.2857f,71.4286f}, + {64.2857f,61.9048f}, + {59.5238f,52.3810f}, + {40.4762f,42.8571f}, + {59.5238f,33.3333f}, + {64.2857f,23.8095f}, + {64.2857f,14.2857f}, + {59.5238f,4.7619f}, + {54.7619f,0.0000f}, + {50.0000f,-9.5238f}, + {50.0000f,-19.0476f}, + {54.7619f,-28.5714f} +}; + +static const GLUTStrokeVertex ch123st2[] = +{ + {50.0000f,38.0952f}, + {59.5238f,28.5714f}, + {59.5238f,19.0476f}, + {54.7619f,9.5238f}, + {50.0000f,4.7619f}, + {45.2381f,-4.7619f}, + {45.2381f,-14.2857f}, + {50.0000f,-23.8095f}, + {54.7619f,-28.5714f}, + {64.2857f,-33.3333f} +}; + +static const GLUTStrokeStrip ch123st[] = +{ + {10,ch123st0}, + {17,ch123st1}, + {10,ch123st2} +}; + +static const GLUTStrokeChar ch123 = {104.7619f,3,ch123st}; + +/* char: 0x7c */ + +static const GLUTStrokeVertex ch124st0[] = +{ + {52.3810f,119.0476f}, + {52.3810f,-33.3333f} +}; + +static const GLUTStrokeStrip ch124st[] = +{ + {2,ch124st0} +}; + +static const GLUTStrokeChar ch124 = {104.7619f,1,ch124st}; + +/* char: 0x7d */ + +static const GLUTStrokeVertex ch125st0[] = +{ + {40.4762f,119.0476f}, + {50.0000f,114.2857f}, + {54.7619f,109.5238f}, + {59.5238f,100.0000f}, + {59.5238f,90.4762f}, + {54.7619f,80.9524f}, + {50.0000f,76.1905f}, + {45.2381f,66.6667f}, + {45.2381f,57.1429f}, + {54.7619f,47.6190f} +}; + +static const GLUTStrokeVertex ch125st1[] = +{ + {50.0000f,114.2857f}, + {54.7619f,104.7619f}, + {54.7619f,95.2381f}, + {50.0000f,85.7143f}, + {45.2381f,80.9524f}, + {40.4762f,71.4286f}, + {40.4762f,61.9048f}, + {45.2381f,52.3810f}, + {64.2857f,42.8571f}, + {45.2381f,33.3333f}, + {40.4762f,23.8095f}, + {40.4762f,14.2857f}, + {45.2381f,4.7619f}, + {50.0000f,0.0000f}, + {54.7619f,-9.5238f}, + {54.7619f,-19.0476f}, + {50.0000f,-28.5714f} +}; + +static const GLUTStrokeVertex ch125st2[] = +{ + {54.7619f,38.0952f}, + {45.2381f,28.5714f}, + {45.2381f,19.0476f}, + {50.0000f,9.5238f}, + {54.7619f,4.7619f}, + {59.5238f,-4.7619f}, + {59.5238f,-14.2857f}, + {54.7619f,-23.8095f}, + {50.0000f,-28.5714f}, + {40.4762f,-33.3333f} +}; + +static const GLUTStrokeStrip ch125st[] = +{ + {10,ch125st0}, + {17,ch125st1}, + {10,ch125st2} +}; + +static const GLUTStrokeChar ch125 = {104.7619f,3,ch125st}; + +/* char: 0x7e */ + +static const GLUTStrokeVertex ch126st0[] = +{ + {9.5238f,28.5714f}, + {9.5238f,38.0952f}, + {14.2857f,52.3810f}, + {23.8095f,57.1429f}, + {33.3333f,57.1429f}, + {42.8571f,52.3810f}, + {61.9048f,38.0952f}, + {71.4286f,33.3333f}, + {80.9524f,33.3333f}, + {90.4762f,38.0952f}, + {95.2381f,47.6190f} +}; + +static const GLUTStrokeVertex ch126st1[] = +{ + {9.5238f,38.0952f}, + {14.2857f,47.6190f}, + {23.8095f,52.3810f}, + {33.3333f,52.3810f}, + {42.8571f,47.6190f}, + {61.9048f,33.3333f}, + {71.4286f,28.5714f}, + {80.9524f,28.5714f}, + {90.4762f,33.3333f}, + {95.2381f,47.6190f}, + {95.2381f,57.1429f} +}; + +static const GLUTStrokeStrip ch126st[] = +{ + {11,ch126st0}, + {11,ch126st1} +}; + +static const GLUTStrokeChar ch126 = {104.7619f,2,ch126st}; + +static const GLUTStrokeChar *chars[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126 +}; + +const GLUTStrokeFont glutStrokeMonoRoman = {"MonoRoman",128,chars,152.3809f,33.3333f}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/overlay.c xpsb-glx-0.19/mesa/src/glut/dos/overlay.c --- xpsb-glx-0.19/mesa/src/glut/dos/overlay.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/overlay.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,93 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +int APIENTRY +glutLayerGet (GLenum info) +{ + switch (info) { + case GLUT_OVERLAY_POSSIBLE: + case GLUT_HAS_OVERLAY: + return GL_FALSE; + case GLUT_LAYER_IN_USE: + return GLUT_NORMAL; + case GLUT_NORMAL_DAMAGED: + return GL_FALSE; + case GLUT_OVERLAY_DAMAGED: + case GLUT_TRANSPARENT_INDEX: + default: + return -1; + } +} + + +void APIENTRY +glutOverlayDisplayFunc (GLUTdisplayCB func) +{ +} + + +void APIENTRY +glutEstablishOverlay (void) +{ +} + + +void APIENTRY +glutRemoveOverlay (void) +{ +} + + +void APIENTRY +glutUseLayer (GLenum layer) +{ +} + + +void APIENTRY +glutPostOverlayRedisplay (void) +{ +} + + +void APIENTRY +glutShowOverlay (void) +{ +} + + +void APIENTRY +glutHideOverlay (void) +{ +} + + +void APIENTRY +glutPostWindowOverlayRedisplay (int win) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.c xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.c --- xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,163 @@ +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include /* for mode definitions */ +#include +#include +#include + +#include "pc_hw.h" + + +/* + * atexit + */ +#define MAX_ATEXIT 32 + +static volatile int atexitcnt; +static VFUNC atexittbl[MAX_ATEXIT]; + + +static void __attribute__((destructor)) +doexit (void) +{ + while (atexitcnt) atexittbl[--atexitcnt](); +} + + +int +pc_clexit (VFUNC f) +{ + int i; + + for (i = 0; i < atexitcnt; i++) { + if (atexittbl[i] == f) { + for (atexitcnt--; i < atexitcnt; i++) atexittbl[i] = atexittbl[i+1]; + atexittbl[i] = 0; + return 0; + } + } + return -1; +} + + +int +pc_atexit (VFUNC f) +{ + pc_clexit(f); + if (atexitcnt < MAX_ATEXIT) { + atexittbl[atexitcnt++] = f; + return 0; + } + return -1; +} + + +/* + * locked memory allocation + */ +void * +pc_malloc (size_t size) +{ + void *p = malloc(size); + + if (p) { + if (_go32_dpmi_lock_data(p, size)) { + free(p); + return NULL; + } + } + + return p; +} + + +/* + * standard redirection + */ +static char outname[L_tmpnam]; +static int h_out, h_outbak; +static char errname[L_tmpnam]; +static int h_err, h_errbak; + + +int +pc_open_stdout (void) +{ + tmpnam(outname); + + if ((h_out=open(outname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { + h_outbak = dup(STDOUT_FILENO); + fflush(stdout); + dup2(h_out, STDOUT_FILENO); + } + + return h_out; +} + + +void +pc_close_stdout (void) +{ + FILE *f; + char *line = alloca(512); + + if (h_out > 0) { + dup2(h_outbak, STDOUT_FILENO); + close(h_out); + close(h_outbak); + + f = fopen(outname, "rt"); + while (fgets(line, 512, f)) { + fputs(line, stdout); + } + fclose(f); + + remove(outname); + } +} + + +int +pc_open_stderr (void) +{ + tmpnam(errname); + + if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { + h_errbak = dup(STDERR_FILENO); + fflush(stderr); + dup2(h_err, STDERR_FILENO); + } + + return h_err; +} + + +void +pc_close_stderr (void) +{ + FILE *f; + char *line = alloca(512); + + if (h_err > 0) { + dup2(h_errbak, STDERR_FILENO); + close(h_err); + close(h_errbak); + + f = fopen(errname, "rt"); + while (fgets(line, 512, f)) { + fputs(line, stderr); + } + fclose(f); + + remove(errname); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.h xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.h --- xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_hw.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,229 @@ +/* + * PC/HW routine collection v1.4 for DOS/DJGPP + * + * Copyright (C) 2002 - Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef PC_HW_H_included +#define PC_HW_H_included + +#include +#include + +/* + * misc C definitions + */ +#define FALSE 0 +#define TRUE !FALSE + +#define SQR(x) ((x) * (x)) + +#define MIN(x,y) (((x) < (y)) ? (x) : (y)) +#define MAX(x,y) (((x) > (y)) ? (x) : (y)) +#define MID(x,y,z) MAX((x), MIN((y), (z))) + +typedef void (*VFUNC) (void); +typedef void (*PFUNC) (void *); +typedef void (*MFUNC) (int x, int y, int z, int b); + +/* + * atexit + */ +int pc_atexit (VFUNC f); +int pc_clexit (VFUNC f); + +/* + * locked memory + */ +#define ENDOFUNC(x) static void x##_end() { } +#define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x) +#define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x)) +#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l) + +void *pc_malloc (size_t size); + +/* + * IRQ + */ +#define ENABLE() __asm __volatile ("sti") +#define DISABLE() __asm __volatile ("cli") + +extern int pc_install_irq (int i, int (*handler) ()); +extern int pc_remove_irq (int i); + +/* + * keyboard + */ +#define KB_SHIFT_FLAG 0x0001 +#define KB_CTRL_FLAG 0x0002 +#define KB_ALT_FLAG 0x0004 +#define KB_LWIN_FLAG 0x0008 +#define KB_RWIN_FLAG 0x0010 +#define KB_MENU_FLAG 0x0020 +#define KB_SCROLOCK_FLAG 0x0100 +#define KB_NUMLOCK_FLAG 0x0200 +#define KB_CAPSLOCK_FLAG 0x0400 +#define KB_INALTSEQ_FLAG 0x0800 +#define KB_ACCENT1_FLAG 0x1000 +#define KB_ACCENT2_FLAG 0x2000 +#define KB_ACCENT3_FLAG 0x4000 +#define KB_ACCENT4_FLAG 0x8000 + +#define KEY_A 1 +#define KEY_B 2 +#define KEY_C 3 +#define KEY_D 4 +#define KEY_E 5 +#define KEY_F 6 +#define KEY_G 7 +#define KEY_H 8 +#define KEY_I 9 +#define KEY_J 10 +#define KEY_K 11 +#define KEY_L 12 +#define KEY_M 13 +#define KEY_N 14 +#define KEY_O 15 +#define KEY_P 16 +#define KEY_Q 17 +#define KEY_R 18 +#define KEY_S 19 +#define KEY_T 20 +#define KEY_U 21 +#define KEY_V 22 +#define KEY_W 23 +#define KEY_X 24 +#define KEY_Y 25 +#define KEY_Z 26 +#define KEY_0 27 +#define KEY_1 28 +#define KEY_2 29 +#define KEY_3 30 +#define KEY_4 31 +#define KEY_5 32 +#define KEY_6 33 +#define KEY_7 34 +#define KEY_8 35 +#define KEY_9 36 +#define KEY_0_PAD 37 +#define KEY_1_PAD 38 +#define KEY_2_PAD 39 +#define KEY_3_PAD 40 +#define KEY_4_PAD 41 +#define KEY_5_PAD 42 +#define KEY_6_PAD 43 +#define KEY_7_PAD 44 +#define KEY_8_PAD 45 +#define KEY_9_PAD 46 +#define KEY_F1 47 +#define KEY_F2 48 +#define KEY_F3 49 +#define KEY_F4 50 +#define KEY_F5 51 +#define KEY_F6 52 +#define KEY_F7 53 +#define KEY_F8 54 +#define KEY_F9 55 +#define KEY_F10 56 +#define KEY_F11 57 +#define KEY_F12 58 +#define KEY_ESC 59 +#define KEY_TILDE 60 +#define KEY_MINUS 61 +#define KEY_EQUALS 62 +#define KEY_BACKSPACE 63 +#define KEY_TAB 64 +#define KEY_OPENBRACE 65 +#define KEY_CLOSEBRACE 66 +#define KEY_ENTER 67 +#define KEY_COLON 68 +#define KEY_QUOTE 69 +#define KEY_BACKSLASH 70 +#define KEY_BACKSLASH2 71 +#define KEY_COMMA 72 +#define KEY_STOP 73 +#define KEY_SLASH 74 +#define KEY_SPACE 75 +#define KEY_INSERT 76 +#define KEY_DEL 77 +#define KEY_HOME 78 +#define KEY_END 79 +#define KEY_PGUP 80 +#define KEY_PGDN 81 +#define KEY_LEFT 82 +#define KEY_RIGHT 83 +#define KEY_UP 84 +#define KEY_DOWN 85 +#define KEY_SLASH_PAD 86 +#define KEY_ASTERISK 87 +#define KEY_MINUS_PAD 88 +#define KEY_PLUS_PAD 89 +#define KEY_DEL_PAD 90 +#define KEY_ENTER_PAD 91 +#define KEY_PRTSCR 92 +#define KEY_PAUSE 93 +#define KEY_ABNT_C1 94 +#define KEY_YEN 95 +#define KEY_KANA 96 +#define KEY_CONVERT 97 +#define KEY_NOCONVERT 98 +#define KEY_AT 99 +#define KEY_CIRCUMFLEX 100 +#define KEY_COLON2 101 +#define KEY_KANJI 102 + +#define KEY_MODIFIERS 103 + +#define KEY_LSHIFT 103 +#define KEY_RSHIFT 104 +#define KEY_LCONTROL 105 +#define KEY_RCONTROL 106 +#define KEY_ALT 107 +#define KEY_ALTGR 108 +#define KEY_LWIN 109 +#define KEY_RWIN 110 +#define KEY_MENU 111 +#define KEY_SCRLOCK 112 +#define KEY_NUMLOCK 113 +#define KEY_CAPSLOCK 114 + +#define KEY_MAX 115 + +int pc_install_keyb (void); +void pc_remove_keyb (void); +int pc_keypressed (void); +int pc_readkey (void); +int pc_keydown (int code); +int pc_keyshifts (void); + +/* + * timer + */ +int pc_install_int (PFUNC func, void *parm, unsigned int freq); +int pc_remove_int (int fid); +int pc_adjust_int (int fid, unsigned int freq); +void pc_remove_timer (void); + +/* + * mouse + */ +int pc_install_mouse (void); +void pc_remove_mouse (void); +MFUNC pc_install_mouse_handler (MFUNC handler); +void pc_mouse_area (int x1, int y1, int x2, int y2); +void pc_mouse_speed (int xspeed, int yspeed); +int pc_query_mouse (int *x, int *y, int *z); +void pc_warp_mouse (int x, int y); + +/* + * standard redirection + */ +int pc_open_stdout (void); +int pc_open_stderr (void); +void pc_close_stdout (void); +void pc_close_stderr (void); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_irq.S xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_irq.S --- xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_irq.S 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_irq.S 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,182 @@ +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + + .file "pc_irq.S" + + .text + +#define IRQ_STACK_SIZE 16384 + +#define IRQ_WRAPPER_LEN (__irq_wrapper_1-__irq_wrapper_0) +#define IRQ_OLD (__irq_old_0-__irq_wrapper_0) +#define IRQ_HOOK (__irq_hook_0-__irq_wrapper_0) +#define IRQ_STACK (__irq_stack_0-__irq_wrapper_0) + + .balign 4 +common: + movw $0x0400, %ax + int $0x31 + + movl %ss:8(%ebp), %ebx + cmpl $15, %ebx + jbe 0f + fail: + orl $-1, %eax + popl %edi + popl %ebx + leave + ret + + 0: + movl %ebx, %edi + imull $IRQ_WRAPPER_LEN, %edi + addl $__irq_wrapper_0, %edi + + cmpb $7, %bl + jbe 1f + movb %dl, %dh + subb $8, %dh + 1: + addb %dh, %bl + ret + + .balign 4 + .global _pc_install_irq +_pc_install_irq: + pushl %ebp + movl %esp, %ebp + pushl %ebx + pushl %edi + + call common + + cmpl $0, IRQ_HOOK(%edi) + jne fail + + pushl $IRQ_WRAPPER_LEN + pushl %edi + call __go32_dpmi_lock_code + addl $8, %esp + testl %eax, %eax + jnz fail + + pushl $IRQ_STACK_SIZE + call _pc_malloc + popl %edx + testl %eax, %eax + jz fail + addl %edx, %eax + movl %eax, IRQ_STACK(%edi) + + movl ___djgpp_ds_alias, %eax + movl %eax, IRQ_STACK+4(%edi) + + movl %ss:12(%ebp), %eax + movl %eax, IRQ_HOOK(%edi) + + movw $0x0204, %ax + int $0x31 + movl %edx, IRQ_OLD(%edi) + movw %cx, IRQ_OLD+4(%edi) + movw $0x0205, %ax + movl %edi, %edx + movl %cs, %ecx + int $0x31 + + done: + xorl %eax, %eax + popl %edi + popl %ebx + leave + ret + + .balign 4 + .global _pc_remove_irq +_pc_remove_irq: + pushl %ebp + movl %esp, %ebp + pushl %ebx + pushl %edi + + call common + + cmpl $0, IRQ_HOOK(%edi) + je fail + + movl $0, IRQ_HOOK(%edi) + + movw $0x0205, %ax + movl IRQ_OLD(%edi), %edx + movl IRQ_OLD+4(%edi), %ecx + int $0x31 + + movl IRQ_STACK(%edi), %eax + subl $IRQ_STACK_SIZE, %eax + pushl %eax + call _free + popl %eax + + jmp done + +#define WRAPPER(x) ; \ + .balign 4 ; \ +__irq_wrapper_##x: ; \ + pushal ; \ + pushl %ds ; \ + pushl %es ; \ + pushl %fs ; \ + pushl %gs ; \ + movl %ss, %ebx ; \ + movl %esp, %esi ; \ + lss %cs:__irq_stack_##x, %esp ; \ + pushl %ss ; \ + pushl %ss ; \ + popl %es ; \ + popl %ds ; \ + movl ___djgpp_dos_sel, %fs ; \ + pushl %fs ; \ + popl %gs ; \ + call *__irq_hook_##x ; \ + movl %ebx, %ss ; \ + movl %esi, %esp ; \ + testl %eax, %eax ; \ + popl %gs ; \ + popl %fs ; \ + popl %es ; \ + popl %ds ; \ + popal ; \ + jz __irq_ignore_##x ; \ +__irq_bypass_##x: ; \ + ljmp *%cs:__irq_old_##x ; \ +__irq_ignore_##x: ; \ + iret ; \ + .balign 4 ; \ +__irq_old_##x: ; \ + .long 0, 0 ; \ +__irq_hook_##x: ; \ + .long 0 ; \ +__irq_stack_##x: ; \ + .long 0, 0 + + WRAPPER(0); + WRAPPER(1); + WRAPPER(2); + WRAPPER(3); + WRAPPER(4); + WRAPPER(5); + WRAPPER(6); + WRAPPER(7); + WRAPPER(8); + WRAPPER(9); + WRAPPER(10); + WRAPPER(11); + WRAPPER(12); + WRAPPER(13); + WRAPPER(14); + WRAPPER(15); diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_keyb.c xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_keyb.c --- xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_keyb.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_keyb.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,540 @@ +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include + +#include "pc_hw.h" + + +#define KEYB_IRQ 1 + +#define KEY_BUFFER_SIZE 64 + +#define KB_MODIFIERS (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG | KB_LWIN_FLAG | KB_RWIN_FLAG | KB_MENU_FLAG) +#define KB_LED_FLAGS (KB_SCROLOCK_FLAG | KB_NUMLOCK_FLAG | KB_CAPSLOCK_FLAG) + +static int keyboard_installed; + +static volatile struct { + volatile int start, end; + volatile int key[KEY_BUFFER_SIZE]; +} key_buffer; + +static volatile int key_enhanced, key_pause_loop, key_shifts; +static int leds_ok = TRUE; +static int in_a_terrupt = FALSE; +static volatile char pc_key[KEY_MAX]; + + +/* convert Allegro format scancodes into key_shifts flag bits */ +static unsigned short modifier_table[KEY_MAX - KEY_MODIFIERS] = { + KB_SHIFT_FLAG, KB_SHIFT_FLAG, KB_CTRL_FLAG, + KB_CTRL_FLAG, KB_ALT_FLAG, KB_ALT_FLAG, + KB_LWIN_FLAG, KB_RWIN_FLAG, KB_MENU_FLAG, + KB_SCROLOCK_FLAG, KB_NUMLOCK_FLAG, KB_CAPSLOCK_FLAG +}; + + +/* lookup table for converting hardware scancodes into Allegro format */ +static unsigned char hw_to_mycode[128] = { + /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, + /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, + /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, + /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, + /* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R, + /* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I, + /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, + /* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S, + /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, + /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, + /* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH, + /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, + /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, + /* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK, + /* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, + /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, + /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, + /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD, + /* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD, + /* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD, + /* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD, + /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, + /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, + /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, + /* 0x60 */ 0, 0, 0, 0, + /* 0x64 */ 0, 0, 0, 0, + /* 0x68 */ 0, 0, 0, 0, + /* 0x6C */ 0, 0, 0, 0, + /* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1, + /* 0x74 */ 0, 0, 0, 0, + /* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT, + /* 0x7C */ 0, KEY_YEN, 0, 0 +}; + + +/* lookup table for converting extended hardware codes into Allegro format */ +static unsigned char hw_to_mycode_ex[128] = { + /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, + /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, + /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, + /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, + /* 0x10 */ KEY_CIRCUMFLEX, KEY_AT, KEY_COLON2, KEY_R, + /* 0x14 */ KEY_KANJI, KEY_Y, KEY_U, KEY_I, + /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, + /* 0x1C */ KEY_ENTER_PAD, KEY_RCONTROL, KEY_A, KEY_S, + /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, + /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, + /* 0x28 */ KEY_QUOTE, KEY_TILDE, 0, KEY_BACKSLASH, + /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, + /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, + /* 0x34 */ KEY_STOP, KEY_SLASH_PAD, 0, KEY_PRTSCR, + /* 0x38 */ KEY_ALTGR, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, + /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, + /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, + /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_PAUSE, KEY_HOME, + /* 0x48 */ KEY_UP, KEY_PGUP, KEY_MINUS_PAD, KEY_LEFT, + /* 0x4C */ KEY_5_PAD, KEY_RIGHT, KEY_PLUS_PAD, KEY_END, + /* 0x50 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL, + /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, + /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, + /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, + /* 0x60 */ 0, 0, 0, 0, + /* 0x64 */ 0, 0, 0, 0, + /* 0x68 */ 0, 0, 0, 0, + /* 0x6C */ 0, 0, 0, 0, + /* 0x70 */ 0, 0, 0, 0, + /* 0x74 */ 0, 0, 0, 0, + /* 0x78 */ 0, 0, 0, 0, + /* 0x7C */ 0, 0, 0, 0 +}; + + +/* default mapping table for the US keyboard layout */ +static unsigned short standard_key_ascii_table[KEY_MAX] = { + /* start */ 0, + /* alphabet */ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ '/', '*', '-', '+', '.', 13, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + +/* capslock mapping table for the US keyboard layout */ +static unsigned short standard_key_capslock_table[KEY_MAX] = { + /* start */ 0, + /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ '/', '*', '-', '+', '.', 13, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + +/* shifted mapping table for the US keyboard layout */ +static unsigned short standard_key_shift_table[KEY_MAX] = { + /* start */ 0, + /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + /* numbers */ ')', '!', '@', '#', '$', '%', '^', '&', '*', '(', + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, '~', '_', '+', 8, 9, '{', '}', 13, ':', '"', '|', '|', '<', '>', '?', ' ', + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ '/', '*', '-', '+', '.', 13, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + +/* ctrl+key mapping table for the US keyboard layout */ +static unsigned short standard_key_control_table[KEY_MAX] = { + /* start */ 0, + /* alphabet */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + /* numbers */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, 2, 2, 2, 127, 127, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ 2, 2, 2, 2, 2, 10, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + +/* convert numeric pad scancodes into arrow codes */ +static unsigned char numlock_table[10] = { + KEY_INSERT, KEY_END, KEY_DOWN, KEY_PGDN, KEY_LEFT, + KEY_5_PAD, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PGUP +}; + + +/* kb_wait_for_write_ready: + * Wait for the keyboard controller to set the ready-for-write bit. + */ +static __inline int +kb_wait_for_write_ready (void) +{ + int timeout = 4096; + + while ((timeout > 0) && (inportb(0x64) & 2)) timeout--; + + return (timeout > 0); +} + + +/* kb_wait_for_read_ready: + * Wait for the keyboard controller to set the ready-for-read bit. + */ +static __inline int +kb_wait_for_read_ready (void) +{ + int timeout = 16384; + + while ((timeout > 0) && (!(inportb(0x64) & 1))) timeout--; + + return (timeout > 0); +} + + +/* kb_send_data: + * Sends a byte to the keyboard controller. Returns 1 if all OK. + */ +static __inline int +kb_send_data (unsigned char data) +{ + int resends = 4; + int timeout, temp; + + do { + if (!kb_wait_for_write_ready()) + return 0; + + outportb(0x60, data); + timeout = 4096; + + while (--timeout > 0) { + if (!kb_wait_for_read_ready()) + return 0; + + temp = inportb(0x60); + + if (temp == 0xFA) + return 1; + + if (temp == 0xFE) + break; + } + } while ((resends-- > 0) && (timeout > 0)); + + return 0; +} + + +static void +update_leds (int leds) +{ + if (leds_ok) { + if (!in_a_terrupt) + DISABLE(); + + if (!kb_send_data(0xED)) { + kb_send_data(0xF4); + leds_ok = FALSE; + } else if (!kb_send_data((leds >> 8) & 7)) { + kb_send_data(0xF4); + leds_ok = FALSE; + } + + if (!in_a_terrupt) + ENABLE(); + } +} ENDOFUNC(update_leds) + + +static void +inject_key (int scancode) +{ + unsigned short *table; + + if ((scancode >= KEY_0_PAD) && (scancode <= KEY_9_PAD)) { + if (((key_shifts & KB_NUMLOCK_FLAG) != 0) == ((key_shifts & KB_SHIFT_FLAG) != 0)) { + scancode = numlock_table[scancode - KEY_0_PAD]; + } + table = standard_key_ascii_table; + } else if (key_shifts & KB_CTRL_FLAG) { + table = standard_key_control_table; + } else if (key_shifts & KB_SHIFT_FLAG) { + if (key_shifts & KB_CAPSLOCK_FLAG) { + if (standard_key_ascii_table[scancode] == standard_key_capslock_table[scancode]) { + table = standard_key_shift_table; + } else { + table = standard_key_ascii_table; + } + } else { + table = standard_key_shift_table; + } + } else if (key_shifts & KB_CAPSLOCK_FLAG) { + table = standard_key_capslock_table; + } else { + table = standard_key_ascii_table; + } + + key_buffer.key[key_buffer.end++] = (scancode << 16) | table[scancode]; + + if (key_buffer.end >= KEY_BUFFER_SIZE) + key_buffer.end = 0; + if (key_buffer.end == key_buffer.start) { + key_buffer.start++; + if (key_buffer.start >= KEY_BUFFER_SIZE) + key_buffer.start = 0; + } +} ENDOFUNC(inject_key) + + +static void +handle_code (int scancode, int keycode) +{ + in_a_terrupt++; + + if (keycode == 0) { /* pause */ + inject_key(scancode); + pc_key[KEY_PAUSE] ^= TRUE; + } else if (scancode) { + int flag; + + if (scancode >= KEY_MODIFIERS) { + flag = modifier_table[scancode - KEY_MODIFIERS]; + } else { + flag = 0; + } + if ((char)keycode < 0) { /* release */ + pc_key[scancode] = FALSE; + if (flag & KB_MODIFIERS) { + key_shifts &= ~flag; + } + } else { /* keypress */ + pc_key[scancode] = TRUE; + if (flag & KB_MODIFIERS) { + key_shifts |= flag; + } + if (flag & KB_LED_FLAGS) { + key_shifts ^= flag; + update_leds(key_shifts); + } + if (scancode < KEY_MODIFIERS) { + inject_key(scancode); + } + } + } + + in_a_terrupt--; +} ENDOFUNC(handle_code) + + +static int +keyboard () +{ + unsigned char temp, scancode; + + temp = inportb(0x60); + + if (temp <= 0xe1) { + if (key_pause_loop) { + if (!--key_pause_loop) handle_code(KEY_PAUSE, 0); + } else + switch (temp) { + case 0xe0: + key_enhanced = TRUE; + break; + case 0xe1: + key_pause_loop = 5; + break; + default: + if (key_enhanced) { + key_enhanced = FALSE; + scancode = hw_to_mycode_ex[temp & 0x7f]; + } else { + scancode = hw_to_mycode[temp & 0x7f]; + } + handle_code(scancode, temp); + } + } + + if (((temp==0x4F)||(temp==0x53))&&(key_shifts&KB_CTRL_FLAG)&&(key_shifts&KB_ALT_FLAG)) { + /* Hack alert: + * only SIGINT (but not Ctrl-Break) + * calls the destructors and will safely clean up + */ + __asm("\n\ + movb $0x79, %%al \n\ + call ___djgpp_hw_exception \n\ + ":::"%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); + } + + __asm("\n\ + inb $0x61, %%al \n\ + movb %%al, %%ah \n\ + orb $0x80, %%al \n\ + outb %%al, $0x61 \n\ + xchgb %%al, %%ah \n\ + outb %%al, $0x61 \n\ + movb $0x20, %%al \n\ + outb %%al, $0x20 \n\ + ":::"%eax"); + return 0; +} ENDOFUNC(keyboard) + + +int +pc_keypressed (void) +{ + return (key_buffer.start!=key_buffer.end); +} + + +int +pc_readkey (void) +{ + if (keyboard_installed) { + int key; + + while (key_buffer.start == key_buffer.end) { + __dpmi_yield(); + } + + DISABLE(); + key = key_buffer.key[key_buffer.start++]; + if (key_buffer.start >= KEY_BUFFER_SIZE) + key_buffer.start = 0; + ENABLE(); + + return key; + } else { + return 0; + } +} + + +int +pc_keydown (int code) +{ + return pc_key[code]; +} + + +int +pc_keyshifts (void) +{ + return key_shifts; +} + + +void +pc_remove_keyb (void) +{ + if (keyboard_installed) { + int s1, s2, s3; + + keyboard_installed = FALSE; + pc_clexit(pc_remove_keyb); + + DISABLE(); + _farsetsel(__djgpp_dos_sel); + _farnspokew(0x41c, _farnspeekw(0x41a)); + + s1 = _farnspeekb(0x417) & 0x80; + s2 = _farnspeekb(0x418) & 0xFC; + s3 = _farnspeekb(0x496) & 0xF3; + + if (pc_key[KEY_RSHIFT]) { s1 |= 1; } + if (pc_key[KEY_LSHIFT]) { s1 |= 2; } + if (pc_key[KEY_LCONTROL]) { s2 |= 1; s1 |= 4; } + if (pc_key[KEY_ALT]) { s1 |= 8; s2 |= 2; } + if (pc_key[KEY_RCONTROL]) { s1 |= 4; s3 |= 4; } + if (pc_key[KEY_ALTGR]) { s1 |= 8; s3 |= 8; } + + if (key_shifts & KB_SCROLOCK_FLAG) s1 |= 16; + if (key_shifts & KB_NUMLOCK_FLAG) s1 |= 32; + if (key_shifts & KB_CAPSLOCK_FLAG) s1 |= 64; + + _farnspokeb(0x417, s1); + _farnspokeb(0x418, s2); + _farnspokeb(0x496, s3); + update_leds(key_shifts); + + ENABLE(); + pc_remove_irq(KEYB_IRQ); + } +} + + +int +pc_install_keyb (void) +{ + if (keyboard_installed || pc_install_irq(KEYB_IRQ, keyboard)) { + return -1; + } else { + int s1, s2, s3; + + LOCKDATA(key_buffer); + LOCKDATA(key_enhanced); + LOCKDATA(key_pause_loop); + LOCKDATA(key_shifts); + LOCKDATA(leds_ok); + LOCKDATA(in_a_terrupt); + LOCKDATA(pc_key); + LOCKDATA(modifier_table); + LOCKDATA(hw_to_mycode); + LOCKDATA(hw_to_mycode_ex); + LOCKDATA(standard_key_ascii_table); + LOCKDATA(standard_key_capslock_table); + LOCKDATA(standard_key_shift_table); + LOCKDATA(standard_key_control_table); + LOCKDATA(numlock_table); + LOCKFUNC(update_leds); + LOCKFUNC(inject_key); + LOCKFUNC(handle_code); + LOCKFUNC(keyboard); + + DISABLE(); + _farsetsel(__djgpp_dos_sel); + _farnspokew(0x41c, _farnspeekw(0x41a)); + + key_shifts = 0; + s1 = _farnspeekb(0x417); + s2 = _farnspeekb(0x418); + s3 = _farnspeekb(0x496); + + if (s1 & 1) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_RSHIFT] = TRUE; } + if (s1 & 2) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_LSHIFT] = TRUE; } + if (s2 & 1) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_LCONTROL] = TRUE; } + if (s2 & 2) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALT] = TRUE; } + if (s3 & 4) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_RCONTROL] = TRUE; } + if (s3 & 8) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALTGR] = TRUE; } + + if (s1 & 16) key_shifts |= KB_SCROLOCK_FLAG; + if (s1 & 32) key_shifts |= KB_NUMLOCK_FLAG; + if (s1 & 64) key_shifts |= KB_CAPSLOCK_FLAG; + update_leds(key_shifts); + + key_enhanced = key_pause_loop = 0; + key_buffer.start = key_buffer.end = 0; + ENABLE(); + + pc_atexit(pc_remove_keyb); + keyboard_installed = TRUE; + return 0; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_mouse.c xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_mouse.c --- xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_mouse.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_mouse.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,293 @@ +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include + +#include "pc_hw.h" + + +#define PC_CUTE_WHEEL 1 /* CuteMouse WheelAPI */ + +#define MOUSE_STACK_SIZE 16384 + +#define CLEAR_MICKEYS() \ + do { \ + __asm __volatile ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \ + ox = oy = 0; \ + } while (0) + +extern void mouse_wrap (void); +extern int mouse_wrap_end[]; + +static MFUNC mouse_func; +static long mouse_callback; +static __dpmi_regs mouse_regs; + +static volatile struct { + volatile int x, y, z, b; +} pc_mouse; + +static int minx = 0; +static int maxx = 319; +static int miny = 0; +static int maxy = 199; +static int minz = 0; +static int maxz = 255; + +static int sx = 2; +static int sy = 2; + +static int emulat3 = FALSE; + +static int ox, oy; + + +static void +mouse (__dpmi_regs *r) +{ + int nx = (signed short)r->x.si / sx; + int ny = (signed short)r->x.di / sy; + int dx = nx - ox; + int dy = ny - oy; +#if PC_CUTE_WHEEL + int dz = (signed char)r->h.bh; +#endif + ox = nx; + oy = ny; + + pc_mouse.b = r->h.bl; + pc_mouse.x = MID(minx, pc_mouse.x + dx, maxx); + pc_mouse.y = MID(miny, pc_mouse.y + dy, maxy); +#if PC_CUTE_WHEEL + pc_mouse.z = MID(minz, pc_mouse.z + dz, maxz); +#endif + + if (emulat3) { + if ((pc_mouse.b & 3) == 3) { + pc_mouse.b = 4; + } + } + + if (mouse_func) { + mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); + } +} ENDOFUNC(mouse) + + +void +pc_remove_mouse (void) +{ + if (mouse_callback) { + pc_clexit(pc_remove_mouse); + __asm("\n\ + movl %%edx, %%ecx \n\ + shrl $16, %%ecx \n\ + movw $0x0304, %%ax \n\ + int $0x31 \n\ + movw $0x000c, %%ax \n\ + xorl %%ecx, %%ecx \n\ + int $0x33 \n\ + "::"d"(mouse_callback):"%eax", "%ecx"); + + mouse_callback = 0; + + free((void *)(mouse_wrap_end[0] - MOUSE_STACK_SIZE)); + } +} + + +int +pc_install_mouse (void) +{ + int buttons; + + /* fail if already call-backed */ + if (mouse_callback) { + return 0; + } + + /* reset mouse and get status */ + __asm("\n\ + xorl %%eax, %%eax \n\ + int $0x33 \n\ + andl %%ebx, %%eax \n\ + movl %%eax, %0 \n\ + ":"=g" (buttons)::"%eax", "%ebx"); + if (!buttons) { + return 0; + } + + /* lock wrapper */ + LOCKDATA(mouse_func); + LOCKDATA(mouse_callback); + LOCKDATA(mouse_regs); + LOCKDATA(pc_mouse); + LOCKDATA(minx); + LOCKDATA(maxx); + LOCKDATA(miny); + LOCKDATA(maxy); + LOCKDATA(minz); + LOCKDATA(maxz); + LOCKDATA(sx); + LOCKDATA(sy); + LOCKDATA(emulat3); + LOCKDATA(ox); + LOCKDATA(oy); + LOCKFUNC(mouse); + LOCKFUNC(mouse_wrap); + + mouse_wrap_end[1] = __djgpp_ds_alias; + /* grab a locked stack */ + if ((mouse_wrap_end[0] = (int)pc_malloc(MOUSE_STACK_SIZE)) == NULL) { + return 0; + } + + /* try to hook a call-back */ + __asm("\n\ + pushl %%ds \n\ + pushl %%es \n\ + movw $0x0303, %%ax \n\ + pushl %%ds \n\ + pushl %%cs \n\ + popl %%ds \n\ + popl %%es \n\ + int $0x31 \n\ + popl %%es \n\ + popl %%ds \n\ + jc 0f \n\ + shll $16, %%ecx \n\ + movw %%dx, %%cx \n\ + movl %%ecx, %0 \n\ + 0: \n\ + ":"=g"(mouse_callback) + :"S" (mouse_wrap), "D"(&mouse_regs) + :"%eax", "%ecx", "%edx"); + if (!mouse_callback) { + free((void *)mouse_wrap_end[0]); + return 0; + } + + /* adjust stack */ + mouse_wrap_end[0] += MOUSE_STACK_SIZE; + + /* install the handler */ + mouse_regs.x.ax = 0x000c; +#if PC_CUTE_WHEEL + mouse_regs.x.cx = 0x7f | 0x80; +#else + mouse_regs.x.cx = 0x7f; +#endif + mouse_regs.x.dx = mouse_callback & 0xffff; + mouse_regs.x.es = mouse_callback >> 16; + __dpmi_int(0x33, &mouse_regs); + + CLEAR_MICKEYS(); + + emulat3 = (buttons < 3); + pc_atexit(pc_remove_mouse); + return buttons; +} + + +MFUNC +pc_install_mouse_handler (MFUNC handler) +{ + MFUNC old; + + if (!mouse_callback && !pc_install_mouse()) { + return NULL; + } + + old = mouse_func; + mouse_func = handler; + return old; +} + + +void +pc_mouse_area (int x1, int y1, int x2, int y2) +{ + minx = x1; + maxx = x2; + miny = y1; + maxy = y2; +} + + +void +pc_mouse_speed (int xspeed, int yspeed) +{ + DISABLE(); + + sx = MAX(1, xspeed); + sy = MAX(1, yspeed); + + ENABLE(); +} + + +int +pc_query_mouse (int *x, int *y, int *z) +{ + *x = pc_mouse.x; + *y = pc_mouse.y; + *z = pc_mouse.z; + return pc_mouse.b; +} + + +void +pc_warp_mouse (int x, int y) +{ + CLEAR_MICKEYS(); + + pc_mouse.x = MID(minx, x, maxx); + pc_mouse.y = MID(miny, y, maxy); + + if (mouse_func) { + mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); + } +} + + +/* Hack alert: + * `mouse_wrap_end' actually holds the + * address of stack in a safe data selector. + */ +__asm("\n\ + .text \n\ + .p2align 5,,31 \n\ + .global _mouse_wrap \n\ +_mouse_wrap: \n\ + cld \n\ + lodsl \n\ + movl %eax, %es:42(%edi) \n\ + addw $4, %es:46(%edi) \n\ + pushl %es \n\ + movl %ss, %ebx \n\ + movl %esp, %esi \n\ + lss %cs:_mouse_wrap_end, %esp\n\ + pushl %ss \n\ + pushl %ss \n\ + popl %es \n\ + popl %ds \n\ + movl ___djgpp_dos_sel, %fs \n\ + pushl %fs \n\ + popl %gs \n\ + pushl %edi \n\ + call _mouse \n\ + popl %edi \n\ + movl %ebx, %ss \n\ + movl %esi, %esp \n\ + popl %es \n\ + iret \n\ + .global _mouse_wrap_end \n\ +_mouse_wrap_end:.long 0, 0"); diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_timer.c xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_timer.c --- xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_timer.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/PC_HW/pc_timer.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,327 @@ +/* + * PC/HW routine collection v1.5 for DOS/DJGPP + * + * Copyright (C) 2002 - Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include + +#include "pc_hw.h" + +#define TIMER_IRQ 0 + +#define MAX_TIMERS 8 + +#define PIT_FREQ 0x1234DD + +#define ADJUST(timer, basefreq) timer.counter = PIT_FREQ * timer.freq / SQR(basefreq) + +#define unvolatile(__v, __t) __extension__ ({union { volatile __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;}) + +static int timer_installed; + +typedef struct { + volatile unsigned int counter, clock_ticks, freq; + volatile PFUNC func; + volatile void *parm; +} TIMER; + +static TIMER timer_main, timer_func[MAX_TIMERS]; + + +/* Desc: main timer callback + * + * In : - + * Out : 0 to bypass BIOS, 1 to chain to BIOS + * + * Note: - + */ +static int +timer () +{ + int i; + + for (i = 0; i < MAX_TIMERS; i++) { + TIMER *t = &timer_func[i]; + if (t->func) { + t->clock_ticks += t->counter; + if (t->clock_ticks >= timer_main.counter) { + t->clock_ticks -= timer_main.counter; + t->func(unvolatile(t->parm, void *)); + } + } + } + + timer_main.clock_ticks += timer_main.counter; + if (timer_main.clock_ticks >= 0x10000) { + timer_main.clock_ticks -= 0x10000; + return 1; + } else { + outportb(0x20, 0x20); + return 0; + } +} ENDOFUNC(timer) + + +/* Desc: uninstall timer engine + * + * In : - + * Out : - + * + * Note: - + */ +void +pc_remove_timer (void) +{ + if (timer_installed) { + timer_installed = FALSE; + pc_clexit(pc_remove_timer); + + DISABLE(); + outportb(0x43, 0x34); + outportb(0x40, 0); + outportb(0x40, 0); + ENABLE(); + + pc_remove_irq(TIMER_IRQ); + } +} + + +/* Desc: remove timerfunc + * + * In : timerfunc id + * Out : 0 if success + * + * Note: tries to relax the main timer whenever possible + */ +int +pc_remove_int (int fid) +{ + int i; + unsigned int freq = 0; + + /* are we installed? */ + if (!timer_installed) { + return -1; + } + + /* sanity check */ + if ((fid < 0) || (fid >= MAX_TIMERS) || (timer_func[fid].func == NULL)) { + return -1; + } + timer_func[fid].func = NULL; + + /* scan for maximum frequency */ + for (i = 0; i < MAX_TIMERS; i++) { + TIMER *t = &timer_func[i]; + if (t->func) { + if (freq < t->freq) { + freq = t->freq; + } + } + } + + /* if there are no callbacks left, cleanup */ + if (!freq) { + pc_remove_timer(); + return 0; + } + + /* if we just lowered the maximum frequency, try to relax the timer engine */ + if (freq < timer_main.freq) { + unsigned int new_counter = PIT_FREQ / freq; + + DISABLE(); + + for (i = 0; i < MAX_TIMERS; i++) { + if (timer_func[i].func) { + ADJUST(timer_func[i], freq); + } + } + + outportb(0x43, 0x34); + outportb(0x40, (unsigned char)new_counter); + outportb(0x40, (unsigned char)(new_counter>>8)); + timer_main.clock_ticks = 0; + timer_main.counter = new_counter; + timer_main.freq = freq; + + ENABLE(); + } + + return 0; +} ENDOFUNC(pc_remove_int) + + +/* Desc: adjust timerfunc + * + * In : timerfunc id, new frequency (Hz) + * Out : 0 if success + * + * Note: might change the main timer frequency + */ +int +pc_adjust_int (int fid, unsigned int freq) +{ + int i; + + /* are we installed? */ + if (!timer_installed) { + return -1; + } + + /* sanity check */ + if ((fid < 0) || (fid >= MAX_TIMERS) || (timer_func[fid].func == NULL)) { + return -1; + } + timer_func[fid].freq = freq; + + /* scan for maximum frequency */ + freq = 0; + for (i = 0; i < MAX_TIMERS; i++) { + TIMER *t = &timer_func[i]; + if (t->func) { + if (freq < t->freq) { + freq = t->freq; + } + } + } + + /* update main timer / sons to match highest frequency */ + DISABLE(); + + /* using '>' is correct still (and avoids updating + * the HW timer too often), but doesn't relax the timer! + */ + if (freq != timer_main.freq) { + unsigned int new_counter = PIT_FREQ / freq; + + for (i = 0; i < MAX_TIMERS; i++) { + if (timer_func[i].func) { + ADJUST(timer_func[i], freq); + } + } + + outportb(0x43, 0x34); + outportb(0x40, (unsigned char)new_counter); + outportb(0x40, (unsigned char)(new_counter>>8)); + timer_main.clock_ticks = 0; + timer_main.counter = new_counter; + timer_main.freq = freq; + } else { + ADJUST(timer_func[fid], timer_main.freq); + } + + ENABLE(); + + return 0; +} ENDOFUNC(pc_adjust_int) + + +/* Desc: install timer engine + * + * In : - + * Out : 0 for success + * + * Note: initial frequency is 18.2 Hz + */ +static int +install_timer (void) +{ + if (timer_installed || pc_install_irq(TIMER_IRQ, timer)) { + return -1; + } else { + memset(timer_func, 0, sizeof(timer_func)); + + LOCKDATA(timer_func); + LOCKDATA(timer_main); + LOCKFUNC(timer); + LOCKFUNC(pc_adjust_int); + LOCKFUNC(pc_remove_int); + + timer_main.counter = 0x10000; + + DISABLE(); + outportb(0x43, 0x34); + outportb(0x40, 0); + outportb(0x40, 0); + timer_main.clock_ticks = 0; + ENABLE(); + + pc_atexit(pc_remove_timer); + timer_installed = TRUE; + return 0; + } +} + + +/* Desc: install timerfunc + * + * In : callback function, opaque pointer to be passed to callee, freq (Hz) + * Out : timerfunc id (0 .. MAX_TIMERS-1) + * + * Note: returns -1 if error + */ +int +pc_install_int (PFUNC func, void *parm, unsigned int freq) +{ + int i; + TIMER *t = NULL; + + /* ensure the timer engine is set up */ + if (!timer_installed) { + if (install_timer()) { + return -1; + } + } + + /* find an empty slot */ + for (i = 0; i < MAX_TIMERS; i++) { + if (!timer_func[i].func) { + t = &timer_func[i]; + break; + } + } + if (t == NULL) { + return -1; + } + + DISABLE(); + + t->func = func; + t->parm = parm; + t->freq = freq; + t->clock_ticks = 0; + + /* update main timer / sons to match highest frequency */ + if (freq > timer_main.freq) { + unsigned int new_counter = PIT_FREQ / freq; + + for (i = 0; i < MAX_TIMERS; i++) { + if (timer_func[i].func) { + ADJUST(timer_func[i], freq); + } + } + + outportb(0x43, 0x34); + outportb(0x40, (unsigned char)new_counter); + outportb(0x40, (unsigned char)(new_counter>>8)); + timer_main.clock_ticks = 0; + timer_main.counter = new_counter; + timer_main.freq = freq; + } else { + /* t == &timer_func[i] */ + ADJUST(timer_func[i], timer_main.freq); + } + + i = t - timer_func; + + ENABLE(); + + return i; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/roman.c xpsb-glx-0.19/mesa/src/glut/dos/roman.c --- xpsb-glx-0.19/mesa/src/glut/dos/roman.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/roman.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2779 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "internal.h" + +/* char: 0x20 */ + +static const GLUTStrokeChar ch32 = {104.7619f,0,NULL}; + +/* char: 0x21 */ + +static const GLUTStrokeVertex ch33st0[] = +{ + {13.3819f,100.0000f}, + {13.3819f,33.3333f} +}; + +static const GLUTStrokeVertex ch33st1[] = +{ + {13.3819f,9.5238f}, + {8.6200f,4.7619f}, + {13.3819f,0.0000f}, + {18.1438f,4.7619f}, + {13.3819f,9.5238f} +}; + +static const GLUTStrokeStrip ch33st[] = +{ + {2,ch33st0}, + {5,ch33st1} +}; + +static const GLUTStrokeChar ch33 = {26.6238f,2,ch33st}; + +/* char: 0x22 */ + +static const GLUTStrokeVertex ch34st0[] = +{ + {4.0200f,100.0000f}, + {4.0200f,66.6667f} +}; + +static const GLUTStrokeVertex ch34st1[] = +{ + {42.1152f,100.0000f}, + {42.1152f,66.6667f} +}; + +static const GLUTStrokeStrip ch34st[] = +{ + {2,ch34st0}, + {2,ch34st1} +}; + +static const GLUTStrokeChar ch34 = {51.4352f,2,ch34st}; + +/* char: 0x23 */ + +static const GLUTStrokeVertex ch35st0[] = +{ + {41.2952f,119.0476f}, + {7.9619f,-33.3333f} +}; + +static const GLUTStrokeVertex ch35st1[] = +{ + {69.8667f,119.0476f}, + {36.5333f,-33.3333f} +}; + +static const GLUTStrokeVertex ch35st2[] = +{ + {7.9619f,57.1429f}, + {74.6286f,57.1429f} +}; + +static const GLUTStrokeVertex ch35st3[] = +{ + {3.2000f,28.5714f}, + {69.8667f,28.5714f} +}; + +static const GLUTStrokeStrip ch35st[] = +{ + {2,ch35st0}, + {2,ch35st1}, + {2,ch35st2}, + {2,ch35st3} +}; + +static const GLUTStrokeChar ch35 = {79.4886f,4,ch35st}; + +/* char: 0x24 */ + +static const GLUTStrokeVertex ch36st0[] = +{ + {28.6295f,119.0476f}, + {28.6295f,-19.0476f} +}; + +static const GLUTStrokeVertex ch36st1[] = +{ + {47.6771f,119.0476f}, + {47.6771f,-19.0476f} +}; + +static const GLUTStrokeVertex ch36st2[] = +{ + {71.4867f,85.7143f}, + {61.9629f,95.2381f}, + {47.6771f,100.0000f}, + {28.6295f,100.0000f}, + {14.3438f,95.2381f}, + {4.8200f,85.7143f}, + {4.8200f,76.1905f}, + {9.5819f,66.6667f}, + {14.3438f,61.9048f}, + {23.8676f,57.1429f}, + {52.4390f,47.6190f}, + {61.9629f,42.8571f}, + {66.7248f,38.0952f}, + {71.4867f,28.5714f}, + {71.4867f,14.2857f}, + {61.9629f,4.7619f}, + {47.6771f,0.0000f}, + {28.6295f,0.0000f}, + {14.3438f,4.7619f}, + {4.8200f,14.2857f} +}; + +static const GLUTStrokeStrip ch36st[] = +{ + {2,ch36st0}, + {2,ch36st1}, + {20,ch36st2} +}; + +static const GLUTStrokeChar ch36 = {76.2067f,3,ch36st}; + +/* char: 0x25 */ + +static const GLUTStrokeVertex ch37st0[] = +{ + {92.0743f,100.0000f}, + {6.3600f,0.0000f} +}; + +static const GLUTStrokeVertex ch37st1[] = +{ + {30.1695f,100.0000f}, + {39.6933f,90.4762f}, + {39.6933f,80.9524f}, + {34.9314f,71.4286f}, + {25.4076f,66.6667f}, + {15.8838f,66.6667f}, + {6.3600f,76.1905f}, + {6.3600f,85.7143f}, + {11.1219f,95.2381f}, + {20.6457f,100.0000f}, + {30.1695f,100.0000f}, + {39.6933f,95.2381f}, + {53.9790f,90.4762f}, + {68.2648f,90.4762f}, + {82.5505f,95.2381f}, + {92.0743f,100.0000f} +}; + +static const GLUTStrokeVertex ch37st2[] = +{ + {73.0267f,33.3333f}, + {63.5029f,28.5714f}, + {58.7410f,19.0476f}, + {58.7410f,9.5238f}, + {68.2648f,0.0000f}, + {77.7886f,0.0000f}, + {87.3124f,4.7619f}, + {92.0743f,14.2857f}, + {92.0743f,23.8095f}, + {82.5505f,33.3333f}, + {73.0267f,33.3333f} +}; + +static const GLUTStrokeStrip ch37st[] = +{ + {2,ch37st0}, + {16,ch37st1}, + {11,ch37st2} +}; + +static const GLUTStrokeChar ch37 = {96.5743f,3,ch37st}; + +/* char: 0x26 */ + +static const GLUTStrokeVertex ch38st0[] = +{ + {101.2181f,57.1429f}, + {101.2181f,61.9048f}, + {96.4562f,66.6667f}, + {91.6943f,66.6667f}, + {86.9324f,61.9048f}, + {82.1705f,52.3810f}, + {72.6467f,28.5714f}, + {63.1229f,14.2857f}, + {53.5990f,4.7619f}, + {44.0752f,0.0000f}, + {25.0276f,0.0000f}, + {15.5038f,4.7619f}, + {10.7419f,9.5238f}, + {5.9800f,19.0476f}, + {5.9800f,28.5714f}, + {10.7419f,38.0952f}, + {15.5038f,42.8571f}, + {48.8371f,61.9048f}, + {53.5990f,66.6667f}, + {58.3610f,76.1905f}, + {58.3610f,85.7143f}, + {53.5990f,95.2381f}, + {44.0752f,100.0000f}, + {34.5514f,95.2381f}, + {29.7895f,85.7143f}, + {29.7895f,76.1905f}, + {34.5514f,61.9048f}, + {44.0752f,47.6190f}, + {67.8848f,14.2857f}, + {77.4086f,4.7619f}, + {86.9324f,0.0000f}, + {96.4562f,0.0000f}, + {101.2181f,4.7619f}, + {101.2181f,9.5238f} +}; + +static const GLUTStrokeStrip ch38st[] = +{ + {34,ch38st0} +}; + +static const GLUTStrokeChar ch38 = {101.7581f,1,ch38st}; + +/* char: 0x27 */ + +static const GLUTStrokeVertex ch39st0[] = +{ + {4.4400f,100.0000f}, + {4.4400f,66.6667f} +}; + +static const GLUTStrokeStrip ch39st[] = +{ + {2,ch39st0} +}; + +static const GLUTStrokeChar ch39 = {13.6200f,1,ch39st}; + +/* char: 0x28 */ + +static const GLUTStrokeVertex ch40st0[] = +{ + {40.9133f,119.0476f}, + {31.3895f,109.5238f}, + {21.8657f,95.2381f}, + {12.3419f,76.1905f}, + {7.5800f,52.3810f}, + {7.5800f,33.3333f}, + {12.3419f,9.5238f}, + {21.8657f,-9.5238f}, + {31.3895f,-23.8095f}, + {40.9133f,-33.3333f} +}; + +static const GLUTStrokeStrip ch40st[] = +{ + {10,ch40st0} +}; + +static const GLUTStrokeChar ch40 = {47.1733f,1,ch40st}; + +/* char: 0x29 */ + +static const GLUTStrokeVertex ch41st0[] = +{ + {5.2800f,119.0476f}, + {14.8038f,109.5238f}, + {24.3276f,95.2381f}, + {33.8514f,76.1905f}, + {38.6133f,52.3810f}, + {38.6133f,33.3333f}, + {33.8514f,9.5238f}, + {24.3276f,-9.5238f}, + {14.8038f,-23.8095f}, + {5.2800f,-33.3333f} +}; + +static const GLUTStrokeStrip ch41st[] = +{ + {10,ch41st0} +}; + +static const GLUTStrokeChar ch41 = {47.5333f,1,ch41st}; + +/* char: 0x2a */ + +static const GLUTStrokeVertex ch42st0[] = +{ + {30.7695f,71.4286f}, + {30.7695f,14.2857f} +}; + +static const GLUTStrokeVertex ch42st1[] = +{ + {6.9600f,57.1429f}, + {54.5790f,28.5714f} +}; + +static const GLUTStrokeVertex ch42st2[] = +{ + {54.5790f,57.1429f}, + {6.9600f,28.5714f} +}; + +static const GLUTStrokeStrip ch42st[] = +{ + {2,ch42st0}, + {2,ch42st1}, + {2,ch42st2} +}; + +static const GLUTStrokeChar ch42 = {59.4390f,3,ch42st}; + +/* char: 0x2b */ + +static const GLUTStrokeVertex ch43st0[] = +{ + {48.8371f,85.7143f}, + {48.8371f,0.0000f} +}; + +static const GLUTStrokeVertex ch43st1[] = +{ + {5.9800f,42.8571f}, + {91.6943f,42.8571f} +}; + +static const GLUTStrokeStrip ch43st[] = +{ + {2,ch43st0}, + {2,ch43st1} +}; + +static const GLUTStrokeChar ch43 = {97.2543f,2,ch43st}; + +/* char: 0x2c */ + +static const GLUTStrokeVertex ch44st0[] = +{ + {18.2838f,4.7619f}, + {13.5219f,0.0000f}, + {8.7600f,4.7619f}, + {13.5219f,9.5238f}, + {18.2838f,4.7619f}, + {18.2838f,-4.7619f}, + {13.5219f,-14.2857f}, + {8.7600f,-19.0476f} +}; + +static const GLUTStrokeStrip ch44st[] = +{ + {8,ch44st0} +}; + +static const GLUTStrokeChar ch44 = {26.0638f,1,ch44st}; + +/* char: 0x2d */ + +static const GLUTStrokeVertex ch45st0[] = +{ + {7.3800f,42.8571f}, + {93.0943f,42.8571f} +}; + +static const GLUTStrokeStrip ch45st[] = +{ + {2,ch45st0} +}; + +static const GLUTStrokeChar ch45 = {100.7543f,1,ch45st}; + +/* char: 0x2e */ + +static const GLUTStrokeVertex ch46st0[] = +{ + {13.1019f,9.5238f}, + {8.3400f,4.7619f}, + {13.1019f,0.0000f}, + {17.8638f,4.7619f}, + {13.1019f,9.5238f} +}; + +static const GLUTStrokeStrip ch46st[] = +{ + {5,ch46st0} +}; + +static const GLUTStrokeChar ch46 = {26.4838f,1,ch46st}; + +/* char: 0x2f */ + +static const GLUTStrokeVertex ch47st0[] = +{ + {7.2400f,-14.2857f}, + {73.9067f,100.0000f} +}; + +static const GLUTStrokeStrip ch47st[] = +{ + {2,ch47st0} +}; + +static const GLUTStrokeChar ch47 = {82.1067f,1,ch47st}; + +/* char: 0x30 */ + +static const GLUTStrokeVertex ch48st0[] = +{ + {33.5514f,100.0000f}, + {19.2657f,95.2381f}, + {9.7419f,80.9524f}, + {4.9800f,57.1429f}, + {4.9800f,42.8571f}, + {9.7419f,19.0476f}, + {19.2657f,4.7619f}, + {33.5514f,0.0000f}, + {43.0752f,0.0000f}, + {57.3610f,4.7619f}, + {66.8848f,19.0476f}, + {71.6467f,42.8571f}, + {71.6467f,57.1429f}, + {66.8848f,80.9524f}, + {57.3610f,95.2381f}, + {43.0752f,100.0000f}, + {33.5514f,100.0000f} +}; + +static const GLUTStrokeStrip ch48st[] = +{ + {17,ch48st0} +}; + +static const GLUTStrokeChar ch48 = {77.0667f,1,ch48st}; + +/* char: 0x31 */ + +static const GLUTStrokeVertex ch49st0[] = +{ + {11.8200f,80.9524f}, + {21.3438f,85.7143f}, + {35.6295f,100.0000f}, + {35.6295f,0.0000f} +}; + +static const GLUTStrokeStrip ch49st[] = +{ + {4,ch49st0} +}; + +static const GLUTStrokeChar ch49 = {66.5295f,1,ch49st}; + +/* char: 0x32 */ + +static const GLUTStrokeVertex ch50st0[] = +{ + {10.1819f,76.1905f}, + {10.1819f,80.9524f}, + {14.9438f,90.4762f}, + {19.7057f,95.2381f}, + {29.2295f,100.0000f}, + {48.2771f,100.0000f}, + {57.8010f,95.2381f}, + {62.5629f,90.4762f}, + {67.3248f,80.9524f}, + {67.3248f,71.4286f}, + {62.5629f,61.9048f}, + {53.0390f,47.6190f}, + {5.4200f,0.0000f}, + {72.0867f,0.0000f} +}; + +static const GLUTStrokeStrip ch50st[] = +{ + {14,ch50st0} +}; + +static const GLUTStrokeChar ch50 = {77.6467f,1,ch50st}; + +/* char: 0x33 */ + +static const GLUTStrokeVertex ch51st0[] = +{ + {14.5238f,100.0000f}, + {66.9048f,100.0000f}, + {38.3333f,61.9048f}, + {52.6190f,61.9048f}, + {62.1429f,57.1429f}, + {66.9048f,52.3810f}, + {71.6667f,38.0952f}, + {71.6667f,28.5714f}, + {66.9048f,14.2857f}, + {57.3810f,4.7619f}, + {43.0952f,0.0000f}, + {28.8095f,0.0000f}, + {14.5238f,4.7619f}, + {9.7619f,9.5238f}, + {5.0000f,19.0476f} +}; + +static const GLUTStrokeStrip ch51st[] = +{ + {15,ch51st0} +}; + +static const GLUTStrokeChar ch51 = {77.0467f,1,ch51st}; + +/* char: 0x34 */ + +static const GLUTStrokeVertex ch52st0[] = +{ + {51.4990f,100.0000f}, + {3.8800f,33.3333f}, + {75.3086f,33.3333f} +}; + +static const GLUTStrokeVertex ch52st1[] = +{ + {51.4990f,100.0000f}, + {51.4990f,0.0000f} +}; + +static const GLUTStrokeStrip ch52st[] = +{ + {3,ch52st0}, + {2,ch52st1} +}; + +static const GLUTStrokeChar ch52 = {80.1686f,2,ch52st}; + +/* char: 0x35 */ + +static const GLUTStrokeVertex ch53st0[] = +{ + {62.0029f,100.0000f}, + {14.3838f,100.0000f}, + {9.6219f,57.1429f}, + {14.3838f,61.9048f}, + {28.6695f,66.6667f}, + {42.9552f,66.6667f}, + {57.2410f,61.9048f}, + {66.7648f,52.3810f}, + {71.5267f,38.0952f}, + {71.5267f,28.5714f}, + {66.7648f,14.2857f}, + {57.2410f,4.7619f}, + {42.9552f,0.0000f}, + {28.6695f,0.0000f}, + {14.3838f,4.7619f}, + {9.6219f,9.5238f}, + {4.8600f,19.0476f} +}; + +static const GLUTStrokeStrip ch53st[] = +{ + {17,ch53st0} +}; + +static const GLUTStrokeChar ch53 = {77.6867f,1,ch53st}; + +/* char: 0x36 */ + +static const GLUTStrokeVertex ch54st0[] = +{ + {62.7229f,85.7143f}, + {57.9610f,95.2381f}, + {43.6752f,100.0000f}, + {34.1514f,100.0000f}, + {19.8657f,95.2381f}, + {10.3419f,80.9524f}, + {5.5800f,57.1429f}, + {5.5800f,33.3333f}, + {10.3419f,14.2857f}, + {19.8657f,4.7619f}, + {34.1514f,0.0000f}, + {38.9133f,0.0000f}, + {53.1990f,4.7619f}, + {62.7229f,14.2857f}, + {67.4848f,28.5714f}, + {67.4848f,33.3333f}, + {62.7229f,47.6190f}, + {53.1990f,57.1429f}, + {38.9133f,61.9048f}, + {34.1514f,61.9048f}, + {19.8657f,57.1429f}, + {10.3419f,47.6190f}, + {5.5800f,33.3333f} +}; + +static const GLUTStrokeStrip ch54st[] = +{ + {23,ch54st0} +}; + +static const GLUTStrokeChar ch54 = {73.8048f,1,ch54st}; + +/* char: 0x37 */ + +static const GLUTStrokeVertex ch55st0[] = +{ + {72.2267f,100.0000f}, + {24.6076f,0.0000f} +}; + +static const GLUTStrokeVertex ch55st1[] = +{ + {5.5600f,100.0000f}, + {72.2267f,100.0000f} +}; + +static const GLUTStrokeStrip ch55st[] = +{ + {2,ch55st0}, + {2,ch55st1} +}; + +static const GLUTStrokeChar ch55 = {77.2267f,2,ch55st}; + +/* char: 0x38 */ + +static const GLUTStrokeVertex ch56st0[] = +{ + {29.4095f,100.0000f}, + {15.1238f,95.2381f}, + {10.3619f,85.7143f}, + {10.3619f,76.1905f}, + {15.1238f,66.6667f}, + {24.6476f,61.9048f}, + {43.6952f,57.1429f}, + {57.9810f,52.3810f}, + {67.5048f,42.8571f}, + {72.2667f,33.3333f}, + {72.2667f,19.0476f}, + {67.5048f,9.5238f}, + {62.7429f,4.7619f}, + {48.4571f,0.0000f}, + {29.4095f,0.0000f}, + {15.1238f,4.7619f}, + {10.3619f,9.5238f}, + {5.6000f,19.0476f}, + {5.6000f,33.3333f}, + {10.3619f,42.8571f}, + {19.8857f,52.3810f}, + {34.1714f,57.1429f}, + {53.2190f,61.9048f}, + {62.7429f,66.6667f}, + {67.5048f,76.1905f}, + {67.5048f,85.7143f}, + {62.7429f,95.2381f}, + {48.4571f,100.0000f}, + {29.4095f,100.0000f} +}; + +static const GLUTStrokeStrip ch56st[] = +{ + {29,ch56st0} +}; + +static const GLUTStrokeChar ch56 = {77.6667f,1,ch56st}; + +/* char: 0x39 */ + +static const GLUTStrokeVertex ch57st0[] = +{ + {68.5048f,66.6667f}, + {63.7429f,52.3810f}, + {54.2190f,42.8571f}, + {39.9333f,38.0952f}, + {35.1714f,38.0952f}, + {20.8857f,42.8571f}, + {11.3619f,52.3810f}, + {6.6000f,66.6667f}, + {6.6000f,71.4286f}, + {11.3619f,85.7143f}, + {20.8857f,95.2381f}, + {35.1714f,100.0000f}, + {39.9333f,100.0000f}, + {54.2190f,95.2381f}, + {63.7429f,85.7143f}, + {68.5048f,66.6667f}, + {68.5048f,42.8571f}, + {63.7429f,19.0476f}, + {54.2190f,4.7619f}, + {39.9333f,0.0000f}, + {30.4095f,0.0000f}, + {16.1238f,4.7619f}, + {11.3619f,14.2857f} +}; + +static const GLUTStrokeStrip ch57st[] = +{ + {23,ch57st0} +}; + +static const GLUTStrokeChar ch57 = {74.0648f,1,ch57st}; + +/* char: 0x3a */ + +static const GLUTStrokeVertex ch58st0[] = +{ + {14.0819f,66.6667f}, + {9.3200f,61.9048f}, + {14.0819f,57.1429f}, + {18.8438f,61.9048f}, + {14.0819f,66.6667f} +}; + +static const GLUTStrokeVertex ch58st1[] = +{ + {14.0819f,9.5238f}, + {9.3200f,4.7619f}, + {14.0819f,0.0000f}, + {18.8438f,4.7619f}, + {14.0819f,9.5238f} +}; + +static const GLUTStrokeStrip ch58st[] = +{ + {5,ch58st0}, + {5,ch58st1} +}; + +static const GLUTStrokeChar ch58 = {26.2238f,2,ch58st}; + +/* char: 0x3b */ + +static const GLUTStrokeVertex ch59st0[] = +{ + {12.9619f,66.6667f}, + {8.2000f,61.9048f}, + {12.9619f,57.1429f}, + {17.7238f,61.9048f}, + {12.9619f,66.6667f} +}; + +static const GLUTStrokeVertex ch59st1[] = +{ + {17.7238f,4.7619f}, + {12.9619f,0.0000f}, + {8.2000f,4.7619f}, + {12.9619f,9.5238f}, + {17.7238f,4.7619f}, + {17.7238f,-4.7619f}, + {12.9619f,-14.2857f}, + {8.2000f,-19.0476f} +}; + +static const GLUTStrokeStrip ch59st[] = +{ + {5,ch59st0}, + {8,ch59st1} +}; + +static const GLUTStrokeChar ch59 = {26.3038f,2,ch59st}; + +/* char: 0x3c */ + +static const GLUTStrokeVertex ch60st0[] = +{ + {79.2505f,85.7143f}, + {3.0600f,42.8571f}, + {79.2505f,0.0000f} +}; + +static const GLUTStrokeStrip ch60st[] = +{ + {3,ch60st0} +}; + +static const GLUTStrokeChar ch60 = {81.6105f,1,ch60st}; + +/* char: 0x3d */ + +static const GLUTStrokeVertex ch61st0[] = +{ + {5.7000f,57.1429f}, + {91.4143f,57.1429f} +}; + +static const GLUTStrokeVertex ch61st1[] = +{ + {5.7000f,28.5714f}, + {91.4143f,28.5714f} +}; + +static const GLUTStrokeStrip ch61st[] = +{ + {2,ch61st0}, + {2,ch61st1} +}; + +static const GLUTStrokeChar ch61 = {97.2543f,2,ch61st}; + +/* char: 0x3e */ + +static const GLUTStrokeVertex ch62st0[] = +{ + {2.7800f,85.7143f}, + {78.9705f,42.8571f}, + {2.7800f,0.0000f} +}; + +static const GLUTStrokeStrip ch62st[] = +{ + {3,ch62st0} +}; + +static const GLUTStrokeChar ch62 = {81.6105f,1,ch62st}; + +/* char: 0x3f */ + +static const GLUTStrokeVertex ch63st0[] = +{ + {8.4200f,76.1905f}, + {8.4200f,80.9524f}, + {13.1819f,90.4762f}, + {17.9438f,95.2381f}, + {27.4676f,100.0000f}, + {46.5152f,100.0000f}, + {56.0390f,95.2381f}, + {60.8010f,90.4762f}, + {65.5629f,80.9524f}, + {65.5629f,71.4286f}, + {60.8010f,61.9048f}, + {56.0390f,57.1429f}, + {36.9914f,47.6190f}, + {36.9914f,33.3333f} +}; + +static const GLUTStrokeVertex ch63st1[] = +{ + {36.9914f,9.5238f}, + {32.2295f,4.7619f}, + {36.9914f,0.0000f}, + {41.7533f,4.7619f}, + {36.9914f,9.5238f} +}; + +static const GLUTStrokeStrip ch63st[] = +{ + {14,ch63st0}, + {5,ch63st1} +}; + +static const GLUTStrokeChar ch63 = {73.9029f,2,ch63st}; + +/* char: 0x40 */ + +static const GLUTStrokeVertex ch64st0[] = +{ + {49.2171f,52.3810f}, + {39.6933f,57.1429f}, + {30.1695f,57.1429f}, + {25.4076f,47.6190f}, + {25.4076f,42.8571f}, + {30.1695f,33.3333f}, + {39.6933f,33.3333f}, + {49.2171f,38.0952f} +}; + +static const GLUTStrokeVertex ch64st1[] = +{ + {49.2171f,57.1429f}, + {49.2171f,38.0952f}, + {53.9790f,33.3333f}, + {63.5029f,33.3333f}, + {68.2648f,42.8571f}, + {68.2648f,47.6190f}, + {63.5029f,61.9048f}, + {53.9790f,71.4286f}, + {39.6933f,76.1905f}, + {34.9314f,76.1905f}, + {20.6457f,71.4286f}, + {11.1219f,61.9048f}, + {6.3600f,47.6190f}, + {6.3600f,42.8571f}, + {11.1219f,28.5714f}, + {20.6457f,19.0476f}, + {34.9314f,14.2857f}, + {39.6933f,14.2857f}, + {53.9790f,19.0476f} +}; + +static const GLUTStrokeStrip ch64st[] = +{ + {8,ch64st0}, + {19,ch64st1} +}; + +static const GLUTStrokeChar ch64 = {74.3648f,2,ch64st}; + +/* char: 0x41 */ + +static const GLUTStrokeVertex ch65st0[] = +{ + {40.5952f,100.0000f}, + {2.5000f,0.0000f} +}; + +static const GLUTStrokeVertex ch65st1[] = +{ + {40.5952f,100.0000f}, + {78.6905f,0.0000f} +}; + +static const GLUTStrokeVertex ch65st2[] = +{ + {16.7857f,33.3333f}, + {64.4048f,33.3333f} +}; + +static const GLUTStrokeStrip ch65st[] = +{ + {2,ch65st0}, + {2,ch65st1}, + {2,ch65st2} +}; + +static const GLUTStrokeChar ch65 = {80.4905f,3,ch65st}; + +/* char: 0x42 */ + +static const GLUTStrokeVertex ch66st0[] = +{ + {11.4200f,100.0000f}, + {11.4200f,0.0000f} +}; + +static const GLUTStrokeVertex ch66st1[] = +{ + {11.4200f,100.0000f}, + {54.2771f,100.0000f}, + {68.5629f,95.2381f}, + {73.3248f,90.4762f}, + {78.0867f,80.9524f}, + {78.0867f,71.4286f}, + {73.3248f,61.9048f}, + {68.5629f,57.1429f}, + {54.2771f,52.3810f} +}; + +static const GLUTStrokeVertex ch66st2[] = +{ + {11.4200f,52.3810f}, + {54.2771f,52.3810f}, + {68.5629f,47.6190f}, + {73.3248f,42.8571f}, + {78.0867f,33.3333f}, + {78.0867f,19.0476f}, + {73.3248f,9.5238f}, + {68.5629f,4.7619f}, + {54.2771f,0.0000f}, + {11.4200f,0.0000f} +}; + +static const GLUTStrokeStrip ch66st[] = +{ + {2,ch66st0}, + {9,ch66st1}, + {10,ch66st2} +}; + +static const GLUTStrokeChar ch66 = {83.6267f,3,ch66st}; + +/* char: 0x43 */ + +static const GLUTStrokeVertex ch67st0[] = +{ + {78.0886f,76.1905f}, + {73.3267f,85.7143f}, + {63.8029f,95.2381f}, + {54.2790f,100.0000f}, + {35.2314f,100.0000f}, + {25.7076f,95.2381f}, + {16.1838f,85.7143f}, + {11.4219f,76.1905f}, + {6.6600f,61.9048f}, + {6.6600f,38.0952f}, + {11.4219f,23.8095f}, + {16.1838f,14.2857f}, + {25.7076f,4.7619f}, + {35.2314f,0.0000f}, + {54.2790f,0.0000f}, + {63.8029f,4.7619f}, + {73.3267f,14.2857f}, + {78.0886f,23.8095f} +}; + +static const GLUTStrokeStrip ch67st[] = +{ + {18,ch67st0} +}; + +static const GLUTStrokeChar ch67 = {84.4886f,1,ch67st}; + +/* char: 0x44 */ + +static const GLUTStrokeVertex ch68st0[] = +{ + {11.9600f,100.0000f}, + {11.9600f,0.0000f} +}; + +static const GLUTStrokeVertex ch68st1[] = +{ + {11.9600f,100.0000f}, + {45.2933f,100.0000f}, + {59.5790f,95.2381f}, + {69.1029f,85.7143f}, + {73.8648f,76.1905f}, + {78.6267f,61.9048f}, + {78.6267f,38.0952f}, + {73.8648f,23.8095f}, + {69.1029f,14.2857f}, + {59.5790f,4.7619f}, + {45.2933f,0.0000f}, + {11.9600f,0.0000f} +}; + +static const GLUTStrokeStrip ch68st[] = +{ + {2,ch68st0}, + {12,ch68st1} +}; + +static const GLUTStrokeChar ch68 = {85.2867f,2,ch68st}; + +/* char: 0x45 */ + +static const GLUTStrokeVertex ch69st0[] = +{ + {11.4200f,100.0000f}, + {11.4200f,0.0000f} +}; + +static const GLUTStrokeVertex ch69st1[] = +{ + {11.4200f,100.0000f}, + {73.3248f,100.0000f} +}; + +static const GLUTStrokeVertex ch69st2[] = +{ + {11.4200f,52.3810f}, + {49.5152f,52.3810f} +}; + +static const GLUTStrokeVertex ch69st3[] = +{ + {11.4200f,0.0000f}, + {73.3248f,0.0000f} +}; + +static const GLUTStrokeStrip ch69st[] = +{ + {2,ch69st0}, + {2,ch69st1}, + {2,ch69st2}, + {2,ch69st3} +}; + +static const GLUTStrokeChar ch69 = {78.1848f,4,ch69st}; + +/* char: 0x46 */ + +static const GLUTStrokeVertex ch70st0[] = +{ + {11.4200f,100.0000f}, + {11.4200f,0.0000f} +}; + +static const GLUTStrokeVertex ch70st1[] = +{ + {11.4200f,100.0000f}, + {73.3248f,100.0000f} +}; + +static const GLUTStrokeVertex ch70st2[] = +{ + {11.4200f,52.3810f}, + {49.5152f,52.3810f} +}; + +static const GLUTStrokeStrip ch70st[] = +{ + {2,ch70st0}, + {2,ch70st1}, + {2,ch70st2} +}; + +static const GLUTStrokeChar ch70 = {78.7448f,3,ch70st}; + +/* char: 0x47 */ + +static const GLUTStrokeVertex ch71st0[] = +{ + {78.4886f,76.1905f}, + {73.7267f,85.7143f}, + {64.2029f,95.2381f}, + {54.6790f,100.0000f}, + {35.6314f,100.0000f}, + {26.1076f,95.2381f}, + {16.5838f,85.7143f}, + {11.8219f,76.1905f}, + {7.0600f,61.9048f}, + {7.0600f,38.0952f}, + {11.8219f,23.8095f}, + {16.5838f,14.2857f}, + {26.1076f,4.7619f}, + {35.6314f,0.0000f}, + {54.6790f,0.0000f}, + {64.2029f,4.7619f}, + {73.7267f,14.2857f}, + {78.4886f,23.8095f}, + {78.4886f,38.0952f} +}; + +static const GLUTStrokeVertex ch71st1[] = +{ + {54.6790f,38.0952f}, + {78.4886f,38.0952f} +}; + +static const GLUTStrokeStrip ch71st[] = +{ + {19,ch71st0}, + {2,ch71st1} +}; + +static const GLUTStrokeChar ch71 = {89.7686f,2,ch71st}; + +/* char: 0x48 */ + +static const GLUTStrokeVertex ch72st0[] = +{ + {11.4200f,100.0000f}, + {11.4200f,0.0000f} +}; + +static const GLUTStrokeVertex ch72st1[] = +{ + {78.0867f,100.0000f}, + {78.0867f,0.0000f} +}; + +static const GLUTStrokeVertex ch72st2[] = +{ + {11.4200f,52.3810f}, + {78.0867f,52.3810f} +}; + +static const GLUTStrokeStrip ch72st[] = +{ + {2,ch72st0}, + {2,ch72st1}, + {2,ch72st2} +}; + +static const GLUTStrokeChar ch72 = {89.0867f,3,ch72st}; + +/* char: 0x49 */ + +static const GLUTStrokeVertex ch73st0[] = +{ + {10.8600f,100.0000f}, + {10.8600f,0.0000f} +}; + +static const GLUTStrokeStrip ch73st[] = +{ + {2,ch73st0} +}; + +static const GLUTStrokeChar ch73 = {21.3000f,1,ch73st}; + +/* char: 0x4a */ + +static const GLUTStrokeVertex ch74st0[] = +{ + {50.1190f,100.0000f}, + {50.1190f,23.8095f}, + {45.3571f,9.5238f}, + {40.5952f,4.7619f}, + {31.0714f,0.0000f}, + {21.5476f,0.0000f}, + {12.0238f,4.7619f}, + {7.2619f,9.5238f}, + {2.5000f,23.8095f}, + {2.5000f,33.3333f} +}; + +static const GLUTStrokeStrip ch74st[] = +{ + {10,ch74st0} +}; + +static const GLUTStrokeChar ch74 = {59.9990f,1,ch74st}; + +/* char: 0x4b */ + +static const GLUTStrokeVertex ch75st0[] = +{ + {11.2800f,100.0000f}, + {11.2800f,0.0000f} +}; + +static const GLUTStrokeVertex ch75st1[] = +{ + {77.9467f,100.0000f}, + {11.2800f,33.3333f} +}; + +static const GLUTStrokeVertex ch75st2[] = +{ + {35.0895f,57.1429f}, + {77.9467f,0.0000f} +}; + +static const GLUTStrokeStrip ch75st[] = +{ + {2,ch75st0}, + {2,ch75st1}, + {2,ch75st2} +}; + +static const GLUTStrokeChar ch75 = {79.3267f,3,ch75st}; + +/* char: 0x4c */ + +static const GLUTStrokeVertex ch76st0[] = +{ + {11.6800f,100.0000f}, + {11.6800f,0.0000f} +}; + +static const GLUTStrokeVertex ch76st1[] = +{ + {11.6800f,0.0000f}, + {68.8229f,0.0000f} +}; + +static const GLUTStrokeStrip ch76st[] = +{ + {2,ch76st0}, + {2,ch76st1} +}; + +static const GLUTStrokeChar ch76 = {71.3229f,2,ch76st}; + +/* char: 0x4d */ + +static const GLUTStrokeVertex ch77st0[] = +{ + {10.8600f,100.0000f}, + {10.8600f,0.0000f} +}; + +static const GLUTStrokeVertex ch77st1[] = +{ + {10.8600f,100.0000f}, + {48.9552f,0.0000f} +}; + +static const GLUTStrokeVertex ch77st2[] = +{ + {87.0505f,100.0000f}, + {48.9552f,0.0000f} +}; + +static const GLUTStrokeVertex ch77st3[] = +{ + {87.0505f,100.0000f}, + {87.0505f,0.0000f} +}; + +static const GLUTStrokeStrip ch77st[] = +{ + {2,ch77st0}, + {2,ch77st1}, + {2,ch77st2}, + {2,ch77st3} +}; + +static const GLUTStrokeChar ch77 = {97.2105f,4,ch77st}; + +/* char: 0x4e */ + +static const GLUTStrokeVertex ch78st0[] = +{ + {11.1400f,100.0000f}, + {11.1400f,0.0000f} +}; + +static const GLUTStrokeVertex ch78st1[] = +{ + {11.1400f,100.0000f}, + {77.8067f,0.0000f} +}; + +static const GLUTStrokeVertex ch78st2[] = +{ + {77.8067f,100.0000f}, + {77.8067f,0.0000f} +}; + +static const GLUTStrokeStrip ch78st[] = +{ + {2,ch78st0}, + {2,ch78st1}, + {2,ch78st2} +}; + +static const GLUTStrokeChar ch78 = {88.8067f,3,ch78st}; + +/* char: 0x4f */ + +static const GLUTStrokeVertex ch79st0[] = +{ + {34.8114f,100.0000f}, + {25.2876f,95.2381f}, + {15.7638f,85.7143f}, + {11.0019f,76.1905f}, + {6.2400f,61.9048f}, + {6.2400f,38.0952f}, + {11.0019f,23.8095f}, + {15.7638f,14.2857f}, + {25.2876f,4.7619f}, + {34.8114f,0.0000f}, + {53.8590f,0.0000f}, + {63.3829f,4.7619f}, + {72.9067f,14.2857f}, + {77.6686f,23.8095f}, + {82.4305f,38.0952f}, + {82.4305f,61.9048f}, + {77.6686f,76.1905f}, + {72.9067f,85.7143f}, + {63.3829f,95.2381f}, + {53.8590f,100.0000f}, + {34.8114f,100.0000f} +}; + +static const GLUTStrokeStrip ch79st[] = +{ + {21,ch79st0} +}; + +static const GLUTStrokeChar ch79 = {88.8305f,1,ch79st}; + +/* char: 0x50 */ + +static const GLUTStrokeVertex ch80st0[] = +{ + {12.1000f,100.0000f}, + {12.1000f,0.0000f} +}; + +static const GLUTStrokeVertex ch80st1[] = +{ + {12.1000f,100.0000f}, + {54.9571f,100.0000f}, + {69.2429f,95.2381f}, + {74.0048f,90.4762f}, + {78.7667f,80.9524f}, + {78.7667f,66.6667f}, + {74.0048f,57.1429f}, + {69.2429f,52.3810f}, + {54.9571f,47.6190f}, + {12.1000f,47.6190f} +}; + +static const GLUTStrokeStrip ch80st[] = +{ + {2,ch80st0}, + {10,ch80st1} +}; + +static const GLUTStrokeChar ch80 = {85.6667f,2,ch80st}; + +/* char: 0x51 */ + +static const GLUTStrokeVertex ch81st0[] = +{ + {33.8714f,100.0000f}, + {24.3476f,95.2381f}, + {14.8238f,85.7143f}, + {10.0619f,76.1905f}, + {5.3000f,61.9048f}, + {5.3000f,38.0952f}, + {10.0619f,23.8095f}, + {14.8238f,14.2857f}, + {24.3476f,4.7619f}, + {33.8714f,0.0000f}, + {52.9190f,0.0000f}, + {62.4429f,4.7619f}, + {71.9667f,14.2857f}, + {76.7286f,23.8095f}, + {81.4905f,38.0952f}, + {81.4905f,61.9048f}, + {76.7286f,76.1905f}, + {71.9667f,85.7143f}, + {62.4429f,95.2381f}, + {52.9190f,100.0000f}, + {33.8714f,100.0000f} +}; + +static const GLUTStrokeVertex ch81st1[] = +{ + {48.1571f,19.0476f}, + {76.7286f,-9.5238f} +}; + +static const GLUTStrokeStrip ch81st[] = +{ + {21,ch81st0}, + {2,ch81st1} +}; + +static const GLUTStrokeChar ch81 = {88.0905f,2,ch81st}; + +/* char: 0x52 */ + +static const GLUTStrokeVertex ch82st0[] = +{ + {11.6800f,100.0000f}, + {11.6800f,0.0000f} +}; + +static const GLUTStrokeVertex ch82st1[] = +{ + {11.6800f,100.0000f}, + {54.5371f,100.0000f}, + {68.8229f,95.2381f}, + {73.5848f,90.4762f}, + {78.3467f,80.9524f}, + {78.3467f,71.4286f}, + {73.5848f,61.9048f}, + {68.8229f,57.1429f}, + {54.5371f,52.3810f}, + {11.6800f,52.3810f} +}; + +static const GLUTStrokeVertex ch82st2[] = +{ + {45.0133f,52.3810f}, + {78.3467f,0.0000f} +}; + +static const GLUTStrokeStrip ch82st[] = +{ + {2,ch82st0}, + {10,ch82st1}, + {2,ch82st2} +}; + +static const GLUTStrokeChar ch82 = {82.3667f,3,ch82st}; + +/* char: 0x53 */ + +static const GLUTStrokeVertex ch83st0[] = +{ + {74.6667f,85.7143f}, + {65.1429f,95.2381f}, + {50.8571f,100.0000f}, + {31.8095f,100.0000f}, + {17.5238f,95.2381f}, + {8.0000f,85.7143f}, + {8.0000f,76.1905f}, + {12.7619f,66.6667f}, + {17.5238f,61.9048f}, + {27.0476f,57.1429f}, + {55.6190f,47.6190f}, + {65.1429f,42.8571f}, + {69.9048f,38.0952f}, + {74.6667f,28.5714f}, + {74.6667f,14.2857f}, + {65.1429f,4.7619f}, + {50.8571f,0.0000f}, + {31.8095f,0.0000f}, + {17.5238f,4.7619f}, + {8.0000f,14.2857f} +}; + +static const GLUTStrokeStrip ch83st[] = +{ + {20,ch83st0} +}; + +static const GLUTStrokeChar ch83 = {80.8267f,1,ch83st}; + +/* char: 0x54 */ + +static const GLUTStrokeVertex ch84st0[] = +{ + {35.6933f,100.0000f}, + {35.6933f,0.0000f} +}; + +static const GLUTStrokeVertex ch84st1[] = +{ + {2.3600f,100.0000f}, + {69.0267f,100.0000f} +}; + +static const GLUTStrokeStrip ch84st[] = +{ + {2,ch84st0}, + {2,ch84st1} +}; + +static const GLUTStrokeChar ch84 = {71.9467f,2,ch84st}; + +/* char: 0x55 */ + +static const GLUTStrokeVertex ch85st0[] = +{ + {11.5400f,100.0000f}, + {11.5400f,28.5714f}, + {16.3019f,14.2857f}, + {25.8257f,4.7619f}, + {40.1114f,0.0000f}, + {49.6352f,0.0000f}, + {63.9210f,4.7619f}, + {73.4448f,14.2857f}, + {78.2067f,28.5714f}, + {78.2067f,100.0000f} +}; + +static const GLUTStrokeStrip ch85st[] = +{ + {10,ch85st0} +}; + +static const GLUTStrokeChar ch85 = {89.4867f,1,ch85st}; + +/* char: 0x56 */ + +static const GLUTStrokeVertex ch86st0[] = +{ + {2.3600f,100.0000f}, + {40.4552f,0.0000f} +}; + +static const GLUTStrokeVertex ch86st1[] = +{ + {78.5505f,100.0000f}, + {40.4552f,0.0000f} +}; + +static const GLUTStrokeStrip ch86st[] = +{ + {2,ch86st0}, + {2,ch86st1} +}; + +static const GLUTStrokeChar ch86 = {81.6105f,2,ch86st}; + +/* char: 0x57 */ + +static const GLUTStrokeVertex ch87st0[] = +{ + {2.2200f,100.0000f}, + {26.0295f,0.0000f} +}; + +static const GLUTStrokeVertex ch87st1[] = +{ + {49.8390f,100.0000f}, + {26.0295f,0.0000f} +}; + +static const GLUTStrokeVertex ch87st2[] = +{ + {49.8390f,100.0000f}, + {73.6486f,0.0000f} +}; + +static const GLUTStrokeVertex ch87st3[] = +{ + {97.4581f,100.0000f}, + {73.6486f,0.0000f} +}; + +static const GLUTStrokeStrip ch87st[] = +{ + {2,ch87st0}, + {2,ch87st1}, + {2,ch87st2}, + {2,ch87st3} +}; + +static const GLUTStrokeChar ch87 = {100.5181f,4,ch87st}; + +/* char: 0x58 */ + +static const GLUTStrokeVertex ch88st0[] = +{ + {2.5000f,100.0000f}, + {69.1667f,0.0000f} +}; + +static const GLUTStrokeVertex ch88st1[] = +{ + {69.1667f,100.0000f}, + {2.5000f,0.0000f} +}; + +static const GLUTStrokeStrip ch88st[] = +{ + {2,ch88st0}, + {2,ch88st1} +}; + +static const GLUTStrokeChar ch88 = {72.3667f,2,ch88st}; + +/* char: 0x59 */ + +static const GLUTStrokeVertex ch89st0[] = +{ + {1.5200f,100.0000f}, + {39.6152f,52.3810f}, + {39.6152f,0.0000f} +}; + +static const GLUTStrokeVertex ch89st1[] = +{ + {77.7105f,100.0000f}, + {39.6152f,52.3810f} +}; + +static const GLUTStrokeStrip ch89st[] = +{ + {3,ch89st0}, + {2,ch89st1} +}; + +static const GLUTStrokeChar ch89 = {79.6505f,2,ch89st}; + +/* char: 0x5a */ + +static const GLUTStrokeVertex ch90st0[] = +{ + {69.1667f,100.0000f}, + {2.5000f,0.0000f} +}; + +static const GLUTStrokeVertex ch90st1[] = +{ + {2.5000f,100.0000f}, + {69.1667f,100.0000f} +}; + +static const GLUTStrokeVertex ch90st2[] = +{ + {2.5000f,0.0000f}, + {69.1667f,0.0000f} +}; + +static const GLUTStrokeStrip ch90st[] = +{ + {2,ch90st0}, + {2,ch90st1}, + {2,ch90st2} +}; + +static const GLUTStrokeChar ch90 = {73.7467f,3,ch90st}; + +/* char: 0x5b */ + +static const GLUTStrokeVertex ch91st0[] = +{ + {7.7800f,119.0476f}, + {7.7800f,-33.3333f} +}; + +static const GLUTStrokeVertex ch91st1[] = +{ + {12.5419f,119.0476f}, + {12.5419f,-33.3333f} +}; + +static const GLUTStrokeVertex ch91st2[] = +{ + {7.7800f,119.0476f}, + {41.1133f,119.0476f} +}; + +static const GLUTStrokeVertex ch91st3[] = +{ + {7.7800f,-33.3333f}, + {41.1133f,-33.3333f} +}; + +static const GLUTStrokeStrip ch91st[] = +{ + {2,ch91st0}, + {2,ch91st1}, + {2,ch91st2}, + {2,ch91st3} +}; + +static const GLUTStrokeChar ch91 = {46.1133f,4,ch91st}; + +/* char: 0x5c */ + +static const GLUTStrokeVertex ch92st0[] = +{ + {5.8400f,100.0000f}, + {72.5067f,-14.2857f} +}; + +static const GLUTStrokeStrip ch92st[] = +{ + {2,ch92st0} +}; + +static const GLUTStrokeChar ch92 = {78.2067f,1,ch92st}; + +/* char: 0x5d */ + +static const GLUTStrokeVertex ch93st0[] = +{ + {33.0114f,119.0476f}, + {33.0114f,-33.3333f} +}; + +static const GLUTStrokeVertex ch93st1[] = +{ + {37.7733f,119.0476f}, + {37.7733f,-33.3333f} +}; + +static const GLUTStrokeVertex ch93st2[] = +{ + {4.4400f,119.0476f}, + {37.7733f,119.0476f} +}; + +static const GLUTStrokeVertex ch93st3[] = +{ + {4.4400f,-33.3333f}, + {37.7733f,-33.3333f} +}; + +static const GLUTStrokeStrip ch93st[] = +{ + {2,ch93st0}, + {2,ch93st1}, + {2,ch93st2}, + {2,ch93st3} +}; + +static const GLUTStrokeChar ch93 = {46.3933f,4,ch93st}; + +/* char: 0x5e */ + +static const GLUTStrokeVertex ch94st0[] = +{ + {44.0752f,109.5238f}, + {5.9800f,42.8571f} +}; + +static const GLUTStrokeVertex ch94st1[] = +{ + {44.0752f,109.5238f}, + {82.1705f,42.8571f} +}; + +static const GLUTStrokeStrip ch94st[] = +{ + {2,ch94st0}, + {2,ch94st1} +}; + +static const GLUTStrokeChar ch94 = {90.2305f,2,ch94st}; + +/* char: 0x5f */ + +static const GLUTStrokeVertex ch95st0[] = +{ + {-1.1000f,-33.3333f}, + {103.6619f,-33.3333f}, + {103.6619f,-28.5714f}, + {-1.1000f,-28.5714f}, + {-1.1000f,-33.3333f} +}; + +static const GLUTStrokeStrip ch95st[] = +{ + {5,ch95st0} +}; + +static const GLUTStrokeChar ch95 = {104.0619f,1,ch95st}; + +/* char: 0x60 */ + +static const GLUTStrokeVertex ch96st0[] = +{ + {33.0219f,100.0000f}, + {56.8314f,71.4286f} +}; + +static const GLUTStrokeVertex ch96st1[] = +{ + {33.0219f,100.0000f}, + {28.2600f,95.2381f}, + {56.8314f,71.4286f} +}; + +static const GLUTStrokeStrip ch96st[] = +{ + {2,ch96st0}, + {3,ch96st1} +}; + +static const GLUTStrokeChar ch96 = {83.5714f,2,ch96st}; + +/* char: 0x61 */ + +static const GLUTStrokeVertex ch97st0[] = +{ + {63.8229f,66.6667f}, + {63.8229f,0.0000f} +}; + +static const GLUTStrokeVertex ch97st1[] = +{ + {63.8229f,52.3810f}, + {54.2990f,61.9048f}, + {44.7752f,66.6667f}, + {30.4895f,66.6667f}, + {20.9657f,61.9048f}, + {11.4419f,52.3810f}, + {6.6800f,38.0952f}, + {6.6800f,28.5714f}, + {11.4419f,14.2857f}, + {20.9657f,4.7619f}, + {30.4895f,0.0000f}, + {44.7752f,0.0000f}, + {54.2990f,4.7619f}, + {63.8229f,14.2857f} +}; + +static const GLUTStrokeStrip ch97st[] = +{ + {2,ch97st0}, + {14,ch97st1} +}; + +static const GLUTStrokeChar ch97 = {66.6029f,2,ch97st}; + +/* char: 0x62 */ + +static const GLUTStrokeVertex ch98st0[] = +{ + {8.7600f,100.0000f}, + {8.7600f,0.0000f} +}; + +static const GLUTStrokeVertex ch98st1[] = +{ + {8.7600f,52.3810f}, + {18.2838f,61.9048f}, + {27.8076f,66.6667f}, + {42.0933f,66.6667f}, + {51.6171f,61.9048f}, + {61.1410f,52.3810f}, + {65.9029f,38.0952f}, + {65.9029f,28.5714f}, + {61.1410f,14.2857f}, + {51.6171f,4.7619f}, + {42.0933f,0.0000f}, + {27.8076f,0.0000f}, + {18.2838f,4.7619f}, + {8.7600f,14.2857f} +}; + +static const GLUTStrokeStrip ch98st[] = +{ + {2,ch98st0}, + {14,ch98st1} +}; + +static const GLUTStrokeChar ch98 = {70.4629f,2,ch98st}; + +/* char: 0x63 */ + +static const GLUTStrokeVertex ch99st0[] = +{ + {62.6629f,52.3810f}, + {53.1390f,61.9048f}, + {43.6152f,66.6667f}, + {29.3295f,66.6667f}, + {19.8057f,61.9048f}, + {10.2819f,52.3810f}, + {5.5200f,38.0952f}, + {5.5200f,28.5714f}, + {10.2819f,14.2857f}, + {19.8057f,4.7619f}, + {29.3295f,0.0000f}, + {43.6152f,0.0000f}, + {53.1390f,4.7619f}, + {62.6629f,14.2857f} +}; + +static const GLUTStrokeStrip ch99st[] = +{ + {14,ch99st0} +}; + +static const GLUTStrokeChar ch99 = {68.9229f,1,ch99st}; + +/* char: 0x64 */ + +static const GLUTStrokeVertex ch100st0[] = +{ + {61.7829f,100.0000f}, + {61.7829f,0.0000f} +}; + +static const GLUTStrokeVertex ch100st1[] = +{ + {61.7829f,52.3810f}, + {52.2590f,61.9048f}, + {42.7352f,66.6667f}, + {28.4495f,66.6667f}, + {18.9257f,61.9048f}, + {9.4019f,52.3810f}, + {4.6400f,38.0952f}, + {4.6400f,28.5714f}, + {9.4019f,14.2857f}, + {18.9257f,4.7619f}, + {28.4495f,0.0000f}, + {42.7352f,0.0000f}, + {52.2590f,4.7619f}, + {61.7829f,14.2857f} +}; + +static const GLUTStrokeStrip ch100st[] = +{ + {2,ch100st0}, + {14,ch100st1} +}; + +static const GLUTStrokeChar ch100 = {70.2629f,2,ch100st}; + +/* char: 0x65 */ + +static const GLUTStrokeVertex ch101st0[] = +{ + {5.7200f,38.0952f}, + {62.8629f,38.0952f}, + {62.8629f,47.6190f}, + {58.1010f,57.1429f}, + {53.3390f,61.9048f}, + {43.8152f,66.6667f}, + {29.5295f,66.6667f}, + {20.0057f,61.9048f}, + {10.4819f,52.3810f}, + {5.7200f,38.0952f}, + {5.7200f,28.5714f}, + {10.4819f,14.2857f}, + {20.0057f,4.7619f}, + {29.5295f,0.0000f}, + {43.8152f,0.0000f}, + {53.3390f,4.7619f}, + {62.8629f,14.2857f} +}; + +static const GLUTStrokeStrip ch101st[] = +{ + {17,ch101st0} +}; + +static const GLUTStrokeChar ch101 = {68.5229f,1,ch101st}; + +/* char: 0x66 */ + +static const GLUTStrokeVertex ch102st0[] = +{ + {38.7752f,100.0000f}, + {29.2514f,100.0000f}, + {19.7276f,95.2381f}, + {14.9657f,80.9524f}, + {14.9657f,0.0000f} +}; + +static const GLUTStrokeVertex ch102st1[] = +{ + {0.6800f,66.6667f}, + {34.0133f,66.6667f} +}; + +static const GLUTStrokeStrip ch102st[] = +{ + {5,ch102st0}, + {2,ch102st1} +}; + +static const GLUTStrokeChar ch102 = {38.6552f,2,ch102st}; + +/* char: 0x67 */ + +static const GLUTStrokeVertex ch103st0[] = +{ + {62.5029f,66.6667f}, + {62.5029f,-9.5238f}, + {57.7410f,-23.8095f}, + {52.9790f,-28.5714f}, + {43.4552f,-33.3333f}, + {29.1695f,-33.3333f}, + {19.6457f,-28.5714f} +}; + +static const GLUTStrokeVertex ch103st1[] = +{ + {62.5029f,52.3810f}, + {52.9790f,61.9048f}, + {43.4552f,66.6667f}, + {29.1695f,66.6667f}, + {19.6457f,61.9048f}, + {10.1219f,52.3810f}, + {5.3600f,38.0952f}, + {5.3600f,28.5714f}, + {10.1219f,14.2857f}, + {19.6457f,4.7619f}, + {29.1695f,0.0000f}, + {43.4552f,0.0000f}, + {52.9790f,4.7619f}, + {62.5029f,14.2857f} +}; + +static const GLUTStrokeStrip ch103st[] = +{ + {7,ch103st0}, + {14,ch103st1} +}; + +static const GLUTStrokeChar ch103 = {70.9829f,2,ch103st}; + +/* char: 0x68 */ + +static const GLUTStrokeVertex ch104st0[] = +{ + {9.6000f,100.0000f}, + {9.6000f,0.0000f} +}; + +static const GLUTStrokeVertex ch104st1[] = +{ + {9.6000f,47.6190f}, + {23.8857f,61.9048f}, + {33.4095f,66.6667f}, + {47.6952f,66.6667f}, + {57.2190f,61.9048f}, + {61.9810f,47.6190f}, + {61.9810f,0.0000f} +}; + +static const GLUTStrokeStrip ch104st[] = +{ + {2,ch104st0}, + {7,ch104st1} +}; + +static const GLUTStrokeChar ch104 = {71.0210f,2,ch104st}; + +/* char: 0x69 */ + +static const GLUTStrokeVertex ch105st0[] = +{ + {10.0200f,100.0000f}, + {14.7819f,95.2381f}, + {19.5438f,100.0000f}, + {14.7819f,104.7619f}, + {10.0200f,100.0000f} +}; + +static const GLUTStrokeVertex ch105st1[] = +{ + {14.7819f,66.6667f}, + {14.7819f,0.0000f} +}; + +static const GLUTStrokeStrip ch105st[] = +{ + {5,ch105st0}, + {2,ch105st1} +}; + +static const GLUTStrokeChar ch105 = {28.8638f,2,ch105st}; + +/* char: 0x6a */ + +static const GLUTStrokeVertex ch106st0[] = +{ + {17.3876f,100.0000f}, + {22.1495f,95.2381f}, + {26.9114f,100.0000f}, + {22.1495f,104.7619f}, + {17.3876f,100.0000f} +}; + +static const GLUTStrokeVertex ch106st1[] = +{ + {22.1495f,66.6667f}, + {22.1495f,-14.2857f}, + {17.3876f,-28.5714f}, + {7.8638f,-33.3333f}, + {-1.6600f,-33.3333f} +}; + +static const GLUTStrokeStrip ch106st[] = +{ + {5,ch106st0}, + {5,ch106st1} +}; + +static const GLUTStrokeChar ch106 = {36.2314f,2,ch106st}; + +/* char: 0x6b */ + +static const GLUTStrokeVertex ch107st0[] = +{ + {9.6000f,100.0000f}, + {9.6000f,0.0000f} +}; + +static const GLUTStrokeVertex ch107st1[] = +{ + {57.2190f,66.6667f}, + {9.6000f,19.0476f} +}; + +static const GLUTStrokeVertex ch107st2[] = +{ + {28.6476f,38.0952f}, + {61.9810f,0.0000f} +}; + +static const GLUTStrokeStrip ch107st[] = +{ + {2,ch107st0}, + {2,ch107st1}, + {2,ch107st2} +}; + +static const GLUTStrokeChar ch107 = {62.5210f,3,ch107st}; + +/* char: 0x6c */ + +static const GLUTStrokeVertex ch108st0[] = +{ + {10.0200f,100.0000f}, + {10.0200f,0.0000f} +}; + +static const GLUTStrokeStrip ch108st[] = +{ + {2,ch108st0} +}; + +static const GLUTStrokeChar ch108 = {19.3400f,1,ch108st}; + +/* char: 0x6d */ + +static const GLUTStrokeVertex ch109st0[] = +{ + {9.6000f,66.6667f}, + {9.6000f,0.0000f} +}; + +static const GLUTStrokeVertex ch109st1[] = +{ + {9.6000f,47.6190f}, + {23.8857f,61.9048f}, + {33.4095f,66.6667f}, + {47.6952f,66.6667f}, + {57.2190f,61.9048f}, + {61.9810f,47.6190f}, + {61.9810f,0.0000f} +}; + +static const GLUTStrokeVertex ch109st2[] = +{ + {61.9810f,47.6190f}, + {76.2667f,61.9048f}, + {85.7905f,66.6667f}, + {100.0762f,66.6667f}, + {109.6000f,61.9048f}, + {114.3619f,47.6190f}, + {114.3619f,0.0000f} +}; + +static const GLUTStrokeStrip ch109st[] = +{ + {2,ch109st0}, + {7,ch109st1}, + {7,ch109st2} +}; + +static const GLUTStrokeChar ch109 = {123.9619f,3,ch109st}; + +/* char: 0x6e */ + +static const GLUTStrokeVertex ch110st0[] = +{ + {9.1800f,66.6667f}, + {9.1800f,0.0000f} +}; + +static const GLUTStrokeVertex ch110st1[] = +{ + {9.1800f,47.6190f}, + {23.4657f,61.9048f}, + {32.9895f,66.6667f}, + {47.2752f,66.6667f}, + {56.7990f,61.9048f}, + {61.5610f,47.6190f}, + {61.5610f,0.0000f} +}; + +static const GLUTStrokeStrip ch110st[] = +{ + {2,ch110st0}, + {7,ch110st1} +}; + +static const GLUTStrokeChar ch110 = {70.8810f,2,ch110st}; + +/* char: 0x6f */ + +static const GLUTStrokeVertex ch111st0[] = +{ + {28.7895f,66.6667f}, + {19.2657f,61.9048f}, + {9.7419f,52.3810f}, + {4.9800f,38.0952f}, + {4.9800f,28.5714f}, + {9.7419f,14.2857f}, + {19.2657f,4.7619f}, + {28.7895f,0.0000f}, + {43.0752f,0.0000f}, + {52.5990f,4.7619f}, + {62.1229f,14.2857f}, + {66.8848f,28.5714f}, + {66.8848f,38.0952f}, + {62.1229f,52.3810f}, + {52.5990f,61.9048f}, + {43.0752f,66.6667f}, + {28.7895f,66.6667f} +}; + +static const GLUTStrokeStrip ch111st[] = +{ + {17,ch111st0} +}; + +static const GLUTStrokeChar ch111 = {71.7448f,1,ch111st}; + +/* char: 0x70 */ + +static const GLUTStrokeVertex ch112st0[] = +{ + {9.4600f,66.6667f}, + {9.4600f,-33.3333f} +}; + +static const GLUTStrokeVertex ch112st1[] = +{ + {9.4600f,52.3810f}, + {18.9838f,61.9048f}, + {28.5076f,66.6667f}, + {42.7933f,66.6667f}, + {52.3171f,61.9048f}, + {61.8410f,52.3810f}, + {66.6029f,38.0952f}, + {66.6029f,28.5714f}, + {61.8410f,14.2857f}, + {52.3171f,4.7619f}, + {42.7933f,0.0000f}, + {28.5076f,0.0000f}, + {18.9838f,4.7619f}, + {9.4600f,14.2857f} +}; + +static const GLUTStrokeStrip ch112st[] = +{ + {2,ch112st0}, + {14,ch112st1} +}; + +static const GLUTStrokeChar ch112 = {70.8029f,2,ch112st}; + +/* char: 0x71 */ + +static const GLUTStrokeVertex ch113st0[] = +{ + {61.9829f,66.6667f}, + {61.9829f,-33.3333f} +}; + +static const GLUTStrokeVertex ch113st1[] = +{ + {61.9829f,52.3810f}, + {52.4590f,61.9048f}, + {42.9352f,66.6667f}, + {28.6495f,66.6667f}, + {19.1257f,61.9048f}, + {9.6019f,52.3810f}, + {4.8400f,38.0952f}, + {4.8400f,28.5714f}, + {9.6019f,14.2857f}, + {19.1257f,4.7619f}, + {28.6495f,0.0000f}, + {42.9352f,0.0000f}, + {52.4590f,4.7619f}, + {61.9829f,14.2857f} +}; + +static const GLUTStrokeStrip ch113st[] = +{ + {2,ch113st0}, + {14,ch113st1} +}; + +static const GLUTStrokeChar ch113 = {70.7429f,2,ch113st}; + +/* char: 0x72 */ + +static const GLUTStrokeVertex ch114st0[] = +{ + {9.4600f,66.6667f}, + {9.4600f,0.0000f} +}; + +static const GLUTStrokeVertex ch114st1[] = +{ + {9.4600f,38.0952f}, + {14.2219f,52.3810f}, + {23.7457f,61.9048f}, + {33.2695f,66.6667f}, + {47.5552f,66.6667f} +}; + +static const GLUTStrokeStrip ch114st[] = +{ + {2,ch114st0}, + {5,ch114st1} +}; + +static const GLUTStrokeChar ch114 = {49.4952f,2,ch114st}; + +/* char: 0x73 */ + +static const GLUTStrokeVertex ch115st0[] = +{ + {57.0810f,52.3810f}, + {52.3190f,61.9048f}, + {38.0333f,66.6667f}, + {23.7476f,66.6667f}, + {9.4619f,61.9048f}, + {4.7000f,52.3810f}, + {9.4619f,42.8571f}, + {18.9857f,38.0952f}, + {42.7952f,33.3333f}, + {52.3190f,28.5714f}, + {57.0810f,19.0476f}, + {57.0810f,14.2857f}, + {52.3190f,4.7619f}, + {38.0333f,0.0000f}, + {23.7476f,0.0000f}, + {9.4619f,4.7619f}, + {4.7000f,14.2857f} +}; + +static const GLUTStrokeStrip ch115st[] = +{ + {17,ch115st0} +}; + +static const GLUTStrokeChar ch115 = {62.3210f,1,ch115st}; + +/* char: 0x74 */ + +static const GLUTStrokeVertex ch116st0[] = +{ + {14.8257f,100.0000f}, + {14.8257f,19.0476f}, + {19.5876f,4.7619f}, + {29.1114f,0.0000f}, + {38.6352f,0.0000f} +}; + +static const GLUTStrokeVertex ch116st1[] = +{ + {0.5400f,66.6667f}, + {33.8733f,66.6667f} +}; + +static const GLUTStrokeStrip ch116st[] = +{ + {5,ch116st0}, + {2,ch116st1} +}; + +static const GLUTStrokeChar ch116 = {39.3152f,2,ch116st}; + +/* char: 0x75 */ + +static const GLUTStrokeVertex ch117st0[] = +{ + {9.4600f,66.6667f}, + {9.4600f,19.0476f}, + {14.2219f,4.7619f}, + {23.7457f,0.0000f}, + {38.0314f,0.0000f}, + {47.5552f,4.7619f}, + {61.8410f,19.0476f} +}; + +static const GLUTStrokeVertex ch117st1[] = +{ + {61.8410f,66.6667f}, + {61.8410f,0.0000f} +}; + +static const GLUTStrokeStrip ch117st[] = +{ + {7,ch117st0}, + {2,ch117st1} +}; + +static const GLUTStrokeChar ch117 = {71.1610f,2,ch117st}; + +/* char: 0x76 */ + +static const GLUTStrokeVertex ch118st0[] = +{ + {1.8000f,66.6667f}, + {30.3714f,0.0000f} +}; + +static const GLUTStrokeVertex ch118st1[] = +{ + {58.9429f,66.6667f}, + {30.3714f,0.0000f} +}; + +static const GLUTStrokeStrip ch118st[] = +{ + {2,ch118st0}, + {2,ch118st1} +}; + +static const GLUTStrokeChar ch118 = {60.6029f,2,ch118st}; + +/* char: 0x77 */ + +static const GLUTStrokeVertex ch119st0[] = +{ + {2.5000f,66.6667f}, + {21.5476f,0.0000f} +}; + +static const GLUTStrokeVertex ch119st1[] = +{ + {40.5952f,66.6667f}, + {21.5476f,0.0000f} +}; + +static const GLUTStrokeVertex ch119st2[] = +{ + {40.5952f,66.6667f}, + {59.6429f,0.0000f} +}; + +static const GLUTStrokeVertex ch119st3[] = +{ + {78.6905f,66.6667f}, + {59.6429f,0.0000f} +}; + +static const GLUTStrokeStrip ch119st[] = +{ + {2,ch119st0}, + {2,ch119st1}, + {2,ch119st2}, + {2,ch119st3} +}; + +static const GLUTStrokeChar ch119 = {80.4905f,4,ch119st}; + +/* char: 0x78 */ + +static const GLUTStrokeVertex ch120st0[] = +{ + {1.6600f,66.6667f}, + {54.0410f,0.0000f} +}; + +static const GLUTStrokeVertex ch120st1[] = +{ + {54.0410f,66.6667f}, + {1.6600f,0.0000f} +}; + +static const GLUTStrokeStrip ch120st[] = +{ + {2,ch120st0}, + {2,ch120st1} +}; + +static const GLUTStrokeChar ch120 = {56.4010f,2,ch120st}; + +/* char: 0x79 */ + +static const GLUTStrokeVertex ch121st0[] = +{ + {6.5619f,66.6667f}, + {35.1333f,0.0000f} +}; + +static const GLUTStrokeVertex ch121st1[] = +{ + {63.7048f,66.6667f}, + {35.1333f,0.0000f}, + {25.6095f,-19.0476f}, + {16.0857f,-28.5714f}, + {6.5619f,-33.3333f}, + {1.8000f,-33.3333f} +}; + +static const GLUTStrokeStrip ch121st[] = +{ + {2,ch121st0}, + {6,ch121st1} +}; + +static const GLUTStrokeChar ch121 = {66.0648f,2,ch121st}; + +/* char: 0x7a */ + +static const GLUTStrokeVertex ch122st0[] = +{ + {56.8210f,66.6667f}, + {4.4400f,0.0000f} +}; + +static const GLUTStrokeVertex ch122st1[] = +{ + {4.4400f,66.6667f}, + {56.8210f,66.6667f} +}; + +static const GLUTStrokeVertex ch122st2[] = +{ + {4.4400f,0.0000f}, + {56.8210f,0.0000f} +}; + +static const GLUTStrokeStrip ch122st[] = +{ + {2,ch122st0}, + {2,ch122st1}, + {2,ch122st2} +}; + +static const GLUTStrokeChar ch122 = {61.8210f,3,ch122st}; + +/* char: 0x7b */ + +static const GLUTStrokeVertex ch123st0[] = +{ + {31.1895f,119.0476f}, + {21.6657f,114.2857f}, + {16.9038f,109.5238f}, + {12.1419f,100.0000f}, + {12.1419f,90.4762f}, + {16.9038f,80.9524f}, + {21.6657f,76.1905f}, + {26.4276f,66.6667f}, + {26.4276f,57.1429f}, + {16.9038f,47.6190f} +}; + +static const GLUTStrokeVertex ch123st1[] = +{ + {21.6657f,114.2857f}, + {16.9038f,104.7619f}, + {16.9038f,95.2381f}, + {21.6657f,85.7143f}, + {26.4276f,80.9524f}, + {31.1895f,71.4286f}, + {31.1895f,61.9048f}, + {26.4276f,52.3810f}, + {7.3800f,42.8571f}, + {26.4276f,33.3333f}, + {31.1895f,23.8095f}, + {31.1895f,14.2857f}, + {26.4276f,4.7619f}, + {21.6657f,0.0000f}, + {16.9038f,-9.5238f}, + {16.9038f,-19.0476f}, + {21.6657f,-28.5714f} +}; + +static const GLUTStrokeVertex ch123st2[] = +{ + {16.9038f,38.0952f}, + {26.4276f,28.5714f}, + {26.4276f,19.0476f}, + {21.6657f,9.5238f}, + {16.9038f,4.7619f}, + {12.1419f,-4.7619f}, + {12.1419f,-14.2857f}, + {16.9038f,-23.8095f}, + {21.6657f,-28.5714f}, + {31.1895f,-33.3333f} +}; + +static const GLUTStrokeStrip ch123st[] = +{ + {10,ch123st0}, + {17,ch123st1}, + {10,ch123st2} +}; + +static const GLUTStrokeChar ch123 = {41.6295f,3,ch123st}; + +/* char: 0x7c */ + +static const GLUTStrokeVertex ch124st0[] = +{ + {11.5400f,119.0476f}, + {11.5400f,-33.3333f} +}; + +static const GLUTStrokeStrip ch124st[] = +{ + {2,ch124st0} +}; + +static const GLUTStrokeChar ch124 = {23.7800f,1,ch124st}; + +/* char: 0x7d */ + +static const GLUTStrokeVertex ch125st0[] = +{ + {9.1800f,119.0476f}, + {18.7038f,114.2857f}, + {23.4657f,109.5238f}, + {28.2276f,100.0000f}, + {28.2276f,90.4762f}, + {23.4657f,80.9524f}, + {18.7038f,76.1905f}, + {13.9419f,66.6667f}, + {13.9419f,57.1429f}, + {23.4657f,47.6190f} +}; + +static const GLUTStrokeVertex ch125st1[] = +{ + {18.7038f,114.2857f}, + {23.4657f,104.7619f}, + {23.4657f,95.2381f}, + {18.7038f,85.7143f}, + {13.9419f,80.9524f}, + {9.1800f,71.4286f}, + {9.1800f,61.9048f}, + {13.9419f,52.3810f}, + {32.9895f,42.8571f}, + {13.9419f,33.3333f}, + {9.1800f,23.8095f}, + {9.1800f,14.2857f}, + {13.9419f,4.7619f}, + {18.7038f,0.0000f}, + {23.4657f,-9.5238f}, + {23.4657f,-19.0476f}, + {18.7038f,-28.5714f} +}; + +static const GLUTStrokeVertex ch125st2[] = +{ + {23.4657f,38.0952f}, + {13.9419f,28.5714f}, + {13.9419f,19.0476f}, + {18.7038f,9.5238f}, + {23.4657f,4.7619f}, + {28.2276f,-4.7619f}, + {28.2276f,-14.2857f}, + {23.4657f,-23.8095f}, + {18.7038f,-28.5714f}, + {9.1800f,-33.3333f} +}; + +static const GLUTStrokeStrip ch125st[] = +{ + {10,ch125st0}, + {17,ch125st1}, + {10,ch125st2} +}; + +static const GLUTStrokeChar ch125 = {41.4695f,3,ch125st}; + +/* char: 0x7e */ + +static const GLUTStrokeVertex ch126st0[] = +{ + {2.9200f,28.5714f}, + {2.9200f,38.0952f}, + {7.6819f,52.3810f}, + {17.2057f,57.1429f}, + {26.7295f,57.1429f}, + {36.2533f,52.3810f}, + {55.3010f,38.0952f}, + {64.8248f,33.3333f}, + {74.3486f,33.3333f}, + {83.8724f,38.0952f}, + {88.6343f,47.6190f} +}; + +static const GLUTStrokeVertex ch126st1[] = +{ + {2.9200f,38.0952f}, + {7.6819f,47.6190f}, + {17.2057f,52.3810f}, + {26.7295f,52.3810f}, + {36.2533f,47.6190f}, + {55.3010f,33.3333f}, + {64.8248f,28.5714f}, + {74.3486f,28.5714f}, + {83.8724f,33.3333f}, + {88.6343f,47.6190f}, + {88.6343f,57.1429f} +}; + +static const GLUTStrokeStrip ch126st[] = +{ + {11,ch126st0}, + {11,ch126st1} +}; + +static const GLUTStrokeChar ch126 = {91.2743f,2,ch126st}; + +static const GLUTStrokeChar *chars[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126 +}; + +const GLUTStrokeFont glutStrokeRoman = {"Roman",128,chars,152.3809f,33.3333f}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/shapes.c xpsb-glx-0.19/mesa/src/glut/dos/shapes.c --- xpsb-glx-0.19/mesa/src/glut/dos/shapes.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/shapes.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1143 @@ +/* + * freeglut_geometry.c + * + * Freeglut geometry rendering methods. + * + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. + * Written by Pawel W. Olszta, + * Creation date: Fri Dec 3 1999 + * + * 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 + * PAWEL W. OLSZTA 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 +#include "internal.h" + +/* + * TODO BEFORE THE STABLE RELEASE: + * + * Following functions have been contributed by Andreas Umbach. + * + * glutWireCube() -- looks OK + * glutSolidCube() -- OK + * + * Those functions have been implemented by John Fay. + * + * glutWireTorus() -- looks OK + * glutSolidTorus() -- looks OK + * glutWireDodecahedron() -- looks OK + * glutSolidDodecahedron() -- looks OK + * glutWireOctahedron() -- looks OK + * glutSolidOctahedron() -- looks OK + * glutWireTetrahedron() -- looks OK + * glutSolidTetrahedron() -- looks OK + * glutWireIcosahedron() -- looks OK + * glutSolidIcosahedron() -- looks OK + * + * The Following functions have been updated by Nigel Stewart, based + * on FreeGLUT 2.0.0 implementations: + * + * glutWireSphere() -- looks OK + * glutSolidSphere() -- looks OK + * glutWireCone() -- looks OK + * glutSolidCone() -- looks OK + */ + + +/* -- INTERFACE FUNCTIONS -------------------------------------------------- */ + +/* + * Draws a wireframed cube. Code contributed by Andreas Umbach + */ +void GLUTAPIENTRY glutWireCube( GLdouble dSize ) +{ + double size = dSize * 0.5; + +# define V(a,b,c) glVertex3d( a size, b size, c size ); +# define N(a,b,c) glNormal3d( a, b, c ); + + /* + * PWO: I dared to convert the code to use macros... + */ + glBegin( GL_LINE_LOOP ); N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+); glEnd(); + glBegin( GL_LINE_LOOP ); N( 0.0, 1.0, 0.0); V(+,+,+); V(+,+,-); V(-,+,-); V(-,+,+); glEnd(); + glBegin( GL_LINE_LOOP ); N( 0.0, 0.0, 1.0); V(+,+,+); V(-,+,+); V(-,-,+); V(+,-,+); glEnd(); + glBegin( GL_LINE_LOOP ); N(-1.0, 0.0, 0.0); V(-,-,+); V(-,+,+); V(-,+,-); V(-,-,-); glEnd(); + glBegin( GL_LINE_LOOP ); N( 0.0,-1.0, 0.0); V(-,-,+); V(-,-,-); V(+,-,-); V(+,-,+); glEnd(); + glBegin( GL_LINE_LOOP ); N( 0.0, 0.0,-1.0); V(-,-,-); V(-,+,-); V(+,+,-); V(+,-,-); glEnd(); + +# undef V +# undef N +} + +/* + * Draws a solid cube. Code contributed by Andreas Umbach + */ +void GLUTAPIENTRY glutSolidCube( GLdouble dSize ) +{ + double size = dSize * 0.5; + +# define V(a,b,c) glVertex3d( a size, b size, c size ); +# define N(a,b,c) glNormal3d( a, b, c ); + + /* + * PWO: Again, I dared to convert the code to use macros... + */ + glBegin( GL_QUADS ); + N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+); + N( 0.0, 1.0, 0.0); V(+,+,+); V(+,+,-); V(-,+,-); V(-,+,+); + N( 0.0, 0.0, 1.0); V(+,+,+); V(-,+,+); V(-,-,+); V(+,-,+); + N(-1.0, 0.0, 0.0); V(-,-,+); V(-,+,+); V(-,+,-); V(-,-,-); + N( 0.0,-1.0, 0.0); V(-,-,+); V(-,-,-); V(+,-,-); V(+,-,+); + N( 0.0, 0.0,-1.0); V(-,-,-); V(-,+,-); V(+,+,-); V(+,-,-); + glEnd(); + +# undef V +# undef N +} + +/* + * Compute lookup table of cos and sin values forming a cirle + * + * Notes: + * It is the responsibility of the caller to free these tables + * The size of the table is (n+1) to form a connected loop + * The last entry is exactly the same as the first + * The sign of n can be flipped to get the reverse loop + */ + +static void circleTable(double **sint,double **cost,const int n) +{ + int i; + + /* Table size, the sign of n flips the circle direction */ + + const int size = abs(n); + + /* Determine the angle between samples */ + + const double angle = 2*M_PI/(double)n; + + /* Allocate memory for n samples, plus duplicate of first entry at the end */ + + *sint = (double *) calloc(sizeof(double), size+1); + *cost = (double *) calloc(sizeof(double), size+1); + + /* Bail out if memory allocation fails, fgError never returns */ + + if (!(*sint) || !(*cost)) + { + free(*sint); + free(*cost); + _glut_fatal("Failed to allocate memory in circleTable"); + } + + /* Compute cos and sin around the circle */ + + for (i=0; i=0; j--) + { + glNormal3d(cost1[j]*r1, sint1[j]*r1, z1 ); + glVertex3d(cost1[j]*r1*radius, sint1[j]*r1*radius, z1*radius); + } + + glEnd(); + + /* Cover each stack with a quad strip, except the top and bottom stacks */ + + for( i=1; i=0; j--) + glVertex3d(cost[j]*radius, sint[j]*radius, height); + glEnd(); + + /* Do the stacks */ + + z0 = 0.0; + z1 = zStep; + + for (i=1; i<=stacks; i++) + { + if (i==stacks) + z1 = height; + + glBegin(GL_QUAD_STRIP); + for (j=0; j<=slices; j++ ) + { + glNormal3d(cost[j], sint[j], 0.0 ); + glVertex3d(cost[j]*radius, sint[j]*radius, z0 ); + glVertex3d(cost[j]*radius, sint[j]*radius, z1 ); + } + glEnd(); + + z0 = z1; z1 += zStep; + } + + /* Release sin and cos tables */ + + free(sint); + free(cost); +} + +/* + * Draws a wire cylinder + */ +void GLUTAPIENTRY glutWireCylinder(GLdouble radius, GLdouble height, GLint slices, GLint stacks) +{ + int i,j; + + /* Step in z and radius as stacks are drawn. */ + + double z = 0.0; + const double zStep = height/stacks; + + /* Pre-computed circle */ + + double *sint,*cost; + circleTable(&sint,&cost,-slices); + + /* Draw the stacks... */ + + for (i=0; i<=stacks; i++) + { + if (i==stacks) + z = height; + + glBegin(GL_LINE_LOOP); + + for( j=0; j + +#include "internal.h" + + +#define FREQUENCY 100 /* set this to zero to use the default timer */ + + +static int timer_installed; +#if FREQUENCY +static volatile int ticks; + + +static void +ticks_timer (void *p) +{ + (void)p; + ticks++; +} ENDOFUNC(ticks_timer) +#else +#include + +static struct timeval then; +#endif + + +int APIENTRY +glutGet (GLenum type) +{ + switch (type) { + case GLUT_WINDOW_X: + return _glut_current->xpos; + case GLUT_WINDOW_Y: + return _glut_current->ypos; + case GLUT_WINDOW_WIDTH: + return _glut_current->width; + case GLUT_WINDOW_HEIGHT: + return _glut_current->height; + case GLUT_WINDOW_STENCIL_SIZE: + return _glut_visual.stencil; + case GLUT_WINDOW_DEPTH_SIZE: + return _glut_visual.depth; + case GLUT_WINDOW_RGBA: + return !(_glut_default.mode & GLUT_INDEX); + case GLUT_WINDOW_COLORMAP_SIZE: + return (_glut_default.mode & GLUT_INDEX) ? (256 - RESERVED_COLORS) : 0; + case GLUT_SCREEN_WIDTH: + return _glut_visual.geometry[0]; + case GLUT_SCREEN_HEIGHT: + return _glut_visual.geometry[1]; + case GLUT_INIT_WINDOW_X: + return _glut_default.x; + case GLUT_INIT_WINDOW_Y: + return _glut_default.y; + case GLUT_INIT_WINDOW_WIDTH: + return _glut_default.width; + case GLUT_INIT_WINDOW_HEIGHT: + return _glut_default.height; + case GLUT_INIT_DISPLAY_MODE: + return _glut_default.mode; + case GLUT_ELAPSED_TIME: +#if FREQUENCY + if (!timer_installed) { + timer_installed = GL_TRUE; + LOCKDATA(ticks); + LOCKFUNC(ticks_timer); + pc_install_int(ticks_timer, NULL, FREQUENCY); + } + return ticks * 1000 / FREQUENCY; +#else + if (!timer_installed) { + timer_installed = GL_TRUE; + gettimeofday(&then, NULL); + return 0; + } else { + struct timeval now; + gettimeofday(&now, NULL); + return (now.tv_usec - then.tv_usec) / 1000 + + (now.tv_sec - then.tv_sec) * 1000; + } +#endif + default: + return -1; + } +} + + +int APIENTRY +glutDeviceGet (GLenum type) +{ + switch (type) { + case GLUT_HAS_KEYBOARD: + return GL_TRUE; + case GLUT_HAS_MOUSE: + return (_glut_mouse != 0); + case GLUT_NUM_MOUSE_BUTTONS: + return _glut_mouse; + case GLUT_HAS_SPACEBALL: + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + case GLUT_HAS_TABLET: + return GL_FALSE; + case GLUT_NUM_SPACEBALL_BUTTONS: + case GLUT_NUM_BUTTON_BOX_BUTTONS: + case GLUT_NUM_DIALS: + case GLUT_NUM_TABLET_BUTTONS: + return 0; + default: + return -1; + } +} + + +int APIENTRY +glutGetModifiers (void) +{ + int mod = 0; + int shifts = pc_keyshifts(); + + if (shifts & (KB_SHIFT_FLAG | KB_CAPSLOCK_FLAG)) { + mod |= GLUT_ACTIVE_SHIFT; + } + + if (shifts & KB_ALT_FLAG) { + mod |= GLUT_ACTIVE_ALT; + } + + if (shifts & KB_CTRL_FLAG) { + mod |= GLUT_ACTIVE_CTRL; + } + + return mod; +} + + +void APIENTRY +glutReportErrors (void) +{ + /* reports all the OpenGL errors that happened till now */ +} + + +/* GAME MODE + * Hack alert: incomplete... what is GameMode, anyway? + */ +static GLint game; +static GLboolean game_possible; +static GLboolean game_active; +static GLuint game_width; +static GLuint game_height; +static GLuint game_bpp; +static GLuint game_refresh; + + +void APIENTRY +glutGameModeString (const char *string) +{ + if (sscanf(string, "%ux%u:%u@%u", &game_width, &game_height, &game_bpp, &game_refresh) == 4) { + game_possible = GL_TRUE; + } +} + + +int APIENTRY +glutGameModeGet (GLenum mode) +{ + switch (mode) { + case GLUT_GAME_MODE_ACTIVE: + return game_active; + case GLUT_GAME_MODE_POSSIBLE: + return game_possible && !_glut_current; + case GLUT_GAME_MODE_WIDTH: + return game_active ? (int)game_width : -1; + case GLUT_GAME_MODE_HEIGHT: + return game_active ? (int)game_height : -1; + case GLUT_GAME_MODE_PIXEL_DEPTH: + return game_active ? (int)game_bpp : -1; + case GLUT_GAME_MODE_REFRESH_RATE: + return game_active ? (int)game_refresh : -1; + default: + return -1; + } +} + + +int APIENTRY +glutEnterGameMode (void) +{ + if (glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) { + _glut_visual.bpp = game_bpp; + _glut_visual.refresh = game_refresh; + + glutInitWindowSize(game_width, game_height); + + if ((game = glutCreateWindow("")) > 0) { + game_active = GL_TRUE; + } + + return game; + } else { + return 0; + } +} + + +void GLUTAPIENTRY +glutLeaveGameMode (void) +{ + if (glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) { + game_active = GL_FALSE; + + glutDestroyWindow(game); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/stroke.c xpsb-glx-0.19/mesa/src/glut/dos/stroke.c --- xpsb-glx-0.19/mesa/src/glut/dos/stroke.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/stroke.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,118 @@ +/* + * FxGLUT version 0.12 - GLUT for Voodoo 1 and 2 under Linux + * Copyright (C) 1999 Christopher John Purnell + * cjp@lost.org.uk + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "internal.h" + + +void +glutStrokeCharacter (void *font, int c) +{ + const GLUTStrokeFont *sfp = _glut_font(font); + const GLUTStrokeChar *scp; + const GLUTStrokeStrip *ssp; + const GLUTStrokeVertex *svp; + unsigned i, j; + + if (((unsigned)c) >= sfp->num || !(scp = sfp->table[c])) + return; + + ssp = scp->strip; + + for (i = 0; i < scp->num; i++, ssp++) { + svp = ssp->vertex; + + glBegin(GL_LINE_STRIP); + for (j = 0; j < ssp->num; j++, svp++) { + glVertex2f(svp->x, svp->y); + } + glEnd(); + } + + glTranslatef(scp->right, 0.0, 0.0); +} + + +void +glutStrokeString (void *font, const unsigned char *string) +{ + const GLUTStrokeFont *sfp = _glut_font(font); + const GLUTStrokeChar *scp; + const GLUTStrokeStrip *ssp; + const GLUTStrokeVertex *svp; + unsigned char c; + unsigned i, j; + + while ((c = *(string++))) { + if (c < sfp->num && (scp = sfp->table[c])) { + ssp = scp->strip; + + for (i = 0; i < scp->num; i++, ssp++) { + svp = ssp->vertex; + + glBegin(GL_LINE_STRIP); + for (j = 0; j < ssp->num; j++, svp++) { + glVertex2f(svp->x, svp->y); + } + glEnd(); + } + + glTranslatef(scp->right, 0.0, 0.0); + } + } +} + + +int +glutStrokeWidth (void *font, int c) +{ + const GLUTStrokeFont *sfp = _glut_font(font); + const GLUTStrokeChar *scp; + + if (((unsigned)c) >= sfp->num || !(scp = sfp->table[c])) + return 0; + + return scp->right; +} + + +int +glutStrokeLength (void *font, const unsigned char *string) +{ + const GLUTStrokeFont *sfp = _glut_font(font); + const GLUTStrokeChar *scp; + unsigned char c; + int length = 0; + + while ((c = *(string++))) { + if (c < sfp->num && (scp = sfp->table[c])) + length += scp->right; + } + + return length; +} + + +GLfloat +glutStrokeHeight (void *font) +{ + const GLUTStrokeFont *sfp = _glut_font(font); + + return sfp->height; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/teapot.c xpsb-glx-0.19/mesa/src/glut/dos/teapot.c --- xpsb-glx-0.19/mesa/src/glut/dos/teapot.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/teapot.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,201 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * + * ALL RIGHTS RESERVED + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that + * both the copyright notice and this permission notice appear in + * supporting documentation, and that the name of Silicon + * Graphics, Inc. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU + * "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR + * OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO + * EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE + * ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, + * INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, + * SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR + * NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY + * OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * US Government Users Restricted Rights + * + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer + * Software clause at DFARS 252.227-7013 and/or in similar or + * successor clauses in the FAR or the DOD or NASA FAR + * Supplement. Unpublished-- rights reserved under the copyright + * laws of the United States. Contractor/manufacturer is Silicon + * Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA + * 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ + +#include "internal.h" + +/* + * Rim, body, lid, and bottom data must be reflected in x and y; + * handle and spout data across the y axis only. + */ +static int patchdata[][16] = +{ + { 102, 103, 104, 105, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15 }, /* rim */ + { 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27 }, /* body */ + { 24, 25, 26, 27, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40 }, + { 96, 96, 96, 96, 97, 98, 99, 100, + 101, 101, 101, 101, 0, 1, 2, 3 }, /* lid */ + { 0, 1, 2, 3, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117 }, + { 118, 118, 118, 118, 124, 122, 119, 121, + 123, 126, 125, 120, 40, 39, 38, 37 }, /* bottom */ + { 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56 }, /* handle */ + { 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 28, 65, 66, 67 }, + { 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83 }, /* spout */ + { 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95 } +}; + +static float cpdata[][3] = +{ + {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, + {0,-0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, + {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, + {1.4375, 0, 2.53125}, {1.4375, -0.805, 2.53125}, + {0.805, -1.4375, 2.53125}, {0, -1.4375, 2.53125}, + {1.5, 0, 2.4}, {1.5, -0.84, 2.4}, {0.84, -1.5, 2.4}, + {0, -1.5, 2.4}, {1.75, 0, 1.875}, {1.75, -0.98, 1.875}, + {0.98, -1.75, 1.875}, {0, -1.75, 1.875}, {2, 0, 1.35}, + {2, -1.12, 1.35}, {1.12, -2, 1.35}, {0, -2, 1.35}, {2, 0, 0.9}, + {2, -1.12, 0.9}, {1.12, -2, 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, + {2, 0, 0.45}, {2, -1.12, 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, + {1.5, 0, 0.225}, {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, + {0, -1.5, 0.225}, {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, + {0.84, -1.5, 0.15}, {0, -1.5, 0.15}, {-1.6, 0, 2.025}, + {-1.6, -0.3, 2.025}, {-1.5, -0.3, 2.25}, {-1.5, 0, 2.25}, + {-2.3, 0, 2.025}, {-2.3, -0.3, 2.025}, {-2.5, -0.3, 2.25}, + {-2.5, 0, 2.25}, {-2.7, 0, 2.025}, {-2.7, -0.3, 2.025}, + {-3, -0.3, 2.25}, {-3, 0, 2.25}, {-2.7, 0, 1.8}, + {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, {-3, 0, 1.8}, + {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, -0.3, 1.35}, + {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, 1.125}, + {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, -0.3, 0.9}, + {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, 1.425}, + {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, 0.6}, + {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, 0.825}, + {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, + {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, + {2.7, -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, + {2.8, 0, 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, + {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, + {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, + {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, + {0, 0, 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, + {0.45, -0.8, 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, + {1.4, -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, + {0.4, 0, 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, + {0, -0.4, 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, + {0.728, -1.3, 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, + {1.3, -0.728, 2.4}, {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, + {0, 0, 0}, {1.425, -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, + {0.798, -1.425, 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, + {1.5, -0.84, 0.075}, {0.84, -1.5, 0.075} +}; + +static float tex[2][2][2] = +{ + { {0, 0}, {1, 0} }, + { {0, 1}, {1, 1} } +}; + +static void teapot( GLint grid, GLdouble scale, GLenum type ) +{ + float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; + long i, j, k, l; + + glPushAttrib( GL_ENABLE_BIT | GL_EVAL_BIT ); + glEnable( GL_AUTO_NORMAL ); + glEnable( GL_NORMALIZE ); + glEnable( GL_MAP2_VERTEX_3 ); + glEnable( GL_MAP2_TEXTURE_COORD_2 ); + + glPushMatrix(); + glRotatef(270.0, 1.0, 0.0, 0.0); + glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); + glTranslatef(0.0, 0.0, -1.5); + + for (i = 0; i < 10; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 4; k++) + { + for (l = 0; l < 3; l++) + { + p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 1) + q[j][k][l] *= -1.0; + if (i < 6) + { + r[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 0) + r[j][k][l] *= -1.0; + s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + if (l == 0) + s[j][k][l] *= -1.0; + if (l == 1) + s[j][k][l] *= -1.0; + } + } + } + } + + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, + &tex[0][0][0]); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &p[0][0][0]); + glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &q[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + if (i < 6) + { + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &r[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &s[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + } + } + + glPopMatrix(); + glPopAttrib(); +} + +void glutWireTeapot(GLdouble size) +{ + teapot(10, size, GL_LINE); +} + +void glutSolidTeapot(GLdouble size) +{ + teapot(7, size, GL_FILL); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/tr10.c xpsb-glx-0.19/mesa/src/glut/dos/tr10.c --- xpsb-glx-0.19/mesa/src/glut/dos/tr10.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/tr10.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1018 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch32data[] = { + 0x0 +}; +static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 2, ch32data }; + +static const unsigned char ch33data[] = { + 0x80,0x0,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch33 = { 1, 7, -1, 0, 3, ch33data }; + +static const unsigned char ch34data[] = { + 0xa0,0xa0 +}; +static const GLUTBitmapChar ch34 = { 3, 2, 0, -5, 4, ch34data }; + +static const unsigned char ch35data[] = { + 0x50,0x50,0xf8,0x50,0xf8,0x50,0x50 +}; +static const GLUTBitmapChar ch35 = { 5, 7, 0, 0, 5, ch35data }; + +static const unsigned char ch36data[] = { + 0x20,0xe0,0x90,0x10,0x60,0x80,0x90,0x70,0x20 +}; +static const GLUTBitmapChar ch36 = { 4, 9, 0, 1, 5, ch36data }; + +static const unsigned char ch37data[] = { + 0x44,0x2a,0x2a,0x56,0xa8,0xa4,0x7e +}; +static const GLUTBitmapChar ch37 = { 7, 7, 0, 0, 8, ch37data }; + +static const unsigned char ch38data[] = { + 0x76,0x8d,0x98,0x74,0x6e,0x50,0x30 +}; +static const GLUTBitmapChar ch38 = { 8, 7, 0, 0, 8, ch38data }; + +static const unsigned char ch39data[] = { + 0x40,0xc0 +}; +static const GLUTBitmapChar ch39 = { 2, 2, 0, -5, 3, ch39data }; + +static const unsigned char ch40data[] = { + 0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20 +}; +static const GLUTBitmapChar ch40 = { 3, 9, 0, 2, 4, ch40data }; + +static const unsigned char ch41data[] = { + 0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80 +}; +static const GLUTBitmapChar ch41 = { 3, 9, 0, 2, 4, ch41data }; + +static const unsigned char ch42data[] = { + 0xa0,0x40,0xa0 +}; +static const GLUTBitmapChar ch42 = { 3, 3, 0, -4, 5, ch42data }; + +static const unsigned char ch43data[] = { + 0x20,0x20,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch43 = { 5, 5, 0, 0, 6, ch43data }; + +static const unsigned char ch44data[] = { + 0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch44 = { 1, 3, -1, 2, 3, ch44data }; + +static const unsigned char ch45data[] = { + 0xf0 +}; +static const GLUTBitmapChar ch45 = { 4, 1, -1, -2, 7, ch45data }; + +static const unsigned char ch46data[] = { + 0x80 +}; +static const GLUTBitmapChar ch46 = { 1, 1, -1, 0, 3, ch46data }; + +static const unsigned char ch47data[] = { + 0x80,0x80,0x40,0x40,0x40,0x20,0x20 +}; +static const GLUTBitmapChar ch47 = { 3, 7, 0, 0, 3, ch47data }; + +static const unsigned char ch48data[] = { + 0x60,0x90,0x90,0x90,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch48 = { 4, 7, 0, 0, 5, ch48data }; + +static const unsigned char ch49data[] = { + 0xe0,0x40,0x40,0x40,0x40,0xc0,0x40 +}; +static const GLUTBitmapChar ch49 = { 3, 7, -1, 0, 5, ch49data }; + +static const unsigned char ch50data[] = { + 0xf0,0x40,0x20,0x20,0x10,0x90,0x60 +}; +static const GLUTBitmapChar ch50 = { 4, 7, 0, 0, 5, ch50data }; + +static const unsigned char ch51data[] = { + 0xe0,0x10,0x10,0x60,0x10,0x90,0x60 +}; +static const GLUTBitmapChar ch51 = { 4, 7, 0, 0, 5, ch51data }; + +static const unsigned char ch52data[] = { + 0x10,0x10,0xf8,0x90,0x50,0x30,0x10 +}; +static const GLUTBitmapChar ch52 = { 5, 7, 0, 0, 5, ch52data }; + +static const unsigned char ch53data[] = { + 0xe0,0x90,0x10,0x10,0xe0,0x40,0x70 +}; +static const GLUTBitmapChar ch53 = { 4, 7, 0, 0, 5, ch53data }; + +static const unsigned char ch54data[] = { + 0x60,0x90,0x90,0x90,0xe0,0x40,0x30 +}; +static const GLUTBitmapChar ch54 = { 4, 7, 0, 0, 5, ch54data }; + +static const unsigned char ch55data[] = { + 0x40,0x40,0x40,0x20,0x20,0x90,0xf0 +}; +static const GLUTBitmapChar ch55 = { 4, 7, 0, 0, 5, ch55data }; + +static const unsigned char ch56data[] = { + 0x60,0x90,0x90,0x60,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch56 = { 4, 7, 0, 0, 5, ch56data }; + +static const unsigned char ch57data[] = { + 0xc0,0x20,0x70,0x90,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch57 = { 4, 7, 0, 0, 5, ch57data }; + +static const unsigned char ch58data[] = { + 0x80,0x0,0x0,0x0,0x80 +}; +static const GLUTBitmapChar ch58 = { 1, 5, -1, 0, 3, ch58data }; + +static const unsigned char ch59data[] = { + 0x80,0x80,0x80,0x0,0x0,0x0,0x80 +}; +static const GLUTBitmapChar ch59 = { 1, 7, -1, 2, 3, ch59data }; + +static const unsigned char ch60data[] = { + 0x20,0x40,0x80,0x40,0x20 +}; +static const GLUTBitmapChar ch60 = { 3, 5, -1, 0, 5, ch60data }; + +static const unsigned char ch61data[] = { + 0xf8,0x0,0xf8 +}; +static const GLUTBitmapChar ch61 = { 5, 3, 0, -1, 6, ch61data }; + +static const unsigned char ch62data[] = { + 0x80,0x40,0x20,0x40,0x80 +}; +static const GLUTBitmapChar ch62 = { 3, 5, 0, 0, 5, ch62data }; + +static const unsigned char ch63data[] = { + 0x40,0x0,0x40,0x40,0x20,0xa0,0xe0 +}; +static const GLUTBitmapChar ch63 = { 3, 7, 0, 0, 4, ch63data }; + +static const unsigned char ch64data[] = { + 0x3e,0x40,0x92,0xad,0xa5,0xa5,0x9d,0x42,0x3c +}; +static const GLUTBitmapChar ch64 = { 8, 9, 0, 2, 9, ch64data }; + +static const unsigned char ch65data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10 +}; +static const GLUTBitmapChar ch65 = { 7, 7, 0, 0, 8, ch65data }; + +static const unsigned char ch66data[] = { + 0xf0,0x48,0x48,0x70,0x48,0x48,0xf0 +}; +static const GLUTBitmapChar ch66 = { 5, 7, 0, 0, 6, ch66data }; + +static const unsigned char ch67data[] = { + 0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c +}; +static const GLUTBitmapChar ch67 = { 6, 7, 0, 0, 7, ch67data }; + +static const unsigned char ch68data[] = { + 0xf8,0x4c,0x44,0x44,0x44,0x4c,0xf8 +}; +static const GLUTBitmapChar ch68 = { 6, 7, 0, 0, 7, ch68data }; + +static const unsigned char ch69data[] = { + 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8 +}; +static const GLUTBitmapChar ch69 = { 5, 7, 0, 0, 6, ch69data }; + +static const unsigned char ch70data[] = { + 0xe0,0x40,0x40,0x70,0x40,0x48,0xf8 +}; +static const GLUTBitmapChar ch70 = { 5, 7, 0, 0, 6, ch70data }; + +static const unsigned char ch71data[] = { + 0x78,0xc4,0x84,0x9c,0x80,0xc4,0x7c +}; +static const GLUTBitmapChar ch71 = { 6, 7, 0, 0, 7, ch71data }; + +static const unsigned char ch72data[] = { + 0xee,0x44,0x44,0x7c,0x44,0x44,0xee +}; +static const GLUTBitmapChar ch72 = { 7, 7, 0, 0, 8, ch72data }; + +static const unsigned char ch73data[] = { + 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0 +}; +static const GLUTBitmapChar ch73 = { 3, 7, 0, 0, 4, ch73data }; + +static const unsigned char ch74data[] = { + 0xc0,0xa0,0x20,0x20,0x20,0x20,0x70 +}; +static const GLUTBitmapChar ch74 = { 4, 7, 0, 0, 4, ch74data }; + +static const unsigned char ch75data[] = { + 0xec,0x48,0x50,0x60,0x50,0x48,0xec +}; +static const GLUTBitmapChar ch75 = { 6, 7, 0, 0, 7, ch75data }; + +static const unsigned char ch76data[] = { + 0xf8,0x48,0x40,0x40,0x40,0x40,0xe0 +}; +static const GLUTBitmapChar ch76 = { 5, 7, 0, 0, 6, ch76data }; + +static const unsigned char ch77data[] = { + 0xeb,0x80,0x49,0x0,0x55,0x0,0x55,0x0,0x63,0x0,0x63,0x0,0xe3,0x80 +}; +static const GLUTBitmapChar ch77 = { 9, 7, 0, 0, 10, ch77data }; + +static const unsigned char ch78data[] = { + 0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee +}; +static const GLUTBitmapChar ch78 = { 7, 7, 0, 0, 8, ch78data }; + +static const unsigned char ch79data[] = { + 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78 +}; +static const GLUTBitmapChar ch79 = { 6, 7, 0, 0, 7, ch79data }; + +static const unsigned char ch80data[] = { + 0xe0,0x40,0x40,0x70,0x48,0x48,0xf0 +}; +static const GLUTBitmapChar ch80 = { 5, 7, 0, 0, 6, ch80data }; + +static const unsigned char ch81data[] = { + 0xc,0x18,0x70,0xcc,0x84,0x84,0x84,0xcc,0x78 +}; +static const GLUTBitmapChar ch81 = { 6, 9, 0, 2, 7, ch81data }; + +static const unsigned char ch82data[] = { + 0xec,0x48,0x50,0x70,0x48,0x48,0xf0 +}; +static const GLUTBitmapChar ch82 = { 6, 7, 0, 0, 7, ch82data }; + +static const unsigned char ch83data[] = { + 0xe0,0x90,0x10,0x60,0xc0,0x90,0x70 +}; +static const GLUTBitmapChar ch83 = { 4, 7, 0, 0, 5, ch83data }; + +static const unsigned char ch84data[] = { + 0x70,0x20,0x20,0x20,0x20,0xa8,0xf8 +}; +static const GLUTBitmapChar ch84 = { 5, 7, 0, 0, 6, ch84data }; + +static const unsigned char ch85data[] = { + 0x38,0x6c,0x44,0x44,0x44,0x44,0xee +}; +static const GLUTBitmapChar ch85 = { 7, 7, 0, 0, 8, ch85data }; + +static const unsigned char ch86data[] = { + 0x10,0x10,0x28,0x28,0x6c,0x44,0xee +}; +static const GLUTBitmapChar ch86 = { 7, 7, 0, 0, 8, ch86data }; + +static const unsigned char ch87data[] = { + 0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0xc9,0x80,0x88,0x80,0xdd,0xc0 +}; +static const GLUTBitmapChar ch87 = { 10, 7, 0, 0, 10, ch87data }; + +static const unsigned char ch88data[] = { + 0xee,0x44,0x28,0x10,0x28,0x44,0xee +}; +static const GLUTBitmapChar ch88 = { 7, 7, 0, 0, 8, ch88data }; + +static const unsigned char ch89data[] = { + 0x38,0x10,0x10,0x28,0x28,0x44,0xee +}; +static const GLUTBitmapChar ch89 = { 7, 7, 0, 0, 8, ch89data }; + +static const unsigned char ch90data[] = { + 0xf8,0x88,0x40,0x20,0x10,0x88,0xf8 +}; +static const GLUTBitmapChar ch90 = { 5, 7, 0, 0, 6, ch90data }; + +static const unsigned char ch91data[] = { + 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 +}; +static const GLUTBitmapChar ch91 = { 2, 9, 0, 2, 3, ch91data }; + +static const unsigned char ch92data[] = { + 0x20,0x20,0x40,0x40,0x40,0x80,0x80 +}; +static const GLUTBitmapChar ch92 = { 3, 7, 0, 0, 3, ch92data }; + +static const unsigned char ch93data[] = { + 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0 +}; +static const GLUTBitmapChar ch93 = { 2, 9, 0, 2, 3, ch93data }; + +static const unsigned char ch94data[] = { + 0xa0,0xa0,0x40 +}; +static const GLUTBitmapChar ch94 = { 3, 3, -1, -4, 5, ch94data }; + +static const unsigned char ch95data[] = { + 0xf8 +}; +static const GLUTBitmapChar ch95 = { 5, 1, 0, 3, 5, ch95data }; + +static const unsigned char ch96data[] = { + 0xc0,0x80 +}; +static const GLUTBitmapChar ch96 = { 2, 2, 0, -5, 3, ch96data }; + +static const unsigned char ch97data[] = { + 0xe0,0xa0,0x60,0x20,0xc0 +}; +static const GLUTBitmapChar ch97 = { 3, 5, 0, 0, 4, ch97data }; + +static const unsigned char ch98data[] = { + 0xe0,0x90,0x90,0x90,0xe0,0x80,0x80 +}; +static const GLUTBitmapChar ch98 = { 4, 7, 0, 0, 5, ch98data }; + +static const unsigned char ch99data[] = { + 0x60,0x80,0x80,0x80,0x60 +}; +static const GLUTBitmapChar ch99 = { 3, 5, 0, 0, 4, ch99data }; + +static const unsigned char ch100data[] = { + 0x68,0x90,0x90,0x90,0x70,0x10,0x30 +}; +static const GLUTBitmapChar ch100 = { 5, 7, 0, 0, 5, ch100data }; + +static const unsigned char ch101data[] = { + 0x60,0x80,0xc0,0xa0,0x60 +}; +static const GLUTBitmapChar ch101 = { 3, 5, 0, 0, 4, ch101data }; + +static const unsigned char ch102data[] = { + 0xe0,0x40,0x40,0x40,0xe0,0x40,0x30 +}; +static const GLUTBitmapChar ch102 = { 4, 7, 0, 0, 4, ch102data }; + +static const unsigned char ch103data[] = { + 0xe0,0x90,0x60,0x40,0xa0,0xa0,0x70 +}; +static const GLUTBitmapChar ch103 = { 4, 7, 0, 2, 5, ch103data }; + +static const unsigned char ch104data[] = { + 0xd8,0x90,0x90,0x90,0xe0,0x80,0x80 +}; +static const GLUTBitmapChar ch104 = { 5, 7, 0, 0, 5, ch104data }; + +static const unsigned char ch105data[] = { + 0x40,0x40,0x40,0x40,0xc0,0x0,0x40 +}; +static const GLUTBitmapChar ch105 = { 2, 7, 0, 0, 3, ch105data }; + +static const unsigned char ch106data[] = { + 0x80,0x40,0x40,0x40,0x40,0x40,0xc0,0x0,0x40 +}; +static const GLUTBitmapChar ch106 = { 2, 9, 0, 2, 3, ch106data }; + +static const unsigned char ch107data[] = { + 0x98,0x90,0xe0,0xa0,0x90,0x80,0x80 +}; +static const GLUTBitmapChar ch107 = { 5, 7, 0, 0, 5, ch107data }; + +static const unsigned char ch108data[] = { + 0xe0,0x40,0x40,0x40,0x40,0x40,0xc0 +}; +static const GLUTBitmapChar ch108 = { 3, 7, 0, 0, 4, ch108data }; + +static const unsigned char ch109data[] = { + 0xdb,0x92,0x92,0x92,0xec +}; +static const GLUTBitmapChar ch109 = { 8, 5, 0, 0, 8, ch109data }; + +static const unsigned char ch110data[] = { + 0xd8,0x90,0x90,0x90,0xe0 +}; +static const GLUTBitmapChar ch110 = { 5, 5, 0, 0, 5, ch110data }; + +static const unsigned char ch111data[] = { + 0x60,0x90,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch111 = { 4, 5, 0, 0, 5, ch111data }; + +static const unsigned char ch112data[] = { + 0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0 +}; +static const GLUTBitmapChar ch112 = { 4, 7, 0, 2, 5, ch112data }; + +static const unsigned char ch113data[] = { + 0x38,0x10,0x70,0x90,0x90,0x90,0x70 +}; +static const GLUTBitmapChar ch113 = { 5, 7, 0, 2, 5, ch113data }; + +static const unsigned char ch114data[] = { + 0xe0,0x40,0x40,0x60,0xa0 +}; +static const GLUTBitmapChar ch114 = { 3, 5, 0, 0, 4, ch114data }; + +static const unsigned char ch115data[] = { + 0xe0,0x20,0x60,0x80,0xe0 +}; +static const GLUTBitmapChar ch115 = { 3, 5, 0, 0, 4, ch115data }; + +static const unsigned char ch116data[] = { + 0x30,0x40,0x40,0x40,0xe0,0x40 +}; +static const GLUTBitmapChar ch116 = { 4, 6, 0, 0, 4, ch116data }; + +static const unsigned char ch117data[] = { + 0x68,0x90,0x90,0x90,0x90 +}; +static const GLUTBitmapChar ch117 = { 5, 5, 0, 0, 5, ch117data }; + +static const unsigned char ch118data[] = { + 0x20,0x60,0x50,0x90,0xd8 +}; +static const GLUTBitmapChar ch118 = { 5, 5, 0, 0, 5, ch118data }; + +static const unsigned char ch119data[] = { + 0x28,0x6c,0x54,0x92,0xdb +}; +static const GLUTBitmapChar ch119 = { 8, 5, 0, 0, 8, ch119data }; + +static const unsigned char ch120data[] = { + 0xd8,0x50,0x20,0x50,0xd8 +}; +static const GLUTBitmapChar ch120 = { 5, 5, 0, 0, 6, ch120data }; + +static const unsigned char ch121data[] = { + 0x40,0x40,0x20,0x30,0x50,0x48,0xdc +}; +static const GLUTBitmapChar ch121 = { 6, 7, 1, 2, 5, ch121data }; + +static const unsigned char ch122data[] = { + 0xf0,0x90,0x40,0x20,0xf0 +}; +static const GLUTBitmapChar ch122 = { 4, 5, 0, 0, 5, ch122data }; + +static const unsigned char ch123data[] = { + 0x20,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20 +}; +static const GLUTBitmapChar ch123 = { 3, 9, 0, 2, 4, ch123data }; + +static const unsigned char ch124data[] = { + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch124 = { 1, 9, 0, 2, 2, ch124data }; + +static const unsigned char ch125data[] = { + 0x80,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80 +}; +static const GLUTBitmapChar ch125 = { 3, 9, 0, 2, 4, ch125data }; + +static const unsigned char ch126data[] = { + 0x98,0x64 +}; +static const GLUTBitmapChar ch126 = { 6, 2, 0, -2, 7, ch126data }; + +static const unsigned char ch160data[] = { + 0x0 +}; +static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 2, ch160data }; + +static const unsigned char ch161data[] = { + 0x80,0x80,0x80,0x80,0x80,0x0,0x80 +}; +static const GLUTBitmapChar ch161 = { 1, 7, -1, 2, 3, ch161data }; + +static const unsigned char ch162data[] = { + 0x80,0xe0,0x90,0x80,0x90,0x70,0x10 +}; +static const GLUTBitmapChar ch162 = { 4, 7, 0, 1, 5, ch162data }; + +static const unsigned char ch163data[] = { + 0xf0,0xc8,0x40,0xe0,0x40,0x50,0x30 +}; +static const GLUTBitmapChar ch163 = { 5, 7, 0, 0, 5, ch163data }; + +static const unsigned char ch164data[] = { + 0x88,0x70,0x50,0x50,0x70,0x88 +}; +static const GLUTBitmapChar ch164 = { 5, 6, 0, -1, 5, ch164data }; + +static const unsigned char ch165data[] = { + 0x70,0x20,0xf8,0x20,0xd8,0x50,0x88 +}; +static const GLUTBitmapChar ch165 = { 5, 7, 0, 0, 5, ch165data }; + +static const unsigned char ch166data[] = { + 0x80,0x80,0x80,0x0,0x80,0x80,0x80 +}; +static const GLUTBitmapChar ch166 = { 1, 7, 0, 0, 2, ch166data }; + +static const unsigned char ch167data[] = { + 0xe0,0x90,0x20,0x50,0x90,0xa0,0x40,0x90,0x70 +}; +static const GLUTBitmapChar ch167 = { 4, 9, 0, 1, 5, ch167data }; + +static const unsigned char ch168data[] = { + 0xa0 +}; +static const GLUTBitmapChar ch168 = { 3, 1, -1, -6, 5, ch168data }; + +static const unsigned char ch169data[] = { + 0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38 +}; +static const GLUTBitmapChar ch169 = { 7, 7, -1, 0, 9, ch169data }; + +static const unsigned char ch170data[] = { + 0xe0,0x0,0xa0,0x20,0xc0 +}; +static const GLUTBitmapChar ch170 = { 3, 5, 0, -2, 4, ch170data }; + +static const unsigned char ch171data[] = { + 0x50,0xa0,0xa0,0x50 +}; +static const GLUTBitmapChar ch171 = { 4, 4, 0, -1, 5, ch171data }; + +static const unsigned char ch172data[] = { + 0x8,0x8,0xf8 +}; +static const GLUTBitmapChar ch172 = { 5, 3, -1, -1, 7, ch172data }; + +static const unsigned char ch173data[] = { + 0xe0 +}; +static const GLUTBitmapChar ch173 = { 3, 1, 0, -2, 4, ch173data }; + +static const unsigned char ch174data[] = { + 0x38,0x44,0xaa,0xb2,0xba,0x44,0x38 +}; +static const GLUTBitmapChar ch174 = { 7, 7, -1, 0, 9, ch174data }; + +static const unsigned char ch175data[] = { + 0xe0 +}; +static const GLUTBitmapChar ch175 = { 3, 1, 0, -6, 4, ch175data }; + +static const unsigned char ch176data[] = { + 0x60,0x90,0x90,0x60 +}; +static const GLUTBitmapChar ch176 = { 4, 4, 0, -3, 4, ch176data }; + +static const unsigned char ch177data[] = { + 0xf8,0x0,0x20,0x20,0xf8,0x20,0x20 +}; +static const GLUTBitmapChar ch177 = { 5, 7, 0, 0, 6, ch177data }; + +static const unsigned char ch178data[] = { + 0xe0,0x40,0xa0,0x60 +}; +static const GLUTBitmapChar ch178 = { 3, 4, 0, -3, 3, ch178data }; + +static const unsigned char ch179data[] = { + 0xc0,0x20,0x40,0xe0 +}; +static const GLUTBitmapChar ch179 = { 3, 4, 0, -3, 3, ch179data }; + +static const unsigned char ch180data[] = { + 0x80,0x40 +}; +static const GLUTBitmapChar ch180 = { 2, 2, 0, -5, 3, ch180data }; + +static const unsigned char ch181data[] = { + 0x80,0x80,0xe8,0x90,0x90,0x90,0x90 +}; +static const GLUTBitmapChar ch181 = { 5, 7, 0, 2, 5, ch181data }; + +static const unsigned char ch182data[] = { + 0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c +}; +static const GLUTBitmapChar ch182 = { 6, 9, 0, 2, 6, ch182data }; + +static const unsigned char ch183data[] = { + 0x80 +}; +static const GLUTBitmapChar ch183 = { 1, 1, 0, -2, 2, ch183data }; + +static const unsigned char ch184data[] = { + 0xc0,0x20,0x40 +}; +static const GLUTBitmapChar ch184 = { 3, 3, 0, 3, 4, ch184data }; + +static const unsigned char ch185data[] = { + 0xe0,0x40,0xc0,0x40 +}; +static const GLUTBitmapChar ch185 = { 3, 4, 0, -3, 3, ch185data }; + +static const unsigned char ch186data[] = { + 0xe0,0x0,0x40,0xa0,0x40 +}; +static const GLUTBitmapChar ch186 = { 3, 5, 0, -2, 4, ch186data }; + +static const unsigned char ch187data[] = { + 0xa0,0x50,0x50,0xa0 +}; +static const GLUTBitmapChar ch187 = { 4, 4, 0, -1, 5, ch187data }; + +static const unsigned char ch188data[] = { + 0x44,0x3e,0x2c,0xf4,0x48,0xc8,0x44 +}; +static const GLUTBitmapChar ch188 = { 7, 7, 0, 0, 8, ch188data }; + +static const unsigned char ch189data[] = { + 0x4e,0x24,0x2a,0xf6,0x48,0xc8,0x44 +}; +static const GLUTBitmapChar ch189 = { 7, 7, 0, 0, 8, ch189data }; + +static const unsigned char ch190data[] = { + 0x44,0x3e,0x2c,0xd4,0x28,0x48,0xe4 +}; +static const GLUTBitmapChar ch190 = { 7, 7, 0, 0, 8, ch190data }; + +static const unsigned char ch191data[] = { + 0xe0,0xa0,0x80,0x40,0x40,0x0,0x40 +}; +static const GLUTBitmapChar ch191 = { 3, 7, 0, 2, 4, ch191data }; + +static const unsigned char ch192data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch192 = { 7, 10, 0, 0, 8, ch192data }; + +static const unsigned char ch193data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch193 = { 7, 10, 0, 0, 8, ch193data }; + +static const unsigned char ch194data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch194 = { 7, 10, 0, 0, 8, ch194data }; + +static const unsigned char ch195data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x14 +}; +static const GLUTBitmapChar ch195 = { 7, 10, 0, 0, 8, ch195data }; + +static const unsigned char ch196data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28 +}; +static const GLUTBitmapChar ch196 = { 7, 9, 0, 0, 8, ch196data }; + +static const unsigned char ch197data[] = { + 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x10,0x28,0x10 +}; +static const GLUTBitmapChar ch197 = { 7, 10, 0, 0, 8, ch197data }; + +static const unsigned char ch198data[] = { + 0xef,0x49,0x78,0x2e,0x28,0x39,0x1f +}; +static const GLUTBitmapChar ch198 = { 8, 7, 0, 0, 9, ch198data }; + +static const unsigned char ch199data[] = { + 0x60,0x10,0x20,0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c +}; +static const GLUTBitmapChar ch199 = { 6, 10, 0, 3, 7, ch199data }; + +static const unsigned char ch200data[] = { + 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch200 = { 5, 10, 0, 0, 6, ch200data }; + +static const unsigned char ch201data[] = { + 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch201 = { 5, 10, 0, 0, 6, ch201data }; + +static const unsigned char ch202data[] = { + 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch202 = { 5, 10, 0, 0, 6, ch202data }; + +static const unsigned char ch203data[] = { + 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50 +}; +static const GLUTBitmapChar ch203 = { 5, 9, 0, 0, 6, ch203data }; + +static const unsigned char ch204data[] = { + 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch204 = { 3, 10, 0, 0, 4, ch204data }; + +static const unsigned char ch205data[] = { + 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch205 = { 3, 10, 0, 0, 4, ch205data }; + +static const unsigned char ch206data[] = { + 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch206 = { 3, 10, 0, 0, 4, ch206data }; + +static const unsigned char ch207data[] = { + 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0 +}; +static const GLUTBitmapChar ch207 = { 3, 9, 0, 0, 4, ch207data }; + +static const unsigned char ch208data[] = { + 0xf8,0x4c,0x44,0xe4,0x44,0x4c,0xf8 +}; +static const GLUTBitmapChar ch208 = { 6, 7, 0, 0, 7, ch208data }; + +static const unsigned char ch209data[] = { + 0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch209 = { 7, 10, 0, 0, 8, ch209data }; + +static const unsigned char ch210data[] = { + 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch210 = { 6, 10, 0, 0, 7, ch210data }; + +static const unsigned char ch211data[] = { + 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch211 = { 6, 10, 0, 0, 7, ch211data }; + +static const unsigned char ch212data[] = { + 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch212 = { 6, 10, 0, 0, 7, ch212data }; + +static const unsigned char ch213data[] = { + 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x28 +}; +static const GLUTBitmapChar ch213 = { 6, 10, 0, 0, 7, ch213data }; + +static const unsigned char ch214data[] = { + 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50 +}; +static const GLUTBitmapChar ch214 = { 6, 9, 0, 0, 7, ch214data }; + +static const unsigned char ch215data[] = { + 0x88,0x50,0x20,0x50,0x88 +}; +static const GLUTBitmapChar ch215 = { 5, 5, 0, 0, 6, ch215data }; + +static const unsigned char ch216data[] = { + 0x80,0x7c,0x66,0x52,0x52,0x4a,0x66,0x3e,0x1 +}; +static const GLUTBitmapChar ch216 = { 8, 9, 0, 1, 8, ch216data }; + +static const unsigned char ch217data[] = { + 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x20 +}; +static const GLUTBitmapChar ch217 = { 7, 10, 0, 0, 8, ch217data }; + +static const unsigned char ch218data[] = { + 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch218 = { 7, 10, 0, 0, 8, ch218data }; + +static const unsigned char ch219data[] = { + 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28,0x10 +}; +static const GLUTBitmapChar ch219 = { 7, 10, 0, 0, 8, ch219data }; + +static const unsigned char ch220data[] = { + 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28 +}; +static const GLUTBitmapChar ch220 = { 7, 9, 0, 0, 8, ch220data }; + +static const unsigned char ch221data[] = { + 0x38,0x10,0x10,0x28,0x28,0x44,0xee,0x0,0x10,0x8 +}; +static const GLUTBitmapChar ch221 = { 7, 10, 0, 0, 8, ch221data }; + +static const unsigned char ch222data[] = { + 0xe0,0x40,0x70,0x48,0x70,0x40,0xe0 +}; +static const GLUTBitmapChar ch222 = { 5, 7, 0, 0, 6, ch222data }; + +static const unsigned char ch223data[] = { + 0xe0,0x50,0x50,0x60,0x50,0x50,0x20 +}; +static const GLUTBitmapChar ch223 = { 4, 7, 0, 0, 5, ch223data }; + +static const unsigned char ch224data[] = { + 0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch224 = { 3, 8, 0, 0, 4, ch224data }; + +static const unsigned char ch225data[] = { + 0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch225 = { 3, 8, 0, 0, 4, ch225data }; + +static const unsigned char ch226data[] = { + 0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch226 = { 3, 8, 0, 0, 4, ch226data }; + +static const unsigned char ch227data[] = { + 0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x50 +}; +static const GLUTBitmapChar ch227 = { 4, 8, 0, 0, 4, ch227data }; + +static const unsigned char ch228data[] = { + 0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0 +}; +static const GLUTBitmapChar ch228 = { 3, 7, 0, 0, 4, ch228data }; + +static const unsigned char ch229data[] = { + 0xe0,0xa0,0x60,0x20,0xc0,0x40,0xa0,0x40 +}; +static const GLUTBitmapChar ch229 = { 3, 8, 0, 0, 4, ch229data }; + +static const unsigned char ch230data[] = { + 0xd8,0xa0,0x70,0x28,0xd8 +}; +static const GLUTBitmapChar ch230 = { 5, 5, 0, 0, 6, ch230data }; + +static const unsigned char ch231data[] = { + 0xc0,0x20,0x40,0x60,0x80,0x80,0x80,0x60 +}; +static const GLUTBitmapChar ch231 = { 3, 8, 0, 3, 4, ch231data }; + +static const unsigned char ch232data[] = { + 0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch232 = { 3, 8, 0, 0, 4, ch232data }; + +static const unsigned char ch233data[] = { + 0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch233 = { 3, 8, 0, 0, 4, ch233data }; + +static const unsigned char ch234data[] = { + 0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch234 = { 3, 8, 0, 0, 4, ch234data }; + +static const unsigned char ch235data[] = { + 0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0 +}; +static const GLUTBitmapChar ch235 = { 3, 7, 0, 0, 4, ch235data }; + +static const unsigned char ch236data[] = { + 0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x80 +}; +static const GLUTBitmapChar ch236 = { 3, 8, 0, 0, 4, ch236data }; + +static const unsigned char ch237data[] = { + 0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch237 = { 3, 8, 0, 0, 4, ch237data }; + +static const unsigned char ch238data[] = { + 0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch238 = { 3, 8, 0, 0, 4, ch238data }; + +static const unsigned char ch239data[] = { + 0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0 +}; +static const GLUTBitmapChar ch239 = { 3, 7, 0, 0, 4, ch239data }; + +static const unsigned char ch240data[] = { + 0x60,0x90,0x90,0x90,0x70,0xa0,0x70,0x40 +}; +static const GLUTBitmapChar ch240 = { 4, 8, 0, 0, 5, ch240data }; + +static const unsigned char ch241data[] = { + 0xd8,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50 +}; +static const GLUTBitmapChar ch241 = { 5, 8, 0, 0, 5, ch241data }; + +static const unsigned char ch242data[] = { + 0x60,0x90,0x90,0x90,0x60,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch242 = { 4, 8, 0, 0, 5, ch242data }; + +static const unsigned char ch243data[] = { + 0x60,0x90,0x90,0x90,0x60,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch243 = { 4, 8, 0, 0, 5, ch243data }; + +static const unsigned char ch244data[] = { + 0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x40 +}; +static const GLUTBitmapChar ch244 = { 4, 8, 0, 0, 5, ch244data }; + +static const unsigned char ch245data[] = { + 0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x50 +}; +static const GLUTBitmapChar ch245 = { 4, 8, 0, 0, 5, ch245data }; + +static const unsigned char ch246data[] = { + 0x60,0x90,0x90,0x90,0x60,0x0,0xa0 +}; +static const GLUTBitmapChar ch246 = { 4, 7, 0, 0, 5, ch246data }; + +static const unsigned char ch247data[] = { + 0x20,0x0,0xf8,0x0,0x20 +}; +static const GLUTBitmapChar ch247 = { 5, 5, 0, 0, 6, ch247data }; + +static const unsigned char ch248data[] = { + 0x80,0x70,0x48,0x48,0x48,0x38,0x4 +}; +static const GLUTBitmapChar ch248 = { 6, 7, 1, 1, 5, ch248data }; + +static const unsigned char ch249data[] = { + 0x68,0x90,0x90,0x90,0x90,0x0,0x20,0x40 +}; +static const GLUTBitmapChar ch249 = { 5, 8, 0, 0, 5, ch249data }; + +static const unsigned char ch250data[] = { + 0x68,0x90,0x90,0x90,0x90,0x0,0x40,0x20 +}; +static const GLUTBitmapChar ch250 = { 5, 8, 0, 0, 5, ch250data }; + +static const unsigned char ch251data[] = { + 0x68,0x90,0x90,0x90,0x90,0x0,0x50,0x20 +}; +static const GLUTBitmapChar ch251 = { 5, 8, 0, 0, 5, ch251data }; + +static const unsigned char ch252data[] = { + 0x68,0x90,0x90,0x90,0x90,0x0,0x50 +}; +static const GLUTBitmapChar ch252 = { 5, 7, 0, 0, 5, ch252data }; + +static const unsigned char ch253data[] = { + 0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0x20,0x10 +}; +static const GLUTBitmapChar ch253 = { 5, 10, 0, 2, 5, ch253data }; + +static const unsigned char ch254data[] = { + 0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0,0x80,0x80 +}; +static const GLUTBitmapChar ch254 = { 4, 9, 0, 2, 5, ch254data }; + +static const unsigned char ch255data[] = { + 0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0xa0 +}; +static const GLUTBitmapChar ch255 = { 5, 9, 0, 2, 5, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmapTimesRoman10 = { + "-Adobe-Times-Medium-R-Normal--10-100-75-75-P-54-ISO8859-1", + 13, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/tr24.c xpsb-glx-0.19/mesa/src/glut/dos/tr24.c --- xpsb-glx-0.19/mesa/src/glut/dos/tr24.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/tr24.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1301 @@ +/* autogenerated by bdf2c! do not edit */ + +/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ + + +#include "internal.h" +/* +typedef struct { + int width, height; + int xorig, yorig; + int xmove; + const unsigned char *bitmap; +} GLUTBitmapChar; + +typedef struct { + const char *name; + int height; + int num; + const GLUTBitmapChar *const *table; +} GLUTBitmapFont; +*/ + + +static const unsigned char ch32data[] = { + 0x0 +}; +static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 6, ch32data }; + +static const unsigned char ch33data[] = { + 0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0 +}; +static const GLUTBitmapChar ch33 = { 2, 17, -3, 0, 8, ch33data }; + +static const unsigned char ch34data[] = { + 0x88,0xcc,0xcc,0xcc,0xcc +}; +static const GLUTBitmapChar ch34 = { 6, 5, -1, -12, 10, ch34data }; + +static const unsigned char ch35data[] = { + 0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0, + 0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80, + 0x8,0x80 +}; +static const GLUTBitmapChar ch35 = { 11, 17, -1, 0, 13, ch35data }; + +static const unsigned char ch36data[] = { + 0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60, + 0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20, + 0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0 +}; +static const GLUTBitmapChar ch36 = { 11, 21, 0, 2, 12, ch36data }; + +static const unsigned char ch37data[] = { + 0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3, + 0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60, + 0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0 +}; +static const GLUTBitmapChar ch37 = { 17, 16, -1, 0, 19, ch37data }; + +static const unsigned char ch38data[] = { + 0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10, + 0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0, + 0x7,0x80 +}; +static const GLUTBitmapChar ch38 = { 16, 17, -1, 0, 18, ch38data }; + +static const unsigned char ch39data[] = { + 0xc0,0x60,0x20,0xe0,0xc0 +}; +static const GLUTBitmapChar ch39 = { 3, 5, -3, -12, 8, ch39data }; + +static const unsigned char ch40data[] = { + 0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60, + 0x60,0x20,0x30,0x10,0x8,0x4 +}; +static const GLUTBitmapChar ch40 = { 6, 22, -1, 5, 8, ch40data }; + +static const unsigned char ch41data[] = { + 0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18, + 0x18,0x10,0x30,0x20,0x40,0x80 +}; +static const GLUTBitmapChar ch41 = { 6, 22, -1, 5, 8, ch41data }; + +static const unsigned char ch42data[] = { + 0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0, + 0x8,0x0 +}; +static const GLUTBitmapChar ch42 = { 9, 9, -2, -8, 12, ch42data }; + +static const unsigned char ch43data[] = { + 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0, + 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch43 = { 12, 12, -1, -1, 14, ch43data }; + +static const unsigned char ch44data[] = { + 0xc0,0x60,0x20,0xe0,0xc0 +}; +static const GLUTBitmapChar ch44 = { 3, 5, -2, 3, 7, ch44data }; + +static const unsigned char ch45data[] = { + 0xff,0xf0,0xff,0xf0 +}; +static const GLUTBitmapChar ch45 = { 12, 2, -1, -6, 14, ch45data }; + +static const unsigned char ch46data[] = { + 0xc0,0xc0 +}; +static const GLUTBitmapChar ch46 = { 2, 2, -2, 0, 6, ch46data }; + +static const unsigned char ch47data[] = { + 0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6, + 0x6,0x3,0x3,0x3 +}; +static const GLUTBitmapChar ch47 = { 8, 20, 1, 3, 7, ch47data }; + +static const unsigned char ch48data[] = { + 0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0, + 0x1e,0x0 +}; +static const GLUTBitmapChar ch48 = { 10, 17, -1, 0, 12, ch48data }; + +static const unsigned char ch49data[] = { + 0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18, + 0x8 +}; +static const GLUTBitmapChar ch49 = { 8, 17, -2, 0, 12, ch49data }; + +static const unsigned char ch50data[] = { + 0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0, + 0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0, + 0x1c,0x0 +}; +static const GLUTBitmapChar ch50 = { 10, 17, -1, 0, 12, ch50data }; + +static const unsigned char ch51data[] = { + 0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80, + 0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0, + 0x1c,0x0 +}; +static const GLUTBitmapChar ch51 = { 9, 17, -1, 0, 12, ch51data }; + +static const unsigned char ch52data[] = { + 0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0, + 0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0, + 0x3,0x0 +}; +static const GLUTBitmapChar ch52 = { 10, 17, -1, 0, 12, ch52data }; + +static const unsigned char ch53data[] = { + 0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0, + 0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80, + 0x1f,0xc0 +}; +static const GLUTBitmapChar ch53 = { 10, 17, -1, 0, 12, ch53data }; + +static const unsigned char ch54data[] = { + 0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0, + 0x3,0xc0 +}; +static const GLUTBitmapChar ch54 = { 10, 17, -1, 0, 12, ch54data }; + +static const unsigned char ch55data[] = { + 0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0, + 0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0, + 0x7f,0xc0 +}; +static const GLUTBitmapChar ch55 = { 10, 17, -1, 0, 12, ch55data }; + +static const unsigned char ch56data[] = { + 0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80, + 0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, + 0x1e,0x0 +}; +static const GLUTBitmapChar ch56 = { 10, 17, -1, 0, 12, ch56data }; + +static const unsigned char ch57data[] = { + 0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0, + 0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80, + 0x1e,0x0 +}; +static const GLUTBitmapChar ch57 = { 10, 17, -1, 0, 12, ch57data }; + +static const unsigned char ch58data[] = { + 0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch58 = { 2, 11, -2, 0, 6, ch58data }; + +static const unsigned char ch59data[] = { + 0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 +}; +static const GLUTBitmapChar ch59 = { 3, 14, -2, 3, 7, ch59data }; + +static const unsigned char ch60data[] = { + 0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0, + 0x7,0x0,0x1,0xc0,0x0,0x60 +}; +static const GLUTBitmapChar ch60 = { 11, 11, -1, -1, 13, ch60data }; + +static const unsigned char ch61data[] = { + 0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0 +}; +static const GLUTBitmapChar ch61 = { 12, 6, -1, -4, 14, ch61data }; + +static const unsigned char ch62data[] = { + 0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0, + 0x1c,0x0,0x70,0x0,0xc0,0x0 +}; +static const GLUTBitmapChar ch62 = { 11, 11, -1, -1, 13, ch62data }; + +static const unsigned char ch63data[] = { + 0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6, + 0x7c +}; +static const GLUTBitmapChar ch63 = { 8, 17, -2, 0, 11, ch63data }; + +static const unsigned char ch64data[] = { + 0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63, + 0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc, + 0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80, + 0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0 +}; +static const GLUTBitmapChar ch64 = { 18, 20, -2, 3, 22, ch64data }; + +static const unsigned char ch65data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0 +}; +static const GLUTBitmapChar ch65 = { 17, 17, 0, 0, 17, ch65data }; + +static const unsigned char ch66data[] = { + 0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38, + 0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, + 0xff,0xc0 +}; +static const GLUTBitmapChar ch66 = { 14, 17, -1, 0, 16, ch66data }; + +static const unsigned char ch67data[] = { + 0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, + 0x7,0xe4 +}; +static const GLUTBitmapChar ch67 = { 14, 17, -1, 0, 16, ch67data }; + +static const unsigned char ch68data[] = { + 0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6, + 0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70, + 0xff,0xc0 +}; +static const GLUTBitmapChar ch68 = { 15, 17, -1, 0, 17, ch68data }; + +static const unsigned char ch69data[] = { + 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, + 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, + 0xff,0xf0 +}; +static const GLUTBitmapChar ch69 = { 13, 17, -1, 0, 15, ch69data }; + +static const unsigned char ch70data[] = { + 0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20, + 0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, + 0xff,0xf0 +}; +static const GLUTBitmapChar ch70 = { 12, 17, -1, 0, 14, ch70data }; + +static const unsigned char ch71data[] = { + 0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f, + 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, + 0x7,0xe4 +}; +static const GLUTBitmapChar ch71 = { 16, 17, -1, 0, 18, ch71data }; + +static const unsigned char ch72data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30, + 0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6, + 0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0, + 0xfc,0x1f,0x80 +}; +static const GLUTBitmapChar ch72 = { 17, 17, -1, 0, 19, ch72data }; + +static const unsigned char ch73data[] = { + 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0xfc +}; +static const GLUTBitmapChar ch73 = { 6, 17, -1, 0, 8, ch73data }; + +static const unsigned char ch74data[] = { + 0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, + 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, + 0x1f,0x80 +}; +static const GLUTBitmapChar ch74 = { 9, 17, -1, 0, 11, ch74data }; + +static const unsigned char ch75data[] = { + 0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80, + 0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18, + 0xfc,0x7e +}; +static const GLUTBitmapChar ch75 = { 16, 17, -1, 0, 17, ch75data }; + +static const unsigned char ch76data[] = { + 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, + 0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, + 0xfc,0x0 +}; +static const GLUTBitmapChar ch76 = { 13, 17, -1, 0, 14, ch76data }; + +static const unsigned char ch77data[] = { + 0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21, + 0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2, + 0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0, + 0xf0,0x0,0xf8 +}; +static const GLUTBitmapChar ch77 = { 21, 17, -1, 0, 22, ch77data }; + +static const unsigned char ch78data[] = { + 0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, + 0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, + 0xf0,0x1f +}; +static const GLUTBitmapChar ch78 = { 16, 17, -1, 0, 18, ch78data }; + +static const unsigned char ch79data[] = { + 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, + 0x7,0xe0 +}; +static const GLUTBitmapChar ch79 = { 16, 17, -1, 0, 18, ch79data }; + +static const unsigned char ch80data[] = { + 0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, + 0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, + 0xff,0xc0 +}; +static const GLUTBitmapChar ch80 = { 13, 17, -1, 0, 15, ch80data }; + +static const unsigned char ch81data[] = { + 0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c, + 0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0 +}; +static const GLUTBitmapChar ch81 = { 16, 22, -1, 5, 18, ch81data }; + +static const unsigned char ch82data[] = { + 0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80, + 0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70, + 0xff,0xc0 +}; +static const GLUTBitmapChar ch82 = { 15, 17, -1, 0, 16, ch82data }; + +static const unsigned char ch83data[] = { + 0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0, + 0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0, + 0x1e,0x40 +}; +static const GLUTBitmapChar ch83 = { 11, 17, -1, 0, 13, ch83data }; + +static const unsigned char ch84data[] = { + 0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0, + 0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc, + 0xff,0xfc +}; +static const GLUTBitmapChar ch84 = { 14, 17, -1, 0, 16, ch84data }; + +static const unsigned char ch85data[] = { + 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0xfc,0x1f +}; +static const GLUTBitmapChar ch85 = { 16, 17, -1, 0, 18, ch85data }; + +static const unsigned char ch86data[] = { + 0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3, + 0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18, + 0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0, + 0xfc,0x1f,0x80 +}; +static const GLUTBitmapChar ch86 = { 17, 17, 0, 0, 17, ch86data }; + +static const unsigned char ch87data[] = { + 0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3, + 0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c, + 0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18, + 0xfc,0x7e,0x7e +}; +static const GLUTBitmapChar ch87 = { 23, 17, 0, 0, 23, ch87data }; + +static const unsigned char ch88data[] = { + 0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6, + 0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0, + 0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0, + 0x7e,0xf,0x80 +}; +static const GLUTBitmapChar ch88 = { 18, 17, 0, 0, 18, ch88data }; + +static const unsigned char ch89data[] = { + 0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, + 0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, + 0xfc,0x3f +}; +static const GLUTBitmapChar ch89 = { 16, 17, 0, 0, 16, ch89data }; + +static const unsigned char ch90data[] = { + 0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0, + 0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70, + 0xff,0xf0 +}; +static const GLUTBitmapChar ch90 = { 13, 17, -1, 0, 15, ch90data }; + +static const unsigned char ch91data[] = { + 0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0xc0,0xc0,0xf8 +}; +static const GLUTBitmapChar ch91 = { 5, 21, -2, 4, 8, ch91data }; + +static const unsigned char ch92data[] = { + 0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0, + 0xc0 +}; +static const GLUTBitmapChar ch92 = { 7, 17, 0, 0, 7, ch92data }; + +static const unsigned char ch93data[] = { + 0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, + 0x18,0x18,0x18,0x18,0xf8 +}; +static const GLUTBitmapChar ch93 = { 5, 21, -1, 4, 8, ch93data }; + +static const unsigned char ch94data[] = { + 0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0, + 0x8,0x0 +}; +static const GLUTBitmapChar ch94 = { 9, 9, -1, -8, 11, ch94data }; + +static const unsigned char ch95data[] = { + 0xff,0xf8,0xff,0xf8 +}; +static const GLUTBitmapChar ch95 = { 13, 2, 0, 5, 13, ch95data }; + +static const unsigned char ch96data[] = { + 0x60,0xe0,0x80,0xc0,0x60 +}; +static const GLUTBitmapChar ch96 = { 3, 5, -2, -12, 7, ch96data }; + +static const unsigned char ch97data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0 +}; +static const GLUTBitmapChar ch97 = { 9, 12, -1, 0, 11, ch97data }; + +static const unsigned char ch98data[] = { + 0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, + 0xe0,0x0 +}; +static const GLUTBitmapChar ch98 = { 10, 17, -1, 0, 12, ch98data }; + +static const unsigned char ch99data[] = { + 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, + 0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0 +}; +static const GLUTBitmapChar ch99 = { 9, 12, -1, 0, 11, ch99data }; + +static const unsigned char ch100data[] = { + 0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80, + 0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, + 0x3,0x80 +}; +static const GLUTBitmapChar ch100 = { 10, 17, -1, 0, 12, ch100data }; + +static const unsigned char ch101data[] = { + 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, + 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0 +}; +static const GLUTBitmapChar ch101 = { 9, 12, -1, 0, 11, ch101data }; + +static const unsigned char ch102data[] = { + 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16, + 0xe +}; +static const GLUTBitmapChar ch102 = { 7, 17, 0, 0, 7, ch102data }; + +static const unsigned char ch103data[] = { + 0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0, + 0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, + 0x1f,0xc0 +}; +static const GLUTBitmapChar ch103 = { 11, 17, -1, 5, 12, ch103data }; + +static const unsigned char ch104data[] = { + 0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, + 0xe0,0x0 +}; +static const GLUTBitmapChar ch104 = { 11, 17, -1, 0, 13, ch104data }; + +static const unsigned char ch105data[] = { + 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60, + 0x60 +}; +static const GLUTBitmapChar ch105 = { 4, 17, -1, 0, 6, ch105data }; + +static const unsigned char ch106data[] = { + 0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x70,0x0,0x0,0x0,0x30,0x30 +}; +static const GLUTBitmapChar ch106 = { 4, 22, 0, 5, 6, ch106data }; + +static const unsigned char ch107data[] = { + 0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0, + 0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, + 0xe0,0x0 +}; +static const GLUTBitmapChar ch107 = { 11, 17, -1, 0, 12, ch107data }; + +static const unsigned char ch108data[] = { + 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, + 0xe0 +}; +static const GLUTBitmapChar ch108 = { 4, 17, -1, 0, 6, ch108data }; + +static const unsigned char ch109data[] = { + 0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60, + 0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f, + 0x0,0xe7,0xe,0x0 +}; +static const GLUTBitmapChar ch109 = { 18, 12, -1, 0, 20, ch109data }; + +static const unsigned char ch110data[] = { + 0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0 +}; +static const GLUTBitmapChar ch110 = { 11, 12, -1, 0, 13, ch110data }; + +static const unsigned char ch111data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0 +}; +static const GLUTBitmapChar ch111 = { 10, 12, -1, 0, 12, ch111data }; + +static const unsigned char ch112data[] = { + 0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, + 0xee,0x0 +}; +static const GLUTBitmapChar ch112 = { 10, 17, -1, 5, 12, ch112data }; + +static const unsigned char ch113data[] = { + 0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80, + 0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80, + 0x1d,0x80 +}; +static const GLUTBitmapChar ch113 = { 10, 17, -1, 5, 12, ch113data }; + +static const unsigned char ch114data[] = { + 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6 +}; +static const GLUTBitmapChar ch114 = { 7, 12, -1, 0, 8, ch114data }; + +static const unsigned char ch115data[] = { + 0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e +}; +static const GLUTBitmapChar ch115 = { 8, 12, -1, 0, 10, ch115data }; + +static const unsigned char ch116data[] = { + 0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10 +}; +static const GLUTBitmapChar ch116 = { 7, 15, 0, 0, 7, ch116data }; + +static const unsigned char ch117data[] = { + 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0 +}; +static const GLUTBitmapChar ch117 = { 11, 12, -1, 0, 13, ch117data }; + +static const unsigned char ch118data[] = { + 0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80, + 0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0 +}; +static const GLUTBitmapChar ch118 = { 11, 12, 0, 0, 11, ch118data }; + +static const unsigned char ch119data[] = { + 0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19, + 0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3, + 0x0,0xf1,0xe7,0x80 +}; +static const GLUTBitmapChar ch119 = { 17, 12, 0, 0, 17, ch119data }; + +static const unsigned char ch120data[] = { + 0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0, + 0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0 +}; +static const GLUTBitmapChar ch120 = { 11, 12, -1, 0, 13, ch120data }; + +static const unsigned char ch121data[] = { + 0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, + 0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, + 0xf1,0xe0 +}; +static const GLUTBitmapChar ch121 = { 11, 17, 0, 5, 11, ch121data }; + +static const unsigned char ch122data[] = { + 0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff +}; +static const GLUTBitmapChar ch122 = { 8, 12, -1, 0, 10, ch122data }; + +static const unsigned char ch123data[] = { + 0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18, + 0x18,0x18,0x18,0x18,0xc,0x7 +}; +static const GLUTBitmapChar ch123 = { 8, 22, -1, 5, 10, ch123data }; + +static const unsigned char ch124data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0 +}; +static const GLUTBitmapChar ch124 = { 2, 17, -2, 0, 6, ch124data }; + +static const unsigned char ch125data[] = { + 0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18, + 0x18,0x18,0x18,0x18,0x30,0xe0 +}; +static const GLUTBitmapChar ch125 = { 8, 22, -1, 5, 10, ch125data }; + +static const unsigned char ch126data[] = { + 0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20 +}; +static const GLUTBitmapChar ch126 = { 11, 4, -1, -5, 13, ch126data }; + +static const unsigned char ch160data[] = { + 0x0 +}; +static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 6, ch160data }; + +static const unsigned char ch161data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0, + 0xc0 +}; +static const GLUTBitmapChar ch161 = { 2, 17, -4, 5, 8, ch161data }; + +static const unsigned char ch162data[] = { + 0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0, + 0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0 +}; +static const GLUTBitmapChar ch162 = { 9, 16, -1, 2, 12, ch162data }; + +static const unsigned char ch163data[] = { + 0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, + 0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80, + 0xf,0x0 +}; +static const GLUTBitmapChar ch163 = { 10, 17, -1, 0, 12, ch163data }; + +static const unsigned char ch164data[] = { + 0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60 +}; +static const GLUTBitmapChar ch164 = { 11, 12, -1, -3, 13, ch164data }; + +static const unsigned char ch165data[] = { + 0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0, + 0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30, + 0xf8,0x7c +}; +static const GLUTBitmapChar ch165 = { 14, 17, 0, 0, 14, ch165data }; + +static const unsigned char ch166data[] = { + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0 +}; +static const GLUTBitmapChar ch166 = { 2, 17, -2, 0, 6, ch166data }; + +static const unsigned char ch167data[] = { + 0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70, + 0x60,0x46,0x26,0x1c +}; +static const GLUTBitmapChar ch167 = { 8, 20, -2, 2, 12, ch167data }; + +static const unsigned char ch168data[] = { + 0xcc,0xcc +}; +static const GLUTBitmapChar ch168 = { 6, 2, -1, -14, 8, ch168data }; + +static const unsigned char ch169data[] = { + 0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4, + 0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0, + 0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, + 0x7,0xf0,0x0 +}; +static const GLUTBitmapChar ch169 = { 17, 17, -1, 0, 19, ch169data }; + +static const unsigned char ch170data[] = { + 0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78 +}; +static const GLUTBitmapChar ch170 = { 7, 9, 0, -8, 8, ch170data }; + +static const unsigned char ch171data[] = { + 0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0, + 0x19,0x80,0x8,0x80 +}; +static const GLUTBitmapChar ch171 = { 9, 10, -2, -1, 13, ch171data }; + +static const unsigned char ch172data[] = { + 0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0 +}; +static const GLUTBitmapChar ch172 = { 12, 7, -1, -3, 14, ch172data }; + +static const unsigned char ch173data[] = { + 0xfe,0xfe +}; +static const GLUTBitmapChar ch173 = { 7, 2, -1, -5, 9, ch173data }; + +static const unsigned char ch174data[] = { + 0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2, + 0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10, + 0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, + 0x7,0xf0,0x0 +}; +static const GLUTBitmapChar ch174 = { 17, 17, -1, 0, 19, ch174data }; + +static const unsigned char ch175data[] = { + 0xfc,0xfc +}; +static const GLUTBitmapChar ch175 = { 6, 2, -1, -14, 8, ch175data }; + +static const unsigned char ch176data[] = { + 0x38,0x44,0x82,0x82,0x82,0x44,0x38 +}; +static const GLUTBitmapChar ch176 = { 7, 7, -1, -10, 9, ch176data }; + +static const unsigned char ch177data[] = { + 0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, + 0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch177 = { 12, 15, -1, 0, 14, ch177data }; + +static const unsigned char ch178data[] = { + 0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38 +}; +static const GLUTBitmapChar ch178 = { 6, 10, 0, -7, 7, ch178data }; + +static const unsigned char ch179data[] = { + 0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38 +}; +static const GLUTBitmapChar ch179 = { 6, 10, 0, -7, 7, ch179data }; + +static const unsigned char ch180data[] = { + 0x80,0x60,0x38,0x18 +}; +static const GLUTBitmapChar ch180 = { 5, 4, -2, -13, 8, ch180data }; + +static const unsigned char ch181data[] = { + 0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0xe1,0xc0 +}; +static const GLUTBitmapChar ch181 = { 11, 17, -1, 5, 13, ch181data }; + +static const unsigned char ch182data[] = { + 0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0, + 0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0, + 0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80 +}; +static const GLUTBitmapChar ch182 = { 9, 22, -1, 5, 11, ch182data }; + +static const unsigned char ch183data[] = { + 0xc0,0xc0 +}; +static const GLUTBitmapChar ch183 = { 2, 2, -2, -6, 6, ch183data }; + +static const unsigned char ch184data[] = { + 0x78,0xcc,0xc,0x3c,0x30,0x10 +}; +static const GLUTBitmapChar ch184 = { 6, 6, -1, 6, 8, ch184data }; + +static const unsigned char ch185data[] = { + 0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20 +}; +static const GLUTBitmapChar ch185 = { 5, 10, -1, -7, 7, ch185data }; + +static const unsigned char ch186data[] = { + 0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78 +}; +static const GLUTBitmapChar ch186 = { 6, 9, -1, -8, 8, ch186data }; + +static const unsigned char ch187data[] = { + 0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0, + 0xcc,0x0,0x88,0x0 +}; +static const GLUTBitmapChar ch187 = { 9, 10, -2, -1, 12, ch187data }; + +static const unsigned char ch188data[] = { + 0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c, + 0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, + 0x20,0x8 +}; +static const GLUTBitmapChar ch188 = { 16, 17, -1, 0, 18, ch188data }; + +static const unsigned char ch189data[] = { + 0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46, + 0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, + 0x20,0x8 +}; +static const GLUTBitmapChar ch189 = { 15, 17, -1, 0, 18, ch189data }; + +static const unsigned char ch190data[] = { + 0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3, + 0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60, + 0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0, + 0x38,0x4,0x0 +}; +static const GLUTBitmapChar ch190 = { 17, 17, 0, 0, 18, ch190data }; + +static const unsigned char ch191data[] = { + 0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc, + 0xc +}; +static const GLUTBitmapChar ch191 = { 8, 17, -1, 5, 11, ch191data }; + +static const unsigned char ch192data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3, + 0x0,0x0 +}; +static const GLUTBitmapChar ch192 = { 17, 22, 0, 0, 17, ch192data }; + +static const unsigned char ch193data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0, + 0x30,0x0 +}; +static const GLUTBitmapChar ch193 = { 17, 22, 0, 0, 17, ch193data }; + +static const unsigned char ch194data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1, + 0x80,0x0 +}; +static const GLUTBitmapChar ch194 = { 17, 22, 0, 0, 17, ch194data }; + +static const unsigned char ch195data[] = { + 0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0 +}; +static const GLUTBitmapChar ch195 = { 17, 21, 0, 0, 17, ch195data }; + +static const unsigned char ch196data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0 +}; +static const GLUTBitmapChar ch196 = { 17, 21, 0, 0, 17, ch196data }; + +static const unsigned char ch197data[] = { + 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, + 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, + 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, + 0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0 +}; +static const GLUTBitmapChar ch197 = { 17, 21, 0, 0, 17, ch197data }; + +static const unsigned char ch198data[] = { + 0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8, + 0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60, + 0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60, + 0x3,0xff,0xe0 +}; +static const GLUTBitmapChar ch198 = { 20, 17, 0, 0, 21, ch198data }; + +static const unsigned char ch199data[] = { + 0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38, + 0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, + 0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4 +}; +static const GLUTBitmapChar ch199 = { 14, 23, -1, 6, 16, ch199data }; + +static const unsigned char ch200data[] = { + 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, + 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, + 0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0 +}; +static const GLUTBitmapChar ch200 = { 13, 22, -1, 0, 15, ch200data }; + +static const unsigned char ch201data[] = { + 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, + 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, + 0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0 +}; +static const GLUTBitmapChar ch201 = { 13, 22, -1, 0, 15, ch201data }; + +static const unsigned char ch202data[] = { + 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, + 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, + 0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0 +}; +static const GLUTBitmapChar ch202 = { 13, 22, -1, 0, 15, ch202data }; + +static const unsigned char ch203data[] = { + 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, + 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, + 0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80 +}; +static const GLUTBitmapChar ch203 = { 13, 21, -1, 0, 15, ch203data }; + +static const unsigned char ch204data[] = { + 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0xfc,0x0,0x8,0x30,0xe0,0xc0 +}; +static const GLUTBitmapChar ch204 = { 6, 22, -1, 0, 8, ch204data }; + +static const unsigned char ch205data[] = { + 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0xfc,0x0,0x40,0x30,0x1c,0xc +}; +static const GLUTBitmapChar ch205 = { 6, 22, -1, 0, 8, ch205data }; + +static const unsigned char ch206data[] = { + 0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, + 0x7e,0x0,0x81,0x66,0x3c,0x18 +}; +static const GLUTBitmapChar ch206 = { 8, 22, -1, 0, 8, ch206data }; + +static const unsigned char ch207data[] = { + 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0xfc,0x0,0x0,0xcc,0xcc +}; +static const GLUTBitmapChar ch207 = { 6, 21, -1, 0, 8, ch207data }; + +static const unsigned char ch208data[] = { + 0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3, + 0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38, + 0x7f,0xe0 +}; +static const GLUTBitmapChar ch208 = { 16, 17, 0, 0, 17, ch208data }; + +static const unsigned char ch209data[] = { + 0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, + 0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, + 0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90 +}; +static const GLUTBitmapChar ch209 = { 16, 21, -1, 0, 18, ch209data }; + +static const unsigned char ch210data[] = { + 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, + 0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch210 = { 16, 22, -1, 0, 18, ch210data }; + +static const unsigned char ch211data[] = { + 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, + 0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30 +}; +static const GLUTBitmapChar ch211 = { 16, 22, -1, 0, 18, ch211data }; + +static const unsigned char ch212data[] = { + 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, + 0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80 +}; +static const GLUTBitmapChar ch212 = { 16, 22, -1, 0, 18, ch212data }; + +static const unsigned char ch213data[] = { + 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, + 0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90 +}; +static const GLUTBitmapChar ch213 = { 16, 21, -1, 0, 18, ch213data }; + +static const unsigned char ch214data[] = { + 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, + 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, + 0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60 +}; +static const GLUTBitmapChar ch214 = { 16, 21, -1, 0, 18, ch214data }; + +static const unsigned char ch215data[] = { + 0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0, + 0x61,0x80,0xc0,0xc0,0x80,0x40 +}; +static const GLUTBitmapChar ch215 = { 10, 11, -2, -1, 14, ch215data }; + +static const unsigned char ch216data[] = { + 0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3, + 0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c, + 0x1c,0x38,0x7,0xe4,0x0,0x4 +}; +static const GLUTBitmapChar ch216 = { 16, 19, -1, 1, 18, ch216data }; + +static const unsigned char ch217data[] = { + 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch217 = { 16, 22, -1, 0, 18, ch217data }; + +static const unsigned char ch218data[] = { + 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30 +}; +static const GLUTBitmapChar ch218 = { 16, 22, -1, 0, 18, ch218data }; + +static const unsigned char ch219data[] = { + 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80 +}; +static const GLUTBitmapChar ch219 = { 16, 22, -1, 0, 18, ch219data }; + +static const unsigned char ch220data[] = { + 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, + 0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30 +}; +static const GLUTBitmapChar ch220 = { 16, 21, -1, 0, 18, ch220data }; + +static const unsigned char ch221data[] = { + 0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, + 0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, + 0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30 +}; +static const GLUTBitmapChar ch221 = { 16, 22, 0, 0, 16, ch221data }; + +static const unsigned char ch222data[] = { + 0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18, + 0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0, + 0xfc,0x0 +}; +static const GLUTBitmapChar ch222 = { 13, 17, -1, 0, 15, ch222data }; + +static const unsigned char ch223data[] = { + 0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80, + 0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, + 0x1e,0x0 +}; +static const GLUTBitmapChar ch223 = { 10, 17, -1, 0, 12, ch223data }; + +static const unsigned char ch224data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, + 0x60,0x0 +}; +static const GLUTBitmapChar ch224 = { 9, 17, -1, 0, 11, ch224data }; + +static const unsigned char ch225data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, + 0x3,0x0 +}; +static const GLUTBitmapChar ch225 = { 9, 17, -1, 0, 11, ch225data }; + +static const unsigned char ch226data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0, + 0x18,0x0 +}; +static const GLUTBitmapChar ch226 = { 9, 17, -1, 0, 11, ch226data }; + +static const unsigned char ch227data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0 +}; +static const GLUTBitmapChar ch227 = { 9, 16, -1, 0, 11, ch227data }; + +static const unsigned char ch228data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0 +}; +static const GLUTBitmapChar ch228 = { 9, 16, -1, 0, 11, ch228data }; + +static const unsigned char ch229data[] = { + 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, + 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, + 0x1c,0x0 +}; +static const GLUTBitmapChar ch229 = { 9, 17, -1, 0, 11, ch229data }; + +static const unsigned char ch230data[] = { + 0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc, + 0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0 +}; +static const GLUTBitmapChar ch230 = { 14, 12, -1, 0, 16, ch230data }; + +static const unsigned char ch231data[] = { + 0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0, + 0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80, + 0x63,0x80,0x1f,0x0 +}; +static const GLUTBitmapChar ch231 = { 9, 18, -1, 6, 11, ch231data }; + +static const unsigned char ch232data[] = { + 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, + 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, + 0x60,0x0 +}; +static const GLUTBitmapChar ch232 = { 9, 17, -1, 0, 11, ch232data }; + +static const unsigned char ch233data[] = { + 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, + 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, + 0x3,0x0 +}; +static const GLUTBitmapChar ch233 = { 9, 17, -1, 0, 11, ch233data }; + +static const unsigned char ch234data[] = { + 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, + 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, + 0xc,0x0 +}; +static const GLUTBitmapChar ch234 = { 9, 17, -1, 0, 11, ch234data }; + +static const unsigned char ch235data[] = { + 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, + 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 +}; +static const GLUTBitmapChar ch235 = { 9, 16, -1, 0, 11, ch235data }; + +static const unsigned char ch236data[] = { + 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0, + 0xc0 +}; +static const GLUTBitmapChar ch236 = { 5, 17, 0, 0, 6, ch236data }; + +static const unsigned char ch237data[] = { + 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38, + 0x18 +}; +static const GLUTBitmapChar ch237 = { 5, 17, -1, 0, 6, ch237data }; + +static const unsigned char ch238data[] = { + 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78, + 0x30 +}; +static const GLUTBitmapChar ch238 = { 6, 17, 0, 0, 6, ch238data }; + +static const unsigned char ch239data[] = { + 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc +}; +static const GLUTBitmapChar ch239 = { 6, 16, 0, 0, 6, ch239data }; + +static const unsigned char ch240data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80, + 0xc0,0x0 +}; +static const GLUTBitmapChar ch240 = { 10, 17, -1, 0, 12, ch240data }; + +static const unsigned char ch241data[] = { + 0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80 +}; +static const GLUTBitmapChar ch241 = { 11, 16, -1, 0, 13, ch241data }; + +static const unsigned char ch242data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, + 0x30,0x0 +}; +static const GLUTBitmapChar ch242 = { 10, 17, -1, 0, 12, ch242data }; + +static const unsigned char ch243data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, + 0x1,0x80 +}; +static const GLUTBitmapChar ch243 = { 10, 17, -1, 0, 12, ch243data }; + +static const unsigned char ch244data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, + 0xc,0x0 +}; +static const GLUTBitmapChar ch244 = { 10, 17, -1, 0, 12, ch244data }; + +static const unsigned char ch245data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80 +}; +static const GLUTBitmapChar ch245 = { 10, 16, -1, 0, 12, ch245data }; + +static const unsigned char ch246data[] = { + 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 +}; +static const GLUTBitmapChar ch246 = { 10, 16, -1, 0, 12, ch246data }; + +static const unsigned char ch247data[] = { + 0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0, + 0x6,0x0,0x6,0x0 +}; +static const GLUTBitmapChar ch247 = { 12, 10, -1, -2, 14, ch247data }; + +static const unsigned char ch248data[] = { + 0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0, + 0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0 +}; +static const GLUTBitmapChar ch248 = { 10, 14, -1, 1, 12, ch248data }; + +static const unsigned char ch249data[] = { + 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, + 0x30,0x0 +}; +static const GLUTBitmapChar ch249 = { 11, 17, -1, 0, 13, ch249data }; + +static const unsigned char ch250data[] = { + 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, + 0x1,0x80 +}; +static const GLUTBitmapChar ch250 = { 11, 17, -1, 0, 13, ch250data }; + +static const unsigned char ch251data[] = { + 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, + 0xc,0x0 +}; +static const GLUTBitmapChar ch251 = { 11, 17, -1, 0, 13, ch251data }; + +static const unsigned char ch252data[] = { + 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 +}; +static const GLUTBitmapChar ch252 = { 11, 16, -1, 0, 13, ch252data }; + +static const unsigned char ch253data[] = { + 0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, + 0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, + 0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80 +}; +static const GLUTBitmapChar ch253 = { 11, 22, 0, 5, 11, ch253data }; + +static const unsigned char ch254data[] = { + 0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, + 0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, + 0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0 +}; +static const GLUTBitmapChar ch254 = { 10, 22, -1, 5, 12, ch254data }; + +static const unsigned char ch255data[] = { + 0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, + 0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, + 0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 +}; +static const GLUTBitmapChar ch255 = { 11, 21, 0, 5, 11, ch255data }; + + +static const GLUTBitmapChar *chars[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, + &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, + &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, + &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, + &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, + &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, + &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, + &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, + &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, + &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, + &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, + &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, + &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, + &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, + &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, + &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, + &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, + &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, + &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, + &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, + &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, + &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, + &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 +}; + +const GLUTBitmapFont glutBitmapTimesRoman24 = { + "-Adobe-Times-Medium-R-Normal--24-240-75-75-P-124-ISO8859-1", + 28, 256, chars +}; diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/util.c xpsb-glx-0.19/mesa/src/glut/dos/util.c --- xpsb-glx-0.19/mesa/src/glut/dos/util.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/util.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,74 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 "internal.h" + + +extern GLUTStrokeFont glutStrokeRoman, glutStrokeMonoRoman; +extern GLUTBitmapFont glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18; + +/* To get around the fact that DJGPP DXEs only allow functions + to be exported and no data addresses (as Unix DSOs support), the + GLUT API constants such as GLUT_STROKE_ROMAN have to get passed + through a case statement to get mapped to the actual data structure + address. */ +void * +_glut_font (void *font) +{ + switch ((int)font) { + case (int)GLUT_STROKE_ROMAN: + return &glutStrokeRoman; + case (int)GLUT_STROKE_MONO_ROMAN: + return &glutStrokeMonoRoman; + case (int)GLUT_BITMAP_9_BY_15: + return &glutBitmap9By15; + case (int)GLUT_BITMAP_8_BY_13: + return &glutBitmap8By13; + case (int)GLUT_BITMAP_TIMES_ROMAN_10: + return &glutBitmapTimesRoman10; + case (int)GLUT_BITMAP_TIMES_ROMAN_24: + return &glutBitmapTimesRoman24; + case (int)GLUT_BITMAP_HELVETICA_10: + return &glutBitmapHelvetica10; + case (int)GLUT_BITMAP_HELVETICA_12: + return &glutBitmapHelvetica12; + case (int)GLUT_BITMAP_HELVETICA_18: + return &glutBitmapHelvetica18; + default: + if ((font == &glutStrokeRoman) || + (font == &glutStrokeMonoRoman) || + (font == &glutBitmap9By15) || + (font == &glutBitmap8By13) || + (font == &glutBitmapTimesRoman10) || + (font == &glutBitmapTimesRoman24) || + (font == &glutBitmapHelvetica10) || + (font == &glutBitmapHelvetica12) || + (font == &glutBitmapHelvetica18)) { + return font; + } + _glut_fatal("bad font!"); + return NULL; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/dos/window.c xpsb-glx-0.19/mesa/src/glut/dos/window.c --- xpsb-glx-0.19/mesa/src/glut/dos/window.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/dos/window.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,329 @@ +/* + * DOS/DJGPP Mesa Utility Toolkit + * Version: 1.0 + * + * Copyright (C) 2005 Daniel Borca 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 + * DANIEL BORCA 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 + +#include "internal.h" + + +static GLuint swaptime, swapcount; + +static DMesaVisual visual = NULL; + +GLUTwindow *_glut_current, *_glut_windows[MAX_WINDOWS]; + + +static void +clean (void) +{ + int i; + + for (i=1; i<=MAX_WINDOWS; i++) { + glutDestroyWindow(i); + } + if (visual) DMesaDestroyVisual(visual); + + pc_close_stdout(); + pc_close_stderr(); +} + + +static GLUTwindow * +_glut_window (int win) +{ + if (win > 0 && --win < MAX_WINDOWS) { + return _glut_windows[win]; + } + return NULL; +} + + +int APIENTRY +glutCreateWindow (const char *title) +{ + int i; + int m8width = (_glut_default.width + 7) & ~7; + + if (!(_glut_default.mode & GLUT_DOUBLE)) { + return 0; + } + + /* We set the Visual once. This will be our desktop (graphic mode). + * We should do this in the `glutInit' code, but we don't have any idea + * about its geometry. Supposedly, when we are about to create one + * window, we have a slight idea about resolution. + */ + if (!visual) { + if ((visual=DMesaCreateVisual(_glut_default.x + m8width, _glut_default.y + _glut_default.height, _glut_visual.bpp, _glut_visual.refresh, + GLUT_SINGLE, + !(_glut_default.mode & GLUT_INDEX), + (_glut_default.mode & GLUT_ALPHA ) ? _glut_visual.alpha : 0, + (_glut_default.mode & GLUT_DEPTH ) ? _glut_visual.depth : 0, + (_glut_default.mode & GLUT_STENCIL) ? _glut_visual.stencil : 0, + (_glut_default.mode & GLUT_ACCUM ) ? _glut_visual.accum : 0))==NULL) { + return 0; + } + + DMesaGetIntegerv(DMESA_GET_SCREEN_SIZE, _glut_visual.geometry); + DMesaGetIntegerv(DMESA_GET_DRIVER_CAPS, &_glut_visual.flags); + + /* Also hook stdio/stderr once */ + pc_open_stdout(); + pc_open_stderr(); + pc_atexit(clean); + } + + /* Search for an empty slot. + * Each window has its own rendering Context and its own Buffer. + */ + for (i=0; inum = ++i; + w->xpos = _glut_default.x; + w->ypos = _glut_default.y; + w->width = m8width; + w->height = _glut_default.height; + w->context = c; + w->buffer = b; + + return i; + } + } + + return 0; +} + + +int APIENTRY +glutCreateSubWindow (int win, int x, int y, int width, int height) +{ + return GL_FALSE; +} + + +void APIENTRY +glutDestroyWindow (int win) +{ + GLUTwindow *w = _glut_window(win); + if (w != NULL) { + if (w->destroy) { + w->destroy(); + } + DMesaMakeCurrent(NULL, NULL); + DMesaDestroyBuffer(w->buffer); + DMesaDestroyContext(w->context); + free(w); + _glut_windows[win - 1] = NULL; + } +} + + +void APIENTRY +glutPostRedisplay (void) +{ + _glut_current->redisplay = GL_TRUE; +} + + +void APIENTRY +glutSwapBuffers (void) +{ + if (_glut_current->show_mouse) { + /* XXX scare mouse */ + DMesaSwapBuffers(_glut_current->buffer); + /* XXX unscare mouse */ + } else { + DMesaSwapBuffers(_glut_current->buffer); + } + + if (_glut_fps) { + GLint t = glutGet(GLUT_ELAPSED_TIME); + swapcount++; + if (swaptime == 0) + swaptime = t; + else if (t - swaptime > _glut_fps) { + double time = 0.001 * (t - swaptime); + double fps = (double)swapcount / time; + fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", swapcount, time, fps); + swaptime = t; + swapcount = 0; + } + } +} + + +int APIENTRY +glutGetWindow (void) +{ + return _glut_current->num; +} + + +void APIENTRY +glutSetWindow (int win) +{ + GLUTwindow *w = _glut_window(win); + if (w != NULL) { + _glut_current = w; + DMesaMakeCurrent(_glut_current->context, _glut_current->buffer); + } +} + + +void APIENTRY +glutSetWindowTitle (const char *title) +{ +} + + +void APIENTRY +glutSetIconTitle (const char *title) +{ +} + + +void APIENTRY +glutPositionWindow (int x, int y) +{ + if (DMesaMoveBuffer(x, y)) { + _glut_current->xpos = x; + _glut_current->ypos = y; + } +} + + +void APIENTRY +glutReshapeWindow (int width, int height) +{ + if (DMesaResizeBuffer(width, height)) { + _glut_current->width = width; + _glut_current->height = height; + if (_glut_current->reshape) { + _glut_current->reshape(width, height); + } else { + glViewport(0, 0, width, height); + } + } +} + + +void APIENTRY +glutFullScreen (void) +{ +} + + +void APIENTRY +glutPopWindow (void) +{ +} + + +void APIENTRY +glutPushWindow (void) +{ +} + + +void APIENTRY +glutIconifyWindow (void) +{ +} + + +void APIENTRY +glutShowWindow (void) +{ +} + + +void APIENTRY +glutHideWindow (void) +{ +} + + +void APIENTRY +glutCloseFunc (GLUTdestroyCB destroy) +{ + _glut_current->destroy = destroy; +} + + +void APIENTRY +glutPostWindowRedisplay (int win) +{ + GLUTwindow *w = _glut_window(win); + if (w != NULL) { + w->redisplay = GL_TRUE; + } +} + + +void * APIENTRY +glutGetWindowData (void) +{ + return _glut_current->data; +} + + +void APIENTRY +glutSetWindowData (void *data) +{ + _glut_current->data = data; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/bitmap.c xpsb-glx-0.19/mesa/src/glut/fbdev/bitmap.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/bitmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/bitmap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,78 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + * + * To improve on this library, maybe support subwindows or overlays, + * I (sean at depagnier dot com) will do my best to help. + */ + + +#include "glutbitmap.h" + +void glutBitmapCharacter(GLUTbitmapFont font, int c) +{ + const BitmapCharRec *ch; + BitmapFontPtr fi = (BitmapFontPtr) font; + + if (c < fi->first || + c >= fi->first + fi->num_chars) + return; + ch = fi->ch[c - fi->first]; + if (!ch) + return; + + glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + + 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); + glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, + ch->advance, 0, ch->bitmap); + glPopClientAttrib(); +} + +int glutBitmapWidth (GLUTbitmapFont font, int c) +{ + const BitmapCharRec *ch; + BitmapFontPtr fi = (BitmapFontPtr) font; + + if (c < fi->first || c >= fi->first + fi->num_chars) + return 0; + ch = fi->ch[c - fi->first]; + if (ch) + return ch->advance; + return 0; +} + +int glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) +{ + int length = 0; + + for (; *string; string++) + length += glutBitmapWidth(font, *string); + return length; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/callback.c xpsb-glx-0.19/mesa/src/glut/fbdev/callback.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/callback.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/callback.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,171 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include + +#include + +#include "internal.h" + +void (*DisplayFunc)(void) = NULL; +void (*ReshapeFunc)(int width, int height) = NULL; +void (*KeyboardFunc)(unsigned char key, int x, int y) = NULL; +void (*KeyboardUpFunc)(unsigned char key, int x, int y) = NULL; +void (*MouseFunc)(int key, int state, int x, int y) = NULL; +void (*MotionFunc)(int x, int y) = NULL; +void (*PassiveMotionFunc)(int x, int y) = NULL; +void (*VisibilityFunc)(int state) = NULL; +void (*SpecialFunc)(int key, int x, int y) = NULL; +void (*SpecialUpFunc)(int key, int x, int y) = NULL; +void (*IdleFunc)(void) = NULL; +void (*MenuStatusFunc)(int state, int x, int y) = NULL; +void (*MenuStateFunc)(int state) = NULL; + +void glutDisplayFunc(void (*func)(void)) +{ + DisplayFunc = func; +} + +void glutOverlayDisplayFunc(void (*func)(void)) +{ +} + +void glutWindowStatusFunc(void (*func)(int state)) +{ +} + +void glutReshapeFunc(void (*func)(int width, int height)) +{ + ReshapeFunc = func; +} + +void glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) +{ + KeyboardFunc = func; +} + +void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y)) +{ + KeyboardUpFunc = func; +} + +void glutMouseFunc(void (*func)(int button, int state, int x, int y)) +{ + MouseFunc = func; +} + +void glutMotionFunc(void (*func)(int x, int y)) +{ + MotionFunc = func; +} + +void glutPassiveMotionFunc(void (*func)(int x, int y)) +{ + PassiveMotionFunc = func; +} + +void glutJoystickFunc(void (*func)(unsigned int buttonMask, + int x, int y, int z), int pollInterval) +{ +} + +void glutVisibilityFunc(void (*func)(int state)) +{ + VisibilityFunc = func; +} + +void glutEntryFunc(void (*func)(int state)) +{ +} + +void glutSpecialFunc(void (*func)(int key, int x, int y)) +{ + SpecialFunc = func; +} + +void glutSpecialUpFunc(void (*func)(int key, int x, int y)) +{ + SpecialUpFunc = func; +} + +void glutSpaceballMotionFunc(void (*func)(int x, int y, int z)) +{ +} + +void glutSpaceballRotateFunc(void (*func)(int x, int y, int z)) +{ +} + +void glutSpaceballButtonFunc(void (*func)(int button, int state)) +{ +} + +void glutButtonBoxFunc(void (*func)(int button, int state)) +{ +} + +void glutDialsFunc(void (*func)(int dial, int value)) +{ +} + +void glutTabletMotionFunc(void (*func)(int x, int y)) +{ +} + +void glutTabletButtonFunc(void (*func)(int button, int state, + int x, int y)) +{ +} + +void glutMenuStatusFunc(void (*func)(int status, int x, int y)) +{ + MenuStatusFunc = func; +} + +void glutMenuStateFunc(void (*func)(int status)) +{ + MenuStateFunc = func; +} + +void glutIdleFunc(void (*func)(void)) +{ + IdleFunc = func; +} + +void glutTimerFunc(unsigned int msecs, + void (*func)(int value), int value) +{ + struct GlutTimer **head = &GlutTimers, *timer = malloc(sizeof *timer); + timer->time = glutGet(GLUT_ELAPSED_TIME) + msecs; + timer->func = func; + timer->value = value; + + while(*head && (*head)->time < timer->time) + head = &(*head)->next; + + timer->next = *head; + *head = timer; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/colormap.c xpsb-glx-0.19/mesa/src/glut/fbdev/colormap.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/colormap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/colormap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,177 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include + +#include + +#include +#include + +#include "internal.h" + +#define TOCMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat) ((1<<16) - 1)) +#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1)) +#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1) + +static struct fb_cmap ColorMap, OriginalColorMap; + +unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256]; + +unsigned char ReverseColorMap[REVERSECMAPSIZE] + [REVERSECMAPSIZE] + [REVERSECMAPSIZE]; + +static void FindReverseMap(int r, int g, int b) +{ + static int count; + int i, shift = 16 - REVERSECMAPSIZELOG; + unsigned int minv = -1, mini = 0; + for(i=0; i<256; i++) { + int val = 0; + val += abs(r-(RedColorMap[i]>>shift)); + val += abs(g-(GreenColorMap[i]>>shift)); + val += abs(b-(BlueColorMap[i]>>shift)); + if(val < minv) { + minv = val; + mini = i; + } + } + ReverseColorMap[r][g][b] = mini; +} + +static void FillItemReverseColorMap(int r, int g, int b) +{ + FindReverseMap(r, g, b); + if(r > 0) + FindReverseMap(r-1, g, b); + if(r < REVERSECMAPSIZE - 1) + FindReverseMap(r+1, g, b); + if(g > 0) + FindReverseMap(r, g-1, b); + if(g < REVERSECMAPSIZE - 1) + FindReverseMap(r, g+1, b); + if(b > 0) + FindReverseMap(r, g, b-1); + if(b < REVERSECMAPSIZE - 1) + FindReverseMap(r, g, b+1); +} + +static void FillReverseColorMap(void) +{ + int r, g, b; + for(r = 0; r < REVERSECMAPSIZE; r++) + for(g = 0; g < REVERSECMAPSIZE; g++) + for(b = 0; b < REVERSECMAPSIZE; b++) + FindReverseMap(r, g, b); +} + +void RestoreColorMap(void) +{ + if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) + return; + + if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0) + sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n"); +} + +void LoadColorMap(void) +{ + if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) + return; + + ColorMap.start = 0; + ColorMap.red = RedColorMap; + ColorMap.green = GreenColorMap; + ColorMap.blue = BlueColorMap; + ColorMap.transp = NULL; + + if(DisplayMode & GLUT_INDEX) { + ColorMap.len = 256; + + if (ioctl(FrameBufferFD, FBIOGETCMAP, (void *) &ColorMap) < 0) + sprintf(exiterror, "ioctl(FBIOGETCMAP) failed!\n"); + + FillReverseColorMap(); + } else { + int rcols = 1 << VarInfo.red.length; + int gcols = 1 << VarInfo.green.length; + int bcols = 1 << VarInfo.blue.length; + + int i; + + ColorMap.len = gcols; + + for (i = 0; i < rcols ; i++) + RedColorMap[i] = (65536/(rcols-1)) * i; + + for (i = 0; i < gcols ; i++) + GreenColorMap[i] = (65536/(gcols-1)) * i; + + for (i = 0; i < bcols ; i++) + BlueColorMap[i] = (65536/(bcols-1)) * i; + + RestoreColorMap(); + } +} + +void glutSetColor(int cell, GLfloat red, GLfloat green, GLfloat blue) +{ + if(cell < 0 || cell >= 256) + return; + + RedColorMap[cell] = TOCMAP(red); + GreenColorMap[cell] = TOCMAP(green); + BlueColorMap[cell] = TOCMAP(blue); + + RestoreColorMap(); + + FillItemReverseColorMap(TORMAP(red), TORMAP(green), TORMAP(blue)); +} + +GLfloat glutGetColor(int cell, int component) +{ + if(!(DisplayMode & GLUT_INDEX)) + return -1.0; + + if(cell < 0 || cell > 256) + return -1.0; + + switch(component) { + case GLUT_RED: + return FROMCMAP(RedColorMap[cell]); + case GLUT_GREEN: + return FROMCMAP(GreenColorMap[cell]); + case GLUT_BLUE: + return FROMCMAP(BlueColorMap[cell]); + } + return -1.0; +} + +void glutCopyColormap(int win) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/cursor.c xpsb-glx-0.19/mesa/src/glut/fbdev/cursor.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/cursor.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/cursor.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,272 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +/* these routines are written to access graphics memory directly, not using mesa + to render the cursor, this is faster, it would be good to use a hardware + cursor if it exists instead */ + +#include +#include +#include +#include + +#include + +#include + +#include "internal.h" +#include "cursors.h" + +int CurrentCursor = GLUT_CURSOR_LEFT_ARROW; + +static int LastMouseX, LastMouseY; +static unsigned char *MouseBuffer; + +void InitializeCursor(void) +{ + if(!MouseBuffer && (MouseBuffer = malloc(CURSOR_WIDTH * CURSOR_HEIGHT + * VarInfo.bits_per_pixel / 8)) == NULL) { + sprintf(exiterror, "malloc failure\n"); + exit(0); + } + + MouseX = VarInfo.xres / 2; + MouseY = VarInfo.yres / 2; +} + +void EraseCursor(void) +{ + int off = LastMouseY * FixedInfo.line_length + + LastMouseX * VarInfo.bits_per_pixel / 8; + int stride = CURSOR_WIDTH * VarInfo.bits_per_pixel / 8; + int i; + + unsigned char *src = MouseBuffer; + + if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) + return; + + for(i = 0; i (int)VarInfo.xres - CURSOR_WIDTH) + LastMouseX = VarInfo.xres - CURSOR_WIDTH; + else + LastMouseX = x; + + if(y < 0) + LastMouseY = 0; + else + if(y > (int)VarInfo.yres - CURSOR_HEIGHT) + LastMouseY = VarInfo.yres - CURSOR_HEIGHT; + else + LastMouseY = y; + + bypp = VarInfo.bits_per_pixel / 8; + off = LastMouseY * FixedInfo.line_length + LastMouseX * bypp; + stride = CURSOR_WIDTH * bypp; + for(i = 0; i= NUM_CURSORS) + return; + + px = MouseX - CursorsXOffset[CurrentCursor]; + py = MouseY - CursorsYOffset[CurrentCursor]; + + SaveCursor(px, py); + + xoff = 0; + if(px < 0) + xoff = -px; + + xlen = CURSOR_WIDTH; + if(px + CURSOR_WIDTH > VarInfo.xres) + xlen = VarInfo.xres - px; + + yoff = 0; + if(py < 0) + yoff = -py; + + ylen = CURSOR_HEIGHT; + if(py + CURSOR_HEIGHT > VarInfo.yres) + ylen = VarInfo.yres - py; + + bypp = VarInfo.bits_per_pixel / 8; + + c = BackBuffer + FixedInfo.line_length * (py + yoff) + (px + xoff) * bypp; + cstride = FixedInfo.line_length - bypp * (xlen - xoff); + + d = Cursors[CurrentCursor] + (CURSOR_WIDTH * yoff + xoff)*4; + dstride = (CURSOR_WIDTH - xlen + xoff) * 4; + + switch(bypp) { + case 1: + { + const int shift = 8 - REVERSECMAPSIZELOG; + for(i = yoff; i < ylen; i++) { + for(j = xoff; j < xlen; j++) { + if(d[3] < 220) + *c = ReverseColorMap + [(d[0]+(((int)(RedColorMap[c[0]]>>8)*d[3])>>8))>>shift] + [(d[1]+(((int)(GreenColorMap[c[0]]>>8)*d[3])>>8))>>shift] + [(d[2]+(((int)(BlueColorMap[c[0]]>>8)*d[3])>>8))>>shift]; + c++; + d+=4; + } + d += dstride; + c += cstride; + } + } break; + case 2: + { + uint16_t *e = (void*)c; + cstride /= 2; + for(i = yoff; i < ylen; i++) { + for(j = xoff; j < xlen; j++) { + if(d[3] < 220) + e[0] = ((((d[0] + (((int)(((e[0] >> 8) & 0xf8) + | ((c[0] >> 11) & 0x7)) * d[3]) >> 8)) & 0xf8) << 8) + | (((d[1] + (((int)(((e[0] >> 3) & 0xfc) + | ((e[0] >> 5) & 0x3)) * d[3]) >> 8)) & 0xfc) << 3) + | ((d[2] + (((int)(((e[0] << 3) & 0xf8) + | (e[0] & 0x7)) * d[3]) >> 8)) >> 3)); + + e++; + d+=4; + } + d += dstride; + e += cstride; + } + } break; + case 3: + case 4: + for(i = yoff; i < ylen; i++) { + for(j = xoff; j < xlen; j++) { + if(d[3] < 220) { + c[0] = d[0] + (((int)c[0] * d[3]) >> 8); + c[1] = d[1] + (((int)c[1] * d[3]) >> 8); + c[2] = d[2] + (((int)c[2] * d[3]) >> 8); + } + + c+=bypp; + d+=4; + } + d += dstride; + c += cstride; + } break; + } +} + +#define MIN(x, y) x < y ? x : y +void SwapCursor(void) +{ + int px = MouseX - CursorsXOffset[CurrentCursor]; + int py = MouseY - CursorsYOffset[CurrentCursor]; + + int minx = MIN(px, LastMouseX); + int sizex = abs(px - LastMouseX); + + int miny = MIN(py, LastMouseY); + int sizey = abs(py - LastMouseY); + + if(MouseVisible) + DrawCursor(); + + /* now update the portion of the screen that has changed, this is also + used to hide the mouse if MouseVisible is 0 */ + if(DisplayMode & GLUT_DOUBLE && ((sizex || sizey) || !MouseVisible)) { + int off, stride, i; + if(minx < 0) + minx = 0; + if(miny < 0) + miny = 0; + + if(minx + sizex > VarInfo.xres - CURSOR_WIDTH) + sizex = VarInfo.xres - CURSOR_WIDTH - minx; + if(miny + sizey > VarInfo.yres - CURSOR_HEIGHT) + sizey = VarInfo.yres - CURSOR_HEIGHT - miny; + off = FixedInfo.line_length * miny + + minx * VarInfo.bits_per_pixel / 8; + stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8; + + for(i = 0; i < sizey + CURSOR_HEIGHT; i++) { + memcpy(FrameBuffer+off, BackBuffer+off, stride); + off += FixedInfo.line_length; + } + } +} + +void glutWarpPointer(int x, int y) +{ + if(x < 0) + x = 0; + if(x >= VarInfo.xres) + x = VarInfo.xres - 1; + MouseX = x; + + if(y < 0) + y = 0; + if(y >= VarInfo.yres) + y = VarInfo.yres - 1; + MouseY = y; + + EraseCursor(); + SwapCursor(); +} + +void glutSetCursor(int cursor) +{ + if(cursor == GLUT_CURSOR_FULL_CROSSHAIR) + cursor = GLUT_CURSOR_CROSSHAIR; + + EraseCursor(); + MouseVisible = 1; + CurrentCursor = cursor; + SwapCursor(); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/cursors.h xpsb-glx-0.19/mesa/src/glut/fbdev/cursors.h --- xpsb-glx-0.19/mesa/src/glut/fbdev/cursors.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/cursors.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,7099 @@ +/* These cursor images were generated from png files + included in xorg. + + They are in the format RGBA and are each 32x32 + the RGB components have already been multiplied + by the alpha, and the alpha is already inverted */ + +#define CURSOR_WIDTH 32 +#define CURSOR_HEIGHT 32 + +int CursorsXOffset[20]={16, 4, 9, 16, 7, 16, 10, 8, 8, 11, + 16, 13, 12, 20, 3, 28, 3, 28, 28, 3}; +int CursorsYOffset[20]={4, 4, 2, 20, 28, 14, 0, 8, 14, 11, + 14, 12, 3, 28, 18, 12, 3, 3, 26, 26}; + +const unsigned char Cursors[][CURSOR_WIDTH * CURSOR_HEIGHT * 4] = { + { + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, + 0, 0, 0, 76, 0, 0, 0, 100, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, + 127, 127, 127, 64, 0, 0, 0, 64, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 210, 2, 2, 2, 73, 127, 127, 127, 64, + 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 251, + 0, 0, 0, 247, 0, 0, 0, 248, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, + 2, 2, 2, 73, 127, 127, 127, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 248, 0, 0, 0, 236, + 0, 0, 0, 227, 0, 0, 0, 229, 0, 0, 0, 240, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, + 127, 127, 127, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 254, + 0, 0, 0, 248, 0, 0, 0, 234, 0, 0, 0, 221, + 0, 0, 0, 217, 0, 0, 0, 218, 0, 0, 0, 228, + 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 210, 2, 2, 2, 73, 127, 127, 127, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 248, + 0, 0, 0, 234, 0, 0, 0, 221, 0, 0, 0, 216, + 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, + 2, 2, 2, 73, 127, 127, 127, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 62, 0, 0, 0, 234, + 0, 0, 0, 221, 0, 0, 0, 216, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, + 127, 127, 127, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 189, 189, 189, 62, 0, 0, 0, 59, 0, 0, 0, 221, + 0, 0, 0, 216, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 210, 2, 2, 2, 73, 127, 127, 127, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 62, + 189, 189, 189, 59, 0, 0, 0, 55, 0, 0, 0, 216, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, + 2, 2, 2, 73, 127, 127, 127, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 59, + 189, 189, 189, 55, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, + 127, 127, 127, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 189, 189, 189, 62, 189, 189, 189, 59, 189, 189, 189, 55, + 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 222, 2, 2, 2, 73, 127, 127, 127, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 62, + 189, 189, 189, 59, 189, 189, 189, 55, 190, 190, 190, 54, + 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 189, 26, 26, 26, 64, 130, 130, 130, 64, + 187, 187, 187, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 59, + 189, 189, 189, 55, 190, 190, 190, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 174, 0, 0, 0, 94, + 23, 23, 23, 64, 104, 104, 104, 64, 178, 178, 178, 64, + 189, 189, 189, 62, 189, 189, 189, 59, 189, 189, 189, 55, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 201, 0, 0, 0, 97, 56, 56, 56, 62, + 189, 189, 189, 59, 189, 189, 189, 55, 190, 190, 190, 54, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 91, 133, 133, 133, 61, + 189, 189, 189, 56, 190, 190, 190, 54, 148, 148, 148, 54, + 127, 127, 127, 54, 186, 186, 186, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 198, 26, 26, 26, 63, 189, 189, 189, 60, + 189, 189, 189, 55, 190, 190, 190, 54, 56, 56, 56, 54, + 0, 0, 0, 67, 20, 20, 20, 54, 101, 101, 101, 54, + 175, 175, 175, 54, 0, 0, 0, 54, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 118, 107, 107, 107, 64, 189, 189, 189, 62, + 189, 189, 189, 57, 165, 165, 165, 55, 2, 2, 2, 59, + 0, 0, 0, 203, 0, 0, 0, 172, 0, 0, 0, 105, + 5, 5, 5, 56, 0, 0, 0, 72, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 225, + 8, 8, 8, 64, 178, 178, 178, 64, 189, 189, 189, 63, + 190, 190, 190, 61, 88, 88, 88, 59, 0, 0, 0, 119, + 0, 0, 0, 218, 0, 0, 0, 216, 0, 0, 0, 215, + 0, 0, 0, 202, 0, 0, 0, 207, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 144, + 80, 80, 80, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 184, 184, 184, 64, 14, 14, 14, 63, 0, 0, 0, 202, + 0, 0, 0, 222, 0, 0, 0, 216, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 243, 0, 0, 0, 73, + 160, 160, 160, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 122, 122, 122, 64, 0, 0, 0, 102, 0, 0, 0, 237, + 0, 0, 0, 220, 0, 0, 0, 216, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 216, + 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 225, + 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 207, 23, 23, 23, 64, + 169, 169, 169, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 41, 41, 41, 64, 0, 0, 0, 178, 0, 0, 0, 229, + 0, 0, 0, 217, 0, 0, 0, 216, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 216, + 0, 0, 0, 218, 0, 0, 0, 219, 0, 0, 0, 217, + 0, 0, 0, 216, 0, 0, 0, 217, 0, 0, 0, 228, + 0, 0, 0, 247, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 249, 0, 0, 0, 135, + 2, 2, 2, 70, 62, 62, 62, 64, 110, 110, 110, 64, + 0, 0, 0, 78, 0, 0, 0, 234, 0, 0, 0, 222, + 0, 0, 0, 216, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 217, + 0, 0, 0, 227, 0, 0, 0, 235, 0, 0, 0, 230, + 0, 0, 0, 225, 0, 0, 0, 226, 0, 0, 0, 239, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 237, 0, 0, 0, 165, 0, 0, 0, 111, + 0, 0, 0, 179, 0, 0, 0, 232, 0, 0, 0, 218, + 0, 0, 0, 216, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 221, + 0, 0, 0, 239, 0, 0, 0, 250, 0, 0, 0, 249, + 0, 0, 0, 245, 0, 0, 0, 246, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 245, 0, 0, 0, 224, 0, 0, 0, 216, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 216, 0, 0, 0, 217, 0, 0, 0, 228, + 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 242, 0, 0, 0, 222, 0, 0, 0, 216, + 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, + 0, 0, 0, 216, 0, 0, 0, 219, 0, 0, 0, 236, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 246, 0, 0, 0, 228, 0, 0, 0, 218, + 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 216, + 0, 0, 0, 216, 0, 0, 0, 225, 0, 0, 0, 244, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 243, 0, 0, 0, 231, + 0, 0, 0, 223, 0, 0, 0, 219, 0, 0, 0, 217, + 0, 0, 0, 220, 0, 0, 0, 234, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 249, + 0, 0, 0, 242, 0, 0, 0, 235, 0, 0, 0, 231, + 0, 0, 0, 235, 0, 0, 0, 247, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 100, + 0, 0, 0, 76, 0, 0, 0, 210, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 127, 127, 127, 64, 2, 2, 2, 73, 0, 0, 0, 210, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 127, 127, 127, 64, 2, 2, 2, 73, + 0, 0, 0, 210, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 248, 0, 0, 0, 248, 0, 0, 0, 251, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 127, 127, 127, 64, + 2, 2, 2, 73, 0, 0, 0, 208, 0, 0, 0, 241, + 0, 0, 0, 230, 0, 0, 0, 228, 0, 0, 0, 237, + 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 127, 127, 127, 64, 2, 2, 2, 71, 0, 0, 0, 189, + 0, 0, 0, 219, 0, 0, 0, 218, 0, 0, 0, 222, + 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 127, 127, 127, 62, 2, 2, 2, 64, + 0, 0, 0, 179, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 127, 127, 127, 57, + 3, 3, 3, 62, 0, 0, 0, 179, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 235, + 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 127, 127, 127, 54, 3, 3, 3, 62, 0, 0, 0, 179, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 222, + 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 127, 127, 127, 54, 3, 3, 3, 62, + 0, 0, 0, 179, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 127, 127, 127, 54, + 3, 3, 3, 62, 0, 0, 0, 179, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 235, + 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 127, 127, 127, 54, 3, 3, 3, 62, 0, 0, 0, 179, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 222, + 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 127, 127, 127, 54, 3, 3, 3, 62, + 0, 0, 0, 189, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 186, 186, 186, 54, 130, 130, 130, 54, 26, 26, 26, 54, + 0, 0, 0, 161, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 235, + 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 178, 178, 178, 54, 103, 103, 103, 54, + 23, 23, 23, 54, 0, 0, 0, 79, 0, 0, 0, 148, + 0, 0, 0, 214, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 222, + 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 56, 56, 56, 54, 0, 0, 0, 82, + 0, 0, 0, 171, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 187, 187, 187, 64, + 127, 127, 127, 64, 147, 147, 147, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 133, 133, 133, 54, 0, 0, 0, 77, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 218, 0, 0, 0, 224, 0, 0, 0, 243, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, + 175, 175, 175, 64, 100, 100, 100, 64, 20, 20, 20, 64, + 0, 0, 0, 79, 56, 56, 56, 62, 189, 189, 189, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 26, 26, 26, 54, + 0, 0, 0, 169, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 241, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 85, + 5, 5, 5, 67, 0, 0, 0, 124, 0, 0, 0, 204, + 0, 0, 0, 240, 2, 2, 2, 68, 165, 165, 165, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 106, 106, 106, 54, + 0, 0, 0, 100, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 218, + 0, 0, 0, 221, 0, 0, 0, 230, 0, 0, 0, 246, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 246, + 0, 0, 0, 240, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 132, 88, 88, 88, 57, + 190, 190, 190, 54, 190, 190, 190, 54, 178, 178, 178, 54, + 8, 8, 8, 54, 0, 0, 0, 192, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 219, 0, 0, 0, 227, + 0, 0, 0, 236, 0, 0, 0, 245, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 209, 14, 14, 14, 57, + 184, 184, 184, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 80, 80, 80, 54, 0, 0, 0, 123, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 223, 0, 0, 0, 239, + 0, 0, 0, 251, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 246, 0, 0, 0, 92, + 121, 121, 121, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 160, 160, 160, 54, 0, 0, 0, 62, 0, 0, 0, 207, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 221, 0, 0, 0, 238, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 248, 0, 0, 0, 166, + 41, 41, 41, 55, 190, 190, 190, 54, 189, 189, 189, 55, + 169, 169, 169, 55, 23, 23, 23, 55, 0, 0, 0, 176, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 218, 0, 0, 0, 230, + 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 234, + 0, 0, 0, 71, 109, 109, 109, 57, 62, 62, 62, 58, + 2, 2, 2, 65, 0, 0, 0, 122, 0, 0, 0, 214, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 223, + 0, 0, 0, 241, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 178, 0, 0, 0, 109, 0, 0, 0, 163, + 0, 0, 0, 233, 0, 0, 0, 240, 0, 0, 0, 222, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 219, + 0, 0, 0, 233, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 247, 0, 0, 0, 229, + 0, 0, 0, 218, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 226, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 237, + 0, 0, 0, 221, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, + 0, 0, 0, 226, 0, 0, 0, 218, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 219, + 0, 0, 0, 229, 0, 0, 0, 246, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 235, 0, 0, 0, 222, 0, 0, 0, 219, + 0, 0, 0, 220, 0, 0, 0, 224, 0, 0, 0, 232, + 0, 0, 0, 243, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 247, 0, 0, 0, 236, 0, 0, 0, 232, + 0, 0, 0, 236, 0, 0, 0, 243, 0, 0, 0, 249, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 13, 14, 20, 170, 45, 49, 63, 26, + 50, 52, 63, 26, 63, 67, 78, 80, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 17, 18, 21, 197, 36, 36, 41, 108, 53, 53, 63, 0, + 58, 57, 69, 0, 76, 81, 96, 28, 62, 65, 76, 129, + 16, 17, 19, 233, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 4, 4, 17, 55, 94, 94, 99, 0, 210, 213, 218, 0, + 206, 209, 214, 0, 117, 118, 124, 0, 23, 24, 36, 0, + 31, 33, 38, 210, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 13, 12, 22, 55, 100, 100, 103, 0, 202, 204, 208, 0, + 193, 195, 200, 0, 122, 123, 128, 0, 29, 30, 39, 0, + 29, 32, 36, 210, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 14, 14, 25, 55, 101, 101, 104, 0, 201, 203, 208, 0, + 193, 195, 200, 0, 121, 121, 127, 0, 32, 32, 43, 0, + 28, 31, 37, 210, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 17, 16, 27, 55, 101, 101, 104, 0, 200, 203, 207, 0, + 193, 196, 201, 0, 119, 120, 125, 0, 33, 33, 44, 0, + 26, 29, 36, 187, 0, 0, 0, 189, 0, 0, 0, 189, + 0, 0, 0, 203, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 17, 16, 27, 55, 101, 101, 104, 0, 199, 201, 206, 0, + 194, 196, 200, 0, 118, 119, 124, 0, 36, 36, 46, 0, + 24, 27, 34, 173, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 187, 0, 0, 0, 220, 0, 0, 0, 248, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 18, 17, 28, 55, 102, 103, 106, 0, 202, 205, 210, 0, + 198, 200, 205, 0, 117, 118, 123, 0, 40, 40, 51, 0, + 7, 7, 9, 169, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 240, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 20, 19, 29, 55, 104, 104, 107, 0, 204, 206, 212, 0, + 201, 203, 208, 0, 117, 117, 123, 0, 34, 35, 47, 0, + 13, 15, 19, 160, 12, 13, 17, 164, 13, 14, 17, 164, + 13, 14, 17, 164, 14, 15, 18, 164, 12, 13, 15, 224, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 2, 2, 6, 197, 22, 22, 30, 20, 33, 33, 39, 20, + 19, 20, 25, 163, 0, 0, 0, 255, 0, 0, 0, 255, + 23, 22, 33, 55, 103, 103, 106, 0, 205, 207, 212, 0, + 202, 204, 210, 0, 114, 114, 121, 0, 27, 27, 36, 0, + 41, 45, 56, 0, 43, 46, 58, 0, 38, 41, 54, 0, + 52, 54, 65, 0, 49, 51, 64, 0, 51, 54, 66, 45, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 9, 9, 9, 28, 79, 80, 85, 0, 82, 82, 89, 0, + 52, 54, 63, 77, 25, 28, 34, 151, 0, 0, 0, 255, + 23, 22, 33, 55, 103, 103, 106, 0, 207, 209, 213, 0, + 205, 207, 212, 0, 112, 113, 119, 0, 33, 32, 42, 0, + 72, 73, 78, 0, 36, 36, 47, 0, 30, 30, 41, 0, + 74, 75, 81, 0, 45, 44, 52, 0, 39, 40, 50, 22, + 41, 42, 49, 126, 25, 26, 30, 211, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 26, 26, 26, 25, 211, 213, 218, 0, 214, 217, 221, 0, + 67, 67, 77, 0, 21, 20, 26, 50, 5, 5, 7, 246, + 25, 24, 32, 50, 103, 103, 106, 0, 209, 211, 215, 0, + 208, 210, 214, 0, 111, 112, 118, 0, 60, 60, 70, 0, + 209, 210, 214, 0, 98, 99, 106, 0, 77, 76, 83, 0, + 204, 206, 210, 0, 67, 68, 74, 0, 34, 34, 44, 0, + 2, 2, 20, 0, 58, 61, 70, 143, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 2, 2, 2, 104, 73, 74, 78, 0, 216, 218, 222, 0, + 191, 193, 199, 0, 149, 150, 156, 3, 23, 23, 36, 11, + 33, 32, 40, 0, 97, 97, 101, 0, 209, 211, 216, 0, + 208, 210, 214, 0, 113, 113, 119, 0, 57, 56, 65, 0, + 204, 205, 209, 0, 99, 99, 105, 0, 78, 77, 84, 0, + 198, 200, 205, 0, 70, 69, 77, 0, 87, 86, 93, 0, + 167, 168, 173, 0, 73, 74, 83, 2, 45, 47, 54, 101, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 2, 218, 27, 27, 31, 61, 130, 131, 135, 0, + 197, 198, 203, 0, 183, 184, 190, 0, 90, 90, 100, 0, + 38, 37, 47, 0, 103, 103, 108, 0, 210, 212, 216, 0, + 210, 212, 217, 0, 159, 160, 164, 0, 108, 109, 114, 0, + 209, 211, 215, 0, 148, 149, 153, 0, 122, 122, 127, 0, + 202, 204, 209, 0, 78, 78, 87, 0, 112, 112, 118, 0, + 201, 203, 208, 0, 68, 67, 74, 0, 39, 40, 46, 89, + 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 2, 2, 3, 198, 17, 16, 26, 0, + 163, 165, 169, 0, 203, 205, 209, 0, 222, 224, 228, 0, + 62, 61, 70, 0, 107, 107, 114, 0, 209, 211, 216, 0, + 225, 227, 231, 0, 213, 215, 220, 0, 209, 212, 216, 0, + 214, 216, 220, 0, 212, 214, 218, 0, 205, 208, 213, 0, + 210, 212, 217, 0, 66, 67, 74, 0, 107, 108, 113, 0, + 202, 204, 208, 0, 68, 68, 75, 0, 38, 38, 46, 63, + 0, 0, 0, 178, 0, 0, 0, 190, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 3, 3, 4, 209, 21, 20, 31, 0, + 170, 172, 176, 0, 209, 211, 216, 0, 210, 212, 216, 0, + 55, 54, 63, 0, 107, 108, 114, 0, 209, 212, 216, 0, + 230, 232, 236, 0, 239, 242, 245, 0, 236, 238, 242, 0, + 234, 237, 241, 0, 229, 232, 237, 0, 219, 221, 227, 0, + 209, 211, 216, 0, 194, 197, 202, 0, 204, 206, 211, 0, + 205, 207, 211, 0, 67, 67, 74, 0, 36, 38, 45, 63, + 0, 0, 0, 178, 0, 0, 0, 184, 0, 0, 0, 219, + 0, 0, 0, 242, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 3, 3, 3, 226, 5, 5, 14, 93, + 110, 111, 119, 22, 177, 179, 183, 0, 215, 217, 221, 0, + 111, 111, 120, 0, 155, 156, 162, 0, 213, 215, 220, 0, + 228, 231, 234, 0, 233, 236, 240, 0, 232, 235, 240, 0, + 229, 231, 236, 0, 225, 227, 231, 0, 217, 220, 225, 0, + 211, 213, 218, 0, 203, 205, 211, 0, 201, 203, 208, 0, + 214, 216, 221, 0, 66, 66, 72, 0, 36, 38, 45, 63, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 221, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 10, 9, 20, 65, 87, 87, 93, 0, 229, 231, 234, 0, + 210, 212, 216, 0, 205, 207, 212, 0, 213, 215, 221, 0, + 221, 224, 229, 0, 226, 229, 234, 0, 226, 229, 234, 0, + 221, 223, 228, 0, 216, 219, 224, 0, 213, 215, 221, 0, + 209, 211, 216, 0, 203, 206, 212, 0, 201, 203, 208, 0, + 214, 217, 221, 0, 63, 62, 68, 0, 36, 37, 44, 63, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 179, 0, 0, 0, 209, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 247, 14, 14, 17, 170, 36, 37, 48, 0, + 204, 206, 209, 0, 212, 214, 220, 0, 212, 214, 219, 0, + 215, 218, 224, 0, 219, 222, 227, 0, 218, 221, 227, 0, + 215, 217, 223, 0, 211, 213, 219, 0, 209, 211, 217, 0, + 206, 208, 215, 0, 206, 209, 215, 0, 212, 214, 219, 0, + 217, 219, 224, 0, 53, 52, 59, 0, 34, 36, 44, 63, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 205, 28, 27, 35, 0, + 198, 199, 203, 0, 211, 214, 219, 0, 207, 210, 215, 0, + 208, 210, 216, 0, 209, 212, 218, 0, 210, 212, 217, 0, + 206, 209, 215, 0, 204, 207, 213, 0, 200, 203, 209, 0, + 198, 201, 206, 0, 206, 209, 215, 0, 201, 203, 207, 0, + 152, 154, 160, 0, 41, 43, 51, 58, 14, 14, 18, 124, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 1, 205, 5, 5, 18, 0, + 207, 209, 213, 0, 221, 223, 227, 0, 205, 207, 212, 0, + 200, 203, 209, 0, 203, 206, 212, 0, 202, 205, 211, 0, + 200, 202, 208, 0, 197, 199, 205, 0, 195, 198, 203, 0, + 193, 195, 200, 0, 196, 198, 203, 0, 154, 155, 160, 0, + 36, 36, 42, 0, 43, 49, 60, 108, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 1, 244, + 32, 31, 42, 14, 115, 115, 120, 0, 195, 197, 201, 0, + 195, 197, 202, 0, 196, 199, 204, 0, 196, 199, 205, 0, + 196, 198, 203, 0, 194, 196, 201, 0, 191, 194, 199, 0, + 191, 193, 197, 0, 191, 193, 198, 0, 156, 157, 162, 0, + 32, 31, 38, 0, 44, 48, 59, 108, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 25, 25, 36, 16, 109, 110, 114, 0, 198, 200, 205, 0, + 194, 196, 201, 0, 195, 197, 203, 0, 195, 198, 203, 0, + 194, 197, 202, 0, 194, 196, 200, 0, 193, 195, 199, 0, + 191, 193, 198, 0, 191, 193, 197, 0, 156, 158, 163, 0, + 28, 27, 34, 0, 29, 32, 39, 126, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 9, 9, 21, 39, 81, 82, 86, 1, 176, 178, 182, 22, + 170, 171, 175, 21, 170, 172, 176, 15, 171, 173, 176, 15, + 170, 171, 175, 15, 169, 171, 175, 15, 168, 170, 174, 16, + 168, 170, 173, 22, 168, 170, 174, 22, 136, 138, 141, 15, + 18, 18, 23, 0, 25, 27, 33, 134, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 248, 0, 0, 0, 77, 0, 0, 0, 52, + 0, 0, 0, 49, 0, 0, 0, 36, 0, 0, 0, 36, + 0, 0, 0, 36, 0, 0, 0, 36, 0, 0, 0, 36, + 0, 0, 0, 38, 0, 0, 0, 38, 0, 0, 0, 36, + 0, 0, 0, 109, 1, 1, 1, 176, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 200, 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 241, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 223, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 184, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 223, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 184, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 231, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 191, + 0, 0, 0, 178, 0, 0, 0, 183, 0, 0, 0, 183, + 0, 0, 0, 183, 0, 0, 0, 183, 0, 0, 0, 183, + 0, 0, 0, 183, 0, 0, 0, 183, 0, 0, 0, 185, + 0, 0, 0, 185, 0, 0, 0, 182, 0, 0, 0, 178, + 0, 0, 0, 235, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 200, 0, 0, 0, 193, 0, 0, 0, 193, + 0, 0, 0, 193, 0, 0, 0, 193, 0, 0, 0, 193, + 0, 0, 0, 193, 0, 0, 0, 193, 0, 0, 0, 194, + 0, 0, 0, 194, 0, 0, 0, 193, 0, 0, 0, 221, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 7, 7, 7, 246, 14, 14, 14, 239, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 45, 45, 45, 164, + 51, 51, 51, 83, 47, 47, 47, 67, 53, 53, 53, 61, + 45, 45, 45, 54, 50, 50, 50, 64, 55, 55, 55, 135, + 24, 24, 24, 223, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 8, 8, 8, 243, 39, 39, 39, 111, 7, 7, 7, 50, + 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, + 0, 0, 0, 50, 0, 0, 0, 50, 1, 1, 1, 50, + 37, 37, 37, 61, 48, 48, 48, 177, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 59, 59, 59, 100, 3, 3, 3, 50, 2, 2, 2, 50, + 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, + 0, 0, 0, 50, 0, 0, 0, 50, 1, 1, 1, 50, + 4, 4, 4, 50, 44, 44, 44, 56, 26, 26, 26, 226, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 6, 6, 6, 248, + 35, 35, 35, 54, 1, 1, 1, 50, 2, 2, 2, 50, + 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, + 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, + 1, 1, 1, 50, 31, 31, 31, 50, 44, 44, 44, 205, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 252, + 38, 38, 38, 55, 16, 16, 16, 50, 2, 2, 2, 50, + 1, 1, 1, 50, 1, 1, 1, 50, 0, 0, 0, 50, + 0, 0, 0, 50, 1, 1, 1, 50, 1, 1, 1, 48, + 5, 5, 5, 44, 30, 30, 30, 42, 35, 35, 35, 171, + 0, 0, 0, 208, 0, 0, 0, 210, 0, 0, 0, 243, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 77, 77, 77, 56, 39, 39, 39, 51, 2, 2, 2, 50, + 14, 14, 14, 50, 12, 12, 12, 50, 2, 2, 2, 50, + 3, 3, 3, 50, 13, 13, 13, 45, 2, 2, 2, 36, + 4, 4, 4, 35, 65, 65, 65, 36, 39, 39, 39, 134, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 203, 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 101, 101, 101, 58, 45, 45, 45, 66, 98, 98, 98, 50, + 161, 161, 161, 50, 155, 155, 155, 50, 16, 16, 16, 50, + 112, 112, 112, 44, 161, 161, 161, 35, 131, 131, 131, 35, + 14, 14, 14, 35, 108, 108, 108, 54, 7, 7, 7, 172, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 191, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 84, 84, 84, 117, 14, 14, 14, 50, 149, 149, 149, 50, + 163, 163, 163, 50, 148, 148, 148, 50, 41, 41, 41, 49, + 106, 106, 106, 35, 163, 163, 163, 35, 163, 163, 163, 35, + 33, 33, 33, 35, 84, 84, 84, 63, 15, 15, 15, 166, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 238, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 72, 72, 72, 70, 5, 5, 5, 50, 65, 65, 65, 50, + 108, 108, 108, 50, 58, 58, 58, 50, 125, 125, 125, 50, + 79, 79, 79, 35, 97, 97, 97, 35, 80, 80, 80, 35, + 6, 6, 6, 35, 36, 36, 36, 40, 27, 27, 27, 153, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 238, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 14, 14, 14, 239, 57, 57, 57, 141, 71, 71, 71, 102, + 61, 61, 61, 87, 12, 12, 12, 50, 154, 154, 154, 52, + 94, 94, 94, 35, 38, 38, 38, 41, 70, 70, 70, 87, + 69, 69, 69, 54, 30, 30, 30, 147, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 233, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 100, 100, 100, 99, + 100, 100, 100, 102, 48, 48, 48, 57, 23, 23, 23, 50, + 42, 42, 42, 39, 92, 92, 92, 50, 50, 50, 50, 129, + 49, 49, 49, 135, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 186, 0, 0, 0, 245, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 21, 21, 21, 227, + 33, 33, 33, 206, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 28, 28, 28, 214, 43, 43, 43, 50, + 111, 111, 111, 105, 99, 99, 99, 63, 103, 103, 103, 60, + 105, 105, 105, 45, 114, 114, 114, 59, 67, 67, 67, 60, + 50, 50, 50, 102, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 8, 8, 8, 171, 35, 35, 35, 145, + 0, 0, 0, 178, 0, 0, 0, 196, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 3, 3, 3, 251, 55, 55, 55, 66, + 29, 29, 29, 51, 18, 18, 18, 225, 0, 0, 0, 255, + 0, 0, 0, 255, 38, 38, 38, 205, 30, 30, 30, 51, + 105, 105, 105, 57, 102, 102, 102, 63, 99, 99, 99, 56, + 112, 112, 112, 42, 113, 113, 113, 46, 19, 19, 19, 35, + 41, 41, 41, 111, 0, 0, 0, 178, 0, 0, 0, 178, + 23, 23, 23, 158, 52, 52, 52, 65, 55, 55, 55, 36, + 13, 13, 13, 168, 0, 0, 0, 180, 0, 0, 0, 239, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 42, 42, 42, 206, 24, 24, 24, 50, + 6, 6, 6, 50, 47, 47, 47, 178, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 48, 48, 48, 168, + 24, 24, 24, 52, 32, 32, 32, 50, 63, 63, 63, 50, + 40, 40, 40, 43, 14, 14, 14, 37, 38, 38, 38, 60, + 17, 17, 17, 165, 0, 0, 0, 178, 29, 29, 29, 147, + 40, 40, 40, 48, 55, 55, 55, 48, 49, 49, 49, 38, + 9, 9, 9, 170, 0, 0, 0, 211, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 45, 45, 45, 137, 4, 4, 4, 50, + 3, 3, 3, 50, 44, 44, 44, 68, 38, 38, 38, 203, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 26, 26, 26, 193, 41, 41, 41, 72, 39, 39, 39, 57, + 14, 14, 14, 71, 22, 22, 22, 140, 1, 1, 1, 211, + 0, 0, 0, 202, 36, 36, 36, 137, 31, 31, 31, 46, + 16, 16, 16, 35, 87, 87, 87, 50, 24, 24, 24, 47, + 23, 23, 23, 191, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 32, 32, 32, 198, 30, 30, 30, 60, 65, 65, 65, 62, + 38, 38, 38, 50, 6, 6, 6, 50, 24, 24, 24, 50, + 55, 55, 55, 110, 38, 38, 38, 199, 3, 3, 3, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 252, + 2, 2, 2, 252, 11, 11, 11, 237, 11, 11, 11, 167, + 15, 15, 15, 115, 40, 40, 40, 40, 76, 76, 76, 62, + 84, 84, 84, 47, 53, 53, 53, 39, 36, 36, 36, 39, + 20, 20, 20, 192, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 80, 80, 80, 119, 2, 2, 2, 50, 20, 20, 20, 50, + 41, 41, 41, 67, 64, 64, 64, 50, 10, 10, 10, 50, + 2, 2, 2, 50, 14, 14, 14, 50, 51, 51, 51, 66, + 60, 60, 60, 120, 8, 8, 8, 244, 0, 0, 0, 255, + 12, 12, 12, 214, 51, 51, 51, 83, 24, 24, 24, 36, + 15, 15, 15, 39, 93, 93, 93, 41, 55, 55, 55, 64, + 47, 47, 47, 118, 38, 38, 38, 150, 41, 41, 41, 145, + 2, 2, 2, 214, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 222, 0, 0, 0, 194, + 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 21, 21, 21, 231, 90, 90, 90, 96, 51, 51, 51, 185, + 0, 0, 0, 255, 13, 13, 13, 239, 9, 9, 9, 227, + 55, 55, 55, 102, 36, 36, 36, 54, 42, 42, 42, 36, + 96, 96, 96, 35, 73, 73, 73, 88, 24, 24, 24, 75, + 7, 7, 7, 50, 13, 13, 13, 50, 62, 62, 62, 40, + 80, 80, 80, 78, 38, 38, 38, 148, 0, 0, 0, 178, + 0, 0, 0, 179, 0, 0, 0, 181, 2, 2, 2, 177, + 1, 1, 1, 234, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 206, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 57, 57, 57, 191, 24, 24, 24, 50, 25, 25, 25, 106, + 8, 8, 8, 232, 8, 8, 8, 244, 3, 3, 3, 251, + 73, 73, 73, 148, 66, 66, 66, 97, 55, 55, 55, 38, + 7, 7, 7, 35, 3, 3, 3, 40, 40, 40, 40, 50, + 77, 77, 77, 93, 80, 80, 80, 106, 34, 34, 34, 51, + 44, 44, 44, 45, 26, 26, 26, 102, 14, 14, 14, 148, + 44, 44, 44, 141, 65, 65, 65, 133, 55, 55, 55, 82, + 29, 29, 29, 77, 46, 46, 46, 194, 0, 0, 0, 198, + 0, 0, 0, 178, 0, 0, 0, 189, 0, 0, 0, 180, + 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 58, 58, 58, 57, 35, 35, 35, 65, + 14, 14, 14, 51, 17, 17, 17, 52, 15, 15, 15, 60, + 4, 4, 4, 48, 1, 1, 1, 38, 30, 30, 30, 38, + 56, 56, 56, 61, 49, 49, 49, 114, 23, 23, 23, 173, + 33, 33, 33, 182, 60, 60, 60, 84, 45, 45, 45, 57, + 35, 35, 35, 50, 14, 14, 14, 45, 60, 60, 60, 50, + 38, 38, 38, 46, 18, 18, 18, 47, 4, 4, 4, 50, + 6, 6, 6, 48, 35, 35, 35, 140, 0, 0, 0, 181, + 0, 0, 0, 184, 0, 0, 0, 182, 0, 0, 0, 178, + 0, 0, 0, 236, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 57, 57, 57, 131, 34, 34, 34, 51, + 28, 28, 28, 52, 58, 58, 58, 50, 36, 36, 36, 50, + 54, 54, 54, 48, 46, 46, 46, 104, 23, 23, 23, 158, + 1, 1, 1, 177, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 190, 13, 13, 13, 206, + 43, 43, 43, 187, 60, 60, 60, 112, 54, 54, 54, 57, + 85, 85, 85, 58, 87, 87, 87, 60, 39, 39, 39, 41, + 60, 60, 60, 71, 16, 16, 16, 169, 0, 0, 0, 189, + 0, 0, 0, 192, 0, 0, 0, 203, 0, 0, 0, 205, + 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 35, 35, 35, 119, 12, 12, 12, 50, + 76, 76, 76, 62, 46, 46, 46, 98, 51, 51, 51, 169, + 11, 11, 11, 216, 0, 0, 0, 191, 0, 0, 0, 204, + 0, 0, 0, 229, 0, 0, 0, 217, 0, 0, 0, 212, + 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 179, 0, 0, 0, 223, 18, 18, 18, 195, + 56, 56, 56, 84, 15, 15, 15, 36, 6, 6, 6, 35, + 46, 46, 46, 121, 0, 0, 0, 211, 0, 0, 0, 238, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 38, 38, 38, 194, 50, 50, 50, 115, + 51, 51, 51, 158, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 234, 0, 0, 0, 182, 0, 0, 0, 225, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 226, 0, 0, 0, 201, 0, 0, 0, 180, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 180, 53, 53, 53, 102, 58, 58, 58, 62, + 35, 35, 35, 166, 0, 0, 0, 240, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 227, + 0, 0, 0, 220, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 247, 0, 0, 0, 178, 0, 0, 0, 180, + 0, 0, 0, 203, 0, 0, 0, 207, 0, 0, 0, 213, + 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 190, 0, 0, 0, 213, + 0, 0, 0, 218, 1, 1, 1, 177, 1, 1, 1, 177, + 0, 0, 0, 178, 0, 0, 0, 182, 0, 0, 0, 194, + 0, 0, 0, 190, 0, 0, 0, 183, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 198, 0, 0, 0, 184, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 186, 0, 0, 0, 214, + 0, 0, 0, 237, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 235, 0, 0, 0, 220, + 0, 0, 0, 199, 0, 0, 0, 178, 0, 0, 0, 181, + 0, 0, 0, 181, 0, 0, 0, 180, 0, 0, 0, 178, + 0, 0, 0, 187, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 202, 0, 0, 0, 178, + 0, 0, 0, 183, 0, 0, 0, 178, 0, 0, 0, 192, + 0, 0, 0, 223, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 245, 0, 0, 0, 214, + 0, 0, 0, 179, 0, 0, 0, 184, 0, 0, 0, 178, + 0, 0, 0, 218, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 0, 0, 0, 178, + 0, 0, 0, 191, 0, 0, 0, 241, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 245, 0, 0, 0, 188, 0, 0, 0, 178, + 0, 0, 0, 226, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 239, 0, 0, 0, 237, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 13, 13, 13, 233, 58, 58, 58, 179, + 87, 87, 87, 150, 89, 89, 89, 146, 68, 68, 68, 166, + 23, 23, 23, 213, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 22, 22, 22, 226, + 150, 150, 150, 90, 239, 239, 239, 8, 249, 249, 249, 0, + 242, 242, 242, 0, 243, 243, 243, 0, 248, 248, 248, 0, + 248, 248, 248, 2, 180, 180, 180, 46, 50, 50, 50, 175, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 35, 35, 35, 212, 220, 220, 220, 26, + 245, 245, 245, 0, 197, 197, 197, 0, 159, 159, 159, 1, + 134, 134, 134, 21, 133, 133, 133, 30, 178, 178, 178, 6, + 219, 219, 219, 0, 242, 242, 242, 0, 229, 229, 229, 2, + 83, 83, 83, 126, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 4, 4, 4, 247, 200, 200, 200, 43, 246, 246, 246, 0, + 175, 175, 175, 0, 82, 82, 82, 54, 12, 12, 12, 200, + 0, 0, 0, 253, 0, 0, 0, 255, 3, 3, 3, 229, + 81, 81, 81, 103, 216, 216, 216, 2, 239, 239, 239, 0, + 216, 216, 216, 2, 45, 45, 45, 167, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 80, 80, 80, 160, 254, 254, 254, 0, 206, 206, 206, 0, + 104, 104, 104, 36, 1, 1, 1, 239, 0, 0, 0, 255, + 0, 0, 0, 246, 0, 0, 0, 207, 0, 0, 0, 182, + 0, 0, 0, 178, 75, 75, 75, 96, 242, 242, 242, 0, + 231, 231, 231, 0, 140, 140, 140, 31, 0, 0, 0, 202, + 0, 0, 0, 243, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 163, 163, 163, 75, 243, 243, 243, 0, 177, 177, 177, 0, + 36, 36, 36, 155, 0, 0, 0, 255, 0, 0, 0, 239, + 0, 0, 0, 185, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 1, 1, 1, 177, 203, 203, 203, 20, + 242, 242, 242, 0, 183, 183, 183, 2, 5, 5, 5, 156, + 0, 0, 0, 182, 0, 0, 0, 232, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 141, 141, 141, 57, 162, 162, 162, 11, 139, 139, 139, 6, + 3, 3, 3, 229, 0, 0, 0, 250, 0, 0, 0, 187, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 195, + 0, 0, 0, 236, 0, 0, 0, 252, 168, 168, 168, 66, + 243, 243, 243, 0, 178, 178, 178, 1, 10, 10, 10, 145, + 0, 0, 0, 178, 0, 0, 0, 182, 0, 0, 0, 242, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 247, 2, 2, 2, 228, + 0, 0, 0, 254, 0, 0, 0, 218, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 194, 0, 0, 0, 252, + 0, 0, 0, 255, 2, 2, 2, 251, 207, 207, 207, 32, + 234, 234, 234, 0, 154, 154, 154, 5, 2, 2, 2, 183, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 204, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 191, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 234, 0, 0, 0, 255, + 0, 0, 0, 255, 105, 105, 105, 137, 253, 253, 253, 0, + 196, 196, 196, 0, 88, 88, 88, 64, 0, 0, 0, 246, + 0, 0, 0, 179, 0, 0, 0, 178, 0, 0, 0, 184, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 183, 0, 0, 0, 179, + 0, 0, 0, 183, 0, 0, 0, 253, 0, 0, 0, 254, + 99, 99, 99, 143, 248, 248, 248, 3, 213, 213, 213, 0, + 126, 126, 126, 10, 13, 13, 13, 203, 0, 0, 0, 255, + 0, 0, 0, 186, 0, 0, 0, 178, 0, 0, 0, 180, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 247, + 0, 0, 0, 242, 2, 2, 2, 252, 126, 126, 126, 115, + 251, 251, 251, 1, 213, 213, 213, 0, 130, 130, 130, 6, + 24, 24, 24, 170, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 184, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 1, 1, 1, 253, 138, 138, 138, 104, 252, 252, 252, 0, + 202, 202, 202, 0, 119, 119, 119, 11, 21, 21, 21, 175, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 214, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 206, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 87, 87, 87, 155, 252, 252, 252, 1, 200, 200, 200, 0, + 113, 113, 113, 19, 13, 13, 13, 197, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 218, 0, 0, 0, 179, + 0, 0, 0, 178, 0, 0, 0, 183, 0, 0, 0, 244, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 250, + 211, 211, 211, 30, 231, 231, 231, 0, 139, 139, 139, 5, + 13, 13, 13, 196, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 210, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 181, 0, 0, 0, 233, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 32, 32, 32, 207, + 252, 252, 252, 1, 208, 208, 208, 0, 85, 85, 85, 78, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 205, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 182, + 0, 0, 0, 233, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 58, 58, 58, 176, + 253, 253, 253, 0, 195, 195, 195, 0, 59, 59, 59, 128, + 0, 0, 0, 255, 0, 0, 0, 218, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 185, 0, 0, 0, 240, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 49, 49, 49, 177, + 174, 174, 174, 17, 134, 134, 134, 17, 35, 35, 35, 153, + 0, 0, 0, 250, 0, 0, 0, 182, 0, 0, 0, 178, + 0, 0, 0, 182, 0, 0, 0, 241, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 254, + 0, 0, 0, 231, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 211, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 1, 1, 1, 252, + 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 254, + 0, 0, 0, 220, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 228, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 176, 176, 176, 51, + 238, 238, 238, 0, 230, 230, 230, 0, 55, 55, 55, 148, + 0, 0, 0, 219, 0, 0, 0, 179, 0, 0, 0, 179, + 0, 0, 0, 234, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 182, 182, 182, 51, + 252, 252, 252, 0, 204, 204, 204, 0, 46, 46, 46, 148, + 0, 0, 0, 253, 0, 0, 0, 250, 0, 0, 0, 250, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 4, 4, 4, 245, + 31, 31, 31, 206, 37, 37, 37, 199, 195, 195, 195, 40, + 249, 249, 249, 0, 200, 200, 200, 0, 80, 80, 80, 108, + 49, 49, 49, 186, 31, 31, 31, 197, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 3, 3, 3, 247, + 182, 182, 182, 40, 251, 251, 251, 0, 254, 254, 254, 0, + 253, 253, 253, 0, 236, 236, 236, 0, 247, 247, 247, 0, + 204, 204, 204, 0, 49, 49, 49, 97, 0, 0, 0, 184, + 0, 0, 0, 236, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 41, 41, 41, 186, 233, 233, 233, 1, 250, 250, 250, 0, + 254, 254, 254, 0, 249, 249, 249, 0, 197, 197, 197, 0, + 100, 100, 100, 25, 0, 0, 0, 173, 0, 0, 0, 178, + 0, 0, 0, 234, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 127, 127, 127, 87, 243, 243, 243, 0, + 252, 252, 252, 0, 223, 223, 223, 0, 151, 151, 151, 0, + 23, 23, 23, 123, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 224, 0, 0, 0, 241, 0, 0, 0, 245, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 12, 12, 12, 228, 209, 209, 209, 14, + 243, 243, 243, 0, 184, 184, 184, 0, 78, 78, 78, 47, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 227, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 77, 77, 77, 143, + 231, 231, 231, 0, 135, 135, 135, 3, 11, 11, 11, 146, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 195, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 1, 1, 1, 250, + 154, 154, 154, 48, 56, 56, 56, 104, 0, 0, 0, 190, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 179, 0, 0, 0, 238, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 21, 21, 21, 201, 3, 3, 3, 233, 0, 0, 0, 235, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 206, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 205, 0, 0, 0, 178, 0, 0, 0, 182, + 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 247, 0, 0, 0, 183, 0, 0, 0, 217, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 229, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 3, 2, 251, + 14, 20, 12, 231, 23, 36, 18, 210, 28, 45, 22, 199, + 29, 47, 23, 197, 28, 48, 21, 194, 20, 35, 15, 211, + 5, 8, 4, 244, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 32, 43, 28, 204, 79, 121, 65, 112, 100, 173, 76, 47, + 95, 180, 66, 38, 82, 175, 50, 38, 77, 169, 46, 38, + 74, 166, 44, 38, 68, 162, 37, 38, 67, 161, 36, 38, + 62, 155, 30, 42, 63, 138, 38, 74, 43, 96, 26, 129, + 16, 38, 9, 202, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 1, 1, 1, 253, 39, 54, 33, 191, 95, 142, 79, 88, + 107, 184, 82, 38, 83, 175, 52, 38, 54, 149, 22, 38, + 33, 116, 5, 38, 24, 98, 0, 42, 21, 83, 0, 66, + 17, 68, 0, 99, 15, 60, 0, 116, 12, 51, 0, 134, + 13, 52, 0, 134, 17, 66, 0, 117, 27, 92, 5, 85, + 36, 114, 10, 54, 34, 95, 13, 106, 10, 23, 5, 220, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 54, 94, 41, 123, 0, 1, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 24, 33, 22, 216, + 99, 140, 86, 93, 107, 185, 81, 38, 87, 181, 55, 38, + 52, 147, 20, 39, 26, 102, 0, 38, 18, 75, 0, 62, + 7, 30, 0, 156, 0, 3, 0, 240, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 2, 0, 248, 11, 44, 0, 167, 27, 94, 4, 76, + 0, 3, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 12, 16, 10, 235, 78, 157, 52, 42, 9, 37, 0, 179, + 1, 1, 1, 253, 70, 93, 62, 148, 116, 182, 94, 43, + 96, 184, 66, 38, 68, 174, 33, 38, 37, 134, 5, 39, + 22, 90, 0, 39, 9, 35, 0, 126, 0, 1, 0, 248, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 245, 0, 0, 0, 236, 0, 0, 0, 232, + 0, 0, 0, 229, 0, 0, 0, 227, 0, 0, 0, 231, + 0, 0, 0, 239, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 42, 64, 35, 177, 79, 171, 49, 38, 26, 102, 1, 80, + 78, 106, 69, 133, 117, 188, 94, 38, 82, 182, 49, 38, + 53, 168, 15, 38, 32, 129, 0, 39, 22, 89, 0, 39, + 7, 29, 0, 148, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 246, 0, 0, 0, 214, 0, 0, 0, 185, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 181, 0, 0, 0, 194, + 0, 0, 0, 217, 0, 0, 0, 246, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 72, 117, 57, 115, 78, 178, 45, 39, 49, 164, 11, 38, + 91, 182, 61, 39, 81, 182, 47, 38, 49, 172, 7, 38, + 35, 141, 0, 38, 23, 95, 0, 38, 7, 28, 0, 150, + 0, 0, 0, 255, 0, 0, 0, 244, 0, 0, 0, 208, + 0, 0, 0, 180, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 179, 0, 0, 0, 187, + 0, 0, 0, 201, 0, 0, 0, 208, 0, 0, 0, 215, + 0, 0, 0, 219, 0, 0, 0, 215, 0, 0, 0, 206, + 0, 0, 0, 195, 0, 0, 0, 184, 0, 0, 0, 218, + 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 1, 252, + 96, 164, 73, 58, 72, 179, 36, 38, 48, 173, 6, 38, + 54, 175, 13, 38, 47, 173, 5, 35, 39, 160, 0, 34, + 29, 120, 0, 38, 14, 56, 0, 98, 0, 0, 0, 250, + 0, 0, 0, 214, 0, 0, 0, 180, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 181, + 0, 0, 0, 208, 0, 0, 0, 243, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 246, 0, 0, 0, 208, + 0, 0, 0, 222, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 26, 38, 22, 209, + 96, 178, 69, 42, 62, 178, 24, 38, 43, 172, 0, 38, + 43, 172, 0, 38, 42, 171, 0, 32, 37, 149, 0, 29, + 26, 104, 0, 38, 3, 14, 0, 189, 0, 0, 0, 188, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 188, 0, 0, 0, 243, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 56, 89, 45, 148, + 87, 181, 55, 39, 53, 175, 12, 38, 43, 172, 0, 38, + 43, 172, 0, 38, 42, 172, 0, 28, 37, 152, 0, 27, + 29, 118, 0, 38, 9, 25, 3, 153, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 192, 0, 0, 0, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 85, 141, 67, 86, + 77, 179, 42, 40, 47, 173, 5, 38, 42, 171, 0, 38, + 41, 166, 0, 36, 39, 159, 0, 27, 37, 150, 0, 27, + 38, 147, 2, 27, 50, 149, 17, 29, 35, 95, 15, 76, + 7, 20, 3, 154, 0, 0, 0, 178, 0, 0, 0, 191, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 3, 12, 0, 217, 3, 12, 0, 228, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 11, 16, 10, 236, 101, 177, 75, 44, + 62, 171, 26, 38, 38, 150, 0, 38, 34, 139, 0, 38, + 32, 129, 0, 33, 29, 117, 0, 27, 25, 104, 0, 29, + 20, 85, 0, 40, 15, 60, 0, 71, 9, 36, 0, 108, + 2, 9, 0, 156, 0, 0, 0, 179, 0, 0, 0, 241, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 1, 0, 249, 3, 14, 0, 209, + 8, 35, 0, 157, 15, 59, 0, 105, 21, 85, 0, 55, + 53, 129, 27, 39, 32, 53, 25, 186, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 40, 62, 33, 179, 75, 161, 46, 38, + 30, 117, 1, 38, 26, 104, 0, 39, 20, 83, 0, 61, + 14, 56, 0, 84, 7, 32, 0, 114, 2, 12, 0, 150, + 0, 0, 0, 175, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 203, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 2, 0, 246, 4, 17, 0, 200, 9, 38, 0, 151, + 15, 61, 0, 100, 22, 89, 0, 52, 27, 107, 0, 39, + 29, 120, 0, 38, 33, 131, 0, 38, 54, 155, 19, 38, + 98, 175, 73, 45, 8, 11, 7, 241, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 33, 63, 22, 159, 15, 54, 2, 119, + 7, 29, 0, 171, 2, 9, 0, 223, 0, 0, 0, 249, + 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 205, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 11, 41, 1, 159, + 33, 107, 8, 47, 33, 119, 5, 38, 31, 125, 0, 40, + 33, 132, 0, 38, 35, 142, 0, 38, 38, 152, 0, 38, + 40, 161, 0, 38, 46, 168, 5, 38, 78, 180, 43, 39, + 80, 134, 62, 93, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 231, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 184, + 0, 0, 0, 218, 0, 0, 0, 254, 0, 0, 0, 254, + 16, 40, 8, 197, 41, 116, 16, 90, 38, 147, 2, 38, + 39, 160, 0, 38, 43, 171, 0, 38, 43, 172, 0, 39, + 43, 172, 0, 38, 54, 175, 14, 38, 87, 181, 56, 39, + 52, 83, 41, 154, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 245, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 179, + 0, 0, 0, 183, 0, 0, 0, 198, 0, 0, 0, 215, + 0, 0, 0, 235, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 3, 14, 0, 211, 28, 114, 0, 38, + 38, 155, 0, 38, 43, 172, 0, 38, 43, 172, 0, 38, + 43, 172, 0, 38, 63, 178, 25, 38, 96, 178, 68, 39, + 22, 32, 19, 186, 0, 0, 0, 205, 0, 0, 0, 187, + 0, 0, 0, 178, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 188, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 183, + 0, 0, 0, 201, 0, 0, 0, 219, 0, 0, 0, 237, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 11, 44, 0, 123, 29, 117, 0, 38, + 39, 160, 0, 38, 43, 172, 0, 36, 44, 173, 1, 33, + 45, 173, 3, 31, 72, 179, 37, 28, 92, 158, 69, 45, + 1, 1, 1, 177, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 205, + 0, 0, 0, 222, 0, 0, 0, 240, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 3, 12, 0, 206, 22, 89, 0, 42, 34, 138, 0, 37, + 44, 170, 2, 29, 65, 178, 26, 27, 69, 179, 32, 27, + 52, 172, 12, 27, 83, 181, 51, 27, 68, 110, 53, 85, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 10, 0, 212, + 17, 69, 0, 54, 29, 118, 0, 38, 43, 161, 4, 38, + 67, 178, 31, 38, 104, 186, 76, 33, 92, 155, 71, 50, + 39, 148, 4, 28, 88, 179, 57, 27, 37, 58, 30, 129, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 185, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 3, 13, 0, 200, 17, 71, 0, 52, + 28, 115, 0, 39, 49, 159, 13, 39, 77, 181, 44, 38, + 105, 186, 79, 38, 115, 160, 100, 72, 15, 20, 14, 175, + 21, 87, 0, 65, 90, 168, 63, 31, 8, 12, 7, 168, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 206, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 1, 4, 0, 239, + 6, 26, 0, 188, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 1, 4, 0, 239, + 8, 32, 0, 151, 19, 79, 0, 45, 34, 124, 4, 39, + 64, 168, 30, 38, 94, 184, 64, 38, 118, 183, 96, 42, + 78, 108, 68, 130, 7, 8, 7, 232, 0, 0, 0, 179, + 7, 29, 0, 134, 65, 120, 47, 64, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 227, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 1, 7, 0, 237, + 30, 95, 8, 95, 28, 96, 6, 83, 9, 38, 0, 170, + 5, 22, 0, 201, 1, 7, 0, 234, 0, 2, 0, 245, + 0, 3, 0, 242, 2, 9, 0, 226, 3, 16, 0, 209, + 7, 30, 0, 171, 11, 46, 0, 131, 20, 83, 0, 50, + 29, 112, 1, 38, 54, 147, 22, 38, 89, 181, 58, 38, + 110, 184, 86, 39, 94, 137, 80, 95, 28, 36, 25, 214, + 0, 0, 0, 253, 0, 0, 0, 198, 0, 0, 0, 178, + 0, 0, 0, 177, 19, 30, 14, 149, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 179, + 0, 0, 0, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 16, 44, 6, 186, 43, 118, 18, 76, + 52, 143, 21, 39, 45, 133, 16, 38, 35, 120, 8, 41, + 33, 115, 5, 40, 37, 122, 8, 38, 38, 125, 10, 38, + 44, 133, 13, 38, 51, 144, 20, 38, 65, 161, 33, 38, + 88, 179, 58, 38, 109, 182, 85, 41, 85, 126, 72, 107, + 30, 40, 27, 208, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 202, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 179, + 0, 0, 0, 192, 0, 0, 0, 178, 0, 0, 0, 194, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 11, 24, 7, 222, 32, 64, 21, 172, 43, 97, 25, 128, + 65, 128, 44, 96, 74, 143, 51, 79, 76, 139, 55, 85, + 75, 136, 54, 88, 71, 127, 52, 100, 65, 109, 50, 123, + 54, 83, 44, 155, 17, 23, 15, 228, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 199, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 180, 0, 0, 0, 225, + 0, 0, 0, 237, 0, 0, 0, 178, 0, 0, 0, 215, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 229, 0, 0, 0, 243, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 230, 0, 0, 0, 191, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 194, 0, 0, 0, 240, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 197, 0, 0, 0, 237, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 229, 0, 0, 0, 187, 0, 0, 0, 206, + 0, 0, 0, 226, 0, 0, 0, 237, 0, 0, 0, 245, + 0, 0, 0, 248, 0, 0, 0, 242, 0, 0, 0, 236, + 0, 0, 0, 227, 0, 0, 0, 214, 0, 0, 0, 191, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 188, 0, 0, 0, 225, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 213, + 0, 0, 0, 185, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, + 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 192, + 0, 0, 0, 226, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 239, 0, 0, 0, 223, + 0, 0, 0, 208, 0, 0, 0, 201, 0, 0, 0, 199, + 0, 0, 0, 200, 0, 0, 0, 204, 0, 0, 0, 209, + 0, 0, 0, 219, 0, 0, 0, 237, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 13, 5, 13, 201, + 32, 13, 24, 144, 1, 0, 1, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 18, 8, 16, 185, 130, 40, 22, 23, + 146, 46, 22, 6, 35, 13, 21, 148, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 2, 1, 2, 245, 95, 32, 25, 56, 169, 58, 22, 0, + 163, 57, 25, 0, 104, 34, 24, 42, 3, 1, 4, 238, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 1, 3, 242, + 15, 8, 20, 186, 148, 60, 31, 10, 172, 86, 59, 0, + 176, 89, 55, 0, 134, 48, 24, 15, 18, 10, 24, 174, + 3, 2, 5, 238, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 68, 55, 76, 108, + 79, 54, 76, 73, 188, 142, 152, 0, 189, 159, 185, 0, + 180, 98, 70, 0, 149, 69, 43, 14, 123, 103, 128, 49, + 42, 32, 48, 150, 0, 0, 0, 252, 0, 0, 0, 240, + 0, 0, 0, 233, 0, 0, 0, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 13, 7, 17, 198, 160, 134, 161, 15, + 152, 121, 143, 18, 198, 177, 205, 0, 205, 187, 216, 0, + 175, 106, 91, 0, 172, 95, 70, 9, 205, 182, 205, 3, + 103, 85, 109, 67, 0, 0, 0, 240, 0, 0, 0, 215, + 0, 0, 0, 209, 0, 0, 0, 231, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 42, 28, 45, 144, 196, 173, 202, 0, + 194, 164, 189, 0, 214, 198, 226, 0, 210, 193, 222, 0, + 162, 91, 82, 0, 179, 102, 82, 1, 200, 177, 206, 0, + 111, 88, 114, 49, 0, 0, 0, 223, 0, 0, 0, 205, + 0, 0, 0, 203, 0, 0, 0, 218, 0, 0, 0, 247, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 62, 45, 68, 115, 197, 176, 207, 0, + 195, 168, 195, 0, 216, 200, 227, 0, 203, 183, 212, 0, + 157, 84, 74, 0, 159, 84, 72, 4, 198, 177, 208, 0, + 92, 72, 98, 69, 0, 0, 0, 214, 0, 0, 0, 203, + 0, 0, 0, 202, 0, 0, 0, 210, 0, 0, 0, 233, + 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 84, 66, 91, 87, 202, 183, 212, 0, + 191, 164, 193, 0, 217, 202, 227, 0, 197, 173, 203, 0, + 173, 113, 112, 0, 163, 96, 92, 4, 202, 184, 214, 0, + 76, 58, 80, 81, 0, 0, 0, 205, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 203, 0, 0, 0, 210, + 0, 0, 0, 234, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 109, 88, 117, 56, 199, 176, 204, 0, + 199, 179, 211, 0, 216, 201, 227, 0, 197, 170, 200, 0, + 185, 139, 148, 0, 168, 107, 108, 4, 199, 180, 210, 0, + 59, 42, 62, 97, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 204, + 0, 0, 0, 225, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 2, 1, 3, 244, 128, 103, 133, 36, 190, 164, 193, 0, + 202, 180, 212, 0, 215, 198, 226, 0, 200, 173, 201, 0, + 188, 154, 171, 0, 168, 115, 123, 4, 190, 166, 196, 0, + 43, 29, 45, 118, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 204, + 0, 0, 0, 225, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 13, 6, 14, 207, 148, 121, 151, 22, 206, 183, 213, 0, + 191, 155, 180, 0, 209, 186, 214, 0, 205, 178, 203, 0, + 222, 205, 227, 0, 190, 160, 184, 0, 187, 161, 191, 1, + 28, 17, 29, 138, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 205, + 0, 0, 0, 228, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 0, 1, 250, 31, 19, 33, 162, + 142, 119, 147, 36, 213, 193, 222, 0, 210, 186, 214, 0, + 209, 163, 170, 0, 213, 185, 210, 0, 207, 182, 209, 0, + 215, 185, 213, 0, 221, 198, 223, 0, 193, 166, 193, 1, + 56, 36, 56, 92, 1, 0, 1, 197, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 206, + 0, 0, 0, 231, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 34, 20, 35, 155, 187, 162, 190, 9, + 221, 199, 224, 0, 177, 134, 184, 0, 157, 93, 100, 0, + 182, 112, 102, 0, 155, 80, 71, 0, 176, 123, 133, 0, + 208, 157, 181, 0, 212, 171, 194, 0, 215, 185, 211, 0, + 166, 132, 156, 10, 13, 6, 14, 162, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 207, + 0, 0, 0, 235, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 82, 54, 73, 85, 182, 138, 159, 2, + 184, 134, 149, 2, 195, 142, 153, 0, 180, 102, 88, 0, + 200, 155, 159, 0, 149, 81, 74, 0, 173, 85, 67, 0, + 197, 146, 156, 0, 190, 134, 142, 0, 166, 113, 125, 5, + 119, 78, 95, 34, 14, 6, 14, 163, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 208, + 0, 0, 0, 238, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 10, 5, 11, 217, 27, 12, 23, 175, + 84, 42, 55, 77, 173, 95, 89, 0, 201, 134, 117, 0, + 203, 150, 161, 0, 200, 151, 161, 0, 168, 83, 53, 0, + 217, 130, 88, 0, 171, 82, 67, 0, 108, 50, 62, 24, + 10, 4, 9, 177, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 209, + 0, 0, 0, 238, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 73, 31, 42, 96, 183, 96, 77, 0, 180, 123, 107, 30, + 201, 147, 131, 15, 218, 183, 141, 0, 217, 157, 84, 1, + 189, 117, 83, 22, 180, 92, 74, 0, 101, 46, 59, 37, + 2, 0, 1, 198, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 205, + 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 111, 57, 68, 63, 215, 153, 138, 0, 155, 112, 104, 64, + 47, 23, 29, 187, 102, 67, 55, 115, 77, 44, 41, 119, + 148, 103, 100, 49, 207, 145, 147, 0, 104, 52, 61, 56, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 204, + 0, 0, 0, 217, 0, 0, 0, 246, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 18, 8, 13, 219, + 176, 138, 147, 29, 229, 204, 199, 0, 139, 106, 109, 89, + 0, 0, 0, 254, 0, 0, 0, 245, 17, 8, 11, 202, + 191, 165, 167, 25, 228, 210, 213, 0, 131, 93, 105, 54, + 0, 0, 0, 201, 0, 0, 0, 202, 0, 0, 0, 202, + 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 212, + 0, 0, 0, 235, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 51, 36, 41, 183, + 226, 225, 225, 5, 231, 231, 231, 0, 158, 142, 148, 75, + 0, 0, 0, 255, 0, 0, 0, 254, 22, 12, 15, 221, + 173, 173, 173, 59, 197, 197, 197, 30, 118, 108, 111, 92, + 0, 0, 0, 204, 0, 0, 0, 203, 0, 0, 0, 203, + 0, 0, 0, 203, 0, 0, 0, 203, 0, 0, 0, 220, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 8, 7, 8, 246, + 86, 86, 86, 160, 107, 107, 107, 136, 35, 35, 35, 216, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 2, 2, 2, 232, 9, 9, 9, 199, 0, 0, 0, 215, + 0, 0, 0, 226, 0, 0, 0, 220, 0, 0, 0, 220, + 0, 0, 0, 214, 0, 0, 0, 205, 0, 0, 0, 224, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 229, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 249, 0, 0, 0, 249, 0, 0, 0, 247, + 0, 0, 0, 227, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, + 0, 0, 0, 221, 0, 0, 0, 207, 0, 0, 0, 229, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 227, 0, 0, 0, 212, 0, 0, 0, 230, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 231, 0, 0, 0, 222, 0, 0, 0, 239, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 245, 0, 0, 0, 240, 0, 0, 0, 247, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 250, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 28, 28, 28, 226, 34, 34, 34, 220, 34, 34, 34, 220, + 34, 34, 34, 220, 34, 34, 34, 220, 34, 34, 34, 220, + 34, 34, 34, 220, 15, 15, 15, 239, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 55, 55, 55, 189, + 44, 45, 45, 114, 28, 31, 32, 83, 36, 42, 43, 83, + 38, 45, 47, 83, 38, 45, 47, 83, 27, 30, 31, 83, + 28, 29, 30, 85, 62, 62, 62, 136, 22, 22, 22, 232, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 59, 59, 59, 148, + 127, 122, 98, 16, 12, 24, 26, 0, 18, 31, 34, 0, + 14, 26, 29, 0, 12, 23, 26, 0, 9, 19, 21, 0, + 23, 33, 34, 0, 106, 95, 73, 66, 57, 57, 57, 197, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 60, 60, 60, 142, + 175, 160, 127, 25, 117, 114, 93, 7, 174, 154, 118, 0, + 200, 173, 128, 0, 189, 161, 115, 0, 135, 116, 80, 0, + 76, 70, 55, 35, 127, 111, 79, 60, 58, 58, 58, 196, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 55, 55, 55, 194, 81, 76, 68, 99, + 232, 207, 156, 1, 198, 176, 143, 0, 194, 184, 170, 0, + 182, 177, 169, 0, 184, 178, 169, 0, 190, 175, 155, 0, + 181, 153, 112, 0, 133, 111, 75, 32, 71, 70, 69, 133, + 17, 17, 17, 237, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 29, 29, 29, 225, 74, 73, 69, 112, 213, 187, 139, 9, + 197, 185, 168, 0, 179, 178, 176, 0, 190, 190, 190, 0, + 158, 158, 157, 0, 171, 170, 169, 0, 159, 157, 156, 0, + 165, 160, 156, 0, 187, 163, 127, 0, 120, 102, 71, 45, + 71, 71, 71, 138, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 227, 0, 0, 0, 237, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 67, 67, 67, 161, 160, 144, 113, 43, 202, 181, 151, 0, + 192, 192, 192, 0, 208, 209, 209, 0, 197, 197, 197, 0, + 207, 208, 208, 0, 200, 200, 200, 0, 187, 187, 186, 0, + 139, 137, 140, 0, 151, 146, 141, 0, 196, 164, 117, 0, + 80, 73, 60, 78, 37, 37, 37, 174, 0, 0, 0, 204, + 0, 0, 0, 206, 0, 0, 0, 219, 0, 0, 0, 244, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 8, 8, 8, 246, + 72, 71, 69, 119, 221, 192, 144, 2, 189, 186, 182, 0, + 181, 182, 181, 0, 181, 186, 190, 0, 203, 205, 207, 0, + 214, 215, 215, 0, 211, 212, 212, 0, 184, 184, 186, 0, + 185, 185, 186, 0, 147, 144, 143, 0, 187, 169, 146, 0, + 126, 104, 68, 39, 75, 75, 75, 130, 2, 2, 2, 202, + 0, 0, 0, 207, 0, 0, 0, 218, 0, 0, 0, 242, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 22, 22, 22, 232, + 93, 89, 80, 98, 212, 186, 142, 0, 184, 183, 182, 0, + 206, 207, 207, 0, 210, 212, 213, 0, 183, 185, 189, 0, + 164, 171, 179, 0, 170, 172, 176, 0, 205, 206, 207, 0, + 214, 215, 215, 0, 165, 163, 162, 0, 181, 173, 162, 0, + 186, 153, 98, 10, 71, 63, 50, 77, 47, 47, 47, 166, + 0, 0, 0, 205, 0, 0, 0, 210, 0, 0, 0, 229, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 22, 22, 22, 232, + 93, 87, 77, 96, 210, 185, 141, 0, 164, 162, 160, 0, + 201, 202, 202, 0, 217, 219, 219, 0, 213, 214, 214, 0, + 150, 158, 168, 0, 189, 191, 193, 0, 213, 214, 214, 0, + 215, 216, 216, 0, 159, 157, 156, 0, 182, 174, 162, 0, + 194, 158, 100, 3, 87, 72, 51, 61, 52, 52, 52, 162, + 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 212, + 0, 0, 0, 235, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 12, 12, 12, 242, + 73, 71, 67, 113, 213, 182, 130, 0, 178, 177, 175, 0, + 172, 172, 171, 0, 215, 216, 216, 0, 199, 199, 199, 0, + 183, 183, 182, 0, 181, 180, 179, 0, 211, 212, 212, 0, + 211, 212, 212, 0, 154, 152, 151, 0, 193, 181, 162, 0, + 127, 103, 67, 32, 68, 68, 68, 116, 12, 12, 12, 194, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 206, + 0, 0, 0, 220, 0, 0, 0, 246, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 66, 66, 66, 150, 162, 137, 94, 30, 185, 170, 150, 0, + 143, 141, 140, 0, 203, 203, 203, 0, 186, 186, 185, 0, + 169, 172, 180, 0, 182, 183, 185, 0, 197, 197, 197, 0, + 181, 180, 179, 0, 144, 140, 137, 0, 187, 161, 122, 0, + 82, 71, 52, 67, 50, 50, 50, 163, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 211, 0, 0, 0, 237, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 45, 45, 45, 209, 73, 66, 54, 97, 197, 165, 113, 2, + 177, 172, 165, 0, 138, 136, 136, 0, 166, 164, 164, 0, + 176, 175, 176, 0, 186, 185, 185, 0, 166, 164, 163, 0, + 164, 161, 160, 0, 182, 165, 143, 0, 140, 115, 75, 21, + 69, 68, 68, 110, 5, 5, 5, 199, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 207, 0, 0, 0, 223, 0, 0, 0, 248, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 69, 69, 69, 168, 94, 84, 64, 78, + 210, 181, 129, 1, 182, 167, 146, 0, 166, 162, 160, 0, + 154, 150, 147, 0, 155, 152, 151, 0, 175, 170, 164, 0, + 182, 161, 131, 0, 144, 118, 77, 15, 64, 61, 56, 93, + 34, 34, 34, 176, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 207, 0, 0, 0, 225, 0, 0, 0, 248, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 4, 4, 4, 250, 63, 63, 63, 139, + 179, 156, 111, 28, 156, 141, 103, 7, 199, 170, 120, 0, + 183, 156, 114, 0, 177, 149, 108, 0, 153, 126, 86, 0, + 101, 87, 62, 26, 104, 87, 60, 49, 66, 66, 66, 150, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 213, 0, 0, 0, 239, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 58, 58, 58, 145, + 135, 123, 89, 9, 6, 18, 21, 0, 14, 23, 23, 0, + 23, 23, 18, 0, 16, 16, 13, 0, 3, 10, 11, 0, + 18, 24, 21, 0, 103, 87, 60, 54, 53, 53, 53, 161, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 206, + 0, 0, 0, 223, 0, 0, 0, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 67, 67, 67, 165, + 31, 31, 29, 86, 1, 6, 8, 44, 6, 18, 21, 44, + 7, 22, 24, 44, 2, 8, 9, 43, 0, 2, 3, 41, + 7, 10, 10, 40, 49, 48, 46, 93, 35, 35, 35, 175, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 215, + 0, 0, 0, 238, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 4, 4, 4, 250, + 59, 59, 59, 187, 59, 59, 59, 180, 59, 59, 59, 180, + 59, 59, 59, 180, 59, 59, 59, 180, 59, 59, 59, 175, + 59, 59, 59, 159, 43, 43, 43, 170, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 205, 0, 0, 0, 211, 0, 0, 0, 233, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 233, 0, 0, 0, 212, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 207, 0, 0, 0, 218, 0, 0, 0, 243, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 237, 0, 0, 0, 212, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 206, 0, 0, 0, 220, 0, 0, 0, 246, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 250, 0, 0, 0, 238, 0, 0, 0, 233, + 0, 0, 0, 233, 0, 0, 0, 233, 0, 0, 0, 233, + 0, 0, 0, 234, 0, 0, 0, 242, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 237, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 65, + 0, 0, 0, 77, 0, 0, 0, 95, 0, 0, 0, 76, + 0, 0, 0, 195, 0, 0, 0, 209, 0, 0, 0, 105, + 0, 0, 0, 77, 0, 0, 0, 95, 0, 0, 0, 77, + 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 101, 136, 136, 136, 67, + 171, 171, 171, 79, 174, 174, 174, 80, 174, 174, 174, 80, + 103, 103, 103, 60, 87, 87, 87, 59, 171, 171, 171, 79, + 174, 174, 174, 80, 174, 174, 174, 80, 158, 158, 158, 75, + 5, 5, 5, 69, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 77, 158, 158, 158, 75, + 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, + 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, + 174, 174, 174, 80, 174, 174, 174, 80, 165, 165, 165, 78, + 5, 5, 5, 51, 0, 0, 0, 237, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 245, 5, 5, 5, 67, + 10, 10, 10, 68, 8, 8, 8, 52, 105, 105, 105, 64, + 174, 174, 174, 80, 174, 174, 174, 80, 125, 125, 125, 66, + 10, 10, 10, 57, 10, 10, 10, 63, 8, 8, 8, 81, + 0, 0, 0, 215, 0, 0, 0, 253, 0, 0, 0, 253, + 0, 0, 0, 252, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 7, 7, 7, 56, + 174, 174, 174, 80, 174, 174, 174, 80, 17, 17, 17, 38, + 0, 0, 0, 218, 0, 0, 0, 214, 0, 0, 0, 210, + 0, 0, 0, 228, 0, 0, 0, 235, 0, 0, 0, 236, + 0, 0, 0, 231, 0, 0, 0, 229, 0, 0, 0, 230, + 0, 0, 0, 233, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 75, + 174, 174, 174, 80, 173, 173, 173, 79, 9, 9, 9, 53, + 0, 0, 0, 210, 0, 0, 0, 209, 0, 0, 0, 209, + 0, 0, 0, 209, 0, 0, 0, 211, 0, 0, 0, 212, + 0, 0, 0, 209, 0, 0, 0, 209, 0, 0, 0, 209, + 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 59, + 174, 174, 174, 80, 173, 173, 173, 79, 12, 12, 12, 62, + 0, 0, 0, 212, 0, 0, 0, 207, 0, 0, 0, 206, + 0, 0, 0, 205, 0, 0, 0, 205, 0, 0, 0, 205, + 0, 0, 0, 205, 0, 0, 0, 206, 0, 0, 0, 207, + 0, 0, 0, 211, 0, 0, 0, 231, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 82, + 174, 174, 174, 80, 173, 173, 173, 80, 12, 12, 12, 66, + 0, 0, 0, 231, 0, 0, 0, 226, 0, 0, 0, 222, + 0, 0, 0, 211, 0, 0, 0, 205, 0, 0, 0, 205, + 0, 0, 0, 209, 0, 0, 0, 221, 0, 0, 0, 226, + 0, 0, 0, 230, 0, 0, 0, 243, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 65, + 174, 174, 174, 80, 174, 174, 174, 80, 10, 10, 10, 58, + 0, 0, 0, 251, 0, 0, 0, 250, 0, 0, 0, 244, + 0, 0, 0, 223, 0, 0, 0, 207, 0, 0, 0, 205, + 0, 0, 0, 219, 0, 0, 0, 242, 0, 0, 0, 249, + 0, 0, 0, 251, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 82, + 174, 174, 174, 80, 174, 174, 174, 80, 7, 7, 7, 48, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 229, 0, 0, 0, 208, 0, 0, 0, 207, + 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 76, + 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 73, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 75, + 174, 174, 174, 80, 174, 174, 174, 80, 13, 13, 13, 80, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 89, + 174, 174, 174, 80, 174, 174, 174, 80, 11, 11, 11, 65, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 89, + 174, 174, 174, 80, 174, 174, 174, 80, 8, 8, 8, 51, + 0, 0, 0, 237, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 69, + 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 70, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 80, + 174, 174, 174, 80, 174, 174, 174, 80, 13, 13, 13, 80, + 0, 0, 0, 234, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 87, + 174, 174, 174, 80, 174, 174, 174, 80, 11, 11, 11, 64, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 87, + 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 73, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 95, + 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 73, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 9, 9, 9, 61, + 174, 174, 174, 80, 174, 174, 174, 80, 25, 25, 25, 55, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 245, 6, 6, 6, 78, + 7, 7, 7, 53, 10, 10, 10, 61, 105, 105, 105, 64, + 174, 174, 174, 80, 174, 174, 174, 80, 125, 125, 125, 66, + 12, 12, 12, 68, 9, 9, 9, 58, 6, 6, 6, 63, + 0, 0, 0, 210, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 84, 158, 158, 158, 75, + 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, + 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, + 174, 174, 174, 80, 174, 174, 174, 80, 150, 150, 150, 71, + 7, 7, 7, 62, 0, 0, 0, 209, 0, 0, 0, 207, + 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 88, 147, 147, 147, 72, + 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, + 103, 103, 103, 60, 87, 87, 87, 59, 171, 171, 171, 79, + 174, 174, 174, 80, 174, 174, 174, 80, 157, 157, 157, 74, + 8, 8, 8, 82, 0, 0, 0, 193, 0, 0, 0, 207, + 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 81, + 0, 0, 0, 87, 0, 0, 0, 95, 0, 0, 0, 82, + 0, 0, 0, 195, 0, 0, 0, 209, 0, 0, 0, 81, + 0, 0, 0, 74, 0, 0, 0, 87, 0, 0, 0, 74, + 0, 0, 0, 198, 0, 0, 0, 205, 0, 0, 0, 205, + 0, 0, 0, 219, 0, 0, 0, 242, 0, 0, 0, 249, + 0, 0, 0, 251, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, + 0, 0, 0, 228, 0, 0, 0, 206, 0, 0, 0, 191, + 0, 0, 0, 211, 0, 0, 0, 205, 0, 0, 0, 205, + 0, 0, 0, 209, 0, 0, 0, 221, 0, 0, 0, 226, + 0, 0, 0, 230, 0, 0, 0, 243, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 234, + 0, 0, 0, 212, 0, 0, 0, 207, 0, 0, 0, 206, + 0, 0, 0, 205, 0, 0, 0, 205, 0, 0, 0, 205, + 0, 0, 0, 205, 0, 0, 0, 206, 0, 0, 0, 207, + 0, 0, 0, 211, 0, 0, 0, 231, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 235, + 0, 0, 0, 213, 0, 0, 0, 209, 0, 0, 0, 209, + 0, 0, 0, 209, 0, 0, 0, 211, 0, 0, 0, 212, + 0, 0, 0, 209, 0, 0, 0, 209, 0, 0, 0, 209, + 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, + 0, 0, 0, 235, 0, 0, 0, 230, 0, 0, 0, 229, + 0, 0, 0, 231, 0, 0, 0, 235, 0, 0, 0, 236, + 0, 0, 0, 231, 0, 0, 0, 229, 0, 0, 0, 230, + 0, 0, 0, 233, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 252, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 252, 0, 0, 0, 253, 0, 0, 0, 253, + 0, 0, 0, 252, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 168, 0, 0, 0, 162, + 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 168, 160, 160, 160, 64, 172, 172, 172, 64, + 12, 12, 12, 145, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 252, + 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 247, 0, 0, 0, 235, + 0, 0, 0, 234, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 234, 0, 0, 0, 214, + 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 168, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 112, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 100, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 157, 0, 0, 0, 144, 0, 0, 0, 130, + 0, 0, 0, 129, 0, 0, 0, 169, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 168, 160, 160, 160, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 189, 189, 189, 63, 190, 190, 190, 57, 189, 189, 189, 52, + 189, 189, 189, 52, 112, 112, 112, 57, 0, 0, 0, 213, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 162, 172, 172, 172, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 189, 189, 189, 63, 190, 190, 190, 57, 189, 189, 189, 52, + 189, 189, 189, 52, 124, 124, 124, 57, 0, 0, 0, 207, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 246, 12, 12, 12, 145, + 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 136, + 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 135, + 23, 23, 23, 98, 189, 189, 189, 63, 189, 189, 189, 63, + 44, 44, 44, 89, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 131, 23, 23, 23, 121, 23, 23, 23, 110, + 23, 23, 23, 110, 5, 5, 5, 146, 0, 0, 0, 246, + 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, + 0, 0, 0, 147, 189, 189, 189, 58, 190, 190, 190, 57, + 23, 23, 23, 122, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 228, 0, 0, 0, 217, 0, 0, 0, 206, + 0, 0, 0, 205, 0, 0, 0, 215, 0, 0, 0, 227, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 237, + 0, 0, 0, 250, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 235, + 0, 0, 0, 135, 190, 190, 190, 52, 189, 189, 189, 52, + 23, 23, 23, 111, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 206, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 206, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 209, 0, 0, 0, 217, + 0, 0, 0, 241, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 234, + 0, 0, 0, 134, 189, 189, 189, 52, 189, 189, 189, 52, + 23, 23, 23, 110, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 206, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 208, 0, 0, 0, 216, + 0, 0, 0, 240, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, + 0, 0, 0, 146, 189, 189, 189, 57, 189, 189, 189, 57, + 23, 23, 23, 120, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 224, 0, 0, 0, 215, 0, 0, 0, 206, + 0, 0, 0, 205, 0, 0, 0, 214, 0, 0, 0, 224, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 227, 0, 0, 0, 234, + 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 157, 189, 189, 189, 63, 189, 189, 189, 63, + 23, 23, 23, 133, 0, 0, 0, 250, 0, 0, 0, 250, + 0, 0, 0, 246, 0, 0, 0, 227, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 224, 0, 0, 0, 245, + 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 250, + 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 252, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 168, 160, 160, 160, 64, 172, 172, 172, 64, + 12, 12, 12, 145, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 168, 0, 0, 0, 162, + 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 234, 0, 0, 0, 214, + 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 247, 0, 0, 0, 235, + 0, 0, 0, 234, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 252, + 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 201, + 0, 0, 0, 201, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 192, 107, 107, 107, 67, + 107, 107, 107, 67, 0, 0, 0, 192, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 192, 107, 107, 107, 67, 190, 190, 190, 64, + 190, 190, 190, 64, 107, 107, 107, 67, 0, 0, 0, 192, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 192, + 107, 107, 107, 67, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 107, 107, 107, 67, + 0, 0, 0, 192, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 192, 107, 107, 107, 67, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 107, 107, 107, 67, 0, 0, 0, 192, 0, 0, 0, 250, + 0, 0, 0, 239, 0, 0, 0, 239, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 201, 107, 107, 107, 67, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 106, 106, 106, 65, 0, 0, 0, 184, + 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 234, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 204, 23, 23, 23, 136, 23, 23, 23, 136, + 23, 23, 23, 136, 23, 23, 23, 100, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 100, 23, 23, 23, 135, + 23, 23, 23, 132, 23, 23, 23, 122, 0, 0, 0, 170, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 215, + 0, 0, 0, 234, 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 249, + 0, 0, 0, 234, 0, 0, 0, 215, 0, 0, 0, 206, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 206, + 0, 0, 0, 215, 0, 0, 0, 234, 0, 0, 0, 249, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 155, 0, 0, 0, 234, + 0, 0, 0, 215, 0, 0, 0, 206, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 206, 0, 0, 0, 215, 0, 0, 0, 234, + 0, 0, 0, 250, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 189, 189, 189, 64, 0, 0, 0, 148, 0, 0, 0, 218, + 0, 0, 0, 209, 0, 0, 0, 207, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 205, + 0, 0, 0, 207, 0, 0, 0, 209, 0, 0, 0, 218, + 0, 0, 0, 240, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 189, 189, 189, 64, 0, 0, 0, 150, 0, 0, 0, 229, + 0, 0, 0, 226, 0, 0, 0, 224, 0, 0, 0, 215, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 215, + 0, 0, 0, 224, 0, 0, 0, 226, 0, 0, 0, 229, + 0, 0, 0, 242, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 158, 0, 0, 0, 250, + 0, 0, 0, 250, 0, 0, 0, 246, 0, 0, 0, 227, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 227, + 0, 0, 0, 246, 0, 0, 0, 250, 0, 0, 0, 250, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 180, 68, 68, 68, 88, 71, 71, 71, 88, + 71, 71, 71, 88, 71, 71, 71, 76, 190, 190, 190, 64, + 190, 190, 190, 64, 71, 71, 71, 76, 71, 71, 71, 88, + 71, 71, 71, 88, 68, 68, 68, 87, 0, 0, 0, 160, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 225, 62, 62, 62, 82, 187, 187, 187, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 187, 187, 187, 64, 62, 62, 62, 80, 0, 0, 0, 202, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 225, 62, 62, 62, 82, + 187, 187, 187, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 187, 187, 187, 64, + 62, 62, 62, 82, 0, 0, 0, 221, 0, 0, 0, 229, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 229, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 225, + 62, 62, 62, 82, 187, 187, 187, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 186, 186, 186, 63, 61, 61, 61, 79, + 0, 0, 0, 216, 0, 0, 0, 243, 0, 0, 0, 225, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 225, + 0, 0, 0, 243, 0, 0, 0, 246, 0, 0, 0, 247, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 225, 62, 62, 62, 82, 187, 187, 187, 64, + 187, 187, 187, 63, 62, 62, 62, 76, 0, 0, 0, 197, + 0, 0, 0, 220, 0, 0, 0, 218, 0, 0, 0, 212, + 0, 0, 0, 205, 0, 0, 0, 205, 0, 0, 0, 212, + 0, 0, 0, 218, 0, 0, 0, 220, 0, 0, 0, 224, + 0, 0, 0, 240, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 225, 62, 62, 62, 82, + 62, 62, 62, 81, 0, 0, 0, 213, 0, 0, 0, 221, + 0, 0, 0, 208, 0, 0, 0, 206, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 205, + 0, 0, 0, 206, 0, 0, 0, 208, 0, 0, 0, 221, + 0, 0, 0, 242, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 234, + 0, 0, 0, 234, 0, 0, 0, 252, 0, 0, 0, 239, + 0, 0, 0, 219, 0, 0, 0, 207, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 207, 0, 0, 0, 219, 0, 0, 0, 239, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, + 0, 0, 0, 238, 0, 0, 0, 219, 0, 0, 0, 207, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 207, + 0, 0, 0, 219, 0, 0, 0, 238, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 238, 0, 0, 0, 219, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 219, + 0, 0, 0, 238, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 239, + 0, 0, 0, 221, 0, 0, 0, 221, 0, 0, 0, 239, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 20, 20, 20, 148, 15, 15, 15, 160, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 28, 28, 28, 128, 7, 7, 7, 177, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 246, 34, 34, 34, 122, + 168, 168, 168, 64, 36, 36, 36, 133, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 73, 73, 73, 95, 149, 149, 149, 64, + 16, 16, 16, 152, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 236, 52, 52, 52, 103, 179, 179, 179, 64, + 190, 190, 190, 64, 36, 36, 36, 133, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 253, 0, 0, 0, 254, + 0, 0, 0, 255, 73, 73, 73, 95, 190, 190, 190, 64, + 164, 164, 164, 64, 29, 29, 29, 128, 0, 0, 0, 249, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 222, + 75, 75, 75, 87, 186, 186, 186, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 87, 87, 87, 83, 63, 63, 63, 117, + 63, 63, 63, 117, 63, 63, 63, 117, 63, 63, 63, 116, + 63, 63, 63, 111, 63, 63, 63, 109, 63, 63, 63, 115, + 63, 63, 63, 117, 112, 112, 112, 73, 190, 190, 190, 64, + 190, 190, 190, 64, 176, 176, 176, 64, 47, 47, 47, 108, + 0, 0, 0, 238, 0, 0, 0, 239, 0, 0, 0, 234, + 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 36, 36, 36, 106, + 187, 187, 187, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 63, 189, 189, 189, 59, + 189, 189, 189, 54, 189, 189, 189, 55, 189, 189, 189, 62, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 173, 173, 173, 64, + 11, 11, 11, 141, 0, 0, 0, 229, 0, 0, 0, 212, + 0, 0, 0, 225, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 234, + 56, 56, 56, 100, 181, 181, 181, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 70, 70, 70, 91, 42, 42, 42, 138, + 42, 42, 42, 133, 42, 42, 42, 122, 42, 42, 42, 113, + 42, 42, 42, 111, 42, 42, 42, 117, 42, 42, 42, 131, + 42, 42, 42, 136, 99, 99, 99, 75, 190, 190, 190, 63, + 190, 190, 190, 63, 167, 167, 167, 63, 32, 32, 32, 122, + 0, 0, 0, 241, 0, 0, 0, 226, 0, 0, 0, 207, + 0, 0, 0, 208, 0, 0, 0, 222, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 245, 37, 37, 37, 118, 170, 170, 170, 64, + 190, 190, 190, 64, 35, 35, 35, 133, 0, 0, 0, 247, + 0, 0, 0, 227, 0, 0, 0, 210, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 210, 0, 0, 0, 222, + 0, 0, 0, 226, 73, 73, 73, 84, 189, 189, 189, 57, + 151, 151, 151, 57, 18, 18, 18, 129, 0, 0, 0, 224, + 0, 0, 0, 224, 0, 0, 0, 214, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 207, 0, 0, 0, 219, + 0, 0, 0, 241, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 22, 22, 22, 141, + 156, 156, 156, 64, 36, 36, 36, 132, 0, 0, 0, 235, + 0, 0, 0, 211, 0, 0, 0, 205, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 206, + 0, 0, 0, 206, 73, 73, 73, 77, 131, 131, 131, 54, + 8, 8, 8, 140, 0, 0, 0, 206, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 205, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 207, + 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 10, 10, 10, 170, 11, 11, 11, 173, 0, 0, 0, 245, + 0, 0, 0, 224, 0, 0, 0, 209, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 209, 0, 0, 0, 219, + 0, 0, 0, 222, 20, 20, 20, 129, 2, 2, 2, 173, + 0, 0, 0, 222, 0, 0, 0, 222, 0, 0, 0, 222, + 0, 0, 0, 221, 0, 0, 0, 212, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 206, 0, 0, 0, 217, + 0, 0, 0, 238, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 247, 0, 0, 0, 227, 0, 0, 0, 210, + 0, 0, 0, 205, 0, 0, 0, 216, 0, 0, 0, 242, + 0, 0, 0, 250, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 247, 0, 0, 0, 226, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 220, 0, 0, 0, 241, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 231, + 0, 0, 0, 213, 0, 0, 0, 218, 0, 0, 0, 246, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 228, 0, 0, 0, 211, + 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 236, 0, 0, 0, 231, 0, 0, 0, 249, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 237, 0, 0, 0, 231, + 0, 0, 0, 246, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 252, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 180, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 171, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 180, 139, 139, 139, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 157, 157, 157, 64, 5, 5, 5, 157, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 171, 157, 157, 157, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 172, 172, 172, 64, 8, 8, 8, 148, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 5, 5, 5, 157, + 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 136, + 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 135, + 23, 23, 23, 134, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 133, 9, 9, 9, 144, 0, 0, 0, 242, + 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 252, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 248, + 0, 0, 0, 236, 0, 0, 0, 194, 0, 0, 0, 173, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 235, + 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 236, + 0, 0, 0, 178, 83, 83, 83, 60, 127, 127, 127, 52, + 3, 3, 3, 140, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 213, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 195, + 83, 83, 83, 61, 189, 189, 189, 52, 189, 189, 189, 52, + 127, 127, 127, 52, 3, 3, 3, 139, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 212, + 0, 0, 0, 232, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 82, 82, 82, 71, + 190, 190, 190, 58, 189, 189, 189, 57, 189, 189, 189, 57, + 189, 189, 189, 57, 127, 127, 127, 57, 2, 2, 2, 150, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 224, + 0, 0, 0, 224, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 227, 0, 0, 0, 231, + 0, 0, 0, 245, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 210, 83, 83, 83, 73, 190, 190, 190, 64, + 189, 189, 189, 63, 186, 186, 186, 63, 189, 189, 189, 63, + 186, 186, 186, 63, 189, 189, 189, 63, 127, 127, 127, 63, + 3, 3, 3, 167, 0, 0, 0, 245, 0, 0, 0, 235, + 0, 0, 0, 233, 0, 0, 0, 243, 0, 0, 0, 249, + 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 250, + 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 251, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, + 83, 83, 83, 73, 190, 190, 190, 64, 190, 190, 190, 64, + 83, 83, 83, 64, 166, 166, 166, 64, 190, 190, 190, 64, + 68, 68, 68, 64, 181, 181, 181, 64, 190, 190, 190, 64, + 127, 127, 127, 63, 3, 3, 3, 158, 0, 0, 0, 218, + 0, 0, 0, 215, 0, 0, 0, 231, 0, 0, 0, 248, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 210, 83, 83, 83, 73, + 190, 190, 190, 64, 190, 190, 190, 64, 83, 83, 83, 73, + 0, 0, 0, 139, 166, 166, 166, 64, 190, 190, 190, 64, + 23, 23, 23, 118, 44, 44, 44, 94, 180, 180, 180, 63, + 189, 189, 189, 59, 127, 127, 127, 54, 3, 3, 3, 139, + 0, 0, 0, 206, 0, 0, 0, 213, 0, 0, 0, 231, + 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 210, 83, 83, 83, 73, 190, 190, 190, 64, + 190, 190, 190, 64, 83, 83, 83, 73, 0, 0, 0, 210, + 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, + 23, 23, 23, 135, 0, 0, 0, 233, 44, 44, 44, 87, + 181, 181, 181, 54, 189, 189, 189, 52, 127, 127, 127, 51, + 2, 2, 2, 137, 0, 0, 0, 205, 0, 0, 0, 213, + 0, 0, 0, 231, 0, 0, 0, 248, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 213, + 83, 83, 83, 73, 190, 190, 190, 64, 190, 190, 190, 64, + 83, 83, 83, 73, 0, 0, 0, 210, 0, 0, 0, 255, + 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, + 24, 24, 24, 132, 0, 0, 0, 236, 0, 0, 0, 202, + 44, 44, 44, 76, 180, 180, 180, 51, 189, 189, 189, 51, + 127, 127, 127, 51, 3, 3, 3, 139, 0, 0, 0, 205, + 0, 0, 0, 213, 0, 0, 0, 231, 0, 0, 0, 248, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 189, + 127, 127, 127, 64, 190, 190, 190, 64, 83, 83, 83, 73, + 0, 0, 0, 210, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 183, 166, 166, 166, 64, 189, 189, 189, 63, + 23, 23, 23, 124, 0, 0, 0, 217, 0, 0, 0, 207, + 0, 0, 0, 191, 44, 44, 44, 76, 180, 180, 180, 51, + 160, 160, 160, 51, 14, 14, 14, 115, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 213, 0, 0, 0, 231, + 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 2, 2, 2, 171, 56, 56, 56, 73, 0, 0, 0, 210, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 183, 165, 165, 165, 63, 189, 189, 189, 59, + 23, 23, 23, 114, 0, 0, 0, 207, 0, 0, 0, 206, + 0, 0, 0, 214, 0, 0, 0, 202, 41, 41, 41, 77, + 17, 17, 17, 102, 0, 0, 0, 212, 0, 0, 0, 216, + 0, 0, 0, 208, 0, 0, 0, 206, 0, 0, 0, 213, + 0, 0, 0, 231, 0, 0, 0, 248, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 181, 166, 166, 166, 59, 190, 190, 190, 54, + 23, 23, 23, 109, 0, 0, 0, 207, 0, 0, 0, 217, + 0, 0, 0, 233, 0, 0, 0, 229, 0, 0, 0, 209, + 0, 0, 0, 207, 0, 0, 0, 223, 0, 0, 0, 235, + 0, 0, 0, 221, 0, 0, 0, 208, 0, 0, 0, 206, + 0, 0, 0, 213, 0, 0, 0, 231, 0, 0, 0, 248, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 175, 165, 165, 165, 55, 189, 189, 189, 52, + 23, 23, 23, 110, 0, 0, 0, 217, 0, 0, 0, 236, + 0, 0, 0, 248, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 247, + 0, 0, 0, 240, 0, 0, 0, 221, 0, 0, 0, 208, + 0, 0, 0, 206, 0, 0, 0, 214, 0, 0, 0, 235, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 173, 166, 166, 166, 54, 189, 189, 189, 52, + 23, 23, 23, 117, 0, 0, 0, 236, 0, 0, 0, 250, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 249, + 0, 0, 0, 252, 0, 0, 0, 241, 0, 0, 0, 221, + 0, 0, 0, 209, 0, 0, 0, 212, 0, 0, 0, 232, + 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 180, 166, 166, 166, 58, 189, 189, 189, 56, + 24, 24, 24, 127, 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 241, + 0, 0, 0, 226, 0, 0, 0, 229, 0, 0, 0, 245, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 183, 165, 165, 165, 63, 189, 189, 189, 62, + 23, 23, 23, 134, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 248, 0, 0, 0, 249, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, + 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 228, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 204, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 233, 0, 0, 0, 210, + 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 235, 0, 0, 0, 213, + 0, 0, 0, 211, 0, 0, 0, 229, 0, 0, 0, 250, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 245, 0, 0, 0, 233, + 0, 0, 0, 231, 0, 0, 0, 241, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 252, + 0, 0, 0, 252, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 207, + 0, 0, 0, 164, 0, 0, 0, 164, 0, 0, 0, 230, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 185, 185, 185, 64, 161, 161, 161, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 240, 0, 0, 0, 229, 0, 0, 0, 231, + 0, 0, 0, 244, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 228, 0, 0, 0, 210, 0, 0, 0, 213, + 0, 0, 0, 235, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 226, 0, 0, 0, 207, 0, 0, 0, 210, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 226, 0, 0, 0, 207, 0, 0, 0, 210, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 13, 13, 13, 137, + 35, 35, 35, 104, 0, 0, 0, 241, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 193, 47, 47, 47, 67, 1, 1, 1, 149, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 12, 12, 12, 148, 153, 153, 153, 64, + 177, 177, 177, 64, 37, 37, 37, 101, 0, 0, 0, 241, + 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 213, + 73, 73, 73, 69, 187, 187, 187, 52, 117, 117, 117, 54, + 0, 0, 0, 180, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 5, 5, 5, 166, 136, 136, 136, 64, + 190, 190, 190, 64, 176, 176, 176, 64, 37, 37, 37, 101, + 0, 0, 0, 242, 0, 0, 0, 255, 23, 23, 23, 136, + 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, + 0, 0, 0, 255, 0, 0, 0, 218, 72, 72, 72, 76, + 187, 187, 187, 57, 189, 189, 189, 52, 94, 94, 94, 58, + 0, 0, 0, 191, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 6, 6, 6, 159, + 137, 137, 137, 64, 190, 190, 190, 64, 176, 176, 176, 64, + 36, 36, 36, 101, 0, 0, 0, 242, 23, 23, 23, 135, + 189, 189, 189, 62, 165, 165, 165, 62, 0, 0, 0, 182, + 0, 0, 0, 218, 73, 73, 73, 77, 188, 188, 188, 63, + 189, 189, 189, 57, 95, 95, 95, 56, 0, 0, 0, 166, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 6, 6, 6, 159, 137, 137, 137, 64, 190, 190, 190, 64, + 176, 176, 176, 64, 36, 36, 36, 101, 23, 23, 23, 119, + 189, 189, 189, 57, 166, 166, 166, 56, 0, 0, 0, 140, + 71, 71, 71, 77, 188, 188, 188, 64, 189, 189, 189, 63, + 96, 96, 96, 61, 0, 0, 0, 162, 0, 0, 0, 210, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 6, 6, 6, 158, 138, 138, 138, 64, + 190, 190, 190, 64, 176, 176, 176, 63, 60, 60, 60, 58, + 190, 190, 190, 53, 166, 166, 166, 52, 71, 71, 71, 55, + 188, 188, 188, 60, 189, 189, 189, 63, 96, 96, 96, 68, + 0, 0, 0, 176, 0, 0, 0, 207, 0, 0, 0, 210, + 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 250, + 0, 0, 0, 235, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 6, 6, 6, 157, + 138, 138, 138, 64, 189, 189, 189, 63, 182, 182, 182, 59, + 190, 190, 190, 54, 185, 185, 185, 51, 187, 187, 187, 52, + 189, 189, 189, 55, 97, 97, 97, 65, 0, 0, 0, 192, + 0, 0, 0, 226, 0, 0, 0, 207, 0, 0, 0, 210, + 0, 0, 0, 233, 0, 0, 0, 247, 0, 0, 0, 235, + 0, 0, 0, 216, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 6, 6, 6, 157, 138, 138, 138, 64, 189, 189, 189, 62, + 190, 190, 190, 58, 189, 189, 189, 54, 189, 189, 189, 51, + 97, 97, 97, 56, 0, 0, 0, 172, 0, 0, 0, 234, + 0, 0, 0, 223, 0, 0, 0, 207, 0, 0, 0, 209, + 0, 0, 0, 228, 0, 0, 0, 232, 0, 0, 0, 216, + 0, 0, 0, 206, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 6, 6, 6, 156, 139, 139, 139, 64, + 189, 189, 189, 62, 190, 190, 190, 58, 98, 98, 98, 58, + 0, 0, 0, 160, 0, 0, 0, 208, 0, 0, 0, 216, + 0, 0, 0, 214, 0, 0, 0, 206, 0, 0, 0, 207, + 0, 0, 0, 216, 0, 0, 0, 214, 0, 0, 0, 206, + 0, 0, 0, 207, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 7, 7, 7, 155, + 139, 139, 139, 64, 99, 99, 99, 67, 0, 0, 0, 180, + 0, 0, 0, 214, 0, 0, 0, 206, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 204, 0, 0, 0, 205, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 207, + 0, 0, 0, 217, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 4, 4, 4, 172, 0, 0, 0, 200, 0, 0, 0, 248, + 0, 0, 0, 232, 0, 0, 0, 214, 0, 0, 0, 206, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 204, 0, 0, 0, 207, 0, 0, 0, 217, + 0, 0, 0, 237, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 2, 2, 2, 165, 5, 5, 5, 153, + 5, 5, 5, 153, 5, 5, 5, 153, 5, 5, 5, 153, + 5, 5, 5, 153, 5, 5, 5, 153, 5, 5, 5, 153, + 5, 5, 5, 153, 5, 5, 5, 153, 5, 5, 5, 153, + 5, 5, 5, 148, 5, 5, 5, 137, 6, 6, 6, 127, + 6, 6, 6, 123, 5, 5, 5, 122, 5, 5, 5, 122, + 1, 1, 1, 141, 0, 0, 0, 217, 0, 0, 0, 237, + 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 6, 6, 6, 154, 161, 161, 161, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 62, 190, 190, 190, 58, + 189, 189, 189, 54, 189, 189, 189, 51, 189, 189, 189, 52, + 143, 143, 143, 54, 0, 0, 0, 167, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 8, 8, 8, 149, 169, 169, 169, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 62, + 190, 190, 190, 58, 190, 190, 190, 54, 189, 189, 189, 55, + 153, 153, 153, 59, 0, 0, 0, 171, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 247, 7, 7, 7, 152, 19, 19, 19, 140, + 19, 19, 19, 140, 19, 19, 19, 140, 19, 19, 19, 140, + 19, 19, 19, 140, 19, 19, 19, 139, 19, 19, 19, 137, + 19, 19, 19, 136, 19, 19, 19, 136, 19, 19, 19, 136, + 19, 19, 19, 136, 19, 19, 19, 135, 19, 19, 19, 135, + 19, 19, 19, 133, 19, 19, 19, 129, 19, 19, 19, 130, + 4, 4, 4, 154, 0, 0, 0, 247, 0, 0, 0, 250, + 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 245, 0, 0, 0, 231, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 225, 0, 0, 0, 223, 0, 0, 0, 224, + 0, 0, 0, 225, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 251, 0, 0, 0, 232, 0, 0, 0, 212, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 231, + 0, 0, 0, 228, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 204, 92, 92, 92, 68, + 106, 106, 106, 65, 0, 0, 0, 188, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 224, 0, 0, 0, 213, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 212, 79, 79, 79, 77, 105, 105, 105, 68, + 1, 1, 1, 191, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 253, 0, 0, 0, 205, + 88, 88, 88, 73, 189, 189, 189, 64, 188, 188, 188, 64, + 45, 45, 45, 85, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, + 0, 0, 0, 239, 0, 0, 0, 184, 98, 98, 98, 68, + 189, 189, 189, 64, 187, 187, 187, 64, 68, 68, 68, 82, + 0, 0, 0, 220, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 253, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 238, + 1, 1, 1, 162, 108, 108, 108, 57, 190, 190, 190, 58, + 184, 184, 184, 63, 60, 60, 60, 86, 0, 0, 0, 226, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 239, + 0, 0, 0, 235, 0, 0, 0, 247, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 2, 2, 2, 166, + 117, 117, 117, 54, 189, 189, 189, 52, 181, 181, 181, 56, + 52, 52, 52, 90, 0, 0, 0, 231, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 249, 0, 0, 0, 234, 0, 0, 0, 216, + 0, 0, 0, 213, 0, 0, 0, 229, 0, 0, 0, 249, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 3, 3, 3, 170, 126, 126, 126, 59, + 190, 190, 190, 52, 178, 178, 178, 52, 44, 44, 44, 86, + 0, 0, 0, 231, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 249, + 0, 0, 0, 233, 0, 0, 0, 214, 0, 0, 0, 206, + 0, 0, 0, 208, 0, 0, 0, 225, 0, 0, 0, 247, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 6, 6, 6, 161, 135, 135, 135, 63, 190, 190, 190, 58, + 185, 185, 185, 52, 70, 70, 70, 52, 33, 33, 33, 104, + 33, 33, 33, 128, 33, 33, 33, 132, 33, 33, 33, 132, + 32, 32, 32, 131, 32, 32, 32, 129, 32, 32, 32, 121, + 32, 32, 32, 112, 33, 33, 33, 106, 32, 32, 32, 107, + 32, 32, 32, 112, 30, 30, 30, 123, 0, 0, 0, 209, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 178, + 140, 140, 140, 64, 190, 190, 190, 63, 190, 190, 190, 58, + 190, 190, 190, 52, 189, 189, 189, 52, 189, 189, 189, 56, + 189, 189, 189, 62, 190, 190, 190, 64, 190, 190, 190, 64, + 189, 189, 189, 62, 189, 189, 189, 58, 190, 190, 190, 53, + 189, 189, 189, 51, 189, 189, 189, 52, 189, 189, 189, 56, + 190, 190, 190, 60, 175, 175, 175, 63, 0, 0, 0, 174, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 224, + 64, 64, 64, 84, 186, 186, 186, 63, 190, 190, 190, 58, + 185, 185, 185, 52, 136, 136, 136, 52, 136, 136, 136, 56, + 135, 135, 135, 62, 135, 135, 135, 64, 135, 135, 135, 62, + 135, 135, 135, 58, 135, 135, 135, 53, 135, 135, 135, 51, + 135, 135, 135, 52, 135, 135, 135, 56, 135, 135, 135, 61, + 135, 135, 135, 63, 125, 125, 125, 64, 0, 0, 0, 175, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 229, 56, 56, 56, 88, 183, 183, 183, 58, + 190, 190, 190, 52, 112, 112, 112, 52, 1, 1, 1, 132, + 0, 0, 0, 212, 0, 0, 0, 211, 0, 0, 0, 195, + 0, 0, 0, 181, 0, 0, 0, 176, 0, 0, 0, 177, + 0, 0, 0, 186, 0, 0, 0, 201, 0, 0, 0, 209, + 0, 0, 0, 210, 0, 0, 0, 211, 0, 0, 0, 238, + 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 246, + 0, 0, 0, 246, 0, 0, 0, 247, 0, 0, 0, 247, + 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 232, 47, 47, 47, 87, + 180, 180, 180, 52, 189, 189, 189, 52, 122, 122, 122, 57, + 3, 3, 3, 166, 0, 0, 0, 227, 0, 0, 0, 211, + 0, 0, 0, 205, 0, 0, 0, 204, 0, 0, 0, 205, + 0, 0, 0, 211, 0, 0, 0, 217, 0, 0, 0, 219, + 0, 0, 0, 219, 0, 0, 0, 219, 0, 0, 0, 219, + 0, 0, 0, 219, 0, 0, 0, 219, 0, 0, 0, 219, + 0, 0, 0, 219, 0, 0, 0, 219, 0, 0, 0, 222, + 0, 0, 0, 237, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 218, + 40, 40, 40, 83, 176, 176, 176, 52, 189, 189, 189, 56, + 130, 130, 130, 59, 5, 5, 5, 139, 0, 0, 0, 205, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 205, 0, 0, 0, 206, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 209, + 0, 0, 0, 230, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, + 0, 0, 0, 199, 34, 34, 34, 86, 172, 172, 172, 56, + 189, 189, 189, 60, 137, 137, 137, 57, 8, 8, 8, 127, + 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 205, + 0, 0, 0, 210, 0, 0, 0, 215, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, + 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 220, + 0, 0, 0, 236, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, + 0, 0, 0, 209, 0, 0, 0, 199, 28, 28, 28, 99, + 168, 168, 168, 62, 190, 190, 190, 61, 145, 145, 145, 57, + 11, 11, 11, 120, 0, 0, 0, 205, 0, 0, 0, 206, + 0, 0, 0, 217, 0, 0, 0, 234, 0, 0, 0, 242, + 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 244, + 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 244, + 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 245, + 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, + 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, + 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 218, + 23, 23, 23, 118, 162, 162, 162, 64, 175, 175, 175, 62, + 35, 35, 35, 94, 0, 0, 0, 211, 0, 0, 0, 205, + 0, 0, 0, 209, 0, 0, 0, 224, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 1, 1, 1, 160, 181, 181, 181, 64, + 187, 187, 187, 64, 14, 14, 14, 141, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, + 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 224, + 0, 0, 0, 245, 19, 19, 19, 133, 32, 32, 32, 113, + 0, 0, 0, 235, 0, 0, 0, 229, 0, 0, 0, 212, + 0, 0, 0, 206, 0, 0, 0, 209, 0, 0, 0, 224, + 0, 0, 0, 243, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 235, 36, 36, 36, 110, + 43, 43, 43, 103, 0, 0, 0, 225, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, + 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 224, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 247, 0, 0, 0, 230, + 0, 0, 0, 212, 0, 0, 0, 206, 0, 0, 0, 209, + 0, 0, 0, 223, 0, 0, 0, 242, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, + 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 224, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 248, + 0, 0, 0, 231, 0, 0, 0, 213, 0, 0, 0, 206, + 0, 0, 0, 209, 0, 0, 0, 226, 0, 0, 0, 248, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 233, + 0, 0, 0, 209, 0, 0, 0, 207, 0, 0, 0, 224, + 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 248, 0, 0, 0, 232, 0, 0, 0, 214, + 0, 0, 0, 211, 0, 0, 0, 228, 0, 0, 0, 248, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 236, + 0, 0, 0, 214, 0, 0, 0, 210, 0, 0, 0, 229, + 0, 0, 0, 250, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 236, + 0, 0, 0, 233, 0, 0, 0, 245, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, + 0, 0, 0, 234, 0, 0, 0, 231, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 173, + 0, 0, 0, 182, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 191, 0, 0, 0, 215, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 5, 5, 5, 158, 155, 155, 155, 64, + 137, 137, 137, 64, 0, 0, 0, 181, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 174, + 125, 125, 125, 64, 80, 80, 80, 74, 0, 0, 0, 212, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 57, 57, 57, 72, + 190, 190, 190, 64, 189, 189, 189, 64, 79, 79, 79, 74, + 0, 0, 0, 213, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 207, + 87, 87, 87, 72, 190, 190, 190, 64, 189, 189, 189, 64, + 79, 79, 79, 74, 0, 0, 0, 213, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 252, 0, 0, 0, 253, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 207, 87, 87, 87, 72, 190, 190, 190, 64, + 189, 189, 189, 64, 78, 78, 78, 75, 0, 0, 0, 213, + 0, 0, 0, 247, 0, 0, 0, 236, 0, 0, 0, 238, + 0, 0, 0, 250, 23, 23, 23, 135, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 160, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 206, 89, 89, 89, 71, + 190, 190, 190, 64, 189, 189, 189, 64, 78, 78, 78, 73, + 0, 0, 0, 193, 0, 0, 0, 214, 0, 0, 0, 216, + 0, 0, 0, 234, 23, 23, 23, 132, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 206, + 89, 89, 89, 71, 190, 190, 190, 64, 189, 189, 189, 62, + 77, 77, 77, 66, 0, 0, 0, 174, 0, 0, 0, 206, + 0, 0, 0, 215, 23, 23, 23, 123, 189, 189, 189, 63, + 190, 190, 190, 64, 0, 0, 0, 160, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 232, 0, 0, 0, 190, 0, 0, 0, 190, + 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, + 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, + 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, + 0, 0, 0, 141, 90, 90, 90, 64, 190, 190, 190, 63, + 188, 188, 188, 60, 76, 76, 76, 64, 0, 0, 0, 174, + 0, 0, 0, 206, 23, 23, 23, 113, 189, 189, 189, 59, + 189, 189, 189, 63, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 160, 158, 158, 158, 64, 158, 158, 158, 64, + 158, 158, 158, 64, 158, 158, 158, 64, 158, 158, 158, 64, + 158, 158, 158, 64, 158, 158, 158, 64, 158, 158, 158, 64, + 158, 158, 158, 64, 158, 158, 158, 64, 158, 158, 158, 64, + 158, 158, 158, 64, 158, 158, 158, 64, 187, 187, 187, 64, + 189, 189, 189, 63, 188, 188, 188, 60, 76, 76, 76, 64, + 0, 0, 0, 176, 23, 23, 23, 109, 190, 190, 190, 54, + 189, 189, 189, 59, 0, 0, 0, 157, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 63, 132, 132, 132, 60, + 0, 0, 0, 158, 23, 23, 23, 110, 189, 189, 189, 52, + 190, 190, 190, 54, 0, 0, 0, 149, 0, 0, 0, 250, + 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 200, 32, 32, 32, 127, 32, 32, 32, 127, + 32, 32, 32, 127, 32, 32, 32, 127, 32, 32, 32, 127, + 32, 32, 32, 126, 32, 32, 32, 126, 32, 32, 32, 124, + 32, 32, 32, 124, 32, 32, 32, 124, 32, 32, 32, 124, + 32, 32, 32, 110, 71, 71, 71, 63, 187, 187, 187, 63, + 189, 189, 189, 63, 134, 134, 134, 63, 4, 4, 4, 157, + 0, 0, 0, 234, 23, 23, 23, 116, 189, 189, 189, 51, + 189, 189, 189, 52, 0, 0, 0, 136, 0, 0, 0, 235, + 0, 0, 0, 250, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 244, 0, 0, 0, 233, + 0, 0, 0, 231, 0, 0, 0, 231, 0, 0, 0, 219, + 38, 38, 38, 92, 176, 176, 176, 58, 190, 190, 190, 58, + 134, 134, 134, 58, 5, 5, 5, 145, 0, 0, 0, 231, + 0, 0, 0, 227, 23, 23, 23, 116, 189, 189, 189, 52, + 189, 189, 189, 51, 0, 0, 0, 129, 0, 0, 0, 216, + 0, 0, 0, 234, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 232, 0, 0, 0, 212, + 0, 0, 0, 209, 0, 0, 0, 197, 37, 37, 37, 82, + 177, 177, 177, 52, 190, 190, 190, 52, 135, 135, 135, 52, + 5, 5, 5, 131, 0, 0, 0, 209, 0, 0, 0, 209, + 0, 0, 0, 208, 23, 23, 23, 110, 189, 189, 189, 51, + 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 206, + 0, 0, 0, 217, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 232, 0, 0, 0, 211, + 0, 0, 0, 196, 37, 37, 37, 81, 176, 176, 176, 52, + 189, 189, 189, 52, 135, 135, 135, 52, 5, 5, 5, 131, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 207, 23, 23, 23, 110, 189, 189, 189, 51, + 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 206, + 0, 0, 0, 216, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 242, 0, 0, 0, 218, + 36, 36, 36, 89, 177, 177, 177, 57, 190, 190, 190, 57, + 136, 136, 136, 57, 5, 5, 5, 145, 0, 0, 0, 228, + 0, 0, 0, 228, 0, 0, 0, 228, 0, 0, 0, 228, + 0, 0, 0, 225, 24, 24, 24, 115, 189, 189, 189, 52, + 189, 189, 189, 51, 0, 0, 0, 129, 0, 0, 0, 214, + 0, 0, 0, 232, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 35, 35, 35, 99, + 176, 176, 176, 63, 189, 189, 189, 63, 136, 136, 136, 63, + 6, 6, 6, 157, 0, 0, 0, 250, 0, 0, 0, 250, + 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 247, + 0, 0, 0, 235, 23, 23, 23, 116, 189, 189, 189, 51, + 189, 189, 189, 51, 0, 0, 0, 135, 0, 0, 0, 232, + 0, 0, 0, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 24, 24, 24, 117, + 167, 167, 167, 64, 137, 137, 137, 64, 6, 6, 6, 159, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 239, + 0, 0, 0, 220, 23, 23, 23, 111, 189, 189, 189, 51, + 189, 189, 189, 54, 0, 0, 0, 147, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, + 21, 21, 21, 128, 6, 6, 6, 161, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 240, 0, 0, 0, 220, + 0, 0, 0, 208, 10, 10, 10, 116, 176, 176, 176, 54, + 163, 163, 163, 58, 0, 0, 0, 165, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 240, 0, 0, 0, 220, 0, 0, 0, 208, + 0, 0, 0, 206, 0, 0, 0, 202, 17, 17, 17, 123, + 13, 13, 13, 140, 0, 0, 0, 248, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 248, + 0, 0, 0, 226, 0, 0, 0, 208, 0, 0, 0, 206, + 0, 0, 0, 214, 0, 0, 0, 232, 0, 0, 0, 248, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, + 0, 0, 0, 229, 0, 0, 0, 212, 0, 0, 0, 214, + 0, 0, 0, 232, 0, 0, 0, 248, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 246, 0, 0, 0, 233, 0, 0, 0, 236, + 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 251, 0, 0, 0, 252, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 180, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, + 0, 0, 0, 159, 0, 0, 0, 168, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 177, 142, 142, 142, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 160, 160, 160, 64, 0, 0, 0, 168, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 172, 172, 172, 64, 0, 0, 0, 162, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 44, 44, 44, 91, 23, 23, 23, 136, + 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 135, + 23, 23, 23, 134, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, + 23, 23, 23, 133, 12, 12, 12, 141, 0, 0, 0, 242, + 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 252, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 248, + 0, 0, 0, 236, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 234, + 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 216, 0, 0, 0, 158, 0, 0, 0, 148, + 0, 0, 0, 135, 0, 0, 0, 131, 0, 0, 0, 131, + 0, 0, 0, 131, 0, 0, 0, 131, 0, 0, 0, 131, + 0, 0, 0, 131, 0, 0, 0, 131, 0, 0, 0, 131, + 0, 0, 0, 131, 0, 0, 0, 177, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 214, + 0, 0, 0, 235, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 189, 189, 189, 58, + 190, 190, 190, 52, 189, 189, 189, 51, 189, 189, 189, 51, + 189, 189, 189, 52, 189, 189, 189, 52, 189, 189, 189, 52, + 189, 189, 189, 52, 189, 189, 189, 52, 189, 189, 189, 52, + 189, 189, 189, 52, 0, 0, 0, 129, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 212, + 0, 0, 0, 234, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 189, 189, 189, 52, 189, 189, 189, 51, 189, 189, 189, 54, + 189, 189, 189, 56, 189, 189, 189, 57, 189, 189, 189, 57, + 189, 189, 189, 57, 189, 189, 189, 57, 189, 189, 189, 57, + 189, 189, 189, 57, 0, 0, 0, 141, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 231, + 0, 0, 0, 245, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 189, 189, 189, 52, 171, 171, 171, 52, 29, 29, 29, 59, + 0, 0, 0, 146, 0, 0, 0, 156, 0, 0, 0, 154, + 0, 0, 0, 154, 0, 0, 0, 154, 0, 0, 0, 154, + 0, 0, 0, 154, 0, 0, 0, 209, 0, 0, 0, 246, + 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 246, + 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 172, 172, 172, 52, 189, 189, 189, 52, 171, 171, 171, 57, + 29, 29, 29, 106, 0, 0, 0, 234, 0, 0, 0, 232, + 0, 0, 0, 230, 0, 0, 0, 229, 0, 0, 0, 229, + 0, 0, 0, 229, 0, 0, 0, 229, 0, 0, 0, 229, + 0, 0, 0, 229, 0, 0, 0, 229, 0, 0, 0, 229, + 0, 0, 0, 230, 0, 0, 0, 232, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 29, 29, 29, 55, 171, 171, 171, 52, 189, 189, 189, 57, + 171, 171, 171, 62, 29, 29, 29, 98, 0, 0, 0, 204, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 212, 0, 0, 0, 232, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 122, 29, 29, 29, 88, 171, 171, 171, 57, + 189, 189, 189, 62, 172, 172, 172, 57, 30, 30, 30, 88, + 0, 0, 0, 197, 0, 0, 0, 204, 0, 0, 0, 204, + 0, 0, 0, 205, 0, 0, 0, 207, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 212, 0, 0, 0, 232, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 129, 0, 0, 0, 200, 29, 29, 29, 95, + 171, 171, 171, 62, 190, 190, 190, 57, 172, 172, 172, 52, + 29, 29, 29, 87, 0, 0, 0, 197, 0, 0, 0, 204, + 0, 0, 0, 208, 0, 0, 0, 219, 0, 0, 0, 228, + 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 230, 0, 0, 0, 232, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 218, + 29, 29, 29, 105, 172, 172, 172, 57, 189, 189, 189, 52, + 172, 172, 172, 51, 29, 29, 29, 87, 0, 0, 0, 197, + 0, 0, 0, 207, 0, 0, 0, 220, 0, 0, 0, 239, + 0, 0, 0, 249, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 237, 29, 29, 29, 99, 172, 172, 172, 52, + 189, 189, 189, 51, 172, 172, 172, 52, 29, 29, 29, 88, + 0, 0, 0, 198, 0, 0, 0, 209, 0, 0, 0, 223, + 0, 0, 0, 243, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 222, 29, 29, 29, 89, + 172, 172, 172, 52, 189, 189, 189, 55, 171, 171, 171, 55, + 30, 30, 30, 88, 0, 0, 0, 198, 0, 0, 0, 209, + 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 201, + 30, 30, 30, 88, 171, 171, 171, 57, 189, 189, 189, 60, + 163, 163, 163, 56, 3, 3, 3, 120, 0, 0, 0, 205, + 0, 0, 0, 209, 0, 0, 0, 223, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, + 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, + 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 208, + 0, 0, 0, 201, 29, 29, 29, 96, 163, 163, 163, 62, + 44, 44, 44, 89, 0, 0, 0, 208, 0, 0, 0, 209, + 0, 0, 0, 205, 0, 0, 0, 209, 0, 0, 0, 223, + 0, 0, 0, 243, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 162, 172, 172, 172, 64, + 181, 181, 181, 64, 14, 14, 14, 139, 0, 0, 0, 255, + 0, 0, 0, 216, 0, 0, 0, 157, 0, 0, 0, 144, + 0, 0, 0, 176, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 221, 3, 3, 3, 145, + 0, 0, 0, 235, 0, 0, 0, 243, 0, 0, 0, 223, + 0, 0, 0, 209, 0, 0, 0, 205, 0, 0, 0, 209, + 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 246, 12, 12, 12, 145, + 14, 14, 14, 139, 0, 0, 0, 237, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 230, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 243, + 0, 0, 0, 223, 0, 0, 0, 209, 0, 0, 0, 205, + 0, 0, 0, 209, 0, 0, 0, 224, 0, 0, 0, 244, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 230, 0, 0, 0, 208, + 0, 0, 0, 208, 0, 0, 0, 230, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 243, 0, 0, 0, 223, 0, 0, 0, 209, + 0, 0, 0, 205, 0, 0, 0, 213, 0, 0, 0, 235, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, + 0, 0, 0, 208, 0, 0, 0, 207, 0, 0, 0, 226, + 0, 0, 0, 246, 0, 0, 0, 232, 0, 0, 0, 212, + 0, 0, 0, 212, 0, 0, 0, 232, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 243, 0, 0, 0, 224, + 0, 0, 0, 213, 0, 0, 0, 222, 0, 0, 0, 242, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 233, + 0, 0, 0, 212, 0, 0, 0, 211, 0, 0, 0, 230, + 0, 0, 0, 249, 0, 0, 0, 243, 0, 0, 0, 232, + 0, 0, 0, 232, 0, 0, 0, 243, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 244, + 0, 0, 0, 235, 0, 0, 0, 242, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, + 0, 0, 0, 232, 0, 0, 0, 230, 0, 0, 0, 243, + 0, 0, 0, 253, 0, 0, 0, 253, 0, 0, 0, 252, + 0, 0, 0, 252, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 242, 2, 2, 2, 158, 3, 3, 3, 156, + 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, + 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, + 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, + 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, + 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, + 1, 1, 1, 183, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 16, 16, 16, 137, 176, 176, 176, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 128, 128, 128, 64, 0, 0, 0, 197, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 18, 18, 18, 134, 180, 180, 180, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 172, 172, 172, 64, 0, 0, 0, 178, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 237, 11, 11, 11, 145, 17, 17, 17, 143, + 17, 17, 17, 143, 17, 17, 17, 143, 17, 17, 17, 143, + 17, 17, 17, 143, 17, 17, 17, 143, 17, 17, 17, 142, + 16, 16, 16, 142, 16, 16, 16, 141, 16, 16, 16, 141, + 16, 16, 16, 141, 16, 16, 16, 141, 16, 16, 16, 141, + 16, 16, 16, 141, 53, 53, 53, 86, 189, 189, 189, 64, + 172, 172, 172, 64, 0, 0, 0, 176, 0, 0, 0, 253, + 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 239, + 0, 0, 0, 236, 0, 0, 0, 236, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 40, 40, 40, 110, 189, 189, 189, 59, + 172, 172, 172, 59, 0, 0, 0, 164, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 207, 10, 10, 10, 150, + 10, 10, 10, 150, 10, 10, 10, 150, 10, 10, 10, 150, + 10, 10, 10, 148, 10, 10, 10, 139, 10, 10, 10, 128, + 10, 10, 10, 125, 10, 10, 10, 125, 10, 10, 10, 125, + 10, 10, 10, 125, 9, 9, 9, 125, 0, 0, 0, 182, + 0, 0, 0, 211, 40, 40, 40, 99, 189, 189, 189, 53, + 172, 172, 172, 53, 0, 0, 0, 147, 0, 0, 0, 211, + 0, 0, 0, 211, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 7, 7, 7, 152, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 189, 189, 189, 63, 190, 190, 190, 58, 189, 189, 189, 53, + 189, 189, 189, 52, 189, 189, 189, 51, 189, 189, 189, 51, + 189, 189, 189, 51, 175, 175, 175, 51, 0, 0, 0, 141, + 0, 0, 0, 206, 40, 40, 40, 96, 189, 189, 189, 51, + 172, 172, 172, 51, 0, 0, 0, 143, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 6, 6, 6, 152, 176, 176, 176, 64, + 176, 176, 176, 64, 176, 176, 176, 64, 176, 176, 176, 64, + 176, 176, 176, 64, 176, 176, 176, 61, 176, 176, 176, 57, + 177, 177, 177, 55, 185, 185, 185, 55, 189, 189, 189, 55, + 189, 189, 189, 55, 175, 175, 175, 55, 0, 0, 0, 151, + 0, 0, 0, 221, 40, 40, 40, 103, 189, 189, 189, 55, + 172, 172, 172, 55, 0, 0, 0, 154, 0, 0, 0, 221, + 0, 0, 0, 221, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 220, 0, 0, 0, 173, + 0, 0, 0, 173, 0, 0, 0, 173, 0, 0, 0, 173, + 0, 0, 0, 173, 0, 0, 0, 172, 0, 0, 0, 150, + 46, 46, 46, 63, 181, 181, 181, 61, 190, 190, 190, 61, + 190, 190, 190, 61, 175, 175, 175, 61, 0, 0, 0, 167, + 0, 0, 0, 245, 39, 39, 39, 115, 190, 190, 190, 61, + 172, 172, 172, 61, 0, 0, 0, 170, 0, 0, 0, 245, + 0, 0, 0, 246, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 234, 47, 47, 47, 91, + 181, 181, 181, 59, 189, 189, 189, 59, 163, 163, 163, 59, + 189, 189, 189, 59, 175, 175, 175, 59, 0, 0, 0, 160, + 0, 0, 0, 234, 40, 40, 40, 110, 189, 189, 189, 59, + 172, 172, 172, 59, 0, 0, 0, 163, 0, 0, 0, 236, + 0, 0, 0, 245, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 235, 47, 47, 47, 92, 180, 180, 180, 59, + 190, 190, 190, 54, 156, 156, 156, 53, 30, 30, 30, 58, + 189, 189, 189, 53, 175, 175, 175, 53, 0, 0, 0, 144, + 0, 0, 0, 210, 39, 39, 39, 98, 189, 189, 189, 53, + 172, 172, 172, 53, 0, 0, 0, 146, 0, 0, 0, 214, + 0, 0, 0, 232, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 235, + 48, 48, 48, 92, 182, 182, 182, 63, 190, 190, 190, 58, + 156, 156, 156, 53, 16, 16, 16, 108, 13, 13, 13, 117, + 189, 189, 189, 52, 174, 174, 174, 52, 0, 0, 0, 141, + 0, 0, 0, 206, 39, 39, 39, 96, 189, 189, 189, 51, + 172, 172, 172, 51, 0, 0, 0, 142, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 234, 49, 49, 49, 92, + 182, 182, 182, 64, 189, 189, 189, 64, 155, 155, 155, 61, + 15, 15, 15, 121, 0, 0, 0, 224, 13, 13, 13, 129, + 190, 190, 190, 56, 175, 175, 175, 56, 0, 0, 0, 153, + 0, 0, 0, 217, 39, 39, 39, 98, 189, 189, 189, 51, + 172, 172, 172, 51, 0, 0, 0, 142, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 234, 49, 49, 49, 92, 182, 182, 182, 64, + 190, 190, 190, 64, 155, 155, 155, 64, 15, 15, 15, 133, + 0, 0, 0, 248, 0, 0, 0, 250, 13, 13, 13, 143, + 190, 190, 190, 62, 175, 175, 175, 62, 0, 0, 0, 163, + 0, 0, 0, 222, 39, 39, 39, 98, 189, 189, 189, 51, + 172, 172, 172, 51, 0, 0, 0, 142, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 234, + 49, 49, 49, 91, 182, 182, 182, 64, 190, 190, 190, 64, + 155, 155, 155, 64, 15, 15, 15, 135, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 13, 13, 13, 146, + 189, 189, 189, 64, 175, 175, 175, 61, 0, 0, 0, 153, + 0, 0, 0, 210, 39, 39, 39, 96, 189, 189, 189, 52, + 172, 172, 172, 52, 0, 0, 0, 142, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 234, 49, 49, 49, 91, + 182, 182, 182, 64, 190, 190, 190, 64, 154, 154, 154, 64, + 14, 14, 14, 135, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 13, 13, 13, 146, + 189, 189, 189, 62, 174, 174, 174, 57, 0, 0, 0, 143, + 0, 0, 0, 205, 40, 40, 40, 97, 190, 190, 190, 54, + 172, 172, 172, 54, 0, 0, 0, 143, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 5, 5, 5, 141, 167, 167, 167, 64, + 190, 190, 190, 64, 154, 154, 154, 64, 14, 14, 14, 136, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 13, 13, 13, 142, + 189, 189, 189, 57, 175, 175, 175, 53, 0, 0, 0, 140, + 0, 0, 0, 208, 40, 40, 40, 102, 189, 189, 189, 59, + 172, 172, 172, 57, 0, 0, 0, 144, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 244, 33, 33, 33, 106, + 138, 138, 138, 64, 13, 13, 13, 136, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 245, 11, 11, 11, 132, + 163, 163, 163, 53, 151, 151, 151, 51, 0, 0, 0, 143, + 0, 0, 0, 220, 39, 39, 39, 111, 189, 189, 189, 62, + 172, 172, 172, 58, 0, 0, 0, 144, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 244, + 0, 0, 0, 177, 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 245, 0, 0, 0, 227, 0, 0, 0, 186, + 0, 0, 0, 150, 0, 0, 0, 152, 0, 0, 0, 204, + 0, 0, 0, 240, 16, 16, 16, 137, 150, 150, 150, 63, + 117, 117, 117, 58, 0, 0, 0, 160, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 246, + 0, 0, 0, 227, 0, 0, 0, 211, 0, 0, 0, 205, + 0, 0, 0, 208, 0, 0, 0, 221, 0, 0, 0, 240, + 0, 0, 0, 252, 0, 0, 0, 249, 0, 0, 0, 186, + 0, 0, 0, 183, 0, 0, 0, 208, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 237, + 0, 0, 0, 214, 0, 0, 0, 206, 0, 0, 0, 208, + 0, 0, 0, 221, 0, 0, 0, 240, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 231, 0, 0, 0, 209, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 243, + 0, 0, 0, 222, 0, 0, 0, 211, 0, 0, 0, 221, + 0, 0, 0, 240, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 232, 0, 0, 0, 211, 0, 0, 0, 211, + 0, 0, 0, 231, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, + 0, 0, 0, 242, 0, 0, 0, 233, 0, 0, 0, 242, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 242, 0, 0, 0, 230, 0, 0, 0, 230, + 0, 0, 0, 242, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 251, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 251, 0, 0, 0, 251, + 0, 0, 0, 253, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 213, + 0, 0, 0, 218, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 210, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 245, + 0, 0, 0, 221, 0, 0, 0, 221, 0, 0, 0, 245, + 0, 0, 0, 255, 7, 7, 7, 164, 128, 128, 128, 64, + 117, 117, 117, 64, 0, 0, 0, 188, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 16, 16, 16, 133, + 111, 111, 111, 64, 8, 8, 8, 154, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 161, + 134, 134, 134, 64, 134, 134, 134, 64, 0, 0, 0, 161, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 2, 2, 2, 154, 156, 156, 156, 64, + 190, 190, 190, 64, 148, 148, 148, 64, 12, 12, 12, 143, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 159, + 190, 190, 190, 64, 190, 190, 190, 64, 0, 0, 0, 159, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 233, 50, 50, 50, 92, + 182, 182, 182, 64, 190, 190, 190, 64, 155, 155, 155, 64, + 16, 16, 16, 133, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 254, 0, 0, 0, 159, + 190, 190, 190, 64, 190, 190, 190, 64, 0, 0, 0, 159, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, + 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 254, + 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 238, + 42, 42, 42, 99, 177, 177, 177, 64, 190, 190, 190, 64, + 161, 161, 161, 64, 22, 22, 22, 123, 0, 0, 0, 248, + 0, 0, 0, 246, 0, 0, 0, 240, 0, 0, 0, 154, + 189, 189, 189, 64, 190, 190, 190, 64, 0, 0, 0, 159, + 0, 0, 0, 255, 23, 23, 23, 136, 189, 189, 189, 64, + 189, 189, 189, 62, 0, 0, 0, 148, 0, 0, 0, 238, + 0, 0, 0, 246, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 242, 34, 34, 34, 106, 173, 173, 173, 64, + 190, 190, 190, 64, 167, 167, 167, 64, 27, 27, 27, 110, + 0, 0, 0, 218, 0, 0, 0, 215, 0, 0, 0, 140, + 190, 190, 190, 61, 189, 189, 189, 64, 0, 0, 0, 159, + 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 63, + 190, 190, 190, 58, 0, 0, 0, 133, 0, 0, 0, 214, + 0, 0, 0, 233, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 247, 27, 27, 27, 115, + 167, 167, 167, 64, 190, 190, 190, 63, 173, 173, 173, 59, + 34, 34, 34, 88, 0, 0, 0, 195, 0, 0, 0, 130, + 190, 190, 190, 56, 190, 190, 190, 61, 0, 0, 0, 159, + 0, 0, 0, 255, 23, 23, 23, 136, 189, 189, 189, 63, + 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, + 0, 0, 0, 230, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, + 22, 22, 22, 123, 161, 161, 161, 64, 190, 190, 190, 61, + 177, 177, 177, 56, 42, 42, 42, 81, 0, 0, 0, 115, + 190, 190, 190, 52, 189, 189, 189, 56, 0, 0, 0, 154, + 0, 0, 0, 253, 23, 23, 23, 136, 189, 189, 189, 63, + 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 16, 16, 16, 133, 155, 155, 155, 63, + 190, 190, 190, 61, 181, 181, 181, 56, 50, 50, 50, 52, + 189, 189, 189, 51, 190, 190, 190, 52, 0, 0, 0, 141, + 0, 0, 0, 242, 23, 23, 23, 134, 189, 189, 189, 63, + 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 12, 12, 12, 143, + 147, 147, 147, 64, 190, 190, 190, 61, 185, 185, 185, 56, + 189, 189, 189, 53, 189, 189, 189, 51, 0, 0, 0, 131, + 0, 0, 0, 222, 23, 23, 23, 127, 189, 189, 189, 62, + 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 190, 55, 55, 55, 109, + 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 109, + 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 109, + 64, 64, 64, 67, 173, 173, 173, 64, 190, 190, 190, 61, + 189, 189, 189, 57, 189, 189, 189, 53, 0, 0, 0, 128, + 0, 0, 0, 208, 23, 23, 23, 116, 189, 189, 189, 59, + 189, 189, 189, 57, 0, 0, 0, 129, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 64, + 189, 189, 189, 62, 190, 190, 190, 57, 0, 0, 0, 131, + 0, 0, 0, 205, 23, 23, 23, 110, 190, 190, 190, 54, + 190, 190, 190, 54, 0, 0, 0, 129, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 165, 111, 111, 111, 64, + 111, 111, 111, 64, 111, 111, 111, 64, 111, 111, 111, 64, + 111, 111, 111, 64, 111, 111, 111, 64, 111, 111, 111, 64, + 111, 111, 111, 64, 111, 111, 111, 64, 111, 111, 111, 64, + 111, 111, 111, 64, 111, 111, 111, 62, 0, 0, 0, 146, + 0, 0, 0, 212, 23, 23, 23, 109, 189, 189, 189, 51, + 189, 189, 189, 52, 0, 0, 0, 128, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 244, + 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 244, + 0, 0, 0, 244, 0, 0, 0, 243, 0, 0, 0, 240, + 0, 0, 0, 236, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 234, 0, 0, 0, 236, + 0, 0, 0, 222, 23, 23, 23, 111, 189, 189, 189, 51, + 189, 189, 189, 51, 0, 0, 0, 127, 0, 0, 0, 208, + 0, 0, 0, 229, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 228, 0, 0, 0, 221, + 0, 0, 0, 221, 0, 0, 0, 221, 0, 0, 0, 221, + 0, 0, 0, 221, 0, 0, 0, 219, 0, 0, 0, 207, + 0, 0, 0, 194, 0, 0, 0, 191, 0, 0, 0, 191, + 0, 0, 0, 191, 0, 0, 0, 191, 0, 0, 0, 190, + 0, 0, 0, 186, 23, 23, 23, 100, 189, 189, 189, 51, + 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 208, + 0, 0, 0, 230, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 193, 106, 106, 106, 65, 134, 134, 134, 64, + 134, 134, 134, 64, 134, 134, 134, 64, 134, 134, 134, 64, + 134, 134, 134, 64, 134, 134, 134, 63, 133, 133, 133, 58, + 133, 133, 133, 53, 133, 133, 133, 52, 133, 133, 133, 52, + 133, 133, 133, 52, 133, 133, 133, 52, 133, 133, 133, 52, + 133, 133, 133, 51, 141, 141, 141, 51, 189, 189, 189, 51, + 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 209, + 0, 0, 0, 230, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 159, 184, 184, 184, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 190, 190, 190, 63, 189, 189, 189, 59, + 189, 189, 189, 55, 190, 190, 190, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, + 177, 177, 177, 54, 0, 0, 0, 137, 0, 0, 0, 220, + 0, 0, 0, 237, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 233, 33, 33, 33, 117, 55, 55, 55, 109, + 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 109, + 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 107, + 55, 55, 55, 105, 55, 55, 55, 105, 55, 55, 55, 105, + 55, 55, 55, 105, 55, 55, 55, 105, 55, 55, 55, 105, + 55, 55, 55, 105, 55, 55, 55, 105, 55, 55, 55, 105, + 23, 23, 23, 124, 0, 0, 0, 232, 0, 0, 0, 244, + 0, 0, 0, 249, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 249, 0, 0, 0, 240, + 0, 0, 0, 236, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 236, + 0, 0, 0, 235, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 236, 0, 0, 0, 216, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 212, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 254, 0, 0, 0, 245, 0, 0, 0, 230, + 0, 0, 0, 226, 0, 0, 0, 225, 0, 0, 0, 225, + 0, 0, 0, 225, 0, 0, 0, 225, 0, 0, 0, 225, + 0, 0, 0, 225, 0, 0, 0, 225, 0, 0, 0, 225, + 0, 0, 0, 225, 0, 0, 0, 225, 0, 0, 0, 225, + 0, 0, 0, 225, + },{ + 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 243, + 0, 0, 0, 241, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 203, 87, 87, 87, 69, + 100, 100, 100, 65, 4, 4, 4, 179, 0, 0, 0, 255, + 0, 0, 0, 249, 0, 0, 0, 228, 0, 0, 0, 228, + 0, 0, 0, 247, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 219, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 166, 123, 123, 123, 64, 126, 126, 126, 64, + 3, 3, 3, 155, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 4, 4, 4, 171, 101, 101, 101, 65, + 19, 19, 19, 130, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 185, 185, 185, 64, 190, 190, 190, 64, + 6, 6, 6, 152, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 7, 7, 7, 160, 134, 134, 134, 64, 190, 190, 190, 64, + 161, 161, 161, 64, 7, 7, 7, 144, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 185, 185, 185, 64, 189, 189, 189, 62, + 6, 6, 6, 143, 0, 0, 0, 239, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 253, 10, 10, 10, 149, + 142, 142, 142, 64, 190, 190, 190, 64, 186, 186, 186, 64, + 66, 66, 66, 82, 0, 0, 0, 221, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, + 0, 0, 0, 253, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 185, 185, 185, 63, 189, 189, 189, 59, + 5, 5, 5, 128, 0, 0, 0, 215, 0, 0, 0, 235, + 0, 0, 0, 248, 14, 14, 14, 135, 150, 150, 150, 59, + 189, 189, 189, 59, 183, 183, 183, 62, 57, 57, 57, 87, + 0, 0, 0, 227, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 246, + 0, 0, 0, 238, 0, 0, 0, 245, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 185, 185, 185, 63, 189, 189, 189, 57, + 6, 6, 6, 124, 0, 0, 0, 208, 0, 0, 0, 225, + 19, 19, 19, 125, 156, 156, 156, 58, 190, 190, 190, 53, + 179, 179, 179, 54, 48, 48, 48, 87, 0, 0, 0, 231, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 253, 0, 0, 0, 243, 0, 0, 0, 225, + 0, 0, 0, 214, 0, 0, 0, 224, 0, 0, 0, 244, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, + 6, 6, 6, 124, 0, 0, 0, 202, 24, 24, 24, 106, + 163, 163, 163, 62, 189, 189, 189, 57, 176, 176, 176, 52, + 40, 40, 40, 83, 0, 0, 0, 217, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, + 0, 0, 0, 242, 0, 0, 0, 223, 0, 0, 0, 209, + 0, 0, 0, 206, 0, 0, 0, 213, 0, 0, 0, 236, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, + 6, 6, 6, 115, 30, 30, 30, 90, 169, 169, 169, 57, + 189, 189, 189, 62, 171, 171, 171, 57, 33, 33, 33, 87, + 0, 0, 0, 199, 0, 0, 0, 232, 0, 0, 0, 252, + 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 241, + 0, 0, 0, 222, 0, 0, 0, 208, 0, 0, 0, 205, + 0, 0, 0, 210, 0, 0, 0, 225, 0, 0, 0, 245, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, + 43, 43, 43, 53, 173, 173, 173, 52, 190, 190, 190, 57, + 166, 166, 166, 62, 27, 27, 27, 102, 0, 0, 0, 200, + 0, 0, 0, 209, 0, 0, 0, 232, 0, 0, 0, 252, + 0, 0, 0, 252, 0, 0, 0, 240, 0, 0, 0, 221, + 0, 0, 0, 208, 0, 0, 0, 205, 0, 0, 0, 210, + 0, 0, 0, 226, 0, 0, 0, 245, 0, 0, 0, 253, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, + 180, 180, 180, 52, 189, 189, 189, 52, 160, 160, 160, 57, + 21, 21, 21, 120, 0, 0, 0, 222, 0, 0, 0, 207, + 0, 0, 0, 209, 0, 0, 0, 231, 0, 0, 0, 248, + 0, 0, 0, 239, 0, 0, 0, 220, 0, 0, 0, 208, + 0, 0, 0, 205, 0, 0, 0, 211, 0, 0, 0, 227, + 0, 0, 0, 246, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, + 189, 189, 189, 52, 175, 175, 175, 52, 58, 58, 58, 59, + 42, 42, 42, 115, 42, 42, 42, 109, 42, 42, 42, 99, + 42, 42, 42, 100, 41, 41, 41, 110, 42, 42, 42, 114, + 42, 42, 42, 106, 2, 2, 2, 153, 0, 0, 0, 205, + 0, 0, 0, 212, 0, 0, 0, 229, 0, 0, 0, 246, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, + 189, 189, 189, 52, 189, 189, 189, 52, 190, 190, 190, 57, + 189, 189, 189, 62, 189, 189, 189, 57, 189, 189, 189, 52, + 189, 189, 189, 52, 190, 190, 190, 54, 190, 190, 190, 54, + 189, 189, 189, 52, 12, 12, 12, 118, 0, 0, 0, 212, + 0, 0, 0, 230, 0, 0, 0, 247, 0, 0, 0, 254, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 166, 123, 123, 123, 63, 126, 126, 126, 57, + 126, 126, 126, 52, 126, 126, 126, 52, 126, 126, 126, 57, + 126, 126, 126, 62, 126, 126, 126, 57, 126, 126, 126, 52, + 126, 126, 126, 51, 126, 126, 126, 52, 126, 126, 126, 51, + 126, 126, 126, 51, 8, 8, 8, 126, 0, 0, 0, 231, + 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, + 0, 0, 0, 248, 0, 0, 0, 224, 0, 0, 0, 203, + 0, 0, 0, 186, 0, 0, 0, 186, 0, 0, 0, 205, + 0, 0, 0, 220, 0, 0, 0, 204, 0, 0, 0, 186, + 0, 0, 0, 183, 0, 0, 0, 183, 0, 0, 0, 183, + 0, 0, 0, 187, 0, 0, 0, 216, 0, 0, 0, 239, + 0, 0, 0, 244, 0, 0, 0, 245, 0, 0, 0, 245, + 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 251, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 26, 26, 26, 126, 0, 0, 0, 238, + 0, 0, 0, 238, 0, 0, 0, 233, 0, 0, 0, 212, + 0, 0, 0, 193, 0, 0, 0, 194, 0, 0, 0, 213, + 0, 0, 0, 229, 0, 0, 0, 212, 0, 0, 0, 193, + 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, + 0, 0, 0, 193, 0, 0, 0, 200, 0, 0, 0, 217, + 0, 0, 0, 218, 0, 0, 0, 218, 0, 0, 0, 218, + 0, 0, 0, 218, 0, 0, 0, 221, 0, 0, 0, 238, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, + 190, 190, 190, 64, 127, 127, 127, 64, 117, 117, 117, 64, + 117, 117, 117, 64, 117, 117, 117, 63, 117, 117, 117, 57, + 117, 117, 117, 52, 117, 117, 117, 52, 117, 117, 117, 57, + 117, 117, 117, 62, 117, 117, 117, 57, 117, 117, 117, 52, + 117, 117, 117, 51, 117, 117, 117, 51, 117, 117, 117, 51, + 117, 117, 117, 51, 104, 104, 104, 52, 6, 6, 6, 136, + 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 206, + 0, 0, 0, 206, 0, 0, 0, 210, 0, 0, 0, 232, + 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 163, 179, 179, 179, 64, + 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, + 190, 190, 190, 64, 189, 189, 189, 63, 189, 189, 189, 57, + 189, 189, 189, 52, 189, 189, 189, 52, 190, 190, 190, 57, + 189, 189, 189, 62, 189, 189, 189, 59, 189, 189, 189, 55, + 189, 189, 189, 55, 189, 189, 189, 55, 189, 189, 189, 55, + 189, 189, 189, 55, 189, 189, 189, 55, 34, 34, 34, 104, + 0, 0, 0, 218, 0, 0, 0, 218, 0, 0, 0, 218, + 0, 0, 0, 218, 0, 0, 0, 221, 0, 0, 0, 238, + 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 236, 37, 37, 37, 108, + 73, 73, 73, 91, 73, 73, 73, 91, 73, 73, 73, 91, + 73, 73, 73, 91, 73, 73, 73, 89, 73, 73, 73, 80, + 73, 73, 73, 73, 73, 73, 73, 74, 73, 73, 73, 81, + 73, 73, 73, 88, 73, 73, 73, 88, 74, 74, 74, 87, + 73, 73, 73, 87, 73, 73, 73, 87, 73, 73, 73, 87, + 73, 73, 73, 87, 61, 61, 61, 88, 0, 0, 0, 191, + 0, 0, 0, 243, 0, 0, 0, 243, 0, 0, 0, 243, + 0, 0, 0, 243, 0, 0, 0, 245, 0, 0, 0, 249, + 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 227, + 0, 0, 0, 207, 0, 0, 0, 206, 0, 0, 0, 219, + 0, 0, 0, 233, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, + 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 238, + 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 227, + 0, 0, 0, 207, 0, 0, 0, 205, 0, 0, 0, 207, + 0, 0, 0, 209, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, + 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 215, + 0, 0, 0, 234, 0, 0, 0, 252, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 232, + 0, 0, 0, 211, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, + 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 211, + 0, 0, 0, 231, 0, 0, 0, 251, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, + 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, + 0, 0, 0, 231, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, + 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 230, + 0, 0, 0, 243, 0, 0, 0, 254, 0, 0, 0, 255, + 0, 0, 0, 255, + }}; + +#define NUM_CURSORS sizeof(Cursors) / sizeof(Cursors[0]) diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/ext.c xpsb-glx-0.19/mesa/src/glut/fbdev/ext.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/ext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/ext.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,154 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include + +#include +#include + +#include "internal.h" + +void glutReportErrors(void) +{ + GLenum error; + + while ((error = glGetError()) != GL_NO_ERROR) + sprintf(exiterror, "GL error: %s", gluErrorString(error)); +} + +static struct { + const char *name; + const GLUTproc address; +} glut_functions[] = { + { "glutInit", (const GLUTproc) glutInit }, + { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, + { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, + { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, + { "glutMainLoop", (const GLUTproc) glutMainLoop }, + { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, + { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, + { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, + { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, + { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, + { "glutGetWindow", (const GLUTproc) glutGetWindow }, + { "glutSetWindow", (const GLUTproc) glutSetWindow }, + { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, + { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, + { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, + { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, + { "glutPopWindow", (const GLUTproc) glutPopWindow }, + { "glutPushWindow", (const GLUTproc) glutPushWindow }, + { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, + { "glutShowWindow", (const GLUTproc) glutShowWindow }, + { "glutHideWindow", (const GLUTproc) glutHideWindow }, + { "glutFullScreen", (const GLUTproc) glutFullScreen }, + { "glutSetCursor", (const GLUTproc) glutSetCursor }, + { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, + { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, + { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, + { "glutUseLayer", (const GLUTproc) glutUseLayer }, + { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, + { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, + { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, + { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, + { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, + { "glutGetMenu", (const GLUTproc) glutGetMenu }, + { "glutSetMenu", (const GLUTproc) glutSetMenu }, + { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, + { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, + { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, + { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, + { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, + { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, + { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, + { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, + { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, + { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, + { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, + { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, + { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, + { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, + { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, + { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, + { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, + { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, + { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, + { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, + { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, + { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, + { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, + { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, + { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, + { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, + { "glutSetColor", (const GLUTproc) glutSetColor }, + { "glutGetColor", (const GLUTproc) glutGetColor }, + { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, + { "glutGet", (const GLUTproc) glutGet }, + { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, + { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, + { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, + { "glutLayerGet", (const GLUTproc) glutLayerGet }, + { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, + { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, + { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, + { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, + { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, + { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, + { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, + { "glutWireSphere", (const GLUTproc) glutWireSphere }, + { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, + { "glutWireCone", (const GLUTproc) glutWireCone }, + { "glutSolidCone", (const GLUTproc) glutSolidCone }, + { "glutWireCube", (const GLUTproc) glutWireCube }, + { "glutSolidCube", (const GLUTproc) glutSolidCube }, + { "glutWireTorus", (const GLUTproc) glutWireTorus }, + { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, + { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, + { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, + { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, + { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, + { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, + { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, + { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, + { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, + { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, + { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, + { "glutReportErrors", (const GLUTproc) glutReportErrors }, + { NULL, NULL } +}; + +GLUTproc glutGetProcAddress(const char *procName) +{ + /* Try GLUT functions first */ + int i; + for (i = 0; glut_functions[i].name; i++) { + if (strcmp(glut_functions[i].name, procName) == 0) + return glut_functions[i].address; + } + + /* Try core GL functions */ + return (GLUTproc) glFBDevGetProcAddress(procName); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/fbdev.c xpsb-glx-0.19/mesa/src/glut/fbdev/fbdev.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/fbdev.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/fbdev.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,940 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + * + * To improve on this library, maybe support subwindows or overlays, + * I (sean at depagnier dot com) will do my best to help. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include "internal.h" + +#define FBMODES "/etc/fb.modes" + +struct fb_fix_screeninfo FixedInfo; +struct fb_var_screeninfo VarInfo; +static struct fb_var_screeninfo OrigVarInfo; + +static int DesiredDepth = 0; + +int FrameBufferFD = -1; +unsigned char *FrameBuffer; +unsigned char *BackBuffer = NULL; +int DisplayMode; + +struct GlutTimer *GlutTimers = NULL; + +struct timeval StartTime; + +/* per window data */ +GLFBDevContextPtr Context; +GLFBDevBufferPtr Buffer; +GLFBDevVisualPtr Visual; + +int Redisplay; +int Visible; +int VisibleSwitch; +int Active; +static int Resized; +/* we have to poll to see if we are visible + on a framebuffer that is not active */ +int VisiblePoll; +int Swapping, VTSwitch; +static int FramebufferIndex; + +static int Initialized; + +char exiterror[256]; + +/* test if the active console is attached to the same framebuffer */ +void TestVisible(void) { + struct fb_con2fbmap confb; + struct vt_stat st; + int ret; + ioctl(ConsoleFD, VT_GETSTATE, &st); + confb.console = st.v_active; + + ret = ioctl(FrameBufferFD, FBIOGET_CON2FBMAP, &confb); + + if(ret == -1 || confb.framebuffer == FramebufferIndex) { + VisibleSwitch = 1; + Visible = 0; + VisiblePoll = 0; + } +} + +static void Cleanup(void) +{ + /* do not handle this signal when cleaning up */ + signal(SIGWINCH, SIG_IGN); + + if(GameMode) + glutLeaveGameMode(); + + if(ConsoleFD != -1) + RestoreVT(); + + /* close mouse */ + CloseMouse(); + + if(Visual) + glutDestroyWindow(1); + + /* restore original variable screen info */ + if(FrameBufferFD != -1) { + OrigVarInfo.xoffset = 0; + OrigVarInfo.yoffset = 0; + + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) + fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", + strerror(errno)); + + if(FrameBuffer) + munmap(FrameBuffer, FixedInfo.smem_len); + close(FrameBufferFD); + + } + + /* free allocated back buffer */ + if(DisplayMode & GLUT_DOUBLE) + free(BackBuffer); + + /* free menu items */ + FreeMenus(); + + if(exiterror[0]) + fprintf(stderr, "[glfbdev glut] %s", exiterror); + } + +static void CrashHandler(int sig) +{ + sprintf(exiterror, "Caught signal %d, cleaning up\n", sig); + exit(0); +} + +static void removeArgs(int *argcp, char **argv, int num) +{ + int i; + for (i = 0; argv[i+num]; i++) + argv[i] = argv[i+num]; + + argv[i] = NULL; + *argcp -= num; +} + +#define REQPARAM(PARAM) \ + if (i >= *argcp - 1) { \ + fprintf(stderr, PARAM" requires a parameter\n"); \ + exit(0); \ + } + +void glutInit (int *argcp, char **argv) +{ + int i, nomouse = 0, nokeyboard = 0, usestdin = 0; + int RequiredWidth = 0, RequiredHeight; + char *fbdev; + + stack_t stack; + struct sigaction sa; + + /* parse out args */ + for (i = 1; i < *argcp;) { + if (!strcmp(argv[i], "-geometry")) { + REQPARAM("geometry"); + if(sscanf(argv[i+1], "%dx%d", &RequiredWidth, + &RequiredHeight) != 2) { + fprintf(stderr,"Please specify geometry as widthxheight\n"); + exit(0); + } + removeArgs(argcp, &argv[i], 2); + } else + if (!strcmp(argv[i], "-bpp")) { + REQPARAM("bpp"); + if(sscanf(argv[i+1], "%d", &DesiredDepth) != 1) { + fprintf(stderr, "Please specify a parameter for bpp\n"); + exit(0); + } + removeArgs(argcp, &argv[i], 2); + } else + if (!strcmp(argv[i], "-vt")) { + REQPARAM("vt"); + if(sscanf(argv[i+1], "%d", &CurrentVT) != 1) { + fprintf(stderr, "Please specify a parameter for vt\n"); + exit(0); + } + removeArgs(argcp, &argv[i], 2); + } else + if (!strcmp(argv[i], "-mousespeed")) { + REQPARAM("mousespeed"); + if(sscanf(argv[i+1], "%lf", &MouseSpeed) != 1) { + fprintf(stderr, "Please specify a mouse speed, eg: 2.5\n"); + exit(0); + } + removeArgs(argcp, &argv[i], 2); + } else + if (!strcmp(argv[i], "-nomouse")) { + nomouse = 1; + removeArgs(argcp, &argv[i], 1); + } else + if (!strcmp(argv[i], "-nokeyboard")) { + nokeyboard = 1; + removeArgs(argcp, &argv[i], 1); + } else + if (!strcmp(argv[i], "-stdin")) { + usestdin = 1; + removeArgs(argcp, &argv[i], 1); + } else + if (!strcmp(argv[i], "-gpmmouse")) { +#ifdef HAVE_GPM + GpmMouse = 1; +#else + fprintf(stderr, "gpm support not compiled\n"); + exit(0); +#endif + removeArgs(argcp, &argv[i], 1); + } else + if (!strcmp(argv[i], "--")) { + removeArgs(argcp, &argv[i], 1); + break; + } else + i++; + } + + gettimeofday(&StartTime, 0); + atexit(Cleanup); + + /* set up SIGSEGV to use alternate stack */ + stack.ss_flags = 0; + stack.ss_size = SIGSTKSZ; + if(!(stack.ss_sp = malloc(SIGSTKSZ))) + sprintf(exiterror, "Failed to allocate alternate stack for SIGSEGV!\n"); + + sigaltstack(&stack, NULL); + + sa.sa_handler = CrashHandler; + sa.sa_flags = SA_ONSTACK; + sigemptyset(&sa.sa_mask); + sigaction(SIGSEGV, &sa, NULL); + + signal(SIGINT, CrashHandler); + signal(SIGTERM, CrashHandler); + signal(SIGABRT, CrashHandler); + + if(nomouse == 0) + InitializeMouse(); + if(nokeyboard == 0) + InitializeVT(usestdin); + + fbdev = getenv("FRAMEBUFFER"); + if(fbdev) { +#ifdef MULTIHEAD + if(!sscanf(fbdev, "/dev/fb%d", &FramebufferIndex)) + if(!sscanf(fbdev, "/dev/fb/%d", &FramebufferIndex)) + sprintf(exiterror, "Could not determine Framebuffer index!\n"); +#endif + } else { + static char fb[128]; + struct fb_con2fbmap confb; + int fd = open("/dev/fb0", O_RDWR); + + FramebufferIndex = 0; + + confb.console = CurrentVT; + if(ioctl(fd, FBIOGET_CON2FBMAP, &confb) != -1) + FramebufferIndex = confb.framebuffer; + sprintf(fb, "/dev/fb%d", FramebufferIndex); + fbdev = fb; + close(fd); + } + + /* open the framebuffer device */ + FrameBufferFD = open(fbdev, O_RDWR); + if (FrameBufferFD < 0) { + sprintf(exiterror, "Error opening %s: %s\n", fbdev, strerror(errno)); + exit(0); + } + + /* get the fixed screen info */ + if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { + sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", + strerror(errno)); + exit(0); + } + + /* get the variable screen info */ + if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) { + sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", + strerror(errno)); + exit(0); + } + + /* operate on a copy */ + VarInfo = OrigVarInfo; + + /* set the depth, resolution, etc */ + if(RequiredWidth) + if(!ParseFBModes(RequiredWidth, RequiredWidth, RequiredHeight, + RequiredHeight, 0, MAX_VSYNC)) { + sprintf(exiterror, "No mode (%dx%d) found in "FBMODES"\n", + RequiredWidth, RequiredHeight); + exit(0); + } + + Initialized = 1; +} + +void glutInitDisplayMode (unsigned int mode) +{ + DisplayMode = mode; +} + +static const char *GetStrVal(const char *p, int *set, int min, int max) +{ + char *endptr; + int comp = *p, val; + + if(p[1] == '=') + p++; + + if(*p == '\0') + return p; + + val = strtol(p+1, &endptr, 10); + + if(endptr == p+1) + return p; + + switch(comp) { + case '!': + if(val == min) + val = max; + else + val = min; + break; + case '<': + val = min; + break; + case '>': + val = max; + break; + } + + if(val < min || val > max) { + sprintf(exiterror, "display string value out of range\n"); + exit(0); + } + + *set = val; + + return endptr; +} + +static void SetAttrib(int val, int attr) +{ + if(val) + DisplayMode |= attr; + else + DisplayMode &= ~attr; +} + +void glutInitDisplayString(const char *string) +{ + const char *p = string; + int val; + while(*p) { + if(*p == ' ') + p++; + else + if(memcmp(p, "acca", 4) == 0) { + p = GetStrVal(p+4, &AccumSize, 1, 32); + SetAttrib(AccumSize, GLUT_ACCUM); + } else + if(memcmp(p, "acc", 3) == 0) { + p = GetStrVal(p+3, &AccumSize, 1, 32); + SetAttrib(AccumSize, GLUT_ACCUM); + } else + if(memcmp(p, "depth", 5) == 0) { + p = GetStrVal(p+5, &DepthSize, 12, 32); + SetAttrib(DepthSize, GLUT_DEPTH); + } else + if(memcmp(p, "double", 6) == 0) { + val = 1; + p = GetStrVal(p+6, &val, 0, 1); + SetAttrib(val, GLUT_DOUBLE); + } else + if(memcmp(p, "index", 5) == 0) { + val = 1; + p = GetStrVal(p+5, &val, 0, 1); + SetAttrib(val, GLUT_INDEX); + } else + if(memcmp(p, "stencil", 7) == 0) { + p = GetStrVal(p+7, &StencilSize, 0, 1); + SetAttrib(StencilSize, GLUT_STENCIL); + } else + if(memcmp(p, "samples", 7) == 0) { + NumSamples = 1; + p = GetStrVal(p+7, &NumSamples, 0, 16); + SetAttrib(NumSamples, GLUT_MULTISAMPLE); + } else + if(p = strchr(p, ' ')) + p++; + else + break; + } +} + +void glutInitWindowPosition (int x, int y) +{ +} + +void glutInitWindowSize (int width, int height) +{ +} + +static void ProcessTimers(void) +{ + while(GlutTimers && GlutTimers->time <= glutGet(GLUT_ELAPSED_TIME)) { + struct GlutTimer *timer = GlutTimers; + GlutTimers = timer->next; + timer->func(timer->value); + free(timer); + } +} + +void glutMainLoop(void) +{ + int idleiters; + + if(ReshapeFunc) + ReshapeFunc(VarInfo.xres, VarInfo.yres); + + if(!DisplayFunc) { + sprintf(exiterror, "Fatal Error: No Display Function registered\n"); + exit(0); + } + + for(;;) { + ProcessTimers(); + + if(Active) + ReceiveInput(); + else + if(VisiblePoll) + TestVisible(); + + if(IdleFunc) + IdleFunc(); + + if(VisibleSwitch) { + VisibleSwitch = 0; + if(VisibilityFunc) + VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); + } + + if(Resized) { + SetVideoMode(); + CreateBuffer(); + + if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { + sprintf(exiterror, "Failure to Make Current\n"); + exit(0); + } + + InitializeMenus(); + + if(ReshapeFunc) + ReshapeFunc(VarInfo.xres, VarInfo.yres); + + Redisplay = 1; + Resized = 0; + } + + if(Visible && Redisplay) { + Redisplay = 0; + EraseCursor(); + DisplayFunc(); + if(!(DisplayMode & GLUT_DOUBLE)) { + if(ActiveMenu) + DrawMenus(); + DrawCursor(); + } + idleiters = 0; + } else { + /* we sleep if not receiving redisplays, and + the main loop is running faster than 2khz */ + + static int lasttime; + int time = glutGet(GLUT_ELAPSED_TIME); + if(time > lasttime) { + if(idleiters >= 2) + usleep(100); + + idleiters = 0; + lasttime = time; + } + idleiters++; + } + } +} + +int ParseFBModes(int minw, int maxw, int minh, int maxh, int minf, int maxf) +{ + char buf[1024]; + struct fb_var_screeninfo vi = VarInfo; + + FILE *fbmodes = fopen(FBMODES, "r"); + + if(!fbmodes) { + sprintf(exiterror, "Warning: could not open "FBMODES"\n"); + return 0; + } + + while(fgets(buf, sizeof buf, fbmodes)) { + char *c; + int v, bpp, freq; + + if(!(c = strstr(buf, "geometry"))) + continue; + v = sscanf(c, "geometry %d %d %d %d %d", &vi.xres, &vi.yres, + &vi.xres_virtual, &vi.yres_virtual, &bpp); + if(v != 5) + continue; + + if(maxw < minw) { + if(maxw < vi.xres && minw > vi.xres) + continue; + } else + if(maxw < vi.xres || minw > vi.xres) + continue; + + if(maxh < minh) { + if(maxh < vi.yres && minh > vi.yres) + continue; + } else + if(maxh < vi.yres || minh > vi.yres) + continue; + + fgets(buf, sizeof buf, fbmodes); + if(!(c = strstr(buf, "timings"))) + continue; + + v = sscanf(c, "timings %d %d %d %d %d %d %d", &vi.pixclock, + &vi.left_margin, &vi.right_margin, &vi.upper_margin, + &vi.lower_margin, &vi.hsync_len, &vi.vsync_len); + + if(v != 7) + continue; + + freq = 1E12/vi.pixclock + /(vi.left_margin + vi.xres + vi.right_margin + vi.hsync_len) + /(vi.upper_margin + vi.yres + vi.lower_margin + vi.vsync_len); + + if(maxf < minf) { + if(maxf < freq && minf > freq) + continue; + } else + if(maxf < freq || minf > freq) + continue; + + VarInfo = vi; + fclose(fbmodes); + return 1; + } + + fclose(fbmodes); + + return 0; +} + +void SetVideoMode(void) +{ + /* set new variable screen info */ + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { + sprintf(exiterror, "FBIOPUT_VSCREENINFO failed: %s\n", strerror(errno)); + strcat(exiterror, "Perhaps the device does not support the selected mode\n"); + exit(0); + } + + /* reload the screen info to update rgb bits */ + if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) { + sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", + strerror(errno)); + exit(0); + } + + /* reload the fixed info to update color mode */ + if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { + sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", + strerror(errno)); + exit(0); + } + + if (DesiredDepth && DesiredDepth != VarInfo.bits_per_pixel) { + sprintf(exiterror, "error: Could not set set %d bpp\n", DesiredDepth); + exit(0); + } + + if(DisplayMode & GLUT_INDEX && FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { + sprintf(exiterror, "error: Could not set 8 bit color mode\n"); + exit(0); + } + + /* initialize colormap */ + LoadColorMap(); +} + +void CreateBuffer(void) +{ + int size = VarInfo.xres_virtual * VarInfo.yres_virtual + * VarInfo.bits_per_pixel / 8; + + /* mmap the framebuffer into our address space */ + if(FrameBuffer) + munmap(FrameBuffer, FixedInfo.smem_len); + FrameBuffer = mmap(0, FixedInfo.smem_len, PROT_READ | PROT_WRITE, + MAP_SHARED, FrameBufferFD, 0); + if (FrameBuffer == MAP_FAILED) { + sprintf(exiterror, "error: unable to mmap framebuffer: %s\n", + strerror(errno)); + exit(0); + } + + if(DisplayMode & GLUT_DOUBLE) { + free(BackBuffer); + if(!(BackBuffer = malloc(size))) { + sprintf(exiterror, "Failed to allocate double buffer\n"); + exit(0); + } + } else + BackBuffer = FrameBuffer; + + if(Buffer) + glFBDevDestroyBuffer(Buffer); + + if(!(Buffer = glFBDevCreateBuffer( &FixedInfo, &VarInfo, Visual, + FrameBuffer, BackBuffer, size))) { + sprintf(exiterror, "Failure to create Buffer\n"); + exit(0); + } +} + +void CreateVisual(void) +{ + int i, mask = DisplayMode; + int attribs[20]; + for(i=0; i 0) + InitializeVT(0); + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { + sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", + strerror(errno)); + exit(0); + } + + RestoreColorMap(); + + Redisplay = 1; + VisibleSwitch = 1; + Visible = 1; +} + +void glutIconifyWindow(void) +{ + RestoreVT(); + signal(SIGCONT, UnIconifyWindow); + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) + fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", + strerror(errno)); + + raise(SIGSTOP); +} + +void glutSetWindowTitle(const char *name) +{ + /* escape code to set title in screen */ + if(getenv("TERM") && memcmp(getenv("TERM"), "screen", 6) == 0) + printf("\033k%s\033\\", name); +} + +void glutSetIconTitle(const char *name) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/gamemode.c xpsb-glx-0.19/mesa/src/glut/fbdev/gamemode.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/gamemode.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/gamemode.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,306 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include +#include + +#include + +#include + +#include "internal.h" + +int GameMode; + +static int ModePossible, DispChanged; +static struct fb_var_screeninfo NormVarInfo, GameVarInfo; + +static GLFBDevContextPtr GameContext; +static GLFBDevVisualPtr NormVisual; + +/* storage for non-gamemode callbacks */ +void (*KeyFuncs[2])(unsigned char key, int x, int y); +static void (*NormFuncs[8])(); + +static const char*SetOpers(const char *p, unsigned int *min, unsigned int *max) +{ + char *endptr; + int comp = *p, val, neq = 0; + + if(p[1] == '=') { + neq = 0; + p++; + } + + val = strtol(p+1, &endptr, 10); + if(endptr == p+1) + return p; + + switch(comp) { + case '=': + *min = *max = val; + break; + case '!': + *min = val + 1; + *max = val - 1; + break; + case '<': + *max = val - neq; + break; + case '>': + *min = val + neq; + break; + } + return endptr; +} + +void glutGameModeString(const char *string) +{ + const char *p = string; + unsigned int minb = 15, maxb = 32; + unsigned int minw = 0, maxw = -1; + unsigned int minh, maxh = -1; + unsigned int minf = 0, maxf = MAX_VSYNC; + char *endptr; + int count = -1, val; + + ModePossible = 0; + + if(DisplayMode & GLUT_INDEX) + minb = maxb = 8; + + again: + count++; + if((val = strtol(p, &endptr, 10)) && *endptr=='x') { + maxw = minw = val; + p = endptr + 1; + maxh = minh = strtol(p, &endptr, 10); + p = endptr; + goto again; + } + + if(*p == ':') { + minb = strtol(p+1, &endptr, 10); + p = endptr; + if(DisplayMode & GLUT_INDEX) { + if(minb != 8) + return; + } else + if(minb != 15 && minb != 16 && minb != 24 && minb != 32) + return; + maxb = minb; + goto again; + } + + if(*p == '@') { + minf = strtol(p+1, &endptr, 10) - 5; + maxf = minf + 10; + p = endptr; + goto again; + } + + if(count == 0) + while(*p) { + if(*p == ' ') + p++; + else + if(memcmp(p, "bpp", 3) == 0) + p = SetOpers(p+3, &minb, &maxb); + else + if(memcmp(p, "height", 6) == 0) + p = SetOpers(p+6, &minh, &maxh); + else + if(memcmp(p, "hertz", 5) == 0) + p = SetOpers(p+5, &minf, &maxf); + else + if(memcmp(p, "width", 5) == 0) + p = SetOpers(p+5, &minw, &maxw); + else + if(p = strchr(p, ' ')) + p++; + else + break; + } + + NormVarInfo = VarInfo; + if(!ParseFBModes(minw, maxw, minh, maxh, minf, maxf)) + return; + + GameVarInfo = VarInfo; + VarInfo = NormVarInfo; + + /* determine optimal bitdepth, make sure we have enough video memory */ + if(VarInfo.bits_per_pixel && VarInfo.bits_per_pixel <= maxb) + GameVarInfo.bits_per_pixel = VarInfo.bits_per_pixel; + else + GameVarInfo.bits_per_pixel = maxb; + + while(FixedInfo.smem_len < GameVarInfo.xres * GameVarInfo.yres + * GameVarInfo.bits_per_pixel / 8) { + if(GameVarInfo.bits_per_pixel < minb) + return; + GameVarInfo.bits_per_pixel = ((GameVarInfo.bits_per_pixel+1)/8)*8-8; + } + + ModePossible = 1; +} + +int glutEnterGameMode(void) +{ + if(ActiveMenu) + return 0; + + if(!ModePossible) + return 0; + + if(GameMode) { + if(!memcmp(&GameVarInfo, &VarInfo, sizeof VarInfo)) { + DispChanged = 0; + return 1; + } + glutLeaveGameMode(); + } + + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &GameVarInfo)) + return 0; + + NormVarInfo = VarInfo; + VarInfo = GameVarInfo; + + NormVisual = Visual; + SetVideoMode(); + CreateVisual(); + CreateBuffer(); + + if(!(GameContext = glFBDevCreateContext(Visual, NULL))) { + sprintf(exiterror, "Failure to create Context\n"); + exit(0); + } + + if(!glFBDevMakeCurrent( GameContext, Buffer, Buffer )) { + sprintf(exiterror, "Failure to Make Game Current\n"); + exit(0); + } + + InitializeCursor(); + + KeyFuncs[0] = KeyboardFunc; + KeyFuncs[1] = KeyboardUpFunc; + + NormFuncs[0] = DisplayFunc; + NormFuncs[1] = ReshapeFunc; + NormFuncs[2] = MouseFunc; + NormFuncs[3] = MotionFunc; + NormFuncs[4] = PassiveMotionFunc; + NormFuncs[5] = VisibilityFunc; + NormFuncs[6] = SpecialFunc; + NormFuncs[7] = SpecialUpFunc; + + DisplayFunc = NULL; + ReshapeFunc = NULL; + KeyboardFunc = NULL; + KeyboardUpFunc = NULL; + MouseFunc = NULL; + MotionFunc = NULL; + PassiveMotionFunc = NULL; + VisibilityFunc = NULL; + SpecialFunc = SpecialUpFunc = NULL; + + DispChanged = 1; + GameMode = 1; + Visible = 1; + VisibleSwitch = 1; + Redisplay = 1; + return 1; +} + +void glutLeaveGameMode(void) +{ + if(!GameMode) + return; + + glFBDevDestroyContext(GameContext); + glFBDevDestroyVisual(Visual); + + VarInfo = NormVarInfo; + Visual = NormVisual; + + if(Visual) { + SetVideoMode(); + CreateBuffer(); + + if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { + sprintf(exiterror, "Failure to Make Current\n"); + exit(0); + } + + Redisplay = 1; + } + + KeyboardFunc = KeyFuncs[0]; + KeyboardUpFunc = KeyFuncs[1]; + + DisplayFunc = NormFuncs[0]; + ReshapeFunc = NormFuncs[1]; + MouseFunc = NormFuncs[2]; + MotionFunc = NormFuncs[3]; + PassiveMotionFunc = NormFuncs[4]; + VisibilityFunc = NormFuncs[5]; + SpecialFunc = NormFuncs[6]; + SpecialUpFunc = NormFuncs[7]; + + GameMode = 0; +} + +int glutGameModeGet(GLenum mode) { + switch(mode) { + case GLUT_GAME_MODE_ACTIVE: + return GameMode; + case GLUT_GAME_MODE_POSSIBLE: + return ModePossible; + case GLUT_GAME_MODE_DISPLAY_CHANGED: + return DispChanged; + } + + if(!ModePossible) + return -1; + + switch(mode) { + case GLUT_GAME_MODE_WIDTH: + return GameVarInfo.xres; + case GLUT_GAME_MODE_HEIGHT: + return GameVarInfo.yres; + case GLUT_GAME_MODE_PIXEL_DEPTH: + return GameVarInfo.bits_per_pixel; + case GLUT_GAME_MODE_REFRESH_RATE: + return 1E12/GameVarInfo.pixclock + / (GameVarInfo.left_margin + GameVarInfo.xres + + GameVarInfo.right_margin + GameVarInfo.hsync_len) + / (GameVarInfo.upper_margin + GameVarInfo.yres + + GameVarInfo.lower_margin + GameVarInfo.vsync_len); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/input.c xpsb-glx-0.19/mesa/src/glut/fbdev/input.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/input.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/input.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,828 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include "internal.h" + +#define MOUSEDEV "/dev/gpmdata" + +#ifdef HAVE_GPM +#include +int GpmMouse; +#endif + +int CurrentVT = 0; +int ConsoleFD = -1; + +int KeyboardModifiers; + +int MouseX, MouseY; +int NumMouseButtons; + +double MouseSpeed = 0; + +int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT; + +int MouseVisible = 0; +int LastMouseTime = 0; + +static int OldKDMode = -1; +static int OldMode = KD_TEXT; +static struct vt_mode OldVTMode; +static struct termios OldTermios; + +static int KeyboardLedState; + +static int MouseFD; + +static int kbdpipe[2]; + +static int LastStdinKeyTime, LastStdinSpecialKey = -1, LastStdinCode = -1; + +#define MODIFIER(mod) \ + KeyboardModifiers = release ? KeyboardModifiers & ~mod \ + : KeyboardModifiers | mod; + +/* signal handler attached to SIGIO on keyboard input, vt + switching and modifiers is handled in the signal handler + other keypresses read from a pipe that leaves the handler + if a program locks up the glut loop, you can still switch + vts and kill it without Alt-SysRq hack */ +static void KeyboardHandler(int sig) +{ + unsigned char code; + + while(read(ConsoleFD, &code, 1) == 1) { + int release, labelval; + struct kbentry entry; + static int lalt; /* only left alt does vt switch */ + + release = code & 0x80; + + entry.kb_index = code & 0x7F; + entry.kb_table = 0; + + if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { + sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); + exit(0); + } + + labelval = entry.kb_value; + + switch(labelval) { + case K_SHIFT: + case K_SHIFTL: + MODIFIER(GLUT_ACTIVE_SHIFT); + continue; + case K_CTRL: + MODIFIER(GLUT_ACTIVE_CTRL); + continue; + case K_ALT: + lalt = !release; + case K_ALTGR: + MODIFIER(GLUT_ACTIVE_ALT); + continue; + } + + if(lalt && !release) { + /* VT switch, we must do it */ + int vt = -1; + struct vt_stat st; + if(labelval >= K_F1 && labelval <= K_F12) + vt = labelval - K_F1 + 1; + + if(labelval == K_LEFT) + if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) + vt = st.v_active - 1; + + if(labelval == K_RIGHT) + if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) + vt = st.v_active + 1; + + if(vt != -1) { + if(Swapping) + VTSwitch = vt; + else + if(ioctl(ConsoleFD, VT_ACTIVATE, vt) < 0) + sprintf(exiterror, "Error switching console\n"); + continue; + } + } + write(kbdpipe[1], &code, 1); + } +} + +static void LedModifier(int led, int release) +{ + static int releaseflag = K_CAPS | K_NUM | K_HOLD; + if(release) + releaseflag |= led; + else + if(releaseflag & led) { + KeyboardLedState ^= led; + releaseflag &= ~led; + } + + ioctl(ConsoleFD, KDSKBLED, KeyboardLedState); + ioctl(ConsoleFD, KDSETLED, 0x80); +} + +static void HandleKeyPress(unsigned char key, int up) +{ + if(up) { + if(KeyboardUpFunc) + KeyboardUpFunc(key, MouseX, MouseY); + } else + if(KeyboardFunc) + KeyboardFunc(key, MouseX, MouseY); + else + if(key == 27) + exit(0); /* no handler, to provide a way to exit */ +} + +static void HandleSpecialPress(int key, int up) +{ + if(up) { + if(SpecialUpFunc) + SpecialUpFunc(key, MouseX, MouseY); + } else + if(SpecialFunc) + SpecialFunc(key, MouseX, MouseY); +} + +static void ReleaseStdinKey(void) +{ + if(LastStdinSpecialKey != -1) { + HandleSpecialPress(LastStdinSpecialKey, 1); + LastStdinSpecialKey = -1; + } + if(LastStdinCode != -1) { + HandleKeyPress(LastStdinCode, 1); + LastStdinCode = -1; + } +} + +#define READKEY read(kbdpipe[0], &code, 1) +static int ReadKey(void) +{ + int release, labelval, labelvalnoshift; + unsigned char code; + int specialkey = 0; + struct kbentry entry; + + if(READKEY != 1) { + /* if we are reading from stdin, we detect key releases when the key + does not repeat after a given timeout */ + if(ConsoleFD == 0 && LastStdinKeyTime + 100 < glutGet(GLUT_ELAPSED_TIME)) + ReleaseStdinKey(); + return 0; + } + + if(code == 0) + return 0; + + /* stdin input escape code based */ + if(ConsoleFD == 0) { + KeyboardModifiers = 0; + altset: + if(code == 27 && READKEY == 1) { + if(code != 91) { + KeyboardModifiers |= GLUT_ACTIVE_ALT; + goto altset; + } + READKEY; + switch(code) { + case 68: + specialkey = GLUT_KEY_LEFT; break; + case 65: + specialkey = GLUT_KEY_UP; break; + case 67: + specialkey = GLUT_KEY_RIGHT; break; + case 66: + specialkey = GLUT_KEY_DOWN; break; + case 52: + specialkey = GLUT_KEY_END; READKEY; break; + case 53: + specialkey = GLUT_KEY_PAGE_UP; READKEY; break; + case 54: + specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break; + case 49: + READKEY; + if(code == 126) + specialkey = GLUT_KEY_HOME; + else { + specialkey = GLUT_KEY_F1 + code - 50; + READKEY; + } + break; + case 50: + READKEY; + if(code == 126) + specialkey = GLUT_KEY_INSERT; + else { + if(code > '1') + code--; + if(code > '6') + code--; + if(code > '3') { + KeyboardModifiers |= GLUT_ACTIVE_SHIFT; + code -= 12; + } + specialkey = GLUT_KEY_F1 + code - 40; + READKEY; + } + break; + case 51: + READKEY; + if(code == 126) { + code = '\b'; + goto stdkey; + } + KeyboardModifiers |= GLUT_ACTIVE_SHIFT; + specialkey = GLUT_KEY_F1 + code - 45; + READKEY; + break; + case 91: + READKEY; + specialkey = GLUT_KEY_F1 + code - 65; + break; + default: + return 0; + } + } + + if(specialkey) { + LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); + + if(LastStdinSpecialKey != specialkey) { + ReleaseStdinKey(); + HandleSpecialPress(specialkey, 0); + LastStdinSpecialKey = specialkey; + LastStdinKeyTime += 200; /* initial repeat */ + } else + if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) + HandleSpecialPress(specialkey, 0); + } else { + if(code >= 1 && code <= 26 && code != '\r') { + KeyboardModifiers |= GLUT_ACTIVE_CTRL; + code += 'a' - 1; + } + if((code >= 43 && code <= 34) || (code == 60) + || (code >= 62 && code <= 90) || (code == 94) + || (code == 95) || (code >= 123 && code <= 126)) + KeyboardModifiers |= GLUT_ACTIVE_SHIFT; + + stdkey: + LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); + if(LastStdinCode != code) { + ReleaseStdinKey(); + HandleKeyPress(code, 0); + LastStdinCode = code; + LastStdinKeyTime += 200; /* initial repeat */ + } else + if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) + HandleSpecialPress(code, 0); + } + return 1; + } + + /* linux kbd reading */ + release = code & 0x80; + code &= 0x7F; + + if(KeyRepeatMode == GLUT_KEY_REPEAT_OFF) { + static char keystates[128]; + if(release) + keystates[code] = 0; + else { + if(keystates[code]) + return 1; + keystates[code] = 1; + } + } + + entry.kb_index = code; + entry.kb_table = 0; + + if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { + sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); + exit(0); + } + + labelvalnoshift = entry.kb_value; + + if(KeyboardModifiers & GLUT_ACTIVE_SHIFT) + entry.kb_table |= K_SHIFTTAB; + + if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { + sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); + exit(0); + } + + labelval = entry.kb_value; + + switch(labelvalnoshift) { + case K_CAPS: + LedModifier(LED_CAP, release); + return 0; + case K_NUM: + LedModifier(LED_NUM, release); + return 0; + case K_HOLD: /* scroll lock suspends glut */ + LedModifier(LED_SCR, release); + while(KeyboardLedState & LED_SCR) { + usleep(10000); + ReadKey(); + } + return 0; + } + + /* we could queue keypresses here */ + if(KeyboardLedState & LED_SCR) + return 0; + + if(labelvalnoshift >= K_F1 && labelvalnoshift <= K_F12) + specialkey = GLUT_KEY_F1 + labelvalnoshift - K_F1; + else + switch(labelvalnoshift) { + case K_LEFT: + specialkey = GLUT_KEY_LEFT; break; + case K_UP: + specialkey = GLUT_KEY_UP; break; + case K_RIGHT: + specialkey = GLUT_KEY_RIGHT; break; + case K_DOWN: + specialkey = GLUT_KEY_DOWN; break; + case K_PGUP: + specialkey = GLUT_KEY_PAGE_UP; break; + case K_PGDN: + specialkey = GLUT_KEY_PAGE_DOWN; break; + case K_FIND: + specialkey = GLUT_KEY_HOME; break; + case K_SELECT: + specialkey = GLUT_KEY_END; break; + case K_INSERT: + specialkey = GLUT_KEY_INSERT; break; + case K_REMOVE: + labelval = '\b'; + break; + case K_ENTER: + labelval = '\r'; break; + } + + /* likely a keypad input, but depends on keyboard mapping, ignore */ + if(labelval == 512) + return 1; + + /* dispatch callback */ + if(specialkey) + HandleSpecialPress(specialkey, release); + else { + char c = labelval; + + if(KeyboardLedState & LED_CAP) { + if(c >= 'A' && c <= 'Z') + c += 'a' - 'A'; + else + if(c >= 'a' && c <= 'z') + c += 'A' - 'a'; + } + HandleKeyPress(c, release); + } + return 1; +} + +void glutIgnoreKeyRepeat(int ignore) +{ + KeyRepeatMode = ignore ? GLUT_KEY_REPEAT_OFF : GLUT_KEY_REPEAT_ON; +} + +void glutSetKeyRepeat(int repeatMode) +{ + KeyRepeatMode = repeatMode; +} + +void glutForceJoystickFunc(void) +{ +} + +static void HandleMousePress(int button, int pressed) +{ + if(TryMenu(button, pressed)) + return; + + if(MouseFunc) + MouseFunc(button, pressed ? GLUT_DOWN : GLUT_UP, MouseX, MouseY); +} + +static int ReadMouse(void) +{ + int l, r, m; + static int ll, lm, lr; + signed char dx, dy; + +#ifdef HAVE_GPM + if(GpmMouse) { + Gpm_Event event; + struct pollfd pfd; + pfd.fd = gpm_fd; + pfd.events = POLLIN; + if(poll(&pfd, 1, 1) != 1) + return 0; + + if(Gpm_GetEvent(&event) != 1) + return 0; + + l = event.buttons & GPM_B_LEFT; + m = event.buttons & GPM_B_MIDDLE; + r = event.buttons & GPM_B_RIGHT; + + /* gpm is weird in that it gives a button number when the button + is released, with type set to GPM_UP, this is only a problem + if it is the last button released */ + + if(event.type & GPM_UP) + if(event.buttons == GPM_B_LEFT || event.buttons == GPM_B_MIDDLE || + event.buttons == GPM_B_RIGHT || event.buttons == GPM_B_FOURTH) + l = m = r = 0; + + dx = event.dx; + dy = event.dy; + } else +#endif + { + char data[4]; + + if(MouseFD == -1) + return 0; + + if(read(MouseFD, data, 4) != 4) + return 0; + + l = ((data[0] & 0x20) >> 3); + m = ((data[3] & 0x10) >> 3); + r = ((data[0] & 0x10) >> 4); + + dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); + dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); + } + + MouseX += dx * MouseSpeed; + if(MouseX < 0) + MouseX = 0; + else + if(MouseX >= VarInfo.xres) + MouseX = VarInfo.xres - 1; + + MouseY += dy * MouseSpeed; + if(MouseY < 0) + MouseY = 0; + else + if(MouseY >= VarInfo.yres) + MouseY = VarInfo.yres - 1; + + if(l != ll) + HandleMousePress(GLUT_LEFT_BUTTON, l); + if(m != lm) + HandleMousePress(GLUT_MIDDLE_BUTTON, m); + if(r != lr) + HandleMousePress(GLUT_RIGHT_BUTTON, r); + + ll = l, lm = m, lr = r; + + if(dx || dy || !MouseVisible) { + if(l || m || r) { + if(MotionFunc) + MotionFunc(MouseX, MouseY); + } else + if(PassiveMotionFunc) + PassiveMotionFunc(MouseX, MouseY); + + EraseCursor(); + + MouseVisible = 1; + + if(ActiveMenu) + Redisplay = 1; + else + SwapCursor(); + } + + LastMouseTime = glutGet(GLUT_ELAPSED_TIME); + + return 1; +} + +void ReceiveInput(void) +{ + if(ConsoleFD != -1) + while(ReadKey()); + + while(ReadMouse()); + + /* implement a 2 second timeout on the mouse */ + if(MouseVisible && glutGet(GLUT_ELAPSED_TIME) - LastMouseTime > 2000) { + EraseCursor(); + MouseVisible = 0; + SwapCursor(); + } +} + +static void VTSwitchHandler(int sig) +{ + struct vt_stat st; + switch(sig) { + case SIGUSR1: + ioctl(ConsoleFD, VT_RELDISP, 1); + Active = 0; +#ifdef MULTIHEAD + VisiblePoll = 1; + TestVisible(); +#else + VisibleSwitch = 1; + Visible = 0; +#endif + break; + case SIGUSR2: + ioctl(ConsoleFD, VT_GETSTATE, &st); + if(st.v_active) + ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ); + + RestoreColorMap(); + + Active = 1; + Visible = 1; + VisibleSwitch = 1; + + Redisplay = 1; + break; + } +} + +void InitializeVT(int usestdin) +{ + struct termios tio; + struct vt_mode vt; + char console[128]; + + signal(SIGIO, SIG_IGN); + + Active = 1; + + if(usestdin) { + ConsoleFD = 0; + goto setattribs; + } + + /* detect the current vt if it was not specified */ + if(CurrentVT == 0) { + int fd = open("/dev/tty", O_RDWR | O_NDELAY, 0); + struct vt_stat st; + if(fd == -1) { + sprintf(exiterror, "Failed to open /dev/tty\n"); + exit(0); + } + + if(ioctl(fd, VT_GETSTATE, &st) == -1) { + fprintf(stderr, "Could not detect current vt, specify with -vt\n"); + fprintf(stderr, "Defaulting to stdin input\n"); + ConsoleFD = 0; + close(fd); + goto setattribs; + } + + CurrentVT = st.v_active; + close(fd); + } + + /* if we close with the modifier set in glutIconifyWindow, we won't + get the signal when they are released, so set to zero here */ + KeyboardModifiers = 0; + + /* open the console tty */ + sprintf(console, "/dev/tty%d", CurrentVT); + ConsoleFD = open(console, O_RDWR | O_NDELAY, 0); + if (ConsoleFD < 0) { + sprintf(exiterror, "error couldn't open %s," + " defaulting to stdin \n", console); + ConsoleFD = 0; + goto setattribs; + } + + signal(SIGUSR1, VTSwitchHandler); + signal(SIGUSR2, VTSwitchHandler); + + if (ioctl(ConsoleFD, VT_GETMODE, &OldVTMode) < 0) { + sprintf(exiterror,"Failed to grab %s, defaulting to stdin\n", console); + close(ConsoleFD); + ConsoleFD = 0; + goto setattribs; + } + + vt = OldVTMode; + + vt.mode = VT_PROCESS; + vt.waitv = 0; + vt.relsig = SIGUSR1; + vt.acqsig = SIGUSR2; + if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) { + sprintf(exiterror, "error: ioctl(VT_SETMODE) failed: %s\n", + strerror(errno)); + close(ConsoleFD); + ConsoleFD = 0; + exit(1); + } + + if (ioctl(ConsoleFD, KDGKBMODE, &OldKDMode) < 0) { + sprintf(exiterror, "Warning: ioctl KDGKBMODE failed!\n"); + OldKDMode = K_XLATE; + } + + /* use SIGIO so VT switching can work if the program is locked */ + signal(SIGIO, KeyboardHandler); + + pipe(kbdpipe); + + if(fcntl(kbdpipe[0], F_SETFL, O_NONBLOCK | O_ASYNC) < 0) { + sprintf(exiterror, "Failed to set keyboard to non-blocking\n"); + exit(0); + } + + fcntl(ConsoleFD, F_SETOWN, getpid()); + + if(ioctl(ConsoleFD, KDGETMODE, &OldMode) < 0) + sprintf(exiterror, "Warning: Failed to get terminal mode\n"); + +#ifdef HAVE_GPM + if(!GpmMouse) +#endif + if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) + sprintf(exiterror,"Warning: Failed to set terminal to graphics\n"); + + if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) { + sprintf(exiterror, "ioctl KDSKBMODE failed!\n"); + exit(0); + } + + if(ioctl(ConsoleFD, KDGKBLED, &KeyboardLedState) < 0) { + sprintf(exiterror, "ioctl KDGKBLED failed!\n"); + exit(0); + } + + setattribs: + /* enable async input input */ + if(fcntl(ConsoleFD, F_SETFL, O_ASYNC) < 0) { + sprintf(exiterror, "Failed to set O_ASYNC mode on fd %d\n", ConsoleFD); + exit(0); + } + + /* save old terminos settings */ + if (tcgetattr(ConsoleFD, &OldTermios) < 0) { + sprintf(exiterror, "tcgetattr failed\n"); + exit(0); + } + + tio = OldTermios; + + /* terminos settings for straight-through mode */ + tio.c_lflag &= ~(ICANON | ECHO | ISIG); + tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON); + tio.c_iflag |= IGNBRK; + + tio.c_cc[VMIN] = 0; + tio.c_cc[VTIME] = 0; + + if (tcsetattr(ConsoleFD, TCSANOW, &tio) < 0) { + sprintf(exiterror, "tcsetattr failed\n"); + exit(0); + } +} + +void RestoreVT(void) +{ + if(ConsoleFD < 0) + return; + + if (tcsetattr(ConsoleFD, TCSANOW, &OldTermios) < 0) + sprintf(exiterror, "tcsetattr failed\n"); + + /* setting the mode to text from graphics restores the colormap */ + if( +#ifdef HAVE_GPM + !GpmMouse || +#endif + ConsoleFD == 0) + if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) + goto skipioctl; /* no need to fail twice */ + + if(ioctl(ConsoleFD, KDSETMODE, OldMode) < 0) + fprintf(stderr, "ioctl KDSETMODE failed!\n"); + + skipioctl: + + if(ConsoleFD == 0) + return; + + /* restore keyboard state */ + if (ioctl(ConsoleFD, VT_SETMODE, &OldVTMode) < 0) + fprintf(stderr, "Failed to set vtmode\n"); + + if (ioctl(ConsoleFD, KDSKBMODE, OldKDMode) < 0) + fprintf(stderr, "ioctl KDSKBMODE failed!\n"); + + close(ConsoleFD); + + close(kbdpipe[0]); + close(kbdpipe[1]); +} + +void InitializeMouse(void) +{ +#ifdef HAVE_GPM + if(!GpmMouse) +#endif + { + const char *mousedev = getenv("MOUSE"); + if(!mousedev) + mousedev = MOUSEDEV; + if((MouseFD = open(mousedev, O_RDONLY | O_NONBLOCK)) >= 0) { + if(!MouseSpeed) + MouseSpeed = 1; + NumMouseButtons = 3; + return; + } + } +#ifdef HAVE_GPM + { + Gpm_Connect conn; + int c; + conn.eventMask = ~0; /* Want to know about all the events */ + conn.defaultMask = 0; /* don't handle anything by default */ + conn.minMod = 0; /* want everything */ + conn.maxMod = ~0; /* all modifiers included */ + if(Gpm_Open(&conn, 0) != -1) { + if(!MouseSpeed) + MouseSpeed = 8; + NumMouseButtons = 3; + return; + } + fprintf(stderr, "Cannot open gpmctl.\n"); + } +#endif + fprintf(stderr,"Cannot open %s.\n" + "Continuing without Mouse\n", MOUSEDEV); +} + +void CloseMouse(void) +{ +#ifdef HAVE_GPM + if(GpmMouse) { + if(NumMouseButtons) + Gpm_Close(); + } else +#endif + if(MouseFD >= 0) + close(MouseFD); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/internal.h xpsb-glx-0.19/mesa/src/glut/fbdev/internal.h --- xpsb-glx-0.19/mesa/src/glut/fbdev/internal.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/internal.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,177 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include +#include + +#define MULTIHEAD /* enable multihead hacks, + it allows the program to continue drawing + without reading input when a second fbdev + has keyboard focus it can cause + screen corruption that requires C-l to fix */ +#define HAVE_GPM + +#define MAX_VSYNC 200 + +/* this causes these symbols to not be exported */ +#pragma GCC visibility push(hidden) + + +/* --------- fbdev ------------ */ +extern int Redisplay; +extern int Visible; +extern int VisibleSwitch; +extern int Active; +extern int VisiblePoll; +extern int Swapping, VTSwitch; + +void TestVisible(void); +int ParseFBModes(int, int, int, int, int, int); +void SetVideoMode(void); +void CreateBuffer(void); +void CreateVisual(void); + +extern int FrameBufferFD; +extern unsigned char *FrameBuffer; +extern unsigned char *BackBuffer; +extern int DisplayMode; + +extern char exiterror[256]; + +extern struct fb_fix_screeninfo FixedInfo; +extern struct fb_var_screeninfo VarInfo; + +extern GLFBDevContextPtr Context; +extern GLFBDevBufferPtr Buffer; +extern GLFBDevVisualPtr Visual; + +/* --- colormap --- */ +#define REVERSECMAPSIZELOG 3 +#define REVERSECMAPSIZE (1< /dev/null + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# Remove .o and backup files +clean: depend + -rm -f depend depend.bak + -rm -f *.o *~ *.o *~ *.so libglut.so.3.7 + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/menu.c xpsb-glx-0.19/mesa/src/glut/fbdev/menu.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/menu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/menu.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,309 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include +#include + +#include + +#include + +#include "internal.h" + +#define MENU_FONT_WIDTH 9 +#define MENU_FONT_HEIGHT 15 +#define MENU_FONT GLUT_BITMAP_9_BY_15 +#define SUBMENU_OFFSET 20 + +struct GlutMenu *Menus; +int ActiveMenu; +int CurrentMenu; + +static double MenuProjection[16]; + +static int AttachedMenus[3]; +static int NumMenus = 1; +static int SelectedMenu; + +void InitializeMenus(void) +{ + glPushAttrib(GL_TRANSFORM_BIT); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + gluOrtho2D(0.0, VarInfo.xres, VarInfo.yres, 0.0); + glGetDoublev(GL_PROJECTION_MATRIX, MenuProjection); + + glPopMatrix(); + glPopAttrib(); +} + +void FreeMenus(void) +{ + int i, j; + + for(i = 1; i= *y && MouseY < *y + MENU_FONT_HEIGHT && + MouseX >= x && MouseX < x + Menus[menu].width) { + a = 1; + SelectedMenu = menu; + ret = 0; + Menus[menu].selected = i; + glColor3f(1,0,0); + } else + glColor3f(1,1,1); + + *y += MENU_FONT_HEIGHT; + glRasterPos2i(x, *y); + for(; *s; s++) + glutBitmapCharacter(MENU_FONT, *s); + + if(Menus[menu].selected == i) + if(Menus[menu].Items[i].submenu) + if(DrawMenu(Menus[menu].Items[i].submenu, x + + SUBMENU_OFFSET, y)) { + if(!a) + Menus[menu].selected = -1; + } else + ret = 0; + } + return ret; +} + +void DrawMenus(void) +{ + int x, y; + + if(GameMode) + return; + + x = Menus[ActiveMenu].x; + y = Menus[ActiveMenu].y; + + /* save old settings */ + glPushAttrib(GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT + | GL_ENABLE_BIT | GL_VIEWPORT_BIT); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadMatrixd(MenuProjection); + glViewport(0, 0, VarInfo.xres, VarInfo.yres); + + glDisable(GL_DEPTH_TEST); + glDisable(GL_ALPHA_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_FOG); + glDisable(GL_TEXTURE_2D); + glEnable(GL_COLOR_LOGIC_OP); + glLogicOp(GL_AND_REVERSE); + + if(DrawMenu(ActiveMenu, x, &y)) + Menus[ActiveMenu].selected = -1; + + /* restore settings */ + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + + glPopAttrib(); +} + +void OpenMenu(void) +{ + if(MenuStatusFunc) + MenuStatusFunc(GLUT_MENU_IN_USE, MouseX, MouseY); + if(MenuStateFunc) + MenuStateFunc(GLUT_MENU_IN_USE); + Menus[ActiveMenu].x = MouseX-Menus[ActiveMenu].width/2; + + if(Menus[ActiveMenu].x < 0) + Menus[ActiveMenu].x = 0; + if(Menus[ActiveMenu].x + Menus[ActiveMenu].width >= VarInfo.xres) + Menus[ActiveMenu].x = VarInfo.xres - Menus[ActiveMenu].width - 1; + + Menus[ActiveMenu].y = MouseY-Menus[ActiveMenu].NumItems*MENU_FONT_HEIGHT/2; + Menus[ActiveMenu].selected = -1; +} + +void CloseMenu(void) +{ + if(MenuStatusFunc) + MenuStatusFunc(GLUT_MENU_NOT_IN_USE, MouseX, MouseY); + if(MenuStateFunc) + MenuStateFunc(GLUT_MENU_NOT_IN_USE); + if(SelectedMenu > 0) { + int selected = Menus[SelectedMenu].selected; + if(selected >= 0) + if(Menus[SelectedMenu].Items[selected].submenu == 0) + Menus[SelectedMenu].func(Menus[SelectedMenu].Items + [selected].value); + } + +} + +/* glut menu functions */ + +int glutCreateMenu(void (*func)(int value)) +{ + CurrentMenu = NumMenus; + NumMenus++; + Menus = realloc(Menus, sizeof(*Menus) * NumMenus); + Menus[CurrentMenu].NumItems = 0; + Menus[CurrentMenu].Items = NULL; + Menus[CurrentMenu].func = func; + Menus[CurrentMenu].width = 0; + return CurrentMenu; +} + +void glutSetMenu(int menu) +{ + CurrentMenu = menu; +} + +int glutGetMenu(void) +{ + return CurrentMenu; +} + +void glutDestroyMenu(int menu) +{ + if(menu == CurrentMenu) + CurrentMenu = 0; +} + +static void NameMenuEntry(int entry, const char *name) +{ + int cm = CurrentMenu; + if(!(Menus[cm].Items[entry-1].name = realloc(Menus[cm].Items[entry-1].name, + strlen(name) + 1))) { + sprintf(exiterror, "realloc failed in NameMenuEntry\n"); + exit(0); + } + strcpy(Menus[cm].Items[entry-1].name, name); + if(strlen(name) * MENU_FONT_WIDTH > Menus[cm].width) + Menus[cm].width = strlen(name) * MENU_FONT_WIDTH; +} + +static int AddMenuItem(const char *name) +{ + int cm = CurrentMenu; + int item = Menus[cm].NumItems++; + if(!(Menus[cm].Items = realloc(Menus[cm].Items, + Menus[cm].NumItems * sizeof(*Menus[0].Items)))) { + sprintf(exiterror, "realloc failed in AddMenuItem\n"); + exit(0); + } + Menus[cm].Items[item].name = NULL; + NameMenuEntry(item+1, name); + return item; +} + +void glutAddMenuEntry(const char *name, int value) +{ + int item = AddMenuItem(name); + Menus[CurrentMenu].Items[item].value = value; + Menus[CurrentMenu].Items[item].submenu = 0; +} + +void glutAddSubMenu(const char *name, int menu) +{ + int item = AddMenuItem(name); + if(menu == CurrentMenu) { + sprintf(exiterror, "Recursive menus not supported\n"); + exit(0); + } + Menus[CurrentMenu].Items[item].submenu = menu; +} + +void glutChangeToMenuEntry(int entry, const char *name, int value) +{ + NameMenuEntry(entry, name); + Menus[CurrentMenu].Items[entry-1].value = value; + Menus[CurrentMenu].Items[entry-1].submenu = 0; +} + +void glutChangeToSubMenu(int entry, const char *name, int menu) +{ + NameMenuEntry(entry, name); + Menus[CurrentMenu].Items[entry-1].submenu = menu; +} + +void glutRemoveMenuItem(int entry) +{ + memmove(Menus[CurrentMenu].Items + entry - 1, + Menus[CurrentMenu].Items + entry, + sizeof(*Menus[0].Items) * (Menus[CurrentMenu].NumItems - entry)); + Menus[CurrentMenu].NumItems--; +} + +void glutAttachMenu(int button) +{ + AttachedMenus[button] = CurrentMenu; +} + +void glutDetachMenu(int button) +{ + AttachedMenus[button] = 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/overlay.c xpsb-glx-0.19/mesa/src/glut/fbdev/overlay.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/overlay.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/overlay.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include + +void glutEstablishOverlay(void) +{ + exit(0); +} + +void glutUseLayer(GLenum layer) +{ +} + +void glutRemoveOverlay(void) +{ +} + +void glutPostOverlayRedisplay(void) +{ +} + +void glutPostWindowOverlayRedisplay(int win) +{ +} + +void glutShowOverlay(void) +{ +} + +void glutHideOverlay(void) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/state.c xpsb-glx-0.19/mesa/src/glut/fbdev/state.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/state.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/state.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,197 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +#include +#include + +#include + +#include + +#include "../../mesa/main/config.h" + +#include "internal.h" + +int AccumSize = 16; /* per channel size of accumulation buffer */ +int DepthSize = DEFAULT_SOFTWARE_DEPTH_BITS; +int StencilSize = STENCIL_BITS; +int NumSamples = 4; + +int glutGet(GLenum state) +{ + switch(state) { + case GLUT_WINDOW_X: + return 0; + case GLUT_WINDOW_Y: + return 0; + case GLUT_INIT_WINDOW_WIDTH: + case GLUT_WINDOW_WIDTH: + case GLUT_SCREEN_WIDTH: + return VarInfo.xres; + case GLUT_INIT_WINDOW_HEIGHT: + case GLUT_WINDOW_HEIGHT: + case GLUT_SCREEN_HEIGHT: + return VarInfo.yres; + case GLUT_WINDOW_BUFFER_SIZE: + return VarInfo.bits_per_pixel; + case GLUT_WINDOW_STENCIL_SIZE: + return StencilSize; + case GLUT_WINDOW_DEPTH_SIZE: + return DepthSize; + case GLUT_WINDOW_RED_SIZE: + return VarInfo.red.length; + case GLUT_WINDOW_GREEN_SIZE: + return VarInfo.green.length; + case GLUT_WINDOW_BLUE_SIZE: + return VarInfo.green.length; + case GLUT_WINDOW_ALPHA_SIZE: + return VarInfo.transp.length; + case GLUT_WINDOW_ACCUM_RED_SIZE: + case GLUT_WINDOW_ACCUM_GREEN_SIZE: + case GLUT_WINDOW_ACCUM_BLUE_SIZE: + case GLUT_WINDOW_ACCUM_ALPHA_SIZE: + return AccumSize; + case GLUT_WINDOW_DOUBLEBUFFER: + if(DisplayMode & GLUT_DOUBLE) + return 1; + return 0; + case GLUT_WINDOW_RGBA: + if(DisplayMode & GLUT_INDEX) + return 0; + return 1; + case GLUT_WINDOW_PARENT: + return 0; + case GLUT_WINDOW_NUM_CHILDREN: + return 0; + case GLUT_WINDOW_COLORMAP_SIZE: + if(DisplayMode & GLUT_INDEX) + return 256; + return 0; + case GLUT_WINDOW_NUM_SAMPLES: + return NumSamples; + case GLUT_WINDOW_STEREO: + return 0; + case GLUT_WINDOW_CURSOR: + return CurrentCursor; + case GLUT_SCREEN_WIDTH_MM: + return VarInfo.width; + case GLUT_SCREEN_HEIGHT_MM: + return VarInfo.height; + case GLUT_MENU_NUM_ITEMS: + if(CurrentMenu) + return Menus[CurrentMenu].NumItems; + return 0; + case GLUT_DISPLAY_MODE_POSSIBLE: + if((DisplayMode & GLUT_MULTISAMPLE) + || (DisplayMode & GLUT_STEREO) + || (DisplayMode & GLUT_LUMINANCE) + || (DisplayMode & GLUT_ALPHA) && (DisplayMode & GLUT_INDEX)) + return 0; + return 1; + case GLUT_INIT_DISPLAY_MODE: + return DisplayMode; + case GLUT_INIT_WINDOW_X: + case GLUT_INIT_WINDOW_Y: + return 0; + case GLUT_ELAPSED_TIME: + { + static struct timeval tv; + gettimeofday(&tv, 0); + return 1000 * (tv.tv_sec - StartTime.tv_sec) + + (tv.tv_usec - StartTime.tv_usec) / 1000; + } + } + return -1; +} + +int glutLayerGet(GLenum info) +{ + switch(info) { + case GLUT_OVERLAY_POSSIBLE: + return 0; + case GLUT_LAYER_IN_USE: + return GLUT_NORMAL; + case GLUT_HAS_OVERLAY: + return 0; + case GLUT_TRANSPARENT_INDEX: + return -1; + case GLUT_NORMAL_DAMAGED: + return Redisplay; + case GLUT_OVERLAY_DAMAGED: + return -1; + } + return -1; +} + +int glutDeviceGet(GLenum info) +{ + switch(info) { + case GLUT_HAS_KEYBOARD: + return ConsoleFD != -1 ? 1 : 0; + case GLUT_HAS_MOUSE: + case GLUT_NUM_MOUSE_BUTTONS: + return NumMouseButtons; + case GLUT_HAS_SPACEBALL: + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + case GLUT_HAS_TABLET: + return 0; + case GLUT_NUM_SPACEBALL_BUTTONS: + case GLUT_NUM_BUTTON_BOX_BUTTONS: + case GLUT_NUM_DIALS: + case GLUT_NUM_TABLET_BUTTONS: + return 0; + case GLUT_DEVICE_IGNORE_KEY_REPEAT: + return KeyRepeatMode == GLUT_KEY_REPEAT_OFF; + case GLUT_DEVICE_KEY_REPEAT: + return KeyRepeatMode; + case GLUT_JOYSTICK_POLL_RATE: + case GLUT_HAS_JOYSTICK: + case GLUT_JOYSTICK_BUTTONS: + case GLUT_JOYSTICK_AXES: + return 0; + } + return -1; +} + +int glutGetModifiers(void){ + return KeyboardModifiers; +} + +int glutExtensionSupported(const char *extension) +{ + const char *exts = (const char *) glGetString(GL_EXTENSIONS); + const char *start = exts; + int len = strlen(extension); + for(;;) { + const char *p = strstr(exts, extension); + if(!p) + break; + if((p == start || p[-1] == ' ') && (p[len] == ' ' || p[len] == 0)) + return 1; + exts = p + len; + } + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/stroke.c xpsb-glx-0.19/mesa/src/glut/fbdev/stroke.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/stroke.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/stroke.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,81 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + * + * To improve on this library, maybe support subwindows or overlays, + * I (sean at depagnier dot com) will do my best to help. + */ + +#include +#include "glutstroke.h" + +void glutStrokeCharacter(GLUTstrokeFont font, int c) +{ + const StrokeCharRec *ch; + const StrokeRec *stroke; + const CoordRec *coord; + StrokeFontPtr fontinfo = (StrokeFontPtr) font; + int i, j; + + if (c < 0 || c >= fontinfo->num_chars) + return; + ch = &(fontinfo->ch[c]); + if (ch) { + for (i = ch->num_strokes, stroke = ch->stroke; + i > 0; i--, stroke++) { + glBegin(GL_LINE_STRIP); + for (j = stroke->num_coords, coord = stroke->coord; + j > 0; j--, coord++) { + glVertex2f(coord->x, coord->y); + } + glEnd(); + } + glTranslatef(ch->right, 0.0, 0.0); + } +} + +int glutStrokeWidth(GLUTstrokeFont font, int c) +{ + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + + fontinfo = (StrokeFontPtr) font; + + if (c < 0 || c >= fontinfo->num_chars) + return 0; + ch = &(fontinfo->ch[c]); + if (ch) + return ch->right; + + return 0; +} + +int glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) +{ + int length = 0; + + for (; *string; string++) + length += glutStrokeWidth(font, *string); + return length; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/fbdev/vidresize.c xpsb-glx-0.19/mesa/src/glut/fbdev/vidresize.c --- xpsb-glx-0.19/mesa/src/glut/fbdev/vidresize.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/fbdev/vidresize.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,55 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * Copyright (C) 1995-2006 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Library for glut using mesa fbdev driver + * + * Written by Sean D'Epagnier (c) 2006 + */ + +/* Notice, if you know how to implement these functions correctly + please proceed */ + +#include + +#include + +#include "internal.h" + +int glutVideoResizeGet(GLenum param) +{ + return 0; +} + +void glutSetupVideoResizing(void) +{ +} + +void glutStopVideoResizing(void) +{ +} + +void glutVideoResize(int x, int y, int width, int height) +{ +} + +void glutVideoPan(int x, int y, int width, int height) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/ggi/debug.h xpsb-glx-0.19/mesa/src/glut/ggi/debug.h --- xpsb-glx-0.19/mesa/src/glut/ggi/debug.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/ggi/debug.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,259 @@ +/* +****************************************************************************** + + GGIMesa debugging macros + + Copyright (C) 1998-1999 Marcus Sundberg [marcus@ggi-project.org] + Copyright (C) 1999-2000 Jon Taylor [taylorj@ggi-project.org] + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHOR(S) 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 _GGI_GLUT_INTERNAL_DEBUG_H +#define _GGI_GLUT_INTERNAL_DEBUG_H + +#define DEBUG + +#include +#include +#include +#include + + +__BEGIN_DECLS + +/* Exported variables */ +#ifdef BUILDING_GGIGLUT +extern uint32 _ggiglutDebugState; +extern int _ggiglutDebugSync; +#else +IMPORTVAR uint32 _ggiglutDebugState; +IMPORTVAR int _ggiglutDebugSync; +#endif + +__END_DECLS + + +/* Debugging types + * bit 0 is reserved! */ + +#define GGIGLUTDEBUG_CORE (1<<1) /* 2 */ +#define GGIGLUTDEBUG_MODE (1<<2) /* 4 */ +#define GGIGLUTDEBUG_COLOR (1<<3) /* 8 */ +#define GGIGLUTDEBUG_DRAW (1<<4) /* 16 */ +#define GGIGLUTDEBUG_MISC (1<<5) /* 32 */ +#define GGIGLUTDEBUG_LIBS (1<<6) /* 64 */ +#define GGIGLUTDEBUG_EVENTS (1<<7) /* 128 */ + +#define GGIGLUTDEBUG_ALL 0xffffffff + +#ifdef __GNUC__ + +#ifdef DEBUG +#define GGIGLUTDPRINT(form,args...) if (_ggiglutDebugState) { ggDPrintf(_ggiglutDebugSync, "GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_CORE(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_CORE) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_MODE(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_MODE) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_COLOR(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_COLOR) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_DRAW(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_DRAW) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_MISC(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_MISC) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_LIBS(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_LIBS) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#define GGIGLUTDPRINT_EVENTS(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_EVENTS) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } +#else /* DEBUG */ +#define GGIGLUTDPRINT(form,args...) do{}while(0) +#define GGIGLUTDPRINT_CORE(form,args...) do{}while(0) +#define GGIGLUTDPRINT_MODE(form,args...) do{}while(0) +#define GGIGLUTDPRINT_COLOR(form,args...) do{}while(0) +#define GGIGLUTDPRINT_DRAW(form,args...) do{}while(0) +#define GGIGLUTDPRINT_MISC(form,args...) do{}while(0) +#define GGIGLUTDPRINT_LIBS(form,args...) do{}while(0) +#define GGIGLUTDPRINT_EVENTS(form,args...) do{}while(0) +#endif /* DEBUG */ + +#else /* __GNUC__ */ + +__BEGIN_DECLS + +static inline void GGIGLUTDPRINT(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_CORE(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_CORE) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_MODE(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_MODE) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_COLOR(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_COLOR) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_DRAW(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_DRAW) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_MISC(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_MISC) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_LIBS(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_LIBS) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +static inline void GGIGLUTDPRINT_EVENTS(const char *form,...) +{ +#ifdef DEBUG + if (_ggiDebugState & GGIDEBUG_EVENTS) { + va_list args; + + fprintf(stderr, "GGIGLUT: "); + va_start(args, form); + vfprintf(stderr, form, args); + va_end(args); + if (_ggiglutDebugSync) fflush(stderr); + } +#endif +} + +__END_DECLS + +#endif /* __GNUC__ */ + +#ifdef DEBUG +#define GGIGLUT_ASSERT(x,str) \ +{ if (!(x)) { \ + fprintf(stderr,"GGIGLUT:%s:%d: INTERNAL ERROR: %s\n",__FILE__,__LINE__,str); \ + exit(1); \ +} } +#define GGIGLUT_APPASSERT(x,str) \ +{ if (!(x)) { \ + fprintf(stderr,"GGIGLUT:%s:%d: APPLICATION ERROR: %s\n",__FILE__,__LINE__,str); \ + exit(1); \ +} } +#else /* DEBUG */ +#define GGIGLUT_ASSERT(x,str) do{}while(0) +#define GGIGLUT_APPASSERT(x,str) do{}while(0) +#endif /* DEBUG */ + +#ifdef DEBUG +# define GGIGLUTD0(x) x +#else +# define GGIGLUTD0(x) /* empty */ +#endif + +#ifdef GGIGLUTDLEV +# if GGIGLUTDLEV == 1 +# define GGIGLUTD1(x) x +# define GGIGLUTD2(x) /* empty */ +# define GGIGLUTD3(x) /* empty */ +# elif GGIGLUTDLEV == 2 +# define GGIGLUTD1(x) x +# define GGIGLUTD2(x) x +# define GGIGLUTD3(x) /* empty */ +# elif GGIGLUTDLEV > 2 +# define GGIGLUTD1(x) x +# define GGIGLUTD2(x) x +# define GGIGLUTD3(x) x +# endif +#else +# define GGIGLUTD1(x) /* empty */ +# define GGIGLUTD2(x) /* empty */ +# define GGIGLUTD3(x) /* empty */ +#endif + +#endif /* _GGI_MESA_INTERNAL_DEBUG_H */ diff -Nru xpsb-glx-0.19/mesa/src/glut/ggi/ggiglut.c xpsb-glx-0.19/mesa/src/glut/ggi/ggiglut.c --- xpsb-glx-0.19/mesa/src/glut/ggi/ggiglut.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/ggi/ggiglut.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,959 @@ +/* ************************************************************************** + * ggiglut.c + * ************************************************************************** + * + * Copyright (C) 1998 Uwe Maurer - uwe_maurer@t-online.de + * Copyright (C) 1999 James Simmons + * Copyright (C) 1999 Jon Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * ************************************************************************** + * To-do: + * - Make everything use the portable ggi_* types + * + */ + +#define BUILDING_GGIGLUT + +#define WIDTH 640 +#define HEIGHT 480 +#define GRAPHTYPE_RGB GT_16BIT +#define GRAPHTYPE_INDEX GT_8BIT + +/*************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include "GL/ggimesa.h" +#include "debug.h" + +#include +#include + +int _ggiglutDebugSync = 0; +uint32 _ggiglutDebugState = 0; + +char *__glutProgramName = "GGI"; + +static ggi_visual_t __glut_vis; + +static ggi_mesa_context_t __glut_ctx; + +//static int __glut_width = WIDTH; +//static int __glut_height = HEIGHT; +//static ggi_graphtype __glut_gt_rgb = GRAPHTYPE_RGB; +//static ggi_graphtype __glut_gt_index = GRAPHTYPE_INDEX; +static int __glut_width = GGI_AUTO; +static int __glut_height = GGI_AUTO; +static ggi_graphtype __glut_gt_rgb = GT_AUTO; +static ggi_graphtype __glut_gt_index = GT_8BIT; +static int __glut_init = GL_FALSE; + +static int mousex = WIDTH / 2; +static int mousey = HEIGHT / 2; +static int mouse_moved = GL_FALSE; +static int mouse_down = GL_FALSE; +static int mouse_showcursor = GL_FALSE; + +static void (*__glut_reshape)(int, int); +static void (*__glut_display)(void); +static void (*__glut_idle)(void); +static void (*__glut_keyboard)(unsigned char, int, int); +static void (*__glut_special)(int, int, int); +static void (*__glut_mouse)(int, int, int, int); +static void (*__glut_motion)(int, int); +static void (*__glut_passive_motion)(int, int); +static void (*__glut_visibility)(int); + +static unsigned int __glut_mode = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH; + +static int __glut_mod_keys = 0; + +static int __glut_redisplay = GL_FALSE; + +/* Menu */ +static int __glut_menubutton = -1; +static int __glut_menuactive = GL_FALSE; + +#define MAX_ENTRIES 64 + +typedef struct menu_s +{ + char *label[MAX_ENTRIES]; + int value[MAX_ENTRIES]; + struct menu_s * submenu[MAX_ENTRIES]; + void (*func)(int); + int max_strlen; + int num_entries; +} menu_t; + +static menu_t *mainmenu; +static menu_t *curmenu; +static menu_t *activemenu; + +void glutInit(int *argc, char **argv) +{ + ggi_graphtype gt; + int i, k; + char *str; + + GGIGLUTDPRINT_CORE("glutInit() called\n"); + + #define REMOVE {for (k=i;k<*argc-1;k++) argv[k]=argv[k+1]; \ + (*argc)--; i--; } + + if (__glut_init) return; + + str = getenv("GGIGLUT_DEBUG"); + if (str != NULL) { + _ggiglutDebugState = atoi(str); + fprintf(stderr, "Debugging=%d\n", _ggiglutDebugState); + GGIGLUTDPRINT_CORE("Debugging=%d\n", _ggiglutDebugState); + } + + str = getenv("GGIGLUT_DEBUGSYNC"); + if (str != NULL) { + _ggiglutDebugSync = 1; + } + + if (argc && argv) + { + + for (i = 1; i < *argc; i++) + { + if (strcmp(argv[i], "-mouse") == 0) + { + mouse_showcursor = GL_TRUE; + REMOVE; + } + else + if (strcmp(argv[i], "-bpp") == 0 && (i + 1) < (*argc)) + { + switch(atoi(argv[i + 1])) + { + case 4: gt = GT_4BIT; break; + case 8: gt = GT_8BIT; break; + case 15: gt = GT_15BIT; break; + case 16: gt = GT_16BIT; break; + case 24: gt = GT_24BIT; break; + case 32: gt = GT_32BIT; break; + default: + ggiPanic("\"%s\" bits per pixel?\n", argv[i+1]); + } + __glut_gt_rgb = __glut_gt_index = gt; + REMOVE; + REMOVE; + } + else + if (strcmp(argv[i], "-size") == 0 && (i + 2) < (*argc)) + { + __glut_width = atoi(argv[i + 1]); + __glut_height = atoi(argv[i + 2]); + REMOVE; + REMOVE; + REMOVE; + } + } + } + + if (ggiInit() < 0) + { + ggiPanic("ggiInit() failed!\n"); + } + __glut_init = GL_TRUE; + +#undef REMOVE +} + +void glutInitWindowPosition(int x, int y) +{ + GGIGLUTDPRINT_CORE("glutInitWindowPosition() called\n"); +} + +void glutInitWindowSize(int x, int y) +{ + GGIGLUTDPRINT_CORE("glutInitWindowsSize() called\n"); +} + +void glutFullScreen(void) +{ + GGIGLUTDPRINT_CORE("glutFullScreen() called\n"); +} + +void glutInitDisplayMode(unsigned int mode) +{ + GGIGLUTDPRINT_CORE("glutInitDisplayMode() called\n"); + + __glut_mode = mode; +} + +void glutInitDisplayString(const char *string) +{ + GGIGLUTDPRINT_CORE("glutInitDisplayString(%s) called\n", string); +} + +int glutCreateWindow(const char *title) +{ + ggi_graphtype gt; + ggi_mode mode = + { + 1, + { GGI_AUTO, GGI_AUTO }, + { GGI_AUTO, GGI_AUTO }, + { 0, 0 }, + GT_AUTO, + { GGI_AUTO, GGI_AUTO } + }; + int frames; + int rgb; + int err; + + GGIGLUTDPRINT_CORE("glutCreateWindow() called\n"); + + if (!__glut_init) + glutInit(NULL, NULL); + + GGIGLUTDPRINT("GGIGLUT: %s\n", title); + + rgb = !(__glut_mode & GLUT_INDEX); + frames = (__glut_mode & GLUT_DOUBLE) ? 2 : 1; + + gt = (rgb) ? __glut_gt_rgb : __glut_gt_index; + + __glut_vis = ggiOpen(NULL); + if (__glut_vis == NULL) + { + ggiPanic("ggiOpen() failed!\n"); + /* return GL_FALSE; */ + } + + ggiSetFlags(__glut_vis, GGIFLAG_ASYNC); + + ggiCheckMode(__glut_vis, &mode); + + err = ggiSetMode(__glut_vis, &mode); + if (err < 0) + { + ggiPanic("Can't set graphic mode!\n"); + /* return GL_FALSE; */ + } + + if (ggiMesaExtendVisual(__glut_vis, GL_FALSE, GL_FALSE, + 16, 0, 0, 0, 0, 0, 1) < 0) + { + ggiPanic("GGIMesaSetVisual failed!\n"); + } + + __glut_ctx = ggiMesaCreateContext(__glut_vis); + + if (__glut_ctx == NULL) + ggiPanic("Can't create mesa-context\n"); + + ggiGetMode(__glut_vis, &mode); + + + __glut_width = mode.visible.x; + __glut_height = mode.visible.y; + + mousex = mode.visible.x / 2; + mousey = mode.visible.y / 2; + + ggiMesaMakeCurrent(__glut_ctx, __glut_vis); + + if (__glut_reshape) + __glut_reshape(__glut_width, __glut_height); + + return GL_TRUE; +} + +void glutReshapeFunc(void (*func)(int, int)) +{ + GGIGLUTDPRINT_CORE("glutReshapeFunc() called\n"); + + __glut_reshape = func; + if (__glut_vis && __glut_reshape) + __glut_reshape(__glut_width, __glut_height); +} + +void glutKeyboardFunc(void (*keyboard)(unsigned char key, int x, int y)) +{ + GGIGLUTDPRINT_CORE("glutKeyBoardFunc() called\n"); + + __glut_keyboard = keyboard; +} + +int glutGetModifiers(void) +{ + GGIGLUTDPRINT_CORE("glutGetModifiers() called\n"); + + return __glut_mod_keys; +} + +void glutEntryFunc(void (*func)(int state)) +{ + GGIGLUTDPRINT_CORE("glutEntryFunc() called\n"); +} + +void glutVisibilitFunc(void (*func)(int state)) +{ + GGIGLUTDPRINT_CORE("glutVisibilityFunc() called\n"); +} + +void glutTimerFunc(unsigned int millis, void (*func)(int value), int value) +{ + GGIGLUTDPRINT_CORE("glutTimerFunc() called\n"); +} + +void glutMenuStateFunc(void (*func)(int state)) +{ + GGIGLUTDPRINT_CORE("glutMenuStateFunc() called\n"); +} + +int glutGet(GLenum type) +{ + GGIGLUTDPRINT_CORE("glutGet() called\n"); + + switch(type) + { + case GLUT_WINDOW_X: + return 0; + case GLUT_WINDOW_Y: + return 0; + case GLUT_WINDOW_WIDTH: + return __glut_width; + case GLUT_WINDOW_HEIGHT: + return __glut_height; + case GLUT_MENU_NUM_ITEMS: + if (curmenu) + return curmenu->num_entries; + else + return 0; + default: + GGIGLUTDPRINT("glutGet: unknown type %i\n", type); + } + return 0; +} + +void glutSpecialFunc(void (*special)(int key, int x, int y)) +{ + GGIGLUTDPRINT_CORE("glutSpecialFunc() called\n"); + + __glut_special=special; +} + +void glutDisplayFunc(void (*disp)(void)) +{ + GGIGLUTDPRINT_CORE("glutDisplayFunc() called\n"); + __glut_display=disp; +} + +void glutSetColor(int index, GLfloat red, GLfloat green, GLfloat blue) +{ + ggi_color c; + GLfloat max; + + GGIGLUTDPRINT_CORE("glutSetColor() called\n"); + + if (red > 1.0) red = 1.0; + if (red < 0.0) red = 0.0; + if (green > 1.0) green = 1.0; + if (green < 0.0) green = 0.0; + if (blue > 1.0) blue = 1.0; + if (blue < 0.0) blue = 0.0; + + max = (float)((1 << GGI_COLOR_PRECISION) - 1); + + c.r = (int)(max * red); + c.g = (int)(max * green); + c.b = (int)(max * blue); + ggiSetPalette(__glut_vis, index, 1, &c); +} + +void glutPostRedisplay(void) +{ + GGIGLUTDPRINT_CORE("glutPostRedisplay() called\n"); + + __glut_redisplay = GL_TRUE; +} + +void glutPostWindowRedisplay(int win) +{ + GGIGLUTDPRINT_CORE("glutPostWindowRedisplay() called\n"); + + __glut_redisplay = GL_TRUE; +} + +void glutSwapBuffers(void) +{ + GGIGLUTDPRINT_CORE("glutSwapBuffers() called\n"); + + ggiMesaSwapBuffers(); +} + +void glutIdleFunc(void (*idle)(void)) +{ + GGIGLUTDPRINT_CORE("glutIdleFunc() called\n"); + + __glut_idle = idle; +} + +static void keyboard(ggi_event *ev) +{ + int sym; + int modifer = 0, key = 0; + + GGIGLUTDPRINT_CORE("keyboard() called\n"); + + sym = ev->key.sym; + + modifer = ev->key.modifiers; + if (modifer == GII_KM_SHIFT) + __glut_mod_keys |= GLUT_ACTIVE_SHIFT; + if (modifer == GII_KM_CTRL) + __glut_mod_keys |= GLUT_ACTIVE_CTRL; + if (modifer == GII_KM_ALT) + __glut_mod_keys |= GLUT_ACTIVE_ALT; + + /* if (__glut_special && key) __glut_special(GII_KTYP(key),0,0); */ + + if (__glut_keyboard) +// __glut_keyboard(GII_UNICODE(sym), 0, 0); + __glut_keyboard(sym, 0, 0); +} + +static void mouseabs(ggi_event *ev) +{ + int oldx = mousex; + int oldy = mousey; + + mousex = ev->pmove.x; + mousey = ev->pmove.y; + + if (mousex < 0) mousex = 0; + if (mousey < 0) mousey = 0; + if (mousex >= __glut_width) mousex = __glut_width - 1; + if (mousey >= __glut_height) mousey = __glut_height - 1; + + if (mousex != oldx || mousey != oldy) mouse_moved = GL_TRUE; +} + +static void mouse(ggi_event *ev) +{ + int oldx = mousex; + int oldy = mousey; + + GGIGLUTDPRINT_CORE("mouse() called\n"); + + mousex += ev->pmove.x >> 1; + mousey += ev->pmove.y >> 1; + + if (mousex < 0) mousex = 0; + if (mousey < 0) mousey = 0; + if (mousex >= __glut_width) mousex = __glut_width - 1; + if (mousey >= __glut_height) mousey = __glut_height - 1; + + if (mousex != oldx || mousey != oldy) mouse_moved = GL_TRUE; + +} + +static void showmenu(void); +static int clickmenu(void); +static void updatemouse(void); +static void drawmouse(void); + +static void mousemove(void) +{ + GGIGLUTDPRINT_CORE("mousemove() called\n"); + + if (mouse_moved) { + if (__glut_motion && mouse_down) { + __glut_motion(mousex,mousey); + } + + if (__glut_passive_motion && (!mouse_down)) { + __glut_passive_motion(mousex,mousey); + } + + if (__glut_menuactive) updatemouse(); + mouse_moved=GL_FALSE; + } +} + +static void button(ggi_event *ev) +{ + int i; + int btn[4] = { + 0, + GLUT_LEFT_BUTTON, + GLUT_RIGHT_BUTTON, + GLUT_MIDDLE_BUTTON + }; + + GGIGLUTDPRINT_CORE("button() called\n"); + + mousemove(); + + if (ev->pbutton.button <= 3) { /* GGI can have >3 buttons ! */ + char state = ev->any.type == evPtrButtonPress ? GLUT_DOWN : GLUT_UP; + if (__glut_menuactive) { + if (state == GLUT_UP && clickmenu()) { + glutPostRedisplay(); + __glut_menuactive = GL_FALSE; + } + } else + if (btn[ev->pbutton.button] == __glut_menubutton) { + __glut_menuactive = GL_TRUE; + activemenu = mainmenu; + showmenu(); + } else + if (__glut_mouse) { + __glut_mouse(btn[ev->pbutton.button], state, mousex, mousey); + } + if (state == GLUT_DOWN) { + mouse_down |= (1 << (ev->pbutton.button - 1)); + } + else mouse_down &= ~( 1 << (ev->pbutton.button - 1)); + } +} + +void glutMainLoop(void) +{ + ggi_event ev; + ggi_event_mask evmask = (emKeyPress | emKeyRepeat | emPtrMove | emPtrButton); + + GGIGLUTDPRINT_CORE("glutMainLoop() called\n"); + + ggiSetEventMask(__glut_vis, evmask); + + glutPostRedisplay(); + + if (__glut_visibility) + __glut_visibility(GLUT_VISIBLE); + + while (1) + { + if (!__glut_menuactive) + { + if (__glut_idle) + __glut_idle(); + if (__glut_redisplay && __glut_display) + { + __glut_redisplay = GL_FALSE; + __glut_display(); + } + } + + while (1) + { + struct timeval t = {0, 0}; + + if (ggiEventPoll(__glut_vis, evmask, &t) == 0) + break; + + ggiEventRead(__glut_vis, &ev, evmask); + + switch (ev.any.type) + { + case evKeyPress: + case evKeyRepeat: + keyboard(&ev); + break; + case evPtrAbsolute: + mouseabs(&ev); + break; + case evPtrRelative: + mouse(&ev); + break; + case evPtrButtonPress: + case evPtrButtonRelease: + button(&ev); + break; + } + } + mousemove(); + } +} + +static void showmenu() +{ + int y,i; + ggi_color col = { 0xffff, 0xffff, 0xffff }; + + GGIGLUTDPRINT_CORE("showmenu() called\n"); + + ggiSetGCForeground(__glut_vis,ggiMapColor(__glut_vis,&col)); + ggiSetOrigin(__glut_vis,0,0); + + for (y = i = 0; i < activemenu->num_entries; i++, y += 8) { + ggiPuts(__glut_vis, 0, y, activemenu->label[i]); + } + drawmouse(); +} + +static int clickmenu(void) +{ + int i; + int w, h; + + GGIGLUTDPRINT_CORE("clickmenu() called\n"); + + i = mousey / 8; + + if (i >= activemenu->num_entries) return GL_TRUE; + if (mousex >= 8 * strlen(activemenu->label[i])) return GL_TRUE; + + if (activemenu->submenu[i]) { + ggi_color col={0,0,0}; + ggiSetGCForeground(__glut_vis,ggiMapColor(__glut_vis,&col)); + h=activemenu->num_entries*8; + w=activemenu->max_strlen*8; + ggiDrawBox(__glut_vis,0,0,w,h); + activemenu=activemenu->submenu[i]; + showmenu(); + return GL_FALSE; + } + curmenu=activemenu; + activemenu->func(activemenu->value[i]); + return GL_TRUE; +} + +static int oldx=-1; +static int oldy=-1; +static char buffer[16*16*4]; + +static void updatemouse() +{ + GGIGLUTDPRINT_CORE("updatemouse() called\n"); + + ggiPutBox(__glut_vis,oldx,oldy,16,16,buffer); + drawmouse(); +} + +static void drawmouse() +{ + int x,y; + + GGIGLUTDPRINT_CORE("drawmouse() called\n"); + + x=mousex-8; + if (x<0) x=0; + y=mousey-8; + if (y<0) y=0; + ggiGetBox(__glut_vis,x,y,16,16,buffer); + ggiDrawLine(__glut_vis,mousex-2,mousey,mousex+2,mousey); + ggiDrawLine(__glut_vis,mousex,mousey-2,mousex,mousey+2); + oldx=x; + oldy=y; +} + +int glutCreateMenu(void(*func)(int)) +{ + menu_t *m; + + GGIGLUTDPRINT_CORE("glutCreateMenu() called\n"); + + m=malloc(sizeof(menu_t)); + memset(m,0,sizeof(menu_t)); + curmenu=m; + curmenu->func=func; + return (int)curmenu; +} + +static void addEntry(const char *label,int value,menu_t *submenu) +{ + int i=curmenu->num_entries; + + GGIGLUTDPRINT_CORE("addEntry() called\n"); + + /* printf("%i %i %s %p\n",i,value,label,submenu); */ + if (ilabel[i]=strdup(label); + curmenu->value[i]=value; + curmenu->submenu[i]=submenu; + + if (strlen(label)>curmenu->max_strlen) + curmenu->max_strlen=strlen(label); + curmenu->num_entries++; + } +} + +void glutAddMenuEntry(const char *label,int value) +{ + GGIGLUTDPRINT_CORE("glutAddMenuEntry() called\n"); + + addEntry(label,value,NULL); +} + +void glutAddSubMenu(const char *label,int submenu) +{ + char text[100]; + + GGIGLUTDPRINT_CORE("glutAddSubMenu() called\n"); + + if (!curmenu) return; + strncpy(text,label,98); + text[98]=0; + text[strlen(text)+1]=0; + text[strlen(text)]='>'; + + addEntry(text,0,(menu_t *) submenu); +} + +void glutAttachMenu(int button) +{ + GGIGLUTDPRINT_CORE("glutAttachMenu() called\n"); + + mainmenu=curmenu; + __glut_menubutton=button; +} + +void glutDetachMenu(int button) +{ + GGIGLUTDPRINT_CORE("glutDetachMenu() called\n"); +} + +void glutVisibilityFunc(void (*func)(int state)) +{ + GGIGLUTDPRINT_CORE("glutVisibilityFunc() called\n"); + + __glut_visibility=func; +} + +void glutMouseFunc(void (*mouse)(int, int, int, int)) +{ + GGIGLUTDPRINT_CORE("glutMouseFunc() called\n"); + + __glut_mouse=mouse; +} + +void glutMotionFunc(void (*motion)(int,int)) +{ + GGIGLUTDPRINT_CORE("glutMotionFunc() called\n"); + + __glut_motion=motion; +} + +void glutPassiveMotionFunc(void (*motion)(int,int)) +{ + GGIGLUTDPRINT_CORE("glutPassiveMotionFunc() called\n"); + + __glut_passive_motion=motion; +} + +void glutSetWindowTitle(const char *title) +{ + GGIGLUTDPRINT_CORE("glutSetWindowTitle() called\n"); +} + +void glutSetIconTitle(const char *title) +{ + GGIGLUTDPRINT_CORE("glutSetIconTitle() called\n"); +} + +void glutChangeToMenuEntry(int item,const char *label,int value) +{ + GGIGLUTDPRINT_CORE("glutChangeToMenuEntry() called\n"); + + if (item>0 && item<=curmenu->num_entries) { + item--; + free(curmenu->label[item]); + curmenu->label[item]=strdup(label); + curmenu->value[item]=value; + curmenu->submenu[item]=NULL; + } +} +void glutChangeToSubMenu(int item,const char *label,int submenu) +{ + GGIGLUTDPRINT_CORE("glutChengeToSubMenu() called\n"); + + if (item>0 && item<=curmenu->num_entries) { + item--; + free(curmenu->label[item]); + curmenu->label[item]=strdup(label); + curmenu->value[item]=0; + curmenu->submenu[item]=(menu_t *)submenu; + } +} + +void glutDestroyMenu(int menu) +{ + menu_t *m=(menu_t *)menu; + int i; + + GGIGLUTDPRINT_CORE("glutDestroyMenu() called\n"); + + for (i=0;inum_entries;i++) { + free(m->label[i]); + } + free(m); +} + +int glutCreateSubWindow(int win,int x,int y,int w,int h) +{ + GGIGLUTDPRINT_CORE("glutCreateSubWindow() called\n"); + + return 0; +} + +void glutDestroyWindow(int win) +{ + GGIGLUTDPRINT_CORE("glutDestroyWindow() called\n"); +} + +int glutGetWindow(void) +{ + GGIGLUTDPRINT_CORE("glutGetWindow() called\n"); + + return 0; +} + +void glutSetWindow(int win) +{ + GGIGLUTDPRINT_CORE("glutSetWindow() called\n"); +} + +void glutPositionWindow(int x,int y) +{ + GGIGLUTDPRINT_CORE("glutPositionWindow() called\n"); +} + +void glutReshapeWindow(int x,int y) +{ + GGIGLUTDPRINT_CORE("glutReshapeWindow() called\n"); +} + +void glutPushWindow(void) +{ + GGIGLUTDPRINT_CORE("glutPushWindow() called\n"); +} + +void glutPopWindow(void) +{ + GGIGLUTDPRINT_CORE("glutPopWindow() called\n"); +} + +void glutIconifyWindow(void) +{ + GGIGLUTDPRINT_CORE("glutIconifyWindow() called\n"); +} + +void glutShowWindow() +{ + GGIGLUTDPRINT_CORE("glutShowWindow() called\n"); +} + +void glutHideWindow() +{ + GGIGLUTDPRINT_CORE("glutHideWindow() called\n"); +} + +void glutSetCursor(int cursor) +{ + GGIGLUTDPRINT_CORE("glutSetCursor() called\n"); +} + +void glutWarpPointer(int x,int y) +{ + GGIGLUTDPRINT_CORE("glutWarpPointer() called\n"); +} + +void glutEstablishOverlay(void) +{ + GGIGLUTDPRINT_CORE("glutEstablishOverlay() called\n"); +} + +void glutRemoveOverlay(void) +{ + GGIGLUTDPRINT_CORE("glutRemoveOverlay() called\n"); +} + +void glutUseLayer(GLenum layer) +{ + GGIGLUTDPRINT_CORE("glutUseLayer() called\n"); +} + +int glutLayerGet(GLenum type) +{ + GGIGLUTDPRINT_CORE("glutLayerGet() called\n"); + return 0; +} + +void glutPostOverlayRedisplay(void) +{ + GGIGLUTDPRINT_CORE("glutPostOverlayRedisplay() called\n"); +} + +void glutPostWindowOverlayRedisplay(int w) +{ + GGIGLUTDPRINT_CORE("glutPostWindowOverlayRedisplay() called\n"); +} + +void glutShowOverlay(void) +{ + GGIGLUTDPRINT_CORE("glutShowOverlay() called\n"); +} + +void glutHideOverlay(void) +{ + GGIGLUTDPRINT_CORE("glutHideOverlay() called\n"); +} + +int glutGetMenu(void) +{ + GGIGLUTDPRINT_CORE("glutGetMenu() called\n"); + return 0; +} + +void glutSetMenu(int menu) +{ + GGIGLUTDPRINT_CORE("glutSetMenu() called\n"); +} + +void glutRemoveMenuItem(int item) +{ + GGIGLUTDPRINT_CORE("glutRemoveMenuItem() called\n"); +} + +void glutSpaceBallMotionFunc(void (*func)(int key,int x,int y)) +{ + GGIGLUTDPRINT_CORE("glutSpaceBallMotionFunc() called\n"); +} + +void glutSpaceBallRotateFunc(void (*func)(int x,int y,int z)) +{ + GGIGLUTDPRINT_CORE("glutSpaceBallRotateFunc() called\n"); +} + +void glutSpaceBallButtonFunc(void (*func)(int button,int state)) +{ + GGIGLUTDPRINT_CORE("glutSpaceBallButtonFunc() called\n"); +} + +void glutCopyColormap(int win) +{ + GGIGLUTDPRINT_CORE("glutCopyColormap() called\n"); +} + +int glutDeviceGet(GLenum param) +{ + GGIGLUTDPRINT_CORE("glutDeviceGet() called\n"); + + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/ggi/Makefile xpsb-glx-0.19/mesa/src/glut/ggi/Makefile --- xpsb-glx-0.19/mesa/src/glut/ggi/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/ggi/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,52 @@ +# Makefile for GLUT for ggi + +TOP = ../../.. + +include $(TOP)/configs/current + + +##### MACROS ##### + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 1 + +SOURCES = \ + ggiglut.c + + +OBJECTS = $(SOURCES:.c=.o) + + +##### RULES ##### + +.c.o: + $(CC) -c -I$(TOP)/include $(CFLAGS) $(GLUT_CFLAGS) $< + + + +##### TARGETS ##### + +default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + + +# Make the library +$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \ + -patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + $(GLUT_LIB_DEPS) $(OBJECTS) + + +clean: + -rm -f *.o *~ + -rm -f *.lo + -rm -f *.la + -rm -rf .libs + + +depend: $(SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(SOURCES) + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/capturexfont.c xpsb-glx-0.19/mesa/src/glut/glx/capturexfont.c --- xpsb-glx-0.19/mesa/src/glut/glx/capturexfont.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/capturexfont.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,356 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* capturexfont.c connects to an X server and downloads a + bitmap font from which a C source file is generated, + encoding the font for GLUT's use. Example usage: + capturexfont.c 9x15 glutBitmap9By15 > glut_9x15.c */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#define MAX_GLYPHS_PER_GRAB 512 /* This is big enough for 2^9 + glyph character sets */ + +static void +outputChar(int num, int width, int height, + int xoff, int yoff, int advance, int data) +{ + if (width == 0 || height == 0) { + printf("#ifdef _WIN32\n"); + printf("/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with\n"); + printf(" a height or width of zero does not advance the raster position\n"); + printf(" as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */\n"); + printf("static const GLubyte ch%ddata[] = { 0x0 };\n", num); + printf("static const BitmapCharRec ch%d = {", num); + printf("%d,", 0); + printf("%d,", 0); + printf("%d,", xoff); + printf("%d,", yoff); + printf("%d,", advance); + printf("ch%ddata", num); + printf("};\n"); + printf("#else\n"); + } + printf("static const BitmapCharRec ch%d = {", num); + printf("%d,", width); + printf("%d,", height); + printf("%d,", xoff); + printf("%d,", yoff); + printf("%d,", advance); + if (data) { + printf("ch%ddata", num); + } else { + printf("0"); + } + printf("};\n"); + if (width == 0 || height == 0) { + printf("#endif\n"); + } + printf("\n"); +} + +/* Can't just use isprint because it only works for the range + of ASCII characters (ie, TRUE for isascii) and capturexfont + might be run on 16-bit fonts. */ +#define PRINTABLE(ch) (isascii(ch) ? isprint(ch) : 0) + +void +captureXFont(Display * dpy, Font font, char *xfont, char *name) +{ + int first, last, count; + int cnt, len; + Pixmap offscreen; + Window drawable; + XFontStruct *fontinfo; + XImage *image; + GC xgc; + XGCValues values; + int width, height; + int i, j, k; + XCharStruct *charinfo; + XChar2b character; + GLubyte *bitmapData; + int x, y; + int spanLength; + int charWidth, charHeight, maxSpanLength, pixwidth; + int grabList[MAX_GLYPHS_PER_GRAB]; + int glyphsPerGrab = MAX_GLYPHS_PER_GRAB; + int numToGrab; + int rows, pages, byte1, byte2, index; + int nullBitmap; + + drawable = RootWindow(dpy, DefaultScreen(dpy)); + + fontinfo = XQueryFont(dpy, font); + pages = fontinfo->max_char_or_byte2 - fontinfo->min_char_or_byte2 + 1; + first = (fontinfo->min_byte1 << 8) + fontinfo->min_char_or_byte2; + last = (fontinfo->max_byte1 << 8) + fontinfo->max_char_or_byte2; + count = last - first + 1; + + width = fontinfo->max_bounds.rbearing - + fontinfo->min_bounds.lbearing; + height = fontinfo->max_bounds.ascent + + fontinfo->max_bounds.descent; + /* 16-bit fonts have more than one row; indexing into + per_char is trickier. */ + rows = fontinfo->max_byte1 - fontinfo->min_byte1 + 1; + + maxSpanLength = (width + 7) / 8; + /* For portability reasons we don't use alloca for + bitmapData, but we could. */ + bitmapData = malloc(height * maxSpanLength); + /* Be careful determining the width of the pixmap; the X + protocol allows pixmaps of width 2^16-1 (unsigned short + size) but drawing coordinates max out at 2^15-1 (signed + short size). If the width is too large, we need to limit + the glyphs per grab. */ + if ((glyphsPerGrab * 8 * maxSpanLength) >= (1 << 15)) { + glyphsPerGrab = (1 << 15) / (8 * maxSpanLength); + } + pixwidth = glyphsPerGrab * 8 * maxSpanLength; + offscreen = XCreatePixmap(dpy, drawable, pixwidth, height, 1); + + values.font = font; + values.background = 0; + values.foreground = 0; + xgc = XCreateGC(dpy, offscreen, + GCFont | GCBackground | GCForeground, &values); + XFillRectangle(dpy, offscreen, xgc, 0, 0, + 8 * maxSpanLength * glyphsPerGrab, height); + XSetForeground(dpy, xgc, 1); + + numToGrab = 0; + if (fontinfo->per_char == NULL) { + charinfo = &(fontinfo->min_bounds); + charWidth = charinfo->rbearing - charinfo->lbearing; + charHeight = charinfo->ascent + charinfo->descent; + spanLength = (charWidth + 7) / 8; + } + printf("\n/* GENERATED FILE -- DO NOT MODIFY */\n\n"); + printf("#include \"glutbitmap.h\"\n\n"); + for (i = first; count; i++, count--) { + int undefined; + if (rows == 1) { + undefined = (fontinfo->min_char_or_byte2 > i || + fontinfo->max_char_or_byte2 < i); + } else { + byte2 = i & 0xff; + byte1 = i >> 8; + undefined = (fontinfo->min_char_or_byte2 > byte2 || + fontinfo->max_char_or_byte2 < byte2 || + fontinfo->min_byte1 > byte1 || + fontinfo->max_byte1 < byte1); + + } + if (undefined) { + goto PossiblyDoGrab; + } + if (fontinfo->per_char != NULL) { + if (rows == 1) { + index = i - fontinfo->min_char_or_byte2; + } else { + byte2 = i & 0xff; + byte1 = i >> 8; + index = + (byte1 - fontinfo->min_byte1) * pages + + (byte2 - fontinfo->min_char_or_byte2); + } + charinfo = &(fontinfo->per_char[index]); + charWidth = charinfo->rbearing - charinfo->lbearing; + charHeight = charinfo->ascent + charinfo->descent; + if (charWidth == 0 || charHeight == 0) { + if (charinfo->width != 0) { + /* Still must move raster pos even if empty character + + */ + outputChar(i, 0, 0, 0, 0, charinfo->width, 0); + } + goto PossiblyDoGrab; + } + } + grabList[numToGrab] = i; + character.byte2 = i & 255; + character.byte1 = i >> 8; + + /* XXX We could use XDrawImageString16 which would also + paint the backing rectangle but X server bugs in some + scalable font rasterizers makes it more effective to do + XFillRectangles to clear the pixmap and then + XDrawImage16 for the text. */ + XDrawString16(dpy, offscreen, xgc, + -charinfo->lbearing + 8 * maxSpanLength * numToGrab, + charinfo->ascent, &character, 1); + + numToGrab++; + + PossiblyDoGrab: + + if (numToGrab >= glyphsPerGrab || count == 1) { + image = XGetImage(dpy, offscreen, + 0, 0, pixwidth, height, 1, XYPixmap); + for (j = numToGrab - 1; j >= 0; j--) { + if (fontinfo->per_char != NULL) { + byte2 = grabList[j] & 0xff; + byte1 = grabList[j] >> 8; + index = + (byte1 - fontinfo->min_byte1) * pages + + (byte2 - fontinfo->min_char_or_byte2); + charinfo = &(fontinfo->per_char[index]); + charWidth = charinfo->rbearing - charinfo->lbearing; + charHeight = charinfo->ascent + charinfo->descent; + spanLength = (charWidth + 7) / 8; + } + memset(bitmapData, 0, height * spanLength); + for (y = 0; y < charHeight; y++) { + for (x = 0; x < charWidth; x++) { + if (XGetPixel(image, j * maxSpanLength * 8 + x, + charHeight - 1 - y)) { + /* Little endian machines (such as DEC Alpha) + could benefit from reversing the bit order + here and changing the GL_UNPACK_LSB_FIRST + parameter in glutBitmapCharacter to GL_TRUE. */ + bitmapData[y * spanLength + x / 8] |= + (1 << (7 - (x & 7))); + } + } + } + if (PRINTABLE(grabList[j])) { + printf("/* char: 0x%x '%c' */\n\n", + grabList[j], grabList[j]); + } else { + printf("/* char: 0x%x */\n\n", grabList[j]); + } + + /* Determine if the bitmap is null. */ + nullBitmap = 1; + len = (charinfo->ascent + charinfo->descent) * + ((charinfo->rbearing - charinfo->lbearing + 7) / 8); + cnt = 0; + while (cnt < len) { + for (k = 0; k < 16 && cnt < len; k++, cnt++) { + if (bitmapData[cnt] != 0) { + nullBitmap = 0; + } + } + } + + if (!nullBitmap) { + printf("static const GLubyte ch%ddata[] = {\n", grabList[j]); + len = (charinfo->ascent + charinfo->descent) * + ((charinfo->rbearing - charinfo->lbearing + 7) / 8); + cnt = 0; + while (cnt < len) { + for (k = 0; k < 16 && cnt < len; k++, cnt++) { + printf("0x%x,", bitmapData[cnt]); + } + printf("\n"); + } + printf("};\n\n"); + } else { + charWidth = 0; + charHeight = 0; + } + + outputChar(grabList[j], charWidth, charHeight, + -charinfo->lbearing, charinfo->descent, + charinfo->width, !nullBitmap); + } + XDestroyImage(image); + numToGrab = 0; + if (count > 0) { + XSetForeground(dpy, xgc, 0); + XFillRectangle(dpy, offscreen, xgc, 0, 0, + 8 * maxSpanLength * glyphsPerGrab, height); + XSetForeground(dpy, xgc, 1); + } + } + } + XFreeGC(dpy, xgc); + XFreePixmap(dpy, offscreen); + /* For portability reasons we don't use alloca for + bitmapData, but we could. */ + free(bitmapData); + + printf("static const BitmapCharRec * const chars[] = {\n"); + for (i = first; i <= last; i++) { + int undefined; + byte2 = i & 0xff; + byte1 = i >> 8; + undefined = (fontinfo->min_char_or_byte2 > byte2 || + fontinfo->max_char_or_byte2 < byte2 || + fontinfo->min_byte1 > byte1 || + fontinfo->max_byte1 < byte1); + if (undefined) { + printf("0,\n"); + } else { + if (fontinfo->per_char != NULL) { + if (rows == 1) { + index = i - fontinfo->min_char_or_byte2; + } else { + byte2 = i & 0xff; + byte1 = i >> 8; + index = + (byte1 - fontinfo->min_byte1) * pages + + (byte2 - fontinfo->min_char_or_byte2); + } + charinfo = &(fontinfo->per_char[index]); + charWidth = charinfo->rbearing - charinfo->lbearing; + charHeight = charinfo->ascent + charinfo->descent; + if (charWidth == 0 || charHeight == 0) { + if (charinfo->width == 0) { + printf("0,\n"); + continue; + } + } + } + printf("&ch%d,\n", i); + } + } + printf("};\n\n"); + printf("const BitmapFontRec %s = {\n", name); + printf("\"%s\",\n", xfont); + printf("%d,\n", last - first + 1); + printf("%d,\n", first); + printf("chars\n"); + printf("};\n\n"); + XFreeFont(dpy, fontinfo); +} + +int +main(int argc, char **argv) +{ + Display *dpy; + Font font; + + if (argc != 3) { + fprintf(stderr, "usage: capturexfont XFONT NAME\n"); + exit(1); + } + dpy = XOpenDisplay(NULL); + if (dpy == NULL) { + fprintf(stderr, "capturexfont: could not open X display\n"); + exit(1); + } + font = XLoadFont(dpy, argv[1]); + if (font == None) { + fprintf(stderr, "capturexfont: bad font\n"); + exit(1); + } + captureXFont(dpy, font, argv[1], argv[2]); + XCloseDisplay(dpy); + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/descrip.mms xpsb-glx-0.19/mesa/src/glut/glx/descrip.mms --- xpsb-glx-0.19/mesa/src/glut/glx/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/descrip.mms 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,208 @@ +# Makefile for GLUT for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +.first + define gl [---.include.gl] + +.include [---]mms-config. + +##### MACROS ##### +GLUT_MAJOR = 3 +GLUT_MINOR = 7 + +VPATH = RCS + +INCDIR = [---.include] +LIBDIR = [---.lib] +CFLAGS = /nowarn/include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm + +SOURCES = \ +glut_8x13.c \ +glut_9x15.c \ +glut_bitmap.c \ +glut_bwidth.c \ +glut_cindex.c \ +glut_cmap.c \ +glut_cursor.c \ +glut_dials.c \ +glut_dstr.c \ +glut_event.c \ +glut_ext.c \ +glut_fullscrn.c \ +glut_gamemode.c \ +glut_get.c \ +glut_glxext.c \ +glut_hel10.c \ +glut_hel12.c \ +glut_hel18.c \ +glut_init.c \ +glut_input.c \ +glut_joy.c \ +glut_key.c \ +glut_keyctrl.c \ +glut_keyup.c \ +glut_menu.c \ +glut_menu2.c \ +glut_mesa.c \ +glut_modifier.c \ +glut_mroman.c \ +glut_overlay.c \ +glut_roman.c \ +glut_shapes.c \ +glut_space.c \ +glut_stroke.c \ +glut_swap.c \ +glut_swidth.c \ +glut_tablet.c \ +glut_teapot.c \ +glut_tr10.c \ +glut_tr24.c \ +glut_util.c \ +glut_vidresize.c \ +glut_warp.c \ +glut_win.c \ +glut_winmisc.c \ +layerutil.c + +OBJECTS0=glut_8x13.obj,\ +glut_9x15.obj,\ +glut_bitmap.obj,\ +glut_bwidth.obj,\ +glut_cindex.obj,\ +glut_cmap.obj,\ +glut_cursor.obj,\ +glut_dials.obj,\ +glut_dstr.obj,\ +glut_event.obj,\ +glut_ext.obj,\ +glut_fullscrn.obj,\ +glut_gamemode.obj + +OBJECTS1=glut_get.obj,\ +glut_glxext.obj,\ +glut_hel10.obj,\ +glut_hel12.obj,\ +glut_hel18.obj,\ +glut_init.obj,\ +glut_input.obj,\ +glut_joy.obj,\ +glut_key.obj,\ +glut_keyctrl.obj,\ +glut_keyup.obj,\ +glut_menu.obj,\ +glut_menu2.obj,\ +glut_mesa.obj,\ +glut_modifier.obj + +OBJECTS2=glut_mroman.obj,\ +glut_overlay.obj,\ +glut_roman.obj,\ +glut_shapes.obj,\ +glut_space.obj,\ +glut_stroke.obj,\ +glut_swap.obj,\ +glut_swidth.obj,\ +glut_tablet.obj,\ +glut_teapot.obj,\ +glut_tr10.obj,\ +glut_tr24.obj,\ +glut_util.obj,\ +glut_vidresize.obj + +OBJECTS3=glut_warp.obj,\ +glut_win.obj,\ +glut_winmisc.obj,\ +layerutil.obj + +##### RULES ##### + +VERSION=Glut V3.7 + +##### TARGETS ##### + +# Make the library +$(LIBDIR)$(GLUT_LIB) : $(OBJECTS0) $(OBJECTS1) $(OBJECTS2) $(OBJECTS3) + @ $(MAKELIB) $(GLUT_LIB) $(OBJECTS0) + @ library $(GLUT_LIB) $(OBJECTS1) + @ library $(GLUT_LIB) $(OBJECTS2) + @ library $(GLUT_LIB) $(OBJECTS3) + @ rename $(GLUT_LIB)* $(LIBDIR) +.ifdef SHARE + @ WRITE_ SYS$OUTPUT " generating mesagl1.opt" + @ OPEN_/WRITE FILE mesagl1.opt + @ WRITE_ FILE "!" + @ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)" + @ WRITE_ FILE "!" + @ WRITE_ FILE "IDENTIFICATION=""$(VERSION)""" + @ WRITE_ FILE "GSMATCH=LEQUAL,3,7 + @ WRITE_ FILE "$(OBJECTS0)" + @ WRITE_ FILE "$(OBJECTS1)" + @ WRITE_ FILE "$(OBJECTS2)" + @ WRITE_ FILE "$(OBJECTS3)" + @ WRITE_ FILE "[---.lib]libmesaglu.exe/SHARE" + @ WRITE_ FILE "[---.lib]libmesagl.exe/SHARE" + @ write file "sys$library:decw$xmulibshr.exe/share" + @ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE" + @ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE" + @ CLOSE_ FILE + @ WRITE_ SYS$OUTPUT " generating mesagl.map ..." + @ CXXLINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT + @ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..." + @ @[---.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt + @ WRITE_ SYS$OUTPUT " linking $(GLUT_SHAR) ..." + @ CXXLINK_/NODEB/SHARE=$(GLUT_SHAR)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt + @ rename $(GLUT_SHAR)* $(LIBDIR) +.endif + +clean : + delete *.obj;* + purge + +include mms_depend. + +glut_8x13.obj : glut_8x13.c +glut_9x15.obj : glut_9x15.c +glut_bitmap.obj : glut_bitmap.c +glut_bwidth.obj : glut_bwidth.c +glut_cindex.obj : glut_cindex.c +glut_cmap.obj : glut_cmap.c +glut_cursor.obj : glut_cursor.c +glut_dials.obj : glut_dials.c +glut_dstr.obj : glut_dstr.c +glut_event.obj : glut_event.c +glut_ext.obj : glut_ext.c +glut_fullscrn.obj : glut_fullscrn.c +glut_gamemode.obj : glut_gamemode.c +glut_get.obj : glut_get.c +glut_glxext.obj : glut_glxext.c +glut_hel10.obj : glut_hel10.c +glut_hel12.obj : glut_hel12.c +glut_hel18.obj : glut_hel18.c +glut_init.obj : glut_init.c +glut_input.obj : glut_input.c +glut_joy.obj : glut_joy.c +glut_key.obj : glut_key.c +glut_keyctrl.obj : glut_keyctrl.c +glut_keyup.obj : glut_keyup.c +glut_menu.obj : glut_menu.c +glut_menu2.obj : glut_menu2.c +glut_mesa.obj : glut_mesa.c +glut_modifier.obj : glut_modifier.c +glut_mroman.obj : glut_mroman.c +glut_overlay.obj : glut_overlay.c +glut_roman.obj : glut_roman.c +glut_shapes.obj : glut_shapes.c +glut_space.obj : glut_space.c +glut_stroke.obj : glut_stroke.c +glut_swap.obj : glut_swap.c +glut_swidth.obj : glut_swidth.c +glut_tablet.obj : glut_tablet.c +glut_teapot.obj : glut_teapot.c +glut_tr10.obj : glut_tr10.c +glut_tr24.obj : glut_tr24.c +glut_util.obj : glut_util.c +glut_vidresize.obj : glut_vidresize.c +glut_warp.obj : glut_warp.c +glut_win.obj : glut_win.c +glut_winmisc.obj : glut_winmisc.c +layerutil.obj : layerutil.c diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/fxglut.def xpsb-glx-0.19/mesa/src/glut/glx/fxglut.def --- xpsb-glx-0.19/mesa/src/glut/glx/fxglut.def 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/fxglut.def 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,103 @@ +EXPORTS + glutInit + glutInitDisplayMode + glutInitDisplayString + glutInitWindowPosition + glutInitWindowSize + glutMainLoop + glutCreateWindow + glutCreateSubWindow + glutDestroyWindow + glutPostRedisplay + glutSwapBuffers + glutGetWindow + glutSetWindow + glutSetWindowTitle + glutSetIconTitle + glutPositionWindow + glutReshapeWindow + glutPopWindow + glutPushWindow + glutIconifyWindow + glutShowWindow + glutHideWindow + glutFullScreen + glutSetCursor + glutWarpPointer + glutEstablishOverlay + glutRemoveOverlay + glutUseLayer + glutPostOverlayRedisplay + glutShowOverlay + glutHideOverlay + glutCreateMenu + glutDestroyMenu + glutGetMenu + glutSetMenu + glutAddMenuEntry + glutAddSubMenu + glutChangeToMenuEntry + glutChangeToSubMenu + glutRemoveMenuItem + glutAttachMenu + glutDetachMenu + glutDisplayFunc + glutReshapeFunc + glutKeyboardFunc + glutMouseFunc + glutMotionFunc + glutPassiveMotionFunc + glutEntryFunc + glutVisibilityFunc + glutIdleFunc + glutTimerFunc + glutMenuStateFunc + glutSpecialFunc + glutSpaceballMotionFunc + glutSpaceballRotateFunc + glutSpaceballButtonFunc + glutButtonBoxFunc + glutDialsFunc + glutTabletMotionFunc + glutTabletButtonFunc + glutMenuStatusFunc + glutOverlayDisplayFunc + glutWindowStatusFunc + glutSetColor + glutGetColor + glutCopyColormap + glutGet + glutDeviceGet + glutExtensionSupported + glutGetModifiers + glutLayerGet + glutBitmapCharacter + glutBitmapWidth + glutStrokeCharacter + glutStrokeWidth + glutBitmapLength + glutStrokeLength + glutWireSphere + glutSolidSphere + glutWireCone + glutSolidCone + glutWireCube + glutSolidCube + glutWireTorus + glutSolidTorus + glutWireDodecahedron + glutSolidDodecahedron + glutWireTeapot + glutSolidTeapot + glutWireOctahedron + glutSolidOctahedron + glutWireTetrahedron + glutSolidTetrahedron + glutWireIcosahedron + glutSolidIcosahedron + glutVideoResizeGet + glutSetupVideoResizing + glutStopVideoResizing + glutVideoResize + glutVideoPan + glutReportErrors diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_8x13.c xpsb-glx-0.19/mesa/src/glut/glx/glut_8x13.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_8x13.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_8x13.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2073 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmap8By13 XXX +#include "glutbitmap.h" +#undef glutBitmap8By13 + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch0data[] = { 0x0 }; +static const BitmapCharRec ch0 = {1,1,0,0,8,ch0data}; +#else +static const BitmapCharRec ch0 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,8,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch127data[] = { 0x0 }; +static const BitmapCharRec ch127 = {1,1,0,0,8,ch127data}; +#else +static const BitmapCharRec ch127 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,8,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,8,0}; +#endif + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch255 = {6,12,-1,2,8,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {6,10,-1,2,8,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {6,12,-1,2,8,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch252 = {6,10,-1,0,8,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch251 = {6,10,-1,0,8,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch250 = {6,10,-1,0,8,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch249 = {6,10,-1,0,8,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x78,0xc4,0xa4,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch248 = {6,8,-1,1,8,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x20,0x0,0xf8,0x0,0x20,0x20, +}; + +static const BitmapCharRec ch247 = {5,7,-1,-1,8,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch246 = {6,10,-1,0,8,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {6,10,-1,0,8,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch244 = {6,10,-1,0,8,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {6,10,-1,0,8,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch242 = {6,10,-1,0,8,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {6,10,-1,0,8,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x8,0x50,0x30,0x48, +}; + +static const BitmapCharRec ch240 = {6,10,-1,0,8,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch239 = {5,10,-1,0,8,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x90,0x60, +}; + +static const BitmapCharRec ch238 = {5,10,-1,0,8,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch237 = {5,10,-1,0,8,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch236 = {5,10,-1,0,8,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch235 = {6,10,-1,0,8,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch234 = {6,10,-1,0,8,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch233 = {6,10,-1,0,8,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch232 = {6,10,-1,0,8,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x20,0x10,0x78,0x84,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch231 = {6,8,-1,2,8,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6c,0x92,0x90,0x7c,0x12,0x6c, +}; + +static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch229 = {6,10,-1,0,8,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch228 = {6,10,-1,0,8,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {6,10,-1,0,8,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch226 = {6,10,-1,0,8,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {6,10,-1,0,8,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch224 = {6,10,-1,0,8,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0x80,0xb8,0xc4,0x84,0x84,0xf8,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch223 = {6,9,-1,1,8,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80, +}; + +static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x20,0x20,0x20,0x20,0x50,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch221 = {5,10,-1,0,8,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch219 = {6,10,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch218 = {6,10,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,10,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x78,0xc4,0xa4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch216 = {6,11,-1,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch215 = {6,6,-1,-1,8,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch214 = {7,10,0,0,8,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch213 = {7,10,0,0,8,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18, +}; + +static const BitmapCharRec ch212 = {7,10,0,0,8,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {7,10,0,0,8,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10, +}; + +static const BitmapCharRec ch210 = {7,10,0,0,8,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch208 = {7,9,0,0,8,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch207 = {5,10,-1,0,8,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch206 = {5,10,-1,0,8,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch205 = {5,10,-1,0,8,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch204 = {5,10,-1,0,8,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch203 = {6,10,-1,0,8,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch202 = {6,10,-1,0,8,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {6,10,-1,0,8,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch200 = {6,10,-1,0,8,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x20,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch199 = {6,11,-1,2,8,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e, +}; + +static const BitmapCharRec ch198 = {7,9,0,0,8,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch197 = {6,10,-1,0,8,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch196 = {6,10,-1,0,8,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch195 = {6,10,-1,0,8,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch194 = {6,10,-1,0,8,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch193 = {6,10,-1,0,8,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {6,10,-1,0,8,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x78,0x84,0x84,0x80,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {6,9,-1,0,8,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch190 = {7,10,0,0,8,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch189 = {7,10,0,0,8,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch188 = {7,10,0,0,8,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0x48,0x24,0x12,0x24,0x48,0x90, +}; + +static const BitmapCharRec ch187 = {7,7,0,-1,8,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf0,0x0,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch186 = {4,6,-1,-3,8,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,6,-1,-4,8,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x40, +}; + +static const BitmapCharRec ch184 = {2,2,-3,2,8,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0, +}; + +static const BitmapCharRec ch183 = {2,1,-3,-4,8,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,9,-1,0,8,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0xb4,0xcc,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch181 = {6,7,-1,1,8,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,-3,-8,8,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x60,0x90,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch179 = {4,6,-1,-4,8,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x80,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,6,-1,-4,8,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,-1,-1,8,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,-2,-5,8,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc, +}; + +static const BitmapCharRec ch175 = {6,1,-1,-8,8,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,9,0,-1,8,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfc, +}; + +static const BitmapCharRec ch173 = {6,1,-1,-4,8,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-1,8,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x24,0x48,0x90,0x48,0x24,0x12, +}; + +static const BitmapCharRec ch171 = {7,7,0,-1,8,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x78,0x88,0x78,0x8,0x70, +}; + +static const BitmapCharRec ch170 = {5,7,-1,-2,8,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,9,0,-1,8,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xd8, +}; + +static const BitmapCharRec ch168 = {5,1,-1,-8,8,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x60,0x90,0x10,0x60,0x90,0x90,0x60,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch167 = {4,10,-2,0,8,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,9,-3,0,8,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch165 = {7,9,0,0,8,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x84,0x78,0x48,0x48,0x78,0x84, +}; + +static const BitmapCharRec ch164 = {6,6,-1,-1,8,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch163 = {7,9,0,0,8,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x20,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch162 = {5,8,-1,-1,8,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,9,-3,0,8,ch161data}; + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x90,0xa8,0x48, +}; + +static const BitmapCharRec ch126 = {5,3,-1,-6,8,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x10,0x10,0x20,0x18,0x20,0x10,0x10,0xe0, +}; + +static const BitmapCharRec ch125 = {5,9,-1,0,8,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,9,-3,0,8,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x38,0x40,0x40,0x20,0xc0,0x20,0x40,0x40,0x38, +}; + +static const BitmapCharRec ch123 = {5,9,-2,0,8,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfc,0x40,0x20,0x10,0x8,0xfc, +}; + +static const BitmapCharRec ch122 = {6,6,-1,0,8,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch121 = {6,8,-1,2,8,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch120 = {6,6,-1,0,8,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x44,0xaa,0x92,0x92,0x82,0x82, +}; + +static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x50,0x50,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,6,-1,0,8,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x74,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch117 = {6,6,-1,0,8,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x38,0x44,0x40,0x40,0x40,0xf8,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {6,8,-1,0,8,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x78,0x84,0x18,0x60,0x84,0x78, +}; + +static const BitmapCharRec ch115 = {6,6,-1,0,8,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x40,0x40,0x40,0x40,0x44,0xb8, +}; + +static const BitmapCharRec ch114 = {6,6,-1,0,8,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x4,0x4,0x4,0x74,0x8c,0x84,0x8c,0x74, +}; + +static const BitmapCharRec ch113 = {6,8,-1,2,8,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xb8,0xc4,0x84,0xc4,0xb8, +}; + +static const BitmapCharRec ch112 = {6,8,-1,2,8,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x78,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch111 = {6,6,-1,0,8,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8, +}; + +static const BitmapCharRec ch110 = {6,6,-1,0,8,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x82,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, +}; + +static const BitmapCharRec ch108 = {5,9,-1,0,8,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x84,0x88,0x90,0xe0,0x90,0x88,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {6,9,-1,0,8,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x18,0x0,0x8, +}; + +static const BitmapCharRec ch106 = {5,10,-1,2,8,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x20, +}; + +static const BitmapCharRec ch105 = {5,8,-1,0,8,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {6,9,-1,0,8,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x78,0x84,0x78,0x80,0x70,0x88,0x88,0x74, +}; + +static const BitmapCharRec ch103 = {6,8,-1,2,8,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0xf8,0x40,0x40,0x44,0x38, +}; + +static const BitmapCharRec ch102 = {6,9,-1,0,8,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78, +}; + +static const BitmapCharRec ch101 = {6,6,-1,0,8,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x74,0x8c,0x84,0x84,0x8c,0x74,0x4,0x4,0x4, +}; + +static const BitmapCharRec ch100 = {6,9,-1,0,8,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x78,0x84,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch99 = {6,6,-1,0,8,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {6,9,-1,0,8,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78, +}; + +static const BitmapCharRec ch97 = {6,6,-1,0,8,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x10,0x60,0xe0, +}; + +static const BitmapCharRec ch96 = {4,3,-2,-6,8,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfe, +}; + +static const BitmapCharRec ch95 = {7,1,0,1,8,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x20, +}; + +static const BitmapCharRec ch94 = {5,3,-1,-6,8,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch93 = {4,9,-1,0,8,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {7,9,0,0,8,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, +}; + +static const BitmapCharRec ch91 = {4,9,-2,0,8,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfc,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch90 = {6,9,-1,0,8,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,9,0,0,8,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch88 = {7,9,0,0,8,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch87 = {7,9,0,0,8,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,9,0,0,8,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,9,0,0,8,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x78,0x84,0x4,0x4,0x78,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x84,0x88,0x90,0xa0,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x4,0x78,0x94,0xa4,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch81 = {6,10,-1,1,8,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch79 = {6,9,-1,0,8,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x84,0x84,0x84,0x8c,0x94,0xa4,0xc4,0x84,0x84, +}; + +static const BitmapCharRec ch78 = {6,9,-1,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82, +}; + +static const BitmapCharRec ch77 = {7,9,0,0,8,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xfc,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {6,9,-1,0,8,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x84,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x84, +}; + +static const BitmapCharRec ch75 = {6,9,-1,0,8,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x70,0x88,0x8,0x8,0x8,0x8,0x8,0x8,0x3c, +}; + +static const BitmapCharRec ch74 = {6,9,-1,0,8,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch73 = {5,9,-1,0,8,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch72 = {6,9,-1,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x74,0x8c,0x84,0x9c,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch71 = {6,9,-1,0,8,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfc,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch68 = {7,9,0,0,8,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch67 = {6,9,-1,0,8,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch66 = {7,9,0,0,8,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x48,0x30, +}; + +static const BitmapCharRec ch65 = {6,9,-1,0,8,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x78,0x80,0x94,0xac,0xa4,0x9c,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch64 = {6,9,-1,0,8,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x10,0x0,0x10,0x10,0x8,0x4,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch63 = {6,9,-1,0,8,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x10,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {5,9,-1,0,8,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfc,0x0,0x0,0xfc, +}; + +static const BitmapCharRec ch61 = {6,4,-1,-2,8,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x8,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x8, +}; + +static const BitmapCharRec ch60 = {5,9,-2,0,8,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x60,0x70,0x0,0x0,0x20,0x70,0x20, +}; + +static const BitmapCharRec ch59 = {4,8,-1,1,8,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x40,0xe0,0x40,0x0,0x0,0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch58 = {3,8,-2,1,8,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x8,0x4,0x4,0x74,0x8c,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch57 = {6,9,-1,0,8,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x78,0x84,0x84,0x84,0x78,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch56 = {6,9,-1,0,8,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch55 = {6,9,-1,0,8,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x78,0x84,0x84,0xc4,0xb8,0x80,0x80,0x40,0x38, +}; + +static const BitmapCharRec ch54 = {6,9,-1,0,8,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x78,0x84,0x4,0x4,0xc4,0xb8,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch53 = {6,9,-1,0,8,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x8,0x8,0xfc,0x88,0x88,0x48,0x28,0x18,0x8, +}; + +static const BitmapCharRec ch52 = {6,9,-1,0,8,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x78,0x84,0x4,0x4,0x38,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch51 = {6,9,-1,0,8,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xfc,0x80,0x40,0x30,0x8,0x4,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch50 = {6,9,-1,0,8,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, +}; + +static const BitmapCharRec ch49 = {5,9,-1,0,8,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30, +}; + +static const BitmapCharRec ch48 = {6,9,-1,0,8,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2, +}; + +static const BitmapCharRec ch47 = {7,9,0,0,8,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch46 = {3,3,-2,1,8,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xfc, +}; + +static const BitmapCharRec ch45 = {6,1,-1,-4,8,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x60,0x70, +}; + +static const BitmapCharRec ch44 = {4,3,-1,1,8,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,-1,-2,8,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x48,0x30,0xfc,0x30,0x48, +}; + +static const BitmapCharRec ch42 = {6,5,-1,-2,8,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,9,-2,0,8,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,9,-3,0,8,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x60,0x70, +}; + +static const BitmapCharRec ch39 = {4,3,-1,-6,8,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x74,0x88,0x94,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch38 = {6,7,-1,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x88,0x54,0x48,0x20,0x10,0x10,0x48,0xa4,0x44, +}; + +static const BitmapCharRec ch37 = {6,9,-1,0,8,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0xf0,0x28,0x70,0xa0,0x78,0x20, +}; + +static const BitmapCharRec ch36 = {5,7,-1,-1,8,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x48,0x48,0xfc,0x48,0xfc,0x48,0x48, +}; + +static const BitmapCharRec ch35 = {6,7,-1,-1,8,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0x90, +}; + +static const BitmapCharRec ch34 = {4,3,-2,-6,8,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,9,-3,0,8,ch33data}; + +/* char: 0x1f */ + +static const GLubyte ch31data[] = { +0x80, +}; + +static const BitmapCharRec ch31 = {1,1,-3,-3,8,ch31data}; + +/* char: 0x1e */ + +static const GLubyte ch30data[] = { +0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch30 = {7,9,0,0,8,ch30data}; + +/* char: 0x1d */ + +static const GLubyte ch29data[] = { +0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, +}; + +static const BitmapCharRec ch29 = {7,7,0,0,8,ch29data}; + +/* char: 0x1c */ + +static const GLubyte ch28data[] = { +0x88,0x48,0x48,0x48,0x48,0xfc, +}; + +static const BitmapCharRec ch28 = {6,6,-1,0,8,ch28data}; + +/* char: 0x1b */ + +static const GLubyte ch27data[] = { +0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80, +}; + +static const BitmapCharRec ch27 = {7,8,0,0,8,ch27data}; + +/* char: 0x1a */ + +static const GLubyte ch26data[] = { +0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2, +}; + +static const BitmapCharRec ch26 = {7,8,0,0,8,ch26data}; + +/* char: 0x19 */ + +static const GLubyte ch25data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch25 = {1,13,-3,2,8,ch25data}; + +/* char: 0x18 */ + +static const GLubyte ch24data[] = { +0x10,0x10,0x10,0x10,0x10,0xff, +}; + +static const BitmapCharRec ch24 = {8,6,0,2,8,ch24data}; + +/* char: 0x17 */ + +static const GLubyte ch23data[] = { +0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch23 = {8,8,0,-3,8,ch23data}; + +/* char: 0x16 */ + +static const GLubyte ch22data[] = { +0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch22 = {4,13,0,2,8,ch22data}; + +/* char: 0x15 */ + +static const GLubyte ch21data[] = { +0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch21 = {5,13,-3,2,8,ch21data}; + +/* char: 0x14 */ + +static const GLubyte ch20data[] = { +0xff, +}; + +static const BitmapCharRec ch20 = {8,1,0,1,8,ch20data}; + +/* char: 0x13 */ + +static const GLubyte ch19data[] = { +0xff, +}; + +static const BitmapCharRec ch19 = {8,1,0,-1,8,ch19data}; + +/* char: 0x12 */ + +static const GLubyte ch18data[] = { +0xff, +}; + +static const BitmapCharRec ch18 = {8,1,0,-3,8,ch18data}; + +/* char: 0x11 */ + +static const GLubyte ch17data[] = { +0xff, +}; + +static const BitmapCharRec ch17 = {8,1,0,-5,8,ch17data}; + +/* char: 0x10 */ + +static const GLubyte ch16data[] = { +0xff, +}; + +static const BitmapCharRec ch16 = {8,1,0,-7,8,ch16data}; + +/* char: 0xf */ + +static const GLubyte ch15data[] = { +0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch15 = {8,13,0,2,8,ch15data}; + +/* char: 0xe */ + +static const GLubyte ch14data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch14 = {5,8,-3,-3,8,ch14data}; + +/* char: 0xd */ + +static const GLubyte ch13data[] = { +0x80,0x80,0x80,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch13 = {5,6,-3,2,8,ch13data}; + +/* char: 0xc */ + +static const GLubyte ch12data[] = { +0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch12 = {4,6,0,2,8,ch12data}; + +/* char: 0xb */ + +static const GLubyte ch11data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch11 = {4,8,0,-3,8,ch11data}; + +/* char: 0xa */ + +static const GLubyte ch10data[] = { +0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch10 = {7,9,0,2,8,ch10data}; + +/* char: 0x9 */ + +static const GLubyte ch9data[] = { +0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, +}; + +static const BitmapCharRec ch9 = {7,9,0,2,8,ch9data}; + +/* char: 0x8 */ + +static const GLubyte ch8data[] = { +0xfe,0x10,0x10,0xfe,0x10,0x10, +}; + +static const BitmapCharRec ch8 = {7,6,0,0,8,ch8data}; + +/* char: 0x7 */ + +static const GLubyte ch7data[] = { +0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch7 = {5,4,-1,-5,8,ch7data}; + +/* char: 0x6 */ + +static const GLubyte ch6data[] = { +0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch6 = {7,9,0,2,8,ch6data}; + +/* char: 0x5 */ + +static const GLubyte ch5data[] = { +0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78, +}; + +static const BitmapCharRec ch5 = {7,9,0,2,8,ch5data}; + +/* char: 0x4 */ + +static const GLubyte ch4data[] = { +0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0, +}; + +static const BitmapCharRec ch4 = {7,9,0,2,8,ch4data}; + +/* char: 0x3 */ + +static const GLubyte ch3data[] = { +0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88, +}; + +static const BitmapCharRec ch3 = {7,9,0,2,8,ch3data}; + +/* char: 0x2 */ + +static const GLubyte ch2data[] = { +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +}; + +static const BitmapCharRec ch2 = {8,12,0,2,8,ch2data}; + +/* char: 0x1 */ + +static const GLubyte ch1data[] = { +0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, +}; + +static const BitmapCharRec ch1 = {7,7,0,-1,8,ch1data}; + +static const BitmapCharRec * const chars[] = { +&ch0, +&ch1, +&ch2, +&ch3, +&ch4, +&ch5, +&ch6, +&ch7, +&ch8, +&ch9, +&ch10, +&ch11, +&ch12, +&ch13, +&ch14, +&ch15, +&ch16, +&ch17, +&ch18, +&ch19, +&ch20, +&ch21, +&ch22, +&ch23, +&ch24, +&ch25, +&ch26, +&ch27, +&ch28, +&ch29, +&ch30, +&ch31, +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +&ch127, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmap8By13 = { +"-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1", +256, +0, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_9x15.c xpsb-glx-0.19/mesa/src/glut/glx/glut_9x15.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_9x15.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_9x15.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2075 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmap9By15 XXX +#include "glutbitmap.h" +#undef glutBitmap9By15 + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch0data[] = { 0x0 }; +static const BitmapCharRec ch0 = {1,1,0,0,9,ch0data}; +#else +static const BitmapCharRec ch0 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,9,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch127data[] = { 0x0 }; +static const BitmapCharRec ch127 = {1,1,0,0,9,ch127data}; +#else +static const BitmapCharRec ch127 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,9,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,9,0}; +#endif + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch255 = {6,14,-1,3,9,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {7,12,-1,3,9,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch253 = {6,14,-1,3,9,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch252 = {7,11,-1,0,9,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch251 = {7,11,-1,0,9,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch250 = {7,11,-1,0,9,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch249 = {7,11,-1,0,9,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x7c,0xa2,0xa2,0x92,0x8a,0x8a,0x7c,0x2, +}; + +static const BitmapCharRec ch248 = {7,9,-1,1,9,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x10,0x38,0x10,0x0,0xfe,0x0,0x10,0x38,0x10, +}; + +static const BitmapCharRec ch247 = {7,9,-1,0,9,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch246 = {7,11,-1,0,9,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {7,11,-1,0,9,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch244 = {7,11,-1,0,9,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch243 = {7,11,-1,0,9,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch242 = {7,11,-1,0,9,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {7,11,-1,0,9,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x8,0x50,0x30,0x48, +}; + +static const BitmapCharRec ch240 = {7,11,-1,0,9,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch239 = {5,11,-2,0,9,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x90,0x60, +}; + +static const BitmapCharRec ch238 = {5,11,-2,0,9,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60,0x10, +}; + +static const BitmapCharRec ch237 = {5,11,-2,0,9,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x30,0x40, +}; + +static const BitmapCharRec ch236 = {5,11,-2,0,9,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch235 = {7,11,-1,0,9,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch234 = {7,11,-1,0,9,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch233 = {7,11,-1,0,9,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch232 = {7,11,-1,0,9,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch231 = {7,10,-1,3,9,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6e,0x92,0x90,0x7c,0x12,0x92,0x6c, +}; + +static const BitmapCharRec ch230 = {7,7,-1,0,9,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x18,0x24,0x18, +}; + +static const BitmapCharRec ch229 = {7,11,-1,0,9,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch228 = {7,11,-1,0,9,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {7,11,-1,0,9,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch226 = {7,11,-1,0,9,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch225 = {7,11,-1,0,9,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch224 = {7,11,-1,0,9,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0x80,0xbc,0xc2,0x82,0x82,0xfc,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch223 = {7,9,-1,1,9,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {7,10,-1,0,9,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch221 = {7,11,-1,0,9,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch220 = {7,11,-1,0,9,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch219 = {7,11,-1,0,9,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch218 = {7,11,-1,0,9,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch217 = {7,11,-1,0,9,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x7c,0xc2,0xa2,0xa2,0x92,0x92,0x8a,0x8a,0x86,0x7c,0x2, +}; + +static const BitmapCharRec ch216 = {7,12,-1,1,9,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x82,0x44,0x28,0x10,0x28,0x44,0x82, +}; + +static const BitmapCharRec ch215 = {7,7,-1,-1,9,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch214 = {7,11,-1,0,9,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {7,11,-1,0,9,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch212 = {7,11,-1,0,9,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch211 = {7,11,-1,0,9,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch210 = {7,11,-1,0,9,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x92,0x92,0xa2,0xc2,0x82,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {7,11,-1,0,9,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xfc,0x42,0x42,0x42,0x42,0xf2,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch208 = {7,10,-1,0,9,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch207 = {5,11,-2,0,9,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x88,0x70, +}; + +static const BitmapCharRec ch206 = {5,11,-2,0,9,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x60,0x10, +}; + +static const BitmapCharRec ch205 = {5,11,-2,0,9,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x30,0x40, +}; + +static const BitmapCharRec ch204 = {5,11,-2,0,9,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch203 = {7,11,-1,0,9,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch202 = {7,11,-1,0,9,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch201 = {7,11,-1,0,9,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch200 = {7,11,-1,0,9,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch199 = {7,13,-1,3,9,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x9e,0x90,0x90,0x90,0xfc,0x90,0x90,0x90,0x90,0x6e, +}; + +static const BitmapCharRec ch198 = {7,10,-1,0,9,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,11,-1,0,9,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch195 = {7,11,-1,0,9,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch194 = {7,11,-1,0,9,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch193 = {7,11,-1,0,9,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch192 = {7,11,-1,0,9,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x7c,0x82,0x82,0x80,0x40,0x20,0x10,0x10,0x0,0x10, +}; + +static const BitmapCharRec ch191 = {7,10,-1,0,9,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch190 = {7,10,-1,0,9,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch189 = {7,10,-1,0,9,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch188 = {7,10,-1,0,9,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0x48,0x24,0x12,0x12,0x24,0x48,0x90, +}; + +static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf8,0x0,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch186 = {5,6,-1,-5,9,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,6,-1,-4,9,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0x60,0x90,0x30, +}; + +static const BitmapCharRec ch184 = {4,3,-2,3,9,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-4,-4,9,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0xa,0xa,0xa,0xa,0xa,0x7a,0x8a,0x8a,0x8a,0x7e, +}; + +static const BitmapCharRec ch182 = {7,10,-1,0,9,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xba,0xc6,0x82,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch181 = {7,9,-1,2,9,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0xc0,0x20, +}; + +static const BitmapCharRec ch180 = {3,2,-3,-9,9,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x60,0x90,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch179 = {4,6,-1,-4,9,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x80,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,6,-1,-4,9,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xfe,0x0,0x10,0x10,0x10,0xfe,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch177 = {7,9,-1,-1,9,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,-3,-6,9,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc, +}; + +static const BitmapCharRec ch175 = {6,1,-1,-9,9,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x3c,0x42,0xa5,0xa9,0xbd,0xa5,0xb9,0x42,0x3c, +}; + +static const BitmapCharRec ch174 = {8,9,0,-1,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfc, +}; + +static const BitmapCharRec ch173 = {6,1,-1,-4,9,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-2,9,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x24,0x48,0x90,0x90,0x48,0x24,0x12, +}; + +static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x78,0x90,0x70,0x90,0x60, +}; + +static const BitmapCharRec ch170 = {5,7,-3,-3,9,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x3c,0x42,0x99,0xa5,0xa1,0xa5,0x99,0x42,0x3c, +}; + +static const BitmapCharRec ch169 = {8,9,0,-1,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch168 = {3,2,-3,-9,9,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x8,0x70,0x88,0x88,0x88,0x70,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,11,-2,1,9,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,11,-4,1,9,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x10,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch165 = {7,10,-1,0,9,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x82,0x7c,0x44,0x44,0x7c,0x82, +}; + +static const BitmapCharRec ch164 = {7,6,-1,-3,9,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch163 = {7,10,-1,0,9,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x78,0xa4,0xa0,0x90,0x94,0x78,0x8, +}; + +static const BitmapCharRec ch162 = {6,8,-1,0,9,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80, +}; + +static const BitmapCharRec ch161 = {1,11,-4,0,9,ch161data}; + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x8c,0x92,0x62, +}; + +static const BitmapCharRec ch126 = {7,3,-1,-7,9,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x10,0x10,0x10,0x20,0x18,0x18,0x20,0x10,0x10,0x10,0xe0, +}; + +static const BitmapCharRec ch125 = {5,12,-1,1,9,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,12,-4,1,9,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x38,0x40,0x40,0x40,0x20,0xc0,0xc0,0x20,0x40,0x40,0x40,0x38, +}; + +static const BitmapCharRec ch123 = {5,12,-3,1,9,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfe,0x40,0x20,0x10,0x8,0x4,0xfe, +}; + +static const BitmapCharRec ch122 = {7,7,-1,0,9,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch121 = {6,10,-1,3,9,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x82,0x44,0x28,0x10,0x28,0x44,0x82, +}; + +static const BitmapCharRec ch120 = {7,7,-1,0,9,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x44,0xaa,0x92,0x92,0x92,0x82,0x82, +}; + +static const BitmapCharRec ch119 = {7,7,-1,0,9,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x10,0x28,0x28,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch118 = {7,7,-1,0,9,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch117 = {7,7,-1,0,9,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x1c,0x22,0x20,0x20,0x20,0x20,0xfc,0x20,0x20, +}; + +static const BitmapCharRec ch116 = {7,9,-1,0,9,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x7c,0x82,0x2,0x7c,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch115 = {7,7,-1,0,9,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x40,0x40,0x40,0x40,0x42,0x62,0x9c, +}; + +static const BitmapCharRec ch114 = {7,7,-1,0,9,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x2,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x86,0x7a, +}; + +static const BitmapCharRec ch113 = {7,10,-1,3,9,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc, +}; + +static const BitmapCharRec ch112 = {7,10,-1,3,9,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch111 = {7,7,-1,0,9,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc, +}; + +static const BitmapCharRec ch110 = {7,7,-1,0,9,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x82,0x92,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0, +}; + +static const BitmapCharRec ch108 = {5,10,-2,0,9,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x82,0x8c,0xb0,0xc0,0xb0,0x8c,0x82,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {7,10,-1,0,9,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x78,0x84,0x84,0x84,0x4,0x4,0x4,0x4,0x4,0x1c,0x0,0x0,0xc, +}; + +static const BitmapCharRec ch106 = {6,13,-1,3,9,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60, +}; + +static const BitmapCharRec ch105 = {5,10,-2,0,9,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {7,10,-1,0,9,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x7c,0x82,0x82,0x7c,0x80,0x78,0x84,0x84,0x84,0x7a, +}; + +static const BitmapCharRec ch103 = {7,10,-1,3,9,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x20,0x20,0x20,0x20,0xf8,0x20,0x20,0x22,0x22,0x1c, +}; + +static const BitmapCharRec ch102 = {7,10,-1,0,9,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch101 = {7,7,-1,0,9,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x7a,0x86,0x82,0x82,0x82,0x86,0x7a,0x2,0x2,0x2, +}; + +static const BitmapCharRec ch100 = {7,10,-1,0,9,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch99 = {7,7,-1,0,9,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {7,10,-1,0,9,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c, +}; + +static const BitmapCharRec ch97 = {7,7,-1,0,9,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x10,0x20,0x40,0xc0, +}; + +static const BitmapCharRec ch96 = {4,4,-3,-6,9,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff, +}; + +static const BitmapCharRec ch95 = {8,1,0,1,9,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x82,0x44,0x28,0x10, +}; + +static const BitmapCharRec ch94 = {7,4,-1,-6,9,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch93 = {4,12,-2,1,9,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x2,0x4,0x4,0x8,0x10,0x10,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch92 = {7,10,-1,0,9,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, +}; + +static const BitmapCharRec ch91 = {4,12,-3,1,9,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfe,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch90 = {7,10,-1,0,9,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,10,-1,0,9,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x82,0x44,0x28,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch88 = {7,10,-1,0,9,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x44,0xaa,0x92,0x92,0x92,0x92,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch87 = {7,10,-1,0,9,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,10,-1,0,9,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch85 = {7,10,-1,0,9,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,10,-1,0,9,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x7c,0x82,0x82,0x2,0xc,0x70,0x80,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch83 = {7,10,-1,0,9,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x82,0x82,0x84,0x88,0x90,0xfc,0x82,0x82,0x82,0xfc, +}; + +static const BitmapCharRec ch82 = {7,10,-1,0,9,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x6,0x8,0x7c,0x92,0xa2,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch81 = {7,12,-1,2,9,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc, +}; + +static const BitmapCharRec ch80 = {7,10,-1,0,9,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch79 = {7,10,-1,0,9,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x82,0x82,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x82, +}; + +static const BitmapCharRec ch78 = {7,10,-1,0,9,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x82,0x82,0x82,0x92,0x92,0xaa,0xaa,0xc6,0x82,0x82, +}; + +static const BitmapCharRec ch77 = {7,10,-1,0,9,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xfe,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {7,10,-1,0,9,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x82,0x84,0x88,0x90,0xa0,0xe0,0x90,0x88,0x84,0x82, +}; + +static const BitmapCharRec ch75 = {7,10,-1,0,9,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x78,0x84,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x1e, +}; + +static const BitmapCharRec ch74 = {7,10,-1,0,9,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch73 = {5,10,-2,0,9,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x82,0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch72 = {7,10,-1,0,9,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x7c,0x82,0x82,0x82,0x8e,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch71 = {7,10,-1,0,9,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x40,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, +}; + +static const BitmapCharRec ch70 = {7,10,-1,0,9,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfe,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, +}; + +static const BitmapCharRec ch69 = {7,10,-1,0,9,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch68 = {7,10,-1,0,9,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch67 = {7,10,-1,0,9,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xfc,0x42,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch66 = {7,10,-1,0,9,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x44,0x28,0x10, +}; + +static const BitmapCharRec ch65 = {7,10,-1,0,9,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x7c,0x80,0x80,0x9a,0xa6,0xa2,0x9e,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch64 = {7,10,-1,0,9,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x10,0x0,0x10,0x10,0x8,0x4,0x2,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch63 = {7,10,-1,0,9,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {5,10,-2,0,9,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfe,0x0,0x0,0xfe, +}; + +static const BitmapCharRec ch61 = {7,4,-1,-2,9,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x8,0x10,0x20,0x40,0x80,0x80,0x40,0x20,0x10,0x8, +}; + +static const BitmapCharRec ch60 = {5,10,-2,0,9,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {2,10,-4,3,9,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,7,-4,0,9,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x78,0x4,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch57 = {7,10,-1,0,9,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch56 = {7,10,-1,0,9,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x8,0x4,0x2,0x2,0xfe, +}; + +static const BitmapCharRec ch55 = {7,10,-1,0,9,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x7c,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x40,0x3c, +}; + +static const BitmapCharRec ch54 = {7,10,-1,0,9,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7c,0x82,0x2,0x2,0x2,0xc2,0xbc,0x80,0x80,0xfe, +}; + +static const BitmapCharRec ch53 = {7,10,-1,0,9,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x4,0x4,0x4,0xfe,0x84,0x44,0x24,0x14,0xc,0x4, +}; + +static const BitmapCharRec ch52 = {7,10,-1,0,9,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x7c,0x82,0x2,0x2,0x2,0x1c,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch51 = {7,10,-1,0,9,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xfe,0x80,0x40,0x30,0x8,0x4,0x2,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch50 = {7,10,-1,0,9,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xfe,0x10,0x10,0x10,0x10,0x10,0x90,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch49 = {7,10,-1,0,9,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch48 = {7,10,-1,0,9,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x40,0x40,0x20,0x10,0x10,0x8,0x4,0x4,0x2, +}; + +static const BitmapCharRec ch47 = {7,10,-1,0,9,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-4,0,9,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xfe, +}; + +static const BitmapCharRec ch45 = {7,1,-1,-4,9,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch44 = {2,5,-4,3,9,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x10,0x10,0x10,0xfe,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch43 = {7,7,-1,-1,9,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x10,0x92,0x54,0x38,0x54,0x92,0x10, +}; + +static const BitmapCharRec ch42 = {7,7,-1,-1,9,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,12,-3,1,9,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,12,-3,1,9,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x20,0x30, +}; + +static const BitmapCharRec ch39 = {4,4,-3,-6,9,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x62,0x94,0x88,0x94,0x62,0x60,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch38 = {7,10,-1,0,9,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x84,0x4a,0x4a,0x24,0x10,0x10,0x48,0xa4,0xa4,0x42, +}; + +static const BitmapCharRec ch37 = {7,10,-1,0,9,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x10,0x7c,0x92,0x12,0x12,0x14,0x38,0x50,0x90,0x92,0x7c,0x10, +}; + +static const BitmapCharRec ch36 = {7,12,-1,1,9,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48, +}; + +static const BitmapCharRec ch35 = {6,8,-1,-1,9,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0x90, +}; + +static const BitmapCharRec ch34 = {4,3,-3,-7,9,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,11,-4,0,9,ch33data}; + +/* char: 0x1f */ + +static const GLubyte ch31data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch31 = {2,2,-4,-2,9,ch31data}; + +/* char: 0x1e */ + +static const GLubyte ch30data[] = { +0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch30 = {7,10,-1,0,9,ch30data}; + +/* char: 0x1d */ + +static const GLubyte ch29data[] = { +0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, +}; + +static const BitmapCharRec ch29 = {7,7,-1,0,9,ch29data}; + +/* char: 0x1c */ + +static const GLubyte ch28data[] = { +0x44,0x24,0x24,0x24,0x24,0x24,0xfe, +}; + +static const BitmapCharRec ch28 = {7,7,-1,0,9,ch28data}; + +/* char: 0x1b */ + +static const GLubyte ch27data[] = { +0xfe,0x0,0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch27 = {7,12,-1,2,9,ch27data}; + +/* char: 0x1a */ + +static const GLubyte ch26data[] = { +0xfc,0x0,0x4,0x8,0x10,0x20,0x40,0x40,0x20,0x10,0x8,0x4, +}; + +static const BitmapCharRec ch26 = {6,12,-2,2,9,ch26data}; + +/* char: 0x19 */ + +static const GLubyte ch25data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch25 = {1,15,-4,3,9,ch25data}; + +/* char: 0x18 */ + +static const GLubyte ch24data[] = { +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80, +}; + +static const BitmapCharRec ch24 = {9,7,0,3,9,ch24data}; + +/* char: 0x17 */ + +static const GLubyte ch23data[] = { +0xff,0x80,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch23 = {9,9,0,-3,9,ch23data}; + +/* char: 0x16 */ + +static const GLubyte ch22data[] = { +0x8,0x8,0x8,0x8,0x8,0x8,0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch22 = {5,15,0,3,9,ch22data}; + +/* char: 0x15 */ + +static const GLubyte ch21data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch21 = {5,15,-4,3,9,ch21data}; + +/* char: 0x14 */ + +static const GLubyte ch20data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch20 = {9,1,0,1,9,ch20data}; + +/* char: 0x13 */ + +static const GLubyte ch19data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch19 = {9,1,0,-1,9,ch19data}; + +/* char: 0x12 */ + +static const GLubyte ch18data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch18 = {9,1,0,-3,9,ch18data}; + +/* char: 0x11 */ + +static const GLubyte ch17data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch17 = {9,1,0,-5,9,ch17data}; + +/* char: 0x10 */ + +static const GLubyte ch16data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch16 = {9,1,0,-7,9,ch16data}; + +/* char: 0xf */ + +static const GLubyte ch15data[] = { +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0, +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, +}; + +static const BitmapCharRec ch15 = {9,15,0,3,9,ch15data}; + +/* char: 0xe */ + +static const GLubyte ch14data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch14 = {5,9,-4,-3,9,ch14data}; + +/* char: 0xd */ + +static const GLubyte ch13data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch13 = {5,7,-4,3,9,ch13data}; + +/* char: 0xc */ + +static const GLubyte ch12data[] = { +0x8,0x8,0x8,0x8,0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch12 = {5,7,0,3,9,ch12data}; + +/* char: 0xb */ + +static const GLubyte ch11data[] = { +0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch11 = {5,9,0,-3,9,ch11data}; + +/* char: 0xa */ + +static const GLubyte ch10data[] = { +0x8,0x8,0x8,0x8,0x3e,0x0,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch10 = {7,10,-1,2,9,ch10data}; + +/* char: 0x9 */ + +static const GLubyte ch9data[] = { +0x3e,0x20,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, +}; + +static const BitmapCharRec ch9 = {7,10,-1,2,9,ch9data}; + +/* char: 0x8 */ + +static const GLubyte ch8data[] = { +0xfe,0x10,0x10,0xfe,0x10,0x10, +}; + +static const BitmapCharRec ch8 = {7,6,-1,0,9,ch8data}; + +/* char: 0x7 */ + +static const GLubyte ch7data[] = { +0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch7 = {5,4,-2,-6,9,ch7data}; + +/* char: 0x6 */ + +static const GLubyte ch6data[] = { +0x20,0x20,0x3c,0x20,0x3e,0x0,0xf8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch6 = {7,10,-1,2,9,ch6data}; + +/* char: 0x5 */ + +static const GLubyte ch5data[] = { +0x22,0x22,0x3c,0x22,0x3c,0x0,0x78,0x80,0x80,0x78, +}; + +static const BitmapCharRec ch5 = {7,10,-1,2,9,ch5data}; + +/* char: 0x4 */ + +static const GLubyte ch4data[] = { +0x10,0x10,0x1c,0x10,0x1e,0x80,0x80,0xe0,0x80,0xf0, +}; + +static const BitmapCharRec ch4 = {7,10,-1,2,9,ch4data}; + +/* char: 0x3 */ + +static const GLubyte ch3data[] = { +0x8,0x8,0x8,0x3e,0x0,0x88,0x88,0xf8,0x88,0x88, +}; + +static const BitmapCharRec ch3 = {7,10,-1,2,9,ch3data}; + +/* char: 0x2 */ + +static const GLubyte ch2data[] = { +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +}; + +static const BitmapCharRec ch2 = {8,14,0,3,9,ch2data}; + +/* char: 0x1 */ + +static const GLubyte ch1data[] = { +0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, +}; + +static const BitmapCharRec ch1 = {7,7,-1,0,9,ch1data}; + +static const BitmapCharRec * const chars[] = { +&ch0, +&ch1, +&ch2, +&ch3, +&ch4, +&ch5, +&ch6, +&ch7, +&ch8, +&ch9, +&ch10, +&ch11, +&ch12, +&ch13, +&ch14, +&ch15, +&ch16, +&ch17, +&ch18, +&ch19, +&ch20, +&ch21, +&ch22, +&ch23, +&ch24, +&ch25, +&ch26, +&ch27, +&ch28, +&ch29, +&ch30, +&ch31, +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +&ch127, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmap9By15 = { +"-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1", +256, +0, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_bitmap.c xpsb-glx-0.19/mesa/src/glut/glx/glut_bitmap.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_bitmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_bitmap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutbitmap.h" + +void GLUTAPIENTRY +glutBitmapCharacter(GLUTbitmapFont font, int c) +{ + const BitmapCharRec *ch; + BitmapFontPtr fontinfo; + GLint swapbytes, lsbfirst, rowlength; + GLint skiprows, skippixels, alignment; + +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + if (c < fontinfo->first || + c >= fontinfo->first + fontinfo->num_chars) + return; + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) { + /* Save current modes. */ + 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); + /* Little endian machines (DEC Alpha for example) could + benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE + instead of GL_FALSE, but this would require changing the + generated bitmaps too. */ + 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); + glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, + ch->advance, 0, ch->bitmap); + /* Restore saved 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 -Nru xpsb-glx-0.19/mesa/src/glut/glx/glutbitmap.h xpsb-glx-0.19/mesa/src/glut/glx/glutbitmap.h --- xpsb-glx-0.19/mesa/src/glut/glx/glutbitmap.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glutbitmap.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,32 @@ +#ifndef __glutbitmap_h__ +#define __glutbitmap_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#define GLUT_NO_LIB_PRAGMA /* Avoid auto library linking when building + the GLUT library itself. */ +#include + +typedef struct { + const GLsizei width; + const GLsizei height; + const GLfloat xorig; + const GLfloat yorig; + const GLfloat advance; + const GLubyte *bitmap; +} BitmapCharRec, *BitmapCharPtr; + +typedef struct { + const char *name; + const int num_chars; + const int first; + const BitmapCharRec * const *ch; +} BitmapFontRec, *BitmapFontPtr; + +typedef void *GLUTbitmapFont; + +#endif /* __glutbitmap_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_bwidth.c xpsb-glx-0.19/mesa/src/glut/glx/glut_bwidth.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_bwidth.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_bwidth.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,58 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutbitmap.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutBitmapWidth(GLUTbitmapFont font, int c) +{ + BitmapFontPtr fontinfo; + const BitmapCharRec *ch; + +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + if (c < fontinfo->first || c >= fontinfo->first + fontinfo->num_chars) + return 0; + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) + return ch->advance; + else + return 0; +} + +int GLUTAPIENTRY +glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) +{ + int c, length; + BitmapFontPtr fontinfo; + const BitmapCharRec *ch; + +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + length = 0; + for (; *string != '\0'; string++) { + c = *string; + if (c >= fontinfo->first && c < fontinfo->first + fontinfo->num_chars) { + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) + length += ch->advance; + } + } + return length; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_cindex.c xpsb-glx-0.19/mesa/src/glut/glx/glut_cindex.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_cindex.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_cindex.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,252 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include "glutint.h" + +#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i))) + +/* CENTRY */ +void GLUTAPIENTRY +glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ + GLUTcolormap *cmap, *newcmap; + XVisualInfo *vis; + XColor color; + int i; + + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + cmap = __glutCurrentWindow->colormap; + vis = __glutCurrentWindow->vis; + } else { + cmap = __glutCurrentWindow->overlay->colormap; + vis = __glutCurrentWindow->overlay->vis; + if (ndx == __glutCurrentWindow->overlay->transparentPixel) { + __glutWarning( + "glutSetColor: cannot set color of overlay transparent index %d\n", + ndx); + return; + } + } + + if (!cmap) { + __glutWarning("glutSetColor: current window is RGBA"); + return; + } +#if defined(_WIN32) + if (ndx >= 256 || /* always assume 256 colors on Win32 */ +#else + if (ndx >= vis->visual->map_entries || +#endif + ndx < 0) { + __glutWarning("glutSetColor: index %d out of range", ndx); + return; + } + if (cmap->refcnt > 1) { + newcmap = __glutAssociateNewColormap(vis); + cmap->refcnt--; + /* Wouldn't it be nice if XCopyColormapAndFree could be + told not to free the old colormap's entries! */ + for (i = cmap->size - 1; i >= 0; i--) { + if (i == ndx) { + /* We are going to set this cell shortly! */ + continue; + } + if (cmap->cells[i].component[GLUT_RED] >= 0.0) { + color.pixel = i; + newcmap->cells[i].component[GLUT_RED] = + cmap->cells[i].component[GLUT_RED]; + color.red = (GLfloat) 0xffff * + cmap->cells[i].component[GLUT_RED]; + newcmap->cells[i].component[GLUT_GREEN] = + cmap->cells[i].component[GLUT_GREEN]; + color.green = (GLfloat) 0xffff * + cmap->cells[i].component[GLUT_GREEN]; + newcmap->cells[i].component[GLUT_BLUE] = + cmap->cells[i].component[GLUT_BLUE]; + color.blue = (GLfloat) 0xffff * + cmap->cells[i].component[GLUT_BLUE]; + color.flags = DoRed | DoGreen | DoBlue; +#if defined(_WIN32) + if (IsWindowVisible(__glutCurrentWindow->win)) { + XHDC = __glutCurrentWindow->hdc; + } else { + XHDC = 0; + } +#endif + XStoreColor(__glutDisplay, newcmap->cmap, &color); + } else { + /* Leave unallocated entries unallocated. */ + } + } + cmap = newcmap; + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + __glutCurrentWindow->colormap = cmap; + __glutCurrentWindow->cmap = cmap->cmap; + } else { + __glutCurrentWindow->overlay->colormap = cmap; + __glutCurrentWindow->overlay->cmap = cmap->cmap; + } + XSetWindowColormap(__glutDisplay, + __glutCurrentWindow->renderWin, cmap->cmap); + +#if !defined(_WIN32) + { + GLUTwindow *toplevel; + + toplevel = __glutToplevelOf(__glutCurrentWindow); + if (toplevel->cmap != cmap->cmap) { + __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); + } + } +#endif + } + color.pixel = ndx; + red = CLAMP(red); + cmap->cells[ndx].component[GLUT_RED] = red; + color.red = (GLfloat) 0xffff *red; + green = CLAMP(green); + cmap->cells[ndx].component[GLUT_GREEN] = green; + color.green = (GLfloat) 0xffff *green; + blue = CLAMP(blue); + cmap->cells[ndx].component[GLUT_BLUE] = blue; + color.blue = (GLfloat) 0xffff *blue; + color.flags = DoRed | DoGreen | DoBlue; +#if defined(_WIN32) + if (IsWindowVisible(__glutCurrentWindow->win)) { + XHDC = __glutCurrentWindow->hdc; + } else { + XHDC = 0; + } +#endif + XStoreColor(__glutDisplay, cmap->cmap, &color); +} + +GLfloat GLUTAPIENTRY +glutGetColor(int ndx, int comp) +{ + GLUTcolormap *colormap; + XVisualInfo *vis; + + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + colormap = __glutCurrentWindow->colormap; + vis = __glutCurrentWindow->vis; + } else { + colormap = __glutCurrentWindow->overlay->colormap; + vis = __glutCurrentWindow->overlay->vis; + if (ndx == __glutCurrentWindow->overlay->transparentPixel) { + __glutWarning("glutGetColor: requesting overlay transparent index %d\n", + ndx); + return -1.0; + } + } + + if (!colormap) { + __glutWarning("glutGetColor: current window is RGBA"); + return -1.0; + } +#if defined(_WIN32) +#define OUT_OF_RANGE_NDX(ndx) (ndx >= 256 || ndx < 0) +#else +#define OUT_OF_RANGE_NDX(ndx) (ndx >= vis->visual->map_entries || ndx < 0) +#endif + if (OUT_OF_RANGE_NDX(ndx)) { + __glutWarning("glutGetColor: index %d out of range", ndx); + return -1.0; + } + return colormap->cells[ndx].component[comp]; +} + +void GLUTAPIENTRY +glutCopyColormap(int winnum) +{ + GLUTwindow *window = __glutWindowList[winnum - 1]; + GLUTcolormap *oldcmap, *newcmap; + XVisualInfo *dstvis; + + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + oldcmap = __glutCurrentWindow->colormap; + dstvis = __glutCurrentWindow->vis; + newcmap = window->colormap; + } else { + oldcmap = __glutCurrentWindow->overlay->colormap; + dstvis = __glutCurrentWindow->overlay->vis; + if (!window->overlay) { + __glutWarning("glutCopyColormap: window %d has no overlay", winnum); + return; + } + newcmap = window->overlay->colormap; + } + + if (!oldcmap) { + __glutWarning("glutCopyColormap: destination colormap must be color index"); + return; + } + if (!newcmap) { + __glutWarning( + "glutCopyColormap: source colormap of window %d must be color index", + winnum); + return; + } + if (newcmap == oldcmap) { + /* Source and destination are the same; now copy needed. */ + return; + } +#if !defined(_WIN32) + /* Play safe: compare visual IDs, not Visual*'s. */ + if (newcmap->visual->visualid == oldcmap->visual->visualid) { +#endif + /* Visuals match! "Copy" by reference... */ + __glutFreeColormap(oldcmap); + newcmap->refcnt++; + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + __glutCurrentWindow->colormap = newcmap; + __glutCurrentWindow->cmap = newcmap->cmap; + } else { + __glutCurrentWindow->overlay->colormap = newcmap; + __glutCurrentWindow->overlay->cmap = newcmap->cmap; + } + XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin, + newcmap->cmap); +#if !defined(_WIN32) + __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); + } else { + GLUTcolormap *copycmap; + XColor color; + int i, last; + + /* Visuals different - need a distinct X colormap! */ + copycmap = __glutAssociateNewColormap(dstvis); + /* Wouldn't it be nice if XCopyColormapAndFree could be + told not to free the old colormap's entries! */ + last = newcmap->size; + if (last > copycmap->size) { + last = copycmap->size; + } + for (i = last - 1; i >= 0; i--) { + if (newcmap->cells[i].component[GLUT_RED] >= 0.0) { + color.pixel = i; + copycmap->cells[i].component[GLUT_RED] = + newcmap->cells[i].component[GLUT_RED]; + color.red = (GLfloat) 0xffff * + newcmap->cells[i].component[GLUT_RED]; + copycmap->cells[i].component[GLUT_GREEN] = + newcmap->cells[i].component[GLUT_GREEN]; + color.green = (GLfloat) 0xffff * + newcmap->cells[i].component[GLUT_GREEN]; + copycmap->cells[i].component[GLUT_BLUE] = + newcmap->cells[i].component[GLUT_BLUE]; + color.blue = (GLfloat) 0xffff * + newcmap->cells[i].component[GLUT_BLUE]; + color.flags = DoRed | DoGreen | DoBlue; + XStoreColor(__glutDisplay, copycmap->cmap, &color); + } + } + } +#endif +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_cmap.c xpsb-glx-0.19/mesa/src/glut/glx/glut_cmap.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_cmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_cmap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,419 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include /* SunOS multithreaded assert() needs . Lame. */ +#include +#if !defined(_WIN32) +#include +#include +#include /* for XA_RGB_DEFAULT_MAP atom */ +#if defined(__vms) +#include /* for XmuLookupStandardColormap */ +#else +#include /* for XmuLookupStandardColormap */ +#endif +#endif + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif + +#include "glutint.h" +#include "layerutil.h" + +GLUTcolormap *__glutColormapList = NULL; + +GLUTcolormap * +__glutAssociateNewColormap(XVisualInfo * vis) +{ + GLUTcolormap *cmap; + int transparentPixel, i; + unsigned long pixels[255]; + + cmap = (GLUTcolormap *) malloc(sizeof(GLUTcolormap)); + if (!cmap) + __glutFatalError("out of memory."); +#if defined(_WIN32) + pixels[0] = 0; /* avoid compilation warnings on win32 */ + cmap->visual = 0; + cmap->size = 256; /* always assume 256 on Win32 */ +#else + cmap->visual = vis->visual; + cmap->size = vis->visual->map_entries; +#endif + cmap->refcnt = 1; + cmap->cells = (GLUTcolorcell *) + malloc(sizeof(GLUTcolorcell) * cmap->size); + if (!cmap->cells) + __glutFatalError("out of memory."); + /* make all color cell entries be invalid */ + for (i = cmap->size - 1; i >= 0; i--) { + cmap->cells[i].component[GLUT_RED] = -1.0; + cmap->cells[i].component[GLUT_GREEN] = -1.0; + cmap->cells[i].component[GLUT_BLUE] = -1.0; + } + transparentPixel = __glutGetTransparentPixel(__glutDisplay, vis); + if (transparentPixel == -1 || transparentPixel >= cmap->size) { + + /* If there is no transparent pixel or if the transparent + pixel is outside the range of valid colormap cells (HP + can implement their overlays this smart way since their + transparent pixel is 255), we can AllocAll the colormap. + See note below. */ + + cmap->cmap = XCreateColormap(__glutDisplay, + __glutRoot, cmap->visual, AllocAll); + } else { + + /* On machines where zero (or some other value in the range + of 0 through map_entries-1), BadAlloc may be generated + when an AllocAll overlay colormap is allocated since the + transparent pixel precludes all the cells in the colormap + being allocated (the transparent pixel is pre-allocated). + So in this case, use XAllocColorCells to allocate + map_entries-1 pixels (that is, all but the transparent + pixel. */ + +#if defined(_WIN32) + cmap->cmap = XCreateColormap(__glutDisplay, + __glutRoot, 0, AllocNone); +#else + cmap->cmap = XCreateColormap(__glutDisplay, + __glutRoot, vis->visual, AllocNone); + XAllocColorCells(__glutDisplay, cmap->cmap, False, 0, 0, + pixels, cmap->size - 1); +#endif + } + cmap->next = __glutColormapList; + __glutColormapList = cmap; + return cmap; +} + +static GLUTcolormap * +associateColormap(XVisualInfo * vis) +{ +#if !defined(_WIN32) + GLUTcolormap *cmap = __glutColormapList; + + while (cmap != NULL) { + /* Play safe: compare visual IDs, not Visual*'s. */ + if (cmap->visual->visualid == vis->visual->visualid) { + /* Already have created colormap for the visual. */ + cmap->refcnt++; + return cmap; + } + cmap = cmap->next; + } +#endif + return __glutAssociateNewColormap(vis); +} + +void +__glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap) +{ +#if defined(_WIN32) + if (vi->dwFlags & PFD_NEED_PALETTE || vi->iPixelType == PFD_TYPE_COLORINDEX) { + *colormap = associateColormap(vi); + *cmap = (*colormap)->cmap; + } else { + *colormap = NULL; + *cmap = 0; + } +#else + Status status; + XStandardColormap *standardCmaps; + int i, numCmaps; + static Atom hpColorRecoveryAtom = -1; + int isRGB, visualClass, rc; + +#if defined(__cplusplus) || defined(c_plusplus) + visualClass = vi->c_class; +#else + visualClass = vi->class; +#endif + switch (visualClass) { + case PseudoColor: + /* Mesa might return a PseudoColor visual for RGB mode. */ + rc = glXGetConfig(__glutDisplay, vi, GLX_RGBA, &isRGB); + if (rc == 0 && isRGB) { + /* Must be Mesa. */ + *colormap = NULL; + if (MaxCmapsOfScreen(DefaultScreenOfDisplay(__glutDisplay)) == 1 + && vi->visual == DefaultVisual(__glutDisplay, __glutScreen)) { + char *privateCmap = getenv("MESA_PRIVATE_CMAP"); + + if (privateCmap) { + /* User doesn't want to share colormaps. */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + } else { + /* Share the root colormap. */ + *cmap = DefaultColormap(__glutDisplay, __glutScreen); + } + } else { + /* Get our own PseudoColor colormap. */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + } + } else { + /* CI mode, real GLX never returns a PseudoColor visual + for RGB mode. */ + *colormap = associateColormap(vi); + *cmap = (*colormap)->cmap; + } + break; + case TrueColor: + *colormap = NULL; /* NULL if RGBA */ + + /* Hewlett-Packard supports a feature called "HP Color + Recovery". Mesa has code to use HP Color Recovery. For + Mesa to use this feature, the atom + _HP_RGB_SMOOTH_MAP_LIST must be defined on the root + window AND the colormap obtainable by XGetRGBColormaps + for that atom must be set on the window. If that + colormap is not set, the output will look stripy. */ + + if (hpColorRecoveryAtom == -1) { + char *xvendor; + +#define VENDOR_HP "Hewlett-Packard" + + /* Only makes sense to make XInternAtom round-trip if we + know that we are connected to an HP X server. */ + xvendor = ServerVendor(__glutDisplay); + if (!strncmp(xvendor, VENDOR_HP, sizeof(VENDOR_HP) - 1)) { + hpColorRecoveryAtom = XInternAtom(__glutDisplay, "_HP_RGB_SMOOTH_MAP_LIST", True); + } else { + hpColorRecoveryAtom = None; + } + } + if (hpColorRecoveryAtom != None) { + status = XGetRGBColormaps(__glutDisplay, __glutRoot, + &standardCmaps, &numCmaps, hpColorRecoveryAtom); + if (status == 1) { + for (i = 0; i < numCmaps; i++) { + if (standardCmaps[i].visualid == vi->visualid) { + *cmap = standardCmaps[i].colormap; + XFree(standardCmaps); + return; + } + } + XFree(standardCmaps); + } + } +#ifndef SOLARIS_2_4_BUG + /* Solaris 2.4 and 2.5 have a bug in their + XmuLookupStandardColormap implementations. Please + compile your Solaris 2.4 or 2.5 version of GLUT with + -DSOLARIS_2_4_BUG to work around this bug. The symptom + of the bug is that programs will get a BadMatch error + from X_CreateWindow when creating a GLUT window because + Solaris 2.4 and 2.5 create a corrupted RGB_DEFAULT_MAP + property. Note that this workaround prevents Colormap + sharing between applications, perhaps leading + unnecessary colormap installations or colormap flashing. + Sun fixed this bug in Solaris 2.6. */ + status = XmuLookupStandardColormap(__glutDisplay, + vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP, + /* replace */ False, /* retain */ True); + if (status == 1) { + status = XGetRGBColormaps(__glutDisplay, __glutRoot, + &standardCmaps, &numCmaps, XA_RGB_DEFAULT_MAP); + if (status == 1) { + for (i = 0; i < numCmaps; i++) { + if (standardCmaps[i].visualid == vi->visualid) { + *cmap = standardCmaps[i].colormap; + XFree(standardCmaps); + return; + } + } + XFree(standardCmaps); + } + } +#endif + /* If no standard colormap but TrueColor, just make a + private one. */ + /* XXX Should do a better job of internal sharing for + privately allocated TrueColor colormaps. */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + break; + case DirectColor: + *colormap = NULL; /* NULL if RGBA */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocAll); + if (vi->depth == 24) { + /* init the red, green, blue maps to linear ramps */ + XColor xc[256]; + int i; + for (i = 0; i < 256; i++) { + xc[i].pixel = (i << 16) | (i << 8) | i; + xc[i].red = (i << 8) | i; + xc[i].green = (i << 8) | i; + xc[i].blue = (i << 8) | i; + xc[i].flags = DoRed | DoGreen | DoBlue; + } + XStoreColors(__glutDisplay, *cmap, xc, 256); + } + else { + fprintf(stderr, "GLUT Error: DirectColor visuals other than 24-bits " + "not fully supported.\n"); + } + break; + case StaticColor: + case StaticGray: + case GrayScale: + /* Mesa supports these visuals */ + *colormap = NULL; + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + break; + default: + __glutFatalError( + "could not allocate colormap for visual type: %d.", + visualClass); + } + return; +#endif +} + +#if !defined(_WIN32) +static int +findColormaps(GLUTwindow * window, + Window * winlist, Colormap * cmaplist, int num, int max) +{ + GLUTwindow *child; + int i; + + /* Do not allow more entries that maximum number of + colormaps! */ + if (num >= max) + return num; + /* Is cmap for this window already on the list? */ + for (i = 0; i < num; i++) { + if (cmaplist[i] == window->cmap) + goto normalColormapAlreadyListed; + } + /* Not found on the list; add colormap and window. */ + winlist[num] = window->win; + cmaplist[num] = window->cmap; + num++; + +normalColormapAlreadyListed: + + /* Repeat above but for the overlay colormap if there one. */ + if (window->overlay) { + if (num >= max) + return num; + for (i = 0; i < num; i++) { + if (cmaplist[i] == window->overlay->cmap) + goto overlayColormapAlreadyListed; + } + winlist[num] = window->overlay->win; + cmaplist[num] = window->overlay->cmap; + num++; + } +overlayColormapAlreadyListed: + + /* Recursively search children. */ + child = window->children; + while (child) { + num = findColormaps(child, winlist, cmaplist, num, max); + child = child->siblings; + } + return num; +} + +void +__glutEstablishColormapsProperty(GLUTwindow * window) +{ + /* this routine is strictly X. Win32 doesn't need to do + anything of this sort (but has to do other wacky stuff + later). */ + static Atom wmColormapWindows = None; + Window *winlist; + Colormap *cmaplist; + Status status; + int maxcmaps, num; + + assert(!window->parent); + maxcmaps = MaxCmapsOfScreen(ScreenOfDisplay(__glutDisplay, + __glutScreen)); + /* For portability reasons we don't use alloca for winlist + and cmaplist, but we could. */ + winlist = (Window *) malloc(maxcmaps * sizeof(Window)); + cmaplist = (Colormap *) malloc(maxcmaps * sizeof(Colormap)); + num = findColormaps(window, winlist, cmaplist, 0, maxcmaps); + if (num < 2) { + /* Property no longer needed; remove it. */ + wmColormapWindows = XSGIFastInternAtom(__glutDisplay, + "WM_COLORMAP_WINDOWS", SGI_XA_WM_COLORMAP_WINDOWS, False); + if (wmColormapWindows == None) { + __glutWarning("Could not intern X atom for WM_COLORMAP_WINDOWS."); + return; + } + XDeleteProperty(__glutDisplay, window->win, wmColormapWindows); + } else { + status = XSetWMColormapWindows(__glutDisplay, window->win, + winlist, num); + /* XSetWMColormapWindows should always work unless the + WM_COLORMAP_WINDOWS property cannot be intern'ed. We + check to be safe. */ + if (status == False) + __glutFatalError("XSetWMColormapWindows returned False."); + } + /* For portability reasons we don't use alloca for winlist + and cmaplist, but we could. */ + free(winlist); + free(cmaplist); +} + +GLUTwindow * +__glutToplevelOf(GLUTwindow * window) +{ + while (window->parent) { + window = window->parent; + } + return window; +} +#endif + +void +__glutFreeColormap(GLUTcolormap * cmap) +{ + GLUTcolormap *cur, **prev; + + cmap->refcnt--; + if (cmap->refcnt == 0) { + /* remove from colormap list */ + cur = __glutColormapList; + prev = &__glutColormapList; + while (cur) { + if (cur == cmap) { + *prev = cmap->next; + break; + } + prev = &(cur->next); + cur = cur->next; + } + /* actually free colormap */ + XFreeColormap(__glutDisplay, cmap->cmap); + free(cmap->cells); + free(cmap); + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_cursor.c xpsb-glx-0.19/mesa/src/glut/glx/glut_cursor.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_cursor.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_cursor.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,201 @@ + +/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +#if !defined(_WIN32) +#include /* For XA_CURSOR */ +#include +#endif + +typedef struct _CursorTable { +#if defined(_WIN32) + char* glyph; +#else + int glyph; +#endif + Cursor cursor; +} CursorTable; +/* *INDENT-OFF* */ + +static CursorTable cursorTable[] = { + {XC_arrow, None}, /* GLUT_CURSOR_RIGHT_ARROW */ + {XC_top_left_arrow, None}, /* GLUT_CURSOR_LEFT_ARROW */ + {XC_hand1, None}, /* GLUT_CURSOR_INFO */ + {XC_pirate, None}, /* GLUT_CURSOR_DESTROY */ + {XC_question_arrow, None}, /* GLUT_CURSOR_HELP */ + {XC_exchange, None}, /* GLUT_CURSOR_CYCLE */ + {XC_spraycan, None}, /* GLUT_CURSOR_SPRAY */ + {XC_watch, None}, /* GLUT_CURSOR_WAIT */ + {XC_xterm, None}, /* GLUT_CURSOR_TEXT */ + {XC_crosshair, None}, /* GLUT_CURSOR_CROSSHAIR */ + {XC_sb_v_double_arrow, None}, /* GLUT_CURSOR_UP_DOWN */ + {XC_sb_h_double_arrow, None}, /* GLUT_CURSOR_LEFT_RIGHT */ + {XC_top_side, None}, /* GLUT_CURSOR_TOP_SIDE */ + {XC_bottom_side, None}, /* GLUT_CURSOR_BOTTOM_SIDE */ + {XC_left_side, None}, /* GLUT_CURSOR_LEFT_SIDE */ + {XC_right_side, None}, /* GLUT_CURSOR_RIGHT_SIDE */ + {XC_top_left_corner, None}, /* GLUT_CURSOR_TOP_LEFT_CORNER */ + {XC_top_right_corner, None}, /* GLUT_CURSOR_TOP_RIGHT_CORNER */ + {XC_bottom_right_corner, None}, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */ + {XC_bottom_left_corner, None}, /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */ +}; +/* *INDENT-ON* */ + +#if !defined(_WIN32) +static Cursor blankCursor = None; +static Cursor fullCrosshairCusor = None; + +/* SGI X server's support a special property called the + _SGI_CROSSHAIR_CURSOR that when installed as a window's + cursor, becomes a full screen crosshair cursor. SGI + has special cursor generation hardware for this case. */ +static Cursor +getFullCrosshairCursor(void) +{ + Cursor cursor; + Atom crosshairAtom, actualType; + int rc, actualFormat; + unsigned long n, left; + unsigned char *value; + + if (fullCrosshairCusor == None) { + crosshairAtom = XInternAtom(__glutDisplay, + "_SGI_CROSSHAIR_CURSOR", True); + if (crosshairAtom != None) { + value = 0; /* Make compiler happy. */ + rc = XGetWindowProperty(__glutDisplay, __glutRoot, + crosshairAtom, 0, 1, False, XA_CURSOR, &actualType, + &actualFormat, &n, &left, &value); + if (rc == Success && actualFormat == 32 && n >= 1) { + cursor = ((unsigned long *)value)[0]; + XFree(value); + return cursor; + } + } + } + return XCreateFontCursor(__glutDisplay, XC_crosshair); +} + +/* X11 forces you to create a blank cursor if you want + to disable the cursor. */ +static Cursor +makeBlankCursor(void) +{ + static char data[1] = + {0}; + Cursor cursor; + Pixmap blank; + XColor dummy; + + blank = XCreateBitmapFromData(__glutDisplay, __glutRoot, + data, 1, 1); + if (blank == None) + __glutFatalError("out of memory."); + cursor = XCreatePixmapCursor(__glutDisplay, blank, blank, + &dummy, &dummy, 0, 0); + XFreePixmap(__glutDisplay, blank); + + return cursor; +} +#endif /* !_WIN32 */ + +/* Win32 and X11 use this same function to accomplish + fairly different tasks. X11 lets you just define the + cursor for a window and the window system takes care + of making sure that the window's cursor is installed + when the mouse is in the window. Win32 requires the + application to handle a WM_SETCURSOR message to install + the right cursor when windows are entered. Think of + the Win32 __glutSetCursor (called from __glutWindowProc) + as "install cursor". Think of the X11 __glutSetCursor + (called from glutSetCursor) as "define cursor". */ +void +__glutSetCursor(GLUTwindow *window) +{ + int cursor = window->cursor; + Cursor xcursor = 0; + + if (cursor >= 0 && + cursor < sizeof(cursorTable) / sizeof(cursorTable[0])) { + if (cursorTable[cursor].cursor == None) { + cursorTable[cursor].cursor = XCreateFontCursor(__glutDisplay, + cursorTable[cursor].glyph); + } + xcursor = cursorTable[cursor].cursor; + } else { + /* Special cases. */ + switch (cursor) { + case GLUT_CURSOR_INHERIT: +#if defined(_WIN32) + while (window->parent) { + window = window->parent; + if (window->cursor != GLUT_CURSOR_INHERIT) { + __glutSetCursor(window); + return; + } + } + /* XXX Default to an arrow cursor. Is this + right or should we be letting the default + window proc be installing some system cursor? */ + xcursor = cursorTable[0].cursor; + if (xcursor == NULL) { + xcursor = + cursorTable[0].cursor = + LoadCursor(NULL, cursorTable[0].glyph); + } +#else + xcursor = None; +#endif + break; + case GLUT_CURSOR_NONE: +#if defined(_WIN32) + xcursor = NULL; +#else + if (blankCursor == None) { + blankCursor = makeBlankCursor(); + } + xcursor = blankCursor; +#endif + break; + case GLUT_CURSOR_FULL_CROSSHAIR: +#if defined(_WIN32) + xcursor = (HICON) IDC_CROSS; +#else + if (fullCrosshairCusor == None) { + fullCrosshairCusor = getFullCrosshairCursor(); + } + xcursor = fullCrosshairCusor; +#endif + break; + } + } + XDefineCursor(__glutDisplay, + window->win, xcursor); + XFlush(__glutDisplay); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSetCursor(int cursor) +{ +#ifdef _WIN32 + POINT point; + + __glutCurrentWindow->cursor = cursor; + /* Are we in the window right now? If so, + install the cursor. */ + GetCursorPos(&point); + if (__glutCurrentWindow->win == WindowFromPoint(point)) { + __glutSetCursor(__glutCurrentWindow); + } +#else + __glutCurrentWindow->cursor = cursor; + __glutSetCursor(__glutCurrentWindow); +#endif +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut.def xpsb-glx-0.19/mesa/src/glut/glx/glut.def --- xpsb-glx-0.19/mesa/src/glut/glx/glut.def 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut.def 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,131 @@ +DESCRIPTION 'OpenGL Utility Toolkit for Win32' + +VERSION 3.7 + +EXPORTS + + glutAddMenuEntry + glutAddSubMenu + glutAttachMenu + glutBitmapCharacter + glutBitmapLength + glutBitmapWidth + glutButtonBoxFunc + glutChangeToMenuEntry + glutChangeToSubMenu + glutCopyColormap + glutCreateMenu + __glutCreateMenuWithExit + glutCreateSubWindow + glutCreateWindow + __glutCreateWindowWithExit + glutDestroyMenu + glutDestroyWindow + glutDetachMenu + glutDeviceGet + glutDialsFunc + glutDisplayFunc + glutEnterGameMode + glutEntryFunc + glutEstablishOverlay + glutExtensionSupported + glutForceJoystickFunc + glutFullScreen + glutGameModeGet + glutGameModeString + glutGet + glutGetColor + glutGetMenu + glutGetModifiers + glutGetWindow + glutHideOverlay + glutHideWindow + glutIconifyWindow + glutIdleFunc + glutIgnoreKeyRepeat + glutInit + __glutInitWithExit + glutInitDisplayMode + glutInitDisplayString + glutInitWindowPosition + glutInitWindowSize + glutJoystickFunc + glutKeyboardFunc + glutKeyboardUpFunc + glutLayerGet + glutLeaveGameMode + glutMainLoop + glutMenuStateFunc + glutMenuStatusFunc + glutMotionFunc + glutMouseFunc + glutOverlayDisplayFunc + glutPassiveMotionFunc + glutPopWindow + glutPositionWindow + glutPostOverlayRedisplay + glutPostRedisplay + glutPostWindowOverlayRedisplay + glutPostWindowRedisplay + glutPushWindow + glutRemoveMenuItem + glutRemoveOverlay + glutReportErrors + glutReshapeFunc + glutReshapeWindow + glutSetColor + glutSetCursor + glutSetIconTitle + glutSetKeyRepeat + glutSetMenu + glutSetWindow + glutSetWindowTitle + glutSetupVideoResizing + glutShowOverlay + glutShowWindow + glutSolidCone + glutSolidCube + glutSolidDodecahedron + glutSolidIcosahedron + glutSolidOctahedron + glutSolidSphere + glutSolidTeapot + glutSolidTetrahedron + glutSolidTorus + glutSpaceballButtonFunc + glutSpaceballMotionFunc + glutSpaceballRotateFunc + glutSpecialFunc + glutSpecialUpFunc + glutStopVideoResizing + glutStrokeCharacter + glutStrokeLength + glutStrokeWidth + glutSwapBuffers + glutTabletButtonFunc + glutTabletMotionFunc + glutTimerFunc + glutUseLayer + glutVideoPan + glutVideoResize + glutVideoResizeGet + glutVisibilityFunc + glutWarpPointer + glutWindowStatusFunc + glutWireCone + glutWireCube + glutWireDodecahedron + glutWireIcosahedron + glutWireOctahedron + glutWireSphere + glutWireTeapot + glutWireTetrahedron + glutWireTorus + glutStrokeRoman + glutBitmap9By15 + glutBitmapHelvetica10 + glutBitmapHelvetica18 + glutBitmapTimesRoman24 +; __glutSetFCB +; __glutGetFCB + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_dials.c xpsb-glx-0.19/mesa/src/glut/glx/glut_dials.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_dials.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_dials.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,26 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +void GLUTAPIENTRY +glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc) +{ + __glutCurrentWindow->buttonBox = buttonBoxFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); +} + +void GLUTAPIENTRY +glutDialsFunc(GLUTdialsCB dialsFunc) +{ + __glutCurrentWindow->dials = dialsFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_dstr.c xpsb-glx-0.19/mesa/src/glut/glx/glut_dstr.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_dstr.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_dstr.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1624 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include +#include +#include "glutint.h" + +/* glxcaps matches the criteria macros listed in glutint.h, but + only list the first set (those that correspond to GLX visual + attributes). */ +static int glxcap[NUM_GLXCAPS] = +{ + GLX_RGBA, + GLX_BUFFER_SIZE, + GLX_DOUBLEBUFFER, + GLX_STEREO, + GLX_AUX_BUFFERS, + GLX_RED_SIZE, + GLX_GREEN_SIZE, + GLX_BLUE_SIZE, + GLX_ALPHA_SIZE, + GLX_DEPTH_SIZE, + GLX_STENCIL_SIZE, + GLX_ACCUM_RED_SIZE, + GLX_ACCUM_GREEN_SIZE, + GLX_ACCUM_BLUE_SIZE, + GLX_ACCUM_ALPHA_SIZE, + GLX_LEVEL, +}; + +#ifdef TEST + +#if !defined(_WIN32) +char *__glutProgramName = "dstr"; +Display *__glutDisplay; +int __glutScreen; +XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask, void **fbc) = NULL; +char *__glutDisplayString = NULL; +#endif +static int verbose = 0; + +static char *compstr[] = +{ + "none", "=", "!=", "<=", ">=", ">", "<", "~" +}; +static char *capstr[] = +{ + "rgba", "bufsize", "double", "stereo", "auxbufs", "red", "green", "blue", "alpha", + "depth", "stencil", "acred", "acgreen", "acblue", "acalpha", "level", "xvisual", + "transparent", "samples", "xstaticgray", "xgrayscale", "xstaticcolor", "xpseudocolor", + "xtruecolor", "xdirectcolor", "slow", "conformant", "num" +}; + +static void +printCriteria(Criterion * criteria, int ncriteria) +{ + int i; + printf("Criteria: %d\n", ncriteria); + for (i = 0; i < ncriteria; i++) { + printf(" %s %s %d\n", + capstr[criteria[i].capability], + compstr[criteria[i].comparison], + criteria[i].value); + } +} + +#endif /* TEST */ + +static int isMesaGLX = -1; + +static int +determineMesaGLX(void) +{ +#ifdef GLX_VERSION_1_1 + const char *vendor, *version, *ch; + + vendor = glXGetClientString(__glutDisplay, GLX_VENDOR); + if (!strcmp(vendor, "Brian Paul")) { + version = glXGetClientString(__glutDisplay, GLX_VERSION); + for (ch = version; *ch != ' ' && *ch != '\0'; ch++); + for (; *ch == ' ' && *ch != '\0'; ch++); + +#define MESA_NAME "Mesa " /* Trailing space is intentional. */ + + if (!strncmp(MESA_NAME, ch, sizeof(MESA_NAME) - 1)) { + return 1; + } + } +#else + /* Recent versions for Mesa should support GLX 1.1 and + therefore glXGetClientString. If we get into this case, + we would be compiling against a true OpenGL not supporting + GLX 1.1, and the resulting compiled library won't work well + with Mesa then. */ +#endif + return 0; +} + +static XVisualInfo ** +getMesaVisualList(int *n) +{ + XVisualInfo **vlist, *vinfo; + int attribs[23]; + int i, x, cnt; + + vlist = (XVisualInfo **) malloc((32 + 16) * sizeof(XVisualInfo *)); + if (!vlist) + __glutFatalError("out of memory."); + + cnt = 0; + for (i = 0; i < 32; i++) { + x = 0; + attribs[x] = GLX_RGBA; + x++; + attribs[x] = GLX_RED_SIZE; + x++; + attribs[x] = 1; + x++; + attribs[x] = GLX_GREEN_SIZE; + x++; + attribs[x] = 1; + x++; + attribs[x] = GLX_BLUE_SIZE; + x++; + attribs[x] = 1; + x++; + if (i & 1) { + attribs[x] = GLX_DEPTH_SIZE; + x++; + attribs[x] = 1; + x++; + } + if (i & 2) { + attribs[x] = GLX_STENCIL_SIZE; + x++; + attribs[x] = 1; + x++; + } + if (i & 4) { + attribs[x] = GLX_ACCUM_RED_SIZE; + x++; + attribs[x] = 1; + x++; + attribs[x] = GLX_ACCUM_GREEN_SIZE; + x++; + attribs[x] = 1; + x++; + attribs[x] = GLX_ACCUM_BLUE_SIZE; + x++; + attribs[x] = 1; + x++; + } + if (i & 8) { + attribs[x] = GLX_ALPHA_SIZE; + x++; + attribs[x] = 1; + x++; + if (i & 4) { + attribs[x] = GLX_ACCUM_ALPHA_SIZE; + x++; + attribs[x] = 1; + x++; + } + } + if (i & 16) { + attribs[x] = GLX_DOUBLEBUFFER; + x++; + } + attribs[x] = None; + x++; + assert(x <= sizeof(attribs) / sizeof(attribs[0])); + vinfo = glXChooseVisual(__glutDisplay, __glutScreen, attribs); + if (vinfo) { + vlist[cnt] = vinfo; + cnt++; + } + } + for (i = 0; i < 16; i++) { + x = 0; + if (i & 1) { + attribs[x] = GLX_DEPTH_SIZE; + x++; + attribs[x] = 1; + x++; + } + if (i & 2) { + attribs[x] = GLX_STENCIL_SIZE; + x++; + attribs[x] = 1; + x++; + } + if (i & 4) { + attribs[x] = GLX_DOUBLEBUFFER; + x++; + } + if (i & 8) { + attribs[x] = GLX_LEVEL; + x++; + attribs[x] = 1; + x++; +#if defined(GLX_TRANSPARENT_TYPE_EXT) && defined(GLX_TRANSPARENT_INDEX_EXT) + attribs[x] = GLX_TRANSPARENT_TYPE_EXT; + x++; + attribs[x] = GLX_TRANSPARENT_INDEX_EXT; + x++; +#endif + } + attribs[x] = None; + x++; + assert(x <= sizeof(attribs) / sizeof(attribs[0])); + vinfo = glXChooseVisual(__glutDisplay, __glutScreen, attribs); + if (vinfo) { + vlist[cnt] = vinfo; + cnt++; + } + } + + *n = cnt; + return vlist; +} + +static FrameBufferMode * +loadVisuals(int *nitems_return) +{ + XVisualInfo *vinfo, **vlist, template; + FrameBufferMode *fbmodes, *mode; + int n, i, j, rc, glcapable; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + int multisample; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info) + int visual_info; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_rating) + int visual_rating; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + int fbconfig; +#endif + + isMesaGLX = determineMesaGLX(); + if (isMesaGLX) { + vlist = getMesaVisualList(&n); + } else { +#if !defined(_WIN32) + template.screen = __glutScreen; + vinfo = XGetVisualInfo(__glutDisplay, VisualScreenMask, &template, &n); +#else + vinfo = XGetVisualInfo(__glutDisplay, 0, &template, &n); +#endif + if (vinfo == NULL) { + *nitems_return = 0; + return NULL; + } + assert(n > 0); + + /* Make an array of XVisualInfo* pointers to help the Mesa + case because each glXChooseVisual call returns a + distinct XVisualInfo*, not a handy array like + XGetVisualInfo. (Mesa expects us to return the _exact_ + pointer returned by glXChooseVisual so we could not just + copy the returned structure.) */ + vlist = (XVisualInfo **) malloc(n * sizeof(XVisualInfo *)); + if (!vlist) + __glutFatalError("out of memory."); + for (i = 0; i < n; i++) { + vlist[i] = &vinfo[i]; + } + } + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + multisample = __glutIsSupportedByGLX("GLX_SGIS_multisample"); +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info) + visual_info = __glutIsSupportedByGLX("GLX_EXT_visual_info"); +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_rating) + visual_rating = __glutIsSupportedByGLX("GLX_EXT_visual_rating"); +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + fbconfig = __glutIsSupportedByGLX("GLX_SGIX_fbconfig"); +#endif + + fbmodes = (FrameBufferMode *) malloc(n * sizeof(FrameBufferMode)); + if (fbmodes == NULL) { + *nitems_return = -1; + free(vlist); + return NULL; + } + for (i = 0; i < n; i++) { + mode = &fbmodes[i]; + mode->vi = vlist[i]; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + mode->fbc = NULL; +#endif + rc = glXGetConfig(__glutDisplay, vlist[i], GLX_USE_GL, &glcapable); + if (rc == 0 && glcapable) { + mode->valid = 1; /* Assume the best until proven + otherwise. */ + for (j = 0; j < NUM_GLXCAPS; j++) { + rc = glXGetConfig(__glutDisplay, vlist[i], glxcap[j], &mode->cap[j]); + if (rc != 0) { + mode->valid = 0; + } + } +#if defined(_WIN32) + mode->cap[XVISUAL] = ChoosePixelFormat(XHDC, vlist[i]); +#else + mode->cap[XVISUAL] = (int) vlist[i]->visualid; +#endif + mode->cap[XSTATICGRAY] = 0; + mode->cap[XGRAYSCALE] = 0; + mode->cap[XSTATICCOLOR] = 0; + mode->cap[XPSEUDOCOLOR] = 0; + mode->cap[XTRUECOLOR] = 0; + mode->cap[XDIRECTCOLOR] = 0; +#if !defined(_WIN32) +#if defined(__cplusplus) || defined(c_plusplus) + switch (vlist[i]->c_class) { +#else + switch (vlist[i]->class) { +#endif + case StaticGray: + mode->cap[XSTATICGRAY] = 1; + break; + case GrayScale: + mode->cap[XGRAYSCALE] = 1; + break; + case StaticColor: + mode->cap[XSTATICCOLOR] = 1; + break; + case PseudoColor: + mode->cap[XPSEUDOCOLOR] = 1; + break; + case TrueColor: + mode->cap[XTRUECOLOR] = 1; + break; + case DirectColor: + mode->cap[XDIRECTCOLOR] = 1; + break; + } +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_rating) + if (visual_rating) { + int rating; + +/* babcock@cs.montana.edu reported that DEC UNIX (OSF1) V4.0 + 564 for Alpha did not properly define GLX_VISUAL_CAVEAT_EXT + in despite claiming to support + GLX_EXT_visual_rating. */ +#ifndef GLX_VISUAL_CAVEAT_EXT +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#endif + + rc = glXGetConfig(__glutDisplay, + vlist[i], GLX_VISUAL_CAVEAT_EXT, &rating); + if (rc != 0) { + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 1; + } else { + switch (rating) { + case GLX_SLOW_VISUAL_EXT: + mode->cap[SLOW] = 1; + mode->cap[CONFORMANT] = 1; + break; + +/* IRIX 5.3 for the R10K Indigo2 may have shipped without this + properly defined in /usr/include/GL/glxtokens.h */ +#ifndef GLX_NON_CONFORMANT_VISUAL_EXT +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +#endif + + case GLX_NON_CONFORMANT_VISUAL_EXT: + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 0; + break; + case GLX_NONE_EXT: + default: /* XXX Hopefully this is a good default + assumption. */ + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 1; + break; + } + } + } else { + mode->cap[TRANSPARENT] = 0; + } +#else + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 1; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info) + if (visual_info) { + int transparent; + +/* babcock@cs.montana.edu reported that DEC UNIX (OSF1) V4.0 + 564 for Alpha did not properly define + GLX_TRANSPARENT_TYPE_EXT in despite claiming to + support GLX_EXT_visual_info. */ +#ifndef GLX_TRANSPARENT_TYPE_EXT +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#endif + + rc = glXGetConfig(__glutDisplay, + vlist[i], GLX_TRANSPARENT_TYPE_EXT, &transparent); + if (rc != 0) { + mode->cap[TRANSPARENT] = 0; + } else { + mode->cap[TRANSPARENT] = (transparent != GLX_NONE_EXT); + } + } else { + mode->cap[TRANSPARENT] = 0; + } +#else + mode->cap[TRANSPARENT] = 0; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + if (multisample) { + rc = glXGetConfig(__glutDisplay, + vlist[i], GLX_SAMPLES_SGIS, &mode->cap[SAMPLES]); + if (rc != 0) { + mode->cap[SAMPLES] = 0; + } + } else { + mode->cap[SAMPLES] = 0; + } +#else + mode->cap[SAMPLES] = 0; +#endif + } else { +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + if (fbconfig) { + GLXFBConfigSGIX fbc; + int fbconfigID, drawType, renderType; + + fbc = __glut_glXGetFBConfigFromVisualSGIX(__glutDisplay, vlist[i]); + if (fbc) { + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, fbc, + GLX_FBCONFIG_ID_SGIX, &fbconfigID); + if ((rc == 0) && (fbconfigID != None)) { + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, fbc, + GLX_DRAWABLE_TYPE_SGIX, &drawType); + if ((rc == 0) && (drawType & GLX_WINDOW_BIT_SGIX)) { + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, fbc, + GLX_RENDER_TYPE_SGIX, &renderType); + if ((rc == 0) && (renderType & GLX_RGBA_BIT_SGIX)) { + mode->fbc = fbc; + mode->valid = 1; /* Assume the best until + proven otherwise. */ + + assert(glxcap[0] == GLX_RGBA); + mode->cap[0] = 1; + + /* Start with "j = 1" to skip the GLX_RGBA attribute. */ + for (j = 1; j < NUM_GLXCAPS; j++) { + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, + fbc, glxcap[j], &mode->cap[j]); + if (rc != 0) { + mode->valid = 0; + } + } + + mode->cap[XVISUAL] = (int) vlist[i]->visualid; + mode->cap[XSTATICGRAY] = 0; + mode->cap[XGRAYSCALE] = 0; + mode->cap[XSTATICCOLOR] = 0; + mode->cap[XPSEUDOCOLOR] = 0; + mode->cap[XTRUECOLOR] = 0; + mode->cap[XDIRECTCOLOR] = 0; +#if defined(__cplusplus) || defined(c_plusplus) + switch (vlist[i]->c_class) { +#else + switch (vlist[i]->class) { +#endif + case StaticGray: + mode->cap[XSTATICGRAY] = 1; + break; + case GrayScale: + mode->cap[XGRAYSCALE] = 1; + break; + case StaticColor: + mode->cap[XSTATICCOLOR] = 1; + break; + case PseudoColor: + mode->cap[XPSEUDOCOLOR] = 1; + break; + case TrueColor: + mode->cap[XTRUECOLOR] = 1; + break; + case DirectColor: + mode->cap[XDIRECTCOLOR] = 1; + break; + } +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_rating) + if (visual_rating) { + int rating; + +/* babcock@cs.montana.edu reported that DEC UNIX (OSF1) V4.0 + 564 for Alpha did not properly define GLX_VISUAL_CAVEAT_EXT + in despite claiming to support + GLX_EXT_visual_rating. */ +#ifndef GLX_VISUAL_CAVEAT_EXT +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#endif + + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, + fbc, GLX_VISUAL_CAVEAT_EXT, &rating); + if (rc != 0) { + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 1; + } else { + switch (rating) { + case GLX_SLOW_VISUAL_EXT: + mode->cap[SLOW] = 1; + mode->cap[CONFORMANT] = 1; + break; + +/* IRIX 5.3 for the R10K Indigo2 may have shipped without this + properly defined in /usr/include/GL/glxtokens.h */ +#ifndef GLX_NON_CONFORMANT_VISUAL_EXT +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +#endif + + case GLX_NON_CONFORMANT_VISUAL_EXT: + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 0; + break; + case GLX_NONE_EXT: + default: /* XXX Hopefully this is a good + default assumption. */ + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 1; + break; + } + } + } else { + mode->cap[TRANSPARENT] = 0; + } +#else + mode->cap[SLOW] = 0; + mode->cap[CONFORMANT] = 1; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info) + if (visual_info) { + int transparent; + +/* babcock@cs.montana.edu reported that DEC UNIX (OSF1) V4.0 + 564 for Alpha did not properly define + GLX_TRANSPARENT_TYPE_EXT in despite claiming to + support GLX_EXT_visual_info. */ +#ifndef GLX_TRANSPARENT_TYPE_EXT +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#endif + + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, + fbc, GLX_TRANSPARENT_TYPE_EXT, &transparent); + if (rc != 0) { + mode->cap[TRANSPARENT] = 0; + } else { + mode->cap[TRANSPARENT] = (transparent != GLX_NONE_EXT); + } + } else { + mode->cap[TRANSPARENT] = 0; + } +#else + mode->cap[TRANSPARENT] = 0; +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + if (multisample) { + rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, + fbc, GLX_SAMPLES_SGIS, &mode->cap[SAMPLES]); + if (rc != 0) { + mode->cap[SAMPLES] = 0; + } + } else { + mode->cap[SAMPLES] = 0; + } +#else + mode->cap[SAMPLES] = 0; +#endif + + } else { + /* Fbconfig is not RGBA; GLUT only uses RGBA + FBconfigs. */ + /* XXX Code could be exteneded to handle color + index FBconfigs, but seems a color index + window-renderable FBconfig would also be + advertised as an X visual. */ + mode->valid = 0; + } + } else { + /* Fbconfig does not support window rendering; + not a valid FBconfig for GLUT windows. */ + mode->valid = 0; + } + } else { + /* FBconfig ID is None (zero); not a valid + FBconfig. */ + mode->valid = 0; + } + } else { + /* FBconfig ID is None (zero); not a valid FBconfig. */ + mode->valid = 0; + } + } else { + /* No SGIX_fbconfig GLX sever implementation support. */ + mode->valid = 0; + } +#else + /* No SGIX_fbconfig GLX extension API support. */ + mode->valid = 0; +#endif + } + } + + free(vlist); + *nitems_return = n; + return fbmodes; +} + +static XVisualInfo * +findMatch(FrameBufferMode * fbmodes, int nfbmodes, + Criterion * criteria, int ncriteria, void **fbc) +{ + FrameBufferMode *found; + int *bestScore, *thisScore; + int i, j, numok, result = 0, worse, better; + + found = NULL; + numok = 1; /* "num" capability is indexed from 1, + not 0. */ + + /* XXX alloca canidate. */ + bestScore = (int *) malloc(ncriteria * sizeof(int)); + if (!bestScore) + __glutFatalError("out of memory."); + for (j = 0; j < ncriteria; j++) { + /* Very negative number. */ + bestScore[j] = -32768; + } + + /* XXX alloca canidate. */ + thisScore = (int *) malloc(ncriteria * sizeof(int)); + if (!thisScore) + __glutFatalError("out of memory."); + + for (i = 0; i < nfbmodes; i++) { + if (fbmodes[i].valid) { +#ifdef TEST +#if !defined(_WIN32) + if (verbose) + printf("Visual 0x%x\n", fbmodes[i].vi->visualid); +#endif +#endif + + worse = 0; + better = 0; + + for (j = 0; j < ncriteria; j++) { + int cap, cvalue, fbvalue; + + cap = criteria[j].capability; + cvalue = criteria[j].value; + if (cap == NUM) { + fbvalue = numok; + } else { + fbvalue = fbmodes[i].cap[cap]; + } +#ifdef TEST + if (verbose) + printf(" %s %s %d to %d\n", + capstr[cap], compstr[criteria[j].comparison], cvalue, fbvalue); +#endif + switch (criteria[j].comparison) { + case EQ: + result = cvalue == fbvalue; + thisScore[j] = 1; + break; + case NEQ: + result = cvalue != fbvalue; + thisScore[j] = 1; + break; + case LT: + result = fbvalue < cvalue; + thisScore[j] = fbvalue - cvalue; + break; + case GT: + result = fbvalue > cvalue; + thisScore[j] = fbvalue - cvalue; + break; + case LTE: + result = fbvalue <= cvalue; + thisScore[j] = fbvalue - cvalue; + break; + case GTE: + result = (fbvalue >= cvalue); + thisScore[j] = fbvalue - cvalue; + break; + case MIN: + result = fbvalue >= cvalue; + thisScore[j] = cvalue - fbvalue; + break; + } + +#ifdef TEST + if (verbose) + printf(" result=%d score=%d bestScore=%d\n", result, thisScore[j], bestScore[j]); +#endif + + if (result) { + if (better || thisScore[j] > bestScore[j]) { + better = 1; + } else if (thisScore[j] == bestScore[j]) { + /* Keep looking. */ + } else { + goto nextFBM; + } + } else { + if (cap == NUM) { + worse = 1; + } else { + goto nextFBM; + } + } + + } + + if (better && !worse) { + found = &fbmodes[i]; + for (j = 0; j < ncriteria; j++) { + bestScore[j] = thisScore[j]; + } + } + numok++; + + nextFBM:; + + } + } + free(bestScore); + free(thisScore); + if (found) { +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + *fbc = found->fbc; +#endif + return found->vi; + } else { + return NULL; + } +} + +static int +parseCriteria(char *word, Criterion * criterion, int *mask, + Bool * allowDoubleAsSingle) +{ + char *cstr, *vstr, *response; + int comparator, value = 0; + int rgb, rgba, acc, acca, count, i; + + cstr = strpbrk(word, "=>': + if (cstr[1] == '=') { + comparator = GTE; + vstr = &cstr[2]; + } else { + comparator = GT; + vstr = &cstr[1]; + } + break; + case '<': + if (cstr[1] == '=') { + comparator = LTE; + vstr = &cstr[2]; + } else { + comparator = LT; + vstr = &cstr[1]; + } + break; + case '!': + if (cstr[1] == '=') { + comparator = NEQ; + vstr = &cstr[2]; + } else { + return -1; + } + break; + default: + return -1; + } + value = (int) strtol(vstr, &response, 0); + if (response == vstr) { + /* Not a valid number. */ + return -1; + } + *cstr = '\0'; + } else { + comparator = NONE; + } + switch (word[0]) { + case 'a': + if (!strcmp(word, "alpha")) { + criterion[0].capability = ALPHA_SIZE; + if (comparator == NONE) { + criterion[0].comparison = GTE; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << RGBA); + *mask |= (1 << ALPHA_SIZE); + *mask |= (1 << RGBA_MODE); + return 1; + } + acca = !strcmp(word, "acca"); + acc = !strcmp(word, "acc"); + if (acc || acca) { + criterion[0].capability = ACCUM_RED_SIZE; + criterion[1].capability = ACCUM_GREEN_SIZE; + criterion[2].capability = ACCUM_BLUE_SIZE; + criterion[3].capability = ACCUM_ALPHA_SIZE; + if (acca) { + count = 4; + } else { + count = 3; + criterion[3].comparison = MIN; + criterion[3].value = 0; + } + if (comparator == NONE) { + comparator = GTE; + value = 8; + } + for (i = 0; i < count; i++) { + criterion[i].comparison = comparator; + criterion[i].value = value; + } + *mask |= (1 << ACCUM_RED_SIZE); + return 4; + } + if (!strcmp(word, "auxbufs")) { + criterion[0].capability = AUX_BUFFERS; + if (comparator == NONE) { + criterion[0].comparison = MIN; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << AUX_BUFFERS); + return 1; + } + return -1; + case 'b': + if (!strcmp(word, "blue")) { + criterion[0].capability = BLUE_SIZE; + if (comparator == NONE) { + criterion[0].comparison = GTE; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << RGBA); + *mask |= (1 << RGBA_MODE); + return 1; + } + if (!strcmp(word, "buffer")) { + criterion[0].capability = BUFFER_SIZE; + if (comparator == NONE) { + criterion[0].comparison = GTE; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + return 1; + } + return -1; + case 'c': + if (!strcmp(word, "conformant")) { + criterion[0].capability = CONFORMANT; + if (comparator == NONE) { + criterion[0].comparison = EQ; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << CONFORMANT); + return 1; + } + return -1; + case 'd': + if (!strcmp(word, "depth")) { + criterion[0].capability = DEPTH_SIZE; + if (comparator == NONE) { + criterion[0].comparison = GTE; + criterion[0].value = 12; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << DEPTH_SIZE); + return 1; + } + if (!strcmp(word, "double")) { + criterion[0].capability = DOUBLEBUFFER; + if (comparator == NONE) { + criterion[0].comparison = EQ; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << DOUBLEBUFFER); + return 1; + } + return -1; + case 'g': + if (!strcmp(word, "green")) { + criterion[0].capability = GREEN_SIZE; + if (comparator == NONE) { + criterion[0].comparison = GTE; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << RGBA); + *mask |= (1 << RGBA_MODE); + return 1; + } + return -1; + case 'i': + if (!strcmp(word, "index")) { + criterion[0].capability = RGBA; + criterion[0].comparison = EQ; + criterion[0].value = 0; + *mask |= (1 << RGBA); + *mask |= (1 << CI_MODE); + criterion[1].capability = BUFFER_SIZE; + if (comparator == NONE) { + criterion[1].comparison = GTE; + criterion[1].value = 1; + } else { + criterion[1].comparison = comparator; + criterion[1].value = value; + } + return 2; + } + return -1; + case 'l': + if (!strcmp(word, "luminance")) { + criterion[0].capability = RGBA; + criterion[0].comparison = EQ; + criterion[0].value = 1; + + criterion[1].capability = RED_SIZE; + if (comparator == NONE) { + criterion[1].comparison = GTE; + criterion[1].value = 1; + } else { + criterion[1].comparison = comparator; + criterion[1].value = value; + } + + criterion[2].capability = GREEN_SIZE; + criterion[2].comparison = EQ; + criterion[2].value = 0; + + criterion[3].capability = BLUE_SIZE; + criterion[3].comparison = EQ; + criterion[3].value = 0; + + *mask |= (1 << RGBA); + *mask |= (1 << RGBA_MODE); + *mask |= (1 << LUMINANCE_MODE); + return 4; + } + return -1; + case 'n': + if (!strcmp(word, "num")) { + criterion[0].capability = NUM; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'r': + if (!strcmp(word, "red")) { + criterion[0].capability = RED_SIZE; + if (comparator == NONE) { + criterion[0].comparison = GTE; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << RGBA); + *mask |= (1 << RGBA_MODE); + return 1; + } + rgba = !strcmp(word, "rgba"); + rgb = !strcmp(word, "rgb"); + if (rgb || rgba) { + criterion[0].capability = RGBA; + criterion[0].comparison = EQ; + criterion[0].value = 1; + + criterion[1].capability = RED_SIZE; + criterion[2].capability = GREEN_SIZE; + criterion[3].capability = BLUE_SIZE; + criterion[4].capability = ALPHA_SIZE; + if (rgba) { + count = 5; + } else { + count = 4; + criterion[4].comparison = MIN; + criterion[4].value = 0; + } + if (comparator == NONE) { + comparator = GTE; + value = 1; + } + for (i = 1; i < count; i++) { + criterion[i].comparison = comparator; + criterion[i].value = value; + } + *mask |= (1 << RGBA); + *mask |= (1 << RGBA_MODE); + return 5; + } + return -1; + case 's': + if (!strcmp(word, "stencil")) { + criterion[0].capability = STENCIL_SIZE; + if (comparator == NONE) { + criterion[0].comparison = MIN; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << STENCIL_SIZE); + return 1; + } + if (!strcmp(word, "single")) { + criterion[0].capability = DOUBLEBUFFER; + if (comparator == NONE) { + criterion[0].comparison = EQ; + criterion[0].value = 0; + *allowDoubleAsSingle = True; + *mask |= (1 << DOUBLEBUFFER); + return 1; + } else { + return -1; + } + } + if (!strcmp(word, "stereo")) { + criterion[0].capability = STEREO; + if (comparator == NONE) { + criterion[0].comparison = EQ; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << STEREO); + return 1; + } + if (!strcmp(word, "samples")) { + criterion[0].capability = SAMPLES; + if (comparator == NONE) { + criterion[0].comparison = LTE; + criterion[0].value = 4; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << SAMPLES); + return 1; + } + if (!strcmp(word, "slow")) { + criterion[0].capability = SLOW; + if (comparator == NONE) { + /* Just "slow" means permit fast visuals, but accept + slow ones in preference. Presumably the slow ones + must be higher quality or something else desirable. */ + criterion[0].comparison = GTE; + criterion[0].value = 0; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + *mask |= (1 << SLOW); + return 1; + } + return -1; +#if defined(_WIN32) + case 'w': + if (!strcmp(word, "win32pfd")) { + criterion[0].capability = XVISUAL; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; +#endif +#if !defined(_WIN32) + case 'x': + if (!strcmp(word, "xvisual")) { + if (comparator == NONE) { + return -1; + } else { + criterion[0].capability = XVISUAL; + criterion[0].comparison = comparator; + criterion[0].value = value; + /* Set everything in "mask" so that no default criteria + get used. Assume the program really wants the + xvisual specified. */ + *mask |= ~0; + return 1; + } + } + /* Be a little over-eager to fill in the comparison and + value so we won't have to replicate the code after each + string match. */ + if (comparator == NONE) { + criterion[0].comparison = EQ; + criterion[0].value = 1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + } + + if (!strcmp(word, "xstaticgray")) { + criterion[0].capability = XSTATICGRAY; + *mask |= (1 << XSTATICGRAY); /* Indicates _any_ visual + class selected. */ + return 1; + } + if (!strcmp(word, "xgrayscale")) { + criterion[0].capability = XGRAYSCALE; + *mask |= (1 << XSTATICGRAY); /* Indicates _any_ visual + class selected. */ + return 1; + } + if (!strcmp(word, "xstaticcolor")) { + criterion[0].capability = XSTATICCOLOR; + *mask |= (1 << XSTATICGRAY); /* Indicates _any_ visual + class selected. */ + return 1; + } + if (!strcmp(word, "xpseudocolor")) { + criterion[0].capability = XPSEUDOCOLOR; + *mask |= (1 << XSTATICGRAY); /* Indicates _any_ visual + class selected. */ + return 1; + } + if (!strcmp(word, "xtruecolor")) { + criterion[0].capability = XTRUECOLOR; + *mask |= (1 << XSTATICGRAY); /* Indicates _any_ visual + class selected. */ + return 1; + } + if (!strcmp(word, "xdirectcolor")) { + criterion[0].capability = XDIRECTCOLOR; + *mask |= (1 << XSTATICGRAY); /* Indicates _any_ visual + class selected. */ + return 1; + } + return -1; +#endif + default: + return -1; + } +} + +static Criterion * +parseModeString(char *mode, int *ncriteria, Bool * allowDoubleAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask) +{ + Criterion *criteria = NULL; + int n, mask, parsed, i; + char *copy, *word; + + *allowDoubleAsSingle = False; + copy = __glutStrdup(mode); + /* Attempt to estimate how many criteria entries should be + needed. */ + n = 0; + word = strtok(copy, " \t"); + while (word) { + n++; + word = strtok(NULL, " \t"); + } + /* Overestimate by 4 times ("rgba" might add four criteria + entries) plus add in possible defaults plus space for + required criteria. */ + criteria = (Criterion *) malloc((4 * n + 30 + nRequired) * sizeof(Criterion)); + if (!criteria) { + __glutFatalError("out of memory."); + } + + /* Re-copy the copy of the mode string. */ + strcpy(copy, mode); + + /* First add the required criteria (these match at the + highest priority). Typically these will be used to force a + specific level (layer), transparency, and/or visual type. */ + mask = requiredMask; + for (i = 0; i < nRequired; i++) { + criteria[i] = requiredCriteria[i]; + } + n = nRequired; + + word = strtok(copy, " \t"); + while (word) { + parsed = parseCriteria(word, &criteria[n], &mask, allowDoubleAsSingle); + if (parsed >= 0) { + n += parsed; + } else { + __glutWarning("Unrecognized display string word: %s (ignoring)\n", word); + } + word = strtok(NULL, " \t"); + } + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) { + if (!(mask & (1 << SAMPLES))) { + criteria[n].capability = SAMPLES; + criteria[n].comparison = EQ; + criteria[n].value = 0; + n++; + } else { + /* Multisample visuals are marked nonconformant. If + multisampling was requeste and no conformant + preference was set, assume that we will settle for a + non-conformant visual to get multisampling. */ + if (!(mask & (1 << CONFORMANT))) { + criteria[n].capability = CONFORMANT; + criteria[n].comparison = MIN; + criteria[n].value = 0; + n++; + mask |= (1 << CONFORMANT); + } + } + } +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info) + if (__glutIsSupportedByGLX("GLX_EXT_visual_info")) { + if (!(mask & (1 << TRANSPARENT))) { + criteria[n].capability = TRANSPARENT; + criteria[n].comparison = EQ; + criteria[n].value = 0; + n++; + } + } +#endif +#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_rating) + if (__glutIsSupportedByGLX("GLX_EXT_visual_rating")) { + if (!(mask & (1 << SLOW))) { + criteria[n].capability = SLOW; + criteria[n].comparison = EQ; + criteria[n].value = 0; + n++; + } + if (!(mask & (1 << CONFORMANT))) { + criteria[n].capability = CONFORMANT; + criteria[n].comparison = EQ; + criteria[n].value = 1; + n++; + } + } +#endif + if (!(mask & (1 << ACCUM_RED_SIZE))) { + criteria[n].capability = ACCUM_RED_SIZE; + criteria[n].comparison = MIN; + criteria[n].value = 0; + criteria[n + 1].capability = ACCUM_GREEN_SIZE; + criteria[n + 1].comparison = MIN; + criteria[n + 1].value = 0; + criteria[n + 2].capability = ACCUM_BLUE_SIZE; + criteria[n + 2].comparison = MIN; + criteria[n + 2].value = 0; + criteria[n + 3].capability = ACCUM_ALPHA_SIZE; + criteria[n + 3].comparison = MIN; + criteria[n + 3].value = 0; + n += 4; + } + if (!(mask & (1 << AUX_BUFFERS))) { + criteria[n].capability = AUX_BUFFERS; + criteria[n].comparison = MIN; + criteria[n].value = 0; + n++; + } + if (!(mask & (1 << RGBA))) { + criteria[n].capability = RGBA; + criteria[n].comparison = EQ; + criteria[n].value = 1; + criteria[n + 1].capability = RED_SIZE; + criteria[n + 1].comparison = GTE; + criteria[n + 1].value = 1; + criteria[n + 2].capability = GREEN_SIZE; + criteria[n + 2].comparison = GTE; + criteria[n + 2].value = 1; + criteria[n + 3].capability = BLUE_SIZE; + criteria[n + 3].comparison = GTE; + criteria[n + 3].value = 1; + criteria[n + 4].capability = ALPHA_SIZE; + criteria[n + 4].comparison = MIN; + criteria[n + 4].value = 0; + n += 5; + mask |= (1 << RGBA_MODE); + } +#if !defined(_WIN32) + if (!(mask & (1 << XSTATICGRAY))) { + assert(isMesaGLX != -1); + if ((mask & (1 << RGBA_MODE)) && !isMesaGLX) { + /* Normally, request an RGBA mode visual be TrueColor, + except in the case of Mesa where we trust Mesa (and + other code in GLUT) to handle any type of RGBA visual + reasonably. */ + if (mask & (1 << LUMINANCE_MODE)) { + /* If RGBA luminance was requested, actually go for + a StaticGray visual. */ + criteria[n].capability = XSTATICGRAY; + } else { + criteria[n].capability = XTRUECOLOR; + } + criteria[n].value = 1; + criteria[n].comparison = EQ; + + n++; + } + if (mask & (1 << CI_MODE)) { + criteria[n].capability = XPSEUDOCOLOR; + criteria[n].value = 1; + criteria[n].comparison = EQ; + n++; + } + } +#endif + if (!(mask & (1 << STEREO))) { + criteria[n].capability = STEREO; + criteria[n].comparison = EQ; + criteria[n].value = 0; + n++; + } + if (!(mask & (1 << DOUBLEBUFFER))) { + criteria[n].capability = DOUBLEBUFFER; + criteria[n].comparison = EQ; + criteria[n].value = 0; + *allowDoubleAsSingle = True; + n++; + } + if (!(mask & (1 << DEPTH_SIZE))) { + criteria[n].capability = DEPTH_SIZE; + criteria[n].comparison = MIN; + criteria[n].value = 0; + n++; + } + if (!(mask & (1 << STENCIL_SIZE))) { + criteria[n].capability = STENCIL_SIZE; + criteria[n].comparison = MIN; + criteria[n].value = 0; + n++; + } + if (!(mask & (1 << LEVEL))) { + criteria[n].capability = LEVEL; + criteria[n].comparison = EQ; + criteria[n].value = 0; + n++; + } + if (n) { + /* Since over-estimated the size needed; squeeze it down to + reality. */ + criteria = (Criterion *) realloc(criteria, n * sizeof(Criterion)); + if (!criteria) { + /* Should never happen since should be shrinking down! */ + __glutFatalError("out of memory."); + } + } else { + /* For portability, avoid "realloc(ptr,0)" call. */ + free(criteria); + criteria = NULL; + } + + free(copy); + *ncriteria = n; + return criteria; +} + +static FrameBufferMode *fbmodes = NULL; +static int nfbmodes = 0; + +static XVisualInfo * +getVisualInfoFromString(char *string, Bool * treatAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask, void **fbc) +{ + Criterion *criteria; + XVisualInfo *visinfo; + Bool allowDoubleAsSingle; + int ncriteria, i; + + if (!fbmodes) { + fbmodes = loadVisuals(&nfbmodes); + } + criteria = parseModeString(string, &ncriteria, + &allowDoubleAsSingle, requiredCriteria, nRequired, requiredMask); + if (criteria == NULL) { + __glutWarning("failed to parse mode string"); + return NULL; + } +#ifdef TEST + printCriteria(criteria, ncriteria); +#endif + visinfo = findMatch(fbmodes, nfbmodes, criteria, ncriteria, fbc); + if (visinfo) { + *treatAsSingle = 0; + } else { + if (allowDoubleAsSingle) { + /* Rewrite criteria so that we now look for a double + buffered visual which will then get treated as a + single buffered visual. */ + for (i = 0; i < ncriteria; i++) { + if (criteria[i].capability == DOUBLEBUFFER + && criteria[i].comparison == EQ + && criteria[i].value == 0) { + criteria[i].value = 1; + } + } + visinfo = findMatch(fbmodes, nfbmodes, criteria, ncriteria, fbc); + if (visinfo) { + *treatAsSingle = 1; + } + } + } + free(criteria); + + if (visinfo) { +#if defined(_WIN32) + /* We could have a valid pixel format for drawing to a + bitmap. However, we don't want to draw into a bitmap, we + need one that can be used with a window, so make sure + that this is true. */ + if (!(visinfo->dwFlags & PFD_DRAW_TO_WINDOW)) + return NULL; +#endif + return visinfo; + } else { + return NULL; + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutInitDisplayString(const char *string) +{ +#ifdef _WIN32 + XHDC = GetDC(GetDesktopWindow()); +#endif + + __glutDetermineVisualFromString = getVisualInfoFromString; + if (__glutDisplayString) { + free(__glutDisplayString); + } + if (string) { + __glutDisplayString = __glutStrdup(string); + if (!__glutDisplayString) + __glutFatalError("out of memory."); + } else { + __glutDisplayString = NULL; + } +} +/* ENDCENTRY */ + +#ifdef TEST + +Criterion requiredWindowCriteria[] = +{ + {LEVEL, EQ, 0}, + {TRANSPARENT, EQ, 0} +}; +int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion); +int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT); + +Criterion requiredOverlayCriteria[] = +{ + {LEVEL, EQ, 1}, + {TRANSPARENT, EQ, 1}, + {XPSEUDOCOLOR, EQ, 1}, + {RGBA, EQ, 0}, + {BUFFER_SIZE, GTE, 1} +}; +int numRequiredOverlayCriteria = sizeof(requiredOverlayCriteria) / sizeof(Criterion); +int requiredOverlayCriteriaMask = +(1 << LEVEL) | (1 << TRANSPARENT) | (1 << XSTATICGRAY) | (1 << RGBA) | (1 << CI_MODE); + +int +main(int argc, char **argv) +{ + Display *dpy; + XVisualInfo *vinfo; + Bool treatAsSingle; + char *str, buffer[1024]; + int tty = isatty(fileno(stdin)); + int overlay = 0, showconfig = 0; + void *fbc; + +#if !defined(_WIN32) + dpy = XOpenDisplay(NULL); + if (dpy == NULL) { + printf("Could not connect to X server\n"); + exit(1); + } + __glutDisplay = dpy; + __glutScreen = DefaultScreen(__glutDisplay); +#endif + while (!feof(stdin)) { + if (tty) + printf("dstr> "); + str = fgets(buffer, 1023, stdin); + if (str) { + printf("\n"); + if (!strcmp("v", str)) { + verbose = 1 - verbose; + printf("verbose = %d\n\n", verbose); + } else if (!strcmp("s", str)) { + showconfig = 1 - showconfig; + printf("showconfig = %d\n\n", showconfig); + } else if (!strcmp("o", str)) { + overlay = 1 - overlay; + printf("overlay = %d\n\n", overlay); + } else { + if (overlay) { + vinfo = getVisualInfoFromString(str, &treatAsSingle, + requiredOverlayCriteria, numRequiredOverlayCriteria, requiredOverlayCriteriaMask, &fbc); + } else { + vinfo = getVisualInfoFromString(str, &treatAsSingle, + requiredWindowCriteria, numRequiredWindowCriteria, requiredWindowCriteriaMask, &fbc); + } + if (vinfo) { + printf("\n"); + if (!tty) + printf("Display string: %s", str); +#ifdef _WIN32 + printf("Visual = 0x%x\n", 0); +#else + printf("Visual = 0x%x%s\n", vinfo->visualid, fbc ? " (needs FBC)" : ""); +#endif + if (treatAsSingle) { + printf("Treat as SINGLE.\n"); + } + if (showconfig) { + int glxCapable, bufferSize, level, renderType, doubleBuffer, + stereo, auxBuffers, redSize, greenSize, blueSize, + alphaSize, depthSize, stencilSize, acRedSize, acGreenSize, + acBlueSize, acAlphaSize; + + glXGetConfig(dpy, vinfo, GLX_BUFFER_SIZE, &bufferSize); + glXGetConfig(dpy, vinfo, GLX_LEVEL, &level); + glXGetConfig(dpy, vinfo, GLX_RGBA, &renderType); + glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &doubleBuffer); + glXGetConfig(dpy, vinfo, GLX_STEREO, &stereo); + glXGetConfig(dpy, vinfo, GLX_AUX_BUFFERS, &auxBuffers); + glXGetConfig(dpy, vinfo, GLX_RED_SIZE, &redSize); + glXGetConfig(dpy, vinfo, GLX_GREEN_SIZE, &greenSize); + glXGetConfig(dpy, vinfo, GLX_BLUE_SIZE, &blueSize); + glXGetConfig(dpy, vinfo, GLX_ALPHA_SIZE, &alphaSize); + glXGetConfig(dpy, vinfo, GLX_DEPTH_SIZE, &depthSize); + glXGetConfig(dpy, vinfo, GLX_STENCIL_SIZE, &stencilSize); + glXGetConfig(dpy, vinfo, GLX_ACCUM_RED_SIZE, &acRedSize); + glXGetConfig(dpy, vinfo, GLX_ACCUM_GREEN_SIZE, &acGreenSize); + glXGetConfig(dpy, vinfo, GLX_ACCUM_BLUE_SIZE, &acBlueSize); + glXGetConfig(dpy, vinfo, GLX_ACCUM_ALPHA_SIZE, &acAlphaSize); + printf("RGBA = (%d, %d, %d, %d)\n", redSize, greenSize, blueSize, alphaSize); + printf("acc = (%d, %d, %d, %d)\n", acRedSize, acGreenSize, acBlueSize, acAlphaSize); + printf("db = %d\n", doubleBuffer); + printf("str = %d\n", stereo); + printf("aux = %d\n", auxBuffers); + printf("lvl = %d\n", level); + printf("buf = %d\n", bufferSize); + printf("rgba = %d\n", renderType); + printf("z = %d\n", depthSize); + printf("s = %d\n", stencilSize); + } + } else { + printf("\n"); + printf("No match.\n"); + } + printf("\n"); + } + } + } + printf("\n"); + return 0; +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_event.c xpsb-glx-0.19/mesa/src/glut/glx/glut_event.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_event.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_event.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1386 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#include /* Some FD_ZERO macros use memset without + prototyping memset. */ + +/* Much of the following #ifdef logic to include the proper + prototypes for the select system call is based on logic + from the X11R6.3 version of . */ + +#if !defined(_WIN32) +# ifdef __sgi +# include /* prototype for bzero used by FD_ZERO */ +# endif +# if (defined(__FreeBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) +# include /* select system call interface */ +# ifdef luna +# include +# endif +# endif + /* AIX 4.2 fubar-ed , so go to heroic measures to get it */ +# if defined(AIXV4) && !defined(NFDBITS) +# include +# endif +#endif /* !_WIN32 */ + +#include + +#if !defined(_WIN32) +# if defined(__vms) && ( __VMS_VER < 70000000 ) +# include +# else +# ifndef __vms +# include +# endif +# endif +# include +# include +# include +#else +# ifdef __CYGWIN32__ +# include +# else +# include +# endif +# ifdef __hpux + /* XXX Bert Gijsbers reports that HP-UX + needs different keysyms for the End, Insert, and Delete keys + to work on an HP 715. It would be better if HP generated + standard keysyms for standard keys. */ +# include +# endif +#endif /* !_WIN32 */ + +#include "glutint.h" + +#if defined(__vms) && ( __VMS_VER < 70000000 ) +#include +#include +extern int SYS$CLREF(int efn); +extern int SYS$SETIMR(unsigned int efn, struct timeval6 *timeout, void *ast, + unsigned int request_id, unsigned int flags); +extern int SYS$WFLOR(unsigned int efn, unsigned int mask); +extern int SYS$CANTIM(unsigned int request_id, unsigned int mode); +#endif /* __vms, VMs 6.2 or earlier */ + +static GLUTtimer *freeTimerList = NULL; + +GLUTidleCB __glutIdleFunc = NULL; +GLUTtimer *__glutTimerList = NULL; +#ifdef SUPPORT_FORTRAN +GLUTtimer *__glutNewTimer; +#endif +GLUTwindow *__glutWindowWorkList = NULL; +GLUTmenu *__glutMappedMenu; +GLUTmenu *__glutCurrentMenu = NULL; + +void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *); +#if !defined(_WIN32) +void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item, int num, int type) = NULL; +void (*__glutFinishMenu)(Window win, int x, int y); +void (*__glutPaintMenu)(GLUTmenu * menu); +void (*__glutStartMenu)(GLUTmenu * menu, GLUTwindow * window, int x, int y, int x_win, int y_win); +GLUTmenu * (*__glutGetMenuByNum)(int menunum); +GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu, Window win, int *which); +GLUTmenu * (*__glutGetMenu)(Window win); +#endif + +Atom __glutMotifHints = None; +/* Modifier mask of ~0 implies not in core input callback. */ +unsigned int __glutModifierMask = (unsigned int) ~0; +int __glutWindowDamaged = 0; + +void GLUTAPIENTRY +glutIdleFunc(GLUTidleCB idleFunc) +{ + __glutIdleFunc = idleFunc; +} + +void GLUTAPIENTRY +glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value) +{ + GLUTtimer *timer, *other; + GLUTtimer **prevptr; +#ifdef OLD_VMS + struct timeval6 now; +#else + struct timeval now; +#endif + + if (!timerFunc) + return; + + if (freeTimerList) { + timer = freeTimerList; + freeTimerList = timer->next; + } else { + timer = (GLUTtimer *) malloc(sizeof(GLUTtimer)); + if (!timer) + __glutFatalError("out of memory."); + } + + timer->func = timerFunc; +#if defined(__vms) && ( __VMS_VER < 70000000 ) + /* VMS time is expressed in units of 100 ns */ + timer->timeout.val = interval * TICKS_PER_MILLISECOND; +#else + timer->timeout.tv_sec = (int) interval / 1000; + timer->timeout.tv_usec = (int) (interval % 1000) * 1000; +#endif + timer->value = value; + timer->next = NULL; + GETTIMEOFDAY(&now); + ADD_TIME(timer->timeout, timer->timeout, now); + prevptr = &__glutTimerList; + other = *prevptr; + while (other && IS_AFTER(other->timeout, timer->timeout)) { + prevptr = &other->next; + other = *prevptr; + } + timer->next = other; +#ifdef SUPPORT_FORTRAN + __glutNewTimer = timer; /* for Fortran binding! */ +#endif + *prevptr = timer; +} + +void +handleTimeouts(void) +{ +#ifdef OLD_VMS + struct timeval6 now; +#else + struct timeval now; +#endif + GLUTtimer *timer; + + /* Assumption is that __glutTimerList is already determined + to be non-NULL. */ + GETTIMEOFDAY(&now); + while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) { + timer = __glutTimerList; + /* call the timer function */ + timer->func(timer->value); + /* remove from the linked list */ + __glutTimerList = timer->next; + /* put this timer on the "free" list */ + timer->next = freeTimerList; + freeTimerList = timer; + + if (!__glutTimerList) + break; + } +} + +void +__glutPutOnWorkList(GLUTwindow * window, int workMask) +{ + if (window->workMask) { + /* Already on list; just OR in new workMask. */ + window->workMask |= workMask; + } else { + /* Update work mask and add to window work list. */ + window->workMask = workMask; + /* Assert that if the window does not have a + workMask already, the window should definitely + not be the head of the work list. */ + assert(window != __glutWindowWorkList); + window->prevWorkWin = __glutWindowWorkList; + __glutWindowWorkList = window; + } +} + +void +__glutPostRedisplay(GLUTwindow * window, int layerMask) +{ + int shown = (layerMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) ? + window->shownState : window->overlay->shownState; + + /* Post a redisplay if the window is visible (or the + visibility of the window is unknown, ie. window->visState + == -1) _and_ the layer is known to be shown. */ + if (window->visState != GLUT_HIDDEN + && window->visState != GLUT_FULLY_COVERED && shown) { + __glutPutOnWorkList(window, layerMask); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutPostRedisplay(void) +{ + __glutPostRedisplay(__glutCurrentWindow, GLUT_REDISPLAY_WORK); +} + +/* The advantage of this routine is that it saves the cost of a + glutSetWindow call (entailing an expensive OpenGL context switch), + particularly useful when multiple windows need redisplays posted at + the same times. See also glutPostWindowOverlayRedisplay. */ +void GLUTAPIENTRY +glutPostWindowRedisplay(int win) +{ + __glutPostRedisplay(__glutWindowList[win - 1], GLUT_REDISPLAY_WORK); +} + +/* ENDCENTRY */ +static GLUTeventParser *eventParserList = NULL; + +/* __glutRegisterEventParser allows another module to register + to intercept X events types not otherwise acted on by the + GLUT processEventsAndTimeouts routine. The X Input + extension support code uses an event parser for handling X + Input extension events. */ + +void +__glutRegisterEventParser(GLUTeventParser * parser) +{ + parser->next = eventParserList; + eventParserList = parser; +} + +static void +markWindowHidden(GLUTwindow * window) +{ + if (GLUT_HIDDEN != window->visState) { + GLUTwindow *child; + + if (window->windowStatus) { + window->visState = GLUT_HIDDEN; + __glutSetWindow(window); + window->windowStatus(GLUT_HIDDEN); + } + /* An unmap is only reported on a single window; its + descendents need to know they are no longer visible. */ + child = window->children; + while (child) { + markWindowHidden(child); + child = child->siblings; + } + } +} + +#if !defined(_WIN32) + +static void +purgeStaleWindow(Window win) +{ + GLUTstale **pEntry = &__glutStaleWindowList; + GLUTstale *entry = __glutStaleWindowList; + + /* Tranverse singly-linked stale window list look for the + window ID. */ + while (entry) { + if (entry->win == win) { + /* Found it; delete it. */ + *pEntry = entry->next; + free(entry); + return; + } else { + pEntry = &entry->next; + entry = *pEntry; + } + } +} + +/* Unlike XNextEvent, if a signal arrives, + interruptibleXNextEvent will return (with a zero return + value). This helps GLUT drop out of XNextEvent if a signal + is delivered. The intent is so that a GLUT program can call + glutIdleFunc in a signal handler to register an idle func + and then immediately get dropped into the idle func (after + returning from the signal handler). The idea is to make + GLUT's main loop reliably interruptible by signals. */ +static int +interruptibleXNextEvent(Display * dpy, XEvent * event) +{ + fd_set fds; + int rc; + + /* Flush X protocol since XPending does not do this + implicitly. */ + XFlush(__glutDisplay); + for (;;) { + if (XPending(__glutDisplay)) { + XNextEvent(dpy, event); + return 1; + } +#ifndef VMS + /* the combination ConectionNumber-select is buggy on VMS. Sometimes it + * fails. This part of the code hangs the program on VMS7.2. But even + * without it the program seems to run correctly. + * Note that this is a bug in the VMS/DECWindows run-time-libraries. + * Compaq engeneering does not want or is not able to make a fix. + * (last sentence is a quotation from Compaq when I reported the + * problem January 2000) */ + FD_ZERO(&fds); + FD_SET(__glutConnectionFD, &fds); + rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL); + if (rc < 0) { + if (errno == EINTR) { + return 0; + } else { + __glutFatalError("select error."); + } + } +#endif + } +} + +#endif + +static void +processEventsAndTimeouts(void) +{ + do { +#if defined(_WIN32) + MSG event; + + if(!GetMessage(&event, NULL, 0, 0)) /* bail if no more messages */ + exit(0); + TranslateMessage(&event); /* translate virtual-key messages */ + DispatchMessage(&event); /* call the window proc */ + /* see win32_event.c for event (message) processing procedures */ +#else + static int mappedMenuButton; + GLUTeventParser *parser; + XEvent event, ahead; + GLUTwindow *window; + GLUTkeyboardCB keyboard; + GLUTspecialCB special; + int gotEvent, width, height; + + gotEvent = interruptibleXNextEvent(__glutDisplay, &event); + if (gotEvent) { + switch (event.type) { + case MappingNotify: + XRefreshKeyboardMapping((XMappingEvent *) & event); + break; + case ConfigureNotify: + window = __glutGetWindow(event.xconfigure.window); + if (window) { + if (window->win != event.xconfigure.window) { + /* Ignore ConfigureNotify sent to the overlay + planes. GLUT could get here because overlays + select for StructureNotify events to receive + DestroyNotify. */ + break; + } + width = event.xconfigure.width; + height = event.xconfigure.height; + if (width != window->width || height != window->height) { + if (window->overlay) { + XResizeWindow(__glutDisplay, window->overlay->win, width, height); + } + window->width = width; + window->height = height; + __glutSetWindow(window); + /* Do not execute OpenGL out of sequence with + respect to the XResizeWindow request! */ + glXWaitX(); + window->reshape(width, height); + window->forceReshape = False; + /* A reshape should be considered like posting a + repair; this is necessary for the "Mesa + glXSwapBuffers to repair damage" hack to operate + correctly. Without it, there's not an initial + back buffer render from which to blit from when + damage happens to the window. */ + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } + } + break; + case Expose: + /* compress expose events */ + while (XEventsQueued(__glutDisplay, QueuedAfterReading) + > 0) { + XPeekEvent(__glutDisplay, &ahead); + if (ahead.type != Expose || + ahead.xexpose.window != event.xexpose.window) { + break; + } + XNextEvent(__glutDisplay, &event); + } + if (event.xexpose.count == 0) { + GLUTmenu *menu; + + if (__glutMappedMenu && + (menu = __glutGetMenu(event.xexpose.window))) { + __glutPaintMenu(menu); + } else { + window = __glutGetWindow(event.xexpose.window); + if (window) { + if (window->win == event.xexpose.window) { + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } else if (window->overlay && window->overlay->win == event.xexpose.window) { + __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK); + } + } + } + } else { + /* there are more exposes to read; wait to redisplay */ + } + break; + case ButtonPress: + case ButtonRelease: + if (__glutMappedMenu && event.type == ButtonRelease + && mappedMenuButton == event.xbutton.button) { + /* Menu is currently popped up and its button is + released. */ + __glutFinishMenu(event.xbutton.window, event.xbutton.x, event.xbutton.y); + } else { + window = __glutGetWindow(event.xbutton.window); + /* added button check for mice with > 3 buttons */ + if (window) { + GLUTmenu *menu; + int menuNum; + + if (event.xbutton.button <= GLUT_MAX_MENUS) + menuNum = window->menu[event.xbutton.button - 1]; + else + menuNum = 0; + + /* Make sure that __glutGetMenuByNum is only called if there + really is a menu present. */ + if ((menuNum > 0) && (menu = __glutGetMenuByNum(menuNum))) { + if (event.type == ButtonPress && !__glutMappedMenu) { + __glutStartMenu(menu, window, + event.xbutton.x_root, event.xbutton.y_root, + event.xbutton.x, event.xbutton.y); + mappedMenuButton = event.xbutton.button; + } else { + /* Ignore a release of a button with a menu + attatched to it when no menu is popped up, + or ignore a press when another menu is + already popped up. */ + } + } else if (window->mouse) { + __glutSetWindow(window); + __glutModifierMask = event.xbutton.state; + window->mouse(event.xbutton.button - 1, + event.type == ButtonRelease ? + GLUT_UP : GLUT_DOWN, + event.xbutton.x, event.xbutton.y); + __glutModifierMask = ~0; + } else { + /* Stray mouse events. Ignore. */ + } + } else { + /* Window might have been destroyed and all the + events for the window may not yet be received. */ + } + } + break; + case MotionNotify: + if (!__glutMappedMenu) { + window = __glutGetWindow(event.xmotion.window); + if (window) { + /* If motion function registered _and_ buttons held + * down, call motion function... */ + if (window->motion && event.xmotion.state & + (Button1Mask | Button2Mask | Button3Mask)) { + __glutSetWindow(window); + window->motion(event.xmotion.x, event.xmotion.y); + } + /* If passive motion function registered _and_ + buttons not held down, call passive motion + function... */ + else if (window->passive && + ((event.xmotion.state & + (Button1Mask | Button2Mask | Button3Mask)) == + 0)) { + __glutSetWindow(window); + window->passive(event.xmotion.x, + event.xmotion.y); + } + } + } else { + /* Motion events are thrown away when a pop up menu + is active. */ + } + break; + case KeyPress: + case KeyRelease: + window = __glutGetWindow(event.xkey.window); + if (!window) { + break; + } + if (event.type == KeyPress) { + keyboard = window->keyboard; + } else { + + /* If we are ignoring auto repeated keys for this window, + check if the next event in the X event queue is a KeyPress + for the exact same key (and at the exact same time) as the + key being released. The X11 protocol will send auto + repeated keys as such KeyRelease/KeyPress pairs. */ + + if (window->ignoreKeyRepeat) { + if (XEventsQueued(__glutDisplay, QueuedAfterReading)) { + XPeekEvent(__glutDisplay, &ahead); + if (ahead.type == KeyPress + && ahead.xkey.window == event.xkey.window + && ahead.xkey.keycode == event.xkey.keycode + && ahead.xkey.time == event.xkey.time) { + /* Pop off the repeated KeyPress and ignore + the auto repeated KeyRelease/KeyPress pair. */ + XNextEvent(__glutDisplay, &event); + break; + } + } + } + keyboard = window->keyboardUp; + } + if (keyboard) { + char tmp[1]; + int rc; + + rc = XLookupString(&event.xkey, tmp, sizeof(tmp), + NULL, NULL); + if (rc) { + __glutSetWindow(window); + __glutModifierMask = event.xkey.state; + keyboard(tmp[0], + event.xkey.x, event.xkey.y); + __glutModifierMask = ~0; + break; + } + } + if (event.type == KeyPress) { + special = window->special; + } else { + special = window->specialUp; + } + if (special) { + KeySym ks; + int key; + +/* Introduced in X11R6: (Partial list of) Keypad Functions. Define + in place in case compiling against an older pre-X11R6 + X11/keysymdef.h file. */ +#ifndef XK_KP_Home +#define XK_KP_Home 0xFF95 +#endif +#ifndef XK_KP_Left +#define XK_KP_Left 0xFF96 +#endif +#ifndef XK_KP_Up +#define XK_KP_Up 0xFF97 +#endif +#ifndef XK_KP_Right +#define XK_KP_Right 0xFF98 +#endif +#ifndef XK_KP_Down +#define XK_KP_Down 0xFF99 +#endif +#ifndef XK_KP_Prior +#define XK_KP_Prior 0xFF9A +#endif +#ifndef XK_KP_Next +#define XK_KP_Next 0xFF9B +#endif +#ifndef XK_KP_End +#define XK_KP_End 0xFF9C +#endif +#ifndef XK_KP_Insert +#define XK_KP_Insert 0xFF9E +#endif +#ifndef XK_KP_Delete +#define XK_KP_Delete 0xFF9F +#endif + + ks = XLookupKeysym((XKeyEvent *) & event, 0); + /* XXX Verbose, but makes no assumptions about keysym + layout. */ + switch (ks) { +/* *INDENT-OFF* */ + /* function keys */ + case XK_F1: key = GLUT_KEY_F1; break; + case XK_F2: key = GLUT_KEY_F2; break; + case XK_F3: key = GLUT_KEY_F3; break; + case XK_F4: key = GLUT_KEY_F4; break; + case XK_F5: key = GLUT_KEY_F5; break; + case XK_F6: key = GLUT_KEY_F6; break; + case XK_F7: key = GLUT_KEY_F7; break; + case XK_F8: key = GLUT_KEY_F8; break; + case XK_F9: key = GLUT_KEY_F9; break; + case XK_F10: key = GLUT_KEY_F10; break; + case XK_F11: key = GLUT_KEY_F11; break; + case XK_F12: key = GLUT_KEY_F12; break; + /* directional keys */ + case XK_KP_Left: + case XK_Left: key = GLUT_KEY_LEFT; break; + case XK_KP_Up: /* Introduced in X11R6. */ + case XK_Up: key = GLUT_KEY_UP; break; + case XK_KP_Right: /* Introduced in X11R6. */ + case XK_Right: key = GLUT_KEY_RIGHT; break; + case XK_KP_Down: /* Introduced in X11R6. */ + case XK_Down: key = GLUT_KEY_DOWN; break; +/* *INDENT-ON* */ + + case XK_KP_Prior: /* Introduced in X11R6. */ + case XK_Prior: + /* XK_Prior same as X11R6's XK_Page_Up */ + key = GLUT_KEY_PAGE_UP; + break; + case XK_KP_Next: /* Introduced in X11R6. */ + case XK_Next: + /* XK_Next same as X11R6's XK_Page_Down */ + key = GLUT_KEY_PAGE_DOWN; + break; + case XK_KP_Home: /* Introduced in X11R6. */ + case XK_Home: + key = GLUT_KEY_HOME; + break; +#ifdef __hpux + case XK_Select: +#endif + case XK_KP_End: /* Introduced in X11R6. */ + case XK_End: + key = GLUT_KEY_END; + break; +#ifdef __hpux + case XK_InsertChar: +#endif + case XK_KP_Insert: /* Introduced in X11R6. */ + case XK_Insert: + key = GLUT_KEY_INSERT; + break; +#ifdef __hpux + case XK_DeleteChar: +#endif + case XK_KP_Delete: /* Introduced in X11R6. */ + /* The Delete character is really an ASCII key. */ + __glutSetWindow(window); + keyboard(127, /* ASCII Delete character. */ + event.xkey.x, event.xkey.y); + goto skip; + default: + goto skip; + } + __glutSetWindow(window); + __glutModifierMask = event.xkey.state; + special(key, event.xkey.x, event.xkey.y); + __glutModifierMask = ~0; + skip:; + } + break; + case EnterNotify: + case LeaveNotify: + if (event.xcrossing.mode != NotifyNormal || + event.xcrossing.detail == NotifyNonlinearVirtual || + event.xcrossing.detail == NotifyVirtual) { + + /* Careful to ignore Enter/LeaveNotify events that + come from the pop-up menu pointer grab and ungrab. + Also, ignore "virtual" Enter/LeaveNotify events + since they represent the pointer passing through + the window hierarchy without actually entering or + leaving the actual real estate of a window. */ + + break; + } + if (__glutMappedMenu) { + GLUTmenuItem *item; + int num; + + item = __glutGetMenuItem(__glutMappedMenu, + event.xcrossing.window, &num); + if (item) { + __glutMenuItemEnterOrLeave(item, num, event.type); + break; + } + } + window = __glutGetWindow(event.xcrossing.window); + if (window) { + if (window->entry) { + if (event.type == EnterNotify) { + + /* With overlays established, X can report two + enter events for both the overlay and normal + plane window. Do not generate a second enter + callback if we reported one without an + intervening leave. */ + + if (window->entryState != EnterNotify) { + int num = window->num; + Window xid = window->win; + + window->entryState = EnterNotify; + __glutSetWindow(window); + window->entry(GLUT_ENTERED); + + if (__glutMappedMenu) { + + /* Do not generate any passive motion events + when menus are in use. */ + + } else { + + /* An EnterNotify event can result in a + "compound" callback if a passive motion + callback is also registered. In this case, + be a little paranoid about the possibility + the window could have been destroyed in the + entry callback. */ + + window = __glutWindowList[num]; + if (window && window->passive && window->win == xid) { + __glutSetWindow(window); + window->passive(event.xcrossing.x, event.xcrossing.y); + } + } + } + } else { + if (window->entryState != LeaveNotify) { + + /* When an overlay is established for a window + already mapped and with the pointer in it, + the X server will generate a leave/enter + event pair as the pointer leaves (without + moving) from the normal plane X window to + the newly mapped overlay X window (or vice + versa). This enter/leave pair should not be + reported to the GLUT program since the pair + is a consequence of creating (or destroying) + the overlay, not an actual leave from the + GLUT window. */ + + if (XEventsQueued(__glutDisplay, QueuedAfterReading)) { + XPeekEvent(__glutDisplay, &ahead); + if (ahead.type == EnterNotify && + __glutGetWindow(ahead.xcrossing.window) == window) { + XNextEvent(__glutDisplay, &event); + break; + } + } + window->entryState = LeaveNotify; + __glutSetWindow(window); + window->entry(GLUT_LEFT); + } + } + } else if (window->passive) { + __glutSetWindow(window); + window->passive(event.xcrossing.x, event.xcrossing.y); + } + } + break; + case UnmapNotify: + /* MapNotify events are not needed to maintain + visibility state since VisibilityNotify events will + be delivered when a window becomes visible from + mapping. However, VisibilityNotify events are not + delivered when a window is unmapped (for the window + or its children). */ + window = __glutGetWindow(event.xunmap.window); + if (window) { + if (window->win != event.xconfigure.window) { + /* Ignore UnmapNotify sent to the overlay planes. + GLUT could get here because overlays select for + StructureNotify events to receive DestroyNotify. + */ + break; + } + markWindowHidden(window); + } + break; + case VisibilityNotify: + window = __glutGetWindow(event.xvisibility.window); + if (window) { + /* VisibilityUnobscured+1 = GLUT_FULLY_RETAINED, + VisibilityPartiallyObscured+1 = + GLUT_PARTIALLY_RETAINED, VisibilityFullyObscured+1 + = GLUT_FULLY_COVERED. */ + int visState = event.xvisibility.state + 1; + + if (visState != window->visState) { + if (window->windowStatus) { + window->visState = visState; + __glutSetWindow(window); + window->windowStatus(visState); + } + } + } + break; + case ClientMessage: + if (event.xclient.data.l[0] == __glutWMDeleteWindow) + exit(0); + break; + case DestroyNotify: + purgeStaleWindow(event.xdestroywindow.window); + break; + case CirculateNotify: + case CreateNotify: + case GravityNotify: + case ReparentNotify: + /* Uninteresting to GLUT (but possible for GLUT to + receive). */ + break; + default: + /* Pass events not directly handled by the GLUT main + event loop to any event parsers that have been + registered. In this way, X Input extension events + are passed to the correct handler without forcing + all GLUT programs to support X Input event handling. + */ + parser = eventParserList; + while (parser) { + if (parser->func(&event)) + break; + parser = parser->next; + } + break; + } + } +#endif /* _WIN32 */ + if (__glutTimerList) { + handleTimeouts(); + } + } + while (XPending(__glutDisplay)); +} + +static void +waitForSomething(void) +{ +#if defined(__vms) && ( __VMS_VER < 70000000 ) + static struct timeval6 zerotime = + {0}; + unsigned int timer_efn; +#define timer_id 'glut' /* random :-) number */ + unsigned int wait_mask; +#else + static struct timeval zerotime = + {0, 0}; +#if !defined(_WIN32) + fd_set fds; +#endif +#endif +#ifdef OLD_VMS + struct timeval6 now, timeout, waittime; +#else + struct timeval now, timeout, waittime; +#endif +#if !defined(_WIN32) + int rc; +#endif + + /* Flush X protocol since XPending does not do this + implicitly. */ + XFlush(__glutDisplay); + if (XPending(__glutDisplay)) { + /* It is possible (but quite rare) that XFlush may have + needed to wait for a writable X connection file + descriptor, and in the process, may have had to read off + X protocol from the file descriptor. If XPending is true, + this case occured and we should avoid waiting in select + since X protocol buffered within Xlib is due to be + processed and potentially no more X protocol is on the + file descriptor, so we would risk waiting improperly in + select. */ + goto immediatelyHandleXinput; + } +#if defined(__vms) && ( __VMS_VER < 70000000 ) + timeout = __glutTimerList->timeout; + GETTIMEOFDAY(&now); + wait_mask = 1 << (__glutConnectionFD & 31); + if (IS_AFTER(now, timeout)) { + /* We need an event flag for the timer. */ + /* XXX The `right' way to do this is to use LIB$GET_EF, but + since it needs to be in the same cluster as the EFN for + the display, we will have hack it. */ + timer_efn = __glutConnectionFD - 1; + if ((timer_efn / 32) != (__glutConnectionFD / 32)) { + timer_efn = __glutConnectionFD + 1; + } + rc = SYS$CLREF(timer_efn); + rc = SYS$SETIMR(timer_efn, &timeout, NULL, timer_id, 0); + wait_mask |= 1 << (timer_efn & 31); + } else { + timer_efn = 0; + } + rc = SYS$WFLOR(__glutConnectionFD, wait_mask); + if (timer_efn != 0 && SYS$CLREF(timer_efn) == SS$_WASCLR) { + rc = SYS$CANTIM(timer_id, PSL$C_USER); + } + /* XXX There does not seem to be checking of "rc" in the code + above. Can any of the SYS$ routines above fail? */ +#else /* not vms6.2 or lower */ +#if !defined(_WIN32) + FD_ZERO(&fds); + FD_SET(__glutConnectionFD, &fds); +#endif + timeout = __glutTimerList->timeout; + GETTIMEOFDAY(&now); + if (IS_AFTER(now, timeout)) { + TIMEDELTA(waittime, timeout, now); + } else { + waittime = zerotime; + } +#if !defined(_WIN32) + rc = select(__glutConnectionFD + 1, &fds, + NULL, NULL, &waittime); + if (rc < 0 && errno != EINTR) + __glutFatalError("select error."); +#else + + MsgWaitForMultipleObjects(0, NULL, FALSE, + waittime.tv_sec*1000 + waittime.tv_usec/1000, QS_ALLINPUT); + +#endif +#endif /* not vms6.2 or lower */ + /* Without considering the cause of select unblocking, check + for pending X events and handle any timeouts (by calling + processEventsAndTimeouts). We always look for X events + even if select returned with 0 (indicating a timeout); + otherwise we risk starving X event processing by continous + timeouts. */ + if (XPending(__glutDisplay)) { + immediatelyHandleXinput: + processEventsAndTimeouts(); + } else { + if (__glutTimerList) + handleTimeouts(); + } +} + +static void +idleWait(void) +{ + if (XPending(__glutDisplay)) { + processEventsAndTimeouts(); + } else { + if (__glutTimerList) { + handleTimeouts(); + } + } + /* Make sure idle func still exists! */ + if (__glutIdleFunc) { + __glutIdleFunc(); + } +} + +static GLUTwindow **beforeEnd; + +static GLUTwindow * +processWindowWorkList(GLUTwindow * window) +{ + int workMask; + + if (window->prevWorkWin) { + window->prevWorkWin = processWindowWorkList(window->prevWorkWin); + } else { + beforeEnd = &window->prevWorkWin; + } + + /* Capture work mask for work that needs to be done to this + window, then clear the window's work mask (excepting the + dummy work bit, see below). Then, process the captured + work mask. This allows callbacks in the processing the + captured work mask to set the window's work mask for + subsequent processing. */ + + workMask = window->workMask; + assert((workMask & GLUT_DUMMY_WORK) == 0); + + /* Set the dummy work bit, clearing all other bits, to + indicate that the window is currently on the window work + list _and_ that the window's work mask is currently being + processed. This convinces __glutPutOnWorkList that this + window is on the work list still. */ + window->workMask = GLUT_DUMMY_WORK; + + /* Optimization: most of the time, the work to do is a + redisplay and not these other types of work. Check for + the following cases as a group to before checking each one + individually one by one. This saves about 25 MIPS + instructions in the common redisplay only case. */ + if (workMask & (GLUT_EVENT_MASK_WORK | GLUT_DEVICE_MASK_WORK | + GLUT_CONFIGURE_WORK | GLUT_COLORMAP_WORK | GLUT_MAP_WORK)) { +#if !defined(_WIN32) + /* Be sure to set event mask BEFORE map window is done. */ + if (workMask & GLUT_EVENT_MASK_WORK) { + long eventMask; + + /* Make sure children are not propogating events this + window is selecting for. Be sure to do this before + enabling events on the children's parent. */ + if (window->children) { + GLUTwindow *child = window->children; + unsigned long attribMask = CWDontPropagate; + XSetWindowAttributes wa; + + wa.do_not_propagate_mask = window->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK; + if (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) { + wa.event_mask = child->eventMask | (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK); + attribMask |= CWEventMask; + } + do { + XChangeWindowAttributes(__glutDisplay, child->win, + attribMask, &wa); + child = child->siblings; + } while (child); + } + eventMask = window->eventMask; + if (window->parent && window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) + eventMask |= (window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK); + XSelectInput(__glutDisplay, window->win, eventMask); + if (window->overlay) + XSelectInput(__glutDisplay, window->overlay->win, + window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK); + } +#endif /* !_WIN32 */ + /* Be sure to set device mask BEFORE map window is done. */ + if (workMask & GLUT_DEVICE_MASK_WORK) { + __glutUpdateInputDeviceMaskFunc(window); + } + /* Be sure to configure window BEFORE map window is done. */ + if (workMask & GLUT_CONFIGURE_WORK) { +#if defined(_WIN32) + RECT changes; + POINT point; + UINT flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER + | SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER; + + GetClientRect(window->win, &changes); + + /* If this window is a toplevel window, translate the 0,0 client + coordinate into a screen coordinate for proper placement. */ + if (!window->parent) { + point.x = 0; + point.y = 0; + ClientToScreen(window->win, &point); + changes.left = point.x; + changes.top = point.y; + } + if (window->desiredConfMask & (CWX | CWY)) { + changes.left = window->desiredX; + changes.top = window->desiredY; + flags &= ~SWP_NOMOVE; + } + if (window->desiredConfMask & (CWWidth | CWHeight)) { + changes.right = changes.left + window->desiredWidth; + changes.bottom = changes.top + window->desiredHeight; + flags &= ~SWP_NOSIZE; + /* XXX If overlay exists, resize the overlay here, ie. + if (window->overlay) ... */ + } + if (window->desiredConfMask & CWStackMode) { + flags &= ~SWP_NOZORDER; + /* XXX Overlay support might require something special here. */ + } + + /* Adjust the window rectangle because Win32 thinks that the x, y, + width & height are the WHOLE window (including decorations), + whereas GLUT treats the x, y, width & height as only the CLIENT + area of the window. Only do this to top level windows + that are not in game mode (since game mode windows do + not have any decorations). */ + if (!window->parent && window != __glutGameModeWindow) { + AdjustWindowRect(&changes, + WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + FALSE); + } + + /* Do the repositioning, moving, and push/pop. */ + SetWindowPos(window->win, + window->desiredStack == Above ? HWND_TOP : HWND_NOTOPMOST, + changes.left, changes.top, + changes.right - changes.left, changes.bottom - changes.top, + flags); + + /* Zero out the mask. */ + window->desiredConfMask = 0; + + /* This hack causes the window to go back to the right position + when it is taken out of fullscreen mode. */ + if (workMask & GLUT_FULL_SCREEN_WORK) { + window->desiredConfMask |= CWX | CWY; + window->desiredX = point.x; + window->desiredY = point.y; + } +#else /* !_WIN32 */ + XWindowChanges changes; + + changes.x = window->desiredX; + changes.y = window->desiredY; + if (window->desiredConfMask & (CWWidth | CWHeight)) { + changes.width = window->desiredWidth; + changes.height = window->desiredHeight; + if (window->overlay) + XResizeWindow(__glutDisplay, window->overlay->win, + window->desiredWidth, window->desiredHeight); + if (__glutMotifHints != None) { + if (workMask & GLUT_FULL_SCREEN_WORK) { + MotifWmHints hints; + + hints.flags = MWM_HINTS_DECORATIONS; + hints.decorations = 0; /* Absolutely no + decorations. */ + XChangeProperty(__glutDisplay, window->win, + __glutMotifHints, __glutMotifHints, 32, + PropModeReplace, (unsigned char *) &hints, 4); + if (workMask & GLUT_MAP_WORK) { + /* Handle case where glutFullScreen is called + before the first time that the window is + mapped. Some window managers will randomly or + interactively position the window the first + time it is mapped if the window's + WM_NORMAL_HINTS property does not request an + explicit position. We don't want any such + window manager interaction when going + fullscreen. Overwrite the WM_NORMAL_HINTS + property installed by glutCreateWindow's + XSetWMProperties property with one explicitly + requesting a fullscreen window. */ + XSizeHints hints; + + hints.flags = USPosition | USSize; + hints.x = 0; + hints.y = 0; + hints.width = window->desiredWidth; + hints.height = window->desiredHeight; + XSetWMNormalHints(__glutDisplay, window->win, &hints); + } + } else { + XDeleteProperty(__glutDisplay, window->win, __glutMotifHints); + } + } + } + if (window->desiredConfMask & CWStackMode) { + changes.stack_mode = window->desiredStack; + /* Do not let glutPushWindow push window beneath the + underlay. */ + if (window->parent && window->parent->overlay + && window->desiredStack == Below) { + changes.stack_mode = Above; + changes.sibling = window->parent->overlay->win; + window->desiredConfMask |= CWSibling; + } + } + XConfigureWindow(__glutDisplay, window->win, + window->desiredConfMask, &changes); + window->desiredConfMask = 0; +#endif + } +#if !defined(_WIN32) + /* Be sure to establish the colormaps BEFORE map window is + done. */ + if (workMask & GLUT_COLORMAP_WORK) { + __glutEstablishColormapsProperty(window); + } +#endif + if (workMask & GLUT_MAP_WORK) { + switch (window->desiredMapState) { + case WithdrawnState: + if (window->parent) { + XUnmapWindow(__glutDisplay, window->win); + } else { + XWithdrawWindow(__glutDisplay, window->win, + __glutScreen); + } + window->shownState = 0; + break; + case NormalState: + XMapWindow(__glutDisplay, window->win); + window->shownState = 1; + break; +#ifdef _WIN32 + case GameModeState: /* Not an Xlib value. */ + ShowWindow(window->win, SW_SHOW); + window->shownState = 1; + break; +#endif + case IconicState: + XIconifyWindow(__glutDisplay, window->win, __glutScreen); + window->shownState = 0; + break; + } + } + } + if (workMask & (GLUT_REDISPLAY_WORK | GLUT_OVERLAY_REDISPLAY_WORK | GLUT_REPAIR_WORK | GLUT_OVERLAY_REPAIR_WORK)) { + if (window->forceReshape) { + /* Guarantee that before a display callback is generated + for a window, a reshape callback must be generated. */ + __glutSetWindow(window); + window->reshape(window->width, window->height); + window->forceReshape = False; + + /* Setting the redisplay bit on the first reshape is + necessary to make the "Mesa glXSwapBuffers to repair + damage" hack operate correctly. Without indicating a + redisplay is necessary, there's not an initial back + buffer render from which to blit from when damage + happens to the window. */ + workMask |= GLUT_REDISPLAY_WORK; + } + /* The code below is more involved than otherwise necessary + because it is paranoid about the overlay or entire window + being removed or destroyed in the course of the callbacks. + Notice how the global __glutWindowDamaged is used to record + the layers' damage status. See the code in glutLayerGet for + how __glutWindowDamaged is used. The point is to not have to + update the "damaged" field after the callback since the + window (or overlay) may be destroyed (or removed) when the + callback returns. */ + + if (window->overlay && window->overlay->display) { + int num = window->num; + Window xid = window->overlay ? window->overlay->win : None; + + /* If an overlay display callback is registered, we + differentiate between a redisplay needed for the + overlay and/or normal plane. If there is no overlay + display callback registered, we simply use the + standard display callback. */ + + if (workMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) { + if (__glutMesaSwapHackSupport) { + if (window->usedSwapBuffers) { + if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) { + SWAP_BUFFERS_WINDOW(window); + goto skippedDisplayCallback1; + } + } + } + /* Render to normal plane. */ +#ifdef _WIN32 + window->renderDc = window->hdc; +#endif + window->renderWin = window->win; + window->renderCtx = window->ctx; + __glutWindowDamaged = (workMask & GLUT_REPAIR_WORK); + __glutSetWindow(window); + window->usedSwapBuffers = 0; + window->display(); + __glutWindowDamaged = 0; + + skippedDisplayCallback1:; + } + if (workMask & (GLUT_OVERLAY_REDISPLAY_WORK | GLUT_OVERLAY_REPAIR_WORK)) { + window = __glutWindowList[num]; + if (window && window->overlay && + window->overlay->win == xid && window->overlay->display) { + + /* Render to overlay. */ +#ifdef _WIN32 + window->renderDc = window->overlay->hdc; +#endif + window->renderWin = window->overlay->win; + window->renderCtx = window->overlay->ctx; + __glutWindowDamaged = (workMask & GLUT_OVERLAY_REPAIR_WORK); + __glutSetWindow(window); + window->overlay->display(); + __glutWindowDamaged = 0; + } else { + /* Overlay may have since been destroyed or the + overlay callback may have been disabled during + normal display callback. */ + } + } + } else { + if (__glutMesaSwapHackSupport) { + if (!window->overlay && window->usedSwapBuffers) { + if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) { + SWAP_BUFFERS_WINDOW(window); + goto skippedDisplayCallback2; + } + } + } + /* Render to normal plane (and possibly overlay). */ + __glutWindowDamaged = (workMask & (GLUT_OVERLAY_REPAIR_WORK | GLUT_REPAIR_WORK)); + __glutSetWindow(window); + window->usedSwapBuffers = 0; + window->display(); + __glutWindowDamaged = 0; + + skippedDisplayCallback2:; + } + } + /* Combine workMask with window->workMask to determine what + finish and debug work there is. */ + workMask |= window->workMask; + + if (workMask & GLUT_FINISH_WORK) { + /* Finish work makes sure a glFinish gets done to indirect + rendering contexts. Indirect contexts tend to have much + longer latency because lots of OpenGL extension requests + can queue up in the X protocol stream. __glutSetWindow + is where the finish works gets queued for indirect + contexts. */ + __glutSetWindow(window); + glFinish(); + } + if (workMask & GLUT_DEBUG_WORK) { + __glutSetWindow(window); + glutReportErrors(); + } + /* Strip out dummy, finish, and debug work bits. */ + window->workMask &= ~(GLUT_DUMMY_WORK | GLUT_FINISH_WORK | GLUT_DEBUG_WORK); + if (window->workMask) { + /* Leave on work list. */ + return window; + } else { + /* Remove current window from work list. */ + return window->prevWorkWin; + } +} + +#ifndef _WIN32 +static /* X11 implementations do not need this global. */ +#endif +void +__glutProcessWindowWorkLists(void) +{ + if (__glutWindowWorkList) { + GLUTwindow *remainder, *work; + + work = __glutWindowWorkList; + __glutWindowWorkList = NULL; + if (work) { + remainder = processWindowWorkList(work); + if (remainder) { + *beforeEnd = __glutWindowWorkList; + __glutWindowWorkList = remainder; + } + } + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutMainLoop(void) +{ +#if !defined(_WIN32) + if (!__glutDisplay) + __glutFatalUsage("main loop entered with out proper initialization."); +#endif + if (!__glutWindowListSize) + __glutFatalUsage( + "main loop entered with no windows created."); + for (;;) { + __glutProcessWindowWorkLists(); + if (__glutIdleFunc || __glutWindowWorkList) { + idleWait(); + } else { + if (__glutTimerList) { + waitForSomething(); + } else { + processEventsAndTimeouts(); + } + } + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_ext.c xpsb-glx-0.19/mesa/src/glut/glx/glut_ext.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_ext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_ext.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,201 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include + +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutExtensionSupported(const char *extension) +{ + static const GLubyte *extensions = NULL; + const GLubyte *start; + GLubyte *where, *terminator; + + /* Extension names should not have spaces. */ + where = (GLubyte *) strchr(extension, ' '); + if (where || *extension == '\0') + return 0; + + if (!extensions) { + extensions = glGetString(GL_EXTENSIONS); + } + /* It takes a bit of care to be fool-proof about parsing the + OpenGL extensions string. Don't be fooled by sub-strings, + etc. */ + start = extensions; + for (;;) { + /* If your application crashes in the strstr routine below, + you are probably calling glutExtensionSupported without + having a current window. Calling glGetString without + a current OpenGL context has unpredictable results. + Please fix your program. */ + where = (GLubyte *) strstr((const char *) start, extension); + if (!where) + break; + terminator = where + strlen(extension); + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { + return 1; + } + } + start = terminator; + } + return 0; +} + + +struct name_address_pair { + const char *name; + const GLUTproc address; +}; + +static struct name_address_pair glut_functions[] = { + { "glutInit", (const GLUTproc) glutInit }, + { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, + { "glutInitDisplayString", (const GLUTproc) glutInitDisplayString }, + { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, + { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, + { "glutMainLoop", (const GLUTproc) glutMainLoop }, + { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, + { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, + { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, + { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, + { "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay }, + { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, + { "glutGetWindow", (const GLUTproc) glutGetWindow }, + { "glutSetWindow", (const GLUTproc) glutSetWindow }, + { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, + { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, + { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, + { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, + { "glutPopWindow", (const GLUTproc) glutPopWindow }, + { "glutPushWindow", (const GLUTproc) glutPushWindow }, + { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, + { "glutShowWindow", (const GLUTproc) glutShowWindow }, + { "glutHideWindow", (const GLUTproc) glutHideWindow }, + { "glutFullScreen", (const GLUTproc) glutFullScreen }, + { "glutSetCursor", (const GLUTproc) glutSetCursor }, + { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, + { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, + { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, + { "glutUseLayer", (const GLUTproc) glutUseLayer }, + { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, + { "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay }, + { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, + { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, + { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, + { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, + { "glutGetMenu", (const GLUTproc) glutGetMenu }, + { "glutSetMenu", (const GLUTproc) glutSetMenu }, + { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, + { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, + { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, + { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, + { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, + { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, + { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, + { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, + { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, + { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, + { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, + { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, + { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, + { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, + { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, + { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, + { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, + { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, + { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, + { "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc }, + { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, + { "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc }, + { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, + { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, + { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, + { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, + { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, + { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, + { "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc }, + { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc }, + { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc }, + { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc }, + { "glutSetColor", (const GLUTproc) glutSetColor }, + { "glutGetColor", (const GLUTproc) glutGetColor }, + { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, + { "glutGet", (const GLUTproc) glutGet }, + { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, + { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, + { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, + { "glutLayerGet", (const GLUTproc) glutLayerGet }, + { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, + { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, + { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, + { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, + { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, + { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, + { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, + { "glutWireSphere", (const GLUTproc) glutWireSphere }, + { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, + { "glutWireCone", (const GLUTproc) glutWireCone }, + { "glutSolidCone", (const GLUTproc) glutSolidCone }, + { "glutWireCube", (const GLUTproc) glutWireCube }, + { "glutSolidCube", (const GLUTproc) glutSolidCube }, + { "glutWireTorus", (const GLUTproc) glutWireTorus }, + { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, + { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, + { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, + { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, + { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, + { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, + { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, + { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, + { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, + { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, + { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, + { "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet }, + { "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing }, + { "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing }, + { "glutVideoResize", (const GLUTproc) glutVideoResize }, + { "glutVideoPan", (const GLUTproc) glutVideoPan }, + { "glutReportErrors", (const GLUTproc) glutReportErrors }, + { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat }, + { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat }, + { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc }, + { "glutGameModeString", (const GLUTproc) glutGameModeString }, + { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode }, + { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode }, + { "glutGameModeGet", (const GLUTproc) glutGameModeGet }, + { NULL, NULL } +}; + + +/* XXX This isn't an official GLUT function, yet */ +GLUTproc GLUTAPIENTRY +glutGetProcAddress(const char *procName) +{ + /* Try GLUT functions first */ + int i; + for (i = 0; glut_functions[i].name; i++) { + if (strcmp(glut_functions[i].name, procName) == 0) + return glut_functions[i].address; + } + + /* Try core GL functions */ +#if defined(_WIN32) + return (GLUTproc) wglGetProcAddress((LPCSTR) procName); +#elif defined(GLX_ARB_get_proc_address) + return (GLUTproc) glXGetProcAddressARB((const GLubyte *) procName); +#else + return NULL; +#endif +} + + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_fcb.c xpsb-glx-0.19/mesa/src/glut/glx/glut_fcb.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_fcb.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_fcb.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,164 @@ + +/* Copyright (c) Mark J. Kilgard, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* I appreciate the guidance from William Mitchell + (mitchell@cam.nist.gov) in developing this friend interface + for use by the f90gl package. See ../../README.fortran */ + +#include "glutint.h" + +/* FCB stands for Fortran CallBack. */ + +/* There is only one idleFunc, menuStateFunc, and menuStatusFunc, so they + can be saved in the wrappers for Fortran rather than the C structures. */ + +/* Set a Fortran callback function. */ + +void APIENTRY +__glutSetFCB(int which, GLUTproc func) +{ +#ifdef SUPPORT_FORTRAN + switch (which) { + case GLUT_FCB_DISPLAY: + __glutCurrentWindow->fdisplay = (GLUTdisplayFCB) func; + break; + case GLUT_FCB_RESHAPE: + __glutCurrentWindow->freshape = (GLUTreshapeFCB) func; + break; + case GLUT_FCB_MOUSE: + __glutCurrentWindow->fmouse = (GLUTmouseFCB) func; + break; + case GLUT_FCB_MOTION: + __glutCurrentWindow->fmotion = (GLUTmotionFCB) func; + break; + case GLUT_FCB_PASSIVE: + __glutCurrentWindow->fpassive = (GLUTpassiveFCB) func; + break; + case GLUT_FCB_ENTRY: + __glutCurrentWindow->fentry = (GLUTentryFCB) func; + break; + case GLUT_FCB_KEYBOARD: + __glutCurrentWindow->fkeyboard = (GLUTkeyboardFCB) func; + break; + case GLUT_FCB_KEYBOARD_UP: + __glutCurrentWindow->fkeyboardUp = (GLUTkeyboardFCB) func; + break; + case GLUT_FCB_WINDOW_STATUS: + __glutCurrentWindow->fwindowStatus = (GLUTwindowStatusFCB) func; + break; + case GLUT_FCB_VISIBILITY: + __glutCurrentWindow->fvisibility = (GLUTvisibilityFCB) func; + break; + case GLUT_FCB_SPECIAL: + __glutCurrentWindow->fspecial = (GLUTspecialFCB) func; + break; + case GLUT_FCB_SPECIAL_UP: + __glutCurrentWindow->fspecialUp = (GLUTspecialFCB) func; + break; + case GLUT_FCB_BUTTON_BOX: + __glutCurrentWindow->fbuttonBox = (GLUTbuttonBoxFCB) func; + break; + case GLUT_FCB_DIALS: + __glutCurrentWindow->fdials = (GLUTdialsFCB) func; + break; + case GLUT_FCB_SPACE_MOTION: + __glutCurrentWindow->fspaceMotion = (GLUTspaceMotionFCB) func; + break; + case GLUT_FCB_SPACE_ROTATE: + __glutCurrentWindow->fspaceRotate = (GLUTspaceRotateFCB) func; + break; + case GLUT_FCB_SPACE_BUTTON: + __glutCurrentWindow->fspaceButton = (GLUTspaceButtonFCB) func; + break; + case GLUT_FCB_TABLET_MOTION: + __glutCurrentWindow->ftabletMotion = (GLUTtabletMotionFCB) func; + break; + case GLUT_FCB_TABLET_BUTTON: + __glutCurrentWindow->ftabletButton = (GLUTtabletButtonFCB) func; + break; +#ifdef _WIN32 + case GLUT_FCB_JOYSTICK: + __glutCurrentWindow->fjoystick = (GLUTjoystickFCB) func; + break; +#endif + case GLUT_FCB_OVERLAY_DISPLAY: + __glutCurrentWindow->overlay->fdisplay = (GLUTdisplayFCB) func; + break; + case GLUT_FCB_SELECT: + __glutCurrentMenu->fselect = (GLUTselectFCB) func; + break; + case GLUT_FCB_TIMER: + __glutNewTimer->ffunc = (GLUTtimerFCB) func; + break; + } +#endif +} + +/* Get a Fortran callback function. */ + +GLUTproc APIENTRY +__glutGetFCB(int which) +{ +#ifdef SUPPORT_FORTRAN + switch (which) { + case GLUT_FCB_DISPLAY: + return __glutCurrentWindow->fdisplay; + case GLUT_FCB_RESHAPE: + return __glutCurrentWindow->freshape; + case GLUT_FCB_MOUSE: + return __glutCurrentWindow->fmouse; + case GLUT_FCB_MOTION: + return __glutCurrentWindow->fmotion; + case GLUT_FCB_PASSIVE: + return __glutCurrentWindow->fpassive; + case GLUT_FCB_ENTRY: + return __glutCurrentWindow->fentry; + case GLUT_FCB_KEYBOARD: + return __glutCurrentWindow->fkeyboard; + case GLUT_FCB_KEYBOARD_UP: + return __glutCurrentWindow->fkeyboardUp; + case GLUT_FCB_WINDOW_STATUS: + return __glutCurrentWindow->fwindowStatus; + case GLUT_FCB_VISIBILITY: + return __glutCurrentWindow->fvisibility; + case GLUT_FCB_SPECIAL: + return __glutCurrentWindow->fspecial; + case GLUT_FCB_SPECIAL_UP: + return __glutCurrentWindow->fspecialUp; + case GLUT_FCB_BUTTON_BOX: + return __glutCurrentWindow->fbuttonBox; + case GLUT_FCB_DIALS: + return __glutCurrentWindow->fdials; + case GLUT_FCB_SPACE_MOTION: + return __glutCurrentWindow->fspaceMotion; + case GLUT_FCB_SPACE_ROTATE: + return __glutCurrentWindow->fspaceRotate; + case GLUT_FCB_SPACE_BUTTON: + return __glutCurrentWindow->fspaceButton; + case GLUT_FCB_TABLET_MOTION: + return __glutCurrentWindow->ftabletMotion; + case GLUT_FCB_TABLET_BUTTON: + return __glutCurrentWindow->ftabletButton; + case GLUT_FCB_JOYSTICK: +#ifdef _WIN32 + return __glutCurrentWindow->fjoystick; +#else + return NULL; +#endif + case GLUT_FCB_OVERLAY_DISPLAY: + return __glutCurrentWindow->overlay->fdisplay; + case GLUT_FCB_SELECT: + return __glutCurrentMenu->fselect; + case GLUT_FCB_TIMER: + return __glutTimerList ? __glutTimerList->ffunc : NULL; + default: + return NULL; + } +#else + return NULL; +#endif +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_fullscrn.c xpsb-glx-0.19/mesa/src/glut/glx/glut_fullscrn.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_fullscrn.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_fullscrn.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,56 @@ + +/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include /* SunOS multithreaded assert() needs . Lame. */ +#include + +#if !defined(_WIN32) +#include +#include +#endif + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutFullScreen(void) +{ + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); +#if !defined(_WIN32) + if (__glutMotifHints == None) { + __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", + SGI_XA__MOTIF_WM_HINTS, 0); + if (__glutMotifHints == None) { + __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); + } + } +#endif + + __glutCurrentWindow->desiredX = 0; + __glutCurrentWindow->desiredY = 0; + __glutCurrentWindow->desiredWidth = __glutScreenWidth; + __glutCurrentWindow->desiredHeight = __glutScreenHeight; + __glutCurrentWindow->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; + + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_gamemode.c xpsb-glx-0.19/mesa/src/glut/glx/glut_gamemode.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_gamemode.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_gamemode.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,678 @@ + +/* Copyright (c) Mark J. Kilgard, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include + +#include "glutint.h" + +#ifndef _WIN32 +#include +#include + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif +#endif /* not _WIN32 */ + +int __glutDisplaySettingsChanged = 0; +static DisplayMode *dmodes, *currentDm = NULL; +static int ndmodes = -1; +GLUTwindow *__glutGameModeWindow = NULL; + +#ifdef TEST +static char *compstr[] = +{ + "none", "=", "!=", "<=", ">=", ">", "<", "~" +}; +static char *capstr[] = +{ + "width", "height", "bpp", "hertz", "num" +}; +#endif + +void +__glutCloseDownGameMode(void) +{ + if (__glutDisplaySettingsChanged) { +#ifdef _WIN32 + /* Assumes that display settings have been changed, that + is __glutDisplaySettingsChanged is true. */ + ChangeDisplaySettings(NULL, 0); +#endif + __glutDisplaySettingsChanged = 0; + } + __glutGameModeWindow = NULL; +} + +void GLUTAPIENTRY +glutLeaveGameMode(void) +{ + if (__glutGameModeWindow == NULL) { + __glutWarning("not in game mode so cannot leave game mode"); + return; + } + __glutDestroyWindow(__glutGameModeWindow, + __glutGameModeWindow); + XFlush(__glutDisplay); + __glutGameModeWindow = NULL; +} + +#ifdef _WIN32 + +/* Same values as from MSDN's SetDisp.c example. */ +#define MIN_WIDTH 400 +#define MIN_FREQUENCY 60 + +static void +initGameModeSupport(void) +{ + DEVMODE dm; + DWORD mode; + int i; + + if (ndmodes >= 0) { + /* ndmodes is initially -1 to indicate no + dmodes allocated yet. */ + return; + } + + /* Determine how many display modes there are. */ + ndmodes = 0; + mode = 0; + while (EnumDisplaySettings(NULL, mode, &dm)) { + if (dm.dmPelsWidth >= MIN_WIDTH && + (dm.dmDisplayFrequency == 0 || + dm.dmDisplayFrequency >= MIN_FREQUENCY)) { + ndmodes++; + } + mode++; + } + + /* Allocate memory for a list of all the display modes. */ + dmodes = (DisplayMode*) + malloc(ndmodes * sizeof(DisplayMode)); + + /* Now that we know how many display modes to expect, + enumerate them again and save the information in + the list we allocated above. */ + i = 0; + mode = 0; + while (EnumDisplaySettings(NULL, mode, &dm)) { + /* Try to reject any display settings that seem unplausible. */ + if (dm.dmPelsWidth >= MIN_WIDTH && + (dm.dmDisplayFrequency == 0 || + dm.dmDisplayFrequency >= MIN_FREQUENCY)) { + dmodes[i].devmode = dm; + dmodes[i].valid = 1; /* XXX Not used for now. */ + dmodes[i].cap[DM_WIDTH] = dm.dmPelsWidth; + dmodes[i].cap[DM_HEIGHT] = dm.dmPelsHeight; + dmodes[i].cap[DM_PIXEL_DEPTH] = dm.dmBitsPerPel; + if (dm.dmDisplayFrequency == 0) { + /* Guess a reasonable guess. */ + /* Lame Windows 95 version of EnumDisplaySettings. */ + dmodes[i].cap[DM_HERTZ] = 60; + } else { + dmodes[i].cap[DM_HERTZ] = dm.dmDisplayFrequency; + } + i++; + } + mode++; + } + + assert(i == ndmodes); +} + +#else + +/* X Windows version of initGameModeSupport. */ +static void +initGameModeSupport(void) +{ + if (ndmodes >= 0) { + /* ndmodes is initially -1 to indicate no + dmodes allocated yet. */ + return; + } + + /* Determine how many display modes there are. */ + ndmodes = 0; +} + +#endif + +/* This routine is based on similiar code in glut_dstr.c */ +static DisplayMode * +findMatch(DisplayMode * dmodes, int ndmodes, + Criterion * criteria, int ncriteria) +{ + DisplayMode *found; + int *bestScore, *thisScore; + int i, j, numok, result = 0, worse, better; + + found = NULL; + numok = 1; /* "num" capability is indexed from 1, + not 0. */ + + /* XXX alloca canidate. */ + bestScore = (int *) malloc(ncriteria * sizeof(int)); + if (!bestScore) { + __glutFatalError("out of memory."); + } + for (j = 0; j < ncriteria; j++) { + /* Very negative number. */ + bestScore[j] = -32768; + } + + /* XXX alloca canidate. */ + thisScore = (int *) malloc(ncriteria * sizeof(int)); + if (!thisScore) { + __glutFatalError("out of memory."); + } + + for (i = 0; i < ndmodes; i++) { + if (dmodes[i].valid) { + worse = 0; + better = 0; + + for (j = 0; j < ncriteria; j++) { + int cap, cvalue, dvalue; + + cap = criteria[j].capability; + cvalue = criteria[j].value; + if (cap == NUM) { + dvalue = numok; + } else { + dvalue = dmodes[i].cap[cap]; + } +#ifdef TEST + if (verbose) + printf(" %s %s %d to %d\n", + capstr[cap], compstr[criteria[j].comparison], cvalue, dvalue); +#endif + switch (criteria[j].comparison) { + case EQ: + result = cvalue == dvalue; + thisScore[j] = 1; + break; + case NEQ: + result = cvalue != dvalue; + thisScore[j] = 1; + break; + case LT: + result = dvalue < cvalue; + thisScore[j] = dvalue - cvalue; + break; + case GT: + result = dvalue > cvalue; + thisScore[j] = dvalue - cvalue; + break; + case LTE: + result = dvalue <= cvalue; + thisScore[j] = dvalue - cvalue; + break; + case GTE: + result = (dvalue >= cvalue); + thisScore[j] = dvalue - cvalue; + break; + case MIN: + result = dvalue >= cvalue; + thisScore[j] = cvalue - dvalue; + break; + } + +#ifdef TEST + if (verbose) + printf(" result=%d score=%d bestScore=%d\n", result, thisScore[j], bestScore[j]); +#endif + + if (result) { + if (better || thisScore[j] > bestScore[j]) { + better = 1; + } else if (thisScore[j] == bestScore[j]) { + /* Keep looking. */ + } else { + goto nextDM; + } + } else { + if (cap == NUM) { + worse = 1; + } else { + goto nextDM; + } + } + + } + + if (better && !worse) { + found = &dmodes[i]; + for (j = 0; j < ncriteria; j++) { + bestScore[j] = thisScore[j]; + } + } + numok++; + + nextDM:; + + } + } + free(bestScore); + free(thisScore); + return found; +} + +/** + * Parses strings in the form of: + * 800x600 + * 800x600:16 + * 800x600@60 + * 800x600:16@60 + * @60 + * :16 + * :16@60 + * NOTE that @ before : is not parsed. + */ +static int +specialCaseParse(char *word, Criterion * criterion, int mask) +{ + char *xstr, *response; + int got; + int width, height, bpp, hertz; + + switch(word[0]) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* The WWWxHHH case. */ + if (mask & (1 << DM_WIDTH)) { + return -1; + } + xstr = strpbrk(&word[1], "x"); + if (xstr) { + width = (int) strtol(word, &response, 0); + if (response == word || response[0] != 'x') { + /* Not a valid number OR needs to be followed by 'x'. */ + return -1; + } + height = (int) strtol(&xstr[1], &response, 0); + if (response == &xstr[1]) { + /* Not a valid number. */ + return -1; + } + criterion[0].capability = DM_WIDTH; + criterion[0].comparison = EQ; + criterion[0].value = width; + criterion[1].capability = DM_HEIGHT; + criterion[1].comparison = EQ; + criterion[1].value = height; + got = specialCaseParse(response, + &criterion[2], 1 << DM_WIDTH); + if (got >= 0) { + return got + 2; + } else { + return -1; + } + } + return -1; + case ':': + /* The :BPP case. */ + if (mask & (1 << DM_PIXEL_DEPTH)) { + return -1; + } + bpp = (int) strtol(&word[1], &response, 0); + if (response == &word[1]) { + /* Not a valid number. */ + return -1; + } + criterion[0].capability = DM_PIXEL_DEPTH; + criterion[0].comparison = EQ; + criterion[0].value = bpp; + got = specialCaseParse(response, + &criterion[1], 1 << DM_WIDTH | 1 << DM_PIXEL_DEPTH); + if (got >= 0) { + return got + 1; + } else { + return -1; + } + case '@': + /* The @HZ case. */ + if (mask & (1 << DM_HERTZ)) { + return -1; + } + hertz = (int) strtol(&word[1], &response, 0); + if (response == &word[1]) { + /* Not a valid number. */ + return -1; + } + criterion[0].capability = DM_HERTZ; + criterion[0].comparison = EQ; + criterion[0].value = hertz; + got = specialCaseParse(response, + &criterion[1], ~DM_HERTZ); + if (got >= 0) { + return got + 1; + } else { + return -1; + } + case '\0': + return 0; + } + return -1; +} + +/* This routine is based on similiar code in glut_dstr.c */ +static int +parseCriteria(char *word, Criterion * criterion) +{ + char *cstr, *vstr, *response; + int comparator, value = 0; + + cstr = strpbrk(word, "=>': + if (cstr[1] == '=') { + comparator = GTE; + vstr = &cstr[2]; + } else { + comparator = GT; + vstr = &cstr[1]; + } + break; + case '<': + if (cstr[1] == '=') { + comparator = LTE; + vstr = &cstr[2]; + } else { + comparator = LT; + vstr = &cstr[1]; + } + break; + case '!': + if (cstr[1] == '=') { + comparator = NEQ; + vstr = &cstr[2]; + } else { + return -1; + } + break; + default: + return -1; + } + value = (int) strtol(vstr, &response, 0); + if (response == vstr) { + /* Not a valid number. */ + return -1; + } + *cstr = '\0'; + } else { + comparator = NONE; + } + switch (word[0]) { + case 'b': + if (!strcmp(word, "bpp")) { + criterion[0].capability = DM_PIXEL_DEPTH; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'h': + if (!strcmp(word, "height")) { + criterion[0].capability = DM_HEIGHT; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + if (!strcmp(word, "hertz")) { + criterion[0].capability = DM_HERTZ; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'n': + if (!strcmp(word, "num")) { + criterion[0].capability = DM_NUM; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'w': + if (!strcmp(word, "width")) { + criterion[0].capability = DM_WIDTH; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + } + if (comparator == NONE) { + return specialCaseParse(word, criterion, 0); + } + return -1; +} + +/* This routine is based on similiar code in glut_dstr.c */ +static Criterion * +parseDisplayString(const char *display, int *ncriteria) +{ + Criterion *criteria = NULL; + int n, parsed; + char *copy, *word; + + copy = __glutStrdup(display); + /* Attempt to estimate how many criteria entries should be + needed. */ + n = 0; + word = strtok(copy, " \t"); + while (word) { + n++; + word = strtok(NULL, " \t"); + } + /* Allocate number of words of criteria. A word + could contain as many as four criteria in the + worst case. Example: 800x600:16@60 */ + criteria = (Criterion *) malloc(4 * n * sizeof(Criterion)); + if (!criteria) { + __glutFatalError("out of memory."); + } + + /* Re-copy the copy of the display string. */ + strcpy(copy, display); + + n = 0; + word = strtok(copy, " \t"); + while (word) { + parsed = parseCriteria(word, &criteria[n]); + if (parsed >= 0) { + n += parsed; + } else { + __glutWarning("Unrecognized game mode string word: %s (ignoring)\n", word); + } + word = strtok(NULL, " \t"); + } + + free(copy); + *ncriteria = n; + return criteria; +} + +void GLUTAPIENTRY +glutGameModeString(const char *string) +{ + Criterion *criteria; + int ncriteria; + + initGameModeSupport(); + criteria = parseDisplayString(string, &ncriteria); + currentDm = findMatch(dmodes, ndmodes, criteria, ncriteria); + free(criteria); +} + +int GLUTAPIENTRY +glutEnterGameMode(void) +{ + GLUTwindow *window; + int width, height; + Window win; + + if (__glutMappedMenu) { + __glutFatalUsage("entering game mode not allowed while menus in use"); + } + if (__glutGameModeWindow) { + /* Already in game mode, so blow away game mode + window so apps can change resolutions. */ + window = __glutGameModeWindow; + /* Setting the game mode window to NULL tricks + the window destroy code into not undoing the + screen display change since we plan on immediately + doing another mode change. */ + __glutGameModeWindow = NULL; + __glutDestroyWindow(window, window); + } + + /* Assume default screen size until we find out if we + can actually change the display settings. */ + width = __glutScreenWidth; + height = __glutScreenHeight; + + if (currentDm) { +#ifdef _WIN32 + LONG status; + static int registered = 0; + + status = ChangeDisplaySettings(¤tDm->devmode, + CDS_FULLSCREEN); + if (status == DISP_CHANGE_SUCCESSFUL) { + __glutDisplaySettingsChanged = 1; + width = currentDm->cap[DM_WIDTH]; + height = currentDm->cap[DM_HEIGHT]; + if (!registered) { + atexit(__glutCloseDownGameMode); + registered = 1; + } + } else { + /* Switch back to default resolution. */ + ChangeDisplaySettings(NULL, 0); + } +#endif + } + + window = __glutCreateWindow(NULL, 0, 0, + width, height, /* game mode */ 1); + win = window->win; + +#if !defined(_WIN32) + if (__glutMotifHints == None) { + __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", + SGI_XA__MOTIF_WM_HINTS, 0); + if (__glutMotifHints == None) { + __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); + } + } + + /* Game mode window is a toplevel window. */ + XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); +#endif + + /* Schedule the fullscreen property to be added and to + make sure the window is configured right. Win32 + doesn't need this. */ + window->desiredX = 0; + window->desiredY = 0; + window->desiredWidth = width; + window->desiredHeight = height; + window->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; +#ifdef _WIN32 + /* Win32 does not want to use GLUT_FULL_SCREEN_WORK + for game mode because we need to be maximizing + the window in game mode, not just sizing it to + take up the full screen. The Win32-ness of game + mode happens when you pass 1 in the gameMode parameter + to __glutCreateWindow above. A gameMode of creates + a WS_POPUP window, not a standard WS_OVERLAPPEDWINDOW + window. WS_POPUP ensures the taskbar is hidden. */ + __glutPutOnWorkList(window, + GLUT_CONFIGURE_WORK); +#else + __glutPutOnWorkList(window, + GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); +#endif + + __glutGameModeWindow = window; + return window->num + 1; +} + +int GLUTAPIENTRY +glutGameModeGet(GLenum mode) +{ + switch (mode) { + case GLUT_GAME_MODE_ACTIVE: + return __glutGameModeWindow != NULL; + case GLUT_GAME_MODE_POSSIBLE: + return currentDm != NULL; + case GLUT_GAME_MODE_WIDTH: + return currentDm ? currentDm->cap[DM_WIDTH] : -1; + case GLUT_GAME_MODE_HEIGHT: + return currentDm ? currentDm->cap[DM_HEIGHT] : -1; + case GLUT_GAME_MODE_PIXEL_DEPTH: + return currentDm ? currentDm->cap[DM_PIXEL_DEPTH] : -1; + case GLUT_GAME_MODE_REFRESH_RATE: + return currentDm ? currentDm->cap[DM_HERTZ] : -1; + case GLUT_GAME_MODE_DISPLAY_CHANGED: + return __glutDisplaySettingsChanged; + default: + return -1; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_get.c xpsb-glx-0.19/mesa/src/glut/glx/glut_get.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_get.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_get.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,220 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include /* SunOS 4 needs NULL defined for GETTIMEOFDAY macro. */ +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutGet(GLenum param) +{ + Window win, root; + int x, y, value; + unsigned int width, height, border, depth; + + switch (param) { + case GLUT_INIT_WINDOW_X: + return __glutInitX; + case GLUT_INIT_WINDOW_Y: + return __glutInitY; + case GLUT_INIT_WINDOW_WIDTH: + return __glutInitWidth; + case GLUT_INIT_WINDOW_HEIGHT: + return __glutInitHeight; + case GLUT_INIT_DISPLAY_MODE: + return __glutDisplayMode; + case GLUT_WINDOW_X: + XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, + __glutRoot, 0, 0, &x, &y, &win); + return x; + case GLUT_WINDOW_Y: + XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, + __glutRoot, 0, 0, &x, &y, &win); + return y; + case GLUT_WINDOW_WIDTH: + if (!__glutCurrentWindow->reshape) { + XGetGeometry(__glutDisplay, __glutCurrentWindow->win, + &root, &x, &y, + &width, &height, &border, &depth); + return width; + } + return __glutCurrentWindow->width; + case GLUT_WINDOW_HEIGHT: + if (!__glutCurrentWindow->reshape) { + XGetGeometry(__glutDisplay, __glutCurrentWindow->win, + &root, &x, &y, + &width, &height, &border, &depth); + return height; + } + return __glutCurrentWindow->height; + +#define GET_CONFIG(attrib) { \ + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { \ + glXGetConfig(__glutDisplay, __glutCurrentWindow->vis, \ + attrib, &value); \ + } else { \ + glXGetConfig(__glutDisplay, __glutCurrentWindow->overlay->vis, \ + attrib, &value); \ + } \ +} + + case GLUT_WINDOW_BUFFER_SIZE: + GET_CONFIG(GLX_BUFFER_SIZE); + return value; + case GLUT_WINDOW_STENCIL_SIZE: + GET_CONFIG(GLX_STENCIL_SIZE); + return value; + case GLUT_WINDOW_DEPTH_SIZE: + GET_CONFIG(GLX_DEPTH_SIZE); + return value; + case GLUT_WINDOW_RED_SIZE: + GET_CONFIG(GLX_RED_SIZE); + return value; + case GLUT_WINDOW_GREEN_SIZE: + GET_CONFIG(GLX_GREEN_SIZE); + return value; + case GLUT_WINDOW_BLUE_SIZE: + GET_CONFIG(GLX_BLUE_SIZE); + return value; + case GLUT_WINDOW_ALPHA_SIZE: + GET_CONFIG(GLX_ALPHA_SIZE); + return value; + case GLUT_WINDOW_ACCUM_RED_SIZE: + GET_CONFIG(GLX_ACCUM_RED_SIZE); + return value; + case GLUT_WINDOW_ACCUM_GREEN_SIZE: + GET_CONFIG(GLX_ACCUM_GREEN_SIZE); + return value; + case GLUT_WINDOW_ACCUM_BLUE_SIZE: + GET_CONFIG(GLX_ACCUM_BLUE_SIZE); + return value; + case GLUT_WINDOW_ACCUM_ALPHA_SIZE: + GET_CONFIG(GLX_ACCUM_ALPHA_SIZE); + return value; + case GLUT_WINDOW_DOUBLEBUFFER: + GET_CONFIG(GLX_DOUBLEBUFFER); + return value; + case GLUT_WINDOW_RGBA: + GET_CONFIG(GLX_RGBA); + return value; + case GLUT_WINDOW_COLORMAP_SIZE: + GET_CONFIG(GLX_RGBA); + if (value) { + return 0; + } else { +#if defined(_WIN32) + /* KLUDGE: we always assume 256 colors in CI mode on + Win32 */ + return 256; +#else + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + return __glutCurrentWindow->vis->visual->map_entries; + } else { + return __glutCurrentWindow->overlay->vis->visual->map_entries; + } +#endif /* _WIN32 */ + } + case GLUT_WINDOW_PARENT: + return __glutCurrentWindow->parent ? + __glutCurrentWindow->parent->num + 1 : 0; + case GLUT_WINDOW_NUM_CHILDREN: + { + int num = 0; + GLUTwindow *children = __glutCurrentWindow->children; + + while (children) { + num++; + children = children->siblings; + } + return num; + } + case GLUT_WINDOW_NUM_SAMPLES: +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) { + GET_CONFIG(GLX_SAMPLES_SGIS); + return value; + } else { + return 0; + } +#else + /* Independent of GLX server support, multisampling not + supported by GLX client-side. */ + return 0; +#endif + case GLUT_WINDOW_STEREO: + GET_CONFIG(GLX_STEREO); + return value; + case GLUT_WINDOW_CURSOR: + return __glutCurrentWindow->cursor; + case GLUT_SCREEN_WIDTH: + return DisplayWidth(__glutDisplay, __glutScreen); + case GLUT_SCREEN_HEIGHT: + return DisplayHeight(__glutDisplay, __glutScreen); + case GLUT_SCREEN_WIDTH_MM: + return DisplayWidthMM(__glutDisplay, __glutScreen); + case GLUT_SCREEN_HEIGHT_MM: + return DisplayHeightMM(__glutDisplay, __glutScreen); + case GLUT_MENU_NUM_ITEMS: + return __glutCurrentMenu->num; + case GLUT_DISPLAY_MODE_POSSIBLE: + { + XVisualInfo *vi; + Bool dummy, visAlloced; + void *fbc; + +#if defined(_WIN32) + /* Our fake glXChooseVisual (which is called by + __glutDetermineVisual) needs an HDC to work with, so grab one + from the "root" window. */ + XHDC = GetDC(GetDesktopWindow()); +#endif + vi = __glutDetermineWindowVisual(&dummy, &visAlloced, &fbc); +#if defined(_WIN32) + ReleaseDC(GetDesktopWindow(), XHDC); +#endif + if (vi) { + if (visAlloced) + XFree(vi); + return 1; + } + return 0; + } + case GLUT_ELAPSED_TIME: + { +#ifdef OLD_VMS + struct timeval6 elapsed, beginning, now; +#else + struct timeval elapsed, beginning, now; +#endif + + __glutInitTime(&beginning); + GETTIMEOFDAY(&now); + TIMEDELTA(elapsed, now, beginning); + /* Return elapsed milliseconds. */ +#if defined(__vms) && ( __VMS_VER < 70000000 ) + return (int) (elapsed.val / TICKS_PER_MILLISECOND); +#else + return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000)); +#endif + } + case GLUT_WINDOW_FORMAT_ID: +#if defined(_WIN32) + return GetPixelFormat(__glutCurrentWindow->hdc); +#else + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + return (int) __glutCurrentWindow->vis->visualid; + } else { + return (int) __glutCurrentWindow->overlay->vis->visualid; + } +#endif + default: + __glutWarning("invalid glutGet parameter: %d", param); + return -1; + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_glxext.c xpsb-glx-0.19/mesa/src/glut/glx/glut_glxext.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_glxext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_glxext.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,255 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include "glutint.h" + +#if defined(GLX_VERSION_1_1) +int +__glutIsSupportedByGLX(char *extension) +{ + static const char *extensions = NULL; + const char *start; + char *where, *terminator; + int major, minor; + + glXQueryVersion(__glutDisplay, &major, &minor); + /* Be careful not to call glXQueryExtensionsString if it + looks like the server doesn't support GLX 1.1. + Unfortunately, the original GLX 1.0 didn't have the notion + of GLX extensions. */ + if ((major == 1 && minor >= 1) || (major > 1)) { + if (!extensions) + extensions = glXQueryExtensionsString(__glutDisplay, __glutScreen); + /* It takes a bit of care to be fool-proof about parsing + the GLX extensions string. Don't be fooled by + sub-strings, etc. */ + start = extensions; + for (;;) { + where = strstr(start, extension); + if (!where) + return 0; + terminator = where + strlen(extension); + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { + return 1; + } + } + start = terminator; + } + } + return 0; +} +#endif + + + +/* + * Wrapping of GLX extension functions. + * Technically, we should do a runtime test to see if we've got the + * glXGetProcAddressARB() function. I think GLX_ARB_get_proc_address + * is pretty widely supported now and any system that has + * GLX_ARB_get_proc_address defined in its header files should be OK + * at runtime. + */ + +int +__glut_glXBindChannelToWindowSGIX(Display *dpy, int screen, + int channel, Window window) +{ +#ifdef GLX_ARB_get_proc_address + typedef int (*glXBindChannelToWindowSGIX_t) (Display *, int, int, Window); + static glXBindChannelToWindowSGIX_t glXBindChannelToWindowSGIX_ptr = NULL; + if (!glXBindChannelToWindowSGIX_ptr) { + glXBindChannelToWindowSGIX_ptr = (glXBindChannelToWindowSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXBindChannelToWindowSGIX"); + } + if (glXBindChannelToWindowSGIX_ptr) + return (*glXBindChannelToWindowSGIX_ptr)(dpy, screen, channel, window); + else + return 0; +#elif defined(GLX_SGIX_video_resize) + return glXBindChannelToWindowSGIX(dpy, screen, channel, window); +#else + return 0; +#endif +} + + +int +__glut_glXChannelRectSGIX(Display *dpy, int screen, int channel, + int x, int y, int w, int h) +{ +#ifdef GLX_ARB_get_proc_address + typedef int (*glXChannelRectSGIX_t)(Display *, int, int, int, int, int, int); + static glXChannelRectSGIX_t glXChannelRectSGIX_ptr = NULL; + if (!glXChannelRectSGIX_ptr) { + glXChannelRectSGIX_ptr = (glXChannelRectSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXChannelRectSGIX"); + } + if (glXChannelRectSGIX_ptr) + return (*glXChannelRectSGIX_ptr)(dpy, screen, channel, x, y, w, h); + else + return 0; +#elif defined(GLX_SGIX_video_resize) + return glXChannelRectSGIX(dpy, screen, channel, x, y, w, h); +#else + return 0; +#endif +} + + +int +__glut_glXQueryChannelRectSGIX(Display *dpy, int screen, int channel, + int *x, int *y, int *w, int *h) +{ +#ifdef GLX_ARB_get_proc_address + typedef int (*glXQueryChannelRectSGIX_t)(Display *, int, int, + int *, int *, int *, int *); + static glXQueryChannelRectSGIX_t glXQueryChannelRectSGIX_ptr = NULL; + if (!glXQueryChannelRectSGIX_ptr) { + glXQueryChannelRectSGIX_ptr = (glXQueryChannelRectSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXQueryChannelRectSGIX"); + } + if (glXQueryChannelRectSGIX_ptr) + return (*glXQueryChannelRectSGIX_ptr)(dpy, screen, channel, x, y, w, h); + else + return 0; +#elif defined(GLX_SGIX_video_resize) + return glXQueryChannelRectSGIX(dpy, screen, channel, x, y, w, h); +#else + return 0; +#endif +} + + +int +__glut_glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel, + int *dx, int *dy, int *dw, int *dh) +{ +#ifdef GLX_ARB_get_proc_address + typedef int (*glXQueryChannelDeltasSGIX_t)(Display *, int, int, + int *, int *, int *, int *); + static glXQueryChannelDeltasSGIX_t glXQueryChannelDeltasSGIX_ptr = NULL; + if (!glXQueryChannelDeltasSGIX_ptr) { + glXQueryChannelDeltasSGIX_ptr = (glXQueryChannelDeltasSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXQueryChannelDeltasSGIX"); + } + if (glXQueryChannelDeltasSGIX_ptr) + return (*glXQueryChannelDeltasSGIX_ptr)(dpy, screen, channel, + dx, dy, dw, dh); + else + return 0; +#elif defined(GLX_SGIX_video_resize) + return glXQueryChannelDeltasSGIX(dpy, screen, channel, dx, dy, dw, dh); +#else + return 0; +#endif +} + + +int +__glut_glXChannelRectSyncSGIX(Display *dpy, int screen, + int channel, GLenum synctype) +{ +#ifdef GLX_ARB_get_proc_address + typedef int (*glXChannelRectSyncSGIX_t)(Display *, int, int, GLenum); + static glXChannelRectSyncSGIX_t glXChannelRectSyncSGIX_ptr = NULL; + if (!glXChannelRectSyncSGIX_ptr) { + glXChannelRectSyncSGIX_ptr = (glXChannelRectSyncSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXChannelRectSyncSGIX"); + } + if (glXChannelRectSyncSGIX_ptr) + return (*glXChannelRectSyncSGIX_ptr)(dpy, screen, channel, synctype); + else + return 0; +#elif defined(GLX_SGIX_video_resize) + return glXChannelRectSyncSGIX(dpy, screen, channel, synctype); +#else + return 0; +#endif +} + + + +GLXContext +__glut_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, + int render_type, GLXContext share_list, + Bool direct) +{ +#ifdef GLX_ARB_get_proc_address + typedef GLXContext (*glXCreateContextWithConfigSGIX_t)(Display *, + GLXFBConfigSGIX, int, GLXContext, Bool); + static glXCreateContextWithConfigSGIX_t glXCreateContextWithConfig_ptr = NULL; + if (!glXCreateContextWithConfig_ptr) { + glXCreateContextWithConfig_ptr = (glXCreateContextWithConfigSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXCreateContextWithConfigSGIX"); + } + if (glXCreateContextWithConfig_ptr) + return (*glXCreateContextWithConfig_ptr)(dpy, config, render_type, + share_list, direct); + else + return 0; +#elif defined(GLX_SGIX_fbconfig) + return glXCreateContextWithConfigSGIX(dpy, config, render_type, + share_list, direct); +#else + return 0; +#endif +} + + +int +__glut_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, + int attribute, int *value) +{ +#ifdef GLX_ARB_get_proc_address + typedef int (*glXGetFBConfigAttribSGIX_t)(Display *, + GLXFBConfigSGIX, int, int *); + static glXGetFBConfigAttribSGIX_t glXGetFBConfigAttrib_ptr = NULL; + if (!glXGetFBConfigAttrib_ptr) { + glXGetFBConfigAttrib_ptr = (glXGetFBConfigAttribSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXGetFBConfigAttribSGIX"); + } + if (glXGetFBConfigAttrib_ptr) + return (*glXGetFBConfigAttrib_ptr)(dpy, config, attribute, value); + else + return 0; +#elif defined(GLX_SGIX_fbconfig) + return glXGetFBConfigAttribSGIX(dpy, config, attribute, value); +#else + return 0; +#endif +} + + +GLXFBConfigSGIX +__glut_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis) +{ +#ifdef GLX_ARB_get_proc_address + typedef GLXFBConfigSGIX (*glXGetFBConfigFromVisualSGIX_t)(Display *, + XVisualInfo *); + static glXGetFBConfigFromVisualSGIX_t glXGetFBConfigFromVisual_ptr = NULL; + if (!glXGetFBConfigFromVisual_ptr) { + glXGetFBConfigFromVisual_ptr = (glXGetFBConfigFromVisualSGIX_t) + glXGetProcAddressARB((const GLubyte *) "glXGetFBConfigFromVisualSGIX"); + } + if (glXGetFBConfigFromVisual_ptr) + return (*glXGetFBConfigFromVisual_ptr)(dpy, vis); + else + return 0; +#elif defined(GLX_SGIX_fbconfig) + return glXGetFBConfigFromVisualSGIX(dpy, vis); +#else + return 0; +#endif +} + + + + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_hel10.c xpsb-glx-0.19/mesa/src/glut/glx/glut_hel10.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_hel10.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_hel10.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1778 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica10 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica10 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch255 = {4,10,0,2,5,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {5,10,0,2,6,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {4,11,0,2,5,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {4,8,0,0,5,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {4,9,0,0,5,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch250 = {4,9,0,0,5,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {4,9,0,0,5,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x70,0x88,0xc8,0xa8,0x98,0x74, +}; + +static const BitmapCharRec ch248 = {6,6,0,0,6,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,0,-1,6,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch246 = {5,8,0,0,6,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {5,9,0,0,6,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch244 = {5,9,0,0,6,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {5,9,0,0,6,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {5,9,0,0,6,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch241 = {4,9,0,0,5,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50, +}; + +static const BitmapCharRec ch240 = {5,9,0,0,6,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,8,0,0,2,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,9,1,0,2,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch237 = {2,9,0,0,2,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {2,9,1,0,2,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50, +}; + +static const BitmapCharRec ch235 = {4,8,0,0,5,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch234 = {4,9,0,0,5,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch233 = {4,9,0,0,5,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch232 = {4,9,0,0,5,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch231 = {4,8,0,2,5,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6c,0x92,0x90,0x7e,0x12,0xec, +}; + +static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20, +}; + +static const BitmapCharRec ch229 = {5,9,0,0,5,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50, +}; + +static const BitmapCharRec ch228 = {5,8,0,0,5,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch227 = {5,9,0,0,5,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch226 = {5,9,0,0,5,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {5,9,0,0,5,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch224 = {5,9,0,0,5,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch223 = {4,8,0,0,5,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {5,8,-1,0,7,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,11,0,0,7,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, +}; + +static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {6,11,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch218 = {6,11,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,11,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch216 = {6,10,-1,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,0,-1,6,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48, +}; + +static const BitmapCharRec ch214 = {6,10,-1,0,8,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {6,11,-1,0,8,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch212 = {6,11,-1,0,8,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {6,11,-1,0,8,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch210 = {6,11,-1,0,8,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {6,11,-1,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78, +}; + +static const BitmapCharRec ch208 = {7,8,0,0,8,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,10,0,0,3,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,11,0,0,3,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch205 = {2,11,-1,0,3,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {2,11,0,0,3,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50, +}; + +static const BitmapCharRec ch203 = {5,10,-1,0,7,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch202 = {5,11,-1,0,7,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {5,11,-1,0,7,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch200 = {5,11,-1,0,7,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch199 = {6,10,-1,2,8,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80, +}; + +static const BitmapCharRec ch198 = {9,8,0,0,10,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,11,0,0,7,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,10,0,0,7,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,11,0,0,7,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,11,0,0,7,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,11,0,0,7,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,11,0,0,7,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {4,8,-1,2,6,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0, +}; + +static const BitmapCharRec ch190 = {9,8,0,0,9,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42, +}; + +static const BitmapCharRec ch189 = {8,8,0,0,9,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0, +}; + +static const BitmapCharRec ch188 = {9,8,0,0,9,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x28,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {5,5,0,0,6,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0xe0,0xa0,0xe0, +}; + +static const BitmapCharRec ch186 = {3,5,0,-3,4,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {2,4,0,-3,3,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x40, +}; + +static const BitmapCharRec ch184 = {2,2,0,2,3,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0, +}; + +static const BitmapCharRec ch183 = {2,1,0,-3,3,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,10,0,2,6,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch181 = {4,8,0,2,5,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-6,3,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0xe0, +}; + +static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xe0,0x40,0xa0,0x60, +}; + +static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xe0, +}; + +static const BitmapCharRec ch175 = {3,1,0,-7,3,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xba,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xe0, +}; + +static const BitmapCharRec ch173 = {3,1,0,-3,4,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch172 = {5,3,-1,-2,7,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x28,0x50,0xa0,0x50,0x28, +}; + +static const BitmapCharRec ch171 = {5,5,0,0,6,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xe0, +}; + +static const BitmapCharRec ch170 = {3,5,0,-3,4,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,0,-7,3,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,10,0,2,6,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,10,-1,2,3,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch165 = {5,8,0,0,6,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x90,0x60,0x90,0x90,0x60,0x90, +}; + +static const BitmapCharRec ch164 = {4,6,0,-1,5,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30, +}; + +static const BitmapCharRec ch163 = {5,8,0,0,6,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {5,8,0,1,6,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,8,-1,2,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,3,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,3,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch125 = {3,10,0,2,3,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,10,-1,2,3,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch123 = {3,10,0,2,3,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x80,0x40,0x20,0x10,0xf0, +}; + +static const BitmapCharRec ch122 = {4,6,0,0,5,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90, +}; + +static const BitmapCharRec ch121 = {4,8,0,2,5,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x88,0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch120 = {5,6,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x28,0x28,0x54,0x54,0x92,0x92, +}; + +static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x20,0x50,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,6,0,0,6,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x70,0x90,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch117 = {4,6,0,0,5,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {3,8,0,0,4,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x60,0x90,0x10,0x60,0x90,0x60, +}; + +static const BitmapCharRec ch115 = {4,6,0,0,5,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x80,0x80,0x80,0x80,0xc0,0xa0, +}; + +static const BitmapCharRec ch114 = {3,6,0,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch113 = {5,8,0,2,6,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch112 = {5,8,0,2,6,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x70,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch111 = {5,6,0,0,6,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x88,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch110 = {5,6,0,0,6,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x92,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch108 = {1,8,0,0,2,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {4,8,0,0,5,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch106 = {1,9,0,1,2,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch105 = {1,8,0,0,2,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,8,0,0,6,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch103 = {5,8,0,2,6,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,8,0,0,4,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60, +}; + +static const BitmapCharRec ch101 = {4,6,0,0,5,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8, +}; + +static const BitmapCharRec ch100 = {5,8,0,0,6,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x60,0x90,0x80,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch99 = {4,6,0,0,5,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {5,8,0,0,6,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0, +}; + +static const BitmapCharRec ch97 = {5,6,0,0,5,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x80,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,3,0,-5,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfc, +}; + +static const BitmapCharRec ch95 = {6,1,0,2,6,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x50,0x20,0x20, +}; + +static const BitmapCharRec ch94 = {5,5,0,-3,6,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,10,0,2,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {3,8,0,0,3,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,10,-1,2,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch90 = {5,8,-1,0,7,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82, +}; + +static const BitmapCharRec ch89 = {7,8,0,0,7,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch88 = {5,8,-1,0,7,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +}; + +static const BitmapCharRec ch87 = {9,8,0,0,9,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,8,0,0,7,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,8,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch84 = {5,8,0,0,5,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch83 = {5,8,-1,0,7,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch82 = {5,8,-1,0,7,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch81 = {7,9,-1,1,8,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch80 = {5,8,-1,0,7,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch79 = {6,8,-1,0,8,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4, +}; + +static const BitmapCharRec ch78 = {6,8,-1,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82, +}; + +static const BitmapCharRec ch77 = {7,8,-1,0,9,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {4,8,-1,0,6,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88, +}; + +static const BitmapCharRec ch75 = {5,8,-1,0,7,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch74 = {4,8,0,0,5,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch73 = {1,8,-1,0,3,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch72 = {6,8,-1,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch71 = {6,8,-1,0,8,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch70 = {5,8,-1,0,6,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch69 = {5,8,-1,0,7,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0, +}; + +static const BitmapCharRec ch68 = {6,8,-1,0,8,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch67 = {6,8,-1,0,8,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch66 = {5,8,-1,0,7,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10, +}; + +static const BitmapCharRec ch65 = {7,8,0,0,7,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40, +0x20,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch64 = {10,10,0,2,11,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch63 = {4,8,-1,0,6,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {3,5,-1,-1,6,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf0,0x0,0xf0, +}; + +static const BitmapCharRec ch61 = {4,3,0,-2,5,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x20,0x40,0x80,0x40,0x20, +}; + +static const BitmapCharRec ch60 = {3,5,-1,-1,6,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, +}; + +static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch57 = {5,8,0,0,6,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch56 = {5,8,0,0,6,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch55 = {5,8,0,0,6,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch54 = {5,8,0,0,6,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch53 = {5,8,0,0,6,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch52 = {5,8,0,0,6,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch51 = {5,8,0,0,6,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch50 = {5,8,0,0,6,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch49 = {2,8,-1,0,6,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch48 = {5,8,0,0,6,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20, +}; + +static const BitmapCharRec ch47 = {3,8,0,0,3,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf8, +}; + +static const BitmapCharRec ch45 = {5,1,-1,-3,7,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch44 = {2,3,0,2,3,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,0,-1,6,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,0,-5,4,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,10,-1,2,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,10,0,2,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch39 = {2,3,-1,-5,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20, +}; + +static const BitmapCharRec ch38 = {6,8,-1,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64, +}; + +static const BitmapCharRec ch37 = {8,8,0,0,9,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {5,9,0,1,6,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0xf8,0x28,0x7c,0x28,0x28, +}; + +static const BitmapCharRec ch35 = {6,7,0,0,6,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,2,-1,-6,4,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,8,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {0,0,0,0,3,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,3,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapHelvetica10 = { +"-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_hel12.c xpsb-glx-0.19/mesa/src/glut/glx/glut_hel12.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_hel12.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_hel12.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1788 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica12 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica12 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50, +}; + +static const BitmapCharRec ch255 = {5,12,-1,3,7,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {5,12,-1,3,7,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {5,13,-1,3,7,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {5,9,-1,0,7,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {5,10,-1,0,7,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch250 = {5,10,-1,0,7,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {5,10,-1,0,7,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a, +}; + +static const BitmapCharRec ch248 = {7,7,0,0,7,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,-1,-1,7,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch246 = {5,9,-1,0,7,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {5,10,-1,0,7,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch244 = {5,10,-1,0,7,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {5,10,-1,0,7,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {5,10,-1,0,7,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {5,10,-1,0,7,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68, +}; + +static const BitmapCharRec ch240 = {5,10,-1,0,7,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,9,0,0,3,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,10,0,0,3,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch237 = {2,10,-1,0,3,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {2,10,0,0,3,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch235 = {5,9,-1,0,7,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch234 = {5,10,-1,0,7,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch233 = {5,10,-1,0,7,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch232 = {5,10,-1,0,7,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch231 = {5,10,-1,3,7,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0, +}; + +static const BitmapCharRec ch230 = {9,7,-1,0,11,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch229 = {6,10,-1,0,7,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch228 = {6,9,-1,0,7,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {6,10,-1,0,7,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch226 = {6,10,-1,0,7,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {6,10,-1,0,7,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch224 = {6,10,-1,0,7,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch223 = {5,9,-1,0,7,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,12,-1,0,9,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, +}; + +static const BitmapCharRec ch220 = {6,11,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {6,12,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch218 = {6,12,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,12,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80, +0x21,0x0,0x1e,0x80,0x0,0x40, +}; + +static const BitmapCharRec ch216 = {10,11,0,1,10,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,-1,-1,7,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24, +}; + +static const BitmapCharRec ch214 = {8,11,-1,0,10,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch213 = {8,12,-1,0,10,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8, +}; + +static const BitmapCharRec ch212 = {8,12,-1,0,10,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4, +}; + +static const BitmapCharRec ch211 = {8,12,-1,0,10,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10, +}; + +static const BitmapCharRec ch210 = {8,12,-1,0,10,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch209 = {7,12,-1,0,9,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c, +}; + +static const BitmapCharRec ch208 = {8,9,0,0,9,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,11,0,0,3,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,12,0,0,3,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch205 = {2,12,-1,0,3,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {2,12,0,0,3,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28, +}; + +static const BitmapCharRec ch203 = {6,11,-1,0,8,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch202 = {6,12,-1,0,8,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch201 = {6,12,-1,0,8,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch200 = {6,12,-1,0,8,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch199 = {7,12,-1,3,9,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0, +0x1f,0x80, +}; + +static const BitmapCharRec ch198 = {9,9,-1,0,11,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,12,-1,0,9,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,12,-1,0,9,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,12,-1,0,9,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,12,-1,0,9,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,12,-1,0,9,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {5,9,-1,3,7,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0, +0xe1,0x0, +}; + +static const BitmapCharRec ch190 = {9,9,0,0,10,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0, +0x41,0x0, +}; + +static const BitmapCharRec ch189 = {9,9,0,0,10,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0, +0x41,0x0, +}; + +static const BitmapCharRec ch188 = {9,9,0,0,10,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x28,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {5,5,-1,-1,7,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0xe0,0xa0,0xe0, +}; + +static const BitmapCharRec ch186 = {3,5,-1,-4,5,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {2,5,-1,-3,4,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x20,0x20,0x40, +}; + +static const BitmapCharRec ch184 = {3,4,0,3,3,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0x80, +}; + +static const BitmapCharRec ch183 = {1,1,-1,-3,3,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c, +}; + +static const BitmapCharRec ch182 = {6,12,0,3,7,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch181 = {5,10,-1,3,7,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-8,2,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0x20,0xe0, +}; + +static const BitmapCharRec ch179 = {3,5,0,-3,4,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x40,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,5,0,-3,4,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,-1,0,7,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-4,5,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xf0, +}; + +static const BitmapCharRec ch175 = {4,1,0,-8,4,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0, +0x3e,0x0, +}; + +static const BitmapCharRec ch174 = {9,9,-1,0,11,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xf0, +}; + +static const BitmapCharRec ch173 = {4,1,0,-3,5,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-2,8,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x28,0x50,0xa0,0x50,0x28, +}; + +static const BitmapCharRec ch171 = {5,5,-1,-1,7,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xe0, +}; + +static const BitmapCharRec ch170 = {3,5,-1,-4,5,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0, +0x3e,0x0, +}; + +static const BitmapCharRec ch169 = {9,9,-1,0,11,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,0,-8,3,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,12,0,3,6,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,11,-1,2,3,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch165 = {5,9,-1,0,7,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x84,0x78,0x48,0x48,0x78,0x84, +}; + +static const BitmapCharRec ch164 = {6,6,0,-1,7,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30, +}; + +static const BitmapCharRec ch163 = {5,9,-1,0,7,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {5,9,-1,1,7,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,10,-1,3,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,4,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,4,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0, +}; + +static const BitmapCharRec ch125 = {4,12,0,3,4,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,12,-1,3,3,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, +}; + +static const BitmapCharRec ch123 = {4,12,0,3,4,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x80,0x40,0x40,0x20,0x10,0xf0, +}; + +static const BitmapCharRec ch122 = {4,7,-1,0,6,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch121 = {5,10,-1,3,7,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x84,0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch120 = {6,7,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +}; + +static const BitmapCharRec ch119 = {9,7,0,0,9,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x20,0x50,0x50,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,7,-1,0,7,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch117 = {5,7,-1,0,7,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {3,9,0,0,3,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x60,0x90,0x10,0x60,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch115 = {4,7,-1,0,6,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x80,0x80,0x80,0x80,0x80,0xc0,0xa0, +}; + +static const BitmapCharRec ch114 = {3,7,-1,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch113 = {5,10,-1,3,7,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch112 = {5,10,-1,3,7,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch111 = {5,7,-1,0,7,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch110 = {5,7,-1,0,7,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x92,0x92,0x92,0x92,0x92,0xda,0xa4, +}; + +static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch108 = {1,9,-1,0,3,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {5,9,-1,0,6,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40, +}; + +static const BitmapCharRec ch106 = {2,12,0,3,3,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch105 = {1,9,-1,0,3,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,9,-1,0,7,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch103 = {5,10,-1,3,7,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,9,0,0,3,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch101 = {5,7,-1,0,7,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8, +}; + +static const BitmapCharRec ch100 = {5,9,-1,0,7,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x70,0x88,0x80,0x80,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch99 = {5,7,-1,0,7,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {5,9,-1,0,7,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch97 = {6,7,-1,0,7,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,3,0,-6,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfe, +}; + +static const BitmapCharRec ch95 = {7,1,0,2,7,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x20, +}; + +static const BitmapCharRec ch94 = {5,3,0,-5,6,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,12,0,3,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {4,9,0,0,4,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,12,-1,3,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch90 = {7,9,-1,0,9,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,9,-1,0,9,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82, +}; + +static const BitmapCharRec ch88 = {7,9,-1,0,9,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +0x88,0x80, +}; + +static const BitmapCharRec ch87 = {9,9,-1,0,11,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,9,-1,0,9,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,9,0,0,7,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c, +}; + +static const BitmapCharRec ch81 = {8,9,-1,0,10,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c, +}; + +static const BitmapCharRec ch79 = {8,9,-1,0,10,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82, +}; + +static const BitmapCharRec ch78 = {7,9,-1,0,9,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80, +0x80,0x80, +}; + +static const BitmapCharRec ch77 = {9,9,-1,0,11,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {5,9,-1,0,7,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84, +}; + +static const BitmapCharRec ch75 = {7,9,-1,0,8,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch74 = {5,9,-1,0,7,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch73 = {1,9,-1,0,3,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch72 = {7,9,-1,0,9,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch71 = {7,9,-1,0,9,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8, +}; + +static const BitmapCharRec ch68 = {7,9,-1,0,9,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch67 = {7,9,-1,0,9,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch66 = {6,9,-1,0,8,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10, +}; + +static const BitmapCharRec ch65 = {7,9,-1,0,9,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40, +0x60,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch64 = {10,10,-1,1,12,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch63 = {5,9,-1,0,7,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0x30,0xc,0x30,0xc0, +}; + +static const BitmapCharRec ch62 = {6,5,-1,-1,7,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf8,0x0,0xf8, +}; + +static const BitmapCharRec ch61 = {5,3,-1,-2,7,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0xc,0x30,0xc0,0x30,0xc, +}; + +static const BitmapCharRec ch60 = {6,5,0,-1,7,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, +}; + +static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch57 = {5,9,-1,0,7,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch56 = {5,9,-1,0,7,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch55 = {5,9,-1,0,7,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch54 = {5,9,-1,0,7,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch53 = {5,9,-1,0,7,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8, +}; + +static const BitmapCharRec ch52 = {6,9,0,0,7,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch51 = {5,9,-1,0,7,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch50 = {5,9,-1,0,7,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20, +}; + +static const BitmapCharRec ch49 = {3,9,-1,0,7,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch48 = {5,9,-1,0,7,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10, +}; + +static const BitmapCharRec ch47 = {4,9,0,0,4,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf8, +}; + +static const BitmapCharRec ch45 = {5,1,-1,-3,8,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch44 = {2,3,-1,2,4,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,-1,-1,7,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,-1,-6,5,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,12,0,3,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,12,-1,3,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0xc0, +}; + +static const BitmapCharRec ch39 = {2,3,-1,-6,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30, +}; + +static const BitmapCharRec ch38 = {7,9,-1,0,9,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0, +0x62,0x0, +}; + +static const BitmapCharRec ch37 = {9,9,-1,0,11,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {5,10,-1,1,7,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28, +}; + +static const BitmapCharRec ch35 = {6,8,0,0,7,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,3,-1,-6,5,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,9,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,4,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,4,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapHelvetica12 = { +"-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_hel18.c xpsb-glx-0.19/mesa/src/glut/glx/glut_hel18.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_hel18.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_hel18.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1897 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica18 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica18 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66, +0x66, +}; + +static const BitmapCharRec ch255 = {8,17,-1,4,10,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch254 = {9,18,-1,4,11,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18, +0xc,0x6, +}; + +static const BitmapCharRec ch253 = {8,18,-1,4,10,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66, +}; + +static const BitmapCharRec ch252 = {8,13,-1,0,10,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch251 = {8,14,-1,0,10,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6, +}; + +static const BitmapCharRec ch250 = {8,14,-1,0,10,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30, +}; + +static const BitmapCharRec ch249 = {8,14,-1,0,10,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80, +0x3f,0xc0,0xe,0x60, +}; + +static const BitmapCharRec ch248 = {11,10,0,0,11,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18, +}; + +static const BitmapCharRec ch247 = {8,8,-1,-1,10,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0, +}; + +static const BitmapCharRec ch246 = {9,13,-1,0,11,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0, +}; + +static const BitmapCharRec ch245 = {9,14,-1,0,11,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch244 = {9,14,-1,0,11,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch243 = {9,14,-1,0,11,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0, +}; + +static const BitmapCharRec ch242 = {9,14,-1,0,11,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32, +}; + +static const BitmapCharRec ch241 = {8,14,-1,0,10,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0, +}; + +static const BitmapCharRec ch240 = {9,14,-1,0,11,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8, +}; + +static const BitmapCharRec ch239 = {5,13,0,0,4,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30, +}; + +static const BitmapCharRec ch238 = {6,14,1,0,4,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30, +}; + +static const BitmapCharRec ch237 = {4,14,0,0,4,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0, +}; + +static const BitmapCharRec ch236 = {4,14,0,0,4,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36, +}; + +static const BitmapCharRec ch235 = {8,13,-1,0,10,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch234 = {8,14,-1,0,10,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6, +}; + +static const BitmapCharRec ch233 = {8,14,-1,0,10,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60, +}; + +static const BitmapCharRec ch232 = {8,14,-1,0,10,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, +}; + +static const BitmapCharRec ch231 = {8,14,-1,4,10,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18, +0xef,0xf0,0x7d,0xe0, +}; + +static const BitmapCharRec ch230 = {13,10,-1,0,15,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38, +}; + +static const BitmapCharRec ch229 = {7,14,-1,0,9,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c, +}; + +static const BitmapCharRec ch228 = {7,13,-1,0,9,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32, +}; + +static const BitmapCharRec ch227 = {7,14,-1,0,9,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch226 = {7,14,-1,0,9,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc, +}; + +static const BitmapCharRec ch225 = {7,14,-1,0,9,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60, +}; + +static const BitmapCharRec ch224 = {7,14,-1,0,9,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38, +}; + +static const BitmapCharRec ch223 = {7,14,-1,0,9,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch222 = {10,14,-1,0,12,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0, +0x3,0x0,0x1,0x80, +}; + +static const BitmapCharRec ch221 = {12,18,-1,0,14,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, +0x19,0x80, +}; + +static const BitmapCharRec ch220 = {11,17,-1,0,13,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, +0xf,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch219 = {11,18,-1,0,13,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0, +0x6,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch218 = {11,18,-1,0,13,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0, +0xc,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch217 = {11,18,-1,0,13,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c, +0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc, +}; + +static const BitmapCharRec ch216 = {14,14,0,0,15,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80, +0xc0,0xc0, +}; + +static const BitmapCharRec ch215 = {10,9,0,0,10,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80, +0xd,0x80, +}; + +static const BitmapCharRec ch214 = {13,17,-1,0,15,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80, +0xb,0x40,0x6,0x40, +}; + +static const BitmapCharRec ch213 = {13,18,-1,0,15,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0, +0x7,0x80,0x3,0x0, +}; + +static const BitmapCharRec ch212 = {13,18,-1,0,15,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, +0x1,0x80,0x0,0xc0, +}; + +static const BitmapCharRec ch211 = {13,18,-1,0,15,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, +0x6,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch210 = {13,18,-1,0,15,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, +0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0, +0x16,0x80,0xc,0x80, +}; + +static const BitmapCharRec ch209 = {11,18,-1,0,13,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30, +0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80, +}; + +static const BitmapCharRec ch208 = {12,14,0,0,13,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, +0xcc, +}; + +static const BitmapCharRec ch207 = {6,17,0,0,6,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, +0x78,0x30, +}; + +static const BitmapCharRec ch206 = {6,18,0,0,6,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0, +0x60,0x30, +}; + +static const BitmapCharRec ch205 = {4,18,-2,0,6,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30, +0x60,0xc0, +}; + +static const BitmapCharRec ch204 = {4,18,0,0,6,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, +0x33,0x0, +}; + +static const BitmapCharRec ch203 = {9,17,-1,0,11,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, +0x1e,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch202 = {9,18,-1,0,11,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, +0x6,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch201 = {9,18,-1,0,11,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, +0x18,0x0,0x30,0x0, +}; + +static const BitmapCharRec ch200 = {9,18,-1,0,11,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30, +0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70, +0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch199 = {12,18,-1,4,14,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe, +0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff, +}; + +static const BitmapCharRec ch198 = {16,14,-1,0,18,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x19,0x80,0xf,0x0, +}; + +static const BitmapCharRec ch197 = {12,18,0,0,12,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, +0x19,0x80, +}; + +static const BitmapCharRec ch196 = {12,17,0,0,12,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0, +0x16,0x80,0xc,0x80, +}; + +static const BitmapCharRec ch195 = {12,18,0,0,12,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, +0xf,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch194 = {12,18,0,0,12,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, +0x3,0x0,0x1,0x80, +}; + +static const BitmapCharRec ch193 = {12,18,0,0,12,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, +0xc,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch192 = {12,18,0,0,12,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18, +}; + +static const BitmapCharRec ch191 = {7,14,-1,4,10,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88, +0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30, +}; + +static const BitmapCharRec ch190 = {14,13,0,0,15,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70, +0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, +}; + +static const BitmapCharRec ch189 = {13,13,-1,0,15,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10, +0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, +}; + +static const BitmapCharRec ch188 = {13,13,-1,0,15,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90, +}; + +static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70, +}; + +static const BitmapCharRec ch186 = {5,8,-1,-6,7,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60, +}; + +static const BitmapCharRec ch185 = {3,8,-1,-5,6,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xf0,0xd8,0x18,0x70,0x60, +}; + +static const BitmapCharRec ch184 = {5,5,0,4,5,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-1,-4,4,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2, +0x72,0x3f, +}; + +static const BitmapCharRec ch182 = {8,18,-1,4,10,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch181 = {8,14,-1,4,10,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0xc0,0x60,0x30, +}; + +static const BitmapCharRec ch180 = {4,3,0,-11,4,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70, +}; + +static const BitmapCharRec ch179 = {5,8,0,-5,6,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70, +}; + +static const BitmapCharRec ch178 = {5,8,0,-5,6,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18, +}; + +static const BitmapCharRec ch177 = {8,11,-1,0,10,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x70,0xd8,0x88,0xd8,0x70, +}; + +static const BitmapCharRec ch176 = {5,5,-1,-8,7,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xf8, +}; + +static const BitmapCharRec ch175 = {5,1,0,-12,5,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48, +0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80, +}; + +static const BitmapCharRec ch174 = {13,13,-1,0,14,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xf8,0xf8, +}; + +static const BitmapCharRec ch173 = {5,2,-1,-4,7,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch172 = {9,5,-1,-3,11,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12, +}; + +static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70, +}; + +static const BitmapCharRec ch170 = {5,8,-1,-6,7,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8, +0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80, +}; + +static const BitmapCharRec ch169 = {13,13,-1,0,15,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xd8,0xd8, +}; + +static const BitmapCharRec ch168 = {5,2,0,-11,6,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3, +0x7e,0x3c, +}; + +static const BitmapCharRec ch167 = {8,18,-1,4,10,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch166 = {2,17,-1,3,4,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3, +}; + +static const BitmapCharRec ch165 = {8,13,-1,0,10,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0xc3,0xff,0x66,0x66,0x66,0xff,0xc3, +}; + +static const BitmapCharRec ch164 = {8,7,-1,-3,10,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0, +0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0, +}; + +static const BitmapCharRec ch163 = {9,13,0,0,10,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4, +}; + +static const BitmapCharRec ch162 = {8,14,-1,2,10,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch161 = {2,14,-2,4,6,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,5,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,5,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0xcc,0x7e,0x33, +}; + +static const BitmapCharRec ch126 = {8,3,-1,-4,10,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30, +0x60,0xc0, +}; + +static const BitmapCharRec ch125 = {6,18,0,4,6,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0, +}; + +static const BitmapCharRec ch124 = {2,18,-1,4,4,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30, +0x18,0xc, +}; + +static const BitmapCharRec ch123 = {6,18,0,4,6,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe, +}; + +static const BitmapCharRec ch122 = {7,10,-1,0,9,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch121 = {8,14,-1,4,10,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3, +}; + +static const BitmapCharRec ch120 = {8,10,-1,0,10,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30, +0xc6,0x30,0xc6,0x30, +}; + +static const BitmapCharRec ch119 = {12,10,-1,0,14,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch118 = {8,10,-1,0,10,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch117 = {8,10,-1,0,10,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30, +}; + +static const BitmapCharRec ch116 = {6,13,0,0,6,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c, +}; + +static const BitmapCharRec ch115 = {7,10,-1,0,9,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8, +}; + +static const BitmapCharRec ch114 = {5,10,-1,0,6,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80, +}; + +static const BitmapCharRec ch113 = {9,14,-1,4,11,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0, +}; + +static const BitmapCharRec ch112 = {9,14,-1,4,11,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0, +}; + +static const BitmapCharRec ch111 = {9,10,-1,0,11,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce, +}; + +static const BitmapCharRec ch110 = {8,10,-1,0,10,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30, +0xde,0xf0,0xcc,0x60, +}; + +static const BitmapCharRec ch109 = {12,10,-1,0,14,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch108 = {2,14,-1,0,4,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch107 = {8,14,-1,0,9,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0, +0x30,0x30, +}; + +static const BitmapCharRec ch106 = {4,18,1,4,4,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch105 = {2,14,-1,0,4,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch104 = {8,14,-1,0,10,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80, +}; + +static const BitmapCharRec ch103 = {9,14,-1,4,11,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c, +}; + +static const BitmapCharRec ch102 = {6,14,0,0,6,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c, +}; + +static const BitmapCharRec ch101 = {8,10,-1,0,10,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80, +0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, +}; + +static const BitmapCharRec ch100 = {9,14,-1,0,11,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, +}; + +static const BitmapCharRec ch99 = {8,10,-1,0,10,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0, +0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch98 = {9,14,-1,0,11,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c, +}; + +static const BitmapCharRec ch97 = {7,10,-1,0,9,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0xc0,0x80,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,5,-1,-9,4,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch95 = {10,2,0,4,10,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x82,0xc6,0x6c,0x38,0x10, +}; + +static const BitmapCharRec ch94 = {7,5,-1,-8,9,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xf0,0xf0, +}; + +static const BitmapCharRec ch93 = {4,18,0,4,5,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch92 = {5,14,0,0,5,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xf0,0xf0, +}; + +static const BitmapCharRec ch91 = {4,18,-1,4,5,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0, +0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch90 = {10,14,-1,0,12,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, +}; + +static const BitmapCharRec ch89 = {12,14,-1,0,14,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0, +0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60, +}; + +static const BitmapCharRec ch88 = {11,14,-1,0,13,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66, +0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83, +}; + +static const BitmapCharRec ch87 = {16,14,-1,0,18,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0, +0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, +}; + +static const BitmapCharRec ch86 = {12,14,-1,0,14,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch85 = {11,14,-1,0,13,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0, +0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch84 = {10,14,-1,0,12,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0, +0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0, +}; + +static const BitmapCharRec ch83 = {11,14,-1,0,13,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80, +0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch82 = {10,14,-1,0,12,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch81 = {13,15,-1,1,15,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80, +0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch80 = {10,14,-1,0,12,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch79 = {13,14,-1,0,15,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, +0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch78 = {11,14,-1,0,13,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c, +0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc, +}; + +static const BitmapCharRec ch77 = {14,14,-1,0,16,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch76 = {8,14,-1,0,10,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0, +0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0, +}; + +static const BitmapCharRec ch75 = {12,14,-1,0,13,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3, +}; + +static const BitmapCharRec ch74 = {8,14,-1,0,10,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch73 = {2,14,-2,0,6,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch72 = {11,14,-1,0,13,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0, +0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch71 = {12,14,-1,0,14,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch70 = {9,14,-1,0,11,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch69 = {9,14,-1,0,11,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch68 = {11,14,-1,0,13,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch67 = {12,14,-1,0,14,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80, +0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch66 = {11,14,-1,0,13,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch65 = {12,14,0,0,12,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66, +0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc, +0x3,0xf0, +}; + +static const BitmapCharRec ch64 = {16,17,-1,3,18,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c, +}; + +static const BitmapCharRec ch63 = {7,14,-1,0,10,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0, +}; + +static const BitmapCharRec ch62 = {8,9,-1,0,10,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfe,0xfe,0x0,0x0,0xfe,0xfe, +}; + +static const BitmapCharRec ch61 = {7,6,-2,-2,11,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3, +}; + +static const BitmapCharRec ch60 = {8,9,-1,0,10,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {2,13,-1,3,5,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,10,-1,0,5,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c, +}; + +static const BitmapCharRec ch57 = {8,13,-1,0,10,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c, +}; + +static const BitmapCharRec ch56 = {8,13,-1,0,10,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff, +}; + +static const BitmapCharRec ch55 = {8,13,-1,0,10,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c, +}; + +static const BitmapCharRec ch54 = {8,13,-1,0,10,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe, +}; + +static const BitmapCharRec ch53 = {8,13,-1,0,10,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0, +0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch52 = {9,13,-1,0,10,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c, +}; + +static const BitmapCharRec ch51 = {8,13,-1,0,10,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c, +}; + +static const BitmapCharRec ch50 = {8,13,-1,0,10,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18, +}; + +static const BitmapCharRec ch49 = {5,13,-2,0,10,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c, +}; + +static const BitmapCharRec ch48 = {8,13,-1,0,10,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18, +}; + +static const BitmapCharRec ch47 = {5,14,0,0,5,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-1,0,5,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xff,0xff, +}; + +static const BitmapCharRec ch45 = {8,2,-1,-4,11,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch44 = {2,5,-1,3,5,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18, +}; + +static const BitmapCharRec ch43 = {8,10,-1,0,10,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x88,0x70,0x70,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch42 = {5,6,-1,-8,7,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60, +0xc0,0x80, +}; + +static const BitmapCharRec ch41 = {4,18,-1,4,6,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60, +0x30,0x10, +}; + +static const BitmapCharRec ch40 = {4,18,-1,4,6,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch39 = {2,5,-1,-9,4,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0, +0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0, +}; + +static const BitmapCharRec ch38 = {12,13,-1,0,13,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0, +0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60, +}; + +static const BitmapCharRec ch37 = {14,13,-1,0,16,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0, +0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0, +}; + +static const BitmapCharRec ch36 = {9,16,-1,2,10,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0, +0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0, +}; + +static const BitmapCharRec ch35 = {10,13,0,0,10,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0xd8,0xd8,0xd8, +}; + +static const BitmapCharRec ch34 = {5,5,0,-9,5,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch33 = {2,14,-2,0,6,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,5,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,5,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapHelvetica18 = { +"-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_init.c xpsb-glx-0.19/mesa/src/glut/glx/glut_init.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_init.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_init.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,394 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include + +#if !defined(_WIN32) +#include +#include +#endif + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif + +#include "glutint.h" + +/* GLUT inter-file variables */ +/* *INDENT-OFF* */ +char *__glutProgramName = NULL; +int __glutArgc = 0; +char **__glutArgv = NULL; +char *__glutGeometry = NULL; +Display *__glutDisplay = NULL; +int __glutScreen; +Window __glutRoot; +int __glutScreenHeight; +int __glutScreenWidth; +GLboolean __glutIconic = GL_FALSE; +GLboolean __glutDebug = GL_FALSE; +unsigned int __glutDisplayMode = + GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH; +char *__glutDisplayString = NULL; +int __glutConnectionFD; +XSizeHints __glutSizeHints = {0}; +int __glutInitWidth = 300, __glutInitHeight = 300; +int __glutInitX = -1, __glutInitY = -1; +GLboolean __glutForceDirect = GL_FALSE, + __glutTryDirect = GL_TRUE; +Atom __glutWMDeleteWindow; +char *__glutPPMFile = NULL; +/* *INDENT-ON* */ + +#ifdef _WIN32 +void (__cdecl *__glutExitFunc)(int retval) = NULL; +#endif + +static Bool synchronize = False; + +#if defined(_WIN32) + +#ifdef __BORLANDC__ +#include /* For masking floating point exceptions. */ +#endif + +void +__glutOpenWin32Connection(char* display) +{ + static char *classname; + WNDCLASS wc; + HINSTANCE hInstance = GetModuleHandle(NULL); + + /* Make sure we register the window only once. */ + if(classname) + return; + +#ifdef __BORLANDC__ + /* Under certain conditions (e.g. while rendering solid surfaces with + lighting enabled) Microsoft OpenGL libraries cause some illegal + operations like floating point overflow or division by zero. The + default behaviour of Microsoft compilers is to mask (ignore) + floating point exceptions, while Borland compilers do not. The + following function of Borland RTL allows to mask exceptions. + Advice from Pier Giorgio Esposito (mc2172@mclink.it). */ + _control87(MCW_EM,MCW_EM); +#endif + + classname = "GLUT"; + + /* Clear (important!) and then fill in the window class structure. */ + memset(&wc, 0, sizeof(WNDCLASS)); + wc.style = CS_OWNDC; + wc.lpfnWndProc = (WNDPROC)__glutWindowProc; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, "GLUT_ICON"); + wc.hCursor = LoadCursor(hInstance, IDC_ARROW); + wc.hbrBackground = NULL; + wc.lpszMenuName = NULL; + wc.lpszClassName = classname; + + /* Fill in a default icon if one isn't specified as a resource. */ + if(!wc.hIcon) + wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); + + if(!RegisterClass(&wc)) { + __glutFatalError("RegisterClass() failed:" + "Cannot register GLUT window class."); + } + + __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN); + __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN); + + /* Set the root window to NULL because windows creates a top-level + window when the parent is NULL. X creates a top-level window + when the parent is the root window. */ + __glutRoot = NULL; + + /* Set the display to 1 -- we shouldn't be using this anywhere + (except as an argument to X calls). */ + __glutDisplay = (Display*)1; + + /* There isn't any concept of multiple screens in Win32, therefore, + we don't need to keep track of the screen we're on... it's always + the same one. */ + __glutScreen = 0; +} +#else /* !_WIN32 */ +void +__glutOpenXConnection(char *display) +{ + int errorBase, eventBase; + + __glutDisplay = XOpenDisplay(display); + if (!__glutDisplay) + __glutFatalError("could not open display: %s", + XDisplayName(display)); + if (synchronize) + XSynchronize(__glutDisplay, True); + if (!glXQueryExtension(__glutDisplay, &errorBase, &eventBase)) + __glutFatalError( + "OpenGL GLX extension not supported by display: %s", + XDisplayName(display)); + __glutScreen = DefaultScreen(__glutDisplay); + __glutRoot = RootWindow(__glutDisplay, __glutScreen); + __glutScreenWidth = DisplayWidth(__glutDisplay, __glutScreen); + __glutScreenHeight = DisplayHeight(__glutDisplay, + __glutScreen); + __glutConnectionFD = ConnectionNumber(__glutDisplay); + __glutWMDeleteWindow = XSGIFastInternAtom(__glutDisplay, + "WM_DELETE_WINDOW", SGI_XA_WM_DELETE_WINDOW, False); +} +#endif /* _WIN32 */ + +void +#ifdef OLD_VMS + __glutInitTime(struct timeval6 *beginning) +#else + __glutInitTime(struct timeval *beginning) +#endif +{ + static int beenhere = 0; +#ifdef OLD_VMS + static struct timeval6 genesis; +#else + static struct timeval genesis; +#endif + + if (!beenhere) { + GETTIMEOFDAY(&genesis); + beenhere = 1; + } + *beginning = genesis; +} + +static void +removeArgs(int *argcp, char **argv, int numToRemove) +{ + int i, j; + + for (i = 0, j = numToRemove; argv[j]; i++, j++) { + argv[i] = argv[j]; + } + argv[i] = NULL; + *argcp -= numToRemove; +} + +void GLUTAPIENTRY +glutInit(int *argcp, char **argv) +{ + char *display = NULL; + char *str, *geometry = NULL; +#ifdef OLD_VMS + struct timeval6 unused; +#else + struct timeval unused; +#endif + int i; + + if (__glutDisplay) { + __glutWarning("glutInit being called a second time."); + return; + } + /* Determine temporary program name. */ + str = strrchr(argv[0], '/'); + if (str == NULL) { + __glutProgramName = argv[0]; + } else { + __glutProgramName = str + 1; + } + + /* Make private copy of command line arguments. */ + __glutArgc = *argcp; + __glutArgv = (char **) malloc(__glutArgc * sizeof(char *)); + if (!__glutArgv) + __glutFatalError("out of memory."); + for (i = 0; i < __glutArgc; i++) { + __glutArgv[i] = __glutStrdup(argv[i]); + if (!__glutArgv[i]) + __glutFatalError("out of memory."); + } + + /* determine permanent program name */ + str = strrchr(__glutArgv[0], '/'); + if (str == NULL) { + __glutProgramName = __glutArgv[0]; + } else { + __glutProgramName = str + 1; + } + + /* parse arguments for standard options */ + for (i = 1; i < __glutArgc; i++) { + if (!strcmp(__glutArgv[i], "-display")) { +#if defined(_WIN32) + __glutWarning("-display option not supported by Win32 GLUT."); +#endif + if (++i >= __glutArgc) { + __glutFatalError( + "follow -display option with X display name."); + } + display = __glutArgv[i]; + removeArgs(argcp, &argv[1], 2); + } else if (!strcmp(__glutArgv[i], "-geometry")) { + if (++i >= __glutArgc) { + __glutFatalError( + "follow -geometry option with geometry parameter."); + } + geometry = __glutArgv[i]; + removeArgs(argcp, &argv[1], 2); + } else if (!strcmp(__glutArgv[i], "-direct")) { +#if defined(_WIN32) + __glutWarning("-direct option not supported by Win32 GLUT."); +#endif + if (!__glutTryDirect) + __glutFatalError( + "cannot force both direct and indirect rendering."); + __glutForceDirect = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-indirect")) { +#if defined(_WIN32) + __glutWarning("-indirect option not supported by Win32 GLUT."); +#endif + if (__glutForceDirect) + __glutFatalError( + "cannot force both direct and indirect rendering."); + __glutTryDirect = GL_FALSE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-iconic")) { + __glutIconic = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-gldebug")) { + __glutDebug = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-sync")) { +#if defined(_WIN32) + __glutWarning("-sync option not supported by Win32 GLUT."); +#endif + synchronize = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else { + /* Once unknown option encountered, stop command line + processing. */ + break; + } + } +#if defined(_WIN32) + __glutOpenWin32Connection(display); +#else + __glutOpenXConnection(display); +#endif + if (geometry) { + int flags, x, y, width, height; + + /* Fix bogus "{width|height} may be used before set" + warning */ + width = 0; + height = 0; + + flags = XParseGeometry(geometry, &x, &y, + (unsigned int *) &width, (unsigned int *) &height); + if (WidthValue & flags) { + /* Careful because X does not allow zero or negative + width windows */ + if (width > 0) + __glutInitWidth = width; + } + if (HeightValue & flags) { + /* Careful because X does not allow zero or negative + height windows */ + if (height > 0) + __glutInitHeight = height; + } + glutInitWindowSize(__glutInitWidth, __glutInitHeight); + if (XValue & flags) { + if (XNegative & flags) + x = DisplayWidth(__glutDisplay, __glutScreen) + + x - __glutSizeHints.width; + /* Play safe: reject negative X locations */ + if (x >= 0) + __glutInitX = x; + } + if (YValue & flags) { + if (YNegative & flags) + y = DisplayHeight(__glutDisplay, __glutScreen) + + y - __glutSizeHints.height; + /* Play safe: reject negative Y locations */ + if (y >= 0) + __glutInitY = y; + } + glutInitWindowPosition(__glutInitX, __glutInitY); + } + __glutInitTime(&unused); + + /* check if GLUT_FPS env var is set */ + { + const char *fps = getenv("GLUT_FPS"); + if (fps) { + sscanf(fps, "%d", &__glutFPS); + if (__glutFPS <= 0) + __glutFPS = 5000; /* 5000 milliseconds */ + } + } + + /* check if GLUT_PPM_FILE env var is set */ + __glutPPMFile = getenv("GLUT_PPM_FILE"); +} + +#ifdef _WIN32 +void GLUTAPIENTRY +__glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)) +{ + __glutExitFunc = exitfunc; + glutInit(argcp, argv); +} +#endif + +/* CENTRY */ +void GLUTAPIENTRY +glutInitWindowPosition(int x, int y) +{ + __glutInitX = x; + __glutInitY = y; + if (x >= 0 && y >= 0) { + __glutSizeHints.x = x; + __glutSizeHints.y = y; + __glutSizeHints.flags |= USPosition; + } else { + __glutSizeHints.flags &= ~USPosition; + } +} + +void GLUTAPIENTRY +glutInitWindowSize(int width, int height) +{ + __glutInitWidth = width; + __glutInitHeight = height; + if (width > 0 && height > 0) { + __glutSizeHints.width = width; + __glutSizeHints.height = height; + __glutSizeHints.flags |= USSize; + } else { + __glutSizeHints.flags &= ~USSize; + } +} + +void GLUTAPIENTRY +glutInitDisplayMode(unsigned int mask) +{ + __glutDisplayMode = mask; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_input.c xpsb-glx-0.19/mesa/src/glut/glx/glut_input.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_input.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_input.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,642 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include + +#if !defined(_WIN32) +#include +#if defined(__vms) +#include +#else +#include +#endif +#include +#else +#ifdef __MINGW32__ +#include +#endif +#include +#ifndef __CYGWIN32__ +#include /* Win32 Multimedia API header. */ +#endif +#endif /* !_WIN32 */ + +#include "glutint.h" + +int __glutNumDials = 0; +int __glutNumSpaceballButtons = 0; +int __glutNumButtonBoxButtons = 0; +int __glutNumTabletButtons = 0; +int __glutNumMouseButtons = 3; /* Good guess. */ +XDevice *__glutTablet = NULL; +XDevice *__glutDials = NULL; +XDevice *__glutSpaceball = NULL; + +int __glutHasJoystick = 0; +int __glutNumJoystickButtons = 0; +int __glutNumJoystickAxes = 0; + +#if !defined(_WIN32) +typedef struct _Range { + int min; + int range; +} Range; + +#define NUM_SPACEBALL_AXIS 6 +#define NUM_TABLET_AXIS 2 +#define NUM_DIALS_AXIS 8 + +Range __glutSpaceballRange[NUM_SPACEBALL_AXIS]; +Range __glutTabletRange[NUM_TABLET_AXIS]; +int *__glutDialsResolution; + +/* Safely assumes 0 is an illegal event type for X Input + extension events. */ +int __glutDeviceMotionNotify = 0; +int __glutDeviceButtonPress = 0; +int __glutDeviceButtonPressGrab = 0; +int __glutDeviceButtonRelease = 0; +int __glutDeviceStateNotify = 0; + +static int +normalizeTabletPos(int axis, int rawValue) +{ + assert(rawValue >= __glutTabletRange[axis].min); + assert(rawValue <= __glutTabletRange[axis].min + + __glutTabletRange[axis].range); + /* Normalize rawValue to between 0 and 4000. */ + return ((rawValue - __glutTabletRange[axis].min) * 4000) / + __glutTabletRange[axis].range; +} + +static int +normalizeDialAngle(int axis, int rawValue) +{ + /* XXX Assumption made that the resolution of the device is + number of clicks for one complete dial revolution. This + is true for SGI's dial & button box. */ + return (rawValue * 360.0) / __glutDialsResolution[axis]; +} + +static int +normalizeSpaceballAngle(int axis, int rawValue) +{ + assert(rawValue >= __glutSpaceballRange[axis].min); + assert(rawValue <= __glutSpaceballRange[axis].min + + __glutSpaceballRange[axis].range); + /* Normalize rawValue to between -1800 and 1800. */ + return ((rawValue - __glutSpaceballRange[axis].min) * 3600) / + __glutSpaceballRange[axis].range - 1800; +} + +static int +normalizeSpaceballDelta(int axis, int rawValue) +{ + assert(rawValue >= __glutSpaceballRange[axis].min); + assert(rawValue <= __glutSpaceballRange[axis].min + + __glutSpaceballRange[axis].range); + /* Normalize rawValue to between -1000 and 1000. */ + return ((rawValue - __glutSpaceballRange[axis].min) * 2000) / + __glutSpaceballRange[axis].range - 1000; +} + +static void +queryTabletPos(GLUTwindow * window) +{ + XDeviceState *state; + XInputClass *any; + XValuatorState *v; + int i; + + state = XQueryDeviceState(__glutDisplay, __glutTablet); + any = state->data; + for (i = 0; i < state->num_classes; i++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ValuatorClass: + v = (XValuatorState *) any; + if (v->num_valuators < 2) + goto end; + if (window->tabletPos[0] == -1) + window->tabletPos[0] = normalizeTabletPos(0, v->valuators[0]); + if (window->tabletPos[1] == -1) + window->tabletPos[1] = normalizeTabletPos(1, v->valuators[1]); + } + any = (XInputClass *) ((char *) any + any->length); + } +end: + XFreeDeviceState(state); +} + +static void +tabletPosChange(GLUTwindow * window, int first, int count, int *data) +{ + int i, value, genEvent = 0; + + for (i = first; i < first + count; i++) { + switch (i) { + case 0: /* X axis */ + case 1: /* Y axis */ + value = normalizeTabletPos(i, data[i - first]); + if (value != window->tabletPos[i]) { + window->tabletPos[i] = value; + genEvent = 1; + } + break; + } + } + if (window->tabletPos[0] == -1 || window->tabletPos[1] == -1) + queryTabletPos(window); + if (genEvent) + window->tabletMotion(window->tabletPos[0], window->tabletPos[1]); +} +#endif /* !_WIN32 */ + +static int +__glutProcessDeviceEvents(XEvent * event) +{ +#if !defined(_WIN32) + GLUTwindow *window; + + /* XXX Ugly code fan out. */ + + /* Can't use switch/case since X Input event types are + dynamic. */ + + if (__glutDeviceMotionNotify && event->type == __glutDeviceMotionNotify) { + XDeviceMotionEvent *devmot = (XDeviceMotionEvent *) event; + + window = __glutGetWindow(devmot->window); + if (window) { + if (__glutTablet + && devmot->deviceid == __glutTablet->device_id + && window->tabletMotion) { + tabletPosChange(window, devmot->first_axis, devmot->axes_count, + devmot->axis_data); + } else if (__glutDials + && devmot->deviceid == __glutDials->device_id + && window->dials) { + int i, first = devmot->first_axis, count = devmot->axes_count; + + for (i = first; i < first + count; i++) + window->dials(i + 1, + normalizeDialAngle(i, devmot->axis_data[i - first])); + } else if (__glutSpaceball + && devmot->deviceid == __glutSpaceball->device_id) { + /* XXX Assume that space ball motion events come in as + all the first 6 axes. Assume first 3 axes are XYZ + translations; second 3 axes are XYZ rotations. */ + if (devmot->first_axis == 0 && devmot->axes_count == 6) { + if (window->spaceMotion) + window->spaceMotion( + normalizeSpaceballDelta(0, devmot->axis_data[0]), + normalizeSpaceballDelta(1, devmot->axis_data[1]), + normalizeSpaceballDelta(2, devmot->axis_data[2])); + if (window->spaceRotate) + window->spaceRotate( + normalizeSpaceballAngle(3, devmot->axis_data[3]), + normalizeSpaceballAngle(4, devmot->axis_data[4]), + normalizeSpaceballAngle(5, devmot->axis_data[5])); + } + } + return 1; + } + } else if (__glutDeviceButtonPress + && event->type == __glutDeviceButtonPress) { + XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event; + + window = __glutGetWindow(devbtn->window); + if (window) { + if (__glutTablet + && devbtn->deviceid == __glutTablet->device_id + && window->tabletButton + && devbtn->first_axis == 0 + && devbtn->axes_count == 2) { + tabletPosChange(window, devbtn->first_axis, devbtn->axes_count, + devbtn->axis_data); + window->tabletButton(devbtn->button, GLUT_DOWN, + window->tabletPos[0], window->tabletPos[1]); + } else if (__glutDials + && devbtn->deviceid == __glutDials->device_id + && window->buttonBox) { + window->buttonBox(devbtn->button, GLUT_DOWN); + } else if (__glutSpaceball + && devbtn->deviceid == __glutSpaceball->device_id + && window->spaceButton) { + window->spaceButton(devbtn->button, GLUT_DOWN); + } + return 1; + } + } else if (__glutDeviceButtonRelease + && event->type == __glutDeviceButtonRelease) { + XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event; + + window = __glutGetWindow(devbtn->window); + if (window) { + if (__glutTablet + && devbtn->deviceid == __glutTablet->device_id + && window->tabletButton + && devbtn->first_axis == 0 + && devbtn->axes_count == 2) { + tabletPosChange(window, devbtn->first_axis, devbtn->axes_count, + devbtn->axis_data); + window->tabletButton(devbtn->button, GLUT_UP, + window->tabletPos[0], window->tabletPos[1]); + } else if (__glutDials + && devbtn->deviceid == __glutDials->device_id + && window->buttonBox) { + window->buttonBox(devbtn->button, GLUT_UP); + } else if (__glutSpaceball + && devbtn->deviceid == __glutSpaceball->device_id + && window->spaceButton) { + window->spaceButton(devbtn->button, GLUT_UP); + } + return 1; + } + } +#else + { + JOYINFOEX info; + JOYCAPS joyCaps; + + memset(&info, 0, sizeof(JOYINFOEX)); + info.dwSize = sizeof(JOYINFOEX); + info.dwFlags = JOY_RETURNALL; + + if (joyGetPosEx(JOYSTICKID1,&info) != JOYERR_NOERROR) { + __glutHasJoystick = 1; + joyGetDevCaps(JOYSTICKID1, &joyCaps, sizeof(joyCaps)); + __glutNumJoystickButtons = joyCaps.wNumButtons; + __glutNumJoystickAxes = joyCaps.wNumAxes; + } else { + __glutHasJoystick = 0; + __glutNumJoystickButtons = 0; + __glutNumJoystickAxes = 0; + } + } +#endif /* !_WIN32 */ + return 0; +} + +static GLUTeventParser eventParser = +{__glutProcessDeviceEvents, NULL}; + +static void +addDeviceEventParser(void) +{ + static Bool been_here = False; + + if (been_here) + return; + been_here = True; + __glutRegisterEventParser(&eventParser); +} + +static int +probeDevices(void) +{ + static Bool been_here = False; + static int support; +#if !defined(_WIN32) + XExtensionVersion *version; + XDeviceInfoPtr device_info, device; + XAnyClassPtr any; + XButtonInfoPtr b; + XValuatorInfoPtr v; + XAxisInfoPtr a; + int num_dev = 0, btns = 0, dials = 0; + int i, j, k; +#endif /* !_WIN32 */ + + if (been_here) { + return support; + } + been_here = True; + +#if !defined(_WIN32) + version = XGetExtensionVersion(__glutDisplay, "XInputExtension"); + /* Ugh. XInput extension API forces annoying cast of a pointer + to a long so it can be compared with the NoSuchExtension + value (#defined to 1). */ + if (version == NULL || ((long) version) == NoSuchExtension) { + support = 0; + return support; + } + XFree(version); + device_info = XListInputDevices(__glutDisplay, &num_dev); + if (device_info) { + for (i = 0; i < num_dev; i++) { + /* XXX These are SGI names for these devices; + unfortunately, no good standard exists for standard + types of X input extension devices. */ + + device = &device_info[i]; + any = (XAnyClassPtr) device->inputclassinfo; + + if (!__glutSpaceball && !strcmp(device->name, "spaceball")) { + v = NULL; + b = NULL; + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ButtonClass: + b = (XButtonInfoPtr) any; + btns = b->num_buttons; + break; + case ValuatorClass: + v = (XValuatorInfoPtr) any; + /* Sanity check: at least 6 valuators? */ + if (v->num_axes < NUM_SPACEBALL_AXIS) + goto skip_device; + a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); + for (k = 0; k < NUM_SPACEBALL_AXIS; k++, a++) { + __glutSpaceballRange[k].min = a->min_value; + __glutSpaceballRange[k].range = a->max_value - a->min_value; + } + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + if (v) { + __glutSpaceball = XOpenDevice(__glutDisplay, device->id); + if (__glutSpaceball) { + __glutNumSpaceballButtons = btns; + addDeviceEventParser(); + } + } + } else if (!__glutDials && !strcmp(device->name, "dial+buttons")) { + v = NULL; + b = NULL; + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ButtonClass: + b = (XButtonInfoPtr) any; + btns = b->num_buttons; + break; + case ValuatorClass: + v = (XValuatorInfoPtr) any; + /* Sanity check: at least 8 valuators? */ + if (v->num_axes < NUM_DIALS_AXIS) + goto skip_device; + dials = v->num_axes; + __glutDialsResolution = (int *) malloc(sizeof(int) * dials); + a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); + for (k = 0; k < dials; k++, a++) { + __glutDialsResolution[k] = a->resolution; + } + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + if (v) { + __glutDials = XOpenDevice(__glutDisplay, device->id); + if (__glutDials) { + __glutNumButtonBoxButtons = btns; + __glutNumDials = dials; + addDeviceEventParser(); + } + } + } else if (!__glutTablet && !strcmp(device->name, "tablet")) { + v = NULL; + b = NULL; + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ButtonClass: + b = (XButtonInfoPtr) any; + btns = b->num_buttons; + break; + case ValuatorClass: + v = (XValuatorInfoPtr) any; + /* Sanity check: exactly 2 valuators? */ + if (v->num_axes != NUM_TABLET_AXIS) + goto skip_device; + a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); + for (k = 0; k < NUM_TABLET_AXIS; k++, a++) { + __glutTabletRange[k].min = a->min_value; + __glutTabletRange[k].range = a->max_value - a->min_value; + } + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + if (v) { + __glutTablet = XOpenDevice(__glutDisplay, device->id); + if (__glutTablet) { + __glutNumTabletButtons = btns; + addDeviceEventParser(); + } + } + } else if (!strcmp(device->name, "mouse")) { + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + if (any->c_class == ButtonClass) { +#else + if (any->class == ButtonClass) { +#endif + b = (XButtonInfoPtr) any; + __glutNumMouseButtons = b->num_buttons; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + } + skip_device:; + } + XFreeDeviceList(device_info); + } +#else /* _WIN32 */ + __glutNumMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS); +#endif /* !_WIN32 */ + /* X Input extension might be supported, but only if there is + a tablet, dials, or spaceball do we claim devices are + supported. */ + support = __glutTablet || __glutDials || __glutSpaceball; + return support; +} + +void +__glutUpdateInputDeviceMask(GLUTwindow * window) +{ +#if !defined(_WIN32) + /* 5 (dial and buttons) + 5 (tablet locator and buttons) + 5 + (Spaceball buttons and axis) = 15 */ + XEventClass eventList[15]; + int rc, numEvents; + + rc = probeDevices(); + if (rc) { + numEvents = 0; + if (__glutTablet) { + if (window->tabletMotion) { + DeviceMotionNotify(__glutTablet, __glutDeviceMotionNotify, + eventList[numEvents]); + numEvents++; + } + if (window->tabletButton) { + DeviceButtonPress(__glutTablet, __glutDeviceButtonPress, + eventList[numEvents]); + numEvents++; + DeviceButtonPressGrab(__glutTablet, __glutDeviceButtonPressGrab, + eventList[numEvents]); + numEvents++; + DeviceButtonRelease(__glutTablet, __glutDeviceButtonRelease, + eventList[numEvents]); + numEvents++; + } + if (window->tabletMotion || window->tabletButton) { + DeviceStateNotify(__glutTablet, __glutDeviceStateNotify, + eventList[numEvents]); + numEvents++; + } + } + if (__glutDials) { + if (window->dials) { + DeviceMotionNotify(__glutDials, __glutDeviceMotionNotify, + eventList[numEvents]); + numEvents++; + } + if (window->buttonBox) { + DeviceButtonPress(__glutDials, __glutDeviceButtonPress, + eventList[numEvents]); + numEvents++; + DeviceButtonPressGrab(__glutDials, __glutDeviceButtonPressGrab, + eventList[numEvents]); + numEvents++; + DeviceButtonRelease(__glutDials, __glutDeviceButtonRelease, + eventList[numEvents]); + numEvents++; + } + if (window->dials || window->buttonBox) { + DeviceStateNotify(__glutDials, __glutDeviceStateNotify, + eventList[numEvents]); + numEvents++; + } + } + if (__glutSpaceball) { + if (window->spaceMotion || window->spaceRotate) { + DeviceMotionNotify(__glutSpaceball, __glutDeviceMotionNotify, + eventList[numEvents]); + numEvents++; + } + if (window->spaceButton) { + DeviceButtonPress(__glutSpaceball, __glutDeviceButtonPress, + eventList[numEvents]); + numEvents++; + DeviceButtonPressGrab(__glutSpaceball, __glutDeviceButtonPressGrab, + eventList[numEvents]); + numEvents++; + DeviceButtonRelease(__glutSpaceball, __glutDeviceButtonRelease, + eventList[numEvents]); + numEvents++; + } + if (window->spaceMotion || window->spaceRotate || window->spaceButton) { + DeviceStateNotify(__glutSpaceball, __glutDeviceStateNotify, + eventList[numEvents]); + numEvents++; + } + } +#if 0 + if (window->children) { + GLUTwindow *child = window->children; + + do { + XChangeDeviceDontPropagateList(__glutDisplay, child->win, + numEvents, eventList, AddToList); + child = child->siblings; + } while (child); + } +#endif + XSelectExtensionEvent(__glutDisplay, window->win, + eventList, numEvents); + if (window->overlay) { + XSelectExtensionEvent(__glutDisplay, window->overlay->win, + eventList, numEvents); + } + } else { + /* X Input extension not supported; no chance for exotic + input devices. */ + } +#endif /* !_WIN32 */ +} + +/* CENTRY */ +int GLUTAPIENTRY +glutDeviceGet(GLenum param) +{ + probeDevices(); + switch (param) { + case GLUT_HAS_KEYBOARD: + case GLUT_HAS_MOUSE: + /* Assume window system always has mouse and keyboard. */ + return 1; + case GLUT_HAS_SPACEBALL: + return __glutSpaceball != NULL; + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + return __glutDials != NULL; + case GLUT_HAS_TABLET: + return __glutTablet != NULL; + case GLUT_NUM_MOUSE_BUTTONS: + return __glutNumMouseButtons; + case GLUT_NUM_SPACEBALL_BUTTONS: + return __glutNumSpaceballButtons; + case GLUT_NUM_BUTTON_BOX_BUTTONS: + return __glutNumButtonBoxButtons; + case GLUT_NUM_DIALS: + return __glutNumDials; + case GLUT_NUM_TABLET_BUTTONS: + return __glutNumTabletButtons; + case GLUT_DEVICE_IGNORE_KEY_REPEAT: + return __glutCurrentWindow->ignoreKeyRepeat; +#ifndef _WIN32 + case GLUT_DEVICE_KEY_REPEAT: + { + XKeyboardState state; + + XGetKeyboardControl(__glutDisplay, &state); + return state.global_auto_repeat; + } + case GLUT_JOYSTICK_POLL_RATE: + return 0; +#else + case GLUT_DEVICE_KEY_REPEAT: + /* Win32 cannot globally disable key repeat. */ + return GLUT_KEY_REPEAT_ON; + case GLUT_JOYSTICK_POLL_RATE: + return __glutCurrentWindow->joyPollInterval; +#endif + case GLUT_HAS_JOYSTICK: + return __glutHasJoystick; + case GLUT_JOYSTICK_BUTTONS: + return __glutNumJoystickButtons; + case GLUT_JOYSTICK_AXES: + return __glutNumJoystickAxes; + default: + __glutWarning("invalid glutDeviceGet parameter: %d", param); + return -1; + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glutint.h xpsb-glx-0.19/mesa/src/glut/glx/glutint.h --- xpsb-glx-0.19/mesa/src/glut/glx/glutint.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glutint.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,820 @@ +#ifndef __glutint_h__ +#define __glutint_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#if defined(__CYGWIN32__) +#include +#endif + +#define SUPPORT_FORTRAN /* With GLUT 3.7, everyone supports Fortran. */ + +#if defined(_WIN32) +#include "glutwin32.h" +#else +#include +#include +#define GLX_GLXEXT_PROTOTYPES +#include +#endif + +#ifndef GLUT_BUILDING_LIB +#define GLUT_BUILDING_LIB /* Building the GLUT library itself. */ +#endif + +#include + +#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__) +#include +#endif + +#ifndef _WIN32 +/* added by BrianP: */ +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif +#define __cdecl GLAPIENTRY +#define CDECL GLAPIENTRY +#endif + +/* GLUT_BUILDING_LIB is used by to 1) not #pragma link + with the GLUT library, and 2) avoid the Win32 atexit hack. */ + +/* This must be done after is included. MESA is defined + if the is supplied by Brian Paul's Mesa library. */ +#if defined(MESA) && defined(_WIN32) +/* Mesa implements "wgl" versions of GDI entry points needed for + using OpenGL. Map these "wgl" versions to the GDI names via + macros. */ +#define ChoosePixelFormat wglChoosePixelFormat +#define DescribePixelFormat wglDescribePixelFormat +#define GetPixelFormat wglGetPixelFormat +#define SetPixelFormat wglSetPixelFormat +#define SwapBuffers wglSwapBuffers +#define GetCurrentContext wglGetCurrentContext +#define GetCurrentDC wglGetCurrentDC +#define MakeCurrent wglMakeCurrent +#define CreateContext wglCreateContext +#define DeleteContext wglDeleteContext +#endif /* MESA */ + +#ifdef SUPPORT_FORTRAN +#include +#endif + +#ifdef __vms +#if ( __VMS_VER < 70000000 ) +#define OLD_VMS +struct timeval6 { + __int64 val; +}; +extern int sys$gettim(struct timeval6 *); +#else +#include +#endif +#else +#include +#if !defined(_WIN32) || defined(__CYGWIN32__) +#include +#else +#include +#endif +#endif +#if defined(__vms) && ( __VMS_VER < 70000000 ) + +/* For VMS6.2 or lower : + One TICK on VMS is 100 nanoseconds; 0.1 microseconds or + 0.0001 milliseconds. This means that there are 0.01 + ticks/ns, 10 ticks/us, 10,000 ticks/ms and 10,000,000 + ticks/second. */ + +#define TICKS_PER_MILLISECOND 10000 +#define TICKS_PER_SECOND 10000000 + +#define GETTIMEOFDAY(_x) (void) sys$gettim (_x); + +#define ADD_TIME(dest, src1, src2) { \ + (dest).val = (src1).val + (src2).val; \ +} + +#define TIMEDELTA(dest, src1, src2) { \ + (dest).val = (src1).val - (src2).val; \ +} + +#define IS_AFTER(t1, t2) ((t2).val > (t1).val) + +#define IS_AT_OR_AFTER(t1, t2) ((t2).val >= (t1).val) + +#else +#if defined(SVR4) && !defined(sun) /* Sun claims SVR4, but + wants 2 args. */ +#define GETTIMEOFDAY(_x) gettimeofday(_x) +#else +#define GETTIMEOFDAY(_x) gettimeofday(_x, NULL) +#endif +#define ADD_TIME(dest, src1, src2) { \ + if(((dest).tv_usec = \ + (src1).tv_usec + (src2).tv_usec) >= 1000000) { \ + (dest).tv_usec -= 1000000; \ + (dest).tv_sec = (src1).tv_sec + (src2).tv_sec + 1; \ + } else { \ + (dest).tv_sec = (src1).tv_sec + (src2).tv_sec; \ + if(((dest).tv_sec >= 1) && (((dest).tv_usec <0))) { \ + (dest).tv_sec --;(dest).tv_usec += 1000000; \ + } \ + } \ +} +#define TIMEDELTA(dest, src1, src2) { \ + if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \ + (dest).tv_usec += 1000000; \ + (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \ + } else { \ + (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \ + } \ +} +#define IS_AFTER(t1, t2) \ + (((t2).tv_sec > (t1).tv_sec) || \ + (((t2).tv_sec == (t1).tv_sec) && \ + ((t2).tv_usec > (t1).tv_usec))) +#define IS_AT_OR_AFTER(t1, t2) \ + (((t2).tv_sec > (t1).tv_sec) || \ + (((t2).tv_sec == (t1).tv_sec) && \ + ((t2).tv_usec >= (t1).tv_usec))) +#endif + +#define IGNORE_IN_GAME_MODE() \ + { if (__glutGameModeWindow) return; } + +#define GLUT_WIND_IS_RGB(x) (((x) & GLUT_INDEX) == 0) +#define GLUT_WIND_IS_INDEX(x) (((x) & GLUT_INDEX) != 0) +#define GLUT_WIND_IS_SINGLE(x) (((x) & GLUT_DOUBLE) == 0) +#define GLUT_WIND_IS_DOUBLE(x) (((x) & GLUT_DOUBLE) != 0) +#define GLUT_WIND_HAS_ACCUM(x) (((x) & GLUT_ACCUM) != 0) +#define GLUT_WIND_HAS_ALPHA(x) (((x) & GLUT_ALPHA) != 0) +#define GLUT_WIND_HAS_DEPTH(x) (((x) & GLUT_DEPTH) != 0) +#define GLUT_WIND_HAS_STENCIL(x) (((x) & GLUT_STENCIL) != 0) +#define GLUT_WIND_IS_MULTISAMPLE(x) (((x) & GLUT_MULTISAMPLE) != 0) +#define GLUT_WIND_IS_STEREO(x) (((x) & GLUT_STEREO) != 0) +#define GLUT_WIND_IS_LUMINANCE(x) (((x) & GLUT_LUMINANCE) != 0) +#define GLUT_MAP_WORK (1 << 0) +#define GLUT_EVENT_MASK_WORK (1 << 1) +#define GLUT_REDISPLAY_WORK (1 << 2) +#define GLUT_CONFIGURE_WORK (1 << 3) +#define GLUT_COLORMAP_WORK (1 << 4) +#define GLUT_DEVICE_MASK_WORK (1 << 5) +#define GLUT_FINISH_WORK (1 << 6) +#define GLUT_DEBUG_WORK (1 << 7) +#define GLUT_DUMMY_WORK (1 << 8) +#define GLUT_FULL_SCREEN_WORK (1 << 9) +#define GLUT_OVERLAY_REDISPLAY_WORK (1 << 10) +#define GLUT_REPAIR_WORK (1 << 11) +#define GLUT_OVERLAY_REPAIR_WORK (1 << 12) + +/* Frame buffer capability macros and types. */ +#define RGBA 0 +#define BUFFER_SIZE 1 +#define DOUBLEBUFFER 2 +#define STEREO 3 +#define AUX_BUFFERS 4 +#define RED_SIZE 5 /* Used as mask bit for + "color selected". */ +#define GREEN_SIZE 6 +#define BLUE_SIZE 7 +#define ALPHA_SIZE 8 +#define DEPTH_SIZE 9 +#define STENCIL_SIZE 10 +#define ACCUM_RED_SIZE 11 /* Used as mask bit for + "acc selected". */ +#define ACCUM_GREEN_SIZE 12 +#define ACCUM_BLUE_SIZE 13 +#define ACCUM_ALPHA_SIZE 14 +#define LEVEL 15 + +#define NUM_GLXCAPS (LEVEL + 1) + +#define XVISUAL (NUM_GLXCAPS + 0) +#define TRANSPARENT (NUM_GLXCAPS + 1) +#define SAMPLES (NUM_GLXCAPS + 2) +#define XSTATICGRAY (NUM_GLXCAPS + 3) /* Used as + mask bit + for "any + visual type + selected". */ +#define XGRAYSCALE (NUM_GLXCAPS + 4) +#define XSTATICCOLOR (NUM_GLXCAPS + 5) +#define XPSEUDOCOLOR (NUM_GLXCAPS + 6) +#define XTRUECOLOR (NUM_GLXCAPS + 7) +#define XDIRECTCOLOR (NUM_GLXCAPS + 8) +#define SLOW (NUM_GLXCAPS + 9) +#define CONFORMANT (NUM_GLXCAPS + 10) + +#define NUM_CAPS (NUM_GLXCAPS + 11) + +/* Frame buffer capablities that don't have a corresponding + FrameBufferMode entry. These get used as mask bits. */ +#define NUM (NUM_CAPS + 0) +#define RGBA_MODE (NUM_CAPS + 1) +#define CI_MODE (NUM_CAPS + 2) +#define LUMINANCE_MODE (NUM_CAPS + 3) + +#define NONE 0 +#define EQ 1 +#define NEQ 2 +#define LTE 3 +#define GTE 4 +#define GT 5 +#define LT 6 +#define MIN 7 + +typedef struct _Criterion { + int capability; + int comparison; + int value; +} Criterion; + +typedef struct _FrameBufferMode { + XVisualInfo *vi; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + + /* fbc is non-NULL when the XVisualInfo* is not OpenGL-capable + (ie, GLX_USE_GL is false), but the SGIX_fbconfig extension shows + the visual's fbconfig is OpenGL-capable. The reason for this is typically + an RGBA luminance fbconfig such as 16-bit StaticGray that could + not be advertised as a GLX visual since StaticGray visuals are + required (by the GLX specification) to be color index. The + SGIX_fbconfig allows StaticGray visuals to instead advertised as + fbconfigs that can provide RGBA luminance support. */ + + GLXFBConfigSGIX fbc; +#endif + int valid; + int cap[NUM_CAPS]; +} FrameBufferMode; + +/* DisplayMode capability macros for game mode. */ +#define DM_WIDTH 0 /* "width" */ +#define DM_HEIGHT 1 /* "height" */ +#define DM_PIXEL_DEPTH 2 /* "bpp" (bits per pixel) */ +#define DM_HERTZ 3 /* "hertz" */ +#define DM_NUM 4 /* "num" */ + +#define NUM_DM_CAPS (DM_NUM+1) + +typedef struct _DisplayMode { +#ifdef _WIN32 + DEVMODE devmode; +#else + /* XXX The X Window System does not have a standard + mechanism for display setting changes. On SGI + systems, GLUT could use the XSGIvc (SGI X video + control extension). Perhaps this can be done in + a future release of GLUT. */ +#endif + int valid; + int cap[NUM_DM_CAPS]; +} DisplayMode; + +/* GLUT function types */ +typedef void (GLUTCALLBACK *GLUTdisplayCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int); +typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int); +typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int); +typedef void (GLUTCALLBACK *GLUTentryCB) (int); +typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int); +typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int); +typedef void (GLUTCALLBACK *GLUTidleCB) (void); +typedef void (GLUTCALLBACK *GLUTtimerCB) (int); +typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRICATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTselectCB) (int); +typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int); +typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int); +typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int buttonMask, int x, int y, int z); + +typedef struct _GLUTcolorcell GLUTcolorcell; +struct _GLUTcolorcell { + /* GLUT_RED, GLUT_GREEN, GLUT_BLUE */ + GLfloat component[3]; +}; + +typedef struct _GLUTcolormap GLUTcolormap; +struct _GLUTcolormap { + Visual *visual; /* visual of the colormap */ + Colormap cmap; /* X colormap ID */ + int refcnt; /* number of windows using colormap */ + int size; /* number of cells in colormap */ + int transparent; /* transparent pixel, or -1 if opaque */ + GLUTcolorcell *cells; /* array of cells */ + GLUTcolormap *next; /* next colormap in list */ +}; + +typedef struct _GLUTwindow GLUTwindow; +typedef struct _GLUToverlay GLUToverlay; +struct _GLUTwindow { + int num; /* Small integer window id (0-based). */ + + /* Window system related state. */ +#if defined(_WIN32) + int pf; /* Pixel format. */ + HDC hdc; /* Window's Win32 device context. */ +#endif + Window win; /* X window for GLUT window */ + GLXContext ctx; /* OpenGL context GLUT glut window */ + XVisualInfo *vis; /* visual for window */ + Bool visAlloced; /* if vis needs deallocate on destroy */ + Colormap cmap; /* RGB colormap for window; None if CI */ + GLUTcolormap *colormap; /* colormap; NULL if RGBA */ + GLUToverlay *overlay; /* overlay; NULL if no overlay */ +#if defined(_WIN32) + HDC renderDc; /* Win32's device context for rendering. */ +#endif + Window renderWin; /* X window for rendering (might be + overlay) */ + GLXContext renderCtx; /* OpenGL context for rendering (might + be overlay) */ + /* GLUT settable or visible window state. */ + int width; /* window width in pixels */ + int height; /* window height in pixels */ + int cursor; /* cursor name */ + int visState; /* visibility state (-1 is unknown) */ + int shownState; /* if window mapped */ + int entryState; /* entry state (-1 is unknown) */ +#define GLUT_MAX_MENUS 3 + + int menu[GLUT_MAX_MENUS]; /* attatched menu nums */ + /* Window relationship state. */ + GLUTwindow *parent; /* parent window */ + GLUTwindow *children; /* list of children */ + GLUTwindow *siblings; /* list of siblings */ + /* Misc. non-API visible (hidden) state. */ + Bool treatAsSingle; /* treat this window as single-buffered + (it might be "fake" though) */ + Bool forceReshape; /* force reshape before display */ +#if !defined(_WIN32) + Bool isDirect; /* if direct context (X11 only) */ +#endif + Bool usedSwapBuffers; /* if swap buffers used last display */ + long eventMask; /* mask of X events selected for */ + int buttonUses; /* number of button uses, ref cnt */ + int tabletPos[2]; /* tablet position (-1 is invalid) */ + /* Work list related state. */ + unsigned int workMask; /* mask of window work to be done */ + GLUTwindow *prevWorkWin; /* link list of windows to work on */ + Bool desiredMapState; /* how to mapped window if on map work + list */ + Bool ignoreKeyRepeat; /* if window ignores autorepeat */ + int desiredConfMask; /* mask of desired window configuration + */ + int desiredX; /* desired X location */ + int desiredY; /* desired Y location */ + int desiredWidth; /* desired window width */ + int desiredHeight; /* desired window height */ + int desiredStack; /* desired window stack */ + /* Per-window callbacks. */ + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ + GLUTwindowStatusCB windowStatus; /* window status */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + GLUTspecialCB specialUp; /* special up key */ + GLUTbuttonBoxCB buttonBox; /* button box */ + GLUTdialsCB dials; /* dials */ + GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ + GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ + GLUTspaceButtonCB spaceButton; /* Spaceball button */ + GLUTtabletMotionCB tabletMotion; /* tablet motion */ + GLUTtabletButtonCB tabletButton; /* tablet button */ +#ifdef _WIN32 + GLUTjoystickCB joystick; /* joystick */ + int joyPollInterval; /* joystick polling interval */ +#endif +#ifdef SUPPORT_FORTRAN + GLUTdisplayFCB fdisplay; /* Fortran display */ + GLUTreshapeFCB freshape; /* Fortran reshape */ + GLUTmouseFCB fmouse; /* Fortran mouse */ + GLUTmotionFCB fmotion; /* Fortran motion */ + GLUTpassiveFCB fpassive; /* Fortran passive */ + GLUTentryFCB fentry; /* Fortran entry */ + GLUTkeyboardFCB fkeyboard; /* Fortran keyboard */ + GLUTkeyboardFCB fkeyboardUp; /* Fortran keyboard up */ + GLUTwindowStatusFCB fwindowStatus; /* Fortran window status */ + GLUTvisibilityFCB fvisibility; /* Fortran visibility */ + GLUTspecialFCB fspecial; /* special key */ + GLUTspecialFCB fspecialUp; /* special key up */ + GLUTbuttonBoxFCB fbuttonBox; /* button box */ + GLUTdialsFCB fdials; /* dials */ + GLUTspaceMotionFCB fspaceMotion; /* Spaceball motion */ + GLUTspaceRotateFCB fspaceRotate; /* Spaceball rotate */ + GLUTspaceButtonFCB fspaceButton; /* Spaceball button */ + GLUTtabletMotionFCB ftabletMotion; /* tablet motion */ + GLUTtabletButtonFCB ftabletButton; /* tablet button */ +#ifdef _WIN32 + GLUTjoystickFCB fjoystick; /* joystick */ +#endif +#endif +}; + +struct _GLUToverlay { +#if defined(_WIN32) + int pf; + HDC hdc; +#endif + Window win; + GLXContext ctx; + XVisualInfo *vis; /* visual for window */ + Bool visAlloced; /* if vis needs deallocate on destroy */ + Colormap cmap; /* RGB colormap for window; None if CI */ + GLUTcolormap *colormap; /* colormap; NULL if RGBA */ + int shownState; /* if overlay window mapped */ + Bool treatAsSingle; /* treat as single-buffered */ +#if !defined(_WIN32) + Bool isDirect; /* if direct context */ +#endif + int transparentPixel; /* transparent pixel value */ + GLUTdisplayCB display; /* redraw */ +#ifdef SUPPORT_FORTRAN + GLUTdisplayFCB fdisplay; /* redraw */ +#endif +}; + +typedef struct _GLUTstale GLUTstale; +struct _GLUTstale { + GLUTwindow *window; + Window win; + GLUTstale *next; +}; + +extern GLUTstale *__glutStaleWindowList; + +#define GLUT_OVERLAY_EVENT_FILTER_MASK \ + (ExposureMask | \ + StructureNotifyMask | \ + EnterWindowMask | \ + LeaveWindowMask) +#define GLUT_DONT_PROPAGATE_FILTER_MASK \ + (ButtonReleaseMask | \ + ButtonPressMask | \ + KeyPressMask | \ + KeyReleaseMask | \ + PointerMotionMask | \ + Button1MotionMask | \ + Button2MotionMask | \ + Button3MotionMask) +#define GLUT_HACK_STOP_PROPAGATE_MASK \ + (KeyPressMask | \ + KeyReleaseMask) + +typedef struct _GLUTmenu GLUTmenu; +typedef struct _GLUTmenuItem GLUTmenuItem; +struct _GLUTmenu { + int id; /* small integer menu id (0-based) */ + Window win; /* X window for the menu */ + GLUTselectCB select; /* function of menu */ + GLUTmenuItem *list; /* list of menu entries */ + int num; /* number of entries */ +#if !defined(_WIN32) + Bool managed; /* are the InputOnly windows size + validated? */ + Bool searched; /* help detect menu loops */ + int pixheight; /* height of menu in pixels */ + int pixwidth; /* width of menu in pixels */ +#endif + int submenus; /* number of submenu entries */ + GLUTmenuItem *highlighted; /* pointer to highlighted menu + entry, NULL not highlighted */ + GLUTmenu *cascade; /* currently cascading this menu */ + GLUTmenuItem *anchor; /* currently anchored to this entry */ + int x; /* current x origin relative to the + root window */ + int y; /* current y origin relative to the + root window */ +#ifdef SUPPORT_FORTRAN + GLUTselectFCB fselect; /* function of menu */ +#endif +}; + +struct _GLUTmenuItem { + Window win; /* InputOnly X window for entry */ + GLUTmenu *menu; /* menu entry belongs to */ + Bool isTrigger; /* is a submenu trigger? */ + int value; /* value to return for selecting this + entry; doubles as submenu id + (0-base) if submenu trigger */ +#if defined(_WIN32) + UINT unique; /* unique menu item id (Win32 only) */ +#endif + char *label; /* __glutStrdup'ed label string */ + int len; /* length of label string */ + int pixwidth; /* width of X window in pixels */ + GLUTmenuItem *next; /* next menu entry on list for menu */ +}; + +typedef struct _GLUTtimer GLUTtimer; +struct _GLUTtimer { + GLUTtimer *next; /* list of timers */ +#ifdef OLD_VMS + struct timeval6 timeout; /* time to be called */ +#else + struct timeval timeout; /* time to be called */ +#endif + GLUTtimerCB func; /* timer (value) */ + int value; /* return value */ +#ifdef SUPPORT_FORTRAN + GLUTtimerFCB ffunc; /* Fortran timer */ +#endif +}; + +typedef struct _GLUTeventParser GLUTeventParser; +struct _GLUTeventParser { + int (*func) (XEvent *); + GLUTeventParser *next; +}; + +/* Declarations to implement glutFullScreen support with + mwm/4Dwm. */ + +/* The following X property format is defined in Motif 1.1's + Xm/MwmUtils.h, but GLUT should not depend on that header + file. Note: Motif 1.2 expanded this structure with + uninteresting fields (to GLUT) so just stick with the + smaller Motif 1.1 structure. */ +typedef struct { +#define MWM_HINTS_DECORATIONS 2 + long flags; + long functions; + long decorations; + long input_mode; +} MotifWmHints; + +/* Make current and buffer swap macros. */ +#ifdef _WIN32 +#define MAKE_CURRENT_LAYER(window) \ + { \ + HGLRC currentContext = GetCurrentContext(); \ + HDC currentDc = GetCurrentDC(); \ + \ + if (currentContext != window->renderCtx \ + || currentDc != window->renderDc) { \ + MakeCurrent(window->renderDc, window->renderCtx); \ + } \ + } +#define MAKE_CURRENT_WINDOW(window) \ + { \ + HGLRC currentContext = GetCurrentContext(); \ + HDC currentDc = GetCurrentDC(); \ + \ + if (currentContext != window->ctx || currentDc != window->hdc) { \ + MakeCurrent(window->hdc, window->ctx); \ + } \ + } +#define MAKE_CURRENT_OVERLAY(overlay) \ + MakeCurrent(overlay->hdc, overlay->ctx) +#define UNMAKE_CURRENT() \ + MakeCurrent(NULL, NULL) +#define SWAP_BUFFERS_WINDOW(window) \ + SwapBuffers(window->hdc) +#define SWAP_BUFFERS_LAYER(window) \ + SwapBuffers(window->renderDc) +#else +#define MAKE_CURRENT_LAYER(window) \ + glXMakeCurrent(__glutDisplay, window->renderWin, window->renderCtx) +#define MAKE_CURRENT_WINDOW(window) \ + glXMakeCurrent(__glutDisplay, window->win, window->ctx) +#define MAKE_CURRENT_OVERLAY(overlay) \ + glXMakeCurrent(__glutDisplay, overlay->win, overlay->ctx) +#define UNMAKE_CURRENT() \ + glXMakeCurrent(__glutDisplay, None, NULL) +#define SWAP_BUFFERS_WINDOW(window) \ + glXSwapBuffers(__glutDisplay, window->win) +#define SWAP_BUFFERS_LAYER(window) \ + glXSwapBuffers(__glutDisplay, window->renderWin) +#endif + +/* private variables from glut_event.c */ +extern GLUTwindow *__glutWindowWorkList; +extern int __glutWindowDamaged; +#ifdef SUPPORT_FORTRAN +extern GLUTtimer *__glutTimerList; +extern GLUTtimer *__glutNewTimer; +#endif +extern GLUTmenu *__glutMappedMenu; + +extern void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *); +#if !defined(_WIN32) +extern void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item, + int num, int type); +extern void (*__glutFinishMenu)(Window win, int x, int y); +extern void (*__glutPaintMenu)(GLUTmenu * menu); +extern void (*__glutStartMenu)(GLUTmenu * menu, + GLUTwindow * window, int x, int y, int x_win, int y_win); +extern GLUTmenu * (*__glutGetMenuByNum)(int menunum); +extern GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu, + Window win, int *which); +extern GLUTmenu * (*__glutGetMenu)(Window win); +#endif + +/* private variables from glut_init.c */ +extern Atom __glutWMDeleteWindow; +extern Display *__glutDisplay; +extern unsigned int __glutDisplayMode; +extern char *__glutDisplayString; +extern XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask, void **fbc); +extern GLboolean __glutDebug; +extern GLboolean __glutForceDirect; +extern GLboolean __glutIconic; +extern GLboolean __glutTryDirect; +extern Window __glutRoot; +extern XSizeHints __glutSizeHints; +extern char **__glutArgv; +extern char *__glutProgramName; +extern int __glutArgc; +extern int __glutConnectionFD; +extern int __glutInitHeight; +extern int __glutInitWidth; +extern int __glutInitX; +extern int __glutInitY; +extern int __glutScreen; +extern int __glutScreenHeight; +extern int __glutScreenWidth; +extern Atom __glutMotifHints; +extern unsigned int __glutModifierMask; +#ifdef _WIN32 +extern void (__cdecl *__glutExitFunc)(int retval); +#endif +extern char *__glutPPMFile; + +/* private variables from glut_menu.c */ +extern GLUTmenuItem *__glutItemSelected; +extern GLUTmenu **__glutMenuList; +extern void (GLUTCALLBACK *__glutMenuStatusFunc) (int, int, int); +extern void __glutMenuModificationError(void); +extern void __glutSetMenuItem(GLUTmenuItem * item, + const char *label, int value, Bool isTrigger); + +/* private variables from glut_win.c */ +extern GLUTwindow **__glutWindowList; +extern GLUTwindow *__glutCurrentWindow; +extern GLUTwindow *__glutMenuWindow; +extern GLUTmenu *__glutCurrentMenu; +extern int __glutWindowListSize; +extern void (*__glutFreeOverlayFunc) (GLUToverlay *); +extern void __glutFreeOverlay(GLUToverlay * overlay); +extern XVisualInfo *__glutDetermineWindowVisual(Bool * treatAsSingle, + Bool * visAlloced, void **fbc); + +/* private variables from glut_ppm.c */ +extern void __glutWritePPMFile(void); + +/* private variables from glut_mesa.c */ +extern int __glutMesaSwapHackSupport; + +/* private variables from glut_gamemode.c */ +extern GLUTwindow *__glutGameModeWindow; + +/* private routines from glut_cindex.c */ +extern GLUTcolormap * __glutAssociateNewColormap(XVisualInfo * vis); +extern void __glutFreeColormap(GLUTcolormap *); + +/* private routines from glut_cmap.c */ +extern void __glutSetupColormap( + XVisualInfo * vi, + GLUTcolormap ** colormap, + Colormap * cmap); +#if !defined(_WIN32) +extern void __glutEstablishColormapsProperty( + GLUTwindow * window); +extern GLUTwindow *__glutToplevelOf(GLUTwindow * window); +#endif + +/* private routines from glut_cursor.c */ +extern void __glutSetCursor(GLUTwindow *window); + +/* private routines from glut_event.c */ +extern void __glutPutOnWorkList(GLUTwindow * window, + int work_mask); +extern void __glutRegisterEventParser(GLUTeventParser * parser); +extern void __glutPostRedisplay(GLUTwindow * window, int layerMask); +extern void handleTimeouts(void); + +/* private routines from glut_init.c */ +#if !defined(_WIN32) +extern void __glutOpenXConnection(char *display); +#else +extern void __glutOpenWin32Connection(char *display); +#endif +#ifdef OLD_VMS +extern void __glutInitTime(struct timeval6 *beginning); +#else +extern void __glutInitTime(struct timeval *beginning); +#endif + +/* private routines for glut_menu.c (or win32_menu.c) */ +#if defined(_WIN32) +extern GLUTmenu *__glutGetMenu(Window win); +extern GLUTmenu *__glutGetMenuByNum(int menunum); +extern GLUTmenuItem *__glutGetMenuItem(GLUTmenu * menu, + Window win, int *which); +extern void __glutStartMenu(GLUTmenu * menu, + GLUTwindow * window, int x, int y, int x_win, int y_win); +extern void __glutFinishMenu(Window win, int x, int y); +#endif +extern void __glutSetMenu(GLUTmenu * menu); + +/* private routines from glut_util.c */ +extern char * __glutStrdup(const char *string); +extern void __glutWarning(char *format,...); +extern void __glutFatalError(char *format,...); +extern void __glutFatalUsage(char *format,...); + +/* private routines from glut_win.c */ +extern GLUTwindow *__glutGetWindow(Window win); +extern void __glutChangeWindowEventMask(long mask, Bool add); +extern XVisualInfo *__glutDetermineVisual( + unsigned int mode, + Bool * fakeSingle, + XVisualInfo * (getVisualInfo) (unsigned int)); +extern XVisualInfo *__glutGetVisualInfo(unsigned int mode); +extern void __glutSetWindow(GLUTwindow * window); +extern void __glutReshapeFunc(GLUTreshapeCB reshapeFunc, + int callingConvention); +extern void GLUTCALLBACK __glutDefaultReshape(int, int); +extern GLUTwindow *__glutCreateWindow( + GLUTwindow * parent, + int x, int y, int width, int height, int gamemode); +extern void __glutDestroyWindow( + GLUTwindow * window, + GLUTwindow * initialWindow); + +#if !defined(_WIN32) +/* private routines from glut_glxext.c */ +extern int __glutIsSupportedByGLX(char *); +extern int __glut_glXBindChannelToWindowSGIX(Display *dpy, int screen, + int channel, Window window); +extern int __glut_glXChannelRectSGIX(Display *dpy, int screen, int channel, + int x, int y, int w, int h); +extern int __glut_glXQueryChannelRectSGIX(Display *dpy, int screen, + int channel, int *x, int *y, + int *w, int *h); +extern int __glut_glXQueryChannelDeltasSGIX(Display *dpy, int screen, + int channel, int *dx, int *dy, + int *dw, int *dh); +extern int __glut_glXChannelRectSyncSGIX(Display *dpy, int screen, int channel, + GLenum synctype); +extern GLXContext __glut_glXCreateContextWithConfigSGIX(Display *dpy, + GLXFBConfigSGIX config, + int render_type, + GLXContext share_list, + Bool direct); +extern int __glut_glXGetFBConfigAttribSGIX(Display *dpy, + GLXFBConfigSGIX config, + int attribute, + int *value); +extern GLXFBConfigSGIX __glut_glXGetFBConfigFromVisualSGIX(Display *dpy, + XVisualInfo *vis); +#endif + +/* private routines from glut_input.c */ +extern void __glutUpdateInputDeviceMask(GLUTwindow * window); + +/* private routines from glut_mesa.c */ +extern void __glutDetermineMesaSwapHackSupport(void); + +/* private routines from glut_gameglut.c */ +extern void __glutCloseDownGameMode(void); + +/* private variables from glut_swap.c (BrianP) */ +extern GLint __glutFPS; +extern GLint __glutSwapCount; +extern GLint __glutSwapTime; + +#if defined(_WIN32) +/* private routines from win32_*.c */ +extern LONG WINAPI __glutWindowProc(HWND win, UINT msg, WPARAM w, LPARAM l); +extern HDC XHDC; +#endif + + +#endif /* __glutint_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_joy.c xpsb-glx-0.19/mesa/src/glut/glx/glut_joy.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_joy.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_joy.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,85 @@ + +/* Copyright (c) Mark J. Kilgard, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef _WIN32 +#ifdef __MINGW32__ +#include +#endif +#include +#ifndef __CYGWIN32__ +#include /* Win32 Multimedia API header. */ +#endif +#endif + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval) +{ +#ifdef _WIN32 + if (joystickFunc && (pollInterval > 0)) { + if (__glutCurrentWindow->entryState == WM_SETFOCUS) { + MMRESULT result; + + /* Capture joystick focus if current window has + focus now. */ + result = joySetCapture(__glutCurrentWindow->win, + JOYSTICKID1, 0, TRUE); + if (result == JOYERR_NOERROR) { + (void) joySetThreshold(JOYSTICKID1, pollInterval); + } + } + __glutCurrentWindow->joyPollInterval = pollInterval; + } else { + /* Release joystick focus if current window has + focus now. */ + if (__glutCurrentWindow->joystick + && (__glutCurrentWindow->joyPollInterval > 0) + && (__glutCurrentWindow->entryState == WM_SETFOCUS)) { + (void) joyReleaseCapture(JOYSTICKID1); + } + __glutCurrentWindow->joyPollInterval = 0; + } + __glutCurrentWindow->joystick = joystickFunc; +#else + /* XXX No support currently for X11 joysticks. */ +#endif +} + +void GLUTAPIENTRY +glutForceJoystickFunc(void) +{ +#ifdef _WIN32 + if (__glutCurrentWindow->joystick) { + JOYINFOEX jix; + MMRESULT res; + int x, y, z; + + /* Poll the joystick. */ + jix.dwSize = sizeof(jix); + jix.dwFlags = JOY_RETURNALL; + res = joyGetPosEx(JOYSTICKID1,&jix); + if (res == JOYERR_NOERROR) { + + /* Convert to int for scaling. */ + x = jix.dwXpos; + y = jix.dwYpos; + z = jix.dwZpos; + +#define SCALE(v) ((int) ((v - 32767)/32.768)) + + __glutCurrentWindow->joystick(jix.dwButtons, + SCALE(x), SCALE(y), SCALE(z)); + } + } +#else + /* XXX No support currently for X11 joysticks. */ +#endif +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_key.c xpsb-glx-0.19/mesa/src/glut/glx/glut_key.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_key.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_key.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutKeyboardFunc(GLUTkeyboardCB keyboardFunc) +{ + __glutChangeWindowEventMask(KeyPressMask, + keyboardFunc != NULL || __glutCurrentWindow->special != NULL); + __glutCurrentWindow->keyboard = keyboardFunc; +} + +void GLUTAPIENTRY +glutSpecialFunc(GLUTspecialCB specialFunc) +{ + __glutChangeWindowEventMask(KeyPressMask, + specialFunc != NULL || __glutCurrentWindow->keyboard != NULL); + __glutCurrentWindow->special = specialFunc; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_keyctrl.c xpsb-glx-0.19/mesa/src/glut/glx/glut_keyctrl.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_keyctrl.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_keyctrl.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutIgnoreKeyRepeat(int ignore) +{ + __glutCurrentWindow->ignoreKeyRepeat = ignore; +} + +void GLUTAPIENTRY +glutSetKeyRepeat(int repeatMode) +{ +#if !defined(_WIN32) + XKeyboardControl values; + + /* GLUT's repeatMode #define's match the Xlib API values. */ + values.auto_repeat_mode = repeatMode; + XChangeKeyboardControl(__glutDisplay, KBAutoRepeatMode, &values); +#endif +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_keyup.c xpsb-glx-0.19/mesa/src/glut/glx/glut_keyup.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_keyup.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_keyup.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc) +{ + __glutChangeWindowEventMask(KeyReleaseMask, + keyboardUpFunc != NULL || __glutCurrentWindow->specialUp != NULL); + __glutCurrentWindow->keyboardUp = keyboardUpFunc; +} + +void GLUTAPIENTRY +glutSpecialUpFunc(GLUTspecialCB specialUpFunc) +{ + __glutChangeWindowEventMask(KeyReleaseMask, + specialUpFunc != NULL || __glutCurrentWindow->keyboardUp != NULL); + __glutCurrentWindow->specialUp = specialUpFunc; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_menu2.c xpsb-glx-0.19/mesa/src/glut/glx/glut_menu2.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_menu2.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_menu2.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,189 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* glut_menu2.c implements the little used GLUT menu calls in + a distinct file from glut_menu.c for slim static linking. */ + +/* The Win32 GLUT file win32_menu.c completely re-implements all + the menuing functionality implemented. This file is used only by + the X Window System version of GLUT. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#include + +#include + +#include "glutint.h" +#include "layerutil.h" + +/* CENTRY */ +/* DEPRICATED, use glutMenuStatusFunc instead. */ +void GLUTAPIENTRY +glutMenuStateFunc(GLUTmenuStateCB menuStateFunc) +{ + __glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc; +} + +void GLUTAPIENTRY +glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc) +{ + __glutMenuStatusFunc = menuStatusFunc; +} + +void GLUTAPIENTRY +glutDestroyMenu(int menunum) +{ + GLUTmenu *menu = __glutGetMenuByNum(menunum); + GLUTmenuItem *item, *next; + + if (__glutMappedMenu) + __glutMenuModificationError(); + assert(menu->id == menunum - 1); + XDestroySubwindows(__glutDisplay, menu->win); + XDestroyWindow(__glutDisplay, menu->win); + __glutMenuList[menunum - 1] = NULL; + /* free all menu entries */ + item = menu->list; + while (item) { + assert(item->menu == menu); + next = item->next; + free(item->label); + free(item); + item = next; + } + if (__glutCurrentMenu == menu) { + __glutCurrentMenu = NULL; + } + free(menu); +} + +void GLUTAPIENTRY +glutChangeToMenuEntry(int num, const char *label, int value) +{ + GLUTmenuItem *item; + int i; + + if (__glutMappedMenu) + __glutMenuModificationError(); + i = __glutCurrentMenu->num; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + if (item->isTrigger) { + /* If changing a submenu trigger to a menu entry, we + need to account for submenus. */ + item->menu->submenus--; + } + free(item->label); + __glutSetMenuItem(item, label, value, False); + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutChangeToSubMenu(int num, const char *label, int menu) +{ + GLUTmenuItem *item; + int i; + + if (__glutMappedMenu) + __glutMenuModificationError(); + i = __glutCurrentMenu->num; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + if (!item->isTrigger) { + /* If changing a menu entry to as submenu trigger, we + need to account for submenus. */ + item->menu->submenus++; + } + free(item->label); + __glutSetMenuItem(item, label, /* base 0 */ menu - 1, True); + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutRemoveMenuItem(int num) +{ + GLUTmenuItem *item, **prev, *remaining; + int pixwidth, i; + + if (__glutMappedMenu) + __glutMenuModificationError(); + i = __glutCurrentMenu->num; + prev = &__glutCurrentMenu->list; + item = __glutCurrentMenu->list; + /* If menu item is removed, the menu's pixwidth may need to + be recomputed. */ + pixwidth = 1; + while (item) { + if (i == num) { + /* If this menu item's pixwidth is as wide as the menu's + pixwidth, removing this menu item will necessitate + shrinking the menu's pixwidth. */ + if (item->pixwidth >= __glutCurrentMenu->pixwidth) { + /* Continue recalculating menu pixwidth, first skipping + the removed item. */ + remaining = item->next; + while (remaining) { + if (remaining->pixwidth > pixwidth) { + pixwidth = remaining->pixwidth; + } + remaining = remaining->next; + } + __glutCurrentMenu->pixwidth = pixwidth; + } + __glutCurrentMenu->num--; + __glutCurrentMenu->managed = False; + + /* Patch up menu's item list. */ + *prev = item->next; + + free(item->label); + free(item); + return; + } + if (item->pixwidth > pixwidth) { + pixwidth = item->pixwidth; + } + i--; + prev = &item->next; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutDetachMenu(int button) +{ + if (__glutMappedMenu) + __glutMenuModificationError(); + if (__glutCurrentWindow->menu[button] > 0) { + __glutCurrentWindow->buttonUses--; + __glutChangeWindowEventMask(ButtonPressMask | ButtonReleaseMask, + __glutCurrentWindow->buttonUses > 0); + __glutCurrentWindow->menu[button] = 0; + } +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_menu.c xpsb-glx-0.19/mesa/src/glut/glx/glut_menu.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_menu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_menu.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1018 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* The Win32 GLUT file win32_menu.c completely re-implements all + the menuing functionality implemented. This file is used only by + the X Window System version of GLUT. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include /* for XC_arrow */ + +#include "glutint.h" +#include "layerutil.h" + +void (CDECL *__glutMenuStatusFunc) (int, int, int); +GLUTmenuItem *__glutItemSelected; +GLUTmenu **__glutMenuList = NULL; + +static int menuListSize = 0; +static XFontStruct *menuFont = NULL; +static Cursor menuCursor; +static Colormap menuColormap; +static Visual *menuVisual; +static int menuDepth; +static int fontHeight; +static GC blackGC, grayGC, whiteGC; +static unsigned long menuBlack, menuWhite, menuGray; +static unsigned long useSaveUnders; + +/* A replacement for XAllocColor (originally by Brian Paul). + This function should never fail to allocate a color. When + XAllocColor fails, we return the nearest matching color. If + we have to allocate many colors this function isn't a great + solution; the XQueryColors() could be done just once. */ +static void +noFaultXAllocColor(Display * dpy, Colormap cmap, int cmapSize, + XColor * color) +{ + XColor *ctable, subColor; + int i, bestmatch; + double mindist; /* 3*2^16^2 exceeds 32-bit long int + precision. */ + + for (;;) { + /* First try just using XAllocColor. */ + if (XAllocColor(dpy, cmap, color)) { + return; + } + + /* Retrieve color table entries. */ + /* XXX alloca canidate. */ + ctable = (XColor *) malloc(cmapSize * sizeof(XColor)); + for (i = 0; i < cmapSize; i++) + ctable[i].pixel = i; + XQueryColors(dpy, cmap, ctable, cmapSize); + + /* Find best match. */ + bestmatch = -1; + mindist = 0.0; + for (i = 0; i < cmapSize; i++) { + double dr = (double) color->red - (double) ctable[i].red; + double dg = (double) color->green - (double) ctable[i].green; + double db = (double) color->blue - (double) ctable[i].blue; + double dist = dr * dr + dg * dg + db * db; + if (bestmatch < 0 || dist < mindist) { + bestmatch = i; + mindist = dist; + } + } + + /* Return result. */ + subColor.red = ctable[bestmatch].red; + subColor.green = ctable[bestmatch].green; + subColor.blue = ctable[bestmatch].blue; + free(ctable); + if (XAllocColor(dpy, cmap, &subColor)) { + *color = subColor; + return; + } + /* Extremely unlikely, but possibly color was deallocated + and reallocated by someone else before we could + XAllocColor the color cell we located. If so, loop + again... */ + } +} + +static int +ifSunCreator(void) +{ + char *xvendor, *glvendor, *renderer; + int isSunCreator = 0; /* Until proven that it is. */ + int savedDisplayMode = 0; + char *savedDisplayString = 0; + GLUTwindow *window; + +#define VENDOR_SUN "Sun Microsystems" +#define RENDERER_CREATOR "Creator" + + /* Check the X vendor string first. It is easier to check + than the OpenGL vendor and renderer strings since it + doesn't require a valid OpenGL rendering context. Bail + early if not connected to a Sun. */ + xvendor = ServerVendor(__glutDisplay); + if (!strncmp(xvendor, VENDOR_SUN, sizeof(VENDOR_SUN) - 1)) { + + /* We need a valid current OpenGL rendering context to be + able to call glGetString successfully. If there is not + a current window, set up a temporary one just to call + glGetString with (gag, expensive). */ + if (__glutCurrentWindow) { + window = NULL; + } else { + savedDisplayMode = __glutDisplayMode; + savedDisplayString = __glutDisplayString; + __glutDisplayMode = GLUT_RGB | GLUT_SINGLE; + __glutDisplayString = NULL; + window = __glutCreateWindow(NULL, 0, 0, 1, 1, 0); + } + + glvendor = (char *) glGetString(GL_VENDOR); + if (!strncmp(glvendor, VENDOR_SUN, sizeof(VENDOR_SUN) - 1)) { + renderer = (char *) glGetString(GL_RENDERER); + if (!strncmp(renderer, RENDERER_CREATOR, sizeof(RENDERER_CREATOR) - 1)) { + isSunCreator = 1; + } + } + /* Destroy the temporary window for glGetString if one + needed to be created. */ + if (window) { + __glutDestroyWindow(window, window); + __glutDisplayMode = savedDisplayMode; + __glutDisplayString = savedDisplayString; + } + } + return isSunCreator; +} + +static void +menuVisualSetup(void) +{ + XLayerVisualInfo template, *visual, *overlayVisuals; + XColor color; + Status status; + Bool presumablyMesa; + int layer, nVisuals, i, dummy; + unsigned long *placeHolders = NULL; + int numPlaceHolders = 0; + Bool allocateHigh; + + allocateHigh = ifSunCreator(); + + /* Start with the highest overlay layer and work down. I + don't think any hardware has more than 3 overlay layers. */ + for (layer = 3; layer > 0; layer--) { + template.layer = layer; + template.vinfo.screen = __glutScreen; + overlayVisuals = __glutXGetLayerVisualInfo(__glutDisplay, + VisualScreenMask | VisualLayerMask, &template, &nVisuals); + if (overlayVisuals) { + /* First, check if the default visual is in this layer. + If the default visual is in this layer, we try to use + it since it has pre-defined black and white pixels and + + using the default visual will probably minimize + colormap flashing problems. Suggested by Thomas Roell + (thomas@xig.com). */ + for (i = 0; i < nVisuals; i++) { + visual = &overlayVisuals[i]; + if (visual->vinfo.colormap_size >= 3) { + /* Compare visual IDs just to be safe. */ + if (visual->vinfo.visual->visualid == DefaultVisual(__glutDisplay, __glutScreen)->visualid) { + /* Settle for default visual. */ + menuVisual = DefaultVisual(__glutDisplay, __glutScreen); + menuDepth = DefaultDepth(__glutDisplay, __glutScreen); + menuColormap = DefaultColormap(__glutDisplay, __glutScreen); + menuBlack = BlackPixel(__glutDisplay, __glutScreen); + menuWhite = WhitePixel(__glutDisplay, __glutScreen); + color.red = color.green = color.blue = 0xaa00; + noFaultXAllocColor(__glutDisplay, menuColormap, + menuVisual->map_entries, &color); + menuGray = color.pixel; + useSaveUnders = 0; + XFree(overlayVisuals); + return; + } + } + } + for (i = 0; i < nVisuals; i++) { + visual = &overlayVisuals[i]; + if (visual->vinfo.colormap_size >= 3) { + if (allocateHigh) { + /* For Sun's Creator graphics, try to force the + read-only colors to the high end of the colormap + by first allocating read-write place-holder cells + for all but the last three cells. This helps + avoid colormap flashing problems. */ + numPlaceHolders = visual->vinfo.colormap_size - 3; + if (numPlaceHolders > 0) { + placeHolders = (unsigned long *) + malloc(numPlaceHolders * sizeof(unsigned long)); + /* A malloc failure would be harmless. */ + } + } + menuColormap = XCreateColormap(__glutDisplay, __glutRoot, + visual->vinfo.visual, AllocNone); + if (placeHolders) { + /* Again for Sun's Creator graphics, do the actual + read-write place-holder cell allocation. */ + status = XAllocColorCells(__glutDisplay, menuColormap, False, 0, 0, + placeHolders, numPlaceHolders); + if (!status) { + XFreeColormap(__glutDisplay, menuColormap); + free(placeHolders); + continue; + } + } + /* Allocate overlay colormap cells in defined order: + gray, black, white to match the IRIS GL allocation + scheme. Increases likelihood of less overlay + colormap flashing. */ + /* XXX Nice if these 3 AllocColor's could be done in + one protocol round-trip. */ + color.red = color.green = color.blue = 0xaa00; + status = XAllocColor(__glutDisplay, + menuColormap, &color); + if (!status) { + XFreeColormap(__glutDisplay, menuColormap); + if (placeHolders) { + free(placeHolders); + } + continue; + } + menuGray = color.pixel; + color.red = color.green = color.blue = 0x0000; + status = XAllocColor(__glutDisplay, + menuColormap, &color); + if (!status) { + XFreeColormap(__glutDisplay, menuColormap); + if (placeHolders) { + free(placeHolders); + } + continue; + } + menuBlack = color.pixel; + color.red = color.green = color.blue = 0xffff; + status = XAllocColor(__glutDisplay, + menuColormap, &color); + if (!status) { + XFreeColormap(__glutDisplay, menuColormap); + if (placeHolders) { + free(placeHolders); + } + continue; + } + if (placeHolders) { + /* Now free the placeholder cells. */ + XFreeColors(__glutDisplay, menuColormap, + placeHolders, numPlaceHolders, 0); + free(placeHolders); + } + menuWhite = color.pixel; + menuVisual = visual->vinfo.visual; + menuDepth = visual->vinfo.depth; + /* If using overlays, do not request "save unders". */ + useSaveUnders = 0; + XFree(overlayVisuals); + return; + } + } + XFree(overlayVisuals); + } + } + /* Settle for default visual. */ + menuVisual = DefaultVisual(__glutDisplay, __glutScreen); + menuDepth = DefaultDepth(__glutDisplay, __glutScreen); + menuColormap = DefaultColormap(__glutDisplay, __glutScreen); + menuBlack = BlackPixel(__glutDisplay, __glutScreen); + menuWhite = WhitePixel(__glutDisplay, __glutScreen); + color.red = color.green = color.blue = 0xaa00; + noFaultXAllocColor(__glutDisplay, menuColormap, + menuVisual->map_entries, &color); + menuGray = color.pixel; + + /* When no overlays are supported, we would like to use X + "save unders" to avoid exposes to windows obscured by + pop-up menus. However, OpenGL's direct rendering support + means OpenGL interacts poorly with X backing store and + save unders. X servers do not (in implementation + practice) redirect OpenGL rendering destined to obscured + window regions into backing store. + + Implementation solutions exist for this problem, but they + are expensive and high-end OpenGL implementations + typically provide fast rendering and/or overlays to + obviate the problem associated of user interfaces (pop-up + menus) forcing redraws of complex normal plane scenes. + (See support for overlays pop-up menus above.) + + Mesa 3D, however, does not support direct rendering. + Overlays are often unavailable to Mesa, and Mesa is also + relatively slow. For these reasons, Mesa-rendering GLUT + programs can and should use X save unders. + + Look for the GLX extension. If _not_ supported, we are + presumably using Mesa so enable save unders. */ + + presumablyMesa = !XQueryExtension(__glutDisplay, "GLX", + &dummy, &dummy, &dummy); + + if (presumablyMesa) { + useSaveUnders = CWSaveUnder; + } else { + useSaveUnders = 0; + } +} + +static void +menuSetup(void) +{ + if (menuFont) { + /* MenuFont overload to indicate menu initalization. */ + return; + } + menuFont = XLoadQueryFont(__glutDisplay, + "-*-helvetica-bold-o-normal--14-*-*-*-p-*-iso8859-1"); + if (!menuFont) { + /* Try back up font. */ + menuFont = XLoadQueryFont(__glutDisplay, "fixed"); + } + if (!menuFont) { + __glutFatalError("could not load font."); + } + menuVisualSetup(); + fontHeight = menuFont->ascent + menuFont->descent; + menuCursor = XCreateFontCursor(__glutDisplay, XC_arrow); +} + +static void +menuGraphicsContextSetup(Window win) +{ + XGCValues gcvals; + + if (blackGC != None) { + return; + } + gcvals.font = menuFont->fid; + gcvals.foreground = menuBlack; + blackGC = XCreateGC(__glutDisplay, win, + GCFont | GCForeground, &gcvals); + gcvals.foreground = menuGray; + grayGC = XCreateGC(__glutDisplay, win, GCForeground, &gcvals); + gcvals.foreground = menuWhite; + whiteGC = XCreateGC(__glutDisplay, win, GCForeground, &gcvals); +} + +void +__glutSetMenu(GLUTmenu * menu) +{ + __glutCurrentMenu = menu; +} + +static void +unmapMenu(GLUTmenu * menu) +{ + if (menu->cascade) { + unmapMenu(menu->cascade); + menu->cascade = NULL; + } + menu->anchor = NULL; + menu->highlighted = NULL; + XUnmapWindow(__glutDisplay, menu->win); +} + +static void +finishMenu(Window win, int x, int y) +{ + Window dummy; + int rc; + + unmapMenu(__glutMappedMenu); + XUngrabPointer(__glutDisplay, CurrentTime); + + /* Popping up an overlay popup menu will install its own + colormap. If the window associated with the menu has an + overlay, install that window's overlay colormap so the + overlay isn't left using the popup menu's colormap. */ + if (__glutMenuWindow->overlay) { + XInstallColormap(__glutDisplay, + __glutMenuWindow->overlay->colormap->cmap); + } + + /* This XFlush is needed to to make sure the pointer is + really ungrabbed when the application's menu callback is + called. Otherwise, a deadlock might happen because the + application may try to read from an terminal window, but + yet the ungrab hasn't really happened since it hasn't been + flushed out. */ + XFlush(__glutDisplay); + + if (__glutMenuStatusFunc) { + if (win != __glutMenuWindow->win) { + /* The button release may have occurred in a window other + than the window requesting the pop-up menu (for + example, one of the submenu windows). In this case, we + need to translate the coordinates into the coordinate + system of the window associated with the window. */ + rc = XTranslateCoordinates(__glutDisplay, win, __glutMenuWindow->win, + x, y, &x, &y, &dummy); + assert(rc != False); /* Will always be on same screen. */ + } + __glutSetWindow(__glutMenuWindow); + __glutSetMenu(__glutMappedMenu); + + /* Setting __glutMappedMenu to NULL permits operations that + change menus or destroy the menu window again. */ + __glutMappedMenu = NULL; + + __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y); + } + /* Setting __glutMappedMenu to NULL permits operations that + change menus or destroy the menu window again. */ + __glutMappedMenu = NULL; + + /* If an item is selected and it is not a submenu trigger, + generate menu callback. */ + if (__glutItemSelected && !__glutItemSelected->isTrigger) { + __glutSetWindow(__glutMenuWindow); + /* When menu callback is triggered, current menu should be + set to the callback menu. */ + __glutSetMenu(__glutItemSelected->menu); + __glutItemSelected->menu->select( + __glutItemSelected->value); + } + __glutMenuWindow = NULL; +} + +#define MENU_BORDER 1 +#define MENU_GAP 2 +#define MENU_ARROW_GAP 6 +#define MENU_ARROW_WIDTH 8 + +static void +mapMenu(GLUTmenu * menu, int x, int y) +{ + XWindowChanges changes; + unsigned int mask; + int subMenuExtension, num; + + /* If there are submenus, we need to provide extra space for + the submenu pull arrow. */ + if (menu->submenus > 0) { + subMenuExtension = MENU_ARROW_GAP + MENU_ARROW_WIDTH; + } else { + subMenuExtension = 0; + } + + changes.stack_mode = Above; + mask = CWStackMode | CWX | CWY; + /* If the menu isn't managed (ie, validated so all the + InputOnly subwindows are the right size), do so. */ + if (!menu->managed) { + GLUTmenuItem *item; + + item = menu->list; + num = menu->num; + while (item) { + XWindowChanges itemupdate; + + itemupdate.y = (num - 1) * fontHeight + MENU_GAP; + itemupdate.width = menu->pixwidth; + itemupdate.width += subMenuExtension; + XConfigureWindow(__glutDisplay, item->win, + CWWidth | CWY, &itemupdate); + item = item->next; + num--; + } + menu->pixheight = MENU_GAP + + fontHeight * menu->num + MENU_GAP; + changes.height = menu->pixheight; + changes.width = MENU_GAP + + menu->pixwidth + subMenuExtension + MENU_GAP; + mask |= CWWidth | CWHeight; + menu->managed = True; + } + /* Make sure menu appears fully on screen. */ + if (y + menu->pixheight >= __glutScreenHeight) { + changes.y = __glutScreenHeight - menu->pixheight; + } else { + changes.y = y; + } + if (x + menu->pixwidth + subMenuExtension >= + __glutScreenWidth) { + changes.x = __glutScreenWidth - + menu->pixwidth + subMenuExtension; + } else { + changes.x = x; + } + + /* Rember where the menu is placed so submenus can be + properly placed relative to it. */ + menu->x = changes.x; + menu->y = changes.y; + + XConfigureWindow(__glutDisplay, menu->win, mask, &changes); + XInstallColormap(__glutDisplay, menuColormap); + /* XXX The XRaiseWindow below should not be necessary because + the XConfigureWindow requests an Above stack mode (same as + XRaiseWindow), but some Sun users complained this was still + necessary. Probably some window manager or X server bug on + these machines?? */ + XRaiseWindow(__glutDisplay, menu->win); + XMapWindow(__glutDisplay, menu->win); +} + +static void +startMenu(GLUTmenu * menu, GLUTwindow * window, + int x, int y, int x_win, int y_win) +{ + int grab; + + assert(__glutMappedMenu == NULL); + grab = XGrabPointer(__glutDisplay, __glutRoot, True, + ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, + __glutRoot, menuCursor, CurrentTime); + if (grab != GrabSuccess) { + /* Somebody else has pointer grabbed, ignore menu + activation. */ + return; + } + __glutMappedMenu = menu; + __glutMenuWindow = window; + __glutItemSelected = NULL; + if (__glutMenuStatusFunc) { + __glutSetMenu(menu); + __glutSetWindow(window); + __glutMenuStatusFunc(GLUT_MENU_IN_USE, x_win, y_win); + } + mapMenu(menu, x, y); +} + +static void +paintSubMenuArrow(Window win, int x, int y) +{ + XPoint p[5]; + + p[0].x = p[4].x = x; + p[0].y = p[4].y = y - menuFont->ascent + 1; + p[1].x = p[0].x + MENU_ARROW_WIDTH - 1; + p[1].y = p[0].y + (menuFont->ascent / 2) - 1; + p[2].x = p[1].x; + p[2].y = p[1].y + 1; + p[3].x = p[0].x; + p[3].y = p[0].y + menuFont->ascent - 2; + XFillPolygon(__glutDisplay, win, + whiteGC, p, 4, Convex, CoordModeOrigin); + XDrawLines(__glutDisplay, win, blackGC, p, 5, CoordModeOrigin); +} + +static void +paintMenuItem(GLUTmenuItem * item, int num) +{ + Window win = item->menu->win; + GC gc; + int y; + int subMenuExtension; + + if (item->menu->submenus > 0) { + subMenuExtension = MENU_ARROW_GAP + MENU_ARROW_WIDTH; + } else { + subMenuExtension = 0; + } + if (item->menu->highlighted == item) { + gc = whiteGC; + } else { + gc = grayGC; + } + y = MENU_GAP + fontHeight * num - menuFont->descent; + XFillRectangle(__glutDisplay, win, gc, + MENU_GAP, y - fontHeight + menuFont->descent, + item->menu->pixwidth + subMenuExtension, fontHeight); + XDrawString(__glutDisplay, win, blackGC, + MENU_GAP, y, item->label, item->len); + if (item->isTrigger) { + paintSubMenuArrow(win, + item->menu->pixwidth + MENU_ARROW_GAP + 1, y); + } +} + +static void +paintMenu(GLUTmenu * menu) +{ + GLUTmenuItem *item; + int i = menu->num; + int y = MENU_GAP + fontHeight * i - menuFont->descent; + + item = menu->list; + while (item) { + if (item->menu->highlighted == item) { + paintMenuItem(item, i); + } else { + /* Quick render of the menu item; assume background + already cleared to gray. */ + XDrawString(__glutDisplay, menu->win, blackGC, + 2, y, item->label, item->len); + if (item->isTrigger) { + paintSubMenuArrow(menu->win, + menu->pixwidth + MENU_ARROW_GAP + 1, y); + } + } + i--; + y -= fontHeight; + item = item->next; + } +} + +static GLUTmenuItem * +getMenuItem(GLUTmenu * menu, Window win, int *which) +{ + GLUTmenuItem *item; + int i; + + if (menu->searched) { + __glutFatalError("submenu infinite loop detected"); + } + menu->searched = True; + i = menu->num; + item = menu->list; + while (item) { + if (item->win == win) { + *which = i; + menu->searched = False; + return item; + } + if (item->isTrigger) { + GLUTmenuItem *subitem; + + subitem = __glutGetMenuItem(__glutMenuList[item->value], + win, which); + if (subitem) { + menu->searched = False; + return subitem; + } + } + i--; + item = item->next; + } + menu->searched = False; + return NULL; +} + +static int +getMenuItemIndex(GLUTmenuItem * item) +{ + int count = 0; + + while (item) { + count++; + item = item->next; + } + return count; +} + +static GLUTmenu * +getMenu(Window win) +{ + GLUTmenu *menu; + + menu = __glutMappedMenu; + while (menu) { + if (win == menu->win) { + return menu; + } + menu = menu->cascade; + } + return NULL; +} + +static GLUTmenu * +getMenuByNum(int menunum) +{ + if (menunum < 1 || menunum > menuListSize) { + return NULL; + } + return __glutMenuList[menunum - 1]; +} + +static int +getUnusedMenuSlot(void) +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < menuListSize; i++) { + if (!__glutMenuList[i]) { + return i; + } + } + /* Allocate a new slot. */ + menuListSize++; + if (__glutMenuList) { + __glutMenuList = (GLUTmenu **) + realloc(__glutMenuList, menuListSize * sizeof(GLUTmenu *)); + } else { + /* XXX Some realloc's do not correctly perform a malloc + when asked to perform a realloc on a NULL pointer, + though the ANSI C library spec requires this. */ + __glutMenuList = (GLUTmenu **) malloc(sizeof(GLUTmenu *)); + } + if (!__glutMenuList) { + __glutFatalError("out of memory."); + } + __glutMenuList[menuListSize - 1] = NULL; + return menuListSize - 1; +} + +void +__glutMenuModificationError(void) +{ + /* XXX Remove the warning after GLUT 3.0. */ + __glutWarning("The following is a new check for GLUT 3.0; update your code."); + __glutFatalError("menu manipulation not allowed while menus in use."); +} + + +static void +menuItemEnterOrLeave(GLUTmenuItem * item, + int num, int type) +{ + int alreadyUp = 0; + + if (type == EnterNotify) { + GLUTmenuItem *prevItem = item->menu->highlighted; + + if (prevItem && prevItem != item) { + /* If there's an already higlighted item in this menu + that is different from this one (we could be + re-entering an item with an already cascaded + submenu!), unhighlight the previous item. */ + item->menu->highlighted = NULL; + paintMenuItem(prevItem, getMenuItemIndex(prevItem)); + } + item->menu->highlighted = item; + __glutItemSelected = item; + if (item->menu->cascade) { + if (!item->isTrigger) { + /* Entered a menu item that is not a submenu trigger, + so pop down the current submenu cascade of this + menu. */ + unmapMenu(item->menu->cascade); + item->menu->cascade = NULL; + } else { + GLUTmenu *submenu = __glutMenuList[item->value]; + + if (submenu->anchor == item) { + /* We entered the submenu trigger for the submenu + that is already up, so don't take down the + submenu. */ + alreadyUp = 1; + } else { + /* Submenu already popped up for some other submenu + item of this menu; need to pop down that other + submenu cascade. */ + unmapMenu(item->menu->cascade); + item->menu->cascade = NULL; + } + } + } + if (!alreadyUp) { + /* Make sure the menu item gets painted with + highlighting. */ + paintMenuItem(item, num); + } else { + /* If already up, should already be highlighted. */ + } + } else { + /* LeaveNotify: Handle leaving a menu item... */ + if (item->menu->cascade && + item->menu->cascade->anchor == item) { + /* If there is a submenu casacaded from this item, do not + change the highlighting on this item upon leaving. */ + } else { + /* Unhighlight this menu item. */ + item->menu->highlighted = NULL; + paintMenuItem(item, num); + } + __glutItemSelected = NULL; + } + if (item->isTrigger) { + if (type == EnterNotify && !alreadyUp) { + GLUTmenu *submenu = __glutMenuList[item->value]; + + mapMenu(submenu, + item->menu->x + item->menu->pixwidth + + MENU_ARROW_GAP + MENU_ARROW_WIDTH + + MENU_GAP + MENU_BORDER, + item->menu->y + fontHeight * (num - 1) + MENU_GAP); + item->menu->cascade = submenu; + submenu->anchor = item; + } + } +} + +/* Installs callback functions for use by glut_event.c The point + of this is so that GLUT's menu code only gets linked into + GLUT binaries (assuming a static library) if the GLUT menu + API is used. */ +static void +installMenuCallbacks(void) +{ + __glutMenuItemEnterOrLeave = menuItemEnterOrLeave; + __glutFinishMenu = finishMenu; + __glutPaintMenu = paintMenu; + __glutStartMenu = startMenu; + __glutGetMenuByNum = getMenuByNum; + __glutGetMenu = getMenu; + __glutGetMenuItem = getMenuItem; +} + +int GLUTAPIENTRY +glutCreateMenu(GLUTselectCB selectFunc) +{ + XSetWindowAttributes wa; + GLUTmenu *menu; + int menuid; + + if (__glutMappedMenu) { + __glutMenuModificationError(); + } + if (!__glutDisplay) { + __glutOpenXConnection(NULL); + } + + installMenuCallbacks(); + + menuid = getUnusedMenuSlot(); + menu = (GLUTmenu *) malloc(sizeof(GLUTmenu)); + if (!menu) { + __glutFatalError("out of memory."); + } + menu->id = menuid; + menu->num = 0; + menu->submenus = 0; + menu->managed = False; + menu->searched = False; + menu->pixwidth = 0; + menu->select = selectFunc; + menu->list = NULL; + menu->cascade = NULL; + menu->highlighted = NULL; + menu->anchor = NULL; + menuSetup(); + wa.override_redirect = True; + wa.background_pixel = menuGray; + wa.border_pixel = menuBlack; + wa.colormap = menuColormap; + wa.event_mask = StructureNotifyMask | ExposureMask | + ButtonPressMask | ButtonReleaseMask | + EnterWindowMask | LeaveWindowMask; + /* Save unders really only enabled if useSaveUnders is set to + CWSaveUnder, ie. using Mesa 3D. See earlier comments. */ + wa.save_under = True; + menu->win = XCreateWindow(__glutDisplay, __glutRoot, + /* Real position determined when mapped. */ + 0, 0, + /* Real size will be determined when menu is manged. */ + 1, 1, + MENU_BORDER, menuDepth, InputOutput, menuVisual, + CWOverrideRedirect | CWBackPixel | CWBorderPixel | + CWEventMask | CWColormap | useSaveUnders, + &wa); + menuGraphicsContextSetup(menu->win); + __glutMenuList[menuid] = menu; + __glutSetMenu(menu); + return menuid + 1; +} + +/* CENTRY */ +int GLUTAPIENTRY +glutGetMenu(void) +{ + if (__glutCurrentMenu) { + return __glutCurrentMenu->id + 1; + } else { + return 0; + } +} + +void GLUTAPIENTRY +glutSetMenu(int menuid) +{ + GLUTmenu *menu; + + if (menuid < 1 || menuid > menuListSize) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + menu = __glutMenuList[menuid - 1]; + if (!menu) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + __glutSetMenu(menu); +} +/* ENDCENTRY */ + +void +__glutSetMenuItem(GLUTmenuItem * item, const char *label, + int value, Bool isTrigger) +{ + GLUTmenu *menu; + + menu = item->menu; + item->label = __glutStrdup(label); + if (!item->label) { + __glutFatalError("out of memory."); + } + item->isTrigger = isTrigger; + item->len = (int) strlen(label); + item->value = value; + item->pixwidth = XTextWidth(menuFont, label, item->len) + 4; + if (item->pixwidth > menu->pixwidth) { + menu->pixwidth = item->pixwidth; + } + menu->managed = False; +} + +/* CENTRY */ +void GLUTAPIENTRY +glutAddMenuEntry(const char *label, int value) +{ + XSetWindowAttributes wa; + GLUTmenuItem *entry; + + if (__glutMappedMenu) { + __glutMenuModificationError(); + } + entry = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); + if (!entry) { + __glutFatalError("out of memory."); + } + entry->menu = __glutCurrentMenu; + __glutSetMenuItem(entry, label, value, False); + wa.event_mask = EnterWindowMask | LeaveWindowMask; + entry->win = XCreateWindow(__glutDisplay, + __glutCurrentMenu->win, MENU_GAP, + __glutCurrentMenu->num * fontHeight + MENU_GAP, /* x & y */ + entry->pixwidth, fontHeight, /* width & height */ + 0, CopyFromParent, InputOnly, CopyFromParent, + CWEventMask, &wa); + XMapWindow(__glutDisplay, entry->win); + __glutCurrentMenu->num++; + entry->next = __glutCurrentMenu->list; + __glutCurrentMenu->list = entry; +} + +void GLUTAPIENTRY +glutAddSubMenu(const char *label, int menu) +{ + XSetWindowAttributes wa; + GLUTmenuItem *submenu; + + if (__glutMappedMenu) { + __glutMenuModificationError(); + } + submenu = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); + if (!submenu) { + __glutFatalError("out of memory."); + } + __glutCurrentMenu->submenus++; + submenu->menu = __glutCurrentMenu; + __glutSetMenuItem(submenu, label, /* base 0 */ menu - 1, True); + wa.event_mask = EnterWindowMask | LeaveWindowMask; + submenu->win = XCreateWindow(__glutDisplay, + __glutCurrentMenu->win, MENU_GAP, + __glutCurrentMenu->num * fontHeight + MENU_GAP, /* x & y */ + submenu->pixwidth, fontHeight, /* width & height */ + 0, CopyFromParent, InputOnly, CopyFromParent, + CWEventMask, &wa); + XMapWindow(__glutDisplay, submenu->win); + __glutCurrentMenu->num++; + submenu->next = __glutCurrentMenu->list; + __glutCurrentMenu->list = submenu; +} + +void GLUTAPIENTRY +glutAttachMenu(int button) +{ + /* if button >= GLUT_MAX_MENUS, we'll go out of array bounds below */ + if (button >= GLUT_MAX_MENUS) { + return; + } + if (__glutMappedMenu) { + __glutMenuModificationError(); + } + installMenuCallbacks(); + if (__glutCurrentWindow->menu[button] < 1) { + __glutCurrentWindow->buttonUses++; + } + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, True); + __glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1; +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_mesa.c xpsb-glx-0.19/mesa/src/glut/glx/glut_mesa.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_mesa.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_mesa.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ + +/* Copyright (c) Mark J. Kilgard, 1996. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include "glutint.h" + +int __glutMesaSwapHackSupport = 0; /* Not supported until + proven otherwise. */ + +/* Use the "Mesa swap hack" if reasonable if and only if + MESA_SWAP_HACK is set to something whose first character is + not "N" or "n" AND "Brian Paul" is the vendor string AND + "Mesa X11"* (or "Mesa" for backward compatibility) is the + renderer string. + + Anyone who modifies Mesa so that glXSwapBuffers does not + simply blit the previously rendered back buffer should + change either their vendor or renderer string to avoid + confusing GLUT. */ + +void +__glutDetermineMesaSwapHackSupport(void) +{ + static int doneAlready = 0; + char *env, *vendor, *renderer; + + if (doneAlready) + return; + env = getenv("MESA_SWAP_HACK"); + if (env) { + if ((env[0] != 'n') && (env[0] != 'N')) { + vendor = (char *) glGetString(GL_VENDOR); + renderer = (char *) glGetString(GL_RENDERER); + + /* Old versions of X11 Mesa uses the renderer string + "Mesa"; Brian plans to start using "Mesa X11" to + distinguish the X version of Mesa from other flavor + such as Windows or 3Dfx. */ + +#define MESA_X11 "Mesa X11" + + /* XXX At some point in the future, eliminate the + backward compatibility for the old "Mesa" renderer + string. */ + + if (!strcmp(vendor, "Brian Paul") && (!strcmp(renderer, "Mesa") || + !strncmp(renderer, MESA_X11, sizeof(MESA_X11) - 1))) + __glutMesaSwapHackSupport = 1; + } + } + doneAlready = 1; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_modifier.c xpsb-glx-0.19/mesa/src/glut/glx/glut_modifier.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_modifier.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_modifier.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,31 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutGetModifiers(void) +{ + int modifiers; + + if(__glutModifierMask == (unsigned int) ~0) { + __glutWarning( + "glutCurrentModifiers: do not call outside core input callback."); + return 0; + } + modifiers = 0; + if(__glutModifierMask & (ShiftMask|LockMask)) + modifiers |= GLUT_ACTIVE_SHIFT; + if(__glutModifierMask & ControlMask) + modifiers |= GLUT_ACTIVE_CTRL; + if(__glutModifierMask & Mod1Mask) + modifiers |= GLUT_ACTIVE_ALT; + return modifiers; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_mroman.c xpsb-glx-0.19/mesa/src/glut/glx/glut_mroman.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_mroman.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_mroman.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2451 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "glutstroke.h" + +/* char: 33 '!' */ + +static const CoordRec char33_stroke0[] = { + { 52.381, 100 }, + { 52.381, 33.3333 }, +}; + +static const CoordRec char33_stroke1[] = { + { 52.381, 9.5238 }, + { 47.6191, 4.7619 }, + { 52.381, 0 }, + { 57.1429, 4.7619 }, + { 52.381, 9.5238 }, +}; + +static const StrokeRec char33[] = { + { 2, char33_stroke0 }, + { 5, char33_stroke1 }, +}; + +/* char: 34 '"' */ + +static const CoordRec char34_stroke0[] = { + { 33.3334, 100 }, + { 33.3334, 66.6667 }, +}; + +static const CoordRec char34_stroke1[] = { + { 71.4286, 100 }, + { 71.4286, 66.6667 }, +}; + +static const StrokeRec char34[] = { + { 2, char34_stroke0 }, + { 2, char34_stroke1 }, +}; + +/* char: 35 '#' */ + +static const CoordRec char35_stroke0[] = { + { 54.7619, 119.048 }, + { 21.4286, -33.3333 }, +}; + +static const CoordRec char35_stroke1[] = { + { 83.3334, 119.048 }, + { 50, -33.3333 }, +}; + +static const CoordRec char35_stroke2[] = { + { 21.4286, 57.1429 }, + { 88.0952, 57.1429 }, +}; + +static const CoordRec char35_stroke3[] = { + { 16.6667, 28.5714 }, + { 83.3334, 28.5714 }, +}; + +static const StrokeRec char35[] = { + { 2, char35_stroke0 }, + { 2, char35_stroke1 }, + { 2, char35_stroke2 }, + { 2, char35_stroke3 }, +}; + +/* char: 36 '$' */ + +static const CoordRec char36_stroke0[] = { + { 42.8571, 119.048 }, + { 42.8571, -19.0476 }, +}; + +static const CoordRec char36_stroke1[] = { + { 61.9047, 119.048 }, + { 61.9047, -19.0476 }, +}; + +static const CoordRec char36_stroke2[] = { + { 85.7143, 85.7143 }, + { 76.1905, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, + { 28.5714, 95.2381 }, + { 19.0476, 85.7143 }, + { 19.0476, 76.1905 }, + { 23.8095, 66.6667 }, + { 28.5714, 61.9048 }, + { 38.0952, 57.1429 }, + { 66.6666, 47.619 }, + { 76.1905, 42.8571 }, + { 80.9524, 38.0952 }, + { 85.7143, 28.5714 }, + { 85.7143, 14.2857 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 19.0476, 14.2857 }, +}; + +static const StrokeRec char36[] = { + { 2, char36_stroke0 }, + { 2, char36_stroke1 }, + { 20, char36_stroke2 }, +}; + +/* char: 37 '%' */ + +static const CoordRec char37_stroke0[] = { + { 95.2381, 100 }, + { 9.5238, 0 }, +}; + +static const CoordRec char37_stroke1[] = { + { 33.3333, 100 }, + { 42.8571, 90.4762 }, + { 42.8571, 80.9524 }, + { 38.0952, 71.4286 }, + { 28.5714, 66.6667 }, + { 19.0476, 66.6667 }, + { 9.5238, 76.1905 }, + { 9.5238, 85.7143 }, + { 14.2857, 95.2381 }, + { 23.8095, 100 }, + { 33.3333, 100 }, + { 42.8571, 95.2381 }, + { 57.1428, 90.4762 }, + { 71.4286, 90.4762 }, + { 85.7143, 95.2381 }, + { 95.2381, 100 }, +}; + +static const CoordRec char37_stroke2[] = { + { 76.1905, 33.3333 }, + { 66.6667, 28.5714 }, + { 61.9048, 19.0476 }, + { 61.9048, 9.5238 }, + { 71.4286, 0 }, + { 80.9524, 0 }, + { 90.4762, 4.7619 }, + { 95.2381, 14.2857 }, + { 95.2381, 23.8095 }, + { 85.7143, 33.3333 }, + { 76.1905, 33.3333 }, +}; + +static const StrokeRec char37[] = { + { 2, char37_stroke0 }, + { 16, char37_stroke1 }, + { 11, char37_stroke2 }, +}; + +/* char: 38 '&' */ + +static const CoordRec char38_stroke0[] = { + { 100, 57.1429 }, + { 100, 61.9048 }, + { 95.2381, 66.6667 }, + { 90.4762, 66.6667 }, + { 85.7143, 61.9048 }, + { 80.9524, 52.381 }, + { 71.4286, 28.5714 }, + { 61.9048, 14.2857 }, + { 52.3809, 4.7619 }, + { 42.8571, 0 }, + { 23.8095, 0 }, + { 14.2857, 4.7619 }, + { 9.5238, 9.5238 }, + { 4.7619, 19.0476 }, + { 4.7619, 28.5714 }, + { 9.5238, 38.0952 }, + { 14.2857, 42.8571 }, + { 47.619, 61.9048 }, + { 52.3809, 66.6667 }, + { 57.1429, 76.1905 }, + { 57.1429, 85.7143 }, + { 52.3809, 95.2381 }, + { 42.8571, 100 }, + { 33.3333, 95.2381 }, + { 28.5714, 85.7143 }, + { 28.5714, 76.1905 }, + { 33.3333, 61.9048 }, + { 42.8571, 47.619 }, + { 66.6667, 14.2857 }, + { 76.1905, 4.7619 }, + { 85.7143, 0 }, + { 95.2381, 0 }, + { 100, 4.7619 }, + { 100, 9.5238 }, +}; + +static const StrokeRec char38[] = { + { 34, char38_stroke0 }, +}; + +/* char: 39 ''' */ + +static const CoordRec char39_stroke0[] = { + { 52.381, 100 }, + { 52.381, 66.6667 }, +}; + +static const StrokeRec char39[] = { + { 2, char39_stroke0 }, +}; + +/* char: 40 '(' */ + +static const CoordRec char40_stroke0[] = { + { 69.0476, 119.048 }, + { 59.5238, 109.524 }, + { 50, 95.2381 }, + { 40.4762, 76.1905 }, + { 35.7143, 52.381 }, + { 35.7143, 33.3333 }, + { 40.4762, 9.5238 }, + { 50, -9.5238 }, + { 59.5238, -23.8095 }, + { 69.0476, -33.3333 }, +}; + +static const StrokeRec char40[] = { + { 10, char40_stroke0 }, +}; + +/* char: 41 ')' */ + +static const CoordRec char41_stroke0[] = { + { 35.7143, 119.048 }, + { 45.2381, 109.524 }, + { 54.7619, 95.2381 }, + { 64.2857, 76.1905 }, + { 69.0476, 52.381 }, + { 69.0476, 33.3333 }, + { 64.2857, 9.5238 }, + { 54.7619, -9.5238 }, + { 45.2381, -23.8095 }, + { 35.7143, -33.3333 }, +}; + +static const StrokeRec char41[] = { + { 10, char41_stroke0 }, +}; + +/* char: 42 '*' */ + +static const CoordRec char42_stroke0[] = { + { 52.381, 71.4286 }, + { 52.381, 14.2857 }, +}; + +static const CoordRec char42_stroke1[] = { + { 28.5715, 57.1429 }, + { 76.1905, 28.5714 }, +}; + +static const CoordRec char42_stroke2[] = { + { 76.1905, 57.1429 }, + { 28.5715, 28.5714 }, +}; + +static const StrokeRec char42[] = { + { 2, char42_stroke0 }, + { 2, char42_stroke1 }, + { 2, char42_stroke2 }, +}; + +/* char: 43 '+' */ + +static const CoordRec char43_stroke0[] = { + { 52.3809, 85.7143 }, + { 52.3809, 0 }, +}; + +static const CoordRec char43_stroke1[] = { + { 9.5238, 42.8571 }, + { 95.2381, 42.8571 }, +}; + +static const StrokeRec char43[] = { + { 2, char43_stroke0 }, + { 2, char43_stroke1 }, +}; + +/* char: 44 ',' */ + +static const CoordRec char44_stroke0[] = { + { 57.1429, 4.7619 }, + { 52.381, 0 }, + { 47.6191, 4.7619 }, + { 52.381, 9.5238 }, + { 57.1429, 4.7619 }, + { 57.1429, -4.7619 }, + { 52.381, -14.2857 }, + { 47.6191, -19.0476 }, +}; + +static const StrokeRec char44[] = { + { 8, char44_stroke0 }, +}; + +/* char: 45 '-' */ + +static const CoordRec char45_stroke0[] = { + { 9.5238, 42.8571 }, + { 95.2381, 42.8571 }, +}; + +static const StrokeRec char45[] = { + { 2, char45_stroke0 }, +}; + +/* char: 46 '.' */ + +static const CoordRec char46_stroke0[] = { + { 52.381, 9.5238 }, + { 47.6191, 4.7619 }, + { 52.381, 0 }, + { 57.1429, 4.7619 }, + { 52.381, 9.5238 }, +}; + +static const StrokeRec char46[] = { + { 5, char46_stroke0 }, +}; + +/* char: 47 '/' */ + +static const CoordRec char47_stroke0[] = { + { 19.0476, -14.2857 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char47[] = { + { 2, char47_stroke0 }, +}; + +/* char: 48 '0' */ + +static const CoordRec char48_stroke0[] = { + { 47.619, 100 }, + { 33.3333, 95.2381 }, + { 23.8095, 80.9524 }, + { 19.0476, 57.1429 }, + { 19.0476, 42.8571 }, + { 23.8095, 19.0476 }, + { 33.3333, 4.7619 }, + { 47.619, 0 }, + { 57.1428, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 19.0476 }, + { 85.7143, 42.8571 }, + { 85.7143, 57.1429 }, + { 80.9524, 80.9524 }, + { 71.4286, 95.2381 }, + { 57.1428, 100 }, + { 47.619, 100 }, +}; + +static const StrokeRec char48[] = { + { 17, char48_stroke0 }, +}; + +/* char: 49 '1' */ + +static const CoordRec char49_stroke0[] = { + { 40.4762, 80.9524 }, + { 50, 85.7143 }, + { 64.2857, 100 }, + { 64.2857, 0 }, +}; + +static const StrokeRec char49[] = { + { 4, char49_stroke0 }, +}; + +/* char: 50 '2' */ + +static const CoordRec char50_stroke0[] = { + { 23.8095, 76.1905 }, + { 23.8095, 80.9524 }, + { 28.5714, 90.4762 }, + { 33.3333, 95.2381 }, + { 42.8571, 100 }, + { 61.9047, 100 }, + { 71.4286, 95.2381 }, + { 76.1905, 90.4762 }, + { 80.9524, 80.9524 }, + { 80.9524, 71.4286 }, + { 76.1905, 61.9048 }, + { 66.6666, 47.619 }, + { 19.0476, 0 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char50[] = { + { 14, char50_stroke0 }, +}; + +/* char: 51 '3' */ + +static const CoordRec char51_stroke0[] = { + { 28.5714, 100 }, + { 80.9524, 100 }, + { 52.3809, 61.9048 }, + { 66.6666, 61.9048 }, + { 76.1905, 57.1429 }, + { 80.9524, 52.381 }, + { 85.7143, 38.0952 }, + { 85.7143, 28.5714 }, + { 80.9524, 14.2857 }, + { 71.4286, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 23.8095, 9.5238 }, + { 19.0476, 19.0476 }, +}; + +static const StrokeRec char51[] = { + { 15, char51_stroke0 }, +}; + +/* char: 52 '4' */ + +static const CoordRec char52_stroke0[] = { + { 64.2857, 100 }, + { 16.6667, 33.3333 }, + { 88.0952, 33.3333 }, +}; + +static const CoordRec char52_stroke1[] = { + { 64.2857, 100 }, + { 64.2857, 0 }, +}; + +static const StrokeRec char52[] = { + { 3, char52_stroke0 }, + { 2, char52_stroke1 }, +}; + +/* char: 53 '5' */ + +static const CoordRec char53_stroke0[] = { + { 76.1905, 100 }, + { 28.5714, 100 }, + { 23.8095, 57.1429 }, + { 28.5714, 61.9048 }, + { 42.8571, 66.6667 }, + { 57.1428, 66.6667 }, + { 71.4286, 61.9048 }, + { 80.9524, 52.381 }, + { 85.7143, 38.0952 }, + { 85.7143, 28.5714 }, + { 80.9524, 14.2857 }, + { 71.4286, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 23.8095, 9.5238 }, + { 19.0476, 19.0476 }, +}; + +static const StrokeRec char53[] = { + { 17, char53_stroke0 }, +}; + +/* char: 54 '6' */ + +static const CoordRec char54_stroke0[] = { + { 78.5714, 85.7143 }, + { 73.8096, 95.2381 }, + { 59.5238, 100 }, + { 50, 100 }, + { 35.7143, 95.2381 }, + { 26.1905, 80.9524 }, + { 21.4286, 57.1429 }, + { 21.4286, 33.3333 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 50, 0 }, + { 54.7619, 0 }, + { 69.0476, 4.7619 }, + { 78.5714, 14.2857 }, + { 83.3334, 28.5714 }, + { 83.3334, 33.3333 }, + { 78.5714, 47.619 }, + { 69.0476, 57.1429 }, + { 54.7619, 61.9048 }, + { 50, 61.9048 }, + { 35.7143, 57.1429 }, + { 26.1905, 47.619 }, + { 21.4286, 33.3333 }, +}; + +static const StrokeRec char54[] = { + { 23, char54_stroke0 }, +}; + +/* char: 55 '7' */ + +static const CoordRec char55_stroke0[] = { + { 85.7143, 100 }, + { 38.0952, 0 }, +}; + +static const CoordRec char55_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char55[] = { + { 2, char55_stroke0 }, + { 2, char55_stroke1 }, +}; + +/* char: 56 '8' */ + +static const CoordRec char56_stroke0[] = { + { 42.8571, 100 }, + { 28.5714, 95.2381 }, + { 23.8095, 85.7143 }, + { 23.8095, 76.1905 }, + { 28.5714, 66.6667 }, + { 38.0952, 61.9048 }, + { 57.1428, 57.1429 }, + { 71.4286, 52.381 }, + { 80.9524, 42.8571 }, + { 85.7143, 33.3333 }, + { 85.7143, 19.0476 }, + { 80.9524, 9.5238 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 23.8095, 9.5238 }, + { 19.0476, 19.0476 }, + { 19.0476, 33.3333 }, + { 23.8095, 42.8571 }, + { 33.3333, 52.381 }, + { 47.619, 57.1429 }, + { 66.6666, 61.9048 }, + { 76.1905, 66.6667 }, + { 80.9524, 76.1905 }, + { 80.9524, 85.7143 }, + { 76.1905, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, +}; + +static const StrokeRec char56[] = { + { 29, char56_stroke0 }, +}; + +/* char: 57 '9' */ + +static const CoordRec char57_stroke0[] = { + { 83.3334, 66.6667 }, + { 78.5714, 52.381 }, + { 69.0476, 42.8571 }, + { 54.7619, 38.0952 }, + { 50, 38.0952 }, + { 35.7143, 42.8571 }, + { 26.1905, 52.381 }, + { 21.4286, 66.6667 }, + { 21.4286, 71.4286 }, + { 26.1905, 85.7143 }, + { 35.7143, 95.2381 }, + { 50, 100 }, + { 54.7619, 100 }, + { 69.0476, 95.2381 }, + { 78.5714, 85.7143 }, + { 83.3334, 66.6667 }, + { 83.3334, 42.8571 }, + { 78.5714, 19.0476 }, + { 69.0476, 4.7619 }, + { 54.7619, 0 }, + { 45.2381, 0 }, + { 30.9524, 4.7619 }, + { 26.1905, 14.2857 }, +}; + +static const StrokeRec char57[] = { + { 23, char57_stroke0 }, +}; + +/* char: 58 ':' */ + +static const CoordRec char58_stroke0[] = { + { 52.381, 66.6667 }, + { 47.6191, 61.9048 }, + { 52.381, 57.1429 }, + { 57.1429, 61.9048 }, + { 52.381, 66.6667 }, +}; + +static const CoordRec char58_stroke1[] = { + { 52.381, 9.5238 }, + { 47.6191, 4.7619 }, + { 52.381, 0 }, + { 57.1429, 4.7619 }, + { 52.381, 9.5238 }, +}; + +static const StrokeRec char58[] = { + { 5, char58_stroke0 }, + { 5, char58_stroke1 }, +}; + +/* char: 59 ';' */ + +static const CoordRec char59_stroke0[] = { + { 52.381, 66.6667 }, + { 47.6191, 61.9048 }, + { 52.381, 57.1429 }, + { 57.1429, 61.9048 }, + { 52.381, 66.6667 }, +}; + +static const CoordRec char59_stroke1[] = { + { 57.1429, 4.7619 }, + { 52.381, 0 }, + { 47.6191, 4.7619 }, + { 52.381, 9.5238 }, + { 57.1429, 4.7619 }, + { 57.1429, -4.7619 }, + { 52.381, -14.2857 }, + { 47.6191, -19.0476 }, +}; + +static const StrokeRec char59[] = { + { 5, char59_stroke0 }, + { 8, char59_stroke1 }, +}; + +/* char: 60 '<' */ + +static const CoordRec char60_stroke0[] = { + { 90.4762, 85.7143 }, + { 14.2857, 42.8571 }, + { 90.4762, 0 }, +}; + +static const StrokeRec char60[] = { + { 3, char60_stroke0 }, +}; + +/* char: 61 '=' */ + +static const CoordRec char61_stroke0[] = { + { 9.5238, 57.1429 }, + { 95.2381, 57.1429 }, +}; + +static const CoordRec char61_stroke1[] = { + { 9.5238, 28.5714 }, + { 95.2381, 28.5714 }, +}; + +static const StrokeRec char61[] = { + { 2, char61_stroke0 }, + { 2, char61_stroke1 }, +}; + +/* char: 62 '>' */ + +static const CoordRec char62_stroke0[] = { + { 14.2857, 85.7143 }, + { 90.4762, 42.8571 }, + { 14.2857, 0 }, +}; + +static const StrokeRec char62[] = { + { 3, char62_stroke0 }, +}; + +/* char: 63 '?' */ + +static const CoordRec char63_stroke0[] = { + { 23.8095, 76.1905 }, + { 23.8095, 80.9524 }, + { 28.5714, 90.4762 }, + { 33.3333, 95.2381 }, + { 42.8571, 100 }, + { 61.9047, 100 }, + { 71.4285, 95.2381 }, + { 76.1905, 90.4762 }, + { 80.9524, 80.9524 }, + { 80.9524, 71.4286 }, + { 76.1905, 61.9048 }, + { 71.4285, 57.1429 }, + { 52.3809, 47.619 }, + { 52.3809, 33.3333 }, +}; + +static const CoordRec char63_stroke1[] = { + { 52.3809, 9.5238 }, + { 47.619, 4.7619 }, + { 52.3809, 0 }, + { 57.1428, 4.7619 }, + { 52.3809, 9.5238 }, +}; + +static const StrokeRec char63[] = { + { 14, char63_stroke0 }, + { 5, char63_stroke1 }, +}; + +/* char: 64 '@' */ + +static const CoordRec char64_stroke0[] = { + { 64.2857, 52.381 }, + { 54.7619, 57.1429 }, + { 45.2381, 57.1429 }, + { 40.4762, 47.619 }, + { 40.4762, 42.8571 }, + { 45.2381, 33.3333 }, + { 54.7619, 33.3333 }, + { 64.2857, 38.0952 }, +}; + +static const CoordRec char64_stroke1[] = { + { 64.2857, 57.1429 }, + { 64.2857, 38.0952 }, + { 69.0476, 33.3333 }, + { 78.5714, 33.3333 }, + { 83.3334, 42.8571 }, + { 83.3334, 47.619 }, + { 78.5714, 61.9048 }, + { 69.0476, 71.4286 }, + { 54.7619, 76.1905 }, + { 50, 76.1905 }, + { 35.7143, 71.4286 }, + { 26.1905, 61.9048 }, + { 21.4286, 47.619 }, + { 21.4286, 42.8571 }, + { 26.1905, 28.5714 }, + { 35.7143, 19.0476 }, + { 50, 14.2857 }, + { 54.7619, 14.2857 }, + { 69.0476, 19.0476 }, +}; + +static const StrokeRec char64[] = { + { 8, char64_stroke0 }, + { 19, char64_stroke1 }, +}; + +/* char: 65 'A' */ + +static const CoordRec char65_stroke0[] = { + { 52.3809, 100 }, + { 14.2857, 0 }, +}; + +static const CoordRec char65_stroke1[] = { + { 52.3809, 100 }, + { 90.4762, 0 }, +}; + +static const CoordRec char65_stroke2[] = { + { 28.5714, 33.3333 }, + { 76.1905, 33.3333 }, +}; + +static const StrokeRec char65[] = { + { 2, char65_stroke0 }, + { 2, char65_stroke1 }, + { 2, char65_stroke2 }, +}; + +/* char: 66 'B' */ + +static const CoordRec char66_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char66_stroke1[] = { + { 19.0476, 100 }, + { 61.9047, 100 }, + { 76.1905, 95.2381 }, + { 80.9524, 90.4762 }, + { 85.7143, 80.9524 }, + { 85.7143, 71.4286 }, + { 80.9524, 61.9048 }, + { 76.1905, 57.1429 }, + { 61.9047, 52.381 }, +}; + +static const CoordRec char66_stroke2[] = { + { 19.0476, 52.381 }, + { 61.9047, 52.381 }, + { 76.1905, 47.619 }, + { 80.9524, 42.8571 }, + { 85.7143, 33.3333 }, + { 85.7143, 19.0476 }, + { 80.9524, 9.5238 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 19.0476, 0 }, +}; + +static const StrokeRec char66[] = { + { 2, char66_stroke0 }, + { 9, char66_stroke1 }, + { 10, char66_stroke2 }, +}; + +/* char: 67 'C' */ + +static const CoordRec char67_stroke0[] = { + { 88.0952, 76.1905 }, + { 83.3334, 85.7143 }, + { 73.8096, 95.2381 }, + { 64.2857, 100 }, + { 45.2381, 100 }, + { 35.7143, 95.2381 }, + { 26.1905, 85.7143 }, + { 21.4286, 76.1905 }, + { 16.6667, 61.9048 }, + { 16.6667, 38.0952 }, + { 21.4286, 23.8095 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 45.2381, 0 }, + { 64.2857, 0 }, + { 73.8096, 4.7619 }, + { 83.3334, 14.2857 }, + { 88.0952, 23.8095 }, +}; + +static const StrokeRec char67[] = { + { 18, char67_stroke0 }, +}; + +/* char: 68 'D' */ + +static const CoordRec char68_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char68_stroke1[] = { + { 19.0476, 100 }, + { 52.3809, 100 }, + { 66.6666, 95.2381 }, + { 76.1905, 85.7143 }, + { 80.9524, 76.1905 }, + { 85.7143, 61.9048 }, + { 85.7143, 38.0952 }, + { 80.9524, 23.8095 }, + { 76.1905, 14.2857 }, + { 66.6666, 4.7619 }, + { 52.3809, 0 }, + { 19.0476, 0 }, +}; + +static const StrokeRec char68[] = { + { 2, char68_stroke0 }, + { 12, char68_stroke1 }, +}; + +/* char: 69 'E' */ + +static const CoordRec char69_stroke0[] = { + { 21.4286, 100 }, + { 21.4286, 0 }, +}; + +static const CoordRec char69_stroke1[] = { + { 21.4286, 100 }, + { 83.3334, 100 }, +}; + +static const CoordRec char69_stroke2[] = { + { 21.4286, 52.381 }, + { 59.5238, 52.381 }, +}; + +static const CoordRec char69_stroke3[] = { + { 21.4286, 0 }, + { 83.3334, 0 }, +}; + +static const StrokeRec char69[] = { + { 2, char69_stroke0 }, + { 2, char69_stroke1 }, + { 2, char69_stroke2 }, + { 2, char69_stroke3 }, +}; + +/* char: 70 'F' */ + +static const CoordRec char70_stroke0[] = { + { 21.4286, 100 }, + { 21.4286, 0 }, +}; + +static const CoordRec char70_stroke1[] = { + { 21.4286, 100 }, + { 83.3334, 100 }, +}; + +static const CoordRec char70_stroke2[] = { + { 21.4286, 52.381 }, + { 59.5238, 52.381 }, +}; + +static const StrokeRec char70[] = { + { 2, char70_stroke0 }, + { 2, char70_stroke1 }, + { 2, char70_stroke2 }, +}; + +/* char: 71 'G' */ + +static const CoordRec char71_stroke0[] = { + { 88.0952, 76.1905 }, + { 83.3334, 85.7143 }, + { 73.8096, 95.2381 }, + { 64.2857, 100 }, + { 45.2381, 100 }, + { 35.7143, 95.2381 }, + { 26.1905, 85.7143 }, + { 21.4286, 76.1905 }, + { 16.6667, 61.9048 }, + { 16.6667, 38.0952 }, + { 21.4286, 23.8095 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 45.2381, 0 }, + { 64.2857, 0 }, + { 73.8096, 4.7619 }, + { 83.3334, 14.2857 }, + { 88.0952, 23.8095 }, + { 88.0952, 38.0952 }, +}; + +static const CoordRec char71_stroke1[] = { + { 64.2857, 38.0952 }, + { 88.0952, 38.0952 }, +}; + +static const StrokeRec char71[] = { + { 19, char71_stroke0 }, + { 2, char71_stroke1 }, +}; + +/* char: 72 'H' */ + +static const CoordRec char72_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char72_stroke1[] = { + { 85.7143, 100 }, + { 85.7143, 0 }, +}; + +static const CoordRec char72_stroke2[] = { + { 19.0476, 52.381 }, + { 85.7143, 52.381 }, +}; + +static const StrokeRec char72[] = { + { 2, char72_stroke0 }, + { 2, char72_stroke1 }, + { 2, char72_stroke2 }, +}; + +/* char: 73 'I' */ + +static const CoordRec char73_stroke0[] = { + { 52.381, 100 }, + { 52.381, 0 }, +}; + +static const StrokeRec char73[] = { + { 2, char73_stroke0 }, +}; + +/* char: 74 'J' */ + +static const CoordRec char74_stroke0[] = { + { 76.1905, 100 }, + { 76.1905, 23.8095 }, + { 71.4286, 9.5238 }, + { 66.6667, 4.7619 }, + { 57.1429, 0 }, + { 47.6191, 0 }, + { 38.0953, 4.7619 }, + { 33.3334, 9.5238 }, + { 28.5715, 23.8095 }, + { 28.5715, 33.3333 }, +}; + +static const StrokeRec char74[] = { + { 10, char74_stroke0 }, +}; + +/* char: 75 'K' */ + +static const CoordRec char75_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char75_stroke1[] = { + { 85.7143, 100 }, + { 19.0476, 33.3333 }, +}; + +static const CoordRec char75_stroke2[] = { + { 42.8571, 57.1429 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char75[] = { + { 2, char75_stroke0 }, + { 2, char75_stroke1 }, + { 2, char75_stroke2 }, +}; + +/* char: 76 'L' */ + +static const CoordRec char76_stroke0[] = { + { 23.8095, 100 }, + { 23.8095, 0 }, +}; + +static const CoordRec char76_stroke1[] = { + { 23.8095, 0 }, + { 80.9524, 0 }, +}; + +static const StrokeRec char76[] = { + { 2, char76_stroke0 }, + { 2, char76_stroke1 }, +}; + +/* char: 77 'M' */ + +static const CoordRec char77_stroke0[] = { + { 14.2857, 100 }, + { 14.2857, 0 }, +}; + +static const CoordRec char77_stroke1[] = { + { 14.2857, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char77_stroke2[] = { + { 90.4762, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char77_stroke3[] = { + { 90.4762, 100 }, + { 90.4762, 0 }, +}; + +static const StrokeRec char77[] = { + { 2, char77_stroke0 }, + { 2, char77_stroke1 }, + { 2, char77_stroke2 }, + { 2, char77_stroke3 }, +}; + +/* char: 78 'N' */ + +static const CoordRec char78_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char78_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 0 }, +}; + +static const CoordRec char78_stroke2[] = { + { 85.7143, 100 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char78[] = { + { 2, char78_stroke0 }, + { 2, char78_stroke1 }, + { 2, char78_stroke2 }, +}; + +/* char: 79 'O' */ + +static const CoordRec char79_stroke0[] = { + { 42.8571, 100 }, + { 33.3333, 95.2381 }, + { 23.8095, 85.7143 }, + { 19.0476, 76.1905 }, + { 14.2857, 61.9048 }, + { 14.2857, 38.0952 }, + { 19.0476, 23.8095 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 42.8571, 0 }, + { 61.9047, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 23.8095 }, + { 90.4762, 38.0952 }, + { 90.4762, 61.9048 }, + { 85.7143, 76.1905 }, + { 80.9524, 85.7143 }, + { 71.4286, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, +}; + +static const StrokeRec char79[] = { + { 21, char79_stroke0 }, +}; + +/* char: 80 'P' */ + +static const CoordRec char80_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char80_stroke1[] = { + { 19.0476, 100 }, + { 61.9047, 100 }, + { 76.1905, 95.2381 }, + { 80.9524, 90.4762 }, + { 85.7143, 80.9524 }, + { 85.7143, 66.6667 }, + { 80.9524, 57.1429 }, + { 76.1905, 52.381 }, + { 61.9047, 47.619 }, + { 19.0476, 47.619 }, +}; + +static const StrokeRec char80[] = { + { 2, char80_stroke0 }, + { 10, char80_stroke1 }, +}; + +/* char: 81 'Q' */ + +static const CoordRec char81_stroke0[] = { + { 42.8571, 100 }, + { 33.3333, 95.2381 }, + { 23.8095, 85.7143 }, + { 19.0476, 76.1905 }, + { 14.2857, 61.9048 }, + { 14.2857, 38.0952 }, + { 19.0476, 23.8095 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 42.8571, 0 }, + { 61.9047, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 23.8095 }, + { 90.4762, 38.0952 }, + { 90.4762, 61.9048 }, + { 85.7143, 76.1905 }, + { 80.9524, 85.7143 }, + { 71.4286, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, +}; + +static const CoordRec char81_stroke1[] = { + { 57.1428, 19.0476 }, + { 85.7143, -9.5238 }, +}; + +static const StrokeRec char81[] = { + { 21, char81_stroke0 }, + { 2, char81_stroke1 }, +}; + +/* char: 82 'R' */ + +static const CoordRec char82_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char82_stroke1[] = { + { 19.0476, 100 }, + { 61.9047, 100 }, + { 76.1905, 95.2381 }, + { 80.9524, 90.4762 }, + { 85.7143, 80.9524 }, + { 85.7143, 71.4286 }, + { 80.9524, 61.9048 }, + { 76.1905, 57.1429 }, + { 61.9047, 52.381 }, + { 19.0476, 52.381 }, +}; + +static const CoordRec char82_stroke2[] = { + { 52.3809, 52.381 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char82[] = { + { 2, char82_stroke0 }, + { 10, char82_stroke1 }, + { 2, char82_stroke2 }, +}; + +/* char: 83 'S' */ + +static const CoordRec char83_stroke0[] = { + { 85.7143, 85.7143 }, + { 76.1905, 95.2381 }, + { 61.9047, 100 }, + { 42.8571, 100 }, + { 28.5714, 95.2381 }, + { 19.0476, 85.7143 }, + { 19.0476, 76.1905 }, + { 23.8095, 66.6667 }, + { 28.5714, 61.9048 }, + { 38.0952, 57.1429 }, + { 66.6666, 47.619 }, + { 76.1905, 42.8571 }, + { 80.9524, 38.0952 }, + { 85.7143, 28.5714 }, + { 85.7143, 14.2857 }, + { 76.1905, 4.7619 }, + { 61.9047, 0 }, + { 42.8571, 0 }, + { 28.5714, 4.7619 }, + { 19.0476, 14.2857 }, +}; + +static const StrokeRec char83[] = { + { 20, char83_stroke0 }, +}; + +/* char: 84 'T' */ + +static const CoordRec char84_stroke0[] = { + { 52.3809, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char84_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char84[] = { + { 2, char84_stroke0 }, + { 2, char84_stroke1 }, +}; + +/* char: 85 'U' */ + +static const CoordRec char85_stroke0[] = { + { 19.0476, 100 }, + { 19.0476, 28.5714 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 47.619, 0 }, + { 57.1428, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 28.5714 }, + { 85.7143, 100 }, +}; + +static const StrokeRec char85[] = { + { 10, char85_stroke0 }, +}; + +/* char: 86 'V' */ + +static const CoordRec char86_stroke0[] = { + { 14.2857, 100 }, + { 52.3809, 0 }, +}; + +static const CoordRec char86_stroke1[] = { + { 90.4762, 100 }, + { 52.3809, 0 }, +}; + +static const StrokeRec char86[] = { + { 2, char86_stroke0 }, + { 2, char86_stroke1 }, +}; + +/* char: 87 'W' */ + +static const CoordRec char87_stroke0[] = { + { 4.7619, 100 }, + { 28.5714, 0 }, +}; + +static const CoordRec char87_stroke1[] = { + { 52.3809, 100 }, + { 28.5714, 0 }, +}; + +static const CoordRec char87_stroke2[] = { + { 52.3809, 100 }, + { 76.1905, 0 }, +}; + +static const CoordRec char87_stroke3[] = { + { 100, 100 }, + { 76.1905, 0 }, +}; + +static const StrokeRec char87[] = { + { 2, char87_stroke0 }, + { 2, char87_stroke1 }, + { 2, char87_stroke2 }, + { 2, char87_stroke3 }, +}; + +/* char: 88 'X' */ + +static const CoordRec char88_stroke0[] = { + { 19.0476, 100 }, + { 85.7143, 0 }, +}; + +static const CoordRec char88_stroke1[] = { + { 85.7143, 100 }, + { 19.0476, 0 }, +}; + +static const StrokeRec char88[] = { + { 2, char88_stroke0 }, + { 2, char88_stroke1 }, +}; + +/* char: 89 'Y' */ + +static const CoordRec char89_stroke0[] = { + { 14.2857, 100 }, + { 52.3809, 52.381 }, + { 52.3809, 0 }, +}; + +static const CoordRec char89_stroke1[] = { + { 90.4762, 100 }, + { 52.3809, 52.381 }, +}; + +static const StrokeRec char89[] = { + { 3, char89_stroke0 }, + { 2, char89_stroke1 }, +}; + +/* char: 90 'Z' */ + +static const CoordRec char90_stroke0[] = { + { 85.7143, 100 }, + { 19.0476, 0 }, +}; + +static const CoordRec char90_stroke1[] = { + { 19.0476, 100 }, + { 85.7143, 100 }, +}; + +static const CoordRec char90_stroke2[] = { + { 19.0476, 0 }, + { 85.7143, 0 }, +}; + +static const StrokeRec char90[] = { + { 2, char90_stroke0 }, + { 2, char90_stroke1 }, + { 2, char90_stroke2 }, +}; + +/* char: 91 '[' */ + +static const CoordRec char91_stroke0[] = { + { 35.7143, 119.048 }, + { 35.7143, -33.3333 }, +}; + +static const CoordRec char91_stroke1[] = { + { 40.4762, 119.048 }, + { 40.4762, -33.3333 }, +}; + +static const CoordRec char91_stroke2[] = { + { 35.7143, 119.048 }, + { 69.0476, 119.048 }, +}; + +static const CoordRec char91_stroke3[] = { + { 35.7143, -33.3333 }, + { 69.0476, -33.3333 }, +}; + +static const StrokeRec char91[] = { + { 2, char91_stroke0 }, + { 2, char91_stroke1 }, + { 2, char91_stroke2 }, + { 2, char91_stroke3 }, +}; + +/* char: 92 '\' */ + +static const CoordRec char92_stroke0[] = { + { 19.0476, 100 }, + { 85.7143, -14.2857 }, +}; + +static const StrokeRec char92[] = { + { 2, char92_stroke0 }, +}; + +/* char: 93 ']' */ + +static const CoordRec char93_stroke0[] = { + { 64.2857, 119.048 }, + { 64.2857, -33.3333 }, +}; + +static const CoordRec char93_stroke1[] = { + { 69.0476, 119.048 }, + { 69.0476, -33.3333 }, +}; + +static const CoordRec char93_stroke2[] = { + { 35.7143, 119.048 }, + { 69.0476, 119.048 }, +}; + +static const CoordRec char93_stroke3[] = { + { 35.7143, -33.3333 }, + { 69.0476, -33.3333 }, +}; + +static const StrokeRec char93[] = { + { 2, char93_stroke0 }, + { 2, char93_stroke1 }, + { 2, char93_stroke2 }, + { 2, char93_stroke3 }, +}; + +/* char: 94 '^' */ + +static const CoordRec char94_stroke0[] = { + { 52.3809, 109.524 }, + { 14.2857, 42.8571 }, +}; + +static const CoordRec char94_stroke1[] = { + { 52.3809, 109.524 }, + { 90.4762, 42.8571 }, +}; + +static const StrokeRec char94[] = { + { 2, char94_stroke0 }, + { 2, char94_stroke1 }, +}; + +/* char: 95 '_' */ + +static const CoordRec char95_stroke0[] = { + { 0, -33.3333 }, + { 104.762, -33.3333 }, + { 104.762, -28.5714 }, + { 0, -28.5714 }, + { 0, -33.3333 }, +}; + +static const StrokeRec char95[] = { + { 5, char95_stroke0 }, +}; + +/* char: 96 '`' */ + +static const CoordRec char96_stroke0[] = { + { 42.8572, 100 }, + { 66.6667, 71.4286 }, +}; + +static const CoordRec char96_stroke1[] = { + { 42.8572, 100 }, + { 38.0953, 95.2381 }, + { 66.6667, 71.4286 }, +}; + +static const StrokeRec char96[] = { + { 2, char96_stroke0 }, + { 3, char96_stroke1 }, +}; + +/* char: 97 'a' */ + +static const CoordRec char97_stroke0[] = { + { 80.9524, 66.6667 }, + { 80.9524, 0 }, +}; + +static const CoordRec char97_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char97[] = { + { 2, char97_stroke0 }, + { 14, char97_stroke1 }, +}; + +/* char: 98 'b' */ + +static const CoordRec char98_stroke0[] = { + { 23.8095, 100 }, + { 23.8095, 0 }, +}; + +static const CoordRec char98_stroke1[] = { + { 23.8095, 52.381 }, + { 33.3333, 61.9048 }, + { 42.8571, 66.6667 }, + { 57.1428, 66.6667 }, + { 66.6666, 61.9048 }, + { 76.1905, 52.381 }, + { 80.9524, 38.0952 }, + { 80.9524, 28.5714 }, + { 76.1905, 14.2857 }, + { 66.6666, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 33.3333, 4.7619 }, + { 23.8095, 14.2857 }, +}; + +static const StrokeRec char98[] = { + { 2, char98_stroke0 }, + { 14, char98_stroke1 }, +}; + +/* char: 99 'c' */ + +static const CoordRec char99_stroke0[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char99[] = { + { 14, char99_stroke0 }, +}; + +/* char: 100 'd' */ + +static const CoordRec char100_stroke0[] = { + { 80.9524, 100 }, + { 80.9524, 0 }, +}; + +static const CoordRec char100_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char100[] = { + { 2, char100_stroke0 }, + { 14, char100_stroke1 }, +}; + +/* char: 101 'e' */ + +static const CoordRec char101_stroke0[] = { + { 23.8095, 38.0952 }, + { 80.9524, 38.0952 }, + { 80.9524, 47.619 }, + { 76.1905, 57.1429 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char101[] = { + { 17, char101_stroke0 }, +}; + +/* char: 102 'f' */ + +static const CoordRec char102_stroke0[] = { + { 71.4286, 100 }, + { 61.9048, 100 }, + { 52.381, 95.2381 }, + { 47.6191, 80.9524 }, + { 47.6191, 0 }, +}; + +static const CoordRec char102_stroke1[] = { + { 33.3334, 66.6667 }, + { 66.6667, 66.6667 }, +}; + +static const StrokeRec char102[] = { + { 5, char102_stroke0 }, + { 2, char102_stroke1 }, +}; + +/* char: 103 'g' */ + +static const CoordRec char103_stroke0[] = { + { 80.9524, 66.6667 }, + { 80.9524, -9.5238 }, + { 76.1905, -23.8095 }, + { 71.4285, -28.5714 }, + { 61.9047, -33.3333 }, + { 47.619, -33.3333 }, + { 38.0952, -28.5714 }, +}; + +static const CoordRec char103_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char103[] = { + { 7, char103_stroke0 }, + { 14, char103_stroke1 }, +}; + +/* char: 104 'h' */ + +static const CoordRec char104_stroke0[] = { + { 26.1905, 100 }, + { 26.1905, 0 }, +}; + +static const CoordRec char104_stroke1[] = { + { 26.1905, 47.619 }, + { 40.4762, 61.9048 }, + { 50, 66.6667 }, + { 64.2857, 66.6667 }, + { 73.8095, 61.9048 }, + { 78.5715, 47.619 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char104[] = { + { 2, char104_stroke0 }, + { 7, char104_stroke1 }, +}; + +/* char: 105 'i' */ + +static const CoordRec char105_stroke0[] = { + { 47.6191, 100 }, + { 52.381, 95.2381 }, + { 57.1429, 100 }, + { 52.381, 104.762 }, + { 47.6191, 100 }, +}; + +static const CoordRec char105_stroke1[] = { + { 52.381, 66.6667 }, + { 52.381, 0 }, +}; + +static const StrokeRec char105[] = { + { 5, char105_stroke0 }, + { 2, char105_stroke1 }, +}; + +/* char: 106 'j' */ + +static const CoordRec char106_stroke0[] = { + { 57.1429, 100 }, + { 61.9048, 95.2381 }, + { 66.6667, 100 }, + { 61.9048, 104.762 }, + { 57.1429, 100 }, +}; + +static const CoordRec char106_stroke1[] = { + { 61.9048, 66.6667 }, + { 61.9048, -14.2857 }, + { 57.1429, -28.5714 }, + { 47.6191, -33.3333 }, + { 38.0953, -33.3333 }, +}; + +static const StrokeRec char106[] = { + { 5, char106_stroke0 }, + { 5, char106_stroke1 }, +}; + +/* char: 107 'k' */ + +static const CoordRec char107_stroke0[] = { + { 26.1905, 100 }, + { 26.1905, 0 }, +}; + +static const CoordRec char107_stroke1[] = { + { 73.8095, 66.6667 }, + { 26.1905, 19.0476 }, +}; + +static const CoordRec char107_stroke2[] = { + { 45.2381, 38.0952 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char107[] = { + { 2, char107_stroke0 }, + { 2, char107_stroke1 }, + { 2, char107_stroke2 }, +}; + +/* char: 108 'l' */ + +static const CoordRec char108_stroke0[] = { + { 52.381, 100 }, + { 52.381, 0 }, +}; + +static const StrokeRec char108[] = { + { 2, char108_stroke0 }, +}; + +/* char: 109 'm' */ + +static const CoordRec char109_stroke0[] = { + { 0, 66.6667 }, + { 0, 0 }, +}; + +static const CoordRec char109_stroke1[] = { + { 0, 47.619 }, + { 14.2857, 61.9048 }, + { 23.8095, 66.6667 }, + { 38.0952, 66.6667 }, + { 47.619, 61.9048 }, + { 52.381, 47.619 }, + { 52.381, 0 }, +}; + +static const CoordRec char109_stroke2[] = { + { 52.381, 47.619 }, + { 66.6667, 61.9048 }, + { 76.1905, 66.6667 }, + { 90.4762, 66.6667 }, + { 100, 61.9048 }, + { 104.762, 47.619 }, + { 104.762, 0 }, +}; + +static const StrokeRec char109[] = { + { 2, char109_stroke0 }, + { 7, char109_stroke1 }, + { 7, char109_stroke2 }, +}; + +/* char: 110 'n' */ + +static const CoordRec char110_stroke0[] = { + { 26.1905, 66.6667 }, + { 26.1905, 0 }, +}; + +static const CoordRec char110_stroke1[] = { + { 26.1905, 47.619 }, + { 40.4762, 61.9048 }, + { 50, 66.6667 }, + { 64.2857, 66.6667 }, + { 73.8095, 61.9048 }, + { 78.5715, 47.619 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char110[] = { + { 2, char110_stroke0 }, + { 7, char110_stroke1 }, +}; + +/* char: 111 'o' */ + +static const CoordRec char111_stroke0[] = { + { 45.2381, 66.6667 }, + { 35.7143, 61.9048 }, + { 26.1905, 52.381 }, + { 21.4286, 38.0952 }, + { 21.4286, 28.5714 }, + { 26.1905, 14.2857 }, + { 35.7143, 4.7619 }, + { 45.2381, 0 }, + { 59.5238, 0 }, + { 69.0476, 4.7619 }, + { 78.5714, 14.2857 }, + { 83.3334, 28.5714 }, + { 83.3334, 38.0952 }, + { 78.5714, 52.381 }, + { 69.0476, 61.9048 }, + { 59.5238, 66.6667 }, + { 45.2381, 66.6667 }, +}; + +static const StrokeRec char111[] = { + { 17, char111_stroke0 }, +}; + +/* char: 112 'p' */ + +static const CoordRec char112_stroke0[] = { + { 23.8095, 66.6667 }, + { 23.8095, -33.3333 }, +}; + +static const CoordRec char112_stroke1[] = { + { 23.8095, 52.381 }, + { 33.3333, 61.9048 }, + { 42.8571, 66.6667 }, + { 57.1428, 66.6667 }, + { 66.6666, 61.9048 }, + { 76.1905, 52.381 }, + { 80.9524, 38.0952 }, + { 80.9524, 28.5714 }, + { 76.1905, 14.2857 }, + { 66.6666, 4.7619 }, + { 57.1428, 0 }, + { 42.8571, 0 }, + { 33.3333, 4.7619 }, + { 23.8095, 14.2857 }, +}; + +static const StrokeRec char112[] = { + { 2, char112_stroke0 }, + { 14, char112_stroke1 }, +}; + +/* char: 113 'q' */ + +static const CoordRec char113_stroke0[] = { + { 80.9524, 66.6667 }, + { 80.9524, -33.3333 }, +}; + +static const CoordRec char113_stroke1[] = { + { 80.9524, 52.381 }, + { 71.4285, 61.9048 }, + { 61.9047, 66.6667 }, + { 47.619, 66.6667 }, + { 38.0952, 61.9048 }, + { 28.5714, 52.381 }, + { 23.8095, 38.0952 }, + { 23.8095, 28.5714 }, + { 28.5714, 14.2857 }, + { 38.0952, 4.7619 }, + { 47.619, 0 }, + { 61.9047, 0 }, + { 71.4285, 4.7619 }, + { 80.9524, 14.2857 }, +}; + +static const StrokeRec char113[] = { + { 2, char113_stroke0 }, + { 14, char113_stroke1 }, +}; + +/* char: 114 'r' */ + +static const CoordRec char114_stroke0[] = { + { 33.3334, 66.6667 }, + { 33.3334, 0 }, +}; + +static const CoordRec char114_stroke1[] = { + { 33.3334, 38.0952 }, + { 38.0953, 52.381 }, + { 47.6191, 61.9048 }, + { 57.1429, 66.6667 }, + { 71.4286, 66.6667 }, +}; + +static const StrokeRec char114[] = { + { 2, char114_stroke0 }, + { 5, char114_stroke1 }, +}; + +/* char: 115 's' */ + +static const CoordRec char115_stroke0[] = { + { 78.5715, 52.381 }, + { 73.8095, 61.9048 }, + { 59.5238, 66.6667 }, + { 45.2381, 66.6667 }, + { 30.9524, 61.9048 }, + { 26.1905, 52.381 }, + { 30.9524, 42.8571 }, + { 40.4762, 38.0952 }, + { 64.2857, 33.3333 }, + { 73.8095, 28.5714 }, + { 78.5715, 19.0476 }, + { 78.5715, 14.2857 }, + { 73.8095, 4.7619 }, + { 59.5238, 0 }, + { 45.2381, 0 }, + { 30.9524, 4.7619 }, + { 26.1905, 14.2857 }, +}; + +static const StrokeRec char115[] = { + { 17, char115_stroke0 }, +}; + +/* char: 116 't' */ + +static const CoordRec char116_stroke0[] = { + { 47.6191, 100 }, + { 47.6191, 19.0476 }, + { 52.381, 4.7619 }, + { 61.9048, 0 }, + { 71.4286, 0 }, +}; + +static const CoordRec char116_stroke1[] = { + { 33.3334, 66.6667 }, + { 66.6667, 66.6667 }, +}; + +static const StrokeRec char116[] = { + { 5, char116_stroke0 }, + { 2, char116_stroke1 }, +}; + +/* char: 117 'u' */ + +static const CoordRec char117_stroke0[] = { + { 26.1905, 66.6667 }, + { 26.1905, 19.0476 }, + { 30.9524, 4.7619 }, + { 40.4762, 0 }, + { 54.7619, 0 }, + { 64.2857, 4.7619 }, + { 78.5715, 19.0476 }, +}; + +static const CoordRec char117_stroke1[] = { + { 78.5715, 66.6667 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char117[] = { + { 7, char117_stroke0 }, + { 2, char117_stroke1 }, +}; + +/* char: 118 'v' */ + +static const CoordRec char118_stroke0[] = { + { 23.8095, 66.6667 }, + { 52.3809, 0 }, +}; + +static const CoordRec char118_stroke1[] = { + { 80.9524, 66.6667 }, + { 52.3809, 0 }, +}; + +static const StrokeRec char118[] = { + { 2, char118_stroke0 }, + { 2, char118_stroke1 }, +}; + +/* char: 119 'w' */ + +static const CoordRec char119_stroke0[] = { + { 14.2857, 66.6667 }, + { 33.3333, 0 }, +}; + +static const CoordRec char119_stroke1[] = { + { 52.3809, 66.6667 }, + { 33.3333, 0 }, +}; + +static const CoordRec char119_stroke2[] = { + { 52.3809, 66.6667 }, + { 71.4286, 0 }, +}; + +static const CoordRec char119_stroke3[] = { + { 90.4762, 66.6667 }, + { 71.4286, 0 }, +}; + +static const StrokeRec char119[] = { + { 2, char119_stroke0 }, + { 2, char119_stroke1 }, + { 2, char119_stroke2 }, + { 2, char119_stroke3 }, +}; + +/* char: 120 'x' */ + +static const CoordRec char120_stroke0[] = { + { 26.1905, 66.6667 }, + { 78.5715, 0 }, +}; + +static const CoordRec char120_stroke1[] = { + { 78.5715, 66.6667 }, + { 26.1905, 0 }, +}; + +static const StrokeRec char120[] = { + { 2, char120_stroke0 }, + { 2, char120_stroke1 }, +}; + +/* char: 121 'y' */ + +static const CoordRec char121_stroke0[] = { + { 26.1905, 66.6667 }, + { 54.7619, 0 }, +}; + +static const CoordRec char121_stroke1[] = { + { 83.3334, 66.6667 }, + { 54.7619, 0 }, + { 45.2381, -19.0476 }, + { 35.7143, -28.5714 }, + { 26.1905, -33.3333 }, + { 21.4286, -33.3333 }, +}; + +static const StrokeRec char121[] = { + { 2, char121_stroke0 }, + { 6, char121_stroke1 }, +}; + +/* char: 122 'z' */ + +static const CoordRec char122_stroke0[] = { + { 78.5715, 66.6667 }, + { 26.1905, 0 }, +}; + +static const CoordRec char122_stroke1[] = { + { 26.1905, 66.6667 }, + { 78.5715, 66.6667 }, +}; + +static const CoordRec char122_stroke2[] = { + { 26.1905, 0 }, + { 78.5715, 0 }, +}; + +static const StrokeRec char122[] = { + { 2, char122_stroke0 }, + { 2, char122_stroke1 }, + { 2, char122_stroke2 }, +}; + +/* char: 123 '{' */ + +static const CoordRec char123_stroke0[] = { + { 64.2857, 119.048 }, + { 54.7619, 114.286 }, + { 50, 109.524 }, + { 45.2381, 100 }, + { 45.2381, 90.4762 }, + { 50, 80.9524 }, + { 54.7619, 76.1905 }, + { 59.5238, 66.6667 }, + { 59.5238, 57.1429 }, + { 50, 47.619 }, +}; + +static const CoordRec char123_stroke1[] = { + { 54.7619, 114.286 }, + { 50, 104.762 }, + { 50, 95.2381 }, + { 54.7619, 85.7143 }, + { 59.5238, 80.9524 }, + { 64.2857, 71.4286 }, + { 64.2857, 61.9048 }, + { 59.5238, 52.381 }, + { 40.4762, 42.8571 }, + { 59.5238, 33.3333 }, + { 64.2857, 23.8095 }, + { 64.2857, 14.2857 }, + { 59.5238, 4.7619 }, + { 54.7619, 0 }, + { 50, -9.5238 }, + { 50, -19.0476 }, + { 54.7619, -28.5714 }, +}; + +static const CoordRec char123_stroke2[] = { + { 50, 38.0952 }, + { 59.5238, 28.5714 }, + { 59.5238, 19.0476 }, + { 54.7619, 9.5238 }, + { 50, 4.7619 }, + { 45.2381, -4.7619 }, + { 45.2381, -14.2857 }, + { 50, -23.8095 }, + { 54.7619, -28.5714 }, + { 64.2857, -33.3333 }, +}; + +static const StrokeRec char123[] = { + { 10, char123_stroke0 }, + { 17, char123_stroke1 }, + { 10, char123_stroke2 }, +}; + +/* char: 124 '|' */ + +static const CoordRec char124_stroke0[] = { + { 52.381, 119.048 }, + { 52.381, -33.3333 }, +}; + +static const StrokeRec char124[] = { + { 2, char124_stroke0 }, +}; + +/* char: 125 '}' */ + +static const CoordRec char125_stroke0[] = { + { 40.4762, 119.048 }, + { 50, 114.286 }, + { 54.7619, 109.524 }, + { 59.5238, 100 }, + { 59.5238, 90.4762 }, + { 54.7619, 80.9524 }, + { 50, 76.1905 }, + { 45.2381, 66.6667 }, + { 45.2381, 57.1429 }, + { 54.7619, 47.619 }, +}; + +static const CoordRec char125_stroke1[] = { + { 50, 114.286 }, + { 54.7619, 104.762 }, + { 54.7619, 95.2381 }, + { 50, 85.7143 }, + { 45.2381, 80.9524 }, + { 40.4762, 71.4286 }, + { 40.4762, 61.9048 }, + { 45.2381, 52.381 }, + { 64.2857, 42.8571 }, + { 45.2381, 33.3333 }, + { 40.4762, 23.8095 }, + { 40.4762, 14.2857 }, + { 45.2381, 4.7619 }, + { 50, 0 }, + { 54.7619, -9.5238 }, + { 54.7619, -19.0476 }, + { 50, -28.5714 }, +}; + +static const CoordRec char125_stroke2[] = { + { 54.7619, 38.0952 }, + { 45.2381, 28.5714 }, + { 45.2381, 19.0476 }, + { 50, 9.5238 }, + { 54.7619, 4.7619 }, + { 59.5238, -4.7619 }, + { 59.5238, -14.2857 }, + { 54.7619, -23.8095 }, + { 50, -28.5714 }, + { 40.4762, -33.3333 }, +}; + +static const StrokeRec char125[] = { + { 10, char125_stroke0 }, + { 17, char125_stroke1 }, + { 10, char125_stroke2 }, +}; + +/* char: 126 '~' */ + +static const CoordRec char126_stroke0[] = { + { 9.5238, 28.5714 }, + { 9.5238, 38.0952 }, + { 14.2857, 52.381 }, + { 23.8095, 57.1429 }, + { 33.3333, 57.1429 }, + { 42.8571, 52.381 }, + { 61.9048, 38.0952 }, + { 71.4286, 33.3333 }, + { 80.9524, 33.3333 }, + { 90.4762, 38.0952 }, + { 95.2381, 47.619 }, +}; + +static const CoordRec char126_stroke1[] = { + { 9.5238, 38.0952 }, + { 14.2857, 47.619 }, + { 23.8095, 52.381 }, + { 33.3333, 52.381 }, + { 42.8571, 47.619 }, + { 61.9048, 33.3333 }, + { 71.4286, 28.5714 }, + { 80.9524, 28.5714 }, + { 90.4762, 33.3333 }, + { 95.2381, 47.619 }, + { 95.2381, 57.1429 }, +}; + +static const StrokeRec char126[] = { + { 11, char126_stroke0 }, + { 11, char126_stroke1 }, +}; + +/* char: 127 */ + +static const CoordRec char127_stroke0[] = { + { 71.4286, 100 }, + { 33.3333, -33.3333 }, +}; + +static const CoordRec char127_stroke1[] = { + { 47.619, 66.6667 }, + { 33.3333, 61.9048 }, + { 23.8095, 52.381 }, + { 19.0476, 38.0952 }, + { 19.0476, 23.8095 }, + { 23.8095, 14.2857 }, + { 33.3333, 4.7619 }, + { 47.619, 0 }, + { 57.1428, 0 }, + { 71.4286, 4.7619 }, + { 80.9524, 14.2857 }, + { 85.7143, 28.5714 }, + { 85.7143, 42.8571 }, + { 80.9524, 52.381 }, + { 71.4286, 61.9048 }, + { 57.1428, 66.6667 }, + { 47.619, 66.6667 }, +}; + +static const StrokeRec char127[] = { + { 2, char127_stroke0 }, + { 17, char127_stroke1 }, +}; + +static const StrokeCharRec chars[] = { + { 0, /* char0 */ 0, 0, 0 }, + { 0, /* char1 */ 0, 0, 0 }, + { 0, /* char2 */ 0, 0, 0 }, + { 0, /* char3 */ 0, 0, 0 }, + { 0, /* char4 */ 0, 0, 0 }, + { 0, /* char5 */ 0, 0, 0 }, + { 0, /* char6 */ 0, 0, 0 }, + { 0, /* char7 */ 0, 0, 0 }, + { 0, /* char8 */ 0, 0, 0 }, + { 0, /* char9 */ 0, 0, 0 }, + { 0, /* char10 */ 0, 0, 0 }, + { 0, /* char11 */ 0, 0, 0 }, + { 0, /* char12 */ 0, 0, 0 }, + { 0, /* char13 */ 0, 0, 0 }, + { 0, /* char14 */ 0, 0, 0 }, + { 0, /* char15 */ 0, 0, 0 }, + { 0, /* char16 */ 0, 0, 0 }, + { 0, /* char17 */ 0, 0, 0 }, + { 0, /* char18 */ 0, 0, 0 }, + { 0, /* char19 */ 0, 0, 0 }, + { 0, /* char20 */ 0, 0, 0 }, + { 0, /* char21 */ 0, 0, 0 }, + { 0, /* char22 */ 0, 0, 0 }, + { 0, /* char23 */ 0, 0, 0 }, + { 0, /* char24 */ 0, 0, 0 }, + { 0, /* char25 */ 0, 0, 0 }, + { 0, /* char26 */ 0, 0, 0 }, + { 0, /* char27 */ 0, 0, 0 }, + { 0, /* char28 */ 0, 0, 0 }, + { 0, /* char29 */ 0, 0, 0 }, + { 0, /* char30 */ 0, 0, 0 }, + { 0, /* char31 */ 0, 0, 0 }, + { 0, /* char32 */ 0, 52.381, 104.762 }, + { 2, char33, 52.381, 104.762 }, + { 2, char34, 52.381, 104.762 }, + { 4, char35, 52.381, 104.762 }, + { 3, char36, 52.381, 104.762 }, + { 3, char37, 52.381, 104.762 }, + { 1, char38, 52.381, 104.762 }, + { 1, char39, 52.381, 104.762 }, + { 1, char40, 52.381, 104.762 }, + { 1, char41, 52.381, 104.762 }, + { 3, char42, 52.381, 104.762 }, + { 2, char43, 52.381, 104.762 }, + { 1, char44, 52.381, 104.762 }, + { 1, char45, 52.381, 104.762 }, + { 1, char46, 52.381, 104.762 }, + { 1, char47, 52.381, 104.762 }, + { 1, char48, 52.381, 104.762 }, + { 1, char49, 52.381, 104.762 }, + { 1, char50, 52.381, 104.762 }, + { 1, char51, 52.381, 104.762 }, + { 2, char52, 52.381, 104.762 }, + { 1, char53, 52.381, 104.762 }, + { 1, char54, 52.381, 104.762 }, + { 2, char55, 52.381, 104.762 }, + { 1, char56, 52.381, 104.762 }, + { 1, char57, 52.381, 104.762 }, + { 2, char58, 52.381, 104.762 }, + { 2, char59, 52.381, 104.762 }, + { 1, char60, 52.381, 104.762 }, + { 2, char61, 52.381, 104.762 }, + { 1, char62, 52.381, 104.762 }, + { 2, char63, 52.381, 104.762 }, + { 2, char64, 52.381, 104.762 }, + { 3, char65, 52.381, 104.762 }, + { 3, char66, 52.381, 104.762 }, + { 1, char67, 52.381, 104.762 }, + { 2, char68, 52.381, 104.762 }, + { 4, char69, 52.381, 104.762 }, + { 3, char70, 52.381, 104.762 }, + { 2, char71, 52.381, 104.762 }, + { 3, char72, 52.381, 104.762 }, + { 1, char73, 52.381, 104.762 }, + { 1, char74, 52.381, 104.762 }, + { 3, char75, 52.381, 104.762 }, + { 2, char76, 52.381, 104.762 }, + { 4, char77, 52.381, 104.762 }, + { 3, char78, 52.381, 104.762 }, + { 1, char79, 52.381, 104.762 }, + { 2, char80, 52.381, 104.762 }, + { 2, char81, 52.381, 104.762 }, + { 3, char82, 52.381, 104.762 }, + { 1, char83, 52.381, 104.762 }, + { 2, char84, 52.381, 104.762 }, + { 1, char85, 52.381, 104.762 }, + { 2, char86, 52.381, 104.762 }, + { 4, char87, 52.381, 104.762 }, + { 2, char88, 52.381, 104.762 }, + { 2, char89, 52.381, 104.762 }, + { 3, char90, 52.381, 104.762 }, + { 4, char91, 52.381, 104.762 }, + { 1, char92, 52.381, 104.762 }, + { 4, char93, 52.381, 104.762 }, + { 2, char94, 52.381, 104.762 }, + { 1, char95, 52.381, 104.762 }, + { 2, char96, 52.381, 104.762 }, + { 2, char97, 52.381, 104.762 }, + { 2, char98, 52.381, 104.762 }, + { 1, char99, 52.381, 104.762 }, + { 2, char100, 52.381, 104.762 }, + { 1, char101, 52.381, 104.762 }, + { 2, char102, 52.381, 104.762 }, + { 2, char103, 52.381, 104.762 }, + { 2, char104, 52.381, 104.762 }, + { 2, char105, 52.381, 104.762 }, + { 2, char106, 52.381, 104.762 }, + { 3, char107, 52.381, 104.762 }, + { 1, char108, 52.381, 104.762 }, + { 3, char109, 52.381, 104.762 }, + { 2, char110, 52.381, 104.762 }, + { 1, char111, 52.381, 104.762 }, + { 2, char112, 52.381, 104.762 }, + { 2, char113, 52.381, 104.762 }, + { 2, char114, 52.381, 104.762 }, + { 1, char115, 52.381, 104.762 }, + { 2, char116, 52.381, 104.762 }, + { 2, char117, 52.381, 104.762 }, + { 2, char118, 52.381, 104.762 }, + { 4, char119, 52.381, 104.762 }, + { 2, char120, 52.381, 104.762 }, + { 2, char121, 52.381, 104.762 }, + { 3, char122, 52.381, 104.762 }, + { 3, char123, 52.381, 104.762 }, + { 1, char124, 52.381, 104.762 }, + { 3, char125, 52.381, 104.762 }, + { 2, char126, 52.381, 104.762 }, + { 2, char127, 52.381, 104.762 }, +}; + +StrokeFontRec glutStrokeMonoRoman = { "Roman", 128, chars, 119.048, -33.3333 }; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_overlay.c xpsb-glx-0.19/mesa/src/glut/glx/glut_overlay.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_overlay.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_overlay.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,607 @@ + +/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include + +#if !defined(_WIN32) +#include +#include +#include /* for XA_RGB_DEFAULT_MAP atom */ +#if defined (__vms) +#include /* for XmuLookupStandardColormap */ +#else +#include /* for XmuLookupStandardColormap */ +#endif +#endif /* !_WIN32 */ + +#include "glutint.h" +#include "layerutil.h" + +static Criterion requiredOverlayCriteria[] = +{ + {LEVEL, EQ, 1}, /* This entry gets poked in + determineOverlayVisual. */ + {TRANSPARENT, EQ, 1}, + {XPSEUDOCOLOR, EQ, 1}, + {RGBA, EQ, 0}, + {BUFFER_SIZE, GTE, 1} +}; +static int numRequiredOverlayCriteria = sizeof(requiredOverlayCriteria) / sizeof(Criterion); +static int requiredOverlayCriteriaMask = +(1 << LEVEL) | (1 << TRANSPARENT) | (1 << XSTATICGRAY) | (1 << RGBA) | (1 << CI_MODE); + +#if !defined(_WIN32) +static int +checkOverlayAcceptability(XVisualInfo * vi, unsigned int mode) +{ + int value; + + /* Must support OpenGL. */ + glXGetConfig(__glutDisplay, vi, GLX_USE_GL, &value); + if (!value) + return 1; + + /* Must be color index. */ + glXGetConfig(__glutDisplay, vi, GLX_RGBA, &value); + if (value) + return 1; + + /* Must match single/double buffering request. */ + glXGetConfig(__glutDisplay, vi, GLX_DOUBLEBUFFER, &value); + if (GLUT_WIND_IS_DOUBLE(mode) != (value != 0)) + return 1; + + /* Must match mono/stereo request. */ + glXGetConfig(__glutDisplay, vi, GLX_STEREO, &value); + if (GLUT_WIND_IS_STEREO(mode) != (value != 0)) + return 1; + + /* Alpha and accumulation buffers incompatible with color + index. */ + if (GLUT_WIND_HAS_ALPHA(mode) || GLUT_WIND_HAS_ACCUM(mode)) + return 1; + + /* Look for depth buffer if requested. */ + glXGetConfig(__glutDisplay, vi, GLX_DEPTH_SIZE, &value); + if (GLUT_WIND_HAS_DEPTH(mode) && (value <= 0)) + return 1; + + /* Look for stencil buffer if requested. */ + glXGetConfig(__glutDisplay, vi, GLX_STENCIL_SIZE, &value); + if (GLUT_WIND_HAS_STENCIL(mode) && (value <= 0)) + return 1; + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + /* XXX Multisampled overlay color index?? Pretty unlikely. */ + /* Look for multisampling if requested. */ + if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) + glXGetConfig(__glutDisplay, vi, GLX_SAMPLES_SGIS, &value); + else + value = 0; + if (GLUT_WIND_IS_MULTISAMPLE(mode) && (value <= 0)) + return 1; +#endif + + return 0; +} +#endif + +static XVisualInfo * +getOverlayVisualInfoCI(unsigned int mode) +{ +#if !defined(_WIN32) + XLayerVisualInfo *vi; + XLayerVisualInfo template; + XVisualInfo *goodVisual, *returnVisual; + int nitems, i, j, bad; + + /* The GLX 1.0 glXChooseVisual is does not permit queries + based on pixel transparency (and GLX_BUFFER_SIZE uses + "smallest that meets" its requirement instead of "largest + that meets" that GLUT wants. So, GLUT implements its own + visual selection routine for color index overlays. */ + + /* Try three overlay layers. */ + for (i = 1; i <= 3; i++) { + template.vinfo.screen = __glutScreen; + template.vinfo.class = PseudoColor; + template.layer = i; + template.type = TransparentPixel; + vi = __glutXGetLayerVisualInfo(__glutDisplay, + VisualTransparentType | VisualScreenMask | VisualClassMask | VisualLayerMask, + &template, &nitems); + if (vi) { + /* Check list for acceptable visual meeting requirements + of requested display mode. */ + for (j = 0; j < nitems; j++) { + bad = checkOverlayAcceptability(&vi[j].vinfo, mode); + if (bad) { + /* Set vi[j].vinfo.visual to mark it unacceptable. */ + vi[j].vinfo.visual = NULL; + } + } + + /* Look through list to find deepest acceptable visual. */ + goodVisual = NULL; + for (j = 0; j < nitems; j++) { + if (vi[j].vinfo.visual) { + if (goodVisual == NULL) { + goodVisual = &vi[j].vinfo; + } else { + if (goodVisual->depth < vi[j].vinfo.depth) { + goodVisual = &vi[j].vinfo; + } + } + } + } + + /* If a visual is found, clean up and return the visual. */ + if (goodVisual) { + returnVisual = (XVisualInfo *) malloc(sizeof(XVisualInfo)); + if (returnVisual) { + *returnVisual = *goodVisual; + } + XFree(vi); + return returnVisual; + } + XFree(vi); + } + } +#endif /* !_WIN32 */ + return NULL; +} + +/* ARGSUSED */ +static XVisualInfo * +getOverlayVisualInfoRGB(unsigned int mode) +{ + + /* XXX For now, transparent RGBA overlays are not supported + by GLUT. RGBA overlays raise difficult questions about + what the transparent pixel (really color) value should be. + + Color index overlay transparency is "easy" because the + transparent pixel value does not affect displayable colors + (except for stealing one color cell) since colors are + determined by indirection through a colormap, and because + it is uncommon for arbitrary pixel values in color index to + be "calculated" (as can occur with a host of RGBA operations + like lighting, blending, etc) so it is easy to avoid the + transparent pixel value. + + Since it is typically easy to avoid the transparent pixel + value in color index mode, if GLUT tells the programmer what + pixel is transparent, then most program can easily avoid + generating that pixel value except when they intend + transparency. GLUT returns whatever transparent pixel value + is provided by the system through glutGet( + GLUT_TRANSPARENT_INDEX). + + Theory versus practice for RGBA overlay transparency: In + theory, the reasonable thing is enabling overlay transparency + when an overlay pixel's destination alpha is 0 because this + allows overlay transparency to be controlled via alpha and all + visibile colors are permited, but no hardware I am aware of + supports this practice (and it requires destination alpha which + is typically optional and quite uncommon for overlay windows!). + + In practice, the choice of transparent pixel value is typically + "hardwired" into most graphics hardware to a single pixel value. + SGI hardware uses true black (0,0,0) without regard for the + destination alpha. This is far from ideal because true black (a + common color that is easy to accidently generate) can not be + generated in an RGBA overlay. I am not sure what other vendors + do. + + Pragmatically, most of the typical things you want to do in the + overlays can be done in color index (rubber banding, pop-up + menus, etc.). One solution for GLUT would be to simply + "advertise" what RGB triple (or possibly RGBA quadruple or simply + A alone) generates transparency. The problem with this approach + is that it forces programmers to avoid whatever arbitrary color + various systems decide is transparent. This is a difficult + burden to place on programmers that want to portably make use of + overlays. + + To actually support transparent RGBA overlays, there are really + two reaonsable options. ONE: Simply mandate that true black is + the RGBA overlay transparent color (what IRIS GL did). This is + nice for programmers since only one option, nice for existing SGI + hardware, bad for anyone (including SGI) who wants to improve + upon "true black" RGB transparency. + + Or TWO: Provide a set of queriable "transparency types" (like + "true black" or "alpha == 0" or "true white" or even a queriable + transparent color). This is harder for programmers, OK for + existing SGI hardware, and it leaves open the issue of what other + modes are reasonable. + + Option TWO seems the more general approach, but since hardware + designers will likely only implement a single mode (this is a + scan out issue where bandwidth is pressing issue), codifying + multiple speculative approaches nobody may ever implement seems + silly. And option ONE fiats a suboptimal solution. + + Therefore, I defer any decision of how GLUT should support RGBA + overlay transparency and leave support for it unimplemented. + Nobody has been pressing me for RGBA overlay transparency (though + people have requested color index overlay transparency + repeatedly). Geez, if you read this far you are either really + bored or maybe actually interested in this topic. Anyway, if + you have ideas (particularly if you plan on implementing a + hardware scheme for RGBA overlay transparency), I'd be + interested. + + For the record, SGI's expiremental Framebufer Configuration + experimental GLX extension uses option TWO. Transparency modes + for "none" and "RGB" are defined (others could be defined later). + What RGB value is the transparent one must be queried. + + I was hoping GLUT could have something that required less work + from the programmer to use portably. -mjk */ + + __glutWarning("RGBA overlays are not supported by GLUT (for now)."); + return NULL; +} + +static XVisualInfo * +getOverlayVisualInfo(unsigned int mode) +{ + /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */ + if (GLUT_WIND_IS_LUMINANCE(mode)) + return NULL; + + if (GLUT_WIND_IS_RGB(mode)) + return getOverlayVisualInfoRGB(mode); + else + return getOverlayVisualInfoCI(mode); +} + +#if !defined(_WIN32) + +/* The GLUT overlay can come and go, and the overlay window has + a distinct X window ID. Logically though, GLUT treats the + normal and overlay windows as a unified window. In + particular, X input events typically go to the overlay window + since it is "on top of" the normal window. When an overlay + window ID is destroyed (due to glutRemoveOverlay or a call to + glutEstablishOverlay when an overlay already exists), we + still keep track of the overlay window ID until we get back a + DestroyNotify event for the overlay window. Otherwise, we + could lose track of X input events sent to a destroyed + overlay. To avoid this, we keep the destroyed overlay window + ID on a "stale window" list. This lets us properly route X + input events generated on destroyed overlay windows to the + proper GLUT window. */ +static void +addStaleWindow(GLUTwindow * window, Window win) +{ + GLUTstale *entry; + + entry = (GLUTstale *) malloc(sizeof(GLUTstale)); + if (!entry) + __glutFatalError("out of memory"); + entry->window = window; + entry->win = win; + entry->next = __glutStaleWindowList; + __glutStaleWindowList = entry; +} + +#endif + +void +__glutFreeOverlay(GLUToverlay * overlay) +{ + if (overlay->visAlloced) + XFree(overlay->vis); + XDestroyWindow(__glutDisplay, overlay->win); + glXDestroyContext(__glutDisplay, overlay->ctx); + if (overlay->colormap) { + /* Only color index overlays have colormap data structure. */ + __glutFreeColormap(overlay->colormap); + } + free(overlay); +} + +static XVisualInfo * +determineOverlayVisual(int *treatAsSingle, Bool * visAlloced, void **fbc) +{ + if (__glutDisplayString) { + XVisualInfo *vi; + int i; + + /* __glutDisplayString should be NULL except if + glutInitDisplayString has been called to register a + different display string. Calling glutInitDisplayString + means using a string instead of an integer mask determine + + the visual to use. Using the function pointer variable + __glutDetermineVisualFromString below avoids linking in + the code for implementing glutInitDisplayString (ie, + glut_dstr.o) unless glutInitDisplayString gets called by + the application. */ + + assert(__glutDetermineVisualFromString); + + /* Try three overlay layers. */ + *visAlloced = False; + *fbc = NULL; + for (i = 1; i <= 3; i++) { + requiredOverlayCriteria[0].value = i; + vi = __glutDetermineVisualFromString(__glutDisplayString, treatAsSingle, + requiredOverlayCriteria, numRequiredOverlayCriteria, + requiredOverlayCriteriaMask, fbc); + if (vi) { + return vi; + } + } + return NULL; + } else { + *visAlloced = True; + *fbc = NULL; + return __glutDetermineVisual(__glutDisplayMode, + treatAsSingle, getOverlayVisualInfo); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutEstablishOverlay(void) +{ + GLUToverlay *overlay; + GLUTwindow *window; + XSetWindowAttributes wa; + void *fbc; + + /* Register a routine to free an overlay with glut_win.c; + this keeps glut_win.c from pulling in all of + glut_overlay.c when no overlay functionality is used by + the application. */ + __glutFreeOverlayFunc = __glutFreeOverlay; + + window = __glutCurrentWindow; + + /* Allow for an existant overlay to be re-established perhaps + if you wanted a different display mode. */ + if (window->overlay) { +#if !defined(_WIN32) + addStaleWindow(window, window->overlay->win); +#endif + __glutFreeOverlay(window->overlay); + } + overlay = (GLUToverlay *) malloc(sizeof(GLUToverlay)); + if (!overlay) + __glutFatalError("out of memory."); + + overlay->vis = determineOverlayVisual(&overlay->treatAsSingle, + &overlay->visAlloced, &fbc); + if (!overlay->vis) { + __glutFatalError("lacks overlay support."); + } +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + if (fbc) { + window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc, + GLX_RGBA_TYPE_SGIX, None, __glutTryDirect); + } else +#endif + { + overlay->ctx = glXCreateContext(__glutDisplay, overlay->vis, + None, __glutTryDirect); + } + if (!overlay->ctx) { + __glutFatalError( + "failed to create overlay OpenGL rendering context."); + } +#if !defined(_WIN32) + overlay->isDirect = glXIsDirect(__glutDisplay, overlay->ctx); + if (__glutForceDirect) { + if (!overlay->isDirect) { + __glutFatalError("direct rendering not possible."); + } + } +#endif + __glutSetupColormap(overlay->vis, &overlay->colormap, &overlay->cmap); + overlay->transparentPixel = __glutGetTransparentPixel(__glutDisplay, + overlay->vis); + wa.colormap = overlay->cmap; + wa.background_pixel = overlay->transparentPixel; + wa.event_mask = window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK; + wa.border_pixel = 0; +#if defined(_WIN32) + /* XXX Overlays not supported in Win32 yet. */ +#else + overlay->win = XCreateWindow(__glutDisplay, + window->win, + 0, 0, window->width, window->height, 0, + overlay->vis->depth, InputOutput, overlay->vis->visual, + CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, + &wa); +#endif + if (window->children) { + /* Overlay window must be lowered below any GLUT + subwindows. */ + XLowerWindow(__glutDisplay, overlay->win); + } + XMapWindow(__glutDisplay, overlay->win); + overlay->shownState = 1; + + overlay->display = NULL; + + /* Make sure a reshape gets delivered. */ + window->forceReshape = True; + +#if !defined(_WIN32) + __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); +#endif + + window->overlay = overlay; + glutUseLayer(GLUT_OVERLAY); + + if (overlay->treatAsSingle) { + glDrawBuffer(GL_FRONT); + glReadBuffer(GL_FRONT); + } +} + +void GLUTAPIENTRY +glutRemoveOverlay(void) +{ + GLUTwindow *window = __glutCurrentWindow; + GLUToverlay *overlay = __glutCurrentWindow->overlay; + + if (!window->overlay) + return; + + /* If using overlay, switch to the normal layer. */ + if (window->renderWin == overlay->win) { + glutUseLayer(GLUT_NORMAL); + } +#if !defined(_WIN32) + addStaleWindow(window, overlay->win); +#endif + __glutFreeOverlay(overlay); + window->overlay = NULL; +#if !defined(_WIN32) + __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); +#endif +} + +void GLUTAPIENTRY +glutUseLayer(GLenum layer) +{ + GLUTwindow *window = __glutCurrentWindow; + + switch (layer) { + case GLUT_NORMAL: +#ifdef _WIN32 + window->renderDc = window->hdc; +#endif + window->renderWin = window->win; + window->renderCtx = window->ctx; + break; + case GLUT_OVERLAY: + /* Did you crash here? Calling glutUseLayer(GLUT_OVERLAY) + without an overlay established is erroneous. Fix your + code. */ +#ifdef _WIN32 + window->renderDc = window->overlay->hdc; +#endif + window->renderWin = window->overlay->win; + window->renderCtx = window->overlay->ctx; + break; + default: + __glutWarning("glutUseLayer: unknown layer, %d.", layer); + break; + } + __glutSetWindow(window); +} + +void GLUTAPIENTRY +glutPostOverlayRedisplay(void) +{ + __glutPostRedisplay(__glutCurrentWindow, GLUT_OVERLAY_REDISPLAY_WORK); +} + +/* The advantage of this routine is that it saves the cost of a + glutSetWindow call (entailing an expensive OpenGL context + switch), particularly useful when multiple windows need + redisplays posted at the same times. */ +void GLUTAPIENTRY +glutPostWindowOverlayRedisplay(int win) +{ + __glutPostRedisplay(__glutWindowList[win - 1], GLUT_OVERLAY_REDISPLAY_WORK); +} + +void GLUTAPIENTRY +glutOverlayDisplayFunc(GLUTdisplayCB displayFunc) +{ + if (!__glutCurrentWindow->overlay) { + __glutWarning("glutOverlayDisplayFunc: window has no overlay established"); + return; + } + __glutCurrentWindow->overlay->display = displayFunc; +} + +void GLUTAPIENTRY +glutHideOverlay(void) +{ + if (!__glutCurrentWindow->overlay) { + __glutWarning("glutHideOverlay: window has no overlay established"); + return; + } + XUnmapWindow(__glutDisplay, __glutCurrentWindow->overlay->win); + __glutCurrentWindow->overlay->shownState = 0; +} + +void GLUTAPIENTRY +glutShowOverlay(void) +{ + if (!__glutCurrentWindow->overlay) { + __glutWarning("glutShowOverlay: window has no overlay established"); + return; + } + XMapWindow(__glutDisplay, __glutCurrentWindow->overlay->win); + __glutCurrentWindow->overlay->shownState = 1; +} + +int GLUTAPIENTRY +glutLayerGet(GLenum param) +{ + switch (param) { + case GLUT_OVERLAY_POSSIBLE: + { + XVisualInfo *vi; + Bool dummy, visAlloced; + void *fbc; + + vi = determineOverlayVisual(&dummy, &visAlloced, &fbc); + if (vi) { + if (visAlloced) + XFree(vi); + return 1; + } + return 0; + } + case GLUT_LAYER_IN_USE: + return __glutCurrentWindow->renderWin != __glutCurrentWindow->win; + case GLUT_HAS_OVERLAY: + return __glutCurrentWindow->overlay != NULL; + case GLUT_TRANSPARENT_INDEX: + if (__glutCurrentWindow->overlay) { + return __glutCurrentWindow->overlay->transparentPixel; + } else { + return -1; + } + case GLUT_NORMAL_DAMAGED: + /* __glutWindowDamaged is used so the damage state within + the window (or overlay belwo) can be cleared before + calling a display callback so on return, the state does + not have to be cleared (since upon return from the + callback the window could be destroyed (or layer + removed). */ + return (__glutCurrentWindow->workMask & GLUT_REPAIR_WORK) + || __glutWindowDamaged; + case GLUT_OVERLAY_DAMAGED: + if (__glutCurrentWindow->overlay) { + return (__glutCurrentWindow->workMask & GLUT_OVERLAY_REPAIR_WORK) + || __glutWindowDamaged; + } else { + return -1; + } + default: + __glutWarning("invalid glutLayerGet param: %d", param); + return -1; + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut.pc.in xpsb-glx-0.19/mesa/src/glut/glx/glut.pc.in --- xpsb-glx-0.19/mesa/src/glut/glx/glut.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut.pc.in 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,13 @@ +prefix=@INSTALL_DIR@ +exec_prefix=${prefix} +libdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: glut +Description: Mesa OpenGL Utility Toolkit library +Requires: gl glu +Requires.private: @GLUT_PC_REQ_PRIV@ +Version: @VERSION@ +Libs: -L${libdir} -lglut +Libs.private: @GLUT_PC_LIB_PRIV@ +Cflags: -I${includedir} @GLUT_PC_CFLAGS@ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_ppm.c xpsb-glx-0.19/mesa/src/glut/glx/glut_ppm.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_ppm.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_ppm.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,80 @@ +/* + * PPM file output + * Brian Paul + * 8 Dec 2008 + */ + +#include +#include +#include +#include "glutint.h" + + +static void +write_ppm_file(const char *filename, const GLubyte *buffer, + int width, int height) +{ + const int binary = 1; + FILE *f = fopen( filename, "w" ); + if (f) { + const GLubyte *ptr = buffer; + int i, x, y; + if (binary) { + fprintf(f,"P6\n"); + fprintf(f,"# ppm-file created by GLUT\n"); + fprintf(f,"%i %i\n", width, height); + fprintf(f,"255\n"); + fclose(f); + f = fopen( filename, "ab" ); /* reopen in binary append mode */ + for (y = height - 1; y >= 0; y--) { + for (x = 0; x < width; x++) { + i = (y * width + x) * 4; + fputc(ptr[i], f); /* write red */ + fputc(ptr[i+1], f); /* write green */ + fputc(ptr[i+2], f); /* write blue */ + } + } + } + else { + /*ASCII*/ + int counter = 0; + fprintf(f,"P3\n"); + fprintf(f,"# ascii ppm file created by GLUT\n"); + fprintf(f,"%i %i\n", width, height); + fprintf(f,"255\n"); + for (y = height - 1; y >= 0; y--) { + for (x = 0; x < width; x++) { + i = (y * width + x) * 4; + fprintf(f, " %3d %3d %3d", ptr[i], ptr[i+1], ptr[i+2]); + counter++; + if (counter % 5 == 0) + fprintf(f, "\n"); + } + } + } + fclose(f); + } +} + + +/** + * Called from SwapBuffers if the GLUT_PPM_FILE env var is set. + */ +void __glutWritePPMFile(void) +{ + int w = glutGet(GLUT_WINDOW_WIDTH); + int h = glutGet(GLUT_WINDOW_HEIGHT); + GLubyte *buf; + + assert(__glutPPMFile); + + buf = (GLubyte *) malloc(w * h * 4); + if (buf) { + /* XXX save/restore pixel packing */ + glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf); + write_ppm_file(__glutPPMFile, buf, w, h); + free(buf); + } + + __glutPPMFile = NULL; /* only write one file */ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_roman.c xpsb-glx-0.19/mesa/src/glut/glx/glut_roman.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_roman.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_roman.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2451 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "glutstroke.h" + +/* char: 33 '!' */ + +static const CoordRec char33_stroke0[] = { + { 13.3819, 100 }, + { 13.3819, 33.3333 }, +}; + +static const CoordRec char33_stroke1[] = { + { 13.3819, 9.5238 }, + { 8.62, 4.7619 }, + { 13.3819, 0 }, + { 18.1438, 4.7619 }, + { 13.3819, 9.5238 }, +}; + +static const StrokeRec char33[] = { + { 2, char33_stroke0 }, + { 5, char33_stroke1 }, +}; + +/* char: 34 '"' */ + +static const CoordRec char34_stroke0[] = { + { 4.02, 100 }, + { 4.02, 66.6667 }, +}; + +static const CoordRec char34_stroke1[] = { + { 42.1152, 100 }, + { 42.1152, 66.6667 }, +}; + +static const StrokeRec char34[] = { + { 2, char34_stroke0 }, + { 2, char34_stroke1 }, +}; + +/* char: 35 '#' */ + +static const CoordRec char35_stroke0[] = { + { 41.2952, 119.048 }, + { 7.9619, -33.3333 }, +}; + +static const CoordRec char35_stroke1[] = { + { 69.8667, 119.048 }, + { 36.5333, -33.3333 }, +}; + +static const CoordRec char35_stroke2[] = { + { 7.9619, 57.1429 }, + { 74.6286, 57.1429 }, +}; + +static const CoordRec char35_stroke3[] = { + { 3.2, 28.5714 }, + { 69.8667, 28.5714 }, +}; + +static const StrokeRec char35[] = { + { 2, char35_stroke0 }, + { 2, char35_stroke1 }, + { 2, char35_stroke2 }, + { 2, char35_stroke3 }, +}; + +/* char: 36 '$' */ + +static const CoordRec char36_stroke0[] = { + { 28.6295, 119.048 }, + { 28.6295, -19.0476 }, +}; + +static const CoordRec char36_stroke1[] = { + { 47.6771, 119.048 }, + { 47.6771, -19.0476 }, +}; + +static const CoordRec char36_stroke2[] = { + { 71.4867, 85.7143 }, + { 61.9629, 95.2381 }, + { 47.6771, 100 }, + { 28.6295, 100 }, + { 14.3438, 95.2381 }, + { 4.82, 85.7143 }, + { 4.82, 76.1905 }, + { 9.5819, 66.6667 }, + { 14.3438, 61.9048 }, + { 23.8676, 57.1429 }, + { 52.439, 47.619 }, + { 61.9629, 42.8571 }, + { 66.7248, 38.0952 }, + { 71.4867, 28.5714 }, + { 71.4867, 14.2857 }, + { 61.9629, 4.7619 }, + { 47.6771, 0 }, + { 28.6295, 0 }, + { 14.3438, 4.7619 }, + { 4.82, 14.2857 }, +}; + +static const StrokeRec char36[] = { + { 2, char36_stroke0 }, + { 2, char36_stroke1 }, + { 20, char36_stroke2 }, +}; + +/* char: 37 '%' */ + +static const CoordRec char37_stroke0[] = { + { 92.0743, 100 }, + { 6.36, 0 }, +}; + +static const CoordRec char37_stroke1[] = { + { 30.1695, 100 }, + { 39.6933, 90.4762 }, + { 39.6933, 80.9524 }, + { 34.9314, 71.4286 }, + { 25.4076, 66.6667 }, + { 15.8838, 66.6667 }, + { 6.36, 76.1905 }, + { 6.36, 85.7143 }, + { 11.1219, 95.2381 }, + { 20.6457, 100 }, + { 30.1695, 100 }, + { 39.6933, 95.2381 }, + { 53.979, 90.4762 }, + { 68.2648, 90.4762 }, + { 82.5505, 95.2381 }, + { 92.0743, 100 }, +}; + +static const CoordRec char37_stroke2[] = { + { 73.0267, 33.3333 }, + { 63.5029, 28.5714 }, + { 58.741, 19.0476 }, + { 58.741, 9.5238 }, + { 68.2648, 0 }, + { 77.7886, 0 }, + { 87.3124, 4.7619 }, + { 92.0743, 14.2857 }, + { 92.0743, 23.8095 }, + { 82.5505, 33.3333 }, + { 73.0267, 33.3333 }, +}; + +static const StrokeRec char37[] = { + { 2, char37_stroke0 }, + { 16, char37_stroke1 }, + { 11, char37_stroke2 }, +}; + +/* char: 38 '&' */ + +static const CoordRec char38_stroke0[] = { + { 101.218, 57.1429 }, + { 101.218, 61.9048 }, + { 96.4562, 66.6667 }, + { 91.6943, 66.6667 }, + { 86.9324, 61.9048 }, + { 82.1705, 52.381 }, + { 72.6467, 28.5714 }, + { 63.1229, 14.2857 }, + { 53.599, 4.7619 }, + { 44.0752, 0 }, + { 25.0276, 0 }, + { 15.5038, 4.7619 }, + { 10.7419, 9.5238 }, + { 5.98, 19.0476 }, + { 5.98, 28.5714 }, + { 10.7419, 38.0952 }, + { 15.5038, 42.8571 }, + { 48.8371, 61.9048 }, + { 53.599, 66.6667 }, + { 58.361, 76.1905 }, + { 58.361, 85.7143 }, + { 53.599, 95.2381 }, + { 44.0752, 100 }, + { 34.5514, 95.2381 }, + { 29.7895, 85.7143 }, + { 29.7895, 76.1905 }, + { 34.5514, 61.9048 }, + { 44.0752, 47.619 }, + { 67.8848, 14.2857 }, + { 77.4086, 4.7619 }, + { 86.9324, 0 }, + { 96.4562, 0 }, + { 101.218, 4.7619 }, + { 101.218, 9.5238 }, +}; + +static const StrokeRec char38[] = { + { 34, char38_stroke0 }, +}; + +/* char: 39 ''' */ + +static const CoordRec char39_stroke0[] = { + { 4.44, 100 }, + { 4.44, 66.6667 }, +}; + +static const StrokeRec char39[] = { + { 2, char39_stroke0 }, +}; + +/* char: 40 '(' */ + +static const CoordRec char40_stroke0[] = { + { 40.9133, 119.048 }, + { 31.3895, 109.524 }, + { 21.8657, 95.2381 }, + { 12.3419, 76.1905 }, + { 7.58, 52.381 }, + { 7.58, 33.3333 }, + { 12.3419, 9.5238 }, + { 21.8657, -9.5238 }, + { 31.3895, -23.8095 }, + { 40.9133, -33.3333 }, +}; + +static const StrokeRec char40[] = { + { 10, char40_stroke0 }, +}; + +/* char: 41 ')' */ + +static const CoordRec char41_stroke0[] = { + { 5.28, 119.048 }, + { 14.8038, 109.524 }, + { 24.3276, 95.2381 }, + { 33.8514, 76.1905 }, + { 38.6133, 52.381 }, + { 38.6133, 33.3333 }, + { 33.8514, 9.5238 }, + { 24.3276, -9.5238 }, + { 14.8038, -23.8095 }, + { 5.28, -33.3333 }, +}; + +static const StrokeRec char41[] = { + { 10, char41_stroke0 }, +}; + +/* char: 42 '*' */ + +static const CoordRec char42_stroke0[] = { + { 30.7695, 71.4286 }, + { 30.7695, 14.2857 }, +}; + +static const CoordRec char42_stroke1[] = { + { 6.96, 57.1429 }, + { 54.579, 28.5714 }, +}; + +static const CoordRec char42_stroke2[] = { + { 54.579, 57.1429 }, + { 6.96, 28.5714 }, +}; + +static const StrokeRec char42[] = { + { 2, char42_stroke0 }, + { 2, char42_stroke1 }, + { 2, char42_stroke2 }, +}; + +/* char: 43 '+' */ + +static const CoordRec char43_stroke0[] = { + { 48.8371, 85.7143 }, + { 48.8371, 0 }, +}; + +static const CoordRec char43_stroke1[] = { + { 5.98, 42.8571 }, + { 91.6943, 42.8571 }, +}; + +static const StrokeRec char43[] = { + { 2, char43_stroke0 }, + { 2, char43_stroke1 }, +}; + +/* char: 44 ',' */ + +static const CoordRec char44_stroke0[] = { + { 18.2838, 4.7619 }, + { 13.5219, 0 }, + { 8.76, 4.7619 }, + { 13.5219, 9.5238 }, + { 18.2838, 4.7619 }, + { 18.2838, -4.7619 }, + { 13.5219, -14.2857 }, + { 8.76, -19.0476 }, +}; + +static const StrokeRec char44[] = { + { 8, char44_stroke0 }, +}; + +/* char: 45 '-' */ + +static const CoordRec char45_stroke0[] = { + { 7.38, 42.8571 }, + { 93.0943, 42.8571 }, +}; + +static const StrokeRec char45[] = { + { 2, char45_stroke0 }, +}; + +/* char: 46 '.' */ + +static const CoordRec char46_stroke0[] = { + { 13.1019, 9.5238 }, + { 8.34, 4.7619 }, + { 13.1019, 0 }, + { 17.8638, 4.7619 }, + { 13.1019, 9.5238 }, +}; + +static const StrokeRec char46[] = { + { 5, char46_stroke0 }, +}; + +/* char: 47 '/' */ + +static const CoordRec char47_stroke0[] = { + { 7.24, -14.2857 }, + { 73.9067, 100 }, +}; + +static const StrokeRec char47[] = { + { 2, char47_stroke0 }, +}; + +/* char: 48 '0' */ + +static const CoordRec char48_stroke0[] = { + { 33.5514, 100 }, + { 19.2657, 95.2381 }, + { 9.7419, 80.9524 }, + { 4.98, 57.1429 }, + { 4.98, 42.8571 }, + { 9.7419, 19.0476 }, + { 19.2657, 4.7619 }, + { 33.5514, 0 }, + { 43.0752, 0 }, + { 57.361, 4.7619 }, + { 66.8848, 19.0476 }, + { 71.6467, 42.8571 }, + { 71.6467, 57.1429 }, + { 66.8848, 80.9524 }, + { 57.361, 95.2381 }, + { 43.0752, 100 }, + { 33.5514, 100 }, +}; + +static const StrokeRec char48[] = { + { 17, char48_stroke0 }, +}; + +/* char: 49 '1' */ + +static const CoordRec char49_stroke0[] = { + { 11.82, 80.9524 }, + { 21.3438, 85.7143 }, + { 35.6295, 100 }, + { 35.6295, 0 }, +}; + +static const StrokeRec char49[] = { + { 4, char49_stroke0 }, +}; + +/* char: 50 '2' */ + +static const CoordRec char50_stroke0[] = { + { 10.1819, 76.1905 }, + { 10.1819, 80.9524 }, + { 14.9438, 90.4762 }, + { 19.7057, 95.2381 }, + { 29.2295, 100 }, + { 48.2771, 100 }, + { 57.801, 95.2381 }, + { 62.5629, 90.4762 }, + { 67.3248, 80.9524 }, + { 67.3248, 71.4286 }, + { 62.5629, 61.9048 }, + { 53.039, 47.619 }, + { 5.42, 0 }, + { 72.0867, 0 }, +}; + +static const StrokeRec char50[] = { + { 14, char50_stroke0 }, +}; + +/* char: 51 '3' */ + +static const CoordRec char51_stroke0[] = { + { 14.5238, 100 }, + { 66.9048, 100 }, + { 38.3333, 61.9048 }, + { 52.619, 61.9048 }, + { 62.1429, 57.1429 }, + { 66.9048, 52.381 }, + { 71.6667, 38.0952 }, + { 71.6667, 28.5714 }, + { 66.9048, 14.2857 }, + { 57.381, 4.7619 }, + { 43.0952, 0 }, + { 28.8095, 0 }, + { 14.5238, 4.7619 }, + { 9.7619, 9.5238 }, + { 5, 19.0476 }, +}; + +static const StrokeRec char51[] = { + { 15, char51_stroke0 }, +}; + +/* char: 52 '4' */ + +static const CoordRec char52_stroke0[] = { + { 51.499, 100 }, + { 3.88, 33.3333 }, + { 75.3086, 33.3333 }, +}; + +static const CoordRec char52_stroke1[] = { + { 51.499, 100 }, + { 51.499, 0 }, +}; + +static const StrokeRec char52[] = { + { 3, char52_stroke0 }, + { 2, char52_stroke1 }, +}; + +/* char: 53 '5' */ + +static const CoordRec char53_stroke0[] = { + { 62.0029, 100 }, + { 14.3838, 100 }, + { 9.6219, 57.1429 }, + { 14.3838, 61.9048 }, + { 28.6695, 66.6667 }, + { 42.9552, 66.6667 }, + { 57.241, 61.9048 }, + { 66.7648, 52.381 }, + { 71.5267, 38.0952 }, + { 71.5267, 28.5714 }, + { 66.7648, 14.2857 }, + { 57.241, 4.7619 }, + { 42.9552, 0 }, + { 28.6695, 0 }, + { 14.3838, 4.7619 }, + { 9.6219, 9.5238 }, + { 4.86, 19.0476 }, +}; + +static const StrokeRec char53[] = { + { 17, char53_stroke0 }, +}; + +/* char: 54 '6' */ + +static const CoordRec char54_stroke0[] = { + { 62.7229, 85.7143 }, + { 57.961, 95.2381 }, + { 43.6752, 100 }, + { 34.1514, 100 }, + { 19.8657, 95.2381 }, + { 10.3419, 80.9524 }, + { 5.58, 57.1429 }, + { 5.58, 33.3333 }, + { 10.3419, 14.2857 }, + { 19.8657, 4.7619 }, + { 34.1514, 0 }, + { 38.9133, 0 }, + { 53.199, 4.7619 }, + { 62.7229, 14.2857 }, + { 67.4848, 28.5714 }, + { 67.4848, 33.3333 }, + { 62.7229, 47.619 }, + { 53.199, 57.1429 }, + { 38.9133, 61.9048 }, + { 34.1514, 61.9048 }, + { 19.8657, 57.1429 }, + { 10.3419, 47.619 }, + { 5.58, 33.3333 }, +}; + +static const StrokeRec char54[] = { + { 23, char54_stroke0 }, +}; + +/* char: 55 '7' */ + +static const CoordRec char55_stroke0[] = { + { 72.2267, 100 }, + { 24.6076, 0 }, +}; + +static const CoordRec char55_stroke1[] = { + { 5.56, 100 }, + { 72.2267, 100 }, +}; + +static const StrokeRec char55[] = { + { 2, char55_stroke0 }, + { 2, char55_stroke1 }, +}; + +/* char: 56 '8' */ + +static const CoordRec char56_stroke0[] = { + { 29.4095, 100 }, + { 15.1238, 95.2381 }, + { 10.3619, 85.7143 }, + { 10.3619, 76.1905 }, + { 15.1238, 66.6667 }, + { 24.6476, 61.9048 }, + { 43.6952, 57.1429 }, + { 57.981, 52.381 }, + { 67.5048, 42.8571 }, + { 72.2667, 33.3333 }, + { 72.2667, 19.0476 }, + { 67.5048, 9.5238 }, + { 62.7429, 4.7619 }, + { 48.4571, 0 }, + { 29.4095, 0 }, + { 15.1238, 4.7619 }, + { 10.3619, 9.5238 }, + { 5.6, 19.0476 }, + { 5.6, 33.3333 }, + { 10.3619, 42.8571 }, + { 19.8857, 52.381 }, + { 34.1714, 57.1429 }, + { 53.219, 61.9048 }, + { 62.7429, 66.6667 }, + { 67.5048, 76.1905 }, + { 67.5048, 85.7143 }, + { 62.7429, 95.2381 }, + { 48.4571, 100 }, + { 29.4095, 100 }, +}; + +static const StrokeRec char56[] = { + { 29, char56_stroke0 }, +}; + +/* char: 57 '9' */ + +static const CoordRec char57_stroke0[] = { + { 68.5048, 66.6667 }, + { 63.7429, 52.381 }, + { 54.219, 42.8571 }, + { 39.9333, 38.0952 }, + { 35.1714, 38.0952 }, + { 20.8857, 42.8571 }, + { 11.3619, 52.381 }, + { 6.6, 66.6667 }, + { 6.6, 71.4286 }, + { 11.3619, 85.7143 }, + { 20.8857, 95.2381 }, + { 35.1714, 100 }, + { 39.9333, 100 }, + { 54.219, 95.2381 }, + { 63.7429, 85.7143 }, + { 68.5048, 66.6667 }, + { 68.5048, 42.8571 }, + { 63.7429, 19.0476 }, + { 54.219, 4.7619 }, + { 39.9333, 0 }, + { 30.4095, 0 }, + { 16.1238, 4.7619 }, + { 11.3619, 14.2857 }, +}; + +static const StrokeRec char57[] = { + { 23, char57_stroke0 }, +}; + +/* char: 58 ':' */ + +static const CoordRec char58_stroke0[] = { + { 14.0819, 66.6667 }, + { 9.32, 61.9048 }, + { 14.0819, 57.1429 }, + { 18.8438, 61.9048 }, + { 14.0819, 66.6667 }, +}; + +static const CoordRec char58_stroke1[] = { + { 14.0819, 9.5238 }, + { 9.32, 4.7619 }, + { 14.0819, 0 }, + { 18.8438, 4.7619 }, + { 14.0819, 9.5238 }, +}; + +static const StrokeRec char58[] = { + { 5, char58_stroke0 }, + { 5, char58_stroke1 }, +}; + +/* char: 59 ';' */ + +static const CoordRec char59_stroke0[] = { + { 12.9619, 66.6667 }, + { 8.2, 61.9048 }, + { 12.9619, 57.1429 }, + { 17.7238, 61.9048 }, + { 12.9619, 66.6667 }, +}; + +static const CoordRec char59_stroke1[] = { + { 17.7238, 4.7619 }, + { 12.9619, 0 }, + { 8.2, 4.7619 }, + { 12.9619, 9.5238 }, + { 17.7238, 4.7619 }, + { 17.7238, -4.7619 }, + { 12.9619, -14.2857 }, + { 8.2, -19.0476 }, +}; + +static const StrokeRec char59[] = { + { 5, char59_stroke0 }, + { 8, char59_stroke1 }, +}; + +/* char: 60 '<' */ + +static const CoordRec char60_stroke0[] = { + { 79.2505, 85.7143 }, + { 3.06, 42.8571 }, + { 79.2505, 0 }, +}; + +static const StrokeRec char60[] = { + { 3, char60_stroke0 }, +}; + +/* char: 61 '=' */ + +static const CoordRec char61_stroke0[] = { + { 5.7, 57.1429 }, + { 91.4143, 57.1429 }, +}; + +static const CoordRec char61_stroke1[] = { + { 5.7, 28.5714 }, + { 91.4143, 28.5714 }, +}; + +static const StrokeRec char61[] = { + { 2, char61_stroke0 }, + { 2, char61_stroke1 }, +}; + +/* char: 62 '>' */ + +static const CoordRec char62_stroke0[] = { + { 2.78, 85.7143 }, + { 78.9705, 42.8571 }, + { 2.78, 0 }, +}; + +static const StrokeRec char62[] = { + { 3, char62_stroke0 }, +}; + +/* char: 63 '?' */ + +static const CoordRec char63_stroke0[] = { + { 8.42, 76.1905 }, + { 8.42, 80.9524 }, + { 13.1819, 90.4762 }, + { 17.9438, 95.2381 }, + { 27.4676, 100 }, + { 46.5152, 100 }, + { 56.039, 95.2381 }, + { 60.801, 90.4762 }, + { 65.5629, 80.9524 }, + { 65.5629, 71.4286 }, + { 60.801, 61.9048 }, + { 56.039, 57.1429 }, + { 36.9914, 47.619 }, + { 36.9914, 33.3333 }, +}; + +static const CoordRec char63_stroke1[] = { + { 36.9914, 9.5238 }, + { 32.2295, 4.7619 }, + { 36.9914, 0 }, + { 41.7533, 4.7619 }, + { 36.9914, 9.5238 }, +}; + +static const StrokeRec char63[] = { + { 14, char63_stroke0 }, + { 5, char63_stroke1 }, +}; + +/* char: 64 '@' */ + +static const CoordRec char64_stroke0[] = { + { 49.2171, 52.381 }, + { 39.6933, 57.1429 }, + { 30.1695, 57.1429 }, + { 25.4076, 47.619 }, + { 25.4076, 42.8571 }, + { 30.1695, 33.3333 }, + { 39.6933, 33.3333 }, + { 49.2171, 38.0952 }, +}; + +static const CoordRec char64_stroke1[] = { + { 49.2171, 57.1429 }, + { 49.2171, 38.0952 }, + { 53.979, 33.3333 }, + { 63.5029, 33.3333 }, + { 68.2648, 42.8571 }, + { 68.2648, 47.619 }, + { 63.5029, 61.9048 }, + { 53.979, 71.4286 }, + { 39.6933, 76.1905 }, + { 34.9314, 76.1905 }, + { 20.6457, 71.4286 }, + { 11.1219, 61.9048 }, + { 6.36, 47.619 }, + { 6.36, 42.8571 }, + { 11.1219, 28.5714 }, + { 20.6457, 19.0476 }, + { 34.9314, 14.2857 }, + { 39.6933, 14.2857 }, + { 53.979, 19.0476 }, +}; + +static const StrokeRec char64[] = { + { 8, char64_stroke0 }, + { 19, char64_stroke1 }, +}; + +/* char: 65 'A' */ + +static const CoordRec char65_stroke0[] = { + { 40.5952, 100 }, + { 2.5, 0 }, +}; + +static const CoordRec char65_stroke1[] = { + { 40.5952, 100 }, + { 78.6905, 0 }, +}; + +static const CoordRec char65_stroke2[] = { + { 16.7857, 33.3333 }, + { 64.4048, 33.3333 }, +}; + +static const StrokeRec char65[] = { + { 2, char65_stroke0 }, + { 2, char65_stroke1 }, + { 2, char65_stroke2 }, +}; + +/* char: 66 'B' */ + +static const CoordRec char66_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char66_stroke1[] = { + { 11.42, 100 }, + { 54.2771, 100 }, + { 68.5629, 95.2381 }, + { 73.3248, 90.4762 }, + { 78.0867, 80.9524 }, + { 78.0867, 71.4286 }, + { 73.3248, 61.9048 }, + { 68.5629, 57.1429 }, + { 54.2771, 52.381 }, +}; + +static const CoordRec char66_stroke2[] = { + { 11.42, 52.381 }, + { 54.2771, 52.381 }, + { 68.5629, 47.619 }, + { 73.3248, 42.8571 }, + { 78.0867, 33.3333 }, + { 78.0867, 19.0476 }, + { 73.3248, 9.5238 }, + { 68.5629, 4.7619 }, + { 54.2771, 0 }, + { 11.42, 0 }, +}; + +static const StrokeRec char66[] = { + { 2, char66_stroke0 }, + { 9, char66_stroke1 }, + { 10, char66_stroke2 }, +}; + +/* char: 67 'C' */ + +static const CoordRec char67_stroke0[] = { + { 78.0886, 76.1905 }, + { 73.3267, 85.7143 }, + { 63.8029, 95.2381 }, + { 54.279, 100 }, + { 35.2314, 100 }, + { 25.7076, 95.2381 }, + { 16.1838, 85.7143 }, + { 11.4219, 76.1905 }, + { 6.66, 61.9048 }, + { 6.66, 38.0952 }, + { 11.4219, 23.8095 }, + { 16.1838, 14.2857 }, + { 25.7076, 4.7619 }, + { 35.2314, 0 }, + { 54.279, 0 }, + { 63.8029, 4.7619 }, + { 73.3267, 14.2857 }, + { 78.0886, 23.8095 }, +}; + +static const StrokeRec char67[] = { + { 18, char67_stroke0 }, +}; + +/* char: 68 'D' */ + +static const CoordRec char68_stroke0[] = { + { 11.96, 100 }, + { 11.96, 0 }, +}; + +static const CoordRec char68_stroke1[] = { + { 11.96, 100 }, + { 45.2933, 100 }, + { 59.579, 95.2381 }, + { 69.1029, 85.7143 }, + { 73.8648, 76.1905 }, + { 78.6267, 61.9048 }, + { 78.6267, 38.0952 }, + { 73.8648, 23.8095 }, + { 69.1029, 14.2857 }, + { 59.579, 4.7619 }, + { 45.2933, 0 }, + { 11.96, 0 }, +}; + +static const StrokeRec char68[] = { + { 2, char68_stroke0 }, + { 12, char68_stroke1 }, +}; + +/* char: 69 'E' */ + +static const CoordRec char69_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char69_stroke1[] = { + { 11.42, 100 }, + { 73.3248, 100 }, +}; + +static const CoordRec char69_stroke2[] = { + { 11.42, 52.381 }, + { 49.5152, 52.381 }, +}; + +static const CoordRec char69_stroke3[] = { + { 11.42, 0 }, + { 73.3248, 0 }, +}; + +static const StrokeRec char69[] = { + { 2, char69_stroke0 }, + { 2, char69_stroke1 }, + { 2, char69_stroke2 }, + { 2, char69_stroke3 }, +}; + +/* char: 70 'F' */ + +static const CoordRec char70_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char70_stroke1[] = { + { 11.42, 100 }, + { 73.3248, 100 }, +}; + +static const CoordRec char70_stroke2[] = { + { 11.42, 52.381 }, + { 49.5152, 52.381 }, +}; + +static const StrokeRec char70[] = { + { 2, char70_stroke0 }, + { 2, char70_stroke1 }, + { 2, char70_stroke2 }, +}; + +/* char: 71 'G' */ + +static const CoordRec char71_stroke0[] = { + { 78.4886, 76.1905 }, + { 73.7267, 85.7143 }, + { 64.2029, 95.2381 }, + { 54.679, 100 }, + { 35.6314, 100 }, + { 26.1076, 95.2381 }, + { 16.5838, 85.7143 }, + { 11.8219, 76.1905 }, + { 7.06, 61.9048 }, + { 7.06, 38.0952 }, + { 11.8219, 23.8095 }, + { 16.5838, 14.2857 }, + { 26.1076, 4.7619 }, + { 35.6314, 0 }, + { 54.679, 0 }, + { 64.2029, 4.7619 }, + { 73.7267, 14.2857 }, + { 78.4886, 23.8095 }, + { 78.4886, 38.0952 }, +}; + +static const CoordRec char71_stroke1[] = { + { 54.679, 38.0952 }, + { 78.4886, 38.0952 }, +}; + +static const StrokeRec char71[] = { + { 19, char71_stroke0 }, + { 2, char71_stroke1 }, +}; + +/* char: 72 'H' */ + +static const CoordRec char72_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char72_stroke1[] = { + { 78.0867, 100 }, + { 78.0867, 0 }, +}; + +static const CoordRec char72_stroke2[] = { + { 11.42, 52.381 }, + { 78.0867, 52.381 }, +}; + +static const StrokeRec char72[] = { + { 2, char72_stroke0 }, + { 2, char72_stroke1 }, + { 2, char72_stroke2 }, +}; + +/* char: 73 'I' */ + +static const CoordRec char73_stroke0[] = { + { 10.86, 100 }, + { 10.86, 0 }, +}; + +static const StrokeRec char73[] = { + { 2, char73_stroke0 }, +}; + +/* char: 74 'J' */ + +static const CoordRec char74_stroke0[] = { + { 50.119, 100 }, + { 50.119, 23.8095 }, + { 45.3571, 9.5238 }, + { 40.5952, 4.7619 }, + { 31.0714, 0 }, + { 21.5476, 0 }, + { 12.0238, 4.7619 }, + { 7.2619, 9.5238 }, + { 2.5, 23.8095 }, + { 2.5, 33.3333 }, +}; + +static const StrokeRec char74[] = { + { 10, char74_stroke0 }, +}; + +/* char: 75 'K' */ + +static const CoordRec char75_stroke0[] = { + { 11.28, 100 }, + { 11.28, 0 }, +}; + +static const CoordRec char75_stroke1[] = { + { 77.9467, 100 }, + { 11.28, 33.3333 }, +}; + +static const CoordRec char75_stroke2[] = { + { 35.0895, 57.1429 }, + { 77.9467, 0 }, +}; + +static const StrokeRec char75[] = { + { 2, char75_stroke0 }, + { 2, char75_stroke1 }, + { 2, char75_stroke2 }, +}; + +/* char: 76 'L' */ + +static const CoordRec char76_stroke0[] = { + { 11.68, 100 }, + { 11.68, 0 }, +}; + +static const CoordRec char76_stroke1[] = { + { 11.68, 0 }, + { 68.8229, 0 }, +}; + +static const StrokeRec char76[] = { + { 2, char76_stroke0 }, + { 2, char76_stroke1 }, +}; + +/* char: 77 'M' */ + +static const CoordRec char77_stroke0[] = { + { 10.86, 100 }, + { 10.86, 0 }, +}; + +static const CoordRec char77_stroke1[] = { + { 10.86, 100 }, + { 48.9552, 0 }, +}; + +static const CoordRec char77_stroke2[] = { + { 87.0505, 100 }, + { 48.9552, 0 }, +}; + +static const CoordRec char77_stroke3[] = { + { 87.0505, 100 }, + { 87.0505, 0 }, +}; + +static const StrokeRec char77[] = { + { 2, char77_stroke0 }, + { 2, char77_stroke1 }, + { 2, char77_stroke2 }, + { 2, char77_stroke3 }, +}; + +/* char: 78 'N' */ + +static const CoordRec char78_stroke0[] = { + { 11.14, 100 }, + { 11.14, 0 }, +}; + +static const CoordRec char78_stroke1[] = { + { 11.14, 100 }, + { 77.8067, 0 }, +}; + +static const CoordRec char78_stroke2[] = { + { 77.8067, 100 }, + { 77.8067, 0 }, +}; + +static const StrokeRec char78[] = { + { 2, char78_stroke0 }, + { 2, char78_stroke1 }, + { 2, char78_stroke2 }, +}; + +/* char: 79 'O' */ + +static const CoordRec char79_stroke0[] = { + { 34.8114, 100 }, + { 25.2876, 95.2381 }, + { 15.7638, 85.7143 }, + { 11.0019, 76.1905 }, + { 6.24, 61.9048 }, + { 6.24, 38.0952 }, + { 11.0019, 23.8095 }, + { 15.7638, 14.2857 }, + { 25.2876, 4.7619 }, + { 34.8114, 0 }, + { 53.859, 0 }, + { 63.3829, 4.7619 }, + { 72.9067, 14.2857 }, + { 77.6686, 23.8095 }, + { 82.4305, 38.0952 }, + { 82.4305, 61.9048 }, + { 77.6686, 76.1905 }, + { 72.9067, 85.7143 }, + { 63.3829, 95.2381 }, + { 53.859, 100 }, + { 34.8114, 100 }, +}; + +static const StrokeRec char79[] = { + { 21, char79_stroke0 }, +}; + +/* char: 80 'P' */ + +static const CoordRec char80_stroke0[] = { + { 12.1, 100 }, + { 12.1, 0 }, +}; + +static const CoordRec char80_stroke1[] = { + { 12.1, 100 }, + { 54.9571, 100 }, + { 69.2429, 95.2381 }, + { 74.0048, 90.4762 }, + { 78.7667, 80.9524 }, + { 78.7667, 66.6667 }, + { 74.0048, 57.1429 }, + { 69.2429, 52.381 }, + { 54.9571, 47.619 }, + { 12.1, 47.619 }, +}; + +static const StrokeRec char80[] = { + { 2, char80_stroke0 }, + { 10, char80_stroke1 }, +}; + +/* char: 81 'Q' */ + +static const CoordRec char81_stroke0[] = { + { 33.8714, 100 }, + { 24.3476, 95.2381 }, + { 14.8238, 85.7143 }, + { 10.0619, 76.1905 }, + { 5.3, 61.9048 }, + { 5.3, 38.0952 }, + { 10.0619, 23.8095 }, + { 14.8238, 14.2857 }, + { 24.3476, 4.7619 }, + { 33.8714, 0 }, + { 52.919, 0 }, + { 62.4429, 4.7619 }, + { 71.9667, 14.2857 }, + { 76.7286, 23.8095 }, + { 81.4905, 38.0952 }, + { 81.4905, 61.9048 }, + { 76.7286, 76.1905 }, + { 71.9667, 85.7143 }, + { 62.4429, 95.2381 }, + { 52.919, 100 }, + { 33.8714, 100 }, +}; + +static const CoordRec char81_stroke1[] = { + { 48.1571, 19.0476 }, + { 76.7286, -9.5238 }, +}; + +static const StrokeRec char81[] = { + { 21, char81_stroke0 }, + { 2, char81_stroke1 }, +}; + +/* char: 82 'R' */ + +static const CoordRec char82_stroke0[] = { + { 11.68, 100 }, + { 11.68, 0 }, +}; + +static const CoordRec char82_stroke1[] = { + { 11.68, 100 }, + { 54.5371, 100 }, + { 68.8229, 95.2381 }, + { 73.5848, 90.4762 }, + { 78.3467, 80.9524 }, + { 78.3467, 71.4286 }, + { 73.5848, 61.9048 }, + { 68.8229, 57.1429 }, + { 54.5371, 52.381 }, + { 11.68, 52.381 }, +}; + +static const CoordRec char82_stroke2[] = { + { 45.0133, 52.381 }, + { 78.3467, 0 }, +}; + +static const StrokeRec char82[] = { + { 2, char82_stroke0 }, + { 10, char82_stroke1 }, + { 2, char82_stroke2 }, +}; + +/* char: 83 'S' */ + +static const CoordRec char83_stroke0[] = { + { 74.6667, 85.7143 }, + { 65.1429, 95.2381 }, + { 50.8571, 100 }, + { 31.8095, 100 }, + { 17.5238, 95.2381 }, + { 8, 85.7143 }, + { 8, 76.1905 }, + { 12.7619, 66.6667 }, + { 17.5238, 61.9048 }, + { 27.0476, 57.1429 }, + { 55.619, 47.619 }, + { 65.1429, 42.8571 }, + { 69.9048, 38.0952 }, + { 74.6667, 28.5714 }, + { 74.6667, 14.2857 }, + { 65.1429, 4.7619 }, + { 50.8571, 0 }, + { 31.8095, 0 }, + { 17.5238, 4.7619 }, + { 8, 14.2857 }, +}; + +static const StrokeRec char83[] = { + { 20, char83_stroke0 }, +}; + +/* char: 84 'T' */ + +static const CoordRec char84_stroke0[] = { + { 35.6933, 100 }, + { 35.6933, 0 }, +}; + +static const CoordRec char84_stroke1[] = { + { 2.36, 100 }, + { 69.0267, 100 }, +}; + +static const StrokeRec char84[] = { + { 2, char84_stroke0 }, + { 2, char84_stroke1 }, +}; + +/* char: 85 'U' */ + +static const CoordRec char85_stroke0[] = { + { 11.54, 100 }, + { 11.54, 28.5714 }, + { 16.3019, 14.2857 }, + { 25.8257, 4.7619 }, + { 40.1114, 0 }, + { 49.6352, 0 }, + { 63.921, 4.7619 }, + { 73.4448, 14.2857 }, + { 78.2067, 28.5714 }, + { 78.2067, 100 }, +}; + +static const StrokeRec char85[] = { + { 10, char85_stroke0 }, +}; + +/* char: 86 'V' */ + +static const CoordRec char86_stroke0[] = { + { 2.36, 100 }, + { 40.4552, 0 }, +}; + +static const CoordRec char86_stroke1[] = { + { 78.5505, 100 }, + { 40.4552, 0 }, +}; + +static const StrokeRec char86[] = { + { 2, char86_stroke0 }, + { 2, char86_stroke1 }, +}; + +/* char: 87 'W' */ + +static const CoordRec char87_stroke0[] = { + { 2.22, 100 }, + { 26.0295, 0 }, +}; + +static const CoordRec char87_stroke1[] = { + { 49.839, 100 }, + { 26.0295, 0 }, +}; + +static const CoordRec char87_stroke2[] = { + { 49.839, 100 }, + { 73.6486, 0 }, +}; + +static const CoordRec char87_stroke3[] = { + { 97.4581, 100 }, + { 73.6486, 0 }, +}; + +static const StrokeRec char87[] = { + { 2, char87_stroke0 }, + { 2, char87_stroke1 }, + { 2, char87_stroke2 }, + { 2, char87_stroke3 }, +}; + +/* char: 88 'X' */ + +static const CoordRec char88_stroke0[] = { + { 2.5, 100 }, + { 69.1667, 0 }, +}; + +static const CoordRec char88_stroke1[] = { + { 69.1667, 100 }, + { 2.5, 0 }, +}; + +static const StrokeRec char88[] = { + { 2, char88_stroke0 }, + { 2, char88_stroke1 }, +}; + +/* char: 89 'Y' */ + +static const CoordRec char89_stroke0[] = { + { 1.52, 100 }, + { 39.6152, 52.381 }, + { 39.6152, 0 }, +}; + +static const CoordRec char89_stroke1[] = { + { 77.7105, 100 }, + { 39.6152, 52.381 }, +}; + +static const StrokeRec char89[] = { + { 3, char89_stroke0 }, + { 2, char89_stroke1 }, +}; + +/* char: 90 'Z' */ + +static const CoordRec char90_stroke0[] = { + { 69.1667, 100 }, + { 2.5, 0 }, +}; + +static const CoordRec char90_stroke1[] = { + { 2.5, 100 }, + { 69.1667, 100 }, +}; + +static const CoordRec char90_stroke2[] = { + { 2.5, 0 }, + { 69.1667, 0 }, +}; + +static const StrokeRec char90[] = { + { 2, char90_stroke0 }, + { 2, char90_stroke1 }, + { 2, char90_stroke2 }, +}; + +/* char: 91 '[' */ + +static const CoordRec char91_stroke0[] = { + { 7.78, 119.048 }, + { 7.78, -33.3333 }, +}; + +static const CoordRec char91_stroke1[] = { + { 12.5419, 119.048 }, + { 12.5419, -33.3333 }, +}; + +static const CoordRec char91_stroke2[] = { + { 7.78, 119.048 }, + { 41.1133, 119.048 }, +}; + +static const CoordRec char91_stroke3[] = { + { 7.78, -33.3333 }, + { 41.1133, -33.3333 }, +}; + +static const StrokeRec char91[] = { + { 2, char91_stroke0 }, + { 2, char91_stroke1 }, + { 2, char91_stroke2 }, + { 2, char91_stroke3 }, +}; + +/* char: 92 '\' */ + +static const CoordRec char92_stroke0[] = { + { 5.84, 100 }, + { 72.5067, -14.2857 }, +}; + +static const StrokeRec char92[] = { + { 2, char92_stroke0 }, +}; + +/* char: 93 ']' */ + +static const CoordRec char93_stroke0[] = { + { 33.0114, 119.048 }, + { 33.0114, -33.3333 }, +}; + +static const CoordRec char93_stroke1[] = { + { 37.7733, 119.048 }, + { 37.7733, -33.3333 }, +}; + +static const CoordRec char93_stroke2[] = { + { 4.44, 119.048 }, + { 37.7733, 119.048 }, +}; + +static const CoordRec char93_stroke3[] = { + { 4.44, -33.3333 }, + { 37.7733, -33.3333 }, +}; + +static const StrokeRec char93[] = { + { 2, char93_stroke0 }, + { 2, char93_stroke1 }, + { 2, char93_stroke2 }, + { 2, char93_stroke3 }, +}; + +/* char: 94 '^' */ + +static const CoordRec char94_stroke0[] = { + { 44.0752, 109.524 }, + { 5.98, 42.8571 }, +}; + +static const CoordRec char94_stroke1[] = { + { 44.0752, 109.524 }, + { 82.1705, 42.8571 }, +}; + +static const StrokeRec char94[] = { + { 2, char94_stroke0 }, + { 2, char94_stroke1 }, +}; + +/* char: 95 '_' */ + +static const CoordRec char95_stroke0[] = { + { -1.1, -33.3333 }, + { 103.662, -33.3333 }, + { 103.662, -28.5714 }, + { -1.1, -28.5714 }, + { -1.1, -33.3333 }, +}; + +static const StrokeRec char95[] = { + { 5, char95_stroke0 }, +}; + +/* char: 96 '`' */ + +static const CoordRec char96_stroke0[] = { + { 33.0219, 100 }, + { 56.8314, 71.4286 }, +}; + +static const CoordRec char96_stroke1[] = { + { 33.0219, 100 }, + { 28.26, 95.2381 }, + { 56.8314, 71.4286 }, +}; + +static const StrokeRec char96[] = { + { 2, char96_stroke0 }, + { 3, char96_stroke1 }, +}; + +/* char: 97 'a' */ + +static const CoordRec char97_stroke0[] = { + { 63.8229, 66.6667 }, + { 63.8229, 0 }, +}; + +static const CoordRec char97_stroke1[] = { + { 63.8229, 52.381 }, + { 54.299, 61.9048 }, + { 44.7752, 66.6667 }, + { 30.4895, 66.6667 }, + { 20.9657, 61.9048 }, + { 11.4419, 52.381 }, + { 6.68, 38.0952 }, + { 6.68, 28.5714 }, + { 11.4419, 14.2857 }, + { 20.9657, 4.7619 }, + { 30.4895, 0 }, + { 44.7752, 0 }, + { 54.299, 4.7619 }, + { 63.8229, 14.2857 }, +}; + +static const StrokeRec char97[] = { + { 2, char97_stroke0 }, + { 14, char97_stroke1 }, +}; + +/* char: 98 'b' */ + +static const CoordRec char98_stroke0[] = { + { 8.76, 100 }, + { 8.76, 0 }, +}; + +static const CoordRec char98_stroke1[] = { + { 8.76, 52.381 }, + { 18.2838, 61.9048 }, + { 27.8076, 66.6667 }, + { 42.0933, 66.6667 }, + { 51.6171, 61.9048 }, + { 61.141, 52.381 }, + { 65.9029, 38.0952 }, + { 65.9029, 28.5714 }, + { 61.141, 14.2857 }, + { 51.6171, 4.7619 }, + { 42.0933, 0 }, + { 27.8076, 0 }, + { 18.2838, 4.7619 }, + { 8.76, 14.2857 }, +}; + +static const StrokeRec char98[] = { + { 2, char98_stroke0 }, + { 14, char98_stroke1 }, +}; + +/* char: 99 'c' */ + +static const CoordRec char99_stroke0[] = { + { 62.6629, 52.381 }, + { 53.139, 61.9048 }, + { 43.6152, 66.6667 }, + { 29.3295, 66.6667 }, + { 19.8057, 61.9048 }, + { 10.2819, 52.381 }, + { 5.52, 38.0952 }, + { 5.52, 28.5714 }, + { 10.2819, 14.2857 }, + { 19.8057, 4.7619 }, + { 29.3295, 0 }, + { 43.6152, 0 }, + { 53.139, 4.7619 }, + { 62.6629, 14.2857 }, +}; + +static const StrokeRec char99[] = { + { 14, char99_stroke0 }, +}; + +/* char: 100 'd' */ + +static const CoordRec char100_stroke0[] = { + { 61.7829, 100 }, + { 61.7829, 0 }, +}; + +static const CoordRec char100_stroke1[] = { + { 61.7829, 52.381 }, + { 52.259, 61.9048 }, + { 42.7352, 66.6667 }, + { 28.4495, 66.6667 }, + { 18.9257, 61.9048 }, + { 9.4019, 52.381 }, + { 4.64, 38.0952 }, + { 4.64, 28.5714 }, + { 9.4019, 14.2857 }, + { 18.9257, 4.7619 }, + { 28.4495, 0 }, + { 42.7352, 0 }, + { 52.259, 4.7619 }, + { 61.7829, 14.2857 }, +}; + +static const StrokeRec char100[] = { + { 2, char100_stroke0 }, + { 14, char100_stroke1 }, +}; + +/* char: 101 'e' */ + +static const CoordRec char101_stroke0[] = { + { 5.72, 38.0952 }, + { 62.8629, 38.0952 }, + { 62.8629, 47.619 }, + { 58.101, 57.1429 }, + { 53.339, 61.9048 }, + { 43.8152, 66.6667 }, + { 29.5295, 66.6667 }, + { 20.0057, 61.9048 }, + { 10.4819, 52.381 }, + { 5.72, 38.0952 }, + { 5.72, 28.5714 }, + { 10.4819, 14.2857 }, + { 20.0057, 4.7619 }, + { 29.5295, 0 }, + { 43.8152, 0 }, + { 53.339, 4.7619 }, + { 62.8629, 14.2857 }, +}; + +static const StrokeRec char101[] = { + { 17, char101_stroke0 }, +}; + +/* char: 102 'f' */ + +static const CoordRec char102_stroke0[] = { + { 38.7752, 100 }, + { 29.2514, 100 }, + { 19.7276, 95.2381 }, + { 14.9657, 80.9524 }, + { 14.9657, 0 }, +}; + +static const CoordRec char102_stroke1[] = { + { 0.68, 66.6667 }, + { 34.0133, 66.6667 }, +}; + +static const StrokeRec char102[] = { + { 5, char102_stroke0 }, + { 2, char102_stroke1 }, +}; + +/* char: 103 'g' */ + +static const CoordRec char103_stroke0[] = { + { 62.5029, 66.6667 }, + { 62.5029, -9.5238 }, + { 57.741, -23.8095 }, + { 52.979, -28.5714 }, + { 43.4552, -33.3333 }, + { 29.1695, -33.3333 }, + { 19.6457, -28.5714 }, +}; + +static const CoordRec char103_stroke1[] = { + { 62.5029, 52.381 }, + { 52.979, 61.9048 }, + { 43.4552, 66.6667 }, + { 29.1695, 66.6667 }, + { 19.6457, 61.9048 }, + { 10.1219, 52.381 }, + { 5.36, 38.0952 }, + { 5.36, 28.5714 }, + { 10.1219, 14.2857 }, + { 19.6457, 4.7619 }, + { 29.1695, 0 }, + { 43.4552, 0 }, + { 52.979, 4.7619 }, + { 62.5029, 14.2857 }, +}; + +static const StrokeRec char103[] = { + { 7, char103_stroke0 }, + { 14, char103_stroke1 }, +}; + +/* char: 104 'h' */ + +static const CoordRec char104_stroke0[] = { + { 9.6, 100 }, + { 9.6, 0 }, +}; + +static const CoordRec char104_stroke1[] = { + { 9.6, 47.619 }, + { 23.8857, 61.9048 }, + { 33.4095, 66.6667 }, + { 47.6952, 66.6667 }, + { 57.219, 61.9048 }, + { 61.981, 47.619 }, + { 61.981, 0 }, +}; + +static const StrokeRec char104[] = { + { 2, char104_stroke0 }, + { 7, char104_stroke1 }, +}; + +/* char: 105 'i' */ + +static const CoordRec char105_stroke0[] = { + { 10.02, 100 }, + { 14.7819, 95.2381 }, + { 19.5438, 100 }, + { 14.7819, 104.762 }, + { 10.02, 100 }, +}; + +static const CoordRec char105_stroke1[] = { + { 14.7819, 66.6667 }, + { 14.7819, 0 }, +}; + +static const StrokeRec char105[] = { + { 5, char105_stroke0 }, + { 2, char105_stroke1 }, +}; + +/* char: 106 'j' */ + +static const CoordRec char106_stroke0[] = { + { 17.3876, 100 }, + { 22.1495, 95.2381 }, + { 26.9114, 100 }, + { 22.1495, 104.762 }, + { 17.3876, 100 }, +}; + +static const CoordRec char106_stroke1[] = { + { 22.1495, 66.6667 }, + { 22.1495, -14.2857 }, + { 17.3876, -28.5714 }, + { 7.8638, -33.3333 }, + { -1.66, -33.3333 }, +}; + +static const StrokeRec char106[] = { + { 5, char106_stroke0 }, + { 5, char106_stroke1 }, +}; + +/* char: 107 'k' */ + +static const CoordRec char107_stroke0[] = { + { 9.6, 100 }, + { 9.6, 0 }, +}; + +static const CoordRec char107_stroke1[] = { + { 57.219, 66.6667 }, + { 9.6, 19.0476 }, +}; + +static const CoordRec char107_stroke2[] = { + { 28.6476, 38.0952 }, + { 61.981, 0 }, +}; + +static const StrokeRec char107[] = { + { 2, char107_stroke0 }, + { 2, char107_stroke1 }, + { 2, char107_stroke2 }, +}; + +/* char: 108 'l' */ + +static const CoordRec char108_stroke0[] = { + { 10.02, 100 }, + { 10.02, 0 }, +}; + +static const StrokeRec char108[] = { + { 2, char108_stroke0 }, +}; + +/* char: 109 'm' */ + +static const CoordRec char109_stroke0[] = { + { 9.6, 66.6667 }, + { 9.6, 0 }, +}; + +static const CoordRec char109_stroke1[] = { + { 9.6, 47.619 }, + { 23.8857, 61.9048 }, + { 33.4095, 66.6667 }, + { 47.6952, 66.6667 }, + { 57.219, 61.9048 }, + { 61.981, 47.619 }, + { 61.981, 0 }, +}; + +static const CoordRec char109_stroke2[] = { + { 61.981, 47.619 }, + { 76.2667, 61.9048 }, + { 85.7905, 66.6667 }, + { 100.076, 66.6667 }, + { 109.6, 61.9048 }, + { 114.362, 47.619 }, + { 114.362, 0 }, +}; + +static const StrokeRec char109[] = { + { 2, char109_stroke0 }, + { 7, char109_stroke1 }, + { 7, char109_stroke2 }, +}; + +/* char: 110 'n' */ + +static const CoordRec char110_stroke0[] = { + { 9.18, 66.6667 }, + { 9.18, 0 }, +}; + +static const CoordRec char110_stroke1[] = { + { 9.18, 47.619 }, + { 23.4657, 61.9048 }, + { 32.9895, 66.6667 }, + { 47.2752, 66.6667 }, + { 56.799, 61.9048 }, + { 61.561, 47.619 }, + { 61.561, 0 }, +}; + +static const StrokeRec char110[] = { + { 2, char110_stroke0 }, + { 7, char110_stroke1 }, +}; + +/* char: 111 'o' */ + +static const CoordRec char111_stroke0[] = { + { 28.7895, 66.6667 }, + { 19.2657, 61.9048 }, + { 9.7419, 52.381 }, + { 4.98, 38.0952 }, + { 4.98, 28.5714 }, + { 9.7419, 14.2857 }, + { 19.2657, 4.7619 }, + { 28.7895, 0 }, + { 43.0752, 0 }, + { 52.599, 4.7619 }, + { 62.1229, 14.2857 }, + { 66.8848, 28.5714 }, + { 66.8848, 38.0952 }, + { 62.1229, 52.381 }, + { 52.599, 61.9048 }, + { 43.0752, 66.6667 }, + { 28.7895, 66.6667 }, +}; + +static const StrokeRec char111[] = { + { 17, char111_stroke0 }, +}; + +/* char: 112 'p' */ + +static const CoordRec char112_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, -33.3333 }, +}; + +static const CoordRec char112_stroke1[] = { + { 9.46, 52.381 }, + { 18.9838, 61.9048 }, + { 28.5076, 66.6667 }, + { 42.7933, 66.6667 }, + { 52.3171, 61.9048 }, + { 61.841, 52.381 }, + { 66.6029, 38.0952 }, + { 66.6029, 28.5714 }, + { 61.841, 14.2857 }, + { 52.3171, 4.7619 }, + { 42.7933, 0 }, + { 28.5076, 0 }, + { 18.9838, 4.7619 }, + { 9.46, 14.2857 }, +}; + +static const StrokeRec char112[] = { + { 2, char112_stroke0 }, + { 14, char112_stroke1 }, +}; + +/* char: 113 'q' */ + +static const CoordRec char113_stroke0[] = { + { 61.9829, 66.6667 }, + { 61.9829, -33.3333 }, +}; + +static const CoordRec char113_stroke1[] = { + { 61.9829, 52.381 }, + { 52.459, 61.9048 }, + { 42.9352, 66.6667 }, + { 28.6495, 66.6667 }, + { 19.1257, 61.9048 }, + { 9.6019, 52.381 }, + { 4.84, 38.0952 }, + { 4.84, 28.5714 }, + { 9.6019, 14.2857 }, + { 19.1257, 4.7619 }, + { 28.6495, 0 }, + { 42.9352, 0 }, + { 52.459, 4.7619 }, + { 61.9829, 14.2857 }, +}; + +static const StrokeRec char113[] = { + { 2, char113_stroke0 }, + { 14, char113_stroke1 }, +}; + +/* char: 114 'r' */ + +static const CoordRec char114_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, 0 }, +}; + +static const CoordRec char114_stroke1[] = { + { 9.46, 38.0952 }, + { 14.2219, 52.381 }, + { 23.7457, 61.9048 }, + { 33.2695, 66.6667 }, + { 47.5552, 66.6667 }, +}; + +static const StrokeRec char114[] = { + { 2, char114_stroke0 }, + { 5, char114_stroke1 }, +}; + +/* char: 115 's' */ + +static const CoordRec char115_stroke0[] = { + { 57.081, 52.381 }, + { 52.319, 61.9048 }, + { 38.0333, 66.6667 }, + { 23.7476, 66.6667 }, + { 9.4619, 61.9048 }, + { 4.7, 52.381 }, + { 9.4619, 42.8571 }, + { 18.9857, 38.0952 }, + { 42.7952, 33.3333 }, + { 52.319, 28.5714 }, + { 57.081, 19.0476 }, + { 57.081, 14.2857 }, + { 52.319, 4.7619 }, + { 38.0333, 0 }, + { 23.7476, 0 }, + { 9.4619, 4.7619 }, + { 4.7, 14.2857 }, +}; + +static const StrokeRec char115[] = { + { 17, char115_stroke0 }, +}; + +/* char: 116 't' */ + +static const CoordRec char116_stroke0[] = { + { 14.8257, 100 }, + { 14.8257, 19.0476 }, + { 19.5876, 4.7619 }, + { 29.1114, 0 }, + { 38.6352, 0 }, +}; + +static const CoordRec char116_stroke1[] = { + { 0.54, 66.6667 }, + { 33.8733, 66.6667 }, +}; + +static const StrokeRec char116[] = { + { 5, char116_stroke0 }, + { 2, char116_stroke1 }, +}; + +/* char: 117 'u' */ + +static const CoordRec char117_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, 19.0476 }, + { 14.2219, 4.7619 }, + { 23.7457, 0 }, + { 38.0314, 0 }, + { 47.5552, 4.7619 }, + { 61.841, 19.0476 }, +}; + +static const CoordRec char117_stroke1[] = { + { 61.841, 66.6667 }, + { 61.841, 0 }, +}; + +static const StrokeRec char117[] = { + { 7, char117_stroke0 }, + { 2, char117_stroke1 }, +}; + +/* char: 118 'v' */ + +static const CoordRec char118_stroke0[] = { + { 1.8, 66.6667 }, + { 30.3714, 0 }, +}; + +static const CoordRec char118_stroke1[] = { + { 58.9429, 66.6667 }, + { 30.3714, 0 }, +}; + +static const StrokeRec char118[] = { + { 2, char118_stroke0 }, + { 2, char118_stroke1 }, +}; + +/* char: 119 'w' */ + +static const CoordRec char119_stroke0[] = { + { 2.5, 66.6667 }, + { 21.5476, 0 }, +}; + +static const CoordRec char119_stroke1[] = { + { 40.5952, 66.6667 }, + { 21.5476, 0 }, +}; + +static const CoordRec char119_stroke2[] = { + { 40.5952, 66.6667 }, + { 59.6429, 0 }, +}; + +static const CoordRec char119_stroke3[] = { + { 78.6905, 66.6667 }, + { 59.6429, 0 }, +}; + +static const StrokeRec char119[] = { + { 2, char119_stroke0 }, + { 2, char119_stroke1 }, + { 2, char119_stroke2 }, + { 2, char119_stroke3 }, +}; + +/* char: 120 'x' */ + +static const CoordRec char120_stroke0[] = { + { 1.66, 66.6667 }, + { 54.041, 0 }, +}; + +static const CoordRec char120_stroke1[] = { + { 54.041, 66.6667 }, + { 1.66, 0 }, +}; + +static const StrokeRec char120[] = { + { 2, char120_stroke0 }, + { 2, char120_stroke1 }, +}; + +/* char: 121 'y' */ + +static const CoordRec char121_stroke0[] = { + { 6.5619, 66.6667 }, + { 35.1333, 0 }, +}; + +static const CoordRec char121_stroke1[] = { + { 63.7048, 66.6667 }, + { 35.1333, 0 }, + { 25.6095, -19.0476 }, + { 16.0857, -28.5714 }, + { 6.5619, -33.3333 }, + { 1.8, -33.3333 }, +}; + +static const StrokeRec char121[] = { + { 2, char121_stroke0 }, + { 6, char121_stroke1 }, +}; + +/* char: 122 'z' */ + +static const CoordRec char122_stroke0[] = { + { 56.821, 66.6667 }, + { 4.44, 0 }, +}; + +static const CoordRec char122_stroke1[] = { + { 4.44, 66.6667 }, + { 56.821, 66.6667 }, +}; + +static const CoordRec char122_stroke2[] = { + { 4.44, 0 }, + { 56.821, 0 }, +}; + +static const StrokeRec char122[] = { + { 2, char122_stroke0 }, + { 2, char122_stroke1 }, + { 2, char122_stroke2 }, +}; + +/* char: 123 '{' */ + +static const CoordRec char123_stroke0[] = { + { 31.1895, 119.048 }, + { 21.6657, 114.286 }, + { 16.9038, 109.524 }, + { 12.1419, 100 }, + { 12.1419, 90.4762 }, + { 16.9038, 80.9524 }, + { 21.6657, 76.1905 }, + { 26.4276, 66.6667 }, + { 26.4276, 57.1429 }, + { 16.9038, 47.619 }, +}; + +static const CoordRec char123_stroke1[] = { + { 21.6657, 114.286 }, + { 16.9038, 104.762 }, + { 16.9038, 95.2381 }, + { 21.6657, 85.7143 }, + { 26.4276, 80.9524 }, + { 31.1895, 71.4286 }, + { 31.1895, 61.9048 }, + { 26.4276, 52.381 }, + { 7.38, 42.8571 }, + { 26.4276, 33.3333 }, + { 31.1895, 23.8095 }, + { 31.1895, 14.2857 }, + { 26.4276, 4.7619 }, + { 21.6657, 0 }, + { 16.9038, -9.5238 }, + { 16.9038, -19.0476 }, + { 21.6657, -28.5714 }, +}; + +static const CoordRec char123_stroke2[] = { + { 16.9038, 38.0952 }, + { 26.4276, 28.5714 }, + { 26.4276, 19.0476 }, + { 21.6657, 9.5238 }, + { 16.9038, 4.7619 }, + { 12.1419, -4.7619 }, + { 12.1419, -14.2857 }, + { 16.9038, -23.8095 }, + { 21.6657, -28.5714 }, + { 31.1895, -33.3333 }, +}; + +static const StrokeRec char123[] = { + { 10, char123_stroke0 }, + { 17, char123_stroke1 }, + { 10, char123_stroke2 }, +}; + +/* char: 124 '|' */ + +static const CoordRec char124_stroke0[] = { + { 11.54, 119.048 }, + { 11.54, -33.3333 }, +}; + +static const StrokeRec char124[] = { + { 2, char124_stroke0 }, +}; + +/* char: 125 '}' */ + +static const CoordRec char125_stroke0[] = { + { 9.18, 119.048 }, + { 18.7038, 114.286 }, + { 23.4657, 109.524 }, + { 28.2276, 100 }, + { 28.2276, 90.4762 }, + { 23.4657, 80.9524 }, + { 18.7038, 76.1905 }, + { 13.9419, 66.6667 }, + { 13.9419, 57.1429 }, + { 23.4657, 47.619 }, +}; + +static const CoordRec char125_stroke1[] = { + { 18.7038, 114.286 }, + { 23.4657, 104.762 }, + { 23.4657, 95.2381 }, + { 18.7038, 85.7143 }, + { 13.9419, 80.9524 }, + { 9.18, 71.4286 }, + { 9.18, 61.9048 }, + { 13.9419, 52.381 }, + { 32.9895, 42.8571 }, + { 13.9419, 33.3333 }, + { 9.18, 23.8095 }, + { 9.18, 14.2857 }, + { 13.9419, 4.7619 }, + { 18.7038, 0 }, + { 23.4657, -9.5238 }, + { 23.4657, -19.0476 }, + { 18.7038, -28.5714 }, +}; + +static const CoordRec char125_stroke2[] = { + { 23.4657, 38.0952 }, + { 13.9419, 28.5714 }, + { 13.9419, 19.0476 }, + { 18.7038, 9.5238 }, + { 23.4657, 4.7619 }, + { 28.2276, -4.7619 }, + { 28.2276, -14.2857 }, + { 23.4657, -23.8095 }, + { 18.7038, -28.5714 }, + { 9.18, -33.3333 }, +}; + +static const StrokeRec char125[] = { + { 10, char125_stroke0 }, + { 17, char125_stroke1 }, + { 10, char125_stroke2 }, +}; + +/* char: 126 '~' */ + +static const CoordRec char126_stroke0[] = { + { 2.92, 28.5714 }, + { 2.92, 38.0952 }, + { 7.6819, 52.381 }, + { 17.2057, 57.1429 }, + { 26.7295, 57.1429 }, + { 36.2533, 52.381 }, + { 55.301, 38.0952 }, + { 64.8248, 33.3333 }, + { 74.3486, 33.3333 }, + { 83.8724, 38.0952 }, + { 88.6343, 47.619 }, +}; + +static const CoordRec char126_stroke1[] = { + { 2.92, 38.0952 }, + { 7.6819, 47.619 }, + { 17.2057, 52.381 }, + { 26.7295, 52.381 }, + { 36.2533, 47.619 }, + { 55.301, 33.3333 }, + { 64.8248, 28.5714 }, + { 74.3486, 28.5714 }, + { 83.8724, 33.3333 }, + { 88.6343, 47.619 }, + { 88.6343, 57.1429 }, +}; + +static const StrokeRec char126[] = { + { 11, char126_stroke0 }, + { 11, char126_stroke1 }, +}; + +/* char: 127 */ + +static const CoordRec char127_stroke0[] = { + { 52.381, 100 }, + { 14.2857, -33.3333 }, +}; + +static const CoordRec char127_stroke1[] = { + { 28.5714, 66.6667 }, + { 14.2857, 61.9048 }, + { 4.7619, 52.381 }, + { 0, 38.0952 }, + { 0, 23.8095 }, + { 4.7619, 14.2857 }, + { 14.2857, 4.7619 }, + { 28.5714, 0 }, + { 38.0952, 0 }, + { 52.381, 4.7619 }, + { 61.9048, 14.2857 }, + { 66.6667, 28.5714 }, + { 66.6667, 42.8571 }, + { 61.9048, 52.381 }, + { 52.381, 61.9048 }, + { 38.0952, 66.6667 }, + { 28.5714, 66.6667 }, +}; + +static const StrokeRec char127[] = { + { 2, char127_stroke0 }, + { 17, char127_stroke1 }, +}; + +static const StrokeCharRec chars[] = { + { 0, /* char0 */ 0, 0, 0 }, + { 0, /* char1 */ 0, 0, 0 }, + { 0, /* char2 */ 0, 0, 0 }, + { 0, /* char3 */ 0, 0, 0 }, + { 0, /* char4 */ 0, 0, 0 }, + { 0, /* char5 */ 0, 0, 0 }, + { 0, /* char6 */ 0, 0, 0 }, + { 0, /* char7 */ 0, 0, 0 }, + { 0, /* char8 */ 0, 0, 0 }, + { 0, /* char9 */ 0, 0, 0 }, + { 0, /* char10 */ 0, 0, 0 }, + { 0, /* char11 */ 0, 0, 0 }, + { 0, /* char12 */ 0, 0, 0 }, + { 0, /* char13 */ 0, 0, 0 }, + { 0, /* char14 */ 0, 0, 0 }, + { 0, /* char15 */ 0, 0, 0 }, + { 0, /* char16 */ 0, 0, 0 }, + { 0, /* char17 */ 0, 0, 0 }, + { 0, /* char18 */ 0, 0, 0 }, + { 0, /* char19 */ 0, 0, 0 }, + { 0, /* char20 */ 0, 0, 0 }, + { 0, /* char21 */ 0, 0, 0 }, + { 0, /* char22 */ 0, 0, 0 }, + { 0, /* char23 */ 0, 0, 0 }, + { 0, /* char24 */ 0, 0, 0 }, + { 0, /* char25 */ 0, 0, 0 }, + { 0, /* char26 */ 0, 0, 0 }, + { 0, /* char27 */ 0, 0, 0 }, + { 0, /* char28 */ 0, 0, 0 }, + { 0, /* char29 */ 0, 0, 0 }, + { 0, /* char30 */ 0, 0, 0 }, + { 0, /* char31 */ 0, 0, 0 }, + { 0, /* char32 */ 0, 52.381, 104.762 }, + { 2, char33, 13.3819, 26.6238 }, + { 2, char34, 23.0676, 51.4352 }, + { 4, char35, 36.5333, 79.4886 }, + { 3, char36, 38.1533, 76.2067 }, + { 3, char37, 49.2171, 96.5743 }, + { 1, char38, 53.599, 101.758 }, + { 1, char39, 4.44, 13.62 }, + { 1, char40, 21.8657, 47.1733 }, + { 1, char41, 24.3276, 47.5333 }, + { 3, char42, 30.7695, 59.439 }, + { 2, char43, 48.8371, 97.2543 }, + { 1, char44, 13.5219, 26.0638 }, + { 1, char45, 50.2371, 100.754 }, + { 1, char46, 13.1019, 26.4838 }, + { 1, char47, 40.5733, 82.1067 }, + { 1, char48, 38.3133, 77.0667 }, + { 1, char49, 30.8676, 66.5295 }, + { 1, char50, 38.7533, 77.6467 }, + { 1, char51, 38.3333, 77.0467 }, + { 2, char52, 37.2133, 80.1686 }, + { 1, char53, 38.1933, 77.6867 }, + { 1, char54, 34.1514, 73.8048 }, + { 2, char55, 38.8933, 77.2267 }, + { 1, char56, 38.9333, 77.6667 }, + { 1, char57, 39.9333, 74.0648 }, + { 2, char58, 14.0819, 26.2238 }, + { 2, char59, 12.9619, 26.3038 }, + { 1, char60, 41.1552, 81.6105 }, + { 2, char61, 48.5571, 97.2543 }, + { 1, char62, 40.8752, 81.6105 }, + { 2, char63, 36.9914, 73.9029 }, + { 2, char64, 34.9314, 74.3648 }, + { 3, char65, 40.5952, 80.4905 }, + { 3, char66, 44.7533, 83.6267 }, + { 1, char67, 39.9933, 84.4886 }, + { 2, char68, 45.2933, 85.2867 }, + { 4, char69, 39.9914, 78.1848 }, + { 3, char70, 39.9914, 78.7448 }, + { 2, char71, 40.3933, 89.7686 }, + { 3, char72, 44.7533, 89.0867 }, + { 1, char73, 10.86, 21.3 }, + { 1, char74, 31.0714, 59.999 }, + { 3, char75, 44.6133, 79.3267 }, + { 2, char76, 40.2514, 71.3229 }, + { 4, char77, 48.9552, 97.2105 }, + { 3, char78, 44.4733, 88.8067 }, + { 1, char79, 44.3352, 88.8305 }, + { 2, char80, 45.4333, 85.6667 }, + { 2, char81, 43.3952, 88.0905 }, + { 3, char82, 45.0133, 82.3667 }, + { 1, char83, 41.3333, 80.8267 }, + { 2, char84, 35.6933, 71.9467 }, + { 1, char85, 44.8733, 89.4867 }, + { 2, char86, 40.4552, 81.6105 }, + { 4, char87, 49.839, 100.518 }, + { 2, char88, 35.8333, 72.3667 }, + { 2, char89, 39.6152, 79.6505 }, + { 3, char90, 35.8333, 73.7467 }, + { 4, char91, 22.0657, 46.1133 }, + { 1, char92, 39.1733, 78.2067 }, + { 4, char93, 23.4876, 46.3933 }, + { 2, char94, 44.0752, 90.2305 }, + { 1, char95, 51.281, 104.062 }, + { 2, char96, 42.5457, 83.5714 }, + { 2, char97, 35.2514, 66.6029 }, + { 2, char98, 37.3314, 70.4629 }, + { 1, char99, 34.0914, 68.9229 }, + { 2, char100, 33.2114, 70.2629 }, + { 1, char101, 34.2914, 68.5229 }, + { 2, char102, 14.9657, 38.6552 }, + { 2, char103, 33.9314, 70.9829 }, + { 2, char104, 33.4095, 71.021 }, + { 2, char105, 14.7819, 28.8638 }, + { 2, char106, 17.3876, 36.2314 }, + { 3, char107, 33.4095, 62.521 }, + { 1, char108, 10.02, 19.34 }, + { 3, char109, 61.981, 123.962 }, + { 2, char110, 32.9895, 70.881 }, + { 1, char111, 33.5514, 71.7448 }, + { 2, char112, 38.0314, 70.8029 }, + { 2, char113, 33.4114, 70.7429 }, + { 2, char114, 23.7457, 49.4952 }, + { 1, char115, 28.5095, 62.321 }, + { 2, char116, 14.8257, 39.3152 }, + { 2, char117, 33.2695, 71.161 }, + { 2, char118, 30.3714, 60.6029 }, + { 4, char119, 40.5952, 80.4905 }, + { 2, char120, 25.4695, 56.401 }, + { 2, char121, 35.1333, 66.0648 }, + { 3, char122, 28.2495, 61.821 }, + { 3, char123, 21.6657, 41.6295 }, + { 1, char124, 11.54, 23.78 }, + { 3, char125, 18.7038, 41.4695 }, + { 2, char126, 45.7771, 91.2743 }, + { 2, char127, 33.3333, 66.6667 }, +}; + +StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 }; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_shapes.c xpsb-glx-0.19/mesa/src/glut/glx/glut_shapes.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_shapes.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_shapes.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,596 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include "glutint.h" + +/* Some files do not define M_PI... */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +static GLUquadricObj *quadObj; + +#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } + +static void +initQuadObj(void) +{ + quadObj = gluNewQuadric(); + if (!quadObj) + __glutFatalError("out of memory."); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void GLUTAPIENTRY +glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void GLUTAPIENTRY +glutWireCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +void GLUTAPIENTRY +glutSolidCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +/* ENDCENTRY */ + +static void +drawBox(GLfloat size, GLenum type) +{ + static GLfloat n[6][3] = + { + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {1.0, 0.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} + }; + static GLint faces[6][4] = + { + {0, 1, 2, 3}, + {3, 2, 6, 7}, + {7, 6, 5, 4}, + {4, 5, 1, 0}, + {5, 6, 2, 1}, + {7, 4, 0, 3} + }; + GLfloat v[8][3]; + GLint i; + + v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; + v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; + v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; + v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; + v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; + v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; + + for (i = 5; i >= 0; i--) { + glBegin(type); + glNormal3fv(&n[i][0]); + glVertex3fv(&v[faces[i][0]][0]); + glVertex3fv(&v[faces[i][1]][0]); + glVertex3fv(&v[faces[i][2]][0]); + glVertex3fv(&v[faces[i][3]][0]); + glEnd(); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireCube(GLdouble size) +{ + drawBox(size, GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidCube(GLdouble size) +{ + drawBox(size, GL_QUADS); +} + +/* ENDCENTRY */ + +static void +doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) +{ + int i, j; + GLfloat theta, phi, theta1; + GLfloat cosTheta, sinTheta; + GLfloat cosTheta1, sinTheta1; + GLfloat ringDelta, sideDelta; + + ringDelta = 2.0 * M_PI / rings; + sideDelta = 2.0 * M_PI / nsides; + + theta = 0.0; + cosTheta = 1.0; + sinTheta = 0.0; + for (i = rings - 1; i >= 0; i--) { + theta1 = theta + ringDelta; + cosTheta1 = cos(theta1); + sinTheta1 = sin(theta1); + glBegin(GL_QUAD_STRIP); + phi = 0.0; + for (j = nsides; j >= 0; j--) { + GLfloat cosPhi, sinPhi, dist; + + phi += sideDelta; + cosPhi = cos(phi); + sinPhi = sin(phi); + dist = R + r * cosPhi; + + glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); + glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); + glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); + glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); + } + glEnd(); + theta = theta1; + cosTheta = cosTheta1; + sinTheta = sinTheta1; + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + doughnut(innerRadius, outerRadius, nsides, rings); + glPopAttrib(); +} + +void GLUTAPIENTRY +glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + doughnut(innerRadius, outerRadius, nsides, rings); +} + +/* ENDCENTRY */ + +static GLfloat dodec[20][3]; + +static void +initDodecahedron(void) +{ + GLfloat alpha, beta; + + alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); + beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - + 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); + /* *INDENT-OFF* */ + dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; + dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; + dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; + dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; + dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; + dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; + dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; + dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; + dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; + dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; + dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; + dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; + dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; + dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; + dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; + dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; + dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; + dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; + dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; + dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; + /* *INDENT-ON* */ + +} + +#define DIFF3(_a,_b,_c) { \ + (_c)[0] = (_a)[0] - (_b)[0]; \ + (_c)[1] = (_a)[1] - (_b)[1]; \ + (_c)[2] = (_a)[2] - (_b)[2]; \ +} + +static void +crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) +{ + GLfloat p[3]; /* in case prod == v1 or v2 */ + + p[0] = v1[1] * v2[2] - v2[1] * v1[2]; + p[1] = v1[2] * v2[0] - v2[2] * v1[0]; + p[2] = v1[0] * v2[1] - v2[0] * v1[1]; + prod[0] = p[0]; + prod[1] = p[1]; + prod[2] = p[2]; +} + +static void +normalize(GLfloat v[3]) +{ + GLfloat d; + + d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + if (d == 0.0) { + __glutWarning("normalize: zero length vector"); + v[0] = d = 1.0; + } + d = 1 / d; + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +static void +pentagon(int a, int b, int c, int d, int e, GLenum shadeType) +{ + GLfloat n0[3], d1[3], d2[3]; + + DIFF3(dodec[a], dodec[b], d1); + DIFF3(dodec[b], dodec[c], d2); + crossprod(d1, d2, n0); + normalize(n0); + + glBegin(shadeType); + glNormal3fv(n0); + glVertex3fv(&dodec[a][0]); + glVertex3fv(&dodec[b][0]); + glVertex3fv(&dodec[c][0]); + glVertex3fv(&dodec[d][0]); + glVertex3fv(&dodec[e][0]); + glEnd(); +} + +static void +dodecahedron(GLenum type) +{ + static int inited = 0; + + if (inited == 0) { + inited = 1; + initDodecahedron(); + } + pentagon(0, 1, 9, 16, 5, type); + pentagon(1, 0, 3, 18, 7, type); + pentagon(1, 7, 11, 10, 9, type); + pentagon(11, 7, 18, 19, 6, type); + pentagon(8, 17, 16, 9, 10, type); + pentagon(2, 14, 15, 6, 19, type); + pentagon(2, 13, 12, 4, 14, type); + pentagon(2, 19, 18, 3, 13, type); + pentagon(3, 0, 5, 12, 13, type); + pentagon(6, 15, 8, 10, 11, type); + pentagon(4, 17, 8, 15, 14, type); + pentagon(4, 12, 5, 16, 17, type); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireDodecahedron(void) +{ + dodecahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidDodecahedron(void) +{ + dodecahedron(GL_TRIANGLE_FAN); +} + +/* ENDCENTRY */ + +static void +recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, + GLenum shadeType) +{ + GLfloat q0[3], q1[3]; + + DIFF3(n1, n2, q0); + DIFF3(n2, n3, q1); + crossprod(q0, q1, q1); + normalize(q1); + + glBegin(shadeType); + glNormal3fv(q1); + glVertex3fv(n1); + glVertex3fv(n2); + glVertex3fv(n3); + glEnd(); +} + +static void +subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, + GLenum shadeType) +{ + int depth; + GLfloat w0[3], w1[3], w2[3]; + GLfloat l; + int i, j, k, n; + + depth = 1; + for (i = 0; i < depth; i++) { + for (j = 0; i + j < depth; j++) { + k = depth - i - j; + for (n = 0; n < 3; n++) { + w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; + w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) + / depth; + w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) + / depth; + } + l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); + w0[0] /= l; + w0[1] /= l; + w0[2] /= l; + l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); + w1[0] /= l; + w1[1] /= l; + w1[2] /= l; + l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); + w2[0] /= l; + w2[1] /= l; + w2[2] /= l; + recorditem(w1, w0, w2, shadeType); + } + } +} + +static void +drawtriangle(int i, GLfloat data[][3], int ndx[][3], + GLenum shadeType) +{ + GLfloat *x0, *x1, *x2; + + x0 = data[ndx[i][0]]; + x1 = data[ndx[i][1]]; + x2 = data[ndx[i][2]]; + subdivide(x0, x1, x2, shadeType); +} + +/* octahedron data: The octahedron produced is centered at the + origin and has radius 1.0 */ +static GLfloat odata[6][3] = +{ + {1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} +}; + +static int ondex[8][3] = +{ + {0, 4, 2}, + {1, 2, 4}, + {0, 3, 4}, + {1, 4, 3}, + {0, 2, 5}, + {1, 5, 2}, + {0, 5, 3}, + {1, 3, 5} +}; + +static void +octahedron(GLenum shadeType) +{ + int i; + + for (i = 7; i >= 0; i--) { + drawtriangle(i, odata, ondex, shadeType); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireOctahedron(void) +{ + octahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidOctahedron(void) +{ + octahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* icosahedron data: These numbers are rigged to make an + icosahedron of radius 1.0 */ + +#define X .525731112119133606 +#define Z .850650808352039932 + +static GLfloat idata[12][3] = +{ + {-X, 0, Z}, + {X, 0, Z}, + {-X, 0, -Z}, + {X, 0, -Z}, + {0, Z, X}, + {0, Z, -X}, + {0, -Z, X}, + {0, -Z, -X}, + {Z, X, 0}, + {-Z, X, 0}, + {Z, -X, 0}, + {-Z, -X, 0} +}; + +static int index[20][3] = +{ + {0, 4, 1}, + {0, 9, 4}, + {9, 5, 4}, + {4, 5, 8}, + {4, 8, 1}, + {8, 10, 1}, + {8, 3, 10}, + {5, 3, 8}, + {5, 2, 3}, + {2, 7, 3}, + {7, 10, 3}, + {7, 6, 10}, + {7, 11, 6}, + {11, 0, 6}, + {0, 1, 6}, + {6, 1, 10}, + {9, 0, 11}, + {9, 11, 2}, + {9, 2, 5}, + {7, 2, 11}, +}; + +static void +icosahedron(GLenum shadeType) +{ + int i; + + for (i = 19; i >= 0; i--) { + drawtriangle(i, idata, index, shadeType); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireIcosahedron(void) +{ + icosahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidIcosahedron(void) +{ + icosahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* tetrahedron data: */ + +#define T 1.73205080756887729 + +static GLfloat tdata[4][3] = +{ + {T, T, T}, + {T, -T, -T}, + {-T, T, -T}, + {-T, -T, T} +}; + +static int tndex[4][3] = +{ + {0, 1, 3}, + {2, 1, 0}, + {3, 2, 0}, + {1, 2, 3} +}; + +static void +tetrahedron(GLenum shadeType) +{ + int i; + + for (i = 3; i >= 0; i--) + drawtriangle(i, tdata, tndex, shadeType); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireTetrahedron(void) +{ + tetrahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidTetrahedron(void) +{ + tetrahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_space.c xpsb-glx-0.19/mesa/src/glut/glx/glut_space.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_space.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_space.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,35 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +void GLUTAPIENTRY +glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc) +{ + __glutCurrentWindow->spaceMotion = spaceMotionFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); +} + +void GLUTAPIENTRY +glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc) +{ + __glutCurrentWindow->spaceRotate = spaceRotateFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); +} + +void GLUTAPIENTRY +glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc) +{ + __glutCurrentWindow->spaceButton = spaceButtonFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_stroke.c xpsb-glx-0.19/mesa/src/glut/glx/glut_stroke.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_stroke.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_stroke.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutstroke.h" + +void GLUTAPIENTRY +glutStrokeCharacter(GLUTstrokeFont font, int c) +{ + const StrokeCharRec *ch; + const StrokeRec *stroke; + const CoordRec *coord; + StrokeFontPtr fontinfo; + int i, j; + + +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + if (c < 0 || c >= fontinfo->num_chars) + return; + ch = &(fontinfo->ch[c]); + if (ch) { + for (i = ch->num_strokes, stroke = ch->stroke; + i > 0; i--, stroke++) { + glBegin(GL_LINE_STRIP); + for (j = stroke->num_coords, coord = stroke->coord; + j > 0; j--, coord++) { + glVertex2f(coord->x, coord->y); + } + glEnd(); + } + glTranslatef(ch->right, 0.0, 0.0); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glutstroke.h xpsb-glx-0.19/mesa/src/glut/glx/glutstroke.h --- xpsb-glx-0.19/mesa/src/glut/glx/glutstroke.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glutstroke.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ +#ifndef __glutstroke_h__ +#define __glutstroke_h__ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#if defined(_WIN32) +#pragma warning (disable:4244) /* disable bogus conversion warnings */ +#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +#endif + +typedef struct { + float x; + float y; +} CoordRec, *CoordPtr; + +typedef struct { + int num_coords; + const CoordRec *coord; +} StrokeRec, *StrokePtr; + +typedef struct { + int num_strokes; + const StrokeRec *stroke; + float center; + float right; +} StrokeCharRec, *StrokeCharPtr; + +typedef struct { + const char *name; + int num_chars; + const StrokeCharRec *ch; + float top; + float bottom; +} StrokeFontRec, *StrokeFontPtr; + +typedef void *GLUTstrokeFont; + +#endif /* __glutstroke_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_swap.c xpsb-glx-0.19/mesa/src/glut/glx/glut_swap.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_swap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_swap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,71 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include "glutint.h" + +GLint __glutFPS = 0; +GLint __glutSwapCount = 0; +GLint __glutSwapTime = 0; + +/* CENTRY */ +void GLUTAPIENTRY +glutSwapBuffers(void) +{ + GLUTwindow *window = __glutCurrentWindow; + + if (__glutPPMFile) { + __glutWritePPMFile(); + } + + if (window->renderWin == window->win) { + if (__glutCurrentWindow->treatAsSingle) { + /* Pretend the double buffered window is single buffered, + so treat glutSwapBuffers as a no-op. */ + return; + } + } else { + if (__glutCurrentWindow->overlay->treatAsSingle) { + /* Pretend the double buffered overlay is single + buffered, so treat glutSwapBuffers as a no-op. */ + return; + } + } + + /* For the MESA_SWAP_HACK. */ + window->usedSwapBuffers = 1; + + SWAP_BUFFERS_LAYER(__glutCurrentWindow); + + /* I considered putting the window being swapped on the + GLUT_FINISH_WORK work list because you could call + glutSwapBuffers from an idle callback which doesn't call + __glutSetWindow which normally adds indirect rendering + windows to the GLUT_FINISH_WORK work list. Not being put + on the list could lead to the buffering up of multiple + redisplays and buffer swaps and hamper interactivity. I + consider this an application bug due to not using + glutPostRedisplay to trigger redraws. If + glutPostRedisplay were used, __glutSetWindow would be + called and a glFinish to throttle buffering would occur. */ + + if (__glutFPS) { + GLint t = glutGet(GLUT_ELAPSED_TIME); + __glutSwapCount++; + if (__glutSwapTime == 0) + __glutSwapTime = t; + else if (t - __glutSwapTime > __glutFPS) { + float time = 0.001 * (t - __glutSwapTime); + float fps = (float) __glutSwapCount / time; + fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", + __glutSwapCount, time, fps); + __glutSwapTime = t; + __glutSwapCount = 0; + } + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_swidth.c xpsb-glx-0.19/mesa/src/glut/glx/glut_swidth.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_swidth.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_swidth.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,58 @@ + +/* Copyright (c) Mark J. Kilgard, 1995. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutstroke.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutStrokeWidth(GLUTstrokeFont font, int c) +{ + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + if (c < 0 || c >= fontinfo->num_chars) + return 0; + ch = &(fontinfo->ch[c]); + if (ch) + return ch->right; + else + return 0; +} + +int GLUTAPIENTRY +glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) +{ + int c, length; + StrokeFontPtr fontinfo; + const StrokeCharRec *ch; + +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + length = 0; + for (; *string != '\0'; string++) { + c = *string; + if (c >= 0 && c < fontinfo->num_chars) { + ch = &(fontinfo->ch[c]); + if (ch) + length += ch->right; + } + } + return length; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_tablet.c xpsb-glx-0.19/mesa/src/glut/glx/glut_tablet.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_tablet.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_tablet.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,33 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#include "glutint.h" + +void GLUTAPIENTRY +glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc) +{ + __glutCurrentWindow->tabletMotion = tabletMotionFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); + /* If deinstalling callback, invalidate tablet position. */ + if (tabletMotionFunc == NULL) { + __glutCurrentWindow->tabletPos[0] = -1; + __glutCurrentWindow->tabletPos[1] = -1; + } +} + +void GLUTAPIENTRY +glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc) +{ + __glutCurrentWindow->tabletButton = tabletButtonFunc; + __glutUpdateInputDeviceMaskFunc = __glutUpdateInputDeviceMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_DEVICE_MASK_WORK); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_teapot.c xpsb-glx-0.19/mesa/src/glut/glx/glut_teapot.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_teapot.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_teapot.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,210 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include "glutint.h" + +/* Rim, body, lid, and bottom data must be reflected in x and + y; handle and spout data across the y axis only. */ + +static int patchdata[][16] = +{ + /* rim */ + {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}, + /* body */ + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27}, + {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40}, + /* lid */ + {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, + 101, 0, 1, 2, 3,}, + {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117}, + /* bottom */ + {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, + 125, 120, 40, 39, 38, 37}, + /* handle */ + {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56}, + {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 28, 65, 66, 67}, + /* spout */ + {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83}, + {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95} +}; +/* *INDENT-OFF* */ + +static float cpdata[][3] = +{ + {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, + -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, + {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, + 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, + 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, + 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, + {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, + 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, + {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, + 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, + 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, + {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, + {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, + -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, + -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, + 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, + 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, + 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, + {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, + -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, + 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, + -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, + 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, + 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, + 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, + {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, + -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, + 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, + {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, + {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, + {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, + 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, + 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, + -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, + 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, + 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, + 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, + {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, + -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, + 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, + {0.84, -1.5, 0.075} +}; + +static float tex[2][2][2] = +{ + { {0, 0}, + {1, 0}}, + { {0, 1}, + {1, 1}} +}; + +/* *INDENT-ON* */ + +static void +teapot(GLint grid, GLdouble scale, GLenum type) +{ + float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; + long i, j, k, l; + + glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_MAP2_VERTEX_3); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glPushMatrix(); + glRotatef(270.0, 1.0, 0.0, 0.0); + glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); + glTranslatef(0.0, 0.0, -1.5); + for (i = 0; i < 10; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + for (l = 0; l < 3; l++) { + p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 1) + q[j][k][l] *= -1.0; + if (i < 6) { + r[j][k][l] = + cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 0) + r[j][k][l] *= -1.0; + s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + if (l == 0) + s[j][k][l] *= -1.0; + if (l == 1) + s[j][k][l] *= -1.0; + } + } + } + } + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, + &tex[0][0][0]); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &p[0][0][0]); + glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &q[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + if (i < 6) { + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &r[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &s[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + } + } + glPopMatrix(); + glPopAttrib(); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSolidTeapot(GLdouble scale) +{ + teapot(7, scale, GL_FILL); +} + +void GLUTAPIENTRY +glutWireTeapot(GLdouble scale) +{ + teapot(10, scale, GL_LINE); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_tr10.c xpsb-glx-0.19/mesa/src/glut/glx/glut_tr10.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_tr10.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_tr10.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1777 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapTimesRoman10 XXX +#include "glutbitmap.h" +#undef glutBitmapTimesRoman10 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0xa0, +}; + +static const BitmapCharRec ch255 = {5,9,0,2,5,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {4,9,0,2,5,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {5,10,0,2,5,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {5,7,0,0,5,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {5,8,0,0,5,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch250 = {5,8,0,0,5,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x68,0x90,0x90,0x90,0x90,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {5,8,0,0,5,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x70,0x48,0x48,0x48,0x38,0x4, +}; + +static const BitmapCharRec ch248 = {6,7,1,1,5,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,0,0,6,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0xa0, +}; + +static const BitmapCharRec ch246 = {4,7,0,0,5,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch245 = {4,8,0,0,5,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch244 = {4,8,0,0,5,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch243 = {4,8,0,0,5,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x60,0x90,0x90,0x90,0x60,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {4,8,0,0,5,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xd8,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch241 = {5,8,0,0,5,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x60,0x90,0x90,0x90,0x70,0xa0,0x70,0x40, +}; + +static const BitmapCharRec ch240 = {4,8,0,0,5,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,7,0,0,4,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,8,0,0,4,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch237 = {3,8,0,0,4,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {3,8,0,0,4,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0, +}; + +static const BitmapCharRec ch235 = {3,7,0,0,4,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch234 = {3,8,0,0,4,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch233 = {3,8,0,0,4,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch232 = {3,8,0,0,4,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0xc0,0x20,0x40,0x60,0x80,0x80,0x80,0x60, +}; + +static const BitmapCharRec ch231 = {3,8,0,3,4,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0xd8,0xa0,0x70,0x28,0xd8, +}; + +static const BitmapCharRec ch230 = {5,5,0,0,6,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x40,0xa0,0x40, +}; + +static const BitmapCharRec ch229 = {3,8,0,0,4,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0, +}; + +static const BitmapCharRec ch228 = {3,7,0,0,4,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch227 = {4,8,0,0,4,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch226 = {3,8,0,0,4,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch225 = {3,8,0,0,4,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch224 = {3,8,0,0,4,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xe0,0x50,0x50,0x60,0x50,0x50,0x20, +}; + +static const BitmapCharRec ch223 = {4,7,0,0,5,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xe0,0x40,0x70,0x48,0x70,0x40,0xe0, +}; + +static const BitmapCharRec ch222 = {5,7,0,0,6,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x38,0x10,0x10,0x28,0x28,0x44,0xee,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,10,0,0,8,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28, +}; + +static const BitmapCharRec ch220 = {7,9,0,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {7,10,0,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch218 = {7,10,0,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {7,10,0,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x7c,0x66,0x52,0x52,0x4a,0x66,0x3e,0x1, +}; + +static const BitmapCharRec ch216 = {8,9,0,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,0,0,6,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50, +}; + +static const BitmapCharRec ch214 = {6,9,0,0,7,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {6,10,0,0,7,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch212 = {6,10,0,0,7,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {6,10,0,0,7,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch210 = {6,10,0,0,7,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xf8,0x4c,0x44,0xe4,0x44,0x4c,0xf8, +}; + +static const BitmapCharRec ch208 = {6,7,0,0,7,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,9,0,0,4,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,10,0,0,4,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch205 = {3,10,0,0,4,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {3,10,0,0,4,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50, +}; + +static const BitmapCharRec ch203 = {5,9,0,0,6,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch202 = {5,10,0,0,6,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {5,10,0,0,6,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch200 = {5,10,0,0,6,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x60,0x10,0x20,0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c, +}; + +static const BitmapCharRec ch199 = {6,10,0,3,7,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xef,0x49,0x78,0x2e,0x28,0x39,0x1f, +}; + +static const BitmapCharRec ch198 = {8,7,0,0,9,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,10,0,0,8,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,9,0,0,8,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,10,0,0,8,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,10,0,0,8,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,10,0,0,8,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,10,0,0,8,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0xe0,0xa0,0x80,0x40,0x40,0x0,0x40, +}; + +static const BitmapCharRec ch191 = {3,7,0,2,4,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x44,0x3e,0x2c,0xd4,0x28,0x48,0xe4, +}; + +static const BitmapCharRec ch190 = {7,7,0,0,8,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x4e,0x24,0x2a,0xf6,0x48,0xc8,0x44, +}; + +static const BitmapCharRec ch189 = {7,7,0,0,8,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x44,0x3e,0x2c,0xf4,0x48,0xc8,0x44, +}; + +static const BitmapCharRec ch188 = {7,7,0,0,8,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {4,4,0,-1,5,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0x40,0xa0,0x40, +}; + +static const BitmapCharRec ch186 = {3,5,0,-2,4,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,4,0,-3,3,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x20,0x40, +}; + +static const BitmapCharRec ch184 = {3,3,0,3,4,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0x80, +}; + +static const BitmapCharRec ch183 = {1,1,0,-2,2,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,9,0,2,6,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xe8,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch181 = {5,7,0,2,5,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-5,3,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0xe0, +}; + +static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xe0,0x40,0xa0,0x60, +}; + +static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xe0, +}; + +static const BitmapCharRec ch175 = {3,1,0,-6,4,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xba,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xe0, +}; + +static const BitmapCharRec ch173 = {3,1,0,-2,4,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch172 = {5,3,-1,-1,7,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x50,0xa0,0xa0,0x50, +}; + +static const BitmapCharRec ch171 = {4,4,0,-1,5,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xc0, +}; + +static const BitmapCharRec ch170 = {3,5,0,-2,4,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,-1,-6,5,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0xe0,0x90,0x20,0x50,0x90,0xa0,0x40,0x90,0x70, +}; + +static const BitmapCharRec ch167 = {4,9,0,1,5,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x0,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,7,0,0,2,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x70,0x20,0xf8,0x20,0xd8,0x50,0x88, +}; + +static const BitmapCharRec ch165 = {5,7,0,0,5,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x88,0x70,0x50,0x50,0x70,0x88, +}; + +static const BitmapCharRec ch164 = {5,6,0,-1,5,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xf0,0xc8,0x40,0xe0,0x40,0x50,0x30, +}; + +static const BitmapCharRec ch163 = {5,7,0,0,5,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x80,0xe0,0x90,0x80,0x90,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {4,7,0,1,5,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,7,-1,2,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,2,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,2,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-2,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0x80,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch125 = {3,9,0,2,4,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,9,0,2,2,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x20,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch123 = {3,9,0,2,4,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x90,0x40,0x20,0xf0, +}; + +static const BitmapCharRec ch122 = {4,5,0,0,5,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x40,0x40,0x20,0x30,0x50,0x48,0xdc, +}; + +static const BitmapCharRec ch121 = {6,7,1,2,5,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xd8,0x50,0x20,0x50,0xd8, +}; + +static const BitmapCharRec ch120 = {5,5,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x28,0x6c,0x54,0x92,0xdb, +}; + +static const BitmapCharRec ch119 = {8,5,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x60,0x50,0x90,0xd8, +}; + +static const BitmapCharRec ch118 = {5,5,0,0,5,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x68,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch117 = {5,5,0,0,5,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x30,0x40,0x40,0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch116 = {4,6,0,0,4,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0xe0,0x20,0x60,0x80,0xe0, +}; + +static const BitmapCharRec ch115 = {3,5,0,0,4,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xe0,0x40,0x40,0x60,0xa0, +}; + +static const BitmapCharRec ch114 = {3,5,0,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x38,0x10,0x70,0x90,0x90,0x90,0x70, +}; + +static const BitmapCharRec ch113 = {5,7,0,2,5,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0, +}; + +static const BitmapCharRec ch112 = {4,7,0,2,5,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x60,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch111 = {4,5,0,0,5,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xd8,0x90,0x90,0x90,0xe0, +}; + +static const BitmapCharRec ch110 = {5,5,0,0,5,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xdb,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {8,5,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch108 = {3,7,0,0,4,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x98,0x90,0xe0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {5,7,0,0,5,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x40,0x40,0x40,0x40,0x40,0xc0,0x0,0x40, +}; + +static const BitmapCharRec ch106 = {2,9,0,2,3,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x40,0x40,0x40,0x40,0xc0,0x0,0x40, +}; + +static const BitmapCharRec ch105 = {2,7,0,0,3,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xd8,0x90,0x90,0x90,0xe0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,7,0,0,5,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0xe0,0x90,0x60,0x40,0xa0,0xa0,0x70, +}; + +static const BitmapCharRec ch103 = {4,7,0,2,5,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0xe0,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,7,0,0,4,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x60,0x80,0xc0,0xa0,0x60, +}; + +static const BitmapCharRec ch101 = {3,5,0,0,4,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x90,0x90,0x90,0x70,0x10,0x30, +}; + +static const BitmapCharRec ch100 = {5,7,0,0,5,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x60,0x80,0x80,0x80,0x60, +}; + +static const BitmapCharRec ch99 = {3,5,0,0,4,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xe0,0x90,0x90,0x90,0xe0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {4,7,0,0,5,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0xe0,0xa0,0x60,0x20,0xc0, +}; + +static const BitmapCharRec ch97 = {3,5,0,0,4,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0x80, +}; + +static const BitmapCharRec ch96 = {2,2,0,-5,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xf8, +}; + +static const BitmapCharRec ch95 = {5,1,0,3,5,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0xa0,0xa0,0x40, +}; + +static const BitmapCharRec ch94 = {3,3,-1,-4,5,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,9,0,2,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x20,0x20,0x40,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {3,7,0,0,3,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,9,0,2,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xf8,0x88,0x40,0x20,0x10,0x88,0xf8, +}; + +static const BitmapCharRec ch90 = {5,7,0,0,6,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x38,0x10,0x10,0x28,0x28,0x44,0xee, +}; + +static const BitmapCharRec ch89 = {7,7,0,0,8,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xee,0x44,0x28,0x10,0x28,0x44,0xee, +}; + +static const BitmapCharRec ch88 = {7,7,0,0,8,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0xc9,0x80,0x88,0x80,0xdd,0xc0, +}; + +static const BitmapCharRec ch87 = {10,7,0,0,10,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x10,0x28,0x28,0x6c,0x44,0xee, +}; + +static const BitmapCharRec ch86 = {7,7,0,0,8,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x38,0x6c,0x44,0x44,0x44,0x44,0xee, +}; + +static const BitmapCharRec ch85 = {7,7,0,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x70,0x20,0x20,0x20,0x20,0xa8,0xf8, +}; + +static const BitmapCharRec ch84 = {5,7,0,0,6,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0xe0,0x90,0x10,0x60,0xc0,0x90,0x70, +}; + +static const BitmapCharRec ch83 = {4,7,0,0,5,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xec,0x48,0x50,0x70,0x48,0x48,0xf0, +}; + +static const BitmapCharRec ch82 = {6,7,0,0,7,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0xc,0x18,0x70,0xcc,0x84,0x84,0x84,0xcc,0x78, +}; + +static const BitmapCharRec ch81 = {6,9,0,2,7,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xe0,0x40,0x40,0x70,0x48,0x48,0xf0, +}; + +static const BitmapCharRec ch80 = {5,7,0,0,6,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0xcc,0x84,0x84,0x84,0xcc,0x78, +}; + +static const BitmapCharRec ch79 = {6,7,0,0,7,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee, +}; + +static const BitmapCharRec ch78 = {7,7,0,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xeb,0x80,0x49,0x0,0x55,0x0,0x55,0x0,0x63,0x0,0x63,0x0,0xe3,0x80, +}; + +static const BitmapCharRec ch77 = {9,7,0,0,10,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf8,0x48,0x40,0x40,0x40,0x40,0xe0, +}; + +static const BitmapCharRec ch76 = {5,7,0,0,6,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xec,0x48,0x50,0x60,0x50,0x48,0xec, +}; + +static const BitmapCharRec ch75 = {6,7,0,0,7,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0xc0,0xa0,0x20,0x20,0x20,0x20,0x70, +}; + +static const BitmapCharRec ch74 = {4,7,0,0,4,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xe0,0x40,0x40,0x40,0x40,0x40,0xe0, +}; + +static const BitmapCharRec ch73 = {3,7,0,0,4,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xee,0x44,0x44,0x7c,0x44,0x44,0xee, +}; + +static const BitmapCharRec ch72 = {7,7,0,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x78,0xc4,0x84,0x9c,0x80,0xc4,0x7c, +}; + +static const BitmapCharRec ch71 = {6,7,0,0,7,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xe0,0x40,0x40,0x70,0x40,0x48,0xf8, +}; + +static const BitmapCharRec ch70 = {5,7,0,0,6,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xf8,0x48,0x40,0x70,0x40,0x48,0xf8, +}; + +static const BitmapCharRec ch69 = {5,7,0,0,6,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf8,0x4c,0x44,0x44,0x44,0x4c,0xf8, +}; + +static const BitmapCharRec ch68 = {6,7,0,0,7,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c, +}; + +static const BitmapCharRec ch67 = {6,7,0,0,7,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf0,0x48,0x48,0x70,0x48,0x48,0xf0, +}; + +static const BitmapCharRec ch66 = {5,7,0,0,6,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xee,0x44,0x7c,0x28,0x28,0x38,0x10, +}; + +static const BitmapCharRec ch65 = {7,7,0,0,8,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x40,0x92,0xad,0xa5,0xa5,0x9d,0x42,0x3c, +}; + +static const BitmapCharRec ch64 = {8,9,0,2,9,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x40,0x0,0x40,0x40,0x20,0xa0,0xe0, +}; + +static const BitmapCharRec ch63 = {3,7,0,0,4,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {3,5,0,0,5,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf8,0x0,0xf8, +}; + +static const BitmapCharRec ch61 = {5,3,0,-1,6,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x20,0x40,0x80,0x40,0x20, +}; + +static const BitmapCharRec ch60 = {3,5,-1,0,5,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x80,0x80,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch59 = {1,7,-1,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,5,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0xc0,0x20,0x70,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch57 = {4,7,0,0,5,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x60,0x90,0x90,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch56 = {4,7,0,0,5,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x40,0x20,0x20,0x90,0xf0, +}; + +static const BitmapCharRec ch55 = {4,7,0,0,5,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x60,0x90,0x90,0x90,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch54 = {4,7,0,0,5,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0xe0,0x90,0x10,0x10,0xe0,0x40,0x70, +}; + +static const BitmapCharRec ch53 = {4,7,0,0,5,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x10,0x10,0xf8,0x90,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch52 = {5,7,0,0,5,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0xe0,0x10,0x10,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch51 = {4,7,0,0,5,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf0,0x40,0x20,0x20,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch50 = {4,7,0,0,5,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xe0,0x40,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch49 = {3,7,-1,0,5,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x60,0x90,0x90,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch48 = {4,7,0,0,5,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x20,0x20, +}; + +static const BitmapCharRec ch47 = {3,7,0,0,3,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf0, +}; + +static const BitmapCharRec ch45 = {4,1,-1,-2,7,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x80,0x80, +}; + +static const BitmapCharRec ch44 = {1,3,-1,2,3,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,0,0,6,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,0,-4,5,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,9,0,2,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,9,0,2,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x40,0xc0, +}; + +static const BitmapCharRec ch39 = {2,2,0,-5,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x76,0x8d,0x98,0x74,0x6e,0x50,0x30, +}; + +static const BitmapCharRec ch38 = {8,7,0,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x44,0x2a,0x2a,0x56,0xa8,0xa4,0x7e, +}; + +static const BitmapCharRec ch37 = {7,7,0,0,8,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0xe0,0x90,0x10,0x60,0x80,0x90,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {4,9,0,1,5,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0xf8,0x50,0xf8,0x50,0x50, +}; + +static const BitmapCharRec ch35 = {5,7,0,0,5,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,2,0,-5,4,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,7,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,2,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,2,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapTimesRoman10 = { +"-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_tr24.c xpsb-glx-0.19/mesa/src/glut/glx/glut_tr24.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_tr24.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_tr24.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2060 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapTimesRoman24 XXX +#include "glutbitmap.h" +#undef glutBitmapTimesRoman24 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch255 = {11,21,0,5,11,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, +0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0, +}; + +static const BitmapCharRec ch254 = {10,22,-1,5,12,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80, +}; + +static const BitmapCharRec ch253 = {11,22,0,5,11,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch252 = {11,16,-1,0,13,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch251 = {11,17,-1,0,13,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, +0x1,0x80, +}; + +static const BitmapCharRec ch250 = {11,17,-1,0,13,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch249 = {11,17,-1,0,13,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0, +0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0, +}; + +static const BitmapCharRec ch248 = {10,14,-1,1,12,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0, +0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch247 = {12,10,-1,-2,14,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch246 = {10,16,-1,0,12,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, +}; + +static const BitmapCharRec ch245 = {10,16,-1,0,12,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch244 = {10,17,-1,0,12,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, +0x1,0x80, +}; + +static const BitmapCharRec ch243 = {10,17,-1,0,12,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch242 = {10,17,-1,0,12,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, +}; + +static const BitmapCharRec ch241 = {11,16,-1,0,13,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80, +0xc0,0x0, +}; + +static const BitmapCharRec ch240 = {10,17,-1,0,12,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc, +}; + +static const BitmapCharRec ch239 = {6,16,0,0,6,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78, +0x30, +}; + +static const BitmapCharRec ch238 = {6,17,0,0,6,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38, +0x18, +}; + +static const BitmapCharRec ch237 = {5,17,-1,0,6,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0, +0xc0, +}; + +static const BitmapCharRec ch236 = {5,17,0,0,6,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch235 = {9,16,-1,0,11,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch234 = {9,17,-1,0,11,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch233 = {9,17,-1,0,11,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, +0x60,0x0, +}; + +static const BitmapCharRec ch232 = {9,17,-1,0,11,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0, +0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80, +0x63,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch231 = {9,18,-1,6,11,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc, +0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0, +}; + +static const BitmapCharRec ch230 = {14,12,-1,0,16,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch229 = {9,17,-1,0,11,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0, +}; + +static const BitmapCharRec ch228 = {9,16,-1,0,11,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0, +}; + +static const BitmapCharRec ch227 = {9,16,-1,0,11,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0, +0x18,0x0, +}; + +static const BitmapCharRec ch226 = {9,17,-1,0,11,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch225 = {9,17,-1,0,11,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, +0x60,0x0, +}; + +static const BitmapCharRec ch224 = {9,17,-1,0,11,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80, +0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch223 = {10,17,-1,0,12,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18, +0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0, +0xfc,0x0, +}; + +static const BitmapCharRec ch222 = {13,17,-1,0,15,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, +0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, +0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch221 = {16,22,0,0,16,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30, +}; + +static const BitmapCharRec ch220 = {16,21,-1,0,18,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, +}; + +static const BitmapCharRec ch219 = {16,22,-1,0,18,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch218 = {16,22,-1,0,18,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch217 = {16,22,-1,0,18,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3, +0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c, +0x1c,0x38,0x7,0xe4,0x0,0x4, +}; + +static const BitmapCharRec ch216 = {16,19,-1,1,18,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0, +0x61,0x80,0xc0,0xc0,0x80,0x40, +}; + +static const BitmapCharRec ch215 = {10,11,-2,-1,14,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60, +}; + +static const BitmapCharRec ch214 = {16,21,-1,0,18,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, +}; + +static const BitmapCharRec ch213 = {16,21,-1,0,18,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, +}; + +static const BitmapCharRec ch212 = {16,22,-1,0,18,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch211 = {16,22,-1,0,18,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch210 = {16,22,-1,0,18,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, +0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, +0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, +}; + +static const BitmapCharRec ch209 = {16,21,-1,0,18,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3, +0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38, +0x7f,0xe0, +}; + +static const BitmapCharRec ch208 = {16,17,0,0,17,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x0,0xcc,0xcc, +}; + +static const BitmapCharRec ch207 = {6,21,-1,0,8,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x7e,0x0,0x81,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch206 = {8,22,-1,0,8,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x40,0x30,0x1c,0xc, +}; + +static const BitmapCharRec ch205 = {6,22,-1,0,8,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x8,0x30,0xe0,0xc0, +}; + +static const BitmapCharRec ch204 = {6,22,-1,0,8,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80, +}; + +static const BitmapCharRec ch203 = {13,21,-1,0,15,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0, +}; + +static const BitmapCharRec ch202 = {13,22,-1,0,15,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0, +}; + +static const BitmapCharRec ch201 = {13,22,-1,0,15,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch200 = {13,22,-1,0,15,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38, +0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4, +}; + +static const BitmapCharRec ch199 = {14,23,-1,6,16,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8, +0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60, +0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60, +0x3,0xff,0xe0, +}; + +static const BitmapCharRec ch198 = {20,17,0,0,21,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0, +}; + +static const BitmapCharRec ch197 = {17,21,0,0,17,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0, +}; + +static const BitmapCharRec ch196 = {17,21,0,0,17,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0, +}; + +static const BitmapCharRec ch195 = {17,21,0,0,17,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1, +0x80,0x0, +}; + +static const BitmapCharRec ch194 = {17,22,0,0,17,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch193 = {17,22,0,0,17,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3, +0x0,0x0, +}; + +static const BitmapCharRec ch192 = {17,22,0,0,17,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc, +0xc, +}; + +static const BitmapCharRec ch191 = {8,17,-1,5,11,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3, +0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60, +0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0, +0x38,0x4,0x0, +}; + +static const BitmapCharRec ch190 = {17,17,0,0,18,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46, +0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, +0x20,0x8, +}; + +static const BitmapCharRec ch189 = {15,17,-1,0,18,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c, +0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, +0x20,0x8, +}; + +static const BitmapCharRec ch188 = {16,17,-1,0,18,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0, +0xcc,0x0,0x88,0x0, +}; + +static const BitmapCharRec ch187 = {9,10,-2,-1,12,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78, +}; + +static const BitmapCharRec ch186 = {6,9,-1,-8,8,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, +}; + +static const BitmapCharRec ch185 = {5,10,-1,-7,7,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0x78,0xcc,0xc,0x3c,0x30,0x10, +}; + +static const BitmapCharRec ch184 = {6,6,-1,6,8,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-2,-6,6,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0, +0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0, +0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80, +}; + +static const BitmapCharRec ch182 = {9,22,-1,5,11,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0xe1,0xc0, +}; + +static const BitmapCharRec ch181 = {11,17,-1,5,13,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x60,0x38,0x18, +}; + +static const BitmapCharRec ch180 = {5,4,-2,-13,8,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38, +}; + +static const BitmapCharRec ch179 = {6,10,0,-7,7,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38, +}; + +static const BitmapCharRec ch178 = {6,10,0,-7,7,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch177 = {12,15,-1,0,14,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x38,0x44,0x82,0x82,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch176 = {7,7,-1,-10,9,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc,0xfc, +}; + +static const BitmapCharRec ch175 = {6,2,-1,-14,8,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2, +0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10, +0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, +0x7,0xf0,0x0, +}; + +static const BitmapCharRec ch174 = {17,17,-1,0,19,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfe,0xfe, +}; + +static const BitmapCharRec ch173 = {7,2,-1,-5,9,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch172 = {12,7,-1,-3,14,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0, +0x19,0x80,0x8,0x80, +}; + +static const BitmapCharRec ch171 = {9,10,-2,-1,13,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78, +}; + +static const BitmapCharRec ch170 = {7,9,0,-8,8,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4, +0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0, +0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, +0x7,0xf0,0x0, +}; + +static const BitmapCharRec ch169 = {17,17,-1,0,19,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xcc,0xcc, +}; + +static const BitmapCharRec ch168 = {6,2,-1,-14,8,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70, +0x60,0x46,0x26,0x1c, +}; + +static const BitmapCharRec ch167 = {8,20,-2,2,12,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch166 = {2,17,-2,0,6,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0, +0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30, +0xf8,0x7c, +}; + +static const BitmapCharRec ch165 = {14,17,0,0,14,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60, +}; + +static const BitmapCharRec ch164 = {11,12,-1,-3,13,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80, +0xf,0x0, +}; + +static const BitmapCharRec ch163 = {10,17,-1,0,12,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0, +0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0, +}; + +static const BitmapCharRec ch162 = {9,16,-1,2,12,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch161 = {2,17,-4,5,8,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,6,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,6,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20, +}; + +static const BitmapCharRec ch126 = {11,4,-1,-5,13,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18, +0x18,0x18,0x18,0x18,0x30,0xe0, +}; + +static const BitmapCharRec ch125 = {8,22,-1,5,10,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch124 = {2,17,-2,0,6,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18, +0x18,0x18,0x18,0x18,0xc,0x7, +}; + +static const BitmapCharRec ch123 = {8,22,-1,5,10,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff, +}; + +static const BitmapCharRec ch122 = {8,12,-1,0,10,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0, +}; + +static const BitmapCharRec ch121 = {11,17,0,5,11,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0, +0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0, +}; + +static const BitmapCharRec ch120 = {11,12,-1,0,13,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19, +0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3, +0x0,0xf1,0xe7,0x80, +}; + +static const BitmapCharRec ch119 = {17,12,0,0,17,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80, +0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0, +}; + +static const BitmapCharRec ch118 = {11,12,0,0,11,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0, +}; + +static const BitmapCharRec ch117 = {11,12,-1,0,13,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10, +}; + +static const BitmapCharRec ch116 = {7,15,0,0,7,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e, +}; + +static const BitmapCharRec ch115 = {8,12,-1,0,10,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6, +}; + +static const BitmapCharRec ch114 = {7,12,-1,0,8,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80, +0x1d,0x80, +}; + +static const BitmapCharRec ch113 = {10,17,-1,5,12,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, +0xee,0x0, +}; + +static const BitmapCharRec ch112 = {10,17,-1,5,12,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0, +}; + +static const BitmapCharRec ch111 = {10,12,-1,0,12,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0, +}; + +static const BitmapCharRec ch110 = {11,12,-1,0,13,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60, +0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f, +0x0,0xe7,0xe,0x0, +}; + +static const BitmapCharRec ch109 = {18,12,-1,0,20,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, +0xe0, +}; + +static const BitmapCharRec ch108 = {4,17,-1,0,6,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0, +0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch107 = {11,17,-1,0,12,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0x70,0x0,0x0,0x0,0x30,0x30, +}; + +static const BitmapCharRec ch106 = {4,22,0,5,6,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60, +0x60, +}; + +static const BitmapCharRec ch105 = {4,17,-1,0,6,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch104 = {11,17,-1,0,13,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0, +0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1f,0xc0, +}; + +static const BitmapCharRec ch103 = {11,17,-1,5,12,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16, +0xe, +}; + +static const BitmapCharRec ch102 = {7,17,0,0,7,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0, +}; + +static const BitmapCharRec ch101 = {9,12,-1,0,11,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80, +0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, +0x3,0x80, +}; + +static const BitmapCharRec ch100 = {10,17,-1,0,12,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch99 = {9,12,-1,0,11,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch98 = {10,17,-1,0,12,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0, +}; + +static const BitmapCharRec ch97 = {9,12,-1,0,11,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x60,0xe0,0x80,0xc0,0x60, +}; + +static const BitmapCharRec ch96 = {3,5,-2,-12,7,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff,0xf8,0xff,0xf8, +}; + +static const BitmapCharRec ch95 = {13,2,0,5,13,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch94 = {9,9,-1,-8,11,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0xf8, +}; + +static const BitmapCharRec ch93 = {5,21,-1,4,8,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0, +0xc0, +}; + +static const BitmapCharRec ch92 = {7,17,0,0,7,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xf8, +}; + +static const BitmapCharRec ch91 = {5,21,-2,4,8,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0, +0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70, +0xff,0xf0, +}; + +static const BitmapCharRec ch90 = {13,17,-1,0,15,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, +0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, +0xfc,0x3f, +}; + +static const BitmapCharRec ch89 = {16,17,0,0,16,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6, +0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0, +0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0, +0x7e,0xf,0x80, +}; + +static const BitmapCharRec ch88 = {18,17,0,0,18,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3, +0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c, +0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18, +0xfc,0x7e,0x7e, +}; + +static const BitmapCharRec ch87 = {23,17,0,0,23,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3, +0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18, +0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0, +0xfc,0x1f,0x80, +}; + +static const BitmapCharRec ch86 = {17,17,0,0,17,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f, +}; + +static const BitmapCharRec ch85 = {16,17,-1,0,18,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0, +0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc, +0xff,0xfc, +}; + +static const BitmapCharRec ch84 = {14,17,-1,0,16,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0, +0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0, +0x1e,0x40, +}; + +static const BitmapCharRec ch83 = {11,17,-1,0,13,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80, +0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch82 = {15,17,-1,0,16,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c, +0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0, +}; + +static const BitmapCharRec ch81 = {16,22,-1,5,18,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch80 = {13,17,-1,0,15,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0, +}; + +static const BitmapCharRec ch79 = {16,17,-1,0,18,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, +0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, +0xf0,0x1f, +}; + +static const BitmapCharRec ch78 = {16,17,-1,0,18,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21, +0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2, +0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0, +0xf0,0x0,0xf8, +}; + +static const BitmapCharRec ch77 = {21,17,-1,0,22,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0xfc,0x0, +}; + +static const BitmapCharRec ch76 = {13,17,-1,0,14,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80, +0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18, +0xfc,0x7e, +}; + +static const BitmapCharRec ch75 = {16,17,-1,0,17,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0x1f,0x80, +}; + +static const BitmapCharRec ch74 = {9,17,-1,0,11,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc, +}; + +static const BitmapCharRec ch73 = {6,17,-1,0,8,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30, +0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6, +0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0, +0xfc,0x1f,0x80, +}; + +static const BitmapCharRec ch72 = {17,17,-1,0,19,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, +0x7,0xe4, +}; + +static const BitmapCharRec ch71 = {16,17,-1,0,18,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20, +0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0, +}; + +static const BitmapCharRec ch70 = {12,17,-1,0,14,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0, +}; + +static const BitmapCharRec ch69 = {13,17,-1,0,15,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6, +0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch68 = {15,17,-1,0,17,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, +0x7,0xe4, +}; + +static const BitmapCharRec ch67 = {14,17,-1,0,16,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38, +0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch66 = {14,17,-1,0,16,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0, +}; + +static const BitmapCharRec ch65 = {17,17,0,0,17,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63, +0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc, +0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80, +0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0, +}; + +static const BitmapCharRec ch64 = {18,20,-2,3,22,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6, +0x7c, +}; + +static const BitmapCharRec ch63 = {8,17,-2,0,11,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0, +0x1c,0x0,0x70,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch62 = {11,11,-1,-1,13,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch61 = {12,6,-1,-4,14,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0, +0x7,0x0,0x1,0xc0,0x0,0x60, +}; + +static const BitmapCharRec ch60 = {11,11,-1,-1,13,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {3,14,-2,3,7,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,11,-2,0,6,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0, +0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80, +0x1e,0x0, +}; + +static const BitmapCharRec ch57 = {10,17,-1,0,12,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80, +0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch56 = {10,17,-1,0,12,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0, +0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0, +0x7f,0xc0, +}; + +static const BitmapCharRec ch55 = {10,17,-1,0,12,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0, +0x3,0xc0, +}; + +static const BitmapCharRec ch54 = {10,17,-1,0,12,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0, +0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80, +0x1f,0xc0, +}; + +static const BitmapCharRec ch53 = {10,17,-1,0,12,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0, +0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch52 = {10,17,-1,0,12,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80, +0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch51 = {9,17,-1,0,12,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0, +0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch50 = {10,17,-1,0,12,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18, +0x8, +}; + +static const BitmapCharRec ch49 = {8,17,-2,0,12,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch48 = {10,17,-1,0,12,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6, +0x6,0x3,0x3,0x3, +}; + +static const BitmapCharRec ch47 = {8,20,1,3,7,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-2,0,6,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch45 = {12,2,-1,-6,14,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0xc0,0x60,0x20,0xe0,0xc0, +}; + +static const BitmapCharRec ch44 = {3,5,-2,3,7,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0, +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch43 = {12,12,-1,-1,14,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch42 = {9,9,-2,-8,12,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18, +0x18,0x10,0x30,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {6,22,-1,5,8,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60, +0x60,0x20,0x30,0x10,0x8,0x4, +}; + +static const BitmapCharRec ch40 = {6,22,-1,5,8,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0xc0,0x60,0x20,0xe0,0xc0, +}; + +static const BitmapCharRec ch39 = {3,5,-3,-12,8,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10, +0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0, +0x7,0x80, +}; + +static const BitmapCharRec ch38 = {16,17,-1,0,18,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3, +0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60, +0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0, +}; + +static const BitmapCharRec ch37 = {17,16,-1,0,19,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60, +0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20, +0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0, +}; + +static const BitmapCharRec ch36 = {11,21,0,2,12,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0, +0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80, +0x8,0x80, +}; + +static const BitmapCharRec ch35 = {11,17,-1,0,13,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x88,0xcc,0xcc,0xcc,0xcc, +}; + +static const BitmapCharRec ch34 = {6,5,-1,-12,10,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch33 = {2,17,-3,0,8,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,6,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,6,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +const BitmapFontRec glutBitmapTimesRoman24 = { +"-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_util.c xpsb-glx-0.19/mesa/src/glut/glx/glut_util.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_util.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_util.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,86 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include +#include + +#include "glutint.h" + +/* strdup is actually not a standard ANSI C or POSIX routine + so implement a private one for GLUT. OpenVMS does not have a + strdup; Linux's standard libc doesn't declare strdup by default + (unless BSD or SVID interfaces are requested). */ +char * +__glutStrdup(const char *string) +{ + char *copy; + + copy = (char*) malloc(strlen(string) + 1); + if (copy == NULL) + return NULL; + strcpy(copy, string); + return copy; +} + +void +__glutWarning(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Warning in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutReportErrors(void) +{ + GLenum error; + + while ((error = glGetError()) != GL_NO_ERROR) + __glutWarning("GL error: %s", gluErrorString(error)); +} +/* ENDCENTRY */ + +void +__glutFatalError(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal Error in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); +#ifdef _WIN32 + if (__glutExitFunc) { + __glutExitFunc(1); + } +#endif + exit(1); +} + +void +__glutFatalUsage(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal API Usage in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + abort(); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_vidresize.c xpsb-glx-0.19/mesa/src/glut/glx/glut_vidresize.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_vidresize.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_vidresize.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,231 @@ + +/* Copyright (c) Mark J. Kilgard, 1996. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#ifdef __sgi +#include +#endif + +#include "glutint.h" + +/* Grumble. The IRIX 6.3 and early IRIX 6.4 OpenGL headers + support the video resize extension, but failed to define + GLX_SGIX_video_resize. */ +#if 0 +#ifdef GLX_SYNC_FRAME_SGIX +#define GLX_SGIX_video_resize 1 +#endif +#endif + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) +static int canVideoResize = -1; +static int videoResizeChannel; +#else +static int canVideoResize = 0; +#endif +static int videoResizeInUse = 0; +static int dx = -1, dy = -1, dw = -1, dh = -1; + +/* XXX Note that IRIX 6.2, 6.3, and some 6.4 versions have a + bug where programs seg-fault when they attempt video + resizing from an indirect OpenGL context (either local or + over a network). */ + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + +static volatile int errorCaught; + +/* ARGSUSED */ +static int +catchXSGIvcErrors(Display * dpy, XErrorEvent * event) +{ + errorCaught = 1; + return 0; +} +#endif + +/* CENTRY */ +int GLUTAPIENTRY +glutVideoResizeGet(GLenum param) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (canVideoResize < 0) { + canVideoResize = __glutIsSupportedByGLX("GLX_SGIX_video_resize"); + if (canVideoResize) { +#if defined(__sgi) && __sgi + /* This is a hack because IRIX 6.2, 6.3, and some 6.4 + versions were released with GLX_SGIX_video_resize + being advertised by the X server though the video + resize extension is not actually supported. We try to + determine if the libGL.so we are using actually has a + video resize entrypoint before we try to use the + feature. */ + void (*func) (void); + void *glxDso = dlopen("libGL.so", RTLD_LAZY); + + func = (void (*)(void)) dlsym(glxDso, "glXQueryChannelDeltasSGIX"); + if (!func) { + canVideoResize = 0; + } else +#endif + { + char *channelString; + int (*handler) (Display *, XErrorEvent *); + + channelString = getenv("GLUT_VIDEO_RESIZE_CHANNEL"); + videoResizeChannel = channelString ? atoi(channelString) : 0; + + /* Work around another annoying problem with SGI's + GLX_SGIX_video_resize implementation. Early IRIX + 6.4 OpenGL's advertise the extension and have the + video resize API, but an XSGIvc X protocol errors + result trying to use the API. Set up an error + handler to intercept what would otherwise be a fatal + error. If an error was recieved, do not report that + video resize is possible. */ + handler = XSetErrorHandler(catchXSGIvcErrors); + + errorCaught = 0; + +#if defined(GLX_GLXEXT_PROTOTYPES) +#endif + + __glut_glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, &dx, &dy, &dw, &dh); + + /* glXQueryChannelDeltasSGIX is an inherent X server + round-trip so we know we will have gotten either the + correct reply or and error by this time. */ + XSetErrorHandler(handler); + + /* Still yet another work around. In IRIX 6.4 betas, + glXQueryChannelDeltasSGIX will return as if it + succeeded, but the values are filled with junk. + Watch to make sure the delta variables really make + sense. */ + if (errorCaught || + dx < 0 || dy < 0 || dw < 0 || dh < 0 || + dx > 2048 || dy > 2048 || dw > 2048 || dh > 2048) { + canVideoResize = 0; + } + } + } + } +#endif /* GLX_SGIX_video_resize */ + + switch (param) { + case GLUT_VIDEO_RESIZE_POSSIBLE: + return canVideoResize; + case GLUT_VIDEO_RESIZE_IN_USE: + return videoResizeInUse; + case GLUT_VIDEO_RESIZE_X_DELTA: + return dx; + case GLUT_VIDEO_RESIZE_Y_DELTA: + return dy; + case GLUT_VIDEO_RESIZE_WIDTH_DELTA: + return dw; + case GLUT_VIDEO_RESIZE_HEIGHT_DELTA: + return dh; + case GLUT_VIDEO_RESIZE_X: + case GLUT_VIDEO_RESIZE_Y: + case GLUT_VIDEO_RESIZE_WIDTH: + case GLUT_VIDEO_RESIZE_HEIGHT: +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { + int x, y, width, height; + + __glut_glXQueryChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, &x, &y, &width, &height); + switch (param) { + case GLUT_VIDEO_RESIZE_X: + return x; + case GLUT_VIDEO_RESIZE_Y: + return y; + case GLUT_VIDEO_RESIZE_WIDTH: + return width; + case GLUT_VIDEO_RESIZE_HEIGHT: + return height; + } + } +#endif + return -1; + default: + __glutWarning("invalid glutVideoResizeGet parameter: %d", param); + return -1; + } +} + +void GLUTAPIENTRY +glutSetupVideoResizing(void) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { + __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, __glutCurrentWindow->win); + videoResizeInUse = 1; + } else +#endif + __glutFatalError("glutEstablishVideoResizing: video resizing not possible.\n"); +} + +void GLUTAPIENTRY +glutStopVideoResizing(void) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { + if (videoResizeInUse) { + __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, None); + videoResizeInUse = 0; + } + } +#endif +} + +/* ARGSUSED */ +void GLUTAPIENTRY +glutVideoResize(int x, int y, int width, int height) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { +#ifdef GLX_SYNC_SWAP_SGIX + /* glXChannelRectSyncSGIX introduced in a patch to IRIX + 6.2; the original unpatched IRIX 6.2 behavior is always + GLX_SYNC_SWAP_SGIX. */ + __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, GLX_SYNC_SWAP_SGIX); +#endif + __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, x, y, width, height); + } +#endif +} + +/* ARGSUSED */ +void GLUTAPIENTRY +glutVideoPan(int x, int y, int width, int height) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { +#ifdef GLX_SYNC_FRAME_SGIX + /* glXChannelRectSyncSGIX introduced in a patch to IRIX + 6.2; the original unpatched IRIX 6.2 behavior is always + GLX_SYNC_SWAP_SGIX. We just ignore that we cannot + accomplish GLX_SYNC_FRAME_SGIX on IRIX unpatched 6.2; + this means you'd need a glutSwapBuffers to actually + realize the video resize. */ + __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, GLX_SYNC_FRAME_SGIX); +#endif + __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, x, y, width, height); + } +#endif +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_warp.c xpsb-glx-0.19/mesa/src/glut/glx/glut_warp.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_warp.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_warp.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,23 @@ + +/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutWarpPointer(int x, int y) +{ + XWarpPointer(__glutDisplay, None, __glutCurrentWindow->win, + 0, 0, 0, 0, x, y); + XFlush(__glutDisplay); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glutwin32.h xpsb-glx-0.19/mesa/src/glut/glx/glutwin32.h --- xpsb-glx-0.19/mesa/src/glut/glx/glutwin32.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glutwin32.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,96 @@ +#ifndef __glutwin32_h__ +#define __glutwin32_h__ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "win32_x11.h" +#include "win32_glx.h" + +/* We have to undef some things because Microsoft likes to pollute the + global namespace. */ +#undef TRANSPARENT + +/* Win32 "equivalent" cursors - eventually, the X glyphs should be + converted to Win32 cursors -- then they will look the same */ +#define XC_arrow IDC_ARROW +#define XC_top_left_arrow IDC_ARROW +#define XC_hand1 IDC_SIZEALL +#define XC_pirate IDC_NO +#define XC_question_arrow IDC_HELP +#define XC_exchange IDC_NO +#define XC_spraycan IDC_SIZEALL +#define XC_watch IDC_WAIT +#define XC_xterm IDC_IBEAM +#define XC_crosshair IDC_CROSS +#define XC_sb_v_double_arrow IDC_SIZENS +#define XC_sb_h_double_arrow IDC_SIZEWE +#define XC_top_side IDC_UPARROW +#define XC_bottom_side IDC_SIZENS +#define XC_left_side IDC_SIZEWE +#define XC_right_side IDC_SIZEWE +#define XC_top_left_corner IDC_SIZENWSE +#define XC_top_right_corner IDC_SIZENESW +#define XC_bottom_right_corner IDC_SIZENWSE +#define XC_bottom_left_corner IDC_SIZENESW + +#define XA_STRING 0 + +/* Private routines from win32_util.c */ +#ifndef __CYGWIN32__ +extern int gettimeofday(struct timeval* tp, void* tzp); +#endif +extern void *__glutFont(void *font); +extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo); +extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height); + + +/* Cygwin B20.1 misses the following definitions */ +#ifdef __CYGWIN32__ + +/* from winuser.h */ +#define CDS_FULLSCREEN 4 + +/* from mmsystem.h */ +#define WINMMAPI __declspec(dllimport) +typedef UINT MMRESULT; + +#define MM_JOY1MOVE 0x3A0 +#define MM_JOY1ZMOVE 0x3A2 +#define MM_JOY1BUTTONDOWN 0x3B5 +#define MM_JOY1BUTTONUP 0x3B7 + +#define JOYERR_NOERROR 0 +#define JOYERR_PARMS 165 + +#define JOY_RETURNALL 0x000000ffl + +#define JOYSTICKID1 0 + +typedef struct joyinfoex_tag { + DWORD dwSize; /* size of structure */ + DWORD dwFlags; /* flags to indicate what to return */ + DWORD dwXpos; /* x position */ + DWORD dwYpos; /* y position */ + DWORD dwZpos; /* z position */ + DWORD dwRpos; /* rudder/4th axis position */ + DWORD dwUpos; /* 5th axis position */ + DWORD dwVpos; /* 6th axis position */ + DWORD dwButtons; /* button states */ + DWORD dwButtonNumber; /* current button number pressed */ + DWORD dwPOV; /* point of view state */ + DWORD dwReserved1; /* reserved for communication between winmm & driver */ + DWORD dwReserved2; /* reserved for future expansion */ +} JOYINFOEX, *PJOYINFOEX, /* NEAR */ *NPJOYINFOEX, /* FAR */ *LPJOYINFOEX; + +WINMMAPI MMRESULT WINAPI joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji); +WINMMAPI MMRESULT WINAPI joyReleaseCapture( UINT uJoyID); +WINMMAPI MMRESULT WINAPI joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged); +WINMMAPI MMRESULT WINAPI joySetThreshold( UINT uJoyID, UINT uThreshold); + +#endif + +#endif /* __glutwin32_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_win.c xpsb-glx-0.19/mesa/src/glut/glx/glut_win.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_win.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_win.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1035 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#if !defined(_WIN32) +#include +#include +#endif + +#include "glutint.h" + +GLUTwindow *__glutCurrentWindow = NULL; +GLUTwindow **__glutWindowList = NULL; +int __glutWindowListSize = 0; +#if !defined(_WIN32) +GLUTstale *__glutStaleWindowList = NULL; +#endif +GLUTwindow *__glutMenuWindow = NULL; + +void (*__glutFreeOverlayFunc) (GLUToverlay *); +XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask, void **fbc) = NULL; + +static Criterion requiredWindowCriteria[] = +{ + {LEVEL, EQ, 0}, + {TRANSPARENT, EQ, 0} +}; +static int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion); +static int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT); + +static void +cleanWindowWorkList(GLUTwindow * window) +{ + GLUTwindow **pEntry = &__glutWindowWorkList; + GLUTwindow *entry = __glutWindowWorkList; + + /* Tranverse singly-linked window work list look for the + window. */ + while (entry) { + if (entry == window) { + /* Found it; delete it. */ + *pEntry = entry->prevWorkWin; + return; + } else { + pEntry = &entry->prevWorkWin; + entry = *pEntry; + } + } +} + +#if !defined(_WIN32) + +static void +cleanStaleWindowList(GLUTwindow * window) +{ + GLUTstale **pEntry = &__glutStaleWindowList; + GLUTstale *entry = __glutStaleWindowList; + + /* Tranverse singly-linked stale window list look for the + window ID. */ + while (entry) { + if (entry->window == window) { + /* Found it; delete it. */ + *pEntry = entry->next; + free(entry); + return; + } else { + pEntry = &entry->next; + entry = *pEntry; + } + } +} + +#endif + +static GLUTwindow *__glutWindowCache = NULL; + +GLUTwindow * +__glutGetWindow(Window win) +{ + int i; + + /* Does win belong to the last window ID looked up? */ + if (__glutWindowCache && (win == __glutWindowCache->win || + (__glutWindowCache->overlay && win == + __glutWindowCache->overlay->win))) { + return + __glutWindowCache; + } + /* Otherwise scan the window list looking for the window ID. */ + for (i = 0; i < __glutWindowListSize; i++) { + if (__glutWindowList[i]) { + if (win == __glutWindowList[i]->win) { + __glutWindowCache = __glutWindowList[i]; + return __glutWindowCache; + } + if (__glutWindowList[i]->overlay) { + if (win == __glutWindowList[i]->overlay->win) { + __glutWindowCache = __glutWindowList[i]; + return __glutWindowCache; + } + } + } + } +#if !defined(_WIN32) + { + GLUTstale *entry; + + /* Scan through destroyed overlay window IDs for which no + DestroyNotify has yet been received. */ + for (entry = __glutStaleWindowList; entry; entry = entry->next) { + if (entry->win == win) + return entry->window; + } + } +#endif + return NULL; +} + +/* CENTRY */ +int GLUTAPIENTRY +glutGetWindow(void) +{ + if (__glutCurrentWindow) { + return __glutCurrentWindow->num + 1; + } else { + return 0; + } +} +/* ENDCENTRY */ + +void +__glutSetWindow(GLUTwindow * window) +{ + /* It is tempting to try to short-circuit the call to + glXMakeCurrent if we "know" we are going to make current + to a window we are already current to. In fact, this + assumption breaks when GLUT is expected to integrated with + other OpenGL windowing APIs that also make current to + OpenGL contexts. Since glXMakeCurrent short-circuits the + "already bound" case, GLUT avoids the temptation to do so + too. */ + __glutCurrentWindow = window; + + MAKE_CURRENT_LAYER(__glutCurrentWindow); + +#if !defined(_WIN32) + /* We should be careful to force a finish between each + iteration through the GLUT main loop if indirect OpenGL + contexts are in use; indirect contexts tend to have much + longer latency because lots of OpenGL extension requests + can queue up in the X protocol stream. We accomplish this + by posting GLUT_FINISH_WORK to be done. */ + if (!__glutCurrentWindow->isDirect) + __glutPutOnWorkList(__glutCurrentWindow, GLUT_FINISH_WORK); +#endif + + /* If debugging is enabled, we'll want to check this window + for any OpenGL errors every iteration through the GLUT + main loop. To accomplish this, we post the + GLUT_DEBUG_WORK to be done on this window. */ + if (__glutDebug) { + __glutPutOnWorkList(__glutCurrentWindow, GLUT_DEBUG_WORK); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSetWindow(int win) +{ + GLUTwindow *window; + + if (win < 1 || win > __glutWindowListSize) { + __glutWarning("glutSetWindow attempted on bogus window."); + return; + } + window = __glutWindowList[win - 1]; + if (!window) { + __glutWarning("glutSetWindow attempted on bogus window."); + return; + } + __glutSetWindow(window); +} +/* ENDCENTRY */ + +static int +getUnusedWindowSlot(void) +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < __glutWindowListSize; i++) { + if (!__glutWindowList[i]) { + return i; + } + } + /* Allocate a new slot. */ + __glutWindowListSize++; + if (__glutWindowList) { + __glutWindowList = (GLUTwindow **) + realloc(__glutWindowList, + __glutWindowListSize * sizeof(GLUTwindow *)); + } else { + /* XXX Some realloc's do not correctly perform a malloc + when asked to perform a realloc on a NULL pointer, + though the ANSI C library spec requires this. */ + __glutWindowList = (GLUTwindow **) + malloc(sizeof(GLUTwindow *)); + } + if (!__glutWindowList) + __glutFatalError("out of memory."); + __glutWindowList[__glutWindowListSize - 1] = NULL; + return __glutWindowListSize - 1; +} + +static XVisualInfo * +getVisualInfoCI(unsigned int mode) +{ + static int bufSizeList[] = + {16, 12, 8, 4, 2, 1, 0}; + XVisualInfo *vi; + int list[32]; + int i, n = 0; + + /* Should not be looking at display mode mask if + __glutDisplayString is non-NULL. */ + assert(!__glutDisplayString); + + list[n++] = GLX_BUFFER_SIZE; + list[n++] = 1; + if (GLUT_WIND_IS_DOUBLE(mode)) { + list[n++] = GLX_DOUBLEBUFFER; + } + if (GLUT_WIND_IS_STEREO(mode)) { + list[n++] = GLX_STEREO; + } + if (GLUT_WIND_HAS_DEPTH(mode)) { + list[n++] = GLX_DEPTH_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_HAS_STENCIL(mode)) { + list[n++] = GLX_STENCIL_SIZE; + list[n++] = 1; + } + list[n] = (int) None; /* terminate list */ + + /* glXChooseVisual specify GLX_BUFFER_SIZE prefers the + "smallest index buffer of at least the specified size". + This would be reasonable if GLUT allowed the user to + specify the required buffe size, but GLUT's display mode + is too simplistic (easy to use?). GLUT should try to find + the "largest". So start with a large buffer size and + shrink until we find a matching one that exists. */ + + for (i = 0; bufSizeList[i]; i++) { + /* XXX Assumes list[1] is where GLX_BUFFER_SIZE parameter + is. */ + list[1] = bufSizeList[i]; + vi = glXChooseVisual(__glutDisplay, + __glutScreen, list); + if (vi) + return vi; + } + return NULL; +} + +static XVisualInfo * +getVisualInfoRGB(unsigned int mode) +{ + int list[32]; + int n = 0; + + /* Should not be looking at display mode mask if + __glutDisplayString is non-NULL. */ + assert(!__glutDisplayString); + + /* XXX Would a caching mechanism to minize the calls to + glXChooseVisual? You'd have to reference count + XVisualInfo* pointers. Would also have to properly + interact with glutInitDisplayString. */ + + list[n++] = GLX_RGBA; + list[n++] = GLX_RED_SIZE; + list[n++] = 1; + list[n++] = GLX_GREEN_SIZE; + list[n++] = 1; + list[n++] = GLX_BLUE_SIZE; + list[n++] = 1; + if (GLUT_WIND_HAS_ALPHA(mode)) { + list[n++] = GLX_ALPHA_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_IS_DOUBLE(mode)) { + list[n++] = GLX_DOUBLEBUFFER; + } + if (GLUT_WIND_IS_STEREO(mode)) { + list[n++] = GLX_STEREO; + } + if (GLUT_WIND_HAS_DEPTH(mode)) { + list[n++] = GLX_DEPTH_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_HAS_STENCIL(mode)) { + list[n++] = GLX_STENCIL_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_HAS_ACCUM(mode)) { + list[n++] = GLX_ACCUM_RED_SIZE; + list[n++] = 1; + list[n++] = GLX_ACCUM_GREEN_SIZE; + list[n++] = 1; + list[n++] = GLX_ACCUM_BLUE_SIZE; + list[n++] = 1; + if (GLUT_WIND_HAS_ALPHA(mode)) { + list[n++] = GLX_ACCUM_ALPHA_SIZE; + list[n++] = 1; + } + } +#if defined(GLX_VERSION_1_1) && (defined(GLX_SGIS_multisample) || defined(GLX_ARB_multisample)) + if (GLUT_WIND_IS_MULTISAMPLE(mode)) { + if (!__glutIsSupportedByGLX("GLX_SGIS_multisample") && + !__glutIsSupportedByGLX("GLX_ARB_multisample")) + return NULL; +#if defined(GLX_ARB_multisample) + list[n++] = GLX_SAMPLES_ARB; +#elif defined(GLX_SGIS_multisample) + list[n++] = GLX_SAMPLES_SGIS; +#endif + /* XXX Is 4 a reasonable minimum acceptable number of + samples? */ + list[n++] = 4; + } +#endif + list[n] = (int) None; /* terminate list */ + + return glXChooseVisual(__glutDisplay, + __glutScreen, list); +} + +#ifndef VisualIDMask +#define VisualIDMask 0 +#endif + +static XVisualInfo * +getVisualInfoID(int id) +{ + XVisualInfo temp; + int count; +#if !defined(_WIN32) + temp.visualid = id; +#endif + return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count); +} + + +XVisualInfo * +__glutGetVisualInfo(unsigned int mode) +{ + char *visStr; + /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */ + if (GLUT_WIND_IS_LUMINANCE(mode)) + return NULL; + + visStr = getenv("GLUT_FORCE_VISUAL"); + if (visStr) { + int id = atoi(visStr); + return getVisualInfoID(id); + } + + if (GLUT_WIND_IS_RGB(mode)) + return getVisualInfoRGB(mode); + else + return getVisualInfoCI(mode); +} + +XVisualInfo * +__glutDetermineVisual( + unsigned int displayMode, + Bool * treatAsSingle, + XVisualInfo * (getVisualInfo) (unsigned int)) +{ + XVisualInfo *vis; + + /* Should not be looking at display mode mask if + __glutDisplayString is non-NULL. */ + assert(!__glutDisplayString); + + *treatAsSingle = GLUT_WIND_IS_SINGLE(displayMode); + vis = getVisualInfo(displayMode); + if (!vis) { + /* Fallback cases when can't get exactly what was asked + for... */ + if (GLUT_WIND_IS_SINGLE(displayMode)) { + /* If we can't find a single buffered visual, try looking + for a double buffered visual. We can treat a double + buffered visual as a single buffer visual by changing + the draw buffer to GL_FRONT and treating any swap + buffers as no-ops. */ + displayMode |= GLUT_DOUBLE; + vis = getVisualInfo(displayMode); + *treatAsSingle = True; + } + if (!vis && GLUT_WIND_IS_MULTISAMPLE(displayMode)) { + /* If we can't seem to get multisampling (ie, not Reality + Engine class graphics!), go without multisampling. It + is up to the application to query how many multisamples + were allocated (0 equals no multisampling) if the + application is going to use multisampling for more than + just antialiasing. */ + displayMode &= ~GLUT_MULTISAMPLE; + vis = getVisualInfo(displayMode); + } + } + return vis; +} + +static void GLUTCALLBACK +__glutDefaultDisplay(void) +{ + /* XXX Remove the warning after GLUT 3.0. */ + __glutWarning("The following is a new check for GLUT 3.0; update your code."); + __glutFatalError( + "redisplay needed for window %d, but no display callback.", + __glutCurrentWindow->num + 1); +} + +void GLUTCALLBACK +__glutDefaultReshape(int width, int height) +{ + GLUToverlay *overlay; + + /* Adjust the viewport of the window (and overlay if one + exists). */ + MAKE_CURRENT_WINDOW(__glutCurrentWindow); + glViewport(0, 0, (GLsizei) width, (GLsizei) height); + overlay = __glutCurrentWindow->overlay; + if (overlay) { + MAKE_CURRENT_OVERLAY(overlay); + glViewport(0, 0, (GLsizei) width, (GLsizei) height); + } + /* Make sure we are current to the current layer (application + should be able to count on the current layer not changing + unless the application explicitly calls glutUseLayer). */ + MAKE_CURRENT_LAYER(__glutCurrentWindow); +} + +XVisualInfo * +__glutDetermineWindowVisual(Bool * treatAsSingle, Bool * visAlloced, void **fbc) +{ + if (__glutDisplayString) { + + /* __glutDisplayString should be NULL except if + glutInitDisplayString has been called to register a + different display string. Calling glutInitDisplayString + means using a string instead of an integer mask determine + the visual to use. Using the function pointer variable + __glutDetermineVisualFromString below avoids linking in + the code for implementing glutInitDisplayString (ie, + glut_dstr.o) unless glutInitDisplayString gets called by + the application. */ + + assert(__glutDetermineVisualFromString); + *visAlloced = False; + *fbc = NULL; + return __glutDetermineVisualFromString(__glutDisplayString, treatAsSingle, + requiredWindowCriteria, numRequiredWindowCriteria, requiredWindowCriteriaMask, fbc); + } else { + *visAlloced = True; + *fbc = NULL; + return __glutDetermineVisual(__glutDisplayMode, + treatAsSingle, __glutGetVisualInfo); + } +} + +/* ARGSUSED5 */ /* Only Win32 uses gameMode parameter. */ +GLUTwindow * +__glutCreateWindow(GLUTwindow * parent, + int x, int y, int width, int height, int gameMode) +{ + GLUTwindow *window; + XSetWindowAttributes wa; + unsigned long attribMask; + int winnum; + int i; + void *fbc; + +#if defined(_WIN32) + WNDCLASS wc; + int style; + + if (!GetClassInfo(GetModuleHandle(NULL), "GLUT", &wc)) { + __glutOpenWin32Connection(NULL); + } +#else + if (!__glutDisplay) { + __glutOpenXConnection(NULL); + } +#endif + if (__glutGameModeWindow) { + __glutFatalError("cannot create windows in game mode."); + } + winnum = getUnusedWindowSlot(); + window = (GLUTwindow *) malloc(sizeof(GLUTwindow)); + if (!window) { + __glutFatalError("out of memory."); + } + window->num = winnum; + +#if !defined(_WIN32) + window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, + &window->visAlloced, &fbc); + if (!window->vis) { + __glutFatalError( + "visual with necessary capabilities not found."); + } + __glutSetupColormap(window->vis, &window->colormap, &window->cmap); +#endif + window->eventMask = StructureNotifyMask | ExposureMask; + + attribMask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask; + wa.background_pixmap = None; + wa.border_pixel = 0; + wa.colormap = window->cmap; + wa.event_mask = window->eventMask; + if (parent) { + if (parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) + wa.event_mask |= GLUT_HACK_STOP_PROPAGATE_MASK; + attribMask |= CWDontPropagate; + wa.do_not_propagate_mask = parent->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK; + } else { + wa.do_not_propagate_mask = 0; + } + + /* Stash width and height before Win32's __glutAdjustCoords + possibly overwrites the values. */ + window->width = width; + window->height = height; + window->forceReshape = True; + window->ignoreKeyRepeat = False; + +#if defined(_WIN32) + __glutAdjustCoords(parent ? parent->win : NULL, + &x, &y, &width, &height); + if (parent) { + style = WS_CHILD; + } else { + if (gameMode) { + /* Game mode window should be a WS_POPUP window to + ensure that the taskbar is hidden by it. A standard + WS_OVERLAPPEDWINDOW does not hide the task bar. */ + style = WS_POPUP | WS_MAXIMIZE; + } else { + /* A standard toplevel window with borders and such. */ + style = WS_OVERLAPPEDWINDOW; + } + } + window->win = CreateWindow("GLUT", "GLUT", + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style, + x, y, width, height, parent ? parent->win : __glutRoot, + NULL, GetModuleHandle(NULL), 0); + window->hdc = GetDC(window->win); + /* Must set the XHDC for fake glXChooseVisual & fake + glXCreateContext & fake XAllocColorCells. */ + XHDC = window->hdc; + window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, + &window->visAlloced, &fbc); + if (!window->vis) { + __glutFatalError( + "pixel format with necessary capabilities not found."); + } + if (!SetPixelFormat(window->hdc, + ChoosePixelFormat(window->hdc, window->vis), + window->vis)) { + __glutFatalError("SetPixelFormat failed during window create."); + } + __glutSetupColormap(window->vis, &window->colormap, &window->cmap); + /* Make sure subwindows get a windowStatus callback. */ + if (parent) { + PostMessage(parent->win, WM_ACTIVATE, 0, 0); + } + window->renderDc = window->hdc; +#else + window->win = XCreateWindow(__glutDisplay, + parent == NULL ? __glutRoot : parent->win, + x, y, width, height, 0, + window->vis->depth, InputOutput, window->vis->visual, + attribMask, &wa); +#endif + window->renderWin = window->win; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + if (fbc) { + window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc, + GLX_RGBA_TYPE_SGIX, None, __glutTryDirect); + } else +#endif + { + window->ctx = glXCreateContext(__glutDisplay, window->vis, + None, __glutTryDirect); + } + if (!window->ctx) { + __glutFatalError( + "failed to create OpenGL rendering context."); + } + window->renderCtx = window->ctx; +#if !defined(_WIN32) + window->isDirect = glXIsDirect(__glutDisplay, window->ctx); + if (__glutForceDirect) { + if (!window->isDirect) + __glutFatalError("direct rendering not possible."); + } +#endif + + window->parent = parent; + if (parent) { + window->siblings = parent->children; + parent->children = window; + } else { + window->siblings = NULL; + } + window->overlay = NULL; + window->children = NULL; + window->display = __glutDefaultDisplay; + window->reshape = __glutDefaultReshape; + window->mouse = NULL; + window->motion = NULL; + window->passive = NULL; + window->entry = NULL; + window->keyboard = NULL; + window->keyboardUp = NULL; + window->windowStatus = NULL; + window->visibility = NULL; + window->special = NULL; + window->specialUp = NULL; + window->buttonBox = NULL; + window->dials = NULL; + window->spaceMotion = NULL; + window->spaceRotate = NULL; + window->spaceButton = NULL; + window->tabletMotion = NULL; + window->tabletButton = NULL; +#ifdef _WIN32 + window->joystick = NULL; + window->joyPollInterval = 0; +#endif + window->tabletPos[0] = -1; + window->tabletPos[1] = -1; + window->shownState = 0; + window->visState = -1; /* not VisibilityUnobscured, + VisibilityPartiallyObscured, or + VisibilityFullyObscured */ + window->entryState = -1; /* not EnterNotify or LeaveNotify */ + + window->desiredConfMask = 0; + window->buttonUses = 0; + window->cursor = GLUT_CURSOR_INHERIT; + + /* Setup window to be mapped when glutMainLoop starts. */ + window->workMask = GLUT_MAP_WORK; +#ifdef _WIN32 + if (gameMode) { + /* When mapping a game mode window, just show + the window. We have already created the game + mode window with a maximize flag at creation + time. Doing a ShowWindow(window->win, SW_SHOWNORMAL) + would be wrong for a game mode window since it + would unmaximize the window. */ + window->desiredMapState = GameModeState; + } else { + window->desiredMapState = NormalState; + } +#else + window->desiredMapState = NormalState; +#endif + window->prevWorkWin = __glutWindowWorkList; + __glutWindowWorkList = window; + + /* Initially, no menus attached. */ + for (i = 0; i < GLUT_MAX_MENUS; i++) { + window->menu[i] = 0; + } + + /* Add this new window to the window list. */ + __glutWindowList[winnum] = window; + + /* Make the new window the current window. */ + __glutSetWindow(window); + + __glutDetermineMesaSwapHackSupport(); + + if (window->treatAsSingle) { + /* We do this because either the window really is single + buffered (in which case this is redundant, but harmless, + because this is the initial single-buffered context + state); or we are treating a double buffered window as a + single-buffered window because the system does not appear + to export any suitable single- buffered visuals (in which + the following are necessary). */ + glDrawBuffer(GL_FRONT); + glReadBuffer(GL_FRONT); + } + return window; +} + +/* CENTRY */ +int GLUTAPIENTRY +glutCreateWindow(const char *title) +{ + static int firstWindow = 1; + GLUTwindow *window; +#if !defined(_WIN32) + XWMHints *wmHints; +#endif + Window win; + XTextProperty textprop; + + if (__glutGameModeWindow) { + __glutFatalError("cannot create windows in game mode."); + } + window = __glutCreateWindow(NULL, + __glutSizeHints.x, __glutSizeHints.y, + __glutInitWidth, __glutInitHeight, + /* not game mode */ 0); + win = window->win; + /* Setup ICCCM properties. */ + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); +#if defined(_WIN32) + SetWindowText(win, title); + if (__glutIconic) { + window->desiredMapState = IconicState; + } +#else + wmHints = XAllocWMHints(); + wmHints->initial_state = + __glutIconic ? IconicState : NormalState; + wmHints->flags = StateHint; + XSetWMProperties(__glutDisplay, win, &textprop, &textprop, + /* Only put WM_COMMAND property on first window. */ + firstWindow ? __glutArgv : NULL, + firstWindow ? __glutArgc : 0, + &__glutSizeHints, wmHints, NULL); + XFree(wmHints); + XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); +#endif + firstWindow = 0; + return window->num + 1; +} + +#ifdef _WIN32 +int GLUTAPIENTRY +__glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)) +{ + __glutExitFunc = exitfunc; + return glutCreateWindow(title); +} +#endif + +int GLUTAPIENTRY +glutCreateSubWindow(int win, int x, int y, int width, int height) +{ + GLUTwindow *window; + + window = __glutCreateWindow(__glutWindowList[win - 1], + x, y, width, height, /* not game mode */ 0); +#if !defined(_WIN32) + { + GLUTwindow *toplevel; + + toplevel = __glutToplevelOf(window); + if (toplevel->cmap != window->cmap) { + __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); + } + } +#endif + return window->num + 1; +} +/* ENDCENTRY */ + +void +__glutDestroyWindow(GLUTwindow * window, + GLUTwindow * initialWindow) +{ + GLUTwindow **prev, *cur, *parent, *siblings; + + /* Recursively destroy any children. */ + cur = window->children; + while (cur) { + siblings = cur->siblings; + __glutDestroyWindow(cur, initialWindow); + cur = siblings; + } + /* Remove from parent's children list (only necessary for + non-initial windows and subwindows!). */ + parent = window->parent; + if (parent && parent == initialWindow->parent) { + prev = &parent->children; + cur = parent->children; + while (cur) { + if (cur == window) { + *prev = cur->siblings; + break; + } + prev = &(cur->siblings); + cur = cur->siblings; + } + } + /* Unbind if bound to this window. */ + if (window == __glutCurrentWindow) { + UNMAKE_CURRENT(); + __glutCurrentWindow = NULL; + } + /* Begin tearing down window itself. */ + if (window->overlay) { + __glutFreeOverlayFunc(window->overlay); + } + XDestroyWindow(__glutDisplay, window->win); + glXDestroyContext(__glutDisplay, window->ctx); + if (window->colormap) { + /* Only color index windows have colormap data structure. */ + __glutFreeColormap(window->colormap); + } + /* NULLing the __glutWindowList helps detect is a window + instance has been destroyed, given a window number. */ + __glutWindowList[window->num] = NULL; + + /* Cleanup data structures that might contain window. */ + cleanWindowWorkList(window); +#if !defined(_WIN32) + cleanStaleWindowList(window); +#endif + /* Remove window from the "get window cache" if it is there. */ + if (__glutWindowCache == window) + __glutWindowCache = NULL; + + if (window->visAlloced) { + /* Only free XVisualInfo* gotten from glXChooseVisual. */ + XFree(window->vis); + } + + if (window == __glutGameModeWindow) { + /* Destroying the game mode window should implicitly + have GLUT leave game mode. */ + __glutCloseDownGameMode(); + } + + free(window); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutDestroyWindow(int win) +{ + GLUTwindow *window = __glutWindowList[win - 1]; + + if (__glutMappedMenu && __glutMenuWindow == window) { + __glutFatalUsage("destroying menu window not allowed while menus in use"); + } +#if !defined(_WIN32) + /* If not a toplevel window... */ + if (window->parent) { + /* Destroying subwindows may change colormap requirements; + recalculate toplevel window's WM_COLORMAP_WINDOWS + property. */ + __glutPutOnWorkList(__glutToplevelOf(window->parent), + GLUT_COLORMAP_WORK); + } +#endif + __glutDestroyWindow(window, window); + XFlush(__glutDisplay); +} +/* ENDCENTRY */ + +void +__glutChangeWindowEventMask(long eventMask, Bool add) +{ + if (add) { + /* Add eventMask to window's event mask. */ + if ((__glutCurrentWindow->eventMask & eventMask) != + eventMask) { + __glutCurrentWindow->eventMask |= eventMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_EVENT_MASK_WORK); + } + } else { + /* Remove eventMask from window's event mask. */ + if (__glutCurrentWindow->eventMask & eventMask) { + __glutCurrentWindow->eventMask &= ~eventMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_EVENT_MASK_WORK); + } + } +} + +void GLUTAPIENTRY +glutDisplayFunc(GLUTdisplayCB displayFunc) +{ + /* XXX Remove the warning after GLUT 3.0. */ + if (!displayFunc) + __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code."); + __glutCurrentWindow->display = displayFunc; +} + +void GLUTAPIENTRY +glutMouseFunc(GLUTmouseCB mouseFunc) +{ + if (__glutCurrentWindow->mouse) { + if (!mouseFunc) { + /* Previous mouseFunc being disabled. */ + __glutCurrentWindow->buttonUses--; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, + __glutCurrentWindow->buttonUses > 0); + } + } else { + if (mouseFunc) { + /* Previously no mouseFunc, new one being installed. */ + __glutCurrentWindow->buttonUses++; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, True); + } + } + __glutCurrentWindow->mouse = mouseFunc; +} + +void GLUTAPIENTRY +glutMotionFunc(GLUTmotionCB motionFunc) +{ + /* Hack. Some window managers (4Dwm by default) will mask + motion events if the client is not selecting for button + press and release events. So we select for press and + release events too (being careful to use reference + counting). */ + if (__glutCurrentWindow->motion) { + if (!motionFunc) { + /* previous mouseFunc being disabled */ + __glutCurrentWindow->buttonUses--; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, + __glutCurrentWindow->buttonUses > 0); + } + } else { + if (motionFunc) { + /* Previously no mouseFunc, new one being installed. */ + __glutCurrentWindow->buttonUses++; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, True); + } + } + /* Real work of selecting for passive mouse motion. */ + __glutChangeWindowEventMask( + Button1MotionMask | Button2MotionMask | Button3MotionMask, + motionFunc != NULL); + __glutCurrentWindow->motion = motionFunc; +} + +void GLUTAPIENTRY +glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc) +{ + __glutChangeWindowEventMask(PointerMotionMask, + passiveMotionFunc != NULL); + + /* Passive motion also requires watching enters and leaves so + that a fake passive motion event can be generated on an + enter. */ + __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask, + __glutCurrentWindow->entry != NULL || passiveMotionFunc != NULL); + + __glutCurrentWindow->passive = passiveMotionFunc; +} + +void GLUTAPIENTRY +glutEntryFunc(GLUTentryCB entryFunc) +{ + __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask, + entryFunc != NULL || __glutCurrentWindow->passive); + __glutCurrentWindow->entry = entryFunc; + if (!entryFunc) { + __glutCurrentWindow->entryState = -1; + } +} + +void GLUTAPIENTRY +glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc) +{ + __glutChangeWindowEventMask(VisibilityChangeMask, + windowStatusFunc != NULL); + __glutCurrentWindow->windowStatus = windowStatusFunc; + if (!windowStatusFunc) { + /* Make state invalid. */ + __glutCurrentWindow->visState = -1; + } +} + +static void GLUTCALLBACK +visibilityHelper(int status) +{ + if (status == GLUT_HIDDEN || status == GLUT_FULLY_COVERED) + __glutCurrentWindow->visibility(GLUT_NOT_VISIBLE); + else + __glutCurrentWindow->visibility(GLUT_VISIBLE); +} + +void GLUTAPIENTRY +glutVisibilityFunc(GLUTvisibilityCB visibilityFunc) +{ + __glutCurrentWindow->visibility = visibilityFunc; + if (visibilityFunc) + glutWindowStatusFunc(visibilityHelper); + else + glutWindowStatusFunc(NULL); +} + +void GLUTAPIENTRY +glutReshapeFunc(GLUTreshapeCB reshapeFunc) +{ + if (reshapeFunc) { + __glutCurrentWindow->reshape = reshapeFunc; + } else { + __glutCurrentWindow->reshape = __glutDefaultReshape; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/glut_winmisc.c xpsb-glx-0.19/mesa/src/glut/glx/glut_winmisc.c --- xpsb-glx-0.19/mesa/src/glut/glx/glut_winmisc.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/glut_winmisc.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,124 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include + +#if !defined(_WIN32) +#include +#include +#include /* for XA_STRING atom */ +#endif + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutSetWindowTitle(const char *title) +{ + XTextProperty textprop; + + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); + XSetWMName(__glutDisplay, + __glutCurrentWindow->win, &textprop); + XFlush(__glutDisplay); +} + +void GLUTAPIENTRY +glutSetIconTitle(const char *title) +{ + XTextProperty textprop; + + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); + XSetWMIconName(__glutDisplay, + __glutCurrentWindow->win, &textprop); + XFlush(__glutDisplay); +} + +void GLUTAPIENTRY +glutPositionWindow(int x, int y) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredX = x; + __glutCurrentWindow->desiredY = y; + __glutCurrentWindow->desiredConfMask |= CWX | CWY; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutReshapeWindow(int w, int h) +{ + IGNORE_IN_GAME_MODE(); + if (w <= 0 || h <= 0) + __glutWarning("glutReshapeWindow: non-positive width or height not allowed"); + + __glutCurrentWindow->desiredWidth = w; + __glutCurrentWindow->desiredHeight = h; + __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutPopWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredStack = Above; + __glutCurrentWindow->desiredConfMask |= CWStackMode; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutPushWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredStack = Below; + __glutCurrentWindow->desiredConfMask |= CWStackMode; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutIconifyWindow(void) +{ + IGNORE_IN_GAME_MODE(); + assert(!__glutCurrentWindow->parent); + __glutCurrentWindow->desiredMapState = IconicState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +void GLUTAPIENTRY +glutShowWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredMapState = NormalState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +void GLUTAPIENTRY +glutHideWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredMapState = WithdrawnState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/layerutil.c xpsb-glx-0.19/mesa/src/glut/glx/layerutil.c --- xpsb-glx-0.19/mesa/src/glut/glx/layerutil.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/layerutil.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,204 @@ + +/* Copyright (c) Mark J. Kilgard, 1993, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* Based on XLayerUtil.c: Revision: 1.5 */ + +#include +#include +#include "layerutil.h" + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#include +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif + +static Bool layersRead = False; +static OverlayInfo **overlayInfoPerScreen; +static unsigned long *numOverlaysPerScreen; + +static void +findServerOverlayVisualsInfo(Display * dpy) +{ + static Atom overlayVisualsAtom; + Atom actualType; + Status status; + unsigned long sizeData, bytesLeft; + Window root; + int actualFormat, numScreens, i; + + if (layersRead == False) { + overlayVisualsAtom = XSGIFastInternAtom(dpy, + "SERVER_OVERLAY_VISUALS", SGI_XA_SERVER_OVERLAY_VISUALS, True); + if (overlayVisualsAtom != None) { + numScreens = ScreenCount(dpy); + overlayInfoPerScreen = (OverlayInfo **) + malloc(numScreens * sizeof(OverlayInfo *)); + numOverlaysPerScreen = (unsigned long *) + malloc(numScreens * sizeof(unsigned long)); + if (overlayInfoPerScreen != NULL && + numOverlaysPerScreen != NULL) { + for (i = 0; i < numScreens; i++) { + root = RootWindow(dpy, i); + status = XGetWindowProperty(dpy, root, + overlayVisualsAtom, 0L, (long) 10000, False, + overlayVisualsAtom, &actualType, &actualFormat, + &sizeData, &bytesLeft, + (unsigned char **) &overlayInfoPerScreen[i]); + if (status != Success || + actualType != overlayVisualsAtom || + actualFormat != 32 || sizeData < 4) + numOverlaysPerScreen[i] = 0; + else + /* Four 32-bit quantities per + SERVER_OVERLAY_VISUALS entry. */ + numOverlaysPerScreen[i] = sizeData / 4; + } + layersRead = True; + } else { + if (overlayInfoPerScreen != NULL) + free(overlayInfoPerScreen); + if (numOverlaysPerScreen != NULL) + free(numOverlaysPerScreen); + } + } + } +} + +int +__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo) +{ + int i, screen = vinfo->screen; + OverlayInfo *overlayInfo; + + findServerOverlayVisualsInfo(dpy); + if (layersRead) { + for (i = 0; i < numOverlaysPerScreen[screen]; i++) { + overlayInfo = &overlayInfoPerScreen[screen][i]; + if (vinfo->visualid == overlayInfo->overlay_visual) { + if (overlayInfo->transparent_type == TransparentPixel) { + return (int) overlayInfo->value; + } else { + return -1; + } + } + } + } + return -1; +} + +XLayerVisualInfo * +__glutXGetLayerVisualInfo(Display * dpy, long lvinfo_mask, + XLayerVisualInfo * lvinfo_template, int *nitems_return) +{ + XVisualInfo *vinfo; + XLayerVisualInfo *layerInfo; + int numVisuals, count, i, j; + + vinfo = XGetVisualInfo(dpy, lvinfo_mask & VisualAllMask, + &lvinfo_template->vinfo, nitems_return); + if (vinfo == NULL) + return NULL; + numVisuals = *nitems_return; + findServerOverlayVisualsInfo(dpy); + layerInfo = (XLayerVisualInfo *) + malloc(numVisuals * sizeof(XLayerVisualInfo)); + if (layerInfo == NULL) { + XFree(vinfo); + return NULL; + } + count = 0; + for (i = 0; i < numVisuals; i++) { + XVisualInfo *pVinfo = &vinfo[i]; + int screen = pVinfo->screen; + OverlayInfo *overlayInfo = NULL; + + overlayInfo = NULL; + if (layersRead) { + for (j = 0; j < numOverlaysPerScreen[screen]; j++) + if (pVinfo->visualid == + overlayInfoPerScreen[screen][j].overlay_visual) { + overlayInfo = &overlayInfoPerScreen[screen][j]; + break; + } + } + if (lvinfo_mask & VisualLayerMask) { + if (overlayInfo == NULL) { + if (lvinfo_template->layer != 0) + continue; + } else if (lvinfo_template->layer != overlayInfo->layer) + continue; + } + if (lvinfo_mask & VisualTransparentType) { + if (overlayInfo == NULL) { + if (lvinfo_template->type != None) + continue; + } else if (lvinfo_template->type != + overlayInfo->transparent_type) + continue; + } + if (lvinfo_mask & VisualTransparentValue) { + if (overlayInfo == NULL) + /* Non-overlay visuals have no sense of + TransparentValue. */ + continue; + else if (lvinfo_template->value != overlayInfo->value) + continue; + } + layerInfo[count].vinfo = *pVinfo; + if (overlayInfo == NULL) { + layerInfo[count].layer = 0; + layerInfo[count].type = None; + layerInfo[count].value = 0; /* meaningless */ + } else { + layerInfo[count].layer = overlayInfo->layer; + layerInfo[count].type = overlayInfo->transparent_type; + layerInfo[count].value = overlayInfo->value; + } + count++; + } + XFree(vinfo); + *nitems_return = count; + if (count == 0) { + XFree(layerInfo); + return NULL; + } else + return layerInfo; +} + +#if 0 /* Unused by GLUT. */ +Status +__glutXMatchLayerVisualInfo(Display * dpy, int screen, + int depth, int visualClass, int layer, + XLayerVisualInfo * lvinfo_return) +{ + XLayerVisualInfo *lvinfo; + XLayerVisualInfo lvinfoTemplate; + int nitems; + + lvinfoTemplate.vinfo.screen = screen; + lvinfoTemplate.vinfo.depth = depth; +#if defined(__cplusplus) || defined(c_plusplus) + lvinfoTemplate.vinfo.c_class = visualClass; +#else + lvinfoTemplate.vinfo.class = visualClass; +#endif + lvinfoTemplate.layer = layer; + lvinfo = __glutXGetLayerVisualInfo(dpy, + VisualScreenMask | VisualDepthMask | + VisualClassMask | VisualLayerMask, + &lvinfoTemplate, &nitems); + if (lvinfo != NULL && nitems > 0) { + *lvinfo_return = *lvinfo; + return 1; + } else + return 0; +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/layerutil.h xpsb-glx-0.19/mesa/src/glut/glx/layerutil.h --- xpsb-glx-0.19/mesa/src/glut/glx/layerutil.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/layerutil.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,59 @@ +#ifndef __layerutil_h__ +#define __layerutil_h__ + +/* Copyright (c) Mark J. Kilgard, 1993, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* Based on XLayerUtil.h: Revision: 1.3 */ + +#ifdef __VMS +#include +#endif + +#if !defined(_WIN32) +#include +#include +#include +#endif /* !_WIN32 */ + +/* Transparent type values */ +/* None 0 */ +#define TransparentPixel 1 +#define TransparentMask 2 + +/* layered visual info template flags */ +#define VisualLayerMask 0x200 +#define VisualTransparentType 0x400 +#define VisualTransparentValue 0x800 +#define VisualAllLayerMask 0xFFF + +/* layered visual info structure */ +typedef struct _XLayerVisualInfo { + XVisualInfo vinfo; + long layer; + long type; + unsigned long value; +} XLayerVisualInfo; + +/* SERVER_OVERLAY_VISUALS property element */ +typedef struct _OverlayInfo { + /* Avoid 64-bit portability problems by being careful to use + longs due to the way XGetWindowProperty is specified. Note + that these parameters are passed as CARD32s over X + protocol. */ + long overlay_visual; + long transparent_type; + long value; + long layer; +} OverlayInfo; + +extern int __glutGetTransparentPixel(Display *, XVisualInfo *); +extern XLayerVisualInfo *__glutXGetLayerVisualInfo(Display *, + long, XLayerVisualInfo *, int *); +extern Status __glutXMatchLayerVisualInfo(Display *, + int, int, int, int, XLayerVisualInfo *); + +#endif /* __layerutil_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/Makefile xpsb-glx-0.19/mesa/src/glut/glx/Makefile --- xpsb-glx-0.19/mesa/src/glut/glx/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,138 @@ +# Makefile for GLUT +# +# NOTICE: The OpenGL Utility Toolkit (GLUT) distribution contains source +# code published in a book titled "Programming OpenGL for the X Window +# System" (ISBN: 0-201-48359-9) published by Addison-Wesley. The +# programs and associated files contained in the distribution were +# developed by Mark J. Kilgard and are Copyright 1994, 1995, 1996 by Mark +# J. Kilgard (unless otherwise noted). The programs are not in the +# public domain, but they are freely distributable without licensing +# fees. These programs are provided without guarantee or warrantee +# expressed or implied. +# +# GLUT source included with Mesa with permission from Mark Kilgard. + + +TOP = ../../.. + +include $(TOP)/configs/current + + +##### MACROS ##### + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 1 + +SOURCES = \ + glut_8x13.c \ + glut_9x15.c \ + glut_bitmap.c \ + glut_bwidth.c \ + glut_cindex.c \ + glut_cmap.c \ + glut_cursor.c \ + glut_dials.c \ + glut_dstr.c \ + glut_event.c \ + glut_ext.c \ + glut_fcb.c \ + glut_fullscrn.c \ + glut_gamemode.c \ + glut_get.c \ + glut_glxext.c \ + glut_hel10.c \ + glut_hel12.c \ + glut_hel18.c \ + glut_init.c \ + glut_input.c \ + glut_joy.c \ + glut_key.c \ + glut_keyctrl.c \ + glut_keyup.c \ + glut_menu.c \ + glut_menu2.c \ + glut_mesa.c \ + glut_modifier.c \ + glut_mroman.c \ + glut_overlay.c \ + glut_ppm.c \ + glut_roman.c \ + glut_shapes.c \ + glut_space.c \ + glut_stroke.c \ + glut_swap.c \ + glut_swidth.c \ + glut_tablet.c \ + glut_teapot.c \ + glut_tr10.c \ + glut_tr24.c \ + glut_util.c \ + glut_vidresize.c \ + glut_warp.c \ + glut_win.c \ + glut_winmisc.c \ + layerutil.c + + +OBJECTS = $(SOURCES:.c=.o) + + +##### RULES ##### + +.c.o: + $(CC) -c -I$(TOP)/include $(X11_INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) $< + + + +##### TARGETS ##### + +default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + + +# Make the library +$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ + $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + -id $(INSTALL_LIB_DIR)/lib$(GLUT_LIB).$(GLUT_MAJOR).dylib \ + $(GLUT_LIB_DEPS) $(OBJECTS) + + +# glut pkgconfig file +pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ + -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ + -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' \ + -e 's,@GLUT_PC_REQ_PRIV@,$(GLUT_PC_REQ_PRIV),' \ + -e 's,@GLUT_PC_LIB_PRIV@,$(GLUT_PC_LIB_PRIV),' \ + -e 's,@GLUT_PC_CFLAGS@,$(GLUT_PC_CFLAGS),' +glut.pc: glut.pc.in + $(pcedit) $< > $@ + +install: glut.pc + $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + +clean: + -rm -f *.o *~ + -rm -f *.lo + -rm -f *.la + -rm -f *.pc + -rm -rf .libs + -rm -f depend depend.bak + + +depend: $(SOURCES) + @ echo "running $(MKDEP)" + @ touch depend + @ $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(SOURCES) \ + $(X11_INCLUDES) > /dev/null + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/Makefile.cygnus xpsb-glx-0.19/mesa/src/glut/glx/Makefile.cygnus --- xpsb-glx-0.19/mesa/src/glut/glx/Makefile.cygnus 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/Makefile.cygnus 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,110 @@ +# Makefile.cygnus for Cygnus-Win32 target +# /Stephane Rehel, November 16 1997 + +# Makefile for GLUT 3.7 +# +# NOTICE: The OpenGL Utility Toolkit (GLUT) distribution contains source +# code published in a book titled "Programming OpenGL for the X Window +# System" (ISBN: 0-201-48359-9) published by Addison-Wesley. The +# programs and associated files contained in the distribution were +# developed by Mark J. Kilgard and are Copyright 1994, 1995, 1996 by Mark +# J. Kilgard (unless otherwise noted). The programs are not in the +# public domain, but they are freely distributable without licensing +# fees. These programs are provided without guarantee or warrantee +# expressed or implied. +# +# GLUT source included with Mesa with permission from Mark Kilgard. + + +##### MACROS ##### + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 0 + +VPATH = RCS + +INCDIR = ../include +LIBDIR = ../lib + +SOURCES = \ + glut_8x13.c \ + glut_9x15.c \ + glut_bitmap.c \ + glut_bwidth.c \ + glut_cindex.c \ + glut_cmap.c \ + glut_cursor.c \ + glut_dials.c \ + glut_dstr.c \ + glut_event.c \ + glut_ext.c \ + glut_fullscrn.c \ + glut_get.c \ + glut_hel10.c \ + glut_hel12.c \ + glut_hel18.c \ + glut_init.c \ + glut_input.c \ + glut_mesa.c \ + glut_modifier.c \ + glut_mroman.c \ + glut_overlay.c \ + glut_roman.c \ + glut_shapes.c \ + glut_space.c \ + glut_stroke.c \ + glut_swap.c \ + glut_swidth.c \ + glut_tablet.c \ + glut_teapot.c \ + glut_tr10.c \ + glut_tr24.c \ + glut_util.c \ + glut_vidresize.c \ + glut_warp.c \ + glut_win.c \ + glut_winmisc.c \ + win32_x11.c \ + win32_glx.c \ + win32_menu.c \ + win32_util.c + +OBJECTS = $(SOURCES:.c=.o) + + + +##### RULES ##### + +.c.o: + $(CC) -c -I$(INCDIR) $(CFLAGS) $< + + + +##### TARGETS ##### + +default: + @echo "Specify a target configuration" + +clean: + -rm *.o *~ + +targets: $(LIBDIR)/$(GLUT_LIB) + +# Make the library +$(LIBDIR)/$(GLUT_LIB): $(OBJECTS) + $(MAKELIB) $(GLUT_LIB) $(GLUT_MAJOR) $(GLUT_MINOR) $(GLUT_TINY) $(OBJECTS) + mv $(GLUT_LIB)* $(LIBDIR) + +include ../Make-config + +include depend + + + +# +# Run 'make dep' to update the dependencies if you change what's included +# by any source file. +# +dep: $(SOURCES) + makedepend -fdepend -Y -I../include $(SOURCES) diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/Makefile.mgw xpsb-glx-0.19/mesa/src/glut/glx/Makefile.mgw --- xpsb-glx-0.19/mesa/src/glut/glx/Makefile.mgw 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/Makefile.mgw 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,191 @@ +# Mesa 3-D graphics library +# Version: 5.1 +# +# Copyright (C) 1999-2003 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. + +# MinGW core makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + +# MinGW core-glut makefile updated for Mesa 7.0 +# +# Updated : by Heromyth, on 2007-7-21 +# Email : zxpmyth@yahoo.com.cn +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# The others havn't been tested yet. +# 2) The generated DLLs are *not* compatible with the ones built +# with the other compilers like VC8, especially for GLUT. +# 3) Although more tests are needed, it can be used individually! + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most WMesa code and requires fxMesa. +# As a consequence, you'll need the Win32 Glide3 +# library to build any application. +# default = no +# ICD=1 build the installable client driver interface +# (windows opengl driver interface) +# default = no +# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). +# default = no +# +# Targets: +# all: build GL +# clean: remove object files +# + + + +.PHONY: all clean +.INTERMEDIATE: x86/gen_matypes.exe +.SUFFIXES: .rc .res + +# Set this to the prefix of your build tools, i.e. mingw32- +TOOLS_PREFIX = mingw32- + +TOP = ../../.. + +LIBDIR = $(TOP)/lib + +LIB_NAME = glut32 + +DLL_EXT = .dll +IMP_EXT = .a +LIB_PRE = lib +STRIP = -s + +AR = ar +ARFLAGS = crus +DLLTOOL = dlltool + +GLUT_DLL = $(LIB_NAME)$(DLL_EXT) +GLUT_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT) +GLUT_DEF = $(LIB_NAME).def + +LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32 +LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at + +CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL +CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include + +CC = $(TOOLS_PREFIX)gcc +CXX = $(TOOLS_PREFIX)g++ +CXXFLAGS = $(CFLAGS) + +AR = ar +ARFLAGS = crus + +UNLINK = del $(subst /,\,$(1)) +ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = $(RM) $(1) +endif +ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) +UNLINK = $(RM) $(1) +endif + +HDRS = glutint.h glutstroke.h glutbitmap.h glutwin32.h stroke.h win32_glx.h win32_x11.h + +SRCS = \ + glut_bitmap.c \ + glut_bwidth.c \ + glut_cindex.c \ + glut_cmap.c \ + glut_cursor.c \ + glut_dials.c \ + glut_dstr.c \ + glut_event.c \ + glut_ext.c \ + glut_fcb.c \ + glut_fullscrn.c \ + glut_gamemode.c \ + glut_get.c \ + glut_init.c \ + glut_input.c \ + glut_joy.c \ + glut_key.c \ + glut_keyctrl.c \ + glut_keyup.c \ + glut_mesa.c \ + glut_modifier.c \ + glut_overlay.c \ + glut_shapes.c \ + glut_space.c \ + glut_stroke.c \ + glut_swap.c \ + glut_swidth.c \ + glut_tablet.c \ + glut_teapot.c \ + glut_util.c \ + glut_vidresize.c \ + glut_warp.c \ + glut_win.c \ + glut_winmisc.c \ + win32_glx.c \ + win32_menu.c \ + win32_util.c \ + win32_winproc.c \ + win32_x11.c + + +SRCSSEMIGENS = \ + glut_8x13.c \ + glut_9x15.c \ + glut_hel10.c \ + glut_hel12.c \ + glut_hel18.c \ + glut_mroman.c \ + glut_roman.c \ + glut_tr10.c \ + glut_tr24.c + + + +SOURCES = $(SRCS) $(SRCSSEMIGENS) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.cc.o: + $(CXX) -o $@ $(CXXFLAGS) -c $< + + +all: $(LIBDIR) $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP) + +$(LIBDIR): + mkdir -p $(LIBDIR) + +$(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) + $(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLUT_DLL) $^ $(LDLIBS) + $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLUT_DEF) $^ + $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLUT_IMP) --def $(LIBDIR)/$(GLUT_DEF) + +clean: + -$(call UNLINK,*.o) \ No newline at end of file diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/Makefile.sgi xpsb-glx-0.19/mesa/src/glut/glx/Makefile.sgi --- xpsb-glx-0.19/mesa/src/glut/glx/Makefile.sgi 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/Makefile.sgi 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,189 @@ +#! smake +# +# Copyright (c) Mark J. Kilgard, 1995, 1998. +# +include $(ROOT)/usr/include/make/commondefs + +# NOTE: In my GLUT development tree, many of the C source files for +# GLUT are generated. For this reason, "make full_clobber" will remove +# these generated C files, while "make clobber" will not. + +TOP = ../.. + +TARGETS = libglut.a + +LN = ln -s +MV = mv +RM = -rm -rf + +HDRS = glutint.h glutstroke.h layerutil.h glutbitmap.h + +SRCS = \ + glut_bitmap.c \ + glut_bwidth.c \ + glut_cindex.c \ + glut_cmap.c \ + glut_cursor.c \ + glut_dials.c \ + glut_dstr.c \ + glut_event.c \ + glut_ext.c \ + glut_fbc.c \ + glut_fullscrn.c \ + glut_gamemode.c \ + glut_get.c \ + glut_glxext.c \ + glut_init.c \ + glut_input.c \ + glut_joy.c \ + glut_key.c \ + glut_keyctrl.c \ + glut_keyup.c \ + glut_menu.c \ + glut_menu2.c \ + glut_mesa.c \ + glut_modifier.c \ + glut_overlay.c \ + glut_shapes.c \ + glut_space.c \ + glut_stroke.c \ + glut_swap.c \ + glut_swidth.c \ + glut_tablet.c \ + glut_teapot.c \ + glut_util.c \ + glut_vidresize.c \ + glut_warp.c \ + glut_win.c \ + glut_winmisc.c \ + layerutil.c + +SRCSSEMIGENS = \ + glut_8x13.c \ + glut_9x15.c \ + glut_hel10.c \ + glut_hel12.c \ + glut_hel18.c \ + glut_mroman.c \ + glut_roman.c \ + glut_tr10.c \ + glut_tr24.c + +OBJS = $(SRCS:.c=.o) $(SRCSSEMIGENS:.c=.o) +OTHERGENS = y.tab.c y.tab.h strokegen.c strokegen.h strokelex.c +OTHERSRCS = strokegen.y strokelex.l stroke.h +FONTS = Roman.stroke MonoRoman.stroke + +# Uncomment the LCDEFS line below if you want to build a version of +# libglut.a that avoids using the SGI "fast atoms" optimization +# introduced in IRIX 6.3. This optimization eliminates serveral X server +# round-trips. If you are building libglut.a on an IRIX 6.3 or later +# machine and want a chance (no guarantees) that GLUT executables built +# against your libglut.a will work on IRIX 6.2 machines, uncomment out +# the LCDEFS line below. Otherwise, you'll get a run-time message about +# "attempted access to unresolvable symbol in XXX: _XSGIFastInternAtom" +#LCDEFS = -DNO_FAST_ATOMS + +LCOPTS = -I$(TOP)/include -fullwarn +LWOFF = ,813,852,827,826 +LDIRT = *~ $(OTHERGENS) strokegen *.bak hardcopy glutsrc.ps capturexfont *.pure dstr dstr.c *.gen + +default: $(TARGETS) + +sinclude ObjectType.mk + +$(OBJS) : $(HDRS) + +libglut.a : $(OBJS) + $(RM) $@ + $(AR) crl $@ $(OBJS) + +.ORDER : strokegen.h strokegen.c + +strokegen.h strokegen.c : strokegen.y + $(YACC) -d strokegen.y + $(MV) y.tab.c strokegen.c + $(MV) y.tab.h strokegen.h + +# avoid warnings when compiling lex generated code +strokegen.o : strokegen.c + $(CC) $(CFLAGS) -woff 726,825,635,818,819,820,824,831,835,822,821,1167,1498,1116,1136,1174,1196,803 -c -MDupdate Makedepend strokegen.c + +strokelex.c : strokelex.l + $(LEX) strokelex.l + $(MV) lex.yy.c strokelex.c + +# avoid warnings when compiling lex generated code +strokelex.o : strokelex.c + $(CC) $(CFLAGS) -woff 831,825,817,835,702,819,635,824,822,1167,1498,1110,1196,1174,803 -c -MDupdate Makedepend strokelex.c + +strokegen : strokegen.o strokelex.o + $(CC) -o $@ $(LDFLAGS) strokegen.o strokelex.o -ll + +capturexfont : capturexfont.o + $(CC) -o $@ $(LDFLAGS) capturexfont.o -lX11 + +# glut_roman.c and glut_mroman.c are now checked in, but here are rules to generate them +glut_roman.c.gen : Roman.stroke strokegen + ./strokegen -s glutStrokeRoman < Roman.stroke > $@ +glut_mroman.c.gen : MonoRoman.stroke strokegen + ./strokegen -s glutStrokeMonoRoman < MonoRoman.stroke > $@ + +glutsrc.ps : $(SRCS) + $(RM) hardcopy + mkdir -p hardcopy + for i in $(SRCS) ;\ + do \ + grep -v CENTRY $$i | grep -v INDENT- > hardcopy/$$i; \ + done + cd hardcopy ; enscript -p ../$@ -G -2r `echo $(SRCS) | fmt -1 | sort` + $(RM) hardcopy + +# The bitmap files can be generated using capturexfont, but because +# they require a connection to an X server and potentially different +# X servers have different fonts, these generated files are part +# of the GLUT distribution. + +9_BY_15 = -misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1 +8_BY_13 = -misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1 +TR10 = -adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1 +TR24 = -adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1 +HEL10 = -adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1 +HEL12 = -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1 +HEL18 = -adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1 + +semigens : capturexfont + ./capturexfont $(9_BY_15) glutBitmap9By15 > glut_9x15.c.gen + ./capturexfont $(8_BY_13) glutBitmap8By13 > glut_8x13.c.gen + ./capturexfont $(TR10) glutBitmapTimesRoman10 > glut_tr10.c.gen + ./capturexfont $(TR24) glutBitmapTimesRoman24 > glut_tr24.c.gen + ./capturexfont $(HEL10) glutBitmapHelvetica10 > glut_hel10.c.gen + ./capturexfont $(HEL12) glutBitmapHelvetica12 > glut_hel12.c.gen + ./capturexfont $(HEL18) glutBitmapHelvetica18 > glut_hel18.c.gen + +# unused test rule for test building 16-bit font +JIS = -jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-0 +glut_jis.c : + ./capturexfont $(JIS) glutBitmapJis > $@ + +sources: $(SRCS) + +symcheck: libglut.a + -nm -Bo libglut.a | grep -v ' d ' | grep -v ' T glut' | grep -v ' D glut' | grep -v ' U ' | grep -v ' T __glut' | grep -v ' t ' | grep -v ' b ' | grep -v ' D __glut' | grep -v ' B __glut' + +dstr.c: glut_dstr.c + ln -s glut_dstr.c $@ + +dstr: dstr.c glut_util.o glut_glxext.o + $(RM) $@ + $(CC) -g -o $@ $(CFLAGS) -DTEST dstr.c glut_util.o glut_glxext.o -lGLU -lGL -lXext -lX11 -lm + +./glut.h : glut.h +./glutint.h : glutint.h +./glutstroke.h : glutstroke.h +./strokegen.h : strokegen.h +./stroke.h : stroke.h +./layerutil.h : layerutil.h +strokelex.o: strokelex.c strokegen.h + +include $(COMMONRULES) diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/Makefile.win xpsb-glx-0.19/mesa/src/glut/glx/Makefile.win --- xpsb-glx-0.19/mesa/src/glut/glx/Makefile.win 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/Makefile.win 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,99 @@ +# Makefile for Win32 + +!include + +TOP = .. + +# NOTE: glut_menu.c and glut_glxext.c are NOT compiled into Win32 GLUT + +SRCS = glut_8x13.c glut_9x15.c glut_bitmap.c glut_bwidth.c glut_cindex.c glut_cmap.c glut_cursor.c glut_dials.c glut_dstr.c glut_event.c glut_ext.c glut_fbc.c glut_fullscrn.c glut_gamemode.c glut_get.c glut_hel10.c glut_hel12.c glut_hel18.c glut_init.c glut_input.c glut_joy.c glut_key.c glut_keyctrl.c glut_keyup.c glut_mesa.c glut_modifier.c glut_mroman.c glut_overlay.c glut_roman.c glut_shapes.c glut_space.c glut_stroke.c glut_swap.c glut_swidth.c glut_tablet.c glut_teapot.c glut_tr10.c glut_tr24.c glut_util.c glut_vidresize.c glut_warp.c glut_win.c glut_winmisc.c win32_glx.c win32_menu.c win32_util.c win32_winproc.c win32_x11.c + +all : glutdll + +!include "$(TOP)/mesawin32.mak" + +glutdll : $(GLUTDLL) + +!IFDEF NODEBUG +OPTIMIZE_CFLAGS = -DNDEBUG +!ENDIF + +CFLAGS = $(cvarsdll) $(CFLAGS) $(OPTIMIZE_CFLAGS) -DMESA -DBUILD_GL32 +LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS) + +OBJS = $(SRCS:.c=.obj) +MS_LIBS = ../lib/$(MESALIB) ../lib/$(GLULIB) winmm.lib $(guilibsdll) +SGI_LIBS = $(SGI_OPENGL) $(SGI_GLU) winmm.lib $(guilibsdll) + +MesaGlut.dll : $(OBJS) glut.def + $(link) $(LFLAGS) -out:MesaGlut.dll -def:glut.def $(OBJS) $(MS_LIBS) + @echo "copying GLUT dynamic link library to lib directory..." + -copy $(GLUTDLL) ..\lib + @echo "copying GLUT import library to lib directory..." + -copy $(GLUTLIB) ..\lib + +glut.dll : $(OBJS) glut.def + $(link) $(LFLAGS) -out:glut.dll -def:glut.def $(OBJS) $(SGI_LIBS) + +install : $(GLUTDLL) + @echo "copying GLUT dynamic link library to system directory..." + -copy $(GLUTDLL) $(DLLINSTALL) + @echo "copying GLUT header file to include directory..." + -copy ..\include\GL\glut.h $(INCLUDEINSTALL) + @echo "copying GLUT import library to library directory..." + -copy $(GLUTLIB) $(LIBINSTALL) + +.c.obj : + $(cc) $(CFLAGS) -I . $*.c + +# explicit object dependencies for all source files + +win32_glx.obj: win32_glx.c win32_glx.h +win32_x11.obj: win32_x11.c win32_x11.h +win32_menu.obj: win32_menu.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h +win32_util.obj: win32_util.c glutint.h ..\include\GL\glutf90.h +win32_winproc.obj: win32_winproc.c glutint.h ..\include\GL\glutf90.h + +glut_mroman.obj: glut_mroman.c glutstroke.h glutint.h ..\include\GL\glutf90.h +glut_roman.obj: glut_roman.c glutstroke.h glutint.h ..\include\GL\glutf90.h +glut_hel12.obj: glut_hel12.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_8x13.obj: glut_8x13.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_hel18.obj: glut_hel18.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_9x15.obj: glut_9x15.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_tr10.obj: glut_tr10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_hel10.obj: glut_hel10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_tr24.obj: glut_tr24.c glutbitmap.h glutint.h ..\include\GL\glutf90.h + +glut_bitmap.obj: glut_bitmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_bwidth.obj: glut_bwidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cindex.obj: glut_cindex.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cmap.obj: glut_cmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cursor.obj: glut_cursor.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_dials.obj: glut_dials.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_dstr.obj: glut_dstr.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_event.obj: glut_event.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_ext.obj: glut_ext.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_fullscrn.obj: glut_fullscrn.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_gamemode.obj: glut_gamemode.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_get.obj: glut_get.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_init.obj: glut_init.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_input.obj: glut_input.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_joy.obj: glut_joy.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_key.obj: glut_key.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_keyctrl.obj: glut_keyctrl.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_keyup.obj: glut_keyup.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_mesa.obj: glut_mesa.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_modifier.obj: glut_modifier.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_overlay.obj: glut_overlay.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_shapes.obj: glut_shapes.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_space.obj: glut_space.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_swap.obj: glut_swap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_swidth.obj: glut_swidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_tablet.obj: glut_tablet.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_teapot.obj: glut_teapot.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_util.obj: glut_util.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_vidresize.obj: glut_vidresize.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_warp.obj: glut_warp.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_win.obj: glut_win.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h +glut_winmisc.obj: glut_winmisc.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/mms_depend xpsb-glx-0.19/mesa/src/glut/glx/mms_depend --- xpsb-glx-0.19/mesa/src/glut/glx/mms_depend 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/mms_depend 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,72 @@ +# DO NOT DELETE + +glut_8x13.obj : glutbitmap.h [---.include.gl]gl.h +glut_9x15.obj : glutbitmap.h [---.include.gl]gl.h +glut_bitmap.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_bitmap.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_bitmap.obj : glutbitmap.h +glut_bwidth.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_bwidth.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_bwidth.obj : glutbitmap.h +glut_cindex.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_cindex.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_cindex.obj : layerutil.h +glut_cursor.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_cursor.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_dials.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_dials.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h +glut_dstr.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_dstr.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h +glut_event.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_event.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_ext.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_ext.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_fullscrn.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_fullscrn.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h +glut_fullscrn.obj : [---.include.gl]glu.h +glut_get.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_get.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_hel10.obj : glutbitmap.h [---.include.gl]gl.h +glut_hel12.obj : glutbitmap.h [---.include.gl]gl.h +glut_hel18.obj : glutbitmap.h [---.include.gl]gl.h +glut_init.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_init.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_menu.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_menu.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h layerutil.h +glut_mesa.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_mesa.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h +glut_modifier.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_modifier.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h +glut_modifier.obj : [---.include.gl]glu.h +glut_mroman.obj : glutstroke.h +glut_overlay.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_overlay.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_overlay.obj : layerutil.h +glut_roman.obj : glutstroke.h +glut_shapes.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_shapes.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_space.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_space.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h +glut_stroke.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_stroke.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_stroke.obj : glutstroke.h +glut_swidth.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_swidth.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_swidth.obj : glutstroke.h +glut_tablet.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h +glut_tablet.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h +glut_teapot.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_tr10.obj : glutbitmap.h [---.include.gl]gl.h +glut_tr24.obj : glutbitmap.h [---.include.gl]gl.h +glut_util.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_util.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_vidresize.obj : [---.include.gl]glx.h [---.include.gl]gl.h +glut_vidresize.obj : [---.include.gl]xmesa.h glutint.h [---.include.gl]glut.h +glut_vidresize.obj : [---.include.gl]glu.h +glut_warp.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_warp.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_win.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_win.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +glut_winmisc.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h +glut_winmisc.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h +layerutil.obj : layerutil.h diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/stroke.h xpsb-glx-0.19/mesa/src/glut/glx/stroke.h --- xpsb-glx-0.19/mesa/src/glut/glx/stroke.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/stroke.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,133 @@ + +/***************************************************************** +Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Sun Microsystems, +the X Consortium, and MIT not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. + +SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT +SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef WFONT_INCLUDED +#define WFONT_INCLUDED + +#define WFONT_MAGIC 0x813 +#define WFONT_MAGIC_PLUS 0x715 +#define WFONT_MAGIC_PEX 0x70686e74 +#define START_PROPS 0x100 +#define START_DISPATCH(_num_props) (START_PROPS + 160 * _num_props) +#define START_PATH(_num_ch_, _num_props) (START_DISPATCH(_num_props) + sizeof(Dispatch) * _num_ch_) +#define NUM_DISPATCH 128 + +typedef struct { + unsigned short x; + unsigned short y; +} Path_point2dpx; + +typedef struct { + float x; + float y; +} Path_point2df; + +typedef struct { + int x; + int y; + int z; +} Path_point3di; + +typedef struct { + float x; + float y; + float z; +} Path_point3df; + +typedef struct { + float x; + float y; + float z; + float w; +} Path_point4df; + +typedef union { + Path_point2dpx *pt2dpx; + Path_point2df *pt2df; + Path_point3di *pt3di; + Path_point3df *pt3df; + Path_point4df *pt4df; +} Path_pt_ptr; + +typedef enum { + PATH_2DF, + PATH_2DPX, + PATH_3DF, + PATH_3DI, + PATH_4DF +} Path_type; + +typedef struct { + int n_pts; /* number of points in the subpath */ + Path_pt_ptr pts; /* pointer to them */ + int closed; /* true if the subpath is closed */ + int dcmp_flag; /* flag for pgon dcmp, pgon type + * and dcmped triangle type */ +} Path_subpath; + +typedef struct { + Path_type type; /* type of vertices in this path */ + int n_subpaths; /* number of subpaths */ + int n_vertices; /* total number of vertices */ + Path_subpath *subpaths; /* array of subpaths */ +} Path; + +typedef Path *Path_handle; + +typedef struct { + char propname[80]; /* font property name */ + char propvalue[80]; /* font property value */ +} Property; + +typedef struct { + int magic; /* magic number */ + char name[80]; /* name of this font */ + float top, /* extreme values */ + bottom, max_width; + int num_ch; /* no. of fonts in the set */ + int num_props; /* no. of font properties */ + Property *properties; /* array of properties */ +} Font_header; + +typedef struct { + float center, /* center of the character */ + right; /* right edge */ + long offset; /* offset in the file of the character + * * description */ +} Dispatch; + +typedef struct { + float center, right; + Path strokes; +} Ch_font; + +typedef struct { + char name[80]; + float top, bottom, max_width; + int num_ch; /* # characters in the font */ + Ch_font **ch_data; +} Phg_font; + +#endif /*WFONT_INCLUDED */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.c xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.c --- xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,256 @@ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include "glutint.h" +#include "win32_glx.h" + +/* global current HDC */ +extern HDC XHDC; + +GLXContext +glXCreateContext(Display * display, XVisualInfo * visinfo, + GLXContext share, Bool direct) +{ + /* KLUDGE: GLX really expects a display pointer to be passed + in as the first parameter, but Win32 needs an HDC instead, + so BE SURE that the global XHDC is set before calling this + routine. */ + HGLRC context; + + context = CreateContext(XHDC); + +#if 0 + /* XXX GLUT doesn't support it now, so don't worry about display list + and texture object sharing. */ + if (share) { + wglShareLists(share, context); + } +#endif + + /* Since direct rendering is implicit, the direct flag is + ignored. */ + + return context; +} + +int +glXGetConfig(Display * display, XVisualInfo * visual, int attrib, int *value) +{ + if (!visual) + return GLX_BAD_VISUAL; + + switch (attrib) { + case GLX_USE_GL: + if (visual->dwFlags & (PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW)) { + /* XXX Brad's Matrix Millenium II has problems creating + color index windows in 24-bit mode (lead to GDI crash) + and 32-bit mode (lead to black window). The cColorBits + filed of the PIXELFORMATDESCRIPTOR returned claims to + have 24 and 32 bits respectively of color indices. 2^24 + and 2^32 are ridiculously huge writable colormaps. + Assume that if we get back a color index + PIXELFORMATDESCRIPTOR with 24 or more bits, the + PIXELFORMATDESCRIPTOR doesn't really work and skip it. + -mjk */ + if (visual->iPixelType == PFD_TYPE_COLORINDEX + && visual->cColorBits >= 24) { + *value = 0; + } else { + *value = 1; + } + } else { + *value = 0; + } + break; + case GLX_BUFFER_SIZE: + /* KLUDGE: if we're RGBA, return the number of bits/pixel, + otherwise, return 8 (we guessed at 256 colors in CI + mode). */ + if (visual->iPixelType == PFD_TYPE_RGBA) + *value = visual->cColorBits; + else + *value = 8; + break; + case GLX_LEVEL: + /* The bReserved flag of the pfd contains the + overlay/underlay info. */ + *value = visual->bReserved; + break; + case GLX_RGBA: + *value = visual->iPixelType == PFD_TYPE_RGBA; + break; + case GLX_DOUBLEBUFFER: + *value = visual->dwFlags & PFD_DOUBLEBUFFER; + break; + case GLX_STEREO: + *value = visual->dwFlags & PFD_STEREO; + break; + case GLX_AUX_BUFFERS: + *value = visual->cAuxBuffers; + break; + case GLX_RED_SIZE: + *value = visual->cRedBits; + break; + case GLX_GREEN_SIZE: + *value = visual->cGreenBits; + break; + case GLX_BLUE_SIZE: + *value = visual->cBlueBits; + break; + case GLX_ALPHA_SIZE: + *value = visual->cAlphaBits; + break; + case GLX_DEPTH_SIZE: + *value = visual->cDepthBits; + break; + case GLX_STENCIL_SIZE: + *value = visual->cStencilBits; + break; + case GLX_ACCUM_RED_SIZE: + *value = visual->cAccumRedBits; + break; + case GLX_ACCUM_GREEN_SIZE: + *value = visual->cAccumGreenBits; + break; + case GLX_ACCUM_BLUE_SIZE: + *value = visual->cAccumBlueBits; + break; + case GLX_ACCUM_ALPHA_SIZE: + *value = visual->cAccumAlphaBits; + break; + default: + return GLX_BAD_ATTRIB; + } + return 0; +} + +XVisualInfo * +glXChooseVisual(Display * display, int screen, int *attribList) +{ + /* KLUDGE: since we need the HDC, MAKE SURE to set XHDC + before calling this routine. */ + + int *p = attribList; + int pf; + PIXELFORMATDESCRIPTOR pfd; + PIXELFORMATDESCRIPTOR *match = NULL; + int stereo = 0; + + /* Avoid seg-faults. */ + if (!p) + return NULL; + + memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); + pfd.nSize = (sizeof(PIXELFORMATDESCRIPTOR)); + pfd.nVersion = 1; + + /* Defaults. */ + pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW; + pfd.iPixelType = PFD_TYPE_COLORINDEX; + pfd.cColorBits = 32; + pfd.cDepthBits = 0; + + while (*p) { + switch (*p) { + case GLX_USE_GL: + pfd.dwFlags |= PFD_SUPPORT_OPENGL; + break; + case GLX_BUFFER_SIZE: + pfd.cColorBits = *(++p); + break; + case GLX_LEVEL: + /* the bReserved flag of the pfd contains the + overlay/underlay info. */ + pfd.bReserved = *(++p); + break; + case GLX_RGBA: + pfd.iPixelType = PFD_TYPE_RGBA; + break; + case GLX_DOUBLEBUFFER: + pfd.dwFlags |= PFD_DOUBLEBUFFER; + break; + case GLX_STEREO: + stereo = 1; + pfd.dwFlags |= PFD_STEREO; + break; + case GLX_AUX_BUFFERS: + pfd.cAuxBuffers = *(++p); + break; + case GLX_RED_SIZE: + pfd.cRedBits = 8; /* Try to get the maximum. */ + ++p; + break; + case GLX_GREEN_SIZE: + pfd.cGreenBits = 8; + ++p; + break; + case GLX_BLUE_SIZE: + pfd.cBlueBits = 8; + ++p; + break; + case GLX_ALPHA_SIZE: + pfd.cAlphaBits = 8; + ++p; + break; + case GLX_DEPTH_SIZE: + pfd.cDepthBits = 32; + ++p; + break; + case GLX_STENCIL_SIZE: + pfd.cStencilBits = *(++p); + break; + case GLX_ACCUM_RED_SIZE: + case GLX_ACCUM_GREEN_SIZE: + case GLX_ACCUM_BLUE_SIZE: + case GLX_ACCUM_ALPHA_SIZE: + /* I believe that WGL only used the cAccumRedBits, + cAccumBlueBits, cAccumGreenBits, and cAccumAlphaBits fields + when returning info about the accumulation buffer precision. + Only cAccumBits is used for requesting an accumulation + buffer. */ + pfd.cAccumBits = 1; + ++p; + break; + } + ++p; + } + + /* Let Win32 choose one for us. */ + pf = ChoosePixelFormat(XHDC, &pfd); + if (pf > 0) { + match = (PIXELFORMATDESCRIPTOR *) malloc(sizeof(PIXELFORMATDESCRIPTOR)); + DescribePixelFormat(XHDC, pf, sizeof(PIXELFORMATDESCRIPTOR), match); + + /* ChoosePixelFormat is dumb in that it will return a pixel + format that doesn't have stereo even if it was requested + so we need to make sure that if stereo was selected, we + got it. */ + if (stereo) { + if (!(match->dwFlags & PFD_STEREO)) { + free(match); + return NULL; + } + } + /* XXX Brad's Matrix Millenium II has problems creating + color index windows in 24-bit mode (lead to GDI crash) + and 32-bit mode (lead to black window). The cColorBits + filed of the PIXELFORMATDESCRIPTOR returned claims to + have 24 and 32 bits respectively of color indices. 2^24 + and 2^32 are ridiculously huge writable colormaps. + Assume that if we get back a color index + PIXELFORMATDESCRIPTOR with 24 or more bits, the + PIXELFORMATDESCRIPTOR doesn't really work and skip it. + -mjk */ + if (match->iPixelType == PFD_TYPE_COLORINDEX + && match->cColorBits >= 24) { + free(match); + return NULL; + } + } + return match; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.h xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.h --- xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_glx.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,58 @@ +#ifndef __win32_glx_h__ +#define __win32_glx_h__ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "win32_x11.h" + +/* Type definitions (conversions). */ +typedef HGLRC GLXContext; + +#define GLX_USE_GL 1 /* support GLX rendering */ +#define GLX_BUFFER_SIZE 2 /* depth of the color buffer */ +#define GLX_LEVEL 3 /* level in plane stacking */ +#define GLX_RGBA 4 /* true if RGBA mode */ +#define GLX_DOUBLEBUFFER 5 /* double buffering supported */ +#define GLX_STEREO 6 /* stereo buffering supported */ +#define GLX_AUX_BUFFERS 7 /* number of aux buffers */ +#define GLX_RED_SIZE 8 /* number of red component bits */ +#define GLX_GREEN_SIZE 9 /* number of green component bits */ +#define GLX_BLUE_SIZE 10 /* number of blue component bits */ +#define GLX_ALPHA_SIZE 11 /* number of alpha component bits */ +#define GLX_DEPTH_SIZE 12 /* number of depth bits */ +#define GLX_STENCIL_SIZE 13 /* number of stencil bits */ +#define GLX_ACCUM_RED_SIZE 14 /* number of red accum bits */ +#define GLX_ACCUM_GREEN_SIZE 15 /* number of green accum bits */ +#define GLX_ACCUM_BLUE_SIZE 16 /* number of blue accum bits */ +#define GLX_ACCUM_ALPHA_SIZE 17 /* number of alpha accum bits */ + +#define GLX_BAD_ATTRIB 2 +#define GLX_BAD_VISUAL 4 + +/* Functions emulated by macros. */ + +#define glXDestroyContext(display, context) \ + wglDeleteContext(context) + +/* Function prototypes. */ + +extern GLXContext glXCreateContext( + Display* display, + XVisualInfo* visinfo, + GLXContext share, + Bool direct); +extern int glXGetConfig( + Display* display, + XVisualInfo* visual, + int attrib, + int* value); +extern XVisualInfo* glXChooseVisual( + Display* display, + int screen, + int* attribList); + +#endif /* __win32_glx_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_menu.c xpsb-glx-0.19/mesa/src/glut/glx/win32_menu.c --- xpsb-glx-0.19/mesa/src/glut/glx/win32_menu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_menu.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,531 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* This file completely re-implements glut_menu.c and glut_menu2.c + for Win32. Note that neither glut_menu.c nor glut_menu2.c are + compiled into Win32 GLUT. */ + +#include +#include +#include +#include +#include + +#include "glutint.h" + +void (GLUTCALLBACK *__glutMenuStatusFunc) (int, int, int); +GLUTmenu *__glutMappedMenu; +GLUTwindow *__glutMenuWindow; +GLUTmenuItem *__glutItemSelected; +unsigned __glutMenuButton; + +static GLUTmenu **menuList = NULL; +static int menuListSize = 0; +static UINT uniqueMenuHandler = 1; + +/* DEPRICATED, use glutMenuStatusFunc instead. */ +void GLUTAPIENTRY +glutMenuStateFunc(GLUTmenuStateCB menuStateFunc) +{ + __glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc; +} + +void GLUTAPIENTRY +glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc) +{ + __glutMenuStatusFunc = menuStatusFunc; +} + +void +__glutSetMenu(GLUTmenu * menu) +{ + __glutCurrentMenu = menu; +} + +static void +unmapMenu(GLUTmenu * menu) +{ + if (menu->cascade) { + unmapMenu(menu->cascade); + menu->cascade = NULL; + } + menu->anchor = NULL; + menu->highlighted = NULL; +} + +void +__glutFinishMenu(Window win, int x, int y) +{ + + unmapMenu(__glutMappedMenu); + + /* XXX Put in a GdiFlush just in case. Probably unnecessary. -mjk */ + GdiFlush(); + + if (__glutMenuStatusFunc) { + __glutSetWindow(__glutMenuWindow); + __glutSetMenu(__glutMappedMenu); + + /* Setting __glutMappedMenu to NULL permits operations that + change menus or destroy the menu window again. */ + __glutMappedMenu = NULL; + + __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y); + } + /* Setting __glutMappedMenu to NULL permits operations that + change menus or destroy the menu window again. */ + __glutMappedMenu = NULL; + + /* If an item is selected and it is not a submenu trigger, + generate menu callback. */ + if (__glutItemSelected && !__glutItemSelected->isTrigger) { + __glutSetWindow(__glutMenuWindow); + /* When menu callback is triggered, current menu should be + set to the callback menu. */ + __glutSetMenu(__glutItemSelected->menu); + __glutItemSelected->menu->select(__glutItemSelected->value); + } + __glutMenuWindow = NULL; +} + +static void +mapMenu(GLUTmenu * menu, int x, int y) +{ + TrackPopupMenu((HMENU) menu->win, TPM_LEFTALIGN | + (__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON, + x, y, 0, __glutCurrentWindow->win, NULL); +} + +void +__glutStartMenu(GLUTmenu * menu, GLUTwindow * window, + int x, int y, int x_win, int y_win) +{ + assert(__glutMappedMenu == NULL); + __glutMappedMenu = menu; + __glutMenuWindow = window; + __glutItemSelected = NULL; + if (__glutMenuStatusFunc) { + __glutSetMenu(menu); + __glutSetWindow(window); + __glutMenuStatusFunc(GLUT_MENU_IN_USE, x_win, y_win); + } + mapMenu(menu, x, y); +} + +GLUTmenuItem * +__glutGetUniqueMenuItem(GLUTmenu * menu, UINT unique) +{ + GLUTmenuItem *item; + int i; + + i = menu->num; + item = menu->list; + while (item) { + if (item->unique == unique) { + return item; + } + if (item->isTrigger) { + GLUTmenuItem *subitem; + subitem = __glutGetUniqueMenuItem(menuList[item->value], unique); + if (subitem) { + return subitem; + } + } + i--; + item = item->next; + } + return NULL; +} + +GLUTmenuItem * +__glutGetMenuItem(GLUTmenu * menu, Window win, int *which) +{ + GLUTmenuItem *item; + int i; + + i = menu->num; + item = menu->list; + while (item) { + if (item->win == win) { + *which = i; + return item; + } + if (item->isTrigger) { + GLUTmenuItem *subitem; + + subitem = __glutGetMenuItem(menuList[item->value], + win, which); + if (subitem) { + return subitem; + } + } + i--; + item = item->next; + } + return NULL; +} + +GLUTmenu * +__glutGetMenu(Window win) +{ + GLUTmenu *menu; + + menu = __glutMappedMenu; + while (menu) { + if (win == menu->win) { + return menu; + } + menu = menu->cascade; + } + return NULL; +} + +GLUTmenu * +__glutGetMenuByNum(int menunum) +{ + if (menunum < 1 || menunum > menuListSize) { + return NULL; + } + return menuList[menunum - 1]; +} + +static int +getUnusedMenuSlot(void) +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < menuListSize; i++) { + if (!menuList[i]) { + return i; + } + } + /* Allocate a new slot. */ + menuListSize++; + if (menuList) { + menuList = (GLUTmenu **) + realloc(menuList, menuListSize * sizeof(GLUTmenu *)); + } else { + /* XXX Some realloc's do not correctly perform a malloc + when asked to perform a realloc on a NULL pointer, + though the ANSI C library spec requires this. */ + menuList = (GLUTmenu **) malloc(sizeof(GLUTmenu *)); + } + if (!menuList) { + __glutFatalError("out of memory."); + } + menuList[menuListSize - 1] = NULL; + return menuListSize - 1; +} + +static void +menuModificationError(void) +{ + /* XXX Remove the warning after GLUT 3.0. */ + __glutWarning("The following is a new check for GLUT 3.0; update your code."); + __glutFatalError("menu manipulation not allowed while menus in use."); +} + +int GLUTAPIENTRY +glutCreateMenu(GLUTselectCB selectFunc) +{ + GLUTmenu *menu; + int menuid; + + if (__glutMappedMenu) { + menuModificationError(); + } + menuid = getUnusedMenuSlot(); + menu = (GLUTmenu *) malloc(sizeof(GLUTmenu)); + if (!menu) { + __glutFatalError("out of memory."); + } + menu->id = menuid; + menu->num = 0; + menu->submenus = 0; + menu->select = selectFunc; + menu->list = NULL; + menu->cascade = NULL; + menu->highlighted = NULL; + menu->anchor = NULL; + menu->win = (HWND) CreatePopupMenu(); + menuList[menuid] = menu; + __glutSetMenu(menu); + return menuid + 1; +} + +int GLUTAPIENTRY +__glutCreateMenuWithExit(GLUTselectCB selectFunc, void (__cdecl *exitfunc)(int)) +{ + __glutExitFunc = exitfunc; + return glutCreateMenu(selectFunc); +} + +void GLUTAPIENTRY +glutDestroyMenu(int menunum) +{ + GLUTmenu *menu = __glutGetMenuByNum(menunum); + GLUTmenuItem *item, *next; + + if (__glutMappedMenu) { + menuModificationError(); + } + assert(menu->id == menunum - 1); + DestroyMenu( (HMENU) menu->win); + menuList[menunum - 1] = NULL; + /* free all menu entries */ + item = menu->list; + while (item) { + assert(item->menu == menu); + next = item->next; + free(item->label); + free(item); + item = next; + } + if (__glutCurrentMenu == menu) { + __glutCurrentMenu = NULL; + } + free(menu); +} + +int GLUTAPIENTRY +glutGetMenu(void) +{ + if (__glutCurrentMenu) { + return __glutCurrentMenu->id + 1; + } else { + return 0; + } +} + +void GLUTAPIENTRY +glutSetMenu(int menuid) +{ + GLUTmenu *menu; + + if (menuid < 1 || menuid > menuListSize) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + menu = menuList[menuid - 1]; + if (!menu) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + __glutSetMenu(menu); +} + +static void +setMenuItem(GLUTmenuItem * item, const char *label, + int value, Bool isTrigger) +{ + GLUTmenu *menu; + + menu = item->menu; + item->label = __glutStrdup(label); + if (!item->label) { + __glutFatalError("out of memory."); + } + item->isTrigger = isTrigger; + item->len = (int) strlen(label); + item->value = value; + item->unique = uniqueMenuHandler++; + if (isTrigger) { + AppendMenu((HMENU) menu->win, MF_POPUP, (UINT)item->win, label); + } else { + AppendMenu((HMENU) menu->win, MF_STRING, item->unique, label); + } +} + +void GLUTAPIENTRY +glutAddMenuEntry(const char *label, int value) +{ + GLUTmenuItem *entry; + + if (__glutMappedMenu) { + menuModificationError(); + } + entry = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); + if (!entry) { + __glutFatalError("out of memory."); + } + entry->menu = __glutCurrentMenu; + setMenuItem(entry, label, value, FALSE); + __glutCurrentMenu->num++; + entry->next = __glutCurrentMenu->list; + __glutCurrentMenu->list = entry; +} + +void GLUTAPIENTRY +glutAddSubMenu(const char *label, int menu) +{ + GLUTmenuItem *submenu; + GLUTmenu *popupmenu; + + if (__glutMappedMenu) { + menuModificationError(); + } + submenu = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); + if (!submenu) { + __glutFatalError("out of memory."); + } + __glutCurrentMenu->submenus++; + submenu->menu = __glutCurrentMenu; + popupmenu = __glutGetMenuByNum(menu); + if (popupmenu) { + submenu->win = popupmenu->win; + } + setMenuItem(submenu, label, /* base 0 */ menu - 1, TRUE); + __glutCurrentMenu->num++; + submenu->next = __glutCurrentMenu->list; + __glutCurrentMenu->list = submenu; +} + +void GLUTAPIENTRY +glutChangeToMenuEntry(int num, const char *label, int value) +{ + GLUTmenuItem *item; + int i; + + if (__glutMappedMenu) { + menuModificationError(); + } + i = __glutCurrentMenu->num; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + if (item->isTrigger) { + /* If changing a submenu trigger to a menu entry, we + need to account for submenus. */ + item->menu->submenus--; + /* Nuke the Win32 menu. */ + DestroyMenu((HMENU) item->win); + } + free(item->label); + + item->label = strdup(label); + if (!item->label) + __glutFatalError("out of memory"); + item->isTrigger = FALSE; + item->len = (int) strlen(label); + item->value = value; + item->unique = uniqueMenuHandler++; + ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, + MF_BYPOSITION | MFT_STRING, item->unique, label); + + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutChangeToSubMenu(int num, const char *label, int menu) +{ + GLUTmenu *popupmenu; + GLUTmenuItem *item; + int i; + + if (__glutMappedMenu) { + menuModificationError(); + } + i = __glutCurrentMenu->num; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + if (!item->isTrigger) { + /* If changing a menu entry to as submenu trigger, we + need to account for submenus. */ + item->menu->submenus++; + item->win = (HWND) CreatePopupMenu(); + } + free(item->label); + + item->label = strdup(label); + if (!item->label) + __glutFatalError("out of memory"); + item->isTrigger = TRUE; + item->len = (int) strlen(label); + item->value = menu - 1; + item->unique = uniqueMenuHandler++; + popupmenu = __glutGetMenuByNum(menu); + if (popupmenu) + item->win = popupmenu->win; + ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, + MF_BYPOSITION | MF_POPUP, (UINT) item->win, label); + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutRemoveMenuItem(int num) +{ + GLUTmenuItem *item, **prev; + int i; + + if (__glutMappedMenu) { + menuModificationError(); + } + i = __glutCurrentMenu->num; + prev = &__glutCurrentMenu->list; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + /* Found the menu item in list to remove. */ + __glutCurrentMenu->num--; + + /* Patch up menu's item list. */ + *prev = item->next; + + RemoveMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, MF_BYPOSITION); + + free(item->label); + free(item); + return; + } + i--; + prev = &item->next; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutAttachMenu(int button) +{ + if (__glutCurrentWindow == __glutGameModeWindow) { + __glutWarning("cannot attach menus in game mode."); + return; + } + if (__glutMappedMenu) { + menuModificationError(); + } + if (__glutCurrentWindow->menu[button] < 1) { + __glutCurrentWindow->buttonUses++; + } + __glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1; +} + +void GLUTAPIENTRY +glutDetachMenu(int button) +{ + if (__glutMappedMenu) { + menuModificationError(); + } + if (__glutCurrentWindow->menu[button] > 0) { + __glutCurrentWindow->buttonUses--; + __glutCurrentWindow->menu[button] = 0; + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_util.c xpsb-glx-0.19/mesa/src/glut/glx/win32_util.c --- xpsb-glx-0.19/mesa/src/glut/glx/win32_util.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_util.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,121 @@ + +/* Copyright (c) Nate Robins, 1997. */ + +/* portions Copyright (c) Mark Kilgard, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + + +#include "glutint.h" +#include "glutstroke.h" +#include "glutbitmap.h" +#include + +/* The following added by Paul Garceau */ +#if defined(__MINGW32__) +#include +#include +#include +struct timeval; +#endif + +extern StrokeFontRec glutStrokeRoman, glutStrokeMonoRoman; +extern BitmapFontRec glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18; + +#ifndef __CYGWIN32__ +int +gettimeofday(struct timeval* tp, void* tzp) +{ + struct timeb tb; + + ftime(&tb); + tp->tv_sec = tb.time; + tp->tv_usec = tb.millitm * 1000; + + /* 0 indicates that the call succeeded. */ + return 0; +} +#endif + +/* To get around the fact that Microsoft DLLs only allow functions + to be exported and now data addresses (as Unix DSOs support), the + GLUT API constants such as GLUT_STROKE_ROMAN have to get passed + through a case statement to get mapped to the actual data structure + address. */ +void* +__glutFont(void *font) +{ + switch((int)font) { + case (int)GLUT_STROKE_ROMAN: + return &glutStrokeRoman; + case (int)GLUT_STROKE_MONO_ROMAN: + return &glutStrokeMonoRoman; + case (int)GLUT_BITMAP_9_BY_15: + return &glutBitmap9By15; + case (int)GLUT_BITMAP_8_BY_13: + return &glutBitmap8By13; + case (int)GLUT_BITMAP_TIMES_ROMAN_10: + return &glutBitmapTimesRoman10; + case (int)GLUT_BITMAP_TIMES_ROMAN_24: + return &glutBitmapTimesRoman24; + case (int)GLUT_BITMAP_HELVETICA_10: + return &glutBitmapHelvetica10; + case (int)GLUT_BITMAP_HELVETICA_12: + return &glutBitmapHelvetica12; + case (int)GLUT_BITMAP_HELVETICA_18: + return &glutBitmapHelvetica18; + } + __glutFatalError("font not found."); + /* NOTREACHED */ + return NULL; /* MSVC compiler complains if there is no return at all */ +} + +int +__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo) +{ + /* the transparent pixel on Win32 is always index number 0. So if + we put this routine in this file, we can avoid compiling the + whole of layerutil.c which is where this routine normally comes + from. */ + return 0; +} + +void +__glutAdjustCoords(Window parent, int* x, int* y, int* width, int* height) +{ + RECT rect; + + /* adjust the window rectangle because Win32 thinks that the x, y, + width & height are the WHOLE window (including decorations), + whereas GLUT treats the x, y, width & height as only the CLIENT + area of the window. */ + rect.left = *x; rect.top = *y; + rect.right = *x + *width; rect.bottom = *y + *height; + + /* must adjust the coordinates according to the correct style + because depending on the style, there may or may not be + borders. */ + AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | + (parent ? WS_CHILD : WS_OVERLAPPEDWINDOW), + FALSE); + /* FALSE in the third parameter = window has no menu bar */ + + /* readjust if the x and y are offscreen */ + if(rect.left < 0) { + *x = 0; + } else { + *x = rect.left; + } + + if(rect.top < 0) { + *y = 0; + } else { + *y = rect.top; + } + + *width = rect.right - rect.left; /* adjusted width */ + *height = rect.bottom - rect.top; /* adjusted height */ +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_winproc.c xpsb-glx-0.19/mesa/src/glut/glx/win32_winproc.c --- xpsb-glx-0.19/mesa/src/glut/glx/win32_winproc.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_winproc.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,787 @@ + +/* Copyright (c) Nate Robins, 1997. */ +/* portions Copyright (c) Mark Kilgard, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + + +#include "glutint.h" +#include +#ifdef __MINGW32__ +#include +#endif + +#if defined(_WIN32) && !defined(__CYGWIN32__) +#include /* Win32 Multimedia API header. */ +#endif + +extern unsigned __glutMenuButton; +extern GLUTidleCB __glutIdleFunc; +extern GLUTtimer *__glutTimerList; +extern GLUTmenuItem *__glutGetUniqueMenuItem(GLUTmenu * menu, int unique); +static HMENU __glutHMenu; + +void +updateWindowState(GLUTwindow *window, int visState) +{ + GLUTwindow* child; + + /* XXX shownState and visState are the same in Win32. */ + window->shownState = visState; + if (visState != window->visState) { + if (window->windowStatus) { + window->visState = visState; + __glutSetWindow(window); + window->windowStatus(visState); + } + } + /* Since Win32 only sends an activate for the toplevel window, + update the visibility for all the child windows. */ + child = window->children; + while (child) { + updateWindowState(child, visState); + child = child->siblings; + } +} + +LONG WINAPI +__glutWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + POINT point; /* Point structure. */ + PAINTSTRUCT ps; /* Paint structure. */ + LPMINMAXINFO minmax; /* Minimum/maximum info structure. */ + GLUTwindow* window; /* GLUT window associated with message. */ + GLUTmenu* menu; /* GLUT menu associated with message. */ + int x, y, width, height, key; + int button = -1; + + switch(msg) { + case WM_CREATE: + return 0; + case WM_CLOSE: + if (__glutExitFunc) { + __glutExitFunc(0); + } + exit(0); + break; +#if 0 + case WM_DESTROY: + /* XXX NVidia's NT OpenGL can have problems closing down + its OpenGL internal data structures if we just allow + the process to terminate without unbinding and deleting + the windows context. Apparently, DirectDraw unloads + before OPENGL32.DLL in the close down sequence, but + NVidia's NT OpenGL needs DirectDraw to close down its + data structures. */ + window = __glutGetWindow(hwnd); + if (window) { + if (window->ctx) { + wglMakeCurrent(NULL, NULL); + wglDeleteContext(window->ctx); + } + } + return 0; +#endif + case WM_PAINT: + window = __glutGetWindow(hwnd); + if (window) { + BeginPaint(hwnd, &ps); /* Must have this for some Win32 reason. */ + EndPaint(hwnd, &ps); + if (window->win == hwnd) { + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } else if (window->overlay && window->overlay->win == hwnd) { + __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK); + } + } + return 0; + + case WM_SYSKEYUP: + case WM_KEYUP: + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + /* Win32 is dumb and sends these messages only to the parent + window. Therefore, find out if we're in a child window and + call the child windows keyboard callback if we are. */ + if (window->parent) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + hwnd = ChildWindowFromPoint(hwnd, point); + window = __glutGetWindow(hwnd); + } + if (window->specialUp || window->keyboardUp) { + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + switch (wParam) { + /* *INDENT-OFF* */ + case VK_F1: key = GLUT_KEY_F1; break; + case VK_F2: key = GLUT_KEY_F2; break; + case VK_F3: key = GLUT_KEY_F3; break; + case VK_F4: key = GLUT_KEY_F4; break; + case VK_F5: key = GLUT_KEY_F5; break; + case VK_F6: key = GLUT_KEY_F6; break; + case VK_F7: key = GLUT_KEY_F7; break; + case VK_F8: key = GLUT_KEY_F8; break; + case VK_F9: key = GLUT_KEY_F9; break; + case VK_F10: key = GLUT_KEY_F10; break; + case VK_F11: key = GLUT_KEY_F11; break; + case VK_F12: key = GLUT_KEY_F12; break; + case VK_LEFT: key = GLUT_KEY_LEFT; break; + case VK_UP: key = GLUT_KEY_UP; break; + case VK_RIGHT: key = GLUT_KEY_RIGHT; break; + case VK_DOWN: key = GLUT_KEY_DOWN; break; + case VK_PRIOR: key = GLUT_KEY_PAGE_UP; break; + case VK_NEXT: key = GLUT_KEY_PAGE_DOWN; break; + case VK_HOME: key = GLUT_KEY_HOME; break; + case VK_END: key = GLUT_KEY_END; break; + case VK_INSERT: key = GLUT_KEY_INSERT; break; + case VK_DELETE: + /* Delete is an ASCII character. */ + if (window->keyboardUp) { + window->keyboardUp((unsigned char) 127, point.x, point.y); + } + return 0; + /* *INDENT-ON* */ + default: + if (window->keyboardUp) { + key = MapVirtualKey(wParam, 2); /* Map to ASCII. */ + if (isascii(key) && (key != 0)) { + + /* XXX Attempt to determine modified ASCII character + is quite incomplete. Digits, symbols, CapsLock, + Ctrl, and numeric keypad are all ignored. Fix this. */ + + if (!(__glutModifierMask & ShiftMask)) + key = tolower(key); + window->keyboardUp((unsigned char) key, point.x, point.y); + } + } + __glutModifierMask = (unsigned int) ~0; + return 0; + } + if (window->specialUp) { + window->specialUp(key, point.x, point.y); + } + __glutModifierMask = (unsigned int) ~0; + } + return 0; + + case WM_SYSCHAR: + case WM_CHAR: + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + + /* Bit 30 of lParam is set if key already held down. If + we are ignoring auto repeated key strokes for the window, bail. */ + if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) { + break; + } + + /* Win32 is dumb and sends these messages only to the parent + window. Therefore, find out if we're in a child window and + call the child windows keyboard callback if we are. */ + if (window->parent) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + hwnd = ChildWindowFromPoint(hwnd, point); + window = __glutGetWindow(hwnd); + } + if (window->keyboard) { + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->keyboard((unsigned char)wParam, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + } + return 0; + + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + + /* Bit 30 of lParam is set if key already held down. If + we are ignoring auto repeated key strokes for the window, bail. */ + if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) { + break; + } + + /* Win32 is dumb and sends these messages only to the parent + window. Therefore, find out if we're in a child window and + call the child windows keyboard callback if we are. */ + if (window->parent) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + hwnd = ChildWindowFromPoint(hwnd, point); + window = __glutGetWindow(hwnd); + } + if (window->special) { + switch (wParam) { + /* *INDENT-OFF* */ + /* function keys */ + case VK_F1: key = GLUT_KEY_F1; break; + case VK_F2: key = GLUT_KEY_F2; break; + case VK_F3: key = GLUT_KEY_F3; break; + case VK_F4: key = GLUT_KEY_F4; break; + case VK_F5: key = GLUT_KEY_F5; break; + case VK_F6: key = GLUT_KEY_F6; break; + case VK_F7: key = GLUT_KEY_F7; break; + case VK_F8: key = GLUT_KEY_F8; break; + case VK_F9: key = GLUT_KEY_F9; break; + case VK_F10: key = GLUT_KEY_F10; break; + case VK_F11: key = GLUT_KEY_F11; break; + case VK_F12: key = GLUT_KEY_F12; break; + /* directional keys */ + case VK_LEFT: key = GLUT_KEY_LEFT; break; + case VK_UP: key = GLUT_KEY_UP; break; + case VK_RIGHT: key = GLUT_KEY_RIGHT; break; + case VK_DOWN: key = GLUT_KEY_DOWN; break; + /* *INDENT-ON* */ + + case VK_PRIOR: + /* VK_PRIOR is Win32's Page Up */ + key = GLUT_KEY_PAGE_UP; + break; + case VK_NEXT: + /* VK_NEXT is Win32's Page Down */ + key = GLUT_KEY_PAGE_DOWN; + break; + case VK_HOME: + key = GLUT_KEY_HOME; + break; + case VK_END: + key = GLUT_KEY_END; + break; + case VK_INSERT: + key = GLUT_KEY_INSERT; + break; + case VK_DELETE: + goto handleDelete; + default: + goto defproc; + } + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->special(key, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + } else if (window->keyboard) { + /* Specially handle any keys that match ASCII values but + do not generate Windows WM_SYSCHAR or WM_CHAR messages. */ + switch (wParam) { + case VK_DELETE: + handleDelete: + /* Delete is an ASCII character. */ + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->keyboard((unsigned char) 127, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + return 0; + default: + /* Let the following WM_SYSCHAR or WM_CHAR message generate + the keyboard callback. */ + break; + } + } + return 0; + + case WM_LBUTTONDOWN: + button = GLUT_LEFT_BUTTON; + case WM_MBUTTONDOWN: + if (button < 0) + button = GLUT_MIDDLE_BUTTON; + case WM_RBUTTONDOWN: + if (button < 0) + button = GLUT_RIGHT_BUTTON; + + /* finish the menu if we get a button down message (user must have + cancelled the menu). */ + if (__glutMappedMenu) { + /* TODO: take this out once the menu on middle mouse stuff works + properly. */ + if (button == GLUT_MIDDLE_BUTTON) + return 0; + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); + return 0; + } + + /* set the capture so we can get mouse events outside the window */ + SetCapture(hwnd); + + /* Win32 doesn't return the same numbers as X does when the mouse + goes beyond the upper or left side of the window. roll the + Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */ + x = LOWORD(lParam); + y = HIWORD(lParam); + if(x & 1 << 15) x -= (1 << 16); + if(y & 1 << 15) y -= (1 << 16); + + window = __glutGetWindow(hwnd); + if (window) { + menu = __glutGetMenuByNum(window->menu[button]); + if (menu) { + point.x = LOWORD(lParam); point.y = HIWORD(lParam); + ClientToScreen(window->win, &point); + __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON : + button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON : + 0x0001; + __glutStartMenu(menu, window, point.x, point.y, x, y); + } else if (window->mouse) { + + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on. */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->mouse(button, GLUT_DOWN, x, y); + __glutModifierMask = (unsigned int)~0; + } else { + /* Stray mouse events. Ignore. */ + } + } + return 0; + + case WM_LBUTTONUP: + button = GLUT_LEFT_BUTTON; + case WM_MBUTTONUP: + if (button < 0) + button = GLUT_MIDDLE_BUTTON; + case WM_RBUTTONUP: + if (button < 0) + button = GLUT_RIGHT_BUTTON; + + /* Bail out if we're processing a menu. */ + if (__glutMappedMenu) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + /* if we're getting the middle button up signal, then something + on the menu was selected. */ + if (button == GLUT_MIDDLE_BUTTON) { + return 0; + /* For some reason, the code below always returns -1 even + though the point IS IN THE ITEM! Therefore, just bail out if + we get a middle mouse up. The user must select using the + left mouse button. Stupid Win32. */ +#if 0 + int item = MenuItemFromPoint(hwnd, __glutHMenu, point); + if (item != -1) + __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item); + else + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); +#endif + } else { + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); + } + return 0; + } + + /* Release the mouse capture. */ + ReleaseCapture(); + + window = __glutGetWindow(hwnd); + if (window && window->mouse) { + /* Win32 doesn't return the same numbers as X does when the + mouse goes beyond the upper or left side of the window. roll + the Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */ + x = LOWORD(lParam); + y = HIWORD(lParam); + if(x & 1 << 15) x -= (1 << 16); + if(y & 1 << 15) y -= (1 << 16); + + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->mouse(button, GLUT_UP, x, y); + __glutModifierMask = (unsigned int)~0; + } else { + /* Window might have been destroyed and all the + events for the window may not yet be received. */ + } + return 0; + + case WM_ENTERMENULOOP: + /* KLUDGE: create a timer that fires every 100 ms when we start a + menu so that we can still process the idle & timer events (that + way, the timers will fire during a menu pick and so will the + idle func. */ + SetTimer(hwnd, 1, 1, NULL); + return 0; + + case WM_TIMER: +#if 0 + /* If the timer id is 2, then this is the timer that is set up in + the main glut message processing loop, and we don't want to do + anything but acknowledge that we got it. It is used to prevent + CPU spiking when an idle function is installed. */ + if (wParam == 2) + return 0; +#endif + + /* only worry about the idle function and the timeouts, since + these are the only events we expect to process during + processing of a menu. */ + /* we no longer process the idle functions (as outlined in the + README), since drawing can't be done until the menu has + finished...it's pretty lame when the animation goes on, but + doesn't update, so you get this weird jerkiness. */ +#if 0 + if (__glutIdleFunc) + __glutIdleFunc(); +#endif + if (__glutTimerList) + handleTimeouts(); + return 0; + + case WM_EXITMENULOOP: + /* nuke the above created timer...we don't need it anymore, since + the menu is gone now. */ + KillTimer(hwnd, 1); + return 0; + + case WM_MENUSELECT: + if (lParam != 0) + __glutHMenu = (HMENU)lParam; + return 0; + + case WM_COMMAND: + if (__glutMappedMenu) { + if (GetSubMenu(__glutHMenu, LOWORD(wParam))) + __glutItemSelected = NULL; + else + __glutItemSelected = + __glutGetUniqueMenuItem(__glutMappedMenu, LOWORD(wParam)); + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + __glutFinishMenu(hwnd, point.x, point.y); + } + return 0; + + case WM_MOUSEMOVE: + if (!__glutMappedMenu) { + window = __glutGetWindow(hwnd); + if (window) { + /* If motion function registered _and_ buttons held * + down, call motion function... */ + x = LOWORD(lParam); + y = HIWORD(lParam); + + /* Win32 doesn't return the same numbers as X does when the + mouse goes beyond the upper or left side of the window. + roll the Win32's 0..2^16 pointer co-ord range to 0..+/-2^15. */ + if(x & 1 << 15) x -= (1 << 16); + if(y & 1 << 15) y -= (1 << 16); + + if (window->motion && wParam & + (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) { + __glutSetWindow(window); + window->motion(x, y); + } + /* If passive motion function registered _and_ + buttons not held down, call passive motion + function... */ + else if (window->passive && + ((wParam & + (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) == + 0)) { + __glutSetWindow(window); + window->passive(x, y); + } + } + } else { + /* Motion events are thrown away when a pop up menu is + active. */ + } + return 0; + + case WM_GETMINMAXINFO: + /* this voodoo is brought to you by Win32 (again). It allows the + window to be bigger than the screen, and smaller than 100x100 + (although it doesn't seem to help the y minimum). */ + minmax = (LPMINMAXINFO)lParam; + minmax->ptMaxSize.x = __glutScreenWidth; + minmax->ptMaxSize.y = __glutScreenHeight; + minmax->ptMinTrackSize.x = 0; + minmax->ptMinTrackSize.y = 0; + minmax->ptMaxTrackSize.x = __glutScreenWidth + + GetSystemMetrics(SM_CXSIZE) * 2; + minmax->ptMaxTrackSize.y = __glutScreenHeight + + GetSystemMetrics(SM_CXSIZE) * 2 + GetSystemMetrics(SM_CYCAPTION); + return 0; + + case WM_SIZE: + window = __glutGetWindow(hwnd); + if (window) { + width = LOWORD(lParam); + height = HIWORD(lParam); + if (width != window->width || height != window->height) { +#if 0 /* Win32 GLUT does not support overlays for now. */ + if (window->overlay) { + XResizeWindow(__glutDisplay, window->overlay->win, width, height); + } +#endif + window->width = width; + window->height = height; + __glutSetWindow(window); + /* Do not execute OpenGL out of sequence with respect + to the SetWindowPos request! */ + GdiFlush(); + window->reshape(width, height); + window->forceReshape = FALSE; + /* A reshape should be considered like posting a + repair request. */ + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } + } + return 0; + + case WM_SETCURSOR: + /* If the cursor is not in the client area, then we want to send + this message to the default window procedure ('cause its + probably in the border or title, and we don't handle that + cursor. otherwise, set our cursor. Win32 makes us set the + cursor every time the mouse moves (DUMB!). */ + if(LOWORD(lParam) != HTCLIENT) { + goto defproc; + } + window = __glutGetWindow(hwnd); + if (window) { + __glutSetCursor(window); + } + /* TODO: check out the info in DevStudio on WM_SETCURSOR in the + DefaultAction section. */ + return 1; + + case WM_SETFOCUS: + window = __glutGetWindow(hwnd); + if (window) { + window->entryState = WM_SETFOCUS; + if (window->entry) { + __glutSetWindow(window); + window->entry(GLUT_ENTERED); + /* XXX Generation of fake passive notify? See how much + work the X11 code does to support fake passive notify + callbacks. */ + } + if (window->joystick && __glutCurrentWindow) { + if (__glutCurrentWindow->joyPollInterval > 0) { + MMRESULT result; + + /* Because Win32 will only let one window capture the + joystick at a time, we must capture it when we get the + focus and release it when we lose the focus. */ + result = joySetCapture(__glutCurrentWindow->win, + JOYSTICKID1, 0, TRUE); + if (result != JOYERR_NOERROR) { + return 0; + } + (void) joySetThreshold(JOYSTICKID1, + __glutCurrentWindow->joyPollInterval); + } + } + } + return 0; + + case WM_KILLFOCUS: + window = __glutGetWindow(hwnd); + if (window) { + window->entryState = WM_KILLFOCUS; + if (window->entry) { + __glutSetWindow(window); + window->entry(GLUT_LEFT); + } + if (window->joystick && __glutCurrentWindow) { + if (__glutCurrentWindow->joyPollInterval > 0) { + /* Because Win32 will only let one window capture the + joystick at a time, we must capture it when we get the + focus and release it when we lose the focus. */ + (void) joyReleaseCapture(JOYSTICKID1); + } + } + } + return 0; + case WM_ACTIVATE: + window = __glutGetWindow(hwnd); + /* Make sure we re-select the correct palette if needed. */ + if (LOWORD(wParam)) { + PostMessage(hwnd, WM_PALETTECHANGED, 0, 0); + } + if (window) { + int visState; + + /* HIWORD(wParam) is the minimized flag. */ + visState = !HIWORD(wParam); + updateWindowState(window, visState); + } + return 0; + + /* Colour Palette Management */ + case WM_PALETTECHANGED: + if (hwnd == (HWND)wParam) { + /* Don't respond to the message that we sent! */ + break; + } + /* fall through to WM_QUERYNEWPALETTE */ + + case WM_QUERYNEWPALETTE: + window = __glutGetWindow(hwnd); + if (window && window->colormap) { + UnrealizeObject(window->colormap->cmap); + SelectPalette(window->hdc, window->colormap->cmap, FALSE); + RealizePalette(window->hdc); + return TRUE; + } + return FALSE; + + case MM_JOY1MOVE: + case MM_JOY1ZMOVE: + window = __glutGetWindow(hwnd); + if (window->joystick) { + JOYINFOEX jix; + int x, y, z; + + /* Because WIN32 only supports messages for X, Y, and Z + translations, we must poll for the rest */ + jix.dwSize = sizeof(jix); + jix.dwFlags = JOY_RETURNALL; + joyGetPosEx(JOYSTICKID1,&jix); + +#define SCALE(v) ((int) ((v - 32767)/32.768)) + + /* Convert to integer for scaling. */ + x = jix.dwXpos; + y = jix.dwYpos; + z = jix.dwZpos; + window->joystick(jix.dwButtons, SCALE(x), SCALE(y), SCALE(z)); + + return TRUE; + } + return FALSE; + case MM_JOY1BUTTONDOWN: + case MM_JOY1BUTTONUP: + window = __glutGetWindow(hwnd); + if (window->joystick) { + JOYINFOEX jix; + + /* Because WIN32 only supports messages for X, Y, and Z + translations, we must poll for the rest */ + jix.dwSize = sizeof(jix); + jix.dwFlags = JOY_RETURNALL; + joyGetPosEx(JOYSTICKID1,&jix); + + return TRUE; + } + return FALSE; + +#if 0 + /* Miscellaneous messages (don't really need to enumerate them, + but it's good to know what you're not getting sometimes). */ + case WM_DISPLAYCHANGE: + break; + case WM_NCHITTEST: + /* This event is generated by every mouse move event. */ + goto defproc; + case WM_NCMOUSEMOVE: + goto defproc; + case WM_NCACTIVATE: + goto defproc; + case WM_NCPAINT: + goto defproc; + case WM_NCCALCSIZE: + goto defproc; + case WM_NCCREATE: + goto defproc; + case WM_NCDESTROY: + goto defproc; + case WM_NCLBUTTONDOWN: + goto defproc; + case WM_SETTEXT: + goto defproc; + case WM_GETTEXT: + goto defproc; + case WM_ACTIVATEAPP: + goto defproc; + case WM_GETICON: + goto defproc; + case WM_ERASEBKGND: + goto defproc; + case WM_WINDOWPOSCHANGING: + goto defproc; + case WM_WINDOWPOSCHANGED: + goto defproc; + case WM_MOUSEACTIVATE: + goto defproc; + case WM_SHOWWINDOW: + goto defproc; + case WM_MOVING: + goto defproc; + case WM_MOVE: + goto defproc; + case WM_KEYUP: + goto defproc; + case WM_CAPTURECHANGED: + goto defproc; + case WM_SYSCOMMAND: + goto defproc; + case WM_ENTERSIZEMOVE: + goto defproc; + case WM_ENTERIDLE: + goto defproc; +#endif + + default: + goto defproc; + } + +defproc: + return DefWindowProc(hwnd, msg, wParam, lParam); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.c xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.c --- xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,399 @@ + +/* Copyright (c) Nate Robins, 1997. */ +/* portions Copyright (c) Mark Kilgard, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +/* global variable that must be set for some functions to operate + correctly. */ +HDC XHDC; + +XVisualInfo* +XGetVisualInfo(Display* display, long mask, XVisualInfo* template, int* nitems) +{ + /* KLUDGE: this function needs XHDC to be set to the HDC currently + being operated on before it is invoked! */ + + PIXELFORMATDESCRIPTOR* pfds; + int i, n; + + n = DescribePixelFormat(XHDC, 0, 0, NULL); + pfds = (PIXELFORMATDESCRIPTOR*)malloc(sizeof(PIXELFORMATDESCRIPTOR) * n); + memset(pfds, 0, sizeof(PIXELFORMATDESCRIPTOR) * n); + + for (i = 0; i < n; i++) { + DescribePixelFormat(XHDC, i + 1, sizeof(PIXELFORMATDESCRIPTOR), &pfds[i]); + } + + *nitems = n; + return pfds; +} + +Colormap +XCreateColormap(Display* display, Window root, Visual* visual, int alloc) +{ + /* KLUDGE: this function needs XHDC to be set to the HDC currently + being operated on before it is invoked! */ + + PIXELFORMATDESCRIPTOR pfd; + LOGPALETTE *logical; + HPALETTE palette; + int n; + + /* grab the pixel format */ + memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); + DescribePixelFormat(XHDC, GetPixelFormat(XHDC), + sizeof(PIXELFORMATDESCRIPTOR), &pfd); + + if (!(pfd.dwFlags & PFD_NEED_PALETTE || + pfd.iPixelType == PFD_TYPE_COLORINDEX)) + { + return 0; + } + + n = 1 << pfd.cColorBits; + + /* allocate a bunch of memory for the logical palette (assume 256 + colors in a Win32 palette */ + logical = (LOGPALETTE*)malloc(sizeof(LOGPALETTE) + + sizeof(PALETTEENTRY) * n); + memset(logical, 0, sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * n); + + /* set the entries in the logical palette */ + logical->palVersion = 0x300; + logical->palNumEntries = n; + + /* start with a copy of the current system palette */ + GetSystemPaletteEntries(XHDC, 0, 256, &logical->palPalEntry[0]); + + if (pfd.iPixelType == PFD_TYPE_RGBA) { + int redMask = (1 << pfd.cRedBits) - 1; + int greenMask = (1 << pfd.cGreenBits) - 1; + int blueMask = (1 << pfd.cBlueBits) - 1; + int i; + + /* fill in an RGBA color palette */ + for (i = 0; i < n; ++i) { + logical->palPalEntry[i].peRed = + (((i >> pfd.cRedShift) & redMask) * 255) / redMask; + logical->palPalEntry[i].peGreen = + (((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask; + logical->palPalEntry[i].peBlue = + (((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask; + logical->palPalEntry[i].peFlags = 0; + } + } + + palette = CreatePalette(logical); + free(logical); + + SelectPalette(XHDC, palette, FALSE); + RealizePalette(XHDC); + + return palette; +} + +void +XAllocColorCells(Display* display, Colormap colormap, Bool contig, + unsigned long plane_masks_return[], unsigned int nplanes, + unsigned long pixels_return[], unsigned int npixels) +{ + /* NOP -- we did all the allocating in XCreateColormap! */ +} + +void +XStoreColor(Display* display, Colormap colormap, XColor* color) +{ + /* KLUDGE: set XHDC to 0 if the palette should NOT be realized after + setting the color. set XHDC to the correct HDC if it should. */ + + PALETTEENTRY pe; + + /* X11 stores color from 0-65535, Win32 expects them to be 0-256, so + twiddle the bits ( / 256). */ + pe.peRed = color->red / 256; + pe.peGreen = color->green / 256; + pe.peBlue = color->blue / 256; + + /* make sure we use this flag, otherwise the colors might get mapped + to another place in the colormap, and when we glIndex() that + color, it may have moved (argh!!) */ + pe.peFlags = PC_NOCOLLAPSE; + + /* the pixel field of the XColor structure is the index into the + colormap */ + SetPaletteEntries(colormap, color->pixel, 1, &pe); + + if (XHDC) { + UnrealizeObject(colormap); + SelectPalette(XHDC, colormap, FALSE); + RealizePalette(XHDC); + } +} + +void +XSetWindowColormap(Display* display, Window window, Colormap colormap) +{ + HDC hdc = GetDC(window); + + /* if the third parameter is FALSE, the logical colormap is copied + into the device palette when the application is in the + foreground, if it is TRUE, the colors are mapped into the current + palette in the best possible way. */ + SelectPalette(hdc, colormap, FALSE); + RealizePalette(hdc); + + /* note that we don't have to release the DC, since our window class + uses the WC_OWNDC flag! */ +} + +Bool +XTranslateCoordinates(Display *display, Window src, Window dst, + int src_x, int src_y, + int* dest_x_return, int* dest_y_return, + Window* child_return) +{ + /* KLUDGE: this isn't really a translate coordinates into some other + windows coordinate system...it only translates coordinates into the + root window (screen) coordinate system. */ + + POINT point; + + point.x = src_x; + point.y = src_y; + + ClientToScreen(src, &point); + + *dest_x_return = point.x; + *dest_y_return = point.y; + + /* just to make compilers happy...we don't use the return value. */ + return True; +} + +Status +XGetGeometry(Display* display, Window window, Window* root_return, + int* x_return, int* y_return, + unsigned int* width_return, unsigned int* height_return, + unsigned int *border_width_return, unsigned int* depth_return) +{ + /* KLUDGE: doesn't return the border_width or depth or root, x & y + are in screen coordinates. */ + + RECT rect; + POINT point; + + GetClientRect(window, &rect); + + point.x = 0; + point.y = 0; + ClientToScreen(window, &point); + + *x_return = point.x; + *y_return = point.y; + *width_return = rect.right; + *height_return = rect.bottom; + + /* just to make compilers happy...we don't use the return value. */ + return 1; +} + +int +DisplayWidthMM(Display* display, int screen) +{ + int width; + HWND hwnd = GetDesktopWindow(); + HDC hdc = GetDC(hwnd); + + width = GetDeviceCaps(hdc, HORZSIZE); + + /* make sure to release this DC (it's the desktops, not ours) */ + ReleaseDC(hwnd, hdc); + + return width; +} + +int +DisplayHeightMM(Display* display, int screen) +{ + int height; + HWND hwnd = GetDesktopWindow(); + HDC hdc = GetDC(hwnd); + + height = GetDeviceCaps(hdc, VERTSIZE); + + /* make sure to release this DC (it's the desktops, not ours) */ + ReleaseDC(hwnd, hdc); + + return height; +} + +void +XWarpPointer(Display* display, Window src, Window dst, + int src_x, int src_y, int src_width, int src_height, + int dst_x, int dst_y) +{ + /* KLUDGE: this isn't really a warp pointer into some other windows + coordinate system...it only warps the pointer into the root window + (screen) coordinate system. */ + + POINT point; + + point.x = dst_x; + point.y = dst_y; + ClientToScreen(dst, &point); + + SetCursorPos(point.x, point.y); +} + +int +XPending(Display* display) +{ + /* similar functionality...I don't think that it is exact, but this + will have to do. */ + MSG msg; + + return PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); +} + +/* the following function was stolen from the X sources as indicated. */ + +/* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */ + +/* +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. +*/ + +/* + * XParseGeometry parses strings of the form + * "=x{+-}{+-}", where + * width, height, xoffset, and yoffset are unsigned integers. + * Example: "=80x24+300-49" + * The equal sign is optional. + * It returns a bitmask that indicates which of the four values + * were actually found in the string. For each value found, + * the corresponding argument is updated; for each value + * not found, the corresponding argument is left unchanged. + */ + +static int +ReadInteger(char *string, char **NextString) +{ + register int Result = 0; + int Sign = 1; + + if (*string == '+') + string++; + else if (*string == '-') + { + string++; + Sign = -1; + } + for (; (*string >= '0') && (*string <= '9'); string++) + { + Result = (Result * 10) + (*string - '0'); + } + *NextString = string; + if (Sign >= 0) + return (Result); + else + return (-Result); +} + +int XParseGeometry(char *string, int *x, int *y, unsigned int *width, unsigned int *height) +{ + int mask = NoValue; + register char *strind; + unsigned int tempWidth, tempHeight; + int tempX, tempY; + char *nextCharacter; + + if ( (string == NULL) || (*string == '\0')) return(mask); + if (*string == '=') + string++; /* ignore possible '=' at beg of geometry spec */ + + strind = (char *)string; + if (*strind != '+' && *strind != '-' && *strind != 'x') { + tempWidth = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= WidthValue; + } + + if (*strind == 'x' || *strind == 'X') { + strind++; + tempHeight = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= HeightValue; + } + + if ((*strind == '+') || (*strind == '-')) { + if (*strind == '-') { + strind++; + tempX = -ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= XNegative; + + } + else + { strind++; + tempX = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + } + mask |= XValue; + if ((*strind == '+') || (*strind == '-')) { + if (*strind == '-') { + strind++; + tempY = -ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + mask |= YNegative; + + } + else + { + strind++; + tempY = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + } + mask |= YValue; + } + } + + /* If strind isn't at the end of the string the it's an invalid + geometry specification. */ + + if (*strind != '\0') return (0); + + if (mask & XValue) + *x = tempX; + if (mask & YValue) + *y = tempY; + if (mask & WidthValue) + *width = tempWidth; + if (mask & HeightValue) + *height = tempHeight; + return (mask); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.h xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.h --- xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/glx/win32_x11.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,324 @@ +#ifndef __win32_x11_h__ +#define __win32_x11_h__ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ +#ifdef __MINGW32__ +#include +#endif +#include +#include + +/* These definitions are missing from windows.h */ + + +/* Type definitions (conversions) */ +typedef int Visual; /* Win32 equivalent of X11 type */ +typedef HWND Window; +typedef HPALETTE Colormap; +typedef PIXELFORMATDESCRIPTOR XVisualInfo; +typedef BOOL Bool; +typedef MSG XEvent; +typedef HDC Display; +typedef HCURSOR Cursor; + +typedef int Atom; /* dummies */ +typedef int XDevice; +typedef int Status; + +#define True TRUE /* Win32 equivalents of X11 booleans */ +#define False FALSE + +#define None 0L /* universal null resource or null atom */ + +/* Input Event Masks. Used as event-mask window attribute and as arguments + to Grab requests. Not to be confused with event names. */ + +#define NoEventMask 0L +#define KeyPressMask (1L<<0) +#define KeyReleaseMask (1L<<1) +#define ButtonPressMask (1L<<2) +#define ButtonReleaseMask (1L<<3) +#define EnterWindowMask (1L<<4) +#define LeaveWindowMask (1L<<5) +#define PointerMotionMask (1L<<6) +#define PointerMotionHintMask (1L<<7) +#define Button1MotionMask (1L<<8) +#define Button2MotionMask (1L<<9) +#define Button3MotionMask (1L<<10) +#define Button4MotionMask (1L<<11) +#define Button5MotionMask (1L<<12) +#define ButtonMotionMask (1L<<13) +#define KeymapStateMask (1L<<14) +#define ExposureMask (1L<<15) +#define VisibilityChangeMask (1L<<16) +#define StructureNotifyMask (1L<<17) +#define ResizeRedirectMask (1L<<18) +#define SubstructureNotifyMask (1L<<19) +#define SubstructureRedirectMask (1L<<20) +#define FocusChangeMask (1L<<21) +#define PropertyChangeMask (1L<<22) +#define ColormapChangeMask (1L<<23) +#define OwnerGrabButtonMask (1L<<24) + +/* Key masks. Used as modifiers to GrabButton and GrabKey, results of + QueryPointer, state in various key-, mouse-, and button-related + events. */ + +#define ShiftMask (1<<0) +#define LockMask (1<<1) +#define ControlMask (1<<2) +#define Mod1Mask (1<<3) +#define Mod2Mask (1<<4) +#define Mod3Mask (1<<5) +#define Mod4Mask (1<<6) +#define Mod5Mask (1<<7) + +/* Window classes used by CreateWindow */ +/* Note that CopyFromParent is already defined as 0 above */ + +#define InputOutput 1 +#define InputOnly 2 + +/* Window attributes for CreateWindow and ChangeWindowAttributes */ + +#define CWBackPixmap (1L<<0) +#define CWBackPixel (1L<<1) +#define CWBorderPixmap (1L<<2) +#define CWBorderPixel (1L<<3) +#define CWBitGravity (1L<<4) +#define CWWinGravity (1L<<5) +#define CWBackingStore (1L<<6) +#define CWBackingPlanes (1L<<7) +#define CWBackingPixel (1L<<8) +#define CWOverrideRedirect (1L<<9) +#define CWSaveUnder (1L<<10) +#define CWEventMask (1L<<11) +#define CWDontPropagate (1L<<12) +#define CWColormap (1L<<13) +#define CWCursor (1L<<14) + +/* ConfigureWindow structure */ + +#define CWX (1<<0) +#define CWY (1<<1) +#define CWWidth (1<<2) +#define CWHeight (1<<3) +#define CWBorderWidth (1<<4) +#define CWSibling (1<<5) +#define CWStackMode (1<<6) + + +/* Used in GetWindowAttributes reply */ + +#define IsUnmapped 0 +#define IsUnviewable 1 +#define IsViewable 2 + +/* Window stacking method (in configureWindow) */ + +#define Above 0 +#define Below 1 +#define TopIf 2 +#define BottomIf 3 +#define Opposite 4 + +/* For CreateColormap */ + +#define AllocNone 0 /* create map with no entries */ +#define AllocAll 1 /* allocate entire map writeable */ + + +/* Flags used in StoreNamedColor, StoreColors */ + +#define DoRed (1<<0) +#define DoGreen (1<<1) +#define DoBlue (1<<2) + +/* + * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding + * value (x, y, width, height) was found in the parsed string. + */ +#define NoValue 0x0000 +#define XValue 0x0001 +#define YValue 0x0002 +#define WidthValue 0x0004 +#define HeightValue 0x0008 +#define AllValues 0x000F +#define XNegative 0x0010 +#define YNegative 0x0020 + +/* flags argument in size hints */ +#define USPosition (1L << 0) /* user specified x, y */ +#define USSize (1L << 1) /* user specified width, height */ + +/* definitions for initial window state */ +#define WithdrawnState 0 /* for windows that are not mapped */ +#define NormalState 1 /* most applications want to start this way */ +#define IconicState 3 /* application wants to start as an icon */ +#define GameModeState 4 /* Win32 GLUT only (not in Xlib!). */ + +/* Type definitions */ + +typedef struct { + unsigned int background_pixmap; /* background pixmap */ + unsigned long background_pixel; /* background pixel */ + unsigned long border_pixel; /* border pixel value */ + long event_mask; /* set of events that should be saved */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Colormap colormap; /* color map to be associated with window */ +} XSetWindowAttributes; + +typedef struct { + unsigned long pixel; + unsigned short red, green, blue; + char flags; /* do_red, do_green, do_blue */ +} XColor; + +typedef struct { + unsigned char *value; /* same as Property routines */ + Atom encoding; /* prop type */ + int format; /* prop data format: 8, 16, or 32 */ + unsigned long nitems; /* number of data items in value */ +} XTextProperty; + +typedef struct { + long flags; /* marks which fields in this structure are defined */ + int x, y; /* obsolete for new window mgrs, but clients */ + int width, height; /* should set so old wm's don't mess up */ +} XSizeHints; + +/* Functions emulated by macros. */ + +#define XFreeColormap(display, colormap) \ + DeleteObject(colormap) + +#define XCreateFontCursor(display, shape) \ + LoadCursor(NULL, shape) + +#define XDefineCursor(display, window, cursor) \ + SetCursor(cursor) + +#define XFlush(display) \ + /* Nothing. */ + +#define DisplayWidth(display, screen) \ + GetSystemMetrics(SM_CXSCREEN) + +#define DisplayHeight(display, screen) \ + GetSystemMetrics(SM_CYSCREEN) + +#define XMapWindow(display, window) \ + ShowWindow(window, SW_SHOWNORMAL) + +#define XUnmapWindow(display, window) \ + ShowWindow(window, SW_HIDE) + +#define XIconifyWindow(display, window, screen) \ + ShowWindow(window, SW_MINIMIZE) + +#define XWithdrawWindow(display, window, screen) \ + ShowWindow(window, SW_HIDE) + +#define XLowerWindow(display, window) \ + SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) + +#define XSetWMName(display, window, tp) \ + SetWindowText(window, (tp)->value) + +/* There really isn't a way to set the icon name separate from the + windows name in Win32, so, just set the windows name. */ +#define XSetWMIconName(display, window, tp) \ + XSetWMName(display, window, tp) + +#define XDestroyWindow(display, window) \ + DestroyWindow(window) + +/* Anything that needs to be freed was allocated with malloc in our + fake X windows library for Win32, so free it with plain old + free(). */ +#define XFree(data) \ + free(data) + +/* Nothing to be done for this...the pointer is always 'ungrabbed' + in Win32. */ +#define XUngrabPointer(display, time) \ + /* Nothing. */ + +/* Function prototypes. */ + +extern XVisualInfo* XGetVisualInfo( + Display* display, + long mask, + XVisualInfo* ttemplate, /* Avoid class with C++ keyword. */ + int*nitems); + +extern Colormap XCreateColormap( + Display* display, + Window root, + Visual* visual, + int alloc); + +extern void XAllocColorCells( + Display* display, + Colormap colormap, + Bool contig, + unsigned long plane_masks_return[], + unsigned int nplanes, + unsigned long pixels_return[], + unsigned int npixels); + +extern void XStoreColor( + Display* display, + Colormap colormap, + XColor* color); + +extern void XSetWindowColormap( + Display* display, + Window window, + Colormap colormap); + +extern Bool XTranslateCoordinates( + Display *display, + Window src, Window dst, + int src_x, int src_y, + int* dest_x_return, int* dest_y_return, + Window* child_return); + +extern Status XGetGeometry( + Display* display, + Window window, + Window* root_return, + int* x_return, int* y_return, + unsigned int* width_return, unsigned int* height_return, + unsigned int *border_width_return, + unsigned int* depth_return); + +extern int DisplayWidthMM( + Display* display, + int screen); + +extern int DisplayHeightMM( + Display* display, + int screen); + +extern void XWarpPointer( + Display* display, + Window src, Window dst, + int src_x, int src_y, + int src_width, int src_height, + int dst_x, int dst_y); + +extern int XParseGeometry( + char* string, + int* x, int* y, + unsigned int* width, unsigned int* height); + +extern int XPending( + Display* display); + +#endif /* __win32_x11_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/bitmap.c xpsb-glx-0.19/mesa/src/glut/mini/bitmap.c --- xpsb-glx-0.19/mesa/src/glut/mini/bitmap.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/bitmap.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,56 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutbitmap.h" + +void APIENTRY +glutBitmapCharacter(GLUTbitmapFont font, int c) +{ + const BitmapCharRec *ch; + BitmapFontPtr fontinfo; + GLfloat swapbytes, lsbfirst, rowlength; + GLfloat skiprows, skippixels, alignment; + +#if defined(_WIN32) + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + if (c < fontinfo->first || + c >= fontinfo->first + fontinfo->num_chars) + return; + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) { + /* Save current modes. */ +/* glGetFloatv(GL_UNPACK_SWAP_BYTES, &swapbytes); */ +/* glGetFloatv(GL_UNPACK_LSB_FIRST, &lsbfirst); */ +/* glGetFloatv(GL_UNPACK_ROW_LENGTH, &rowlength); */ +/* glGetFloatv(GL_UNPACK_SKIP_ROWS, &skiprows); */ +/* glGetFloatv(GL_UNPACK_SKIP_PIXELS, &skippixels); */ + glGetFloatv(GL_UNPACK_ALIGNMENT, &alignment); + /* Little endian machines (DEC Alpha for example) could + benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE + instead of GL_FALSE, but this would require changing the + generated bitmaps too. */ +/* 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); + glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, + ch->advance, 0, ch->bitmap); + /* Restore saved modes. */ +/* glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); */ +/* glPixelStorei(GL_UNPACK_LSB_FIRST, (int)lsbfirst); */ +/* glPixelStorei(GL_UNPACK_ROW_LENGTH, (int)rowlength); */ +/* glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); */ +/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); */ + glPixelStorei(GL_UNPACK_ALIGNMENT, (int)alignment); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/callback.c xpsb-glx-0.19/mesa/src/glut/mini/callback.c --- xpsb-glx-0.19/mesa/src/glut/mini/callback.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/callback.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,152 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" +#include "internal.h" + + +void APIENTRY glutDisplayFunc (void (GLUTCALLBACK *func) (void)) +{ + display_func = func; +} + + +void APIENTRY glutReshapeFunc (void (GLUTCALLBACK *func) (int width, int height)) +{ + reshape_func = func; +} + + +void APIENTRY glutKeyboardFunc (void (GLUTCALLBACK *func) (unsigned char key, int x, int y)) +{ + keyboard_func = func; +} + + +void APIENTRY glutMouseFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y)) +{ + mouse_func = func; +} + + +void APIENTRY glutMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) +{ + motion_func = func; +} + + +void APIENTRY glutPassiveMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) +{ + passive_motion_func = func; +} + + +void APIENTRY glutEntryFunc (void (GLUTCALLBACK *func) (int state)) +{ + entry_func = func; +} + + +void APIENTRY glutVisibilityFunc (void (GLUTCALLBACK *func) (int state)) +{ + visibility_func = func; +} + + +void APIENTRY glutIdleFunc (void (GLUTCALLBACK *func) (void)) +{ + idle_func = func; +} + + +void APIENTRY glutTimerFunc (unsigned int millis, void (GLUTCALLBACK *func) (int value), int value) +{ +} + + +void APIENTRY glutMenuStateFunc (void (GLUTCALLBACK *func) (int state)) +{ + menu_state_func = func; +} + + +void APIENTRY glutSpecialFunc (void (GLUTCALLBACK *func) (int key, int x, int y)) +{ + special_func = func; +} + + +void APIENTRY glutSpaceballMotionFunc (void (GLUTCALLBACK *func) (int x, int y, int z)) +{ +} + + +void APIENTRY glutSpaceballRotateFunc (void (GLUTCALLBACK *func) (int x, int y, int z)) +{ +} + + +void APIENTRY glutSpaceballButtonFunc (void (GLUTCALLBACK *func) (int button, int state)) +{ +} + + +void APIENTRY glutButtonBoxFunc (void (GLUTCALLBACK *func) (int button, int state)) +{ +} + + +void APIENTRY glutDialsFunc (void (GLUTCALLBACK *func) (int dial, int value)) +{ +} + + +void APIENTRY glutTabletMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) +{ +} + + +void APIENTRY glutTabletButtonFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y)) +{ +} + + +void APIENTRY glutMenuStatusFunc (void (GLUTCALLBACK *func) (int status, int x, int y)) +{ +} + + +void APIENTRY glutOverlayDisplayFunc (void (GLUTCALLBACK *func) (void)) +{ +} + + +void APIENTRY glutWindowStatusFunc (void (GLUTCALLBACK *func) (int state)) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/color.c xpsb-glx-0.19/mesa/src/glut/mini/color.c --- xpsb-glx-0.19/mesa/src/glut/mini/color.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/color.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,46 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" + + +void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ +} + + +GLfloat APIENTRY glutGetColor (int ndx, int component) +{ + return 0.0; +} + + +void APIENTRY glutCopyColormap (int win) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/globals.c xpsb-glx-0.19/mesa/src/glut/mini/globals.c --- xpsb-glx-0.19/mesa/src/glut/mini/globals.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/globals.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,61 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" +#include "internal.h" + +GLenum g_display_mode = 0; +GLuint g_width = DEFAULT_WIDTH; +GLuint g_height = DEFAULT_HEIGHT; +GLint g_mouse = GL_FALSE; +GLboolean g_redisplay = GL_FALSE; +GLint g_xpos = 0; +GLint g_ypos = 0; + +void (GLUTCALLBACK *display_func) (void) = 0; +void (GLUTCALLBACK *reshape_func) (int width, int height) = 0; +void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y) = 0; +void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y) = 0; +void (GLUTCALLBACK *motion_func) (int x, int y) = 0; +void (GLUTCALLBACK *passive_motion_func) (int x, int y) = 0; +void (GLUTCALLBACK *entry_func) (int state) = 0; +void (GLUTCALLBACK *visibility_func) (int state) = 0; +void (GLUTCALLBACK *idle_func) (void) = 0; +void (GLUTCALLBACK *menu_state_func) (int state) = 0; +void (GLUTCALLBACK *special_func) (int key, int x, int y) = 0; +void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z) = 0; +void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z) = 0; +void (GLUTCALLBACK *spaceball_button_func) (int button, int state) = 0; +void (GLUTCALLBACK *button_box_func) (int button, int state) = 0; +void (GLUTCALLBACK *dials_func) (int dial, int value) = 0; +void (GLUTCALLBACK *tablet_motion_func) (int x, int y) = 0; +void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y) = 0; +void (GLUTCALLBACK *menu_status_func) (int status, int x, int y) = 0; +void (GLUTCALLBACK *overlay_display_func) (void) = 0; +void (GLUTCALLBACK *window_status_func) (int state) = 0; diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/glut.pc.in xpsb-glx-0.19/mesa/src/glut/mini/glut.pc.in --- xpsb-glx-0.19/mesa/src/glut/mini/glut.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/glut.pc.in 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,13 @@ +prefix=@INSTALL_DIR@ +exec_prefix=${prefix} +libdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: glut +Description: Mesa OpenGL Utility Toolkit library +Requires: gl glu +Requires.private: @GLUT_PC_REQ_PRIV@ +Version: @VERSION@ +Libs: -L${libdir} -lglut +Libs.private: @GLUT_PC_LIB_PRIV@ +Cflags: -I${includedir} @GLUT_PC_CFLAGS@ diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/init.c xpsb-glx-0.19/mesa/src/glut/mini/init.c --- xpsb-glx-0.19/mesa/src/glut/mini/init.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/init.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,59 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" +#include "internal.h" + + +void APIENTRY glutInit (int *argcp, char **argv) +{ + glutGet(GLUT_ELAPSED_TIME); +} + + +void APIENTRY glutInitDisplayMode (unsigned int mode) +{ + g_display_mode = mode; +} + + +void APIENTRY glutInitWindowPosition (int x, int y) +{ + g_xpos = x; + g_ypos = y; +} + + +void APIENTRY glutInitWindowSize (int width, int height) +{ + g_width = width; + g_height = height; +} + + diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/internal.h xpsb-glx-0.19/mesa/src/glut/mini/internal.h --- xpsb-glx-0.19/mesa/src/glut/mini/internal.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/internal.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,78 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef INTERNAL_H_included +#define INTERNAL_H_included + + +#include "GL/glut.h" +/* #include "pc_hw/pc_hw.h" */ + + +#define MAX_WINDOWS 4 + +#define DEFAULT_WIDTH 640 +#define DEFAULT_HEIGHT 480 +#define DEFAULT_BPP 16 + +#define DEPTH_SIZE 16 +#define STENCIL_SIZE 8 +#define ACCUM_SIZE 16 + +extern GLenum g_display_mode; +extern GLuint g_width; +extern GLuint g_height; +extern GLint g_mouse; +extern GLboolean g_redisplay; +extern GLint g_xpos; +extern GLint g_ypos; + +extern void (GLUTCALLBACK *display_func) (void); +extern void (GLUTCALLBACK *reshape_func) (int width, int height); +extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y); +extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y); +extern void (GLUTCALLBACK *motion_func) (int x, int y); +extern void (GLUTCALLBACK *passive_motion_func) (int x, int y); +extern void (GLUTCALLBACK *entry_func) (int state); +extern void (GLUTCALLBACK *visibility_func) (int state); +extern void (GLUTCALLBACK *idle_func) (void); +extern void (GLUTCALLBACK *menu_state_func) (int state); +extern void (GLUTCALLBACK *special_func) (int key, int x, int y); +extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z); +extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z); +extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state); +extern void (GLUTCALLBACK *button_box_func) (int button, int state); +extern void (GLUTCALLBACK *dials_func) (int dial, int value); +extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y); +extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y); +extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y); +extern void (GLUTCALLBACK *overlay_display_func) (void); +extern void (GLUTCALLBACK *window_status_func) (int state); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/Makefile xpsb-glx-0.19/mesa/src/glut/mini/Makefile --- xpsb-glx-0.19/mesa/src/glut/mini/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,101 @@ +# subset glut + +TOP = ../../.. +include $(TOP)/configs/current + +MARK = $(TOP)/src/glut/glx + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 1 + +INCLUDES = -I$(TOP)/include -I$(MARK) + +CORE_SOURCES = \ + bitmap.c \ + callback.c \ + color.c \ + globals.c \ + init.c \ + menu.c \ + models.c \ + overlay.c \ + state.c \ + teapot.c \ + window.c + + +MARK_SOURCES = \ + $(MARK)/glut_8x13.c \ + $(MARK)/glut_9x15.c \ + $(MARK)/glut_hel10.c \ + $(MARK)/glut_hel12.c \ + $(MARK)/glut_hel18.c \ + $(MARK)/glut_tr10.c \ + $(MARK)/glut_tr24.c + +SOURCES = $(CORE_SOURCES) $(MARK_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + + +# Make the library +$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ + $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ + $(MKLIB_OPTIONS) $(OBJECTS) + + +# Run 'make -f Makefile.solo dep' to update the dependencies if you change +# what's included by any source file. +depend: $(SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# glut pkgconfig file +pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ + -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ + -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' \ + -e 's,@GLUT_PC_REQ_PRIV@,$(GLUT_PC_REQ_PRIV),' \ + -e 's,@GLUT_PC_LIB_PRIV@,$(GLUT_PC_LIB_PRIV),' \ + -e 's,@GLUT_PC_CFLAGS@,$(GLUT_PC_CFLAGS),' +glut.pc: glut.pc.in + $(pcedit) $< > $@ + +install: glut.pc + $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + +# Remove .o and backup files +clean: depend + -rm -f depend depend.bak + -rm -f *.o *~ *.o *~ *.so *.pc libglut.so.3.7 + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/menu.c xpsb-glx-0.19/mesa/src/glut/mini/menu.c --- xpsb-glx-0.19/mesa/src/glut/mini/menu.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/menu.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,86 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" + + +int APIENTRY glutCreateMenu (void (GLUTCALLBACK *func) (int)) +{ + return 0; +} + +void APIENTRY glutDestroyMenu (int menu) +{ +} + + +int APIENTRY glutGetMenu (void) +{ + return 0; +} + + +void APIENTRY glutSetMenu (int menu) +{ +} + + +void APIENTRY glutAddMenuEntry (const char *label, int value) +{ +} + + +void APIENTRY glutAddSubMenu (const char *label, int submenu) +{ +} + + +void APIENTRY glutChangeToMenuEntry (int item, const char *label, int value) +{ +} + + +void APIENTRY glutChangeToSubMenu (int item, const char *label, int submenu) +{ +} + + +void APIENTRY glutRemoveMenuItem (int item) +{ +} + + +void APIENTRY glutAttachMenu (int button) +{ +} + + +void APIENTRY glutDetachMenu (int button) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/models.c xpsb-glx-0.19/mesa/src/glut/mini/models.c --- xpsb-glx-0.19/mesa/src/glut/mini/models.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/models.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,598 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include +#include +#include "GL/glut.h" + +/* Some files do not define M_PI... */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +static GLUquadricObj *quadObj; + +#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } + +static void +initQuadObj(void) +{ + quadObj = gluNewQuadric(); +/* if (!quadObj) + __glutFatalError("out of memory."); */ +} + +/* CENTRY */ +void APIENTRY +glutWireSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void APIENTRY +glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void APIENTRY +glutWireCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +void APIENTRY +glutSolidCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +/* ENDCENTRY */ + +static void +drawBox(GLfloat size, GLenum type) +{ + static GLfloat n[6][3] = + { + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {1.0, 0.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} + }; + static GLint faces[6][4] = + { + {0, 1, 2, 3}, + {3, 2, 6, 7}, + {7, 6, 5, 4}, + {4, 5, 1, 0}, + {5, 6, 2, 1}, + {7, 4, 0, 3} + }; + GLfloat v[8][3]; + GLint i; + + v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; + v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; + v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; + v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; + v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; + v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; + + for (i = 5; i >= 0; i--) { + glBegin(type); + glNormal3fv(&n[i][0]); + glVertex3fv(&v[faces[i][0]][0]); + glVertex3fv(&v[faces[i][1]][0]); + glVertex3fv(&v[faces[i][2]][0]); + glVertex3fv(&v[faces[i][3]][0]); + glEnd(); + } +} + +/* CENTRY */ +void APIENTRY +glutWireCube(GLdouble size) +{ + drawBox(size, GL_LINE_LOOP); +} + +void APIENTRY +glutSolidCube(GLdouble size) +{ + drawBox(size, GL_QUADS); +} + +/* ENDCENTRY */ + +static void +doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) +{ + int i, j; + GLfloat theta, phi, theta1; + GLfloat cosTheta, sinTheta; + GLfloat cosTheta1, sinTheta1; + GLfloat ringDelta, sideDelta; + + ringDelta = 2.0 * M_PI / rings; + sideDelta = 2.0 * M_PI / nsides; + + theta = 0.0; + cosTheta = 1.0; + sinTheta = 0.0; + for (i = rings - 1; i >= 0; i--) { + theta1 = theta + ringDelta; + cosTheta1 = cos(theta1); + sinTheta1 = sin(theta1); + glBegin(GL_QUAD_STRIP); + phi = 0.0; + for (j = nsides; j >= 0; j--) { + GLfloat cosPhi, sinPhi, dist; + + phi += sideDelta; + cosPhi = cos(phi); + sinPhi = sin(phi); + dist = R + r * cosPhi; + + glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); + glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); + glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); + glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); + } + glEnd(); + theta = theta1; + cosTheta = cosTheta1; + sinTheta = sinTheta1; + } +} + +/* CENTRY */ +void APIENTRY +glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + doughnut(innerRadius, outerRadius, nsides, rings); + glPopAttrib(); +} + +void APIENTRY +glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + doughnut(innerRadius, outerRadius, nsides, rings); +} + +/* ENDCENTRY */ + +static GLfloat dodec[20][3]; + +static void +initDodecahedron(void) +{ + GLfloat alpha, beta; + + alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); + beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - + 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); + /* *INDENT-OFF* */ + dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; + dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; + dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; + dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; + dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; + dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; + dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; + dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; + dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; + dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; + dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; + dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; + dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; + dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; + dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; + dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; + dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; + dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; + dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; + dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; + /* *INDENT-ON* */ + +} + +#define DIFF3(_a,_b,_c) { \ + (_c)[0] = (_a)[0] - (_b)[0]; \ + (_c)[1] = (_a)[1] - (_b)[1]; \ + (_c)[2] = (_a)[2] - (_b)[2]; \ +} + +static void +crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) +{ + GLfloat p[3]; /* in case prod == v1 or v2 */ + + p[0] = v1[1] * v2[2] - v2[1] * v1[2]; + p[1] = v1[2] * v2[0] - v2[2] * v1[0]; + p[2] = v1[0] * v2[1] - v2[0] * v1[1]; + prod[0] = p[0]; + prod[1] = p[1]; + prod[2] = p[2]; +} + +static void +normalize(GLfloat v[3]) +{ + GLfloat d; + + d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + if (d == 0.0) { +/* __glutWarning("normalize: zero length vector"); */ + v[0] = d = 1.0; + } + d = 1 / d; + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +static void +pentagon(int a, int b, int c, int d, int e, GLenum shadeType) +{ + GLfloat n0[3], d1[3], d2[3]; + + DIFF3(dodec[a], dodec[b], d1); + DIFF3(dodec[b], dodec[c], d2); + crossprod(d1, d2, n0); + normalize(n0); + + glBegin(shadeType); + glNormal3fv(n0); + glVertex3fv(&dodec[a][0]); + glVertex3fv(&dodec[b][0]); + glVertex3fv(&dodec[c][0]); + glVertex3fv(&dodec[d][0]); + glVertex3fv(&dodec[e][0]); + glEnd(); +} + +static void +dodecahedron(GLenum type) +{ + static int inited = 0; + + if (inited == 0) { + inited = 1; + initDodecahedron(); + } + pentagon(0, 1, 9, 16, 5, type); + pentagon(1, 0, 3, 18, 7, type); + pentagon(1, 7, 11, 10, 9, type); + pentagon(11, 7, 18, 19, 6, type); + pentagon(8, 17, 16, 9, 10, type); + pentagon(2, 14, 15, 6, 19, type); + pentagon(2, 13, 12, 4, 14, type); + pentagon(2, 19, 18, 3, 13, type); + pentagon(3, 0, 5, 12, 13, type); + pentagon(6, 15, 8, 10, 11, type); + pentagon(4, 17, 8, 15, 14, type); + pentagon(4, 12, 5, 16, 17, type); +} + +/* CENTRY */ +void APIENTRY +glutWireDodecahedron(void) +{ + dodecahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidDodecahedron(void) +{ + dodecahedron(GL_TRIANGLE_FAN); +} + +/* ENDCENTRY */ + +static void +recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, + GLenum shadeType) +{ + GLfloat q0[3], q1[3]; + + DIFF3(n1, n2, q0); + DIFF3(n2, n3, q1); + crossprod(q0, q1, q1); + normalize(q1); + + glBegin(shadeType); + glNormal3fv(q1); + glVertex3fv(n1); + glVertex3fv(n2); + glVertex3fv(n3); + glEnd(); +} + +static void +subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, + GLenum shadeType) +{ + int depth; + GLfloat w0[3], w1[3], w2[3]; + GLfloat l; + int i, j, k, n; + + depth = 1; + for (i = 0; i < depth; i++) { + for (j = 0; i + j < depth; j++) { + k = depth - i - j; + for (n = 0; n < 3; n++) { + w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; + w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) + / depth; + w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) + / depth; + } + l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); + w0[0] /= l; + w0[1] /= l; + w0[2] /= l; + l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); + w1[0] /= l; + w1[1] /= l; + w1[2] /= l; + l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); + w2[0] /= l; + w2[1] /= l; + w2[2] /= l; + recorditem(w1, w0, w2, shadeType); + } + } +} + +static void +drawtriangle(int i, GLfloat data[][3], int ndx[][3], + GLenum shadeType) +{ + GLfloat *x0, *x1, *x2; + + x0 = data[ndx[i][0]]; + x1 = data[ndx[i][1]]; + x2 = data[ndx[i][2]]; + subdivide(x0, x1, x2, shadeType); +} + +/* octahedron data: The octahedron produced is centered at the + origin and has radius 1.0 */ +static GLfloat odata[6][3] = +{ + {1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} +}; + +static int ondex[8][3] = +{ + {0, 4, 2}, + {1, 2, 4}, + {0, 3, 4}, + {1, 4, 3}, + {0, 2, 5}, + {1, 5, 2}, + {0, 5, 3}, + {1, 3, 5} +}; + +static void +octahedron(GLenum shadeType) +{ + int i; + + for (i = 7; i >= 0; i--) { + drawtriangle(i, odata, ondex, shadeType); + } +} + +/* CENTRY */ +void APIENTRY +glutWireOctahedron(void) +{ + octahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidOctahedron(void) +{ + octahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* icosahedron data: These numbers are rigged to make an + icosahedron of radius 1.0 */ + +#define X .525731112119133606 +#define Z .850650808352039932 + +static GLfloat idata[12][3] = +{ + {-X, 0, Z}, + {X, 0, Z}, + {-X, 0, -Z}, + {X, 0, -Z}, + {0, Z, X}, + {0, Z, -X}, + {0, -Z, X}, + {0, -Z, -X}, + {Z, X, 0}, + {-Z, X, 0}, + {Z, -X, 0}, + {-Z, -X, 0} +}; + +static int index[20][3] = +{ + {0, 4, 1}, + {0, 9, 4}, + {9, 5, 4}, + {4, 5, 8}, + {4, 8, 1}, + {8, 10, 1}, + {8, 3, 10}, + {5, 3, 8}, + {5, 2, 3}, + {2, 7, 3}, + {7, 10, 3}, + {7, 6, 10}, + {7, 11, 6}, + {11, 0, 6}, + {0, 1, 6}, + {6, 1, 10}, + {9, 0, 11}, + {9, 11, 2}, + {9, 2, 5}, + {7, 2, 11}, +}; + +static void +icosahedron(GLenum shadeType) +{ + int i; + + for (i = 19; i >= 0; i--) { + drawtriangle(i, idata, index, shadeType); + } +} + +/* CENTRY */ +void APIENTRY +glutWireIcosahedron(void) +{ + icosahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidIcosahedron(void) +{ + icosahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* tetrahedron data: */ + +#define T 1.73205080756887729 + +static GLfloat tdata[4][3] = +{ + {T, T, T}, + {T, -T, -T}, + {-T, T, -T}, + {-T, -T, T} +}; + +static int tndex[4][3] = +{ + {0, 1, 3}, + {2, 1, 0}, + {3, 2, 0}, + {1, 2, 3} +}; + +static void +tetrahedron(GLenum shadeType) +{ + int i; + + for (i = 3; i >= 0; i--) + drawtriangle(i, tdata, tndex, shadeType); +} + +/* CENTRY */ +void APIENTRY +glutWireTetrahedron(void) +{ + tetrahedron(GL_LINE_LOOP); +} + +void APIENTRY +glutSolidTetrahedron(void) +{ + tetrahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/overlay.c xpsb-glx-0.19/mesa/src/glut/mini/overlay.c --- xpsb-glx-0.19/mesa/src/glut/mini/overlay.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/overlay.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,60 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" + + +void APIENTRY glutEstablishOverlay (void) +{ +} + + +void APIENTRY glutRemoveOverlay (void) +{ +} + + +void APIENTRY glutUseLayer (GLenum layer) +{ +} + + +void APIENTRY glutPostOverlayRedisplay (void) +{ +} + + +void APIENTRY glutShowOverlay (void) +{ +} + + +void APIENTRY glutHideOverlay (void) +{ +} diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/state.c xpsb-glx-0.19/mesa/src/glut/mini/state.c --- xpsb-glx-0.19/mesa/src/glut/mini/state.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/state.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,70 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "GL/glut.h" +#include + + +#define TIMEDELTA(dest, src1, src2) { \ + if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \ + (dest).tv_usec += 1000000; \ + (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \ + } else { \ + (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \ + } \ +} + +int APIENTRY glutGet (GLenum type) +{ + + switch (type) { + case GLUT_WINDOW_RGBA: + return 1; + case GLUT_ELAPSED_TIME: { + static int inited = 0; + static struct timeval elapsed, beginning, now; + if (!inited) { + gettimeofday(&beginning, 0); + inited = 1; + } + gettimeofday(&now, 0); + TIMEDELTA(elapsed, now, beginning); + /* Return elapsed milliseconds. */ + return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000)); + } + default: + return 0; + } +} + + +int APIENTRY glutDeviceGet (GLenum type) +{ + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/teapot.c xpsb-glx-0.19/mesa/src/glut/mini/teapot.c --- xpsb-glx-0.19/mesa/src/glut/mini/teapot.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/teapot.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,212 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include +#include "GL/glut.h" + +/* Rim, body, lid, and bottom data must be reflected in x and + y; handle and spout data across the y axis only. */ + +static int patchdata[][16] = +{ + /* rim */ + {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}, + /* body */ + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27}, + {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40}, + /* lid */ + {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, + 101, 0, 1, 2, 3,}, + {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117}, + /* bottom */ + {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, + 125, 120, 40, 39, 38, 37}, + /* handle */ + {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56}, + {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 28, 65, 66, 67}, + /* spout */ + {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83}, + {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95} +}; +/* *INDENT-OFF* */ + +static float cpdata[][3] = +{ + {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, + -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, + {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, + 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, + 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, + 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, + {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, + 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, + {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, + 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, + 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, + {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, + {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, + -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, + -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, + 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, + 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, + 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, + {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, + -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, + 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, + -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, + 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, + 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, + 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, + {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, + -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, + 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, + {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, + {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, + {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, + 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, + 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, + -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, + 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, + 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, + 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, + {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, + -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, + 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, + {0.84, -1.5, 0.075} +}; + +static float tex[2][2][2] = +{ + { {0, 0}, + {1, 0}}, + { {0, 1}, + {1, 1}} +}; + +/* *INDENT-ON* */ + +static void +teapot(GLint grid, GLdouble scale, GLenum type) +{ + float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; + long i, j, k, l; + + glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_MAP2_VERTEX_3); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glPushMatrix(); + glRotatef(270.0, 1.0, 0.0, 0.0); + glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); + glTranslatef(0.0, 0.0, -1.5); + for (i = 0; i < 10; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + for (l = 0; l < 3; l++) { + p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 1) + q[j][k][l] *= -1.0; + if (i < 6) { + r[j][k][l] = + cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 0) + r[j][k][l] *= -1.0; + s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + if (l == 0) + s[j][k][l] *= -1.0; + if (l == 1) + s[j][k][l] *= -1.0; + } + } + } + } + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, + &tex[0][0][0]); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &p[0][0][0]); + glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &q[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + if (i < 6) { + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &r[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &s[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + } + } + glPopMatrix(); + glPopAttrib(); +} + +/* CENTRY */ +void APIENTRY +glutSolidTeapot(GLdouble scale) +{ + teapot(7, scale, GL_FILL); +} + +void APIENTRY +glutWireTeapot(GLdouble scale) +{ + teapot(10, scale, GL_LINE); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/mini/window.c xpsb-glx-0.19/mesa/src/glut/mini/window.c --- xpsb-glx-0.19/mesa/src/glut/mini/window.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/mini/window.c 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,273 @@ +/* + * Mesa 3-D graphics library + * Version: 4.1 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.2 for Mesa 4.1 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include "GL/glut.h" +#include "internal.h" + +#define USE_MINI_GLX 1 +#if USE_MINI_GLX +#include "GL/miniglx.h" +#else +#include +#endif + + + +static GLXContext context = 0; +static Window win; +static XVisualInfo *visinfo = 0; +static Display *dpy = 0; + + +int APIENTRY glutCreateWindow (const char *title) +{ + XSetWindowAttributes attr; + unsigned long mask; + GLXContext ctx; + int scrnum = 0; + Window root = RootWindow( dpy, scrnum ); + + if (win) + return 0; + + if (!dpy) { + dpy = XOpenDisplay(NULL); + if (!dpy) { + printf("Error: XOpenDisplay failed\n"); + exit(1); + } + } + + if (!visinfo) { + int attrib[] = {GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DEPTH_SIZE, 1, + GLX_DOUBLEBUFFER, + None }; + + + visinfo = glXChooseVisual( dpy, scrnum, attrib ); + if (!visinfo) { + printf("Error: couldn't get an RGB, Double-buffered visual\n"); + exit(1); + } + } + + /* window attributes */ + attr.background_pixel = 0; + attr.border_pixel = 0; + attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); + attr.event_mask = StructureNotifyMask | ExposureMask; + mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; + + win = XCreateWindow( dpy, root, g_xpos, g_ypos, g_width, g_height, + 0, visinfo->depth, InputOutput, + visinfo->visual, mask, &attr ); + if (!win) { + printf("Error: XCreateWindow failed\n"); + exit(1); + } + + ctx = glXCreateContext( dpy, visinfo, NULL, True ); + if (!ctx) { + printf("Error: glXCreateContext failed\n"); + exit(1); + } + + if (!glXMakeCurrent( dpy, win, ctx )) { + printf("Error: glXMakeCurrent failed\n"); + exit(1); + } + + if (!(g_display_mode & GLUT_DOUBLE)) + glDrawBuffer( GL_FRONT ); + + + XMapWindow( dpy, win ); + +#if !USE_MINI_GLX + { + XEvent e; + while (1) { + XNextEvent( dpy, &e ); + if (e.type == MapNotify && e.xmap.window == win) { + break; + } + } + } +#endif + + return 1; +} + + +int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height) +{ + return GL_FALSE; +} + + +void APIENTRY glutDestroyWindow (int idx) +{ + if (dpy && win) + XDestroyWindow( dpy, win ); + + if (dpy) + XCloseDisplay( dpy ); + + win = 0; + dpy = 0; +} + + +void APIENTRY glutPostRedisplay (void) +{ + g_redisplay = GL_TRUE; +} + + +void APIENTRY glutSwapBuffers (void) +{ +/* if (g_mouse) pc_scare_mouse(); */ + if (dpy && win) glXSwapBuffers( dpy, win ); +/* if (g_mouse) pc_unscare_mouse(); */ +} + + +int APIENTRY glutGetWindow (void) +{ + return 0; +} + + +void APIENTRY glutSetWindow (int win) +{ +} + + +void APIENTRY glutSetWindowTitle (const char *title) +{ +} + + +void APIENTRY glutSetIconTitle (const char *title) +{ +} + + +void APIENTRY glutPositionWindow (int x, int y) +{ +} + + +void APIENTRY glutReshapeWindow (int width, int height) +{ +} + + +void APIENTRY glutPopWindow (void) +{ +} + + +void APIENTRY glutPushWindow (void) +{ +} + + +void APIENTRY glutIconifyWindow (void) +{ +} + + +void APIENTRY glutShowWindow (void) +{ +} + + +void APIENTRY glutHideWindow (void) +{ +} + +void APIENTRY glutMainLoop (void) +{ + GLboolean idle; + GLboolean have_event; + XEvent evt; + int visible = 0; + + glutPostRedisplay(); + if (reshape_func) reshape_func(g_width, g_height); + + while (GL_TRUE) { + idle = GL_TRUE; + + + if (visible && idle_func) + have_event = XCheckMaskEvent( dpy, ~0, &evt ); + else + have_event = XNextEvent( dpy, &evt ); + + if (have_event) { + idle = GL_FALSE; + switch(evt.type) { + case MapNotify: + if (visibility_func) { + visibility_func(GLUT_VISIBLE); + } + visible = 1; + break; + case UnmapNotify: + if (visibility_func) { + visibility_func(GLUT_NOT_VISIBLE); + } + visible = 0; + break; + case Expose: + g_redisplay = 1; + break; + } + } + + if (visible && g_redisplay && display_func) { + idle = GL_FALSE; + g_redisplay = GL_FALSE; + + display_func(); + } + + if (visible && idle && idle_func) { + idle_func(); + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_8x13.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_8x13.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_8x13.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_8x13.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2076 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmap8By13 XXX +#include "glutbitmap.h" +#undef glutBitmap8By13 + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch0data[] = { 0x0 }; +static const BitmapCharRec ch0 = {1,1,0,0,8,ch0data}; +#else +static const BitmapCharRec ch0 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,8,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch127data[] = { 0x0 }; +static const BitmapCharRec ch127 = {1,1,0,0,8,ch127data}; +#else +static const BitmapCharRec ch127 = {0,0,0,0,8,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,8,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,8,0}; +#endif + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch255 = {6,12,-1,2,8,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {6,10,-1,2,8,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {6,12,-1,2,8,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch252 = {6,10,-1,0,8,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch251 = {6,10,-1,0,8,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch250 = {6,10,-1,0,8,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch249 = {6,10,-1,0,8,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x78,0xc4,0xa4,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch248 = {6,8,-1,1,8,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x20,0x0,0xf8,0x0,0x20,0x20, +}; + +static const BitmapCharRec ch247 = {5,7,-1,-1,8,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch246 = {6,10,-1,0,8,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {6,10,-1,0,8,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch244 = {6,10,-1,0,8,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {6,10,-1,0,8,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch242 = {6,10,-1,0,8,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {6,10,-1,0,8,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x78,0x84,0x84,0x84,0x84,0x78,0x8,0x50,0x30,0x48, +}; + +static const BitmapCharRec ch240 = {6,10,-1,0,8,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch239 = {5,10,-1,0,8,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x90,0x60, +}; + +static const BitmapCharRec ch238 = {5,10,-1,0,8,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch237 = {5,10,-1,0,8,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch236 = {5,10,-1,0,8,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch235 = {6,10,-1,0,8,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch234 = {6,10,-1,0,8,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch233 = {6,10,-1,0,8,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch232 = {6,10,-1,0,8,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x20,0x10,0x78,0x84,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch231 = {6,8,-1,2,8,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6c,0x92,0x90,0x7c,0x12,0x6c, +}; + +static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch229 = {6,10,-1,0,8,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch228 = {6,10,-1,0,8,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {6,10,-1,0,8,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch226 = {6,10,-1,0,8,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {6,10,-1,0,8,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch224 = {6,10,-1,0,8,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0x80,0xb8,0xc4,0x84,0x84,0xf8,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch223 = {6,9,-1,1,8,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80, +}; + +static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x20,0x20,0x20,0x20,0x50,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch221 = {5,10,-1,0,8,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch219 = {6,10,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch218 = {6,10,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,10,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x78,0xc4,0xa4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch216 = {6,11,-1,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch215 = {6,6,-1,-1,8,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch214 = {7,10,0,0,8,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch213 = {7,10,0,0,8,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18, +}; + +static const BitmapCharRec ch212 = {7,10,0,0,8,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {7,10,0,0,8,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10, +}; + +static const BitmapCharRec ch210 = {7,10,0,0,8,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch208 = {7,9,0,0,8,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch207 = {5,10,-1,0,8,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch206 = {5,10,-1,0,8,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch205 = {5,10,-1,0,8,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch204 = {5,10,-1,0,8,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch203 = {6,10,-1,0,8,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch202 = {6,10,-1,0,8,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {6,10,-1,0,8,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch200 = {6,10,-1,0,8,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x20,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch199 = {6,11,-1,2,8,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e, +}; + +static const BitmapCharRec ch198 = {7,9,0,0,8,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch197 = {6,10,-1,0,8,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x48, +}; + +static const BitmapCharRec ch196 = {6,10,-1,0,8,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch195 = {6,10,-1,0,8,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x30, +}; + +static const BitmapCharRec ch194 = {6,10,-1,0,8,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch193 = {6,10,-1,0,8,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {6,10,-1,0,8,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x78,0x84,0x84,0x80,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {6,9,-1,0,8,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch190 = {7,10,0,0,8,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch189 = {7,10,0,0,8,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch188 = {7,10,0,0,8,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0x48,0x24,0x12,0x24,0x48,0x90, +}; + +static const BitmapCharRec ch187 = {7,7,0,-1,8,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf0,0x0,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch186 = {4,6,-1,-3,8,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,6,-1,-4,8,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x40, +}; + +static const BitmapCharRec ch184 = {2,2,-3,2,8,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0, +}; + +static const BitmapCharRec ch183 = {2,1,-3,-4,8,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,9,-1,0,8,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0xb4,0xcc,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch181 = {6,7,-1,1,8,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,-3,-8,8,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x60,0x90,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch179 = {4,6,-1,-4,8,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x80,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,6,-1,-4,8,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,-1,-1,8,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,-2,-5,8,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc, +}; + +static const BitmapCharRec ch175 = {6,1,-1,-8,8,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,9,0,-1,8,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfc, +}; + +static const BitmapCharRec ch173 = {6,1,-1,-4,8,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-1,8,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x24,0x48,0x90,0x48,0x24,0x12, +}; + +static const BitmapCharRec ch171 = {7,7,0,-1,8,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x78,0x88,0x78,0x8,0x70, +}; + +static const BitmapCharRec ch170 = {5,7,-1,-2,8,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,9,0,-1,8,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xd8, +}; + +static const BitmapCharRec ch168 = {5,1,-1,-8,8,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x60,0x90,0x10,0x60,0x90,0x90,0x60,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch167 = {4,10,-2,0,8,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,9,-3,0,8,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch165 = {7,9,0,0,8,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x84,0x78,0x48,0x48,0x78,0x84, +}; + +static const BitmapCharRec ch164 = {6,6,-1,-1,8,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch163 = {7,9,0,0,8,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x20,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch162 = {5,8,-1,-1,8,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,9,-3,0,8,ch161data}; + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x90,0xa8,0x48, +}; + +static const BitmapCharRec ch126 = {5,3,-1,-6,8,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x10,0x10,0x20,0x18,0x20,0x10,0x10,0xe0, +}; + +static const BitmapCharRec ch125 = {5,9,-1,0,8,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,9,-3,0,8,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x38,0x40,0x40,0x20,0xc0,0x20,0x40,0x40,0x38, +}; + +static const BitmapCharRec ch123 = {5,9,-2,0,8,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfc,0x40,0x20,0x10,0x8,0xfc, +}; + +static const BitmapCharRec ch122 = {6,6,-1,0,8,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch121 = {6,8,-1,2,8,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch120 = {6,6,-1,0,8,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x44,0xaa,0x92,0x92,0x82,0x82, +}; + +static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x50,0x50,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,6,-1,0,8,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x74,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch117 = {6,6,-1,0,8,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x38,0x44,0x40,0x40,0x40,0xf8,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {6,8,-1,0,8,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x78,0x84,0x18,0x60,0x84,0x78, +}; + +static const BitmapCharRec ch115 = {6,6,-1,0,8,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x40,0x40,0x40,0x40,0x44,0xb8, +}; + +static const BitmapCharRec ch114 = {6,6,-1,0,8,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x4,0x4,0x4,0x74,0x8c,0x84,0x8c,0x74, +}; + +static const BitmapCharRec ch113 = {6,8,-1,2,8,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xb8,0xc4,0x84,0xc4,0xb8, +}; + +static const BitmapCharRec ch112 = {6,8,-1,2,8,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x78,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch111 = {6,6,-1,0,8,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8, +}; + +static const BitmapCharRec ch110 = {6,6,-1,0,8,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x82,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, +}; + +static const BitmapCharRec ch108 = {5,9,-1,0,8,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x84,0x88,0x90,0xe0,0x90,0x88,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {6,9,-1,0,8,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x18,0x0,0x8, +}; + +static const BitmapCharRec ch106 = {5,10,-1,2,8,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x20, +}; + +static const BitmapCharRec ch105 = {5,8,-1,0,8,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x84,0x84,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {6,9,-1,0,8,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x78,0x84,0x78,0x80,0x70,0x88,0x88,0x74, +}; + +static const BitmapCharRec ch103 = {6,8,-1,2,8,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0xf8,0x40,0x40,0x44,0x38, +}; + +static const BitmapCharRec ch102 = {6,9,-1,0,8,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x78,0x84,0x80,0xfc,0x84,0x78, +}; + +static const BitmapCharRec ch101 = {6,6,-1,0,8,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x74,0x8c,0x84,0x84,0x8c,0x74,0x4,0x4,0x4, +}; + +static const BitmapCharRec ch100 = {6,9,-1,0,8,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x78,0x84,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch99 = {6,6,-1,0,8,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {6,9,-1,0,8,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x74,0x8c,0x84,0x7c,0x4,0x78, +}; + +static const BitmapCharRec ch97 = {6,6,-1,0,8,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x10,0x60,0xe0, +}; + +static const BitmapCharRec ch96 = {4,3,-2,-6,8,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfe, +}; + +static const BitmapCharRec ch95 = {7,1,0,1,8,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x20, +}; + +static const BitmapCharRec ch94 = {5,3,-1,-6,8,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch93 = {4,9,-1,0,8,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {7,9,0,0,8,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, +}; + +static const BitmapCharRec ch91 = {4,9,-2,0,8,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfc,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch90 = {6,9,-1,0,8,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,9,0,0,8,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch88 = {7,9,0,0,8,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch87 = {7,9,0,0,8,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,9,0,0,8,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,9,0,0,8,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x78,0x84,0x4,0x4,0x78,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x84,0x88,0x90,0xa0,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x4,0x78,0x94,0xa4,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch81 = {6,10,-1,1,8,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch79 = {6,9,-1,0,8,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x84,0x84,0x84,0x8c,0x94,0xa4,0xc4,0x84,0x84, +}; + +static const BitmapCharRec ch78 = {6,9,-1,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82, +}; + +static const BitmapCharRec ch77 = {7,9,0,0,8,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xfc,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {6,9,-1,0,8,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x84,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x84, +}; + +static const BitmapCharRec ch75 = {6,9,-1,0,8,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x70,0x88,0x8,0x8,0x8,0x8,0x8,0x8,0x3c, +}; + +static const BitmapCharRec ch74 = {6,9,-1,0,8,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch73 = {5,9,-1,0,8,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch72 = {6,9,-1,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x74,0x8c,0x84,0x9c,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch71 = {6,9,-1,0,8,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfc,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch68 = {7,9,0,0,8,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch67 = {6,9,-1,0,8,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch66 = {7,9,0,0,8,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x48,0x30, +}; + +static const BitmapCharRec ch65 = {6,9,-1,0,8,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x78,0x80,0x94,0xac,0xa4,0x9c,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch64 = {6,9,-1,0,8,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x10,0x0,0x10,0x10,0x8,0x4,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch63 = {6,9,-1,0,8,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x10,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {5,9,-1,0,8,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfc,0x0,0x0,0xfc, +}; + +static const BitmapCharRec ch61 = {6,4,-1,-2,8,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x8,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x8, +}; + +static const BitmapCharRec ch60 = {5,9,-2,0,8,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x60,0x70,0x0,0x0,0x20,0x70,0x20, +}; + +static const BitmapCharRec ch59 = {4,8,-1,1,8,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x40,0xe0,0x40,0x0,0x0,0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch58 = {3,8,-2,1,8,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x8,0x4,0x4,0x74,0x8c,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch57 = {6,9,-1,0,8,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x78,0x84,0x84,0x84,0x78,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch56 = {6,9,-1,0,8,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch55 = {6,9,-1,0,8,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x78,0x84,0x84,0xc4,0xb8,0x80,0x80,0x40,0x38, +}; + +static const BitmapCharRec ch54 = {6,9,-1,0,8,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x78,0x84,0x4,0x4,0xc4,0xb8,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch53 = {6,9,-1,0,8,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x8,0x8,0xfc,0x88,0x88,0x48,0x28,0x18,0x8, +}; + +static const BitmapCharRec ch52 = {6,9,-1,0,8,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x78,0x84,0x4,0x4,0x38,0x10,0x8,0x4,0xfc, +}; + +static const BitmapCharRec ch51 = {6,9,-1,0,8,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xfc,0x80,0x40,0x30,0x8,0x4,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch50 = {6,9,-1,0,8,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, +}; + +static const BitmapCharRec ch49 = {5,9,-1,0,8,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30, +}; + +static const BitmapCharRec ch48 = {6,9,-1,0,8,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2, +}; + +static const BitmapCharRec ch47 = {7,9,0,0,8,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x40,0xe0,0x40, +}; + +static const BitmapCharRec ch46 = {3,3,-2,1,8,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xfc, +}; + +static const BitmapCharRec ch45 = {6,1,-1,-4,8,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x60,0x70, +}; + +static const BitmapCharRec ch44 = {4,3,-1,1,8,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,-1,-2,8,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x48,0x30,0xfc,0x30,0x48, +}; + +static const BitmapCharRec ch42 = {6,5,-1,-2,8,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,9,-2,0,8,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,9,-3,0,8,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x60,0x70, +}; + +static const BitmapCharRec ch39 = {4,3,-1,-6,8,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x74,0x88,0x94,0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch38 = {6,7,-1,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x88,0x54,0x48,0x20,0x10,0x10,0x48,0xa4,0x44, +}; + +static const BitmapCharRec ch37 = {6,9,-1,0,8,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0xf0,0x28,0x70,0xa0,0x78,0x20, +}; + +static const BitmapCharRec ch36 = {5,7,-1,-1,8,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x48,0x48,0xfc,0x48,0xfc,0x48,0x48, +}; + +static const BitmapCharRec ch35 = {6,7,-1,-1,8,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0x90, +}; + +static const BitmapCharRec ch34 = {4,3,-2,-6,8,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,9,-3,0,8,ch33data}; + +/* char: 0x1f */ + +static const GLubyte ch31data[] = { +0x80, +}; + +static const BitmapCharRec ch31 = {1,1,-3,-3,8,ch31data}; + +/* char: 0x1e */ + +static const GLubyte ch30data[] = { +0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch30 = {7,9,0,0,8,ch30data}; + +/* char: 0x1d */ + +static const GLubyte ch29data[] = { +0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, +}; + +static const BitmapCharRec ch29 = {7,7,0,0,8,ch29data}; + +/* char: 0x1c */ + +static const GLubyte ch28data[] = { +0x88,0x48,0x48,0x48,0x48,0xfc, +}; + +static const BitmapCharRec ch28 = {6,6,-1,0,8,ch28data}; + +/* char: 0x1b */ + +static const GLubyte ch27data[] = { +0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80, +}; + +static const BitmapCharRec ch27 = {7,8,0,0,8,ch27data}; + +/* char: 0x1a */ + +static const GLubyte ch26data[] = { +0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2, +}; + +static const BitmapCharRec ch26 = {7,8,0,0,8,ch26data}; + +/* char: 0x19 */ + +static const GLubyte ch25data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch25 = {1,13,-3,2,8,ch25data}; + +/* char: 0x18 */ + +static const GLubyte ch24data[] = { +0x10,0x10,0x10,0x10,0x10,0xff, +}; + +static const BitmapCharRec ch24 = {8,6,0,2,8,ch24data}; + +/* char: 0x17 */ + +static const GLubyte ch23data[] = { +0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch23 = {8,8,0,-3,8,ch23data}; + +/* char: 0x16 */ + +static const GLubyte ch22data[] = { +0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch22 = {4,13,0,2,8,ch22data}; + +/* char: 0x15 */ + +static const GLubyte ch21data[] = { +0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch21 = {5,13,-3,2,8,ch21data}; + +/* char: 0x14 */ + +static const GLubyte ch20data[] = { +0xff, +}; + +static const BitmapCharRec ch20 = {8,1,0,1,8,ch20data}; + +/* char: 0x13 */ + +static const GLubyte ch19data[] = { +0xff, +}; + +static const BitmapCharRec ch19 = {8,1,0,-1,8,ch19data}; + +/* char: 0x12 */ + +static const GLubyte ch18data[] = { +0xff, +}; + +static const BitmapCharRec ch18 = {8,1,0,-3,8,ch18data}; + +/* char: 0x11 */ + +static const GLubyte ch17data[] = { +0xff, +}; + +static const BitmapCharRec ch17 = {8,1,0,-5,8,ch17data}; + +/* char: 0x10 */ + +static const GLubyte ch16data[] = { +0xff, +}; + +static const BitmapCharRec ch16 = {8,1,0,-7,8,ch16data}; + +/* char: 0xf */ + +static const GLubyte ch15data[] = { +0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch15 = {8,13,0,2,8,ch15data}; + +/* char: 0xe */ + +static const GLubyte ch14data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch14 = {5,8,-3,-3,8,ch14data}; + +/* char: 0xd */ + +static const GLubyte ch13data[] = { +0x80,0x80,0x80,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch13 = {5,6,-3,2,8,ch13data}; + +/* char: 0xc */ + +static const GLubyte ch12data[] = { +0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch12 = {4,6,0,2,8,ch12data}; + +/* char: 0xb */ + +static const GLubyte ch11data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch11 = {4,8,0,-3,8,ch11data}; + +/* char: 0xa */ + +static const GLubyte ch10data[] = { +0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch10 = {7,9,0,2,8,ch10data}; + +/* char: 0x9 */ + +static const GLubyte ch9data[] = { +0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, +}; + +static const BitmapCharRec ch9 = {7,9,0,2,8,ch9data}; + +/* char: 0x8 */ + +static const GLubyte ch8data[] = { +0xfe,0x10,0x10,0xfe,0x10,0x10, +}; + +static const BitmapCharRec ch8 = {7,6,0,0,8,ch8data}; + +/* char: 0x7 */ + +static const GLubyte ch7data[] = { +0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch7 = {5,4,-1,-5,8,ch7data}; + +/* char: 0x6 */ + +static const GLubyte ch6data[] = { +0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch6 = {7,9,0,2,8,ch6data}; + +/* char: 0x5 */ + +static const GLubyte ch5data[] = { +0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78, +}; + +static const BitmapCharRec ch5 = {7,9,0,2,8,ch5data}; + +/* char: 0x4 */ + +static const GLubyte ch4data[] = { +0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0, +}; + +static const BitmapCharRec ch4 = {7,9,0,2,8,ch4data}; + +/* char: 0x3 */ + +static const GLubyte ch3data[] = { +0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88, +}; + +static const BitmapCharRec ch3 = {7,9,0,2,8,ch3data}; + +/* char: 0x2 */ + +static const GLubyte ch2data[] = { +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +}; + +static const BitmapCharRec ch2 = {8,12,0,2,8,ch2data}; + +/* char: 0x1 */ + +static const GLubyte ch1data[] = { +0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, +}; + +static const BitmapCharRec ch1 = {7,7,0,-1,8,ch1data}; + +static const BitmapCharRec * const chars[] = { +&ch0, +&ch1, +&ch2, +&ch3, +&ch4, +&ch5, +&ch6, +&ch7, +&ch8, +&ch9, +&ch10, +&ch11, +&ch12, +&ch13, +&ch14, +&ch15, +&ch16, +&ch17, +&ch18, +&ch19, +&ch20, +&ch21, +&ch22, +&ch23, +&ch24, +&ch25, +&ch26, +&ch27, +&ch28, +&ch29, +&ch30, +&ch31, +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +&ch127, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +#if !defined(__IBMCPP__) +const +#endif +BitmapFontRec glutBitmap8By13 = { +"-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1", +256, +0, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_9x15.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_9x15.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_9x15.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_9x15.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2077 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmap9By15 XXX +#include "glutbitmap.h" +#undef glutBitmap9By15 + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch0data[] = { 0x0 }; +static const BitmapCharRec ch0 = {1,1,0,0,9,ch0data}; +#else +static const BitmapCharRec ch0 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,9,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch127data[] = { 0x0 }; +static const BitmapCharRec ch127 = {1,1,0,0,9,ch127data}; +#else +static const BitmapCharRec ch127 = {0,0,0,0,9,0}; +#endif + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,9,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,9,0}; +#endif + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch255 = {6,14,-1,3,9,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {7,12,-1,3,9,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch253 = {6,14,-1,3,9,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch252 = {7,11,-1,0,9,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch251 = {7,11,-1,0,9,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch250 = {7,11,-1,0,9,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch249 = {7,11,-1,0,9,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x80,0x7c,0xa2,0xa2,0x92,0x8a,0x8a,0x7c,0x2, +}; + +static const BitmapCharRec ch248 = {7,9,-1,1,9,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x10,0x38,0x10,0x0,0xfe,0x0,0x10,0x38,0x10, +}; + +static const BitmapCharRec ch247 = {7,9,-1,0,9,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch246 = {7,11,-1,0,9,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {7,11,-1,0,9,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch244 = {7,11,-1,0,9,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch243 = {7,11,-1,0,9,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch242 = {7,11,-1,0,9,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {7,11,-1,0,9,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x8,0x50,0x30,0x48, +}; + +static const BitmapCharRec ch240 = {7,11,-1,0,9,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch239 = {5,11,-2,0,9,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x90,0x60, +}; + +static const BitmapCharRec ch238 = {5,11,-2,0,9,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60,0x10, +}; + +static const BitmapCharRec ch237 = {5,11,-2,0,9,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x30,0x40, +}; + +static const BitmapCharRec ch236 = {5,11,-2,0,9,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch235 = {7,11,-1,0,9,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch234 = {7,11,-1,0,9,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch233 = {7,11,-1,0,9,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch232 = {7,11,-1,0,9,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch231 = {7,10,-1,3,9,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6e,0x92,0x90,0x7c,0x12,0x92,0x6c, +}; + +static const BitmapCharRec ch230 = {7,7,-1,0,9,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x18,0x24,0x18, +}; + +static const BitmapCharRec ch229 = {7,11,-1,0,9,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch228 = {7,11,-1,0,9,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {7,11,-1,0,9,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch226 = {7,11,-1,0,9,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch225 = {7,11,-1,0,9,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch224 = {7,11,-1,0,9,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0x80,0xbc,0xc2,0x82,0x82,0xfc,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch223 = {7,9,-1,1,9,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {7,10,-1,0,9,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch221 = {7,11,-1,0,9,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch220 = {7,11,-1,0,9,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch219 = {7,11,-1,0,9,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch218 = {7,11,-1,0,9,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch217 = {7,11,-1,0,9,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x7c,0xc2,0xa2,0xa2,0x92,0x92,0x8a,0x8a,0x86,0x7c,0x2, +}; + +static const BitmapCharRec ch216 = {7,12,-1,1,9,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x82,0x44,0x28,0x10,0x28,0x44,0x82, +}; + +static const BitmapCharRec ch215 = {7,7,-1,-1,9,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch214 = {7,11,-1,0,9,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {7,11,-1,0,9,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch212 = {7,11,-1,0,9,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch211 = {7,11,-1,0,9,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch210 = {7,11,-1,0,9,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x92,0x92,0xa2,0xc2,0x82,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {7,11,-1,0,9,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0xfc,0x42,0x42,0x42,0x42,0xf2,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch208 = {7,10,-1,0,9,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, +}; + +static const BitmapCharRec ch207 = {5,11,-2,0,9,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x88,0x70, +}; + +static const BitmapCharRec ch206 = {5,11,-2,0,9,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x60,0x10, +}; + +static const BitmapCharRec ch205 = {5,11,-2,0,9,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x30,0x40, +}; + +static const BitmapCharRec ch204 = {5,11,-2,0,9,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch203 = {7,11,-1,0,9,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch202 = {7,11,-1,0,9,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch201 = {7,11,-1,0,9,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch200 = {7,11,-1,0,9,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch199 = {7,13,-1,3,9,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x9e,0x90,0x90,0x90,0xfc,0x90,0x90,0x90,0x90,0x6e, +}; + +static const BitmapCharRec ch198 = {7,10,-1,0,9,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,11,-1,0,9,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x28,0x28, +}; + +static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch195 = {7,11,-1,0,9,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x44,0x38, +}; + +static const BitmapCharRec ch194 = {7,11,-1,0,9,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x30,0x8, +}; + +static const BitmapCharRec ch193 = {7,11,-1,0,9,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x18,0x20, +}; + +static const BitmapCharRec ch192 = {7,11,-1,0,9,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x7c,0x82,0x82,0x80,0x40,0x20,0x10,0x10,0x0,0x10, +}; + +static const BitmapCharRec ch191 = {7,10,-1,0,9,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch190 = {7,10,-1,0,9,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch189 = {7,10,-1,0,9,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch188 = {7,10,-1,0,9,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0x48,0x24,0x12,0x12,0x24,0x48,0x90, +}; + +static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf8,0x0,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch186 = {5,6,-1,-5,9,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xe0,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {3,6,-1,-4,9,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0x60,0x90,0x30, +}; + +static const BitmapCharRec ch184 = {4,3,-2,3,9,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-4,-4,9,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0xa,0xa,0xa,0xa,0xa,0x7a,0x8a,0x8a,0x8a,0x7e, +}; + +static const BitmapCharRec ch182 = {7,10,-1,0,9,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xba,0xc6,0x82,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch181 = {7,9,-1,2,9,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0xc0,0x20, +}; + +static const BitmapCharRec ch180 = {3,2,-3,-9,9,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x60,0x90,0x10,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch179 = {4,6,-1,-4,9,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x80,0x60,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,6,-1,-4,9,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xfe,0x0,0x10,0x10,0x10,0xfe,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch177 = {7,9,-1,-1,9,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,-3,-6,9,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc, +}; + +static const BitmapCharRec ch175 = {6,1,-1,-9,9,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x3c,0x42,0xa5,0xa9,0xbd,0xa5,0xb9,0x42,0x3c, +}; + +static const BitmapCharRec ch174 = {8,9,0,-1,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfc, +}; + +static const BitmapCharRec ch173 = {6,1,-1,-4,9,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-2,9,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x24,0x48,0x90,0x90,0x48,0x24,0x12, +}; + +static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x78,0x90,0x70,0x90,0x60, +}; + +static const BitmapCharRec ch170 = {5,7,-3,-3,9,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x3c,0x42,0x99,0xa5,0xa1,0xa5,0x99,0x42,0x3c, +}; + +static const BitmapCharRec ch169 = {8,9,0,-1,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch168 = {3,2,-3,-9,9,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x8,0x70,0x88,0x88,0x88,0x70,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,11,-2,1,9,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,11,-4,1,9,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x10,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch165 = {7,10,-1,0,9,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x82,0x7c,0x44,0x44,0x7c,0x82, +}; + +static const BitmapCharRec ch164 = {7,6,-1,-3,9,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch163 = {7,10,-1,0,9,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x78,0xa4,0xa0,0x90,0x94,0x78,0x8, +}; + +static const BitmapCharRec ch162 = {6,8,-1,0,9,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80, +}; + +static const BitmapCharRec ch161 = {1,11,-4,0,9,ch161data}; + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x8c,0x92,0x62, +}; + +static const BitmapCharRec ch126 = {7,3,-1,-7,9,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x10,0x10,0x10,0x20,0x18,0x18,0x20,0x10,0x10,0x10,0xe0, +}; + +static const BitmapCharRec ch125 = {5,12,-1,1,9,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,12,-4,1,9,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x38,0x40,0x40,0x40,0x20,0xc0,0xc0,0x20,0x40,0x40,0x40,0x38, +}; + +static const BitmapCharRec ch123 = {5,12,-3,1,9,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfe,0x40,0x20,0x10,0x8,0x4,0xfe, +}; + +static const BitmapCharRec ch122 = {7,7,-1,0,9,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch121 = {6,10,-1,3,9,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x82,0x44,0x28,0x10,0x28,0x44,0x82, +}; + +static const BitmapCharRec ch120 = {7,7,-1,0,9,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x44,0xaa,0x92,0x92,0x92,0x82,0x82, +}; + +static const BitmapCharRec ch119 = {7,7,-1,0,9,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x10,0x28,0x28,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch118 = {7,7,-1,0,9,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x7a,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch117 = {7,7,-1,0,9,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x1c,0x22,0x20,0x20,0x20,0x20,0xfc,0x20,0x20, +}; + +static const BitmapCharRec ch116 = {7,9,-1,0,9,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x7c,0x82,0x2,0x7c,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch115 = {7,7,-1,0,9,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x40,0x40,0x40,0x40,0x42,0x62,0x9c, +}; + +static const BitmapCharRec ch114 = {7,7,-1,0,9,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x2,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x86,0x7a, +}; + +static const BitmapCharRec ch113 = {7,10,-1,3,9,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc, +}; + +static const BitmapCharRec ch112 = {7,10,-1,3,9,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch111 = {7,7,-1,0,9,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc, +}; + +static const BitmapCharRec ch110 = {7,7,-1,0,9,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x82,0x92,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0, +}; + +static const BitmapCharRec ch108 = {5,10,-2,0,9,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x82,0x8c,0xb0,0xc0,0xb0,0x8c,0x82,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {7,10,-1,0,9,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x78,0x84,0x84,0x84,0x4,0x4,0x4,0x4,0x4,0x1c,0x0,0x0,0xc, +}; + +static const BitmapCharRec ch106 = {6,13,-1,3,9,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60, +}; + +static const BitmapCharRec ch105 = {5,10,-2,0,9,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {7,10,-1,0,9,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x7c,0x82,0x82,0x7c,0x80,0x78,0x84,0x84,0x84,0x7a, +}; + +static const BitmapCharRec ch103 = {7,10,-1,3,9,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x20,0x20,0x20,0x20,0xf8,0x20,0x20,0x22,0x22,0x1c, +}; + +static const BitmapCharRec ch102 = {7,10,-1,0,9,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch101 = {7,7,-1,0,9,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x7a,0x86,0x82,0x82,0x82,0x86,0x7a,0x2,0x2,0x2, +}; + +static const BitmapCharRec ch100 = {7,10,-1,0,9,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch99 = {7,7,-1,0,9,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {7,10,-1,0,9,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c, +}; + +static const BitmapCharRec ch97 = {7,7,-1,0,9,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x10,0x20,0x40,0xc0, +}; + +static const BitmapCharRec ch96 = {4,4,-3,-6,9,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff, +}; + +static const BitmapCharRec ch95 = {8,1,0,1,9,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x82,0x44,0x28,0x10, +}; + +static const BitmapCharRec ch94 = {7,4,-1,-6,9,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, +}; + +static const BitmapCharRec ch93 = {4,12,-2,1,9,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x2,0x4,0x4,0x8,0x10,0x10,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch92 = {7,10,-1,0,9,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, +}; + +static const BitmapCharRec ch91 = {4,12,-3,1,9,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfe,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch90 = {7,10,-1,0,9,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,10,-1,0,9,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x82,0x44,0x28,0x10,0x10,0x28,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch88 = {7,10,-1,0,9,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x44,0xaa,0x92,0x92,0x92,0x92,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch87 = {7,10,-1,0,9,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,10,-1,0,9,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch85 = {7,10,-1,0,9,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,10,-1,0,9,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x7c,0x82,0x82,0x2,0xc,0x70,0x80,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch83 = {7,10,-1,0,9,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x82,0x82,0x84,0x88,0x90,0xfc,0x82,0x82,0x82,0xfc, +}; + +static const BitmapCharRec ch82 = {7,10,-1,0,9,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x6,0x8,0x7c,0x92,0xa2,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch81 = {7,12,-1,2,9,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc, +}; + +static const BitmapCharRec ch80 = {7,10,-1,0,9,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch79 = {7,10,-1,0,9,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x82,0x82,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x82, +}; + +static const BitmapCharRec ch78 = {7,10,-1,0,9,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x82,0x82,0x82,0x92,0x92,0xaa,0xaa,0xc6,0x82,0x82, +}; + +static const BitmapCharRec ch77 = {7,10,-1,0,9,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xfe,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {7,10,-1,0,9,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x82,0x84,0x88,0x90,0xa0,0xe0,0x90,0x88,0x84,0x82, +}; + +static const BitmapCharRec ch75 = {7,10,-1,0,9,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x78,0x84,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x1e, +}; + +static const BitmapCharRec ch74 = {7,10,-1,0,9,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch73 = {5,10,-2,0,9,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x82,0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch72 = {7,10,-1,0,9,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x7c,0x82,0x82,0x82,0x8e,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch71 = {7,10,-1,0,9,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x40,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, +}; + +static const BitmapCharRec ch70 = {7,10,-1,0,9,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfe,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, +}; + +static const BitmapCharRec ch69 = {7,10,-1,0,9,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch68 = {7,10,-1,0,9,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, +}; + +static const BitmapCharRec ch67 = {7,10,-1,0,9,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xfc,0x42,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, +}; + +static const BitmapCharRec ch66 = {7,10,-1,0,9,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x44,0x28,0x10, +}; + +static const BitmapCharRec ch65 = {7,10,-1,0,9,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x7c,0x80,0x80,0x9a,0xa6,0xa2,0x9e,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch64 = {7,10,-1,0,9,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x10,0x0,0x10,0x10,0x8,0x4,0x2,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch63 = {7,10,-1,0,9,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {5,10,-2,0,9,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfe,0x0,0x0,0xfe, +}; + +static const BitmapCharRec ch61 = {7,4,-1,-2,9,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x8,0x10,0x20,0x40,0x80,0x80,0x40,0x20,0x10,0x8, +}; + +static const BitmapCharRec ch60 = {5,10,-2,0,9,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {2,10,-4,3,9,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,7,-4,0,9,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x78,0x4,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch57 = {7,10,-1,0,9,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch56 = {7,10,-1,0,9,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x8,0x4,0x2,0x2,0xfe, +}; + +static const BitmapCharRec ch55 = {7,10,-1,0,9,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x7c,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x40,0x3c, +}; + +static const BitmapCharRec ch54 = {7,10,-1,0,9,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7c,0x82,0x2,0x2,0x2,0xc2,0xbc,0x80,0x80,0xfe, +}; + +static const BitmapCharRec ch53 = {7,10,-1,0,9,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x4,0x4,0x4,0xfe,0x84,0x44,0x24,0x14,0xc,0x4, +}; + +static const BitmapCharRec ch52 = {7,10,-1,0,9,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x7c,0x82,0x2,0x2,0x2,0x1c,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch51 = {7,10,-1,0,9,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xfe,0x80,0x40,0x30,0x8,0x4,0x2,0x82,0x82,0x7c, +}; + +static const BitmapCharRec ch50 = {7,10,-1,0,9,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xfe,0x10,0x10,0x10,0x10,0x10,0x90,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch49 = {7,10,-1,0,9,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch48 = {7,10,-1,0,9,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x40,0x40,0x20,0x10,0x10,0x8,0x4,0x4,0x2, +}; + +static const BitmapCharRec ch47 = {7,10,-1,0,9,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-4,0,9,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xfe, +}; + +static const BitmapCharRec ch45 = {7,1,-1,-4,9,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch44 = {2,5,-4,3,9,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x10,0x10,0x10,0xfe,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch43 = {7,7,-1,-1,9,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x10,0x92,0x54,0x38,0x54,0x92,0x10, +}; + +static const BitmapCharRec ch42 = {7,7,-1,-1,9,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,12,-3,1,9,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,12,-3,1,9,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x20,0x30, +}; + +static const BitmapCharRec ch39 = {4,4,-3,-6,9,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x62,0x94,0x88,0x94,0x62,0x60,0x90,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch38 = {7,10,-1,0,9,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x84,0x4a,0x4a,0x24,0x10,0x10,0x48,0xa4,0xa4,0x42, +}; + +static const BitmapCharRec ch37 = {7,10,-1,0,9,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x10,0x7c,0x92,0x12,0x12,0x14,0x38,0x50,0x90,0x92,0x7c,0x10, +}; + +static const BitmapCharRec ch36 = {7,12,-1,1,9,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48, +}; + +static const BitmapCharRec ch35 = {6,8,-1,-1,9,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0x90, +}; + +static const BitmapCharRec ch34 = {4,3,-3,-7,9,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,11,-4,0,9,ch33data}; + +/* char: 0x1f */ + +static const GLubyte ch31data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch31 = {2,2,-4,-2,9,ch31data}; + +/* char: 0x1e */ + +static const GLubyte ch30data[] = { +0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, +}; + +static const BitmapCharRec ch30 = {7,10,-1,0,9,ch30data}; + +/* char: 0x1d */ + +static const GLubyte ch29data[] = { +0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, +}; + +static const BitmapCharRec ch29 = {7,7,-1,0,9,ch29data}; + +/* char: 0x1c */ + +static const GLubyte ch28data[] = { +0x44,0x24,0x24,0x24,0x24,0x24,0xfe, +}; + +static const BitmapCharRec ch28 = {7,7,-1,0,9,ch28data}; + +/* char: 0x1b */ + +static const GLubyte ch27data[] = { +0xfe,0x0,0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch27 = {7,12,-1,2,9,ch27data}; + +/* char: 0x1a */ + +static const GLubyte ch26data[] = { +0xfc,0x0,0x4,0x8,0x10,0x20,0x40,0x40,0x20,0x10,0x8,0x4, +}; + +static const BitmapCharRec ch26 = {6,12,-2,2,9,ch26data}; + +/* char: 0x19 */ + +static const GLubyte ch25data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch25 = {1,15,-4,3,9,ch25data}; + +/* char: 0x18 */ + +static const GLubyte ch24data[] = { +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80, +}; + +static const BitmapCharRec ch24 = {9,7,0,3,9,ch24data}; + +/* char: 0x17 */ + +static const GLubyte ch23data[] = { +0xff,0x80,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch23 = {9,9,0,-3,9,ch23data}; + +/* char: 0x16 */ + +static const GLubyte ch22data[] = { +0x8,0x8,0x8,0x8,0x8,0x8,0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch22 = {5,15,0,3,9,ch22data}; + +/* char: 0x15 */ + +static const GLubyte ch21data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch21 = {5,15,-4,3,9,ch21data}; + +/* char: 0x14 */ + +static const GLubyte ch20data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch20 = {9,1,0,1,9,ch20data}; + +/* char: 0x13 */ + +static const GLubyte ch19data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch19 = {9,1,0,-1,9,ch19data}; + +/* char: 0x12 */ + +static const GLubyte ch18data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch18 = {9,1,0,-3,9,ch18data}; + +/* char: 0x11 */ + +static const GLubyte ch17data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch17 = {9,1,0,-5,9,ch17data}; + +/* char: 0x10 */ + +static const GLubyte ch16data[] = { +0xff,0x80, +}; + +static const BitmapCharRec ch16 = {9,1,0,-7,9,ch16data}; + +/* char: 0xf */ + +static const GLubyte ch15data[] = { +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0, +0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, +}; + +static const BitmapCharRec ch15 = {9,15,0,3,9,ch15data}; + +/* char: 0xe */ + +static const GLubyte ch14data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch14 = {5,9,-4,-3,9,ch14data}; + +/* char: 0xd */ + +static const GLubyte ch13data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch13 = {5,7,-4,3,9,ch13data}; + +/* char: 0xc */ + +static const GLubyte ch12data[] = { +0x8,0x8,0x8,0x8,0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch12 = {5,7,0,3,9,ch12data}; + +/* char: 0xb */ + +static const GLubyte ch11data[] = { +0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch11 = {5,9,0,-3,9,ch11data}; + +/* char: 0xa */ + +static const GLubyte ch10data[] = { +0x8,0x8,0x8,0x8,0x3e,0x0,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch10 = {7,10,-1,2,9,ch10data}; + +/* char: 0x9 */ + +static const GLubyte ch9data[] = { +0x3e,0x20,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, +}; + +static const BitmapCharRec ch9 = {7,10,-1,2,9,ch9data}; + +/* char: 0x8 */ + +static const GLubyte ch8data[] = { +0xfe,0x10,0x10,0xfe,0x10,0x10, +}; + +static const BitmapCharRec ch8 = {7,6,-1,0,9,ch8data}; + +/* char: 0x7 */ + +static const GLubyte ch7data[] = { +0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch7 = {5,4,-2,-6,9,ch7data}; + +/* char: 0x6 */ + +static const GLubyte ch6data[] = { +0x20,0x20,0x3c,0x20,0x3e,0x0,0xf8,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch6 = {7,10,-1,2,9,ch6data}; + +/* char: 0x5 */ + +static const GLubyte ch5data[] = { +0x22,0x22,0x3c,0x22,0x3c,0x0,0x78,0x80,0x80,0x78, +}; + +static const BitmapCharRec ch5 = {7,10,-1,2,9,ch5data}; + +/* char: 0x4 */ + +static const GLubyte ch4data[] = { +0x10,0x10,0x1c,0x10,0x1e,0x80,0x80,0xe0,0x80,0xf0, +}; + +static const BitmapCharRec ch4 = {7,10,-1,2,9,ch4data}; + +/* char: 0x3 */ + +static const GLubyte ch3data[] = { +0x8,0x8,0x8,0x3e,0x0,0x88,0x88,0xf8,0x88,0x88, +}; + +static const BitmapCharRec ch3 = {7,10,-1,2,9,ch3data}; + +/* char: 0x2 */ + +static const GLubyte ch2data[] = { +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +}; + +static const BitmapCharRec ch2 = {8,14,0,3,9,ch2data}; + +/* char: 0x1 */ + +static const GLubyte ch1data[] = { +0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, +}; + +static const BitmapCharRec ch1 = {7,7,-1,0,9,ch1data}; + +static const BitmapCharRec * const chars[] = { +&ch0, +&ch1, +&ch2, +&ch3, +&ch4, +&ch5, +&ch6, +&ch7, +&ch8, +&ch9, +&ch10, +&ch11, +&ch12, +&ch13, +&ch14, +&ch15, +&ch16, +&ch17, +&ch18, +&ch19, +&ch20, +&ch21, +&ch22, +&ch23, +&ch24, +&ch25, +&ch26, +&ch27, +&ch28, +&ch29, +&ch30, +&ch31, +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +&ch127, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; +#if !defined(__IBMCPP__) +const +#endif + BitmapFontRec glutBitmap9By15 = { +"-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1", +256, +0, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_bitmap.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_bitmap.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_bitmap.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_bitmap.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutbitmap.h" + +void GLUTAPIENTRY +glutBitmapCharacter(GLUTbitmapFont font, int c) +{ + const BitmapCharRec *ch; + BitmapFontPtr fontinfo; + GLint swapbytes, lsbfirst, rowlength; + GLint skiprows, skippixels, alignment; + +#if defined(_WIN32) + fontinfo = (BitmapFontPtr) __glutFont(font); +#else + fontinfo = (BitmapFontPtr) font; +#endif + + if (c < fontinfo->first || + c >= fontinfo->first + fontinfo->num_chars) + return; + ch = fontinfo->ch[c - fontinfo->first]; + if (ch) { + /* Save current modes. */ + 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); + /* Little endian machines (DEC Alpha for example) could + benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE + instead of GL_FALSE, but this would require changing the + generated bitmaps too. */ + 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); + glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, + ch->advance, 0, ch->bitmap); + /* Restore saved 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 -Nru xpsb-glx-0.19/mesa/src/glut/os2/glutbitmap.h xpsb-glx-0.19/mesa/src/glut/os2/glutbitmap.h --- xpsb-glx-0.19/mesa/src/glut/os2/glutbitmap.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glutbitmap.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,32 @@ +#ifndef __glutbitmap_h__ +#define __glutbitmap_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#define GLUT_NO_LIB_PRAGMA /* Avoid auto library linking when building + the GLUT library itself. */ +#include + +typedef struct { + const GLsizei width; + const GLsizei height; + const GLfloat xorig; + const GLfloat yorig; + const GLfloat advance; + const GLubyte *bitmap; +} BitmapCharRec, *BitmapCharPtr; + +typedef struct { + const char *name; + const int num_chars; + const int first; + const BitmapCharRec * const *ch; +} BitmapFontRec, *BitmapFontPtr; + +typedef void *GLUTbitmapFont; + +#endif /* __glutbitmap_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_cindex.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_cindex.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_cindex.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_cindex.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,258 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include "glutint.h" + +#if defined(__OS2PM__) + #define IsWindowVisible WinIsWindowVisible +#endif + +#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i))) + +/* CENTRY */ +void GLUTAPIENTRY +glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ + GLUTcolormap *cmap, *newcmap; + XVisualInfo *vis; + XColor color; + int i; + + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + cmap = __glutCurrentWindow->colormap; + vis = __glutCurrentWindow->vis; + } else { + cmap = __glutCurrentWindow->overlay->colormap; + vis = __glutCurrentWindow->overlay->vis; + if (ndx == __glutCurrentWindow->overlay->transparentPixel) { + __glutWarning( + "glutSetColor: cannot set color of overlay transparent index %d\n", + ndx); + return; + } + } + + if (!cmap) { + __glutWarning("glutSetColor: current window is RGBA"); + return; + } +#if defined(_WIN32) || defined(__OS2PM__) + if (ndx >= 256 || /* always assume 256 colors on Win32 */ +#else + if (ndx >= vis->visual->map_entries || +#endif + ndx < 0) { + __glutWarning("glutSetColor: index %d out of range", ndx); + return; + } + if (cmap->refcnt > 1) { + newcmap = __glutAssociateNewColormap(vis); + cmap->refcnt--; + /* Wouldn't it be nice if XCopyColormapAndFree could be + told not to free the old colormap's entries! */ + for (i = cmap->size - 1; i >= 0; i--) { + if (i == ndx) { + /* We are going to set this cell shortly! */ + continue; + } + if (cmap->cells[i].component[GLUT_RED] >= 0.0) { + color.pixel = i; + newcmap->cells[i].component[GLUT_RED] = + cmap->cells[i].component[GLUT_RED]; + color.red = (GLfloat) 0xffff * + cmap->cells[i].component[GLUT_RED]; + newcmap->cells[i].component[GLUT_GREEN] = + cmap->cells[i].component[GLUT_GREEN]; + color.green = (GLfloat) 0xffff * + cmap->cells[i].component[GLUT_GREEN]; + newcmap->cells[i].component[GLUT_BLUE] = + cmap->cells[i].component[GLUT_BLUE]; + color.blue = (GLfloat) 0xffff * + cmap->cells[i].component[GLUT_BLUE]; + color.flags = DoRed | DoGreen | DoBlue; +#if defined(_WIN32) || defined(__OS2PM__) + if (IsWindowVisible(__glutCurrentWindow->win)) { + XHDC = __glutCurrentWindow->hdc; + } else { + XHDC = 0; + } +#endif + XStoreColor(__glutDisplay, newcmap->cmap, &color); + } else { + /* Leave unallocated entries unallocated. */ + } + } + cmap = newcmap; + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + __glutCurrentWindow->colormap = cmap; + __glutCurrentWindow->cmap = cmap->cmap; + } else { + __glutCurrentWindow->overlay->colormap = cmap; + __glutCurrentWindow->overlay->cmap = cmap->cmap; + } + XSetWindowColormap(__glutDisplay, + __glutCurrentWindow->renderWin, cmap->cmap); + +#if !defined(_WIN32) && !defined(__OS2PM__) + { + GLUTwindow *toplevel; + + toplevel = __glutToplevelOf(__glutCurrentWindow); + if (toplevel->cmap != cmap->cmap) { + __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); + } + } +#endif + } + color.pixel = ndx; + red = CLAMP(red); + cmap->cells[ndx].component[GLUT_RED] = red; + color.red = (GLfloat) 0xffff *red; + green = CLAMP(green); + cmap->cells[ndx].component[GLUT_GREEN] = green; + color.green = (GLfloat) 0xffff *green; + blue = CLAMP(blue); + cmap->cells[ndx].component[GLUT_BLUE] = blue; + color.blue = (GLfloat) 0xffff *blue; + color.flags = DoRed | DoGreen | DoBlue; +#if defined(_WIN32) || defined(__OS2PM__) + if (IsWindowVisible(__glutCurrentWindow->win)) { + XHDC = __glutCurrentWindow->hdc; + } else { + XHDC = 0; + } +#endif + XStoreColor(__glutDisplay, cmap->cmap, &color); +} + +GLfloat GLUTAPIENTRY +glutGetColor(int ndx, int comp) +{ + GLUTcolormap *colormap; + XVisualInfo *vis; + + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + colormap = __glutCurrentWindow->colormap; + vis = __glutCurrentWindow->vis; + } else { + colormap = __glutCurrentWindow->overlay->colormap; + vis = __glutCurrentWindow->overlay->vis; + if (ndx == __glutCurrentWindow->overlay->transparentPixel) { + __glutWarning("glutGetColor: requesting overlay transparent index %d\n", + ndx); + return -1.0; + } + } + + if (!colormap) { + __glutWarning("glutGetColor: current window is RGBA"); + return -1.0; + } +#if defined(_WIN32) || defined(__OS2PM__) +#define OUT_OF_RANGE_NDX(ndx) (ndx >= 256 || ndx < 0) +#else +#define OUT_OF_RANGE_NDX(ndx) (ndx >= vis->visual->map_entries || ndx < 0) +#endif + if (OUT_OF_RANGE_NDX(ndx)) { + __glutWarning("glutGetColor: index %d out of range", ndx); + return -1.0; + } + return colormap->cells[ndx].component[comp]; +} + +void GLUTAPIENTRY +glutCopyColormap(int winnum) +{ + GLUTwindow *window = __glutWindowList[winnum - 1]; + GLUTcolormap *oldcmap, *newcmap; + XVisualInfo *dstvis; + + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + oldcmap = __glutCurrentWindow->colormap; + dstvis = __glutCurrentWindow->vis; + newcmap = window->colormap; + } else { + oldcmap = __glutCurrentWindow->overlay->colormap; + dstvis = __glutCurrentWindow->overlay->vis; + if (!window->overlay) { + __glutWarning("glutCopyColormap: window %d has no overlay", winnum); + return; + } + newcmap = window->overlay->colormap; + } + + if (!oldcmap) { + __glutWarning("glutCopyColormap: destination colormap must be color index"); + return; + } + if (!newcmap) { + __glutWarning( + "glutCopyColormap: source colormap of window %d must be color index", + winnum); + return; + } + if (newcmap == oldcmap) { + /* Source and destination are the same; now copy needed. */ + return; + } +#if !defined(_WIN32) && !defined(__OS2PM__) + /* Play safe: compare visual IDs, not Visual*'s. */ + if (newcmap->visual->visualid == oldcmap->visual->visualid) { +#endif + /* Visuals match! "Copy" by reference... */ + __glutFreeColormap(oldcmap); + newcmap->refcnt++; + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + __glutCurrentWindow->colormap = newcmap; + __glutCurrentWindow->cmap = newcmap->cmap; + } else { + __glutCurrentWindow->overlay->colormap = newcmap; + __glutCurrentWindow->overlay->cmap = newcmap->cmap; + } + XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin, + newcmap->cmap); +#if !defined(_WIN32) && !defined(__OS2PM__) + __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); +bla bla bla + + } else { + GLUTcolormap *copycmap; + XColor color; + int i, last; + + /* Visuals different - need a distinct X colormap! */ + copycmap = __glutAssociateNewColormap(dstvis); + /* Wouldn't it be nice if XCopyColormapAndFree could be + told not to free the old colormap's entries! */ + last = newcmap->size; + if (last > copycmap->size) { + last = copycmap->size; + } + for (i = last - 1; i >= 0; i--) { + if (newcmap->cells[i].component[GLUT_RED] >= 0.0) { + color.pixel = i; + copycmap->cells[i].component[GLUT_RED] = + newcmap->cells[i].component[GLUT_RED]; + color.red = (GLfloat) 0xffff * + newcmap->cells[i].component[GLUT_RED]; + copycmap->cells[i].component[GLUT_GREEN] = + newcmap->cells[i].component[GLUT_GREEN]; + color.green = (GLfloat) 0xffff * + newcmap->cells[i].component[GLUT_GREEN]; + copycmap->cells[i].component[GLUT_BLUE] = + newcmap->cells[i].component[GLUT_BLUE]; + color.blue = (GLfloat) 0xffff * + newcmap->cells[i].component[GLUT_BLUE]; + color.flags = DoRed | DoGreen | DoBlue; + XStoreColor(__glutDisplay, copycmap->cmap, &color); + } + } + } +#endif +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_cmap.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_cmap.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_cmap.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_cmap.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,399 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +//EK#include +#endif + +#include +#include +#include /* SunOS multithreaded assert() needs . Lame. */ +#include +#if !defined(_WIN32) && !defined(__OS2__) + #include + #include + #include /* for XA_RGB_DEFAULT_MAP atom */ + #if defined(__vms) + #include /* for XmuLookupStandardColormap */ + #else + #include /* for XmuLookupStandardColormap */ + #endif +#endif + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif + +#include "glutint.h" +#include "layerutil.h" + +GLUTcolormap *__glutColormapList = NULL; + +GLUTcolormap * +__glutAssociateNewColormap(XVisualInfo * vis) +{ + GLUTcolormap *cmap; + int transparentPixel, i; + unsigned long pixels[255]; + + cmap = (GLUTcolormap *) malloc(sizeof(GLUTcolormap)); + if (!cmap) + __glutFatalError("out of memory."); +#if defined(_WIN32) || defined(__OS2__) + pixels[0] = 0; /* avoid compilation warnings on win32 */ + cmap->visual = 0; + cmap->size = 256; /* always assume 256 on Win32 */ +#else + cmap->visual = vis->visual; + cmap->size = vis->visual->map_entries; +#endif + cmap->refcnt = 1; + cmap->cells = (GLUTcolorcell *) + malloc(sizeof(GLUTcolorcell) * cmap->size); + if (!cmap->cells) + __glutFatalError("out of memory."); + /* make all color cell entries be invalid */ + for (i = cmap->size - 1; i >= 0; i--) { + cmap->cells[i].component[GLUT_RED] = -1.0; + cmap->cells[i].component[GLUT_GREEN] = -1.0; + cmap->cells[i].component[GLUT_BLUE] = -1.0; + } + transparentPixel = __glutGetTransparentPixel(__glutDisplay, vis); + if (transparentPixel == -1 || transparentPixel >= cmap->size) { + + /* If there is no transparent pixel or if the transparent + pixel is outside the range of valid colormap cells (HP + can implement their overlays this smart way since their + transparent pixel is 255), we can AllocAll the colormap. + See note below. */ + + cmap->cmap = XCreateColormap(__glutDisplay, + __glutRoot, cmap->visual, AllocAll); + } else { + + /* On machines where zero (or some other value in the range + of 0 through map_entries-1), BadAlloc may be generated + when an AllocAll overlay colormap is allocated since the + transparent pixel precludes all the cells in the colormap + being allocated (the transparent pixel is pre-allocated). + So in this case, use XAllocColorCells to allocate + map_entries-1 pixels (that is, all but the transparent + pixel. */ + +#if defined(_WIN32) || defined(__OS2__) + cmap->cmap = XCreateColormap(__glutDisplay, + __glutRoot, 0, AllocNone); +#else + cmap->cmap = XCreateColormap(__glutDisplay, + __glutRoot, vis->visual, AllocNone); + XAllocColorCells(__glutDisplay, cmap->cmap, False, 0, 0, + pixels, cmap->size - 1); +#endif + } + cmap->next = __glutColormapList; + __glutColormapList = cmap; + return cmap; +} + +static GLUTcolormap * +associateColormap(XVisualInfo * vis) +{ +#if !defined(_WIN32) && !defined(__OS2__) + GLUTcolormap *cmap = __glutColormapList; + + while (cmap != NULL) { + /* Play safe: compare visual IDs, not Visual*'s. */ + if (cmap->visual->visualid == vis->visual->visualid) { + /* Already have created colormap for the visual. */ + cmap->refcnt++; + return cmap; + } + cmap = cmap->next; + } +#endif + return __glutAssociateNewColormap(vis); +} + +void +__glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap) +{ +#if defined(_WIN32) || defined(__OS2__) + if (vi->dwFlags & PFD_NEED_PALETTE || vi->iPixelType == PFD_TYPE_COLORINDEX) { + *colormap = associateColormap(vi); + *cmap = (*colormap)->cmap; + } else { + *colormap = NULL; + *cmap = 0; + } +#else + Status status; + XStandardColormap *standardCmaps; + int i, numCmaps; + static Atom hpColorRecoveryAtom = -1; + int isRGB, visualClass, rc; + +#if defined(__cplusplus) || defined(c_plusplus) + visualClass = vi->c_class; +#else + visualClass = vi->class; +#endif + switch (visualClass) { + case PseudoColor: + /* Mesa might return a PseudoColor visual for RGB mode. */ + rc = glXGetConfig(__glutDisplay, vi, GLX_RGBA, &isRGB); + if (rc == 0 && isRGB) { + /* Must be Mesa. */ + *colormap = NULL; + if (MaxCmapsOfScreen(DefaultScreenOfDisplay(__glutDisplay)) == 1 + && vi->visual == DefaultVisual(__glutDisplay, __glutScreen)) { + char *privateCmap = getenv("MESA_PRIVATE_CMAP"); + + if (privateCmap) { + /* User doesn't want to share colormaps. */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + } else { + /* Share the root colormap. */ + *cmap = DefaultColormap(__glutDisplay, __glutScreen); + } + } else { + /* Get our own PseudoColor colormap. */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + } + } else { + /* CI mode, real GLX never returns a PseudoColor visual + for RGB mode. */ + *colormap = associateColormap(vi); + *cmap = (*colormap)->cmap; + } + break; + case TrueColor: + case DirectColor: + *colormap = NULL; /* NULL if RGBA */ + + /* Hewlett-Packard supports a feature called "HP Color + Recovery". Mesa has code to use HP Color Recovery. For + Mesa to use this feature, the atom + _HP_RGB_SMOOTH_MAP_LIST must be defined on the root + window AND the colormap obtainable by XGetRGBColormaps + for that atom must be set on the window. If that + colormap is not set, the output will look stripy. */ + + if (hpColorRecoveryAtom == -1) { + char *xvendor; + +#define VENDOR_HP "Hewlett-Packard" + + /* Only makes sense to make XInternAtom round-trip if we + know that we are connected to an HP X server. */ + xvendor = ServerVendor(__glutDisplay); + if (!strncmp(xvendor, VENDOR_HP, sizeof(VENDOR_HP) - 1)) { + hpColorRecoveryAtom = XInternAtom(__glutDisplay, "_HP_RGB_SMOOTH_MAP_LIST", True); + } else { + hpColorRecoveryAtom = None; + } + } + if (hpColorRecoveryAtom != None) { + status = XGetRGBColormaps(__glutDisplay, __glutRoot, + &standardCmaps, &numCmaps, hpColorRecoveryAtom); + if (status == 1) { + for (i = 0; i < numCmaps; i++) { + if (standardCmaps[i].visualid == vi->visualid) { + *cmap = standardCmaps[i].colormap; + XFree(standardCmaps); + return; + } + } + XFree(standardCmaps); + } + } +#ifndef SOLARIS_2_4_BUG + /* Solaris 2.4 and 2.5 have a bug in their + XmuLookupStandardColormap implementations. Please + compile your Solaris 2.4 or 2.5 version of GLUT with + -DSOLARIS_2_4_BUG to work around this bug. The symptom + of the bug is that programs will get a BadMatch error + from X_CreateWindow when creating a GLUT window because + Solaris 2.4 and 2.5 create a corrupted RGB_DEFAULT_MAP + property. Note that this workaround prevents Colormap + sharing between applications, perhaps leading + unnecessary colormap installations or colormap flashing. + Sun fixed this bug in Solaris 2.6. */ + status = XmuLookupStandardColormap(__glutDisplay, + vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP, + /* replace */ False, /* retain */ True); + if (status == 1) { + status = XGetRGBColormaps(__glutDisplay, __glutRoot, + &standardCmaps, &numCmaps, XA_RGB_DEFAULT_MAP); + if (status == 1) { + for (i = 0; i < numCmaps; i++) { + if (standardCmaps[i].visualid == vi->visualid) { + *cmap = standardCmaps[i].colormap; + XFree(standardCmaps); + return; + } + } + XFree(standardCmaps); + } + } +#endif + /* If no standard colormap but TrueColor, just make a + private one. */ + /* XXX Should do a better job of internal sharing for + privately allocated TrueColor colormaps. */ + /* XXX DirectColor probably needs ramps hand initialized! */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + break; + case StaticColor: + case StaticGray: + case GrayScale: + /* Mesa supports these visuals */ + *colormap = NULL; + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocNone); + break; + default: + __glutFatalError( + "could not allocate colormap for visual type: %d.", + visualClass); + } + return; +#endif +} + +#if !defined(_WIN32) && !defined(__OS2__) +static int +findColormaps(GLUTwindow * window, + Window * winlist, Colormap * cmaplist, int num, int max) +{ + GLUTwindow *child; + int i; + + /* Do not allow more entries that maximum number of + colormaps! */ + if (num >= max) + return num; + /* Is cmap for this window already on the list? */ + for (i = 0; i < num; i++) { + if (cmaplist[i] == window->cmap) + goto normalColormapAlreadyListed; + } + /* Not found on the list; add colormap and window. */ + winlist[num] = window->win; + cmaplist[num] = window->cmap; + num++; + +normalColormapAlreadyListed: + + /* Repeat above but for the overlay colormap if there one. */ + if (window->overlay) { + if (num >= max) + return num; + for (i = 0; i < num; i++) { + if (cmaplist[i] == window->overlay->cmap) + goto overlayColormapAlreadyListed; + } + winlist[num] = window->overlay->win; + cmaplist[num] = window->overlay->cmap; + num++; + } +overlayColormapAlreadyListed: + + /* Recursively search children. */ + child = window->children; + while (child) { + num = findColormaps(child, winlist, cmaplist, num, max); + child = child->siblings; + } + return num; +} + +void +__glutEstablishColormapsProperty(GLUTwindow * window) +{ + /* this routine is strictly X. Win32 doesn't need to do + anything of this sort (but has to do other wacky stuff + later). */ + static Atom wmColormapWindows = None; + Window *winlist; + Colormap *cmaplist; + Status status; + int maxcmaps, num; + + assert(!window->parent); + maxcmaps = MaxCmapsOfScreen(ScreenOfDisplay(__glutDisplay, + __glutScreen)); + /* For portability reasons we don't use alloca for winlist + and cmaplist, but we could. */ + winlist = (Window *) malloc(maxcmaps * sizeof(Window)); + cmaplist = (Colormap *) malloc(maxcmaps * sizeof(Colormap)); + num = findColormaps(window, winlist, cmaplist, 0, maxcmaps); + if (num < 2) { + /* Property no longer needed; remove it. */ + wmColormapWindows = XSGIFastInternAtom(__glutDisplay, + "WM_COLORMAP_WINDOWS", SGI_XA_WM_COLORMAP_WINDOWS, False); + if (wmColormapWindows == None) { + __glutWarning("Could not intern X atom for WM_COLORMAP_WINDOWS."); + return; + } + XDeleteProperty(__glutDisplay, window->win, wmColormapWindows); + } else { + status = XSetWMColormapWindows(__glutDisplay, window->win, + winlist, num); + /* XSetWMColormapWindows should always work unless the + WM_COLORMAP_WINDOWS property cannot be intern'ed. We + check to be safe. */ + if (status == False) + __glutFatalError("XSetWMColormapWindows returned False."); + } + /* For portability reasons we don't use alloca for winlist + and cmaplist, but we could. */ + free(winlist); + free(cmaplist); +} + +GLUTwindow * +__glutToplevelOf(GLUTwindow * window) +{ + while (window->parent) { + window = window->parent; + } + return window; +} +#endif + +void +__glutFreeColormap(GLUTcolormap * cmap) +{ + GLUTcolormap *cur, **prev; + + cmap->refcnt--; + if (cmap->refcnt == 0) { + /* remove from colormap list */ + cur = __glutColormapList; + prev = &__glutColormapList; + while (cur) { + if (cur == cmap) { + *prev = cmap->next; + break; + } + prev = &(cur->next); + cur = cur->next; + } + /* actually free colormap */ + XFreeColormap(__glutDisplay, cmap->cmap); + free(cmap->cells); + free(cmap); + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_cursor.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_cursor.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_cursor.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_cursor.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,210 @@ + +/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +#if !defined(_WIN32) && !defined(__OS2PM__) +#include /* For XA_CURSOR */ +#include +#endif + +typedef struct _CursorTable { +#if defined(_WIN32) + char* glyph; +#else + int glyph; +#endif + Cursor cursor; +} CursorTable; +/* *INDENT-OFF* */ + +static CursorTable cursorTable[] = { + {XC_arrow, None}, /* GLUT_CURSOR_RIGHT_ARROW */ + {XC_top_left_arrow, None}, /* GLUT_CURSOR_LEFT_ARROW */ + {XC_hand1, None}, /* GLUT_CURSOR_INFO */ + {XC_pirate, None}, /* GLUT_CURSOR_DESTROY */ + {XC_question_arrow, None}, /* GLUT_CURSOR_HELP */ + {XC_exchange, None}, /* GLUT_CURSOR_CYCLE */ + {XC_spraycan, None}, /* GLUT_CURSOR_SPRAY */ + {XC_watch, None}, /* GLUT_CURSOR_WAIT */ + {XC_xterm, None}, /* GLUT_CURSOR_TEXT */ + {XC_crosshair, None}, /* GLUT_CURSOR_CROSSHAIR */ + {XC_sb_v_double_arrow, None}, /* GLUT_CURSOR_UP_DOWN */ + {XC_sb_h_double_arrow, None}, /* GLUT_CURSOR_LEFT_RIGHT */ + {XC_top_side, None}, /* GLUT_CURSOR_TOP_SIDE */ + {XC_bottom_side, None}, /* GLUT_CURSOR_BOTTOM_SIDE */ + {XC_left_side, None}, /* GLUT_CURSOR_LEFT_SIDE */ + {XC_right_side, None}, /* GLUT_CURSOR_RIGHT_SIDE */ + {XC_top_left_corner, None}, /* GLUT_CURSOR_TOP_LEFT_CORNER */ + {XC_top_right_corner, None}, /* GLUT_CURSOR_TOP_RIGHT_CORNER */ + {XC_bottom_right_corner, None}, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */ + {XC_bottom_left_corner, None}, /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */ +}; +/* *INDENT-ON* */ + +#if !defined(_WIN32) && !defined(__OS2PM__) +static Cursor blankCursor = None; +static Cursor fullCrosshairCusor = None; + +/* SGI X server's support a special property called the + _SGI_CROSSHAIR_CURSOR that when installed as a window's + cursor, becomes a full screen crosshair cursor. SGI + has special cursor generation hardware for this case. */ +static Cursor +getFullCrosshairCursor(void) +{ + Cursor cursor; + Atom crosshairAtom, actualType; + int rc, actualFormat; + unsigned long n, left; + unsigned long *value; + + if (fullCrosshairCusor == None) { + crosshairAtom = XInternAtom(__glutDisplay, + "_SGI_CROSSHAIR_CURSOR", True); + if (crosshairAtom != None) { + value = 0; /* Make compiler happy. */ + rc = XGetWindowProperty(__glutDisplay, __glutRoot, + crosshairAtom, 0, 1, False, XA_CURSOR, &actualType, + &actualFormat, &n, &left, (unsigned char **) &value); + if (rc == Success && actualFormat == 32 && n >= 1) { + cursor = value[0]; + XFree(value); + return cursor; + } + } + } + return XCreateFontCursor(__glutDisplay, XC_crosshair); +} + +/* X11 forces you to create a blank cursor if you want + to disable the cursor. */ +static Cursor +makeBlankCursor(void) +{ + static char data[1] = + {0}; + Cursor cursor; + Pixmap blank; + XColor dummy; + + blank = XCreateBitmapFromData(__glutDisplay, __glutRoot, + data, 1, 1); + if (blank == None) + __glutFatalError("out of memory."); + cursor = XCreatePixmapCursor(__glutDisplay, blank, blank, + &dummy, &dummy, 0, 0); + XFreePixmap(__glutDisplay, blank); + + return cursor; +} +#endif /* !_WIN32 && !__OS2PM__*/ + +/* Win32 and X11 use this same function to accomplish + fairly different tasks. X11 lets you just define the + cursor for a window and the window system takes care + of making sure that the window's cursor is installed + when the mouse is in the window. Win32 requires the + application to handle a WM_SETCURSOR message to install + the right cursor when windows are entered. Think of + the Win32 __glutSetCursor (called from __glutWindowProc) + as "install cursor". Think of the X11 __glutSetCursor + (called from glutSetCursor) as "define cursor". */ +void +__glutSetCursor(GLUTwindow *window) +{ + int cursor = window->cursor; + Cursor xcursor = 0; + + if (cursor >= 0 && + cursor < sizeof(cursorTable) / sizeof(cursorTable[0])) { + if (cursorTable[cursor].cursor == None) { + cursorTable[cursor].cursor = XCreateFontCursor(__glutDisplay, + cursorTable[cursor].glyph); + } + xcursor = cursorTable[cursor].cursor; + } else { + /* Special cases. */ + switch (cursor) { + case GLUT_CURSOR_INHERIT: +#if defined(_WIN32) + while (window->parent) { + window = window->parent; + if (window->cursor != GLUT_CURSOR_INHERIT) { + __glutSetCursor(window); + return; + } + } + /* XXX Default to an arrow cursor. Is this + right or should we be letting the default + window proc be installing some system cursor? */ + xcursor = cursorTable[0].cursor; + if (xcursor == NULL) { + xcursor = + cursorTable[0].cursor = + LoadCursor(NULL, cursorTable[0].glyph); + } + +#elif defined(__OS2PM__) +//todo + xcursor = None; + +#else + xcursor = None; +#endif + break; + case GLUT_CURSOR_NONE: +#if defined(_WIN32) || defined(__OS2PM__) + xcursor = NULL; +#else + if (blankCursor == None) { + blankCursor = makeBlankCursor(); + } + xcursor = blankCursor; +#endif + break; + case GLUT_CURSOR_FULL_CROSSHAIR: +#if defined(_WIN32) + xcursor = (HICON) IDC_CROSS; +#elif defined(__OS2PM__) +//todo +#else + if (fullCrosshairCusor == None) { + fullCrosshairCusor = getFullCrosshairCursor(); + } + xcursor = fullCrosshairCusor; +#endif + break; + } + } + XDefineCursor(__glutDisplay, + window->win, xcursor); + XFlush(__glutDisplay); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSetCursor(int cursor) +{ +#ifdef _WIN32 + POINT point; + + __glutCurrentWindow->cursor = cursor; + /* Are we in the window right now? If so, + install the cursor. */ + GetCursorPos(&point); + if (__glutCurrentWindow->win == WindowFromPoint(point)) { + __glutSetCursor(__glutCurrentWindow); + } +#elif defined(__OS2PM__) +//todo +#else + __glutCurrentWindow->cursor = cursor; + __glutSetCursor(__glutCurrentWindow); +#endif +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_event.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_event.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_event.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_event.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1399 @@ +/* glut_event.c */ +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#include /* Some FD_ZERO macros use memset without + prototyping memset. */ + +/* Much of the following #ifdef logic to include the proper + prototypes for the select system call is based on logic + from the X11R6.3 version of . */ + +#if !defined(_WIN32) +# ifdef __sgi +# include /* prototype for bzero used by FD_ZERO */ +# endif +# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) +# include /* select system call interface */ +# ifdef luna +# include +# endif +# endif + /* AIX 4.2 fubar-ed , so go to heroic measures to get it */ +# if defined(AIXV4) && !defined(NFDBITS) +# include +# endif +#endif /* !_WIN32 */ + +#include + +#if defined(__OS2__) +//??? ­ ä¨Ł  ?? # include +#elif !defined(_WIN32) +# if defined(__vms) && ( __VMS_VER < 70000000 ) +# include +# else +# ifndef __vms +# include +# endif +# endif +# include +# include +# include +#else +# ifdef __CYGWIN32__ +# include +# else +# include +# endif +# ifdef __hpux + /* XXX Bert Gijsbers reports that HP-UX + needs different keysyms for the End, Insert, and Delete keys + to work on an HP 715. It would be better if HP generated + standard keysyms for standard keys. */ +# include +# endif +#endif /* !_WIN32 */ + +#include "glutint.h" + +#if defined(__vms) && ( __VMS_VER < 70000000 ) +#include +#include +extern int SYS$CLREF(int efn); +extern int SYS$SETIMR(unsigned int efn, struct timeval6 *timeout, void *ast, + unsigned int request_id, unsigned int flags); +extern int SYS$WFLOR(unsigned int efn, unsigned int mask); +extern int SYS$CANTIM(unsigned int request_id, unsigned int mode); +#endif /* __vms, VMs 6.2 or earlier */ + +static GLUTtimer *freeTimerList = NULL; + +GLUTidleCB __glutIdleFunc = NULL; +GLUTtimer *__glutTimerList = NULL; +#ifdef SUPPORT_FORTRAN +GLUTtimer *__glutNewTimer; +#endif +GLUTwindow *__glutWindowWorkList = NULL; +GLUTmenu *__glutMappedMenu; +GLUTmenu *__glutCurrentMenu = NULL; + +void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *); +#if !defined(_WIN32) && !defined(__OS2__) +void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item, int num, int type) = NULL; +void (*__glutFinishMenu)(Window win, int x, int y); +void (*__glutPaintMenu)(GLUTmenu * menu); +void (*__glutStartMenu)(GLUTmenu * menu, GLUTwindow * window, int x, int y, int x_win, int y_win); +GLUTmenu * (*__glutGetMenuByNum)(int menunum); +GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu, Window win, int *which); +GLUTmenu * (*__glutGetMenu)(Window win); +#endif + +Atom __glutMotifHints = None; +/* Modifier mask of ~0 implies not in core input callback. */ +unsigned int __glutModifierMask = (unsigned int) ~0; +int __glutWindowDamaged = 0; + +void GLUTAPIENTRY +glutIdleFunc(GLUTidleCB idleFunc) +{ + __glutIdleFunc = idleFunc; +} + +void GLUTAPIENTRY +glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value) +{ + GLUTtimer *timer, *other; + GLUTtimer **prevptr; +#ifdef OLD_VMS + struct timeval6 now; +#else + struct timeval now; +#endif + + if (!timerFunc) + return; + + if (freeTimerList) { + timer = freeTimerList; + freeTimerList = timer->next; + } else { + timer = (GLUTtimer *) malloc(sizeof(GLUTtimer)); + if (!timer) + __glutFatalError("out of memory."); + } + + timer->func = timerFunc; +#if defined(__vms) && ( __VMS_VER < 70000000 ) + /* VMS time is expressed in units of 100 ns */ + timer->timeout.val = interval * TICKS_PER_MILLISECOND; +#else + timer->timeout.tv_sec = (int) interval / 1000; + timer->timeout.tv_usec = (int) (interval % 1000) * 1000; +#endif + timer->value = value; + timer->next = NULL; + GETTIMEOFDAY(&now); + ADD_TIME(timer->timeout, timer->timeout, now); + prevptr = &__glutTimerList; + other = *prevptr; + while (other && IS_AFTER(other->timeout, timer->timeout)) { + prevptr = &other->next; + other = *prevptr; + } + timer->next = other; +#ifdef SUPPORT_FORTRAN + __glutNewTimer = timer; /* for Fortran binding! */ +#endif + *prevptr = timer; +} + +void +handleTimeouts(void) +{ +#ifdef OLD_VMS + struct timeval6 now; +#else + struct timeval now; +#endif + GLUTtimer *timer; + + /* Assumption is that __glutTimerList is already determined + to be non-NULL. */ + GETTIMEOFDAY(&now); + while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) { + timer = __glutTimerList; + timer->func(timer->value); + __glutTimerList = timer->next; + timer->next = freeTimerList; + freeTimerList = timer; + if (!__glutTimerList) + break; + } +} + +void +__glutPutOnWorkList(GLUTwindow * window, int workMask) +{ + if (window->workMask) { + /* Already on list; just OR in new workMask. */ + window->workMask |= workMask; + } else { + /* Update work mask and add to window work list. */ + window->workMask = workMask; + /* Assert that if the window does not have a + workMask already, the window should definitely + not be the head of the work list. */ + assert(window != __glutWindowWorkList); + window->prevWorkWin = __glutWindowWorkList; + __glutWindowWorkList = window; + } +} + +void +__glutPostRedisplay(GLUTwindow * window, int layerMask) +{ + int shown = (layerMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) ? + window->shownState : window->overlay->shownState; + + /* Post a redisplay if the window is visible (or the + visibility of the window is unknown, ie. window->visState + == -1) _and_ the layer is known to be shown. */ + if (window->visState != GLUT_HIDDEN + && window->visState != GLUT_FULLY_COVERED && shown) { + __glutPutOnWorkList(window, layerMask); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutPostRedisplay(void) +{ + __glutPostRedisplay(__glutCurrentWindow, GLUT_REDISPLAY_WORK); +} + +/* The advantage of this routine is that it saves the cost of a + glutSetWindow call (entailing an expensive OpenGL context switch), + particularly useful when multiple windows need redisplays posted at + the same times. See also glutPostWindowOverlayRedisplay. */ +void GLUTAPIENTRY +glutPostWindowRedisplay(int win) +{ + __glutPostRedisplay(__glutWindowList[win - 1], GLUT_REDISPLAY_WORK); +} + +/* ENDCENTRY */ +static GLUTeventParser *eventParserList = NULL; + +/* __glutRegisterEventParser allows another module to register + to intercept X events types not otherwise acted on by the + GLUT processEventsAndTimeouts routine. The X Input + extension support code uses an event parser for handling X + Input extension events. */ + +void +__glutRegisterEventParser(GLUTeventParser * parser) +{ + parser->next = eventParserList; + eventParserList = parser; +} + +static void +markWindowHidden(GLUTwindow * window) +{ + if (GLUT_HIDDEN != window->visState) { + GLUTwindow *child; + + if (window->windowStatus) { + window->visState = GLUT_HIDDEN; + __glutSetWindow(window); + window->windowStatus(GLUT_HIDDEN); + } + /* An unmap is only reported on a single window; its + descendents need to know they are no longer visible. */ + child = window->children; + while (child) { + markWindowHidden(child); + child = child->siblings; + } + } +} + +#if !defined(_WIN32) && !defined(__OS2__) + +static void +purgeStaleWindow(Window win) +{ + GLUTstale **pEntry = &__glutStaleWindowList; + GLUTstale *entry = __glutStaleWindowList; + + /* Tranverse singly-linked stale window list look for the + window ID. */ + while (entry) { + if (entry->win == win) { + /* Found it; delete it. */ + *pEntry = entry->next; + free(entry); + return; + } else { + pEntry = &entry->next; + entry = *pEntry; + } + } +} + +/* Unlike XNextEvent, if a signal arrives, + interruptibleXNextEvent will return (with a zero return + value). This helps GLUT drop out of XNextEvent if a signal + is delivered. The intent is so that a GLUT program can call + glutIdleFunc in a signal handler to register an idle func + and then immediately get dropped into the idle func (after + returning from the signal handler). The idea is to make + GLUT's main loop reliably interruptible by signals. */ +static int +interruptibleXNextEvent(Display * dpy, XEvent * event) +{ + fd_set fds; + int rc; + + /* Flush X protocol since XPending does not do this + implicitly. */ + XFlush(__glutDisplay); + for (;;) { + if (XPending(__glutDisplay)) { + XNextEvent(dpy, event); + return 1; + } +#ifndef VMS + /* the combination ConectionNumber-select is buggy on VMS. Sometimes it + * fails. This part of the code hangs the program on VMS7.2. But even + * without it the program seems to run correctly. + * Note that this is a bug in the VMS/DECWindows run-time-libraries. + * Compaq engeneering does not want or is not able to make a fix. + * (last sentence is a quotation from Compaq when I reported the + * problem January 2000) */ + FD_ZERO(&fds); + FD_SET(__glutConnectionFD, &fds); + rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL); + if (rc < 0) { + if (errno == EINTR) { + return 0; + } else { + __glutFatalError("select error."); + } + } +#endif + } +} + +#endif + +static void +processEventsAndTimeouts(void) +{ + do { +#if defined(__OS2__) + QMSG qmsg; /* message from message queue */ + extern HAB hab; /* PM anchor block handle */ + + if(! WinGetMsg( hab, &qmsg, 0UL, 0UL, 0UL ) ) + exit(0); + WinDispatchMsg( hab, /* PM anchor block handle */ + &qmsg ); /* pointer to message */ + +#elif defined(_WIN32) + MSG event; + + if(!GetMessage(&event, NULL, 0, 0)) /* bail if no more messages */ + exit(0); + TranslateMessage(&event); /* translate virtual-key messages */ + DispatchMessage(&event); /* call the window proc */ + /* see win32_event.c for event (message) processing procedures */ +#else + static int mappedMenuButton; + GLUTeventParser *parser; + XEvent event, ahead; + GLUTwindow *window; + GLUTkeyboardCB keyboard; + GLUTspecialCB special; + int gotEvent, width, height; + + gotEvent = interruptibleXNextEvent(__glutDisplay, &event); + if (gotEvent) { + switch (event.type) { + case MappingNotify: + XRefreshKeyboardMapping((XMappingEvent *) & event); + break; + case ConfigureNotify: + window = __glutGetWindow(event.xconfigure.window); + if (window) { + if (window->win != event.xconfigure.window) { + /* Ignore ConfigureNotify sent to the overlay + planes. GLUT could get here because overlays + select for StructureNotify events to receive + DestroyNotify. */ + break; + } + width = event.xconfigure.width; + height = event.xconfigure.height; + if (width != window->width || height != window->height) { + if (window->overlay) { + XResizeWindow(__glutDisplay, window->overlay->win, width, height); + } + window->width = width; + window->height = height; + __glutSetWindow(window); + /* Do not execute OpenGL out of sequence with + respect to the XResizeWindow request! */ + glXWaitX(); + window->reshape(width, height); + window->forceReshape = False; + /* A reshape should be considered like posting a + repair; this is necessary for the "Mesa + glXSwapBuffers to repair damage" hack to operate + correctly. Without it, there's not an initial + back buffer render from which to blit from when + damage happens to the window. */ + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } + } + break; + case Expose: + /* compress expose events */ + while (XEventsQueued(__glutDisplay, QueuedAfterReading) + > 0) { + XPeekEvent(__glutDisplay, &ahead); + if (ahead.type != Expose || + ahead.xexpose.window != event.xexpose.window) { + break; + } + XNextEvent(__glutDisplay, &event); + } + if (event.xexpose.count == 0) { + GLUTmenu *menu; + + if (__glutMappedMenu && + (menu = __glutGetMenu(event.xexpose.window))) { + __glutPaintMenu(menu); + } else { + window = __glutGetWindow(event.xexpose.window); + if (window) { + if (window->win == event.xexpose.window) { + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } else if (window->overlay && window->overlay->win == event.xexpose.window) { + __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK); + } + } + } + } else { + /* there are more exposes to read; wait to redisplay */ + } + break; + case ButtonPress: + case ButtonRelease: + if (__glutMappedMenu && event.type == ButtonRelease + && mappedMenuButton == event.xbutton.button) { + /* Menu is currently popped up and its button is + released. */ + __glutFinishMenu(event.xbutton.window, event.xbutton.x, event.xbutton.y); + } else { + window = __glutGetWindow(event.xbutton.window); + if (window) { + GLUTmenu *menu; + int menuNum; + + menuNum = window->menu[event.xbutton.button - 1]; + /* Make sure that __glutGetMenuByNum is only called if there + really is a menu present. */ + if ((menuNum > 0) && (menu = __glutGetMenuByNum(menuNum))) { + if (event.type == ButtonPress && !__glutMappedMenu) { + __glutStartMenu(menu, window, + event.xbutton.x_root, event.xbutton.y_root, + event.xbutton.x, event.xbutton.y); + mappedMenuButton = event.xbutton.button; + } else { + /* Ignore a release of a button with a menu + attatched to it when no menu is popped up, + or ignore a press when another menu is + already popped up. */ + } + } else if (window->mouse) { + __glutSetWindow(window); + __glutModifierMask = event.xbutton.state; + window->mouse(event.xbutton.button - 1, + event.type == ButtonRelease ? + GLUT_UP : GLUT_DOWN, + event.xbutton.x, event.xbutton.y); + __glutModifierMask = ~0; + } else { + /* Stray mouse events. Ignore. */ + } + } else { + /* Window might have been destroyed and all the + events for the window may not yet be received. */ + } + } + break; + case MotionNotify: + if (!__glutMappedMenu) { + window = __glutGetWindow(event.xmotion.window); + if (window) { + /* If motion function registered _and_ buttons held + * down, call motion function... */ + if (window->motion && event.xmotion.state & + (Button1Mask | Button2Mask | Button3Mask)) { + __glutSetWindow(window); + window->motion(event.xmotion.x, event.xmotion.y); + } + /* If passive motion function registered _and_ + buttons not held down, call passive motion + function... */ + else if (window->passive && + ((event.xmotion.state & + (Button1Mask | Button2Mask | Button3Mask)) == + 0)) { + __glutSetWindow(window); + window->passive(event.xmotion.x, + event.xmotion.y); + } + } + } else { + /* Motion events are thrown away when a pop up menu + is active. */ + } + break; + case KeyPress: + case KeyRelease: + window = __glutGetWindow(event.xkey.window); + if (!window) { + break; + } + if (event.type == KeyPress) { + keyboard = window->keyboard; + } else { + + /* If we are ignoring auto repeated keys for this window, + check if the next event in the X event queue is a KeyPress + for the exact same key (and at the exact same time) as the + key being released. The X11 protocol will send auto + repeated keys as such KeyRelease/KeyPress pairs. */ + + if (window->ignoreKeyRepeat) { + if (XEventsQueued(__glutDisplay, QueuedAfterReading)) { + XPeekEvent(__glutDisplay, &ahead); + if (ahead.type == KeyPress + && ahead.xkey.window == event.xkey.window + && ahead.xkey.keycode == event.xkey.keycode + && ahead.xkey.time == event.xkey.time) { + /* Pop off the repeated KeyPress and ignore + the auto repeated KeyRelease/KeyPress pair. */ + XNextEvent(__glutDisplay, &event); + break; + } + } + } + keyboard = window->keyboardUp; + } + if (keyboard) { + char tmp[1]; + int rc; + + rc = XLookupString(&event.xkey, tmp, sizeof(tmp), + NULL, NULL); + if (rc) { + __glutSetWindow(window); + __glutModifierMask = event.xkey.state; + keyboard(tmp[0], + event.xkey.x, event.xkey.y); + __glutModifierMask = ~0; + break; + } + } + if (event.type == KeyPress) { + special = window->special; + } else { + special = window->specialUp; + } + if (special) { + KeySym ks; + int key; + +/* Introduced in X11R6: (Partial list of) Keypad Functions. Define + in place in case compiling against an older pre-X11R6 + X11/keysymdef.h file. */ +#ifndef XK_KP_Home +#define XK_KP_Home 0xFF95 +#endif +#ifndef XK_KP_Left +#define XK_KP_Left 0xFF96 +#endif +#ifndef XK_KP_Up +#define XK_KP_Up 0xFF97 +#endif +#ifndef XK_KP_Right +#define XK_KP_Right 0xFF98 +#endif +#ifndef XK_KP_Down +#define XK_KP_Down 0xFF99 +#endif +#ifndef XK_KP_Prior +#define XK_KP_Prior 0xFF9A +#endif +#ifndef XK_KP_Next +#define XK_KP_Next 0xFF9B +#endif +#ifndef XK_KP_End +#define XK_KP_End 0xFF9C +#endif +#ifndef XK_KP_Insert +#define XK_KP_Insert 0xFF9E +#endif +#ifndef XK_KP_Delete +#define XK_KP_Delete 0xFF9F +#endif + + ks = XLookupKeysym((XKeyEvent *) & event, 0); + /* XXX Verbose, but makes no assumptions about keysym + layout. */ + switch (ks) { +/* *INDENT-OFF* */ + /* function keys */ + case XK_F1: key = GLUT_KEY_F1; break; + case XK_F2: key = GLUT_KEY_F2; break; + case XK_F3: key = GLUT_KEY_F3; break; + case XK_F4: key = GLUT_KEY_F4; break; + case XK_F5: key = GLUT_KEY_F5; break; + case XK_F6: key = GLUT_KEY_F6; break; + case XK_F7: key = GLUT_KEY_F7; break; + case XK_F8: key = GLUT_KEY_F8; break; + case XK_F9: key = GLUT_KEY_F9; break; + case XK_F10: key = GLUT_KEY_F10; break; + case XK_F11: key = GLUT_KEY_F11; break; + case XK_F12: key = GLUT_KEY_F12; break; + /* directional keys */ + case XK_KP_Left: + case XK_Left: key = GLUT_KEY_LEFT; break; + case XK_KP_Up: /* Introduced in X11R6. */ + case XK_Up: key = GLUT_KEY_UP; break; + case XK_KP_Right: /* Introduced in X11R6. */ + case XK_Right: key = GLUT_KEY_RIGHT; break; + case XK_KP_Down: /* Introduced in X11R6. */ + case XK_Down: key = GLUT_KEY_DOWN; break; +/* *INDENT-ON* */ + + case XK_KP_Prior: /* Introduced in X11R6. */ + case XK_Prior: + /* XK_Prior same as X11R6's XK_Page_Up */ + key = GLUT_KEY_PAGE_UP; + break; + case XK_KP_Next: /* Introduced in X11R6. */ + case XK_Next: + /* XK_Next same as X11R6's XK_Page_Down */ + key = GLUT_KEY_PAGE_DOWN; + break; + case XK_KP_Home: /* Introduced in X11R6. */ + case XK_Home: + key = GLUT_KEY_HOME; + break; +#ifdef __hpux + case XK_Select: +#endif + case XK_KP_End: /* Introduced in X11R6. */ + case XK_End: + key = GLUT_KEY_END; + break; +#ifdef __hpux + case XK_InsertChar: +#endif + case XK_KP_Insert: /* Introduced in X11R6. */ + case XK_Insert: + key = GLUT_KEY_INSERT; + break; +#ifdef __hpux + case XK_DeleteChar: +#endif + case XK_KP_Delete: /* Introduced in X11R6. */ + /* The Delete character is really an ASCII key. */ + __glutSetWindow(window); + keyboard(127, /* ASCII Delete character. */ + event.xkey.x, event.xkey.y); + goto skip; + default: + goto skip; + } + __glutSetWindow(window); + __glutModifierMask = event.xkey.state; + special(key, event.xkey.x, event.xkey.y); + __glutModifierMask = ~0; + skip:; + } + break; + case EnterNotify: + case LeaveNotify: + if (event.xcrossing.mode != NotifyNormal || + event.xcrossing.detail == NotifyNonlinearVirtual || + event.xcrossing.detail == NotifyVirtual) { + + /* Careful to ignore Enter/LeaveNotify events that + come from the pop-up menu pointer grab and ungrab. + Also, ignore "virtual" Enter/LeaveNotify events + since they represent the pointer passing through + the window hierarchy without actually entering or + leaving the actual real estate of a window. */ + + break; + } + if (__glutMappedMenu) { + GLUTmenuItem *item; + int num; + + item = __glutGetMenuItem(__glutMappedMenu, + event.xcrossing.window, &num); + if (item) { + __glutMenuItemEnterOrLeave(item, num, event.type); + break; + } + } + window = __glutGetWindow(event.xcrossing.window); + if (window) { + if (window->entry) { + if (event.type == EnterNotify) { + + /* With overlays established, X can report two + enter events for both the overlay and normal + plane window. Do not generate a second enter + callback if we reported one without an + intervening leave. */ + + if (window->entryState != EnterNotify) { + int num = window->num; + Window xid = window->win; + + window->entryState = EnterNotify; + __glutSetWindow(window); + window->entry(GLUT_ENTERED); + + if (__glutMappedMenu) { + + /* Do not generate any passive motion events + when menus are in use. */ + + } else { + + /* An EnterNotify event can result in a + "compound" callback if a passive motion + callback is also registered. In this case, + be a little paranoid about the possibility + the window could have been destroyed in the + entry callback. */ + + window = __glutWindowList[num]; + if (window && window->passive && window->win == xid) { + __glutSetWindow(window); + window->passive(event.xcrossing.x, event.xcrossing.y); + } + } + } + } else { + if (window->entryState != LeaveNotify) { + + /* When an overlay is established for a window + already mapped and with the pointer in it, + the X server will generate a leave/enter + event pair as the pointer leaves (without + moving) from the normal plane X window to + the newly mapped overlay X window (or vice + versa). This enter/leave pair should not be + reported to the GLUT program since the pair + is a consequence of creating (or destroying) + the overlay, not an actual leave from the + GLUT window. */ + + if (XEventsQueued(__glutDisplay, QueuedAfterReading)) { + XPeekEvent(__glutDisplay, &ahead); + if (ahead.type == EnterNotify && + __glutGetWindow(ahead.xcrossing.window) == window) { + XNextEvent(__glutDisplay, &event); + break; + } + } + window->entryState = LeaveNotify; + __glutSetWindow(window); + window->entry(GLUT_LEFT); + } + } + } else if (window->passive) { + __glutSetWindow(window); + window->passive(event.xcrossing.x, event.xcrossing.y); + } + } + break; + case UnmapNotify: + /* MapNotify events are not needed to maintain + visibility state since VisibilityNotify events will + be delivered when a window becomes visible from + mapping. However, VisibilityNotify events are not + delivered when a window is unmapped (for the window + or its children). */ + window = __glutGetWindow(event.xunmap.window); + if (window) { + if (window->win != event.xconfigure.window) { + /* Ignore UnmapNotify sent to the overlay planes. + GLUT could get here because overlays select for + StructureNotify events to receive DestroyNotify. + */ + break; + } + markWindowHidden(window); + } + break; + case VisibilityNotify: + window = __glutGetWindow(event.xvisibility.window); + if (window) { + /* VisibilityUnobscured+1 = GLUT_FULLY_RETAINED, + VisibilityPartiallyObscured+1 = + GLUT_PARTIALLY_RETAINED, VisibilityFullyObscured+1 + = GLUT_FULLY_COVERED. */ + int visState = event.xvisibility.state + 1; + + if (visState != window->visState) { + if (window->windowStatus) { + window->visState = visState; + __glutSetWindow(window); + window->windowStatus(visState); + } + } + } + break; + case ClientMessage: + if (event.xclient.data.l[0] == __glutWMDeleteWindow) + exit(0); + break; + case DestroyNotify: + purgeStaleWindow(event.xdestroywindow.window); + break; + case CirculateNotify: + case CreateNotify: + case GravityNotify: + case ReparentNotify: + /* Uninteresting to GLUT (but possible for GLUT to + receive). */ + break; + default: + /* Pass events not directly handled by the GLUT main + event loop to any event parsers that have been + registered. In this way, X Input extension events + are passed to the correct handler without forcing + all GLUT programs to support X Input event handling. + */ + parser = eventParserList; + while (parser) { + if (parser->func(&event)) + break; + parser = parser->next; + } + break; + } + } +#endif /* _WIN32 */ + if (__glutTimerList) { + handleTimeouts(); + } + } + while (XPending(__glutDisplay)); +} + +static void +waitForSomething(void) +{ +#if defined(__vms) && ( __VMS_VER < 70000000 ) + static struct timeval6 zerotime = + {0}; + unsigned int timer_efn; +#define timer_id 'glut' /* random :-) number */ + unsigned int wait_mask; +#else + static struct timeval zerotime = + {0, 0}; +#if defined(__OS2__) + +#elif !defined(_WIN32) + fd_set fds; +#endif +#endif +#ifdef OLD_VMS + struct timeval6 now, timeout, waittime; +#else + struct timeval now, timeout, waittime; +#endif +#if !defined(_WIN32) + int rc; +#endif + + /* Flush X protocol since XPending does not do this + implicitly. */ + XFlush(__glutDisplay); + if (XPending(__glutDisplay)) { + /* It is possible (but quite rare) that XFlush may have + needed to wait for a writable X connection file + descriptor, and in the process, may have had to read off + X protocol from the file descriptor. If XPending is true, + this case occured and we should avoid waiting in select + since X protocol buffered within Xlib is due to be + processed and potentially no more X protocol is on the + file descriptor, so we would risk waiting improperly in + select. */ + goto immediatelyHandleXinput; + } +#if defined(__vms) && ( __VMS_VER < 70000000 ) + timeout = __glutTimerList->timeout; + GETTIMEOFDAY(&now); + wait_mask = 1 << (__glutConnectionFD & 31); + if (IS_AFTER(now, timeout)) { + /* We need an event flag for the timer. */ + /* XXX The `right' way to do this is to use LIB$GET_EF, but + since it needs to be in the same cluster as the EFN for + the display, we will have hack it. */ + timer_efn = __glutConnectionFD - 1; + if ((timer_efn / 32) != (__glutConnectionFD / 32)) { + timer_efn = __glutConnectionFD + 1; + } + rc = SYS$CLREF(timer_efn); + rc = SYS$SETIMR(timer_efn, &timeout, NULL, timer_id, 0); + wait_mask |= 1 << (timer_efn & 31); + } else { + timer_efn = 0; + } + rc = SYS$WFLOR(__glutConnectionFD, wait_mask); + if (timer_efn != 0 && SYS$CLREF(timer_efn) == SS$_WASCLR) { + rc = SYS$CANTIM(timer_id, PSL$C_USER); + } + /* XXX There does not seem to be checking of "rc" in the code + above. Can any of the SYS$ routines above fail? */ +#else /* not vms6.2 or lower */ +#if defined(__OS2__) + +#elif !defined(_WIN32) + FD_ZERO(&fds); + FD_SET(__glutConnectionFD, &fds); +#endif + timeout = __glutTimerList->timeout; + GETTIMEOFDAY(&now); + if (IS_AFTER(now, timeout)) { + TIMEDELTA(waittime, timeout, now); + } else { + waittime = zerotime; + } + +#if defined(__OS2__) + DosSleep(0); +#elif !defined(_WIN32) + rc = select(__glutConnectionFD + 1, &fds, + NULL, NULL, &waittime); + if (rc < 0 && errno != EINTR) + __glutFatalError("select error."); +#else + + MsgWaitForMultipleObjects(0, NULL, FALSE, + waittime.tv_sec*1000 + waittime.tv_usec/1000, QS_ALLINPUT); + +#endif +#endif /* not vms6.2 or lower */ + /* Without considering the cause of select unblocking, check + for pending X events and handle any timeouts (by calling + processEventsAndTimeouts). We always look for X events + even if select returned with 0 (indicating a timeout); + otherwise we risk starving X event processing by continous + timeouts. */ + if (XPending(__glutDisplay)) { + immediatelyHandleXinput: + processEventsAndTimeouts(); + } else { + if (__glutTimerList) + handleTimeouts(); + } +} + +static void +idleWait(void) +{ + if (XPending(__glutDisplay)) { + processEventsAndTimeouts(); + } else { + if (__glutTimerList) { + handleTimeouts(); + } + } + /* Make sure idle func still exists! */ + if (__glutIdleFunc) { + __glutIdleFunc(); + } +} + +static GLUTwindow **beforeEnd; + +static GLUTwindow * +processWindowWorkList(GLUTwindow * window) +{ + int workMask; + + if (window->prevWorkWin) { + window->prevWorkWin = processWindowWorkList(window->prevWorkWin); + } else { + beforeEnd = &window->prevWorkWin; + } + + /* Capture work mask for work that needs to be done to this + window, then clear the window's work mask (excepting the + dummy work bit, see below). Then, process the captured + work mask. This allows callbacks in the processing the + captured work mask to set the window's work mask for + subsequent processing. */ + + workMask = window->workMask; + assert((workMask & GLUT_DUMMY_WORK) == 0); + + /* Set the dummy work bit, clearing all other bits, to + indicate that the window is currently on the window work + list _and_ that the window's work mask is currently being + processed. This convinces __glutPutOnWorkList that this + window is on the work list still. */ + window->workMask = GLUT_DUMMY_WORK; + + /* Optimization: most of the time, the work to do is a + redisplay and not these other types of work. Check for + the following cases as a group to before checking each one + individually one by one. This saves about 25 MIPS + instructions in the common redisplay only case. */ + if (workMask & (GLUT_EVENT_MASK_WORK | GLUT_DEVICE_MASK_WORK | + GLUT_CONFIGURE_WORK | GLUT_COLORMAP_WORK | GLUT_MAP_WORK)) { + +#if !defined(_WIN32) && !defined(__OS2__) + /* Be sure to set event mask BEFORE map window is done. */ + if (workMask & GLUT_EVENT_MASK_WORK) { + long eventMask; + + /* Make sure children are not propogating events this + window is selecting for. Be sure to do this before + enabling events on the children's parent. */ + if (window->children) { + GLUTwindow *child = window->children; + unsigned long attribMask = CWDontPropagate; + XSetWindowAttributes wa; + + wa.do_not_propagate_mask = window->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK; + if (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) { + wa.event_mask = child->eventMask | (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK); + attribMask |= CWEventMask; + } + do { + XChangeWindowAttributes(__glutDisplay, child->win, + attribMask, &wa); + child = child->siblings; + } while (child); + } + eventMask = window->eventMask; + if (window->parent && window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) + eventMask |= (window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK); + XSelectInput(__glutDisplay, window->win, eventMask); + if (window->overlay) + XSelectInput(__glutDisplay, window->overlay->win, + window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK); + } +#endif /* !_WIN32 */ + /* Be sure to set device mask BEFORE map window is done. */ + if (workMask & GLUT_DEVICE_MASK_WORK) { + __glutUpdateInputDeviceMaskFunc(window); + } + /* Be sure to configure window BEFORE map window is done. */ + if (workMask & GLUT_CONFIGURE_WORK) { +#if defined(__OS2__) + RECTL changes; + +#elif defined(_WIN32) + RECT changes; + POINT point; + UINT flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER + | SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER; + + GetClientRect(window->win, &changes); + + /* If this window is a toplevel window, translate the 0,0 client + coordinate into a screen coordinate for proper placement. */ + if (!window->parent) { + point.x = 0; + point.y = 0; + ClientToScreen(window->win, &point); + changes.left = point.x; + changes.top = point.y; + } + if (window->desiredConfMask & (CWX | CWY)) { + changes.left = window->desiredX; + changes.top = window->desiredY; + flags &= ~SWP_NOMOVE; + } + if (window->desiredConfMask & (CWWidth | CWHeight)) { + changes.right = changes.left + window->desiredWidth; + changes.bottom = changes.top + window->desiredHeight; + flags &= ~SWP_NOSIZE; + /* XXX If overlay exists, resize the overlay here, ie. + if (window->overlay) ... */ + } + if (window->desiredConfMask & CWStackMode) { + flags &= ~SWP_NOZORDER; + /* XXX Overlay support might require something special here. */ + } + + /* Adjust the window rectangle because Win32 thinks that the x, y, + width & height are the WHOLE window (including decorations), + whereas GLUT treats the x, y, width & height as only the CLIENT + area of the window. Only do this to top level windows + that are not in game mode (since game mode windows do + not have any decorations). */ + if (!window->parent && window != __glutGameModeWindow) { + AdjustWindowRect(&changes, + WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + FALSE); + } + + /* Do the repositioning, moving, and push/pop. */ + SetWindowPos(window->win, + window->desiredStack == Above ? HWND_TOP : HWND_NOTOPMOST, + changes.left, changes.top, + changes.right - changes.left, changes.bottom - changes.top, + flags); + + /* Zero out the mask. */ + window->desiredConfMask = 0; + + /* This hack causes the window to go back to the right position + when it is taken out of fullscreen mode. */ + if (workMask & GLUT_FULL_SCREEN_WORK) { + window->desiredConfMask |= CWX | CWY; + window->desiredX = point.x; + window->desiredY = point.y; + } +#else /* !_WIN32 */ + XWindowChanges changes; + + changes.x = window->desiredX; + changes.y = window->desiredY; + if (window->desiredConfMask & (CWWidth | CWHeight)) { + changes.width = window->desiredWidth; + changes.height = window->desiredHeight; + if (window->overlay) + XResizeWindow(__glutDisplay, window->overlay->win, + window->desiredWidth, window->desiredHeight); + if (__glutMotifHints != None) { + if (workMask & GLUT_FULL_SCREEN_WORK) { + MotifWmHints hints; + + hints.flags = MWM_HINTS_DECORATIONS; + hints.decorations = 0; /* Absolutely no + decorations. */ + XChangeProperty(__glutDisplay, window->win, + __glutMotifHints, __glutMotifHints, 32, + PropModeReplace, (unsigned char *) &hints, 4); + if (workMask & GLUT_MAP_WORK) { + /* Handle case where glutFullScreen is called + before the first time that the window is + mapped. Some window managers will randomly or + interactively position the window the first + time it is mapped if the window's + WM_NORMAL_HINTS property does not request an + explicit position. We don't want any such + window manager interaction when going + fullscreen. Overwrite the WM_NORMAL_HINTS + property installed by glutCreateWindow's + XSetWMProperties property with one explicitly + requesting a fullscreen window. */ + XSizeHints hints; + + hints.flags = USPosition | USSize; + hints.x = 0; + hints.y = 0; + hints.width = window->desiredWidth; + hints.height = window->desiredHeight; + XSetWMNormalHints(__glutDisplay, window->win, &hints); + } + } else { + XDeleteProperty(__glutDisplay, window->win, __glutMotifHints); + } + } + } + if (window->desiredConfMask & CWStackMode) { + changes.stack_mode = window->desiredStack; + /* Do not let glutPushWindow push window beneath the + underlay. */ + if (window->parent && window->parent->overlay + && window->desiredStack == Below) { + changes.stack_mode = Above; + changes.sibling = window->parent->overlay->win; + window->desiredConfMask |= CWSibling; + } + } + XConfigureWindow(__glutDisplay, window->win, + window->desiredConfMask, &changes); + window->desiredConfMask = 0; +#endif + } +#if !defined(_WIN32) && !defined(__OS2__) + /* Be sure to establish the colormaps BEFORE map window is + done. */ + if (workMask & GLUT_COLORMAP_WORK) { + __glutEstablishColormapsProperty(window); + } +#endif + if (workMask & GLUT_MAP_WORK) { + switch (window->desiredMapState) { + case WithdrawnState: + if (window->parent) { + XUnmapWindow(__glutDisplay, window->win); + } else { + XWithdrawWindow(__glutDisplay, window->win, + __glutScreen); + } + window->shownState = 0; + break; + case NormalState: + XMapWindow(__glutDisplay, window->win); + window->shownState = 1; + break; +#ifdef _WIN32 + case GameModeState: /* Not an Xlib value. */ + ShowWindow(window->win, SW_SHOW); + window->shownState = 1; + break; +#endif + case IconicState: + XIconifyWindow(__glutDisplay, window->win, __glutScreen); + window->shownState = 0; + break; + } + } + } + if (workMask & (GLUT_REDISPLAY_WORK | GLUT_OVERLAY_REDISPLAY_WORK | GLUT_REPAIR_WORK | GLUT_OVERLAY_REPAIR_WORK)) { + if (window->forceReshape) { + /* Guarantee that before a display callback is generated + for a window, a reshape callback must be generated. */ + __glutSetWindow(window); + window->reshape(window->width, window->height); + window->forceReshape = False; + + /* Setting the redisplay bit on the first reshape is + necessary to make the "Mesa glXSwapBuffers to repair + damage" hack operate correctly. Without indicating a + redisplay is necessary, there's not an initial back + buffer render from which to blit from when damage + happens to the window. */ + workMask |= GLUT_REDISPLAY_WORK; + } + /* The code below is more involved than otherwise necessary + because it is paranoid about the overlay or entire window + being removed or destroyed in the course of the callbacks. + Notice how the global __glutWindowDamaged is used to record + the layers' damage status. See the code in glutLayerGet for + how __glutWindowDamaged is used. The point is to not have to + update the "damaged" field after the callback since the + window (or overlay) may be destroyed (or removed) when the + callback returns. */ + + if (window->overlay && window->overlay->display) { + int num = window->num; + Window xid = window->overlay ? window->overlay->win : None; + + /* If an overlay display callback is registered, we + differentiate between a redisplay needed for the + overlay and/or normal plane. If there is no overlay + display callback registered, we simply use the + standard display callback. */ + + if (workMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) { + if (__glutMesaSwapHackSupport) { + if (window->usedSwapBuffers) { + if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) { + SWAP_BUFFERS_WINDOW(window); + goto skippedDisplayCallback1; + } + } + } + /* Render to normal plane. */ +#ifdef _WIN32 + window->renderDc = window->hdc; +#endif + window->renderWin = window->win; + window->renderCtx = window->ctx; + __glutWindowDamaged = (workMask & GLUT_REPAIR_WORK); + __glutSetWindow(window); + window->usedSwapBuffers = 0; + window->display(); + __glutWindowDamaged = 0; + + skippedDisplayCallback1:; + } + if (workMask & (GLUT_OVERLAY_REDISPLAY_WORK | GLUT_OVERLAY_REPAIR_WORK)) { + window = __glutWindowList[num]; + if (window && window->overlay && + window->overlay->win == xid && window->overlay->display) { + + /* Render to overlay. */ +#ifdef _WIN32 + window->renderDc = window->overlay->hdc; +#endif + window->renderWin = window->overlay->win; + window->renderCtx = window->overlay->ctx; + __glutWindowDamaged = (workMask & GLUT_OVERLAY_REPAIR_WORK); + __glutSetWindow(window); + window->overlay->display(); + __glutWindowDamaged = 0; + } else { + /* Overlay may have since been destroyed or the + overlay callback may have been disabled during + normal display callback. */ + } + } + } else { + if (__glutMesaSwapHackSupport) { + if (!window->overlay && window->usedSwapBuffers) { + if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) { + SWAP_BUFFERS_WINDOW(window); + goto skippedDisplayCallback2; + } + } + } + /* Render to normal plane (and possibly overlay). */ + __glutWindowDamaged = (workMask & (GLUT_OVERLAY_REPAIR_WORK | GLUT_REPAIR_WORK)); + __glutSetWindow(window); + window->usedSwapBuffers = 0; + window->display(); + __glutWindowDamaged = 0; + + skippedDisplayCallback2:; + } + } + /* Combine workMask with window->workMask to determine what + finish and debug work there is. */ + workMask |= window->workMask; + + if (workMask & GLUT_FINISH_WORK) { + /* Finish work makes sure a glFinish gets done to indirect + rendering contexts. Indirect contexts tend to have much + longer latency because lots of OpenGL extension requests + can queue up in the X protocol stream. __glutSetWindow + is where the finish works gets queued for indirect + contexts. */ + __glutSetWindow(window); + glFinish(); + } + if (workMask & GLUT_DEBUG_WORK) { + __glutSetWindow(window); + glutReportErrors(); + } + /* Strip out dummy, finish, and debug work bits. */ + window->workMask &= ~(GLUT_DUMMY_WORK | GLUT_FINISH_WORK | GLUT_DEBUG_WORK); + if (window->workMask) { + /* Leave on work list. */ + return window; + } else { + /* Remove current window from work list. */ + return window->prevWorkWin; + } +} + +#ifndef _WIN32 +static /* X11 implementations do not need this global. */ +#endif +void +__glutProcessWindowWorkLists(void) +{ + if (__glutWindowWorkList) { + GLUTwindow *remainder, *work; + + work = __glutWindowWorkList; + __glutWindowWorkList = NULL; + if (work) { + remainder = processWindowWorkList(work); + if (remainder) { + *beforeEnd = __glutWindowWorkList; + __glutWindowWorkList = remainder; + } + } + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutMainLoop(void) +{ +#if !defined(_WIN32) + if (!__glutDisplay) + __glutFatalUsage("main loop entered with out proper initialization."); +#endif + if (!__glutWindowListSize) + __glutFatalUsage( + "main loop entered with no windows created."); + for (;;) { + __glutProcessWindowWorkLists(); + if (__glutIdleFunc || __glutWindowWorkList) { + idleWait(); + } else { + if (__glutTimerList) { + waitForSomething(); + } else { + processEventsAndTimeouts(); + } + } + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_ext.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_ext.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_ext.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_ext.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,204 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include + +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutExtensionSupported(const char *extension) +{ + static const GLubyte *extensions = NULL; + const GLubyte *start; + GLubyte *where, *terminator; + + /* Extension names should not have spaces. */ + where = (GLubyte *) strchr(extension, ' '); + if (where || *extension == '\0') + return 0; + + if (!extensions) { + extensions = glGetString(GL_EXTENSIONS); + } + /* It takes a bit of care to be fool-proof about parsing the + OpenGL extensions string. Don't be fooled by sub-strings, + etc. */ + start = extensions; + for (;;) { + /* If your application crashes in the strstr routine below, + you are probably calling glutExtensionSupported without + having a current window. Calling glGetString without + a current OpenGL context has unpredictable results. + Please fix your program. */ + where = (GLubyte *) strstr((const char *) start, extension); + if (!where) + break; + terminator = where + strlen(extension); + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { + return 1; + } + } + start = terminator; + } + return 0; +} + + +struct name_address_pair { + const char *name; + const void *address; +}; + +static struct name_address_pair glut_functions[] = { + { "glutInit", (const void *) glutInit }, + { "glutInitDisplayMode", (const void *) glutInitDisplayMode }, + { "glutInitDisplayString", (const void *) glutInitDisplayString }, + { "glutInitWindowPosition", (const void *) glutInitWindowPosition }, + { "glutInitWindowSize", (const void *) glutInitWindowSize }, + { "glutMainLoop", (const void *) glutMainLoop }, + { "glutCreateWindow", (const void *) glutCreateWindow }, + { "glutCreateSubWindow", (const void *) glutCreateSubWindow }, + { "glutDestroyWindow", (const void *) glutDestroyWindow }, + { "glutPostRedisplay", (const void *) glutPostRedisplay }, + { "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay }, + { "glutSwapBuffers", (const void *) glutSwapBuffers }, + { "glutGetWindow", (const void *) glutGetWindow }, + { "glutSetWindow", (const void *) glutSetWindow }, + { "glutSetWindowTitle", (const void *) glutSetWindowTitle }, + { "glutSetIconTitle", (const void *) glutSetIconTitle }, + { "glutPositionWindow", (const void *) glutPositionWindow }, + { "glutReshapeWindow", (const void *) glutReshapeWindow }, + { "glutPopWindow", (const void *) glutPopWindow }, + { "glutPushWindow", (const void *) glutPushWindow }, + { "glutIconifyWindow", (const void *) glutIconifyWindow }, + { "glutShowWindow", (const void *) glutShowWindow }, + { "glutHideWindow", (const void *) glutHideWindow }, + { "glutFullScreen", (const void *) glutFullScreen }, + { "glutSetCursor", (const void *) glutSetCursor }, + { "glutWarpPointer", (const void *) glutWarpPointer }, + { "glutEstablishOverlay", (const void *) glutEstablishOverlay }, + { "glutRemoveOverlay", (const void *) glutRemoveOverlay }, + { "glutUseLayer", (const void *) glutUseLayer }, + { "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay }, + { "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay }, + { "glutShowOverlay", (const void *) glutShowOverlay }, + { "glutHideOverlay", (const void *) glutHideOverlay }, + { "glutCreateMenu", (const void *) glutCreateMenu }, + { "glutDestroyMenu", (const void *) glutDestroyMenu }, + { "glutGetMenu", (const void *) glutGetMenu }, + { "glutSetMenu", (const void *) glutSetMenu }, + { "glutAddMenuEntry", (const void *) glutAddMenuEntry }, + { "glutAddSubMenu", (const void *) glutAddSubMenu }, + { "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry }, + { "glutChangeToSubMenu", (const void *) glutChangeToSubMenu }, + { "glutRemoveMenuItem", (const void *) glutRemoveMenuItem }, + { "glutAttachMenu", (const void *) glutAttachMenu }, + { "glutDetachMenu", (const void *) glutDetachMenu }, + { "glutDisplayFunc", (const void *) glutDisplayFunc }, + { "glutReshapeFunc", (const void *) glutReshapeFunc }, + { "glutKeyboardFunc", (const void *) glutKeyboardFunc }, + { "glutMouseFunc", (const void *) glutMouseFunc }, + { "glutMotionFunc", (const void *) glutMotionFunc }, + { "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc }, + { "glutEntryFunc", (const void *) glutEntryFunc }, + { "glutVisibilityFunc", (const void *) glutVisibilityFunc }, + { "glutIdleFunc", (const void *) glutIdleFunc }, + { "glutTimerFunc", (const void *) glutTimerFunc }, + { "glutMenuStateFunc", (const void *) glutMenuStateFunc }, + { "glutSpecialFunc", (const void *) glutSpecialFunc }, + { "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc }, + { "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc }, + { "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc }, + { "glutButtonBoxFunc", (const void *) glutButtonBoxFunc }, + { "glutDialsFunc", (const void *) glutDialsFunc }, + { "glutTabletMotionFunc", (const void *) glutTabletMotionFunc }, + { "glutTabletButtonFunc", (const void *) glutTabletButtonFunc }, + { "glutMenuStatusFunc", (const void *) glutMenuStatusFunc }, + { "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc }, + { "glutWindowStatusFunc", (const void *) glutWindowStatusFunc }, + { "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc }, + { "glutSpecialUpFunc", (const void *) glutSpecialUpFunc }, + { "glutJoystickFunc", (const void *) glutJoystickFunc }, + { "glutSetColor", (const void *) glutSetColor }, + { "glutGetColor", (const void *) glutGetColor }, + { "glutCopyColormap", (const void *) glutCopyColormap }, + { "glutGet", (const void *) glutGet }, + { "glutDeviceGet", (const void *) glutDeviceGet }, + { "glutExtensionSupported", (const void *) glutExtensionSupported }, + { "glutGetModifiers", (const void *) glutGetModifiers }, + { "glutLayerGet", (const void *) glutLayerGet }, + { "glutGetProcAddress", (const void *) glutGetProcAddress }, + { "glutBitmapCharacter", (const void *) glutBitmapCharacter }, + { "glutBitmapWidth", (const void *) glutBitmapWidth }, + { "glutStrokeCharacter", (const void *) glutStrokeCharacter }, + { "glutStrokeWidth", (const void *) glutStrokeWidth }, + { "glutBitmapLength", (const void *) glutBitmapLength }, + { "glutStrokeLength", (const void *) glutStrokeLength }, + { "glutWireSphere", (const void *) glutWireSphere }, + { "glutSolidSphere", (const void *) glutSolidSphere }, + { "glutWireCone", (const void *) glutWireCone }, + { "glutSolidCone", (const void *) glutSolidCone }, + { "glutWireCube", (const void *) glutWireCube }, + { "glutSolidCube", (const void *) glutSolidCube }, + { "glutWireTorus", (const void *) glutWireTorus }, + { "glutSolidTorus", (const void *) glutSolidTorus }, + { "glutWireDodecahedron", (const void *) glutWireDodecahedron }, + { "glutSolidDodecahedron", (const void *) glutSolidDodecahedron }, + { "glutWireTeapot", (const void *) glutWireTeapot }, + { "glutSolidTeapot", (const void *) glutSolidTeapot }, + { "glutWireOctahedron", (const void *) glutWireOctahedron }, + { "glutSolidOctahedron", (const void *) glutSolidOctahedron }, + { "glutWireTetrahedron", (const void *) glutWireTetrahedron }, + { "glutSolidTetrahedron", (const void *) glutSolidTetrahedron }, + { "glutWireIcosahedron", (const void *) glutWireIcosahedron }, + { "glutSolidIcosahedron", (const void *) glutSolidIcosahedron }, + { "glutVideoResizeGet", (const void *) glutVideoResizeGet }, + { "glutSetupVideoResizing", (const void *) glutSetupVideoResizing }, + { "glutStopVideoResizing", (const void *) glutStopVideoResizing }, + { "glutVideoResize", (const void *) glutVideoResize }, + { "glutVideoPan", (const void *) glutVideoPan }, + { "glutReportErrors", (const void *) glutReportErrors }, + { "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat }, + { "glutSetKeyRepeat", (const void *) glutSetKeyRepeat }, + { "glutForceJoystickFunc", (const void *) glutForceJoystickFunc }, + { "glutGameModeString", (const void *) glutGameModeString }, + { "glutEnterGameMode", (const void *) glutEnterGameMode }, + { "glutLeaveGameMode", (const void *) glutLeaveGameMode }, + { "glutGameModeGet", (const void *) glutGameModeGet }, + { NULL, NULL } +}; + + +/* XXX This isn't an official GLUT function, yet */ +void * GLUTAPIENTRY +glutGetProcAddress(const char *procName) +{ + /* Try GLUT functions first */ + int i; + for (i = 0; glut_functions[i].name; i++) { + if (strcmp(glut_functions[i].name, procName) == 0) + return (void *) glut_functions[i].address; + } + + /* Try core GL functions */ +#if defined(_WIN32) + return (void *) wglGetProcAddress((LPCSTR) procName); + +#elif defined(__OS2PM__) + return (void *) wglGetProcAddress((char *) procName); +#elif defined(GLX_ARB_get_proc_address) + return (void *) glXGetProcAddressARB((const GLubyte *) procName); +#else + return NULL; +#endif +} + + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_fullscrn.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_fullscrn.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_fullscrn.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_fullscrn.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,38 @@ + +/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutFullScreen(void) +{ + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); +#if !defined(_WIN32) && !defined(__OS2PM__) + if (__glutMotifHints == None) { + __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", + SGI_XA__MOTIF_WM_HINTS, 0); + if (__glutMotifHints == None) { + __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); + } + } +#endif + + __glutCurrentWindow->desiredX = 0; + __glutCurrentWindow->desiredY = 0; + __glutCurrentWindow->desiredWidth = __glutScreenWidth; + __glutCurrentWindow->desiredHeight = __glutScreenHeight; + __glutCurrentWindow->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; + + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_gamemode.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_gamemode.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_gamemode.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_gamemode.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,679 @@ + +/* Copyright (c) Mark J. Kilgard, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + + +#include +#include +#include +#include + +#include "glutint.h" + +#if !defined(_WIN32) && !defined(__OS2__) +#include +#include + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif +#endif /* not _WIN32 */ + +int __glutDisplaySettingsChanged = 0; +static DisplayMode *dmodes, *currentDm = NULL; +static int ndmodes = -1; +GLUTwindow *__glutGameModeWindow = NULL; + +#ifdef TEST +static char *compstr[] = +{ + "none", "=", "!=", "<=", ">=", ">", "<", "~" +}; +static char *capstr[] = +{ + "width", "height", "bpp", "hertz", "num" +}; +#endif + +#if defined(__OS2__) +void +#else +void __cdecl +#endif +__glutCloseDownGameMode(void) +{ + if (__glutDisplaySettingsChanged) { +#ifdef _WIN32 + /* Assumes that display settings have been changed, that + is __glutDisplaySettingsChanged is true. */ + ChangeDisplaySettings(NULL, 0); +#endif + __glutDisplaySettingsChanged = 0; + } + __glutGameModeWindow = NULL; +} + +void GLUTAPIENTRY +glutLeaveGameMode(void) +{ + if (__glutGameModeWindow == NULL) { + __glutWarning("not in game mode so cannot leave game mode"); + return; + } + __glutDestroyWindow(__glutGameModeWindow, + __glutGameModeWindow); + XFlush(__glutDisplay); + __glutGameModeWindow = NULL; +} + +#ifdef _WIN32 + +/* Same values as from MSDN's SetDisp.c example. */ +#define MIN_WIDTH 400 +#define MIN_FREQUENCY 60 + +static void +initGameModeSupport(void) +{ + DEVMODE dm; + DWORD mode; + int i; + + if (ndmodes >= 0) { + /* ndmodes is initially -1 to indicate no + dmodes allocated yet. */ + return; + } + + /* Determine how many display modes there are. */ + ndmodes = 0; + mode = 0; + while (EnumDisplaySettings(NULL, mode, &dm)) { + if (dm.dmPelsWidth >= MIN_WIDTH && + (dm.dmDisplayFrequency == 0 || + dm.dmDisplayFrequency >= MIN_FREQUENCY)) { + ndmodes++; + } + mode++; + } + + /* Allocate memory for a list of all the display modes. */ + dmodes = (DisplayMode*) + malloc(ndmodes * sizeof(DisplayMode)); + + /* Now that we know how many display modes to expect, + enumerate them again and save the information in + the list we allocated above. */ + i = 0; + mode = 0; + while (EnumDisplaySettings(NULL, mode, &dm)) { + /* Try to reject any display settings that seem unplausible. */ + if (dm.dmPelsWidth >= MIN_WIDTH && + (dm.dmDisplayFrequency == 0 || + dm.dmDisplayFrequency >= MIN_FREQUENCY)) { + dmodes[i].devmode = dm; + dmodes[i].valid = 1; /* XXX Not used for now. */ + dmodes[i].cap[DM_WIDTH] = dm.dmPelsWidth; + dmodes[i].cap[DM_HEIGHT] = dm.dmPelsHeight; + dmodes[i].cap[DM_PIXEL_DEPTH] = dm.dmBitsPerPel; + if (dm.dmDisplayFrequency == 0) { + /* Guess a reasonable guess. */ + /* Lame Windows 95 version of EnumDisplaySettings. */ + dmodes[i].cap[DM_HERTZ] = 60; + } else { + dmodes[i].cap[DM_HERTZ] = dm.dmDisplayFrequency; + } + i++; + } + mode++; + } + + assert(i == ndmodes); +} + +#else + +/* X Windows version of initGameModeSupport. */ +static void +initGameModeSupport(void) +{ + if (ndmodes >= 0) { + /* ndmodes is initially -1 to indicate no + dmodes allocated yet. */ + return; + } + + /* Determine how many display modes there are. */ + ndmodes = 0; +} + +#endif + +/* This routine is based on similiar code in glut_dstr.c */ +static DisplayMode * +findMatch(DisplayMode * dmodes, int ndmodes, + Criterion * criteria, int ncriteria) +{ + DisplayMode *found; + int *bestScore, *thisScore; + int i, j, numok, result = 0, worse, better; + + found = NULL; + numok = 1; /* "num" capability is indexed from 1, + not 0. */ + + /* XXX alloca canidate. */ + bestScore = (int *) malloc(ncriteria * sizeof(int)); + if (!bestScore) { + __glutFatalError("out of memory."); + } + for (j = 0; j < ncriteria; j++) { + /* Very negative number. */ + bestScore[j] = -32768; + } + + /* XXX alloca canidate. */ + thisScore = (int *) malloc(ncriteria * sizeof(int)); + if (!thisScore) { + __glutFatalError("out of memory."); + } + + for (i = 0; i < ndmodes; i++) { + if (dmodes[i].valid) { + worse = 0; + better = 0; + + for (j = 0; j < ncriteria; j++) { + int cap, cvalue, dvalue; + + cap = criteria[j].capability; + cvalue = criteria[j].value; + if (cap == NUM) { + dvalue = numok; + } else { + dvalue = dmodes[i].cap[cap]; + } +#ifdef TEST + if (verbose) + printf(" %s %s %d to %d\n", + capstr[cap], compstr[criteria[j].comparison], cvalue, dvalue); +#endif + switch (criteria[j].comparison) { + case EQ: + result = cvalue == dvalue; + thisScore[j] = 1; + break; + case NEQ: + result = cvalue != dvalue; + thisScore[j] = 1; + break; + case LT: + result = dvalue < cvalue; + thisScore[j] = dvalue - cvalue; + break; + case GT: + result = dvalue > cvalue; + thisScore[j] = dvalue - cvalue; + break; + case LTE: + result = dvalue <= cvalue; + thisScore[j] = dvalue - cvalue; + break; + case GTE: + result = (dvalue >= cvalue); + thisScore[j] = dvalue - cvalue; + break; + case MIN: + result = dvalue >= cvalue; + thisScore[j] = cvalue - dvalue; + break; + } + +#ifdef TEST + if (verbose) + printf(" result=%d score=%d bestScore=%d\n", result, thisScore[j], bestScore[j]); +#endif + + if (result) { + if (better || thisScore[j] > bestScore[j]) { + better = 1; + } else if (thisScore[j] == bestScore[j]) { + /* Keep looking. */ + } else { + goto nextDM; + } + } else { + if (cap == NUM) { + worse = 1; + } else { + goto nextDM; + } + } + + } + + if (better && !worse) { + found = &dmodes[i]; + for (j = 0; j < ncriteria; j++) { + bestScore[j] = thisScore[j]; + } + } + numok++; + + nextDM:; + + } + } + free(bestScore); + free(thisScore); + return found; +} + +/** + * Parses strings in the form of: + * 800x600 + * 800x600:16 + * 800x600@60 + * 800x600:16@60 + * @60 + * :16 + * :16@60 + * NOTE that @ before : is not parsed. + */ +static int +specialCaseParse(char *word, Criterion * criterion, int mask) +{ + char *xstr, *response; + int got; + int width, height, bpp, hertz; + + switch(word[0]) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* The WWWxHHH case. */ + if (mask & (1 << DM_WIDTH)) { + return -1; + } + xstr = strpbrk(&word[1], "x"); + if (xstr) { + width = (int) strtol(word, &response, 0); + if (response == word || response[0] != 'x') { + /* Not a valid number OR needs to be followed by 'x'. */ + return -1; + } + height = (int) strtol(&xstr[1], &response, 0); + if (response == &xstr[1]) { + /* Not a valid number. */ + return -1; + } + criterion[0].capability = DM_WIDTH; + criterion[0].comparison = EQ; + criterion[0].value = width; + criterion[1].capability = DM_HEIGHT; + criterion[1].comparison = EQ; + criterion[1].value = height; + got = specialCaseParse(response, + &criterion[2], 1 << DM_WIDTH); + if (got >= 0) { + return got + 2; + } else { + return -1; + } + } + return -1; + case ':': + /* The :BPP case. */ + if (mask & (1 << DM_PIXEL_DEPTH)) { + return -1; + } + bpp = (int) strtol(&word[1], &response, 0); + if (response == &word[1]) { + /* Not a valid number. */ + return -1; + } + criterion[0].capability = DM_PIXEL_DEPTH; + criterion[0].comparison = EQ; + criterion[0].value = bpp; + got = specialCaseParse(response, + &criterion[1], (1 << DM_WIDTH) | (1 << DM_PIXEL_DEPTH)); + if (got >= 0) { + return got + 1; + } else { + return -1; + } + case '@': + /* The @HZ case. */ + if (mask & (1 << DM_HERTZ)) { + return -1; + } + hertz = (int) strtol(&word[1], &response, 0); + if (response == &word[1]) { + /* Not a valid number. */ + return -1; + } + criterion[0].capability = DM_HERTZ; + criterion[0].comparison = EQ; + criterion[0].value = hertz; + got = specialCaseParse(response, + &criterion[1], ~DM_HERTZ); + if (got >= 0) { + return got + 1; + } else { + return -1; + } + case '\0': + return 0; + } + return -1; +} + +/* This routine is based on similiar code in glut_dstr.c */ +static int +parseCriteria(char *word, Criterion * criterion) +{ + char *cstr, *vstr, *response; + int comparator, value = 0; + + cstr = strpbrk(word, "=>': + if (cstr[1] == '=') { + comparator = GTE; + vstr = &cstr[2]; + } else { + comparator = GT; + vstr = &cstr[1]; + } + break; + case '<': + if (cstr[1] == '=') { + comparator = LTE; + vstr = &cstr[2]; + } else { + comparator = LT; + vstr = &cstr[1]; + } + break; + case '!': + if (cstr[1] == '=') { + comparator = NEQ; + vstr = &cstr[2]; + } else { + return -1; + } + break; + default: + return -1; + } + value = (int) strtol(vstr, &response, 0); + if (response == vstr) { + /* Not a valid number. */ + return -1; + } + *cstr = '\0'; + } else { + comparator = NONE; + } + switch (word[0]) { + case 'b': + if (!strcmp(word, "bpp")) { + criterion[0].capability = DM_PIXEL_DEPTH; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'h': + if (!strcmp(word, "height")) { + criterion[0].capability = DM_HEIGHT; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + if (!strcmp(word, "hertz")) { + criterion[0].capability = DM_HERTZ; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'n': + if (!strcmp(word, "num")) { + criterion[0].capability = DM_NUM; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + case 'w': + if (!strcmp(word, "width")) { + criterion[0].capability = DM_WIDTH; + if (comparator == NONE) { + return -1; + } else { + criterion[0].comparison = comparator; + criterion[0].value = value; + return 1; + } + } + return -1; + } + if (comparator == NONE) { + return specialCaseParse(word, criterion, 0); + } + return -1; +} + +/* This routine is based on similiar code in glut_dstr.c */ +static Criterion * +parseDisplayString(const char *display, int *ncriteria) +{ + Criterion *criteria = NULL; + int n, parsed; + char *copy, *word; + + copy = __glutStrdup(display); + /* Attempt to estimate how many criteria entries should be + needed. */ + n = 0; + word = strtok(copy, " \t"); + while (word) { + n++; + word = strtok(NULL, " \t"); + } + /* Allocate number of words of criteria. A word + could contain as many as four criteria in the + worst case. Example: 800x600:16@60 */ + criteria = (Criterion *) malloc(4 * n * sizeof(Criterion)); + if (!criteria) { + __glutFatalError("out of memory."); + } + + /* Re-copy the copy of the display string. */ + strcpy(copy, display); + + n = 0; + word = strtok(copy, " \t"); + while (word) { + parsed = parseCriteria(word, &criteria[n]); + if (parsed >= 0) { + n += parsed; + } else { + __glutWarning("Unrecognized game mode string word: %s (ignoring)\n", word); + } + word = strtok(NULL, " \t"); + } + + free(copy); + *ncriteria = n; + return criteria; +} + +void GLUTAPIENTRY +glutGameModeString(const char *string) +{ + Criterion *criteria; + int ncriteria; + + initGameModeSupport(); + criteria = parseDisplayString(string, &ncriteria); + currentDm = findMatch(dmodes, ndmodes, criteria, ncriteria); + free(criteria); +} + +int GLUTAPIENTRY +glutEnterGameMode(void) +{ + GLUTwindow *window; + int width, height; + Window win; + + if (__glutMappedMenu) { + __glutFatalUsage("entering game mode not allowed while menus in use"); + } + if (__glutGameModeWindow) { + /* Already in game mode, so blow away game mode + window so apps can change resolutions. */ + window = __glutGameModeWindow; + /* Setting the game mode window to NULL tricks + the window destroy code into not undoing the + screen display change since we plan on immediately + doing another mode change. */ + __glutGameModeWindow = NULL; + __glutDestroyWindow(window, window); + } + + /* Assume default screen size until we find out if we + can actually change the display settings. */ + width = __glutScreenWidth; + height = __glutScreenHeight; + + if (currentDm) { +#ifdef _WIN32 + LONG status; + static int registered = 0; + + status = ChangeDisplaySettings(¤tDm->devmode, + CDS_FULLSCREEN); + if (status == DISP_CHANGE_SUCCESSFUL) { + __glutDisplaySettingsChanged = 1; + width = currentDm->cap[DM_WIDTH]; + height = currentDm->cap[DM_HEIGHT]; + if (!registered) { + atexit(__glutCloseDownGameMode); + registered = 1; + } + } else { + /* Switch back to default resolution. */ + ChangeDisplaySettings(NULL, 0); + } +#endif + } + + window = __glutCreateWindow(NULL, 0, 0, + width, height, /* game mode */ 1); + win = window->win; + +#if !defined(_WIN32) && !defined(__OS2__) + if (__glutMotifHints == None) { + __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", + SGI_XA__MOTIF_WM_HINTS, 0); + if (__glutMotifHints == None) { + __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); + } + } + + /* Game mode window is a toplevel window. */ + XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); +#endif + + /* Schedule the fullscreen property to be added and to + make sure the window is configured right. Win32 + doesn't need this. */ + window->desiredX = 0; + window->desiredY = 0; + window->desiredWidth = width; + window->desiredHeight = height; + window->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; +#ifdef _WIN32 + /* Win32 does not want to use GLUT_FULL_SCREEN_WORK + for game mode because we need to be maximizing + the window in game mode, not just sizing it to + take up the full screen. The Win32-ness of game + mode happens when you pass 1 in the gameMode parameter + to __glutCreateWindow above. A gameMode of creates + a WS_POPUP window, not a standard WS_OVERLAPPEDWINDOW + window. WS_POPUP ensures the taskbar is hidden. */ + __glutPutOnWorkList(window, + GLUT_CONFIGURE_WORK); +#else + __glutPutOnWorkList(window, + GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); +#endif + + __glutGameModeWindow = window; + return window->num + 1; +} + +int GLUTAPIENTRY +glutGameModeGet(GLenum mode) +{ + switch (mode) { + case GLUT_GAME_MODE_ACTIVE: + return __glutGameModeWindow != NULL; + case GLUT_GAME_MODE_POSSIBLE: + return currentDm != NULL; + case GLUT_GAME_MODE_WIDTH: + return currentDm ? currentDm->cap[DM_WIDTH] : -1; + case GLUT_GAME_MODE_HEIGHT: + return currentDm ? currentDm->cap[DM_HEIGHT] : -1; + case GLUT_GAME_MODE_PIXEL_DEPTH: + return currentDm ? currentDm->cap[DM_PIXEL_DEPTH] : -1; + case GLUT_GAME_MODE_REFRESH_RATE: + return currentDm ? currentDm->cap[DM_HERTZ] : -1; + case GLUT_GAME_MODE_DISPLAY_CHANGED: + return __glutDisplaySettingsChanged; + default: + return -1; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_get.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_get.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_get.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_get.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,232 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include /* SunOS 4 needs NULL defined for GETTIMEOFDAY macro. */ +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutGet(GLenum param) +{ + Window win, root; + int x, y, value; + unsigned int width, height, border, depth; + + switch (param) { + case GLUT_INIT_WINDOW_X: + return __glutInitX; + case GLUT_INIT_WINDOW_Y: + return __glutInitY; + case GLUT_INIT_WINDOW_WIDTH: + return __glutInitWidth; + case GLUT_INIT_WINDOW_HEIGHT: + return __glutInitHeight; + case GLUT_INIT_DISPLAY_MODE: + return __glutDisplayMode; + case GLUT_WINDOW_X: + XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, + __glutRoot, 0, 0, &x, &y, &win); + return x; + case GLUT_WINDOW_Y: + XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, + __glutRoot, 0, 0, &x, &y, &win); + return y; + case GLUT_WINDOW_WIDTH: + if (!__glutCurrentWindow->reshape) { + XGetGeometry(__glutDisplay, __glutCurrentWindow->win, + &root, &x, &y, + &width, &height, &border, &depth); + return width; + } + return __glutCurrentWindow->width; + case GLUT_WINDOW_HEIGHT: + if (!__glutCurrentWindow->reshape) { + XGetGeometry(__glutDisplay, __glutCurrentWindow->win, + &root, &x, &y, + &width, &height, &border, &depth); + return height; + } + return __glutCurrentWindow->height; +#ifdef __OS2__ + #define GET_CONFIG(attrib) \ + { if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) \ + glXGetConfig( __glutCurrentWindow->vis, attrib, &value); \ + else \ + glXGetConfig(__glutCurrentWindow->overlay->vis, attrib, &value); \ + } \ + +#else + +#define GET_CONFIG(attrib) { \ + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { \ + glXGetConfig(__glutDisplay, __glutCurrentWindow->vis, \ + attrib, &value); \ + } else { \ + glXGetConfig(__glutDisplay, __glutCurrentWindow->overlay->vis, \ + attrib, &value); \ + } \ +} +#endif + + case GLUT_WINDOW_BUFFER_SIZE: + GET_CONFIG(GLX_BUFFER_SIZE); + return value; + case GLUT_WINDOW_STENCIL_SIZE: + GET_CONFIG(GLX_STENCIL_SIZE); + return value; + case GLUT_WINDOW_DEPTH_SIZE: + GET_CONFIG(GLX_DEPTH_SIZE); + return value; + case GLUT_WINDOW_RED_SIZE: + GET_CONFIG(GLX_RED_SIZE); + return value; + case GLUT_WINDOW_GREEN_SIZE: + GET_CONFIG(GLX_GREEN_SIZE); + return value; + case GLUT_WINDOW_BLUE_SIZE: + GET_CONFIG(GLX_BLUE_SIZE); + return value; + case GLUT_WINDOW_ALPHA_SIZE: + GET_CONFIG(GLX_ALPHA_SIZE); + return value; + case GLUT_WINDOW_ACCUM_RED_SIZE: + GET_CONFIG(GLX_ACCUM_RED_SIZE); + return value; + case GLUT_WINDOW_ACCUM_GREEN_SIZE: + GET_CONFIG(GLX_ACCUM_GREEN_SIZE); + return value; + case GLUT_WINDOW_ACCUM_BLUE_SIZE: + GET_CONFIG(GLX_ACCUM_BLUE_SIZE); + return value; + case GLUT_WINDOW_ACCUM_ALPHA_SIZE: + GET_CONFIG(GLX_ACCUM_ALPHA_SIZE); + return value; + case GLUT_WINDOW_DOUBLEBUFFER: + GET_CONFIG(GLX_DOUBLEBUFFER); + return value; + case GLUT_WINDOW_RGBA: + GET_CONFIG(GLX_RGBA); + return value; + case GLUT_WINDOW_COLORMAP_SIZE: + GET_CONFIG(GLX_RGBA); + if (value) { + return 0; + } else { +#if defined(_WIN32) || defined(__OS2__) + /* KLUDGE: we always assume 256 colors in CI mode on + Win32 */ + return 256; +#else + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + return __glutCurrentWindow->vis->visual->map_entries; + } else { + return __glutCurrentWindow->overlay->vis->visual->map_entries; + } +#endif /* _WIN32 */ + } + case GLUT_WINDOW_PARENT: + return __glutCurrentWindow->parent ? + __glutCurrentWindow->parent->num + 1 : 0; + case GLUT_WINDOW_NUM_CHILDREN: + { + int num = 0; + GLUTwindow *children = __glutCurrentWindow->children; + + while (children) { + num++; + children = children->siblings; + } + return num; + } + case GLUT_WINDOW_NUM_SAMPLES: +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) + if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) { + GET_CONFIG(GLX_SAMPLES_SGIS); + return value; + } else { + return 0; + } +#else + /* Independent of GLX server support, multisampling not + supported by GLX client-side. */ + return 0; +#endif + case GLUT_WINDOW_STEREO: + GET_CONFIG(GLX_STEREO); + return value; + case GLUT_WINDOW_CURSOR: + return __glutCurrentWindow->cursor; + case GLUT_SCREEN_WIDTH: + return DisplayWidth(__glutDisplay, __glutScreen); + case GLUT_SCREEN_HEIGHT: + return DisplayHeight(__glutDisplay, __glutScreen); + case GLUT_SCREEN_WIDTH_MM: + return DisplayWidthMM(__glutDisplay, __glutScreen); + case GLUT_SCREEN_HEIGHT_MM: + return DisplayHeightMM(__glutDisplay, __glutScreen); + case GLUT_MENU_NUM_ITEMS: + return __glutCurrentMenu->num; + case GLUT_DISPLAY_MODE_POSSIBLE: + { + XVisualInfo *vi; + Bool dummy, visAlloced; + void *fbc; + +#if defined(_WIN32) + /* Our fake glXChooseVisual (which is called by + __glutDetermineVisual) needs an HDC to work with, so grab one + from the "root" window. */ + XHDC = GetDC(GetDesktopWindow()); +#endif + vi = __glutDetermineWindowVisual(&dummy, &visAlloced, &fbc); +#if defined(_WIN32) + ReleaseDC(GetDesktopWindow(), XHDC); +#endif + if (vi) { + if (visAlloced) + XFree(vi); + return 1; + } + return 0; + } + case GLUT_ELAPSED_TIME: + { +#ifdef OLD_VMS + struct timeval6 elapsed, beginning, now; +#else + struct timeval elapsed, beginning, now; +#endif + + __glutInitTime(&beginning); + GETTIMEOFDAY(&now); + TIMEDELTA(elapsed, now, beginning); + /* Return elapsed milliseconds. */ +#if defined(__vms) && ( __VMS_VER < 70000000 ) + return (int) (elapsed.val / TICKS_PER_MILLISECOND); +#else + return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000)); +#endif + } + case GLUT_WINDOW_FORMAT_ID: +#if defined(__OS2__) + return wglGetPixelFormat(__glutCurrentWindow->hdc); +#elif defined(_WIN32) + return GetPixelFormat(__glutCurrentWindow->hdc); +#else + if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { + return (int) __glutCurrentWindow->vis->visualid; + } else { + return (int) __glutCurrentWindow->overlay->vis->visualid; + } +#endif + default: + __glutWarning("invalid glutGet parameter: %d", param); + return -1; + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_hel10.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_hel10.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_hel10.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_hel10.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1781 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica10 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica10 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch255 = {4,10,0,2,5,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {5,10,0,2,6,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {4,11,0,2,5,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {4,8,0,0,5,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {4,9,0,0,5,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch250 = {4,9,0,0,5,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {4,9,0,0,5,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0x70,0x88,0xc8,0xa8,0x98,0x74, +}; + +static const BitmapCharRec ch248 = {6,6,0,0,6,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,0,-1,6,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch246 = {5,8,0,0,6,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {5,9,0,0,6,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch244 = {5,9,0,0,6,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {5,9,0,0,6,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {5,9,0,0,6,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch241 = {4,9,0,0,5,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50, +}; + +static const BitmapCharRec ch240 = {5,9,0,0,6,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,8,0,0,2,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,9,1,0,2,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch237 = {2,9,0,0,2,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {2,9,1,0,2,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50, +}; + +static const BitmapCharRec ch235 = {4,8,0,0,5,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch234 = {4,9,0,0,5,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20, +}; + +static const BitmapCharRec ch233 = {4,9,0,0,5,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch232 = {4,9,0,0,5,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch231 = {4,8,0,2,5,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x6c,0x92,0x90,0x7e,0x12,0xec, +}; + +static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20, +}; + +static const BitmapCharRec ch229 = {5,9,0,0,5,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50, +}; + +static const BitmapCharRec ch228 = {5,8,0,0,5,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50, +}; + +static const BitmapCharRec ch227 = {5,9,0,0,5,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch226 = {5,9,0,0,5,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {5,9,0,0,5,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch224 = {5,9,0,0,5,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch223 = {4,8,0,0,5,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {5,8,-1,0,7,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,11,0,0,7,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, +}; + +static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {6,11,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch218 = {6,11,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,11,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, +}; + +static const BitmapCharRec ch216 = {6,10,-1,1,8,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,0,-1,6,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48, +}; + +static const BitmapCharRec ch214 = {6,10,-1,0,8,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch213 = {6,11,-1,0,8,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch212 = {6,11,-1,0,8,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch211 = {6,11,-1,0,8,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch210 = {6,11,-1,0,8,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch209 = {6,11,-1,0,8,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78, +}; + +static const BitmapCharRec ch208 = {7,8,0,0,8,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,10,0,0,3,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,11,0,0,3,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch205 = {2,11,-1,0,3,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {2,11,0,0,3,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50, +}; + +static const BitmapCharRec ch203 = {5,10,-1,0,7,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch202 = {5,11,-1,0,7,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch201 = {5,11,-1,0,7,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch200 = {5,11,-1,0,7,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch199 = {6,10,-1,2,8,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80, +}; + +static const BitmapCharRec ch198 = {9,8,0,0,10,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,11,0,0,7,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,10,0,0,7,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,11,0,0,7,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,11,0,0,7,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,11,0,0,7,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,11,0,0,7,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {4,8,-1,2,6,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0, +}; + +static const BitmapCharRec ch190 = {9,8,0,0,9,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42, +}; + +static const BitmapCharRec ch189 = {8,8,0,0,9,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0, +}; + +static const BitmapCharRec ch188 = {9,8,0,0,9,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x28,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {5,5,0,0,6,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0xe0,0xa0,0xe0, +}; + +static const BitmapCharRec ch186 = {3,5,0,-3,4,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {2,4,0,-3,3,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x40, +}; + +static const BitmapCharRec ch184 = {2,2,0,2,3,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0, +}; + +static const BitmapCharRec ch183 = {2,1,0,-3,3,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, +}; + +static const BitmapCharRec ch182 = {6,10,0,2,6,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch181 = {4,8,0,2,5,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-6,3,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0xe0, +}; + +static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xe0,0x40,0xa0,0x60, +}; + +static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xe0, +}; + +static const BitmapCharRec ch175 = {3,1,0,-7,3,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x38,0x44,0xaa,0xb2,0xba,0x44,0x38, +}; + +static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xe0, +}; + +static const BitmapCharRec ch173 = {3,1,0,-3,4,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x8,0x8,0xf8, +}; + +static const BitmapCharRec ch172 = {5,3,-1,-2,7,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x28,0x50,0xa0,0x50,0x28, +}; + +static const BitmapCharRec ch171 = {5,5,0,0,6,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xe0, +}; + +static const BitmapCharRec ch170 = {3,5,0,-3,4,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38, +}; + +static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,0,-7,3,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,10,0,2,6,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,10,-1,2,3,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch165 = {5,8,0,0,6,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x90,0x60,0x90,0x90,0x60,0x90, +}; + +static const BitmapCharRec ch164 = {4,6,0,-1,5,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30, +}; + +static const BitmapCharRec ch163 = {5,8,0,0,6,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {5,8,0,1,6,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,8,-1,2,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,3,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,3,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch125 = {3,10,0,2,3,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,10,-1,2,3,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch123 = {3,10,0,2,3,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x80,0x40,0x20,0x10,0xf0, +}; + +static const BitmapCharRec ch122 = {4,6,0,0,5,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90, +}; + +static const BitmapCharRec ch121 = {4,8,0,2,5,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x88,0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch120 = {5,6,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x28,0x28,0x54,0x54,0x92,0x92, +}; + +static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x20,0x50,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,6,0,0,6,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x70,0x90,0x90,0x90,0x90,0x90, +}; + +static const BitmapCharRec ch117 = {4,6,0,0,5,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {3,8,0,0,4,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x60,0x90,0x10,0x60,0x90,0x60, +}; + +static const BitmapCharRec ch115 = {4,6,0,0,5,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x80,0x80,0x80,0x80,0xc0,0xa0, +}; + +static const BitmapCharRec ch114 = {3,6,0,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch113 = {5,8,0,2,6,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch112 = {5,8,0,2,6,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x70,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch111 = {5,6,0,0,6,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x88,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch110 = {5,6,0,0,6,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x92,0x92,0x92,0x92,0x92,0xec, +}; + +static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch108 = {1,8,0,0,2,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {4,8,0,0,5,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch106 = {1,9,0,1,2,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch105 = {1,8,0,0,2,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,8,0,0,6,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch103 = {5,8,0,2,6,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,8,0,0,4,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x60,0x90,0x80,0xf0,0x90,0x60, +}; + +static const BitmapCharRec ch101 = {4,6,0,0,5,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8, +}; + +static const BitmapCharRec ch100 = {5,8,0,0,6,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x60,0x90,0x80,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch99 = {4,6,0,0,5,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {5,8,0,0,6,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x68,0x90,0x90,0x70,0x10,0xe0, +}; + +static const BitmapCharRec ch97 = {5,6,0,0,5,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x80,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,3,0,-5,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfc, +}; + +static const BitmapCharRec ch95 = {6,1,0,2,6,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x50,0x20,0x20, +}; + +static const BitmapCharRec ch94 = {5,5,0,-3,6,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,10,0,2,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {3,8,0,0,3,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,10,-1,2,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch90 = {5,8,-1,0,7,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82, +}; + +static const BitmapCharRec ch89 = {7,8,0,0,7,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch88 = {5,8,-1,0,7,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +}; + +static const BitmapCharRec ch87 = {9,8,0,0,9,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,8,0,0,7,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,8,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, +}; + +static const BitmapCharRec ch84 = {5,8,0,0,5,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch83 = {5,8,-1,0,7,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch82 = {5,8,-1,0,7,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch81 = {7,9,-1,1,8,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch80 = {5,8,-1,0,7,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78, +}; + +static const BitmapCharRec ch79 = {6,8,-1,0,8,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4, +}; + +static const BitmapCharRec ch78 = {6,8,-1,0,8,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82, +}; + +static const BitmapCharRec ch77 = {7,8,-1,0,9,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {4,8,-1,0,6,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88, +}; + +static const BitmapCharRec ch75 = {5,8,-1,0,7,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10, +}; + +static const BitmapCharRec ch74 = {4,8,0,0,5,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch73 = {1,8,-1,0,3,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch72 = {6,8,-1,0,8,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch71 = {6,8,-1,0,8,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch70 = {5,8,-1,0,6,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch69 = {5,8,-1,0,7,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0, +}; + +static const BitmapCharRec ch68 = {6,8,-1,0,8,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch67 = {6,8,-1,0,8,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, +}; + +static const BitmapCharRec ch66 = {5,8,-1,0,7,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10, +}; + +static const BitmapCharRec ch65 = {7,8,0,0,7,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40, +0x20,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch64 = {10,10,0,2,11,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60, +}; + +static const BitmapCharRec ch63 = {4,8,-1,0,6,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0x80,0x40,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch62 = {3,5,-1,-1,6,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf0,0x0,0xf0, +}; + +static const BitmapCharRec ch61 = {4,3,0,-2,5,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x20,0x40,0x80,0x40,0x20, +}; + +static const BitmapCharRec ch60 = {3,5,-1,-1,6,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, +}; + +static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch57 = {5,8,0,0,6,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch56 = {5,8,0,0,6,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch55 = {5,8,0,0,6,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch54 = {5,8,0,0,6,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch53 = {5,8,0,0,6,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10, +}; + +static const BitmapCharRec ch52 = {5,8,0,0,6,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch51 = {5,8,0,0,6,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch50 = {5,8,0,0,6,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch49 = {2,8,-1,0,6,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch48 = {5,8,0,0,6,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20, +}; + +static const BitmapCharRec ch47 = {3,8,0,0,3,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf8, +}; + +static const BitmapCharRec ch45 = {5,1,-1,-3,7,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch44 = {2,3,0,2,3,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,0,-1,6,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,0,-5,4,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,10,-1,2,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,10,0,2,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch39 = {2,3,-1,-5,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20, +}; + +static const BitmapCharRec ch38 = {6,8,-1,0,8,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64, +}; + +static const BitmapCharRec ch37 = {8,8,0,0,9,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {5,9,0,1,6,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0xf8,0x28,0x7c,0x28,0x28, +}; + +static const BitmapCharRec ch35 = {6,7,0,0,6,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,2,-1,-6,4,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,8,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {0,0,0,0,3,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,3,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +#if !defined(__IBMCPP__) +const +#endif +BitmapFontRec glutBitmapHelvetica10 = { +"-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_hel12.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_hel12.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_hel12.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_hel12.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1791 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica12 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica12 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50, +}; + +static const BitmapCharRec ch255 = {5,12,-1,3,7,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch254 = {5,12,-1,3,7,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch253 = {5,13,-1,3,7,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50, +}; + +static const BitmapCharRec ch252 = {5,9,-1,0,7,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch251 = {5,10,-1,0,7,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch250 = {5,10,-1,0,7,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch249 = {5,10,-1,0,7,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a, +}; + +static const BitmapCharRec ch248 = {7,7,0,0,7,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x20,0x0,0xf8,0x0,0x20, +}; + +static const BitmapCharRec ch247 = {5,5,-1,-1,7,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch246 = {5,9,-1,0,7,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch245 = {5,10,-1,0,7,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch244 = {5,10,-1,0,7,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch243 = {5,10,-1,0,7,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch242 = {5,10,-1,0,7,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch241 = {5,10,-1,0,7,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68, +}; + +static const BitmapCharRec ch240 = {5,10,-1,0,7,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch239 = {3,9,0,0,3,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch238 = {3,10,0,0,3,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch237 = {2,10,-1,0,3,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch236 = {2,10,0,0,3,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch235 = {5,9,-1,0,7,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch234 = {5,10,-1,0,7,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch233 = {5,10,-1,0,7,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40, +}; + +static const BitmapCharRec ch232 = {5,10,-1,0,7,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch231 = {5,10,-1,3,7,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0, +}; + +static const BitmapCharRec ch230 = {9,7,-1,0,11,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30, +}; + +static const BitmapCharRec ch229 = {6,10,-1,0,7,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50, +}; + +static const BitmapCharRec ch228 = {6,9,-1,0,7,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28, +}; + +static const BitmapCharRec ch227 = {6,10,-1,0,7,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20, +}; + +static const BitmapCharRec ch226 = {6,10,-1,0,7,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10, +}; + +static const BitmapCharRec ch225 = {6,10,-1,0,7,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch224 = {6,10,-1,0,7,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch223 = {5,9,-1,0,7,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80, +}; + +static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch221 = {7,12,-1,0,9,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, +}; + +static const BitmapCharRec ch220 = {6,11,-1,0,8,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch219 = {6,12,-1,0,8,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch218 = {6,12,-1,0,8,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch217 = {6,12,-1,0,8,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80, +0x21,0x0,0x1e,0x80,0x0,0x40, +}; + +static const BitmapCharRec ch216 = {10,11,0,1,10,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x88,0x50,0x20,0x50,0x88, +}; + +static const BitmapCharRec ch215 = {5,5,-1,-1,7,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24, +}; + +static const BitmapCharRec ch214 = {8,11,-1,0,10,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch213 = {8,12,-1,0,10,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8, +}; + +static const BitmapCharRec ch212 = {8,12,-1,0,10,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4, +}; + +static const BitmapCharRec ch211 = {8,12,-1,0,10,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10, +}; + +static const BitmapCharRec ch210 = {8,12,-1,0,10,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch209 = {7,12,-1,0,9,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c, +}; + +static const BitmapCharRec ch208 = {8,9,0,0,9,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, +}; + +static const BitmapCharRec ch207 = {3,11,0,0,3,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, +}; + +static const BitmapCharRec ch206 = {3,12,0,0,3,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, +}; + +static const BitmapCharRec ch205 = {2,12,-1,0,3,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, +}; + +static const BitmapCharRec ch204 = {2,12,0,0,3,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28, +}; + +static const BitmapCharRec ch203 = {6,11,-1,0,8,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch202 = {6,12,-1,0,8,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch201 = {6,12,-1,0,8,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch200 = {6,12,-1,0,8,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch199 = {7,12,-1,3,9,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0, +0x1f,0x80, +}; + +static const BitmapCharRec ch198 = {9,9,-1,0,11,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10, +}; + +static const BitmapCharRec ch197 = {7,12,-1,0,9,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28, +}; + +static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14, +}; + +static const BitmapCharRec ch195 = {7,12,-1,0,9,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10, +}; + +static const BitmapCharRec ch194 = {7,12,-1,0,9,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8, +}; + +static const BitmapCharRec ch193 = {7,12,-1,0,9,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20, +}; + +static const BitmapCharRec ch192 = {7,12,-1,0,9,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20, +}; + +static const BitmapCharRec ch191 = {5,9,-1,3,7,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0, +0xe1,0x0, +}; + +static const BitmapCharRec ch190 = {9,9,0,0,10,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0, +0x41,0x0, +}; + +static const BitmapCharRec ch189 = {9,9,0,0,10,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0, +0x41,0x0, +}; + +static const BitmapCharRec ch188 = {9,9,0,0,10,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0xa0,0x50,0x28,0x50,0xa0, +}; + +static const BitmapCharRec ch187 = {5,5,-1,-1,7,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xe0,0x0,0xe0,0xa0,0xe0, +}; + +static const BitmapCharRec ch186 = {3,5,-1,-4,5,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x40,0x40,0x40,0xc0,0x40, +}; + +static const BitmapCharRec ch185 = {2,5,-1,-3,4,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xc0,0x20,0x20,0x40, +}; + +static const BitmapCharRec ch184 = {3,4,0,3,3,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0x80, +}; + +static const BitmapCharRec ch183 = {1,1,-1,-3,3,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c, +}; + +static const BitmapCharRec ch182 = {6,12,0,3,7,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch181 = {5,10,-1,3,7,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x40, +}; + +static const BitmapCharRec ch180 = {2,2,0,-8,2,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0xc0,0x20,0x40,0x20,0xe0, +}; + +static const BitmapCharRec ch179 = {3,5,0,-3,4,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf0,0x40,0x20,0x90,0x60, +}; + +static const BitmapCharRec ch178 = {4,5,0,-3,4,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch177 = {5,7,-1,0,7,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x60,0x90,0x90,0x60, +}; + +static const BitmapCharRec ch176 = {4,4,0,-4,5,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xf0, +}; + +static const BitmapCharRec ch175 = {4,1,0,-8,4,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0, +0x3e,0x0, +}; + +static const BitmapCharRec ch174 = {9,9,-1,0,11,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xf0, +}; + +static const BitmapCharRec ch173 = {4,1,0,-3,5,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x4,0x4,0x4,0xfc, +}; + +static const BitmapCharRec ch172 = {6,4,-1,-2,8,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x28,0x50,0xa0,0x50,0x28, +}; + +static const BitmapCharRec ch171 = {5,5,-1,-1,7,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xe0,0x0,0xa0,0x20,0xe0, +}; + +static const BitmapCharRec ch170 = {3,5,-1,-4,5,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0, +0x3e,0x0, +}; + +static const BitmapCharRec ch169 = {9,9,-1,0,11,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xa0, +}; + +static const BitmapCharRec ch168 = {3,1,0,-8,3,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch167 = {5,12,0,3,6,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch166 = {1,11,-1,2,3,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88, +}; + +static const BitmapCharRec ch165 = {5,9,-1,0,7,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0x84,0x78,0x48,0x48,0x78,0x84, +}; + +static const BitmapCharRec ch164 = {6,6,0,-1,7,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30, +}; + +static const BitmapCharRec ch163 = {5,9,-1,0,7,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10, +}; + +static const BitmapCharRec ch162 = {5,9,-1,1,7,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch161 = {1,10,-1,3,3,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,4,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,4,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x98,0x64, +}; + +static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0, +}; + +static const BitmapCharRec ch125 = {4,12,0,3,4,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch124 = {1,12,-1,3,3,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, +}; + +static const BitmapCharRec ch123 = {4,12,0,3,4,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xf0,0x80,0x40,0x40,0x20,0x10,0xf0, +}; + +static const BitmapCharRec ch122 = {4,7,-1,0,6,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch121 = {5,10,-1,3,7,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0x84,0x84,0x48,0x30,0x30,0x48,0x84, +}; + +static const BitmapCharRec ch120 = {6,7,0,0,6,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +}; + +static const BitmapCharRec ch119 = {9,7,0,0,9,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x20,0x20,0x50,0x50,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch118 = {5,7,-1,0,7,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x68,0x98,0x88,0x88,0x88,0x88,0x88, +}; + +static const BitmapCharRec ch117 = {5,7,-1,0,7,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, +}; + +static const BitmapCharRec ch116 = {3,9,0,0,3,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x60,0x90,0x10,0x60,0x80,0x90,0x60, +}; + +static const BitmapCharRec ch115 = {4,7,-1,0,6,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0x80,0x80,0x80,0x80,0x80,0xc0,0xa0, +}; + +static const BitmapCharRec ch114 = {3,7,-1,0,4,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch113 = {5,10,-1,3,7,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch112 = {5,10,-1,3,7,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch111 = {5,7,-1,0,7,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0, +}; + +static const BitmapCharRec ch110 = {5,7,-1,0,7,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0x92,0x92,0x92,0x92,0x92,0xda,0xa4, +}; + +static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch108 = {1,9,-1,0,3,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80, +}; + +static const BitmapCharRec ch107 = {5,9,-1,0,6,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40, +}; + +static const BitmapCharRec ch106 = {2,12,0,3,3,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, +}; + +static const BitmapCharRec ch105 = {1,9,-1,0,3,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch104 = {5,9,-1,0,7,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, +}; + +static const BitmapCharRec ch103 = {5,10,-1,3,7,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, +}; + +static const BitmapCharRec ch102 = {4,9,0,0,3,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x70,0x88,0x80,0xf8,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch101 = {5,7,-1,0,7,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8, +}; + +static const BitmapCharRec ch100 = {5,9,-1,0,7,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x70,0x88,0x80,0x80,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch99 = {5,7,-1,0,7,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, +}; + +static const BitmapCharRec ch98 = {5,9,-1,0,7,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x74,0x88,0x88,0x78,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch97 = {6,7,-1,0,7,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,3,0,-6,3,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xfe, +}; + +static const BitmapCharRec ch95 = {7,1,0,2,7,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x88,0x50,0x20, +}; + +static const BitmapCharRec ch94 = {5,3,0,-5,6,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, +}; + +static const BitmapCharRec ch93 = {2,12,0,3,3,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80, +}; + +static const BitmapCharRec ch92 = {4,9,0,0,4,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, +}; + +static const BitmapCharRec ch91 = {2,12,-1,3,3,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, +}; + +static const BitmapCharRec ch90 = {7,9,-1,0,9,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch89 = {7,9,-1,0,9,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82, +}; + +static const BitmapCharRec ch88 = {7,9,-1,0,9,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80, +0x88,0x80, +}; + +static const BitmapCharRec ch87 = {9,9,-1,0,11,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, +}; + +static const BitmapCharRec ch86 = {7,9,-1,0,9,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, +}; + +static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, +}; + +static const BitmapCharRec ch84 = {7,9,0,0,7,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78, +}; + +static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c, +}; + +static const BitmapCharRec ch81 = {8,9,-1,0,10,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c, +}; + +static const BitmapCharRec ch79 = {8,9,-1,0,10,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82, +}; + +static const BitmapCharRec ch78 = {7,9,-1,0,9,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80, +0x80,0x80, +}; + +static const BitmapCharRec ch77 = {9,9,-1,0,11,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch76 = {5,9,-1,0,7,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84, +}; + +static const BitmapCharRec ch75 = {7,9,-1,0,8,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8, +}; + +static const BitmapCharRec ch74 = {5,9,-1,0,7,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch73 = {1,9,-1,0,3,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, +}; + +static const BitmapCharRec ch72 = {7,9,-1,0,9,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch71 = {7,9,-1,0,9,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc, +}; + +static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8, +}; + +static const BitmapCharRec ch68 = {7,9,-1,0,9,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, +}; + +static const BitmapCharRec ch67 = {7,9,-1,0,9,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8, +}; + +static const BitmapCharRec ch66 = {6,9,-1,0,8,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10, +}; + +static const BitmapCharRec ch65 = {7,9,-1,0,9,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40, +0x60,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch64 = {10,10,-1,1,12,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch63 = {5,9,-1,0,7,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0x30,0xc,0x30,0xc0, +}; + +static const BitmapCharRec ch62 = {6,5,-1,-1,7,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xf8,0x0,0xf8, +}; + +static const BitmapCharRec ch61 = {5,3,-1,-2,7,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0xc,0x30,0xc0,0x30,0xc, +}; + +static const BitmapCharRec ch60 = {6,5,0,-1,7,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, +}; + +static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0x80,0x0,0x0,0x0,0x0,0x80, +}; + +static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch57 = {5,9,-1,0,7,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch56 = {5,9,-1,0,7,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8, +}; + +static const BitmapCharRec ch55 = {5,9,-1,0,7,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, +}; + +static const BitmapCharRec ch54 = {5,9,-1,0,7,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, +}; + +static const BitmapCharRec ch53 = {5,9,-1,0,7,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8, +}; + +static const BitmapCharRec ch52 = {6,9,0,0,7,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch51 = {5,9,-1,0,7,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70, +}; + +static const BitmapCharRec ch50 = {5,9,-1,0,7,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20, +}; + +static const BitmapCharRec ch49 = {3,9,-1,0,7,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70, +}; + +static const BitmapCharRec ch48 = {5,9,-1,0,7,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10, +}; + +static const BitmapCharRec ch47 = {4,9,0,0,4,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0x80, +}; + +static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xf8, +}; + +static const BitmapCharRec ch45 = {5,1,-1,-3,8,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40, +}; + +static const BitmapCharRec ch44 = {2,3,-1,2,4,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x20,0x20,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch43 = {5,5,-1,-1,7,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0xa0,0x40,0xa0, +}; + +static const BitmapCharRec ch42 = {3,3,-1,-6,5,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {3,12,0,3,4,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, +}; + +static const BitmapCharRec ch40 = {3,12,-1,3,4,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0xc0, +}; + +static const BitmapCharRec ch39 = {2,3,-1,-6,3,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30, +}; + +static const BitmapCharRec ch38 = {7,9,-1,0,9,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0, +0x62,0x0, +}; + +static const BitmapCharRec ch37 = {9,9,-1,0,11,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, +}; + +static const BitmapCharRec ch36 = {5,10,-1,1,7,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28, +}; + +static const BitmapCharRec ch35 = {6,8,0,0,7,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0xa0,0xa0,0xa0, +}; + +static const BitmapCharRec ch34 = {3,3,-1,-6,5,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, +}; + +static const BitmapCharRec ch33 = {1,9,-1,0,3,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,4,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,4,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +#if !defined(__IBMCPP__) +const +#endif +BitmapFontRec glutBitmapHelvetica12 = { +"-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_hel18.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_hel18.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_hel18.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_hel18.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1900 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapHelvetica18 XXX +#include "glutbitmap.h" +#undef glutBitmapHelvetica18 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66, +0x66, +}; + +static const BitmapCharRec ch255 = {8,17,-1,4,10,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch254 = {9,18,-1,4,11,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18, +0xc,0x6, +}; + +static const BitmapCharRec ch253 = {8,18,-1,4,10,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66, +}; + +static const BitmapCharRec ch252 = {8,13,-1,0,10,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch251 = {8,14,-1,0,10,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6, +}; + +static const BitmapCharRec ch250 = {8,14,-1,0,10,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30, +}; + +static const BitmapCharRec ch249 = {8,14,-1,0,10,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80, +0x3f,0xc0,0xe,0x60, +}; + +static const BitmapCharRec ch248 = {11,10,0,0,11,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18, +}; + +static const BitmapCharRec ch247 = {8,8,-1,-1,10,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0, +}; + +static const BitmapCharRec ch246 = {9,13,-1,0,11,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0, +}; + +static const BitmapCharRec ch245 = {9,14,-1,0,11,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch244 = {9,14,-1,0,11,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch243 = {9,14,-1,0,11,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0, +}; + +static const BitmapCharRec ch242 = {9,14,-1,0,11,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32, +}; + +static const BitmapCharRec ch241 = {8,14,-1,0,10,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0, +}; + +static const BitmapCharRec ch240 = {9,14,-1,0,11,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8, +}; + +static const BitmapCharRec ch239 = {5,13,0,0,4,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30, +}; + +static const BitmapCharRec ch238 = {6,14,1,0,4,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30, +}; + +static const BitmapCharRec ch237 = {4,14,0,0,4,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0, +}; + +static const BitmapCharRec ch236 = {4,14,0,0,4,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36, +}; + +static const BitmapCharRec ch235 = {8,13,-1,0,10,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch234 = {8,14,-1,0,10,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6, +}; + +static const BitmapCharRec ch233 = {8,14,-1,0,10,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60, +}; + +static const BitmapCharRec ch232 = {8,14,-1,0,10,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, +}; + +static const BitmapCharRec ch231 = {8,14,-1,4,10,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18, +0xef,0xf0,0x7d,0xe0, +}; + +static const BitmapCharRec ch230 = {13,10,-1,0,15,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38, +}; + +static const BitmapCharRec ch229 = {7,14,-1,0,9,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c, +}; + +static const BitmapCharRec ch228 = {7,13,-1,0,9,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32, +}; + +static const BitmapCharRec ch227 = {7,14,-1,0,9,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch226 = {7,14,-1,0,9,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc, +}; + +static const BitmapCharRec ch225 = {7,14,-1,0,9,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60, +}; + +static const BitmapCharRec ch224 = {7,14,-1,0,9,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38, +}; + +static const BitmapCharRec ch223 = {7,14,-1,0,9,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch222 = {10,14,-1,0,12,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0, +0x3,0x0,0x1,0x80, +}; + +static const BitmapCharRec ch221 = {12,18,-1,0,14,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, +0x19,0x80, +}; + +static const BitmapCharRec ch220 = {11,17,-1,0,13,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, +0xf,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch219 = {11,18,-1,0,13,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0, +0x6,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch218 = {11,18,-1,0,13,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0, +0xc,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch217 = {11,18,-1,0,13,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c, +0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc, +}; + +static const BitmapCharRec ch216 = {14,14,0,0,15,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80, +0xc0,0xc0, +}; + +static const BitmapCharRec ch215 = {10,9,0,0,10,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80, +0xd,0x80, +}; + +static const BitmapCharRec ch214 = {13,17,-1,0,15,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80, +0xb,0x40,0x6,0x40, +}; + +static const BitmapCharRec ch213 = {13,18,-1,0,15,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0, +0x7,0x80,0x3,0x0, +}; + +static const BitmapCharRec ch212 = {13,18,-1,0,15,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, +0x1,0x80,0x0,0xc0, +}; + +static const BitmapCharRec ch211 = {13,18,-1,0,15,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, +0x6,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch210 = {13,18,-1,0,15,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, +0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0, +0x16,0x80,0xc,0x80, +}; + +static const BitmapCharRec ch209 = {11,18,-1,0,13,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30, +0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80, +}; + +static const BitmapCharRec ch208 = {12,14,0,0,13,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, +0xcc, +}; + +static const BitmapCharRec ch207 = {6,17,0,0,6,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, +0x78,0x30, +}; + +static const BitmapCharRec ch206 = {6,18,0,0,6,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0, +0x60,0x30, +}; + +static const BitmapCharRec ch205 = {4,18,-2,0,6,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30, +0x60,0xc0, +}; + +static const BitmapCharRec ch204 = {4,18,0,0,6,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, +0x33,0x0, +}; + +static const BitmapCharRec ch203 = {9,17,-1,0,11,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, +0x1e,0x0,0xc,0x0, +}; + +static const BitmapCharRec ch202 = {9,18,-1,0,11,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, +0x6,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch201 = {9,18,-1,0,11,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, +0x18,0x0,0x30,0x0, +}; + +static const BitmapCharRec ch200 = {9,18,-1,0,11,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30, +0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70, +0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch199 = {12,18,-1,4,14,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe, +0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff, +}; + +static const BitmapCharRec ch198 = {16,14,-1,0,18,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x19,0x80,0xf,0x0, +}; + +static const BitmapCharRec ch197 = {12,18,0,0,12,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, +0x19,0x80, +}; + +static const BitmapCharRec ch196 = {12,17,0,0,12,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0, +0x16,0x80,0xc,0x80, +}; + +static const BitmapCharRec ch195 = {12,18,0,0,12,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, +0xf,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch194 = {12,18,0,0,12,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, +0x3,0x0,0x1,0x80, +}; + +static const BitmapCharRec ch193 = {12,18,0,0,12,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, +0xc,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch192 = {12,18,0,0,12,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18, +}; + +static const BitmapCharRec ch191 = {7,14,-1,4,10,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88, +0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30, +}; + +static const BitmapCharRec ch190 = {14,13,0,0,15,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70, +0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, +}; + +static const BitmapCharRec ch189 = {13,13,-1,0,15,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10, +0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, +}; + +static const BitmapCharRec ch188 = {13,13,-1,0,15,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90, +}; + +static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70, +}; + +static const BitmapCharRec ch186 = {5,8,-1,-6,7,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60, +}; + +static const BitmapCharRec ch185 = {3,8,-1,-5,6,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0xf0,0xd8,0x18,0x70,0x60, +}; + +static const BitmapCharRec ch184 = {5,5,0,4,5,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-1,-4,4,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2, +0x72,0x3f, +}; + +static const BitmapCharRec ch182 = {8,18,-1,4,10,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch181 = {8,14,-1,4,10,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0xc0,0x60,0x30, +}; + +static const BitmapCharRec ch180 = {4,3,0,-11,4,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70, +}; + +static const BitmapCharRec ch179 = {5,8,0,-5,6,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70, +}; + +static const BitmapCharRec ch178 = {5,8,0,-5,6,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18, +}; + +static const BitmapCharRec ch177 = {8,11,-1,0,10,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x70,0xd8,0x88,0xd8,0x70, +}; + +static const BitmapCharRec ch176 = {5,5,-1,-8,7,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xf8, +}; + +static const BitmapCharRec ch175 = {5,1,0,-12,5,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48, +0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80, +}; + +static const BitmapCharRec ch174 = {13,13,-1,0,14,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xf8,0xf8, +}; + +static const BitmapCharRec ch173 = {5,2,-1,-4,7,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch172 = {9,5,-1,-3,11,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12, +}; + +static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70, +}; + +static const BitmapCharRec ch170 = {5,8,-1,-6,7,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8, +0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80, +}; + +static const BitmapCharRec ch169 = {13,13,-1,0,15,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xd8,0xd8, +}; + +static const BitmapCharRec ch168 = {5,2,0,-11,6,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3, +0x7e,0x3c, +}; + +static const BitmapCharRec ch167 = {8,18,-1,4,10,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch166 = {2,17,-1,3,4,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3, +}; + +static const BitmapCharRec ch165 = {8,13,-1,0,10,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0xc3,0xff,0x66,0x66,0x66,0xff,0xc3, +}; + +static const BitmapCharRec ch164 = {8,7,-1,-3,10,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0, +0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0, +}; + +static const BitmapCharRec ch163 = {9,13,0,0,10,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4, +}; + +static const BitmapCharRec ch162 = {8,14,-1,2,10,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch161 = {2,14,-2,4,6,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,5,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,5,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0xcc,0x7e,0x33, +}; + +static const BitmapCharRec ch126 = {8,3,-1,-4,10,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30, +0x60,0xc0, +}; + +static const BitmapCharRec ch125 = {6,18,0,4,6,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0, +}; + +static const BitmapCharRec ch124 = {2,18,-1,4,4,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30, +0x18,0xc, +}; + +static const BitmapCharRec ch123 = {6,18,0,4,6,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe, +}; + +static const BitmapCharRec ch122 = {7,10,-1,0,9,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch121 = {8,14,-1,4,10,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3, +}; + +static const BitmapCharRec ch120 = {8,10,-1,0,10,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30, +0xc6,0x30,0xc6,0x30, +}; + +static const BitmapCharRec ch119 = {12,10,-1,0,14,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch118 = {8,10,-1,0,10,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, +}; + +static const BitmapCharRec ch117 = {8,10,-1,0,10,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30, +}; + +static const BitmapCharRec ch116 = {6,13,0,0,6,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c, +}; + +static const BitmapCharRec ch115 = {7,10,-1,0,9,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8, +}; + +static const BitmapCharRec ch114 = {5,10,-1,0,6,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80, +}; + +static const BitmapCharRec ch113 = {9,14,-1,4,11,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0, +}; + +static const BitmapCharRec ch112 = {9,14,-1,4,11,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, +0x7f,0x0,0x3e,0x0, +}; + +static const BitmapCharRec ch111 = {9,10,-1,0,11,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce, +}; + +static const BitmapCharRec ch110 = {8,10,-1,0,10,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30, +0xde,0xf0,0xcc,0x60, +}; + +static const BitmapCharRec ch109 = {12,10,-1,0,14,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch108 = {2,14,-1,0,4,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch107 = {8,14,-1,0,9,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0, +0x30,0x30, +}; + +static const BitmapCharRec ch106 = {4,18,1,4,4,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch105 = {2,14,-1,0,4,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch104 = {8,14,-1,0,10,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80, +}; + +static const BitmapCharRec ch103 = {9,14,-1,4,11,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c, +}; + +static const BitmapCharRec ch102 = {6,14,0,0,6,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c, +}; + +static const BitmapCharRec ch101 = {8,10,-1,0,10,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80, +0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, +}; + +static const BitmapCharRec ch100 = {9,14,-1,0,11,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, +}; + +static const BitmapCharRec ch99 = {8,10,-1,0,10,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0, +0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch98 = {9,14,-1,0,11,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c, +}; + +static const BitmapCharRec ch97 = {7,10,-1,0,9,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0xc0,0xc0,0x80,0x80,0x40, +}; + +static const BitmapCharRec ch96 = {2,5,-1,-9,4,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch95 = {10,2,0,4,10,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x82,0xc6,0x6c,0x38,0x10, +}; + +static const BitmapCharRec ch94 = {7,5,-1,-8,9,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xf0,0xf0, +}; + +static const BitmapCharRec ch93 = {4,18,0,4,5,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch92 = {5,14,0,0,5,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xf0,0xf0, +}; + +static const BitmapCharRec ch91 = {4,18,-1,4,5,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0, +0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch90 = {10,14,-1,0,12,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, +0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, +}; + +static const BitmapCharRec ch89 = {12,14,-1,0,14,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0, +0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60, +}; + +static const BitmapCharRec ch88 = {11,14,-1,0,13,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66, +0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83, +}; + +static const BitmapCharRec ch87 = {16,14,-1,0,18,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0, +0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, +}; + +static const BitmapCharRec ch86 = {12,14,-1,0,14,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch85 = {11,14,-1,0,13,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0, +0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0, +}; + +static const BitmapCharRec ch84 = {10,14,-1,0,12,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0, +0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0, +}; + +static const BitmapCharRec ch83 = {11,14,-1,0,13,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80, +0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch82 = {10,14,-1,0,12,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch81 = {13,15,-1,1,15,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80, +0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch80 = {10,14,-1,0,12,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, +0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch79 = {13,14,-1,0,15,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, +0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch78 = {11,14,-1,0,13,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c, +0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc, +}; + +static const BitmapCharRec ch77 = {14,14,-1,0,16,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch76 = {8,14,-1,0,10,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0, +0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0, +}; + +static const BitmapCharRec ch75 = {12,14,-1,0,13,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3, +}; + +static const BitmapCharRec ch74 = {8,14,-1,0,10,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch73 = {2,14,-2,0,6,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0, +0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +}; + +static const BitmapCharRec ch72 = {11,14,-1,0,13,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0, +0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch71 = {12,14,-1,0,14,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch70 = {9,14,-1,0,11,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, +}; + +static const BitmapCharRec ch69 = {9,14,-1,0,11,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, +0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch68 = {11,14,-1,0,13,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, +}; + +static const BitmapCharRec ch67 = {12,14,-1,0,14,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80, +0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, +}; + +static const BitmapCharRec ch66 = {11,14,-1,0,13,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, +0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch65 = {12,14,0,0,12,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66, +0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc, +0x3,0xf0, +}; + +static const BitmapCharRec ch64 = {16,17,-1,3,18,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c, +}; + +static const BitmapCharRec ch63 = {7,14,-1,0,10,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0, +}; + +static const BitmapCharRec ch62 = {8,9,-1,0,10,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xfe,0xfe,0x0,0x0,0xfe,0xfe, +}; + +static const BitmapCharRec ch61 = {7,6,-2,-2,11,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3, +}; + +static const BitmapCharRec ch60 = {8,9,-1,0,10,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {2,13,-1,3,5,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,10,-1,0,5,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c, +}; + +static const BitmapCharRec ch57 = {8,13,-1,0,10,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c, +}; + +static const BitmapCharRec ch56 = {8,13,-1,0,10,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff, +}; + +static const BitmapCharRec ch55 = {8,13,-1,0,10,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c, +}; + +static const BitmapCharRec ch54 = {8,13,-1,0,10,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe, +}; + +static const BitmapCharRec ch53 = {8,13,-1,0,10,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0, +0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0, +}; + +static const BitmapCharRec ch52 = {9,13,-1,0,10,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c, +}; + +static const BitmapCharRec ch51 = {8,13,-1,0,10,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c, +}; + +static const BitmapCharRec ch50 = {8,13,-1,0,10,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18, +}; + +static const BitmapCharRec ch49 = {5,13,-2,0,10,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c, +}; + +static const BitmapCharRec ch48 = {8,13,-1,0,10,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18, +}; + +static const BitmapCharRec ch47 = {5,14,0,0,5,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-1,0,5,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xff,0xff, +}; + +static const BitmapCharRec ch45 = {8,2,-1,-4,11,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch44 = {2,5,-1,3,5,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18, +}; + +static const BitmapCharRec ch43 = {8,10,-1,0,10,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x88,0x70,0x70,0xf8,0x20,0x20, +}; + +static const BitmapCharRec ch42 = {5,6,-1,-8,7,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60, +0xc0,0x80, +}; + +static const BitmapCharRec ch41 = {4,18,-1,4,6,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60, +0x30,0x10, +}; + +static const BitmapCharRec ch40 = {4,18,-1,4,6,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0x80,0x40,0x40,0xc0,0xc0, +}; + +static const BitmapCharRec ch39 = {2,5,-1,-9,4,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0, +0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0, +}; + +static const BitmapCharRec ch38 = {12,13,-1,0,13,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0, +0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60, +}; + +static const BitmapCharRec ch37 = {14,13,-1,0,16,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0, +0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0, +}; + +static const BitmapCharRec ch36 = {9,16,-1,2,10,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0, +0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0, +}; + +static const BitmapCharRec ch35 = {10,13,0,0,10,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x90,0x90,0xd8,0xd8,0xd8, +}; + +static const BitmapCharRec ch34 = {5,5,0,-9,5,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +}; + +static const BitmapCharRec ch33 = {2,14,-2,0,6,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,5,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,5,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +#if !defined(__IBMCPP__) +const +#endif +BitmapFontRec glutBitmapHelvetica18 = { +"-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_init.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_init.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_init.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_init.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,451 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include + +#if !defined(_WIN32) && !defined(__OS2__) + #include + #include +#endif + +/* SGI optimization introduced in IRIX 6.3 to avoid X server + round trips for interning common X atoms. */ +#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) +#include +#else +#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) +#endif + +#include "glutint.h" + +/* GLUT inter-file variables */ +/* *INDENT-OFF* */ +char *__glutProgramName = NULL; +int __glutArgc = 0; +char **__glutArgv = NULL; +char *__glutGeometry = NULL; +Display *__glutDisplay = NULL; +int __glutScreen; +Window __glutRoot; +int __glutScreenHeight; +int __glutScreenWidth; +GLboolean __glutIconic = GL_FALSE; +GLboolean __glutDebug = GL_FALSE; +unsigned int __glutDisplayMode = + GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH; +char *__glutDisplayString = NULL; +int __glutConnectionFD; +XSizeHints __glutSizeHints = {0}; +int __glutInitWidth = 300, __glutInitHeight = 300; +int __glutInitX = -1, __glutInitY = -1; +GLboolean __glutForceDirect = GL_FALSE, + __glutTryDirect = GL_TRUE; +Atom __glutWMDeleteWindow; +/* *INDENT-ON* */ + +#ifdef _WIN32 +void (__cdecl *__glutExitFunc)(int retval) = NULL; +#endif + +static Bool synchronize = False; + +#if defined(__OS2__) + +MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); +MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); + + +void __glutOpenOS2Connection(char* display) +{ + static char *classname=NULL; +extern HAB hab; /* PM anchor block handle */ +ERRORID erridErrorCode;/* last error id code */ +int ii; + + /* Make sure we register the window only once. */ + if(classname) + return; + + classname = "GLUT"; + + if ( !WinRegisterClass( hab, /* PM anchor block handle */ + classname,/* window class name */ + GlutWindowProc,/* address of window procedure*/ + CS_SIZEREDRAW, /* |CS_SYNCPAINT size changes cause redrawing */ + 0UL ) ) /* window data */ + { erridErrorCode = WinGetLastError(hab); + ii = erridErrorCode; + return; + } + + classname = "GLUTCHILD"; + + if ( !WinRegisterClass( hab, /* PM anchor block handle */ + classname,/* window class name */ + GlutWindowChildProc,/* address of window procedure*/ + CS_SIZEREDRAW, /* size changes cause redrawing */ + 0UL ) ) /* window data */ + { erridErrorCode = WinGetLastError(hab); + ii = erridErrorCode; + return; + } + + __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN); + __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN); + + /* Set the root window to NULL because windows creates a top-level + window when the parent is NULL. X creates a top-level window + when the parent is the root window. */ + __glutRoot = NULLHANDLE; + + /* Set the display to 1 -- we shouldn't be using this anywhere + (except as an argument to X calls). */ + __glutDisplay = (Display*)1; + + /* There isn't any concept of multiple screens in Win32, therefore, + we don't need to keep track of the screen we're on... it's always + the same one. */ + __glutScreen = 0; +} + +#elif defined(_WIN32) + +#ifdef __BORLANDC__ +#include /* For masking floating point exceptions. */ +#endif + +void +__glutOpenWin32Connection(char* display) +{ + static char *classname; + WNDCLASS wc; + HINSTANCE hInstance = GetModuleHandle(NULL); + + /* Make sure we register the window only once. */ + if(classname) + return; + +#ifdef __BORLANDC__ + /* Under certain conditions (e.g. while rendering solid surfaces with + lighting enabled) Microsoft OpenGL libraries cause some illegal + operations like floating point overflow or division by zero. The + default behaviour of Microsoft compilers is to mask (ignore) + floating point exceptions, while Borland compilers do not. The + following function of Borland RTL allows to mask exceptions. + Advice from Pier Giorgio Esposito (mc2172@mclink.it). */ + _control87(MCW_EM,MCW_EM); +#endif + + classname = "GLUT"; + + /* Clear (important!) and then fill in the window class structure. */ + memset(&wc, 0, sizeof(WNDCLASS)); + wc.style = CS_OWNDC; + wc.lpfnWndProc = (WNDPROC)__glutWindowProc; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, "GLUT_ICON"); + wc.hCursor = LoadCursor(hInstance, IDC_ARROW); + wc.hbrBackground = NULL; + wc.lpszMenuName = NULL; + wc.lpszClassName = classname; + + /* Fill in a default icon if one isn't specified as a resource. */ + if(!wc.hIcon) + wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); + + if(!RegisterClass(&wc)) { + __glutFatalError("RegisterClass() failed:" + "Cannot register GLUT window class."); + } + + __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN); + __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN); + + /* Set the root window to NULL because windows creates a top-level + window when the parent is NULL. X creates a top-level window + when the parent is the root window. */ + __glutRoot = NULL; + + /* Set the display to 1 -- we shouldn't be using this anywhere + (except as an argument to X calls). */ + __glutDisplay = (Display*)1; + + /* There isn't any concept of multiple screens in Win32, therefore, + we don't need to keep track of the screen we're on... it's always + the same one. */ + __glutScreen = 0; +} +#else /* !_WIN32 */ +void +__glutOpenXConnection(char *display) +{ + int errorBase, eventBase; + + __glutDisplay = XOpenDisplay(display); + if (!__glutDisplay) + __glutFatalError("could not open display: %s", + XDisplayName(display)); + if (synchronize) + XSynchronize(__glutDisplay, True); + if (!glXQueryExtension(__glutDisplay, &errorBase, &eventBase)) + __glutFatalError( + "OpenGL GLX extension not supported by display: %s", + XDisplayName(display)); + __glutScreen = DefaultScreen(__glutDisplay); + __glutRoot = RootWindow(__glutDisplay, __glutScreen); + __glutScreenWidth = DisplayWidth(__glutDisplay, __glutScreen); + __glutScreenHeight = DisplayHeight(__glutDisplay, + __glutScreen); + __glutConnectionFD = ConnectionNumber(__glutDisplay); + __glutWMDeleteWindow = XSGIFastInternAtom(__glutDisplay, + "WM_DELETE_WINDOW", SGI_XA_WM_DELETE_WINDOW, False); +} +#endif /* _WIN32 */ + +void +#ifdef OLD_VMS + __glutInitTime(struct timeval6 *beginning) +#else + __glutInitTime(struct timeval *beginning) +#endif +{ + static int beenhere = 0; +#ifdef OLD_VMS + static struct timeval6 genesis; +#else + static struct timeval genesis; +#endif + + if (!beenhere) { + GETTIMEOFDAY(&genesis); + beenhere = 1; + } + *beginning = genesis; +} + +static void +removeArgs(int *argcp, char **argv, int numToRemove) +{ + int i, j; + + for (i = 0, j = numToRemove; argv[j]; i++, j++) { + argv[i] = argv[j]; + } + argv[i] = NULL; + *argcp -= numToRemove; +} + +void GLUTAPIENTRY +glutInit(int *argcp, char **argv) +{ + char *display = NULL; + char *str, *geometry = NULL; +#ifdef OLD_VMS + struct timeval6 unused; +#else + struct timeval unused; +#endif + int i; + + if (__glutDisplay) { + __glutWarning("glutInit being called a second time."); + return; + } + /* Determine temporary program name. */ + str = strrchr(argv[0], '/'); + if (str == NULL) { + __glutProgramName = argv[0]; + } else { + __glutProgramName = str + 1; + } + + /* Make private copy of command line arguments. */ + __glutArgc = *argcp; + __glutArgv = (char **) malloc(__glutArgc * sizeof(char *)); + if (!__glutArgv) + __glutFatalError("out of memory."); + for (i = 0; i < __glutArgc; i++) { + __glutArgv[i] = __glutStrdup(argv[i]); + if (!__glutArgv[i]) + __glutFatalError("out of memory."); + } + + /* determine permanent program name */ + str = strrchr(__glutArgv[0], '/'); + if (str == NULL) { + __glutProgramName = __glutArgv[0]; + } else { + __glutProgramName = str + 1; + } + + /* parse arguments for standard options */ + for (i = 1; i < __glutArgc; i++) { + if (!strcmp(__glutArgv[i], "-display")) { +#if defined(_WIN32) + __glutWarning("-display option not supported by Win32 GLUT."); +#endif + if (++i >= __glutArgc) { + __glutFatalError( + "follow -display option with X display name."); + } + display = __glutArgv[i]; + removeArgs(argcp, &argv[1], 2); + } else if (!strcmp(__glutArgv[i], "-geometry")) { + if (++i >= __glutArgc) { + __glutFatalError( + "follow -geometry option with geometry parameter."); + } + geometry = __glutArgv[i]; + removeArgs(argcp, &argv[1], 2); + } else if (!strcmp(__glutArgv[i], "-direct")) { +#if defined(_WIN32) + __glutWarning("-direct option not supported by Win32 GLUT."); +#endif + if (!__glutTryDirect) + __glutFatalError( + "cannot force both direct and indirect rendering."); + __glutForceDirect = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-indirect")) { +#if defined(_WIN32) + __glutWarning("-indirect option not supported by Win32 GLUT."); +#endif + if (__glutForceDirect) + __glutFatalError( + "cannot force both direct and indirect rendering."); + __glutTryDirect = GL_FALSE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-iconic")) { + __glutIconic = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-gldebug")) { + __glutDebug = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else if (!strcmp(__glutArgv[i], "-sync")) { +#if defined(_WIN32) + __glutWarning("-sync option not supported by Win32 GLUT."); +#endif + synchronize = GL_TRUE; + removeArgs(argcp, &argv[1], 1); + } else { + /* Once unknown option encountered, stop command line + processing. */ + break; + } + } +#if defined(__OS2__) + __glutOpenOS2Connection(display); +#elif defined(_WIN32) + __glutOpenWin32Connection(display); +#else + __glutOpenXConnection(display); +#endif + if (geometry) { + int flags, x, y, width, height; + + /* Fix bogus "{width|height} may be used before set" + warning */ + width = 0; + height = 0; + + flags = XParseGeometry(geometry, &x, &y, + (unsigned int *) &width, (unsigned int *) &height); + if (WidthValue & flags) { + /* Careful because X does not allow zero or negative + width windows */ + if (width > 0) + __glutInitWidth = width; + } + if (HeightValue & flags) { + /* Careful because X does not allow zero or negative + height windows */ + if (height > 0) + __glutInitHeight = height; + } + glutInitWindowSize(__glutInitWidth, __glutInitHeight); + if (XValue & flags) { + if (XNegative & flags) + x = DisplayWidth(__glutDisplay, __glutScreen) + + x - __glutSizeHints.width; + /* Play safe: reject negative X locations */ + if (x >= 0) + __glutInitX = x; + } + if (YValue & flags) { + if (YNegative & flags) + y = DisplayHeight(__glutDisplay, __glutScreen) + + y - __glutSizeHints.height; + /* Play safe: reject negative Y locations */ + if (y >= 0) + __glutInitY = y; + } + glutInitWindowPosition(__glutInitX, __glutInitY); + } + __glutInitTime(&unused); + + /* check if GLUT_FPS env var is set */ + { + const char *fps = getenv("GLUT_FPS"); + if (fps) { + sscanf(fps, "%d", &__glutFPS); + if (__glutFPS <= 0) + __glutFPS = 5000; /* 5000 milliseconds */ + } + } +} + +#ifdef _WIN32 +void APIENTRY +__glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)) +{ + __glutExitFunc = exitfunc; + glutInit(argcp, argv); +} +#endif + +/* CENTRY */ +void GLUTAPIENTRY +glutInitWindowPosition(int x, int y) +{ + __glutInitX = x; + __glutInitY = y; + if (x >= 0 && y >= 0) { + __glutSizeHints.x = x; + __glutSizeHints.y = y; + __glutSizeHints.flags |= USPosition; + } else { + __glutSizeHints.flags &= ~USPosition; + } +} + +void GLUTAPIENTRY +glutInitWindowSize(int width, int height) +{ + __glutInitWidth = width; + __glutInitHeight = height; + if (width > 0 && height > 0) { + __glutSizeHints.width = width; + __glutSizeHints.height = height; + __glutSizeHints.flags |= USSize; + } else { + __glutSizeHints.flags &= ~USSize; + } +} + +void GLUTAPIENTRY +glutInitDisplayMode(unsigned int mask) +{ + __glutDisplayMode = mask; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_input.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_input.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_input.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_input.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,628 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include +#include + +#include "glutint.h" +#define POFIG 0 +#if POFIG + +int __glutNumDials = 0; +int __glutNumSpaceballButtons = 0; +int __glutNumButtonBoxButtons = 0; +int __glutNumTabletButtons = 0; +int __glutNumMouseButtons = 3; /* Good guess. */ +XDevice *__glutTablet = NULL; +XDevice *__glutDials = NULL; +XDevice *__glutSpaceball = NULL; + +int __glutHasJoystick = 0; +int __glutNumJoystickButtons = 0; +int __glutNumJoystickAxes = 0; + +#if !defined(_WIN32) +typedef struct _Range { + int min; + int range; +} Range; + +#define NUM_SPACEBALL_AXIS 6 +#define NUM_TABLET_AXIS 2 +#define NUM_DIALS_AXIS 8 + +Range __glutSpaceballRange[NUM_SPACEBALL_AXIS]; +Range __glutTabletRange[NUM_TABLET_AXIS]; +int *__glutDialsResolution; + +/* Safely assumes 0 is an illegal event type for X Input + extension events. */ +int __glutDeviceMotionNotify = 0; +int __glutDeviceButtonPress = 0; +int __glutDeviceButtonPressGrab = 0; +int __glutDeviceButtonRelease = 0; +int __glutDeviceStateNotify = 0; + +static int +normalizeTabletPos(int axis, int rawValue) +{ + assert(rawValue >= __glutTabletRange[axis].min); + assert(rawValue <= __glutTabletRange[axis].min + + __glutTabletRange[axis].range); + /* Normalize rawValue to between 0 and 4000. */ + return ((rawValue - __glutTabletRange[axis].min) * 4000) / + __glutTabletRange[axis].range; +} + +static int +normalizeDialAngle(int axis, int rawValue) +{ + /* XXX Assumption made that the resolution of the device is + number of clicks for one complete dial revolution. This + is true for SGI's dial & button box. */ + return (rawValue * 360.0) / __glutDialsResolution[axis]; +} + +static int +normalizeSpaceballAngle(int axis, int rawValue) +{ + assert(rawValue >= __glutSpaceballRange[axis].min); + assert(rawValue <= __glutSpaceballRange[axis].min + + __glutSpaceballRange[axis].range); + /* Normalize rawValue to between -1800 and 1800. */ + return ((rawValue - __glutSpaceballRange[axis].min) * 3600) / + __glutSpaceballRange[axis].range - 1800; +} + +static int +normalizeSpaceballDelta(int axis, int rawValue) +{ + assert(rawValue >= __glutSpaceballRange[axis].min); + assert(rawValue <= __glutSpaceballRange[axis].min + + __glutSpaceballRange[axis].range); + /* Normalize rawValue to between -1000 and 1000. */ + return ((rawValue - __glutSpaceballRange[axis].min) * 2000) / + __glutSpaceballRange[axis].range - 1000; +} + +static void +queryTabletPos(GLUTwindow * window) +{ + XDeviceState *state; + XInputClass *any; + XValuatorState *v; + int i; + + state = XQueryDeviceState(__glutDisplay, __glutTablet); + any = state->data; + for (i = 0; i < state->num_classes; i++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ValuatorClass: + v = (XValuatorState *) any; + if (v->num_valuators < 2) + goto end; + if (window->tabletPos[0] == -1) + window->tabletPos[0] = normalizeTabletPos(0, v->valuators[0]); + if (window->tabletPos[1] == -1) + window->tabletPos[1] = normalizeTabletPos(1, v->valuators[1]); + } + any = (XInputClass *) ((char *) any + any->length); + } +end: + XFreeDeviceState(state); +} + +static void +tabletPosChange(GLUTwindow * window, int first, int count, int *data) +{ + int i, value, genEvent = 0; + + for (i = first; i < first + count; i++) { + switch (i) { + case 0: /* X axis */ + case 1: /* Y axis */ + value = normalizeTabletPos(i, data[i - first]); + if (value != window->tabletPos[i]) { + window->tabletPos[i] = value; + genEvent = 1; + } + break; + } + } + if (window->tabletPos[0] == -1 || window->tabletPos[1] == -1) + queryTabletPos(window); + if (genEvent) + window->tabletMotion(window->tabletPos[0], window->tabletPos[1]); +} +#endif /* !_WIN32 */ + +static int +__glutProcessDeviceEvents(XEvent * event) +{ +#if !defined(_WIN32) + GLUTwindow *window; + + /* XXX Ugly code fan out. */ + + /* Can't use switch/case since X Input event types are + dynamic. */ + + if (__glutDeviceMotionNotify && event->type == __glutDeviceMotionNotify) { + XDeviceMotionEvent *devmot = (XDeviceMotionEvent *) event; + + window = __glutGetWindow(devmot->window); + if (window) { + if (__glutTablet + && devmot->deviceid == __glutTablet->device_id + && window->tabletMotion) { + tabletPosChange(window, devmot->first_axis, devmot->axes_count, + devmot->axis_data); + } else if (__glutDials + && devmot->deviceid == __glutDials->device_id + && window->dials) { + int i, first = devmot->first_axis, count = devmot->axes_count; + + for (i = first; i < first + count; i++) + window->dials(i + 1, + normalizeDialAngle(i, devmot->axis_data[i - first])); + } else if (__glutSpaceball + && devmot->deviceid == __glutSpaceball->device_id) { + /* XXX Assume that space ball motion events come in as + all the first 6 axes. Assume first 3 axes are XYZ + translations; second 3 axes are XYZ rotations. */ + if (devmot->first_axis == 0 && devmot->axes_count == 6) { + if (window->spaceMotion) + window->spaceMotion( + normalizeSpaceballDelta(0, devmot->axis_data[0]), + normalizeSpaceballDelta(1, devmot->axis_data[1]), + normalizeSpaceballDelta(2, devmot->axis_data[2])); + if (window->spaceRotate) + window->spaceRotate( + normalizeSpaceballAngle(3, devmot->axis_data[3]), + normalizeSpaceballAngle(4, devmot->axis_data[4]), + normalizeSpaceballAngle(5, devmot->axis_data[5])); + } + } + return 1; + } + } else if (__glutDeviceButtonPress + && event->type == __glutDeviceButtonPress) { + XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event; + + window = __glutGetWindow(devbtn->window); + if (window) { + if (__glutTablet + && devbtn->deviceid == __glutTablet->device_id + && window->tabletButton + && devbtn->first_axis == 0 + && devbtn->axes_count == 2) { + tabletPosChange(window, devbtn->first_axis, devbtn->axes_count, + devbtn->axis_data); + window->tabletButton(devbtn->button, GLUT_DOWN, + window->tabletPos[0], window->tabletPos[1]); + } else if (__glutDials + && devbtn->deviceid == __glutDials->device_id + && window->buttonBox) { + window->buttonBox(devbtn->button, GLUT_DOWN); + } else if (__glutSpaceball + && devbtn->deviceid == __glutSpaceball->device_id + && window->spaceButton) { + window->spaceButton(devbtn->button, GLUT_DOWN); + } + return 1; + } + } else if (__glutDeviceButtonRelease + && event->type == __glutDeviceButtonRelease) { + XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event; + + window = __glutGetWindow(devbtn->window); + if (window) { + if (__glutTablet + && devbtn->deviceid == __glutTablet->device_id + && window->tabletButton + && devbtn->first_axis == 0 + && devbtn->axes_count == 2) { + tabletPosChange(window, devbtn->first_axis, devbtn->axes_count, + devbtn->axis_data); + window->tabletButton(devbtn->button, GLUT_UP, + window->tabletPos[0], window->tabletPos[1]); + } else if (__glutDials + && devbtn->deviceid == __glutDials->device_id + && window->buttonBox) { + window->buttonBox(devbtn->button, GLUT_UP); + } else if (__glutSpaceball + && devbtn->deviceid == __glutSpaceball->device_id + && window->spaceButton) { + window->spaceButton(devbtn->button, GLUT_UP); + } + return 1; + } + } +#else + { + JOYINFOEX info; + JOYCAPS joyCaps; + + memset(&info, 0, sizeof(JOYINFOEX)); + info.dwSize = sizeof(JOYINFOEX); + info.dwFlags = JOY_RETURNALL; + + if (joyGetPosEx(JOYSTICKID1,&info) != JOYERR_NOERROR) { + __glutHasJoystick = 1; + joyGetDevCaps(JOYSTICKID1, &joyCaps, sizeof(joyCaps)); + __glutNumJoystickButtons = joyCaps.wNumButtons; + __glutNumJoystickAxes = joyCaps.wNumAxes; + } else { + __glutHasJoystick = 0; + __glutNumJoystickButtons = 0; + __glutNumJoystickAxes = 0; + } + } +#endif /* !_WIN32 */ + return 0; +} + +static GLUTeventParser eventParser = +{__glutProcessDeviceEvents, NULL}; + +static void +addDeviceEventParser(void) +{ + static Bool been_here = False; + + if (been_here) + return; + been_here = True; + __glutRegisterEventParser(&eventParser); +} + +static int +probeDevices(void) +{ + static Bool been_here = False; + static int support; +#if !defined(_WIN32) + XExtensionVersion *version; + XDeviceInfoPtr device_info, device; + XAnyClassPtr any; + XButtonInfoPtr b; + XValuatorInfoPtr v; + XAxisInfoPtr a; + int num_dev = 0, btns = 0, dials = 0; + int i, j, k; +#endif /* !_WIN32 */ + + if (been_here) { + return support; + } + been_here = True; + +#if !defined(_WIN32) + version = XGetExtensionVersion(__glutDisplay, "XInputExtension"); + /* Ugh. XInput extension API forces annoying cast of a pointer + to a long so it can be compared with the NoSuchExtension + value (#defined to 1). */ + if (version == NULL || ((long) version) == NoSuchExtension) { + support = 0; + return support; + } + XFree(version); + device_info = XListInputDevices(__glutDisplay, &num_dev); + if (device_info) { + for (i = 0; i < num_dev; i++) { + /* XXX These are SGI names for these devices; + unfortunately, no good standard exists for standard + types of X input extension devices. */ + + device = &device_info[i]; + any = (XAnyClassPtr) device->inputclassinfo; + + if (!__glutSpaceball && !strcmp(device->name, "spaceball")) { + v = NULL; + b = NULL; + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ButtonClass: + b = (XButtonInfoPtr) any; + btns = b->num_buttons; + break; + case ValuatorClass: + v = (XValuatorInfoPtr) any; + /* Sanity check: at least 6 valuators? */ + if (v->num_axes < NUM_SPACEBALL_AXIS) + goto skip_device; + a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); + for (k = 0; k < NUM_SPACEBALL_AXIS; k++, a++) { + __glutSpaceballRange[k].min = a->min_value; + __glutSpaceballRange[k].range = a->max_value - a->min_value; + } + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + if (v) { + __glutSpaceball = XOpenDevice(__glutDisplay, device->id); + if (__glutSpaceball) { + __glutNumSpaceballButtons = btns; + addDeviceEventParser(); + } + } + } else if (!__glutDials && !strcmp(device->name, "dial+buttons")) { + v = NULL; + b = NULL; + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ButtonClass: + b = (XButtonInfoPtr) any; + btns = b->num_buttons; + break; + case ValuatorClass: + v = (XValuatorInfoPtr) any; + /* Sanity check: at least 8 valuators? */ + if (v->num_axes < NUM_DIALS_AXIS) + goto skip_device; + dials = v->num_axes; + __glutDialsResolution = (int *) malloc(sizeof(int) * dials); + a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); + for (k = 0; k < dials; k++, a++) { + __glutDialsResolution[k] = a->resolution; + } + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + if (v) { + __glutDials = XOpenDevice(__glutDisplay, device->id); + if (__glutDials) { + __glutNumButtonBoxButtons = btns; + __glutNumDials = dials; + addDeviceEventParser(); + } + } + } else if (!__glutTablet && !strcmp(device->name, "tablet")) { + v = NULL; + b = NULL; + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + switch (any->c_class) { +#else + switch (any->class) { +#endif + case ButtonClass: + b = (XButtonInfoPtr) any; + btns = b->num_buttons; + break; + case ValuatorClass: + v = (XValuatorInfoPtr) any; + /* Sanity check: exactly 2 valuators? */ + if (v->num_axes != NUM_TABLET_AXIS) + goto skip_device; + a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); + for (k = 0; k < NUM_TABLET_AXIS; k++, a++) { + __glutTabletRange[k].min = a->min_value; + __glutTabletRange[k].range = a->max_value - a->min_value; + } + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + if (v) { + __glutTablet = XOpenDevice(__glutDisplay, device->id); + if (__glutTablet) { + __glutNumTabletButtons = btns; + addDeviceEventParser(); + } + } + } else if (!strcmp(device->name, "mouse")) { + for (j = 0; j < device->num_classes; j++) { +#if defined(__cplusplus) || defined(c_plusplus) + if (any->c_class == ButtonClass) { +#else + if (any->class == ButtonClass) { +#endif + b = (XButtonInfoPtr) any; + __glutNumMouseButtons = b->num_buttons; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + } + skip_device:; + } + XFreeDeviceList(device_info); + } +#else /* _WIN32 */ + __glutNumMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS); +#endif /* !_WIN32 */ + /* X Input extension might be supported, but only if there is + a tablet, dials, or spaceball do we claim devices are + supported. */ + support = __glutTablet || __glutDials || __glutSpaceball; + return support; +} + +void +__glutUpdateInputDeviceMask(GLUTwindow * window) +{ +#if !defined(_WIN32) + /* 5 (dial and buttons) + 5 (tablet locator and buttons) + 5 + (Spaceball buttons and axis) = 15 */ + XEventClass eventList[15]; + int rc, numEvents; + + rc = probeDevices(); + if (rc) { + numEvents = 0; + if (__glutTablet) { + if (window->tabletMotion) { + DeviceMotionNotify(__glutTablet, __glutDeviceMotionNotify, + eventList[numEvents]); + numEvents++; + } + if (window->tabletButton) { + DeviceButtonPress(__glutTablet, __glutDeviceButtonPress, + eventList[numEvents]); + numEvents++; + DeviceButtonPressGrab(__glutTablet, __glutDeviceButtonPressGrab, + eventList[numEvents]); + numEvents++; + DeviceButtonRelease(__glutTablet, __glutDeviceButtonRelease, + eventList[numEvents]); + numEvents++; + } + if (window->tabletMotion || window->tabletButton) { + DeviceStateNotify(__glutTablet, __glutDeviceStateNotify, + eventList[numEvents]); + numEvents++; + } + } + if (__glutDials) { + if (window->dials) { + DeviceMotionNotify(__glutDials, __glutDeviceMotionNotify, + eventList[numEvents]); + numEvents++; + } + if (window->buttonBox) { + DeviceButtonPress(__glutDials, __glutDeviceButtonPress, + eventList[numEvents]); + numEvents++; + DeviceButtonPressGrab(__glutDials, __glutDeviceButtonPressGrab, + eventList[numEvents]); + numEvents++; + DeviceButtonRelease(__glutDials, __glutDeviceButtonRelease, + eventList[numEvents]); + numEvents++; + } + if (window->dials || window->buttonBox) { + DeviceStateNotify(__glutDials, __glutDeviceStateNotify, + eventList[numEvents]); + numEvents++; + } + } + if (__glutSpaceball) { + if (window->spaceMotion || window->spaceRotate) { + DeviceMotionNotify(__glutSpaceball, __glutDeviceMotionNotify, + eventList[numEvents]); + numEvents++; + } + if (window->spaceButton) { + DeviceButtonPress(__glutSpaceball, __glutDeviceButtonPress, + eventList[numEvents]); + numEvents++; + DeviceButtonPressGrab(__glutSpaceball, __glutDeviceButtonPressGrab, + eventList[numEvents]); + numEvents++; + DeviceButtonRelease(__glutSpaceball, __glutDeviceButtonRelease, + eventList[numEvents]); + numEvents++; + } + if (window->spaceMotion || window->spaceRotate || window->spaceButton) { + DeviceStateNotify(__glutSpaceball, __glutDeviceStateNotify, + eventList[numEvents]); + numEvents++; + } + } +#if 0 + if (window->children) { + GLUTwindow *child = window->children; + + do { + XChangeDeviceDontPropagateList(__glutDisplay, child->win, + numEvents, eventList, AddToList); + child = child->siblings; + } while (child); + } +#endif + XSelectExtensionEvent(__glutDisplay, window->win, + eventList, numEvents); + if (window->overlay) { + XSelectExtensionEvent(__glutDisplay, window->overlay->win, + eventList, numEvents); + } + } else { + /* X Input extension not supported; no chance for exotic + input devices. */ + } +#endif /* !_WIN32 */ +} + +#endif //POFIG + +/* CENTRY */ +int GLUTAPIENTRY +glutDeviceGet(GLenum param) +{ +#if POFIG + probeDevices(); +#endif + switch (param) { + case GLUT_HAS_KEYBOARD: + case GLUT_HAS_MOUSE: + /* Assume window system always has mouse and keyboard. */ + return 1; +#if POFIG + case GLUT_HAS_SPACEBALL: + return __glutSpaceball != NULL; + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + return __glutDials != NULL; + case GLUT_HAS_TABLET: + return __glutTablet != NULL; + case GLUT_NUM_MOUSE_BUTTONS: + return __glutNumMouseButtons; + case GLUT_NUM_SPACEBALL_BUTTONS: + return __glutNumSpaceballButtons; + case GLUT_NUM_BUTTON_BOX_BUTTONS: + return __glutNumButtonBoxButtons; + case GLUT_NUM_DIALS: + return __glutNumDials; + case GLUT_NUM_TABLET_BUTTONS: + return __glutNumTabletButtons; + case GLUT_DEVICE_IGNORE_KEY_REPEAT: + return __glutCurrentWindow->ignoreKeyRepeat; +#ifndef _WIN32 + case GLUT_DEVICE_KEY_REPEAT: + { + XKeyboardState state; + + XGetKeyboardControl(__glutDisplay, &state); + return state.global_auto_repeat; + } + case GLUT_JOYSTICK_POLL_RATE: + return 0; +#else + case GLUT_DEVICE_KEY_REPEAT: + /* Win32 cannot globally disable key repeat. */ + return GLUT_KEY_REPEAT_ON; + case GLUT_JOYSTICK_POLL_RATE: + return __glutCurrentWindow->joyPollInterval; +#endif + case GLUT_HAS_JOYSTICK: + return __glutHasJoystick; + case GLUT_JOYSTICK_BUTTONS: + return __glutNumJoystickButtons; + case GLUT_JOYSTICK_AXES: + return __glutNumJoystickAxes; +#endif //POFIG + default: + __glutWarning("invalid glutDeviceGet parameter: %d", param); + return -1; + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_key.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_key.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_key.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_key.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutKeyboardFunc(GLUTkeyboardCB keyboardFunc) +{ + __glutChangeWindowEventMask(KeyPressMask, + keyboardFunc != NULL || __glutCurrentWindow->special != NULL); + __glutCurrentWindow->keyboard = keyboardFunc; +} + +void GLUTAPIENTRY +glutSpecialFunc(GLUTspecialCB specialFunc) +{ + __glutChangeWindowEventMask(KeyPressMask, + specialFunc != NULL || __glutCurrentWindow->keyboard != NULL); + __glutCurrentWindow->special = specialFunc; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_keyctrl.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_keyctrl.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_keyctrl.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_keyctrl.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutIgnoreKeyRepeat(int ignore) +{ + __glutCurrentWindow->ignoreKeyRepeat = ignore; +} + +void GLUTAPIENTRY +glutSetKeyRepeat(int repeatMode) +{ +#if !defined(_WIN32) && !defined(__OS2PM__) + XKeyboardControl values; + + /* GLUT's repeatMode #define's match the Xlib API values. */ + values.auto_repeat_mode = repeatMode; + XChangeKeyboardControl(__glutDisplay, KBAutoRepeatMode, &values); +#endif +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_keyup.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_keyup.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_keyup.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_keyup.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc) +{ + __glutChangeWindowEventMask(KeyReleaseMask, + keyboardUpFunc != NULL || __glutCurrentWindow->specialUp != NULL); + __glutCurrentWindow->keyboardUp = keyboardUpFunc; +} + +void GLUTAPIENTRY +glutSpecialUpFunc(GLUTspecialCB specialUpFunc) +{ + __glutChangeWindowEventMask(KeyReleaseMask, + specialUpFunc != NULL || __glutCurrentWindow->keyboardUp != NULL); + __glutCurrentWindow->specialUp = specialUpFunc; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_mesa.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_mesa.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_mesa.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_mesa.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,57 @@ + +/* Copyright (c) Mark J. Kilgard, 1996. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include "glutint.h" + +int __glutMesaSwapHackSupport = 0; /* Not supported until + proven otherwise. */ + +/* Use the "Mesa swap hack" if reasonable if and only if + MESA_SWAP_HACK is set to something whose first character is + not "N" or "n" AND "Brian Paul" is the vendor string AND + "Mesa X11"* (or "Mesa" for backward compatibility) is the + renderer string. + + Anyone who modifies Mesa so that glXSwapBuffers does not + simply blit the previously rendered back buffer should + change either their vendor or renderer string to avoid + confusing GLUT. */ + +void +__glutDetermineMesaSwapHackSupport(void) +{ + static int doneAlready = 0; + char *env, *vendor, *renderer; + + if (doneAlready) + return; + env = getenv("MESA_SWAP_HACK"); + if (env) { + if ((env[0] != 'n') && (env[0] != 'N')) { + vendor = (char *) glGetString(GL_VENDOR); + renderer = (char *) glGetString(GL_RENDERER); + + /* Old versions of X11 Mesa uses the renderer string + "Mesa"; Brian plans to start using "Mesa X11" to + distinguish the X version of Mesa from other flavor + such as Windows or 3Dfx. */ + +#define MESA_X11 "Mesa X11" + + /* XXX At some point in the future, eliminate the + backward compatibility for the old "Mesa" renderer + string. */ + + if (!strcmp(vendor, "Brian Paul") && (!strcmp(renderer, "Mesa") || + !strncmp(renderer, MESA_X11, sizeof(MESA_X11) - 1))) + __glutMesaSwapHackSupport = 1; + } + } + doneAlready = 1; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_modifier.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_modifier.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_modifier.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_modifier.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,31 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" + +/* CENTRY */ +int GLUTAPIENTRY +glutGetModifiers(void) +{ + int modifiers; + + if(__glutModifierMask == (unsigned int) ~0) { + __glutWarning( + "glutCurrentModifiers: do not call outside core input callback."); + return 0; + } + modifiers = 0; + if(__glutModifierMask & (ShiftMask|LockMask)) + modifiers |= GLUT_ACTIVE_SHIFT; + if(__glutModifierMask & ControlMask) + modifiers |= GLUT_ACTIVE_CTRL; + if(__glutModifierMask & Mod1Mask) + modifiers |= GLUT_ACTIVE_ALT; + return modifiers; +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glutos2.h xpsb-glx-0.19/mesa/src/glut/os2/glutos2.h --- xpsb-glx-0.19/mesa/src/glut/os2/glutos2.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glutos2.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,36 @@ +#ifndef __glutos2_h__ +#define __glutos2_h__ + + +/* Win32 "equivalent" cursors - eventually, the X glyphs should be + converted to Win32 cursors -- then they will look the same */ +#define XC_arrow IDC_ARROW +#define XC_top_left_arrow IDC_ARROW +#define XC_hand1 IDC_SIZEALL +#define XC_pirate IDC_NO +#define XC_question_arrow IDC_HELP +#define XC_exchange IDC_NO +#define XC_spraycan IDC_SIZEALL +#define XC_watch IDC_WAIT +#define XC_xterm IDC_IBEAM +#define XC_crosshair IDC_CROSS +#define XC_sb_v_double_arrow IDC_SIZENS +#define XC_sb_h_double_arrow IDC_SIZEWE +#define XC_top_side IDC_UPARROW +#define XC_bottom_side IDC_SIZENS +#define XC_left_side IDC_SIZEWE +#define XC_right_side IDC_SIZEWE +#define XC_top_left_corner IDC_SIZENWSE +#define XC_top_right_corner IDC_SIZENESW +#define XC_bottom_right_corner IDC_SIZENWSE +#define XC_bottom_left_corner IDC_SIZENESW + +#define XA_STRING 0 + +/* Private routines from win32_util.c */ +extern int gettimeofday(struct timeval* tp, void* tzp); +//extern void *__glutFont(void *font); +extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo); +extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height); + +#endif /* __glutos2_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glutOverlay.cpp xpsb-glx-0.19/mesa/src/glut/os2/glutOverlay.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glutOverlay.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glutOverlay.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,133 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. All rights reserved. + * + * FILE: glutOverlay.cpp + * + * DESCRIPTION: we don't support overlays, so this code is + * really simple + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include "glutint.h" +#include "glutbitmap.h" +#include "glutstroke.h" + +GLUTAPI void GLUTAPIENTRY +glutEstablishOverlay(void) +{ + __glutFatalError("OS2PM lacks overlay support."); +} + +GLUTAPI void GLUTAPIENTRY +glutUseLayer(GLenum layer) { + // ignore +} + +GLUTAPI void GLUTAPIENTRY +glutRemoveOverlay(void) { + // ignore +} + +GLUTAPI void GLUTAPIENTRY +glutPostOverlayRedisplay(void) { + // ignore +} + +GLUTAPI void GLUTAPIENTRY +glutShowOverlay(void) { + // ignore +} + +GLUTAPI void GLUTAPIENTRY glutHideOverlay(void) +{ + // ignore +} + +int GLUTAPIENTRY +glutLayerGet(GLenum param) +{ + // ignore +} + +/*********************************************************** + * Unsupported callbacks + ***********************************************************/ +GLUTAPI void GLUTAPIENTRY +glutOverlayDisplayFunc(GLUTdisplayCB displayFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutDialsFunc(GLUTdialsCB dialsFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc) +{ +} + +GLUTAPI void GLUTAPIENTRY +glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc) +{ +} +GLUTAPI void GLUTAPIENTRY +glutPostWindowOverlayRedisplay(int win) +{ // +} + +void GLUTAPIENTRY +glutInitDisplayString(const char *string) +{ // +} +void GLUTAPIENTRY +glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval) +{ // +} + +void GLUTAPIENTRY +glutForceJoystickFunc(void) +{ // +} + + +int GLUTAPIENTRY +glutBitmapWidth(GLUTbitmapFont font, int c) +{ return 0; +} +int GLUTAPIENTRY +glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) +{ // + return 0; +} +int GLUTAPIENTRY +glutStrokeWidth(GLUTstrokeFont font, int c) +{ return 0; +} +int GLUTAPIENTRY +glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) +{ return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_roman.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_roman.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_roman.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_roman.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2451 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#include "glutstroke.h" + +/* char: 33 '!' */ + +static const CoordRec char33_stroke0[] = { + { 13.3819, 100 }, + { 13.3819, 33.3333 }, +}; + +static const CoordRec char33_stroke1[] = { + { 13.3819, 9.5238 }, + { 8.62, 4.7619 }, + { 13.3819, 0 }, + { 18.1438, 4.7619 }, + { 13.3819, 9.5238 }, +}; + +static const StrokeRec char33[] = { + { 2, char33_stroke0 }, + { 5, char33_stroke1 }, +}; + +/* char: 34 '"' */ + +static const CoordRec char34_stroke0[] = { + { 4.02, 100 }, + { 4.02, 66.6667 }, +}; + +static const CoordRec char34_stroke1[] = { + { 42.1152, 100 }, + { 42.1152, 66.6667 }, +}; + +static const StrokeRec char34[] = { + { 2, char34_stroke0 }, + { 2, char34_stroke1 }, +}; + +/* char: 35 '#' */ + +static const CoordRec char35_stroke0[] = { + { 41.2952, 119.048 }, + { 7.9619, -33.3333 }, +}; + +static const CoordRec char35_stroke1[] = { + { 69.8667, 119.048 }, + { 36.5333, -33.3333 }, +}; + +static const CoordRec char35_stroke2[] = { + { 7.9619, 57.1429 }, + { 74.6286, 57.1429 }, +}; + +static const CoordRec char35_stroke3[] = { + { 3.2, 28.5714 }, + { 69.8667, 28.5714 }, +}; + +static const StrokeRec char35[] = { + { 2, char35_stroke0 }, + { 2, char35_stroke1 }, + { 2, char35_stroke2 }, + { 2, char35_stroke3 }, +}; + +/* char: 36 '$' */ + +static const CoordRec char36_stroke0[] = { + { 28.6295, 119.048 }, + { 28.6295, -19.0476 }, +}; + +static const CoordRec char36_stroke1[] = { + { 47.6771, 119.048 }, + { 47.6771, -19.0476 }, +}; + +static const CoordRec char36_stroke2[] = { + { 71.4867, 85.7143 }, + { 61.9629, 95.2381 }, + { 47.6771, 100 }, + { 28.6295, 100 }, + { 14.3438, 95.2381 }, + { 4.82, 85.7143 }, + { 4.82, 76.1905 }, + { 9.5819, 66.6667 }, + { 14.3438, 61.9048 }, + { 23.8676, 57.1429 }, + { 52.439, 47.619 }, + { 61.9629, 42.8571 }, + { 66.7248, 38.0952 }, + { 71.4867, 28.5714 }, + { 71.4867, 14.2857 }, + { 61.9629, 4.7619 }, + { 47.6771, 0 }, + { 28.6295, 0 }, + { 14.3438, 4.7619 }, + { 4.82, 14.2857 }, +}; + +static const StrokeRec char36[] = { + { 2, char36_stroke0 }, + { 2, char36_stroke1 }, + { 20, char36_stroke2 }, +}; + +/* char: 37 '%' */ + +static const CoordRec char37_stroke0[] = { + { 92.0743, 100 }, + { 6.36, 0 }, +}; + +static const CoordRec char37_stroke1[] = { + { 30.1695, 100 }, + { 39.6933, 90.4762 }, + { 39.6933, 80.9524 }, + { 34.9314, 71.4286 }, + { 25.4076, 66.6667 }, + { 15.8838, 66.6667 }, + { 6.36, 76.1905 }, + { 6.36, 85.7143 }, + { 11.1219, 95.2381 }, + { 20.6457, 100 }, + { 30.1695, 100 }, + { 39.6933, 95.2381 }, + { 53.979, 90.4762 }, + { 68.2648, 90.4762 }, + { 82.5505, 95.2381 }, + { 92.0743, 100 }, +}; + +static const CoordRec char37_stroke2[] = { + { 73.0267, 33.3333 }, + { 63.5029, 28.5714 }, + { 58.741, 19.0476 }, + { 58.741, 9.5238 }, + { 68.2648, 0 }, + { 77.7886, 0 }, + { 87.3124, 4.7619 }, + { 92.0743, 14.2857 }, + { 92.0743, 23.8095 }, + { 82.5505, 33.3333 }, + { 73.0267, 33.3333 }, +}; + +static const StrokeRec char37[] = { + { 2, char37_stroke0 }, + { 16, char37_stroke1 }, + { 11, char37_stroke2 }, +}; + +/* char: 38 '&' */ + +static const CoordRec char38_stroke0[] = { + { 101.218, 57.1429 }, + { 101.218, 61.9048 }, + { 96.4562, 66.6667 }, + { 91.6943, 66.6667 }, + { 86.9324, 61.9048 }, + { 82.1705, 52.381 }, + { 72.6467, 28.5714 }, + { 63.1229, 14.2857 }, + { 53.599, 4.7619 }, + { 44.0752, 0 }, + { 25.0276, 0 }, + { 15.5038, 4.7619 }, + { 10.7419, 9.5238 }, + { 5.98, 19.0476 }, + { 5.98, 28.5714 }, + { 10.7419, 38.0952 }, + { 15.5038, 42.8571 }, + { 48.8371, 61.9048 }, + { 53.599, 66.6667 }, + { 58.361, 76.1905 }, + { 58.361, 85.7143 }, + { 53.599, 95.2381 }, + { 44.0752, 100 }, + { 34.5514, 95.2381 }, + { 29.7895, 85.7143 }, + { 29.7895, 76.1905 }, + { 34.5514, 61.9048 }, + { 44.0752, 47.619 }, + { 67.8848, 14.2857 }, + { 77.4086, 4.7619 }, + { 86.9324, 0 }, + { 96.4562, 0 }, + { 101.218, 4.7619 }, + { 101.218, 9.5238 }, +}; + +static const StrokeRec char38[] = { + { 34, char38_stroke0 }, +}; + +/* char: 39 ''' */ + +static const CoordRec char39_stroke0[] = { + { 4.44, 100 }, + { 4.44, 66.6667 }, +}; + +static const StrokeRec char39[] = { + { 2, char39_stroke0 }, +}; + +/* char: 40 '(' */ + +static const CoordRec char40_stroke0[] = { + { 40.9133, 119.048 }, + { 31.3895, 109.524 }, + { 21.8657, 95.2381 }, + { 12.3419, 76.1905 }, + { 7.58, 52.381 }, + { 7.58, 33.3333 }, + { 12.3419, 9.5238 }, + { 21.8657, -9.5238 }, + { 31.3895, -23.8095 }, + { 40.9133, -33.3333 }, +}; + +static const StrokeRec char40[] = { + { 10, char40_stroke0 }, +}; + +/* char: 41 ')' */ + +static const CoordRec char41_stroke0[] = { + { 5.28, 119.048 }, + { 14.8038, 109.524 }, + { 24.3276, 95.2381 }, + { 33.8514, 76.1905 }, + { 38.6133, 52.381 }, + { 38.6133, 33.3333 }, + { 33.8514, 9.5238 }, + { 24.3276, -9.5238 }, + { 14.8038, -23.8095 }, + { 5.28, -33.3333 }, +}; + +static const StrokeRec char41[] = { + { 10, char41_stroke0 }, +}; + +/* char: 42 '*' */ + +static const CoordRec char42_stroke0[] = { + { 30.7695, 71.4286 }, + { 30.7695, 14.2857 }, +}; + +static const CoordRec char42_stroke1[] = { + { 6.96, 57.1429 }, + { 54.579, 28.5714 }, +}; + +static const CoordRec char42_stroke2[] = { + { 54.579, 57.1429 }, + { 6.96, 28.5714 }, +}; + +static const StrokeRec char42[] = { + { 2, char42_stroke0 }, + { 2, char42_stroke1 }, + { 2, char42_stroke2 }, +}; + +/* char: 43 '+' */ + +static const CoordRec char43_stroke0[] = { + { 48.8371, 85.7143 }, + { 48.8371, 0 }, +}; + +static const CoordRec char43_stroke1[] = { + { 5.98, 42.8571 }, + { 91.6943, 42.8571 }, +}; + +static const StrokeRec char43[] = { + { 2, char43_stroke0 }, + { 2, char43_stroke1 }, +}; + +/* char: 44 ',' */ + +static const CoordRec char44_stroke0[] = { + { 18.2838, 4.7619 }, + { 13.5219, 0 }, + { 8.76, 4.7619 }, + { 13.5219, 9.5238 }, + { 18.2838, 4.7619 }, + { 18.2838, -4.7619 }, + { 13.5219, -14.2857 }, + { 8.76, -19.0476 }, +}; + +static const StrokeRec char44[] = { + { 8, char44_stroke0 }, +}; + +/* char: 45 '-' */ + +static const CoordRec char45_stroke0[] = { + { 7.38, 42.8571 }, + { 93.0943, 42.8571 }, +}; + +static const StrokeRec char45[] = { + { 2, char45_stroke0 }, +}; + +/* char: 46 '.' */ + +static const CoordRec char46_stroke0[] = { + { 13.1019, 9.5238 }, + { 8.34, 4.7619 }, + { 13.1019, 0 }, + { 17.8638, 4.7619 }, + { 13.1019, 9.5238 }, +}; + +static const StrokeRec char46[] = { + { 5, char46_stroke0 }, +}; + +/* char: 47 '/' */ + +static const CoordRec char47_stroke0[] = { + { 7.24, -14.2857 }, + { 73.9067, 100 }, +}; + +static const StrokeRec char47[] = { + { 2, char47_stroke0 }, +}; + +/* char: 48 '0' */ + +static const CoordRec char48_stroke0[] = { + { 33.5514, 100 }, + { 19.2657, 95.2381 }, + { 9.7419, 80.9524 }, + { 4.98, 57.1429 }, + { 4.98, 42.8571 }, + { 9.7419, 19.0476 }, + { 19.2657, 4.7619 }, + { 33.5514, 0 }, + { 43.0752, 0 }, + { 57.361, 4.7619 }, + { 66.8848, 19.0476 }, + { 71.6467, 42.8571 }, + { 71.6467, 57.1429 }, + { 66.8848, 80.9524 }, + { 57.361, 95.2381 }, + { 43.0752, 100 }, + { 33.5514, 100 }, +}; + +static const StrokeRec char48[] = { + { 17, char48_stroke0 }, +}; + +/* char: 49 '1' */ + +static const CoordRec char49_stroke0[] = { + { 11.82, 80.9524 }, + { 21.3438, 85.7143 }, + { 35.6295, 100 }, + { 35.6295, 0 }, +}; + +static const StrokeRec char49[] = { + { 4, char49_stroke0 }, +}; + +/* char: 50 '2' */ + +static const CoordRec char50_stroke0[] = { + { 10.1819, 76.1905 }, + { 10.1819, 80.9524 }, + { 14.9438, 90.4762 }, + { 19.7057, 95.2381 }, + { 29.2295, 100 }, + { 48.2771, 100 }, + { 57.801, 95.2381 }, + { 62.5629, 90.4762 }, + { 67.3248, 80.9524 }, + { 67.3248, 71.4286 }, + { 62.5629, 61.9048 }, + { 53.039, 47.619 }, + { 5.42, 0 }, + { 72.0867, 0 }, +}; + +static const StrokeRec char50[] = { + { 14, char50_stroke0 }, +}; + +/* char: 51 '3' */ + +static const CoordRec char51_stroke0[] = { + { 14.5238, 100 }, + { 66.9048, 100 }, + { 38.3333, 61.9048 }, + { 52.619, 61.9048 }, + { 62.1429, 57.1429 }, + { 66.9048, 52.381 }, + { 71.6667, 38.0952 }, + { 71.6667, 28.5714 }, + { 66.9048, 14.2857 }, + { 57.381, 4.7619 }, + { 43.0952, 0 }, + { 28.8095, 0 }, + { 14.5238, 4.7619 }, + { 9.7619, 9.5238 }, + { 5, 19.0476 }, +}; + +static const StrokeRec char51[] = { + { 15, char51_stroke0 }, +}; + +/* char: 52 '4' */ + +static const CoordRec char52_stroke0[] = { + { 51.499, 100 }, + { 3.88, 33.3333 }, + { 75.3086, 33.3333 }, +}; + +static const CoordRec char52_stroke1[] = { + { 51.499, 100 }, + { 51.499, 0 }, +}; + +static const StrokeRec char52[] = { + { 3, char52_stroke0 }, + { 2, char52_stroke1 }, +}; + +/* char: 53 '5' */ + +static const CoordRec char53_stroke0[] = { + { 62.0029, 100 }, + { 14.3838, 100 }, + { 9.6219, 57.1429 }, + { 14.3838, 61.9048 }, + { 28.6695, 66.6667 }, + { 42.9552, 66.6667 }, + { 57.241, 61.9048 }, + { 66.7648, 52.381 }, + { 71.5267, 38.0952 }, + { 71.5267, 28.5714 }, + { 66.7648, 14.2857 }, + { 57.241, 4.7619 }, + { 42.9552, 0 }, + { 28.6695, 0 }, + { 14.3838, 4.7619 }, + { 9.6219, 9.5238 }, + { 4.86, 19.0476 }, +}; + +static const StrokeRec char53[] = { + { 17, char53_stroke0 }, +}; + +/* char: 54 '6' */ + +static const CoordRec char54_stroke0[] = { + { 62.7229, 85.7143 }, + { 57.961, 95.2381 }, + { 43.6752, 100 }, + { 34.1514, 100 }, + { 19.8657, 95.2381 }, + { 10.3419, 80.9524 }, + { 5.58, 57.1429 }, + { 5.58, 33.3333 }, + { 10.3419, 14.2857 }, + { 19.8657, 4.7619 }, + { 34.1514, 0 }, + { 38.9133, 0 }, + { 53.199, 4.7619 }, + { 62.7229, 14.2857 }, + { 67.4848, 28.5714 }, + { 67.4848, 33.3333 }, + { 62.7229, 47.619 }, + { 53.199, 57.1429 }, + { 38.9133, 61.9048 }, + { 34.1514, 61.9048 }, + { 19.8657, 57.1429 }, + { 10.3419, 47.619 }, + { 5.58, 33.3333 }, +}; + +static const StrokeRec char54[] = { + { 23, char54_stroke0 }, +}; + +/* char: 55 '7' */ + +static const CoordRec char55_stroke0[] = { + { 72.2267, 100 }, + { 24.6076, 0 }, +}; + +static const CoordRec char55_stroke1[] = { + { 5.56, 100 }, + { 72.2267, 100 }, +}; + +static const StrokeRec char55[] = { + { 2, char55_stroke0 }, + { 2, char55_stroke1 }, +}; + +/* char: 56 '8' */ + +static const CoordRec char56_stroke0[] = { + { 29.4095, 100 }, + { 15.1238, 95.2381 }, + { 10.3619, 85.7143 }, + { 10.3619, 76.1905 }, + { 15.1238, 66.6667 }, + { 24.6476, 61.9048 }, + { 43.6952, 57.1429 }, + { 57.981, 52.381 }, + { 67.5048, 42.8571 }, + { 72.2667, 33.3333 }, + { 72.2667, 19.0476 }, + { 67.5048, 9.5238 }, + { 62.7429, 4.7619 }, + { 48.4571, 0 }, + { 29.4095, 0 }, + { 15.1238, 4.7619 }, + { 10.3619, 9.5238 }, + { 5.6, 19.0476 }, + { 5.6, 33.3333 }, + { 10.3619, 42.8571 }, + { 19.8857, 52.381 }, + { 34.1714, 57.1429 }, + { 53.219, 61.9048 }, + { 62.7429, 66.6667 }, + { 67.5048, 76.1905 }, + { 67.5048, 85.7143 }, + { 62.7429, 95.2381 }, + { 48.4571, 100 }, + { 29.4095, 100 }, +}; + +static const StrokeRec char56[] = { + { 29, char56_stroke0 }, +}; + +/* char: 57 '9' */ + +static const CoordRec char57_stroke0[] = { + { 68.5048, 66.6667 }, + { 63.7429, 52.381 }, + { 54.219, 42.8571 }, + { 39.9333, 38.0952 }, + { 35.1714, 38.0952 }, + { 20.8857, 42.8571 }, + { 11.3619, 52.381 }, + { 6.6, 66.6667 }, + { 6.6, 71.4286 }, + { 11.3619, 85.7143 }, + { 20.8857, 95.2381 }, + { 35.1714, 100 }, + { 39.9333, 100 }, + { 54.219, 95.2381 }, + { 63.7429, 85.7143 }, + { 68.5048, 66.6667 }, + { 68.5048, 42.8571 }, + { 63.7429, 19.0476 }, + { 54.219, 4.7619 }, + { 39.9333, 0 }, + { 30.4095, 0 }, + { 16.1238, 4.7619 }, + { 11.3619, 14.2857 }, +}; + +static const StrokeRec char57[] = { + { 23, char57_stroke0 }, +}; + +/* char: 58 ':' */ + +static const CoordRec char58_stroke0[] = { + { 14.0819, 66.6667 }, + { 9.32, 61.9048 }, + { 14.0819, 57.1429 }, + { 18.8438, 61.9048 }, + { 14.0819, 66.6667 }, +}; + +static const CoordRec char58_stroke1[] = { + { 14.0819, 9.5238 }, + { 9.32, 4.7619 }, + { 14.0819, 0 }, + { 18.8438, 4.7619 }, + { 14.0819, 9.5238 }, +}; + +static const StrokeRec char58[] = { + { 5, char58_stroke0 }, + { 5, char58_stroke1 }, +}; + +/* char: 59 ';' */ + +static const CoordRec char59_stroke0[] = { + { 12.9619, 66.6667 }, + { 8.2, 61.9048 }, + { 12.9619, 57.1429 }, + { 17.7238, 61.9048 }, + { 12.9619, 66.6667 }, +}; + +static const CoordRec char59_stroke1[] = { + { 17.7238, 4.7619 }, + { 12.9619, 0 }, + { 8.2, 4.7619 }, + { 12.9619, 9.5238 }, + { 17.7238, 4.7619 }, + { 17.7238, -4.7619 }, + { 12.9619, -14.2857 }, + { 8.2, -19.0476 }, +}; + +static const StrokeRec char59[] = { + { 5, char59_stroke0 }, + { 8, char59_stroke1 }, +}; + +/* char: 60 '<' */ + +static const CoordRec char60_stroke0[] = { + { 79.2505, 85.7143 }, + { 3.06, 42.8571 }, + { 79.2505, 0 }, +}; + +static const StrokeRec char60[] = { + { 3, char60_stroke0 }, +}; + +/* char: 61 '=' */ + +static const CoordRec char61_stroke0[] = { + { 5.7, 57.1429 }, + { 91.4143, 57.1429 }, +}; + +static const CoordRec char61_stroke1[] = { + { 5.7, 28.5714 }, + { 91.4143, 28.5714 }, +}; + +static const StrokeRec char61[] = { + { 2, char61_stroke0 }, + { 2, char61_stroke1 }, +}; + +/* char: 62 '>' */ + +static const CoordRec char62_stroke0[] = { + { 2.78, 85.7143 }, + { 78.9705, 42.8571 }, + { 2.78, 0 }, +}; + +static const StrokeRec char62[] = { + { 3, char62_stroke0 }, +}; + +/* char: 63 '?' */ + +static const CoordRec char63_stroke0[] = { + { 8.42, 76.1905 }, + { 8.42, 80.9524 }, + { 13.1819, 90.4762 }, + { 17.9438, 95.2381 }, + { 27.4676, 100 }, + { 46.5152, 100 }, + { 56.039, 95.2381 }, + { 60.801, 90.4762 }, + { 65.5629, 80.9524 }, + { 65.5629, 71.4286 }, + { 60.801, 61.9048 }, + { 56.039, 57.1429 }, + { 36.9914, 47.619 }, + { 36.9914, 33.3333 }, +}; + +static const CoordRec char63_stroke1[] = { + { 36.9914, 9.5238 }, + { 32.2295, 4.7619 }, + { 36.9914, 0 }, + { 41.7533, 4.7619 }, + { 36.9914, 9.5238 }, +}; + +static const StrokeRec char63[] = { + { 14, char63_stroke0 }, + { 5, char63_stroke1 }, +}; + +/* char: 64 '@' */ + +static const CoordRec char64_stroke0[] = { + { 49.2171, 52.381 }, + { 39.6933, 57.1429 }, + { 30.1695, 57.1429 }, + { 25.4076, 47.619 }, + { 25.4076, 42.8571 }, + { 30.1695, 33.3333 }, + { 39.6933, 33.3333 }, + { 49.2171, 38.0952 }, +}; + +static const CoordRec char64_stroke1[] = { + { 49.2171, 57.1429 }, + { 49.2171, 38.0952 }, + { 53.979, 33.3333 }, + { 63.5029, 33.3333 }, + { 68.2648, 42.8571 }, + { 68.2648, 47.619 }, + { 63.5029, 61.9048 }, + { 53.979, 71.4286 }, + { 39.6933, 76.1905 }, + { 34.9314, 76.1905 }, + { 20.6457, 71.4286 }, + { 11.1219, 61.9048 }, + { 6.36, 47.619 }, + { 6.36, 42.8571 }, + { 11.1219, 28.5714 }, + { 20.6457, 19.0476 }, + { 34.9314, 14.2857 }, + { 39.6933, 14.2857 }, + { 53.979, 19.0476 }, +}; + +static const StrokeRec char64[] = { + { 8, char64_stroke0 }, + { 19, char64_stroke1 }, +}; + +/* char: 65 'A' */ + +static const CoordRec char65_stroke0[] = { + { 40.5952, 100 }, + { 2.5, 0 }, +}; + +static const CoordRec char65_stroke1[] = { + { 40.5952, 100 }, + { 78.6905, 0 }, +}; + +static const CoordRec char65_stroke2[] = { + { 16.7857, 33.3333 }, + { 64.4048, 33.3333 }, +}; + +static const StrokeRec char65[] = { + { 2, char65_stroke0 }, + { 2, char65_stroke1 }, + { 2, char65_stroke2 }, +}; + +/* char: 66 'B' */ + +static const CoordRec char66_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char66_stroke1[] = { + { 11.42, 100 }, + { 54.2771, 100 }, + { 68.5629, 95.2381 }, + { 73.3248, 90.4762 }, + { 78.0867, 80.9524 }, + { 78.0867, 71.4286 }, + { 73.3248, 61.9048 }, + { 68.5629, 57.1429 }, + { 54.2771, 52.381 }, +}; + +static const CoordRec char66_stroke2[] = { + { 11.42, 52.381 }, + { 54.2771, 52.381 }, + { 68.5629, 47.619 }, + { 73.3248, 42.8571 }, + { 78.0867, 33.3333 }, + { 78.0867, 19.0476 }, + { 73.3248, 9.5238 }, + { 68.5629, 4.7619 }, + { 54.2771, 0 }, + { 11.42, 0 }, +}; + +static const StrokeRec char66[] = { + { 2, char66_stroke0 }, + { 9, char66_stroke1 }, + { 10, char66_stroke2 }, +}; + +/* char: 67 'C' */ + +static const CoordRec char67_stroke0[] = { + { 78.0886, 76.1905 }, + { 73.3267, 85.7143 }, + { 63.8029, 95.2381 }, + { 54.279, 100 }, + { 35.2314, 100 }, + { 25.7076, 95.2381 }, + { 16.1838, 85.7143 }, + { 11.4219, 76.1905 }, + { 6.66, 61.9048 }, + { 6.66, 38.0952 }, + { 11.4219, 23.8095 }, + { 16.1838, 14.2857 }, + { 25.7076, 4.7619 }, + { 35.2314, 0 }, + { 54.279, 0 }, + { 63.8029, 4.7619 }, + { 73.3267, 14.2857 }, + { 78.0886, 23.8095 }, +}; + +static const StrokeRec char67[] = { + { 18, char67_stroke0 }, +}; + +/* char: 68 'D' */ + +static const CoordRec char68_stroke0[] = { + { 11.96, 100 }, + { 11.96, 0 }, +}; + +static const CoordRec char68_stroke1[] = { + { 11.96, 100 }, + { 45.2933, 100 }, + { 59.579, 95.2381 }, + { 69.1029, 85.7143 }, + { 73.8648, 76.1905 }, + { 78.6267, 61.9048 }, + { 78.6267, 38.0952 }, + { 73.8648, 23.8095 }, + { 69.1029, 14.2857 }, + { 59.579, 4.7619 }, + { 45.2933, 0 }, + { 11.96, 0 }, +}; + +static const StrokeRec char68[] = { + { 2, char68_stroke0 }, + { 12, char68_stroke1 }, +}; + +/* char: 69 'E' */ + +static const CoordRec char69_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char69_stroke1[] = { + { 11.42, 100 }, + { 73.3248, 100 }, +}; + +static const CoordRec char69_stroke2[] = { + { 11.42, 52.381 }, + { 49.5152, 52.381 }, +}; + +static const CoordRec char69_stroke3[] = { + { 11.42, 0 }, + { 73.3248, 0 }, +}; + +static const StrokeRec char69[] = { + { 2, char69_stroke0 }, + { 2, char69_stroke1 }, + { 2, char69_stroke2 }, + { 2, char69_stroke3 }, +}; + +/* char: 70 'F' */ + +static const CoordRec char70_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char70_stroke1[] = { + { 11.42, 100 }, + { 73.3248, 100 }, +}; + +static const CoordRec char70_stroke2[] = { + { 11.42, 52.381 }, + { 49.5152, 52.381 }, +}; + +static const StrokeRec char70[] = { + { 2, char70_stroke0 }, + { 2, char70_stroke1 }, + { 2, char70_stroke2 }, +}; + +/* char: 71 'G' */ + +static const CoordRec char71_stroke0[] = { + { 78.4886, 76.1905 }, + { 73.7267, 85.7143 }, + { 64.2029, 95.2381 }, + { 54.679, 100 }, + { 35.6314, 100 }, + { 26.1076, 95.2381 }, + { 16.5838, 85.7143 }, + { 11.8219, 76.1905 }, + { 7.06, 61.9048 }, + { 7.06, 38.0952 }, + { 11.8219, 23.8095 }, + { 16.5838, 14.2857 }, + { 26.1076, 4.7619 }, + { 35.6314, 0 }, + { 54.679, 0 }, + { 64.2029, 4.7619 }, + { 73.7267, 14.2857 }, + { 78.4886, 23.8095 }, + { 78.4886, 38.0952 }, +}; + +static const CoordRec char71_stroke1[] = { + { 54.679, 38.0952 }, + { 78.4886, 38.0952 }, +}; + +static const StrokeRec char71[] = { + { 19, char71_stroke0 }, + { 2, char71_stroke1 }, +}; + +/* char: 72 'H' */ + +static const CoordRec char72_stroke0[] = { + { 11.42, 100 }, + { 11.42, 0 }, +}; + +static const CoordRec char72_stroke1[] = { + { 78.0867, 100 }, + { 78.0867, 0 }, +}; + +static const CoordRec char72_stroke2[] = { + { 11.42, 52.381 }, + { 78.0867, 52.381 }, +}; + +static const StrokeRec char72[] = { + { 2, char72_stroke0 }, + { 2, char72_stroke1 }, + { 2, char72_stroke2 }, +}; + +/* char: 73 'I' */ + +static const CoordRec char73_stroke0[] = { + { 10.86, 100 }, + { 10.86, 0 }, +}; + +static const StrokeRec char73[] = { + { 2, char73_stroke0 }, +}; + +/* char: 74 'J' */ + +static const CoordRec char74_stroke0[] = { + { 50.119, 100 }, + { 50.119, 23.8095 }, + { 45.3571, 9.5238 }, + { 40.5952, 4.7619 }, + { 31.0714, 0 }, + { 21.5476, 0 }, + { 12.0238, 4.7619 }, + { 7.2619, 9.5238 }, + { 2.5, 23.8095 }, + { 2.5, 33.3333 }, +}; + +static const StrokeRec char74[] = { + { 10, char74_stroke0 }, +}; + +/* char: 75 'K' */ + +static const CoordRec char75_stroke0[] = { + { 11.28, 100 }, + { 11.28, 0 }, +}; + +static const CoordRec char75_stroke1[] = { + { 77.9467, 100 }, + { 11.28, 33.3333 }, +}; + +static const CoordRec char75_stroke2[] = { + { 35.0895, 57.1429 }, + { 77.9467, 0 }, +}; + +static const StrokeRec char75[] = { + { 2, char75_stroke0 }, + { 2, char75_stroke1 }, + { 2, char75_stroke2 }, +}; + +/* char: 76 'L' */ + +static const CoordRec char76_stroke0[] = { + { 11.68, 100 }, + { 11.68, 0 }, +}; + +static const CoordRec char76_stroke1[] = { + { 11.68, 0 }, + { 68.8229, 0 }, +}; + +static const StrokeRec char76[] = { + { 2, char76_stroke0 }, + { 2, char76_stroke1 }, +}; + +/* char: 77 'M' */ + +static const CoordRec char77_stroke0[] = { + { 10.86, 100 }, + { 10.86, 0 }, +}; + +static const CoordRec char77_stroke1[] = { + { 10.86, 100 }, + { 48.9552, 0 }, +}; + +static const CoordRec char77_stroke2[] = { + { 87.0505, 100 }, + { 48.9552, 0 }, +}; + +static const CoordRec char77_stroke3[] = { + { 87.0505, 100 }, + { 87.0505, 0 }, +}; + +static const StrokeRec char77[] = { + { 2, char77_stroke0 }, + { 2, char77_stroke1 }, + { 2, char77_stroke2 }, + { 2, char77_stroke3 }, +}; + +/* char: 78 'N' */ + +static const CoordRec char78_stroke0[] = { + { 11.14, 100 }, + { 11.14, 0 }, +}; + +static const CoordRec char78_stroke1[] = { + { 11.14, 100 }, + { 77.8067, 0 }, +}; + +static const CoordRec char78_stroke2[] = { + { 77.8067, 100 }, + { 77.8067, 0 }, +}; + +static const StrokeRec char78[] = { + { 2, char78_stroke0 }, + { 2, char78_stroke1 }, + { 2, char78_stroke2 }, +}; + +/* char: 79 'O' */ + +static const CoordRec char79_stroke0[] = { + { 34.8114, 100 }, + { 25.2876, 95.2381 }, + { 15.7638, 85.7143 }, + { 11.0019, 76.1905 }, + { 6.24, 61.9048 }, + { 6.24, 38.0952 }, + { 11.0019, 23.8095 }, + { 15.7638, 14.2857 }, + { 25.2876, 4.7619 }, + { 34.8114, 0 }, + { 53.859, 0 }, + { 63.3829, 4.7619 }, + { 72.9067, 14.2857 }, + { 77.6686, 23.8095 }, + { 82.4305, 38.0952 }, + { 82.4305, 61.9048 }, + { 77.6686, 76.1905 }, + { 72.9067, 85.7143 }, + { 63.3829, 95.2381 }, + { 53.859, 100 }, + { 34.8114, 100 }, +}; + +static const StrokeRec char79[] = { + { 21, char79_stroke0 }, +}; + +/* char: 80 'P' */ + +static const CoordRec char80_stroke0[] = { + { 12.1, 100 }, + { 12.1, 0 }, +}; + +static const CoordRec char80_stroke1[] = { + { 12.1, 100 }, + { 54.9571, 100 }, + { 69.2429, 95.2381 }, + { 74.0048, 90.4762 }, + { 78.7667, 80.9524 }, + { 78.7667, 66.6667 }, + { 74.0048, 57.1429 }, + { 69.2429, 52.381 }, + { 54.9571, 47.619 }, + { 12.1, 47.619 }, +}; + +static const StrokeRec char80[] = { + { 2, char80_stroke0 }, + { 10, char80_stroke1 }, +}; + +/* char: 81 'Q' */ + +static const CoordRec char81_stroke0[] = { + { 33.8714, 100 }, + { 24.3476, 95.2381 }, + { 14.8238, 85.7143 }, + { 10.0619, 76.1905 }, + { 5.3, 61.9048 }, + { 5.3, 38.0952 }, + { 10.0619, 23.8095 }, + { 14.8238, 14.2857 }, + { 24.3476, 4.7619 }, + { 33.8714, 0 }, + { 52.919, 0 }, + { 62.4429, 4.7619 }, + { 71.9667, 14.2857 }, + { 76.7286, 23.8095 }, + { 81.4905, 38.0952 }, + { 81.4905, 61.9048 }, + { 76.7286, 76.1905 }, + { 71.9667, 85.7143 }, + { 62.4429, 95.2381 }, + { 52.919, 100 }, + { 33.8714, 100 }, +}; + +static const CoordRec char81_stroke1[] = { + { 48.1571, 19.0476 }, + { 76.7286, -9.5238 }, +}; + +static const StrokeRec char81[] = { + { 21, char81_stroke0 }, + { 2, char81_stroke1 }, +}; + +/* char: 82 'R' */ + +static const CoordRec char82_stroke0[] = { + { 11.68, 100 }, + { 11.68, 0 }, +}; + +static const CoordRec char82_stroke1[] = { + { 11.68, 100 }, + { 54.5371, 100 }, + { 68.8229, 95.2381 }, + { 73.5848, 90.4762 }, + { 78.3467, 80.9524 }, + { 78.3467, 71.4286 }, + { 73.5848, 61.9048 }, + { 68.8229, 57.1429 }, + { 54.5371, 52.381 }, + { 11.68, 52.381 }, +}; + +static const CoordRec char82_stroke2[] = { + { 45.0133, 52.381 }, + { 78.3467, 0 }, +}; + +static const StrokeRec char82[] = { + { 2, char82_stroke0 }, + { 10, char82_stroke1 }, + { 2, char82_stroke2 }, +}; + +/* char: 83 'S' */ + +static const CoordRec char83_stroke0[] = { + { 74.6667, 85.7143 }, + { 65.1429, 95.2381 }, + { 50.8571, 100 }, + { 31.8095, 100 }, + { 17.5238, 95.2381 }, + { 8, 85.7143 }, + { 8, 76.1905 }, + { 12.7619, 66.6667 }, + { 17.5238, 61.9048 }, + { 27.0476, 57.1429 }, + { 55.619, 47.619 }, + { 65.1429, 42.8571 }, + { 69.9048, 38.0952 }, + { 74.6667, 28.5714 }, + { 74.6667, 14.2857 }, + { 65.1429, 4.7619 }, + { 50.8571, 0 }, + { 31.8095, 0 }, + { 17.5238, 4.7619 }, + { 8, 14.2857 }, +}; + +static const StrokeRec char83[] = { + { 20, char83_stroke0 }, +}; + +/* char: 84 'T' */ + +static const CoordRec char84_stroke0[] = { + { 35.6933, 100 }, + { 35.6933, 0 }, +}; + +static const CoordRec char84_stroke1[] = { + { 2.36, 100 }, + { 69.0267, 100 }, +}; + +static const StrokeRec char84[] = { + { 2, char84_stroke0 }, + { 2, char84_stroke1 }, +}; + +/* char: 85 'U' */ + +static const CoordRec char85_stroke0[] = { + { 11.54, 100 }, + { 11.54, 28.5714 }, + { 16.3019, 14.2857 }, + { 25.8257, 4.7619 }, + { 40.1114, 0 }, + { 49.6352, 0 }, + { 63.921, 4.7619 }, + { 73.4448, 14.2857 }, + { 78.2067, 28.5714 }, + { 78.2067, 100 }, +}; + +static const StrokeRec char85[] = { + { 10, char85_stroke0 }, +}; + +/* char: 86 'V' */ + +static const CoordRec char86_stroke0[] = { + { 2.36, 100 }, + { 40.4552, 0 }, +}; + +static const CoordRec char86_stroke1[] = { + { 78.5505, 100 }, + { 40.4552, 0 }, +}; + +static const StrokeRec char86[] = { + { 2, char86_stroke0 }, + { 2, char86_stroke1 }, +}; + +/* char: 87 'W' */ + +static const CoordRec char87_stroke0[] = { + { 2.22, 100 }, + { 26.0295, 0 }, +}; + +static const CoordRec char87_stroke1[] = { + { 49.839, 100 }, + { 26.0295, 0 }, +}; + +static const CoordRec char87_stroke2[] = { + { 49.839, 100 }, + { 73.6486, 0 }, +}; + +static const CoordRec char87_stroke3[] = { + { 97.4581, 100 }, + { 73.6486, 0 }, +}; + +static const StrokeRec char87[] = { + { 2, char87_stroke0 }, + { 2, char87_stroke1 }, + { 2, char87_stroke2 }, + { 2, char87_stroke3 }, +}; + +/* char: 88 'X' */ + +static const CoordRec char88_stroke0[] = { + { 2.5, 100 }, + { 69.1667, 0 }, +}; + +static const CoordRec char88_stroke1[] = { + { 69.1667, 100 }, + { 2.5, 0 }, +}; + +static const StrokeRec char88[] = { + { 2, char88_stroke0 }, + { 2, char88_stroke1 }, +}; + +/* char: 89 'Y' */ + +static const CoordRec char89_stroke0[] = { + { 1.52, 100 }, + { 39.6152, 52.381 }, + { 39.6152, 0 }, +}; + +static const CoordRec char89_stroke1[] = { + { 77.7105, 100 }, + { 39.6152, 52.381 }, +}; + +static const StrokeRec char89[] = { + { 3, char89_stroke0 }, + { 2, char89_stroke1 }, +}; + +/* char: 90 'Z' */ + +static const CoordRec char90_stroke0[] = { + { 69.1667, 100 }, + { 2.5, 0 }, +}; + +static const CoordRec char90_stroke1[] = { + { 2.5, 100 }, + { 69.1667, 100 }, +}; + +static const CoordRec char90_stroke2[] = { + { 2.5, 0 }, + { 69.1667, 0 }, +}; + +static const StrokeRec char90[] = { + { 2, char90_stroke0 }, + { 2, char90_stroke1 }, + { 2, char90_stroke2 }, +}; + +/* char: 91 '[' */ + +static const CoordRec char91_stroke0[] = { + { 7.78, 119.048 }, + { 7.78, -33.3333 }, +}; + +static const CoordRec char91_stroke1[] = { + { 12.5419, 119.048 }, + { 12.5419, -33.3333 }, +}; + +static const CoordRec char91_stroke2[] = { + { 7.78, 119.048 }, + { 41.1133, 119.048 }, +}; + +static const CoordRec char91_stroke3[] = { + { 7.78, -33.3333 }, + { 41.1133, -33.3333 }, +}; + +static const StrokeRec char91[] = { + { 2, char91_stroke0 }, + { 2, char91_stroke1 }, + { 2, char91_stroke2 }, + { 2, char91_stroke3 }, +}; + +/* char: 92 '\' */ + +static const CoordRec char92_stroke0[] = { + { 5.84, 100 }, + { 72.5067, -14.2857 }, +}; + +static const StrokeRec char92[] = { + { 2, char92_stroke0 }, +}; + +/* char: 93 ']' */ + +static const CoordRec char93_stroke0[] = { + { 33.0114, 119.048 }, + { 33.0114, -33.3333 }, +}; + +static const CoordRec char93_stroke1[] = { + { 37.7733, 119.048 }, + { 37.7733, -33.3333 }, +}; + +static const CoordRec char93_stroke2[] = { + { 4.44, 119.048 }, + { 37.7733, 119.048 }, +}; + +static const CoordRec char93_stroke3[] = { + { 4.44, -33.3333 }, + { 37.7733, -33.3333 }, +}; + +static const StrokeRec char93[] = { + { 2, char93_stroke0 }, + { 2, char93_stroke1 }, + { 2, char93_stroke2 }, + { 2, char93_stroke3 }, +}; + +/* char: 94 '^' */ + +static const CoordRec char94_stroke0[] = { + { 44.0752, 109.524 }, + { 5.98, 42.8571 }, +}; + +static const CoordRec char94_stroke1[] = { + { 44.0752, 109.524 }, + { 82.1705, 42.8571 }, +}; + +static const StrokeRec char94[] = { + { 2, char94_stroke0 }, + { 2, char94_stroke1 }, +}; + +/* char: 95 '_' */ + +static const CoordRec char95_stroke0[] = { + { -1.1, -33.3333 }, + { 103.662, -33.3333 }, + { 103.662, -28.5714 }, + { -1.1, -28.5714 }, + { -1.1, -33.3333 }, +}; + +static const StrokeRec char95[] = { + { 5, char95_stroke0 }, +}; + +/* char: 96 '`' */ + +static const CoordRec char96_stroke0[] = { + { 33.0219, 100 }, + { 56.8314, 71.4286 }, +}; + +static const CoordRec char96_stroke1[] = { + { 33.0219, 100 }, + { 28.26, 95.2381 }, + { 56.8314, 71.4286 }, +}; + +static const StrokeRec char96[] = { + { 2, char96_stroke0 }, + { 3, char96_stroke1 }, +}; + +/* char: 97 'a' */ + +static const CoordRec char97_stroke0[] = { + { 63.8229, 66.6667 }, + { 63.8229, 0 }, +}; + +static const CoordRec char97_stroke1[] = { + { 63.8229, 52.381 }, + { 54.299, 61.9048 }, + { 44.7752, 66.6667 }, + { 30.4895, 66.6667 }, + { 20.9657, 61.9048 }, + { 11.4419, 52.381 }, + { 6.68, 38.0952 }, + { 6.68, 28.5714 }, + { 11.4419, 14.2857 }, + { 20.9657, 4.7619 }, + { 30.4895, 0 }, + { 44.7752, 0 }, + { 54.299, 4.7619 }, + { 63.8229, 14.2857 }, +}; + +static const StrokeRec char97[] = { + { 2, char97_stroke0 }, + { 14, char97_stroke1 }, +}; + +/* char: 98 'b' */ + +static const CoordRec char98_stroke0[] = { + { 8.76, 100 }, + { 8.76, 0 }, +}; + +static const CoordRec char98_stroke1[] = { + { 8.76, 52.381 }, + { 18.2838, 61.9048 }, + { 27.8076, 66.6667 }, + { 42.0933, 66.6667 }, + { 51.6171, 61.9048 }, + { 61.141, 52.381 }, + { 65.9029, 38.0952 }, + { 65.9029, 28.5714 }, + { 61.141, 14.2857 }, + { 51.6171, 4.7619 }, + { 42.0933, 0 }, + { 27.8076, 0 }, + { 18.2838, 4.7619 }, + { 8.76, 14.2857 }, +}; + +static const StrokeRec char98[] = { + { 2, char98_stroke0 }, + { 14, char98_stroke1 }, +}; + +/* char: 99 'c' */ + +static const CoordRec char99_stroke0[] = { + { 62.6629, 52.381 }, + { 53.139, 61.9048 }, + { 43.6152, 66.6667 }, + { 29.3295, 66.6667 }, + { 19.8057, 61.9048 }, + { 10.2819, 52.381 }, + { 5.52, 38.0952 }, + { 5.52, 28.5714 }, + { 10.2819, 14.2857 }, + { 19.8057, 4.7619 }, + { 29.3295, 0 }, + { 43.6152, 0 }, + { 53.139, 4.7619 }, + { 62.6629, 14.2857 }, +}; + +static const StrokeRec char99[] = { + { 14, char99_stroke0 }, +}; + +/* char: 100 'd' */ + +static const CoordRec char100_stroke0[] = { + { 61.7829, 100 }, + { 61.7829, 0 }, +}; + +static const CoordRec char100_stroke1[] = { + { 61.7829, 52.381 }, + { 52.259, 61.9048 }, + { 42.7352, 66.6667 }, + { 28.4495, 66.6667 }, + { 18.9257, 61.9048 }, + { 9.4019, 52.381 }, + { 4.64, 38.0952 }, + { 4.64, 28.5714 }, + { 9.4019, 14.2857 }, + { 18.9257, 4.7619 }, + { 28.4495, 0 }, + { 42.7352, 0 }, + { 52.259, 4.7619 }, + { 61.7829, 14.2857 }, +}; + +static const StrokeRec char100[] = { + { 2, char100_stroke0 }, + { 14, char100_stroke1 }, +}; + +/* char: 101 'e' */ + +static const CoordRec char101_stroke0[] = { + { 5.72, 38.0952 }, + { 62.8629, 38.0952 }, + { 62.8629, 47.619 }, + { 58.101, 57.1429 }, + { 53.339, 61.9048 }, + { 43.8152, 66.6667 }, + { 29.5295, 66.6667 }, + { 20.0057, 61.9048 }, + { 10.4819, 52.381 }, + { 5.72, 38.0952 }, + { 5.72, 28.5714 }, + { 10.4819, 14.2857 }, + { 20.0057, 4.7619 }, + { 29.5295, 0 }, + { 43.8152, 0 }, + { 53.339, 4.7619 }, + { 62.8629, 14.2857 }, +}; + +static const StrokeRec char101[] = { + { 17, char101_stroke0 }, +}; + +/* char: 102 'f' */ + +static const CoordRec char102_stroke0[] = { + { 38.7752, 100 }, + { 29.2514, 100 }, + { 19.7276, 95.2381 }, + { 14.9657, 80.9524 }, + { 14.9657, 0 }, +}; + +static const CoordRec char102_stroke1[] = { + { 0.68, 66.6667 }, + { 34.0133, 66.6667 }, +}; + +static const StrokeRec char102[] = { + { 5, char102_stroke0 }, + { 2, char102_stroke1 }, +}; + +/* char: 103 'g' */ + +static const CoordRec char103_stroke0[] = { + { 62.5029, 66.6667 }, + { 62.5029, -9.5238 }, + { 57.741, -23.8095 }, + { 52.979, -28.5714 }, + { 43.4552, -33.3333 }, + { 29.1695, -33.3333 }, + { 19.6457, -28.5714 }, +}; + +static const CoordRec char103_stroke1[] = { + { 62.5029, 52.381 }, + { 52.979, 61.9048 }, + { 43.4552, 66.6667 }, + { 29.1695, 66.6667 }, + { 19.6457, 61.9048 }, + { 10.1219, 52.381 }, + { 5.36, 38.0952 }, + { 5.36, 28.5714 }, + { 10.1219, 14.2857 }, + { 19.6457, 4.7619 }, + { 29.1695, 0 }, + { 43.4552, 0 }, + { 52.979, 4.7619 }, + { 62.5029, 14.2857 }, +}; + +static const StrokeRec char103[] = { + { 7, char103_stroke0 }, + { 14, char103_stroke1 }, +}; + +/* char: 104 'h' */ + +static const CoordRec char104_stroke0[] = { + { 9.6, 100 }, + { 9.6, 0 }, +}; + +static const CoordRec char104_stroke1[] = { + { 9.6, 47.619 }, + { 23.8857, 61.9048 }, + { 33.4095, 66.6667 }, + { 47.6952, 66.6667 }, + { 57.219, 61.9048 }, + { 61.981, 47.619 }, + { 61.981, 0 }, +}; + +static const StrokeRec char104[] = { + { 2, char104_stroke0 }, + { 7, char104_stroke1 }, +}; + +/* char: 105 'i' */ + +static const CoordRec char105_stroke0[] = { + { 10.02, 100 }, + { 14.7819, 95.2381 }, + { 19.5438, 100 }, + { 14.7819, 104.762 }, + { 10.02, 100 }, +}; + +static const CoordRec char105_stroke1[] = { + { 14.7819, 66.6667 }, + { 14.7819, 0 }, +}; + +static const StrokeRec char105[] = { + { 5, char105_stroke0 }, + { 2, char105_stroke1 }, +}; + +/* char: 106 'j' */ + +static const CoordRec char106_stroke0[] = { + { 17.3876, 100 }, + { 22.1495, 95.2381 }, + { 26.9114, 100 }, + { 22.1495, 104.762 }, + { 17.3876, 100 }, +}; + +static const CoordRec char106_stroke1[] = { + { 22.1495, 66.6667 }, + { 22.1495, -14.2857 }, + { 17.3876, -28.5714 }, + { 7.8638, -33.3333 }, + { -1.66, -33.3333 }, +}; + +static const StrokeRec char106[] = { + { 5, char106_stroke0 }, + { 5, char106_stroke1 }, +}; + +/* char: 107 'k' */ + +static const CoordRec char107_stroke0[] = { + { 9.6, 100 }, + { 9.6, 0 }, +}; + +static const CoordRec char107_stroke1[] = { + { 57.219, 66.6667 }, + { 9.6, 19.0476 }, +}; + +static const CoordRec char107_stroke2[] = { + { 28.6476, 38.0952 }, + { 61.981, 0 }, +}; + +static const StrokeRec char107[] = { + { 2, char107_stroke0 }, + { 2, char107_stroke1 }, + { 2, char107_stroke2 }, +}; + +/* char: 108 'l' */ + +static const CoordRec char108_stroke0[] = { + { 10.02, 100 }, + { 10.02, 0 }, +}; + +static const StrokeRec char108[] = { + { 2, char108_stroke0 }, +}; + +/* char: 109 'm' */ + +static const CoordRec char109_stroke0[] = { + { 9.6, 66.6667 }, + { 9.6, 0 }, +}; + +static const CoordRec char109_stroke1[] = { + { 9.6, 47.619 }, + { 23.8857, 61.9048 }, + { 33.4095, 66.6667 }, + { 47.6952, 66.6667 }, + { 57.219, 61.9048 }, + { 61.981, 47.619 }, + { 61.981, 0 }, +}; + +static const CoordRec char109_stroke2[] = { + { 61.981, 47.619 }, + { 76.2667, 61.9048 }, + { 85.7905, 66.6667 }, + { 100.076, 66.6667 }, + { 109.6, 61.9048 }, + { 114.362, 47.619 }, + { 114.362, 0 }, +}; + +static const StrokeRec char109[] = { + { 2, char109_stroke0 }, + { 7, char109_stroke1 }, + { 7, char109_stroke2 }, +}; + +/* char: 110 'n' */ + +static const CoordRec char110_stroke0[] = { + { 9.18, 66.6667 }, + { 9.18, 0 }, +}; + +static const CoordRec char110_stroke1[] = { + { 9.18, 47.619 }, + { 23.4657, 61.9048 }, + { 32.9895, 66.6667 }, + { 47.2752, 66.6667 }, + { 56.799, 61.9048 }, + { 61.561, 47.619 }, + { 61.561, 0 }, +}; + +static const StrokeRec char110[] = { + { 2, char110_stroke0 }, + { 7, char110_stroke1 }, +}; + +/* char: 111 'o' */ + +static const CoordRec char111_stroke0[] = { + { 28.7895, 66.6667 }, + { 19.2657, 61.9048 }, + { 9.7419, 52.381 }, + { 4.98, 38.0952 }, + { 4.98, 28.5714 }, + { 9.7419, 14.2857 }, + { 19.2657, 4.7619 }, + { 28.7895, 0 }, + { 43.0752, 0 }, + { 52.599, 4.7619 }, + { 62.1229, 14.2857 }, + { 66.8848, 28.5714 }, + { 66.8848, 38.0952 }, + { 62.1229, 52.381 }, + { 52.599, 61.9048 }, + { 43.0752, 66.6667 }, + { 28.7895, 66.6667 }, +}; + +static const StrokeRec char111[] = { + { 17, char111_stroke0 }, +}; + +/* char: 112 'p' */ + +static const CoordRec char112_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, -33.3333 }, +}; + +static const CoordRec char112_stroke1[] = { + { 9.46, 52.381 }, + { 18.9838, 61.9048 }, + { 28.5076, 66.6667 }, + { 42.7933, 66.6667 }, + { 52.3171, 61.9048 }, + { 61.841, 52.381 }, + { 66.6029, 38.0952 }, + { 66.6029, 28.5714 }, + { 61.841, 14.2857 }, + { 52.3171, 4.7619 }, + { 42.7933, 0 }, + { 28.5076, 0 }, + { 18.9838, 4.7619 }, + { 9.46, 14.2857 }, +}; + +static const StrokeRec char112[] = { + { 2, char112_stroke0 }, + { 14, char112_stroke1 }, +}; + +/* char: 113 'q' */ + +static const CoordRec char113_stroke0[] = { + { 61.9829, 66.6667 }, + { 61.9829, -33.3333 }, +}; + +static const CoordRec char113_stroke1[] = { + { 61.9829, 52.381 }, + { 52.459, 61.9048 }, + { 42.9352, 66.6667 }, + { 28.6495, 66.6667 }, + { 19.1257, 61.9048 }, + { 9.6019, 52.381 }, + { 4.84, 38.0952 }, + { 4.84, 28.5714 }, + { 9.6019, 14.2857 }, + { 19.1257, 4.7619 }, + { 28.6495, 0 }, + { 42.9352, 0 }, + { 52.459, 4.7619 }, + { 61.9829, 14.2857 }, +}; + +static const StrokeRec char113[] = { + { 2, char113_stroke0 }, + { 14, char113_stroke1 }, +}; + +/* char: 114 'r' */ + +static const CoordRec char114_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, 0 }, +}; + +static const CoordRec char114_stroke1[] = { + { 9.46, 38.0952 }, + { 14.2219, 52.381 }, + { 23.7457, 61.9048 }, + { 33.2695, 66.6667 }, + { 47.5552, 66.6667 }, +}; + +static const StrokeRec char114[] = { + { 2, char114_stroke0 }, + { 5, char114_stroke1 }, +}; + +/* char: 115 's' */ + +static const CoordRec char115_stroke0[] = { + { 57.081, 52.381 }, + { 52.319, 61.9048 }, + { 38.0333, 66.6667 }, + { 23.7476, 66.6667 }, + { 9.4619, 61.9048 }, + { 4.7, 52.381 }, + { 9.4619, 42.8571 }, + { 18.9857, 38.0952 }, + { 42.7952, 33.3333 }, + { 52.319, 28.5714 }, + { 57.081, 19.0476 }, + { 57.081, 14.2857 }, + { 52.319, 4.7619 }, + { 38.0333, 0 }, + { 23.7476, 0 }, + { 9.4619, 4.7619 }, + { 4.7, 14.2857 }, +}; + +static const StrokeRec char115[] = { + { 17, char115_stroke0 }, +}; + +/* char: 116 't' */ + +static const CoordRec char116_stroke0[] = { + { 14.8257, 100 }, + { 14.8257, 19.0476 }, + { 19.5876, 4.7619 }, + { 29.1114, 0 }, + { 38.6352, 0 }, +}; + +static const CoordRec char116_stroke1[] = { + { 0.54, 66.6667 }, + { 33.8733, 66.6667 }, +}; + +static const StrokeRec char116[] = { + { 5, char116_stroke0 }, + { 2, char116_stroke1 }, +}; + +/* char: 117 'u' */ + +static const CoordRec char117_stroke0[] = { + { 9.46, 66.6667 }, + { 9.46, 19.0476 }, + { 14.2219, 4.7619 }, + { 23.7457, 0 }, + { 38.0314, 0 }, + { 47.5552, 4.7619 }, + { 61.841, 19.0476 }, +}; + +static const CoordRec char117_stroke1[] = { + { 61.841, 66.6667 }, + { 61.841, 0 }, +}; + +static const StrokeRec char117[] = { + { 7, char117_stroke0 }, + { 2, char117_stroke1 }, +}; + +/* char: 118 'v' */ + +static const CoordRec char118_stroke0[] = { + { 1.8, 66.6667 }, + { 30.3714, 0 }, +}; + +static const CoordRec char118_stroke1[] = { + { 58.9429, 66.6667 }, + { 30.3714, 0 }, +}; + +static const StrokeRec char118[] = { + { 2, char118_stroke0 }, + { 2, char118_stroke1 }, +}; + +/* char: 119 'w' */ + +static const CoordRec char119_stroke0[] = { + { 2.5, 66.6667 }, + { 21.5476, 0 }, +}; + +static const CoordRec char119_stroke1[] = { + { 40.5952, 66.6667 }, + { 21.5476, 0 }, +}; + +static const CoordRec char119_stroke2[] = { + { 40.5952, 66.6667 }, + { 59.6429, 0 }, +}; + +static const CoordRec char119_stroke3[] = { + { 78.6905, 66.6667 }, + { 59.6429, 0 }, +}; + +static const StrokeRec char119[] = { + { 2, char119_stroke0 }, + { 2, char119_stroke1 }, + { 2, char119_stroke2 }, + { 2, char119_stroke3 }, +}; + +/* char: 120 'x' */ + +static const CoordRec char120_stroke0[] = { + { 1.66, 66.6667 }, + { 54.041, 0 }, +}; + +static const CoordRec char120_stroke1[] = { + { 54.041, 66.6667 }, + { 1.66, 0 }, +}; + +static const StrokeRec char120[] = { + { 2, char120_stroke0 }, + { 2, char120_stroke1 }, +}; + +/* char: 121 'y' */ + +static const CoordRec char121_stroke0[] = { + { 6.5619, 66.6667 }, + { 35.1333, 0 }, +}; + +static const CoordRec char121_stroke1[] = { + { 63.7048, 66.6667 }, + { 35.1333, 0 }, + { 25.6095, -19.0476 }, + { 16.0857, -28.5714 }, + { 6.5619, -33.3333 }, + { 1.8, -33.3333 }, +}; + +static const StrokeRec char121[] = { + { 2, char121_stroke0 }, + { 6, char121_stroke1 }, +}; + +/* char: 122 'z' */ + +static const CoordRec char122_stroke0[] = { + { 56.821, 66.6667 }, + { 4.44, 0 }, +}; + +static const CoordRec char122_stroke1[] = { + { 4.44, 66.6667 }, + { 56.821, 66.6667 }, +}; + +static const CoordRec char122_stroke2[] = { + { 4.44, 0 }, + { 56.821, 0 }, +}; + +static const StrokeRec char122[] = { + { 2, char122_stroke0 }, + { 2, char122_stroke1 }, + { 2, char122_stroke2 }, +}; + +/* char: 123 '{' */ + +static const CoordRec char123_stroke0[] = { + { 31.1895, 119.048 }, + { 21.6657, 114.286 }, + { 16.9038, 109.524 }, + { 12.1419, 100 }, + { 12.1419, 90.4762 }, + { 16.9038, 80.9524 }, + { 21.6657, 76.1905 }, + { 26.4276, 66.6667 }, + { 26.4276, 57.1429 }, + { 16.9038, 47.619 }, +}; + +static const CoordRec char123_stroke1[] = { + { 21.6657, 114.286 }, + { 16.9038, 104.762 }, + { 16.9038, 95.2381 }, + { 21.6657, 85.7143 }, + { 26.4276, 80.9524 }, + { 31.1895, 71.4286 }, + { 31.1895, 61.9048 }, + { 26.4276, 52.381 }, + { 7.38, 42.8571 }, + { 26.4276, 33.3333 }, + { 31.1895, 23.8095 }, + { 31.1895, 14.2857 }, + { 26.4276, 4.7619 }, + { 21.6657, 0 }, + { 16.9038, -9.5238 }, + { 16.9038, -19.0476 }, + { 21.6657, -28.5714 }, +}; + +static const CoordRec char123_stroke2[] = { + { 16.9038, 38.0952 }, + { 26.4276, 28.5714 }, + { 26.4276, 19.0476 }, + { 21.6657, 9.5238 }, + { 16.9038, 4.7619 }, + { 12.1419, -4.7619 }, + { 12.1419, -14.2857 }, + { 16.9038, -23.8095 }, + { 21.6657, -28.5714 }, + { 31.1895, -33.3333 }, +}; + +static const StrokeRec char123[] = { + { 10, char123_stroke0 }, + { 17, char123_stroke1 }, + { 10, char123_stroke2 }, +}; + +/* char: 124 '|' */ + +static const CoordRec char124_stroke0[] = { + { 11.54, 119.048 }, + { 11.54, -33.3333 }, +}; + +static const StrokeRec char124[] = { + { 2, char124_stroke0 }, +}; + +/* char: 125 '}' */ + +static const CoordRec char125_stroke0[] = { + { 9.18, 119.048 }, + { 18.7038, 114.286 }, + { 23.4657, 109.524 }, + { 28.2276, 100 }, + { 28.2276, 90.4762 }, + { 23.4657, 80.9524 }, + { 18.7038, 76.1905 }, + { 13.9419, 66.6667 }, + { 13.9419, 57.1429 }, + { 23.4657, 47.619 }, +}; + +static const CoordRec char125_stroke1[] = { + { 18.7038, 114.286 }, + { 23.4657, 104.762 }, + { 23.4657, 95.2381 }, + { 18.7038, 85.7143 }, + { 13.9419, 80.9524 }, + { 9.18, 71.4286 }, + { 9.18, 61.9048 }, + { 13.9419, 52.381 }, + { 32.9895, 42.8571 }, + { 13.9419, 33.3333 }, + { 9.18, 23.8095 }, + { 9.18, 14.2857 }, + { 13.9419, 4.7619 }, + { 18.7038, 0 }, + { 23.4657, -9.5238 }, + { 23.4657, -19.0476 }, + { 18.7038, -28.5714 }, +}; + +static const CoordRec char125_stroke2[] = { + { 23.4657, 38.0952 }, + { 13.9419, 28.5714 }, + { 13.9419, 19.0476 }, + { 18.7038, 9.5238 }, + { 23.4657, 4.7619 }, + { 28.2276, -4.7619 }, + { 28.2276, -14.2857 }, + { 23.4657, -23.8095 }, + { 18.7038, -28.5714 }, + { 9.18, -33.3333 }, +}; + +static const StrokeRec char125[] = { + { 10, char125_stroke0 }, + { 17, char125_stroke1 }, + { 10, char125_stroke2 }, +}; + +/* char: 126 '~' */ + +static const CoordRec char126_stroke0[] = { + { 2.92, 28.5714 }, + { 2.92, 38.0952 }, + { 7.6819, 52.381 }, + { 17.2057, 57.1429 }, + { 26.7295, 57.1429 }, + { 36.2533, 52.381 }, + { 55.301, 38.0952 }, + { 64.8248, 33.3333 }, + { 74.3486, 33.3333 }, + { 83.8724, 38.0952 }, + { 88.6343, 47.619 }, +}; + +static const CoordRec char126_stroke1[] = { + { 2.92, 38.0952 }, + { 7.6819, 47.619 }, + { 17.2057, 52.381 }, + { 26.7295, 52.381 }, + { 36.2533, 47.619 }, + { 55.301, 33.3333 }, + { 64.8248, 28.5714 }, + { 74.3486, 28.5714 }, + { 83.8724, 33.3333 }, + { 88.6343, 47.619 }, + { 88.6343, 57.1429 }, +}; + +static const StrokeRec char126[] = { + { 11, char126_stroke0 }, + { 11, char126_stroke1 }, +}; + +/* char: 127 */ + +static const CoordRec char127_stroke0[] = { + { 52.381, 100 }, + { 14.2857, -33.3333 }, +}; + +static const CoordRec char127_stroke1[] = { + { 28.5714, 66.6667 }, + { 14.2857, 61.9048 }, + { 4.7619, 52.381 }, + { 0, 38.0952 }, + { 0, 23.8095 }, + { 4.7619, 14.2857 }, + { 14.2857, 4.7619 }, + { 28.5714, 0 }, + { 38.0952, 0 }, + { 52.381, 4.7619 }, + { 61.9048, 14.2857 }, + { 66.6667, 28.5714 }, + { 66.6667, 42.8571 }, + { 61.9048, 52.381 }, + { 52.381, 61.9048 }, + { 38.0952, 66.6667 }, + { 28.5714, 66.6667 }, +}; + +static const StrokeRec char127[] = { + { 2, char127_stroke0 }, + { 17, char127_stroke1 }, +}; + +static const StrokeCharRec chars[] = { + { 0, /* char0 */ 0, 0, 0 }, + { 0, /* char1 */ 0, 0, 0 }, + { 0, /* char2 */ 0, 0, 0 }, + { 0, /* char3 */ 0, 0, 0 }, + { 0, /* char4 */ 0, 0, 0 }, + { 0, /* char5 */ 0, 0, 0 }, + { 0, /* char6 */ 0, 0, 0 }, + { 0, /* char7 */ 0, 0, 0 }, + { 0, /* char8 */ 0, 0, 0 }, + { 0, /* char9 */ 0, 0, 0 }, + { 0, /* char10 */ 0, 0, 0 }, + { 0, /* char11 */ 0, 0, 0 }, + { 0, /* char12 */ 0, 0, 0 }, + { 0, /* char13 */ 0, 0, 0 }, + { 0, /* char14 */ 0, 0, 0 }, + { 0, /* char15 */ 0, 0, 0 }, + { 0, /* char16 */ 0, 0, 0 }, + { 0, /* char17 */ 0, 0, 0 }, + { 0, /* char18 */ 0, 0, 0 }, + { 0, /* char19 */ 0, 0, 0 }, + { 0, /* char20 */ 0, 0, 0 }, + { 0, /* char21 */ 0, 0, 0 }, + { 0, /* char22 */ 0, 0, 0 }, + { 0, /* char23 */ 0, 0, 0 }, + { 0, /* char24 */ 0, 0, 0 }, + { 0, /* char25 */ 0, 0, 0 }, + { 0, /* char26 */ 0, 0, 0 }, + { 0, /* char27 */ 0, 0, 0 }, + { 0, /* char28 */ 0, 0, 0 }, + { 0, /* char29 */ 0, 0, 0 }, + { 0, /* char30 */ 0, 0, 0 }, + { 0, /* char31 */ 0, 0, 0 }, + { 0, /* char32 */ 0, 52.381, 104.762 }, + { 2, char33, 13.3819, 26.6238 }, + { 2, char34, 23.0676, 51.4352 }, + { 4, char35, 36.5333, 79.4886 }, + { 3, char36, 38.1533, 76.2067 }, + { 3, char37, 49.2171, 96.5743 }, + { 1, char38, 53.599, 101.758 }, + { 1, char39, 4.44, 13.62 }, + { 1, char40, 21.8657, 47.1733 }, + { 1, char41, 24.3276, 47.5333 }, + { 3, char42, 30.7695, 59.439 }, + { 2, char43, 48.8371, 97.2543 }, + { 1, char44, 13.5219, 26.0638 }, + { 1, char45, 50.2371, 100.754 }, + { 1, char46, 13.1019, 26.4838 }, + { 1, char47, 40.5733, 82.1067 }, + { 1, char48, 38.3133, 77.0667 }, + { 1, char49, 30.8676, 66.5295 }, + { 1, char50, 38.7533, 77.6467 }, + { 1, char51, 38.3333, 77.0467 }, + { 2, char52, 37.2133, 80.1686 }, + { 1, char53, 38.1933, 77.6867 }, + { 1, char54, 34.1514, 73.8048 }, + { 2, char55, 38.8933, 77.2267 }, + { 1, char56, 38.9333, 77.6667 }, + { 1, char57, 39.9333, 74.0648 }, + { 2, char58, 14.0819, 26.2238 }, + { 2, char59, 12.9619, 26.3038 }, + { 1, char60, 41.1552, 81.6105 }, + { 2, char61, 48.5571, 97.2543 }, + { 1, char62, 40.8752, 81.6105 }, + { 2, char63, 36.9914, 73.9029 }, + { 2, char64, 34.9314, 74.3648 }, + { 3, char65, 40.5952, 80.4905 }, + { 3, char66, 44.7533, 83.6267 }, + { 1, char67, 39.9933, 84.4886 }, + { 2, char68, 45.2933, 85.2867 }, + { 4, char69, 39.9914, 78.1848 }, + { 3, char70, 39.9914, 78.7448 }, + { 2, char71, 40.3933, 89.7686 }, + { 3, char72, 44.7533, 89.0867 }, + { 1, char73, 10.86, 21.3 }, + { 1, char74, 31.0714, 59.999 }, + { 3, char75, 44.6133, 79.3267 }, + { 2, char76, 40.2514, 71.3229 }, + { 4, char77, 48.9552, 97.2105 }, + { 3, char78, 44.4733, 88.8067 }, + { 1, char79, 44.3352, 88.8305 }, + { 2, char80, 45.4333, 85.6667 }, + { 2, char81, 43.3952, 88.0905 }, + { 3, char82, 45.0133, 82.3667 }, + { 1, char83, 41.3333, 80.8267 }, + { 2, char84, 35.6933, 71.9467 }, + { 1, char85, 44.8733, 89.4867 }, + { 2, char86, 40.4552, 81.6105 }, + { 4, char87, 49.839, 100.518 }, + { 2, char88, 35.8333, 72.3667 }, + { 2, char89, 39.6152, 79.6505 }, + { 3, char90, 35.8333, 73.7467 }, + { 4, char91, 22.0657, 46.1133 }, + { 1, char92, 39.1733, 78.2067 }, + { 4, char93, 23.4876, 46.3933 }, + { 2, char94, 44.0752, 90.2305 }, + { 1, char95, 51.281, 104.062 }, + { 2, char96, 42.5457, 83.5714 }, + { 2, char97, 35.2514, 66.6029 }, + { 2, char98, 37.3314, 70.4629 }, + { 1, char99, 34.0914, 68.9229 }, + { 2, char100, 33.2114, 70.2629 }, + { 1, char101, 34.2914, 68.5229 }, + { 2, char102, 14.9657, 38.6552 }, + { 2, char103, 33.9314, 70.9829 }, + { 2, char104, 33.4095, 71.021 }, + { 2, char105, 14.7819, 28.8638 }, + { 2, char106, 17.3876, 36.2314 }, + { 3, char107, 33.4095, 62.521 }, + { 1, char108, 10.02, 19.34 }, + { 3, char109, 61.981, 123.962 }, + { 2, char110, 32.9895, 70.881 }, + { 1, char111, 33.5514, 71.7448 }, + { 2, char112, 38.0314, 70.8029 }, + { 2, char113, 33.4114, 70.7429 }, + { 2, char114, 23.7457, 49.4952 }, + { 1, char115, 28.5095, 62.321 }, + { 2, char116, 14.8257, 39.3152 }, + { 2, char117, 33.2695, 71.161 }, + { 2, char118, 30.3714, 60.6029 }, + { 4, char119, 40.5952, 80.4905 }, + { 2, char120, 25.4695, 56.401 }, + { 2, char121, 35.1333, 66.0648 }, + { 3, char122, 28.2495, 61.821 }, + { 3, char123, 21.6657, 41.6295 }, + { 1, char124, 11.54, 23.78 }, + { 3, char125, 18.7038, 41.4695 }, + { 2, char126, 45.7771, 91.2743 }, + { 2, char127, 33.3333, 66.6667 }, +}; + +StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 }; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_shapes.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_shapes.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_shapes.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_shapes.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,595 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include +#include "glutint.h" + +/* Some files do not define M_PI... */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +static GLUquadricObj *quadObj; + +#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } + +static void +initQuadObj(void) +{ + quadObj = gluNewQuadric(); + if (!quadObj) + __glutFatalError("out of memory."); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void GLUTAPIENTRY +glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluSphere(quadObj, radius, slices, stacks); +} + +void GLUTAPIENTRY +glutWireCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_LINE); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +void GLUTAPIENTRY +glutSolidCone(GLdouble base, GLdouble height, + GLint slices, GLint stacks) +{ + QUAD_OBJ_INIT(); + gluQuadricDrawStyle(quadObj, GLU_FILL); + gluQuadricNormals(quadObj, GLU_SMOOTH); + /* If we ever changed/used the texture or orientation state + of quadObj, we'd need to change it to the defaults here + with gluQuadricTexture and/or gluQuadricOrientation. */ + gluCylinder(quadObj, base, 0.0, height, slices, stacks); +} + +/* ENDCENTRY */ + +static void +drawBox(GLfloat size, GLenum type) +{ + static GLfloat n[6][3] = + { + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {1.0, 0.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} + }; + static GLint faces[6][4] = + { + {0, 1, 2, 3}, + {3, 2, 6, 7}, + {7, 6, 5, 4}, + {4, 5, 1, 0}, + {5, 6, 2, 1}, + {7, 4, 0, 3} + }; + GLfloat v[8][3]; + GLint i; + + v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; + v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; + v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; + v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; + v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; + v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; + + for (i = 5; i >= 0; i--) { + glBegin(type); + glNormal3fv(&n[i][0]); + glVertex3fv(&v[faces[i][0]][0]); + glVertex3fv(&v[faces[i][1]][0]); + glVertex3fv(&v[faces[i][2]][0]); + glVertex3fv(&v[faces[i][3]][0]); + glEnd(); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireCube(GLdouble size) +{ + drawBox(size, GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidCube(GLdouble size) +{ + drawBox(size, GL_QUADS); +} + +/* ENDCENTRY */ + +static void +doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) +{ + int i, j; + GLfloat theta, phi, theta1; + GLfloat cosTheta, sinTheta; + GLfloat cosTheta1, sinTheta1; + GLfloat ringDelta, sideDelta; + + ringDelta = 2.0 * M_PI / rings; + sideDelta = 2.0 * M_PI / nsides; + + theta = 0.0; + cosTheta = 1.0; + sinTheta = 0.0; + for (i = rings - 1; i >= 0; i--) { + theta1 = theta + ringDelta; + cosTheta1 = cos(theta1); + sinTheta1 = sin(theta1); + glBegin(GL_QUAD_STRIP); + phi = 0.0; + for (j = nsides; j >= 0; j--) { + GLfloat cosPhi, sinPhi, dist; + + phi += sideDelta; + cosPhi = cos(phi); + sinPhi = sin(phi); + dist = R + r * cosPhi; + + glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); + glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); + glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); + glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); + } + glEnd(); + theta = theta1; + cosTheta = cosTheta1; + sinTheta = sinTheta1; + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + doughnut(innerRadius, outerRadius, nsides, rings); + glPopAttrib(); +} + +void GLUTAPIENTRY +glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, + GLint nsides, GLint rings) +{ + doughnut(innerRadius, outerRadius, nsides, rings); +} + +/* ENDCENTRY */ + +static GLfloat dodec[20][3]; + +static void +initDodecahedron(void) +{ + GLfloat alpha, beta; + + alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); + beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - + 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); + /* *INDENT-OFF* */ + dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; + dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; + dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; + dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; + dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; + dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; + dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; + dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; + dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; + dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; + dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; + dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; + dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; + dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; + dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; + dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; + dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; + dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; + dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; + dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; + /* *INDENT-ON* */ + +} + +#define DIFF3(_a,_b,_c) { \ + (_c)[0] = (_a)[0] - (_b)[0]; \ + (_c)[1] = (_a)[1] - (_b)[1]; \ + (_c)[2] = (_a)[2] - (_b)[2]; \ +} + +static void +crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) +{ + GLfloat p[3]; /* in case prod == v1 or v2 */ + + p[0] = v1[1] * v2[2] - v2[1] * v1[2]; + p[1] = v1[2] * v2[0] - v2[2] * v1[0]; + p[2] = v1[0] * v2[1] - v2[0] * v1[1]; + prod[0] = p[0]; + prod[1] = p[1]; + prod[2] = p[2]; +} + +static void +normalize(GLfloat v[3]) +{ + GLfloat d; + + d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + if (d == 0.0) { + __glutWarning("normalize: zero length vector"); + v[0] = d = 1.0; + } + d = 1 / d; + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +static void +pentagon(int a, int b, int c, int d, int e, GLenum shadeType) +{ + GLfloat n0[3], d1[3], d2[3]; + + DIFF3(dodec[a], dodec[b], d1); + DIFF3(dodec[b], dodec[c], d2); + crossprod(d1, d2, n0); + normalize(n0); + + glBegin(shadeType); + glNormal3fv(n0); + glVertex3fv(&dodec[a][0]); + glVertex3fv(&dodec[b][0]); + glVertex3fv(&dodec[c][0]); + glVertex3fv(&dodec[d][0]); + glVertex3fv(&dodec[e][0]); + glEnd(); +} + +static void +dodecahedron(GLenum type) +{ + static int inited = 0; + + if (inited == 0) { + inited = 1; + initDodecahedron(); + } + pentagon(0, 1, 9, 16, 5, type); + pentagon(1, 0, 3, 18, 7, type); + pentagon(1, 7, 11, 10, 9, type); + pentagon(11, 7, 18, 19, 6, type); + pentagon(8, 17, 16, 9, 10, type); + pentagon(2, 14, 15, 6, 19, type); + pentagon(2, 13, 12, 4, 14, type); + pentagon(2, 19, 18, 3, 13, type); + pentagon(3, 0, 5, 12, 13, type); + pentagon(6, 15, 8, 10, 11, type); + pentagon(4, 17, 8, 15, 14, type); + pentagon(4, 12, 5, 16, 17, type); +} + +/* CENTRY */ +void GLUTAPIENTRY glutWireDodecahedron(void) +{ + dodecahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidDodecahedron(void) +{ + dodecahedron(GL_TRIANGLE_FAN); +} + +/* ENDCENTRY */ + +static void +recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, + GLenum shadeType) +{ + GLfloat q0[3], q1[3]; + + DIFF3(n1, n2, q0); + DIFF3(n2, n3, q1); + crossprod(q0, q1, q1); + normalize(q1); + + glBegin(shadeType); + glNormal3fv(q1); + glVertex3fv(n1); + glVertex3fv(n2); + glVertex3fv(n3); + glEnd(); +} + +static void +subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, + GLenum shadeType) +{ + int depth; + GLfloat w0[3], w1[3], w2[3]; + GLfloat l; + int i, j, k, n; + + depth = 1; + for (i = 0; i < depth; i++) { + for (j = 0; i + j < depth; j++) { + k = depth - i - j; + for (n = 0; n < 3; n++) { + w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; + w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) + / depth; + w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) + / depth; + } + l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); + w0[0] /= l; + w0[1] /= l; + w0[2] /= l; + l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); + w1[0] /= l; + w1[1] /= l; + w1[2] /= l; + l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); + w2[0] /= l; + w2[1] /= l; + w2[2] /= l; + recorditem(w1, w0, w2, shadeType); + } + } +} + +static void +drawtriangle(int i, GLfloat data[][3], int ndx[][3], + GLenum shadeType) +{ + GLfloat *x0, *x1, *x2; + + x0 = data[ndx[i][0]]; + x1 = data[ndx[i][1]]; + x2 = data[ndx[i][2]]; + subdivide(x0, x1, x2, shadeType); +} + +/* octahedron data: The octahedron produced is centered at the + origin and has radius 1.0 */ +static GLfloat odata[6][3] = +{ + {1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {0.0, -1.0, 0.0}, + {0.0, 0.0, 1.0}, + {0.0, 0.0, -1.0} +}; + +static int ondex[8][3] = +{ + {0, 4, 2}, + {1, 2, 4}, + {0, 3, 4}, + {1, 4, 3}, + {0, 2, 5}, + {1, 5, 2}, + {0, 5, 3}, + {1, 3, 5} +}; + +static void +octahedron(GLenum shadeType) +{ + int i; + + for (i = 7; i >= 0; i--) { + drawtriangle(i, odata, ondex, shadeType); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireOctahedron(void) +{ + octahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidOctahedron(void) +{ + octahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* icosahedron data: These numbers are rigged to make an + icosahedron of radius 1.0 */ + +#define X .525731112119133606 +#define Z .850650808352039932 + +static GLfloat idata[12][3] = +{ + {-X, 0, Z}, + {X, 0, Z}, + {-X, 0, -Z}, + {X, 0, -Z}, + {0, Z, X}, + {0, Z, -X}, + {0, -Z, X}, + {0, -Z, -X}, + {Z, X, 0}, + {-Z, X, 0}, + {Z, -X, 0}, + {-Z, -X, 0} +}; + +static int index[20][3] = +{ + {0, 4, 1}, + {0, 9, 4}, + {9, 5, 4}, + {4, 5, 8}, + {4, 8, 1}, + {8, 10, 1}, + {8, 3, 10}, + {5, 3, 8}, + {5, 2, 3}, + {2, 7, 3}, + {7, 10, 3}, + {7, 6, 10}, + {7, 11, 6}, + {11, 0, 6}, + {0, 1, 6}, + {6, 1, 10}, + {9, 0, 11}, + {9, 11, 2}, + {9, 2, 5}, + {7, 2, 11}, +}; + +static void +icosahedron(GLenum shadeType) +{ + int i; + + for (i = 19; i >= 0; i--) { + drawtriangle(i, idata, index, shadeType); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireIcosahedron(void) +{ + icosahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidIcosahedron(void) +{ + icosahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ + +/* tetrahedron data: */ + +#define T 1.73205080756887729 + +static GLfloat tdata[4][3] = +{ + {T, T, T}, + {T, -T, -T}, + {-T, T, -T}, + {-T, -T, T} +}; + +static int tndex[4][3] = +{ + {0, 1, 3}, + {2, 1, 0}, + {3, 2, 0}, + {1, 2, 3} +}; + +static void +tetrahedron(GLenum shadeType) +{ + int i; + + for (i = 3; i >= 0; i--) + drawtriangle(i, tdata, tndex, shadeType); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutWireTetrahedron(void) +{ + tetrahedron(GL_LINE_LOOP); +} + +void GLUTAPIENTRY +glutSolidTetrahedron(void) +{ + tetrahedron(GL_TRIANGLES); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_stroke.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_stroke.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_stroke.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_stroke.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include "glutint.h" +#include "glutstroke.h" + +void GLUTAPIENTRY +glutStrokeCharacter(GLUTstrokeFont font, int c) +{ + const StrokeCharRec *ch; + const StrokeRec *stroke; + const CoordRec *coord; + StrokeFontPtr fontinfo; + int i, j; + + +#if defined(_WIN32) + fontinfo = (StrokeFontPtr) __glutFont(font); +#else + fontinfo = (StrokeFontPtr) font; +#endif + + if (c < 0 || c >= fontinfo->num_chars) + return; + ch = &(fontinfo->ch[c]); + if (ch) { + for (i = ch->num_strokes, stroke = ch->stroke; + i > 0; i--, stroke++) { + glBegin(GL_LINE_STRIP); + for (j = stroke->num_coords, coord = stroke->coord; + j > 0; j--, coord++) { + glVertex2f(coord->x, coord->y); + } + glEnd(); + } + glTranslatef(ch->right, 0.0, 0.0); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glutstroke.h xpsb-glx-0.19/mesa/src/glut/os2/glutstroke.h --- xpsb-glx-0.19/mesa/src/glut/os2/glutstroke.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glutstroke.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,42 @@ +#ifndef __glutstroke_h__ +#define __glutstroke_h__ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#if defined(_WIN32) +#pragma warning (disable:4244) /* disable bogus conversion warnings */ +#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +#endif + +typedef struct { + float x; + float y; +} CoordRec, *CoordPtr; + +typedef struct { + int num_coords; + const CoordRec *coord; +} StrokeRec, *StrokePtr; + +typedef struct { + int num_strokes; + const StrokeRec *stroke; + float center; + float right; +} StrokeCharRec, *StrokeCharPtr; + +typedef struct { + const char *name; + int num_chars; + const StrokeCharRec *ch; + float top; + float bottom; +} StrokeFontRec, *StrokeFontPtr; + +typedef void *GLUTstrokeFont; + +#endif /* __glutstroke_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_swap.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_swap.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_swap.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_swap.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,67 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include "glutint.h" + +GLint __glutFPS = 0; +GLint __glutSwapCount = 0; +GLint __glutSwapTime = 0; + +/* CENTRY */ +void GLUTAPIENTRY +glutSwapBuffers(void) +{ + GLUTwindow *window = __glutCurrentWindow; + + if (window->renderWin == window->win) { + if (__glutCurrentWindow->treatAsSingle) { + /* Pretend the double buffered window is single buffered, + so treat glutSwapBuffers as a no-op. */ + return; + } + } else { + if (__glutCurrentWindow->overlay->treatAsSingle) { + /* Pretend the double buffered overlay is single + buffered, so treat glutSwapBuffers as a no-op. */ + return; + } + } + + /* For the MESA_SWAP_HACK. */ + window->usedSwapBuffers = 1; + + SWAP_BUFFERS_LAYER(__glutCurrentWindow); + + /* I considered putting the window being swapped on the + GLUT_FINISH_WORK work list because you could call + glutSwapBuffers from an idle callback which doesn't call + __glutSetWindow which normally adds indirect rendering + windows to the GLUT_FINISH_WORK work list. Not being put + on the list could lead to the buffering up of multiple + redisplays and buffer swaps and hamper interactivity. I + consider this an application bug due to not using + glutPostRedisplay to trigger redraws. If + glutPostRedisplay were used, __glutSetWindow would be + called and a glFinish to throttle buffering would occur. */ + + if (__glutFPS) { + GLint t = glutGet(GLUT_ELAPSED_TIME); + __glutSwapCount++; + if (__glutSwapTime == 0) + __glutSwapTime = t; + else if (t - __glutSwapTime > __glutFPS) { + float time = 0.001 * (t - __glutSwapTime); + float fps = (float) __glutSwapCount / time; + fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", + __glutSwapCount, time, fps); + __glutSwapTime = t; + __glutSwapCount = 0; + } + } +} +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_teapot.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_teapot.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_teapot.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_teapot.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,210 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/** +(c) Copyright 1993, Silicon Graphics, Inc. + +ALL RIGHTS RESERVED + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that +both the copyright notice and this permission notice appear in +supporting documentation, and that the name of Silicon +Graphics, Inc. not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. + +THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU +"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO +EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE +ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, +INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, +SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR +NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY +OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR +PERFORMANCE OF THIS SOFTWARE. + +US Government Users Restricted Rights + +Use, duplication, or disclosure by the Government is subject to +restrictions set forth in FAR 52.227.19(c)(2) or subparagraph +(c)(1)(ii) of the Rights in Technical Data and Computer +Software clause at DFARS 252.227-7013 and/or in similar or +successor clauses in the FAR or the DOD or NASA FAR +Supplement. Unpublished-- rights reserved under the copyright +laws of the United States. Contractor/manufacturer is Silicon +Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA +94039-7311. + +OpenGL(TM) is a trademark of Silicon Graphics, Inc. +*/ + +#include "glutint.h" + +/* Rim, body, lid, and bottom data must be reflected in x and + y; handle and spout data across the y axis only. */ + +static int patchdata[][16] = +{ + /* rim */ + {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}, + /* body */ + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27}, + {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40}, + /* lid */ + {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, + 101, 0, 1, 2, 3,}, + {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117}, + /* bottom */ + {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, + 125, 120, 40, 39, 38, 37}, + /* handle */ + {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56}, + {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 28, 65, 66, 67}, + /* spout */ + {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83}, + {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95} +}; +/* *INDENT-OFF* */ + +static float cpdata[][3] = +{ + {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, + -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, + {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, + 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, + 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, + 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, + {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, + 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, + {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, + 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, + 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, + {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, + {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, + -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, + -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, + 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, + 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, + 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, + {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, + -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, + 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, + -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, + 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, + 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, + 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, + {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, + -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, + 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, + {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, + {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, + {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, + 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, + 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, + -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, + 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, + 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, + 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, + {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, + -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, + 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, + {0.84, -1.5, 0.075} +}; + +static float tex[2][2][2] = +{ + { {0, 0}, + {1, 0}}, + { {0, 1}, + {1, 1}} +}; + +/* *INDENT-ON* */ + +static void +teapot(GLint grid, GLdouble scale, GLenum type) +{ + float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; + long i, j, k, l; + + glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_MAP2_VERTEX_3); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glPushMatrix(); + glRotatef(270.0, 1.0, 0.0, 0.0); + glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); + glTranslatef(0.0, 0.0, -1.5); + for (i = 0; i < 10; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + for (l = 0; l < 3; l++) { + p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 1) + q[j][k][l] *= -1.0; + if (i < 6) { + r[j][k][l] = + cpdata[patchdata[i][j * 4 + (3 - k)]][l]; + if (l == 0) + r[j][k][l] *= -1.0; + s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; + if (l == 0) + s[j][k][l] *= -1.0; + if (l == 1) + s[j][k][l] *= -1.0; + } + } + } + } + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, + &tex[0][0][0]); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &p[0][0][0]); + glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &q[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + if (i < 6) { + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &r[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, + &s[0][0][0]); + glEvalMesh2(type, 0, grid, 0, grid); + } + } + glPopMatrix(); + glPopAttrib(); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSolidTeapot(GLdouble scale) +{ + teapot(7, scale, GL_FILL); +} + +void GLUTAPIENTRY +glutWireTeapot(GLdouble scale) +{ + teapot(10, scale, GL_LINE); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_tr24.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_tr24.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_tr24.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_tr24.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,2063 @@ + +/* GENERATED FILE -- DO NOT MODIFY */ + +#define glutBitmapTimesRoman24 XXX +#include "glutbitmap.h" +#undef glutBitmapTimesRoman24 + +/* char: 0xff */ + +static const GLubyte ch255data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch255 = {11,21,0,5,11,ch255data}; + +/* char: 0xfe */ + +static const GLubyte ch254data[] = { +0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, +0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0, +}; + +static const BitmapCharRec ch254 = {10,22,-1,5,12,ch254data}; + +/* char: 0xfd */ + +static const GLubyte ch253data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80, +}; + +static const BitmapCharRec ch253 = {11,22,0,5,11,ch253data}; + +/* char: 0xfc */ + +static const GLubyte ch252data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch252 = {11,16,-1,0,13,ch252data}; + +/* char: 0xfb */ + +static const GLubyte ch251data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch251 = {11,17,-1,0,13,ch251data}; + +/* char: 0xfa */ + +static const GLubyte ch250data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, +0x1,0x80, +}; + +static const BitmapCharRec ch250 = {11,17,-1,0,13,ch250data}; + +/* char: 0xf9 */ + +static const GLubyte ch249data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch249 = {11,17,-1,0,13,ch249data}; + +/* char: 0xf8 */ + +static const GLubyte ch248data[] = { +0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0, +0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0, +}; + +static const BitmapCharRec ch248 = {10,14,-1,1,12,ch248data}; + +/* char: 0xf7 */ + +static const GLubyte ch247data[] = { +0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0, +0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch247 = {12,10,-1,-2,14,ch247data}; + +/* char: 0xf6 */ + +static const GLubyte ch246data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch246 = {10,16,-1,0,12,ch246data}; + +/* char: 0xf5 */ + +static const GLubyte ch245data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, +}; + +static const BitmapCharRec ch245 = {10,16,-1,0,12,ch245data}; + +/* char: 0xf4 */ + +static const GLubyte ch244data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch244 = {10,17,-1,0,12,ch244data}; + +/* char: 0xf3 */ + +static const GLubyte ch243data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, +0x1,0x80, +}; + +static const BitmapCharRec ch243 = {10,17,-1,0,12,ch243data}; + +/* char: 0xf2 */ + +static const GLubyte ch242data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch242 = {10,17,-1,0,12,ch242data}; + +/* char: 0xf1 */ + +static const GLubyte ch241data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, +}; + +static const BitmapCharRec ch241 = {11,16,-1,0,13,ch241data}; + +/* char: 0xf0 */ + +static const GLubyte ch240data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80, +0xc0,0x0, +}; + +static const BitmapCharRec ch240 = {10,17,-1,0,12,ch240data}; + +/* char: 0xef */ + +static const GLubyte ch239data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc, +}; + +static const BitmapCharRec ch239 = {6,16,0,0,6,ch239data}; + +/* char: 0xee */ + +static const GLubyte ch238data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78, +0x30, +}; + +static const BitmapCharRec ch238 = {6,17,0,0,6,ch238data}; + +/* char: 0xed */ + +static const GLubyte ch237data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38, +0x18, +}; + +static const BitmapCharRec ch237 = {5,17,-1,0,6,ch237data}; + +/* char: 0xec */ + +static const GLubyte ch236data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0, +0xc0, +}; + +static const BitmapCharRec ch236 = {5,17,0,0,6,ch236data}; + +/* char: 0xeb */ + +static const GLubyte ch235data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, +}; + +static const BitmapCharRec ch235 = {9,16,-1,0,11,ch235data}; + +/* char: 0xea */ + +static const GLubyte ch234data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, +0xc,0x0, +}; + +static const BitmapCharRec ch234 = {9,17,-1,0,11,ch234data}; + +/* char: 0xe9 */ + +static const GLubyte ch233data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch233 = {9,17,-1,0,11,ch233data}; + +/* char: 0xe8 */ + +static const GLubyte ch232data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, +0x60,0x0, +}; + +static const BitmapCharRec ch232 = {9,17,-1,0,11,ch232data}; + +/* char: 0xe7 */ + +static const GLubyte ch231data[] = { +0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0, +0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80, +0x63,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch231 = {9,18,-1,6,11,ch231data}; + +/* char: 0xe6 */ + +static const GLubyte ch230data[] = { +0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc, +0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0, +}; + +static const BitmapCharRec ch230 = {14,12,-1,0,16,ch230data}; + +/* char: 0xe5 */ + +static const GLubyte ch229data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch229 = {9,17,-1,0,11,ch229data}; + +/* char: 0xe4 */ + +static const GLubyte ch228data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0, +}; + +static const BitmapCharRec ch228 = {9,16,-1,0,11,ch228data}; + +/* char: 0xe3 */ + +static const GLubyte ch227data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0, +}; + +static const BitmapCharRec ch227 = {9,16,-1,0,11,ch227data}; + +/* char: 0xe2 */ + +static const GLubyte ch226data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0, +0x18,0x0, +}; + +static const BitmapCharRec ch226 = {9,17,-1,0,11,ch226data}; + +/* char: 0xe1 */ + +static const GLubyte ch225data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch225 = {9,17,-1,0,11,ch225data}; + +/* char: 0xe0 */ + +static const GLubyte ch224data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, +0x60,0x0, +}; + +static const BitmapCharRec ch224 = {9,17,-1,0,11,ch224data}; + +/* char: 0xdf */ + +static const GLubyte ch223data[] = { +0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80, +0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch223 = {10,17,-1,0,12,ch223data}; + +/* char: 0xde */ + +static const GLubyte ch222data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18, +0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0, +0xfc,0x0, +}; + +static const BitmapCharRec ch222 = {13,17,-1,0,15,ch222data}; + +/* char: 0xdd */ + +static const GLubyte ch221data[] = { +0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, +0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, +0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch221 = {16,22,0,0,16,ch221data}; + +/* char: 0xdc */ + +static const GLubyte ch220data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30, +}; + +static const BitmapCharRec ch220 = {16,21,-1,0,18,ch220data}; + +/* char: 0xdb */ + +static const GLubyte ch219data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, +}; + +static const BitmapCharRec ch219 = {16,22,-1,0,18,ch219data}; + +/* char: 0xda */ + +static const GLubyte ch218data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch218 = {16,22,-1,0,18,ch218data}; + +/* char: 0xd9 */ + +static const GLubyte ch217data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch217 = {16,22,-1,0,18,ch217data}; + +/* char: 0xd8 */ + +static const GLubyte ch216data[] = { +0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3, +0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c, +0x1c,0x38,0x7,0xe4,0x0,0x4, +}; + +static const BitmapCharRec ch216 = {16,19,-1,1,18,ch216data}; + +/* char: 0xd7 */ + +static const GLubyte ch215data[] = { +0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0, +0x61,0x80,0xc0,0xc0,0x80,0x40, +}; + +static const BitmapCharRec ch215 = {10,11,-2,-1,14,ch215data}; + +/* char: 0xd6 */ + +static const GLubyte ch214data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60, +}; + +static const BitmapCharRec ch214 = {16,21,-1,0,18,ch214data}; + +/* char: 0xd5 */ + +static const GLubyte ch213data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, +}; + +static const BitmapCharRec ch213 = {16,21,-1,0,18,ch213data}; + +/* char: 0xd4 */ + +static const GLubyte ch212data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, +}; + +static const BitmapCharRec ch212 = {16,22,-1,0,18,ch212data}; + +/* char: 0xd3 */ + +static const GLubyte ch211data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, +}; + +static const BitmapCharRec ch211 = {16,22,-1,0,18,ch211data}; + +/* char: 0xd2 */ + +static const GLubyte ch210data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch210 = {16,22,-1,0,18,ch210data}; + +/* char: 0xd1 */ + +static const GLubyte ch209data[] = { +0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, +0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, +0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, +}; + +static const BitmapCharRec ch209 = {16,21,-1,0,18,ch209data}; + +/* char: 0xd0 */ + +static const GLubyte ch208data[] = { +0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3, +0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38, +0x7f,0xe0, +}; + +static const BitmapCharRec ch208 = {16,17,0,0,17,ch208data}; + +/* char: 0xcf */ + +static const GLubyte ch207data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x0,0xcc,0xcc, +}; + +static const BitmapCharRec ch207 = {6,21,-1,0,8,ch207data}; + +/* char: 0xce */ + +static const GLubyte ch206data[] = { +0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x7e,0x0,0x81,0x66,0x3c,0x18, +}; + +static const BitmapCharRec ch206 = {8,22,-1,0,8,ch206data}; + +/* char: 0xcd */ + +static const GLubyte ch205data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x40,0x30,0x1c,0xc, +}; + +static const BitmapCharRec ch205 = {6,22,-1,0,8,ch205data}; + +/* char: 0xcc */ + +static const GLubyte ch204data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc,0x0,0x8,0x30,0xe0,0xc0, +}; + +static const BitmapCharRec ch204 = {6,22,-1,0,8,ch204data}; + +/* char: 0xcb */ + +static const GLubyte ch203data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80, +}; + +static const BitmapCharRec ch203 = {13,21,-1,0,15,ch203data}; + +/* char: 0xca */ + +static const GLubyte ch202data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0, +}; + +static const BitmapCharRec ch202 = {13,22,-1,0,15,ch202data}; + +/* char: 0xc9 */ + +static const GLubyte ch201data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0, +}; + +static const BitmapCharRec ch201 = {13,22,-1,0,15,ch201data}; + +/* char: 0xc8 */ + +static const GLubyte ch200data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0, +}; + +static const BitmapCharRec ch200 = {13,22,-1,0,15,ch200data}; + +/* char: 0xc7 */ + +static const GLubyte ch199data[] = { +0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38, +0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4, +}; + +static const BitmapCharRec ch199 = {14,23,-1,6,16,ch199data}; + +/* char: 0xc6 */ + +static const GLubyte ch198data[] = { +0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8, +0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60, +0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60, +0x3,0xff,0xe0, +}; + +static const BitmapCharRec ch198 = {20,17,0,0,21,ch198data}; + +/* char: 0xc5 */ + +static const GLubyte ch197data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0, +}; + +static const BitmapCharRec ch197 = {17,21,0,0,17,ch197data}; + +/* char: 0xc4 */ + +static const GLubyte ch196data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0, +}; + +static const BitmapCharRec ch196 = {17,21,0,0,17,ch196data}; + +/* char: 0xc3 */ + +static const GLubyte ch195data[] = { +0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0, +}; + +static const BitmapCharRec ch195 = {17,21,0,0,17,ch195data}; + +/* char: 0xc2 */ + +static const GLubyte ch194data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1, +0x80,0x0, +}; + +static const BitmapCharRec ch194 = {17,22,0,0,17,ch194data}; + +/* char: 0xc1 */ + +static const GLubyte ch193data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0, +0x30,0x0, +}; + +static const BitmapCharRec ch193 = {17,22,0,0,17,ch193data}; + +/* char: 0xc0 */ + +static const GLubyte ch192data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3, +0x0,0x0, +}; + +static const BitmapCharRec ch192 = {17,22,0,0,17,ch192data}; + +/* char: 0xbf */ + +static const GLubyte ch191data[] = { +0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc, +0xc, +}; + +static const BitmapCharRec ch191 = {8,17,-1,5,11,ch191data}; + +/* char: 0xbe */ + +static const GLubyte ch190data[] = { +0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3, +0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60, +0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0, +0x38,0x4,0x0, +}; + +static const BitmapCharRec ch190 = {17,17,0,0,18,ch190data}; + +/* char: 0xbd */ + +static const GLubyte ch189data[] = { +0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46, +0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, +0x20,0x8, +}; + +static const BitmapCharRec ch189 = {15,17,-1,0,18,ch189data}; + +/* char: 0xbc */ + +static const GLubyte ch188data[] = { +0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c, +0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, +0x20,0x8, +}; + +static const BitmapCharRec ch188 = {16,17,-1,0,18,ch188data}; + +/* char: 0xbb */ + +static const GLubyte ch187data[] = { +0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0, +0xcc,0x0,0x88,0x0, +}; + +static const BitmapCharRec ch187 = {9,10,-2,-1,12,ch187data}; + +/* char: 0xba */ + +static const GLubyte ch186data[] = { +0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78, +}; + +static const BitmapCharRec ch186 = {6,9,-1,-8,8,ch186data}; + +/* char: 0xb9 */ + +static const GLubyte ch185data[] = { +0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, +}; + +static const BitmapCharRec ch185 = {5,10,-1,-7,7,ch185data}; + +/* char: 0xb8 */ + +static const GLubyte ch184data[] = { +0x78,0xcc,0xc,0x3c,0x30,0x10, +}; + +static const BitmapCharRec ch184 = {6,6,-1,6,8,ch184data}; + +/* char: 0xb7 */ + +static const GLubyte ch183data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch183 = {2,2,-2,-6,6,ch183data}; + +/* char: 0xb6 */ + +static const GLubyte ch182data[] = { +0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0, +0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0, +0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80, +}; + +static const BitmapCharRec ch182 = {9,22,-1,5,11,ch182data}; + +/* char: 0xb5 */ + +static const GLubyte ch181data[] = { +0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0xe1,0xc0, +}; + +static const BitmapCharRec ch181 = {11,17,-1,5,13,ch181data}; + +/* char: 0xb4 */ + +static const GLubyte ch180data[] = { +0x80,0x60,0x38,0x18, +}; + +static const BitmapCharRec ch180 = {5,4,-2,-13,8,ch180data}; + +/* char: 0xb3 */ + +static const GLubyte ch179data[] = { +0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38, +}; + +static const BitmapCharRec ch179 = {6,10,0,-7,7,ch179data}; + +/* char: 0xb2 */ + +static const GLubyte ch178data[] = { +0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38, +}; + +static const BitmapCharRec ch178 = {6,10,0,-7,7,ch178data}; + +/* char: 0xb1 */ + +static const GLubyte ch177data[] = { +0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch177 = {12,15,-1,0,14,ch177data}; + +/* char: 0xb0 */ + +static const GLubyte ch176data[] = { +0x38,0x44,0x82,0x82,0x82,0x44,0x38, +}; + +static const BitmapCharRec ch176 = {7,7,-1,-10,9,ch176data}; + +/* char: 0xaf */ + +static const GLubyte ch175data[] = { +0xfc,0xfc, +}; + +static const BitmapCharRec ch175 = {6,2,-1,-14,8,ch175data}; + +/* char: 0xae */ + +static const GLubyte ch174data[] = { +0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2, +0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10, +0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, +0x7,0xf0,0x0, +}; + +static const BitmapCharRec ch174 = {17,17,-1,0,19,ch174data}; + +/* char: 0xad */ + +static const GLubyte ch173data[] = { +0xfe,0xfe, +}; + +static const BitmapCharRec ch173 = {7,2,-1,-5,9,ch173data}; + +/* char: 0xac */ + +static const GLubyte ch172data[] = { +0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch172 = {12,7,-1,-3,14,ch172data}; + +/* char: 0xab */ + +static const GLubyte ch171data[] = { +0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0, +0x19,0x80,0x8,0x80, +}; + +static const BitmapCharRec ch171 = {9,10,-2,-1,13,ch171data}; + +/* char: 0xaa */ + +static const GLubyte ch170data[] = { +0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78, +}; + +static const BitmapCharRec ch170 = {7,9,0,-8,8,ch170data}; + +/* char: 0xa9 */ + +static const GLubyte ch169data[] = { +0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4, +0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0, +0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, +0x7,0xf0,0x0, +}; + +static const BitmapCharRec ch169 = {17,17,-1,0,19,ch169data}; + +/* char: 0xa8 */ + +static const GLubyte ch168data[] = { +0xcc,0xcc, +}; + +static const BitmapCharRec ch168 = {6,2,-1,-14,8,ch168data}; + +/* char: 0xa7 */ + +static const GLubyte ch167data[] = { +0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70, +0x60,0x46,0x26,0x1c, +}; + +static const BitmapCharRec ch167 = {8,20,-2,2,12,ch167data}; + +/* char: 0xa6 */ + +static const GLubyte ch166data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch166 = {2,17,-2,0,6,ch166data}; + +/* char: 0xa5 */ + +static const GLubyte ch165data[] = { +0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0, +0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30, +0xf8,0x7c, +}; + +static const BitmapCharRec ch165 = {14,17,0,0,14,ch165data}; + +/* char: 0xa4 */ + +static const GLubyte ch164data[] = { +0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60, +}; + +static const BitmapCharRec ch164 = {11,12,-1,-3,13,ch164data}; + +/* char: 0xa3 */ + +static const GLubyte ch163data[] = { +0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80, +0xf,0x0, +}; + +static const BitmapCharRec ch163 = {10,17,-1,0,12,ch163data}; + +/* char: 0xa2 */ + +static const GLubyte ch162data[] = { +0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0, +0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0, +}; + +static const BitmapCharRec ch162 = {9,16,-1,2,12,ch162data}; + +/* char: 0xa1 */ + +static const GLubyte ch161data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch161 = {2,17,-4,5,8,ch161data}; + +/* char: 0xa0 */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch160data[] = { 0x0 }; +static const BitmapCharRec ch160 = {1,1,0,0,6,ch160data}; +#else +static const BitmapCharRec ch160 = {0,0,0,0,6,0}; +#endif + +/* char: 0x7e '~' */ + +static const GLubyte ch126data[] = { +0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20, +}; + +static const BitmapCharRec ch126 = {11,4,-1,-5,13,ch126data}; + +/* char: 0x7d '}' */ + +static const GLubyte ch125data[] = { +0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18, +0x18,0x18,0x18,0x18,0x30,0xe0, +}; + +static const BitmapCharRec ch125 = {8,22,-1,5,10,ch125data}; + +/* char: 0x7c '|' */ + +static const GLubyte ch124data[] = { +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch124 = {2,17,-2,0,6,ch124data}; + +/* char: 0x7b '{' */ + +static const GLubyte ch123data[] = { +0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18, +0x18,0x18,0x18,0x18,0xc,0x7, +}; + +static const BitmapCharRec ch123 = {8,22,-1,5,10,ch123data}; + +/* char: 0x7a 'z' */ + +static const GLubyte ch122data[] = { +0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff, +}; + +static const BitmapCharRec ch122 = {8,12,-1,0,10,ch122data}; + +/* char: 0x79 'y' */ + +static const GLubyte ch121data[] = { +0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, +0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, +0xf1,0xe0, +}; + +static const BitmapCharRec ch121 = {11,17,0,5,11,ch121data}; + +/* char: 0x78 'x' */ + +static const GLubyte ch120data[] = { +0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0, +0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0, +}; + +static const BitmapCharRec ch120 = {11,12,-1,0,13,ch120data}; + +/* char: 0x77 'w' */ + +static const GLubyte ch119data[] = { +0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19, +0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3, +0x0,0xf1,0xe7,0x80, +}; + +static const BitmapCharRec ch119 = {17,12,0,0,17,ch119data}; + +/* char: 0x76 'v' */ + +static const GLubyte ch118data[] = { +0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80, +0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0, +}; + +static const BitmapCharRec ch118 = {11,12,0,0,11,ch118data}; + +/* char: 0x75 'u' */ + +static const GLubyte ch117data[] = { +0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0, +}; + +static const BitmapCharRec ch117 = {11,12,-1,0,13,ch117data}; + +/* char: 0x74 't' */ + +static const GLubyte ch116data[] = { +0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10, +}; + +static const BitmapCharRec ch116 = {7,15,0,0,7,ch116data}; + +/* char: 0x73 's' */ + +static const GLubyte ch115data[] = { +0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e, +}; + +static const BitmapCharRec ch115 = {8,12,-1,0,10,ch115data}; + +/* char: 0x72 'r' */ + +static const GLubyte ch114data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6, +}; + +static const BitmapCharRec ch114 = {7,12,-1,0,8,ch114data}; + +/* char: 0x71 'q' */ + +static const GLubyte ch113data[] = { +0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80, +0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80, +0x1d,0x80, +}; + +static const BitmapCharRec ch113 = {10,17,-1,5,12,ch113data}; + +/* char: 0x70 'p' */ + +static const GLubyte ch112data[] = { +0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, +0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, +0xee,0x0, +}; + +static const BitmapCharRec ch112 = {10,17,-1,5,12,ch112data}; + +/* char: 0x6f 'o' */ + +static const GLubyte ch111data[] = { +0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0, +}; + +static const BitmapCharRec ch111 = {10,12,-1,0,12,ch111data}; + +/* char: 0x6e 'n' */ + +static const GLubyte ch110data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0, +}; + +static const BitmapCharRec ch110 = {11,12,-1,0,13,ch110data}; + +/* char: 0x6d 'm' */ + +static const GLubyte ch109data[] = { +0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60, +0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f, +0x0,0xe7,0xe,0x0, +}; + +static const BitmapCharRec ch109 = {18,12,-1,0,20,ch109data}; + +/* char: 0x6c 'l' */ + +static const GLubyte ch108data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, +0xe0, +}; + +static const BitmapCharRec ch108 = {4,17,-1,0,6,ch108data}; + +/* char: 0x6b 'k' */ + +static const GLubyte ch107data[] = { +0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0, +0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch107 = {11,17,-1,0,12,ch107data}; + +/* char: 0x6a 'j' */ + +static const GLubyte ch106data[] = { +0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0x70,0x0,0x0,0x0,0x30,0x30, +}; + +static const BitmapCharRec ch106 = {4,22,0,5,6,ch106data}; + +/* char: 0x69 'i' */ + +static const GLubyte ch105data[] = { +0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60, +0x60, +}; + +static const BitmapCharRec ch105 = {4,17,-1,0,6,ch105data}; + +/* char: 0x68 'h' */ + +static const GLubyte ch104data[] = { +0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch104 = {11,17,-1,0,13,ch104data}; + +/* char: 0x67 'g' */ + +static const GLubyte ch103data[] = { +0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0, +0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1f,0xc0, +}; + +static const BitmapCharRec ch103 = {11,17,-1,5,12,ch103data}; + +/* char: 0x66 'f' */ + +static const GLubyte ch102data[] = { +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16, +0xe, +}; + +static const BitmapCharRec ch102 = {7,17,0,0,7,ch102data}; + +/* char: 0x65 'e' */ + +static const GLubyte ch101data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, +0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0, +}; + +static const BitmapCharRec ch101 = {9,12,-1,0,11,ch101data}; + +/* char: 0x64 'd' */ + +static const GLubyte ch100data[] = { +0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80, +0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, +0x3,0x80, +}; + +static const BitmapCharRec ch100 = {10,17,-1,0,12,ch100data}; + +/* char: 0x63 'c' */ + +static const GLubyte ch99data[] = { +0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0, +}; + +static const BitmapCharRec ch99 = {9,12,-1,0,11,ch99data}; + +/* char: 0x62 'b' */ + +static const GLubyte ch98data[] = { +0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, +0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, +0xe0,0x0, +}; + +static const BitmapCharRec ch98 = {10,17,-1,0,12,ch98data}; + +/* char: 0x61 'a' */ + +static const GLubyte ch97data[] = { +0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, +0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0, +}; + +static const BitmapCharRec ch97 = {9,12,-1,0,11,ch97data}; + +/* char: 0x60 '`' */ + +static const GLubyte ch96data[] = { +0x60,0xe0,0x80,0xc0,0x60, +}; + +static const BitmapCharRec ch96 = {3,5,-2,-12,7,ch96data}; + +/* char: 0x5f '_' */ + +static const GLubyte ch95data[] = { +0xff,0xf8,0xff,0xf8, +}; + +static const BitmapCharRec ch95 = {13,2,0,5,13,ch95data}; + +/* char: 0x5e '^' */ + +static const GLubyte ch94data[] = { +0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch94 = {9,9,-1,-8,11,ch94data}; + +/* char: 0x5d ']' */ + +static const GLubyte ch93data[] = { +0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0xf8, +}; + +static const BitmapCharRec ch93 = {5,21,-1,4,8,ch93data}; + +/* char: 0x5c '\' */ + +static const GLubyte ch92data[] = { +0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0, +0xc0, +}; + +static const BitmapCharRec ch92 = {7,17,0,0,7,ch92data}; + +/* char: 0x5b '[' */ + +static const GLubyte ch91data[] = { +0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xf8, +}; + +static const BitmapCharRec ch91 = {5,21,-2,4,8,ch91data}; + +/* char: 0x5a 'Z' */ + +static const GLubyte ch90data[] = { +0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0, +0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70, +0xff,0xf0, +}; + +static const BitmapCharRec ch90 = {13,17,-1,0,15,ch90data}; + +/* char: 0x59 'Y' */ + +static const GLubyte ch89data[] = { +0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, +0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, +0xfc,0x3f, +}; + +static const BitmapCharRec ch89 = {16,17,0,0,16,ch89data}; + +/* char: 0x58 'X' */ + +static const GLubyte ch88data[] = { +0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6, +0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0, +0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0, +0x7e,0xf,0x80, +}; + +static const BitmapCharRec ch88 = {18,17,0,0,18,ch88data}; + +/* char: 0x57 'W' */ + +static const GLubyte ch87data[] = { +0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3, +0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c, +0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18, +0xfc,0x7e,0x7e, +}; + +static const BitmapCharRec ch87 = {23,17,0,0,23,ch87data}; + +/* char: 0x56 'V' */ + +static const GLubyte ch86data[] = { +0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3, +0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18, +0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0, +0xfc,0x1f,0x80, +}; + +static const BitmapCharRec ch86 = {17,17,0,0,17,ch86data}; + +/* char: 0x55 'U' */ + +static const GLubyte ch85data[] = { +0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, +0xfc,0x1f, +}; + +static const BitmapCharRec ch85 = {16,17,-1,0,18,ch85data}; + +/* char: 0x54 'T' */ + +static const GLubyte ch84data[] = { +0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0, +0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc, +0xff,0xfc, +}; + +static const BitmapCharRec ch84 = {14,17,-1,0,16,ch84data}; + +/* char: 0x53 'S' */ + +static const GLubyte ch83data[] = { +0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0, +0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0, +0x1e,0x40, +}; + +static const BitmapCharRec ch83 = {11,17,-1,0,13,ch83data}; + +/* char: 0x52 'R' */ + +static const GLubyte ch82data[] = { +0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80, +0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch82 = {15,17,-1,0,16,ch82data}; + +/* char: 0x51 'Q' */ + +static const GLubyte ch81data[] = { +0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c, +0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0, +}; + +static const BitmapCharRec ch81 = {16,22,-1,5,18,ch81data}; + +/* char: 0x50 'P' */ + +static const GLubyte ch80data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch80 = {13,17,-1,0,15,ch80data}; + +/* char: 0x4f 'O' */ + +static const GLubyte ch79data[] = { +0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, +0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, +0x7,0xe0, +}; + +static const BitmapCharRec ch79 = {16,17,-1,0,18,ch79data}; + +/* char: 0x4e 'N' */ + +static const GLubyte ch78data[] = { +0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, +0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, +0xf0,0x1f, +}; + +static const BitmapCharRec ch78 = {16,17,-1,0,18,ch78data}; + +/* char: 0x4d 'M' */ + +static const GLubyte ch77data[] = { +0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21, +0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2, +0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0, +0xf0,0x0,0xf8, +}; + +static const BitmapCharRec ch77 = {21,17,-1,0,22,ch77data}; + +/* char: 0x4c 'L' */ + +static const GLubyte ch76data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, +0xfc,0x0, +}; + +static const BitmapCharRec ch76 = {13,17,-1,0,14,ch76data}; + +/* char: 0x4b 'K' */ + +static const GLubyte ch75data[] = { +0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80, +0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18, +0xfc,0x7e, +}; + +static const BitmapCharRec ch75 = {16,17,-1,0,17,ch75data}; + +/* char: 0x4a 'J' */ + +static const GLubyte ch74data[] = { +0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +0x1f,0x80, +}; + +static const BitmapCharRec ch74 = {9,17,-1,0,11,ch74data}; + +/* char: 0x49 'I' */ + +static const GLubyte ch73data[] = { +0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, +0xfc, +}; + +static const BitmapCharRec ch73 = {6,17,-1,0,8,ch73data}; + +/* char: 0x48 'H' */ + +static const GLubyte ch72data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30, +0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6, +0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0, +0xfc,0x1f,0x80, +}; + +static const BitmapCharRec ch72 = {17,17,-1,0,19,ch72data}; + +/* char: 0x47 'G' */ + +static const GLubyte ch71data[] = { +0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, +0x7,0xe4, +}; + +static const BitmapCharRec ch71 = {16,17,-1,0,18,ch71data}; + +/* char: 0x46 'F' */ + +static const GLubyte ch70data[] = { +0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20, +0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0, +}; + +static const BitmapCharRec ch70 = {12,17,-1,0,14,ch70data}; + +/* char: 0x45 'E' */ + +static const GLubyte ch69data[] = { +0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, +0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, +0xff,0xf0, +}; + +static const BitmapCharRec ch69 = {13,17,-1,0,15,ch69data}; + +/* char: 0x44 'D' */ + +static const GLubyte ch68data[] = { +0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6, +0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch68 = {15,17,-1,0,17,ch68data}; + +/* char: 0x43 'C' */ + +static const GLubyte ch67data[] = { +0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, +0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, +0x7,0xe4, +}; + +static const BitmapCharRec ch67 = {14,17,-1,0,16,ch67data}; + +/* char: 0x42 'B' */ + +static const GLubyte ch66data[] = { +0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38, +0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, +0xff,0xc0, +}; + +static const BitmapCharRec ch66 = {14,17,-1,0,16,ch66data}; + +/* char: 0x41 'A' */ + +static const GLubyte ch65data[] = { +0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, +0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, +0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, +0x0,0x80,0x0, +}; + +static const BitmapCharRec ch65 = {17,17,0,0,17,ch65data}; + +/* char: 0x40 '@' */ + +static const GLubyte ch64data[] = { +0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63, +0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc, +0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80, +0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0, +}; + +static const BitmapCharRec ch64 = {18,20,-2,3,22,ch64data}; + +/* char: 0x3f '?' */ + +static const GLubyte ch63data[] = { +0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6, +0x7c, +}; + +static const BitmapCharRec ch63 = {8,17,-2,0,11,ch63data}; + +/* char: 0x3e '>' */ + +static const GLubyte ch62data[] = { +0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0, +0x1c,0x0,0x70,0x0,0xc0,0x0, +}; + +static const BitmapCharRec ch62 = {11,11,-1,-1,13,ch62data}; + +/* char: 0x3d '=' */ + +static const GLubyte ch61data[] = { +0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch61 = {12,6,-1,-4,14,ch61data}; + +/* char: 0x3c '<' */ + +static const GLubyte ch60data[] = { +0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0, +0x7,0x0,0x1,0xc0,0x0,0x60, +}; + +static const BitmapCharRec ch60 = {11,11,-1,-1,13,ch60data}; + +/* char: 0x3b ';' */ + +static const GLubyte ch59data[] = { +0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch59 = {3,14,-2,3,7,ch59data}; + +/* char: 0x3a ':' */ + +static const GLubyte ch58data[] = { +0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, +}; + +static const BitmapCharRec ch58 = {2,11,-2,0,6,ch58data}; + +/* char: 0x39 '9' */ + +static const GLubyte ch57data[] = { +0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0, +0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80, +0x1e,0x0, +}; + +static const BitmapCharRec ch57 = {10,17,-1,0,12,ch57data}; + +/* char: 0x38 '8' */ + +static const GLubyte ch56data[] = { +0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80, +0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch56 = {10,17,-1,0,12,ch56data}; + +/* char: 0x37 '7' */ + +static const GLubyte ch55data[] = { +0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0, +0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0, +0x7f,0xc0, +}; + +static const BitmapCharRec ch55 = {10,17,-1,0,12,ch55data}; + +/* char: 0x36 '6' */ + +static const GLubyte ch54data[] = { +0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0, +0x3,0xc0, +}; + +static const BitmapCharRec ch54 = {10,17,-1,0,12,ch54data}; + +/* char: 0x35 '5' */ + +static const GLubyte ch53data[] = { +0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0, +0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80, +0x1f,0xc0, +}; + +static const BitmapCharRec ch53 = {10,17,-1,0,12,ch53data}; + +/* char: 0x34 '4' */ + +static const GLubyte ch52data[] = { +0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0, +0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0, +0x3,0x0, +}; + +static const BitmapCharRec ch52 = {10,17,-1,0,12,ch52data}; + +/* char: 0x33 '3' */ + +static const GLubyte ch51data[] = { +0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80, +0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch51 = {9,17,-1,0,12,ch51data}; + +/* char: 0x32 '2' */ + +static const GLubyte ch50data[] = { +0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0, +0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0, +0x1c,0x0, +}; + +static const BitmapCharRec ch50 = {10,17,-1,0,12,ch50data}; + +/* char: 0x31 '1' */ + +static const GLubyte ch49data[] = { +0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18, +0x8, +}; + +static const BitmapCharRec ch49 = {8,17,-2,0,12,ch49data}; + +/* char: 0x30 '0' */ + +static const GLubyte ch48data[] = { +0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0, +0x1e,0x0, +}; + +static const BitmapCharRec ch48 = {10,17,-1,0,12,ch48data}; + +/* char: 0x2f '/' */ + +static const GLubyte ch47data[] = { +0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6, +0x6,0x3,0x3,0x3, +}; + +static const BitmapCharRec ch47 = {8,20,1,3,7,ch47data}; + +/* char: 0x2e '.' */ + +static const GLubyte ch46data[] = { +0xc0,0xc0, +}; + +static const BitmapCharRec ch46 = {2,2,-2,0,6,ch46data}; + +/* char: 0x2d '-' */ + +static const GLubyte ch45data[] = { +0xff,0xf0,0xff,0xf0, +}; + +static const BitmapCharRec ch45 = {12,2,-1,-6,14,ch45data}; + +/* char: 0x2c ',' */ + +static const GLubyte ch44data[] = { +0xc0,0x60,0x20,0xe0,0xc0, +}; + +static const BitmapCharRec ch44 = {3,5,-2,3,7,ch44data}; + +/* char: 0x2b '+' */ + +static const GLubyte ch43data[] = { +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0, +0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, +}; + +static const BitmapCharRec ch43 = {12,12,-1,-1,14,ch43data}; + +/* char: 0x2a '*' */ + +static const GLubyte ch42data[] = { +0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0, +0x8,0x0, +}; + +static const BitmapCharRec ch42 = {9,9,-2,-8,12,ch42data}; + +/* char: 0x29 ')' */ + +static const GLubyte ch41data[] = { +0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18, +0x18,0x10,0x30,0x20,0x40,0x80, +}; + +static const BitmapCharRec ch41 = {6,22,-1,5,8,ch41data}; + +/* char: 0x28 '(' */ + +static const GLubyte ch40data[] = { +0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60, +0x60,0x20,0x30,0x10,0x8,0x4, +}; + +static const BitmapCharRec ch40 = {6,22,-1,5,8,ch40data}; + +/* char: 0x27 ''' */ + +static const GLubyte ch39data[] = { +0xc0,0x60,0x20,0xe0,0xc0, +}; + +static const BitmapCharRec ch39 = {3,5,-3,-12,8,ch39data}; + +/* char: 0x26 '&' */ + +static const GLubyte ch38data[] = { +0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10, +0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0, +0x7,0x80, +}; + +static const BitmapCharRec ch38 = {16,17,-1,0,18,ch38data}; + +/* char: 0x25 '%' */ + +static const GLubyte ch37data[] = { +0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3, +0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60, +0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0, +}; + +static const BitmapCharRec ch37 = {17,16,-1,0,19,ch37data}; + +/* char: 0x24 '$' */ + +static const GLubyte ch36data[] = { +0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60, +0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20, +0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0, +}; + +static const BitmapCharRec ch36 = {11,21,0,2,12,ch36data}; + +/* char: 0x23 '#' */ + +static const GLubyte ch35data[] = { +0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0, +0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80, +0x8,0x80, +}; + +static const BitmapCharRec ch35 = {11,17,-1,0,13,ch35data}; + +/* char: 0x22 '"' */ + +static const GLubyte ch34data[] = { +0x88,0xcc,0xcc,0xcc,0xcc, +}; + +static const BitmapCharRec ch34 = {6,5,-1,-12,10,ch34data}; + +/* char: 0x21 '!' */ + +static const GLubyte ch33data[] = { +0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, +0xc0, +}; + +static const BitmapCharRec ch33 = {2,17,-3,0,8,ch33data}; + +/* char: 0x20 ' ' */ + +#ifdef _WIN32 +/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with + a height or width of zero does not advance the raster position + as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ +static const GLubyte ch32data[] = { 0x0 }; +static const BitmapCharRec ch32 = {1,1,0,0,6,ch32data}; +#else +static const BitmapCharRec ch32 = {0,0,0,0,6,0}; +#endif + +static const BitmapCharRec * const chars[] = { +&ch32, +&ch33, +&ch34, +&ch35, +&ch36, +&ch37, +&ch38, +&ch39, +&ch40, +&ch41, +&ch42, +&ch43, +&ch44, +&ch45, +&ch46, +&ch47, +&ch48, +&ch49, +&ch50, +&ch51, +&ch52, +&ch53, +&ch54, +&ch55, +&ch56, +&ch57, +&ch58, +&ch59, +&ch60, +&ch61, +&ch62, +&ch63, +&ch64, +&ch65, +&ch66, +&ch67, +&ch68, +&ch69, +&ch70, +&ch71, +&ch72, +&ch73, +&ch74, +&ch75, +&ch76, +&ch77, +&ch78, +&ch79, +&ch80, +&ch81, +&ch82, +&ch83, +&ch84, +&ch85, +&ch86, +&ch87, +&ch88, +&ch89, +&ch90, +&ch91, +&ch92, +&ch93, +&ch94, +&ch95, +&ch96, +&ch97, +&ch98, +&ch99, +&ch100, +&ch101, +&ch102, +&ch103, +&ch104, +&ch105, +&ch106, +&ch107, +&ch108, +&ch109, +&ch110, +&ch111, +&ch112, +&ch113, +&ch114, +&ch115, +&ch116, +&ch117, +&ch118, +&ch119, +&ch120, +&ch121, +&ch122, +&ch123, +&ch124, +&ch125, +&ch126, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +&ch160, +&ch161, +&ch162, +&ch163, +&ch164, +&ch165, +&ch166, +&ch167, +&ch168, +&ch169, +&ch170, +&ch171, +&ch172, +&ch173, +&ch174, +&ch175, +&ch176, +&ch177, +&ch178, +&ch179, +&ch180, +&ch181, +&ch182, +&ch183, +&ch184, +&ch185, +&ch186, +&ch187, +&ch188, +&ch189, +&ch190, +&ch191, +&ch192, +&ch193, +&ch194, +&ch195, +&ch196, +&ch197, +&ch198, +&ch199, +&ch200, +&ch201, +&ch202, +&ch203, +&ch204, +&ch205, +&ch206, +&ch207, +&ch208, +&ch209, +&ch210, +&ch211, +&ch212, +&ch213, +&ch214, +&ch215, +&ch216, +&ch217, +&ch218, +&ch219, +&ch220, +&ch221, +&ch222, +&ch223, +&ch224, +&ch225, +&ch226, +&ch227, +&ch228, +&ch229, +&ch230, +&ch231, +&ch232, +&ch233, +&ch234, +&ch235, +&ch236, +&ch237, +&ch238, +&ch239, +&ch240, +&ch241, +&ch242, +&ch243, +&ch244, +&ch245, +&ch246, +&ch247, +&ch248, +&ch249, +&ch250, +&ch251, +&ch252, +&ch253, +&ch254, +&ch255, +}; + +#if !defined(__IBMCPP__) +const +#endif +BitmapFontRec glutBitmapTimesRoman24 = { +"-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", +224, +32, +chars +}; + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_util.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_util.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_util.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_util.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,90 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include +#include + +#include "glutint.h" + +#if !defined(__OS2__) + +/* strdup is actually not a standard ANSI C or POSIX routine + so implement a private one for GLUT. OpenVMS does not have a + strdup; Linux's standard libc doesn't declare strdup by default + (unless BSD or SVID interfaces are requested). */ +char * +__glutStrdup(const char *string) +{ + char *copy; + + copy = (char*) malloc(strlen(string) + 1); + if (copy == NULL) + return NULL; + strcpy(copy, string); + return copy; +} +#endif + +void +__glutWarning(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Warning in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutReportErrors(void) +{ + GLenum error; + + while ((error = glGetError()) != GL_NO_ERROR) + __glutWarning("GL error: %s", gluErrorString(error)); +} +/* ENDCENTRY */ + +void +__glutFatalError(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal Error in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); +/* || defined(__OS2__) */ +#if defined(_WIN32) + if (__glutExitFunc) { + __glutExitFunc(1); + } +#endif + exit(1); +} + +void +__glutFatalUsage(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal API Usage in %s: ", + __glutProgramName ? __glutProgramName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + abort(); +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_vidresize.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_vidresize.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_vidresize.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_vidresize.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,232 @@ + +/* Copyright (c) Mark J. Kilgard, 1996. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include + +#ifdef __sgi +#include +#endif + +#include "glutint.h" + +/* Grumble. The IRIX 6.3 and early IRIX 6.4 OpenGL headers + support the video resize extension, but failed to define + GLX_SGIX_video_resize. */ +#if 0 +#ifdef GLX_SYNC_FRAME_SGIX +#define GLX_SGIX_video_resize 1 +#endif +#endif + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) +static int canVideoResize = -1; +static int videoResizeChannel; +#else +static int canVideoResize = 0; +#endif +static int videoResizeInUse = 0; +static int dx = -1, dy = -1, dw = -1, dh = -1; + +/* XXX Note that IRIX 6.2, 6.3, and some 6.4 versions have a + bug where programs seg-fault when they attempt video + resizing from an indirect OpenGL context (either local or + over a network). */ + +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + +static volatile int errorCaught; + +/* ARGSUSED */ +static int +catchXSGIvcErrors(Display * dpy, XErrorEvent * event) +{ + errorCaught = 1; + return 0; +} +#endif + +/* CENTRY */ + +int GLUTAPIENTRY +glutVideoResizeGet(GLenum param) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (canVideoResize < 0) { + canVideoResize = __glutIsSupportedByGLX("GLX_SGIX_video_resize"); + if (canVideoResize) { +#if defined(__sgi) && __sgi + /* This is a hack because IRIX 6.2, 6.3, and some 6.4 + versions were released with GLX_SGIX_video_resize + being advertised by the X server though the video + resize extension is not actually supported. We try to + determine if the libGL.so we are using actually has a + video resize entrypoint before we try to use the + feature. */ + void (*func) (void); + void *glxDso = dlopen("libGL.so", RTLD_LAZY); + + func = (void (*)(void)) dlsym(glxDso, "glXQueryChannelDeltasSGIX"); + if (!func) { + canVideoResize = 0; + } else +#endif + { + char *channelString; + int (*handler) (Display *, XErrorEvent *); + + channelString = getenv("GLUT_VIDEO_RESIZE_CHANNEL"); + videoResizeChannel = channelString ? atoi(channelString) : 0; + + /* Work around another annoying problem with SGI's + GLX_SGIX_video_resize implementation. Early IRIX + 6.4 OpenGL's advertise the extension and have the + video resize API, but an XSGIvc X protocol errors + result trying to use the API. Set up an error + handler to intercept what would otherwise be a fatal + error. If an error was recieved, do not report that + video resize is possible. */ + handler = XSetErrorHandler(catchXSGIvcErrors); + + errorCaught = 0; + +#if defined(GLX_GLXEXT_PROTOTYPES) +#endif + + __glut_glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, &dx, &dy, &dw, &dh); + + /* glXQueryChannelDeltasSGIX is an inherent X server + round-trip so we know we will have gotten either the + correct reply or and error by this time. */ + XSetErrorHandler(handler); + + /* Still yet another work around. In IRIX 6.4 betas, + glXQueryChannelDeltasSGIX will return as if it + succeeded, but the values are filled with junk. + Watch to make sure the delta variables really make + sense. */ + if (errorCaught || + dx < 0 || dy < 0 || dw < 0 || dh < 0 || + dx > 2048 || dy > 2048 || dw > 2048 || dh > 2048) { + canVideoResize = 0; + } + } + } + } +#endif /* GLX_SGIX_video_resize */ + + switch (param) { + case GLUT_VIDEO_RESIZE_POSSIBLE: + return canVideoResize; + case GLUT_VIDEO_RESIZE_IN_USE: + return videoResizeInUse; + case GLUT_VIDEO_RESIZE_X_DELTA: + return dx; + case GLUT_VIDEO_RESIZE_Y_DELTA: + return dy; + case GLUT_VIDEO_RESIZE_WIDTH_DELTA: + return dw; + case GLUT_VIDEO_RESIZE_HEIGHT_DELTA: + return dh; + case GLUT_VIDEO_RESIZE_X: + case GLUT_VIDEO_RESIZE_Y: + case GLUT_VIDEO_RESIZE_WIDTH: + case GLUT_VIDEO_RESIZE_HEIGHT: +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { + int x, y, width, height; + + __glut_glXQueryChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, &x, &y, &width, &height); + switch (param) { + case GLUT_VIDEO_RESIZE_X: + return x; + case GLUT_VIDEO_RESIZE_Y: + return y; + case GLUT_VIDEO_RESIZE_WIDTH: + return width; + case GLUT_VIDEO_RESIZE_HEIGHT: + return height; + } + } +#endif + return -1; + default: + __glutWarning("invalid glutVideoResizeGet parameter: %d", param); + return -1; + } +} + +void GLUTAPIENTRY +glutSetupVideoResizing(void) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { + __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, __glutCurrentWindow->win); + videoResizeInUse = 1; + } else +#endif + __glutFatalError("glutEstablishVideoResizing: video resizing not possible.\n"); +} + +void GLUTAPIENTRY +glutStopVideoResizing(void) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { + if (videoResizeInUse) { + __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, None); + videoResizeInUse = 0; + } + } +#endif +} + +/* ARGSUSED */ +void GLUTAPIENTRY +glutVideoResize(int x, int y, int width, int height) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { +#ifdef GLX_SYNC_SWAP_SGIX + /* glXChannelRectSyncSGIX introduced in a patch to IRIX + 6.2; the original unpatched IRIX 6.2 behavior is always + GLX_SYNC_SWAP_SGIX. */ + __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, GLX_SYNC_SWAP_SGIX); +#endif + __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, x, y, width, height); + } +#endif +} + +/* ARGSUSED */ +void GLUTAPIENTRY +glutVideoPan(int x, int y, int width, int height) +{ +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) + if (videoResizeInUse) { +#ifdef GLX_SYNC_FRAME_SGIX + /* glXChannelRectSyncSGIX introduced in a patch to IRIX + 6.2; the original unpatched IRIX 6.2 behavior is always + GLX_SYNC_SWAP_SGIX. We just ignore that we cannot + accomplish GLX_SYNC_FRAME_SGIX on IRIX unpatched 6.2; + this means you'd need a glutSwapBuffers to actually + realize the video resize. */ + __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, GLX_SYNC_FRAME_SGIX); +#endif + __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen, + videoResizeChannel, x, y, width, height); + } +#endif +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_warp.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_warp.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_warp.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_warp.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,29 @@ + +/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutWarpPointer(int x, int y) +{ +// XWarpPointer(__glutDisplay, None, __glutCurrentWindow->win, +// 0, 0, 0, 0, x, y); + POINTL point; + point.x = x; + point.y = y; + WinMapWindowPoints(__glutCurrentWindow->win,HWND_DESKTOP,&point,1); + WinSetPointerPos(HWND_DESKTOP, point.x, point.y); + + XFlush(__glutDisplay); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_win.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_win.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_win.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_win.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1220 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#ifdef __VMS +#include +#endif + +#include +#include +#include +#include +#if defined(__OS2__) +#define POKA 0 + #include "WarpGL.h" + #include "glutos2.h" + #include "glutint.h" + + #include "gl\os2mesa.h" + +// +//define for resource id for main GLUT window, in samples it is defined in GL_TEST.h + #define ID_WINDOW 256 + + int evglSetPixelFormat(int iPixelFormat); + HPS hpsCurrent; + +#elif !defined(_WIN32) + +#include +#include +#endif + +#include "glutint.h" + +GLUTwindow *__glutCurrentWindow = NULL; +GLUTwindow **__glutWindowList = NULL; +int __glutWindowListSize = 0; +#if !defined(_WIN32) && !defined(__OS2__) +GLUTstale *__glutStaleWindowList = NULL; +#endif +GLUTwindow *__glutMenuWindow = NULL; + +void (*__glutFreeOverlayFunc) (GLUToverlay *); +XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle, + Criterion * requiredCriteria, int nRequired, int requiredMask, void** fbc) = NULL; + +static Criterion requiredWindowCriteria[] = +{ + {LEVEL, EQ, 0}, + {TRANSPARENT, EQ, 0} +}; +static int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion); +static int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT); + +static void +cleanWindowWorkList(GLUTwindow * window) +{ + GLUTwindow **pEntry = &__glutWindowWorkList; + GLUTwindow *entry = __glutWindowWorkList; + + /* Tranverse singly-linked window work list look for the + window. */ + while (entry) { + if (entry == window) { + /* Found it; delete it. */ + *pEntry = entry->prevWorkWin; + return; + } else { + pEntry = &entry->prevWorkWin; + entry = *pEntry; + } + } +} + +#if !defined(_WIN32) && !defined(__OS2PM__) + +static void +cleanStaleWindowList(GLUTwindow * window) +{ + GLUTstale **pEntry = &__glutStaleWindowList; + GLUTstale *entry = __glutStaleWindowList; + + /* Tranverse singly-linked stale window list look for the + window ID. */ + while (entry) { + if (entry->window == window) { + /* Found it; delete it. */ + *pEntry = entry->next; + free(entry); + return; + } else { + pEntry = &entry->next; + entry = *pEntry; + } + } +} + +#endif + +static GLUTwindow *__glutWindowCache = NULL; + +GLUTwindow * +__glutGetWindow(Window win) +{ + int i; + + /* Does win belong to the last window ID looked up? */ + if (__glutWindowCache && (win == __glutWindowCache->win || + (__glutWindowCache->overlay && win == + __glutWindowCache->overlay->win))) { + return + __glutWindowCache; + } + /* Otherwise scan the window list looking for the window ID. */ + for (i = 0; i < __glutWindowListSize; i++) { + if (__glutWindowList[i]) { + if (win == __glutWindowList[i]->win) { + __glutWindowCache = __glutWindowList[i]; + return __glutWindowCache; + } + if (__glutWindowList[i]->overlay) { + if (win == __glutWindowList[i]->overlay->win) { + __glutWindowCache = __glutWindowList[i]; + return __glutWindowCache; + } + } + } + } +#if !defined(_WIN32) && !defined(__OS2PM__) + { + GLUTstale *entry; + + /* Scan through destroyed overlay window IDs for which no + DestroyNotify has yet been received. */ + for (entry = __glutStaleWindowList; entry; entry = entry->next) { + if (entry->win == win) + return entry->window; + } + } +#endif + return NULL; +} + +/* CENTRY */ +int GLUTAPIENTRY +glutGetWindow(void) +{ + if (__glutCurrentWindow) { + return __glutCurrentWindow->num + 1; + } else { + return 0; + } +} +/* ENDCENTRY */ + +void +__glutSetWindow(GLUTwindow * window) +{ + /* It is tempting to try to short-circuit the call to + glXMakeCurrent if we "know" we are going to make current + to a window we are already current to. In fact, this + assumption breaks when GLUT is expected to integrated with + other OpenGL windowing APIs that also make current to + OpenGL contexts. Since glXMakeCurrent short-circuits the + "already bound" case, GLUT avoids the temptation to do so + too. */ + __glutCurrentWindow = window; + + MAKE_CURRENT_LAYER(__glutCurrentWindow); + +#if !defined(_WIN32) && !defined(__OS2__) + /* We should be careful to force a finish between each + iteration through the GLUT main loop if indirect OpenGL + contexts are in use; indirect contexts tend to have much + longer latency because lots of OpenGL extension requests + can queue up in the X protocol stream. We accomplish this + by posting GLUT_FINISH_WORK to be done. */ + if (!__glutCurrentWindow->isDirect) + __glutPutOnWorkList(__glutCurrentWindow, GLUT_FINISH_WORK); +#endif + + /* If debugging is enabled, we'll want to check this window + for any OpenGL errors every iteration through the GLUT + main loop. To accomplish this, we post the + GLUT_DEBUG_WORK to be done on this window. */ + if (__glutDebug) { + __glutPutOnWorkList(__glutCurrentWindow, GLUT_DEBUG_WORK); + } +} + +/* CENTRY */ +void GLUTAPIENTRY +glutSetWindow(int win) +{ + GLUTwindow *window; + + if (win < 1 || win > __glutWindowListSize) { + __glutWarning("glutSetWindow attempted on bogus window."); + return; + } + window = __glutWindowList[win - 1]; + if (!window) { + __glutWarning("glutSetWindow attempted on bogus window."); + return; + } + __glutSetWindow(window); +} +/* ENDCENTRY */ + +static int +getUnusedWindowSlot(void) +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < __glutWindowListSize; i++) { + if (!__glutWindowList[i]) { + return i; + } + } + /* Allocate a new slot. */ + __glutWindowListSize++; + if (__glutWindowList) { + __glutWindowList = (GLUTwindow **) + realloc(__glutWindowList, + __glutWindowListSize * sizeof(GLUTwindow *)); + } else { + /* XXX Some realloc's do not correctly perform a malloc + when asked to perform a realloc on a NULL pointer, + though the ANSI C library spec requires this. */ + __glutWindowList = (GLUTwindow **) + malloc(sizeof(GLUTwindow *)); + } + if (!__glutWindowList) + __glutFatalError("out of memory."); + __glutWindowList[__glutWindowListSize - 1] = NULL; + return __glutWindowListSize - 1; +} + +static XVisualInfo * +getVisualInfoCI(unsigned int mode) +{ +#if POKA + static int bufSizeList[] = + {16, 12, 8, 4, 2, 1, 0}; + XVisualInfo *vi; + int list[32]; + int i, n = 0; + + /* Should not be looking at display mode mask if + __glutDisplayString is non-NULL. */ + assert(!__glutDisplayString); + + list[n++] = GLX_BUFFER_SIZE; + list[n++] = 1; + if (GLUT_WIND_IS_DOUBLE(mode)) { + list[n++] = GLX_DOUBLEBUFFER; + } + if (GLUT_WIND_IS_STEREO(mode)) { + list[n++] = GLX_STEREO; + } + if (GLUT_WIND_HAS_DEPTH(mode)) { + list[n++] = GLX_DEPTH_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_HAS_STENCIL(mode)) { + list[n++] = GLX_STENCIL_SIZE; + list[n++] = 1; + } + list[n] = (int) None; /* terminate list */ + + /* glXChooseVisual specify GLX_BUFFER_SIZE prefers the + "smallest index buffer of at least the specified size". + This would be reasonable if GLUT allowed the user to + specify the required buffe size, but GLUT's display mode + is too simplistic (easy to use?). GLUT should try to find + the "largest". So start with a large buffer size and + shrink until we find a matching one that exists. */ + + for (i = 0; bufSizeList[i]; i++) { + /* XXX Assumes list[1] is where GLX_BUFFER_SIZE parameter + is. */ + list[1] = bufSizeList[i]; + vi = glXChooseVisual(__glutDisplay, + __glutScreen, list); + if (vi) + return vi; + } + return NULL; +#else + return + glXChooseVisual(mode); + +#endif +} + +static XVisualInfo * +getVisualInfoRGB(unsigned int mode) +{ +#if POKA + int list[32]; + int n = 0; + + /* Should not be looking at display mode mask if + __glutDisplayString is non-NULL. */ + assert(!__glutDisplayString); + + /* XXX Would a caching mechanism to minize the calls to + glXChooseVisual? You'd have to reference count + XVisualInfo* pointers. Would also have to properly + interact with glutInitDisplayString. */ + + list[n++] = GLX_RGBA; + list[n++] = GLX_RED_SIZE; + list[n++] = 1; + list[n++] = GLX_GREEN_SIZE; + list[n++] = 1; + list[n++] = GLX_BLUE_SIZE; + list[n++] = 1; + if (GLUT_WIND_HAS_ALPHA(mode)) { + list[n++] = GLX_ALPHA_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_IS_DOUBLE(mode)) { + list[n++] = GLX_DOUBLEBUFFER; + } + if (GLUT_WIND_IS_STEREO(mode)) { + list[n++] = GLX_STEREO; + } + if (GLUT_WIND_HAS_DEPTH(mode)) { + list[n++] = GLX_DEPTH_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_HAS_STENCIL(mode)) { + list[n++] = GLX_STENCIL_SIZE; + list[n++] = 1; + } + if (GLUT_WIND_HAS_ACCUM(mode)) { + list[n++] = GLX_ACCUM_RED_SIZE; + list[n++] = 1; + list[n++] = GLX_ACCUM_GREEN_SIZE; + list[n++] = 1; + list[n++] = GLX_ACCUM_BLUE_SIZE; + list[n++] = 1; + if (GLUT_WIND_HAS_ALPHA(mode)) { + list[n++] = GLX_ACCUM_ALPHA_SIZE; + list[n++] = 1; + } + } +#if defined(GLX_VERSION_1_1) && (defined(GLX_SGIS_multisample) || defined(GLX_ARB_multisample)) + if (GLUT_WIND_IS_MULTISAMPLE(mode)) { + if (!__glutIsSupportedByGLX("GLX_SGIS_multisample") && + !__glutIsSupportedByGLX("GLX_ARB_multisample")) + return NULL; +#if defined(GLX_ARB_multisample) + list[n++] = GLX_SAMPLES_ARB; +#elif defined(GLX_SGIS_multisample) + list[n++] = GLX_SAMPLES_SGIS; +#endif + /* XXX Is 4 a reasonable minimum acceptable number of + samples? */ + list[n++] = 4; + } +#endif + list[n] = (int) None; /* terminate list */ + + return glXChooseVisual(__glutDisplay, + __glutScreen, list); +#else /* POKA */ + + return + glXChooseVisual(mode); + +#endif +} + +XVisualInfo * +__glutGetVisualInfo(unsigned int mode) +{ + /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */ + if (GLUT_WIND_IS_LUMINANCE(mode)) + return NULL; + + if (GLUT_WIND_IS_RGB(mode)) + return getVisualInfoRGB(mode); + else + return getVisualInfoCI(mode); +} + +XVisualInfo * +__glutDetermineVisual( + unsigned int displayMode, + Bool * treatAsSingle, + XVisualInfo * (getVisualInfo) (unsigned int)) +{ + XVisualInfo *vis; + + /* Should not be looking at display mode mask if + __glutDisplayString is non-NULL. */ + assert(!__glutDisplayString); + + *treatAsSingle = GLUT_WIND_IS_SINGLE(displayMode); + vis = getVisualInfo(displayMode); + if (!vis) { + /* Fallback cases when can't get exactly what was asked + for... */ + if (GLUT_WIND_IS_SINGLE(displayMode)) { + /* If we can't find a single buffered visual, try looking + for a double buffered visual. We can treat a double + buffered visual as a single buffer visual by changing + the draw buffer to GL_FRONT and treating any swap + buffers as no-ops. */ + displayMode |= GLUT_DOUBLE; + vis = getVisualInfo(displayMode); + *treatAsSingle = True; + } + if (!vis && GLUT_WIND_IS_MULTISAMPLE(displayMode)) { + /* If we can't seem to get multisampling (ie, not Reality + Engine class graphics!), go without multisampling. It + is up to the application to query how many multisamples + were allocated (0 equals no multisampling) if the + application is going to use multisampling for more than + just antialiasing. */ + displayMode &= ~GLUT_MULTISAMPLE; + vis = getVisualInfo(displayMode); + } + } + return vis; +} + +static void GLUTCALLBACK +__glutDefaultDisplay(void) +{ + /* XXX Remove the warning after GLUT 3.0. */ + __glutWarning("The following is a new check for GLUT 3.0; update your code."); + __glutFatalError( + "redisplay needed for window %d, but no display callback.", + __glutCurrentWindow->num + 1); +} + +void GLUTCALLBACK +__glutDefaultReshape(int width, int height) +{ + GLUToverlay *overlay; + + /* Adjust the viewport of the window (and overlay if one + exists). */ + MAKE_CURRENT_WINDOW(__glutCurrentWindow); + glViewport(0, 0, (GLsizei) width, (GLsizei) height); + overlay = __glutCurrentWindow->overlay; + if (overlay) { + MAKE_CURRENT_OVERLAY(overlay); + glViewport(0, 0, (GLsizei) width, (GLsizei) height); + } + /* Make sure we are current to the current layer (application + should be able to count on the current layer not changing + unless the application explicitly calls glutUseLayer). */ + MAKE_CURRENT_LAYER(__glutCurrentWindow); +} + +XVisualInfo * +__glutDetermineWindowVisual(Bool * treatAsSingle, Bool * visAlloced, void **fbc) +{ + if (__glutDisplayString) { + + /* __glutDisplayString should be NULL except if + glutInitDisplayString has been called to register a + different display string. Calling glutInitDisplayString + means using a string instead of an integer mask determine + the visual to use. Using the function pointer variable + __glutDetermineVisualFromString below avoids linking in + the code for implementing glutInitDisplayString (ie, + glut_dstr.o) unless glutInitDisplayString gets called by + the application. */ + + assert(__glutDetermineVisualFromString); + *visAlloced = False; + *fbc = NULL; + return __glutDetermineVisualFromString(__glutDisplayString, treatAsSingle, + requiredWindowCriteria, numRequiredWindowCriteria, requiredWindowCriteriaMask, fbc); + } else { + *visAlloced = True; + *fbc = NULL; + return __glutDetermineVisual(__glutDisplayMode, + treatAsSingle, __glutGetVisualInfo); + } +} + +/* ARGSUSED5 */ /* Only Win32 uses gameMode parameter. */ +GLUTwindow * +__glutCreateWindow(GLUTwindow * parent, + int x, int y, int width, int height, int gameMode) +{ + GLUTwindow *window; + XSetWindowAttributes wa; + unsigned long attribMask; + int winnum; + int i; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + GLXFBConfigSGIX fbc; +#else + void *fbc; +#endif + +#if defined(__OS2PM__) + { + extern HAB hab; /* PM anchor block handle */ + CLASSINFO classinfo; + + if(!WinQueryClassInfo(hab,"GLUT", &classinfo) ) + __glutOpenOS2Connection(NULL); + } +#elif defined(_WIN32) + WNDCLASS wc; + int style; + + if (!GetClassInfo(GetModuleHandle(NULL), "GLUT", &wc)) { + __glutOpenWin32Connection(NULL); + } +#else + if (!__glutDisplay) { + __glutOpenXConnection(NULL); + } +#endif + +#ifndef __OS2PM__ + if (__glutGameModeWindow) { + __glutFatalError("cannot create windows in game mode."); + } +#endif + + winnum = getUnusedWindowSlot(); + window = (GLUTwindow *) malloc(sizeof(GLUTwindow)); + if (!window) { + __glutFatalError("out of memory."); + } + window->num = winnum; + +#if defined(__OS2PM__) + /* Add this new window to the window list. */ + __glutWindowList[winnum] = window; + window->shownState = -1; +#endif + +#if !defined(_WIN32) && !defined(__OS2PM__) + window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, + &window->visAlloced, (void**) &fbc); + if (!window->vis) { + __glutFatalError( + "visual with necessary capabilities not found."); + } + __glutSetupColormap(window->vis, &window->colormap, &window->cmap); +#endif + window->eventMask = StructureNotifyMask | ExposureMask; + + attribMask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask; + wa.background_pixmap = None; + wa.border_pixel = 0; + wa.colormap = window->cmap; + wa.event_mask = window->eventMask; + if (parent) { + if (parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) + wa.event_mask |= GLUT_HACK_STOP_PROPAGATE_MASK; + attribMask |= CWDontPropagate; + wa.do_not_propagate_mask = parent->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK; + } else { + wa.do_not_propagate_mask = 0; + } + + /* Stash width and height before Win32's __glutAdjustCoords + possibly overwrites the values. */ + window->width = width; + window->height = height; + window->forceReshape = True; + window->ignoreKeyRepeat = False; + +#if defined(__OS2PM__) + + { ULONG flStyle=0; + int ii; + ERRORID erridErrorCode;/* last error id code */ + extern HAB hab; /* PM anchor block handle */ + + if (parent) { + flStyle = WS_CLIPCHILDREN|WS_VISIBLE; + } else { + if (gameMode) { + /* Game mode window should be a WS_POPUP window to + ensure that the taskbar is hidden by it. A standard + WS_OVERLAPPEDWINDOW does not hide the task bar. */ + flStyle = FCF_STANDARD | WS_MAXIMIZED; + } else { + /* A standard toplevel window with borders and such. */ + flStyle = FCF_STANDARD | WS_CLIPCHILDREN; +// flStyle = WS_OVERLAPPEDWINDOW; + } + } +{ + HWND hwnd; /* Window */ + ULONG ListBoxId; /* Window id */ + /* (supplied by application) */ + + + HWND hwndClient; /* handle to the client */ + HWND hwndFrame; /* handle to the frame */ + PFNWP GenericWndProc; + FRAMECDATA fcd; + RECTL rect; /* Boundary rectangle */ + + + +/************************************************/ +// flCreate = (FCF_STANDARD) & ~FCF_TASKLIST; +/**********************************/ + if (parent) + { window->frame = NULL; + + hwnd = WinCreateWindow(parent->win, /* Parent window */ + "GLUTCHILD", /* Class name */ + "", /* Window text */ + flStyle, /* Window style */ + x, y, /* Position (x,y) */ + width, height, /* Size (width,height) */ + parent->win, /* Owner window */ + HWND_TOP, /* Sibling window */ + 0, /* Window id */ + NULL, /* Control data */ + NULL); /* Pres parameters */ + + erridErrorCode = WinGetLastError(hab); + window->win = hwnd; + + window->hdc = WinOpenWindowDC(window->win); + window->hpsBuffer = hpsCurrent; + + + rect.xLeft = x; + rect.xRight = x+width; + rect.yBottom = y; + rect.yTop = y + height; + +/***** else parent *****************************/ + } else { + hwnd = WinCreateStdWindow(HWND_DESKTOP, + 0, /* WS_VISIBLE frame-window style */ + &flStyle, /* window style */ + "GLUT", /* class name */ + "GLUT",/* window title */ + 0L, /* default client style */ + NULLHANDLE, /* resource in executable file */ + ID_WINDOW, /* resource id */ + &hwndClient); /* receives client window handle */ + + erridErrorCode = WinGetLastError(hab); + window->win = hwndClient; + window->frame = hwnd; + window->hdc = WinOpenWindowDC(window->win); + + window->hpsBuffer = hpsCurrent; + + +/* converts a client window's boundaries into an equivalent frame rectangle */ + rect.xLeft = x; + rect.xRight = x+width; + rect.yBottom = y; + rect.yTop = y + height; + + /* calculate equivalent frame boundary from boundary data */ + WinCalcFrameRect(window->frame, &rect, FALSE); + } +/***** endof if(parent) *****************************/ + + /* Must set the XHDC for fake glXChooseVisual & fake + glXCreateContext & fake XAllocColorCells. */ + XHDC = window->hdc; + XHWND = window->win; + window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, + &window->visAlloced, &fbc); + if (!window->vis) + { __glutFatalError( + "pixel format with necessary capabilities not found."); + } + { int rc; + rc = wglChoosePixelFormat(window->hdc, window->vis), + +// evglSetPixelFormat(2); /* int iPixelFormat 1 - doublebuffer/2 - single buffer ??*/ + wglSetPixelFormat(window->hdc,rc,window->vis); + } + __glutSetupColormap(window->vis, &window->colormap, &window->cmap); + + window->ctx = glXCreateContext(window->hpsBuffer, window->vis, + None, __glutTryDirect); + + WinSetWindowPos(hwnd, + HWND_TOP,rect.xLeft,rect.yBottom, + rect.xRight-rect.xLeft, rect.yTop-rect.yBottom, + SWP_ACTIVATE | SWP_MOVE | SWP_SIZE | SWP_SHOW|SWP_ZORDER); /* flags*/ + + /* Make sure subwindows get a windowStatus callback. */ + if (parent) + WinPostMsg(parent->win, WM_ACTIVATE, 0, 0); + + } +} + +#elif defined(_WIN32) + + __glutAdjustCoords(parent ? parent->win : NULL, + &x, &y, &width, &height); + if (parent) { + style = WS_CHILD; + } else { + if (gameMode) { + /* Game mode window should be a WS_POPUP window to + ensure that the taskbar is hidden by it. A standard + WS_OVERLAPPEDWINDOW does not hide the task bar. */ + style = WS_POPUP | WS_MAXIMIZE; + } else { + /* A standard toplevel window with borders and such. */ + style = WS_OVERLAPPEDWINDOW; + } + } + window->win = CreateWindow("GLUT", "GLUT", + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style, + x, y, width, height, parent ? parent->win : __glutRoot, + NULL, GetModuleHandle(NULL), 0); + window->hdc = GetDC(window->win); + /* Must set the XHDC for fake glXChooseVisual & fake + glXCreateContext & fake XAllocColorCells. */ + XHDC = window->hdc; + window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, + &window->visAlloced, &fbc); + if (!window->vis) { + __glutFatalError( + "pixel format with necessary capabilities not found."); + } + if (!SetPixelFormat(window->hdc, + ChoosePixelFormat(window->hdc, window->vis), + window->vis)) { + __glutFatalError("SetPixelFormat failed during window create."); + } + __glutSetupColormap(window->vis, &window->colormap, &window->cmap); + /* Make sure subwindows get a windowStatus callback. */ + if (parent) { + PostMessage(parent->win, WM_ACTIVATE, 0, 0); + } + window->renderDc = window->hdc; +#else + window->win = XCreateWindow(__glutDisplay, + parent == NULL ? __glutRoot : parent->win, + x, y, width, height, 0, + window->vis->depth, InputOutput, window->vis->visual, + attribMask, &wa); +#endif + window->renderWin = window->win; +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) + if (fbc) { + window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc, + GLX_RGBA_TYPE_SGIX, None, __glutTryDirect); + } else +#endif +#if defined(__OS2PM__) +// window->ctx = glXCreateContext(window->hpsBuffer, window->vis, +// None, __glutTryDirect); +#else + window->ctx = glXCreateContext(__glutDisplay, window->vis, + None, __glutTryDirect); +#endif + if (!window->ctx) { + __glutFatalError( + "failed to create OpenGL rendering context."); + } + window->renderCtx = window->ctx; +#if !defined(_WIN32) && !defined(__OS2PM__) + window->isDirect = glXIsDirect(__glutDisplay, window->ctx); + if (__glutForceDirect) { + if (!window->isDirect) + __glutFatalError("direct rendering not possible."); + } +#endif + + window->parent = parent; + if (parent) { + window->siblings = parent->children; + parent->children = window; + } else { + window->siblings = NULL; + } + window->overlay = NULL; + window->children = NULL; + window->display = __glutDefaultDisplay; + window->reshape = __glutDefaultReshape; + window->mouse = NULL; + window->motion = NULL; + window->passive = NULL; + window->entry = NULL; + window->keyboard = NULL; + window->keyboardUp = NULL; + window->windowStatus = NULL; + window->visibility = NULL; + window->special = NULL; + window->specialUp = NULL; + window->buttonBox = NULL; + window->dials = NULL; + window->spaceMotion = NULL; + window->spaceRotate = NULL; + window->spaceButton = NULL; + window->tabletMotion = NULL; + window->tabletButton = NULL; +#ifdef _WIN32 + window->joystick = NULL; + window->joyPollInterval = 0; +#endif + +#if defined(__OS2PM__) + window->wm_command = NULL; +#endif + + window->tabletPos[0] = -1; + window->tabletPos[1] = -1; +#if defined(__OS2PM__) + if(window->shownState == -1) + window->shownState = 0; + window->visState = window->shownState; +#else + window->shownState = 0; + window->visState = -1; /* not VisibilityUnobscured, + VisibilityPartiallyObscured, or + VisibilityFullyObscured */ +#endif + window->entryState = -1; /* not EnterNotify or LeaveNotify */ + + window->desiredConfMask = 0; + window->buttonUses = 0; + window->cursor = GLUT_CURSOR_INHERIT; + + /* Setup window to be mapped when glutMainLoop starts. */ + window->workMask = GLUT_MAP_WORK; +#ifdef _WIN32 + if (gameMode) { + /* When mapping a game mode window, just show + the window. We have already created the game + mode window with a maximize flag at creation + time. Doing a ShowWindow(window->win, SW_SHOWNORMAL) + would be wrong for a game mode window since it + would unmaximize the window. */ + window->desiredMapState = GameModeState; + } else { + window->desiredMapState = NormalState; + } +#else + window->desiredMapState = NormalState; +#endif + window->prevWorkWin = __glutWindowWorkList; + __glutWindowWorkList = window; + + /* Initially, no menus attached. */ + for (i = 0; i < GLUT_MAX_MENUS; i++) { + window->menu[i] = 0; + } + + /* Add this new window to the window list. */ + __glutWindowList[winnum] = window; + + /* Make the new window the current window. */ + __glutSetWindow(window); + + __glutDetermineMesaSwapHackSupport(); + + if (window->treatAsSingle) { + /* We do this because either the window really is single + buffered (in which case this is redundant, but harmless, + because this is the initial single-buffered context + state); or we are treating a double buffered window as a + single-buffered window because the system does not appear + to export any suitable single- buffered visuals (in which + the following are necessary). */ + glDrawBuffer(GL_FRONT); + glReadBuffer(GL_FRONT); + } + return window; +} + +/* CENTRY */ +int GLUTAPIENTRY +glutCreateWindow(const char *title) +{ + static int firstWindow = 1; + GLUTwindow *window; +#if !defined(_WIN32) && !defined(__OS2__) + XWMHints *wmHints; +#endif + Window win; + XTextProperty textprop; + + if (__glutGameModeWindow) { + __glutFatalError("cannot create windows in game mode."); + } + window = __glutCreateWindow(NULL, + __glutSizeHints.x, __glutSizeHints.y, + __glutInitWidth, __glutInitHeight, + /* not game mode */ 0); + win = window->win; + /* Setup ICCCM properties. */ + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); +#if defined(__OS2__) + WinSetWindowText(window->frame, (PCSZ)title); + if (__glutIconic) { + window->desiredMapState = IconicState; + } +#elif defined(_WIN32) + SetWindowText(win, title); + if (__glutIconic) { + window->desiredMapState = IconicState; + } +#else + wmHints = XAllocWMHints(); + wmHints->initial_state = + __glutIconic ? IconicState : NormalState; + wmHints->flags = StateHint; + XSetWMProperties(__glutDisplay, win, &textprop, &textprop, + /* Only put WM_COMMAND property on first window. */ + firstWindow ? __glutArgv : NULL, + firstWindow ? __glutArgc : 0, + &__glutSizeHints, wmHints, NULL); + XFree(wmHints); + XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); +#endif + firstWindow = 0; + return window->num + 1; +} + +#ifdef _WIN32 +int GLUTAPIENTRY +__glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)) +{ + __glutExitFunc = exitfunc; + return glutCreateWindow(title); +} +#endif + +int GLUTAPIENTRY +glutCreateSubWindow(int win, int x, int y, int width, int height) +{ + GLUTwindow *window; + + window = __glutCreateWindow(__glutWindowList[win - 1], + x, y, width, height, /* not game mode */ 0); +#if !defined(_WIN32) && !defined(__OS2__) + { + GLUTwindow *toplevel; + + toplevel = __glutToplevelOf(window); + if (toplevel->cmap != window->cmap) { + __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); + } + } +#endif + return window->num + 1; +} +/* ENDCENTRY */ + +void +__glutDestroyWindow(GLUTwindow * window, + GLUTwindow * initialWindow) +{ + GLUTwindow **prev, *cur, *parent, *siblings; + + /* Recursively destroy any children. */ + cur = window->children; + while (cur) { + siblings = cur->siblings; + __glutDestroyWindow(cur, initialWindow); + cur = siblings; + } + /* Remove from parent's children list (only necessary for + non-initial windows and subwindows!). */ + parent = window->parent; + if (parent && parent == initialWindow->parent) { + prev = &parent->children; + cur = parent->children; + while (cur) { + if (cur == window) { + *prev = cur->siblings; + break; + } + prev = &(cur->siblings); + cur = cur->siblings; + } + } + /* Unbind if bound to this window. */ + if (window == __glutCurrentWindow) { + UNMAKE_CURRENT(); + __glutCurrentWindow = NULL; + } + /* Begin tearing down window itself. */ + if (window->overlay) { + __glutFreeOverlayFunc(window->overlay); + } + XDestroyWindow(__glutDisplay, window->win); + glXDestroyContext(__glutDisplay, window->ctx); + if (window->colormap) { + /* Only color index windows have colormap data structure. */ + __glutFreeColormap(window->colormap); + } + /* NULLing the __glutWindowList helps detect is a window + instance has been destroyed, given a window number. */ + __glutWindowList[window->num] = NULL; + + /* Cleanup data structures that might contain window. */ + cleanWindowWorkList(window); +#if !defined(_WIN32) && !defined(__OS2__) + cleanStaleWindowList(window); +#endif + /* Remove window from the "get window cache" if it is there. */ + if (__glutWindowCache == window) + __glutWindowCache = NULL; + + if (window->visAlloced) { + /* Only free XVisualInfo* gotten from glXChooseVisual. */ + XFree(window->vis); + } + + if (window == __glutGameModeWindow) { + /* Destroying the game mode window should implicitly + have GLUT leave game mode. */ + __glutCloseDownGameMode(); + } + + free(window); +} + +/* CENTRY */ +void GLUTAPIENTRY +glutDestroyWindow(int win) +{ + GLUTwindow *window = __glutWindowList[win - 1]; + + if (__glutMappedMenu && __glutMenuWindow == window) { + __glutFatalUsage("destroying menu window not allowed while menus in use"); + } +#if !defined(_WIN32) && !defined(__OS2__) + /* If not a toplevel window... */ + if (window->parent) { + /* Destroying subwindows may change colormap requirements; + recalculate toplevel window's WM_COLORMAP_WINDOWS + property. */ + __glutPutOnWorkList(__glutToplevelOf(window->parent), + GLUT_COLORMAP_WORK); + } +#endif + __glutDestroyWindow(window, window); + XFlush(__glutDisplay); +} +/* ENDCENTRY */ + +void +__glutChangeWindowEventMask(long eventMask, Bool add) +{ + if (add) { + /* Add eventMask to window's event mask. */ + if ((__glutCurrentWindow->eventMask & eventMask) != + eventMask) { + __glutCurrentWindow->eventMask |= eventMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_EVENT_MASK_WORK); + } + } else { + /* Remove eventMask from window's event mask. */ + if (__glutCurrentWindow->eventMask & eventMask) { + __glutCurrentWindow->eventMask &= ~eventMask; + __glutPutOnWorkList(__glutCurrentWindow, + GLUT_EVENT_MASK_WORK); + } + } +} + +void GLUTAPIENTRY +glutDisplayFunc(GLUTdisplayCB displayFunc) +{ + /* XXX Remove the warning after GLUT 3.0. */ + if (!displayFunc) + __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code."); + __glutCurrentWindow->display = displayFunc; +} + +void GLUTAPIENTRY +glutMouseFunc(GLUTmouseCB mouseFunc) +{ + if (__glutCurrentWindow->mouse) { + if (!mouseFunc) { + /* Previous mouseFunc being disabled. */ + __glutCurrentWindow->buttonUses--; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, + __glutCurrentWindow->buttonUses > 0); + } + } else { + if (mouseFunc) { + /* Previously no mouseFunc, new one being installed. */ + __glutCurrentWindow->buttonUses++; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, True); + } + } + __glutCurrentWindow->mouse = mouseFunc; +} + +void GLUTAPIENTRY +glutMotionFunc(GLUTmotionCB motionFunc) +{ + /* Hack. Some window managers (4Dwm by default) will mask + motion events if the client is not selecting for button + press and release events. So we select for press and + release events too (being careful to use reference + counting). */ + if (__glutCurrentWindow->motion) { + if (!motionFunc) { + /* previous mouseFunc being disabled */ + __glutCurrentWindow->buttonUses--; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, + __glutCurrentWindow->buttonUses > 0); + } + } else { + if (motionFunc) { + /* Previously no mouseFunc, new one being installed. */ + __glutCurrentWindow->buttonUses++; + __glutChangeWindowEventMask( + ButtonPressMask | ButtonReleaseMask, True); + } + } + /* Real work of selecting for passive mouse motion. */ + __glutChangeWindowEventMask( + Button1MotionMask | Button2MotionMask | Button3MotionMask, + motionFunc != NULL); + __glutCurrentWindow->motion = motionFunc; +} + +void GLUTAPIENTRY +glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc) +{ + __glutChangeWindowEventMask(PointerMotionMask, + passiveMotionFunc != NULL); + + /* Passive motion also requires watching enters and leaves so + that a fake passive motion event can be generated on an + enter. */ + __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask, + __glutCurrentWindow->entry != NULL || passiveMotionFunc != NULL); + + __glutCurrentWindow->passive = passiveMotionFunc; +} + +void GLUTAPIENTRY +glutEntryFunc(GLUTentryCB entryFunc) +{ + __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask, + entryFunc != NULL || __glutCurrentWindow->passive); + __glutCurrentWindow->entry = entryFunc; + if (!entryFunc) { + __glutCurrentWindow->entryState = -1; + } +} + +void GLUTAPIENTRY +glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc) +{ + __glutChangeWindowEventMask(VisibilityChangeMask, + windowStatusFunc != NULL); + __glutCurrentWindow->windowStatus = windowStatusFunc; + if (!windowStatusFunc) { + /* Make state invalid. */ + __glutCurrentWindow->visState = -1; + } +} + +static void GLUTCALLBACK +visibilityHelper(int status) +{ + if (status == GLUT_HIDDEN || status == GLUT_FULLY_COVERED) + __glutCurrentWindow->visibility(GLUT_NOT_VISIBLE); + else + __glutCurrentWindow->visibility(GLUT_VISIBLE); +} + + +void GLUTAPIENTRY +glutVisibilityFunc(GLUTvisibilityCB visibilityFunc) +{ + __glutCurrentWindow->visibility = visibilityFunc; + + if (visibilityFunc) + { glutWindowStatusFunc(visibilityHelper); +#if defined(__OS2PM__) + if(__glutCurrentWindow->shownState >= 0) + { visibilityHelper(__glutCurrentWindow->shownState); + } +#endif + } + else + glutWindowStatusFunc(NULL); +} + +void GLUTAPIENTRY +glutReshapeFunc(GLUTreshapeCB reshapeFunc) +{ + if (reshapeFunc) { + __glutCurrentWindow->reshape = reshapeFunc; + } else { + __glutCurrentWindow->reshape = __glutDefaultReshape; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/glut_winmisc.cpp xpsb-glx-0.19/mesa/src/glut/os2/glut_winmisc.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/glut_winmisc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/glut_winmisc.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,126 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + + +#include +#include +#include +#include + + +#include "glutint.h" + +/* CENTRY */ +void GLUTAPIENTRY +glutSetWindowTitle(const char *title) +{ +#if defined(__OS2PM__) + __glutSetWindowText(__glutCurrentWindow->win, (char *)title); + +#else + XTextProperty textprop; + + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); + XSetWMName(__glutDisplay, + __glutCurrentWindow->win, &textprop); + XFlush(__glutDisplay); +#endif +} + +void GLUTAPIENTRY +glutSetIconTitle(const char *title) +{ +#if defined(__OS2PM__) +//todo ? +#else + + XTextProperty textprop; + + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); + XSetWMIconName(__glutDisplay, + __glutCurrentWindow->win, &textprop); + XFlush(__glutDisplay); +#endif +} + +void GLUTAPIENTRY +glutPositionWindow(int x, int y) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredX = x; + __glutCurrentWindow->desiredY = y; + __glutCurrentWindow->desiredConfMask |= CWX | CWY; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutReshapeWindow(int w, int h) +{ + IGNORE_IN_GAME_MODE(); + if (w <= 0 || h <= 0) + __glutWarning("glutReshapeWindow: non-positive width or height not allowed"); + + __glutCurrentWindow->desiredWidth = w; + __glutCurrentWindow->desiredHeight = h; + __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutPopWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredStack = Above; + __glutCurrentWindow->desiredConfMask |= CWStackMode; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutPushWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredStack = Below; + __glutCurrentWindow->desiredConfMask |= CWStackMode; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void GLUTAPIENTRY +glutIconifyWindow(void) +{ + IGNORE_IN_GAME_MODE(); + assert(!__glutCurrentWindow->parent); + __glutCurrentWindow->desiredMapState = IconicState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +void GLUTAPIENTRY +glutShowWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredMapState = NormalState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +void GLUTAPIENTRY +glutHideWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredMapState = WithdrawnState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +/* ENDCENTRY */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/layerutil.h xpsb-glx-0.19/mesa/src/glut/os2/layerutil.h --- xpsb-glx-0.19/mesa/src/glut/os2/layerutil.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/layerutil.h 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,59 @@ +#ifndef __layerutil_h__ +#define __layerutil_h__ + +/* Copyright (c) Mark J. Kilgard, 1993, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* Based on XLayerUtil.h: Revision: 1.3 */ + +#ifdef __VMS +#include +#endif + +#if !defined(_WIN32) && !defined(__OS2__) +#include +#include +#include +#endif /* !_WIN32 */ + +/* Transparent type values */ +/* None 0 */ +#define TransparentPixel 1 +#define TransparentMask 2 + +/* layered visual info template flags */ +#define VisualLayerMask 0x200 +#define VisualTransparentType 0x400 +#define VisualTransparentValue 0x800 +#define VisualAllLayerMask 0xFFF + +/* layered visual info structure */ +typedef struct _XLayerVisualInfo { + XVisualInfo vinfo; + long layer; + long type; + unsigned long value; +} XLayerVisualInfo; + +/* SERVER_OVERLAY_VISUALS property element */ +typedef struct _OverlayInfo { + /* Avoid 64-bit portability problems by being careful to use + longs due to the way XGetWindowProperty is specified. Note + that these parameters are passed as CARD32s over X + protocol. */ + long overlay_visual; + long transparent_type; + long value; + long layer; +} OverlayInfo; + +extern int __glutGetTransparentPixel(Display *, XVisualInfo *); +extern XLayerVisualInfo *__glutXGetLayerVisualInfo(Display *, + long, XLayerVisualInfo *, int *); +extern Status __glutXMatchLayerVisualInfo(Display *, + int, int, int, int, XLayerVisualInfo *); + +#endif /* __layerutil_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/libGlut.DEF xpsb-glx-0.19/mesa/src/glut/os2/libGlut.DEF --- xpsb-glx-0.19/mesa/src/glut/os2/libGlut.DEF 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/libGlut.DEF 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,94 @@ + +;----------------------------------------------------- +; def Module definition file for the DLL +;----------------------------------------------------- + +LIBRARY libGlut INITINSTANCE TERMINSTANCE +PROTMODE +DATA MULTIPLE NONSHARED READWRITE LOADONCALL +CODE LOADONCALL +EXPORTS ; Names of exported functions and data + +;********************************* +;MesaGLUT + glutCommandFunc @3001 + glutCreateWindow @3002 + glutCreateSubWindow @3003 + glutDestroyWindow @3004 + glutDisplayFunc @3005 + glutEntryFunc @3006 + glutExtensionSupported @3007 + glutIdleFunc @3008 + glutInit @3009 + glutInitDisplayMode @3010 + glutInitWindowPosition @3011 + glutInitWindowSize @3012 + glutMainLoop @3013 + glutGet @3014 + glutGetColor @3015 + glutGetWindow @3016 + glutKeyboardFunc @3017 + glutMouseFunc @3018 + glutSpecialFunc @3019 + glutStrokeCharacter @3020 + glutSetColor @3021 + glutSetIconTitle @3022 + glutSetWindow @3023 + glutSetWindowTitle @3024 + + glutReshapeFunc @3025 + glutReshapeWindow @3026 + + + glutSwapBuffers @3027 + glutPostRedisplay @3028 + glutPositionWindow @3029 + glutVisibilityFunc @3030 + glutTimerFunc @3031 + glutMotionFunc @3032 + + glutCreateMenu @3033 + glutAttachMenu @3034 + glutDestroyMenu @3035 + glutAddMenuEntry @3036 + glutPassiveMotionFunc @3037 + + glutSolidCone @3038 + glutSolidCube @3039 + glutSolidDodecahedron @3040 + glutSolidOctahedron @3041 + glutSolidIcosahedron @3042 + glutSolidSphere @3043 + glutSolidTeapot @3044 + glutSolidTetrahedron @3045 + glutSolidTorus @3046 + + glutWireCone @3047 + glutWireCube @3048 + glutWireDodecahedron @3049 + glutWireIcosahedron @3050 + glutWireOctahedron @3051 + glutWireSphere @3052 + glutWireTetrahedron @3053 + glutWireTorus @3054 + glutWireTeapot @3055 + +;GL_GLEXT_PROTOTYPES + glutBitmapCharacter @3101 + glutBitmap9By15 @3102 + glutBitmapHelvetica10 @3103 + glutBitmapHelvetica12 @3104 + glutBitmapHelvetica18 @3105 + glutBitmapTimesRoman24 @3106 + glutStrokeRoman @3107 + glutBitmap8By13 @3108 + +;Global constants +; hab @12001 +; /* PM anchor block handle */ +; hpsCurrent @12002 + XHDC @12004 + XHWND @12005 + + + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/Makefile xpsb-glx-0.19/mesa/src/glut/os2/Makefile --- xpsb-glx-0.19/mesa/src/glut/os2/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/Makefile 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,420 @@ +# Makefile +# Created by IBM WorkFrame/2 MakeMake at 12:46:25 on 3 June 2003 +# +# The actions included in this make file are: +# Compile::C++ Compiler +# Link::Linker +# Lib::Import Lib + +.SUFFIXES: + +.SUFFIXES: \ + .LIB .cpp .dll .obj + +.cpp.obj: + @echo " Compile::C++ Compiler " + icc.exe /I..\ /I..\X86 /I..\GL /I..\swrast /I..\swrast_setup /Ss /Wcmpcndcnscnvcpydclenuextgeninilanobsordparporppcprorearettrdtruund /Tx /O /Gm /Ge- /G5 /Gf /Gi /Oi /C %s + +{G:\EVGEN\MESA5\src-glut.os2pm}.cpp.obj: + @echo " Compile::C++ Compiler " + icc.exe /I..\ /I..\X86 /I..\GL /I..\swrast /I..\swrast_setup /Ss /Wcmpcndcnscnvcpydclenuextgeninilanobsordparporppcprorearettrdtruund /Tx /O /Gm /Ge- /G5 /Gf /Gi /Oi /C %s + +.dll.LIB: + @echo " Lib::Import Lib " + implib.exe %|dpfF.LIB %s + +{G:\EVGEN\MESA5\src-glut.os2pm}.dll.LIB: + @echo " Lib::Import Lib " + implib.exe %|dpfF.LIB %s + +all: \ + .\libGlut.LIB + +.\libGlut.dll: \ + .\os2_winproc.obj \ + .\WarpWin.obj \ + .\glutOverlay.obj \ + .\glut_8x13.obj \ + .\glut_9x15.obj \ + .\glut_bitmap.obj \ + .\glut_cindex.obj \ + .\glut_cmap.obj \ + .\glut_cursor.obj \ + .\glut_event.obj \ + .\glut_ext.obj \ + .\glut_fullscrn.obj \ + .\glut_gamemode.obj \ + .\glut_get.obj \ + .\glut_hel10.obj \ + .\glut_hel12.obj \ + .\glut_hel18.obj \ + .\glut_init.obj \ + .\glut_input.obj \ + .\glut_key.obj \ + .\glut_keyctrl.obj \ + .\glut_keyup.obj \ + .\glut_mesa.obj \ + .\glut_modifier.obj \ + .\glut_roman.obj \ + .\glut_shapes.obj \ + .\glut_stroke.obj \ + .\glut_swap.obj \ + .\glut_teapot.obj \ + .\glut_tr24.obj \ + .\glut_util.obj \ + .\glut_vidresize.obj \ + .\glut_warp.obj \ + .\glut_win.obj \ + .\glut_winmisc.obj \ + .\os2_glx.obj \ + .\os2_menu.obj \ + ..\si-glu\libGLU.lib \ + ..\MesaDll\MesaGL2.lib \ + ..\drv\DrvLoad\MesaDrvLoad.lib \ + {$(LIB)}libGlut.DEF + @echo " Link::Linker " + icc.exe @<< + /B" /dbgpack /exepack:2 /st:200000 /packd /optfunc" + /FelibGlut.dll + ..\si-glu\libGLU.lib + ..\MesaDll\MesaGL2.lib + ..\drv\DrvLoad\MesaDrvLoad.lib + libGlut.DEF + .\os2_winproc.obj + .\WarpWin.obj + .\glutOverlay.obj + .\glut_8x13.obj + .\glut_9x15.obj + .\glut_bitmap.obj + .\glut_cindex.obj + .\glut_cmap.obj + .\glut_cursor.obj + .\glut_event.obj + .\glut_ext.obj + .\glut_fullscrn.obj + .\glut_gamemode.obj + .\glut_get.obj + .\glut_hel10.obj + .\glut_hel12.obj + .\glut_hel18.obj + .\glut_init.obj + .\glut_input.obj + .\glut_key.obj + .\glut_keyctrl.obj + .\glut_keyup.obj + .\glut_mesa.obj + .\glut_modifier.obj + .\glut_roman.obj + .\glut_shapes.obj + .\glut_stroke.obj + .\glut_swap.obj + .\glut_teapot.obj + .\glut_tr24.obj + .\glut_util.obj + .\glut_vidresize.obj + .\glut_warp.obj + .\glut_win.obj + .\glut_winmisc.obj + .\os2_glx.obj + .\os2_menu.obj +<< + +.\os2_winproc.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\os2_winproc.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \ + gl\os2mesa.h \ + gl\gl.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2mesadef.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}context.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glapi.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}mtypes.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glheader.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}config.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glapitable.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glthread.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}math/m_matrix.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}Trace/tr_context.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}dd.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}conf.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_config.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/glext.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}Xthreads.h + +.\os2_menu.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\os2_menu.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\os2_glx.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\os2_glx.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + gl\os2mesa.h \ + gl\gl.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h + +.\glut_winmisc.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_winmisc.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_win.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_win.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutos2.h \ + gl\os2mesa.h \ + gl\gl.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h + +.\glut_warp.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_warp.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_vidresize.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_vidresize.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_util.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_util.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_tr24.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_tr24.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h + +.\glut_teapot.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_teapot.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_swap.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_swap.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_stroke.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_stroke.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_shapes.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_shapes.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_roman.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_roman.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h + +.\glut_modifier.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_modifier.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_mesa.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_mesa.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_keyup.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_keyup.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_keyctrl.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_keyctrl.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_key.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_key.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_input.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_input.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_init.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_init.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_hel18.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_hel18.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h + +.\glut_hel12.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_hel12.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h + +.\glut_hel10.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_hel10.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h + +.\glut_get.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_get.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_gamemode.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_gamemode.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_fullscrn.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_fullscrn.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_ext.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_ext.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_event.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_event.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_cursor.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_cursor.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_cmap.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_cmap.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}layerutil.h + +.\glut_cindex.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_cindex.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_bitmap.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_bitmap.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\glut_9x15.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_9x15.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h + +.\glut_8x13.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glut_8x13.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h + +.\glutOverlay.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\glutOverlay.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h + +.\WarpWin.obj: \ + G:\EVGEN\MESA5\src-glut.os2pm\WarpWin.cpp \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpWin.h \ + {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h + +.\libGlut.LIB: \ + .\libGlut.dll diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/os2_glx.cpp xpsb-glx-0.19/mesa/src/glut/os2/os2_glx.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/os2_glx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/os2_glx.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,145 @@ +/* os2_glx.c */ + +#include +#include +#include +#include "gl/gl.h" +#include "WarpGL.h" +#include "GL/os2mesa.h" + +#define POKA 0 +/* global current HDC */ + +XVisualInfo *wglDescribePixelFormat(int iPixelFormat); + +extern HDC XHDC; +extern HWND XHWND; +//extern HPS hpsCurrent; +extern HAB hab; /* PM anchor block handle */ + +GLXContext +glXCreateContext(HPS hps, XVisualInfo * visinfo, + GLXContext share, Bool direct) +{ + /* KLUDGE: GLX really expects a display pointer to be passed + in as the first parameter, but Win32 needs an HDC instead, + so BE SURE that the global XHDC is set before calling this + routine. */ + HGLRC context; + + context = wglCreateContext(XHDC,hps,hab); + + + /* Since direct rendering is implicit, the direct flag is + ignored. */ + + return context; +} + + +int +glXGetConfig(XVisualInfo * visual, int attrib, int *value) +{ + if (!visual) + return GLX_BAD_VISUAL; + + switch (attrib) { + case GLX_USE_GL: + if (visual->dwFlags & (PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW)) { + /* XXX Brad's Matrix Millenium II has problems creating + color index windows in 24-bit mode (lead to GDI crash) + and 32-bit mode (lead to black window). The cColorBits + filed of the PIXELFORMATDESCRIPTOR returned claims to + have 24 and 32 bits respectively of color indices. 2^24 + and 2^32 are ridiculously huge writable colormaps. + Assume that if we get back a color index + PIXELFORMATDESCRIPTOR with 24 or more bits, the + PIXELFORMATDESCRIPTOR doesn't really work and skip it. + -mjk */ + if (visual->iPixelType == PFD_TYPE_COLORINDEX + && visual->cColorBits >= 24) { + *value = 0; + } else { + *value = 1; + } + } else { + *value = 0; + } + break; + case GLX_BUFFER_SIZE: + /* KLUDGE: if we're RGBA, return the number of bits/pixel, + otherwise, return 8 (we guessed at 256 colors in CI + mode). */ + if (visual->iPixelType == PFD_TYPE_RGBA) + *value = visual->cColorBits; + else + *value = 8; + break; + case GLX_LEVEL: + /* The bReserved flag of the pfd contains the + overlay/underlay info. */ + *value = visual->bReserved; + break; + case GLX_RGBA: + *value = visual->iPixelType == PFD_TYPE_RGBA; + break; + case GLX_DOUBLEBUFFER: + *value = visual->dwFlags & PFD_DOUBLEBUFFER; + break; + case GLX_STEREO: + *value = visual->dwFlags & PFD_STEREO; + break; + case GLX_AUX_BUFFERS: + *value = visual->cAuxBuffers; + break; + case GLX_RED_SIZE: + *value = visual->cRedBits; + break; + case GLX_GREEN_SIZE: + *value = visual->cGreenBits; + break; + case GLX_BLUE_SIZE: + *value = visual->cBlueBits; + break; + case GLX_ALPHA_SIZE: + *value = visual->cAlphaBits; + break; + case GLX_DEPTH_SIZE: + *value = visual->cDepthBits; + break; + case GLX_STENCIL_SIZE: + *value = visual->cStencilBits; + break; + case GLX_ACCUM_RED_SIZE: + *value = visual->cAccumRedBits; + break; + case GLX_ACCUM_GREEN_SIZE: + *value = visual->cAccumGreenBits; + break; + case GLX_ACCUM_BLUE_SIZE: + *value = visual->cAccumBlueBits; + break; + case GLX_ACCUM_ALPHA_SIZE: + *value = visual->cAccumAlphaBits; + break; +#if POKA == 100 +#endif /* POKA == 100 */ + default: + return GLX_BAD_ATTRIB; + } + return 0; +} + + +XVisualInfo * glXChooseVisual(int mode) +{ int imode = 2; + if(mode & GLUT_DOUBLE) + imode = 1; + return + wglDescribePixelFormat(imode); +} + + +#if POKA +#endif /* POKA */ + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/os2_menu.cpp xpsb-glx-0.19/mesa/src/glut/os2/os2_menu.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/os2_menu.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/os2_menu.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,532 @@ + +/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* This file completely re-implements glut_menu.c and glut_menu2.c + for Win32. Note that neither glut_menu.c nor glut_menu2.c are + compiled into Win32 GLUT. */ + +#include +#include +#include +#include +#include + +#include "glutint.h" + +void (GLUTCALLBACK *__glutMenuStatusFunc) (int, int, int); +//GLUTmenu *__glutMappedMenu; +//GLUTwindow *__glutMenuWindow; +GLUTmenuItem *__glutItemSelected; +unsigned __glutMenuButton; + +static GLUTmenu **menuList = NULL; +static int menuListSize = 0; +static UINT uniqueMenuHandler = 1; + +/* DEPRICATED, use glutMenuStatusFunc instead. */ +void GLUTAPIENTRY +glutMenuStateFunc(GLUTmenuStateCB menuStateFunc) +{ + __glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc; +} + +void GLUTAPIENTRY +glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc) +{ + __glutMenuStatusFunc = menuStatusFunc; +} + +void +__glutSetMenu(GLUTmenu * menu) +{ + __glutCurrentMenu = menu; +} + +static void +unmapMenu(GLUTmenu * menu) +{ + if (menu->cascade) { + unmapMenu(menu->cascade); + menu->cascade = NULL; + } + menu->anchor = NULL; + menu->highlighted = NULL; +} + +void +__glutFinishMenu(Window win, int x, int y) +{ + + unmapMenu(__glutMappedMenu); + + /* XXX Put in a GdiFlush just in case. Probably unnecessary. -mjk */ +// GdiFlush(); + + if (__glutMenuStatusFunc) { + __glutSetWindow(__glutMenuWindow); + __glutSetMenu(__glutMappedMenu); + + /* Setting __glutMappedMenu to NULL permits operations that + change menus or destroy the menu window again. */ + __glutMappedMenu = NULL; + + __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y); + } + /* Setting __glutMappedMenu to NULL permits operations that + change menus or destroy the menu window again. */ + __glutMappedMenu = NULL; + + /* If an item is selected and it is not a submenu trigger, + generate menu callback. */ + if (__glutItemSelected && !__glutItemSelected->isTrigger) { + __glutSetWindow(__glutMenuWindow); + /* When menu callback is triggered, current menu should be + set to the callback menu. */ + __glutSetMenu(__glutItemSelected->menu); + __glutItemSelected->menu->select(__glutItemSelected->value); + } + __glutMenuWindow = NULL; +} + +static void +mapMenu(GLUTmenu * menu, int x, int y) +{ +//todo +// TrackPopupMenu((HMENU) menu->win, TPM_LEFTALIGN | +// (__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON, +// x, y, 0, __glutCurrentWindow->win, NULL); +} + +void +__glutStartMenu(GLUTmenu * menu, GLUTwindow * window, + int x, int y, int x_win, int y_win) +{ + assert(__glutMappedMenu == NULL); + __glutMappedMenu = menu; + __glutMenuWindow = window; + __glutItemSelected = NULL; + if (__glutMenuStatusFunc) { + __glutSetMenu(menu); + __glutSetWindow(window); + __glutMenuStatusFunc(GLUT_MENU_IN_USE, x_win, y_win); + } + mapMenu(menu, x, y); +} + +GLUTmenuItem * +__glutGetUniqueMenuItem(GLUTmenu * menu, UINT unique) +{ + GLUTmenuItem *item; + int i; + + i = menu->num; + item = menu->list; + while (item) { + if (item->unique == unique) { + return item; + } + if (item->isTrigger) { + GLUTmenuItem *subitem; + subitem = __glutGetUniqueMenuItem(menuList[item->value], unique); + if (subitem) { + return subitem; + } + } + i--; + item = item->next; + } + return NULL; +} + +GLUTmenuItem * +__glutGetMenuItem(GLUTmenu * menu, Window win, int *which) +{ + GLUTmenuItem *item; + int i; + + i = menu->num; + item = menu->list; + while (item) { + if (item->win == win) { + *which = i; + return item; + } + if (item->isTrigger) { + GLUTmenuItem *subitem; + + subitem = __glutGetMenuItem(menuList[item->value], + win, which); + if (subitem) { + return subitem; + } + } + i--; + item = item->next; + } + return NULL; +} + +GLUTmenu * +__glutGetMenu(Window win) +{ + GLUTmenu *menu; + + menu = __glutMappedMenu; + while (menu) { + if (win == menu->win) { + return menu; + } + menu = menu->cascade; + } + return NULL; +} + +GLUTmenu * +__glutGetMenuByNum(int menunum) +{ + if (menunum < 1 || menunum > menuListSize) { + return NULL; + } + return menuList[menunum - 1]; +} + +static int +getUnusedMenuSlot(void) +{ + int i; + + /* Look for allocated, unused slot. */ + for (i = 0; i < menuListSize; i++) { + if (!menuList[i]) { + return i; + } + } + /* Allocate a new slot. */ + menuListSize++; + if (menuList) { + menuList = (GLUTmenu **) + realloc(menuList, menuListSize * sizeof(GLUTmenu *)); + } else { + /* XXX Some realloc's do not correctly perform a malloc + when asked to perform a realloc on a NULL pointer, + though the ANSI C library spec requires this. */ + menuList = (GLUTmenu **) malloc(sizeof(GLUTmenu *)); + } + if (!menuList) { + __glutFatalError("out of memory."); + } + menuList[menuListSize - 1] = NULL; + return menuListSize - 1; +} + +static void +menuModificationError(void) +{ + /* XXX Remove the warning after GLUT 3.0. */ + __glutWarning("The following is a new check for GLUT 3.0; update your code."); + __glutFatalError("menu manipulation not allowed while menus in use."); +} + +int GLUTAPIENTRY +glutCreateMenu(GLUTselectCB selectFunc) +{ + GLUTmenu *menu; + int menuid; + + if (__glutMappedMenu) { + menuModificationError(); + } + menuid = getUnusedMenuSlot(); + menu = (GLUTmenu *) malloc(sizeof(GLUTmenu)); + if (!menu) { + __glutFatalError("out of memory."); + } + menu->id = menuid; + menu->num = 0; + menu->submenus = 0; + menu->select = selectFunc; + menu->list = NULL; + menu->cascade = NULL; + menu->highlighted = NULL; + menu->anchor = NULL; +//todo +// menu->win = (HWND) CreatePopupMenu(); + menuList[menuid] = menu; + __glutSetMenu(menu); + return menuid + 1; +} + + +void GLUTAPIENTRY +glutDestroyMenu(int menunum) +{ + GLUTmenu *menu = __glutGetMenuByNum(menunum); + GLUTmenuItem *item, *next; + + if (__glutMappedMenu) { + menuModificationError(); + } + assert(menu->id == menunum - 1); +//todo DestroyMenu( (HMENU) menu->win); + menuList[menunum - 1] = NULL; + /* free all menu entries */ + item = menu->list; + while (item) { + assert(item->menu == menu); + next = item->next; + free(item->label); + free(item); + item = next; + } + if (__glutCurrentMenu == menu) { + __glutCurrentMenu = NULL; + } + free(menu); +} + +int GLUTAPIENTRY +glutGetMenu(void) +{ + if (__glutCurrentMenu) { + return __glutCurrentMenu->id + 1; + } else { + return 0; + } +} + +void GLUTAPIENTRY +glutSetMenu(int menuid) +{ + GLUTmenu *menu; + + if (menuid < 1 || menuid > menuListSize) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + menu = menuList[menuid - 1]; + if (!menu) { + __glutWarning("glutSetMenu attempted on bogus menu."); + return; + } + __glutSetMenu(menu); +} + +static void +setMenuItem(GLUTmenuItem * item, const char *label, + int value, Bool isTrigger) +{ + GLUTmenu *menu; + + menu = item->menu; + item->label = __glutStrdup(label); + if (!item->label) { + __glutFatalError("out of memory."); + } + item->isTrigger = isTrigger; + item->len = (int) strlen(label); + item->value = value; + item->unique = uniqueMenuHandler++; +//todo +// if (isTrigger) { +// AppendMenu((HMENU) menu->win, MF_POPUP, (UINT)item->win, label); +// } else { +// AppendMenu((HMENU) menu->win, MF_STRING, item->unique, label); +// } +} + +void GLUTAPIENTRY +glutAddMenuEntry(const char *label, int value) +{ + GLUTmenuItem *entry; + + if (__glutMappedMenu) { + menuModificationError(); + } + entry = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); + if (!entry) { + __glutFatalError("out of memory."); + } + entry->menu = __glutCurrentMenu; + setMenuItem(entry, label, value, FALSE); + __glutCurrentMenu->num++; + entry->next = __glutCurrentMenu->list; + __glutCurrentMenu->list = entry; +} + +void GLUTAPIENTRY +glutAddSubMenu(const char *label, int menu) +{ + GLUTmenuItem *submenu; + GLUTmenu *popupmenu; + + if (__glutMappedMenu) { + menuModificationError(); + } + submenu = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); + if (!submenu) { + __glutFatalError("out of memory."); + } + __glutCurrentMenu->submenus++; + submenu->menu = __glutCurrentMenu; + popupmenu = __glutGetMenuByNum(menu); + if (popupmenu) { + submenu->win = popupmenu->win; + } + setMenuItem(submenu, label, /* base 0 */ menu - 1, TRUE); + __glutCurrentMenu->num++; + submenu->next = __glutCurrentMenu->list; + __glutCurrentMenu->list = submenu; +} + +void GLUTAPIENTRY +glutChangeToMenuEntry(int num, const char *label, int value) +{ + GLUTmenuItem *item; + int i; + + if (__glutMappedMenu) { + menuModificationError(); + } + i = __glutCurrentMenu->num; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + if (item->isTrigger) { + /* If changing a submenu trigger to a menu entry, we + need to account for submenus. */ + item->menu->submenus--; + /* Nuke the Win32 menu. */ +//todo +// DestroyMenu((HMENU) item->win); + } + free(item->label); + + item->label = strdup(label); + if (!item->label) + __glutFatalError("out of memory"); + item->isTrigger = FALSE; + item->len = (int) strlen(label); + item->value = value; + item->unique = uniqueMenuHandler++; +//todo +// ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, +// MF_BYPOSITION | MFT_STRING, item->unique, label); + + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutChangeToSubMenu(int num, const char *label, int menu) +{ + GLUTmenu *popupmenu; + GLUTmenuItem *item; + int i; + + if (__glutMappedMenu) { + menuModificationError(); + } + i = __glutCurrentMenu->num; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + if (!item->isTrigger) { + /* If changing a menu entry to as submenu trigger, we + need to account for submenus. */ + item->menu->submenus++; +//todo +// item->win = (HWND) CreatePopupMenu(); + } + free(item->label); + + item->label = strdup(label); + if (!item->label) + __glutFatalError("out of memory"); + item->isTrigger = TRUE; + item->len = (int) strlen(label); + item->value = menu - 1; + item->unique = uniqueMenuHandler++; + popupmenu = __glutGetMenuByNum(menu); + if (popupmenu) + item->win = popupmenu->win; +//todo +// ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, +// MF_BYPOSITION | MF_POPUP, (UINT) item->win, label); + return; + } + i--; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutRemoveMenuItem(int num) +{ + GLUTmenuItem *item, **prev; + int i; + + if (__glutMappedMenu) { + menuModificationError(); + } + i = __glutCurrentMenu->num; + prev = &__glutCurrentMenu->list; + item = __glutCurrentMenu->list; + while (item) { + if (i == num) { + /* Found the menu item in list to remove. */ + __glutCurrentMenu->num--; + + /* Patch up menu's item list. */ + *prev = item->next; +//todo +// RemoveMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, MF_BYPOSITION); + + free(item->label); + free(item); + return; + } + i--; + prev = &item->next; + item = item->next; + } + __glutWarning("Current menu has no %d item.", num); +} + +void GLUTAPIENTRY +glutAttachMenu(int button) +{ + if (__glutCurrentWindow == __glutGameModeWindow) { + __glutWarning("cannot attach menus in game mode."); + return; + } + if (__glutMappedMenu) { + menuModificationError(); + } + if (__glutCurrentWindow->menu[button] < 1) { + __glutCurrentWindow->buttonUses++; + } + __glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1; +} + +void GLUTAPIENTRY +glutDetachMenu(int button) +{ + if (__glutMappedMenu) { + menuModificationError(); + } + if (__glutCurrentWindow->menu[button] > 0) { + __glutCurrentWindow->buttonUses--; + __glutCurrentWindow->menu[button] = 0; + } +} + diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/os2_winproc.cpp xpsb-glx-0.19/mesa/src/glut/os2/os2_winproc.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/os2_winproc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/os2_winproc.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,1296 @@ +/* os2_winproc.c */ + + +#define INCL_DEV +#include "WarpGL.h" +#include "GL/os2mesa.h" + + +#define _MEERROR_H_ +#include /* It is from MMPM toolkit */ +#include +#include + + +#include "os2mesadef.h" +#include "glutint.h" + + +#define POKA 0 + +#if POKA + +extern unsigned __glutMenuButton; +extern GLUTidleCB __glutIdleFunc; +extern GLUTtimer *__glutTimerList; +extern void handleTimeouts(void); +extern GLUTmenuItem *__glutGetUniqueMenuItem(GLUTmenu * menu, int unique); +static HMENU __glutHMenu; + +#endif + +extern void _mesa_ResizeBuffersMESA( void ); + + +MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); +MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); +void updateWindowState(GLUTwindow *window, int visState); + +volatile extern HAB hab; /* PM anchor block handle */ +volatile extern HPS hpsCurrent; + +RECTL rCtls[52]; +ULONG ulNumRcls; + +MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) +{ MRESULT rc; + rc = GlutWindowProc(hwnd, msg, mp1, mp2 ); + return rc; +} + +MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) +{ + HPS hps = NULLHANDLE; /* presentation space handle */ + GLUTwindow* window; /* GLUT window associated with message. */ + GLUTmenu* menu; /* GLUT menu associated with message. */ + RECTL rclClient; + POINTL point; + int button = -1,rc,key; + + +/* Process the message. */ + + switch( msg ) + { + case WM_CREATE: + { + SIZEL sizl = { 0L, 0L }; + LONG *alCaps; + HDC hdc; + + /*+-----------------------------------------------------------------+*/ + /*| The client window is being created. Create the semaphore to |*/ + /*| control access to the presentation space. Then create the |*/ + /*| thread that will draw the lines. |*/ + /*+-----------------------------------------------------------------+*/ + // DosCreateMutexSem( (PSZ)NULL, &hmtxPS, 0UL, FALSE ); + + hdc = WinOpenWindowDC(hwnd); + + /*+-----------------------------------------------------------------+*/ + /*| Create a non-cached presentation space. We will not release |*/ + /*| this PS, as we will be Selecting a Palette to this PS and then |*/ + /*| animating the palette. Upon releasing a PS the palette is no |*/ + /*| longer selected for obvious reasons. |*/ + /*+-----------------------------------------------------------------+*/ + hpsCurrent = GpiCreatePS( hab, + hdc, + &sizl, + PU_PELS | GPIF_DEFAULT | + GPIT_MICRO | GPIA_ASSOC ); +// DevQueryCaps( hdc, lStart, lCount, alCaps ); +// fPaletteCaps = alCaps[CAPS_ADDITIONAL_GRAPHICS] & CAPS_PALETTE_MANAGER; +// PaletteInit(3); + /* ŻĄpĄ˘®¤ hpsBuffer ˘ pĄ¦¨¬ RGB color table */ + + GpiCreateLogColorTable(hpsCurrent,0 ,LCOLF_RGB,0,0,NULL); + GpiSetPattern(hpsCurrent,PATSYM_SOLID); + GpiSetPatternSet(hpsCurrent,LCID_DEFAULT); + + } + break; + + return 0; + case WM_CLOSE: + WinPostMsg( hwnd, WM_QUIT, NULL, NULL ); + + return 0; + + case WM_PAINT: + window = __glutGetWindow(hwnd); + if (window) + { + PWMC ctx; +// hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient); + hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient); + // blit Dive buffer to screen. + + { + SWP swp; // Window position + POINTL pointl; // Point to offset from Desktop + + // Convert the point to offset from desktop lower left. + pointl.x = 0; + pointl.y = 0; + WinMapWindowPoints ( hwnd, HWND_DESKTOP, &pointl, 1 ); + + +// ctx = window->ctx; +// ctx->xDiveScr = pointl.x; +// ctx->yDiveScr = pointl.y; + } +// rc = DiveBlitImage (ctx->hDive, +// ctx->ulDiveBufferNumber, +// DIVE_BUFFER_SCREEN ); +// + + if (window->win == hwnd) { + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } else if (window->overlay && window->overlay->win == hwnd) { + __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK); + } + WinEndPaint(hps); + } else { + + hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient); + WinFillRect(hps, &rclClient, CLR_WHITE); + WinEndPaint(hps); + } + break; + + case WM_VRNDISABLED: + +// pwinData->fDataInProcess = TRUE; +// DiveSetupBlitter ( pwinData->hDive, 0 ); +// pwinData->fVrnDisabled = TRUE; + break; + + case WM_VRNENABLED: + { HRGN hrgn; /* Region handle */ + RGNRECT rgnCtl; /* Processing control structure */ +// RECTL rCtls[52]; +// ULONG ulNumRcls; + +// pwinData->fDataInProcess = TRUE; + hps = WinGetPS ( hwnd ); + if ( !hps ) + break; + hrgn = GpiCreateRegion ( hps, 0L, NULL ); + if ( hrgn ) + { /* NOTE: If mp1 is zero, then this was just a move message. + ** Illustrate the visible region on a WM_VRNENABLE. + */ + WinQueryVisibleRegion ( hwnd, hrgn ); + rgnCtl.ircStart = 0; + rgnCtl.crc = 50; + rgnCtl.ulDirection = 1; + + /* Get the all ORed rectangles */ + if ( GpiQueryRegionRects ( hps, hrgn, NULL, + &rgnCtl, rCtls) ) + { + ulNumRcls = rgnCtl.crcReturned; + + /* Now find the window position and size, relative to parent. + */ +// WinQueryWindowPos ( pwinData->hwndClient, &pwinData->swp ); + +// rcl.xLeft = 0; +// rcl.yBottom = 0; + + /* Convert the point to offset from desktop lower left. + */ +// pointl.x = pwinData->swp.x; +// pointl.y = pwinData->swp.y; + +// WinMapWindowPoints ( pwinData->hwndFrame, +// HWND_DESKTOP, &pointl, 1 ); + +// pwinData->cxWindowPos = pointl.x; +// pwinData->cyWindowPos = pointl.y; + + } + GpiDestroyRegion( hps, hrgn ); + } + WinReleasePS( hps ); + + } + break; + + case WM_SIZE: + window = __glutGetWindow(hwnd); + if (window) + { int width,height; + width = SHORT1FROMMP(mp2); + height = SHORT2FROMMP(mp2); + if (width != window->width || height != window->height) { +#if 0 /* Win32 GLUT does not support overlays for now. */ + if (window->overlay) { + XResizeWindow(__glutDisplay, window->overlay->win, width, height); + } +#endif + window->width = width; + window->height = height; + __glutSetWindow(window); + if(width <= 0 || height <= 0) + break; + _mesa_ResizeBuffersMESA(); + + /* Do not execute OpenGL out of sequence with respect + to the SetWindowPos request! */ + window->reshape(width, height); + window->forceReshape = FALSE; + /* A reshape should be considered like posting a + repair request. */ + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } + } + return 0; + case WM_SHOW: + window = __glutGetWindow(hwnd); + if (window) { + int visState; + visState = SHORT1FROMMP( mp1 ); + updateWindowState(window, visState); + } + return 0; + + case WM_ACTIVATE: + window = __glutGetWindow(hwnd); +// /* Make sure we re-select the correct palette if needed. */ +// if (LOWORD(wParam)) { +// PostMessage(hwnd, WM_PALETTECHANGED, 0, 0); +// } + if (window) { + int visState; + visState = SHORT1FROMMP( mp1 ); + updateWindowState(window, visState); + } + return 0; + + case WM_CHAR: + { USHORT fsflags; + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + fsflags = SHORT1FROMMP(mp1); +/* ?? */ + if((fsflags & KC_KEYUP) ) /* ¨Ł­®p¨p㥬 ®â¦ â¨Ą Ş­®ŻŞ¨, pĄ Ł¨p㥬 ⮫쪮 ­  ­ ¦ â¨Ą */ + break; +/////////////////////////////////////////////////// + if(!(fsflags & KC_CHAR) ) + { + if (!(fsflags & KC_VIRTUALKEY)) + break; + key = 0; + /* Get the virtual key from mp2. */ + switch (SHORT2FROMMP(mp2)) + { +/* directional keys */ + case VK_LEFT: key = GLUT_KEY_LEFT; break; + case VK_UP: key = GLUT_KEY_UP; break; + case VK_RIGHT: key = GLUT_KEY_RIGHT; break; + case VK_DOWN: key = GLUT_KEY_DOWN; break; + + case VK_PAGEUP: key = GLUT_KEY_PAGE_UP; break; + case VK_PAGEDOWN:key = GLUT_KEY_PAGE_DOWN; break; + case VK_HOME: key = GLUT_KEY_HOME;break; + case VK_END: key = GLUT_KEY_END; break; + case VK_INSERT: key = GLUT_KEY_INSERT; break; + +/* function keys */ + case VK_F1 : key = GLUT_KEY_F1; break; + case VK_F2 : key = GLUT_KEY_F2; break; + case VK_F3 : key = GLUT_KEY_F3; break; + case VK_F4 : key = GLUT_KEY_F4; break; + case VK_F5 : key = GLUT_KEY_F5; break; + case VK_F6 : key = GLUT_KEY_F6; break; + case VK_F7 : key = GLUT_KEY_F7; break; + case VK_F8 : key = GLUT_KEY_F8; break; + case VK_F9 : key = GLUT_KEY_F9; break; + case VK_F10: key = GLUT_KEY_F10;break; + case VK_F11: key = GLUT_KEY_F11; break; + case VK_F12: key = GLUT_KEY_F12; break; + case VK_ESC: key = -1; break; /* Character codes */ + case VK_SPACE: key = -1; break; + case VK_TAB: key = -1; break; + } + if(!key) + { break; /* Key Not implemented */ + } + if(key > 0) + { if (!window->special) /* ­Ą ăáâ ­®˘«Ą­® ®ˇŕ ˇ®â稪  */ + break; + + WinQueryPointerPos(HWND_DESKTOP,&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if(WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* high order bit is on */ + __glutModifierMask |= ShiftMask; + if(WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) + __glutModifierMask |= ControlMask; + if(WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) + __glutModifierMask |= Mod1Mask; + window->special(key, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + return 0; + } + + } +///////////////////////////////////////////////////// + /* If we are ignoring auto repeated key strokes for the window, bail. */ + if (window->ignoreKeyRepeat && (CHAR3FROMMP(mp1)) ) + break; + if(!((unsigned char)SHORT1FROMMP(mp2)) ) /* ¨Ł­®p¨p㥬 ­Ąá¨¬˘®«ě­ëĄ Ş®¤ë */ + break; + if (window->keyboard) { + WinQueryPointerPos(HWND_DESKTOP,&point); + + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if(WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* high order bit is on */ + __glutModifierMask |= ShiftMask; + if(WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) + __glutModifierMask |= ControlMask; + if(WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) + __glutModifierMask |= Mod1Mask; + window->keyboard((unsigned char)SHORT1FROMMP(mp2), point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + } + return 0; + } /* endof case WM_CHAR: */ +//////////////////////////////////////////////// + case WM_BUTTON1DOWN: + button = GLUT_LEFT_BUTTON; + case WM_BUTTON3DOWN: + if (button < 0) + button = GLUT_MIDDLE_BUTTON; + case WM_BUTTON2DOWN: + if (button < 0) + button = GLUT_RIGHT_BUTTON; + { POINTS psh; + psh = *((POINTS *)&mp1); + point.x = psh.x; + point.y = psh.y; + } + /* finish the menu if we get a button down message (user must have + cancelled the menu). */ + if (__glutMappedMenu) { + /* TODO: take this out once the menu on middle mouse stuff works + properly. */ + if (button == GLUT_MIDDLE_BUTTON) + return 0; + /* get current mouse pointer position */ +// WinQueryPointerPos(HWND_DESKTOP,&point); + /* map from desktop to client window */ +// WinMapWindowPoints(HWND_DESKTOP, hwnd, &point, 1); + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); + return 0; + } + window = __glutGetWindow(hwnd); + if (window) { + window->buttonDownState = button+1; + menu = __glutGetMenuByNum(window->menu[button]); + if (menu) { +//todo +// __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON : +// button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON : +// 0x0001; +// __glutStartMenu(menu, window, point.x, point.y, x, y); + } else if (window->mouse) { + + __glutSetWindow(window); + __glutModifierMask = 0; + if (WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* < 0 = high order bit is on. */ + __glutModifierMask |= ShiftMask; + if (WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) + __glutModifierMask |= ControlMask; + if (WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) + __glutModifierMask |= Mod1Mask; + window->mouse(button, GLUT_DOWN, point.x, point.y); + __glutModifierMask = (unsigned int)~0; + } else { + /* Stray mouse events. Ignore. */ + } + } + return 0; + + break; +/********************************************/ + case WM_BUTTON1UP: + button = GLUT_LEFT_BUTTON; + case WM_BUTTON3UP: + if (button < 0) + button = GLUT_MIDDLE_BUTTON; + case WM_BUTTON2UP: + if (button < 0) + button = GLUT_RIGHT_BUTTON; + { POINTS psh; + psh = *((POINTS *)&mp1); + point.x = psh.x; + point.y = psh.y; + } + /* Bail out if we're processing a menu. */ + /* Bail out = ˘ëˇŕ®á¨âěáď á Ż ŕ čă⮬ */ + if (__glutMappedMenu) { + WinQueryPointerPos(HWND_DESKTOP,&point); + WinMapWindowPoints(HWND_DESKTOP, hwnd, &point, 1); + /* if we're getting the middle button up signal, then something + on the menu was selected. */ + if (button == GLUT_MIDDLE_BUTTON) { + return 0; + /* For some reason, the code below always returns -1 even + though the point IS IN THE ITEM! Therefore, just bail out if + we get a middle mouse up. The user must select using the + left mouse button. Stupid Win32. */ +#if 0 + int item = MenuItemFromPoint(hwnd, __glutHMenu, point); + if (item != -1) + __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item); + else + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); +#endif + } else { + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); + } + return 0; + } + + window = __glutGetWindow(hwnd); + if(window) + window->buttonDownState = 0; + + if (window && window->mouse) { + __glutSetWindow(window); + __glutModifierMask = 0; + if (WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) + __glutModifierMask |= ControlMask; + if (WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) + __glutModifierMask |= Mod1Mask; + window->mouse(button, GLUT_UP, point.x, point.y); + + __glutModifierMask = (unsigned int)~0; + } else { + /* Window might have been destroyed and all the + events for the window may not yet be received. */ + } + return 0; + + + break; +////////////////////////////////////////////////// + case WM_COMMAND: + window = __glutGetWindow(hwnd); + if (window) + { if (window->wm_command) + window->wm_command(hwnd,mp1,mp2); + } + break; + + case WM_MOUSEMOVE: + if (!__glutMappedMenu) { + window = __glutGetWindow(hwnd); + if (window) { + /* If motion function registered _and_ buttons held * + down, call motion function... */ + { POINTS psh; + psh = *((POINTS *)&mp1); + point.x = psh.x; + point.y = psh.y; + } + + if (window->motion && window->buttonDownState) { + __glutSetWindow(window); + window->motion(point.x, point.y); + } + /* If passive motion function registered _and_ + buttons not held down, call passive motion + function... */ + else if (window->passive && !window->buttonDownState) { + __glutSetWindow(window); + window->passive(point.x, point.y); + } + } + } else { + /* Motion events are thrown away when a pop up menu is + active. */ + } + return 0; + + + default: + /* For all other messages, let the default window procedure process them. */ + return ( WinDefWindowProc( hwnd, msg, mp1, mp2 ) ); + + } //endof switch( msg ) + return ( WinDefWindowProc( hwnd, msg, mp1, mp2 ) ); +// return NULL; +} + +void APIENTRY glutCommandFunc(GLUTcommandCB Func) +{ +extern GLUTwindow *__glutCurrentWindow; + __glutCurrentWindow->wm_command = Func; +} + + + + +void +updateWindowState(GLUTwindow *window, int visState) +{ + GLUTwindow* child; + + /* XXX shownState and visState are the same in Win32. */ + window->shownState = visState; + if (visState != window->visState) { + if (window->windowStatus) { + window->visState = visState; + __glutSetWindow(window); + window->windowStatus(visState); + } + } + /* Since Win32 only sends an activate for the toplevel window, + update the visibility for all the child windows. */ + child = window->children; + while (child) { + updateWindowState(child, visState); + child = child->siblings; + } +} + +#if POKA + +LONG WINAPI +__glutWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + POINT point; /* Point structure. */ + PAINTSTRUCT ps; /* Paint structure. */ + LPMINMAXINFO minmax; /* Minimum/maximum info structure. */ + GLUTwindow* window; /* GLUT window associated with message. */ + GLUTmenu* menu; /* GLUT menu associated with message. */ + int x, y, width, height, key; + int button = -1; + + switch(msg) { + case WM_CREATE: + return 0; + case WM_CLOSE: + PostQuitMessage(0); + return 0; +#if 0 + case WM_DESTROY: + /* XXX NVidia's NT OpenGL can have problems closing down + its OpenGL internal data structures if we just allow + the process to terminate without unbinding and deleting + the windows context. Apparently, DirectDraw unloads + before OPENGL32.DLL in the close down sequence, but + NVidia's NT OpenGL needs DirectDraw to close down its + data structures. */ + window = __glutGetWindow(hwnd); + if (window) { + if (window->ctx) { + wglMakeCurrent(NULL, NULL); + wglDeleteContext(window->ctx); + } + } + return 0; +#endif + + case WM_SYSKEYUP: + case WM_KEYUP: + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + /* Win32 is dumb and sends these messages only to the parent + window. Therefore, find out if we're in a child window and + call the child windows keyboard callback if we are. */ + if (window->parent) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + hwnd = ChildWindowFromPoint(hwnd, point); + window = __glutGetWindow(hwnd); + } + if (window->specialUp || window->keyboardUp) { + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + switch (wParam) { + /* *INDENT-OFF* */ + case VK_F1: key = GLUT_KEY_F1; break; + case VK_F2: key = GLUT_KEY_F2; break; + case VK_F3: key = GLUT_KEY_F3; break; + case VK_F4: key = GLUT_KEY_F4; break; + case VK_F5: key = GLUT_KEY_F5; break; + case VK_F6: key = GLUT_KEY_F6; break; + case VK_F7: key = GLUT_KEY_F7; break; + case VK_F8: key = GLUT_KEY_F8; break; + case VK_F9: key = GLUT_KEY_F9; break; + case VK_F10: key = GLUT_KEY_F10; break; + case VK_F11: key = GLUT_KEY_F11; break; + case VK_F12: key = GLUT_KEY_F12; break; + case VK_LEFT: key = GLUT_KEY_LEFT; break; + case VK_UP: key = GLUT_KEY_UP; break; + case VK_RIGHT: key = GLUT_KEY_RIGHT; break; + case VK_DOWN: key = GLUT_KEY_DOWN; break; + case VK_PRIOR: key = GLUT_KEY_PAGE_UP; break; + case VK_NEXT: key = GLUT_KEY_PAGE_DOWN; break; + case VK_HOME: key = GLUT_KEY_HOME; break; + case VK_END: key = GLUT_KEY_END; break; + case VK_INSERT: key = GLUT_KEY_INSERT; break; + case VK_DELETE: + /* Delete is an ASCII character. */ + if (window->keyboardUp) { + window->keyboardUp((unsigned char) 127, point.x, point.y); + } + return 0; + /* *INDENT-ON* */ + default: + if (window->keyboardUp) { + key = MapVirtualKey(wParam, 2); /* Map to ASCII. */ + if (isascii(key) && (key != 0)) { + + /* XXX Attempt to determine modified ASCII character + is quite incomplete. Digits, symbols, CapsLock, + Ctrl, and numeric keypad are all ignored. Fix this. */ + + if (!(__glutModifierMask & ShiftMask)) + key = tolower(key); + window->keyboardUp((unsigned char) key, point.x, point.y); + } + } + __glutModifierMask = (unsigned int) ~0; + return 0; + } + if (window->specialUp) { + window->specialUp(key, point.x, point.y); + } + __glutModifierMask = (unsigned int) ~0; + } + return 0; + + case WM_SYSCHAR: + case WM_CHAR: + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + + /* Bit 30 of lParam is set if key already held down. If + we are ignoring auto repeated key strokes for the window, bail. */ + if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) { + break; + } + + /* Win32 is dumb and sends these messages only to the parent + window. Therefore, find out if we're in a child window and + call the child windows keyboard callback if we are. */ + if (window->parent) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + hwnd = ChildWindowFromPoint(hwnd, point); + window = __glutGetWindow(hwnd); + } + if (window->keyboard) { + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->keyboard((unsigned char)wParam, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + } + return 0; + + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + window = __glutGetWindow(hwnd); + if (!window) { + break; + } + + /* Bit 30 of lParam is set if key already held down. If + we are ignoring auto repeated key strokes for the window, bail. */ + if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) { + break; + } + + /* Win32 is dumb and sends these messages only to the parent + window. Therefore, find out if we're in a child window and + call the child windows keyboard callback if we are. */ + if (window->parent) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + hwnd = ChildWindowFromPoint(hwnd, point); + window = __glutGetWindow(hwnd); + } + if (window->special) { + switch (wParam) { + /* *INDENT-OFF* */ + /* function keys */ + case VK_F1: key = GLUT_KEY_F1; break; + case VK_F2: key = GLUT_KEY_F2; break; + case VK_F3: key = GLUT_KEY_F3; break; + case VK_F4: key = GLUT_KEY_F4; break; + case VK_F5: key = GLUT_KEY_F5; break; + case VK_F6: key = GLUT_KEY_F6; break; + case VK_F7: key = GLUT_KEY_F7; break; + case VK_F8: key = GLUT_KEY_F8; break; + case VK_F9: key = GLUT_KEY_F9; break; + case VK_F10: key = GLUT_KEY_F10; break; + case VK_F11: key = GLUT_KEY_F11; break; + case VK_F12: key = GLUT_KEY_F12; break; + /* directional keys */ + case VK_LEFT: key = GLUT_KEY_LEFT; break; + case VK_UP: key = GLUT_KEY_UP; break; + case VK_RIGHT: key = GLUT_KEY_RIGHT; break; + case VK_DOWN: key = GLUT_KEY_DOWN; break; + /* *INDENT-ON* */ + + case VK_PRIOR: + /* VK_PRIOR is Win32's Page Up */ + key = GLUT_KEY_PAGE_UP; + break; + case VK_NEXT: + /* VK_NEXT is Win32's Page Down */ + key = GLUT_KEY_PAGE_DOWN; + break; + case VK_HOME: + key = GLUT_KEY_HOME; + break; + case VK_END: + key = GLUT_KEY_END; + break; + case VK_INSERT: + key = GLUT_KEY_INSERT; + break; + case VK_DELETE: + goto handleDelete; + default: + goto defproc; + } + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->special(key, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + } else if (window->keyboard) { + /* Specially handle any keys that match ASCII values but + do not generate Windows WM_SYSCHAR or WM_CHAR messages. */ + switch (wParam) { + case VK_DELETE: + handleDelete: + /* Delete is an ASCII character. */ + GetCursorPos(&point); + ScreenToClient(window->win, &point); + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->keyboard((unsigned char) 127, point.x, point.y); + __glutModifierMask = (unsigned int) ~0; + return 0; + default: + /* Let the following WM_SYSCHAR or WM_CHAR message generate + the keyboard callback. */ + break; + } + } + return 0; + + case WM_LBUTTONDOWN: + button = GLUT_LEFT_BUTTON; + case WM_MBUTTONDOWN: + if (button < 0) + button = GLUT_MIDDLE_BUTTON; + case WM_RBUTTONDOWN: + if (button < 0) + button = GLUT_RIGHT_BUTTON; + + /* finish the menu if we get a button down message (user must have + cancelled the menu). */ + if (__glutMappedMenu) { + /* TODO: take this out once the menu on middle mouse stuff works + properly. */ + if (button == GLUT_MIDDLE_BUTTON) + return 0; + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); + return 0; + } + + /* set the capture so we can get mouse events outside the window */ + SetCapture(hwnd); + + /* Win32 doesn't return the same numbers as X does when the mouse + goes beyond the upper or left side of the window. roll the + Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */ + x = LOWORD(lParam); + y = HIWORD(lParam); + if(x & 1 << 15) x -= (1 << 16); + if(y & 1 << 15) y -= (1 << 16); + + window = __glutGetWindow(hwnd); + if (window) { + menu = __glutGetMenuByNum(window->menu[button]); + if (menu) { + point.x = LOWORD(lParam); point.y = HIWORD(lParam); + ClientToScreen(window->win, &point); + __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON : + button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON : + 0x0001; + __glutStartMenu(menu, window, point.x, point.y, x, y); + } else if (window->mouse) { + + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on. */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->mouse(button, GLUT_DOWN, x, y); + __glutModifierMask = (unsigned int)~0; + } else { + /* Stray mouse events. Ignore. */ + } + } + return 0; + + case WM_LBUTTONUP: + button = GLUT_LEFT_BUTTON; + case WM_MBUTTONUP: + if (button < 0) + button = GLUT_MIDDLE_BUTTON; + case WM_RBUTTONUP: + if (button < 0) + button = GLUT_RIGHT_BUTTON; + + /* Bail out if we're processing a menu. */ + if (__glutMappedMenu) { + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + /* if we're getting the middle button up signal, then something + on the menu was selected. */ + if (button == GLUT_MIDDLE_BUTTON) { + return 0; + /* For some reason, the code below always returns -1 even + though the point IS IN THE ITEM! Therefore, just bail out if + we get a middle mouse up. The user must select using the + left mouse button. Stupid Win32. */ +#if 0 + int item = MenuItemFromPoint(hwnd, __glutHMenu, point); + if (item != -1) + __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item); + else + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); +#endif + } else { + __glutItemSelected = NULL; + __glutFinishMenu(hwnd, point.x, point.y); + } + return 0; + } + + /* Release the mouse capture. */ + ReleaseCapture(); + + window = __glutGetWindow(hwnd); + if (window && window->mouse) { + /* Win32 doesn't return the same numbers as X does when the + mouse goes beyond the upper or left side of the window. roll + the Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */ + x = LOWORD(lParam); + y = HIWORD(lParam); + if(x & 1 << 15) x -= (1 << 16); + if(y & 1 << 15) y -= (1 << 16); + + __glutSetWindow(window); + __glutModifierMask = 0; + if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ + __glutModifierMask |= ShiftMask; + if (GetKeyState(VK_CONTROL) < 0) + __glutModifierMask |= ControlMask; + if (GetKeyState(VK_MENU) < 0) + __glutModifierMask |= Mod1Mask; + window->mouse(button, GLUT_UP, x, y); + __glutModifierMask = (unsigned int)~0; + } else { + /* Window might have been destroyed and all the + events for the window may not yet be received. */ + } + return 0; + + case WM_ENTERMENULOOP: + /* KLUDGE: create a timer that fires every 100 ms when we start a + menu so that we can still process the idle & timer events (that + way, the timers will fire during a menu pick and so will the + idle func. */ + SetTimer(hwnd, 1, 1, NULL); + return 0; + + case WM_TIMER: +#if 0 + /* If the timer id is 2, then this is the timer that is set up in + the main glut message processing loop, and we don't want to do + anything but acknowledge that we got it. It is used to prevent + CPU spiking when an idle function is installed. */ + if (wParam == 2) + return 0; +#endif + + /* only worry about the idle function and the timeouts, since + these are the only events we expect to process during + processing of a menu. */ + /* we no longer process the idle functions (as outlined in the + README), since drawing can't be done until the menu has + finished...it's pretty lame when the animation goes on, but + doesn't update, so you get this weird jerkiness. */ +#if 0 + if (__glutIdleFunc) + __glutIdleFunc(); +#endif + if (__glutTimerList) + handleTimeouts(); + return 0; + + case WM_EXITMENULOOP: + /* nuke the above created timer...we don't need it anymore, since + the menu is gone now. */ + KillTimer(hwnd, 1); + return 0; + + case WM_MENUSELECT: + if (lParam != 0) + __glutHMenu = (HMENU)lParam; + return 0; + + case WM_COMMAND: + if (__glutMappedMenu) { + if (GetSubMenu(__glutHMenu, LOWORD(wParam))) + __glutItemSelected = NULL; + else + __glutItemSelected = + __glutGetUniqueMenuItem(__glutMappedMenu, LOWORD(wParam)); + GetCursorPos(&point); + ScreenToClient(hwnd, &point); + __glutFinishMenu(hwnd, point.x, point.y); + } + return 0; + + case WM_MOUSEMOVE: + if (!__glutMappedMenu) { + window = __glutGetWindow(hwnd); + if (window) { + /* If motion function registered _and_ buttons held * + down, call motion function... */ + x = LOWORD(lParam); + y = HIWORD(lParam); + + /* Win32 doesn't return the same numbers as X does when the + mouse goes beyond the upper or left side of the window. + roll the Win32's 0..2^16 pointer co-ord range to 0..+/-2^15. */ + if(x & 1 << 15) x -= (1 << 16); + if(y & 1 << 15) y -= (1 << 16); + + if (window->motion && wParam & + (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) { + __glutSetWindow(window); + window->motion(x, y); + } + /* If passive motion function registered _and_ + buttons not held down, call passive motion + function... */ + else if (window->passive && + ((wParam & + (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) == + 0)) { + __glutSetWindow(window); + window->passive(x, y); + } + } + } else { + /* Motion events are thrown away when a pop up menu is + active. */ + } + return 0; + + case WM_GETMINMAXINFO: + /* this voodoo is brought to you by Win32 (again). It allows the + window to be bigger than the screen, and smaller than 100x100 + (although it doesn't seem to help the y minimum). */ + minmax = (LPMINMAXINFO)lParam; + minmax->ptMaxSize.x = __glutScreenWidth; + minmax->ptMaxSize.y = __glutScreenHeight; + minmax->ptMinTrackSize.x = 0; + minmax->ptMinTrackSize.y = 0; + minmax->ptMaxTrackSize.x = __glutScreenWidth + + GetSystemMetrics(SM_CXSIZE) * 2; + minmax->ptMaxTrackSize.y = __glutScreenHeight + + GetSystemMetrics(SM_CXSIZE) * 2 + GetSystemMetrics(SM_CYCAPTION); + return 0; + + case WM_SIZE: + window = __glutGetWindow(hwnd); + if (window) { + width = LOWORD(lParam); + height = HIWORD(lParam); + if (width != window->width || height != window->height) { +#if 0 /* Win32 GLUT does not support overlays for now. */ + if (window->overlay) { + XResizeWindow(__glutDisplay, window->overlay->win, width, height); + } +#endif + window->width = width; + window->height = height; + __glutSetWindow(window); + /* Do not execute OpenGL out of sequence with respect + to the SetWindowPos request! */ + GdiFlush(); + window->reshape(width, height); + window->forceReshape = FALSE; + /* A reshape should be considered like posting a + repair request. */ + __glutPostRedisplay(window, GLUT_REPAIR_WORK); + } + } + return 0; + + case WM_SETCURSOR: + /* If the cursor is not in the client area, then we want to send + this message to the default window procedure ('cause its + probably in the border or title, and we don't handle that + cursor. otherwise, set our cursor. Win32 makes us set the + cursor every time the mouse moves (DUMB!). */ + if(LOWORD(lParam) != HTCLIENT) { + goto defproc; + } + window = __glutGetWindow(hwnd); + if (window) { + __glutSetCursor(window); + } + /* TODO: check out the info in DevStudio on WM_SETCURSOR in the + DefaultAction section. */ + return 1; + + case WM_SETFOCUS: + window = __glutGetWindow(hwnd); + if (window) { + window->entryState = WM_SETFOCUS; + if (window->entry) { + __glutSetWindow(window); + window->entry(GLUT_ENTERED); + /* XXX Generation of fake passive notify? See how much + work the X11 code does to support fake passive notify + callbacks. */ + } + if (window->joystick && __glutCurrentWindow) { + if (__glutCurrentWindow->joyPollInterval > 0) { + MMRESULT result; + + /* Because Win32 will only let one window capture the + joystick at a time, we must capture it when we get the + focus and release it when we lose the focus. */ + result = joySetCapture(__glutCurrentWindow->win, + JOYSTICKID1, 0, TRUE); + if (result != JOYERR_NOERROR) { + return 0; + } + (void) joySetThreshold(JOYSTICKID1, + __glutCurrentWindow->joyPollInterval); + } + } + } + return 0; + + case WM_KILLFOCUS: + window = __glutGetWindow(hwnd); + if (window) { + window->entryState = WM_KILLFOCUS; + if (window->entry) { + __glutSetWindow(window); + window->entry(GLUT_LEFT); + } + if (window->joystick && __glutCurrentWindow) { + if (__glutCurrentWindow->joyPollInterval > 0) { + /* Because Win32 will only let one window capture the + joystick at a time, we must capture it when we get the + focus and release it when we lose the focus. */ + (void) joyReleaseCapture(JOYSTICKID1); + } + } + } + return 0; + case WM_ACTIVATE: + window = __glutGetWindow(hwnd); + /* Make sure we re-select the correct palette if needed. */ + if (LOWORD(wParam)) { + PostMessage(hwnd, WM_PALETTECHANGED, 0, 0); + } + if (window) { + int visState; + + /* HIWORD(wParam) is the minimized flag. */ + visState = !HIWORD(wParam); + updateWindowState(window, visState); + } + return 0; + + /* Colour Palette Management */ + case WM_PALETTECHANGED: + if (hwnd == (HWND)wParam) { + /* Don't respond to the message that we sent! */ + break; + } + /* fall through to WM_QUERYNEWPALETTE */ + + case WM_QUERYNEWPALETTE: + window = __glutGetWindow(hwnd); + if (window && window->colormap) { + UnrealizeObject(window->colormap->cmap); + SelectPalette(window->hdc, window->colormap->cmap, FALSE); + RealizePalette(window->hdc); + return TRUE; + } + return FALSE; + + case MM_JOY1MOVE: + case MM_JOY1ZMOVE: + window = __glutGetWindow(hwnd); + if (window->joystick) { + JOYINFOEX jix; + int x, y, z; + + /* Because WIN32 only supports messages for X, Y, and Z + translations, we must poll for the rest */ + jix.dwSize = sizeof(jix); + jix.dwFlags = JOY_RETURNALL; + joyGetPosEx(JOYSTICKID1,&jix); + +#define SCALE(v) ((int) ((v - 32767)/32.768)) + + /* Convert to integer for scaling. */ + x = jix.dwXpos; + y = jix.dwYpos; + z = jix.dwZpos; + window->joystick(jix.dwButtons, SCALE(x), SCALE(y), SCALE(z)); + + return TRUE; + } + return FALSE; + case MM_JOY1BUTTONDOWN: + case MM_JOY1BUTTONUP: + window = __glutGetWindow(hwnd); + if (window->joystick) { + JOYINFOEX jix; + + /* Because WIN32 only supports messages for X, Y, and Z + translations, we must poll for the rest */ + jix.dwSize = sizeof(jix); + jix.dwFlags = JOY_RETURNALL; + joyGetPosEx(JOYSTICKID1,&jix); + + return TRUE; + } + return FALSE; + +#if 0 + /* Miscellaneous messages (don't really need to enumerate them, + but it's good to know what you're not getting sometimes). */ + case WM_DISPLAYCHANGE: + break; + case WM_NCHITTEST: + /* This event is generated by every mouse move event. */ + goto defproc; + case WM_NCMOUSEMOVE: + goto defproc; + case WM_NCACTIVATE: + goto defproc; + case WM_NCPAINT: + goto defproc; + case WM_NCCALCSIZE: + goto defproc; + case WM_NCCREATE: + goto defproc; + case WM_NCDESTROY: + goto defproc; + case WM_NCLBUTTONDOWN: + goto defproc; + case WM_SETTEXT: + goto defproc; + case WM_GETTEXT: + goto defproc; + case WM_ACTIVATEAPP: + goto defproc; + case WM_GETICON: + goto defproc; + case WM_ERASEBKGND: + goto defproc; + case WM_WINDOWPOSCHANGING: + goto defproc; + case WM_WINDOWPOSCHANGED: + goto defproc; + case WM_MOUSEACTIVATE: + goto defproc; + case WM_SHOWWINDOW: + goto defproc; + case WM_MOVING: + goto defproc; + case WM_MOVE: + goto defproc; + case WM_KEYUP: + goto defproc; + case WM_CAPTURECHANGED: + goto defproc; + case WM_SYSCOMMAND: + goto defproc; + case WM_ENTERSIZEMOVE: + goto defproc; + case WM_ENTERIDLE: + goto defproc; +#endif + + default: + goto defproc; + } + +defproc: + return DefWindowProc(hwnd, msg, wParam, lParam); +} + +#endif + +#if defined(__OS2PM__) +Bool __glutSetWindowText(Window window, char *text) +{ + return WinSetWindowText(window, (PCSZ)text); + +} + +#endif Binary files /tmp/DzrXGGCBaZ/xpsb-glx-0.19/mesa/src/glut/os2/src-glut_os2pm.zip and /tmp/hXDugikVVD/xpsb-glx-0.19/mesa/src/glut/os2/src-glut_os2pm.zip differ diff -Nru xpsb-glx-0.19/mesa/src/glut/os2/WarpWin.cpp xpsb-glx-0.19/mesa/src/glut/os2/WarpWin.cpp --- xpsb-glx-0.19/mesa/src/glut/os2/WarpWin.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glut/os2/WarpWin.cpp 2010-06-24 06:42:03.000000000 +0100 @@ -0,0 +1,419 @@ +/* WarpWin.c */ +/* glut for Warp */ +#include +#include + +#include "WarpWin.h" +#include "WarpGL.h" + +#define POKA 0 + +/* global variables that must be set for some functions to operate + correctly. */ +HDC XHDC; +HWND XHWND; + + +void +XStoreColor(Display* display, Colormap colormap, XColor* color) +{ + /* KLUDGE: set XHDC to 0 if the palette should NOT be realized after + setting the color. set XHDC to the correct HDC if it should. */ + + LONG pe; + ULONG cclr; + int r,g,b; + /* X11 stores color from 0-65535, Win32 expects them to be 0-256, so + twiddle the bits ( / 256). */ + r = color->red / 256; + g = color->green / 256; + b = color->blue / 256; + pe = LONGFromRGB(r,g,b); + /* make sure we use this flag, otherwise the colors might get mapped + to another place in the colormap, and when we glIndex() that + color, it may have moved (argh!!) */ + pe |= (PC_NOCOLLAPSE<<24); +/* This function changes the entries in a palette. */ +#if POKA +OS2: + rc = GpiSetPaletteEntries(colormap,LCOLF_CONSECRGB, color->pixel, 1, &pe); + GpiSelectPalette(hps,colormap); + WinRealizePalette(hwnd,hps,&cclr); +source Win: + if (XHDC) { + UnrealizeObject(colormap); + SelectPalette(XHDC, colormap, FALSE); + RealizePalette(XHDC); + + } +#endif +} + +void +XSetWindowColormap(Display* display, Window window, Colormap colormap) +{ +#if POKA + HDC hdc = GetDC(window); + + /* if the third parameter is FALSE, the logical colormap is copied + into the device palette when the application is in the + foreground, if it is TRUE, the colors are mapped into the current + palette in the best possible way. */ + SelectPalette(hdc, colormap, FALSE); + RealizePalette(hdc); + + /* note that we don't have to release the DC, since our window class + uses the WC_OWNDC flag! */ +#endif +} + + +/* display, root and visual - don't used at all */ +Colormap +XCreateColormap(Display* display, Window root, Visual* visual, int alloc) +{ + /* KLUDGE: this function needs XHDC to be set to the HDC currently + being operated on before it is invoked! */ + + HPAL palette; + int n; +#if POKA + PIXELFORMATDESCRIPTOR pfd; + LOGPALETTE *logical; + + /* grab the pixel format */ + memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); + DescribePixelFormat(XHDC, GetPixelFormat(XHDC), + sizeof(PIXELFORMATDESCRIPTOR), &pfd); + + if (!(pfd.dwFlags & PFD_NEED_PALETTE || + pfd.iPixelType == PFD_TYPE_COLORINDEX)) + { + return 0; + } + + n = 1 << pfd.cColorBits; + + /* allocate a bunch of memory for the logical palette (assume 256 + colors in a Win32 palette */ + logical = (LOGPALETTE*)malloc(sizeof(LOGPALETTE) + + sizeof(PALETTEENTRY) * n); + memset(logical, 0, sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * n); + + /* set the entries in the logical palette */ + logical->palVersion = 0x300; + logical->palNumEntries = n; + + /* start with a copy of the current system palette */ + GetSystemPaletteEntries(XHDC, 0, 256, &logical->palPalEntry[0]); + + if (pfd.iPixelType == PFD_TYPE_RGBA) { + int redMask = (1 << pfd.cRedBits) - 1; + int greenMask = (1 << pfd.cGreenBits) - 1; + int blueMask = (1 << pfd.cBlueBits) - 1; + int i; + + /* fill in an RGBA color palette */ + for (i = 0; i < n; ++i) { + logical->palPalEntry[i].peRed = + (((i >> pfd.cRedShift) & redMask) * 255) / redMask; + logical->palPalEntry[i].peGreen = + (((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask; + logical->palPalEntry[i].peBlue = + (((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask; + logical->palPalEntry[i].peFlags = 0; + } + } + + palette = CreatePalette(logical); + free(logical); + + SelectPalette(XHDC, palette, FALSE); + RealizePalette(XHDC); +#endif /* POKA */ + + return palette; +} + + + +int GetSystemMetrics( int mode) +{ RECTL rect; + + switch(mode) + { case SM_CXSCREEN: + WinQueryWindowRect(HWND_DESKTOP,&rect); + return (rect.xRight-rect.xLeft); + break; + case SM_CYSCREEN: + WinQueryWindowRect(HWND_DESKTOP,&rect); + return (rect.yTop-rect.yBottom); + break; + default: ; + } + return 0; +} +/* + * XParseGeometry parses strings of the form + * "=x{+-}{+-}", where + * width, height, xoffset, and yoffset are unsigned integers. + * Example: "=80x24+300-49" + * The equal sign is optional. + * It returns a bitmask that indicates which of the four values + * were actually found in the string. For each value found, + * the corresponding argument is updated; for each value + * not found, the corresponding argument is left unchanged. + */ + +static int +ReadInteger(char *string, char **NextString) +{ + register int Result = 0; + int Sign = 1; + + if (*string == '+') + string++; + else if (*string == '-') + { + string++; + Sign = -1; + } + for (; (*string >= '0') && (*string <= '9'); string++) + { + Result = (Result * 10) + (*string - '0'); + } + *NextString = string; + if (Sign >= 0) + return (Result); + else + return (-Result); +} + +int XParseGeometry(char *string, int *x, int *y, unsigned int *width, unsigned int *height) +{ + int mask = NoValue; + register char *strind; + unsigned int tempWidth, tempHeight; + int tempX, tempY; + char *nextCharacter; + + if ( (string == NULL) || (*string == '\0')) return(mask); + if (*string == '=') + string++; /* ignore possible '=' at beg of geometry spec */ + + strind = (char *)string; + if (*strind != '+' && *strind != '-' && *strind != 'x') { + tempWidth = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= WidthValue; + } + + if (*strind == 'x' || *strind == 'X') { + strind++; + tempHeight = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= HeightValue; + } + + if ((*strind == '+') || (*strind == '-')) { + if (*strind == '-') { + strind++; + tempX = -ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= XNegative; + + } + else + { strind++; + tempX = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + } + mask |= XValue; + if ((*strind == '+') || (*strind == '-')) { + if (*strind == '-') { + strind++; + tempY = -ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + mask |= YNegative; + + } + else + { + strind++; + tempY = ReadInteger(strind, &nextCharacter); + if (strind == nextCharacter) + return(0); + strind = nextCharacter; + } + mask |= YValue; + } + } + + /* If strind isn't at the end of the string the it's an invalid + geometry specification. */ + + if (*strind != '\0') return (0); + + if (mask & XValue) + *x = tempX; + if (mask & YValue) + *y = tempY; + if (mask & WidthValue) + *width = tempWidth; + if (mask & HeightValue) + *height = tempHeight; + return (mask); +} + +int gettimeofday(struct timeval* tp, void* tzp) +{ + DATETIME DateTime; + APIRET ulrc; /* Return Code. */ + + ulrc = DosGetDateTime(&DateTime); + tp->tv_sec = 60 * (60*DateTime.hours + DateTime.minutes) + DateTime.seconds; + tp->tv_usec = DateTime.hundredths * 10000; + return 0; +} + + +int +XPending(Display* display) +{ + /* similar functionality...I don't think that it is exact, but this + will have to do. */ + QMSG msg; + extern HAB hab; /* PM anchor block handle */ + +//?? WinPeekMsg(hab + return WinPeekMsg(hab, &msg, NULLHANDLE, 0, 0, PM_NOREMOVE); +} + +void +__glutAdjustCoords(Window parent, int* x, int* y, int* width, int* height) +{ + RECTL rect; + + /* adjust the window rectangle because Win32 thinks that the x, y, + width & height are the WHOLE window (including decorations), + whereas GLUT treats the x, y, width & height as only the CLIENT + area of the window. */ + rect.xLeft = *x; rect.yTop = *y; + rect.xRight = *x + *width; rect.yBottom = *y + *height; + + /* must adjust the coordinates according to the correct style + because depending on the style, there may or may not be + borders. */ +//?? AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | +//?? (parent ? WS_CHILD : WS_OVERLAPPEDWINDOW), +//?? FALSE); + /* FALSE in the third parameter = window has no menu bar */ + + /* readjust if the x and y are offscreen */ + if(rect.xLeft < 0) { + *x = 0; + } else { + *x = rect.xLeft; + } + + if(rect.yTop < 0) { + *y = 0; + } else { + *y = rect.yTop; + } + + *width = rect.xRight - rect.xLeft; /* adjusted width */ + *height = -(rect.yBottom - rect.yTop); /* adjusted height */ +} + + +int +__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo) +{ + /* the transparent pixel on Win32 is always index number 0. So if + we put this routine in this file, we can avoid compiling the + whole of layerutil.c which is where this routine normally comes + from. */ + return 0; +} + +/* Translate point coordinates src_x and src_y from src to dst */ + +Bool +XTranslateCoordinates(Display *display, Window src, Window dst, + int src_x, int src_y, + int* dest_x_return, int* dest_y_return, + Window* child_return) +{ + SWP swp_src,swp_dst; + + WinQueryWindowPos(src,&swp_src); + WinQueryWindowPos(dst,&swp_dst); + + *dest_x_return = src_x + swp_src.x - swp_dst.x; + *dest_y_return = src_y + swp_src.y - swp_dst.y; + + /* just to make compilers happy...we don't use the return value. */ + return True; +} + +Status +XGetGeometry(Display* display, Window window, Window* root_return, + int* x_return, int* y_return, + unsigned int* width_return, unsigned int* height_return, + unsigned int *border_width_return, unsigned int* depth_return) +{ + /* KLUDGE: doesn't return the border_width or depth or root, x & y + are in screen coordinates. */ + SWP swp_src; + WinQueryWindowPos(window,&swp_src); + + *x_return = swp_src.x; + *y_return = swp_src.y; + *width_return = swp_src.cx; + *height_return = swp_src.cy; + + /* just to make compilers happy...we don't use the return value. */ + return 1; +} + +/* Get Display Width in millimeters */ +int +DisplayWidthMM(Display* display, int screen) +{ + int width; + LONG *pVC_Caps; + pVC_Caps = GetVideoConfig(NULLHANDLE); + width = (int)( 0.001 * pVC_Caps[CAPS_WIDTH] / pVC_Caps[CAPS_HORIZONTAL_RESOLUTION]);/* mm */ + return width; +} + +/* Get Display Height in millimeters */ +int +DisplayHeightMM(Display* display, int screen) +{ + int height; + LONG *pVC_Caps; + pVC_Caps = GetVideoConfig(NULLHANDLE); + height = (int)( 0.001 * pVC_Caps[CAPS_HEIGHT] / pVC_Caps[CAPS_VERTICAL_RESOLUTION]); /* mm */ + return height; +} + +void ScreenToClient( HWND hwnd, POINTL *point) +{ + SWP swp_src; + WinQueryWindowPos(hwnd,&swp_src); + point->x -= swp_src.x; + point->y -= swp_src.y; +} + diff -Nru xpsb-glx-0.19/mesa/src/glw/GLwDrawA.c xpsb-glx-0.19/mesa/src/glw/GLwDrawA.c --- xpsb-glx-0.19/mesa/src/glw/GLwDrawA.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/GLwDrawA.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,684 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ + +/* + * + * This file has been slightly modified from the original for use with Mesa + * + * Jeroen van der Zijp + * + * jvz@cyberia.cfdrc.com + * + */ +#include +#include +#include +#include +#ifdef __GLX_MOTIF +#include +#include "GLwMDrawAP.h" +#else +#include "GLwDrawAP.h" +#endif +#include +#include + +#ifdef __GLX_MOTIF +#define GLwDrawingAreaWidget GLwMDrawingAreaWidget +#define GLwDrawingAreaClassRec GLwMDrawingAreaClassRec +#define glwDrawingAreaClassRec glwMDrawingAreaClassRec +#define glwDrawingAreaWidgetClass glwMDrawingAreaWidgetClass +#define GLwDrawingAreaRec GLwMDrawingAreaRec +#endif + +#define ATTRIBLIST_SIZE 32 + +#define offset(field) XtOffset(GLwDrawingAreaWidget,glwDrawingArea.field) + + +/* forward definitions */ +static void createColormap(GLwDrawingAreaWidget w,int offset,XrmValue *value); +static void Initialize(GLwDrawingAreaWidget req,GLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args); +static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes); +static void Redraw(GLwDrawingAreaWidget w,XEvent *event,Region region); +static void Resize(GLwDrawingAreaWidget glw); +static void Destroy(GLwDrawingAreaWidget glw); +static void glwInput(GLwDrawingAreaWidget glw,XEvent *event,String *params,Cardinal *numParams); + + + +static char defaultTranslations[] = +#ifdef __GLX_MOTIF + "osfHelp:PrimitiveHelp() \n" +#endif + ": glwInput() \n\ + : glwInput() \n\ + : glwInput() \n\ + : glwInput() \n\ + : glwInput() "; + + +static XtActionsRec actions[] = { + {"glwInput",(XtActionProc)glwInput}, /* key or mouse input */ + }; + + +/* + * There is a bit of unusual handling of the resources here. + * Because Xt insists on allocating the colormap resource when it is + * processing the core resources (even if we redeclare the colormap + * resource here, we need to do a little trick. When Xt first allocates + * the colormap, we allow it to allocate the default one, since we have + * not yet determined the appropriate visual (which is determined from + * resources parsed after the colormap). We also let it allocate colors + * in that default colormap. + * + * In the initialize proc we calculate the actual visual. Then, we + * reobtain the colormap resource using XtGetApplicationResources in + * the initialize proc. If requested, we also reallocate colors in + * that colormap using the same method. + */ + +static XtResource resources[] = { + /* The GLX attributes. Add any new attributes here */ + + {GLwNbufferSize, GLwCBufferSize, XtRInt, sizeof (int), + offset(bufferSize), XtRImmediate, (XtPointer) 0}, + + {GLwNlevel, GLwCLevel, XtRInt, sizeof (int), + offset(level), XtRImmediate, (XtPointer) 0}, + + {GLwNrgba, GLwCRgba, XtRBoolean, sizeof (Boolean), + offset(rgba), XtRImmediate, (XtPointer) FALSE}, + + {GLwNdoublebuffer, GLwCDoublebuffer, XtRBoolean, sizeof (Boolean), + offset(doublebuffer), XtRImmediate, (XtPointer) FALSE}, + + {GLwNstereo, GLwCStereo, XtRBoolean, sizeof (Boolean), + offset(stereo), XtRImmediate, (XtPointer) FALSE}, + + {GLwNauxBuffers, GLwCAuxBuffers, XtRInt, sizeof (int), + offset(auxBuffers), XtRImmediate, (XtPointer) 0}, + + {GLwNredSize, GLwCColorSize, XtRInt, sizeof (int), + offset(redSize), XtRImmediate, (XtPointer) 1}, + + {GLwNgreenSize, GLwCColorSize, XtRInt, sizeof (int), + offset(greenSize), XtRImmediate, (XtPointer) 1}, + + {GLwNblueSize, GLwCColorSize, XtRInt, sizeof (int), + offset(blueSize), XtRImmediate, (XtPointer) 1}, + + {GLwNalphaSize, GLwCAlphaSize, XtRInt, sizeof (int), + offset(alphaSize), XtRImmediate, (XtPointer) 0}, + + {GLwNdepthSize, GLwCDepthSize, XtRInt, sizeof (int), + offset(depthSize), XtRImmediate, (XtPointer) 0}, + + {GLwNstencilSize, GLwCStencilSize, XtRInt, sizeof (int), + offset(stencilSize), XtRImmediate, (XtPointer) 0}, + + {GLwNaccumRedSize, GLwCAccumColorSize, XtRInt, sizeof (int), + offset(accumRedSize), XtRImmediate, (XtPointer) 0}, + + {GLwNaccumGreenSize, GLwCAccumColorSize, XtRInt, sizeof (int), + offset(accumGreenSize), XtRImmediate, (XtPointer) 0}, + + {GLwNaccumBlueSize, GLwCAccumColorSize, XtRInt, sizeof (int), + offset(accumBlueSize), XtRImmediate, (XtPointer) 0}, + + {GLwNaccumAlphaSize, GLwCAccumAlphaSize, XtRInt, sizeof (int), + offset(accumAlphaSize), XtRImmediate, (XtPointer) 0}, + + /* the attribute list */ + {GLwNattribList, GLwCAttribList, XtRPointer, sizeof(int *), + offset(attribList), XtRImmediate, (XtPointer) NULL}, + + /* the visual info */ + {GLwNvisualInfo, GLwCVisualInfo, GLwRVisualInfo, sizeof (XVisualInfo *), + offset(visualInfo), XtRImmediate, (XtPointer) NULL}, + + /* miscellaneous resources */ + {GLwNinstallColormap, GLwCInstallColormap, XtRBoolean, sizeof (Boolean), + offset(installColormap), XtRImmediate, (XtPointer) TRUE}, + + {GLwNallocateBackground, GLwCAllocateColors, XtRBoolean, sizeof (Boolean), + offset(allocateBackground), XtRImmediate, (XtPointer) FALSE}, + + {GLwNallocateOtherColors, GLwCAllocateColors, XtRBoolean, sizeof (Boolean), + offset(allocateOtherColors), XtRImmediate, (XtPointer) FALSE}, + + {GLwNinstallBackground, GLwCInstallBackground, XtRBoolean, sizeof (Boolean), + offset(installBackground), XtRImmediate, (XtPointer) TRUE}, + + {GLwNginitCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList), + offset(ginitCallback), XtRImmediate, (XtPointer) NULL}, + + {GLwNinputCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList), + offset(inputCallback), XtRImmediate, (XtPointer) NULL}, + + {GLwNresizeCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList), + offset(resizeCallback), XtRImmediate, (XtPointer) NULL}, + + {GLwNexposeCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList), + offset(exposeCallback), XtRImmediate, (XtPointer) NULL}, + + /* Changes to Motif primitive resources */ +#ifdef __GLX_MOTIF + {XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), + XtOffset (GLwDrawingAreaWidget, primitive.traversal_on), XmRImmediate, + (XtPointer)FALSE}, + + /* highlighting is normally disabled, as when Motif tries to disable + * highlighting, it tries to reset the color back to the parent's + * background (usually Motif blue). Unfortunately, that is in a + * different colormap, and doesn't work too well. + */ + {XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean), + XtOffset (GLwDrawingAreaWidget, primitive.highlight_on_enter), + XmRImmediate, (XtPointer) FALSE}, + + {XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, + sizeof (Dimension), + XtOffset (GLwDrawingAreaWidget, primitive.highlight_thickness), + XmRImmediate, (XtPointer) 0}, +#endif + }; + + +/* +** The following resources are reobtained using XtGetApplicationResources +** in the initialize proc. +*/ + +/* The colormap */ +static XtResource initializeResources[] = { + /* reobtain the colormap with the new visual */ + {XtNcolormap, XtCColormap, XtRColormap, sizeof(Colormap), + XtOffset(GLwDrawingAreaWidget, core.colormap), + XtRCallProc,(XtPointer) createColormap}, + }; + + +/* reallocate any colors we need in the new colormap */ + +/* The background is obtained only if the allocateBackground resource is TRUE*/ +static XtResource backgroundResources[] = { +#ifdef __GLX_MOTIF + {XmNbackground, XmCBackground,XmRPixel, + sizeof(Pixel),XtOffset(GLwDrawingAreaWidget,core.background_pixel), + XmRString,(XtPointer)"lightgrey"}, + /*XmRCallProc,(XtPointer)_XmBackgroundColorDefault},*/ + + {XmNbackgroundPixmap,XmCPixmap,XmRXmBackgroundPixmap, + sizeof(Pixmap),XtOffset(GLwDrawingAreaWidget,core.background_pixmap), + XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, + +#else + {XtNbackground,XtCBackground,XtRPixel,sizeof(Pixel), + XtOffset(GLwDrawingAreaWidget,core.background_pixel), + XtRString,(XtPointer)"lightgrey"}, + /*XtRString,(XtPointer)"XtDefaultBackground"},*/ + + {XtNbackgroundPixmap, XtCPixmap, XtRPixmap, sizeof(Pixmap), + XtOffset(GLwDrawingAreaWidget,core.background_pixmap), + XtRImmediate,(XtPointer)XtUnspecifiedPixmap}, +#endif + }; + + + +/* The other colors such as the foreground are allocated only if + * allocateOtherColors are set. These resources only exist in Motif. + */ +#ifdef __GLX_MOTIF +static XtResource otherColorResources[] = { + {XmNforeground,XmCForeground,XmRPixel, + sizeof(Pixel),XtOffset(GLwDrawingAreaWidget,primitive.foreground), + XmRString,(XtPointer)"lighgrey"}, + /*XmRCallProc, (XtPointer) _XmForegroundColorDefault},*/ + + {XmNhighlightColor,XmCHighlightColor,XmRPixel,sizeof(Pixel), + XtOffset(GLwDrawingAreaWidget,primitive.highlight_color), + XmRString,(XtPointer)"lightgrey"}, + /*XmRCallProc,(XtPointer)_XmHighlightColorDefault},*/ + + {XmNhighlightPixmap,XmCHighlightPixmap,XmRPrimHighlightPixmap, + sizeof(Pixmap), + XtOffset(GLwDrawingAreaWidget,primitive.highlight_pixmap), + XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, + /*XmRCallProc,(XtPointer)_XmPrimitiveHighlightPixmapDefault},*/ + }; +#endif + + +#undef offset + + +GLwDrawingAreaClassRec glwDrawingAreaClassRec = { + { /* core fields */ +#ifdef __GLX_MOTIF + /* superclass */ (WidgetClass) &xmPrimitiveClassRec, + /* class_name */ "GLwMDrawingArea", +#else /* not __GLX_MOTIF */ + /* superclass */ (WidgetClass) &widgetClassRec, + /* class_name */ "GLwDrawingArea", +#endif /* __GLX_MOTIF */ + /* widget_size */ sizeof(GLwDrawingAreaRec), + /* class_initialize */ NULL, + /* class_part_initialize */ NULL, + /* class_inited */ FALSE, + /* initialize */ (XtInitProc) Initialize, + /* initialize_hook */ NULL, + /* realize */ Realize, + /* actions */ actions, + /* num_actions */ XtNumber(actions), + /* resources */ resources, + /* num_resources */ XtNumber(resources), + /* xrm_class */ NULLQUARK, + /* compress_motion */ TRUE, + /* compress_exposure */ TRUE, + /* compress_enterleave */ TRUE, + /* visible_interest */ TRUE, + /* destroy */ (XtWidgetProc) Destroy, + /* resize */ (XtWidgetProc) Resize, + /* expose */ (XtExposeProc) Redraw, + /* set_values */ NULL, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, + /* accept_focus */ NULL, + /* version */ XtVersion, + /* callback_private */ NULL, + /* tm_table */ defaultTranslations, + /* query_geometry */ XtInheritQueryGeometry, + /* display_accelerator */ XtInheritDisplayAccelerator, + /* extension */ NULL + }, +#ifdef __GLX_MOTIF /* primitive resources */ + { + /* border_highlight */ XmInheritBorderHighlight, + /* border_unhighlight */ XmInheritBorderUnhighlight, + /* translations */ XtInheritTranslations, + /* arm_and_activate */ NULL, + /* get_resources */ NULL, + /* num get_resources */ 0, + /* extension */ NULL, + } +#endif + }; + +WidgetClass glwDrawingAreaWidgetClass=(WidgetClass)&glwDrawingAreaClassRec; + + + +static void error(Widget w,char* string){ + char buf[100]; +#ifdef __GLX_MOTIF + sprintf(buf,"GLwMDrawingArea: %s\n",string); +#else + sprintf(buf,"GLwDrawingArea: %s\n",string); +#endif + XtAppError(XtWidgetToApplicationContext(w),buf); + } + + +static void warning(Widget w,char* string){ + char buf[100]; +#ifdef __GLX_MOTIF + sprintf (buf, "GLwMDraw: %s\n", string); +#else + sprintf (buf, "GLwDraw: %s\n", string); +#endif + XtAppWarning(XtWidgetToApplicationContext(w), buf); + } + + + +/* Initialize the attribList based on the attributes */ +static void createAttribList(GLwDrawingAreaWidget w){ + int *ptr; + w->glwDrawingArea.attribList = (int*)XtMalloc(ATTRIBLIST_SIZE*sizeof(int)); + if(!w->glwDrawingArea.attribList){ + error((Widget)w,"Unable to allocate attribute list"); + } + ptr = w->glwDrawingArea.attribList; + *ptr++ = GLX_BUFFER_SIZE; + *ptr++ = w->glwDrawingArea.bufferSize; + *ptr++ = GLX_LEVEL; + *ptr++ = w->glwDrawingArea.level; + if(w->glwDrawingArea.rgba) *ptr++ = GLX_RGBA; + if(w->glwDrawingArea.doublebuffer) *ptr++ = GLX_DOUBLEBUFFER; + if(w->glwDrawingArea.stereo) *ptr++ = GLX_STEREO; + *ptr++ = GLX_AUX_BUFFERS; + *ptr++ = w->glwDrawingArea.auxBuffers; + *ptr++ = GLX_RED_SIZE; + *ptr++ = w->glwDrawingArea.redSize; + *ptr++ = GLX_GREEN_SIZE; + *ptr++ = w->glwDrawingArea.greenSize; + *ptr++ = GLX_BLUE_SIZE; + *ptr++ = w->glwDrawingArea.blueSize; + *ptr++ = GLX_ALPHA_SIZE; + *ptr++ = w->glwDrawingArea.alphaSize; + *ptr++ = GLX_DEPTH_SIZE; + *ptr++ = w->glwDrawingArea.depthSize; + *ptr++ = GLX_STENCIL_SIZE; + *ptr++ = w->glwDrawingArea.stencilSize; + *ptr++ = GLX_ACCUM_RED_SIZE; + *ptr++ = w->glwDrawingArea.accumRedSize; + *ptr++ = GLX_ACCUM_GREEN_SIZE; + *ptr++ = w->glwDrawingArea.accumGreenSize; + *ptr++ = GLX_ACCUM_BLUE_SIZE; + *ptr++ = w->glwDrawingArea.accumBlueSize; + *ptr++ = GLX_ACCUM_ALPHA_SIZE; + *ptr++ = w->glwDrawingArea.accumAlphaSize; + *ptr++ = None; + assert((ptr-w->glwDrawingArea.attribList)glwDrawingArea.attribList); + w->glwDrawingArea.visualInfo=glXChooseVisual(XtDisplay(w),XScreenNumberOfScreen(XtScreen(w)),w->glwDrawingArea.attribList); + if(!w->glwDrawingArea.visualInfo) error((Widget)w,"requested visual not supported"); + } + + + +/* Initialize the colormap based on the visual info. + * This routine maintains a cache of visual-infos to colormaps. If two + * widgets share the same visual info, they share the same colormap. + * This function is called by the callProc of the colormap resource entry. + */ +static void createColormap(GLwDrawingAreaWidget w,int offset,XrmValue *value){ + static struct cmapCache { Visual *visual; Colormap cmap; } *cmapCache; + static int cacheEntries=0; + static int cacheMalloced=0; + register int i; + + assert(w->glwDrawingArea.visualInfo); + + /* see if we can find it in the cache */ + for(i=0; iglwDrawingArea.visualInfo->visual){ + value->addr=(XtPointer)(&cmapCache[i].cmap); + return; + } + } + + /* not in the cache, create a new entry */ + if(cacheEntries >= cacheMalloced){ + /* need to malloc a new one. Since we are likely to have only a + * few colormaps, we allocate one the first time, and double + * each subsequent time. + */ + if(cacheMalloced==0){ + cacheMalloced=1; + cmapCache=(struct cmapCache*)XtMalloc(sizeof(struct cmapCache)); + } + else{ + cacheMalloced<<=1; + cmapCache=(struct cmapCache*)XtRealloc((char*)cmapCache,sizeof(struct cmapCache)*cacheMalloced); + } + } + + cmapCache[cacheEntries].cmap=XCreateColormap(XtDisplay(w), + RootWindow(XtDisplay(w), + w->glwDrawingArea.visualInfo->screen), + w->glwDrawingArea.visualInfo->visual, + AllocNone); + cmapCache[cacheEntries].visual=w->glwDrawingArea.visualInfo->visual; + value->addr=(XtPointer)(&cmapCache[cacheEntries++].cmap); + } + + + +static void Initialize(GLwDrawingAreaWidget req,GLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args){ + + /* fix size */ + if(req->core.width==0) neww->core.width=100; + if(req->core.height==0) neww->core.width=100; + + /* create the attribute list if needed */ + neww->glwDrawingArea.myList=FALSE; + if(neww->glwDrawingArea.attribList==NULL){ + neww->glwDrawingArea.myList=TRUE; + createAttribList(neww); + } + + /* Gotta have it */ + assert(neww->glwDrawingArea.attribList); + + /* determine the visual info if needed */ + neww->glwDrawingArea.myVisual=FALSE; + if(neww->glwDrawingArea.visualInfo==NULL){ + neww->glwDrawingArea.myVisual=TRUE; + createVisualInfo(neww); + } + + /* Gotta have that too */ + assert(neww->glwDrawingArea.visualInfo); + + neww->core.depth=neww->glwDrawingArea.visualInfo->depth; + + /* Reobtain the colormap and colors in it using XtGetApplicationResources*/ + XtGetApplicationResources((Widget)neww,neww,initializeResources,XtNumber(initializeResources),args,*num_args); + + /* obtain the color resources if appropriate */ + if(req->glwDrawingArea.allocateBackground){ + XtGetApplicationResources((Widget)neww,neww,backgroundResources,XtNumber(backgroundResources),args,*num_args); + } + +#ifdef __GLX_MOTIF + if(req->glwDrawingArea.allocateOtherColors){ + XtGetApplicationResources((Widget)neww,neww,otherColorResources,XtNumber(otherColorResources),args,*num_args); + } +#endif + } + + + +static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes){ + register GLwDrawingAreaWidget glw=(GLwDrawingAreaWidget)w; + GLwDrawingAreaCallbackStruct cb; + Widget parentShell; + Status status; + Window windows[2],*windowsReturn,*windowList; + int countReturn,i; + + /* if we haven't requested that the background be both installed and + * allocated, don't install it. + */ + if(!(glw->glwDrawingArea.installBackground && glw->glwDrawingArea.allocateBackground)){ + *valueMask&=~CWBackPixel; + } + + XtCreateWindow(w,(unsigned int)InputOutput,glw->glwDrawingArea.visualInfo->visual,*valueMask,attributes); + + /* if appropriate, call XSetWMColormapWindows to install the colormap */ + if(glw->glwDrawingArea.installColormap){ + + /* Get parent shell */ + for(parentShell=XtParent(w); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell)); + + if(parentShell && XtWindow(parentShell)){ + + /* check to see if there is already a property */ + status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn); + + /* if no property, just create one */ + if(!status){ + windows[0]=XtWindow(w); + windows[1]=XtWindow(parentShell); + XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windows,2); + } + + /* there was a property, add myself to the beginning */ + else{ + windowList=(Window *)XtMalloc((sizeof(Window))*(countReturn+1)); + windowList[0]=XtWindow(w); + for(i=0; icore.width; + cb.height=glw->core.height; + XtCallCallbackList((Widget)glw,glw->glwDrawingArea.ginitCallback,&cb); + } + + + +static void Redraw(GLwDrawingAreaWidget w,XEvent *event,Region region){ + GLwDrawingAreaCallbackStruct cb; + if(!XtIsRealized((Widget)w)) return; + cb.reason=GLwCR_EXPOSE; + cb.event=event; + cb.width=w->core.width; + cb.height=w->core.height; + XtCallCallbackList((Widget)w,w->glwDrawingArea.exposeCallback,&cb); + } + + + +static void Resize(GLwDrawingAreaWidget glw){ + GLwDrawingAreaCallbackStruct cb; + if(!XtIsRealized((Widget)glw)) return; + cb.reason=GLwCR_RESIZE; + cb.event=NULL; + cb.width=glw->core.width; + cb.height=glw->core.height; + XtCallCallbackList((Widget)glw,glw->glwDrawingArea.resizeCallback,&cb); + } + + + +static void Destroy(GLwDrawingAreaWidget glw){ + Window *windowsReturn; + Widget parentShell; + Status status; + int countReturn; + register int i; + + if(glw->glwDrawingArea.myList && glw->glwDrawingArea.attribList){ + XtFree((XtPointer)glw->glwDrawingArea.attribList); + } + + if(glw->glwDrawingArea.myVisual && glw->glwDrawingArea.visualInfo){ + XtFree((XtPointer)glw->glwDrawingArea.visualInfo); + } + + /* if my colormap was installed, remove it */ + if(glw->glwDrawingArea.installColormap){ + + /* Get parent shell */ + for(parentShell=XtParent(glw); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell)); + + if(parentShell && XtWindow(parentShell)){ + + /* make sure there is a property */ + status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn); + + /* if no property, just return. If there was a property, continue */ + if(status){ + + /* search for a match */ + for(i=0; icore.width; + cb.height=glw->core.height; + XtCallCallbackList((Widget)glw,glw->glwDrawingArea.inputCallback,&cb); + } + + +#ifdef __GLX_MOTIF + +/* Create routine */ +Widget GLwCreateMDrawingArea(Widget parent, char *name,ArgList arglist,Cardinal argcount){ + return XtCreateWidget(name,glwMDrawingAreaWidgetClass, parent, arglist,argcount); + } + +#endif + + +#ifndef __GLX_MOTIF + +/* Make context current */ +void GLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx){ + glXMakeCurrent(XtDisplay(w),XtWindow(w),ctx); + } + + +/* Swap buffers convenience function */ +void GLwDrawingAreaSwapBuffers(Widget w){ + glXSwapBuffers(XtDisplay(w),XtWindow(w)); + } + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glw/GLwDrawA.h xpsb-glx-0.19/mesa/src/glw/GLwDrawA.h --- xpsb-glx-0.19/mesa/src/glw/GLwDrawA.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/GLwDrawA.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,195 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ +#ifndef _GLwDrawA_h +#define _GLwDrawA_h + +#include +#include + +/**************************************************************** + * + * GLwDrawingArea widgets + * + ****************************************************************/ + +/* Resources: + + Name Class RepType Default Value + ---- ----- ------- ------------- + attribList AttribList int * NULL + visualInfo VisualInfo VisualInfo NULL + installColormap InstallColormap Boolean TRUE + allocateBackground AllocateColors Boolean FALSE + allocateOtherColors AllocateColors Boolean FALSE + installBackground InstallBackground Boolean TRUE + exposeCallback Callback Pointer NULL + ginitCallback Callback Pointer NULL + inputCallback Callback Pointer NULL + resizeCallback Callback Pointer NULL + +*** The following resources all correspond to the GLX configuration +*** attributes and are used to create the attribList if it is NULL + bufferSize BufferSize int 0 + level Level int 0 + rgba Rgba Boolean FALSE + doublebuffer Doublebuffer Boolean FALSE + stereo Stereo Boolean FALSE + auxBuffers AuxBuffers int 0 + redSize ColorSize int 1 + greenSize ColorSize int 1 + blueSize ColorSize int 1 + alphaSize AlphaSize int 0 + depthSize DepthSize int 0 + stencilSize StencilSize int 0 + accumRedSize AccumColorSize int 0 + accumGreenSize AccumColorSize int 0 + accumBlueSize AccumColorSize int 0 + accumAlphaSize AccumAlphaSize int 0 +*/ + +#define GLwNattribList "attribList" +#define GLwCAttribList "AttribList" +#define GLwNvisualInfo "visualInfo" +#define GLwCVisualInfo "VisualInfo" +#define GLwRVisualInfo "VisualInfo" + +#define GLwNinstallColormap "installColormap" +#define GLwCInstallColormap "InstallColormap" +#define GLwNallocateBackground "allocateBackground" +#define GLwNallocateOtherColors "allocateOtherColors" +#define GLwCAllocateColors "AllocateColors" +#define GLwNinstallBackground "installBackground" +#define GLwCInstallBackground "InstallBackground" + +#define GLwCCallback "Callback" +#define GLwNexposeCallback "exposeCallback" +#define GLwNginitCallback "ginitCallback" +#define GLwNresizeCallback "resizeCallback" +#define GLwNinputCallback "inputCallback" + +#define GLwNbufferSize "bufferSize" +#define GLwCBufferSize "BufferSize" +#define GLwNlevel "level" +#define GLwCLevel "Level" +#define GLwNrgba "rgba" +#define GLwCRgba "Rgba" +#define GLwNdoublebuffer "doublebuffer" +#define GLwCDoublebuffer "Doublebuffer" +#define GLwNstereo "stereo" +#define GLwCStereo "Stereo" +#define GLwNauxBuffers "auxBuffers" +#define GLwCAuxBuffers "AuxBuffers" +#define GLwNredSize "redSize" +#define GLwNgreenSize "greenSize" +#define GLwNblueSize "blueSize" +#define GLwCColorSize "ColorSize" +#define GLwNalphaSize "alphaSize" +#define GLwCAlphaSize "AlphaSize" +#define GLwNdepthSize "depthSize" +#define GLwCDepthSize "DepthSize" +#define GLwNstencilSize "stencilSize" +#define GLwCStencilSize "StencilSize" +#define GLwNaccumRedSize "accumRedSize" +#define GLwNaccumGreenSize "accumGreenSize" +#define GLwNaccumBlueSize "accumBlueSize" +#define GLwCAccumColorSize "AccumColorSize" +#define GLwNaccumAlphaSize "accumAlphaSize" +#define GLwCAccumAlphaSize "AccumAlphaSize" + +#ifdef __GLX_MOTIF + +typedef struct _GLwMDrawingAreaClassRec *GLwMDrawingAreaWidgetClass; +typedef struct _GLwMDrawingAreaRec *GLwMDrawingAreaWidget; + +extern WidgetClass glwMDrawingAreaWidgetClass; + + +#else + +typedef struct _GLwDrawingAreaClassRec *GLwDrawingAreaWidgetClass; +typedef struct _GLwDrawingAreaRec *GLwDrawingAreaWidget; + +extern WidgetClass glwDrawingAreaWidgetClass; + + +#endif + + +/* Callback reasons */ +#ifdef __GLX_MOTIF +#define GLwCR_EXPOSE XmCR_EXPOSE +#define GLwCR_RESIZE XmCR_RESIZE +#define GLwCR_INPUT XmCR_INPUT +#else +/* The same values as Motif, but don't use Motif constants */ +#define GLwCR_EXPOSE 38 +#define GLwCR_RESIZE 39 +#define GLwCR_INPUT 40 +#endif + +#define GLwCR_GINIT 32135 /* Arbitrary number that should neverr clash */ + +typedef struct + { + int reason; + XEvent *event; + Dimension width,height; + } + GLwDrawingAreaCallbackStruct; + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +/* front ends to glXMakeCurrent and glXSwapBuffers */ +extern void GLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx); +extern void GLwDrawingAreaSwapBuffers(Widget w); + +#ifdef __GLX_MOTIF +#ifdef _NO_PROTO +GLAPI Widget GLwCreateMDrawingArea(); +#else +GLAPI Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount); +#endif +#endif + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glw/GLwDrawAP.h xpsb-glx-0.19/mesa/src/glw/GLwDrawAP.h --- xpsb-glx-0.19/mesa/src/glw/GLwDrawAP.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/GLwDrawAP.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,130 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ +#ifndef _GLwDrawAP_h +#define _GLwDrawAP_h + + +/* MOTIF */ +#ifdef __GLX_MOTIF +#include "GLwMDrawA.h" +#else +#include "GLwDrawA.h" +#endif + +typedef struct _GLwDrawingAreaClassPart { + caddr_t extension; + } GLwDrawingAreaClassPart; + + +#ifdef __GLX_MOTIF +typedef struct _GLwMDrawingAreaClassRec { + CoreClassPart core_class; + XmPrimitiveClassPart primitive_class; + GLwDrawingAreaClassPart glwDrawingArea_class; + } GLwMDrawingAreaClassRec; + + +extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec; + + +/* XT */ +#else + +typedef struct _GLwDrawingAreaClassRec { + CoreClassPart core_class; + GLwDrawingAreaClassPart glwDrawingArea_class; + } GLwDrawingAreaClassRec; + +extern GLwDrawingAreaClassRec glwDrawingAreaClassRec; + + +#endif + + + +typedef struct { + /* resources */ + int * attribList; + XVisualInfo * visualInfo; + Boolean myList; /* TRUE if we malloced the attribList*/ + Boolean myVisual; /* TRUE if we created the visualInfo*/ + Boolean installColormap; + Boolean allocateBackground; + Boolean allocateOtherColors; + Boolean installBackground; + XtCallbackList ginitCallback; + XtCallbackList resizeCallback; + XtCallbackList exposeCallback; + XtCallbackList inputCallback; + /* specific attributes; add as we get new attributes */ + int bufferSize; + int level; + Boolean rgba; + Boolean doublebuffer; + Boolean stereo; + int auxBuffers; + int redSize; + int greenSize; + int blueSize; + int alphaSize; + int depthSize; + int stencilSize; + int accumRedSize; + int accumGreenSize; + int accumBlueSize; + int accumAlphaSize; + } GLwDrawingAreaPart; + +#ifdef __GLX_MOTIF + +typedef struct _GLwMDrawingAreaRec { + CorePart core; + XmPrimitivePart primitive; + GLwDrawingAreaPart glwDrawingArea; + } GLwMDrawingAreaRec; + +#else + +typedef struct _GLwDrawingAreaRec { + CorePart core; + GLwDrawingAreaPart glwDrawingArea; + } GLwDrawingAreaRec; + +#endif + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.c xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.c --- xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.c 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,41 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ +#ifndef __GLX_MOTIF +#define __GLX_MOTIF 1 +#endif +#include "GLwDrawA.c" diff -Nru xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.h xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.h --- xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/GLwMDrawA.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,41 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ +#ifndef __GLX_MOTIF +#define __GLX_MOTIF 1 +#endif +#include "GLwDrawA.h" diff -Nru xpsb-glx-0.19/mesa/src/glw/GLwMDrawAP.h xpsb-glx-0.19/mesa/src/glw/GLwMDrawAP.h --- xpsb-glx-0.19/mesa/src/glw/GLwMDrawAP.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/GLwMDrawAP.h 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,41 @@ +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ +#ifndef __GLX_MOTIF +#define __GLX_MOTIF 1 +#endif +#include "GLwDrawAP.h" diff -Nru xpsb-glx-0.19/mesa/src/glw/glw.pc.in xpsb-glx-0.19/mesa/src/glw/glw.pc.in --- xpsb-glx-0.19/mesa/src/glw/glw.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/glw.pc.in 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,13 @@ +prefix=@INSTALL_DIR@ +exec_prefix=${prefix} +libdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: glw +Description: Mesa OpenGL widget library +Requires: gl +Requires.private: @GLW_PC_REQ_PRIV@ +Version: @VERSION@ +Libs: -L${libdir} -lGLw +Libs.private: @GLW_PC_LIB_PRIV@ +Cflags: -I${includedir} @GLW_PC_CFLAGS@ diff -Nru xpsb-glx-0.19/mesa/src/glw/Makefile xpsb-glx-0.19/mesa/src/glw/Makefile --- xpsb-glx-0.19/mesa/src/glw/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,72 @@ +# src/glw/Makefile + +TOP = ../.. +include $(TOP)/configs/current + +MAJOR = 1 +MINOR = 0 +TINY = 0 + +INCDIRS = -I$(TOP)/include $(MOTIF_CFLAGS) $(X11_INCLUDES) + + +OBJECTS = $(GLW_SOURCES:.c=.o) + + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCDIRS) $(CFLAGS) $< + + + +##### TARGETS ##### + +default: $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME) + +# GLU pkg-config file +pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ + -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ + -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MAJOR).$(MINOR).$(TINY),' \ + -e 's,@GLW_PC_REQ_PRIV@,$(GLW_PC_REQ_PRIV),' \ + -e 's,@GLW_PC_LIB_PRIV@,$(GLW_PC_LIB_PRIV),' \ + -e 's,@GLW_PC_CFLAGS@,$(GLW_PC_CFLAGS),' +glw.pc: glw.pc.in + $(pcedit) $< > $@ + +install: glw.pc + $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) $(TOP)/$(LIB_DIR)/$(GLW_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + +clean: + -rm -f depend depend.bak + -rm -f *.o *.pc *~ + + +# Make the library +$(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS) + $(MKLIB) -o $(GLW_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(MAJOR) -minor $(MINOR) -patch $(TINY) \ + $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + -id $(INSTALL_LIB_DIR)/lib$(GLW_LIB).$(MAJOR).dylib \ + $(GLW_LIB_DEPS) $(OBJECTS) + + +# +# Run 'make depend' to update the dependencies if you change what's included +# by any source file. +# +depend: $(GLW_SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(GLW_SOURCES) \ + $(X11_INCLUDES) > /dev/null + + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glw/README xpsb-glx-0.19/mesa/src/glw/README --- xpsb-glx-0.19/mesa/src/glw/README 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glw/README 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,56 @@ + + widgets README file + + +This directory contains the source code for SGI's OpenGL Xt/Motif widgets, +slightly modified by Jeroen van der Zijp to work better with Mesa. + +To compile the widget code (producing lib/libGLw.a) cd to the widgets/ +directory and type 'make ' where is the system configuration +you used to compile Mesa (like 'make linux'). This hasn't been tested on +many systems so let us know if you have trouble. + +If you want to make a Linux ELF shared lib instead of the non-shared .a +file see the notes in the Makefile. + +If you want to build with Motif support, edit Makefile.X11, looking +for the "Motif" information. + +The SGI copyright is as follows. + + + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. diff -Nru xpsb-glx-0.19/mesa/src/glx/Makefile xpsb-glx-0.19/mesa/src/glx/Makefile --- xpsb-glx-0.19/mesa/src/glx/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/Makefile 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,12 @@ + +TOP = ../.. +include $(TOP)/configs/current + + +default: + cd mini && $(MAKE) + + +clean: + -@cd mini && $(MAKE) clean + diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/dispatch.c xpsb-glx-0.19/mesa/src/glx/mini/dispatch.c --- xpsb-glx-0.19/mesa/src/glx/mini/dispatch.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/dispatch.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,64 @@ +/** + * \file miniglx/dispatch.c + * + * \brief C-based dispatch of the OpenGL entry points (glAccum(), glBegin(), + * etc). + * + * \author Brian Paul + * + * \note This code IS NOT USED if we're compiling on an x86 system and using + * the glapi_x86.S assembly code. + */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "glheader.h" +#include "glapi.h" +#include "glapitable.h" + + +#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) + +#define KEYWORD1 + +#define KEYWORD2 + +#define NAME(func) gl##func + +#define DISPATCH(func, args, msg) \ + const struct _glapi_table *dispatch; \ + dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ + (dispatch->func) args + +#define RETURN_DISPATCH(func, args, msg) \ + const struct _glapi_table *dispatch; \ + dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ + return (dispatch->func) args + + +#include "glapitemp.h" + +#endif /* USE_X86_ASM */ diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/driver.h xpsb-glx-0.19/mesa/src/glx/mini/driver.h --- xpsb-glx-0.19/mesa/src/glx/mini/driver.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/driver.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,168 @@ +/** + * \file driver.h + * \brief DRI utility functions definitions. + * + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. + * + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. + * + * Look for more comments in the dri_util.c file. + * + * \author Kevin E. Martin + * \author Brian Paul + */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _driver_H_ +#define _driver_H_ + +#include "GL/gl.h" +#include "GL/internal/glcore.h" + +#include "drm.h" +#include "drm_sarea.h" + +/** + * \brief DRIDriverContext type. + */ +typedef struct DRIDriverContextRec { + const char *pciBusID; + int pciBus; + int pciDevice; + int pciFunc; + int chipset; + int bpp; + int cpp; + int agpmode; + int isPCI; + + int colorTiling; /**< \brief color tiling is enabled */ + + unsigned long FBStart; /**< \brief physical address of the framebuffer */ + unsigned long MMIOStart; /**< \brief physical address of the MMIO region */ + + int FBSize; /**< \brief size of the mmap'd framebuffer in bytes */ + int MMIOSize; /**< \brief size of the mmap'd MMIO region in bytes */ + + void *FBAddress; /**< \brief start of the mmap'd framebuffer */ + void *MMIOAddress; /**< \brief start of the mmap'd MMIO region */ + + /** + * \brief Client configuration details + * + * These are computed on the server and sent to clients as part of + * the initial handshaking. + */ + struct { + drm_handle_t hSAREA; + int SAREASize; + drm_handle_t hFrameBuffer; + int fbOrigin; + int fbSize; + int fbStride; + int virtualWidth; + int virtualHeight; + int Width; + } shared; + + /** + * \name From DRIInfoRec + */ + /*@{*/ + int drmFD; /**< \brief DRM device file descriptor */ + drm_sarea_t *pSAREA; + unsigned int serverContext; /**< \brief DRM context only active on server */ + /*@}*/ + + + /** + * \name Driver private + * + * Populated by __driInitFBDev() + */ + /*@{*/ + void *driverPrivate; + void *driverClientMsg; + int driverClientMsgSize; + /*@}*/ +} DRIDriverContext; + +/** + * \brief Interface to the DRI driver. + * + * This structure is retrieved from the loadable driver by the \e + * __driDriver symbol to access the Mini GLX specific hardware + * initialization and take down routines. + */ +typedef struct DRIDriverRec { + /** + * \brief Validate the framebuffer device mode + */ + int (*validateMode)( const DRIDriverContext *context ); + + /** + * \brief Examine mode returned by fbdev (may differ from the one + * requested), restore any hw regs clobbered by fbdev. + */ + int (*postValidateMode)( const DRIDriverContext *context ); + + /** + * \brief Initialize the framebuffer device. + */ + int (*initFBDev)( DRIDriverContext *context ); + + /** + * \brief Halt the framebuffer device. + */ + void (*haltFBDev)( DRIDriverContext *context ); + + + /** + * \brief Idle and shutdown hardware in preparation for a VT switch. + */ + int (*shutdownHardware)( const DRIDriverContext *context ); + + /** + * \brief Restore hardware state after regaining the VT. + */ + int (*restoreHardware)( const DRIDriverContext *context ); + + /** + * \brief Notify hardware driver of gain/loose focus. May be zero + * as this is of limited utility for most drivers. + */ + void (*notifyFocus)( int have_focus ); +} DRIDriver; + +#endif /* _driver_H_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/example.miniglx.conf xpsb-glx-0.19/mesa/src/glx/mini/example.miniglx.conf --- xpsb-glx-0.19/mesa/src/glx/mini/example.miniglx.conf 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/example.miniglx.conf 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,36 @@ +# Example miniglx configuration file (/etc/miniglx.conf) +# + +# Framebuffer device to open: Might need to change this on dual-head +# systems. +fbdevDevice=/dev/fb0 + +# Which driver? +# radeon_dri.so -- HW accelerated radeon driver +# fb_dri.so -- Software rasterizer +clientDriverName=radeon_dri.so + +# The pci bus id of the video card. Find this with scanpci, lspci or +# look in /proc/pci. +pciBusID=PCI:1:0:0 + +# Is the card PCI or AGP ? +isPCI=0 + +# Virtual screen dimensions. Can reduce this to save videocard memory +# at the expense of maximum window size available. +virtualWidth=1280 +virtualHeight=1024 + +# Screen depth. Only 16 & 32bpp supported. +bpp=32 + +# AGP Mode. Not all cards supported (1, 2 or 4) +agpmode=1 + +# Rotated monitor? -- NOTE: only works with subsetted radeon driver! +rotateMode=0 + +# Do we want to use color tiling ? +colorTiling=0 + diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/Makefile xpsb-glx-0.19/mesa/src/glx/mini/Makefile --- xpsb-glx-0.19/mesa/src/glx/mini/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/Makefile 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,88 @@ +# Build the MiniGLX libGL.so library. + +TOP = ../../.. +include $(TOP)/configs/current + + +DEFINES += -DGLX_DIRECT_RENDERING -DIN_MINI_GLX -UIN_DRI_DRIVER + +C_SOURCES = \ + $(TOP)/src/mesa/main/dispatch.c \ + $(TOP)/src/mesa/glapi/glapi.c \ + $(TOP)/src/mesa/glapi/glthread.c \ + $(TOP)/src/glx/x11/glcontextmodes.c \ + miniglx.c \ + miniglx_events.c + +X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S + +OBJECTS = $(C_SOURCES:.c=.o) \ + $(ASM_SOURCES:.S=.o) + +INCLUDES = -I. $(INCLUDE_DIRS) + +INCLUDE_DIRS = \ + -I$(TOP)/include \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/glx/x11 \ + -I$(TOP)/src/mesa/drivers/dri/common \ + $(LIBDRM_CFLAGS) \ + $(PCIACCESS_CFLAGS) + + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/miniglx.conf + + +# Make libGL +$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile + @ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major 1 -minor 2 $(MKLIB_OPTIONS) \ + -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) \ + $(LIBDRM_LIB) $(PCIACCESS_LIB) + + +# install sample miniglx.conf +$(TOP)/$(LIB_DIR)/miniglx.conf: + $(INSTALL) example.miniglx.conf $(TOP)/$(LIB_DIR)/miniglx.conf + + +drmtest: xf86drm.o drmtest.o + rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o + + +depend: $(C_SOURCES) $(ASM_SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \ + > /dev/null + + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# Dummy install target +install: + + +# Remove .o and backup files +clean: + -rm -f drmtest $(TOP)/$(LIB_DIR)/libGL.so* + -rm -f *.o *~ + -rm -f depend depend.bak + +include depend diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/miniglx.c xpsb-glx-0.19/mesa/src/glx/mini/miniglx.c --- xpsb-glx-0.19/mesa/src/glx/mini/miniglx.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/miniglx.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,2580 @@ +/** + * \file miniglx.c + * \brief Mini GLX interface functions. + * \author Brian Paul + * + * The Mini GLX interface is a subset of the GLX interface, plus a + * minimal set of Xlib functions. + */ + +/* + * Mesa 3-D graphics library + * Version: 6.0.1 + * + * Copyright (C) 1999-2004 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. + */ + + +/** + * \mainpage Mini GLX + * + * \section miniglxIntro Introduction + * + * The Mini GLX interface facilitates OpenGL rendering on embedded devices. The + * interface is a subset of the GLX interface, plus a minimal set of Xlib-like + * functions. + * + * Programs written to the Mini GLX specification should run unchanged + * on systems with the X Window System and the GLX extension (after + * recompilation). The intention is to allow flexibility for + * prototyping and testing. + * + * The files in the src/miniglx/ directory are compiled to build the + * libGL.so library. This is the library which applications link with. + * libGL.so in turn, loads the hardware-specific device driver. + * + * + * \section miniglxDoxygen About Doxygen + * + * For a list of all files, select File List. Choose a file from + * the list for a list of all functions in the file. + * + * For a list of all functions, types, constants, etc. + * select File Members. + * + * + * \section miniglxReferences References + * + * - Mini GLX Specification, + * Tungsten Graphics, Inc. + * - OpenGL Graphics with the X Window System, Silicon Graphics, Inc., + * ftp://ftp.sgi.com/opengl/doc/opengl1.2/glx1.3.ps + * - Xlib - C Language X Interface, X Consortium Standard, X Version 11, + * Release 6.4, ftp://ftp.x.org/pub/R6.4/xc/doc/hardcopy/X11/xlib.PS.gz + * - XFree86 Man pages, The XFree86 Project, Inc., + * http://www.xfree86.org/current/manindex3.html + * + */ + +/** + * \page datatypes Notes on the XVisualInfo, Visual, and __GLXvisualConfig data types + * + * -# X (unfortunately) has two (or three) data types which + * describe visuals. Ideally, there would just be one. + * -# We need the #__GLXvisualConfig type to augment #XVisualInfo and #Visual + * because we need to describe the GLX-specific attributes of visuals. + * -# In this interface there is a one-to-one-to-one correspondence between + * the three types and they're all interconnected. + * -# The #XVisualInfo type has a pointer to a #Visual. The #Visual structure + * (aka MiniGLXVisualRec) has a pointer to the #__GLXvisualConfig. The + * #Visual structure also has a pointer pointing back to the #XVisualInfo. + * -# The #XVisualInfo structure is the only one who's contents are public. + * -# The glXChooseVisual() and XGetVisualInfo() are the only functions that + * return #XVisualInfo structures. They can be freed with XFree(), though + * there is a small memory leak. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for gettimeofday */ +#include +#include + +#include "miniglxP.h" +#include "dri_util.h" + +#include "imports.h" +#include "glcontextmodes.h" +#include "glapi.h" + +#include "pciaccess.h" + +static GLboolean __glXCreateContextWithConfig(__DRInativeDisplay *dpy, + int screen, int fbconfigID, void *contextID, + drm_context_t *hHWContext); + +static GLboolean __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn, + __DRIid draw, unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, drm_clip_rect_t ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects); + +static __DRIscreen * __glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn); + +static GLboolean __glXWindowExists(__DRInativeDisplay *dpy, __DRIid draw); + +static int __glXGetUST( int64_t * ust ); + +static GLboolean __glXGetMscRate(__DRInativeDisplay * dpy, __DRIid drawable, + int32_t * numerator, int32_t * denominator); + +static GLboolean xf86DRI_DestroyContext(__DRInativeDisplay *dpy, int screen, + __DRIid context_id ); + +static GLboolean xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, + __DRIid drawable, drm_drawable_t *hHWDrawable ); + +static GLboolean xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, + __DRIid drawable); + + +/** Wrapper around either malloc() */ +void * +_mesa_malloc(size_t bytes) +{ + return malloc(bytes); +} + +/** Wrapper around either calloc() */ +void * +_mesa_calloc(size_t bytes) +{ + return calloc(1, bytes); +} + +/** Wrapper around either free() */ +void +_mesa_free(void *ptr) +{ + free(ptr); +} + + +/** + * \brief Current GLX context. + * + * \sa glXGetCurrentContext(). + */ +static GLXContext CurrentContext = NULL; + + + +static Display *SignalDisplay = 0; + +static void SwitchVT(int sig) +{ + fprintf(stderr, "SwitchVT %d dpy %p\n", sig, SignalDisplay); + + if (SignalDisplay) { + SignalDisplay->vtSignalFlag = 1; + switch( sig ) + { + case SIGUSR1: /* vt has been released */ + SignalDisplay->haveVT = 0; + break; + case SIGUSR2: /* vt has been acquired */ + SignalDisplay->haveVT = 1; + break; + } + } +} + +/**********************************************************************/ +/** \name Framebuffer device functions */ +/**********************************************************************/ +/*@{*/ + +/** + * \brief Do the first part of setting up the framebuffer device. + * + * \param dpy the display handle. + * \param use_vt use a VT for display or not + * + * \return GL_TRUE on success, or GL_FALSE on failure. + * + * \sa This is called during XOpenDisplay(). + * + * \internal + * Gets the VT number, opens the respective console TTY device. Saves its state + * to restore when exiting and goes into graphics mode. + * + * Opens the framebuffer device and make a copy of the original variable screen + * information and gets the fixed screen information. Maps the framebuffer and + * MMIO region into the process address space. + */ +static GLboolean +OpenFBDev( Display *dpy, int use_vt ) +{ + char ttystr[1000]; + int fd, vtnumber, ttyfd; + + assert(dpy); + + if (geteuid()) { + fprintf(stderr, "error: you need to be root\n"); + return GL_FALSE; + } + + if (use_vt) { + + /* open /dev/tty0 and get the VT number */ + if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { + fprintf(stderr, "error opening /dev/tty0\n"); + return GL_FALSE; + } + if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) { + fprintf(stderr, "error: couldn't get a free vt\n"); + return GL_FALSE; + } + + fprintf(stderr, "*** got vt nr: %d\n", vtnumber); + close(fd); + + /* open the console tty */ + sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */ + dpy->ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0); + if (dpy->ConsoleFD < 0) { + fprintf(stderr, "error couldn't open console fd\n"); + return GL_FALSE; + } + + /* save current vt number */ + { + struct vt_stat vts; + if (ioctl(dpy->ConsoleFD, VT_GETSTATE, &vts) == 0) + dpy->OriginalVT = vts.v_active; + } + + /* disconnect from controlling tty */ + ttyfd = open("/dev/tty", O_RDWR); + if (ttyfd >= 0) { + ioctl(ttyfd, TIOCNOTTY, 0); + close(ttyfd); + } + + /* some magic to restore the vt when we exit */ + { + struct vt_mode vt; + struct sigaction sig_tty; + + /* Set-up tty signal handler to catch the signal we request below */ + SignalDisplay = dpy; + memset( &sig_tty, 0, sizeof( sig_tty ) ); + sig_tty.sa_handler = SwitchVT; + sigemptyset( &sig_tty.sa_mask ); + if( sigaction( SIGUSR1, &sig_tty, &dpy->OrigSigUsr1 ) || + sigaction( SIGUSR2, &sig_tty, &dpy->OrigSigUsr2 ) ) + { + fprintf(stderr, "error: can't set up signal handler (%s)", + strerror(errno) ); + return GL_FALSE; + } + + + + vt.mode = VT_PROCESS; + vt.waitv = 0; + vt.relsig = SIGUSR1; + vt.acqsig = SIGUSR2; + if (ioctl(dpy->ConsoleFD, VT_SETMODE, &vt) < 0) { + fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + + if (ioctl(dpy->ConsoleFD, VT_ACTIVATE, vtnumber) != 0) + printf("ioctl VT_ACTIVATE: %s\n", strerror(errno)); + if (ioctl(dpy->ConsoleFD, VT_WAITACTIVE, vtnumber) != 0) + printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno)); + + if (ioctl(dpy->ConsoleFD, VT_GETMODE, &vt) < 0) { + fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno)); + return GL_FALSE; + } + + + + } + + /* go into graphics mode */ + if (ioctl(dpy->ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) { + fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + } + + /* open the framebuffer device */ + dpy->FrameBufferFD = open(dpy->fbdevDevice, O_RDWR); + if (dpy->FrameBufferFD < 0) { + fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); + return GL_FALSE; + } + + /* get the original variable screen info */ + if (ioctl(dpy->FrameBufferFD, FBIOGET_VSCREENINFO, &dpy->OrigVarInfo)) { + fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + /* make copy */ + dpy->VarInfo = dpy->OrigVarInfo; /* structure copy */ + + /* Turn off hw accels (otherwise mmap of mmio region will be + * refused) + */ + dpy->VarInfo.accel_flags = 0; + if (ioctl(dpy->FrameBufferFD, FBIOPUT_VSCREENINFO, &dpy->VarInfo)) { + fprintf(stderr, "error: ioctl(FBIOPUT_VSCREENINFO) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + + + /* Get the fixed screen info */ + if (ioctl(dpy->FrameBufferFD, FBIOGET_FSCREENINFO, &dpy->FixedInfo)) { + fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + + + /* mmap the framebuffer into our address space */ + dpy->driverContext.FBStart = dpy->FixedInfo.smem_start; + dpy->driverContext.FBSize = dpy->FixedInfo.smem_len; + dpy->driverContext.shared.fbSize = dpy->FixedInfo.smem_len; + dpy->driverContext.FBAddress = (caddr_t) mmap(0, /* start */ + dpy->driverContext.shared.fbSize, /* bytes */ + PROT_READ | PROT_WRITE, /* prot */ + MAP_SHARED, /* flags */ + dpy->FrameBufferFD, /* fd */ + 0 /* offset */); + if (dpy->driverContext.FBAddress == (caddr_t) - 1) { + fprintf(stderr, "error: unable to mmap framebuffer: %s\n", + strerror(errno)); + return GL_FALSE; + } + + /* mmap the MMIO region into our address space */ + dpy->driverContext.MMIOStart = dpy->FixedInfo.mmio_start; + dpy->driverContext.MMIOSize = dpy->FixedInfo.mmio_len; + dpy->driverContext.MMIOAddress = (caddr_t) mmap(0, /* start */ + dpy->driverContext.MMIOSize, /* bytes */ + PROT_READ | PROT_WRITE, /* prot */ + MAP_SHARED, /* flags */ + dpy->FrameBufferFD, /* fd */ + dpy->FixedInfo.smem_len /* offset */); + if (dpy->driverContext.MMIOAddress == (caddr_t) - 1) { + fprintf(stderr, "error: unable to mmap mmio region: %s\n", + strerror(errno)); + return GL_FALSE; + } + + fprintf(stderr, "got MMIOAddress %p offset %d\n", + dpy->driverContext.MMIOAddress, + dpy->FixedInfo.smem_len); + + return GL_TRUE; +} + + + + +/** + * \brief Setup up the desired framebuffer device mode. + * + * \param dpy the display handle. + * + * \return GL_TRUE on success, or GL_FALSE on failure. + * + * \sa This is called during __miniglx_StartServer(). + * + * \internal + * + * Bumps the size of the window the the next supported mode. Sets the + * variable screen information according to the desired mode and asks + * the driver to validate the mode. Certifies that a DirectColor or + * TrueColor visual is used from the updated fixed screen information. + * In the case of DirectColor visuals, sets up an 'identity' colormap to + * mimic a TrueColor visual. + * + * Calls the driver hooks 'ValidateMode' and 'PostValidateMode' to + * allow the driver to make modifications to the chosen mode according + * to hardware constraints, or to save and restore videocard registers + * that may be clobbered by the fbdev driver. + * + * \todo Timings are hard-coded in the source for a set of supported modes. + */ +static GLboolean +SetupFBDev( Display *dpy ) +{ + int width, height; + + assert(dpy); + + width = dpy->driverContext.shared.virtualWidth; + height = dpy->driverContext.shared.virtualHeight; + + if (width==832) + width=800; +#if 0 + /* Bump size up to next supported mode. + */ + if (width <= 720 && height <= 480) { + width = 720; height = 480; + } + else if (width <= 960 && height <= 540) { + width = 960; height = 540; + } + else if (width <= 800 && height <= 600) { + width = 800; height = 600; + } + else if (width <= 1024 && height <= 768) { + width = 1024; height = 768; + } + else if (width <= 768 && height <= 1024) { + width = 768; height = 1024; + } + else if (width <= 1280 && height <= 1024) { + width = 1280; height = 1024; + } +#endif + + dpy->driverContext.shared.fbStride = width * (dpy->driverContext.bpp / 8); + + /* set the depth, resolution, etc */ + dpy->VarInfo = dpy->OrigVarInfo; + dpy->VarInfo.bits_per_pixel = dpy->driverContext.bpp; + dpy->VarInfo.xres_virtual = dpy->driverContext.shared.virtualWidth; + dpy->VarInfo.yres_virtual = dpy->driverContext.shared.virtualHeight; + dpy->VarInfo.xres = dpy->driverContext.shared.Width; + dpy->VarInfo.yres = height; + dpy->VarInfo.xoffset = 0; + dpy->VarInfo.yoffset = 0; + dpy->VarInfo.nonstd = 0; + dpy->VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */ + + if (dpy->VarInfo.bits_per_pixel == 32) { + dpy->VarInfo.red.offset = 16; + dpy->VarInfo.green.offset = 8; + dpy->VarInfo.blue.offset = 0; + dpy->VarInfo.transp.offset = 24; + dpy->VarInfo.red.length = 8; + dpy->VarInfo.green.length = 8; + dpy->VarInfo.blue.length = 8; + dpy->VarInfo.transp.length = 8; + } + else if (dpy->VarInfo.bits_per_pixel == 16) { + dpy->VarInfo.red.offset = 11; + dpy->VarInfo.green.offset = 5; + dpy->VarInfo.blue.offset = 0; + dpy->VarInfo.red.length = 5; + dpy->VarInfo.green.length = 6; + dpy->VarInfo.blue.length = 5; + dpy->VarInfo.transp.offset = 0; + dpy->VarInfo.transp.length = 0; + } + else { + fprintf(stderr, "Only 32bpp and 16bpp modes supported at the moment\n"); + return 0; + } + + if (!dpy->driver->validateMode( &dpy->driverContext )) { + fprintf(stderr, "Driver validateMode() failed\n"); + return 0; + } + + /* These should be calculated with the gtf.c program, and then we could + remove all this... AlanH. */ + if (dpy->VarInfo.xres == 1280 && + dpy->VarInfo.yres == 1024) { + /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */ + dpy->VarInfo.pixclock = 7408; + dpy->VarInfo.left_margin = 248; + dpy->VarInfo.right_margin = 16; + dpy->VarInfo.upper_margin = 38; + dpy->VarInfo.lower_margin = 1; + dpy->VarInfo.hsync_len = 144; + dpy->VarInfo.vsync_len = 3; + } + else if (dpy->VarInfo.xres == 1024 && + dpy->VarInfo.yres == 768) { + /* timing values taken from /etc/fb.modes (1024x768 @ 75Hz) */ + dpy->VarInfo.pixclock = 12699; + dpy->VarInfo.left_margin = 176; + dpy->VarInfo.right_margin = 16; + dpy->VarInfo.upper_margin = 28; + dpy->VarInfo.lower_margin = 1; + dpy->VarInfo.hsync_len = 96; + dpy->VarInfo.vsync_len = 3; + } + else if (dpy->VarInfo.xres == 800 && + dpy->VarInfo.yres == 600) { + /* timing values taken from /etc/fb.modes (800x600 @ 75Hz) */ + dpy->VarInfo.pixclock = 27778; + dpy->VarInfo.left_margin = 128; + dpy->VarInfo.right_margin = 24; + dpy->VarInfo.upper_margin = 22; + dpy->VarInfo.lower_margin = 1; + dpy->VarInfo.hsync_len = 72; + dpy->VarInfo.vsync_len = 2; + } + else if (dpy->VarInfo.xres == 720 && + dpy->VarInfo.yres == 480) { + dpy->VarInfo.pixclock = 37202; + dpy->VarInfo.left_margin = 88; + dpy->VarInfo.right_margin = 16; + dpy->VarInfo.upper_margin = 14; + dpy->VarInfo.lower_margin = 1; + dpy->VarInfo.hsync_len = 72; + dpy->VarInfo.vsync_len = 3; + } + else if (dpy->VarInfo.xres == 960 && + dpy->VarInfo.yres == 540) { + dpy->VarInfo.pixclock = 24273; + dpy->VarInfo.left_margin = 128; + dpy->VarInfo.right_margin = 32; + dpy->VarInfo.upper_margin = 16; + dpy->VarInfo.lower_margin = 1; + dpy->VarInfo.hsync_len = 96; + dpy->VarInfo.vsync_len = 3; + } + else if (dpy->VarInfo.xres == 768 && + dpy->VarInfo.yres == 1024) { + /* timing values for 768x1024 @ 75Hz */ + dpy->VarInfo.pixclock = 11993; + dpy->VarInfo.left_margin = 136; + dpy->VarInfo.right_margin = 32; + dpy->VarInfo.upper_margin = 41; + dpy->VarInfo.lower_margin = 1; + dpy->VarInfo.hsync_len = 80; + dpy->VarInfo.vsync_len = 3; + } + else { + /* XXX need timings for other screen sizes */ + fprintf(stderr, "XXXX screen size %d x %d not supported at this time!\n", + dpy->VarInfo.xres, dpy->VarInfo.yres); + return GL_FALSE; + } + + fprintf(stderr, "[miniglx] Setting mode: visible %dx%d virtual %dx%dx%d\n", + dpy->VarInfo.xres, dpy->VarInfo.yres, + dpy->VarInfo.xres_virtual, dpy->VarInfo.yres_virtual, + dpy->VarInfo.bits_per_pixel); + + /* set variable screen info */ + if (ioctl(dpy->FrameBufferFD, FBIOPUT_VSCREENINFO, &dpy->VarInfo)) { + fprintf(stderr, "error: ioctl(FBIOPUT_VSCREENINFO) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + /* get the variable screen info, in case it has been modified */ + if (ioctl(dpy->FrameBufferFD, FBIOGET_VSCREENINFO, &dpy->VarInfo)) { + fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + + fprintf(stderr, "[miniglx] Readback mode: visible %dx%d virtual %dx%dx%d\n", + dpy->VarInfo.xres, dpy->VarInfo.yres, + dpy->VarInfo.xres_virtual, dpy->VarInfo.yres_virtual, + dpy->VarInfo.bits_per_pixel); + + /* Get the fixed screen info */ + if (ioctl(dpy->FrameBufferFD, FBIOGET_FSCREENINFO, &dpy->FixedInfo)) { + fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", + strerror(errno)); + return GL_FALSE; + } + + if (dpy->FixedInfo.visual != FB_VISUAL_TRUECOLOR && + dpy->FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) { + fprintf(stderr, "non-TRUECOLOR visuals not supported.\n"); + return GL_FALSE; + } + + if (dpy->FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { + struct fb_cmap cmap; + unsigned short red[256], green[256], blue[256]; + int rcols = 1 << dpy->VarInfo.red.length; + int gcols = 1 << dpy->VarInfo.green.length; + int bcols = 1 << dpy->VarInfo.blue.length; + int i; + + cmap.start = 0; + cmap.len = gcols; + cmap.red = red; + cmap.green = green; + cmap.blue = blue; + cmap.transp = NULL; + + for (i = 0; i < rcols ; i++) + red[i] = (65536/(rcols-1)) * i; + + for (i = 0; i < gcols ; i++) + green[i] = (65536/(gcols-1)) * i; + + for (i = 0; i < bcols ; i++) + blue[i] = (65536/(bcols-1)) * i; + + if (ioctl(dpy->FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) { + fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i); + exit(1); + } + } + + /* May need to restore regs fbdev has clobbered: + */ + if (!dpy->driver->postValidateMode( &dpy->driverContext )) { + fprintf(stderr, "Driver postValidateMode() failed\n"); + return 0; + } + + return GL_TRUE; +} + + +/** + * \brief Restore the framebuffer device to state it was in before we started + * + * Undoes the work done by SetupFBDev(). + * + * \param dpy the display handle. + * + * \return GL_TRUE on success, or GL_FALSE on failure. + * + * \sa Called from XDestroyWindow(). + * + * \internal + * Restores the original variable screen info. + */ +static GLboolean +RestoreFBDev( Display *dpy ) +{ + /* restore original variable screen info */ + if (ioctl(dpy->FrameBufferFD, FBIOPUT_VSCREENINFO, &dpy->OrigVarInfo)) { + fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", + strerror(errno)); + return GL_FALSE; + } + dpy->VarInfo = dpy->OrigVarInfo; + + return GL_TRUE; +} + + +/** + * \brief Close the framebuffer device. + * + * \param dpy the display handle. + * + * \sa Called from XCloseDisplay(). + * + * \internal + * Unmaps the framebuffer and MMIO region. Restores the text mode and the + * original virtual terminal. Closes the console and framebuffer devices. + */ +static void +CloseFBDev( Display *dpy ) +{ + struct vt_mode VT; + + munmap(dpy->driverContext.FBAddress, dpy->driverContext.FBSize); + munmap(dpy->driverContext.MMIOAddress, dpy->driverContext.MMIOSize); + + if (dpy->ConsoleFD) { + /* restore text mode */ + ioctl(dpy->ConsoleFD, KDSETMODE, KD_TEXT); + + /* set vt */ + if (ioctl(dpy->ConsoleFD, VT_GETMODE, &VT) != -1) { + VT.mode = VT_AUTO; + ioctl(dpy->ConsoleFD, VT_SETMODE, &VT); + } + + /* restore original vt */ + if (dpy->OriginalVT >= 0) { + ioctl(dpy->ConsoleFD, VT_ACTIVATE, dpy->OriginalVT); + dpy->OriginalVT = -1; + } + + close(dpy->ConsoleFD); + } + close(dpy->FrameBufferFD); +} + +/*@}*/ + + +/**********************************************************************/ +/** \name Misc functions needed for DRI drivers */ +/**********************************************************************/ +/*@{*/ + +/** + * \brief Find the DRI screen dependent methods associated with the display. + * + * \param dpy a display handle, as returned by XOpenDisplay(). + * \param scrn the screen number. Not referenced. + * + * \returns a pointer to a __DRIscreenRec structure. + * + * \internal + * Returns the MiniGLXDisplayRec::driScreen attribute. + */ +static __DRIscreen * +__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn) +{ + (void) scrn; + return &((Display*)dpy)->driScreen; +} + +/** + * \brief Validate a drawable. + * + * \param dpy a display handle, as returned by XOpenDisplay(). + * \param draw drawable to validate. + * + * \internal + * Since Mini GLX only supports one window, compares the specified drawable with + * the MiniGLXDisplayRec::TheWindow attribute. + */ +static GLboolean +__glXWindowExists(__DRInativeDisplay *dpy, __DRIid draw) +{ + const Display * const display = (Display*)dpy; + if (display->TheWindow == (Window) draw) + return True; + else + return False; +} + +/** + * \brief Get current thread ID. + * + * \return thread ID. + * + * \internal + * Always returns 0. + */ +/*unsigned long +_glthread_GetID(void) +{ + return 0; +}*/ + +/*@}*/ + + +/** + * \brief Scan Linux /prog/bus/pci/devices file to determine hardware + * chipset based on supplied bus ID. + * + * \return probed chipset (non-zero) on success, zero otherwise. + * + * \internal + */ +static int get_chipset_from_busid( Display *dpy ) +{ + char buf[0x200]; + FILE *file; + const char *fname = "/proc/bus/pci/devices"; + int retval = 0; + + if (!(file = fopen(fname,"r"))) { + fprintf(stderr, "couldn't open %s: %s\n", fname, strerror(errno)); + return 0; + } + + while (fgets(buf, sizeof(buf)-1, file)) { + unsigned int nr, bus, dev, fn, vendor, device, encode; + nr = sscanf(buf, "%04x\t%04x%04x", &encode, + &vendor, &device); + + bus = encode >> 8; + dev = (encode & 0xFF) >> 3; + fn = encode & 0x7; + + if (nr != 3) + break; + + if (bus == dpy->driverContext.pciBus && + dev == dpy->driverContext.pciDevice && + fn == dpy->driverContext.pciFunc) { + retval = device; + break; + } + } + + fclose(file); + + if (retval) + fprintf(stderr, "[miniglx] probed chipset 0x%x\n", retval); + else + fprintf(stderr, "[miniglx] failed to probe chipset\n"); + + return retval; +} + + +/** + * \brief Read settings from a configuration file. + * + * The configuration file is usually "/etc/miniglx.conf", but can be overridden + * with the MINIGLX_CONF environment variable. + * + * The format consists in \code option = value \endcode lines. The option names + * corresponds to the fields in MiniGLXDisplayRec. + * + * \param dpy the display handle as. + * + * \return non-zero on success, zero otherwise. + * + * \internal + * Sets some defaults. Opens and parses the the Mini GLX configuration file and + * fills in the MiniGLXDisplayRec field that corresponds for each option. + */ +static int __read_config_file( Display *dpy ) +{ + FILE *file; + const char *fname; + + /* Fallback/defaults + */ + dpy->fbdevDevice = "/dev/fb0"; + dpy->clientDriverName = "fb_dri.so"; + dpy->driverContext.pciBus = 0; + dpy->driverContext.pciDevice = 0; + dpy->driverContext.pciFunc = 0; + dpy->driverContext.chipset = 0; + dpy->driverContext.pciBusID = 0; + dpy->driverContext.shared.virtualWidth = 1280; + dpy->driverContext.shared.virtualHeight = 1024; + dpy->driverContext.bpp = 32; + dpy->driverContext.cpp = 4; + dpy->rotateMode = 0; + dpy->driverContext.agpmode = 1; + dpy->driverContext.isPCI = 0; + dpy->driverContext.colorTiling = 0; + + fname = getenv("MINIGLX_CONF"); + if (!fname) fname = "/etc/miniglx.conf"; + + file = fopen(fname, "r"); + if (!file) { + fprintf(stderr, "couldn't open config file %s: %s\n", fname, strerror(errno)); + return 0; + } + + + while (!feof(file)) { + char buf[81], *opt = buf, *val, *tmp1, *tmp2; + fgets(buf, sizeof(buf), file); + + /* Parse 'opt = val' -- must be easier ways to do this. + */ + while (isspace(*opt)) opt++; + val = opt; + if (*val == '#') continue; /* comment */ + while (!isspace(*val) && *val != '=' && *val) val++; + tmp1 = val; + while (isspace(*val)) val++; + if (*val != '=') continue; + *tmp1 = 0; + val++; + while (isspace(*val)) val++; + tmp2 = val; + while (!isspace(*tmp2) && *tmp2 != '\n' && *tmp2) tmp2++; + *tmp2 = 0; + + + if (strcmp(opt, "fbdevDevice") == 0) + dpy->fbdevDevice = strdup(val); + else if (strcmp(opt, "clientDriverName") == 0) + dpy->clientDriverName = strdup(val); + else if (strcmp(opt, "rotateMode") == 0) + dpy->rotateMode = atoi(val) ? 1 : 0; + else if (strcmp(opt, "pciBusID") == 0) { + if (sscanf(val, "PCI:%d:%d:%d", + &dpy->driverContext.pciBus, + &dpy->driverContext.pciDevice, + &dpy->driverContext.pciFunc) != 3) { + fprintf(stderr, "malformed bus id: %s\n", val); + continue; + } + dpy->driverContext.pciBusID = strdup(val); + } + else if (strcmp(opt, "chipset") == 0) { + if (sscanf(val, "0x%x", &dpy->driverContext.chipset) != 1) + fprintf(stderr, "malformed chipset: %s\n", opt); + } + else if (strcmp(opt, "virtualWidth") == 0) { + if (sscanf(val, "%d", &dpy->driverContext.shared.virtualWidth) != 1) + fprintf(stderr, "malformed virtualWidth: %s\n", opt); + } + else if (strcmp(opt, "virtualHeight") == 0) { + if (sscanf(val, "%d", &dpy->driverContext.shared.virtualHeight) != 1) + fprintf(stderr, "malformed virutalHeight: %s\n", opt); + } + else if (strcmp(opt, "bpp") == 0) { + if (sscanf(val, "%d", &dpy->driverContext.bpp) != 1) + fprintf(stderr, "malformed bpp: %s\n", opt); + dpy->driverContext.cpp = dpy->driverContext.bpp / 8; + } + else if (strcmp(opt, "agpmode") == 0) { + if (sscanf(val, "%d", &dpy->driverContext.agpmode) != 1) + fprintf(stderr, "malformed agpmode: %s\n", opt); + } + else if (strcmp(opt, "isPCI") == 0) { + dpy->driverContext.isPCI = atoi(val) ? 1 : 0; + } + else if (strcmp(opt, "colorTiling") == 0) { + dpy->driverContext.colorTiling = atoi(val) ? 1 : 0; + } + } + + fclose(file); + + if (dpy->driverContext.chipset == 0 && dpy->driverContext.pciBusID != 0) + dpy->driverContext.chipset = get_chipset_from_busid( dpy ); + + return 1; +} + +/** + * Versioned name of the expected \c __driCreateNewScreen function. + * + * The version of the last incompatible loader/driver inteface change is + * appended to the name of the \c __driCreateNewScreen function. This + * prevents loaders from trying to load drivers that are too old. + * + * \todo + * Create a macro or something so that this is automatically updated. + */ +static const char createNewScreenName[] = "__driCreateNewScreen_20050727"; + + +static int InitDriver( Display *dpy ) +{ + /* + * Begin DRI setup. + * We're kind of combining the per-display and per-screen information + * which was kept separate in XFree86/DRI's libGL. + */ + dpy->dlHandle = dlopen(dpy->clientDriverName, RTLD_NOW | RTLD_GLOBAL); + if (!dpy->dlHandle) { + fprintf(stderr, "Unable to open %s: %s\n", dpy->clientDriverName, + dlerror()); + goto failed; + } + + /* Pull in Mini GLX specific hooks: + */ + dpy->driver = (struct DRIDriverRec *) dlsym(dpy->dlHandle, + "__driDriver"); + if (!dpy->driver) { + fprintf(stderr, "Couldn't find __driDriver in %s\n", + dpy->clientDriverName); + goto failed; + } + + /* Pull in standard DRI client-side driver hooks: + */ + dpy->createNewScreen = (PFNCREATENEWSCREENFUNC) + dlsym(dpy->dlHandle, createNewScreenName); + if (!dpy->createNewScreen) { + fprintf(stderr, "Couldn't find %s in %s\n", createNewScreenName, + dpy->clientDriverName); + goto failed; + } + + return GL_TRUE; + +failed: + if (dpy->dlHandle) { + dlclose(dpy->dlHandle); + dpy->dlHandle = 0; + } + return GL_FALSE; +} + + +/**********************************************************************/ +/** \name Public API functions (Xlib and GLX) */ +/**********************************************************************/ +/*@{*/ + + +/** + * \brief Initialize the graphics system. + * + * \param display_name currently ignored. It is recommended to pass it as NULL. + * \return a pointer to a #Display if the function is able to initialize + * the graphics system, NULL otherwise. + * + * Allocates a MiniGLXDisplayRec structure and fills in with information from a + * configuration file. + * + * Calls OpenFBDev() to open the framebuffer device and calls + * DRIDriverRec::initFBDev to do the client-side initialization on it. + * + * Loads the DRI driver and pulls in Mini GLX specific hooks into a + * DRIDriverRec structure, and the standard DRI \e __driCreateScreen hook. + * Asks the driver for a list of supported visuals. Performs the per-screen + * client-side initialization. Also setups the callbacks in the screen private + * information. + * + * Does the framebuffer device setup. Calls __miniglx_open_connections() to + * serve clients. + */ +Display * +__miniglx_StartServer( const char *display_name ) +{ + Display *dpy; + int use_vt = 0; + + pci_system_init(); + + dpy = (Display *)calloc(1, sizeof(Display)); + if (!dpy) + return NULL; + + dpy->IsClient = False; + + if (!__read_config_file( dpy )) { + fprintf(stderr, "Couldn't get configuration details\n"); + free(dpy); + return NULL; + } + + /* Open the fbdev device + */ + if (!OpenFBDev(dpy, use_vt)) { + fprintf(stderr, "OpenFBDev failed\n"); + free(dpy); + return NULL; + } + + if (!InitDriver(dpy)) { + fprintf(stderr, "InitDriver failed\n"); + free(dpy); + return NULL; + } + + /* Perform the initialization normally done in the X server + */ + if (!dpy->driver->initFBDev( &dpy->driverContext )) { + fprintf(stderr, "%s: __driInitFBDev failed\n", __FUNCTION__); + dlclose(dpy->dlHandle); + return GL_FALSE; + } + + /* do fbdev setup + */ + if (!SetupFBDev(dpy)) { + fprintf(stderr, "SetupFBDev failed\n"); + free(dpy); + return NULL; + } + + /* unlock here if not using VT -- JDS */ + if (!use_vt) { + if (dpy->driver->restoreHardware) + dpy->driver->restoreHardware( &dpy->driverContext ); + DRM_UNLOCK( dpy->driverContext.drmFD, + dpy->driverContext.pSAREA, + dpy->driverContext.serverContext ); + dpy->hwActive = 1; + } + + /* Ready for clients: + */ + if (!__miniglx_open_connections(dpy)) { + free(dpy); + return NULL; + } + + return dpy; +} + + +/** + * Implement \c __DRIinterfaceMethods::getProcAddress. + */ +static __DRIfuncPtr get_proc_address( const char * proc_name ) +{ + (void) proc_name; + return NULL; +} + + +/** + * Table of functions exported by the loader to the driver. + */ +static const __DRIinterfaceMethods interface_methods = { + get_proc_address, + + _gl_context_modes_create, + _gl_context_modes_destroy, + + __glXFindDRIScreen, + __glXWindowExists, + + __glXCreateContextWithConfig, + xf86DRI_DestroyContext, + + xf86DRI_CreateDrawable, + xf86DRI_DestroyDrawable, + __glXGetDrawableInfo, + + __glXGetUST, + __glXGetMscRate, +}; + + +static void * +CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc) +{ + void *psp = NULL; + drm_handle_t hSAREA; + drmAddress pSAREA; + const char *BusID; + int i; + __DRIversion ddx_version; + __DRIversion dri_version; + __DRIversion drm_version; + __DRIframebuffer framebuffer; + int fd = -1; + int status; + const char * err_msg; + const char * err_extra; + drmVersionPtr version; + drm_handle_t hFB; + drm_magic_t magic; + + + hSAREA = dpy->driverContext.shared.hSAREA; + BusID = dpy->driverContext.pciBusID; + + fd = drmOpen(NULL, BusID); + + err_msg = "open DRM"; + err_extra = strerror( -fd ); + + if (fd < 0) goto done; + + err_msg = "drmGetMagic"; + err_extra = NULL; + + if (drmGetMagic(fd, &magic)) goto done; + + dpy->authorized = False; + send_char_msg( dpy, 0, _Authorize ); + send_msg( dpy, 0, &magic, sizeof(magic)); + + /* force net buffer flush */ + while (!dpy->authorized) + handle_fd_events( dpy, 0 ); + + version = drmGetVersion(fd); + if (version) { + drm_version.major = version->version_major; + drm_version.minor = version->version_minor; + drm_version.patch = version->version_patchlevel; + drmFreeVersion(version); + } + else { + drm_version.major = -1; + drm_version.minor = -1; + drm_version.patch = -1; + } + + /* + * Get device name (like "tdfx") and the ddx version numbers. + * We'll check the version in each DRI driver's "createScreen" + * function. + */ + ddx_version.major = -1; + ddx_version.minor = 0; + ddx_version.patch = 0; + + /* + * Get the DRI X extension version. + */ + dri_version.major = 4; + dri_version.minor = 0; + dri_version.patch = 0; + + /* + * Get device-specific info. pDevPriv will point to a struct + * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) + * that has information about the screen size, depth, pitch, + * ancilliary buffers, DRM mmap handles, etc. + */ + hFB = dpy->driverContext.shared.hFrameBuffer; + framebuffer.size = dpy->driverContext.shared.fbSize; + framebuffer.stride = dpy->driverContext.shared.fbStride; + framebuffer.dev_priv_size = dpy->driverContext.driverClientMsgSize; + framebuffer.dev_priv = dpy->driverContext.driverClientMsg; + framebuffer.width = dpy->driverContext.shared.virtualWidth; + framebuffer.height = dpy->driverContext.shared.virtualHeight; + + /* + * Map the framebuffer region. + */ + status = drmMap(fd, hFB, framebuffer.size, + (drmAddressPtr)&framebuffer.base); + + err_msg = "drmMap of framebuffer"; + err_extra = strerror( -status ); + + if ( status != 0 ) goto done; + + /* + * Map the SAREA region. Further mmap regions may be setup in + * each DRI driver's "createScreen" function. + */ + status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA); + + err_msg = "drmMap of sarea"; + err_extra = strerror( -status ); + + if ( status == 0 ) { + err_msg = "InitDriver"; + err_extra = NULL; + psp = dpy->createNewScreen(dpy, scrn, psc, NULL, + & ddx_version, + & dri_version, + & drm_version, + & framebuffer, + pSAREA, + fd, + 20050727, + & interface_methods, + (__GLcontextModes **) &dpy->driver_modes); + + /* fill in dummy visual ids */ + { + __GLcontextModes *temp; + temp = (__GLcontextModes *)dpy->driver_modes; + i = 1; + while (temp) + { + temp->visualID = i++; + temp=temp->next; + } + } + } + +done: + if ( psp == NULL ) { + if ( pSAREA != MAP_FAILED ) { + (void)drmUnmap(pSAREA, SAREA_MAX); + } + + if ( framebuffer.base != MAP_FAILED ) { + (void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size); + } + + if ( framebuffer.dev_priv != NULL ) { + free(framebuffer.dev_priv); + } + + if ( fd >= 0 ) { + (void)drmClose(fd); + } + + if ( err_extra != NULL ) { + fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg, + err_extra); + } + else { + fprintf(stderr, "libGL error: %s failed\n", err_msg ); + } + + fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n"); + } + + return psp; +} + +/** + * \brief Initialize the graphics system. + * + * \param display_name currently ignored. It is recommended to pass it as NULL. + * \return a pointer to a #Display if the function is able to initialize + * the graphics system, NULL otherwise. + * + * Allocates a MiniGLXDisplayRec structure and fills in with information from a + * configuration file. + * + * Calls __miniglx_open_connections() to connect to the server. + * + * Loads the DRI driver and pulls in Mini GLX specific hooks into a + * DRIDriverRec structure, and the standard DRI \e __driCreateScreen hook. + * Asks the driver for a list of supported visuals. Performs the per-screen + * client-side initialization. Also setups the callbacks in the screen private + * information. + * + * \todo + * - read config file + * - what about virtualWidth, etc? + * - determine dpy->driverClientMsgSize, + * - allocate dpy->driverClientMsg + */ +Display * +XOpenDisplay( const char *display_name ) +{ + Display *dpy; + + dpy = (Display *)calloc(1, sizeof(Display)); + if (!dpy) + return NULL; + + dpy->IsClient = True; + + /* read config file + */ + if (!__read_config_file( dpy )) { + fprintf(stderr, "Couldn't get configuration details\n"); + free(dpy); + return NULL; + } + + /* Connect to the server and receive driverClientMsg + */ + if (!__miniglx_open_connections(dpy)) { + free(dpy); + return NULL; + } + + /* dlopen the driver .so file + */ + if (!InitDriver(dpy)) { + fprintf(stderr, "InitDriver failed\n"); + free(dpy); + return NULL; + } + + /* Perform the client-side initialization. + * + * Clearly there is a limit of one on the number of windows in + * existence at any time. + * + * Need to shut down DRM and free DRI data in XDestroyWindow(), too. + */ + dpy->driScreen.private = CallCreateNewScreen(dpy, 0, &dpy->driScreen); + if (!dpy->driScreen.private) { + fprintf(stderr, "%s: __driCreateScreen failed\n", __FUNCTION__); + dlclose(dpy->dlHandle); + free(dpy); + return NULL; + } + + /* Anything more to do? + */ + return dpy; +} + + +/** + * \brief Release display resources. + * + * When the application is about to exit, the resources associated with the + * graphics system can be released by calling this function. + * + * \param dpy display handle. It becomes invalid at this point. + * + * Destroys the window if any, and destroys the per-screen + * driver private information. + * Calls __miniglx_close_connections(). + * + * If a server, puts the the framebuffer back into the initial state. + * + * Finally frees the display structure. + */ +void +XCloseDisplay( Display *dpy ) +{ + glXMakeCurrent( dpy, NULL, NULL); + + if (dpy->NumWindows) + XDestroyWindow( dpy, dpy->TheWindow ); + + /* As this is done in XOpenDisplay, need to undo it here: + */ + dpy->driScreen.destroyScreen(dpy, 0, dpy->driScreen.private); + + __miniglx_close_connections( dpy ); + + if (!dpy->IsClient) { + /* put framebuffer back to initial state + */ + (*dpy->driver->haltFBDev)( &dpy->driverContext ); + RestoreFBDev(dpy); + CloseFBDev(dpy); + } + + dlclose(dpy->dlHandle); + free(dpy); +} + + +/** + * \brief Window creation. + * + * \param display a display handle, as returned by XOpenDisplay(). + * \param parent the parent window for the new window. For Mini GLX this should + * be + * \code RootWindow(display, 0) \endcode + * \param x the window abscissa. For Mini GLX, it should be zero. + * \param y the window ordinate. For Mini GLX, it should be zero. + * \param width the window width. For Mini GLX, this specifies the desired + * screen width such as 1024 or 1280. + * \param height the window height. For Mini GLX, this specifies the desired + * screen height such as 768 or 1024. + * \param border_width the border width. For Mini GLX, it should be zero. + * \param depth the window pixel depth. For Mini GLX, this should be the depth + * found in the #XVisualInfo object returned by glXChooseVisual() + * \param winclass the window class. For Mini GLX this value should be + * #InputOutput. + * \param visual the visual type. It should be the visual field of the + * #XVisualInfo object returned by glXChooseVisual(). + * \param valuemask which fields of the XSetWindowAttributes() are to be used. + * For Mini GLX this is typically the bitmask + * \code CWBackPixel | CWBorderPixel | CWColormap \endcode + * \param attributes initial window attributes. The + * XSetWindowAttributes::background_pixel, XSetWindowAttributes::border_pixel + * and XSetWindowAttributes::colormap fields should be set. + * + * \return a window handle if it succeeds or zero if it fails. + * + * \note For Mini GLX, windows are full-screen; they cover the entire frame + * buffer. Also, Mini GLX imposes a limit of one window. A second window + * cannot be created until the first one is destroyed. + * + * This function creates and initializes a ::MiniGLXWindowRec structure after + * ensuring that there is no other window created. Performs the per-drawable + * client-side initialization calling the __DRIscreenRec::createDrawable + * method. + * + */ +Window +XCreateWindow( Display *dpy, Window parent, int x, int y, + unsigned int width, unsigned int height, + unsigned int border_width, int depth, unsigned int winclass, + Visual *visual, unsigned long valuemask, + XSetWindowAttributes *attributes ) +{ + const int empty_attribute_list[1] = { None }; + + Window win; + + /* ignored */ + (void) x; + (void) y; + (void) border_width; + (void) depth; + (void) winclass; + (void) valuemask; + (void) attributes; + + if (!dpy->IsClient) { + fprintf(stderr, "Server process may not create windows (currently)\n"); + return NULL; + } + + if (dpy->NumWindows > 0) + return NULL; /* only allow one window */ + + assert(dpy->TheWindow == NULL); + + win = malloc(sizeof(struct MiniGLXWindowRec)); + if (!win) + return NULL; + + /* In rotated mode, translate incoming x,y,width,height into + * 'normal' coordinates. + */ + if (dpy->rotateMode) { + int tmp; + tmp = width; width = height; height = tmp; + tmp = x; x = y; y = tmp; + } + + /* init other per-window fields */ + win->x = x; + win->y = y; + win->w = width; + win->h = height; + win->visual = visual; /* ptr assignment */ + + win->bytesPerPixel = dpy->driverContext.cpp; + win->rowStride = dpy->driverContext.shared.virtualWidth * win->bytesPerPixel; + win->size = win->rowStride * height; + win->frontStart = dpy->driverContext.FBAddress + (win->rowStride * win->x) + (win->y * win->bytesPerPixel); + win->frontBottom = (GLubyte *) win->frontStart + (height-1) * win->rowStride; + + /* This is incorrect: the hardware driver could put the backbuffer + * just about anywhere. These fields, including the above are + * hardware dependent & don't really belong here. + */ + if (visual->mode->doubleBufferMode) { + win->backStart = (GLubyte *) win->frontStart + + win->rowStride * dpy->driverContext.shared.virtualHeight; + win->backBottom = (GLubyte *) win->backStart + + (height - 1) * win->rowStride; + win->curBottom = win->backBottom; + } + else { + /* single buffered */ + win->backStart = NULL; + win->backBottom = NULL; + win->curBottom = win->frontBottom; + } + + dpy->driScreen.createNewDrawable(dpy, visual->mode, (int) win, + &win->driDrawable, GLX_WINDOW_BIT, empty_attribute_list); + + if (!win->driDrawable.private) { + fprintf(stderr, "%s: dri.createDrawable failed\n", __FUNCTION__); + free(win); + return NULL; + } + + dpy->NumWindows++; + dpy->TheWindow = win; + + return win; +} + + +/** + * \brief Destroy window. + * + * \param display display handle. + * \param w window handle. + * + * This function calls XUnmapWindow() and frees window \p w. + * + * In case of destroying the current buffer first unbinds the GLX context + * by calling glXMakeCurrent() with no drawable. + */ +void +XDestroyWindow( Display *display, Window win ) +{ + if (display && display->IsClient && win) { + /* check if destroying the current buffer */ + Window curDraw = glXGetCurrentDrawable(); + if (win == curDraw) { + glXMakeCurrent( display, NULL, NULL); + } + + XUnmapWindow( display, win ); + + /* Destroy the drawable. */ + win->driDrawable.destroyDrawable(display, win->driDrawable.private); + free(win); + + /* unlink window from display */ + display->NumWindows--; + assert(display->NumWindows == 0); + display->TheWindow = NULL; + } +} + + + + +/** + * \brief Create color map structure. + * + * \param dpy the display handle as returned by XOpenDisplay(). + * \param w the window on whose screen you want to create a color map. This + * parameter is ignored by Mini GLX but should be the value returned by the + * \code RootWindow(display, 0) \endcode macro. + * \param visual a visual type supported on the screen. This parameter is + * ignored by Mini GLX but should be the XVisualInfo::visual returned by + * glXChooseVisual(). + * \param alloc the color map entries to be allocated. This parameter is ignored + * by Mini GLX but should be set to #AllocNone. + * + * \return the color map. + * + * This function is only provided to ease porting. Practically a no-op - + * returns a pointer to a dynamically allocated chunk of memory (one byte). + */ +Colormap +XCreateColormap( Display *dpy, Window w, Visual *visual, int alloc ) +{ + (void) dpy; + (void) w; + (void) visual; + (void) alloc; + return (Colormap) malloc(1); +} + + +/** + * \brief Destroy color map structure. + * + * \param display The display handle as returned by XOpenDisplay(). + * \param colormap the color map to destroy. + * + * This function is only provided to ease porting. Practically a no-op. + * + * Frees the memory pointed by \p colormap. + */ +void +XFreeColormap( Display *display, Colormap colormap ) +{ + (void) display; + (void) colormap; + free(colormap); +} + + +/** + * \brief Free client data. + * + * \param data the data that is to be freed. + * + * Frees the memory pointed by \p data. + */ +void +XFree( void *data ) +{ + free(data); +} + + +/** + * \brief Query available visuals. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param vinfo_mask a bitmask indicating which fields of the \p vinfo_template + * are to be matched. The value must be \c VisualScreenMask. + * \param vinfo_template a template whose fields indicate which visual + * attributes must be matched by the results. The XVisualInfo::screen field of + * this structure must be zero. + * \param nitens_return will hold the number of visuals returned. + * + * \return the address of an array of all available visuals. + * + * An example of using XGetVisualInfo() to get all available visuals follows: + * + * \code + * XVisualInfo vinfo_template, *results; + * int nitens_return; + * Display *dpy = XOpenDisplay(NULL); + * vinfo_template.screen = 0; + * results = XGetVisualInfo(dpy, VisualScreenMask, &vinfo_template, &nitens_return); + * \endcode + * + * Returns the list of all ::XVisualInfo available, one per + * ::__GLcontextMode stored in MiniGLXDisplayRec::modes. + */ +XVisualInfo * +XGetVisualInfo( Display *dpy, long vinfo_mask, XVisualInfo *vinfo_template, int *nitens_return ) +{ + const __GLcontextModes *mode; + XVisualInfo *results; + Visual *visResults; + int i, n=0; + + // ASSERT(vinfo_mask == VisualScreenMask); + ASSERT(vinfo_template.screen == 0); + + if (vinfo_mask == VisualIDMask) + { + for ( mode = dpy->driver_modes ; mode != NULL ; mode= mode->next ) + if (mode->visualID == vinfo_template->visualid) + n=1; + + if (n==0) + return NULL; + + results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo)); + if (!results) { + *nitens_return = 0; + return NULL; + } + + visResults = (Visual *)calloc(1, n * sizeof(Visual)); + if (!results) { + free(results); + *nitens_return = 0; + return NULL; + } + + for ( mode = dpy->driver_modes ; mode != NULL ; mode= mode->next ) + if (mode->visualID == vinfo_template->visualid) + { + visResults[0].mode=mode; + visResults[0].visInfo = results; + visResults[0].dpy = dpy; + if (dpy->driverContext.bpp == 32) + visResults[0].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */ + else + visResults[0].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */ + + results[0].visual = visResults; + results[0].visualid = mode->visualID; +#if defined(__cplusplus) || defined(c_plusplus) + results[0].c_class = TrueColor; +#else + results[0].class = TrueColor; +#endif + results[0].depth = mode->redBits + + mode->redBits + + mode->redBits + + mode->redBits; + results[0].bits_per_rgb = dpy->driverContext.bpp; + + } + + } + else // if (vinfo_mask == VisualScreenMask) + { + n = 0; + for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) + n++; + + results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo)); + if (!results) { + *nitens_return = 0; + return NULL; + } + + visResults = (Visual *)calloc(1, n * sizeof(Visual)); + if (!results) { + free(results); + *nitens_return = 0; + return NULL; + } + + for ( mode = dpy->driver_modes, i = 0 ; mode != NULL ; mode = mode->next, i++ ) { + visResults[i].mode = mode; + visResults[i].visInfo = results + i; + visResults[i].dpy = dpy; + + if (dpy->driverContext.bpp == 32) + visResults[i].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */ + else + visResults[i].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */ + + results[i].visual = visResults + i; + results[i].visualid = mode->visualID; +#if defined(__cplusplus) || defined(c_plusplus) + results[i].c_class = TrueColor; +#else + results[i].class = TrueColor; +#endif + results[i].depth = mode->redBits + + mode->redBits + + mode->redBits + + mode->redBits; + results[i].bits_per_rgb = dpy->driverContext.bpp; + } + } + *nitens_return = n; + return results; +} + + +/** + * \brief Return a visual that matches specified attributes. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param screen the screen number. It is currently ignored by Mini GLX and + * should be zero. + * \param attribList a list of GLX attributes which describe the desired pixel + * format. It is terminated by the token \c None. + * + * The attributes are as follows: + * \arg GLX_USE_GL: + * This attribute should always be present in order to maintain compatibility + * with GLX. + * \arg GLX_RGBA: + * If present, only RGBA pixel formats will be considered. Otherwise, only + * color index formats are considered. + * \arg GLX_DOUBLEBUFFER: + * if present, only double-buffered pixel formats will be chosen. + * \arg GLX_RED_SIZE \e n: + * Must be followed by a non-negative integer indicating the minimum number of + * bits per red pixel component that is acceptable. + * \arg GLX_GREEN_SIZE \e n: + * Must be followed by a non-negative integer indicating the minimum number of + * bits per green pixel component that is acceptable. + * \arg GLX_BLUE_SIZE \e n: + * Must be followed by a non-negative integer indicating the minimum number of + * bits per blue pixel component that is acceptable. + * \arg GLX_ALPHA_SIZE \e n: + * Must be followed by a non-negative integer indicating the minimum number of + * bits per alpha pixel component that is acceptable. + * \arg GLX_STENCIL_SIZE \e n: + * Must be followed by a non-negative integer indicating the minimum number of + * bits per stencil value that is acceptable. + * \arg GLX_DEPTH_SIZE \e n: + * Must be followed by a non-negative integer indicating the minimum number of + * bits per depth component that is acceptable. + * \arg None: + * This token is used to terminate the attribute list. + * + * \return a pointer to an #XVisualInfo object which most closely matches the + * requirements of the attribute list. If there is no visual which matches the + * request, \c NULL will be returned. + * + * \note Visuals with accumulation buffers are not available. + * + * This function searches the list of available visual configurations in + * MiniGLXDisplayRec::configs for a configuration which best matches the GLX + * attribute list parameter. A new ::XVisualInfo object is created which + * describes the visual configuration. The match criteria is described in the + * specification. + */ +XVisualInfo* +glXChooseVisual( Display *dpy, int screen, int *attribList ) +{ + const __GLcontextModes *mode; + Visual *vis; + XVisualInfo *visInfo; + const int *attrib; + GLboolean rgbFlag = GL_FALSE, dbFlag = GL_FALSE, stereoFlag = GL_FALSE; + GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0; + GLint indexBits = 0, depthBits = 0, stencilBits = 0; + GLint numSamples = 0; + int i=0; + + /* + * XXX in the future, might be interpreted as a VT + */ + ASSERT(dpy); + ASSERT(screen == 0); + + vis = (Visual *)calloc(1, sizeof(Visual)); + if (!vis) + return NULL; + + visInfo = (XVisualInfo *)malloc(sizeof(XVisualInfo)); + if (!visInfo) { + free(vis); + return NULL; + } + + visInfo->visual = vis; + vis->visInfo = visInfo; + vis->dpy = dpy; + + /* parse the attribute list */ + for (attrib = attribList; attrib && *attrib != None; attrib++) { + switch (attrib[0]) { + case GLX_DOUBLEBUFFER: + dbFlag = GL_TRUE; + break; + case GLX_RGBA: + rgbFlag = GL_TRUE; + break; + case GLX_RED_SIZE: + redBits = attrib[1]; + attrib++; + break; + case GLX_GREEN_SIZE: + greenBits = attrib[1]; + attrib++; + break; + case GLX_BLUE_SIZE: + blueBits = attrib[1]; + attrib++; + break; + case GLX_ALPHA_SIZE: + alphaBits = attrib[1]; + attrib++; + break; + case GLX_STENCIL_SIZE: + stencilBits = attrib[1]; + attrib++; + break; + case GLX_DEPTH_SIZE: + depthBits = attrib[1]; + attrib++; + break; +#if 0 + case GLX_ACCUM_RED_SIZE: + accumRedBits = attrib[1]; + attrib++; + break; + case GLX_ACCUM_GREEN_SIZE: + accumGreenBits = attrib[1]; + attrib++; + break; + case GLX_ACCUM_BLUE_SIZE: + accumBlueBits = attrib[1]; + attrib++; + break; + case GLX_ACCUM_ALPHA_SIZE: + accumAlphaBits = attrib[1]; + attrib++; + break; + case GLX_LEVEL: + /* ignored for now */ + break; +#endif + default: + /* unexpected token */ + fprintf(stderr, "unexpected token in glXChooseVisual attrib list\n"); + free(vis); + free(visInfo); + return NULL; + } + } + + /* search screen configs for suitable visual */ + (void) numSamples; + (void) indexBits; + (void) redBits; + (void) greenBits; + (void) blueBits; + (void) alphaBits; + (void) stereoFlag; + for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) { + i++; + if (mode->rgbMode == rgbFlag && + mode->doubleBufferMode == dbFlag && + mode->redBits >= redBits && + mode->greenBits >= greenBits && + mode->blueBits >= blueBits && + mode->alphaBits >= alphaBits && + mode->depthBits >= depthBits && + mode->stencilBits >= stencilBits) { + /* found it */ + visInfo->visualid = i; + vis->mode = mode; + break; + } + } + if (!vis->mode) + return NULL; + + /* compute depth and bpp */ + if (rgbFlag) { + /* XXX maybe support depth 16 someday */ +#if defined(__cplusplus) || defined(c_plusplus) + visInfo->c_class = TrueColor; +#else + visInfo->class = TrueColor; +#endif + visInfo->depth = dpy->driverContext.bpp; + visInfo->bits_per_rgb = dpy->driverContext.bpp; + if (dpy->driverContext.bpp == 32) + vis->pixelFormat = PF_B8G8R8A8; + else + vis->pixelFormat = PF_B5G6R5; + } + else { + /* color index mode */ +#if defined(__cplusplus) || defined(c_plusplus) + visInfo->c_class = PseudoColor; +#else + visInfo->class = PseudoColor; +#endif + visInfo->depth = 8; + visInfo->bits_per_rgb = 8; /* bits/pixel */ + vis->pixelFormat = PF_CI8; + } + + return visInfo; +} + + +/** + * \brief Return information about GLX visuals. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param vis the visual to be queried, as returned by glXChooseVisual(). + * \param attrib the visual attribute to be returned. + * \param value pointer to an integer in which the result of the query will be + * stored. + * + * \return zero if no error occurs, \c GLX_INVALID_ATTRIBUTE if the attribute + * parameter is invalid, or \c GLX_BAD_VISUAL if the \p vis parameter is + * invalid. + * + * Returns the appropriate attribute of ::__GLXvisualConfig pointed by + * MiniGLXVisualRec::glxConfig of XVisualInfo::visual. + * + * \sa data types. + */ +int +glXGetConfig( Display *dpy, XVisualInfo *vis, int attrib, int *value ) +{ + const __GLcontextModes *mode = vis->visual->mode; + if (!mode) { + *value = 0; + return GLX_BAD_VISUAL; + } + + switch (attrib) { + case GLX_USE_GL: + *value = True; + return 0; + case GLX_RGBA: + *value = mode->rgbMode; + return 0; + case GLX_DOUBLEBUFFER: + *value = mode->doubleBufferMode; + return 0; + case GLX_RED_SIZE: + *value = mode->redBits; + return 0; + case GLX_GREEN_SIZE: + *value = mode->greenBits; + return 0; + case GLX_BLUE_SIZE: + *value = mode->blueBits; + return 0; + case GLX_ALPHA_SIZE: + *value = mode->alphaBits; + return 0; + case GLX_DEPTH_SIZE: + *value = mode->depthBits; + return 0; + case GLX_STENCIL_SIZE: + *value = mode->stencilBits; + return 0; + default: + *value = 0; + return GLX_BAD_ATTRIBUTE; + } + return 0; +} + + +/** + * \brief Create a new GLX rendering context. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param vis the visual that defines the frame buffer resources available to + * the rendering context, as returned by glXChooseVisual(). + * \param shareList If non-zero, texture objects and display lists are shared + * with the named rendering context. If zero, texture objects and display lists + * will (initially) be private to this context. They may be shared when a + * subsequent context is created. + * \param direct whether direct or indirect rendering is desired. For Mini GLX + * this value is ignored but it should be set to \c True. + * + * \return a ::GLXContext handle if it succeeds or zero if it fails due to + * invalid parameter or insufficient resources. + * + * This function creates and initializes a ::MiniGLXContextRec structure and + * calls the __DRIscreenRec::createContext method to initialize the client + * private data. + */ +GLXContext +glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ) +{ + GLXContext ctx; + void *sharePriv; + + ASSERT(vis); + + ctx = (struct MiniGLXContextRec *)calloc(1, sizeof(struct MiniGLXContextRec)); + if (!ctx) + return NULL; + + ctx->vid = vis->visualid; + + if (shareList) + sharePriv = shareList->driContext.private; + else + sharePriv = NULL; + + ctx->driContext.mode = vis->visual->mode; + ctx->driContext.private = dpy->driScreen.createNewContext(dpy, vis->visual->mode, + GLX_WINDOW_BIT, sharePriv, &ctx->driContext); + + if (!ctx->driContext.private) { + free(ctx); + return NULL; + } + + return ctx; +} + + +/** + * \brief Destroy a GLX context. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param ctx the GLX context to be destroyed. + * + * This function frees the \p ctx parameter after unbinding the current context + * by calling the __DRIcontextRec::bindContext method with zeros and calling + * the __DRIcontextRec::destroyContext method. + */ +void +glXDestroyContext( Display *dpy, GLXContext ctx ) +{ + GLXContext glxctx = glXGetCurrentContext(); + + if (ctx) { + if (glxctx == ctx) { + /* destroying current context */ + ctx->driContext.bindContext(dpy, 0, 0, 0, 0); + CurrentContext = 0; + } + ctx->driContext.destroyContext(dpy, 0, ctx->driContext.private); + free(ctx); + } +} + + +/** + * \brief Bind a GLX context to a window or a pixmap. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param drawable the window or drawable to bind to the rendering context. + * This should be the value returned by XCreateWindow(). + * \param ctx the GLX context to be destroyed. + * + * \return \c True if it succeeds, \c False otherwise to indicate an invalid + * display, window or context parameter. + * + * The current rendering context may be unbound by calling glXMakeCurrent() + * with the window and context parameters set to zero. + * + * An application may create any number of rendering contexts and bind them as + * needed. Note that binding a rendering context is generally not a + * light-weight operation. Most simple OpenGL applications create only one + * rendering context. + * + * This function first unbinds any old context via + * __DRIcontextRec::unbindContext and binds the new one via + * __DRIcontextRec::bindContext. + * + * If \p drawable is zero it unbinds the GLX context by calling + * __DRIcontextRec::bindContext with zeros. + */ +Bool +glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx) +{ + if (dpy && drawable && ctx) { + GLXContext oldContext = glXGetCurrentContext(); + GLXDrawable oldDrawable = glXGetCurrentDrawable(); + /* unbind old */ + if (oldContext) { + oldContext->driContext.unbindContext(dpy, 0, + (__DRIid) oldDrawable, (__DRIid) oldDrawable, + &oldContext->driContext); + } + /* bind new */ + CurrentContext = ctx; + ctx->driContext.bindContext(dpy, 0, (__DRIid) drawable, + (__DRIid) drawable, &ctx->driContext); + ctx->drawBuffer = drawable; + ctx->curBuffer = drawable; + } + else if (ctx && dpy) { + /* unbind */ + ctx->driContext.bindContext(dpy, 0, 0, 0, 0); + } + else if (dpy) { + CurrentContext = 0; /* kw: this seems to be intended??? */ + } + + return True; +} + + +/** + * \brief Exchange front and back buffers. + * + * \param dpy the display handle, as returned by XOpenDisplay(). + * \param drawable the drawable whose buffers are to be swapped. + * + * Any pending rendering commands will be completed before the buffer swap + * takes place. + * + * Calling glXSwapBuffers() on a window which is single-buffered has no effect. + * + * This function just calls the __DRIdrawableRec::swapBuffers method to do the + * work. + */ +void +glXSwapBuffers( Display *dpy, GLXDrawable drawable ) +{ + if (!dpy || !drawable) + return; + + drawable->driDrawable.swapBuffers(dpy, drawable->driDrawable.private); +} + + +/** + * \brief Return the current context + * + * \return the current context, as specified by glXMakeCurrent(), or zero if no + * context is currently bound. + * + * \sa glXCreateContext(), glXMakeCurrent() + * + * Returns the value of the ::CurrentContext global variable. + */ +GLXContext +glXGetCurrentContext( void ) +{ + return CurrentContext; +} + + +/** + * \brief Return the current drawable. + * + * \return the current drawable, as specified by glXMakeCurrent(), or zero if + * no drawable is currently bound. + * + * This function gets the current context via glXGetCurrentContext() and + * returns the MiniGLXContextRec::drawBuffer attribute. + */ +GLXDrawable +glXGetCurrentDrawable( void ) +{ + GLXContext glxctx = glXGetCurrentContext(); + if (glxctx) + return glxctx->drawBuffer; + else + return NULL; +} + + +static GLboolean +__glXCreateContextWithConfig(__DRInativeDisplay *dpy, int screen, + int fbconfigID, void *contextID, drm_context_t *hHWContext) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __glXFindDRIScreen(dpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + + psp = (__DRIscreenPrivate *) pDRIScreen->private; + + if (psp->fd) { + if (drmCreateContext(psp->fd, hHWContext)) { + fprintf(stderr, ">>> drmCreateContext failed\n"); + return GL_FALSE; + } + *(void**)contextID = (void*) *hHWContext; + } + + return GL_TRUE; +} + + +static GLboolean +__glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn, + __DRIid draw, unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, drm_clip_rect_t ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects) +{ + GLXDrawable drawable = (GLXDrawable) draw; + drm_clip_rect_t * cliprect; + Display* display = (Display*)dpy; + __DRIscreenPrivate *psp = display->driScreen.private; + __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private; + __DRIdrawablePrivate *pdp = pcp->driDrawablePriv; + if (drawable == 0) { + return GL_FALSE; + } + + cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t)); + cliprect->x1 = drawable->x; + cliprect->y1 = drawable->y; + cliprect->x2 = drawable->x + drawable->w; + cliprect->y2 = drawable->y + drawable->h; + + /* the drawable index is by client id */ + *index = display->clientID; + + *stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp; + drmUpdateDrawableInfo(psp->fd, pdp->hHWDrawable, DRM_DRAWABLE_CLIPRECTS, 1, cliprect); + *x = drawable->x; + *y = drawable->y; + *width = drawable->w; + *height = drawable->h; + *numClipRects = 1; + *pClipRects = cliprect; + + *backX = drawable->x; + *backY = drawable->y; + *numBackClipRects = 0; + *pBackClipRects = 0; + + return GL_TRUE; +} + + +static GLboolean +xf86DRI_DestroyContext(__DRInativeDisplay *dpy, int screen, __DRIid context_id ) +{ + return GL_TRUE; +} + + +static GLboolean +xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable, + drm_drawable_t *hHWDrawable ) +{ + + Display *display = (Display *)dpy; + __DRIscreenPrivate *psp = display->driScreen.private; + int ret; + ret = drmCreateDrawable(psp->fd, hHWDrawable); + + fprintf(stderr, "drawable is %d %08X ret is %d\n", *hHWDrawable, drawable, -ret); + if (ret != 0) + return GL_FALSE; + return GL_TRUE; +} + + +static GLboolean +xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable) +{ + return GL_TRUE; +} + + +/** + * \brief Query function address. + * + * The glXGetProcAddress() function will return the address of any available + * OpenGL or Mini GLX function. + * + * \param procName name of the function to be returned. + * + * \return If \p procName is a valid function name, a pointer to that function + * will be returned. Otherwise, \c NULL will be returned. + * + * The purpose of glXGetProcAddress() is to facilitate using future extensions + * to OpenGL or Mini GLX. If a future version of the library adds new extension + * functions they'll be accessible via glXGetProcAddress(). The alternative is + * to hard-code calls to the new functions in the application but doing so will + * prevent linking the application with older versions of the library. + * + * Returns the function address by looking up its name in a static (name, + * address) pair list. + */ +void (*glXGetProcAddress(const GLubyte *procname))( void ) +{ + struct name_address { + const char *name; + const void *func; + }; + static const struct name_address functions[] = { + { "glXChooseVisual", (void *) glXChooseVisual }, + { "glXCreateContext", (void *) glXCreateContext }, + { "glXDestroyContext", (void *) glXDestroyContext }, + { "glXMakeCurrent", (void *) glXMakeCurrent }, + { "glXSwapBuffers", (void *) glXSwapBuffers }, + { "glXGetCurrentContext", (void *) glXGetCurrentContext }, + { "glXGetCurrentDrawable", (void *) glXGetCurrentDrawable }, + { "glXGetProcAddress", (void *) glXGetProcAddress }, + { "XOpenDisplay", (void *) XOpenDisplay }, + { "XCloseDisplay", (void *) XCloseDisplay }, + { "XCreateWindow", (void *) XCreateWindow }, + { "XDestroyWindow", (void *) XDestroyWindow }, + { "XMapWindow", (void *) XMapWindow }, + { "XCreateColormap", (void *) XCreateColormap }, + { "XFreeColormap", (void *) XFreeColormap }, + { "XFree", (void *) XFree }, + { "XGetVisualinfo", (void *) XGetVisualInfo }, + { "glXCreatePbuffer", (void *) glXCreatePbuffer }, + { "glXDestroyPbuffer", (void *) glXDestroyPbuffer }, + { "glXChooseFBConfig", (void *) glXChooseFBConfig }, + { "glXGetVisualFromFBConfig", (void *) glXGetVisualFromFBConfig }, + { NULL, NULL } + }; + const struct name_address *entry; + for (entry = functions; entry->name; entry++) { + if (strcmp(entry->name, (const char *) procname) == 0) { + return entry->func; + } + } + return _glapi_get_proc_address((const char *) procname); +} + +void (*glXGetProcAddressARB(const GLubyte *procName))( void ) __attribute__ ((alias ("glXGetProcAddress"))); + +/** + * \brief Query the Mini GLX version. + * + * \param dpy the display handle. It is currently ignored, but should be the + * value returned by XOpenDisplay(). + * \param major receives the major version number of Mini GLX. + * \param minor receives the minor version number of Mini GLX. + * + * \return \c True if the function succeeds, \c False if the function fails due + * to invalid parameters. + * + * \sa #MINI_GLX_VERSION_1_0. + * + * Returns the hard-coded Mini GLX version. + */ +Bool +glXQueryVersion( Display *dpy, int *major, int *minor ) +{ + (void) dpy; + *major = 1; + *minor = 0; + return True; +} + + +/** + * \brief Create a new pbuffer. + */ +GLXPbuffer +glXCreatePbuffer( Display *dpy, GLXFBConfig config, const int *attribList ) +{ + return NULL; +} + + +void +glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ) +{ + free(pbuf); +} + + +GLXFBConfig * +glXChooseFBConfig( Display *dpy, int screen, const int *attribList, + int *nitems ) +{ + GLXFBConfig *f = (GLXFBConfig *) malloc(sizeof(GLXFBConfig)); + f->visInfo = glXChooseVisual( dpy, screen, (int *) attribList ); + if (f->visInfo) { + *nitems = 1; + return f; + } + else { + *nitems = 0; + free(f); + return NULL; + } +} + + +XVisualInfo * +glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) +{ + /* XVisualInfo and GLXFBConfig are the same structure */ + (void) dpy; + return config.visInfo; +} + +void *glXAllocateMemoryMESA(Display *dpy, int scrn, + size_t size, float readFreq, + float writeFreq, float priority) +{ + if (dpy->driScreen.private && dpy->driScreen.allocateMemory) { + return (*dpy->driScreen.allocateMemory)( dpy, scrn, size, + readFreq, writeFreq, + priority ); + } + + return NULL; +} + +void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer) +{ + if (dpy->driScreen.private && dpy->driScreen.freeMemory) { + (*dpy->driScreen.freeMemory)( dpy, scrn, pointer ); + } +} + +GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn, + const void *pointer ) +{ + if (dpy->driScreen.private && dpy->driScreen.memoryOffset) { + return (*dpy->driScreen.memoryOffset)( dpy, scrn, pointer ); + } + + return 0; +} + + +/** + * Get the unadjusted system time (UST). Currently, the UST is measured in + * microseconds since Epoc. The actual resolution of the UST may vary from + * system to system, and the units may vary from release to release. + * Drivers should not call this function directly. They should instead use + * \c glXGetProcAddress to obtain a pointer to the function. + * + * \param ust Location to store the 64-bit UST + * \returns Zero on success or a negative errno value on failure. + * + * \note + * This function was copied directly from src/glx/x11/glxcmds.c. + */ +static int __glXGetUST( int64_t * ust ) +{ + struct timeval tv; + + if ( ust == NULL ) { + return -EFAULT; + } + + if ( gettimeofday( & tv, NULL ) == 0 ) { + ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; + return 0; + } else { + return -errno; + } +} + + +/** + * + * \bug + * This needs to be implemented for miniGlx. + */ +static GLboolean __glXGetMscRate(__DRInativeDisplay * dpy, __DRIid drawable, + int32_t * numerator, int32_t * denominator) +{ + *numerator = 0; + *denominator = 0; + return False; +} +/*@}*/ diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/miniglx_events.c xpsb-glx-0.19/mesa/src/glx/mini/miniglx_events.c --- xpsb-glx-0.19/mesa/src/glx/mini/miniglx_events.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/miniglx_events.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,983 @@ +/** + * \file miniglx_events.c + * \brief Mini GLX client/server communication functions. + * \author Keith Whitwell + * + * The Mini GLX interface is a subset of the GLX interface, plus a + * minimal set of Xlib functions. This file adds interfaces to + * arbitrate a single cliprect between multiple direct rendering + * clients. + * + * A fairly complete client/server non-blocking communication + * mechanism. Probably overkill given that none of our messages + * currently exceed 1 byte in length and take place over the + * relatively benign channel provided by a Unix domain socket. + */ + +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "xf86drm.h" +#include "miniglxP.h" + + +#define MINIGLX_FIFO_NAME "/tmp/miniglx.fifo" + +/** + * \brief Allocate an XEvent structure on the event queue. + * + * \param dpy the display handle. + * + * \return Pointer to the queued event structure or NULL on failure. + * + * \internal + * If there is space on the XEvent queue, return a pointer + * to the next free event and increment the eventqueue tail value. + * Otherwise return null. + */ +static XEvent *queue_event( Display *dpy ) +{ + int incr = (dpy->eventqueue.tail + 1) & MINIGLX_EVENT_QUEUE_MASK; + if (incr == dpy->eventqueue.head) { + return 0; + } + else { + XEvent *ev = &dpy->eventqueue.queue[dpy->eventqueue.tail]; + dpy->eventqueue.tail = incr; + return ev; + } +} + +/** + * \brief Dequeue an XEvent and copy it into provided storage. + * + * \param dpy the display handle. + * \param event_return pointer to copy the queued event to. + * + * \return True or False depending on success. + * + * \internal + * If there is a queued XEvent on the queue, copy it to the provided + * pointer and increment the eventqueue head value. Otherwise return + * null. + */ +static int dequeue_event( Display *dpy, XEvent *event_return ) +{ + if (dpy->eventqueue.tail == dpy->eventqueue.head) { + return False; + } + else { + *event_return = dpy->eventqueue.queue[dpy->eventqueue.head]; + dpy->eventqueue.head += 1; + dpy->eventqueue.head &= MINIGLX_EVENT_QUEUE_MASK; + return True; + } +} + +/** + * \brief Shutdown a socket connection. + * + * \param dpy the display handle. + * \param i the index in dpy->fd of the socket connection. + * + * \internal + * Shutdown and close the file descriptor. If this is the special + * connection in fd[0], issue an error message and exit - there's been + * some sort of failure somewhere. Otherwise, let the application + * know about whats happened by issuing a DestroyNotify event. + */ +static void shut_fd( Display *dpy, int i ) +{ + if (dpy->fd[i].fd < 0) + return; + + shutdown (dpy->fd[i].fd, SHUT_RDWR); + close (dpy->fd[i].fd); + dpy->fd[i].fd = -1; + dpy->fd[i].readbuf_count = 0; + dpy->fd[i].writebuf_count = 0; + + if (i == 0) { + fprintf(stderr, "server connection lost\n"); + exit(1); + } + else { + /* Pass this to the application as a DestroyNotify event. + */ + XEvent *er = queue_event(dpy); + if (!er) return; + er->xdestroywindow.type = DestroyNotify; + er->xdestroywindow.serial = 0; + er->xdestroywindow.send_event = 0; + er->xdestroywindow.display = dpy; + er->xdestroywindow.window = (Window)i; + + drmGetLock(dpy->driverContext.drmFD, 1, 0); + drmUnlock(dpy->driverContext.drmFD, 1); + } +} + +/** + * \brief Send a message to a socket connection. + * + * \param dpy the display handle. + * \param i the index in dpy->fd of the socket connection. + * \param msg the message to send. + * \param sz the size of the message + * + * \internal + * Copy the message to the write buffer for the nominated connection. + * This will be actually sent to that file descriptor from + * __miniglx_Select(). + */ +int send_msg( Display *dpy, int i, + const void *msg, size_t sz ) +{ + int cnt = dpy->fd[i].writebuf_count; + if (MINIGLX_BUF_SIZE - cnt < sz) { + fprintf(stderr, "client %d: writebuf overflow\n", i); + return False; + } + + memcpy( dpy->fd[i].writebuf + cnt, msg, sz ); cnt += sz; + dpy->fd[i].writebuf_count = cnt; + return True; +} + +/** + * \brief Send a message to a socket connection. + * + * \param dpy the display handle. + * \param i the index in dpy->fd of the socket connection. + * \param msg the message to send. + * + * \internal + * Use send_msg() to send a one-byte message to a socket. + */ +int send_char_msg( Display *dpy, int i, char msg ) +{ + return send_msg( dpy, i, &msg, sizeof(char)); +} + + +/** + * \brief Block and receive a message from a socket connection. + * + * \param dpy the display handle. + * \param connection the index in dpy->fd of the socket connection. + * \param msg storage for the received message. + * \param msg_size the number of bytes to read. + * + * \internal + * Block and read from the connection's file descriptor + * until msg_size bytes have been received. + * + * Only called from welcome_message_part(). + */ +int blocking_read( Display *dpy, int connection, + char *msg, size_t msg_size ) +{ + int i, r; + + for (i = 0 ; i < msg_size ; i += r) { + r = read(dpy->fd[connection].fd, msg + i, msg_size - i); + if (r < 1) { + fprintf(stderr, "blocking_read: %d %s\n", r, strerror(errno)); + shut_fd(dpy,connection); + return False; + } + } + + return True; +} + +/** + * \brief Send/receive a part of the welcome message. + * + * \param dpy the display handle. + * \param i the index in dpy->fd of the socket connection. + * \param msg storage for the sent/received message. + * \param sz the number of bytes to write/read. + * + * \return True on success, or False on failure. + * + * This function is called by welcome_message_part(), to either send or receive + * (via blocking_read()) part of the welcome message, according to whether + * Display::IsClient is set. + * + * Each part of the welcome message on the wire consists of a count and then the + * actual message data with that number of bytes. + */ +static int welcome_message_part( Display *dpy, int i, void **msg, int sz ) +{ + if (dpy->IsClient) { + int sz; + if (!blocking_read( dpy, i, (char *)&sz, sizeof(sz))) return False; + if (!*msg) *msg = malloc(sz); + if (!*msg) return False; + if (!blocking_read( dpy, i, *msg, sz )) return False; + return sz; + } + else { + if (!send_msg( dpy, i, &sz, sizeof(sz))) return False; + if (!send_msg( dpy, i, *msg, sz )) return False; + } + + return True; +} + +/** + * \brief Send/receive the welcome message. + * + * \param dpy the display handle. + * \param i the index in dpy->fd of the socket connection. + * + * \return True on success, or False on failure. + * + * Using welcome_message_part(), sends/receives the client ID, the client + * configuration details in DRIDriverContext::shared, and the driver private + * message in DRIDriverContext::driverClientMsg. + */ +static int welcome_message( Display *dpy, int i ) +{ + void *tmp = &dpy->driverContext.shared; + int *clientid = dpy->IsClient ? &dpy->clientID : &i; + int size; + + if (!welcome_message_part( dpy, i, (void **)&clientid, sizeof(*clientid))) + return False; + + if (!welcome_message_part( dpy, i, &tmp, sizeof(dpy->driverContext.shared))) + return False; + + size=welcome_message_part( dpy, i, + (void **)&dpy->driverContext.driverClientMsg, + dpy->driverContext.driverClientMsgSize ); + + if (!size) + return False; + + if (dpy->IsClient) { + dpy->driverContext.driverClientMsgSize = size; + } + return True; +} + + +/** + * \brief Handle a new client connection. + * + * \param dpy the display handle. + * + * \return True on success or False on failure. + * + * Accepts the connection, sets it in non-blocking operation, and finds a free + * slot in Display::fd for it. + */ +static int handle_new_client( Display *dpy ) +{ + struct sockaddr_un client_address; + unsigned int l = sizeof(client_address); + int r, i; + + r = accept(dpy->fd[0].fd, (struct sockaddr *) &client_address, &l); + if (r < 0) { + perror ("accept()"); + shut_fd(dpy,0); + return False; + } + + if (fcntl(r, F_SETFL, O_NONBLOCK) != 0) { + perror("fcntl"); + close(r); + return False; + } + + + /* Some rough & ready adaption of the XEvent semantics. + */ + for (i = 1 ; i < dpy->nrFds ; i++) { + if (dpy->fd[i].fd < 0) { + XEvent *er = queue_event(dpy); + if (!er) { + close(r); + return False; + } + + dpy->fd[i].fd = r; + er->xcreatewindow.type = CreateNotify; + er->xcreatewindow.serial = 0; + er->xcreatewindow.send_event = 0; + er->xcreatewindow.display = dpy; + er->xcreatewindow.window = (Window)i; /* fd slot == window, now? */ + + /* Send the driver client message - this is expected as the + * first message on a new connection. The recpient already + * knows the size of the message. + */ + welcome_message( dpy, i ); + return True; + } + } + + + fprintf(stderr, "[miniglx] %s: Max nr clients exceeded\n", __FUNCTION__); + close(r); + return False; +} + +/** + * This routine "puffs out" the very basic communications between + * client and server to full-sized X Events that can be handled by the + * application. + * + * \param dpy the display handle. + * \param i the index in dpy->fd of the socket connection. + * + * \return True on success or False on failure. + * + * \internal + * Interprets the message (see msg) into a XEvent and advances the file FIFO + * buffer. + */ +static int +handle_fifo_read( Display *dpy, int i ) +{ + drm_magic_t magic; + int err; + + while (dpy->fd[i].readbuf_count) { + char id = dpy->fd[i].readbuf[0]; + XEvent *er; + int count = 1; + + if (dpy->IsClient) { + switch (id) { + /* The server has called XMapWindow on a client window */ + case _YouveGotFocus: + er = queue_event(dpy); + if (!er) return False; + er->xmap.type = MapNotify; + er->xmap.serial = 0; + er->xmap.send_event = False; + er->xmap.display = dpy; + er->xmap.event = dpy->TheWindow; + er->xmap.window = dpy->TheWindow; + er->xmap.override_redirect = False; + if (dpy->driver->notifyFocus) + dpy->driver->notifyFocus( 1 ); + break; + + /* The server has called XMapWindow on a client window */ + case _RepaintPlease: + er = queue_event(dpy); + if (!er) return False; + er->xexpose.type = Expose; + er->xexpose.serial = 0; + er->xexpose.send_event = False; + er->xexpose.display = dpy; + er->xexpose.window = dpy->TheWindow; + if (dpy->rotateMode) { + er->xexpose.x = dpy->TheWindow->y; + er->xexpose.y = dpy->TheWindow->x; + er->xexpose.width = dpy->TheWindow->h; + er->xexpose.height = dpy->TheWindow->w; + } + else { + er->xexpose.x = dpy->TheWindow->x; + er->xexpose.y = dpy->TheWindow->y; + er->xexpose.width = dpy->TheWindow->w; + er->xexpose.height = dpy->TheWindow->h; + } + er->xexpose.count = 0; + break; + + /* The server has called 'XUnmapWindow' on a client + * window. + */ + case _YouveLostFocus: + er = queue_event(dpy); + if (!er) return False; + er->xunmap.type = UnmapNotify; + er->xunmap.serial = 0; + er->xunmap.send_event = False; + er->xunmap.display = dpy; + er->xunmap.event = dpy->TheWindow; + er->xunmap.window = dpy->TheWindow; + er->xunmap.from_configure = False; + if (dpy->driver->notifyFocus) + dpy->driver->notifyFocus( 0 ); + break; + + case _Authorize: + dpy->authorized = True; + break; + + default: + fprintf(stderr, "Client received unhandled message type %d\n", id); + shut_fd(dpy, i); /* Actually shuts down the client */ + return False; + } + } + else { + switch (id) { + /* Lets the server know that the client is ready to render + * (having called 'XMapWindow' locally). + */ + case _CanIHaveFocus: + er = queue_event(dpy); + if (!er) return False; + er->xmaprequest.type = MapRequest; + er->xmaprequest.serial = 0; + er->xmaprequest.send_event = False; + er->xmaprequest.display = dpy; + er->xmaprequest.parent = 0; + er->xmaprequest.window = (Window)i; + break; + + /* Both _YouveLostFocus and _IDontWantFocus generate unmap + * events. The idea is that _YouveLostFocus lets the client + * know that it has had focus revoked by the server, whereas + * _IDontWantFocus lets the server know that the client has + * unmapped its own window. + */ + case _IDontWantFocus: + er = queue_event(dpy); + if (!er) return False; + er->xunmap.type = UnmapNotify; + er->xunmap.serial = 0; + er->xunmap.send_event = False; + er->xunmap.display = dpy; + er->xunmap.event = (Window)i; + er->xunmap.window = (Window)i; + er->xunmap.from_configure = False; + break; + + case _Authorize: + /* is full message here yet? */ + if (dpy->fd[i].readbuf_count < count + sizeof(magic)) { + count = 0; + break; + } + memcpy(&magic, dpy->fd[i].readbuf + count, sizeof(magic)); + fprintf(stderr, "Authorize - magic %d\n", magic); + + err = drmAuthMagic(dpy->driverContext.drmFD, magic); + count += sizeof(magic); + + send_char_msg( dpy, i, _Authorize ); + break; + + default: + fprintf(stderr, "Server received unhandled message type %d\n", id); + shut_fd(dpy, i); /* Generates DestroyNotify event */ + return False; + } + } + + dpy->fd[i].readbuf_count -= count; + + if (dpy->fd[i].readbuf_count) { + memmove(dpy->fd[i].readbuf, + dpy->fd[i].readbuf + count, + dpy->fd[i].readbuf_count); + } + } + + return True; +} + +/** + * Handle a VT signal + * + * \param dpy display handle. + * + * The VT switches is detected by comparing Display::haveVT and + * Display::hwActive. When loosing the VT the hardware lock is acquired, the + * hardware is shutdown via a call to DRIDriverRec::shutdownHardware(), and the + * VT released. When acquiring the VT back the hardware state is restored via a + * call to DRIDriverRec::restoreHardware() and the hardware lock released. + */ +static void __driHandleVtSignals( Display *dpy ) +{ + dpy->vtSignalFlag = 0; + + fprintf(stderr, "%s: haveVT %d hwActive %d\n", __FUNCTION__, + dpy->haveVT, dpy->hwActive); + + if (!dpy->haveVT && dpy->hwActive) { + /* Need to get lock and shutdown hardware */ + DRM_LIGHT_LOCK( dpy->driverContext.drmFD, + dpy->driverContext.pSAREA, + dpy->driverContext.serverContext ); + dpy->driver->shutdownHardware( &dpy->driverContext ); + + /* Can now give up control of the VT */ + ioctl( dpy->ConsoleFD, VT_RELDISP, 1 ); + dpy->hwActive = 0; + } + else if (dpy->haveVT && !dpy->hwActive) { + /* Get VT (wait??) */ + ioctl( dpy->ConsoleFD, VT_RELDISP, VT_ACTIVATE ); + + /* restore HW state, release lock */ + dpy->driver->restoreHardware( &dpy->driverContext ); + DRM_UNLOCK( dpy->driverContext.drmFD, + dpy->driverContext.pSAREA, + dpy->driverContext.serverContext ); + dpy->hwActive = 1; + } +} + + +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) + +/** + * Logic for the select() call. + * + * \param dpy display handle. + * \param n highest fd in any set plus one. + * \param rfds fd set to be watched for reading, or NULL to create one. + * \param wfds fd set to be watched for writing, or NULL to create one. + * \param xfds fd set to be watched for exceptions or error, or NULL to create one. + * \param tv timeout value, or NULL for no timeout. + * + * \return number of file descriptors contained in the sets, or a negative number on failure. + * + * \note + * This all looks pretty complex, but is necessary especially on the + * server side to prevent a poorly-behaved client from causing the + * server to block in a read or write and hence not service the other + * clients. + * + * \sa + * See select_tut in the Linux manual pages for more discussion. + * + * \internal + * Creates and initializes the file descriptor sets by inspecting Display::fd + * if these aren't passed in the function call. Calls select() and fulfill the + * demands by trying to fill MiniGLXConnection::readbuf and draining + * MiniGLXConnection::writebuf. + * The server fd[0] is handled specially for new connections, by calling + * handle_new_client(). + * + */ +int +__miniglx_Select( Display *dpy, int n, fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *tv ) +{ + int i; + int retval; + fd_set my_rfds, my_wfds; + struct timeval my_tv; + + if (!rfds) { + rfds = &my_rfds; + FD_ZERO(rfds); + } + + if (!wfds) { + wfds = &my_wfds; + FD_ZERO(wfds); + } + + /* Don't block if there are events queued. Review this if the + * flush in XMapWindow is changed to blocking. (Test case: + * miniglxtest). + */ + if (dpy->eventqueue.head != dpy->eventqueue.tail) { + my_tv.tv_sec = my_tv.tv_usec = 0; + tv = &my_tv; + } + + for (i = 0 ; i < dpy->nrFds; i++) { + if (dpy->fd[i].fd < 0) + continue; + + if (dpy->fd[i].writebuf_count) + FD_SET(dpy->fd[i].fd, wfds); + + if (dpy->fd[i].readbuf_count < MINIGLX_BUF_SIZE) + FD_SET(dpy->fd[i].fd, rfds); + + n = max(n, dpy->fd[i].fd + 1); + } + + if (dpy->vtSignalFlag) + __driHandleVtSignals( dpy ); + + retval = select( n, rfds, wfds, xfds, tv ); + + if (dpy->vtSignalFlag) { + int tmp = errno; + __driHandleVtSignals( dpy ); + errno = tmp; + } + + if (retval < 0) { + FD_ZERO(rfds); + FD_ZERO(wfds); + return retval; + } + + /* Handle server fd[0] specially on the server - accept new client + * connections. + */ + if (!dpy->IsClient) { + if (FD_ISSET(dpy->fd[0].fd, rfds)) { + FD_CLR(dpy->fd[0].fd, rfds); + handle_new_client( dpy ); + } + } + + /* Otherwise, try and fill readbuffer and drain writebuffer: + */ + for (i = 0 ; i < dpy->nrFds ; i++) { + if (dpy->fd[i].fd < 0) + continue; + + /* If there aren't any event slots left, don't examine + * any more file events. This will prevent lost events. + */ + if (dpy->eventqueue.head == + ((dpy->eventqueue.tail + 1) & MINIGLX_EVENT_QUEUE_MASK)) { + fprintf(stderr, "leaving event loop as event queue is full\n"); + return retval; + } + + if (FD_ISSET(dpy->fd[i].fd, wfds)) { + int r = write(dpy->fd[i].fd, + dpy->fd[i].writebuf, + dpy->fd[i].writebuf_count); + + if (r < 1) + shut_fd(dpy,i); + else { + dpy->fd[i].writebuf_count -= r; + if (dpy->fd[i].writebuf_count) { + memmove(dpy->fd[i].writebuf, + dpy->fd[i].writebuf + r, + dpy->fd[i].writebuf_count); + } + } + } + + if (FD_ISSET(dpy->fd[i].fd, rfds)) { + int r = read(dpy->fd[i].fd, + dpy->fd[i].readbuf + dpy->fd[i].readbuf_count, + MINIGLX_BUF_SIZE - dpy->fd[i].readbuf_count); + + if (r < 1) + shut_fd(dpy,i); + else { + dpy->fd[i].readbuf_count += r; + + handle_fifo_read( dpy, i ); + } + } + } + + return retval; +} + +/** + * \brief Handle socket events. + * + * \param dpy the display handle. + * \param nonblock whether to return immediately or wait for an event. + * + * \return True on success, False on failure. Aborts on critical error. + * + * \internal + * This function is the select() main loop. + */ +int handle_fd_events( Display *dpy, int nonblock ) +{ + while (1) { + struct timeval tv = {0, 0}; + int r = __miniglx_Select( dpy, 0, 0, 0, 0, nonblock ? &tv : 0 ); + if (r >= 0) + return True; + if (errno == EINTR || errno == EAGAIN) + continue; + perror ("select()"); + exit (1); + } +} + +/** + * Initializes the connections. + * + * \param dpy the display handle. + * + * \return True on success or False on failure. + * + * Allocates and initializes the Display::fd array and create a Unix socket on + * the first entry. For a server binds the socket to a filename and listen for + * connections. For a client connects to the server and waits for a welcome + * message. Sets the socket in nonblocking mode. + */ +int __miniglx_open_connections( Display *dpy ) +{ + struct sockaddr_un sa; + int i; + + dpy->nrFds = dpy->IsClient ? 1 : MINIGLX_MAX_SERVER_FDS; + dpy->fd = calloc(1, dpy->nrFds * sizeof(struct MiniGLXConnection)); + if (!dpy->fd) + return False; + + for (i = 0 ; i < dpy->nrFds ; i++) + dpy->fd[i].fd = -1; + + if (!dpy->IsClient) { + if (unlink(MINIGLX_FIFO_NAME) != 0 && errno != ENOENT) { + perror("unlink " MINIGLX_FIFO_NAME); + return False; + } + + } + + /* Create a Unix socket -- Note this is *not* a network connection! + */ + dpy->fd[0].fd = socket(PF_UNIX, SOCK_STREAM, 0); + if (dpy->fd[0].fd < 0) { + perror("socket " MINIGLX_FIFO_NAME); + return False; + } + + memset(&sa, 0, sizeof(sa)); + sa.sun_family = AF_UNIX; + strcpy(sa.sun_path, MINIGLX_FIFO_NAME); + + if (dpy->IsClient) { + /* Connect to server + */ + if (connect(dpy->fd[0].fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) { + perror("connect"); + shut_fd(dpy,0); + return False; + } + + /* Wait for configuration messages from the server. + */ + welcome_message( dpy, 0 ); + } + else { + mode_t tmp = umask( 0000 ); /* open to everybody ? */ + + /* Bind socket to our filename + */ + if (bind(dpy->fd[0].fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) { + perror("bind"); + shut_fd(dpy,0); + return False; + } + + umask( tmp ); + + /* Listen for connections + */ + if (listen(dpy->fd[0].fd, 5) != 0) { + perror("listen"); + shut_fd(dpy,0); + return False; + } + } + + if (fcntl(dpy->fd[0].fd, F_SETFL, O_NONBLOCK) != 0) { + perror("fcntl"); + shut_fd(dpy,0); + return False; + } + + + return True; +} + + +/** + * Frees the connections initialized by __miniglx_open_connections(). + * + * \param dpy the display handle. + */ +void __miniglx_close_connections( Display *dpy ) +{ + int i; + + for (i = 0 ; i < dpy->nrFds ; i++) { + if (dpy->fd[i].fd >= 0) { + shutdown (dpy->fd[i].fd, SHUT_RDWR); + close (dpy->fd[i].fd); + } + } + + dpy->nrFds = 0; + free(dpy->fd); +} + + +/** + * Set a drawable flag. + * + * \param dpy the display handle. + * \param w drawable (window). + * \param flag flag. + * + * Sets the specified drawable flag in the SAREA and increment its stamp while + * holding the light hardware lock. + */ +static void set_drawable_flag( Display *dpy, int w, int flag ) +{ + if (dpy->driverContext.pSAREA) { + if (dpy->hwActive) + DRM_LIGHT_LOCK( dpy->driverContext.drmFD, + dpy->driverContext.pSAREA, + dpy->driverContext.serverContext ); + + dpy->driverContext.pSAREA->drawableTable[w].stamp++; + dpy->driverContext.pSAREA->drawableTable[w].flags = flag; + + if (dpy->hwActive) + DRM_UNLOCK( dpy->driverContext.drmFD, + dpy->driverContext.pSAREA, + dpy->driverContext.serverContext ); + } +} + + + +/** + * \brief Map Window. + * + * \param dpy the display handle as returned by XOpenDisplay(). + * \param w the window handle. + * + * If called by a client, sends a request for focus to the server. If + * called by the server, will generate a MapNotify and Expose event at + * the client. + * + */ +void +XMapWindow( Display *dpy, Window w ) +{ + if (dpy->IsClient) + send_char_msg( dpy, 0, _CanIHaveFocus ); + else { + set_drawable_flag( dpy, (int)w, 1 ); + send_char_msg( dpy, (int)w, _YouveGotFocus ); + send_char_msg( dpy, (int)w, _RepaintPlease ); + dpy->TheWindow = w; + } + handle_fd_events( dpy, 0 ); /* flush write queue */ +} + +/** + * \brief Unmap Window. + * + * \param dpy the display handle as returned by XOpenDisplay(). + * \param w the window handle. + * + * Called from the client: Lets the server know that the window won't + * be updated anymore. + * + * Called from the server: Tells the specified client that it no longer + * holds the focus. + */ +void +XUnmapWindow( Display *dpy, Window w ) +{ + if (dpy->IsClient) { + send_char_msg( dpy, 0, _IDontWantFocus ); + } + else { + dpy->TheWindow = 0; + set_drawable_flag( dpy, (int)w, 0 ); + send_char_msg( dpy, (int)w, _YouveLostFocus ); + } + handle_fd_events( dpy, 0 ); /* flush write queue */ +} + + +/** + * \brief Block and wait for next X event. + * + * \param dpy the display handle as returned by XOpenDisplay(). + * \param event_return a pointer to an XEvent structure for the returned data. + * + * Wait until there is a new XEvent pending. + */ +int XNextEvent(Display *dpy, XEvent *event_return) +{ + for (;;) { + if ( dpy->eventqueue.head != dpy->eventqueue.tail ) + return dequeue_event( dpy, event_return ); + + handle_fd_events( dpy, 0 ); + } +} + +/** + * \brief Non-blocking check for next X event. + * + * \param dpy the display handle as returned by XOpenDisplay(). + * \param event_mask ignored. + * \param event_return a pointer to an XEvent structure for the returned data. + * + * Check if there is a new XEvent pending. Note that event_mask is + * ignored and any pending event will be returned. + */ +Bool XCheckMaskEvent(Display *dpy, long event_mask, XEvent *event_return) +{ + if ( dpy->eventqueue.head != dpy->eventqueue.tail ) + return dequeue_event( dpy, event_return ); + + handle_fd_events( dpy, 1 ); + + return dequeue_event( dpy, event_return ); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/miniglxP.h xpsb-glx-0.19/mesa/src/glx/mini/miniglxP.h --- xpsb-glx-0.19/mesa/src/glx/mini/miniglxP.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/miniglxP.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,205 @@ +/** + * \file miniglxP.h + * \brief Define replacements for some X data types and define the DRI-related + * data structures. + * + * \note Cut down version of glxclient.h. + * + */ + +#ifndef _mini_GLX_client_h_ +#define _mini_GLX_client_h_ + +#include +#include + +#include +#include "glheader.h" +#include "mtypes.h" + +#include "driver.h" +#include "GL/internal/dri_interface.h" + +/** + * \brief Supported pixel formats. + */ +enum PixelFormat { + PF_B8G8R8, /**< \brief 24-bit BGR */ + PF_B8G8R8A8, /**< \brief 32-bit BGRA */ + PF_B5G6R5, /**< \brief 16-bit BGR */ + PF_B5G5R5, /**< \brief 15-bit BGR */ + PF_CI8 /**< \brief 8-bit color index */ +}; + +/** + * \brief X Visual type. + * + * \sa ::Visual, \ref datatypes. + */ +struct MiniGLXVisualRec { + /** \brief GLX visual information */ + const __GLcontextModes *mode; + + /** \brief pointer back to corresponding ::XVisualInfo */ + XVisualInfo *visInfo; + + /** \brief display handle */ + Display *dpy; + + /** \brief pixel format */ + enum PixelFormat pixelFormat; +}; + + + +/** + * \brief X Window type. + * + * \sa ::Window, \ref datatypes. + */ +struct MiniGLXWindowRec { + Visual *visual; + /** \brief position (always 0,0) */ + int x, y; + /** \brief size */ + unsigned int w, h; + void *frontStart; /**< \brief start of front color buffer */ + void *backStart; /**< \brief start of back color buffer */ + size_t size; /**< \brief color buffer size, in bytes */ + GLuint bytesPerPixel; + GLuint rowStride; /**< \brief in bytes */ + GLubyte *frontBottom; /**< \brief pointer to last row */ + GLubyte *backBottom; /**< \brief pointer to last row */ + GLubyte *curBottom; /**< = frontBottom or backBottom */ + __DRIdrawable driDrawable; + GLuint ismapped; +}; + + +/** + * \brief GLXContext type. + * + * \sa ::GLXContext, \ref datatypes. + */ +struct MiniGLXContextRec { + Window drawBuffer; /**< \brief drawing buffer */ + Window curBuffer; /**< \brief current buffer */ + VisualID vid; /**< \brief visual ID */ + __DRIcontext driContext; /**< \brief context dependent methods */ +}; + +#define MINIGLX_BUF_SIZE 512 +#define MINIGLX_MAX_SERVER_FDS 10 +#define MINIGLX_MAX_CLIENT_FDS 1 +#define MINIGLX_EVENT_QUEUE_SZ 16 +#define MINIGLX_EVENT_QUEUE_MASK (MINIGLX_EVENT_QUEUE_SZ-1) + +/** + * A connection to/from the server + * + * All information is to/from the server is buffered and then dispatched by + * __miniglx_Select() to avoid blocking the server. + */ +struct MiniGLXConnection { + int fd; /**< \brief file descriptor */ + char readbuf[MINIGLX_BUF_SIZE]; /**< \brief read buffer */ + char writebuf[MINIGLX_BUF_SIZE]; /**< \brief write buffer */ + int readbuf_count; /**< \brief count of bytes waiting to be read */ + int writebuf_count; /**< \brief count of bytes waiting to be written */ +}; + + +/** + * \brief X Display type + * + * \sa ::Display, \ref datatypes. + */ +struct MiniGLXDisplayRec { + /** \brief fixed framebuffer screen info */ + struct fb_fix_screeninfo FixedInfo; + /** \brief original and current variable framebuffer screen info */ + struct fb_var_screeninfo OrigVarInfo, VarInfo; + struct sigaction OrigSigUsr1; + struct sigaction OrigSigUsr2; + int OriginalVT; + int ConsoleFD; /**< \brief console TTY device file descriptor */ + int FrameBufferFD; /**< \brief framebuffer device file descriptor */ + int NumWindows; /**< \brief number of open windows */ + Window TheWindow; /**< \brief open window - only allow one window for now */ + int rotateMode; + + + volatile int vtSignalFlag; + volatile int haveVT; /**< \brief whether the VT is hold */ + int hwActive; /**< \brief whether the hardware is active -- mimics + the variations of MiniGLXDisplayRec::haveVT */ + + + int IsClient; /**< \brief whether it's a client or the server */ + int clientID; + int nrFds; /**< \brief number of connections (usually just one for the clients) */ + struct MiniGLXConnection *fd; /**< \brief connections */ + int drmFd; /**< \brief handle to drm device */ + int authorized; /**< \brief has server authorized this process? */ + + struct { + int nr, head, tail; + XEvent queue[MINIGLX_EVENT_QUEUE_SZ]; + } eventqueue; + + /** + * \name Visuals + * + * Visuals (configs) in this screen. + */ + /*@{*/ + const __GLcontextModes *driver_modes; /**< \brief Modes filtered by driver. */ + /*@}*/ + + /** + * \name From __GLXdisplayPrivate + */ + /*@{*/ + PFNCREATENEWSCREENFUNC createNewScreen; /**< \brief \e __driCreateScreen hook */ + __DRIscreen driScreen; /**< \brief Screen dependent methods */ + void *dlHandle; /**< + * \brief handle to the client dynamic + * library + */ + /*@}*/ + + /** + * \brief Mini GLX specific driver hooks + */ + struct DRIDriverRec *driver; + struct DRIDriverContextRec driverContext; + + /** + * \name Configuration details + * + * They are read from a configuration file by __read_config_file(). + */ + /*@{*/ + const char *fbdevDevice; + const char *clientDriverName; + /*@}*/ +}; + +/** Character messages. */ +enum msgs { + _CanIHaveFocus, + _IDontWantFocus, + _YouveGotFocus, + _YouveLostFocus, + _RepaintPlease, + _Authorize, +}; +extern int send_msg( Display *dpy, int i, const void *msg, size_t sz ); +extern int send_char_msg( Display *dpy, int i, char msg ); +extern int blocking_read( Display *dpy, int connection, char *msg, size_t msg_size ); +extern int handle_fd_events( Display *dpy, int nonblock ); + +extern int __miniglx_open_connections( Display *dpy ); +extern void __miniglx_close_connections( Display *dpy ); + +#endif /* !_mini_GLX_client_h_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/mini/NOTES xpsb-glx-0.19/mesa/src/glx/mini/NOTES --- xpsb-glx-0.19/mesa/src/glx/mini/NOTES 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/mini/NOTES 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,115 @@ + + +Getting MiniGLX up and running +------------------------------ + +It's necessary to do a bit of work to set up an environment to run miniglx. + +For the radeon driver, it's necessary to get the right set of kernel +modules installed before attempting to run any programs: + + rmmod radeon agpgart; + insmod agpgart; + insmod $(MESA)/src/kernel/radeonfb/radeonfb.o; + insmod $(MESA)/src/kernel/radeon/radeon.o; + +For all drivers, its necessary to reach the compiled libraries, and +tell MiniGLX where to find it's configuration file: + + export LD_LIBRARY_PATH=$(MESA)/lib; + export MINIGLX_CONF=$(MESA)/lib/miniglx.conf + +------------------------------------------------------------ + +MiniGLX Example Programs +------------------------ + +The following programs will work with miniglx: + + $(MESA)/tests/miniglx + $(MESA)/xdemos/glxgears + +Thanks to the miniglut stub library, most of the mesa glut demos will +work. In particular, the following have been tested. (Note there is +no keyboard or mouse interaction with these demos). + + $(MESA)/demos/gears + $(MESA)/demos/geartrain + $(MESA)/demos/morph3d + $(MESA)/demos/isosurf + $(MESA)/demos/texobj + $(MESA)/demos/texcyl + $(MESA)/demos/gloss + $(MESA)/demos/fire + $(MESA)/demos/tunnel + $(MESA)/demos/teapot + $(MESA)/samples/prim + $(MESA)/samples/olympic + $(MESA)/samples/star + $(MESA)/samples/wave + ...etc + +In fact most of the glut demos seem to work within the constraints of +having no keyboard/mouse interactivity. Furthermore, the use of the +glut wrapper means that these programs don't require recompilation to +run under MiniGLX -- the same binary works with both regular GLX and +MiniGLX. + + +------------------------------------------------------------ + +Porting GLX apps to MiniGLX +--------------------------- + +A quick list of issues encountered in porting existing GLX apps to +MiniGLX. Listed in no particular order. + +1) No input events + +MiniGLX doesn't provide an input layer, so any X11 input event +handling in the existing app will have to be redone for whatever +input devices exist on the target. + +2) No configuration, expose events + +Many GLX and Xlib programs wait on an event to ensure the window has +become visible after being mapped. MiniGLX provides no equivalent +facility. + +3) Different headers + +X11/Xlib.h, GL/GLX.h, etc must not be used if the program is being +compiled against MiniGLX. + +The equivalent header is GL/MiniGLX.h. + +4) Different library + +It may be necessary to link directly against the minGLX libGL.so. + +5) Reduced number of Xlib and GLX entrypoints. + +By definition (MiniGLX is a subset of GLX), many Xlib and GLX +entrypoints, structures and macros are not present in MiniGLX. It +will be necessary to find and eliminate all references to +non-supported entrypoints. + + +--------------------------------------------------------------- + +Bugs in radeonfb.o -- the radeon framebuffer driver. +---------------------------------------------------- + +Several bugs have been found in the radeonfb.o framebuffer driver. +Most of these are resolved in the version included in the MiniGLX +sources, but some remain: + +1) Occasionally, after entering graphics mode, colors appear 'shifted' +or 'translated', particularly in higher resolution modes. This is +definitely a bug in radeonfb.o as this can be provoked even when using +the software dri driver (fb_dri.so). Importance: High. Workaround: +Use 800x600 as it seems to be less frequent at this resolution, +otherwise, restart the application. + + + diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/clientattrib.c xpsb-glx-0.19/mesa/src/glx/x11/clientattrib.c --- xpsb-glx-0.19/mesa/src/glx/x11/clientattrib.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/clientattrib.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,142 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include +#include "glxclient.h" +#include "indirect.h" +#include "indirect_vertex_array.h" + +/*****************************************************************************/ + +static void +do_enable_disable(GLenum array, GLboolean val) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + unsigned index = 0; + + if (array == GL_TEXTURE_COORD_ARRAY) { + index = __glXGetActiveTextureUnit(state); + } + + if (!__glXSetArrayEnable(state, array, index, val)) { + __glXSetError(gc, GL_INVALID_ENUM); + } +} + +void +__indirect_glEnableClientState(GLenum array) +{ + do_enable_disable(array, GL_TRUE); +} + +void +__indirect_glDisableClientState(GLenum array) +{ + do_enable_disable(array, GL_FALSE); +} + +/************************************************************************/ + +void +__indirect_glPushClientAttrib(GLuint mask) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + __GLXattribute **spp = gc->attributes.stackPointer, *sp; + + if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) { + if (!(sp = *spp)) { + sp = (__GLXattribute *) Xmalloc(sizeof(__GLXattribute)); + *spp = sp; + } + sp->mask = mask; + gc->attributes.stackPointer = spp + 1; + if (mask & GL_CLIENT_PIXEL_STORE_BIT) { + sp->storePack = state->storePack; + sp->storeUnpack = state->storeUnpack; + } + if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { + __glXPushArrayState(state); + } + } + else { + __glXSetError(gc, GL_STACK_OVERFLOW); + return; + } +} + +void +__indirect_glPopClientAttrib(void) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + __GLXattribute **spp = gc->attributes.stackPointer, *sp; + GLuint mask; + + if (spp > &gc->attributes.stack[0]) { + --spp; + sp = *spp; + assert(sp != 0); + mask = sp->mask; + gc->attributes.stackPointer = spp; + + if (mask & GL_CLIENT_PIXEL_STORE_BIT) { + state->storePack = sp->storePack; + state->storeUnpack = sp->storeUnpack; + } + if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { + __glXPopArrayState(state); + } + + sp->mask = 0; + } + else { + __glXSetError(gc, GL_STACK_UNDERFLOW); + return; + } +} + +void +__glFreeAttributeState(__GLXcontext * gc) +{ + __GLXattribute *sp, **spp; + + for (spp = &gc->attributes.stack[0]; + spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) { + sp = *spp; + if (sp) { + XFree((char *) sp); + } + else { + break; + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/compsize.c xpsb-glx-0.19/mesa/src/glx/x11/compsize.c --- xpsb-glx-0.19/mesa/src/glx/x11/compsize.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/compsize.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,190 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include +#include "indirect_size.h" +#include "glxclient.h" + +/* +** Return the number of elements per group of a specified format +*/ +GLint +__glElementsPerGroup(GLenum format, GLenum type) +{ + /* + ** To make row length computation valid for image extraction, + ** packed pixel types assume elements per group equals one. + */ + switch (type) { + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + case GL_UNSIGNED_SHORT_8_8_APPLE: + case GL_UNSIGNED_SHORT_8_8_REV_APPLE: + case GL_UNSIGNED_SHORT_15_1_MESA: + case GL_UNSIGNED_SHORT_1_15_REV_MESA: + 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: + case GL_UNSIGNED_INT_24_8_NV: + case GL_UNSIGNED_INT_24_8_MESA: + case GL_UNSIGNED_INT_8_24_REV_MESA: + return 1; + default: + break; + } + + switch (format) { + case GL_RGB: + case GL_BGR: + return 3; + case GL_422_EXT: + case GL_422_REV_EXT: + case GL_422_AVERAGE_EXT: + case GL_422_REV_AVERAGE_EXT: + case GL_YCBCR_422_APPLE: + case GL_LUMINANCE_ALPHA: + return 2; + case GL_RGBA: + case GL_BGRA: + case GL_ABGR_EXT: + return 4; + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_INTENSITY: + return 1; + default: + return 0; + } +} + +/* +** Return the number of bytes per element, based on the element type (other +** than GL_BITMAP). +*/ +GLint +__glBytesPerElement(GLenum type) +{ + switch (type) { + case GL_UNSIGNED_SHORT: + case GL_SHORT: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + 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: + case GL_UNSIGNED_SHORT_8_8_APPLE: + case GL_UNSIGNED_SHORT_8_8_REV_APPLE: + case GL_UNSIGNED_SHORT_15_1_MESA: + case GL_UNSIGNED_SHORT_1_15_REV_MESA: + return 2; + case GL_UNSIGNED_BYTE: + case GL_BYTE: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + return 1; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + 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: + case GL_UNSIGNED_INT_24_8_NV: + case GL_UNSIGNED_INT_24_8_MESA: + case GL_UNSIGNED_INT_8_24_REV_MESA: + return 4; + default: + return 0; + } +} + +/* +** Compute memory required for internal packed array of data of given type +** and format. +*/ +GLint +__glImageSize(GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, GLenum target) +{ + int bytes_per_row; + int components; + + switch (target) { + case GL_PROXY_TEXTURE_1D: + case GL_PROXY_TEXTURE_2D: + case GL_PROXY_TEXTURE_3D: + case GL_PROXY_TEXTURE_4D_SGIS: + case GL_PROXY_TEXTURE_CUBE_MAP: + case GL_PROXY_TEXTURE_RECTANGLE_ARB: + case GL_PROXY_HISTOGRAM: + case GL_PROXY_COLOR_TABLE: + case GL_PROXY_TEXTURE_COLOR_TABLE_SGI: + case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: + case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: + case GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP: + return 0; + } + + if (width < 0 || height < 0 || depth < 0) { + return 0; + } + + /* + ** Zero is returned if either format or type are invalid. + */ + components = __glElementsPerGroup(format, type); + if (type == GL_BITMAP) { + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) { + bytes_per_row = (width + 7) >> 3; + } + else { + return 0; + } + } + else { + bytes_per_row = __glBytesPerElement(type) * width; + } + + return bytes_per_row * height * depth * components; +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/dri2.c xpsb-glx-0.19/mesa/src/glx/x11/dri2.c --- xpsb-glx-0.19/mesa/src/glx/x11/dri2.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/dri2.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,301 @@ +/* + * Copyright © 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kristian Høgsberg (krh@redhat.com) + */ + + +#define NEED_REPLIES +#include +#include +#include +#include +#include "xf86drm.h" +#include "dri2.h" + +static char dri2ExtensionName[] = DRI2_NAME; +static XExtensionInfo *dri2Info; +static XEXT_GENERATE_CLOSE_DISPLAY (DRI2CloseDisplay, dri2Info) +static /* const */ XExtensionHooks dri2ExtensionHooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + DRI2CloseDisplay, /* close_display */ + NULL, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + NULL, /* error_string */ +}; + +static XEXT_GENERATE_FIND_DISPLAY (DRI2FindDisplay, dri2Info, + dri2ExtensionName, + &dri2ExtensionHooks, + 0, NULL) + +Bool DRI2QueryExtension(Display *dpy, int *eventBase, int *errorBase) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + + if (XextHasExtension(info)) { + *eventBase = info->codes->first_event; + *errorBase = info->codes->first_error; + return True; + } + + return False; +} + +Bool DRI2QueryVersion(Display *dpy, int *major, int *minor) +{ + XExtDisplayInfo *info = DRI2FindDisplay (dpy); + xDRI2QueryVersionReply rep; + xDRI2QueryVersionReq *req; + + XextCheckExtension (dpy, info, dri2ExtensionName, False); + + LockDisplay(dpy); + GetReq(DRI2QueryVersion, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2QueryVersion; + req->majorVersion = DRI2_MAJOR; + req->minorVersion = DRI2_MINOR; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + *major = rep.majorVersion; + *minor = rep.minorVersion; + UnlockDisplay(dpy); + SyncHandle(); + + return True; +} + +Bool DRI2Connect(Display *dpy, XID window, + char **driverName, char **deviceName) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2ConnectReply rep; + xDRI2ConnectReq *req; + + XextCheckExtension (dpy, info, dri2ExtensionName, False); + + LockDisplay(dpy); + GetReq(DRI2Connect, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2Connect; + req->window = window; + req->driverType = DRI2DriverDRI; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + if (rep.driverNameLength == 0 && rep.deviceNameLength == 0) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + *driverName = Xmalloc(rep.driverNameLength + 1); + if (*driverName == NULL) { + _XEatData(dpy, + ((rep.driverNameLength + 3) & ~3) + + ((rep.deviceNameLength + 3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + _XReadPad(dpy, *driverName, rep.driverNameLength); + (*driverName)[rep.driverNameLength] = '\0'; + + *deviceName = Xmalloc(rep.deviceNameLength + 1); + if (*deviceName == NULL) { + Xfree(*driverName); + _XEatData(dpy, ((rep.deviceNameLength + 3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + _XReadPad(dpy, *deviceName, rep.deviceNameLength); + (*deviceName)[rep.deviceNameLength] = '\0'; + + UnlockDisplay(dpy); + SyncHandle(); + + return True; +} + +Bool DRI2Authenticate(Display *dpy, XID window, drm_magic_t magic) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2AuthenticateReq *req; + xDRI2AuthenticateReply rep; + + XextCheckExtension (dpy, info, dri2ExtensionName, False); + + LockDisplay(dpy); + GetReq(DRI2Authenticate, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2Authenticate; + req->window = window; + req->magic = magic; + + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + UnlockDisplay(dpy); + SyncHandle(); + + return rep.authenticated; +} + +void DRI2CreateDrawable(Display *dpy, XID drawable) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2CreateDrawableReq *req; + + XextSimpleCheckExtension (dpy, info, dri2ExtensionName); + + LockDisplay(dpy); + GetReq(DRI2CreateDrawable, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2CreateDrawable; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); +} + +void DRI2DestroyDrawable(Display *dpy, XID drawable) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2DestroyDrawableReq *req; + + XextSimpleCheckExtension (dpy, info, dri2ExtensionName); + + XSync(dpy, False); + + LockDisplay(dpy); + GetReq(DRI2DestroyDrawable, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2DestroyDrawable; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); +} + +DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable, + int *width, int *height, + unsigned int *attachments, int count, + int *outCount) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2GetBuffersReply rep; + xDRI2GetBuffersReq *req; + DRI2Buffer *buffers; + xDRI2Buffer repBuffer; + CARD32 *p; + int i; + + XextCheckExtension (dpy, info, dri2ExtensionName, False); + + LockDisplay(dpy); + GetReqExtra(DRI2GetBuffers, count * 4, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2GetBuffers; + req->drawable = drawable; + req->count = count; + p = (CARD32 *) &req[1]; + for (i = 0; i < count; i++) + p[i] = attachments[i]; + + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return NULL; + } + + *width = rep.width; + *height = rep.height; + *outCount = rep.count; + + buffers = Xmalloc(count * sizeof buffers[0]); + if (buffers == NULL) { + _XEatData(dpy, rep.count * sizeof repBuffer); + UnlockDisplay(dpy); + SyncHandle(); + return NULL; + } + + for (i = 0; i < rep.count; i++) { + _XReadPad(dpy, (char *) &repBuffer, sizeof repBuffer); + buffers[i].attachment = repBuffer.attachment; + buffers[i].name = repBuffer.name; + buffers[i].pitch = repBuffer.pitch; + buffers[i].cpp = repBuffer.cpp; + buffers[i].flags = repBuffer.flags; + } + + UnlockDisplay(dpy); + SyncHandle(); + + return buffers; +} + +void DRI2CopyRegion(Display *dpy, XID drawable, XserverRegion region, + CARD32 dest, CARD32 src) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2CopyRegionReq *req; + xDRI2CopyRegionReply rep; + + XextSimpleCheckExtension (dpy, info, dri2ExtensionName); + + LockDisplay(dpy); + GetReq(DRI2CopyRegion, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2CopyRegion; + req->drawable = drawable; + req->region = region; + req->dest = dest; + req->src = src; + + _XReply(dpy, (xReply *)&rep, 0, xFalse); + + UnlockDisplay(dpy); + SyncHandle(); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/dri2_glx.c xpsb-glx-0.19/mesa/src/glx/x11/dri2_glx.c --- xpsb-glx-0.19/mesa/src/glx/x11/dri2_glx.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/dri2_glx.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,453 @@ +/* + * Copyright © 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kristian Høgsberg (krh@redhat.com) + */ + +#ifdef GLX_DIRECT_RENDERING + +#include +#include +#include +#include "glxclient.h" +#include "glcontextmodes.h" +#include "xf86dri.h" +#include +#include +#include +#include +#include +#include "xf86drm.h" +#include "dri2.h" +#include "dri_common.h" + +typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate; +typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate; +typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate; + +struct __GLXDRIdisplayPrivateRec { + __GLXDRIdisplay base; + + /* + ** XFree86-DRI version information + */ + int driMajor; + int driMinor; + int driPatch; +}; + +struct __GLXDRIcontextPrivateRec { + __GLXDRIcontext base; + __DRIcontext *driContext; + __GLXscreenConfigs *psc; +}; + +struct __GLXDRIdrawablePrivateRec { + __GLXDRIdrawable base; + __DRIbuffer buffers[5]; + int bufferCount; + int width, height; + int have_back; + int have_front; + int have_fake_front; +}; + +static void dri2DestroyContext(__GLXDRIcontext *context, + __GLXscreenConfigs *psc, Display *dpy) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + (*core->destroyContext)(pcp->driContext); + + Xfree(pcp); +} + +static Bool dri2BindContext(__GLXDRIcontext *context, + __GLXDRIdrawable *draw, __GLXDRIdrawable *read) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + return (*core->bindContext)(pcp->driContext, + draw->driDrawable, + read->driDrawable); +} + +static void dri2UnbindContext(__GLXDRIcontext *context) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + (*core->unbindContext)(pcp->driContext); +} + +static __GLXDRIcontext *dri2CreateContext(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType) +{ + __GLXDRIcontextPrivate *pcp, *pcp_shared; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; + __DRIcontext *shared = NULL; + + if (shareList) { + pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; + shared = pcp_shared->driContext; + } + + pcp = Xmalloc(sizeof *pcp); + if (pcp == NULL) + return NULL; + + pcp->psc = psc; + pcp->driContext = + (*psc->dri2->createNewContext)(psc->__driScreen, + config->driConfig, shared, pcp); + gc->__driContext = pcp->driContext; + + if (pcp->driContext == NULL) { + Xfree(pcp); + return NULL; + } + + pcp->base.destroyContext = dri2DestroyContext; + pcp->base.bindContext = dri2BindContext; + pcp->base.unbindContext = dri2UnbindContext; + + return &pcp->base; +} + +static void dri2DestroyDrawable(__GLXDRIdrawable *pdraw) +{ + const __DRIcoreExtension *core = pdraw->psc->core; + + (*core->destroyDrawable)(pdraw->driDrawable); + DRI2DestroyDrawable(pdraw->psc->dpy, pdraw->drawable); + Xfree(pdraw); +} + +static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc, + XID xDrawable, + GLXDrawable drawable, + const __GLcontextModes *modes) +{ + __GLXDRIdrawablePrivate *pdraw; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; + + pdraw = Xmalloc(sizeof(*pdraw)); + if (!pdraw) + return NULL; + + pdraw->base.destroyDrawable = dri2DestroyDrawable; + pdraw->base.xDrawable = xDrawable; + pdraw->base.drawable = drawable; + pdraw->base.psc = psc; + pdraw->bufferCount = 0; + + DRI2CreateDrawable(psc->dpy, xDrawable); + + /* Create a new drawable */ + pdraw->base.driDrawable = + (*psc->dri2->createNewDrawable)(psc->__driScreen, + config->driConfig, pdraw); + + if (!pdraw->base.driDrawable) { + DRI2DestroyDrawable(psc->dpy, drawable); + Xfree(pdraw); + return NULL; + } + + return &pdraw->base; +} + +static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw, + int x, int y, int width, int height) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + XRectangle xrect; + XserverRegion region; + + /* Check we have the right attachments */ + if (!(priv->have_front && priv->have_back)) + return; + + xrect.x = x; + xrect.y = priv->height - y - height; + xrect.width = width; + xrect.height = height; + + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); + DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, + DRI2BufferFrontLeft, DRI2BufferBackLeft); + XFixesDestroyRegion(pdraw->psc->dpy, region); +} + +static void dri2SwapBuffers(__GLXDRIdrawable *pdraw) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + + dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height); +} + +static void dri2WaitX(__GLXDRIdrawable *pdraw) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + XRectangle xrect; + XserverRegion region; + + /* Check we have the right attachments */ + if (!(priv->have_fake_front && priv->have_front)) + return; + + xrect.x = 0; + xrect.y = 0; + xrect.width = priv->width; + xrect.height = priv->height; + + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); + DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, + DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + XFixesDestroyRegion(pdraw->psc->dpy, region); +} + +static void dri2WaitGL(__GLXDRIdrawable *pdraw) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + XRectangle xrect; + XserverRegion region; + + if (!(priv->have_fake_front && priv->have_front)) + return; + + xrect.x = 0; + xrect.y = 0; + xrect.width = priv->width; + xrect.height = priv->height; + + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); + DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, + DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); + XFixesDestroyRegion(pdraw->psc->dpy, region); +} + +static void dri2DestroyScreen(__GLXscreenConfigs *psc) +{ + /* Free the direct rendering per screen data */ + (*psc->core->destroyScreen)(psc->__driScreen); + close(psc->fd); + psc->__driScreen = NULL; +} + +static __DRIbuffer * +dri2GetBuffers(__DRIdrawable *driDrawable, + int *width, int *height, + unsigned int *attachments, int count, + int *out_count, void *loaderPrivate) +{ + __GLXDRIdrawablePrivate *pdraw = loaderPrivate; + DRI2Buffer *buffers; + int i; + + buffers = DRI2GetBuffers(pdraw->base.psc->dpy, pdraw->base.xDrawable, + width, height, attachments, count, out_count); + if (buffers == NULL) + return NULL; + + pdraw->width = *width; + pdraw->height = *height; + pdraw->bufferCount = *out_count; + pdraw->have_front = 0; + pdraw->have_fake_front = 0; + pdraw->have_back = 0; + + /* This assumes the DRI2 buffer attachment tokens matches the + * __DRIbuffer tokens. */ + for (i = 0; i < *out_count; i++) { + pdraw->buffers[i].attachment = buffers[i].attachment; + pdraw->buffers[i].name = buffers[i].name; + pdraw->buffers[i].pitch = buffers[i].pitch; + pdraw->buffers[i].cpp = buffers[i].cpp; + pdraw->buffers[i].flags = buffers[i].flags; + if (pdraw->buffers[i].attachment == __DRI_BUFFER_FRONT_LEFT) + pdraw->have_front = 1; + if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT) + pdraw->have_fake_front = 1; + if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT) + pdraw->have_back = 1; + } + + Xfree(buffers); + + return pdraw->buffers; +} + +static const __DRIdri2LoaderExtension dri2LoaderExtension = { + { __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION }, + dri2GetBuffers, +}; + +static const __DRIextension *loader_extensions[] = { + &dri2LoaderExtension.base, + &systemTimeExtension.base, + NULL +}; + +static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, + __GLXdisplayPrivate *priv) +{ + const __DRIconfig **driver_configs; + const __DRIextension **extensions; + __GLXDRIscreen *psp; + char *driverName, *deviceName; + drm_magic_t magic; + int i; + + psp = Xmalloc(sizeof *psp); + if (psp == NULL) + return NULL; + + /* Initialize per screen dynamic client GLX extensions */ + psc->ext_list_first_time = GL_TRUE; + + if (!DRI2Connect(psc->dpy, RootWindow(psc->dpy, screen), + &driverName, &deviceName)) + return NULL; + + psc->driver = driOpenDriver(driverName); + if (psc->driver == NULL) + goto handle_error; + + extensions = dlsym(psc->driver, __DRI_DRIVER_EXTENSIONS); + if (extensions == NULL) { + ErrorMessageF("driver exports no extensions (%s)\n", dlerror()); + goto handle_error; + } + + for (i = 0; extensions[i]; i++) { + if (strcmp(extensions[i]->name, __DRI_CORE) == 0) + psc->core = (__DRIcoreExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_DRI2) == 0) + psc->dri2 = (__DRIdri2Extension *) extensions[i]; + } + + if (psc->core == NULL || psc->dri2 == NULL) { + ErrorMessageF("core dri or dri2 extension not found\n"); + goto handle_error; + } + + psc->fd = open(deviceName, O_RDWR); + if (psc->fd < 0) { + ErrorMessageF("failed to open drm device: %s\n", strerror(errno)); + return NULL; + } + + if (drmGetMagic(psc->fd, &magic)) + return NULL; + + if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic)) + return NULL; + + psc->__driScreen = + psc->dri2->createNewScreen(screen, psc->fd, + loader_extensions, &driver_configs, psc); + if (psc->__driScreen == NULL) { + ErrorMessageF("failed to create dri screen\n"); + return NULL; + } + + driBindExtensions(psc, 1); + + psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); + psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + + psp->destroyScreen = dri2DestroyScreen; + psp->createContext = dri2CreateContext; + psp->createDrawable = dri2CreateDrawable; + psp->swapBuffers = dri2SwapBuffers; + psp->waitGL = dri2WaitGL; + psp->waitX = dri2WaitX; + + /* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always + * available.*/ + psp->copySubBuffer = dri2CopySubBuffer; + __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer"); + + Xfree(driverName); + Xfree(deviceName); + + return psp; + + handle_error: + Xfree(driverName); + Xfree(deviceName); + + /* FIXME: clean up here */ + + return NULL; +} + +/* Called from __glXFreeDisplayPrivate. + */ +static void dri2DestroyDisplay(__GLXDRIdisplay *dpy) +{ + Xfree(dpy); +} + +/* + * Allocate, initialize and return a __DRIdisplayPrivate object. + * This is called from __glXInitialize() when we are given a new + * display pointer. + */ +_X_HIDDEN __GLXDRIdisplay *dri2CreateDisplay(Display *dpy) +{ + __GLXDRIdisplayPrivate *pdp; + int eventBase, errorBase; + + if (!DRI2QueryExtension(dpy, &eventBase, &errorBase)) + return NULL; + + pdp = Xmalloc(sizeof *pdp); + if (pdp == NULL) + return NULL; + + if (!DRI2QueryVersion(dpy, &pdp->driMajor, &pdp->driMinor)) { + Xfree(pdp); + return NULL; + } + + pdp->driPatch = 0; + + pdp->base.destroyDisplay = dri2DestroyDisplay; + pdp->base.createScreen = dri2CreateScreen; + + return &pdp->base; +} + +#endif /* GLX_DIRECT_RENDERING */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/dri2.h xpsb-glx-0.19/mesa/src/glx/x11/dri2.h --- xpsb-glx-0.19/mesa/src/glx/x11/dri2.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/dri2.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,70 @@ +/* + * Copyright © 2007,2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kristian Høgsberg (krh@redhat.com) + */ + +#ifndef _DRI2_H_ +#define _DRI2_H_ + +#include +#include + +typedef struct { + unsigned int attachment; + unsigned int name; + unsigned int pitch; + unsigned int cpp; + unsigned int flags; +} DRI2Buffer; + +extern Bool +DRI2QueryExtension(Display *display, int *eventBase, int *errorBase); +extern Bool +DRI2QueryVersion(Display *display, int *major, int *minor); +extern Bool +DRI2Connect(Display *display, XID window, + char **driverName, char **deviceName); +extern Bool +DRI2Authenticate(Display *display, XID window, drm_magic_t magic); +extern void +DRI2CreateDrawable(Display *display, XID drawable); +extern void +DRI2DestroyDrawable(Display *display, XID handle); +extern DRI2Buffer * +DRI2GetBuffers(Display *dpy, XID drawable, + int *width, int *height, + unsigned int *attachments, int count, + int *outCount); + +extern void +DRI2CopyRegion(Display *dpy, XID drawable, XserverRegion region, + CARD32 dest, CARD32 src); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/dri_common.c xpsb-glx-0.19/mesa/src/glx/x11/dri_common.c --- xpsb-glx-0.19/mesa/src/glx/x11/dri_common.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/dri_common.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,399 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright © 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kevin E. Martin + * Brian Paul + * Kristian Høgsberg (krh@redhat.com) + */ + +#ifdef GLX_DIRECT_RENDERING + +#include +#include +#include +#include "glxclient.h" +#include "glcontextmodes.h" +#include "dri_common.h" + +#ifndef RTLD_NOW +#define RTLD_NOW 0 +#endif +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 0 +#endif + +_X_HIDDEN void InfoMessageF(const char *f, ...) +{ + va_list args; + const char *env; + + if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) { + fprintf(stderr, "libGL: "); + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + } +} + +/** + * Print error to stderr, unless LIBGL_DEBUG=="quiet". + */ +_X_HIDDEN void ErrorMessageF(const char *f, ...) +{ + va_list args; + const char *env; + + if ((env = getenv("LIBGL_DEBUG")) && !strstr(env, "quiet")) { + fprintf(stderr, "libGL error: "); + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + } +} + +#ifndef DEFAULT_DRIVER_DIR +/* this is normally defined in Mesa/configs/default with DRI_DRIVER_SEARCH_PATH */ +#define DEFAULT_DRIVER_DIR "/usr/local/lib/dri" +#endif + +/** + * Try to \c dlopen the named driver. + * + * This function adds the "_dri.so" suffix to the driver name and searches the + * directories specified by the \c LIBGL_DRIVERS_PATH environment variable in + * order to find the driver. + * + * \param driverName - a name like "tdfx", "i810", "mga", etc. + * + * \returns + * A handle from \c dlopen, or \c NULL if driver file not found. + */ +_X_HIDDEN void *driOpenDriver(const char *driverName) +{ + void *glhandle, *handle; + const char *libPaths, *p, *next; + char realDriverName[200]; + int len; + + /* Attempt to make sure libGL symbols will be visible to the driver */ + glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL); + + libPaths = NULL; + if (geteuid() == getuid()) { + /* don't allow setuid apps to use LIBGL_DRIVERS_PATH */ + libPaths = getenv("LIBGL_DRIVERS_PATH"); + if (!libPaths) + libPaths = getenv("LIBGL_DRIVERS_DIR"); /* deprecated */ + } + if (libPaths == NULL) + libPaths = DEFAULT_DRIVER_DIR; + + handle = NULL; + for (p = libPaths; *p; p = next) { + next = strchr(p, ':'); + if (next == NULL) { + len = strlen(p); + next = p + len; + } else { + len = next - p; + next++; + } + +#ifdef GLX_USE_TLS + snprintf(realDriverName, sizeof realDriverName, + "%.*s/tls/%s_dri.so", len, p, driverName); + InfoMessageF("OpenDriver: trying %s\n", realDriverName); + handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL); +#endif + + if ( handle == NULL ) { + snprintf(realDriverName, sizeof realDriverName, + "%.*s/%s_dri.so", len, p, driverName); + InfoMessageF("OpenDriver: trying %s\n", realDriverName); + handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL); + } + + if ( handle != NULL ) + break; + else + ErrorMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror()); + } + + if (!handle) + ErrorMessageF("unable to load driver: %s_dri.so\n", driverName); + + if (glhandle) + dlclose(glhandle); + + return handle; +} + +_X_HIDDEN const __DRIsystemTimeExtension systemTimeExtension = { + { __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION }, + __glXGetUST, + __driGetMscRateOML +}; + +#define __ATTRIB(attrib, field) \ + { attrib, offsetof(__GLcontextModes, field) } + +static const struct { unsigned int attrib, offset; } attribMap[] = { + __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits), + __ATTRIB(__DRI_ATTRIB_LEVEL, level), + __ATTRIB(__DRI_ATTRIB_RED_SIZE, redBits), + __ATTRIB(__DRI_ATTRIB_GREEN_SIZE, greenBits), + __ATTRIB(__DRI_ATTRIB_BLUE_SIZE, blueBits), + __ATTRIB(__DRI_ATTRIB_ALPHA_SIZE, alphaBits), + __ATTRIB(__DRI_ATTRIB_DEPTH_SIZE, depthBits), + __ATTRIB(__DRI_ATTRIB_STENCIL_SIZE, stencilBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_RED_SIZE, accumRedBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_GREEN_SIZE, accumGreenBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_BLUE_SIZE, accumBlueBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_ALPHA_SIZE, accumAlphaBits), + __ATTRIB(__DRI_ATTRIB_SAMPLE_BUFFERS, sampleBuffers), + __ATTRIB(__DRI_ATTRIB_SAMPLES, samples), + __ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode), + __ATTRIB(__DRI_ATTRIB_STEREO, stereoMode), + __ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers), +#if 0 + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentIndex), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha), + __ATTRIB(__DRI_ATTRIB_RED_MASK, redMask), + __ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask), + __ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask), + __ATTRIB(__DRI_ATTRIB_ALPHA_MASK, alphaMask), +#endif + __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_WIDTH, maxPbufferWidth), + __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_HEIGHT, maxPbufferHeight), + __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_PIXELS, maxPbufferPixels), + __ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH, optimalPbufferWidth), + __ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT, optimalPbufferHeight), +#if 0 + __ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod), +#endif + __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb), + __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba), + __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture), + __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted), +}; + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) + +static int +scalarEqual(__GLcontextModes *mode, unsigned int attrib, unsigned int value) +{ + unsigned int glxValue; + int i; + + for (i = 0; i < ARRAY_SIZE(attribMap); i++) + if (attribMap[i].attrib == attrib) { + glxValue = *(unsigned int *) ((char *) mode + attribMap[i].offset); + return glxValue == GLX_DONT_CARE || glxValue == value; + } + + return GL_TRUE; /* Is a non-existing attribute equal to value? */ +} + +static int +driConfigEqual(const __DRIcoreExtension *core, + __GLcontextModes *modes, const __DRIconfig *driConfig) +{ + unsigned int attrib, value, glxValue; + int i; + + i = 0; + while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) { + switch (attrib) { + case __DRI_ATTRIB_RENDER_TYPE: + glxValue = 0; + if (value & __DRI_ATTRIB_RGBA_BIT) { + glxValue |= GLX_RGBA_BIT; + } else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) { + glxValue |= GLX_COLOR_INDEX_BIT; + } + if (glxValue != modes->renderType) + return GL_FALSE; + break; + + case __DRI_ATTRIB_CONFIG_CAVEAT: + if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG) + glxValue = GLX_NON_CONFORMANT_CONFIG; + else if (value & __DRI_ATTRIB_SLOW_BIT) + glxValue = GLX_SLOW_CONFIG; + else + glxValue = GLX_NONE; + if (glxValue != modes->visualRating) + return GL_FALSE; + break; + + case __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS: + glxValue = 0; + if (value & __DRI_ATTRIB_TEXTURE_1D_BIT) + glxValue |= GLX_TEXTURE_1D_BIT_EXT; + if (value & __DRI_ATTRIB_TEXTURE_2D_BIT) + glxValue |= GLX_TEXTURE_2D_BIT_EXT; + if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT) + glxValue |= GLX_TEXTURE_RECTANGLE_BIT_EXT; + if (modes->bindToTextureTargets != GLX_DONT_CARE && + glxValue != modes->bindToTextureTargets) + return GL_FALSE; + break; + + default: + if (!scalarEqual(modes, attrib, value)) + return GL_FALSE; + } + } + + return GL_TRUE; +} + +static __GLcontextModes * +createDriMode(const __DRIcoreExtension *core, + __GLcontextModes *modes, const __DRIconfig **driConfigs) +{ + __GLXDRIconfigPrivate *config; + int i; + + for (i = 0; driConfigs[i]; i++) { + if (driConfigEqual(core, modes, driConfigs[i])) + break; + } + + if (driConfigs[i] == NULL) + return NULL; + + config = Xmalloc(sizeof *config); + if (config == NULL) + return NULL; + + config->modes = *modes; + config->driConfig = driConfigs[i]; + + return &config->modes; +} + +_X_HIDDEN __GLcontextModes * +driConvertConfigs(const __DRIcoreExtension *core, + __GLcontextModes *modes, const __DRIconfig **configs) +{ + __GLcontextModes head, *tail, *m; + + tail = &head; + head.next = NULL; + for (m = modes; m; m = m->next) { + tail->next = createDriMode(core, m, configs); + if (tail->next == NULL) { + /* no matching dri config for m */ + continue; + } + + + tail = tail->next; + } + + _gl_context_modes_destroy(modes); + + return head.next; +} + +_X_HIDDEN void +driBindExtensions(__GLXscreenConfigs *psc, int dri2) +{ + const __DRIextension **extensions; + int i; + + extensions = psc->core->getExtensions(psc->__driScreen); + + for (i = 0; extensions[i]; i++) { +#ifdef __DRI_COPY_SUB_BUFFER + if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { + psc->driCopySubBuffer = (__DRIcopySubBufferExtension *) extensions[i]; + __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer"); + } +#endif + +#ifdef __DRI_SWAP_CONTROL + if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) { + psc->swapControl = (__DRIswapControlExtension *) extensions[i]; + __glXEnableDirectExtension(psc, "GLX_SGI_swap_control"); + __glXEnableDirectExtension(psc, "GLX_MESA_swap_control"); + } +#endif + +#ifdef __DRI_ALLOCATE + if (strcmp(extensions[i]->name, __DRI_ALLOCATE) == 0) { + psc->allocate = (__DRIallocateExtension *) extensions[i]; + __glXEnableDirectExtension(psc, "GLX_MESA_allocate_memory"); + } +#endif + +#ifdef __DRI_FRAME_TRACKING + if (strcmp(extensions[i]->name, __DRI_FRAME_TRACKING) == 0) { + psc->frameTracking = (__DRIframeTrackingExtension *) extensions[i]; + __glXEnableDirectExtension(psc, "GLX_MESA_swap_frame_usage"); + } +#endif + +#ifdef __DRI_MEDIA_STREAM_COUNTER + if (strcmp(extensions[i]->name, __DRI_MEDIA_STREAM_COUNTER) == 0) { + psc->msc = (__DRImediaStreamCounterExtension *) extensions[i]; + __glXEnableDirectExtension(psc, "GLX_SGI_video_sync"); + } +#endif + +#ifdef __DRI_SWAP_BUFFER_COUNTER + /* No driver supports this at this time and the extension is + * not defined in dri_interface.h. Will enable + * GLX_OML_sync_control if implemented. */ +#endif + +#ifdef __DRI_READ_DRAWABLE + if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) { + __glXEnableDirectExtension(psc, "GLX_SGI_make_current_read"); + } +#endif + +#ifdef __DRI_TEX_BUFFER + if ((strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) && dri2) { + psc->texBuffer = (__DRItexBufferExtension *) extensions[i]; + __glXEnableDirectExtension(psc, "GLX_EXT_texture_from_pixmap"); + } +#endif + + /* Ignore unknown extensions */ + } +} + +#endif /* GLX_DIRECT_RENDERING */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/dri_common.h xpsb-glx-0.19/mesa/src/glx/x11/dri_common.h --- xpsb-glx-0.19/mesa/src/glx/x11/dri_common.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/dri_common.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,61 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright © 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kevin E. Martin + * Brian Paul + * Kristian Høgsberg (krh@redhat.com) + */ + +#ifndef _DRI_COMMON_H +#define _DRI_COMMON_H + +typedef struct __GLXDRIconfigPrivateRec __GLXDRIconfigPrivate; + +struct __GLXDRIconfigPrivateRec +{ + __GLcontextModes modes; + const __DRIconfig *driConfig; +}; + +extern __GLcontextModes *driConvertConfigs(const __DRIcoreExtension * core, + __GLcontextModes * modes, + const __DRIconfig ** configs); + +extern const __DRIsystemTimeExtension systemTimeExtension; + +extern void InfoMessageF(const char *f, ...); + +extern void ErrorMessageF(const char *f, ...); + +extern void *driOpenDriver(const char *driverName); + +extern void driBindExtensions(__GLXscreenConfigs * psc, int dri2); + +#endif /* _DRI_COMMON_H */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/dri_glx.c xpsb-glx-0.19/mesa/src/glx/x11/dri_glx.c --- xpsb-glx-0.19/mesa/src/glx/x11/dri_glx.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/dri_glx.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,705 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Brian Paul + * + */ + +#ifdef GLX_DIRECT_RENDERING + +#include +#include +#include +#include "glxclient.h" +#include "glcontextmodes.h" +#include "xf86dri.h" +#include "sarea.h" +#include +#include +#include +#include "xf86drm.h" +#include "dri_common.h" + +typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate; +typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate; + +struct __GLXDRIdisplayPrivateRec { + __GLXDRIdisplay base; + + /* + ** XFree86-DRI version information + */ + int driMajor; + int driMinor; + int driPatch; +}; + +struct __GLXDRIcontextPrivateRec { + __GLXDRIcontext base; + __DRIcontext *driContext; + XID hwContextID; + __GLXscreenConfigs *psc; +}; + +/* + * Given a display pointer and screen number, determine the name of + * the DRI driver for the screen. (I.e. "r128", "tdfx", etc). + * Return True for success, False for failure. + */ +static Bool driGetDriverName(Display *dpy, int scrNum, char **driverName) +{ + int directCapable; + Bool b; + int driverMajor, driverMinor, driverPatch; + + *driverName = NULL; + + if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) { + ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n"); + return False; + } + if (!directCapable) { + ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n"); + return False; + } + + b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor, + &driverPatch, driverName); + if (!b) { + ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum); + return False; + } + + InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n", + driverMajor, driverMinor, driverPatch, *driverName, scrNum); + + return True; +} + +/* + * Exported function for querying the DRI driver for a given screen. + * + * The returned char pointer points to a static array that will be + * overwritten by subsequent calls. + */ +PUBLIC const char *glXGetScreenDriver (Display *dpy, int scrNum) { + static char ret[32]; + char *driverName; + if (driGetDriverName(dpy, scrNum, &driverName)) { + int len; + if (!driverName) + return NULL; + len = strlen (driverName); + if (len >= 31) + return NULL; + memcpy (ret, driverName, len+1); + Xfree(driverName); + return ret; + } + return NULL; +} + +/* + * Exported function for obtaining a driver's option list (UTF-8 encoded XML). + * + * The returned char pointer points directly into the driver. Therefore + * it should be treated as a constant. + * + * If the driver was not found or does not support configuration NULL is + * returned. + * + * Note: The driver remains opened after this function returns. + */ +PUBLIC const char *glXGetDriverConfig (const char *driverName) +{ + void *handle = driOpenDriver (driverName); + if (handle) + return dlsym (handle, "__driConfigOptions"); + else + return NULL; +} + +#ifdef XDAMAGE_1_1_INTERFACE + +static GLboolean has_damage_post(Display *dpy) +{ + static GLboolean inited = GL_FALSE; + static GLboolean has_damage; + + if (!inited) { + int major, minor; + + if (XDamageQueryVersion(dpy, &major, &minor) && + major == 1 && minor >= 1) + { + has_damage = GL_TRUE; + } else { + has_damage = GL_FALSE; + } + inited = GL_TRUE; + } + + return has_damage; +} + +static void __glXReportDamage(__DRIdrawable *driDraw, + int x, int y, + drm_clip_rect_t *rects, int num_rects, + GLboolean front_buffer, + void *loaderPrivate) +{ + XRectangle *xrects; + XserverRegion region; + int i; + int x_off, y_off; + __GLXDRIdrawable *glxDraw = loaderPrivate; + __GLXscreenConfigs *psc = glxDraw->psc; + Display *dpy = psc->dpy; + Drawable drawable; + + if (!has_damage_post(dpy)) + return; + + if (front_buffer) { + x_off = x; + y_off = y; + drawable = RootWindow(dpy, psc->scr); + } else{ + x_off = 0; + y_off = 0; + drawable = glxDraw->xDrawable; + } + + xrects = malloc(sizeof(XRectangle) * num_rects); + if (xrects == NULL) + return; + + for (i = 0; i < num_rects; i++) { + xrects[i].x = rects[i].x1 + x_off; + xrects[i].y = rects[i].y1 + y_off; + xrects[i].width = rects[i].x2 - rects[i].x1; + xrects[i].height = rects[i].y2 - rects[i].y1; + } + region = XFixesCreateRegion(dpy, xrects, num_rects); + free(xrects); + XDamageAdd(dpy, drawable, region); + XFixesDestroyRegion(dpy, region); +} + +static const __DRIdamageExtension damageExtension = { + { __DRI_DAMAGE, __DRI_DAMAGE_VERSION }, + __glXReportDamage, +}; + +#endif + +static GLboolean +__glXDRIGetDrawableInfo(__DRIdrawable *drawable, + unsigned int *index, unsigned int *stamp, + int *X, int *Y, int *W, int *H, + int *numClipRects, drm_clip_rect_t ** pClipRects, + int *backX, int *backY, + int *numBackClipRects, drm_clip_rect_t **pBackClipRects, + void *loaderPrivate) +{ + __GLXDRIdrawable *glxDraw = loaderPrivate; + __GLXscreenConfigs *psc = glxDraw->psc; + Display *dpy = psc->dpy; + + return XF86DRIGetDrawableInfo(dpy, psc->scr, glxDraw->drawable, + index, stamp, X, Y, W, H, + numClipRects, pClipRects, + backX, backY, + numBackClipRects, pBackClipRects); +} + +static const __DRIgetDrawableInfoExtension getDrawableInfoExtension = { + { __DRI_GET_DRAWABLE_INFO, __DRI_GET_DRAWABLE_INFO_VERSION }, + __glXDRIGetDrawableInfo +}; + +static const __DRIextension *loader_extensions[] = { + &systemTimeExtension.base, + &getDrawableInfoExtension.base, +#ifdef XDAMAGE_1_1_INTERFACE + &damageExtension.base, +#endif + NULL +}; + +#ifndef GLX_USE_APPLEGL + +/** + * Perform the required libGL-side initialization and call the client-side + * driver's \c __driCreateNewScreen function. + * + * \param dpy Display pointer. + * \param scrn Screen number on the display. + * \param psc DRI screen information. + * \param driDpy DRI display information. + * \param createNewScreen Pointer to the client-side driver's + * \c __driCreateNewScreen function. + * \returns A pointer to the \c __DRIscreenPrivate structure returned by + * the client-side driver on success, or \c NULL on failure. + */ +static void * +CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc, + __GLXDRIdisplayPrivate * driDpy) +{ + void *psp = NULL; + drm_handle_t hSAREA; + drmAddress pSAREA = MAP_FAILED; + char *BusID; + __DRIversion ddx_version; + __DRIversion dri_version; + __DRIversion drm_version; + __DRIframebuffer framebuffer; + int fd = -1; + int status; + + drm_magic_t magic; + drmVersionPtr version; + int newlyopened; + char *driverName; + drm_handle_t hFB; + int junk; + const __DRIconfig **driver_configs; + + /* DRI protocol version. */ + dri_version.major = driDpy->driMajor; + dri_version.minor = driDpy->driMinor; + dri_version.patch = driDpy->driPatch; + + framebuffer.base = MAP_FAILED; + framebuffer.dev_priv = NULL; + + if (!XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) { + ErrorMessageF("XF86DRIOpenConnection failed\n"); + goto handle_error; + } + + fd = drmOpenOnce(NULL, BusID, &newlyopened); + + Xfree(BusID); /* No longer needed */ + + if (fd < 0) { + ErrorMessageF("drmOpenOnce failed (%s)\n", strerror(-fd)); + goto handle_error; + } + + if (drmGetMagic(fd, &magic)) { + ErrorMessageF("drmGetMagic failed\n"); + goto handle_error; + } + + version = drmGetVersion(fd); + if (version) { + drm_version.major = version->version_major; + drm_version.minor = version->version_minor; + drm_version.patch = version->version_patchlevel; + drmFreeVersion(version); + } + else { + drm_version.major = -1; + drm_version.minor = -1; + drm_version.patch = -1; + } + + if (newlyopened && !XF86DRIAuthConnection(dpy, scrn, magic)) { + ErrorMessageF("XF86DRIAuthConnection failed\n"); + goto handle_error; + } + + /* Get device name (like "tdfx") and the ddx version numbers. + * We'll check the version in each DRI driver's "createNewScreen" + * function. */ + if (!XF86DRIGetClientDriverName(dpy, scrn, + &ddx_version.major, + &ddx_version.minor, + &ddx_version.patch, + &driverName)) { + ErrorMessageF("XF86DRIGetClientDriverName failed\n"); + goto handle_error; + } + + Xfree(driverName); /* No longer needed. */ + + /* + * Get device-specific info. pDevPriv will point to a struct + * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that + * has information about the screen size, depth, pitch, ancilliary + * buffers, DRM mmap handles, etc. + */ + if (!XF86DRIGetDeviceInfo(dpy, scrn, &hFB, &junk, + &framebuffer.size, &framebuffer.stride, + &framebuffer.dev_priv_size, &framebuffer.dev_priv)) { + ErrorMessageF("XF86DRIGetDeviceInfo failed"); + goto handle_error; + } + + framebuffer.width = DisplayWidth(dpy, scrn); + framebuffer.height = DisplayHeight(dpy, scrn); + + /* Map the framebuffer region. */ + status = drmMap(fd, hFB, framebuffer.size, + (drmAddressPtr)&framebuffer.base); + if (status != 0) { + ErrorMessageF("drmMap of framebuffer failed (%s)", strerror(-status)); + goto handle_error; + } + + /* Map the SAREA region. Further mmap regions may be setup in + * each DRI driver's "createNewScreen" function. + */ + status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA); + if (status != 0) { + ErrorMessageF("drmMap of SAREA failed (%s)", strerror(-status)); + goto handle_error; + } + + psp = (*psc->legacy->createNewScreen)(scrn, + &ddx_version, + &dri_version, + &drm_version, + &framebuffer, + pSAREA, + fd, + loader_extensions, + &driver_configs, + psc); + + if (psp == NULL) { + ErrorMessageF("Calling driver entry point failed"); + goto handle_error; + } + + psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); + psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + + return psp; + + handle_error: + if (pSAREA != MAP_FAILED) + drmUnmap(pSAREA, SAREA_MAX); + + if (framebuffer.base != MAP_FAILED) + drmUnmap((drmAddress)framebuffer.base, framebuffer.size); + + if (framebuffer.dev_priv != NULL) + Xfree(framebuffer.dev_priv); + + if (fd >= 0) + drmCloseOnce(fd); + + XF86DRICloseConnection(dpy, scrn); + + ErrorMessageF("reverting to software direct rendering\n"); + + return NULL; +} + +#else /* !GLX_USE_APPLEGL */ + +static void * +CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc, + __GLXDRIdisplayPrivate * driDpy) +{ + return NULL; +} + +#endif /* !GLX_USE_APPLEGL */ + +static void driDestroyContext(__GLXDRIcontext *context, + __GLXscreenConfigs *psc, Display *dpy) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + + (*psc->core->destroyContext)(pcp->driContext); + + XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID); + Xfree(pcp); +} + +static Bool driBindContext(__GLXDRIcontext *context, + __GLXDRIdrawable *draw, __GLXDRIdrawable *read) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + return (*core->bindContext)(pcp->driContext, + draw->driDrawable, + read->driDrawable); +} + +static void driUnbindContext(__GLXDRIcontext *context) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + (*core->unbindContext)(pcp->driContext); +} + +static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType) +{ + __GLXDRIcontextPrivate *pcp, *pcp_shared; + drm_context_t hwContext; + __DRIcontext *shared = NULL; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; + + if (!psc || !psc->driScreen) + return NULL; + + if (shareList) { + pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; + shared = pcp_shared->driContext; + } + + pcp = Xmalloc(sizeof *pcp); + if (pcp == NULL) + return NULL; + + pcp->psc = psc; + if (!XF86DRICreateContextWithConfig(psc->dpy, psc->scr, + mode->visualID, + &pcp->hwContextID, &hwContext)) { + Xfree(pcp); + return NULL; + } + + pcp->driContext = + (*psc->legacy->createNewContext)(psc->__driScreen, + config->driConfig, + renderType, + shared, + hwContext, + pcp); + if (pcp->driContext == NULL) { + XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID); + Xfree(pcp); + return NULL; + } + + pcp->base.destroyContext = driDestroyContext; + pcp->base.bindContext = driBindContext; + pcp->base.unbindContext = driUnbindContext; + + return &pcp->base; +} + +static void driDestroyDrawable(__GLXDRIdrawable *pdraw) +{ + __GLXscreenConfigs *psc = pdraw->psc; + + (*psc->core->destroyDrawable)(pdraw->driDrawable); + XF86DRIDestroyDrawable(psc->dpy, psc->scr, pdraw->drawable); + Xfree(pdraw); +} + +static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc, + XID xDrawable, + GLXDrawable drawable, + const __GLcontextModes *modes) +{ + __GLXDRIdrawable *pdraw; + drm_drawable_t hwDrawable; + void *empty_attribute_list = NULL; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; + + /* Old dri can't handle GLX 1.3+ drawable constructors. */ + if (xDrawable != drawable) + return NULL; + + pdraw = Xmalloc(sizeof(*pdraw)); + if (!pdraw) + return NULL; + + pdraw->drawable = drawable; + pdraw->psc = psc; + + if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) + return NULL; + + /* Create a new drawable */ + pdraw->driDrawable = + (*psc->legacy->createNewDrawable)(psc->__driScreen, + config->driConfig, + hwDrawable, + GLX_WINDOW_BIT, + empty_attribute_list, + pdraw); + + if (!pdraw->driDrawable) { + XF86DRIDestroyDrawable(psc->dpy, psc->scr, drawable); + Xfree(pdraw); + return NULL; + } + + pdraw->destroyDrawable = driDestroyDrawable; + + return pdraw; +} + +static void driSwapBuffers(__GLXDRIdrawable *pdraw) +{ + (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable); +} + +static void driCopySubBuffer(__GLXDRIdrawable *pdraw, + int x, int y, int width, int height) +{ + (*pdraw->psc->driCopySubBuffer->copySubBuffer)(pdraw->driDrawable, + x, y, width, height); +} + +static void driDestroyScreen(__GLXscreenConfigs *psc) +{ + /* Free the direct rendering per screen data */ + if (psc->__driScreen) + (*psc->core->destroyScreen)(psc->__driScreen); + psc->__driScreen = NULL; + if (psc->driver) + dlclose(psc->driver); +} + +static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, + __GLXdisplayPrivate *priv) +{ + __GLXDRIdisplayPrivate *pdp; + __GLXDRIscreen *psp; + const __DRIextension **extensions; + char *driverName; + int i; + + psp = Xmalloc(sizeof *psp); + if (psp == NULL) + return NULL; + + /* Initialize per screen dynamic client GLX extensions */ + psc->ext_list_first_time = GL_TRUE; + + if (!driGetDriverName(priv->dpy, screen, &driverName)) { + Xfree(psp); + return NULL; + } + + psc->driver = driOpenDriver(driverName); + Xfree(driverName); + if (psc->driver == NULL) { + Xfree(psp); + return NULL; + } + + extensions = dlsym(psc->driver, __DRI_DRIVER_EXTENSIONS); + if (extensions == NULL) { + ErrorMessageF("driver exports no extensions (%s)\n", dlerror()); + Xfree(psp); + return NULL; + } + + for (i = 0; extensions[i]; i++) { + if (strcmp(extensions[i]->name, __DRI_CORE) == 0) + psc->core = (__DRIcoreExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0) + psc->legacy = (__DRIlegacyExtension *) extensions[i]; + } + + if (psc->core == NULL || psc->legacy == NULL) { + Xfree(psp); + return NULL; + } + + pdp = (__GLXDRIdisplayPrivate *) priv->driDisplay; + psc->__driScreen = + CallCreateNewScreen(psc->dpy, screen, psc, pdp); + if (psc->__driScreen == NULL) { + dlclose(psc->driver); + Xfree(psp); + return NULL; + } + + driBindExtensions(psc, 0); + if (psc->driCopySubBuffer) + psp->copySubBuffer = driCopySubBuffer; + + psp->destroyScreen = driDestroyScreen; + psp->createContext = driCreateContext; + psp->createDrawable = driCreateDrawable; + psp->swapBuffers = driSwapBuffers; + psp->waitX = NULL; + psp->waitGL = NULL; + + return psp; +} + +/* Called from __glXFreeDisplayPrivate. + */ +static void driDestroyDisplay(__GLXDRIdisplay *dpy) +{ + Xfree(dpy); +} + +/* + * Allocate, initialize and return a __DRIdisplayPrivate object. + * This is called from __glXInitialize() when we are given a new + * display pointer. + */ +_X_HIDDEN __GLXDRIdisplay *driCreateDisplay(Display *dpy) +{ + __GLXDRIdisplayPrivate *pdpyp; + int eventBase, errorBase; + int major, minor, patch; + + if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) { + return NULL; + } + + if (!XF86DRIQueryVersion(dpy, &major, &minor, &patch)) { + return NULL; + } + + pdpyp = Xmalloc(sizeof *pdpyp); + if (!pdpyp) { + return NULL; + } + + pdpyp->driMajor = major; + pdpyp->driMinor = minor; + pdpyp->driPatch = patch; + + pdpyp->base.destroyDisplay = driDestroyDisplay; + pdpyp->base.createScreen = driCreateScreen; + + return &pdpyp->base; +} + +#endif /* GLX_DIRECT_RENDERING */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/drisw_glx.c xpsb-glx-0.19/mesa/src/glx/x11/drisw_glx.c --- xpsb-glx-0.19/mesa/src/glx/x11/drisw_glx.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/drisw_glx.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,450 @@ +/* + * Copyright 2008 George Sapountzis + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifdef GLX_DIRECT_RENDERING + +#include +#include "glxclient.h" +#include "glcontextmodes.h" +#include +#include "dri_common.h" + +typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate; +typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate; +typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate; + +struct __GLXDRIdisplayPrivateRec +{ + __GLXDRIdisplay base; +}; + +struct __GLXDRIcontextPrivateRec +{ + __GLXDRIcontext base; + __DRIcontext *driContext; + __GLXscreenConfigs *psc; +}; + +struct __GLXDRIdrawablePrivateRec +{ + __GLXDRIdrawable base; + + GC gc; + GC swapgc; + + XVisualInfo *visinfo; + XImage *ximage; + int bpp; +}; + +/** + * swrast loader functions + */ + +static Bool +XCreateDrawable(__GLXDRIdrawablePrivate * pdp, + Display * dpy, XID drawable, int visualid) +{ + XGCValues gcvalues; + long visMask; + XVisualInfo visTemp; + int num_visuals; + + /* create GC's */ + pdp->gc = XCreateGC(dpy, drawable, 0, NULL); + pdp->swapgc = XCreateGC(dpy, drawable, 0, NULL); + + gcvalues.function = GXcopy; + gcvalues.graphics_exposures = False; + XChangeGC(dpy, pdp->gc, GCFunction, &gcvalues); + XChangeGC(dpy, pdp->swapgc, GCFunction, &gcvalues); + XChangeGC(dpy, pdp->swapgc, GCGraphicsExposures, &gcvalues); + + /* create XImage */ + visTemp.screen = DefaultScreen(dpy); + visTemp.visualid = visualid; + visMask = (VisualScreenMask | VisualIDMask); + pdp->visinfo = XGetVisualInfo(dpy, visMask, &visTemp, &num_visuals); + + pdp->ximage = XCreateImage(dpy, pdp->visinfo->visual, pdp->visinfo->depth, ZPixmap, 0, /* format, offset */ + NULL, /* data */ + 0, 0, /* size */ + 32, /* bitmap_pad */ + 0); /* bytes_per_line */ + + /* get the true number of bits per pixel */ + pdp->bpp = pdp->ximage->bits_per_pixel; + + return True; +} + +static void +XDestroyDrawable(__GLXDRIdrawablePrivate * pdp, Display * dpy, XID drawable) +{ + XDestroyImage(pdp->ximage); + XFree(pdp->visinfo); + + XFreeGC(dpy, pdp->gc); + XFreeGC(dpy, pdp->swapgc); +} + +static void +swrastGetDrawableInfo(__DRIdrawable * draw, + int *x, int *y, int *w, int *h, void *loaderPrivate) +{ + __GLXDRIdrawablePrivate *pdp = loaderPrivate; + __GLXDRIdrawable *pdraw = &(pdp->base); + Display *dpy = pdraw->psc->dpy; + Drawable drawable; + + Window root; + Status stat; + unsigned int bw, depth; + + drawable = pdraw->xDrawable; + + stat = XGetGeometry(dpy, drawable, &root, + x, y, (unsigned int *) w, (unsigned int *) h, + &bw, &depth); +} + +static inline int +bytes_per_line(int w, int bpp, unsigned mul) +{ + unsigned mask = mul - 1; + + return ((w * bpp + mask) & ~mask) / 8; +} + +static void +swrastPutImage(__DRIdrawable * draw, int op, + int x, int y, int w, int h, char *data, void *loaderPrivate) +{ + __GLXDRIdrawablePrivate *pdp = loaderPrivate; + __GLXDRIdrawable *pdraw = &(pdp->base); + Display *dpy = pdraw->psc->dpy; + Drawable drawable; + XImage *ximage; + GC gc; + + switch (op) { + case __DRI_SWRAST_IMAGE_OP_DRAW: + gc = pdp->gc; + break; + case __DRI_SWRAST_IMAGE_OP_SWAP: + gc = pdp->swapgc; + break; + default: + return; + } + + drawable = pdraw->xDrawable; + + ximage = pdp->ximage; + ximage->data = data; + ximage->width = w; + ximage->height = h; + ximage->bytes_per_line = bytes_per_line(w, pdp->bpp, 32); + + XPutImage(dpy, drawable, gc, ximage, 0, 0, x, y, w, h); + + ximage->data = NULL; +} + +static void +swrastGetImage(__DRIdrawable * draw, + int x, int y, int w, int h, char *data, void *loaderPrivate) +{ + __GLXDRIdrawablePrivate *pdp = loaderPrivate; + __GLXDRIdrawable *pdraw = &(pdp->base); + Display *dpy = pdraw->psc->dpy; + Drawable drawable; + XImage *ximage; + + drawable = pdraw->xDrawable; + + ximage = pdp->ximage; + ximage->data = data; + ximage->width = w; + ximage->height = h; + ximage->bytes_per_line = bytes_per_line(w, pdp->bpp, 32); + + XGetSubImage(dpy, drawable, x, y, w, h, ~0L, ZPixmap, ximage, 0, 0); + + ximage->data = NULL; +} + +static const __DRIswrastLoaderExtension swrastLoaderExtension = { + {__DRI_SWRAST_LOADER, __DRI_SWRAST_LOADER_VERSION}, + swrastGetDrawableInfo, + swrastPutImage, + swrastGetImage +}; + +static const __DRIextension *loader_extensions[] = { + &systemTimeExtension.base, + &swrastLoaderExtension.base, + NULL +}; + +/** + * GLXDRI functions + */ + +static void +driDestroyContext(__GLXDRIcontext * context, + __GLXscreenConfigs * psc, Display * dpy) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + (*core->destroyContext) (pcp->driContext); + + Xfree(pcp); +} + +static Bool +driBindContext(__GLXDRIcontext * context, + __GLXDRIdrawable * draw, __GLXDRIdrawable * read) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + return (*core->bindContext) (pcp->driContext, + draw->driDrawable, read->driDrawable); +} + +static void +driUnbindContext(__GLXDRIcontext * context) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + const __DRIcoreExtension *core = pcp->psc->core; + + (*core->unbindContext) (pcp->driContext); +} + +static __GLXDRIcontext * +driCreateContext(__GLXscreenConfigs * psc, + const __GLcontextModes * mode, + GLXContext gc, GLXContext shareList, int renderType) +{ + __GLXDRIcontextPrivate *pcp, *pcp_shared; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; + const __DRIcoreExtension *core = psc->core; + __DRIcontext *shared = NULL; + + if (!psc || !psc->driScreen) + return NULL; + + if (shareList) { + pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; + shared = pcp_shared->driContext; + } + + pcp = Xmalloc(sizeof *pcp); + if (pcp == NULL) + return NULL; + + pcp->psc = psc; + pcp->driContext = + (*core->createNewContext) (psc->__driScreen, + config->driConfig, shared, pcp); + if (pcp->driContext == NULL) { + Xfree(pcp); + return NULL; + } + + pcp->base.destroyContext = driDestroyContext; + pcp->base.bindContext = driBindContext; + pcp->base.unbindContext = driUnbindContext; + + return &pcp->base; +} + +static void +driDestroyDrawable(__GLXDRIdrawable * pdraw) +{ + __GLXDRIdrawablePrivate *pdp = (__GLXDRIdrawablePrivate *) pdraw; + const __DRIcoreExtension *core = pdraw->psc->core; + + (*core->destroyDrawable) (pdraw->driDrawable); + + XDestroyDrawable(pdp, pdraw->psc->dpy, pdraw->drawable); + Xfree(pdp); +} + +static __GLXDRIdrawable * +driCreateDrawable(__GLXscreenConfigs * psc, + XID xDrawable, + GLXDrawable drawable, const __GLcontextModes * modes) +{ + __GLXDRIdrawable *pdraw; + __GLXDRIdrawablePrivate *pdp; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; + const __DRIswrastExtension *swrast = psc->swrast; + + /* Old dri can't handle GLX 1.3+ drawable constructors. */ + if (xDrawable != drawable) + return NULL; + + pdp = Xmalloc(sizeof(*pdp)); + if (!pdp) + return NULL; + + pdraw = &(pdp->base); + pdraw->xDrawable = xDrawable; + pdraw->drawable = drawable; + pdraw->psc = psc; + + XCreateDrawable(pdp, psc->dpy, xDrawable, modes->visualID); + + /* Create a new drawable */ + pdraw->driDrawable = + (*swrast->createNewDrawable) (psc->__driScreen, config->driConfig, pdp); + + if (!pdraw->driDrawable) { + XDestroyDrawable(pdp, psc->dpy, xDrawable); + Xfree(pdp); + return NULL; + } + + pdraw->destroyDrawable = driDestroyDrawable; + + return pdraw; +} + +static void +driSwapBuffers(__GLXDRIdrawable * pdraw) +{ + (*pdraw->psc->core->swapBuffers) (pdraw->driDrawable); +} + +static void +driDestroyScreen(__GLXscreenConfigs * psc) +{ + /* Free the direct rendering per screen data */ + (*psc->core->destroyScreen) (psc->__driScreen); + psc->__driScreen = NULL; + if (psc->driver) + dlclose(psc->driver); +} + +static __GLXDRIscreen * +driCreateScreen(__GLXscreenConfigs * psc, int screen, + __GLXdisplayPrivate * priv) +{ + __GLXDRIscreen *psp; + const __DRIconfig **driver_configs; + const __DRIextension **extensions; + const char *driverName = "swrast"; + int i; + + psp = Xmalloc(sizeof *psp); + if (psp == NULL) + return NULL; + + /* Initialize per screen dynamic client GLX extensions */ + psc->ext_list_first_time = GL_TRUE; + + psc->driver = driOpenDriver(driverName); + if (psc->driver == NULL) + goto handle_error; + + extensions = dlsym(psc->driver, __DRI_DRIVER_EXTENSIONS); + if (extensions == NULL) { + ErrorMessageF("driver exports no extensions (%s)\n", dlerror()); + goto handle_error; + } + + for (i = 0; extensions[i]; i++) { + if (strcmp(extensions[i]->name, __DRI_CORE) == 0) + psc->core = (__DRIcoreExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_SWRAST) == 0) + psc->swrast = (__DRIswrastExtension *) extensions[i]; + } + + if (psc->core == NULL || psc->swrast == NULL) { + ErrorMessageF("core dri extension not found\n"); + goto handle_error; + } + + psc->__driScreen = + psc->swrast->createNewScreen(screen, + loader_extensions, &driver_configs, psc); + if (psc->__driScreen == NULL) { + ErrorMessageF("failed to create dri screen\n"); + goto handle_error; + } + + driBindExtensions(psc, 0); + + psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); + psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + + psp->destroyScreen = driDestroyScreen; + psp->createContext = driCreateContext; + psp->createDrawable = driCreateDrawable; + psp->swapBuffers = driSwapBuffers; + + return psp; + + handle_error: + Xfree(psp); + + if (psc->driver) + dlclose(psc->driver); + + ErrorMessageF("reverting to indirect rendering\n"); + + return NULL; +} + +/* Called from __glXFreeDisplayPrivate. + */ +static void +driDestroyDisplay(__GLXDRIdisplay * dpy) +{ + Xfree(dpy); +} + +/* + * Allocate, initialize and return a __DRIdisplayPrivate object. + * This is called from __glXInitialize() when we are given a new + * display pointer. + */ +_X_HIDDEN __GLXDRIdisplay * +driswCreateDisplay(Display * dpy) +{ + __GLXDRIdisplayPrivate *pdpyp; + + pdpyp = Xmalloc(sizeof *pdpyp); + if (pdpyp == NULL) + return NULL; + + pdpyp->base.destroyDisplay = driDestroyDisplay; + pdpyp->base.createScreen = driCreateScreen; + + return &pdpyp->base; +} + +#endif /* GLX_DIRECT_RENDERING */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/eval.c xpsb-glx-0.19/mesa/src/glx/x11/eval.c --- xpsb-glx-0.19/mesa/src/glx/x11/eval.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/eval.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,132 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "packrender.h" + +/* +** Routines to pack evaluator maps into the transport buffer. Maps are +** allowed to have extra arbitrary data, so these routines extract just +** the information that the GL needs. +*/ + +void +__glFillMap1f(GLint k, GLint order, GLint stride, + const GLfloat * points, GLubyte * pc) +{ + if (stride == k) { + /* Just copy the data */ + __GLX_PUT_FLOAT_ARRAY(0, points, order * k); + } + else { + GLint i; + + for (i = 0; i < order; i++) { + __GLX_PUT_FLOAT_ARRAY(0, points, k); + points += stride; + pc += k * __GLX_SIZE_FLOAT32; + } + } +} + +void +__glFillMap1d(GLint k, GLint order, GLint stride, + const GLdouble * points, GLubyte * pc) +{ + if (stride == k) { + /* Just copy the data */ + __GLX_PUT_DOUBLE_ARRAY(0, points, order * k); + } + else { + GLint i; + for (i = 0; i < order; i++) { + __GLX_PUT_DOUBLE_ARRAY(0, points, k); + points += stride; + pc += k * __GLX_SIZE_FLOAT64; + } + } +} + +void +__glFillMap2f(GLint k, GLint majorOrder, GLint minorOrder, + GLint majorStride, GLint minorStride, + const GLfloat * points, GLfloat * data) +{ + GLint i, j, x; + + if ((minorStride == k) && (majorStride == minorOrder * k)) { + /* Just copy the data */ + __GLX_MEM_COPY(data, points, majorOrder * majorStride * + __GLX_SIZE_FLOAT32); + return; + } + for (i = 0; i < majorOrder; i++) { + for (j = 0; j < minorOrder; j++) { + for (x = 0; x < k; x++) { + data[x] = points[x]; + } + points += minorStride; + data += k; + } + points += majorStride - minorStride * minorOrder; + } +} + +void +__glFillMap2d(GLint k, GLint majorOrder, GLint minorOrder, + GLint majorStride, GLint minorStride, + const GLdouble * points, GLdouble * data) +{ + int i, j, x; + + if ((minorStride == k) && (majorStride == minorOrder * k)) { + /* Just copy the data */ + __GLX_MEM_COPY(data, points, majorOrder * majorStride * + __GLX_SIZE_FLOAT64); + return; + } + +#ifdef __GLX_ALIGN64 + x = k * __GLX_SIZE_FLOAT64; +#endif + for (i = 0; i < majorOrder; i++) { + for (j = 0; j < minorOrder; j++) { +#ifdef __GLX_ALIGN64 + __GLX_MEM_COPY(data, points, x); +#else + for (x = 0; x < k; x++) { + data[x] = points[x]; + } +#endif + points += minorStride; + data += k; + } + points += majorStride - minorStride * minorOrder; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.c xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.c --- xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,544 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glcontextmodes.c + * Utility routines for working with \c __GLcontextModes structures. At + * some point most or all of these functions will be moved to the Mesa + * code base. + * + * \author Ian Romanick + */ + +#if defined(IN_MINI_GLX) +#include +#else +#if defined(HAVE_DIX_CONFIG_H) +# include +#endif +#include +#include +#include "GL/glxint.h" +#endif + +/* Memory macros */ +#if defined(IN_MINI_GLX) +# include +# include +# define _mesa_malloc(b) malloc(b) +# define _mesa_free(m) free(m) +# define _mesa_memset memset +#else +# ifdef XFree86Server +# include +# include +# define _mesa_malloc(b) xalloc(b) +# define _mesa_free(m) xfree(m) +# define _mesa_memset memset +# else +# include +# define _mesa_memset memset +# define _mesa_malloc(b) Xmalloc(b) +# define _mesa_free(m) Xfree(m) +# endif /* XFree86Server */ +#endif /* !defined(IN_MINI_GLX) */ + +#include "glcontextmodes.h" + +#if !defined(IN_MINI_GLX) +#define NUM_VISUAL_TYPES 6 + +/** + * Convert an X visual type to a GLX visual type. + * + * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.) + * to be converted. + * \return If \c visualType is a valid X visual type, a GLX visual type will + * be returned. Otherwise \c GLX_NONE will be returned. + */ +GLint +_gl_convert_from_x_visual_type(int visualType) +{ + static const int glx_visual_types[NUM_VISUAL_TYPES] = { + GLX_STATIC_GRAY, GLX_GRAY_SCALE, + GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, + GLX_TRUE_COLOR, GLX_DIRECT_COLOR + }; + + return ((unsigned) visualType < NUM_VISUAL_TYPES) + ? glx_visual_types[visualType] : GLX_NONE; +} + + +/** + * Convert a GLX visual type to an X visual type. + * + * \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR, + * \c GLX_STATIC_GRAY, etc.) to be converted. + * \return If \c visualType is a valid GLX visual type, an X visual type will + * be returned. Otherwise -1 will be returned. + */ +GLint +_gl_convert_to_x_visual_type(int visualType) +{ + static const int x_visual_types[NUM_VISUAL_TYPES] = { + TrueColor, DirectColor, + PseudoColor, StaticColor, + GrayScale, StaticGray + }; + + return ((unsigned) (visualType - GLX_TRUE_COLOR) < NUM_VISUAL_TYPES) + ? x_visual_types[visualType - GLX_TRUE_COLOR] : -1; +} + + +/** + * Copy a GLX visual config structure to a GL context mode structure. All + * of the fields in \c config are copied to \c mode. Additional fields in + * \c mode that can be derrived from the fields of \c config (i.e., + * \c haveDepthBuffer) are also filled in. The remaining fields in \c mode + * that cannot be derived are set to default values. + * + * \param mode Destination GL context mode. + * \param config Source GLX visual config. + * + * \note + * The \c fbconfigID and \c visualID fields of the \c __GLcontextModes + * structure will be set to the \c vid of the \c __GLXvisualConfig structure. + */ +void +_gl_copy_visual_to_context_mode(__GLcontextModes * mode, + const __GLXvisualConfig * config) +{ + __GLcontextModes *const next = mode->next; + + (void) _mesa_memset(mode, 0, sizeof(__GLcontextModes)); + mode->next = next; + + mode->visualID = config->vid; + mode->visualType = _gl_convert_from_x_visual_type(config->class); + mode->xRenderable = GL_TRUE; + mode->fbconfigID = config->vid; + mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + + mode->rgbMode = (config->rgba != 0); + mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + + mode->colorIndexMode = !(mode->rgbMode); + mode->doubleBufferMode = (config->doubleBuffer != 0); + mode->stereoMode = (config->stereo != 0); + + mode->haveAccumBuffer = ((config->accumRedSize + + config->accumGreenSize + + config->accumBlueSize + + config->accumAlphaSize) > 0); + mode->haveDepthBuffer = (config->depthSize > 0); + mode->haveStencilBuffer = (config->stencilSize > 0); + + mode->redBits = config->redSize; + mode->greenBits = config->greenSize; + mode->blueBits = config->blueSize; + mode->alphaBits = config->alphaSize; + mode->redMask = config->redMask; + mode->greenMask = config->greenMask; + mode->blueMask = config->blueMask; + mode->alphaMask = config->alphaMask; + mode->rgbBits = mode->rgbMode ? config->bufferSize : 0; + mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0; + + mode->accumRedBits = config->accumRedSize; + mode->accumGreenBits = config->accumGreenSize; + mode->accumBlueBits = config->accumBlueSize; + mode->accumAlphaBits = config->accumAlphaSize; + mode->depthBits = config->depthSize; + mode->stencilBits = config->stencilSize; + + mode->numAuxBuffers = config->auxBuffers; + mode->level = config->level; + + mode->visualRating = config->visualRating; + mode->transparentPixel = config->transparentPixel; + mode->transparentRed = config->transparentRed; + mode->transparentGreen = config->transparentGreen; + mode->transparentBlue = config->transparentBlue; + mode->transparentAlpha = config->transparentAlpha; + mode->transparentIndex = config->transparentIndex; + mode->samples = config->multiSampleSize; + mode->sampleBuffers = config->nMultiSampleBuffers; + /* mode->visualSelectGroup = config->visualSelectGroup; ? */ + + mode->swapMethod = GLX_SWAP_UNDEFINED_OML; + + mode->bindToTextureRgb = (mode->rgbMode) ? GL_TRUE : GL_FALSE; + mode->bindToTextureRgba = (mode->rgbMode && mode->alphaBits) ? + GL_TRUE : GL_FALSE; + mode->bindToMipmapTexture = mode->rgbMode ? GL_TRUE : GL_FALSE; + mode->bindToTextureTargets = mode->rgbMode ? + GLX_TEXTURE_1D_BIT_EXT | GLX_TEXTURE_2D_BIT_EXT | + GLX_TEXTURE_RECTANGLE_BIT_EXT : 0; + mode->yInverted = GL_FALSE; +} + + +/** + * Get data from a GL context mode. + * + * \param mode GL context mode whose data is to be returned. + * \param attribute Attribute of \c mode that is to be returned. + * \param value_return Location to store the data member of \c mode. + * \return If \c attribute is a valid attribute of \c mode, zero is + * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. + */ +int +_gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, + int *value_return) +{ + switch (attribute) { + case GLX_USE_GL: + *value_return = GL_TRUE; + return 0; + case GLX_BUFFER_SIZE: + *value_return = mode->rgbBits; + return 0; + case GLX_RGBA: + *value_return = mode->rgbMode; + return 0; + case GLX_RED_SIZE: + *value_return = mode->redBits; + return 0; + case GLX_GREEN_SIZE: + *value_return = mode->greenBits; + return 0; + case GLX_BLUE_SIZE: + *value_return = mode->blueBits; + return 0; + case GLX_ALPHA_SIZE: + *value_return = mode->alphaBits; + return 0; + case GLX_DOUBLEBUFFER: + *value_return = mode->doubleBufferMode; + return 0; + case GLX_STEREO: + *value_return = mode->stereoMode; + return 0; + case GLX_AUX_BUFFERS: + *value_return = mode->numAuxBuffers; + return 0; + case GLX_DEPTH_SIZE: + *value_return = mode->depthBits; + return 0; + case GLX_STENCIL_SIZE: + *value_return = mode->stencilBits; + return 0; + case GLX_ACCUM_RED_SIZE: + *value_return = mode->accumRedBits; + return 0; + case GLX_ACCUM_GREEN_SIZE: + *value_return = mode->accumGreenBits; + return 0; + case GLX_ACCUM_BLUE_SIZE: + *value_return = mode->accumBlueBits; + return 0; + case GLX_ACCUM_ALPHA_SIZE: + *value_return = mode->accumAlphaBits; + return 0; + case GLX_LEVEL: + *value_return = mode->level; + return 0; + case GLX_TRANSPARENT_TYPE_EXT: + *value_return = mode->transparentPixel; + return 0; + case GLX_TRANSPARENT_RED_VALUE: + *value_return = mode->transparentRed; + return 0; + case GLX_TRANSPARENT_GREEN_VALUE: + *value_return = mode->transparentGreen; + return 0; + case GLX_TRANSPARENT_BLUE_VALUE: + *value_return = mode->transparentBlue; + return 0; + case GLX_TRANSPARENT_ALPHA_VALUE: + *value_return = mode->transparentAlpha; + return 0; + case GLX_TRANSPARENT_INDEX_VALUE: + *value_return = mode->transparentIndex; + return 0; + case GLX_X_VISUAL_TYPE: + *value_return = mode->visualType; + return 0; + case GLX_CONFIG_CAVEAT: + *value_return = mode->visualRating; + return 0; + case GLX_VISUAL_ID: + *value_return = mode->visualID; + return 0; + case GLX_DRAWABLE_TYPE: + *value_return = mode->drawableType; + return 0; + case GLX_RENDER_TYPE: + *value_return = mode->renderType; + return 0; + case GLX_X_RENDERABLE: + *value_return = mode->xRenderable; + return 0; + case GLX_FBCONFIG_ID: + *value_return = mode->fbconfigID; + return 0; + case GLX_MAX_PBUFFER_WIDTH: + *value_return = mode->maxPbufferWidth; + return 0; + case GLX_MAX_PBUFFER_HEIGHT: + *value_return = mode->maxPbufferHeight; + return 0; + case GLX_MAX_PBUFFER_PIXELS: + *value_return = mode->maxPbufferPixels; + return 0; + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + *value_return = mode->optimalPbufferWidth; + return 0; + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + *value_return = mode->optimalPbufferHeight; + return 0; + case GLX_SWAP_METHOD_OML: + *value_return = mode->swapMethod; + return 0; + case GLX_SAMPLE_BUFFERS_SGIS: + *value_return = mode->sampleBuffers; + return 0; + case GLX_SAMPLES_SGIS: + *value_return = mode->samples; + return 0; + case GLX_BIND_TO_TEXTURE_RGB_EXT: + *value_return = mode->bindToTextureRgb; + return 0; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + *value_return = mode->bindToTextureRgba; + return 0; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + *value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE : + GL_FALSE; + return 0; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + *value_return = mode->bindToTextureTargets; + return 0; + case GLX_Y_INVERTED_EXT: + *value_return = mode->yInverted; + return 0; + + /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. + * It is ONLY for communication between the GLX client and the GLX + * server. + */ + case GLX_VISUAL_SELECT_GROUP_SGIX: + default: + return GLX_BAD_ATTRIBUTE; + } +} +#endif /* !defined(IN_MINI_GLX) */ + + +/** + * Allocate a linked list of \c __GLcontextModes structures. The fields of + * each structure will be initialized to "reasonable" default values. In + * most cases this is the default value defined by table 3.4 of the GLX + * 1.3 specification. This means that most values are either initialized to + * zero or \c GLX_DONT_CARE (which is -1). As support for additional + * extensions is added, the new values will be initialized to appropriate + * values from the extension specification. + * + * \param count Number of structures to allocate. + * \param minimum_size Minimum size of a structure to allocate. This allows + * for differences in the version of the + * \c __GLcontextModes stucture used in libGL and in a + * DRI-based driver. + * \returns A pointer to the first element in a linked list of \c count + * stuctures on success, or \c NULL on failure. + * + * \warning Use of \c minimum_size does \b not guarantee binary compatibility. + * The fundamental assumption is that if the \c minimum_size + * specified by the driver and the size of the \c __GLcontextModes + * structure in libGL is the same, then the meaning of each byte in + * the structure is the same in both places. \b Be \b careful! + * Basically this means that fields have to be added in libGL and + * then propagated to drivers. Drivers should \b never arbitrarilly + * extend the \c __GLcontextModes data-structure. + */ +__GLcontextModes * +_gl_context_modes_create(unsigned count, size_t minimum_size) +{ + const size_t size = (minimum_size > sizeof(__GLcontextModes)) + ? minimum_size : sizeof(__GLcontextModes); + __GLcontextModes *base = NULL; + __GLcontextModes **next; + unsigned i; + + next = &base; + for (i = 0; i < count; i++) { + *next = (__GLcontextModes *) _mesa_malloc(size); + if (*next == NULL) { + _gl_context_modes_destroy(base); + base = NULL; + break; + } + + (void) _mesa_memset(*next, 0, size); + (*next)->visualID = GLX_DONT_CARE; + (*next)->visualType = GLX_DONT_CARE; + (*next)->visualRating = GLX_NONE; + (*next)->transparentPixel = GLX_NONE; + (*next)->transparentRed = GLX_DONT_CARE; + (*next)->transparentGreen = GLX_DONT_CARE; + (*next)->transparentBlue = GLX_DONT_CARE; + (*next)->transparentAlpha = GLX_DONT_CARE; + (*next)->transparentIndex = GLX_DONT_CARE; + (*next)->xRenderable = GLX_DONT_CARE; + (*next)->fbconfigID = GLX_DONT_CARE; + (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; + (*next)->bindToTextureRgb = GLX_DONT_CARE; + (*next)->bindToTextureRgba = GLX_DONT_CARE; + (*next)->bindToMipmapTexture = GLX_DONT_CARE; + (*next)->bindToTextureTargets = GLX_DONT_CARE; + (*next)->yInverted = GLX_DONT_CARE; + + next = &((*next)->next); + } + + return base; +} + + +/** + * Destroy a linked list of \c __GLcontextModes structures created by + * \c _gl_context_modes_create. + * + * \param modes Linked list of structures to be destroyed. All structres + * in the list will be freed. + */ +void +_gl_context_modes_destroy(__GLcontextModes * modes) +{ + while (modes != NULL) { + __GLcontextModes *const next = modes->next; + + _mesa_free(modes); + modes = next; + } +} + + +/** + * Find a context mode matching a Visual ID. + * + * \param modes List list of context-mode structures to be searched. + * \param vid Visual ID to be found. + * \returns A pointer to a context-mode in \c modes if \c vid was found in + * the list, or \c NULL if it was not. + */ + +__GLcontextModes * +_gl_context_modes_find_visual(__GLcontextModes * modes, int vid) +{ + __GLcontextModes *m; + + for (m = modes; m != NULL; m = m->next) + if (m->visualID == vid) + return m; + + return NULL; +} + +__GLcontextModes * +_gl_context_modes_find_fbconfig(__GLcontextModes * modes, int fbid) +{ + __GLcontextModes *m; + + for (m = modes; m != NULL; m = m->next) + if (m->fbconfigID == fbid) + return m; + + return NULL; +} + +/** + * Determine if two context-modes are the same. This is intended to be used + * by libGL implementations to compare to sets of driver generated FBconfigs. + * + * \param a Context-mode to be compared. + * \param b Context-mode to be compared. + * \returns \c GL_TRUE if the two context-modes are the same. \c GL_FALSE is + * returned otherwise. + */ +GLboolean +_gl_context_modes_are_same(const __GLcontextModes * a, + const __GLcontextModes * b) +{ + return ((a->rgbMode == b->rgbMode) && + (a->floatMode == b->floatMode) && + (a->colorIndexMode == b->colorIndexMode) && + (a->doubleBufferMode == b->doubleBufferMode) && + (a->stereoMode == b->stereoMode) && + (a->redBits == b->redBits) && + (a->greenBits == b->greenBits) && + (a->blueBits == b->blueBits) && (a->alphaBits == b->alphaBits) && +#if 0 /* For some reason these don't get set on the client-side in libGL. */ + (a->redMask == b->redMask) && + (a->greenMask == b->greenMask) && + (a->blueMask == b->blueMask) && (a->alphaMask == b->alphaMask) && +#endif + (a->rgbBits == b->rgbBits) && + (a->indexBits == b->indexBits) && + (a->accumRedBits == b->accumRedBits) && + (a->accumGreenBits == b->accumGreenBits) && + (a->accumBlueBits == b->accumBlueBits) && + (a->accumAlphaBits == b->accumAlphaBits) && + (a->depthBits == b->depthBits) && + (a->stencilBits == b->stencilBits) && + (a->numAuxBuffers == b->numAuxBuffers) && + (a->level == b->level) && + (a->pixmapMode == b->pixmapMode) && + (a->visualRating == b->visualRating) && + (a->transparentPixel == b->transparentPixel) && + ((a->transparentPixel != GLX_TRANSPARENT_RGB) || + ((a->transparentRed == b->transparentRed) && + (a->transparentGreen == b->transparentGreen) && + (a->transparentBlue == b->transparentBlue) && + (a->transparentAlpha == b->transparentAlpha))) && + ((a->transparentPixel != GLX_TRANSPARENT_INDEX) || + (a->transparentIndex == b->transparentIndex)) && + (a->sampleBuffers == b->sampleBuffers) && + (a->samples == b->samples) && + ((a->drawableType & b->drawableType) != 0) && + (a->renderType == b->renderType) && + (a->maxPbufferWidth == b->maxPbufferWidth) && + (a->maxPbufferHeight == b->maxPbufferHeight) && + (a->maxPbufferPixels == b->maxPbufferPixels) && + (a->optimalPbufferWidth == b->optimalPbufferWidth) && + (a->optimalPbufferHeight == b->optimalPbufferHeight) && + (a->swapMethod == b->swapMethod) && + (a->bindToTextureRgb == b->bindToTextureRgb) && + (a->bindToTextureRgba == b->bindToTextureRgba) && + (a->bindToMipmapTexture == b->bindToMipmapTexture) && + (a->bindToTextureTargets == b->bindToTextureTargets) && + (a->yInverted == b->yInverted)); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.h xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.h --- xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glcontextmodes.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,54 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glcontextmodes.h + * \author Ian Romanick + */ + +#ifndef GLCONTEXTMODES_H +#define GLCONTEXTMODES_H + +#include "GL/internal/glcore.h" + +#if !defined(IN_MINI_GLX) +extern GLint _gl_convert_from_x_visual_type(int visualType); +extern GLint _gl_convert_to_x_visual_type(int visualType); +extern void _gl_copy_visual_to_context_mode(__GLcontextModes * mode, + const __GLXvisualConfig * config); +extern int _gl_get_context_mode_data(const __GLcontextModes * mode, + int attribute, int *value_return); +#endif /* !defined(IN_MINI_GLX) */ + +extern __GLcontextModes *_gl_context_modes_create(unsigned count, + size_t minimum_size); +extern void _gl_context_modes_destroy(__GLcontextModes * modes); +extern __GLcontextModes *_gl_context_modes_find_visual(__GLcontextModes * + modes, int vid); +extern __GLcontextModes *_gl_context_modes_find_fbconfig(__GLcontextModes * + modes, int fbid); +extern GLboolean _gl_context_modes_are_same(const __GLcontextModes * a, + const __GLcontextModes * b); + +#endif /* GLCONTEXTMODES_H */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxclient.h xpsb-glx-0.19/mesa/src/glx/x11/glxclient.h --- xpsb-glx-0.19/mesa/src/glx/x11/glxclient.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxclient.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,767 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/** + * \file glxclient.h + * Direct rendering support added by Precision Insight, Inc. + * + * \author Kevin E. Martin + */ + +#ifndef _GLX_client_h_ +#define _GLX_client_h_ +#define NEED_REPLIES +#define NEED_EVENTS +#include +#include +#define GLX_GLXEXT_PROTOTYPES +#include +#include +#include +#include +#include +#ifdef WIN32 +#include +#endif +#include "GL/glxint.h" +#include "GL/glxproto.h" +#include "GL/internal/glcore.h" +#include "glapi/glapitable.h" +#include "glxhash.h" +#if defined( USE_XTHREADS ) +# include +#elif defined( PTHREADS ) +# include +#endif + +#include "glxextensions.h" + + +/* If we build the library with gcc's -fvisibility=hidden flag, we'll + * use the PUBLIC macro to mark functions that are to be exported. + * + * We also need to define a USED attribute, so the optimizer doesn't + * inline a static function that we later use in an alias. - ajax + */ +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define PUBLIC __attribute__((visibility("default"))) +# define USED __attribute__((used)) +#else +# define PUBLIC +# define USED +#endif + + + +#define GLX_MAJOR_VERSION 1 /* current version numbers */ +#define GLX_MINOR_VERSION 4 + +#define __GLX_MAX_TEXTURE_UNITS 32 + +typedef struct __GLXscreenConfigsRec __GLXscreenConfigs; +typedef struct __GLXcontextRec __GLXcontext; +typedef struct __GLXdrawableRec __GLXdrawable; +typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; +typedef struct _glapi_table __GLapi; + +/************************************************************************/ + +#ifdef GLX_DIRECT_RENDERING + +#define containerOf(ptr, type, member) \ + (type *)( (char *)ptr - offsetof(type,member) ) + +#include + + +/** + * Display dependent methods. This structure is initialized during the + * \c driCreateDisplay call. + */ +typedef struct __GLXDRIdisplayRec __GLXDRIdisplay; +typedef struct __GLXDRIscreenRec __GLXDRIscreen; +typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; +typedef struct __GLXDRIcontextRec __GLXDRIcontext; + +#include "glxextensions.h" + +struct __GLXDRIdisplayRec { + /** + * Method to destroy the private DRI display data. + */ + void (*destroyDisplay)(__GLXDRIdisplay *display); + + __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen, + __GLXdisplayPrivate *priv); +}; + +struct __GLXDRIscreenRec { + + void (*destroyScreen)(__GLXscreenConfigs *psc); + + __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType); + + __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, + XID drawable, + GLXDrawable glxDrawable, + const __GLcontextModes *modes); + + void (*swapBuffers)(__GLXDRIdrawable *pdraw); + void (*copySubBuffer)(__GLXDRIdrawable *pdraw, + int x, int y, int width, int height); + void (*waitX)(__GLXDRIdrawable *pdraw); + void (*waitGL)(__GLXDRIdrawable *pdraw); +}; + +struct __GLXDRIcontextRec { + void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc, + Display *dpy); + Bool (*bindContext)(__GLXDRIcontext *context, + __GLXDRIdrawable *pdraw, + __GLXDRIdrawable *pread); + + void (*unbindContext)(__GLXDRIcontext *context); +}; + +struct __GLXDRIdrawableRec { + void (*destroyDrawable)(__GLXDRIdrawable *drawable); + + XID xDrawable; + XID drawable; + __GLXscreenConfigs *psc; + GLenum textureTarget; + __DRIdrawable *driDrawable; +}; + +/* +** Function to create and DRI display data and initialize the display +** dependent methods. +*/ +extern __GLXDRIdisplay *driswCreateDisplay(Display *dpy); +extern __GLXDRIdisplay *driCreateDisplay(Display *dpy); +extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy); + +extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); + +/* +** Functions to obtain driver configuration information from a direct +** rendering client application +*/ +extern const char *glXGetScreenDriver (Display *dpy, int scrNum); + +extern const char *glXGetDriverConfig (const char *driverName); + +#endif + +/************************************************************************/ + +#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16 + +typedef struct __GLXpixelStoreModeRec { + GLboolean swapEndian; + GLboolean lsbFirst; + GLuint rowLength; + GLuint imageHeight; + GLuint imageDepth; + GLuint skipRows; + GLuint skipPixels; + GLuint skipImages; + GLuint alignment; +} __GLXpixelStoreMode; + + +typedef struct __GLXattributeRec { + GLuint mask; + + /** + * Pixel storage state. Most of the pixel store mode state is kept + * here and used by the client code to manage the packing and + * unpacking of data sent to/received from the server. + */ + __GLXpixelStoreMode storePack, storeUnpack; + + /** + * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically + * disabled? + */ + GLboolean NoDrawArraysProtocol; + + /** + * Vertex Array storage state. The vertex array component + * state is stored here and is used to manage the packing of + * DrawArrays data sent to the server. + */ + struct array_state_vector * array_state; +} __GLXattribute; + +typedef struct __GLXattributeMachineRec { + __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; + __GLXattribute **stackPointer; +} __GLXattributeMachine; + +/** + * GLX state that needs to be kept on the client. One of these records + * exist for each context that has been made current by this client. + */ +struct __GLXcontextRec { + /** + * \name Drawing command buffer. + * + * Drawing commands are packed into this buffer before being sent as a + * single GLX protocol request. The buffer is sent when it overflows or + * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location + * in the buffer to be filled. \c limit is described above in the buffer + * slop discussion. + * + * Commands that require large amounts of data to be transfered will + * also use this buffer to hold a header that describes the large + * command. + * + * These must be the first 6 fields since they are static initialized + * in the dummy context in glxext.c + */ + /*@{*/ + GLubyte *buf; + GLubyte *pc; + GLubyte *limit; + GLubyte *bufEnd; + GLint bufSize; + /*@}*/ + + /** + * The XID of this rendering context. When the context is created a + * new XID is allocated. This is set to None when the context is + * destroyed but is still current to some thread. In this case the + * context will be freed on next MakeCurrent. + */ + XID xid; + + /** + * The XID of the \c shareList context. + */ + XID share_xid; + + /** + * Screen number. + */ + GLint screen; + __GLXscreenConfigs *psc; + + /** + * \c GL_TRUE if the context was created with ImportContext, which + * means the server-side context was created by another X client. + */ + GLboolean imported; + + /** + * The context tag returned by MakeCurrent when this context is made + * current. This tag is used to identify the context that a thread has + * current so that proper server context management can be done. It is + * used for all context specific commands (i.e., \c Render, \c RenderLarge, + * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old + * context)). + */ + GLXContextTag currentContextTag; + + /** + * \name Rendering mode + * + * The rendering mode is kept on the client as well as the server. + * When \c glRenderMode is called, the buffer associated with the + * previous rendering mode (feedback or select) is filled. + */ + /*@{*/ + GLenum renderMode; + GLfloat *feedbackBuf; + GLuint *selectBuf; + /*@}*/ + + /** + * This is \c GL_TRUE if the pixel unpack modes are such that an image + * can be unpacked from the clients memory by just copying. It may + * still be true that the server will have to do some work. This + * just promises that a straight copy will fetch the correct bytes. + */ + GLboolean fastImageUnpack; + + /** + * Fill newImage with the unpacked form of \c oldImage getting it + * ready for transport to the server. + */ + void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLvoid*, GLubyte*, GLubyte*); + + /** + * Client side attribs. + */ + __GLXattributeMachine attributes; + + /** + * Client side error code. This is set when client side gl API + * routines need to set an error because of a bad enumerant or + * running out of memory, etc. + */ + GLenum error; + + /** + * Whether this context does direct rendering. + */ + Bool isDirect; + + /** + * \c dpy of current display for this context. Will be \c NULL if not + * current to any display, or if this is the "dummy context". + */ + Display *currentDpy; + + /** + * The current drawable for this context. Will be None if this + * context is not current to any drawable. currentReadable is below. + */ + GLXDrawable currentDrawable; + + /** + * \name GL Constant Strings + * + * Constant strings that describe the server implementation + * These pertain to GL attributes, not to be confused with + * GLX versioning attributes. + */ + /*@{*/ + GLubyte *vendor; + GLubyte *renderer; + GLubyte *version; + GLubyte *extensions; + /*@}*/ + + /** + * Record the dpy this context was created on for later freeing + */ + Display *createDpy; + + /** + * Maximum small render command size. This is the smaller of 64k and + * the size of the above buffer. + */ + GLint maxSmallRenderCommandSize; + + /** + * Major opcode for the extension. Copied here so a lookup isn't + * needed. + */ + GLint majorOpcode; + + /** + * Pointer to the mode used to create this context. + */ + const __GLcontextModes * mode; + +#ifdef GLX_DIRECT_RENDERING + __GLXDRIcontext *driContext; + __DRIcontext *__driContext; +#endif + + /** + * The current read-drawable for this context. Will be None if this + * context is not current to any drawable. + * + * \since Internal API version 20030606. + */ + GLXDrawable currentReadable; + + /** + * Pointer to client-state data that is private to libGL. This is only + * used for indirect rendering contexts. + * + * No internal API version change was made for this change. Client-side + * drivers should NEVER use this data or even care that it exists. + */ + void * client_state_private; + + /** + * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE. + */ + int renderType; + + /** + * \name Raw server GL version + * + * True core GL version supported by the server. This is the raw value + * returned by the server, and it may not reflect what is actually + * supported (or reported) by the client-side library. + */ + /*@{*/ + int server_major; /**< Major version number. */ + int server_minor; /**< Minor version number. */ + /*@}*/ + + char gl_extension_bits[ __GL_EXT_BYTES ]; +}; + +#define __glXSetError(gc,code) \ + if (!(gc)->error) { \ + (gc)->error = code; \ + } + +extern void __glFreeAttributeState(__GLXcontext *); + +/************************************************************************/ + +/** + * The size of the largest drawing command known to the implementation + * that will use the GLXRender GLX command. In this case it is + * \c glPolygonStipple. + */ +#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156 + +/** + * To keep the implementation fast, the code uses a "limit" pointer + * to determine when the drawing command buffer is too full to hold + * another fixed size command. This constant defines the amount of + * space that must always be available in the drawing command buffer + * at all times for the implementation to work. It is important that + * the number be just large enough, but not so large as to reduce the + * efficacy of the buffer. The "+32" is just to keep the code working + * in case somebody counts wrong. + */ +#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32) + +/** + * This implementation uses a smaller threshold for switching + * to the RenderLarge protocol than the protcol requires so that + * large copies don't occur. + */ +#define __GLX_RENDER_CMD_SIZE_LIMIT 4096 + +/** + * One of these records exists per screen of the display. It contains + * a pointer to the config data for that screen (if the screen supports GL). + */ +struct __GLXscreenConfigsRec { + /** + * GLX extension string reported by the X-server. + */ + const char *serverGLXexts; + + /** + * GLX extension string to be reported to applications. This is the + * set of extensions that the application can actually use. + */ + char *effectiveGLXexts; + +#ifdef GLX_DIRECT_RENDERING + /** + * Per screen direct rendering interface functions and data. + */ + __DRIscreen *__driScreen; + const __DRIcoreExtension *core; + const __DRIlegacyExtension *legacy; + const __DRIswrastExtension *swrast; + const __DRIdri2Extension *dri2; + __glxHashTable *drawHash; + Display *dpy; + int scr, fd; + void *driver; + + __GLXDRIscreen *driScreen; + +#ifdef __DRI_COPY_SUB_BUFFER + const __DRIcopySubBufferExtension *driCopySubBuffer; +#endif + +#ifdef __DRI_SWAP_CONTROL + const __DRIswapControlExtension *swapControl; +#endif + +#ifdef __DRI_ALLOCATE + const __DRIallocateExtension *allocate; +#endif + +#ifdef __DRI_FRAME_TRACKING + const __DRIframeTrackingExtension *frameTracking; +#endif + +#ifdef __DRI_MEDIA_STREAM_COUNTER + const __DRImediaStreamCounterExtension *msc; +#endif + +#ifdef __DRI_TEX_BUFFER + const __DRItexBufferExtension *texBuffer; +#endif + +#endif + + /** + * Linked list of glx visuals and fbconfigs for this screen. + */ + __GLcontextModes *visuals, *configs; + + /** + * Per-screen dynamic GLX extension tracking. The \c direct_support + * field only contains enough bits for 64 extensions. Should libGL + * ever need to track more than 64 GLX extensions, we can safely grow + * this field. The \c __GLXscreenConfigs structure is not used outside + * libGL. + */ + /*@{*/ + unsigned char direct_support[8]; + GLboolean ext_list_first_time; + /*@}*/ + +}; + +/** + * Per display private data. One of these records exists for each display + * that is using the OpenGL (GLX) extension. + */ +struct __GLXdisplayPrivateRec { + /** + * Back pointer to the display + */ + Display *dpy; + + /** + * The \c majorOpcode is common to all connections to the same server. + * It is also copied into the context structure. + */ + int majorOpcode; + + /** + * \name Server Version + * + * Major and minor version returned by the server during initialization. + */ + /*@{*/ + int majorVersion, minorVersion; + /*@}*/ + + /** + * \name Storage for the servers GLX vendor and versions strings. + * + * These are the same for all screens on this display. These fields will + * be filled in on demand. + */ + /*@{*/ + const char *serverGLXvendor; + const char *serverGLXversion; + /*@}*/ + + /** + * Configurations of visuals for all screens on this display. + * Also, per screen data which now includes the server \c GLX_EXTENSION + * string. + */ + __GLXscreenConfigs *screenConfigs; + +#ifdef GLX_DIRECT_RENDERING + /** + * Per display direct rendering interface functions and data. + */ + __GLXDRIdisplay *driswDisplay; + __GLXDRIdisplay *driDisplay; + __GLXDRIdisplay *dri2Display; +#endif +}; + + +extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*); + +extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber, + GLint totalRequests, + const GLvoid * data, GLint dataLen); + +extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, + const GLvoid *, GLint); + +/* Initialize the GLX extension for dpy */ +extern __GLXdisplayPrivate *__glXInitialize(Display*); + +/************************************************************************/ + +extern int __glXDebug; + +/* This is per-thread storage in an MT environment */ +#if defined( USE_XTHREADS ) || defined( PTHREADS ) + +extern void __glXSetCurrentContext(__GLXcontext *c); + +# if defined( GLX_USE_TLS ) + +extern __thread void * __glX_tls_Context + __attribute__((tls_model("initial-exec"))); + +# define __glXGetCurrentContext() __glX_tls_Context + +# else + +extern __GLXcontext *__glXGetCurrentContext(void); + +# endif /* defined( GLX_USE_TLS ) */ + +#else + +extern __GLXcontext *__glXcurrentContext; +#define __glXGetCurrentContext() __glXcurrentContext +#define __glXSetCurrentContext(gc) __glXcurrentContext = gc + +#endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */ + +extern void __glXSetCurrentContextNull(void); + +extern void __glXFreeContext(__GLXcontext*); + + +/* +** Global lock for all threads in this address space using the GLX +** extension +*/ +#if defined( USE_XTHREADS ) +extern xmutex_rec __glXmutex; +#define __glXLock() xmutex_lock(&__glXmutex) +#define __glXUnlock() xmutex_unlock(&__glXmutex) +#elif defined( PTHREADS ) +extern pthread_mutex_t __glXmutex; +#define __glXLock() pthread_mutex_lock(&__glXmutex) +#define __glXUnlock() pthread_mutex_unlock(&__glXmutex) +#else +#define __glXLock() +#define __glXUnlock() +#endif + +/* +** Setup for a command. Initialize the extension for dpy if necessary. +*/ +extern CARD8 __glXSetupForCommand(Display *dpy); + +/************************************************************************/ + +/* +** Data conversion and packing support. +*/ + +extern const GLuint __glXDefaultPixelStore[9]; + +/* Send an image to the server using RenderLarge. */ +extern void __glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim, + GLint width, GLint height, GLint depth, GLenum format, GLenum type, + const GLvoid *src, GLubyte *pc, GLubyte *modes); + +/* Return the size, in bytes, of some pixel data */ +extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum); + +/* Return the number of elements per group of a specified format*/ +extern GLint __glElementsPerGroup(GLenum format, GLenum type); + +/* Return the number of bytes per element, based on the element type (other +** than GL_BITMAP). +*/ +extern GLint __glBytesPerElement(GLenum type); + +/* +** Fill the transport buffer with the data from the users buffer, +** applying some of the pixel store modes (unpack modes) to the data +** first. As a side effect of this call, the "modes" field is +** updated to contain the modes needed by the server to decode the +** sent data. +*/ +extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLvoid*, GLubyte*, GLubyte*); + +/* Copy map data with a stride into a packed buffer */ +extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *); +extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *); +extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint, + const GLfloat *, GLfloat *); +extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, + const GLdouble *, GLdouble *); + +/* +** Empty an image out of the reply buffer into the clients memory applying +** the pack modes to pack back into the clients requested format. +*/ +extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLubyte *, GLvoid *); + + +/* +** Allocate and Initialize Vertex Array client state, and free. +*/ +extern void __glXInitVertexArrayState(__GLXcontext *); +extern void __glXFreeVertexArrayState(__GLXcontext *); + +/* +** Inform the Server of the major and minor numbers and of the client +** libraries extension string. +*/ +extern void __glXClientInfo ( Display *dpy, int opcode ); + +/************************************************************************/ + +/* +** Declarations that should be in Xlib +*/ +#ifdef __GL_USE_OUR_PROTOTYPES +extern void _XFlush(Display*); +extern Status _XReply(Display*, xReply*, int, Bool); +extern void _XRead(Display*, void*, long); +extern void _XSend(Display*, const void*, long); +#endif + + +extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, + int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags ); + +extern char * __glXQueryServerString(Display* dpy, int opcode, + CARD32 screen, CARD32 name); +extern char * __glXGetString(Display* dpy, int opcode, + CARD32 screen, CARD32 name); + +extern char *__glXstrdup(const char *str); + + +extern const char __glXGLClientVersion[]; +extern const char __glXGLClientExtensions[]; + +/* Get the unadjusted system time */ +extern int __glXGetUST( int64_t * ust ); + +extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, + int32_t * numerator, int32_t * denominator); + +#ifdef GLX_DIRECT_RENDERING +GLboolean +__driGetMscRateOML(__DRIdrawable *draw, + int32_t *numerator, int32_t *denominator, void *private); +#endif + +#endif /* !__GLX_client_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxcmds.c xpsb-glx-0.19/mesa/src/glx/x11/glxcmds.c --- xpsb-glx-0.19/mesa/src/glx/x11/glxcmds.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxcmds.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,2984 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/** + * \file glxcmds.c + * Client-side GLX interface. + */ + +#include "glxclient.h" +#include "glapi.h" +#include "glxextensions.h" +#include "glcontextmodes.h" + +#ifdef GLX_DIRECT_RENDERING +#include +#include +#include "xf86dri.h" +#endif + +#if defined(USE_XCB) +#include +#include +#include +#endif + +static const char __glXGLXClientVendorName[] = "SGI"; +static const char __glXGLXClientVersion[] = "1.4"; + + +/****************************************************************************/ + +#ifdef GLX_DIRECT_RENDERING + +static Bool windowExistsFlag; +static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr) +{ + if (xerr->error_code == BadWindow) { + windowExistsFlag = GL_FALSE; + } + return 0; +} + +/** + * Find drawables in the local hash that have been destroyed on the + * server. + * + * \param dpy Display to destroy drawables for + * \param screen Screen number to destroy drawables for + */ +static void GarbageCollectDRIDrawables(Display *dpy, __GLXscreenConfigs *sc) +{ + XID draw; + __GLXDRIdrawable *pdraw; + XWindowAttributes xwa; + int (*oldXErrorHandler)(Display *, XErrorEvent *); + + /* Set no-op error handler so Xlib doesn't bail out if the windows + * has alreay been destroyed on the server. */ + XSync(dpy, GL_FALSE); + oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler); + + if (__glxHashFirst(sc->drawHash, &draw, (void *)&pdraw) == 1) { + do { + windowExistsFlag = GL_TRUE; + XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */ + if (!windowExistsFlag) { + /* Destroy the local drawable data, if the drawable no + longer exists in the Xserver */ + (*pdraw->destroyDrawable)(pdraw); + __glxHashDelete(sc->drawHash, draw); + } + } while (__glxHashNext(sc->drawHash, &draw, (void *)&pdraw) == 1); + } + + XSync(dpy, GL_FALSE); + XSetErrorHandler(oldXErrorHandler); +} + +extern __GLXDRIdrawable * +GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable, int * const scrn_num); + +/** + * Get the __DRIdrawable for the drawable associated with a GLXContext + * + * \param dpy The display associated with \c drawable. + * \param drawable GLXDrawable whose __DRIdrawable part is to be retrieved. + * \param scrn_num If non-NULL, the drawables screen is stored there + * \returns A pointer to the context's __DRIdrawable on success, or NULL if + * the drawable is not associated with a direct-rendering context. + */ +_X_HIDDEN __GLXDRIdrawable * +GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable, int * const scrn_num) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw; + const unsigned screen_count = ScreenCount(dpy); + unsigned i; + __GLXscreenConfigs *psc; + + if (priv == NULL) + return NULL; + + for (i = 0; i < screen_count; i++) { + psc = &priv->screenConfigs[i]; + if (psc->drawHash == NULL) + continue; + + if (__glxHashLookup(psc->drawHash, drawable, (void *) &pdraw) == 0) { + if (scrn_num != NULL) + *scrn_num = i; + return pdraw; + } + } + + return NULL; +} + +#endif + + +/** + * Get the GLX per-screen data structure associated with a GLX context. + * + * \param dpy Display for which the GLX per-screen information is to be + * retrieved. + * \param scrn Screen on \c dpy for which the GLX per-screen information is + * to be retrieved. + * \returns A pointer to the GLX per-screen data if \c dpy and \c scrn + * specify a valid GLX screen, or NULL otherwise. + * + * \todo Should this function validate that \c scrn is within the screen + * number range for \c dpy? + */ + +static __GLXscreenConfigs * +GetGLXScreenConfigs(Display *dpy, int scrn) +{ + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + + return (priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL; +} + + +static int +GetGLXPrivScreenConfig( Display *dpy, int scrn, __GLXdisplayPrivate ** ppriv, + __GLXscreenConfigs ** ppsc ) +{ + /* Initialize the extension, if needed . This has the added value + * of initializing/allocating the display private + */ + + if ( dpy == NULL ) { + return GLX_NO_EXTENSION; + } + + *ppriv = __glXInitialize(dpy); + if ( *ppriv == NULL ) { + return GLX_NO_EXTENSION; + } + + /* Check screen number to see if its valid */ + if ((scrn < 0) || (scrn >= ScreenCount(dpy))) { + return GLX_BAD_SCREEN; + } + + /* Check to see if the GL is supported on this screen */ + *ppsc = &((*ppriv)->screenConfigs[scrn]); + if ( (*ppsc)->configs == NULL ) { + /* No support for GL on this screen regardless of visual */ + return GLX_BAD_VISUAL; + } + + return Success; +} + + +/** + * Determine if a \c GLXFBConfig supplied by the application is valid. + * + * \param dpy Application supplied \c Display pointer. + * \param config Application supplied \c GLXFBConfig. + * + * \returns If the \c GLXFBConfig is valid, the a pointer to the matching + * \c __GLcontextModes structure is returned. Otherwise, \c NULL + * is returned. + */ +static __GLcontextModes * +ValidateGLXFBConfig( Display * dpy, GLXFBConfig config ) +{ + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + const unsigned num_screens = ScreenCount(dpy); + unsigned i; + const __GLcontextModes * modes; + + + if ( priv != NULL ) { + for ( i = 0 ; i < num_screens ; i++ ) { + for ( modes = priv->screenConfigs[i].configs + ; modes != NULL + ; modes = modes->next ) { + if ( modes == (__GLcontextModes *) config ) { + return (__GLcontextModes *) config; + } + } + } + } + + return NULL; +} + + +/** + * \todo It should be possible to move the allocate of \c client_state_private + * later in the function for direct-rendering contexts. Direct-rendering + * contexts don't need to track client state, so they don't need that memory + * at all. + * + * \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new + * function called \c __glXAllocateClientState that allocates the memory and + * does all the initialization (including the pixel pack / unpack). + */ +static +GLXContext AllocateGLXContext( Display *dpy ) +{ + GLXContext gc; + int bufSize; + CARD8 opcode; + __GLXattribute *state; + + if (!dpy) + return NULL; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return NULL; + } + + /* Allocate our context record */ + gc = (GLXContext) Xmalloc(sizeof(struct __GLXcontextRec)); + if (!gc) { + /* Out of memory */ + return NULL; + } + memset(gc, 0, sizeof(struct __GLXcontextRec)); + + state = Xmalloc(sizeof(struct __GLXattributeRec)); + if (state == NULL) { + /* Out of memory */ + Xfree(gc); + return NULL; + } + gc->client_state_private = state; + memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec)); + state->NoDrawArraysProtocol = (getenv("LIBGL_NO_DRAWARRAYS") != NULL); + + /* + ** Create a temporary buffer to hold GLX rendering commands. The size + ** of the buffer is selected so that the maximum number of GLX rendering + ** commands can fit in a single X packet and still have room in the X + ** packet for the GLXRenderReq header. + */ + + bufSize = (XMaxRequestSize(dpy) * 4) - sz_xGLXRenderReq; + gc->buf = (GLubyte *) Xmalloc(bufSize); + if (!gc->buf) { + Xfree(gc->client_state_private); + Xfree(gc); + return NULL; + } + gc->bufSize = bufSize; + + /* Fill in the new context */ + gc->renderMode = GL_RENDER; + + state->storePack.alignment = 4; + state->storeUnpack.alignment = 4; + + gc->attributes.stackPointer = &gc->attributes.stack[0]; + + /* + ** PERFORMANCE NOTE: A mode dependent fill image can speed things up. + ** Other code uses the fastImageUnpack bit, but it is never set + ** to GL_TRUE. + */ + gc->fastImageUnpack = GL_FALSE; + gc->fillImage = __glFillImage; + gc->pc = gc->buf; + gc->bufEnd = gc->buf + bufSize; + gc->isDirect = GL_FALSE; + if (__glXDebug) { + /* + ** Set limit register so that there will be one command per packet + */ + gc->limit = gc->buf; + } else { + gc->limit = gc->buf + bufSize - __GLX_BUFFER_LIMIT_SIZE; + } + gc->createDpy = dpy; + gc->majorOpcode = opcode; + + /* + ** Constrain the maximum drawing command size allowed to be + ** transfered using the X_GLXRender protocol request. First + ** constrain by a software limit, then constrain by the protocl + ** limit. + */ + if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) { + bufSize = __GLX_RENDER_CMD_SIZE_LIMIT; + } + if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) { + bufSize = __GLX_MAX_RENDER_CMD_SIZE; + } + gc->maxSmallRenderCommandSize = bufSize; + return gc; +} + + +/** + * Create a new context. Exactly one of \c vis and \c fbconfig should be + * non-NULL. + * + * \param use_glx_1_3 For FBConfigs, should GLX 1.3 protocol or + * SGIX_fbconfig protocol be used? + * \param renderType For FBConfigs, what is the rendering type? + */ + +static GLXContext +CreateContext(Display *dpy, XVisualInfo *vis, + const __GLcontextModes * const fbconfig, + GLXContext shareList, + Bool allowDirect, GLXContextID contextID, + Bool use_glx_1_3, int renderType) +{ + GLXContext gc; +#ifdef GLX_DIRECT_RENDERING + int screen = (fbconfig == NULL) ? vis->screen : fbconfig->screen; + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); +#endif + + if ( dpy == NULL ) + return NULL; + + gc = AllocateGLXContext(dpy); + if (!gc) + return NULL; + + if (None == contextID) { + if ( (vis == NULL) && (fbconfig == NULL) ) + return NULL; + +#ifdef GLX_DIRECT_RENDERING + if (allowDirect && psc->driScreen) { + const __GLcontextModes * mode; + + if (fbconfig == NULL) { + mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + if (mode == NULL) { + xError error; + + error.errorCode = BadValue; + error.resourceID = vis->visualid; + error.sequenceNumber = dpy->request; + error.type = X_Error; + error.majorCode = gc->majorOpcode; + error.minorCode = X_GLXCreateContext; + _XError(dpy, &error); + return None; + } + } + else { + mode = fbconfig; + } + + gc->driContext = psc->driScreen->createContext(psc, mode, gc, + shareList, + renderType); + if (gc->driContext != NULL) { + gc->screen = mode->screen; + gc->psc = psc; + gc->mode = mode; + gc->isDirect = GL_TRUE; + } + } +#endif + + LockDisplay(dpy); + if ( fbconfig == NULL ) { + xGLXCreateContextReq *req; + + /* Send the glXCreateContext request */ + GetReq(GLXCreateContext,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXCreateContext; + req->context = gc->xid = XAllocID(dpy); + req->visual = vis->visualid; + req->screen = vis->screen; + req->shareList = shareList ? shareList->xid : None; +#ifdef GLX_DIRECT_RENDERING + req->isDirect = gc->driContext != NULL; +#else + req->isDirect = 0; +#endif + } + else if ( use_glx_1_3 ) { + xGLXCreateNewContextReq *req; + + /* Send the glXCreateNewContext request */ + GetReq(GLXCreateNewContext,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXCreateNewContext; + req->context = gc->xid = XAllocID(dpy); + req->fbconfig = fbconfig->fbconfigID; + req->screen = fbconfig->screen; + req->renderType = renderType; + req->shareList = shareList ? shareList->xid : None; +#ifdef GLX_DIRECT_RENDERING + req->isDirect = gc->driContext != NULL; +#else + req->isDirect = 0; +#endif + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXCreateContextWithConfigSGIXReq *req; + + /* Send the glXCreateNewContext request */ + GetReqExtra(GLXVendorPrivateWithReply, + sz_xGLXCreateContextWithConfigSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq); + req = (xGLXCreateContextWithConfigSGIXReq *)vpreq; + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX; + req->context = gc->xid = XAllocID(dpy); + req->fbconfig = fbconfig->fbconfigID; + req->screen = fbconfig->screen; + req->renderType = renderType; + req->shareList = shareList ? shareList->xid : None; +#ifdef GLX_DIRECT_RENDERING + req->isDirect = gc->driContext != NULL; +#else + req->isDirect = 0; +#endif + } + + UnlockDisplay(dpy); + SyncHandle(); + gc->imported = GL_FALSE; + } + else { + gc->xid = contextID; + gc->imported = GL_TRUE; + } + + return gc; +} + +PUBLIC GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool allowDirect) +{ + return CreateContext(dpy, vis, NULL, shareList, allowDirect, None, + False, 0); +} + +_X_HIDDEN void __glXFreeContext(__GLXcontext *gc) +{ + if (gc->vendor) XFree((char *) gc->vendor); + if (gc->renderer) XFree((char *) gc->renderer); + if (gc->version) XFree((char *) gc->version); + if (gc->extensions) XFree((char *) gc->extensions); + __glFreeAttributeState(gc); + XFree((char *) gc->buf); + Xfree((char *) gc->client_state_private); + XFree((char *) gc); + +} + +/* +** Destroy the named context +*/ +static void +DestroyContext(Display *dpy, GLXContext gc) +{ + xGLXDestroyContextReq *req; + GLXContextID xid; + CARD8 opcode; + GLboolean imported; + + opcode = __glXSetupForCommand(dpy); + if (!opcode || !gc) { + return; + } + + __glXLock(); + xid = gc->xid; + imported = gc->imported; + gc->xid = None; + +#ifdef GLX_DIRECT_RENDERING + /* Destroy the direct rendering context */ + if (gc->driContext) { + (*gc->driContext->destroyContext)(gc->driContext, gc->psc, dpy); + gc->driContext = NULL; + GarbageCollectDRIDrawables(dpy, gc->psc); + } +#endif + + __glXFreeVertexArrayState(gc); + + if (gc->currentDpy) { + /* Have to free later cuz it's in use now */ + __glXUnlock(); + } else { + /* Destroy the handle if not current to anybody */ + __glXUnlock(); + __glXFreeContext(gc); + } + + if (!imported) { + /* + ** This dpy also created the server side part of the context. + ** Send the glXDestroyContext request. + */ + LockDisplay(dpy); + GetReq(GLXDestroyContext,req); + req->reqType = opcode; + req->glxCode = X_GLXDestroyContext; + req->context = xid; + UnlockDisplay(dpy); + SyncHandle(); + } +} + +PUBLIC void glXDestroyContext(Display *dpy, GLXContext gc) +{ + DestroyContext(dpy, gc); +} + +/* +** Return the major and minor version #s for the GLX extension +*/ +PUBLIC Bool glXQueryVersion(Display *dpy, int *major, int *minor) +{ + __GLXdisplayPrivate *priv; + + /* Init the extension. This fetches the major and minor version. */ + priv = __glXInitialize(dpy); + if (!priv) return GL_FALSE; + + if (major) *major = priv->majorVersion; + if (minor) *minor = priv->minorVersion; + return GL_TRUE; +} + +/* +** Query the existance of the GLX extension +*/ +PUBLIC Bool glXQueryExtension(Display *dpy, int *errorBase, int *eventBase) +{ + int major_op, erb, evb; + Bool rv; + + rv = XQueryExtension(dpy, GLX_EXTENSION_NAME, &major_op, &evb, &erb); + if (rv) { + if (errorBase) *errorBase = erb; + if (eventBase) *eventBase = evb; + } + return rv; +} + +/* +** Put a barrier in the token stream that forces the GL to finish its +** work before X can proceed. +*/ +PUBLIC void glXWaitGL(void) +{ + xGLXWaitGLReq *req; + GLXContext gc = __glXGetCurrentContext(); + Display *dpy = gc->currentDpy; + + if (!dpy) return; + + /* Flush any pending commands out */ + __glXFlushRenderBuffer(gc, gc->pc); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen); + + if ( pdraw != NULL ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + glFlush(); + if (psc->driScreen->waitGL != NULL) + (*psc->driScreen->waitGL)(pdraw); + } + return; + } +#endif + + /* Send the glXWaitGL request */ + LockDisplay(dpy); + GetReq(GLXWaitGL,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXWaitGL; + req->contextTag = gc->currentContextTag; + UnlockDisplay(dpy); + SyncHandle(); +} + +/* +** Put a barrier in the token stream that forces X to finish its +** work before GL can proceed. +*/ +PUBLIC void glXWaitX(void) +{ + xGLXWaitXReq *req; + GLXContext gc = __glXGetCurrentContext(); + Display *dpy = gc->currentDpy; + + if (!dpy) return; + + /* Flush any pending commands out */ + __glXFlushRenderBuffer(gc, gc->pc); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen); + + if ( pdraw != NULL ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + if (psc->driScreen->waitX != NULL) + (*psc->driScreen->waitX)(pdraw); + } else + XSync(dpy, False); + return; + } +#endif + + /* + ** Send the glXWaitX request. + */ + LockDisplay(dpy); + GetReq(GLXWaitX,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXWaitX; + req->contextTag = gc->currentContextTag; + UnlockDisplay(dpy); + SyncHandle(); +} + +PUBLIC void glXUseXFont(Font font, int first, int count, int listBase) +{ + xGLXUseXFontReq *req; + GLXContext gc = __glXGetCurrentContext(); + Display *dpy = gc->currentDpy; + + if (!dpy) return; + + /* Flush any pending commands out */ + (void) __glXFlushRenderBuffer(gc, gc->pc); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + DRI_glXUseXFont(font, first, count, listBase); + return; + } +#endif + + /* Send the glXUseFont request */ + LockDisplay(dpy); + GetReq(GLXUseXFont,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXUseXFont; + req->contextTag = gc->currentContextTag; + req->font = font; + req->first = first; + req->count = count; + req->listBase = listBase; + UnlockDisplay(dpy); + SyncHandle(); +} + +/************************************************************************/ + +/* +** Copy the source context to the destination context using the +** attribute "mask". +*/ +PUBLIC void glXCopyContext(Display *dpy, GLXContext source, + GLXContext dest, unsigned long mask) +{ + xGLXCopyContextReq *req; + GLXContext gc = __glXGetCurrentContext(); + GLXContextTag tag; + CARD8 opcode; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return; + } + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + /* NOT_DONE: This does not work yet */ + } +#endif + + /* + ** If the source is the current context, send its tag so that the context + ** can be flushed before the copy. + */ + if (source == gc && dpy == gc->currentDpy) { + tag = gc->currentContextTag; + } else { + tag = 0; + } + + /* Send the glXCopyContext request */ + LockDisplay(dpy); + GetReq(GLXCopyContext,req); + req->reqType = opcode; + req->glxCode = X_GLXCopyContext; + req->source = source ? source->xid : None; + req->dest = dest ? dest->xid : None; + req->mask = mask; + req->contextTag = tag; + UnlockDisplay(dpy); + SyncHandle(); +} + + +/** + * Determine if a context uses direct rendering. + * + * \param dpy Display where the context was created. + * \param contextID ID of the context to be tested. + * + * \returns \c GL_TRUE if the context is direct rendering or not. + */ +static Bool __glXIsDirect(Display *dpy, GLXContextID contextID) +{ +#if !defined(USE_XCB) + xGLXIsDirectReq *req; + xGLXIsDirectReply reply; +#endif + CARD8 opcode; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return GL_FALSE; + } + +#ifdef USE_XCB + xcb_connection_t* c = XGetXCBConnection(dpy); + xcb_glx_is_direct_reply_t* reply = + xcb_glx_is_direct_reply(c, + xcb_glx_is_direct(c, contextID), + NULL); + + const Bool is_direct = reply->is_direct ? True : False; + free(reply); + + return is_direct; +#else + /* Send the glXIsDirect request */ + LockDisplay(dpy); + GetReq(GLXIsDirect,req); + req->reqType = opcode; + req->glxCode = X_GLXIsDirect; + req->context = contextID; + _XReply(dpy, (xReply*) &reply, 0, False); + UnlockDisplay(dpy); + SyncHandle(); + + return reply.isDirect; +#endif /* USE_XCB */ +} + +/** + * \todo + * Shouldn't this function \b always return \c GL_FALSE when + * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with + * the GLX protocol here at all? + */ +PUBLIC Bool glXIsDirect(Display *dpy, GLXContext gc) +{ + if (!gc) { + return GL_FALSE; +#ifdef GLX_DIRECT_RENDERING + } else if (gc->driContext) { + return GL_TRUE; +#endif + } + return __glXIsDirect(dpy, gc->xid); +} + +PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis, + Pixmap pixmap) +{ + xGLXCreateGLXPixmapReq *req; + GLXPixmap xid; + CARD8 opcode; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return None; + } + + /* Send the glXCreateGLXPixmap request */ + LockDisplay(dpy); + GetReq(GLXCreateGLXPixmap,req); + req->reqType = opcode; + req->glxCode = X_GLXCreateGLXPixmap; + req->screen = vis->screen; + req->visual = vis->visualid; + req->pixmap = pixmap; + req->glxpixmap = xid = XAllocID(dpy); + UnlockDisplay(dpy); + SyncHandle(); + return xid; +} + +/* +** Destroy the named pixmap +*/ +PUBLIC void glXDestroyGLXPixmap(Display *dpy, GLXPixmap glxpixmap) +{ + xGLXDestroyGLXPixmapReq *req; + CARD8 opcode; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return; + } + + /* Send the glXDestroyGLXPixmap request */ + LockDisplay(dpy); + GetReq(GLXDestroyGLXPixmap,req); + req->reqType = opcode; + req->glxCode = X_GLXDestroyGLXPixmap; + req->glxpixmap = glxpixmap; + UnlockDisplay(dpy); + SyncHandle(); +} + +PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable) +{ + GLXContext gc; + GLXContextTag tag; + CARD8 opcode; +#ifdef USE_XCB + xcb_connection_t *c; +#else + xGLXSwapBuffersReq *req; +#endif + +#ifdef GLX_DIRECT_RENDERING + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL); + + if (pdraw != NULL) { + glFlush(); + (*pdraw->psc->driScreen->swapBuffers)(pdraw); + return; + } +#endif + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return; + } + + /* + ** The calling thread may or may not have a current context. If it + ** does, send the context tag so the server can do a flush. + */ + gc = __glXGetCurrentContext(); + if ((gc != NULL) && (dpy == gc->currentDpy) && + ((drawable == gc->currentDrawable) || (drawable == gc->currentReadable)) ) { + tag = gc->currentContextTag; + } else { + tag = 0; + } + +#ifdef USE_XCB + c = XGetXCBConnection(dpy); + xcb_glx_swap_buffers(c, tag, drawable); + xcb_flush(c); +#else + /* Send the glXSwapBuffers request */ + LockDisplay(dpy); + GetReq(GLXSwapBuffers,req); + req->reqType = opcode; + req->glxCode = X_GLXSwapBuffers; + req->drawable = drawable; + req->contextTag = tag; + UnlockDisplay(dpy); + SyncHandle(); + XFlush(dpy); +#endif /* USE_XCB */ +} + + +/* +** Return configuration information for the given display, screen and +** visual combination. +*/ +PUBLIC int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute, + int *value_return) +{ + __GLXdisplayPrivate *priv; + __GLXscreenConfigs *psc; + __GLcontextModes *modes; + int status; + + status = GetGLXPrivScreenConfig( dpy, vis->screen, & priv, & psc ); + if ( status == Success ) { + modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + + /* Lookup attribute after first finding a match on the visual */ + if ( modes != NULL ) { + return _gl_get_context_mode_data( modes, attribute, value_return ); + } + + status = GLX_BAD_VISUAL; + } + + /* + ** If we can't find the config for this visual, this visual is not + ** supported by the OpenGL implementation on the server. + */ + if ( (status == GLX_BAD_VISUAL) && (attribute == GLX_USE_GL) ) { + *value_return = GL_FALSE; + status = Success; + } + + return status; +} + +/************************************************************************/ + +static void +init_fbconfig_for_chooser( __GLcontextModes * config, + GLboolean fbconfig_style_tags ) +{ + memset( config, 0, sizeof( __GLcontextModes ) ); + config->visualID = (XID) GLX_DONT_CARE; + config->visualType = GLX_DONT_CARE; + + /* glXChooseFBConfig specifies different defaults for these two than + * glXChooseVisual. + */ + if ( fbconfig_style_tags ) { + config->rgbMode = GL_TRUE; + config->doubleBufferMode = GLX_DONT_CARE; + } + + config->visualRating = GLX_DONT_CARE; + config->transparentPixel = GLX_NONE; + config->transparentRed = GLX_DONT_CARE; + config->transparentGreen = GLX_DONT_CARE; + config->transparentBlue = GLX_DONT_CARE; + config->transparentAlpha = GLX_DONT_CARE; + config->transparentIndex = GLX_DONT_CARE; + + config->drawableType = GLX_WINDOW_BIT; + config->renderType = (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + config->xRenderable = GLX_DONT_CARE; + config->fbconfigID = (GLXFBConfigID)(GLX_DONT_CARE); + + config->swapMethod = GLX_DONT_CARE; +} + +#define MATCH_DONT_CARE( param ) \ + do { \ + if ( (a-> param != GLX_DONT_CARE) \ + && (a-> param != b-> param) ) { \ + return False; \ + } \ + } while ( 0 ) + +#define MATCH_MINIMUM( param ) \ + do { \ + if ( (a-> param != GLX_DONT_CARE) \ + && (a-> param > b-> param) ) { \ + return False; \ + } \ + } while ( 0 ) + +#define MATCH_EXACT( param ) \ + do { \ + if ( a-> param != b-> param) { \ + return False; \ + } \ + } while ( 0 ) + +/** + * Determine if two GLXFBConfigs are compatible. + * + * \param a Application specified config to test. + * \param b Server specified config to test against \c a. + */ +static Bool +fbconfigs_compatible( const __GLcontextModes * const a, + const __GLcontextModes * const b ) +{ + MATCH_DONT_CARE( doubleBufferMode ); + MATCH_DONT_CARE( visualType ); + MATCH_DONT_CARE( visualRating ); + MATCH_DONT_CARE( xRenderable ); + MATCH_DONT_CARE( fbconfigID ); + MATCH_DONT_CARE( swapMethod ); + + MATCH_MINIMUM( rgbBits ); + MATCH_MINIMUM( numAuxBuffers ); + MATCH_MINIMUM( redBits ); + MATCH_MINIMUM( greenBits ); + MATCH_MINIMUM( blueBits ); + MATCH_MINIMUM( alphaBits ); + MATCH_MINIMUM( depthBits ); + MATCH_MINIMUM( stencilBits ); + MATCH_MINIMUM( accumRedBits ); + MATCH_MINIMUM( accumGreenBits ); + MATCH_MINIMUM( accumBlueBits ); + MATCH_MINIMUM( accumAlphaBits ); + MATCH_MINIMUM( sampleBuffers ); + MATCH_MINIMUM( maxPbufferWidth ); + MATCH_MINIMUM( maxPbufferHeight ); + MATCH_MINIMUM( maxPbufferPixels ); + MATCH_MINIMUM( samples ); + + MATCH_DONT_CARE( stereoMode ); + MATCH_EXACT( level ); + + if ( ((a->drawableType & b->drawableType) == 0) + || ((a->renderType & b->renderType) == 0) ) { + return False; + } + + + /* There is a bug in a few of the XFree86 DDX drivers. They contain + * visuals with a "transparent type" of 0 when they really mean GLX_NONE. + * Technically speaking, it is a bug in the DDX driver, but there is + * enough of an installed base to work around the problem here. In any + * case, 0 is not a valid value of the transparent type, so we'll treat 0 + * from the app as GLX_DONT_CARE. We'll consider GLX_NONE from the app and + * 0 from the server to be a match to maintain backward compatibility with + * the (broken) drivers. + */ + + if ( a->transparentPixel != GLX_DONT_CARE + && a->transparentPixel != 0 ) { + if ( a->transparentPixel == GLX_NONE ) { + if ( b->transparentPixel != GLX_NONE && b->transparentPixel != 0 ) + return False; + } else { + MATCH_EXACT( transparentPixel ); + } + + switch ( a->transparentPixel ) { + case GLX_TRANSPARENT_RGB: + MATCH_DONT_CARE( transparentRed ); + MATCH_DONT_CARE( transparentGreen ); + MATCH_DONT_CARE( transparentBlue ); + MATCH_DONT_CARE( transparentAlpha ); + break; + + case GLX_TRANSPARENT_INDEX: + MATCH_DONT_CARE( transparentIndex ); + break; + + default: + break; + } + } + + return True; +} + + +/* There's some trickly language in the GLX spec about how this is supposed + * to work. Basically, if a given component size is either not specified + * or the requested size is zero, it is supposed to act like PERFER_SMALLER. + * Well, that's really hard to do with the code as-is. This behavior is + * closer to correct, but still not technically right. + */ +#define PREFER_LARGER_OR_ZERO(comp) \ + do { \ + if ( ((*a)-> comp) != ((*b)-> comp) ) { \ + if ( ((*a)-> comp) == 0 ) { \ + return -1; \ + } \ + else if ( ((*b)-> comp) == 0 ) { \ + return 1; \ + } \ + else { \ + return ((*b)-> comp) - ((*a)-> comp) ; \ + } \ + } \ + } while( 0 ) + +#define PREFER_LARGER(comp) \ + do { \ + if ( ((*a)-> comp) != ((*b)-> comp) ) { \ + return ((*b)-> comp) - ((*a)-> comp) ; \ + } \ + } while( 0 ) + +#define PREFER_SMALLER(comp) \ + do { \ + if ( ((*a)-> comp) != ((*b)-> comp) ) { \ + return ((*a)-> comp) - ((*b)-> comp) ; \ + } \ + } while( 0 ) + +/** + * Compare two GLXFBConfigs. This function is intended to be used as the + * compare function passed in to qsort. + * + * \returns If \c a is a "better" config, according to the specification of + * SGIX_fbconfig, a number less than zero is returned. If \c b is + * better, then a number greater than zero is return. If both are + * equal, zero is returned. + * \sa qsort, glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX + */ +static int +fbconfig_compare( const __GLcontextModes * const * const a, + const __GLcontextModes * const * const b ) +{ + /* The order of these comparisons must NOT change. It is defined by + * the GLX 1.3 spec and ARB_multisample. + */ + + PREFER_SMALLER( visualSelectGroup ); + + /* The sort order for the visualRating is GLX_NONE, GLX_SLOW, and + * GLX_NON_CONFORMANT_CONFIG. It just so happens that this is the + * numerical sort order of the enums (0x8000, 0x8001, and 0x800D). + */ + PREFER_SMALLER( visualRating ); + + /* This isn't quite right. It is supposed to compare the sum of the + * components the user specifically set minimums for. + */ + PREFER_LARGER_OR_ZERO( redBits ); + PREFER_LARGER_OR_ZERO( greenBits ); + PREFER_LARGER_OR_ZERO( blueBits ); + PREFER_LARGER_OR_ZERO( alphaBits ); + + PREFER_SMALLER( rgbBits ); + + if ( ((*a)->doubleBufferMode != (*b)->doubleBufferMode) ) { + /* Prefer single-buffer. + */ + return ( !(*a)->doubleBufferMode ) ? -1 : 1; + } + + PREFER_SMALLER( numAuxBuffers ); + + /*to align with X server 1.6.0 criteria when matching a + *FBConfig to existing X visual to create GLX visual, + *here we prefer larger depth. + */ + PREFER_LARGER( depthBits ); + PREFER_SMALLER( stencilBits ); + + /* This isn't quite right. It is supposed to compare the sum of the + * components the user specifically set minimums for. + */ + PREFER_LARGER_OR_ZERO( accumRedBits ); + PREFER_LARGER_OR_ZERO( accumGreenBits ); + PREFER_LARGER_OR_ZERO( accumBlueBits ); + PREFER_LARGER_OR_ZERO( accumAlphaBits ); + + PREFER_SMALLER( visualType ); + + /* None of the multisample specs say where this comparison should happen, + * so I put it near the end. + */ + PREFER_SMALLER( sampleBuffers ); + PREFER_SMALLER( samples ); + + /* None of the pbuffer or fbconfig specs say that this comparison needs + * to happen at all, but it seems like it should. + */ + PREFER_LARGER( maxPbufferWidth ); + PREFER_LARGER( maxPbufferHeight ); + PREFER_LARGER( maxPbufferPixels ); + + return 0; +} + + +/** + * Selects and sorts a subset of the supplied configs based on the attributes. + * This function forms to basis of \c glXChooseVisual, \c glXChooseFBConfig, + * and \c glXChooseFBConfigSGIX. + * + * \param configs Array of pointers to possible configs. The elements of + * this array that do not meet the criteria will be set to + * NULL. The remaining elements will be sorted according to + * the various visual / FBConfig selection rules. + * \param num_configs Number of elements in the \c configs array. + * \param attribList Attributes used select from \c configs. This array is + * terminated by a \c None tag. The array can either take + * the form expected by \c glXChooseVisual (where boolean + * tags do not have a value) or by \c glXChooseFBConfig + * (where every tag has a value). + * \param fbconfig_style_tags Selects whether \c attribList is in + * \c glXChooseVisual style or + * \c glXChooseFBConfig style. + * \returns The number of valid elements left in \c configs. + * + * \sa glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX + */ +static int +choose_visual( __GLcontextModes ** configs, int num_configs, + const int *attribList, GLboolean fbconfig_style_tags ) +{ + __GLcontextModes test_config; + int base; + int i; + + /* This is a fairly direct implementation of the selection method + * described by GLX_SGIX_fbconfig. Start by culling out all the + * configs that are not compatible with the selected parameter + * list. + */ + + init_fbconfig_for_chooser( & test_config, fbconfig_style_tags ); + __glXInitializeVisualConfigFromTags( & test_config, 512, + (const INT32 *) attribList, + GL_TRUE, fbconfig_style_tags ); + + base = 0; + for ( i = 0 ; i < num_configs ; i++ ) { + if ( fbconfigs_compatible( & test_config, configs[i] ) ) { + configs[ base ] = configs[ i ]; + base++; + } + } + + if ( base == 0 ) { + return 0; + } + + if ( base < num_configs ) { + (void) memset( & configs[ base ], 0, + sizeof( void * ) * (num_configs - base) ); + } + + /* After the incompatible configs are removed, the resulting + * list is sorted according to the rules set out in the various + * specifications. + */ + + qsort( configs, base, sizeof( __GLcontextModes * ), + (int (*)(const void*, const void*)) fbconfig_compare ); + return base; +} + + + + +/* +** Return the visual that best matches the template. Return None if no +** visual matches the template. +*/ +PUBLIC XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *attribList) +{ + XVisualInfo *visualList = NULL; + __GLXdisplayPrivate *priv; + __GLXscreenConfigs *psc; + __GLcontextModes test_config; + __GLcontextModes *modes; + const __GLcontextModes *best_config = NULL; + + /* + ** Get a list of all visuals, return if list is empty + */ + if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) { + return None; + } + + + /* + ** Build a template from the defaults and the attribute list + ** Free visual list and return if an unexpected token is encountered + */ + init_fbconfig_for_chooser( & test_config, GL_FALSE ); + __glXInitializeVisualConfigFromTags( & test_config, 512, + (const INT32 *) attribList, + GL_TRUE, GL_FALSE ); + + /* + ** Eliminate visuals that don't meet minimum requirements + ** Compute a score for those that do + ** Remember which visual, if any, got the highest score + */ + //for ( modes = psc->visuals ; modes != NULL ; modes = modes->next ) { + for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) { + if ( fbconfigs_compatible( & test_config, modes ) + && ((best_config == NULL) + || (fbconfig_compare( (const __GLcontextModes * const * const)&modes, &best_config ) < 0)) ) { + best_config = modes; + } + } + + /* + ** If no visual is acceptable, return None + ** Otherwise, create an XVisualInfo list with just the selected X visual + ** and return this. + */ + if (best_config != NULL) { + XVisualInfo visualTemplate; + int i; + + visualTemplate.screen = screen; + visualTemplate.visualid = best_config->visualID; + visualList = XGetVisualInfo( dpy, VisualScreenMask|VisualIDMask, + &visualTemplate, &i ); + } + + return visualList; +} + + +PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen ) +{ + __GLXscreenConfigs *psc; + __GLXdisplayPrivate *priv; + + if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) { + return NULL; + } + + if (!psc->effectiveGLXexts) { + if (!psc->serverGLXexts) { + psc->serverGLXexts = + __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS); + } + + __glXCalculateUsableExtensions(psc, +#ifdef GLX_DIRECT_RENDERING + (psc->driScreen != NULL), +#else + GL_FALSE, +#endif + priv->minorVersion); + } + + return psc->effectiveGLXexts; +} + +PUBLIC const char *glXGetClientString( Display *dpy, int name ) +{ + switch(name) { + case GLX_VENDOR: + return (__glXGLXClientVendorName); + case GLX_VERSION: + return (__glXGLXClientVersion); + case GLX_EXTENSIONS: + return (__glXGetClientExtensions()); + default: + return NULL; + } +} + +PUBLIC const char *glXQueryServerString( Display *dpy, int screen, int name ) +{ + __GLXscreenConfigs *psc; + __GLXdisplayPrivate *priv; + const char ** str; + + + if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) { + return NULL; + } + + switch(name) { + case GLX_VENDOR: + str = & priv->serverGLXvendor; + break; + case GLX_VERSION: + str = & priv->serverGLXversion; + break; + case GLX_EXTENSIONS: + str = & psc->serverGLXexts; + break; + default: + return NULL; + } + + if ( *str == NULL ) { + *str = __glXQueryServerString(dpy, priv->majorOpcode, screen, name); + } + + return *str; +} + +void __glXClientInfo ( Display *dpy, int opcode ) +{ + char * ext_str = __glXGetClientGLExtensionString(); + int size = strlen( ext_str ) + 1; + +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_client_info(c, + GLX_MAJOR_VERSION, + GLX_MINOR_VERSION, + size, + (const uint8_t *)ext_str); +#else + xGLXClientInfoReq *req; + + /* Send the glXClientInfo request */ + LockDisplay(dpy); + GetReq(GLXClientInfo,req); + req->reqType = opcode; + req->glxCode = X_GLXClientInfo; + req->major = GLX_MAJOR_VERSION; + req->minor = GLX_MINOR_VERSION; + + req->length += (size + 3) >> 2; + req->numbytes = size; + Data(dpy, ext_str, size); + + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + + Xfree( ext_str ); +} + + +/* +** EXT_import_context +*/ + +PUBLIC Display *glXGetCurrentDisplay(void) +{ + GLXContext gc = __glXGetCurrentContext(); + if (NULL == gc) return NULL; + return gc->currentDpy; +} + +PUBLIC GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (), + glXGetCurrentDisplay) + +/** + * Used internally by libGL to send \c xGLXQueryContextinfoExtReq requests + * to the X-server. + * + * \param dpy Display where \c ctx was created. + * \param ctx Context to query. + * \returns \c Success on success. \c GLX_BAD_CONTEXT if \c ctx is invalid, + * or zero if the request failed due to internal problems (i.e., + * unable to allocate temporary memory, etc.) + * + * \note + * This function dynamically determines whether to use the EXT_import_context + * version of the protocol or the GLX 1.3 version of the protocol. + */ +static int __glXQueryContextInfo(Display *dpy, GLXContext ctx) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + xGLXQueryContextReply reply; + CARD8 opcode; + GLuint numValues; + int retval; + + if (ctx == NULL) { + return GLX_BAD_CONTEXT; + } + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return 0; + } + + /* Send the glXQueryContextInfoEXT request */ + LockDisplay(dpy); + + if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) { + xGLXQueryContextReq *req; + + GetReq(GLXQueryContext, req); + + req->reqType = opcode; + req->glxCode = X_GLXQueryContext; + req->context = (unsigned int)(ctx->xid); + } + else { + xGLXVendorPrivateReq *vpreq; + xGLXQueryContextInfoEXTReq *req; + + GetReqExtra( GLXVendorPrivate, + sz_xGLXQueryContextInfoEXTReq - sz_xGLXVendorPrivateReq, + vpreq ); + req = (xGLXQueryContextInfoEXTReq *)vpreq; + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_QueryContextInfoEXT; + req->context = (unsigned int)(ctx->xid); + } + + _XReply(dpy, (xReply*) &reply, 0, False); + + numValues = reply.n; + if (numValues == 0) + retval = Success; + else if (numValues > __GLX_MAX_CONTEXT_PROPS) + retval = 0; + else + { + int *propList, *pProp; + int nPropListBytes; + int i; + + nPropListBytes = numValues << 3; + propList = (int *) Xmalloc(nPropListBytes); + if (NULL == propList) { + retval = 0; + } else { + _XRead(dpy, (char *)propList, nPropListBytes); + pProp = propList; + for (i=0; i < numValues; i++) { + switch (*pProp++) { + case GLX_SHARE_CONTEXT_EXT: + ctx->share_xid = *pProp++; + break; + case GLX_VISUAL_ID_EXT: + ctx->mode = + _gl_context_modes_find_visual(ctx->psc->visuals, *pProp++); + break; + case GLX_SCREEN: + ctx->screen = *pProp++; + break; + case GLX_FBCONFIG_ID: + ctx->mode = + _gl_context_modes_find_fbconfig(ctx->psc->configs, *pProp++); + break; + case GLX_RENDER_TYPE: + ctx->renderType = *pProp++; + break; + default: + pProp++; + continue; + } + } + Xfree((char *)propList); + retval = Success; + } + } + UnlockDisplay(dpy); + SyncHandle(); + return retval; +} + +PUBLIC int +glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value) +{ + int retVal; + + /* get the information from the server if we don't have it already */ +#ifdef GLX_DIRECT_RENDERING + if (!ctx->driContext && (ctx->mode == NULL)) { +#else + if (ctx->mode == NULL) { +#endif + retVal = __glXQueryContextInfo(dpy, ctx); + if (Success != retVal) return retVal; + } + switch (attribute) { + case GLX_SHARE_CONTEXT_EXT: + *value = (int)(ctx->share_xid); + break; + case GLX_VISUAL_ID_EXT: + *value = ctx->mode ? ctx->mode->visualID : None; + break; + case GLX_SCREEN: + *value = (int)(ctx->screen); + break; + case GLX_FBCONFIG_ID: + *value = ctx->mode ? ctx->mode->fbconfigID : None; + break; + case GLX_RENDER_TYPE: + *value = (int)(ctx->renderType); + break; + default: + return GLX_BAD_ATTRIBUTE; + } + return Success; +} + +PUBLIC GLX_ALIAS( int, glXQueryContextInfoEXT, + (Display *dpy, GLXContext ctx, int attribute, int *value), + (dpy, ctx, attribute, value), + glXQueryContext ) + +PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx) +{ + return ctx->xid; +} + +PUBLIC GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID) +{ + GLXContext ctx; + + if (contextID == None) { + return NULL; + } + if (__glXIsDirect(dpy, contextID)) { + return NULL; + } + + ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, False, 0); + if (NULL != ctx) { + if (Success != __glXQueryContextInfo(dpy, ctx)) { + return NULL; + } + } + return ctx; +} + +PUBLIC void glXFreeContextEXT(Display *dpy, GLXContext ctx) +{ + DestroyContext(dpy, ctx); +} + + + +/* + * GLX 1.3 functions - these are just stubs for now! + */ + +PUBLIC GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen, + const int *attribList, int *nitems) +{ + __GLcontextModes ** config_list; + int list_size; + + + config_list = (__GLcontextModes **) + glXGetFBConfigs( dpy, screen, & list_size ); + + if ( (config_list != NULL) && (list_size > 0) && (attribList != NULL) ) { + list_size = choose_visual( config_list, list_size, attribList, + GL_TRUE ); + if ( list_size == 0 ) { + XFree( config_list ); + config_list = NULL; + } + } + + *nitems = list_size; + return (GLXFBConfig *) config_list; +} + + +PUBLIC GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config, + int renderType, GLXContext shareList, + Bool allowDirect) +{ + return CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList, + allowDirect, None, True, renderType ); +} + + +PUBLIC GLXDrawable glXGetCurrentReadDrawable(void) +{ + GLXContext gc = __glXGetCurrentContext(); + return gc->currentReadable; +} + + +PUBLIC GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + __GLcontextModes ** config = NULL; + int i; + + *nelements = 0; + if ( (priv->screenConfigs != NULL) + && (screen >= 0) && (screen <= ScreenCount(dpy)) + && (priv->screenConfigs[screen].configs != NULL) + && (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE) ) { + unsigned num_configs = 0; + __GLcontextModes * modes; + + + for ( modes = priv->screenConfigs[screen].configs + ; modes != NULL + ; modes = modes->next ) { + if ( modes->fbconfigID != GLX_DONT_CARE ) { + num_configs++; + } + } + + config = (__GLcontextModes **) Xmalloc( sizeof(__GLcontextModes *) + * num_configs ); + if ( config != NULL ) { + *nelements = num_configs; + i = 0; + for ( modes = priv->screenConfigs[screen].configs + ; modes != NULL + ; modes = modes->next ) { + if ( modes->fbconfigID != GLX_DONT_CARE ) { + config[i] = modes; + i++; + } + } + } + } + return (GLXFBConfig *) config; +} + + +PUBLIC int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, + int attribute, int *value) +{ + __GLcontextModes * const modes = ValidateGLXFBConfig( dpy, config ); + + return (modes != NULL) + ? _gl_get_context_mode_data( modes, attribute, value ) + : GLXBadFBConfig; +} + + +PUBLIC XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config) +{ + XVisualInfo visualTemplate; + __GLcontextModes * fbconfig = (__GLcontextModes *) config; + int count; + + /* + ** Get a list of all visuals, return if list is empty + */ + visualTemplate.visualid = fbconfig->visualID; + return XGetVisualInfo(dpy,VisualIDMask,&visualTemplate,&count); +} + + +/* +** GLX_SGI_swap_control +*/ +static int __glXSwapIntervalSGI(int interval) +{ + xGLXVendorPrivateReq *req; + GLXContext gc = __glXGetCurrentContext(); + Display * dpy; + CARD32 * interval_ptr; + CARD8 opcode; + + if ( gc == NULL ) { + return GLX_BAD_CONTEXT; + } + + if ( interval <= 0 ) { + return GLX_BAD_VALUE; + } + +#ifdef __DRI_SWAP_CONTROL + if (gc->driContext) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy, + gc->currentDrawable, + NULL); + if (psc->swapControl != NULL && pdraw != NULL) { + psc->swapControl->setSwapInterval(pdraw->driDrawable, interval); + return 0; + } + else { + return GLX_BAD_CONTEXT; + } + } +#endif + dpy = gc->currentDpy; + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return 0; + } + + /* Send the glXSwapIntervalSGI request */ + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate,sizeof(CARD32),req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_SwapIntervalSGI; + req->contextTag = gc->currentContextTag; + + interval_ptr = (CARD32 *) (req + 1); + *interval_ptr = interval; + + UnlockDisplay(dpy); + SyncHandle(); + XFlush(dpy); + + return 0; +} + + +/* +** GLX_MESA_swap_control +*/ +static int __glXSwapIntervalMESA(unsigned int interval) +{ +#ifdef __DRI_SWAP_CONTROL + GLXContext gc = __glXGetCurrentContext(); + + if ( interval < 0 ) { + return GLX_BAD_VALUE; + } + + if (gc != NULL && gc->driContext) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + + if ( (psc != NULL) && (psc->driScreen != NULL) ) { + __GLXDRIdrawable *pdraw = + GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL); + if (psc->swapControl != NULL && pdraw != NULL) { + psc->swapControl->setSwapInterval(pdraw->driDrawable, interval); + return 0; + } + } + } +#else + (void) interval; +#endif + + return GLX_BAD_CONTEXT; +} + + +static int __glXGetSwapIntervalMESA(void) +{ +#ifdef __DRI_SWAP_CONTROL + GLXContext gc = __glXGetCurrentContext(); + + if (gc != NULL && gc->driContext) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + + if ( (psc != NULL) && (psc->driScreen != NULL) ) { + __GLXDRIdrawable *pdraw = + GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL); + if (psc->swapControl != NULL && pdraw != NULL) { + return psc->swapControl->getSwapInterval(pdraw->driDrawable); + } + } + } +#endif + + return 0; +} + + +/* +** GLX_MESA_swap_frame_usage +*/ + +static GLint __glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable) +{ + int status = GLX_BAD_CONTEXT; +#ifdef __DRI_FRAME_TRACKING + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if (pdraw != NULL && psc->frameTracking != NULL) + status = psc->frameTracking->frameTracking(pdraw->driDrawable, GL_TRUE); +#else + (void) dpy; + (void) drawable; +#endif + return status; +} + + +static GLint __glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable) +{ + int status = GLX_BAD_CONTEXT; +#ifdef __DRI_FRAME_TRACKING + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs *psc = GetGLXScreenConfigs(dpy, screen); + + if (pdraw != NULL && psc->frameTracking != NULL) + status = psc->frameTracking->frameTracking(pdraw->driDrawable, + GL_FALSE); +#else + (void) dpy; + (void) drawable; +#endif + return status; +} + + +static GLint __glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, + GLfloat *usage) +{ + int status = GLX_BAD_CONTEXT; +#ifdef __DRI_FRAME_TRACKING + int screen; + __GLXDRIdrawable * const pdraw = GetGLXDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if (pdraw != NULL && psc->frameTracking != NULL) { + int64_t sbc, missedFrames; + float lastMissedUsage; + + status = psc->frameTracking->queryFrameTracking(pdraw->driDrawable, + &sbc, + &missedFrames, + &lastMissedUsage, + usage); + } +#else + (void) dpy; + (void) drawable; + (void) usage; +#endif + return status; +} + + +static GLint __glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, + int64_t *sbc, int64_t *missedFrames, + GLfloat *lastMissedUsage) +{ + int status = GLX_BAD_CONTEXT; +#ifdef __DRI_FRAME_TRACKING + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if (pdraw != NULL && psc->frameTracking != NULL) { + float usage; + + status = psc->frameTracking->queryFrameTracking(pdraw->driDrawable, + sbc, missedFrames, + lastMissedUsage, &usage); + } +#else + (void) dpy; + (void) drawable; + (void) sbc; + (void) missedFrames; + (void) lastMissedUsage; +#endif + return status; +} + + +/* +** GLX_SGI_video_sync +*/ +static int __glXGetVideoSyncSGI(unsigned int *count) +{ + /* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry, + * FIXME: there should be a GLX encoding for this call. I can find no + * FIXME: documentation for the GLX encoding. + */ +#ifdef __DRI_MEDIA_STREAM_COUNTER + GLXContext gc = __glXGetCurrentContext(); + + + if (gc != NULL && gc->driContext) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + if ( psc->msc && psc->driScreen ) { + __GLXDRIdrawable *pdraw = + GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL); + int64_t temp; + int ret; + + ret = (*psc->msc->getDrawableMSC)(psc->__driScreen, + pdraw->driDrawable, &temp); + *count = (unsigned) temp; + + return (ret == 0) ? 0 : GLX_BAD_CONTEXT; + } + } +#else + (void) count; +#endif + return GLX_BAD_CONTEXT; +} + +static int __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) +{ +#ifdef __DRI_MEDIA_STREAM_COUNTER + GLXContext gc = __glXGetCurrentContext(); + + if ( divisor <= 0 || remainder < 0 ) + return GLX_BAD_VALUE; + + if (gc != NULL && gc->driContext) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + if (psc->msc != NULL && psc->driScreen ) { + __GLXDRIdrawable *pdraw = + GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL); + int ret; + int64_t msc; + int64_t sbc; + + ret = (*psc->msc->waitForMSC)(pdraw->driDrawable, 0, + divisor, remainder, &msc, &sbc); + *count = (unsigned) msc; + return (ret == 0) ? 0 : GLX_BAD_CONTEXT; + } + } +#else + (void) count; +#endif + return GLX_BAD_CONTEXT; +} + + +/* +** GLX_SGIX_fbconfig +** Many of these functions are aliased to GLX 1.3 entry points in the +** GLX_functions table. +*/ + +PUBLIC GLX_ALIAS(int, glXGetFBConfigAttribSGIX, + (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value), + (dpy, config, attribute, value), + glXGetFBConfigAttrib) + +PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX, + (Display *dpy, int screen, int *attrib_list, int *nelements), + (dpy, screen, attrib_list, nelements), + glXChooseFBConfig) + +PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX, + (Display * dpy, GLXFBConfigSGIX config), + (dpy, config), + glXGetVisualFromFBConfig) + +PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy, + GLXFBConfigSGIX config, Pixmap pixmap) +{ + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXCreateGLXPixmapWithConfigSGIXReq *req; + GLXPixmap xid = None; + CARD8 opcode; + const __GLcontextModes * const fbconfig = (__GLcontextModes *) config; + __GLXscreenConfigs * psc; + + + if ( (dpy == NULL) || (config == NULL) ) { + return None; + } + + psc = GetGLXScreenConfigs( dpy, fbconfig->screen ); + if ( (psc != NULL) + && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) { + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return None; + } + + /* Send the glXCreateGLXPixmapWithConfigSGIX request */ + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivateWithReply, + sz_xGLXCreateGLXPixmapWithConfigSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq); + req = (xGLXCreateGLXPixmapWithConfigSGIXReq *)vpreq; + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_CreateGLXPixmapWithConfigSGIX; + req->screen = fbconfig->screen; + req->fbconfig = fbconfig->fbconfigID; + req->pixmap = pixmap; + req->glxpixmap = xid = XAllocID(dpy); + UnlockDisplay(dpy); + SyncHandle(); + } + + return xid; +} + +PUBLIC GLXContext glXCreateContextWithConfigSGIX(Display *dpy, + GLXFBConfigSGIX config, int renderType, + GLXContext shareList, Bool allowDirect) +{ + GLXContext gc = NULL; + const __GLcontextModes * const fbconfig = (__GLcontextModes *) config; + __GLXscreenConfigs * psc; + + + if ( (dpy == NULL) || (config == NULL) ) { + return None; + } + + psc = GetGLXScreenConfigs( dpy, fbconfig->screen ); + if ( (psc != NULL) + && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) { + gc = CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList, + allowDirect, None, False, renderType ); + } + + return gc; +} + + +PUBLIC GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy, + XVisualInfo *vis) +{ + __GLXdisplayPrivate *priv; + __GLXscreenConfigs *psc; + + if ( (GetGLXPrivScreenConfig( dpy, vis->screen, & priv, & psc ) != Success) + && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) + && (psc->configs->fbconfigID != GLX_DONT_CARE) ) { + return (GLXFBConfigSGIX) _gl_context_modes_find_visual( psc->configs, + vis->visualid ); + } + + return NULL; +} + + +/* +** GLX_SGIX_swap_group +*/ +static void __glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, + GLXDrawable member) +{ + (void) dpy; + (void) drawable; + (void) member; +} + + +/* +** GLX_SGIX_swap_barrier +*/ +static void __glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, + int barrier) +{ + (void) dpy; + (void) drawable; + (void) barrier; +} + +static Bool __glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max) +{ + (void) dpy; + (void) screen; + (void) max; + return False; +} + + +/* +** GLX_OML_sync_control +*/ +static Bool __glXGetSyncValuesOML(Display *dpy, GLXDrawable drawable, + int64_t *ust, int64_t *msc, int64_t *sbc) +{ +#if defined(__DRI_SWAP_BUFFER_COUNTER) && defined(__DRI_MEDIA_STREAM_COUNTER) + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + + if ( priv != NULL ) { + int i; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &i); + __GLXscreenConfigs * const psc = &priv->screenConfigs[i]; + + assert( (pdraw == NULL) || (i != -1) ); + return ( (pdraw && psc->sbc && psc->msc) + && ((*psc->msc->getMSC)(psc->driScreen, msc) == 0) + && ((*psc->sbc->getSBC)(pdraw->driDrawable, sbc) == 0) + && (__glXGetUST(ust) == 0) ); + } +#else + (void) dpy; + (void) drawable; + (void) ust; + (void) msc; + (void) sbc; +#endif + return False; +} + +#ifdef GLX_DIRECT_RENDERING +_X_HIDDEN GLboolean +__driGetMscRateOML(__DRIdrawable *draw, + int32_t *numerator, int32_t *denominator, void *private) +{ +#ifdef XF86VIDMODE + __GLXscreenConfigs *psc; + XF86VidModeModeLine mode_line; + int dot_clock; + int i; + __GLXDRIdrawable *glxDraw = private; + + psc = glxDraw->psc; + if (XF86VidModeQueryVersion(psc->dpy, &i, &i) && + XF86VidModeGetModeLine(psc->dpy, psc->scr, &dot_clock, &mode_line) ) { + unsigned n = dot_clock * 1000; + unsigned d = mode_line.vtotal * mode_line.htotal; + +# define V_INTERLACE 0x010 +# define V_DBLSCAN 0x020 + + if (mode_line.flags & V_INTERLACE) + n *= 2; + else if (mode_line.flags & V_DBLSCAN) + d *= 2; + + /* The OML_sync_control spec requires that if the refresh rate is a + * whole number, that the returned numerator be equal to the refresh + * rate and the denominator be 1. + */ + + if (n % d == 0) { + n /= d; + d = 1; + } + else { + static const unsigned f[] = { 13, 11, 7, 5, 3, 2, 0 }; + + /* This is a poor man's way to reduce a fraction. It's far from + * perfect, but it will work well enough for this situation. + */ + + for (i = 0; f[i] != 0; i++) { + while (n % f[i] == 0 && d % f[i] == 0) { + d /= f[i]; + n /= f[i]; + } + } + } + + *numerator = n; + *denominator = d; + + return True; + } + else + return False; +#else + return False; +#endif +} +#endif + +/** + * Determine the refresh rate of the specified drawable and display. + * + * \param dpy Display whose refresh rate is to be determined. + * \param drawable Drawable whose refresh rate is to be determined. + * \param numerator Numerator of the refresh rate. + * \param demoninator Denominator of the refresh rate. + * \return If the refresh rate for the specified display and drawable could + * be calculated, True is returned. Otherwise False is returned. + * + * \note This function is implemented entirely client-side. A lot of other + * functionality is required to export GLX_OML_sync_control, so on + * XFree86 this function can be called for direct-rendering contexts + * when GLX_OML_sync_control appears in the client extension string. + */ + +_X_HIDDEN GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, + int32_t * numerator, + int32_t * denominator) +{ +#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE ) + __GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable, NULL); + + if (draw == NULL) + return False; + + return __driGetMscRateOML(draw->driDrawable, numerator, denominator, draw); +#else + (void) dpy; + (void) drawable; + (void) numerator; + (void) denominator; +#endif + return False; +} + + +static int64_t __glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable, + int64_t target_msc, int64_t divisor, + int64_t remainder) +{ +#ifdef __DRI_SWAP_BUFFER_COUNTER + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + + /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE + * error", but it also says "It [glXSwapBuffersMscOML] will return a value + * of -1 if the function failed because of errors detected in the input + * parameters" + */ + if ( divisor < 0 || remainder < 0 || target_msc < 0 ) + return -1; + if ( divisor > 0 && remainder >= divisor ) + return -1; + + if (pdraw != NULL && psc->counters != NULL) + return (*psc->sbc->swapBuffersMSC)(pdraw->driDrawable, target_msc, + divisor, remainder); + +#else + (void) dpy; + (void) drawable; + (void) target_msc; + (void) divisor; + (void) remainder; +#endif + return 0; +} + + +static Bool __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, + int64_t target_msc, int64_t divisor, + int64_t remainder, int64_t *ust, + int64_t *msc, int64_t *sbc) +{ +#ifdef __DRI_MEDIA_STREAM_COUNTER + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + int ret; + + /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE + * error", but the return type in the spec is Bool. + */ + if ( divisor < 0 || remainder < 0 || target_msc < 0 ) + return False; + if ( divisor > 0 && remainder >= divisor ) + return False; + + if (pdraw != NULL && psc->msc != NULL) { + ret = (*psc->msc->waitForMSC)(pdraw->driDrawable, target_msc, + divisor, remainder, msc, sbc); + + /* __glXGetUST returns zero on success and non-zero on failure. + * This function returns True on success and False on failure. + */ + return ( (ret == 0) && (__glXGetUST( ust ) == 0) ); + } +#else + (void) dpy; + (void) drawable; + (void) target_msc; + (void) divisor; + (void) remainder; + (void) ust; + (void) msc; + (void) sbc; +#endif + return False; +} + + +static Bool __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, + int64_t target_sbc, int64_t *ust, + int64_t *msc, int64_t *sbc ) +{ +#ifdef __DRI_SWAP_BUFFER_COUNTER + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + int ret; + + /* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE + * error", but the return type in the spec is Bool. + */ + if ( target_sbc < 0 ) + return False; + + if (pdraw != NULL && psc->sbc != NULL) { + ret = (*psc->sbc->waitForSBC)(pdraw->driDrawable, target_sbc, msc, sbc); + + /* __glXGetUST returns zero on success and non-zero on failure. + * This function returns True on success and False on failure. + */ + return( (ret == 0) && (__glXGetUST( ust ) == 0) ); + } +#else + (void) dpy; + (void) drawable; + (void) target_sbc; + (void) ust; + (void) msc; + (void) sbc; +#endif + return False; +} + + +/** + * GLX_MESA_allocate_memory + */ +/*@{*/ + +PUBLIC void *glXAllocateMemoryMESA(Display *dpy, int scrn, + size_t size, float readFreq, + float writeFreq, float priority) +{ +#ifdef __DRI_ALLOCATE + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn ); + + if (psc && psc->allocate) + return (*psc->allocate->allocateMemory)(psc->__driScreen, size, + readFreq, writeFreq, priority); + +#else + (void) dpy; + (void) scrn; + (void) size; + (void) readFreq; + (void) writeFreq; + (void) priority; +#endif /* GLX_DIRECT_RENDERING */ + + return NULL; +} + + +PUBLIC void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer) +{ +#ifdef __DRI_ALLOCATE + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn ); + + if (psc && psc->allocate) + (*psc->allocate->freeMemory)(psc->__driScreen, pointer); + +#else + (void) dpy; + (void) scrn; + (void) pointer; +#endif /* GLX_DIRECT_RENDERING */ +} + + +PUBLIC GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn, + const void *pointer ) +{ +#ifdef __DRI_ALLOCATE + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn ); + + if (psc && psc->allocate) + return (*psc->allocate->memoryOffset)(psc->__driScreen, pointer); + +#else + (void) dpy; + (void) scrn; + (void) pointer; +#endif /* GLX_DIRECT_RENDERING */ + + return ~0L; +} +/*@}*/ + + +/** + * Mesa extension stubs. These will help reduce portability problems. + */ +/*@{*/ + +/** + * Release all buffers associated with the specified GLX drawable. + * + * \todo + * This function was intended for stand-alone Mesa. The issue there is that + * the library doesn't get any notification when a window is closed. In + * DRI there is a similar but slightly different issue. When GLX 1.3 is + * supported, there are 3 different functions to destroy a drawable. It + * should be possible to create GLX protocol (or have it determine which + * protocol to use based on the type of the drawable) to have one function + * do the work of 3. For the direct-rendering case, this function could + * just call the driver's \c __DRIdrawableRec::destroyDrawable function. + * This would reduce the frequency with which \c __driGarbageCollectDrawables + * would need to be used. This really should be done as part of the new DRI + * interface work. + * + * \sa http://oss.sgi.com/projects/ogl-sample/registry/MESA/release_buffers.txt + * __driGarbageCollectDrawables + * glXDestroyGLXPixmap + * glXDestroyPbuffer glXDestroyPixmap glXDestroyWindow + * glXDestroyGLXPbufferSGIX glXDestroyGLXVideoSourceSGIX + */ +static Bool __glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ) +{ + (void) dpy; + (void) d; + return False; +} + + +PUBLIC GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ) +{ + (void) dpy; + (void) visual; + (void) pixmap; + (void) cmap; + return 0; +} +/*@}*/ + + +/** + * GLX_MESA_copy_sub_buffer + */ +#define X_GLXvop_CopySubBufferMESA 5154 /* temporary */ +static void __glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height) +{ + xGLXVendorPrivateReq *req; + GLXContext gc; + GLXContextTag tag; + CARD32 *drawable_ptr; + INT32 *x_ptr, *y_ptr, *w_ptr, *h_ptr; + CARD8 opcode; + +#ifdef __DRI_COPY_SUB_BUFFER + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); + if ( pdraw != NULL ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + if (psc->driScreen->copySubBuffer != NULL) { + glFlush(); + (*psc->driScreen->copySubBuffer)(pdraw, x, y, width, height); + } + + return; + } +#endif + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + /* + ** The calling thread may or may not have a current context. If it + ** does, send the context tag so the server can do a flush. + */ + gc = __glXGetCurrentContext(); + if ((gc != NULL) && (dpy == gc->currentDpy) && + ((drawable == gc->currentDrawable) || + (drawable == gc->currentReadable)) ) { + tag = gc->currentContextTag; + } else { + tag = 0; + } + + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, sizeof(CARD32) + sizeof(INT32) * 4,req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_CopySubBufferMESA; + req->contextTag = tag; + + drawable_ptr = (CARD32 *) (req + 1); + x_ptr = (INT32 *) (drawable_ptr + 1); + y_ptr = (INT32 *) (drawable_ptr + 2); + w_ptr = (INT32 *) (drawable_ptr + 3); + h_ptr = (INT32 *) (drawable_ptr + 4); + + *drawable_ptr = drawable; + *x_ptr = x; + *y_ptr = y; + *w_ptr = width; + *h_ptr = height; + + UnlockDisplay(dpy); + SyncHandle(); +} + + +/** + * GLX_EXT_texture_from_pixmap + */ +/*@{*/ +static void __glXBindTexImageEXT(Display *dpy, + GLXDrawable drawable, + int buffer, + const int *attrib_list) +{ + xGLXVendorPrivateReq *req; + GLXContext gc = __glXGetCurrentContext(); + CARD32 *drawable_ptr; + INT32 *buffer_ptr; + CARD32 *num_attrib_ptr; + CARD32 *attrib_ptr; + CARD8 opcode; + unsigned int i; + + if (gc == NULL) + return; + + i = 0; + if (attrib_list) { + while (attrib_list[i * 2] != None) + i++; + } + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL); + + if (pdraw != NULL) + (*pdraw->psc->texBuffer->setTexBuffer)(gc->__driContext, + pdraw->textureTarget, + pdraw->driDrawable); + + return; + } +#endif + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, 12 + 8 * i,req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_BindTexImageEXT; + req->contextTag = gc->currentContextTag; + + drawable_ptr = (CARD32 *) (req + 1); + buffer_ptr = (INT32 *) (drawable_ptr + 1); + num_attrib_ptr = (CARD32 *) (buffer_ptr + 1); + attrib_ptr = (CARD32 *) (num_attrib_ptr + 1); + + *drawable_ptr = drawable; + *buffer_ptr = buffer; + *num_attrib_ptr = (CARD32) i; + + i = 0; + if (attrib_list) { + while (attrib_list[i * 2] != None) + { + *attrib_ptr++ = (CARD32) attrib_list[i * 2 + 0]; + *attrib_ptr++ = (CARD32) attrib_list[i * 2 + 1]; + i++; + } + } + + UnlockDisplay(dpy); + SyncHandle(); +} + +static void __glXReleaseTexImageEXT(Display *dpy, + GLXDrawable drawable, + int buffer) +{ + xGLXVendorPrivateReq *req; + GLXContext gc = __glXGetCurrentContext(); + CARD32 *drawable_ptr; + INT32 *buffer_ptr; + CARD8 opcode; + + if (gc == NULL) + return; + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) + return; +#endif + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, sizeof(CARD32)+sizeof(INT32),req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_ReleaseTexImageEXT; + req->contextTag = gc->currentContextTag; + + drawable_ptr = (CARD32 *) (req + 1); + buffer_ptr = (INT32 *) (drawable_ptr + 1); + + *drawable_ptr = drawable; + *buffer_ptr = buffer; + + UnlockDisplay(dpy); + SyncHandle(); +} +/*@}*/ + +/** + * \c strdup is actually not a standard ANSI C or POSIX routine. + * Irix will not define it if ANSI mode is in effect. + * + * \sa strdup + */ +_X_HIDDEN char * +__glXstrdup(const char *str) +{ + char *copy; + copy = (char *) Xmalloc(strlen(str) + 1); + if (!copy) + return NULL; + strcpy(copy, str); + return copy; +} + +/* +** glXGetProcAddress support +*/ + +struct name_address_pair { + const char *Name; + GLvoid *Address; +}; + +#define GLX_FUNCTION(f) { # f, (GLvoid *) f } +#define GLX_FUNCTION2(n,f) { # n, (GLvoid *) f } + +static const struct name_address_pair GLX_functions[] = { + /*** GLX_VERSION_1_0 ***/ + GLX_FUNCTION( glXChooseVisual ), + GLX_FUNCTION( glXCopyContext ), + GLX_FUNCTION( glXCreateContext ), + GLX_FUNCTION( glXCreateGLXPixmap ), + GLX_FUNCTION( glXDestroyContext ), + GLX_FUNCTION( glXDestroyGLXPixmap ), + GLX_FUNCTION( glXGetConfig ), + GLX_FUNCTION( glXGetCurrentContext ), + GLX_FUNCTION( glXGetCurrentDrawable ), + GLX_FUNCTION( glXIsDirect ), + GLX_FUNCTION( glXMakeCurrent ), + GLX_FUNCTION( glXQueryExtension ), + GLX_FUNCTION( glXQueryVersion ), + GLX_FUNCTION( glXSwapBuffers ), + GLX_FUNCTION( glXUseXFont ), + GLX_FUNCTION( glXWaitGL ), + GLX_FUNCTION( glXWaitX ), + + /*** GLX_VERSION_1_1 ***/ + GLX_FUNCTION( glXGetClientString ), + GLX_FUNCTION( glXQueryExtensionsString ), + GLX_FUNCTION( glXQueryServerString ), + + /*** GLX_VERSION_1_2 ***/ + GLX_FUNCTION( glXGetCurrentDisplay ), + + /*** GLX_VERSION_1_3 ***/ + GLX_FUNCTION( glXChooseFBConfig ), + GLX_FUNCTION( glXCreateNewContext ), + GLX_FUNCTION( glXCreatePbuffer ), + GLX_FUNCTION( glXCreatePixmap ), + GLX_FUNCTION( glXCreateWindow ), + GLX_FUNCTION( glXDestroyPbuffer ), + GLX_FUNCTION( glXDestroyPixmap ), + GLX_FUNCTION( glXDestroyWindow ), + GLX_FUNCTION( glXGetCurrentReadDrawable ), + GLX_FUNCTION( glXGetFBConfigAttrib ), + GLX_FUNCTION( glXGetFBConfigs ), + GLX_FUNCTION( glXGetSelectedEvent ), + GLX_FUNCTION( glXGetVisualFromFBConfig ), + GLX_FUNCTION( glXMakeContextCurrent ), + GLX_FUNCTION( glXQueryContext ), + GLX_FUNCTION( glXQueryDrawable ), + GLX_FUNCTION( glXSelectEvent ), + + /*** GLX_SGI_swap_control ***/ + GLX_FUNCTION2( glXSwapIntervalSGI, __glXSwapIntervalSGI ), + + /*** GLX_SGI_video_sync ***/ + GLX_FUNCTION2( glXGetVideoSyncSGI, __glXGetVideoSyncSGI ), + GLX_FUNCTION2( glXWaitVideoSyncSGI, __glXWaitVideoSyncSGI ), + + /*** GLX_SGI_make_current_read ***/ + GLX_FUNCTION2( glXMakeCurrentReadSGI, glXMakeContextCurrent ), + GLX_FUNCTION2( glXGetCurrentReadDrawableSGI, glXGetCurrentReadDrawable ), + + /*** GLX_EXT_import_context ***/ + GLX_FUNCTION( glXFreeContextEXT ), + GLX_FUNCTION( glXGetContextIDEXT ), + GLX_FUNCTION2( glXGetCurrentDisplayEXT, glXGetCurrentDisplay ), + GLX_FUNCTION( glXImportContextEXT ), + GLX_FUNCTION2( glXQueryContextInfoEXT, glXQueryContext ), + + /*** GLX_SGIX_fbconfig ***/ + GLX_FUNCTION2( glXGetFBConfigAttribSGIX, glXGetFBConfigAttrib ), + GLX_FUNCTION2( glXChooseFBConfigSGIX, glXChooseFBConfig ), + GLX_FUNCTION( glXCreateGLXPixmapWithConfigSGIX ), + GLX_FUNCTION( glXCreateContextWithConfigSGIX ), + GLX_FUNCTION2( glXGetVisualFromFBConfigSGIX, glXGetVisualFromFBConfig ), + GLX_FUNCTION( glXGetFBConfigFromVisualSGIX ), + + /*** GLX_SGIX_pbuffer ***/ + GLX_FUNCTION( glXCreateGLXPbufferSGIX ), + GLX_FUNCTION( glXDestroyGLXPbufferSGIX ), + GLX_FUNCTION( glXQueryGLXPbufferSGIX ), + GLX_FUNCTION( glXSelectEventSGIX ), + GLX_FUNCTION( glXGetSelectedEventSGIX ), + + /*** GLX_SGIX_swap_group ***/ + GLX_FUNCTION2( glXJoinSwapGroupSGIX, __glXJoinSwapGroupSGIX ), + + /*** GLX_SGIX_swap_barrier ***/ + GLX_FUNCTION2( glXBindSwapBarrierSGIX, __glXBindSwapBarrierSGIX ), + GLX_FUNCTION2( glXQueryMaxSwapBarriersSGIX, __glXQueryMaxSwapBarriersSGIX ), + + /*** GLX_MESA_allocate_memory ***/ + GLX_FUNCTION( glXAllocateMemoryMESA ), + GLX_FUNCTION( glXFreeMemoryMESA ), + GLX_FUNCTION( glXGetMemoryOffsetMESA ), + + /*** GLX_MESA_copy_sub_buffer ***/ + GLX_FUNCTION2( glXCopySubBufferMESA, __glXCopySubBufferMESA ), + + /*** GLX_MESA_pixmap_colormap ***/ + GLX_FUNCTION( glXCreateGLXPixmapMESA ), + + /*** GLX_MESA_release_buffers ***/ + GLX_FUNCTION2( glXReleaseBuffersMESA, __glXReleaseBuffersMESA ), + + /*** GLX_MESA_swap_control ***/ + GLX_FUNCTION2( glXSwapIntervalMESA, __glXSwapIntervalMESA ), + GLX_FUNCTION2( glXGetSwapIntervalMESA, __glXGetSwapIntervalMESA ), + + /*** GLX_MESA_swap_frame_usage ***/ + GLX_FUNCTION2( glXBeginFrameTrackingMESA, __glXBeginFrameTrackingMESA ), + GLX_FUNCTION2( glXEndFrameTrackingMESA, __glXEndFrameTrackingMESA ), + GLX_FUNCTION2( glXGetFrameUsageMESA, __glXGetFrameUsageMESA ), + GLX_FUNCTION2( glXQueryFrameTrackingMESA, __glXQueryFrameTrackingMESA ), + + /*** GLX_ARB_get_proc_address ***/ + GLX_FUNCTION( glXGetProcAddressARB ), + + /*** GLX 1.4 ***/ + GLX_FUNCTION2( glXGetProcAddress, glXGetProcAddressARB ), + + /*** GLX_OML_sync_control ***/ + GLX_FUNCTION2( glXWaitForSbcOML, __glXWaitForSbcOML ), + GLX_FUNCTION2( glXWaitForMscOML, __glXWaitForMscOML ), + GLX_FUNCTION2( glXSwapBuffersMscOML, __glXSwapBuffersMscOML ), + GLX_FUNCTION2( glXGetMscRateOML, __glXGetMscRateOML ), + GLX_FUNCTION2( glXGetSyncValuesOML, __glXGetSyncValuesOML ), + + /*** GLX_EXT_texture_from_pixmap ***/ + GLX_FUNCTION2( glXBindTexImageEXT, __glXBindTexImageEXT ), + GLX_FUNCTION2( glXReleaseTexImageEXT, __glXReleaseTexImageEXT ), + +#ifdef GLX_DIRECT_RENDERING + /*** DRI configuration ***/ + GLX_FUNCTION( glXGetScreenDriver ), + GLX_FUNCTION( glXGetDriverConfig ), +#endif + + { NULL, NULL } /* end of list */ +}; + + +static const GLvoid * +get_glx_proc_address(const char *funcName) +{ + GLuint i; + + /* try static functions */ + for (i = 0; GLX_functions[i].Name; i++) { + if (strcmp(GLX_functions[i].Name, funcName) == 0) + return GLX_functions[i].Address; + } + + return NULL; +} + + +/** + * Get the address of a named GL function. This is the pre-GLX 1.4 name for + * \c glXGetProcAddress. + * + * \param procName Name of a GL or GLX function. + * \returns A pointer to the named function + * + * \sa glXGetProcAddress + */ +PUBLIC void (*glXGetProcAddressARB(const GLubyte *procName))( void ) +{ + typedef void (*gl_function)( void ); + gl_function f; + + + /* Search the table of GLX and internal functions first. If that + * fails and the supplied name could be a valid core GL name, try + * searching the core GL function table. This check is done to prevent + * DRI based drivers from searching the core GL function table for + * internal API functions. + */ + + f = (gl_function) get_glx_proc_address((const char *) procName); + if ( (f == NULL) && (procName[0] == 'g') && (procName[1] == 'l') + && (procName[2] != 'X') ) { + f = (gl_function) _glapi_get_proc_address((const char *) procName); + } + + return f; +} + +/** + * Get the address of a named GL function. This is the GLX 1.4 name for + * \c glXGetProcAddressARB. + * + * \param procName Name of a GL or GLX function. + * \returns A pointer to the named function + * + * \sa glXGetProcAddressARB + */ +PUBLIC void (*glXGetProcAddress(const GLubyte *procName))( void ) +#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED) + __attribute__ ((alias ("glXGetProcAddressARB"))); +#else +{ + return glXGetProcAddressARB(procName); +} +#endif /* __GNUC__ */ + + +#ifdef GLX_DIRECT_RENDERING +/** + * Get the unadjusted system time (UST). Currently, the UST is measured in + * microseconds since Epoc. The actual resolution of the UST may vary from + * system to system, and the units may vary from release to release. + * Drivers should not call this function directly. They should instead use + * \c glXGetProcAddress to obtain a pointer to the function. + * + * \param ust Location to store the 64-bit UST + * \returns Zero on success or a negative errno value on failure. + * + * \sa glXGetProcAddress, PFNGLXGETUSTPROC + * + * \since Internal API version 20030317. + */ +_X_HIDDEN int __glXGetUST( int64_t * ust ) +{ + struct timeval tv; + + if ( ust == NULL ) { + return -EFAULT; + } + + if ( gettimeofday( & tv, NULL ) == 0 ) { + ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; + return 0; + } else { + return -errno; + } +} +#endif /* GLX_DIRECT_RENDERING */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxcurrent.c xpsb-glx-0.19/mesa/src/glx/x11/glxcurrent.c --- xpsb-glx-0.19/mesa/src/glx/x11/glxcurrent.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxcurrent.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,534 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/** + * \file glxcurrent.c + * Client-side GLX interface for current context management. + */ + +#include "glxclient.h" +#include "glapi.h" +#include "indirect_init.h" + +#ifdef GLX_DIRECT_RENDERING +#include "xf86dri.h" +#endif + +/* +** We setup some dummy structures here so that the API can be used +** even if no context is current. +*/ + +static GLubyte dummyBuffer[__GLX_BUFFER_LIMIT_SIZE]; + +/* +** Dummy context used by small commands when there is no current context. +** All the +** gl and glx entry points are designed to operate as nop's when using +** the dummy context structure. +*/ +static __GLXcontext dummyContext = { + &dummyBuffer[0], + &dummyBuffer[0], + &dummyBuffer[0], + &dummyBuffer[__GLX_BUFFER_LIMIT_SIZE], + sizeof(dummyBuffer), +}; + + +/* +** All indirect rendering contexts will share the same indirect dispatch table. +*/ +static __GLapi *IndirectAPI = NULL; + + +/* + * Current context management and locking + */ + +#if defined( USE_XTHREADS ) + +/* thread safe */ +static GLboolean TSDinitialized = GL_FALSE; +static xthread_key_t ContextTSD; + +_X_HIDDEN __GLXcontext * +__glXGetCurrentContext(void) +{ + if (!TSDinitialized) { + xthread_key_create(&ContextTSD, NULL); + TSDinitialized = GL_TRUE; + return &dummyContext; + } + else { + void *p; + xthread_get_specific(ContextTSD, &p); + if (!p) + return &dummyContext; + else + return (__GLXcontext *) p; + } +} + +_X_HIDDEN void +__glXSetCurrentContext(__GLXcontext * c) +{ + if (!TSDinitialized) { + xthread_key_create(&ContextTSD, NULL); + TSDinitialized = GL_TRUE; + } + xthread_set_specific(ContextTSD, c); +} + + +/* Used by the __glXLock() and __glXUnlock() macros */ +_X_HIDDEN xmutex_rec __glXmutex; + +#elif defined( PTHREADS ) + +_X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER; + +# if defined( GLX_USE_TLS ) + +/** + * Per-thread GLX context pointer. + * + * \c __glXSetCurrentContext is written is such a way that this pointer can + * \b never be \c NULL. This is important! Because of this + * \c __glXGetCurrentContext can be implemented as trivial macro. + */ +__thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec"))) + = &dummyContext; + +_X_HIDDEN void +__glXSetCurrentContext(__GLXcontext * c) +{ + __glX_tls_Context = (c != NULL) ? c : &dummyContext; +} + +# else + +static pthread_once_t once_control = PTHREAD_ONCE_INIT; + +/** + * Per-thread data key. + * + * Once \c init_thread_data has been called, the per-thread data key will + * take a value of \c NULL. As each new thread is created the default + * value, in that thread, will be \c NULL. + */ +static pthread_key_t ContextTSD; + +/** + * Initialize the per-thread data key. + * + * This function is called \b exactly once per-process (not per-thread!) to + * initialize the per-thread data key. This is ideally done using the + * \c pthread_once mechanism. + */ +static void +init_thread_data(void) +{ + if (pthread_key_create(&ContextTSD, NULL) != 0) { + perror("pthread_key_create"); + exit(-1); + } +} + +_X_HIDDEN void +__glXSetCurrentContext(__GLXcontext * c) +{ + pthread_once(&once_control, init_thread_data); + pthread_setspecific(ContextTSD, c); +} + +_X_HIDDEN __GLXcontext * +__glXGetCurrentContext(void) +{ + void *v; + + pthread_once(&once_control, init_thread_data); + + v = pthread_getspecific(ContextTSD); + return (v == NULL) ? &dummyContext : (__GLXcontext *) v; +} + +# endif /* defined( GLX_USE_TLS ) */ + +#elif defined( THREADS ) + +#error Unknown threading method specified. + +#else + +/* not thread safe */ +_X_HIDDEN __GLXcontext *__glXcurrentContext = &dummyContext; + +#endif + + +_X_HIDDEN void +__glXSetCurrentContextNull(void) +{ + __glXSetCurrentContext(&dummyContext); +#ifdef GLX_DIRECT_RENDERING + _glapi_set_dispatch(NULL); /* no-op functions */ +#endif +} + + +/************************************************************************/ + +PUBLIC GLXContext +glXGetCurrentContext(void) +{ + GLXContext cx = __glXGetCurrentContext(); + + if (cx == &dummyContext) { + return NULL; + } + else { + return cx; + } +} + +PUBLIC GLXDrawable +glXGetCurrentDrawable(void) +{ + GLXContext gc = __glXGetCurrentContext(); + return gc->currentDrawable; +} + + +/************************************************************************/ + +/** + * Sends a GLX protocol message to the specified display to make the context + * and the drawables current. + * + * \param dpy Display to send the message to. + * \param opcode Major opcode value for the display. + * \param gc_id Context tag for the context to be made current. + * \param draw Drawable ID for the "draw" drawable. + * \param read Drawable ID for the "read" drawable. + * \param reply Space to store the X-server's reply. + * + * \warning + * This function assumes that \c dpy is locked with \c LockDisplay on entry. + */ +static Bool +SendMakeCurrentRequest(Display * dpy, CARD8 opcode, + GLXContextID gc_id, GLXContextTag gc_tag, + GLXDrawable draw, GLXDrawable read, + xGLXMakeCurrentReply * reply) +{ + Bool ret; + + + LockDisplay(dpy); + + if (draw == read) { + xGLXMakeCurrentReq *req; + + GetReq(GLXMakeCurrent, req); + req->reqType = opcode; + req->glxCode = X_GLXMakeCurrent; + req->drawable = draw; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + else { + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + + /* If the server can support the GLX 1.3 version, we should + * perfer that. Not only that, some servers support GLX 1.3 but + * not the SGI extension. + */ + + if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { + xGLXMakeContextCurrentReq *req; + + GetReq(GLXMakeContextCurrent, req); + req->reqType = opcode; + req->glxCode = X_GLXMakeContextCurrent; + req->drawable = draw; + req->readdrawable = read; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXMakeCurrentReadSGIReq *req; + + GetReqExtra(GLXVendorPrivateWithReply, + sz_xGLXMakeCurrentReadSGIReq - + sz_xGLXVendorPrivateWithReplyReq, vpreq); + req = (xGLXMakeCurrentReadSGIReq *) vpreq; + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_MakeCurrentReadSGI; + req->drawable = draw; + req->readable = read; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + } + + ret = _XReply(dpy, (xReply *) reply, 0, False); + + UnlockDisplay(dpy); + SyncHandle(); + + return ret; +} + + +#ifdef GLX_DIRECT_RENDERING +static __GLXDRIdrawable * +FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc) +{ + __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw; + __GLXscreenConfigs *psc; + + if (priv == NULL) + return NULL; + + psc = &priv->screenConfigs[gc->screen]; + if (psc->drawHash == NULL) + return NULL; + + if (__glxHashLookup(psc->drawHash, glxDrawable, (void *) &pdraw) == 0) + return pdraw; + + pdraw = psc->driScreen->createDrawable(psc, glxDrawable, + glxDrawable, gc->mode); + if (__glxHashInsert(psc->drawHash, glxDrawable, pdraw)) { + (*pdraw->destroyDrawable) (pdraw); + return NULL; + } + + return pdraw; +} +#endif /* GLX_DIRECT_RENDERING */ + + +/** + * Make a particular context current. + * + * \note This is in this file so that it can access dummyContext. + */ +static Bool +MakeContextCurrent(Display * dpy, GLXDrawable draw, + GLXDrawable read, GLXContext gc) +{ + xGLXMakeCurrentReply reply; + const GLXContext oldGC = __glXGetCurrentContext(); + const CARD8 opcode = __glXSetupForCommand(dpy); + const CARD8 oldOpcode = ((gc == oldGC) || (oldGC == &dummyContext)) + ? opcode : __glXSetupForCommand(oldGC->currentDpy); + Bool bindReturnValue; + __GLXattribute *state; + + if (!opcode || !oldOpcode) { + return GL_FALSE; + } + + /* Make sure that the new context has a nonzero ID. In the request, + * a zero context ID is used only to mean that we bind to no current + * context. + */ + if ((gc != NULL) && (gc->xid == None)) { + return GL_FALSE; + } + + _glapi_check_multithread(); + +#ifdef GLX_DIRECT_RENDERING + /* Bind the direct rendering context to the drawable */ + if (gc && gc->driContext) { + __GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc); + __GLXDRIdrawable *pread = FetchDRIDrawable(dpy, read, gc); + + if ((pdraw == NULL) || (pread == NULL)) { + xError error; + + error.errorCode = GLXBadDrawable; + error.resourceID = (pdraw == NULL) ? draw : read; + error.sequenceNumber = dpy->request; + error.type = X_Error; + error.majorCode = gc->majorOpcode; + error.minorCode = X_GLXMakeContextCurrent; + _XError(dpy, &error); + return False; + } + + bindReturnValue = + (gc->driContext->bindContext) (gc->driContext, pdraw, pread); + } + else +#endif + { + /* Send a glXMakeCurrent request to bind the new context. */ + bindReturnValue = + SendMakeCurrentRequest(dpy, opcode, gc ? gc->xid : None, + ((dpy != oldGC->currentDpy) + || oldGC->isDirect) + ? None : oldGC->currentContextTag, draw, read, + &reply); + } + + + if (!bindReturnValue) { + return False; + } + +#ifdef GLX_DIRECT_RENDERING + if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) && + !oldGC->isDirect && oldGC != &dummyContext) { +#else + if ((dpy != oldGC->currentDpy) && oldGC != &dummyContext) { +#endif + xGLXMakeCurrentReply dummy_reply; + + /* We are either switching from one dpy to another and have to + * send a request to the previous dpy to unbind the previous + * context, or we are switching away from a indirect context to + * a direct context and have to send a request to the dpy to + * unbind the previous context. + */ + (void) SendMakeCurrentRequest(oldGC->currentDpy, oldOpcode, None, + oldGC->currentContextTag, None, None, + &dummy_reply); + } +#ifdef GLX_DIRECT_RENDERING + else if (oldGC->driContext) { + oldGC->driContext->unbindContext(oldGC->driContext); + } +#endif + + + /* Update our notion of what is current */ + __glXLock(); + if (gc == oldGC) { + /* Even though the contexts are the same the drawable might have + * changed. Note that gc cannot be the dummy, and that oldGC + * cannot be NULL, therefore if they are the same, gc is not + * NULL and not the dummy. + */ + gc->currentDrawable = draw; + gc->currentReadable = read; + } + else { + if (oldGC != &dummyContext) { + /* Old current context is no longer current to anybody */ + oldGC->currentDpy = 0; + oldGC->currentDrawable = None; + oldGC->currentReadable = None; + oldGC->currentContextTag = 0; + + if (oldGC->xid == None) { + /* We are switching away from a context that was + * previously destroyed, so we need to free the memory + * for the old handle. + */ +#ifdef GLX_DIRECT_RENDERING + /* Destroy the old direct rendering context */ + if (oldGC->driContext) { + oldGC->driContext->destroyContext(oldGC->driContext, + oldGC->psc, + oldGC->createDpy); + oldGC->driContext = NULL; + } +#endif + __glXFreeContext(oldGC); + } + } + if (gc) { + __glXSetCurrentContext(gc); + + gc->currentDpy = dpy; + gc->currentDrawable = draw; + gc->currentReadable = read; + +#ifdef GLX_DIRECT_RENDERING + if (!gc->driContext) { +#endif + if (!IndirectAPI) + IndirectAPI = __glXNewIndirectAPI(); + _glapi_set_dispatch(IndirectAPI); + +#ifdef GLX_USE_APPLEGL + do { + extern void XAppleDRIUseIndirectDispatch(void); + XAppleDRIUseIndirectDispatch(); + } while (0); +#endif + + state = (__GLXattribute *) (gc->client_state_private); + + gc->currentContextTag = reply.contextTag; + if (state->array_state == NULL) { + (void) glGetString(GL_EXTENSIONS); + (void) glGetString(GL_VERSION); + __glXInitVertexArrayState(gc); + } +#ifdef GLX_DIRECT_RENDERING + } + else { + gc->currentContextTag = -1; + } +#endif + } + else { + __glXSetCurrentContextNull(); + } + } + __glXUnlock(); + return GL_TRUE; +} + + +PUBLIC Bool +glXMakeCurrent(Display * dpy, GLXDrawable draw, GLXContext gc) +{ + return MakeContextCurrent(dpy, draw, draw, gc); +} + +PUBLIC +GLX_ALIAS(Bool, glXMakeCurrentReadSGI, + (Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), + (dpy, d, r, ctx), MakeContextCurrent) + +PUBLIC +GLX_ALIAS(Bool, glXMakeContextCurrent, + (Display * dpy, GLXDrawable d, GLXDrawable r, + GLXContext ctx), (dpy, d, r, ctx), + MakeContextCurrent) diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxext.c xpsb-glx-0.19/mesa/src/glx/x11/glxext.c --- xpsb-glx-0.19/mesa/src/glx/x11/glxext.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxext.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1052 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/** + * \file glxext.c + * GLX protocol interface boot-strap code. + * + * Direct rendering support added by Precision Insight, Inc. + * + * \author Kevin E. Martin + */ + +#include +#include "glxclient.h" +#include +#include +#include "glapi.h" +#include "glxextensions.h" +#include "glcontextmodes.h" + +#ifdef USE_XCB +#include +#include +#include +#endif + + +#ifdef DEBUG +void __glXDumpDrawBuffer(__GLXcontext * ctx); +#endif + +#ifdef USE_SPARC_ASM +static void _glx_mesa_init_sparc_glapi_relocs(void); +static int _mesa_sparc_needs_init = 1; +#define INIT_MESA_SPARC do { \ + if (_mesa_sparc_needs_init) { \ + _glx_mesa_init_sparc_glapi_relocs(); \ + _mesa_sparc_needs_init = 0; \ + } \ + } while(0) +#else +#define INIT_MESA_SPARC do { } while(0) +#endif + +/* +** You can set this cell to 1 to force the gl drawing stuff to be +** one command per packet +*/ +_X_HIDDEN int __glXDebug = 0; + +/* Extension required boiler plate */ + +static char *__glXExtensionName = GLX_EXTENSION_NAME; +XExtensionInfo *__glXExtensionInfo = NULL; + +static /* const */ char *error_list[] = { + "GLXBadContext", + "GLXBadContextState", + "GLXBadDrawable", + "GLXBadPixmap", + "GLXBadContextTag", + "GLXBadCurrentWindow", + "GLXBadRenderRequest", + "GLXBadLargeRequest", + "GLXUnsupportedPrivateRequest", + "GLXBadFBConfig", + "GLXBadPbuffer", + "GLXBadCurrentDrawable", + "GLXBadWindow", +}; + +static int +__glXCloseDisplay(Display * dpy, XExtCodes * codes) +{ + GLXContext gc; + + gc = __glXGetCurrentContext(); + if (dpy == gc->currentDpy) { + __glXSetCurrentContextNull(); + __glXFreeContext(gc); + } + + return XextRemoveDisplay(__glXExtensionInfo, dpy); +} + + +static +XEXT_GENERATE_ERROR_STRING(__glXErrorString, __glXExtensionName, + __GLX_NUMBER_ERRORS, error_list) + + static /* const */ XExtensionHooks __glXExtensionHooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + __glXCloseDisplay, /* close_display */ + NULL, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + __glXErrorString, /* error_string */ + }; + +static +XEXT_GENERATE_FIND_DISPLAY(__glXFindDisplay, __glXExtensionInfo, + __glXExtensionName, &__glXExtensionHooks, + __GLX_NUMBER_EVENTS, NULL) + +/************************************************************************/ +/* +** Free the per screen configs data as well as the array of +** __glXScreenConfigs. +*/ +static void +FreeScreenConfigs(__GLXdisplayPrivate * priv) +{ + __GLXscreenConfigs *psc; + GLint i, screens; + + /* Free screen configuration information */ + psc = priv->screenConfigs; + screens = ScreenCount(priv->dpy); + for (i = 0; i < screens; i++, psc++) { + if (psc->configs) { + _gl_context_modes_destroy(psc->configs); + if (psc->effectiveGLXexts) + Xfree(psc->effectiveGLXexts); + psc->configs = NULL; /* NOTE: just for paranoia */ + } + if (psc->visuals) { + _gl_context_modes_destroy(psc->visuals); + psc->visuals = NULL; /* NOTE: just for paranoia */ + } + Xfree((char *) psc->serverGLXexts); + +#ifdef GLX_DIRECT_RENDERING + if (psc->driScreen) { + psc->driScreen->destroyScreen(psc); + __glxHashDestroy(psc->drawHash); + XFree(psc->driScreen); + psc->driScreen = NULL; + } +#endif + } + XFree((char *) priv->screenConfigs); + priv->screenConfigs = NULL; +} + +/* +** Release the private memory referred to in a display private +** structure. The caller will free the extension structure. +*/ +static int +__glXFreeDisplayPrivate(XExtData * extension) +{ + __GLXdisplayPrivate *priv; + + priv = (__GLXdisplayPrivate *) extension->private_data; + FreeScreenConfigs(priv); + if (priv->serverGLXvendor) { + Xfree((char *) priv->serverGLXvendor); + priv->serverGLXvendor = 0x0; /* to protect against double free's */ + } + if (priv->serverGLXversion) { + Xfree((char *) priv->serverGLXversion); + priv->serverGLXversion = 0x0; /* to protect against double free's */ + } + +#ifdef GLX_DIRECT_RENDERING + /* Free the direct rendering per display data */ + if (priv->driswDisplay) + (*priv->driswDisplay->destroyDisplay) (priv->driswDisplay); + priv->driswDisplay = NULL; + + if (priv->driDisplay) + (*priv->driDisplay->destroyDisplay) (priv->driDisplay); + priv->driDisplay = NULL; + + if (priv->dri2Display) + (*priv->dri2Display->destroyDisplay) (priv->dri2Display); + priv->dri2Display = NULL; +#endif + + Xfree((char *) priv); + return 0; +} + +/************************************************************************/ + +/* +** Query the version of the GLX extension. This procedure works even if +** the client extension is not completely set up. +*/ +static Bool +QueryVersion(Display * dpy, int opcode, int *major, int *minor) +{ +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_query_version_reply_t* reply = + xcb_glx_query_version_reply(c, + xcb_glx_query_version(c, + GLX_MAJOR_VERSION, + GLX_MINOR_VERSION), + NULL); + + if(reply->major_version != GLX_MAJOR_VERSION) + { + free(reply); + return GL_FALSE; + } + *major = reply->major_version; + *minor = min(reply->minor_version, GLX_MINOR_VERSION); + free(reply); + return GL_TRUE; +#else + xGLXQueryVersionReq *req; + xGLXQueryVersionReply reply; + + /* Send the glXQueryVersion request */ + LockDisplay(dpy); + GetReq(GLXQueryVersion, req); + req->reqType = opcode; + req->glxCode = X_GLXQueryVersion; + req->majorVersion = GLX_MAJOR_VERSION; + req->minorVersion = GLX_MINOR_VERSION; + _XReply(dpy, (xReply *) & reply, 0, False); + UnlockDisplay(dpy); + SyncHandle(); + + if (reply.majorVersion != GLX_MAJOR_VERSION) { + /* + ** The server does not support the same major release as this + ** client. + */ + return GL_FALSE; + } + *major = reply.majorVersion; + *minor = min(reply.minorVersion, GLX_MINOR_VERSION); + return GL_TRUE; +#endif /* USE_XCB */ +} + + +_X_HIDDEN void +__glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count, + const INT32 * bp, Bool tagged_only, + Bool fbconfig_style_tags) +{ + int i; + + if (!tagged_only) { + /* Copy in the first set of properties */ + config->visualID = *bp++; + + config->visualType = _gl_convert_from_x_visual_type(*bp++); + + config->rgbMode = *bp++; + + config->redBits = *bp++; + config->greenBits = *bp++; + config->blueBits = *bp++; + config->alphaBits = *bp++; + config->accumRedBits = *bp++; + config->accumGreenBits = *bp++; + config->accumBlueBits = *bp++; + config->accumAlphaBits = *bp++; + + config->doubleBufferMode = *bp++; + config->stereoMode = *bp++; + + config->rgbBits = *bp++; + config->depthBits = *bp++; + config->stencilBits = *bp++; + config->numAuxBuffers = *bp++; + config->level = *bp++; + + count -= __GLX_MIN_CONFIG_PROPS; + } + + /* + ** Additional properties may be in a list at the end + ** of the reply. They are in pairs of property type + ** and property value. + */ + +#define FETCH_OR_SET(tag) \ + config-> tag = ( fbconfig_style_tags ) ? *bp++ : 1 + + for (i = 0; i < count; i += 2) { + switch (*bp++) { + case GLX_RGBA: + FETCH_OR_SET(rgbMode); + break; + case GLX_BUFFER_SIZE: + config->rgbBits = *bp++; + break; + case GLX_LEVEL: + config->level = *bp++; + break; + case GLX_DOUBLEBUFFER: + FETCH_OR_SET(doubleBufferMode); + break; + case GLX_STEREO: + FETCH_OR_SET(stereoMode); + break; + case GLX_AUX_BUFFERS: + config->numAuxBuffers = *bp++; + break; + case GLX_RED_SIZE: + config->redBits = *bp++; + break; + case GLX_GREEN_SIZE: + config->greenBits = *bp++; + break; + case GLX_BLUE_SIZE: + config->blueBits = *bp++; + break; + case GLX_ALPHA_SIZE: + config->alphaBits = *bp++; + break; + case GLX_DEPTH_SIZE: + config->depthBits = *bp++; + break; + case GLX_STENCIL_SIZE: + config->stencilBits = *bp++; + break; + case GLX_ACCUM_RED_SIZE: + config->accumRedBits = *bp++; + break; + case GLX_ACCUM_GREEN_SIZE: + config->accumGreenBits = *bp++; + break; + case GLX_ACCUM_BLUE_SIZE: + config->accumBlueBits = *bp++; + break; + case GLX_ACCUM_ALPHA_SIZE: + config->accumAlphaBits = *bp++; + break; + case GLX_VISUAL_CAVEAT_EXT: + config->visualRating = *bp++; + break; + case GLX_X_VISUAL_TYPE: + config->visualType = *bp++; + break; + case GLX_TRANSPARENT_TYPE: + config->transparentPixel = *bp++; + break; + case GLX_TRANSPARENT_INDEX_VALUE: + config->transparentIndex = *bp++; + break; + case GLX_TRANSPARENT_RED_VALUE: + config->transparentRed = *bp++; + break; + case GLX_TRANSPARENT_GREEN_VALUE: + config->transparentGreen = *bp++; + break; + case GLX_TRANSPARENT_BLUE_VALUE: + config->transparentBlue = *bp++; + break; + case GLX_TRANSPARENT_ALPHA_VALUE: + config->transparentAlpha = *bp++; + break; + case GLX_VISUAL_ID: + config->visualID = *bp++; + break; + case GLX_DRAWABLE_TYPE: + config->drawableType = *bp++; + break; + case GLX_RENDER_TYPE: + config->renderType = *bp++; + break; + case GLX_X_RENDERABLE: + config->xRenderable = *bp++; + break; + case GLX_FBCONFIG_ID: + config->fbconfigID = *bp++; + break; + case GLX_MAX_PBUFFER_WIDTH: + config->maxPbufferWidth = *bp++; + break; + case GLX_MAX_PBUFFER_HEIGHT: + config->maxPbufferHeight = *bp++; + break; + case GLX_MAX_PBUFFER_PIXELS: + config->maxPbufferPixels = *bp++; + break; + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + config->optimalPbufferWidth = *bp++; + break; + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + config->optimalPbufferHeight = *bp++; + break; + case GLX_VISUAL_SELECT_GROUP_SGIX: + config->visualSelectGroup = *bp++; + break; + case GLX_SWAP_METHOD_OML: + config->swapMethod = *bp++; + break; + case GLX_SAMPLE_BUFFERS_SGIS: + config->sampleBuffers = *bp++; + break; + case GLX_SAMPLES_SGIS: + config->samples = *bp++; + break; + case GLX_BIND_TO_TEXTURE_RGB_EXT: + config->bindToTextureRgb = *bp++; + break; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + config->bindToTextureRgba = *bp++; + break; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + config->bindToMipmapTexture = *bp++; + break; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + config->bindToTextureTargets = *bp++; + break; + case GLX_Y_INVERTED_EXT: + config->yInverted = *bp++; + break; + case None: + i = count; + break; + default: + break; + } + } + + config->renderType = + (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + + config->haveAccumBuffer = ((config->accumRedBits + + config->accumGreenBits + + config->accumBlueBits + + config->accumAlphaBits) > 0); + config->haveDepthBuffer = (config->depthBits > 0); + config->haveStencilBuffer = (config->stencilBits > 0); +} + +static __GLcontextModes * +createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, + int screen, GLboolean tagged_only) +{ + INT32 buf[__GLX_TOTAL_CONFIG], *props; + unsigned prop_size; + __GLcontextModes *modes, *m; + int i; + + if (nprops == 0) + return NULL; + + /* FIXME: Is the __GLX_MIN_CONFIG_PROPS test correct for FBconfigs? */ + + /* Check number of properties */ + if (nprops < __GLX_MIN_CONFIG_PROPS || nprops > __GLX_MAX_CONFIG_PROPS) + return NULL; + + /* Allocate memory for our config structure */ + modes = _gl_context_modes_create(nvisuals, sizeof(__GLcontextModes)); + if (!modes) + return NULL; + + prop_size = nprops * __GLX_SIZE_INT32; + if (prop_size <= sizeof(buf)) + props = buf; + else + props = Xmalloc(prop_size); + + /* Read each config structure and convert it into our format */ + m = modes; + for (i = 0; i < nvisuals; i++) { + _XRead(dpy, (char *) props, prop_size); + /* Older X servers don't send this so we default it here. */ + m->drawableType = GLX_WINDOW_BIT; + __glXInitializeVisualConfigFromTags(m, nprops, props, + tagged_only, GL_TRUE); + m->screen = screen; + m = m->next; + } + + if (props != buf) + Xfree(props); + + return modes; +} + +static GLboolean +getVisualConfigs(Display * dpy, __GLXdisplayPrivate * priv, int screen) +{ + xGLXGetVisualConfigsReq *req; + __GLXscreenConfigs *psc; + xGLXGetVisualConfigsReply reply; + + LockDisplay(dpy); + + psc = priv->screenConfigs + screen; + psc->visuals = NULL; + GetReq(GLXGetVisualConfigs, req); + req->reqType = priv->majorOpcode; + req->glxCode = X_GLXGetVisualConfigs; + req->screen = screen; + + if (!_XReply(dpy, (xReply *) & reply, 0, False)) + goto out; + + psc->visuals = createConfigsFromProperties(dpy, + reply.numVisuals, + reply.numProps, + screen, GL_FALSE); + + out: + UnlockDisplay(dpy); + return psc->visuals != NULL; +} + +static GLboolean +getFBConfigs(Display * dpy, __GLXdisplayPrivate * priv, int screen) +{ + xGLXGetFBConfigsReq *fb_req; + xGLXGetFBConfigsSGIXReq *sgi_req; + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXGetFBConfigsReply reply; + __GLXscreenConfigs *psc; + + psc = priv->screenConfigs + screen; + psc->serverGLXexts = __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS); + + LockDisplay(dpy); + + psc->configs = NULL; + if (atof(priv->serverGLXversion) >= 1.3) { + GetReq(GLXGetFBConfigs, fb_req); + fb_req->reqType = priv->majorOpcode; + fb_req->glxCode = X_GLXGetFBConfigs; + fb_req->screen = screen; + } + else if (strstr(psc->serverGLXexts, "GLX_SGIX_fbconfig") != NULL) { + GetReqExtra(GLXVendorPrivateWithReply, + sz_xGLXGetFBConfigsSGIXReq + + sz_xGLXVendorPrivateWithReplyReq, vpreq); + sgi_req = (xGLXGetFBConfigsSGIXReq *) vpreq; + sgi_req->reqType = priv->majorOpcode; + sgi_req->glxCode = X_GLXVendorPrivateWithReply; + sgi_req->vendorCode = X_GLXvop_GetFBConfigsSGIX; + sgi_req->screen = screen; + } + else + goto out; + + if (!_XReply(dpy, (xReply *) & reply, 0, False)) + goto out; + + psc->configs = createConfigsFromProperties(dpy, + reply.numFBConfigs, + reply.numAttribs * 2, + screen, GL_TRUE); + + out: + UnlockDisplay(dpy); + return psc->configs != NULL; +} + +/* +** Allocate the memory for the per screen configs for each screen. +** If that works then fetch the per screen configs data. +*/ +static Bool +AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) +{ + __GLXscreenConfigs *psc; + GLint i, screens; + + /* + ** First allocate memory for the array of per screen configs. + */ + screens = ScreenCount(dpy); + psc = (__GLXscreenConfigs *) Xmalloc(screens * sizeof(__GLXscreenConfigs)); + if (!psc) { + return GL_FALSE; + } + memset(psc, 0, screens * sizeof(__GLXscreenConfigs)); + priv->screenConfigs = psc; + + priv->serverGLXversion = __glXQueryServerString(dpy, priv->majorOpcode, 0, GLX_VERSION); + if (priv->serverGLXversion == NULL) { + FreeScreenConfigs(priv); + return GL_FALSE; + } + + for (i = 0; i < screens; i++, psc++) { + getVisualConfigs(dpy, priv, i); + getFBConfigs(dpy, priv, i); + +#ifdef GLX_DIRECT_RENDERING + psc->scr = i; + psc->dpy = dpy; + psc->drawHash = __glxHashCreate(); + if (psc->drawHash == NULL) + continue; + + if (priv->dri2Display) + psc->driScreen = (*priv->dri2Display->createScreen) (psc, i, priv); + + if (psc->driScreen == NULL && priv->driDisplay) + psc->driScreen = (*priv->driDisplay->createScreen) (psc, i, priv); + + if (psc->driScreen == NULL && priv->driswDisplay) + psc->driScreen = (*priv->driswDisplay->createScreen) (psc, i, priv); + + if (psc->driScreen == NULL) { + __glxHashDestroy(psc->drawHash); + psc->drawHash = NULL; + } +#endif + } + SyncHandle(); + return GL_TRUE; +} + +/* +** Initialize the client side extension code. +*/ +_X_HIDDEN __GLXdisplayPrivate * +__glXInitialize(Display * dpy) +{ + XExtDisplayInfo *info = __glXFindDisplay(dpy); + XExtData **privList, *private, *found; + __GLXdisplayPrivate *dpyPriv; + XEDataObject dataObj; + int major, minor; +#ifdef GLX_DIRECT_RENDERING + Bool glx_direct, glx_accel; +#endif + +#if defined(USE_XTHREADS) + { + static int firstCall = 1; + if (firstCall) { + /* initialize the GLX mutexes */ + xmutex_init(&__glXmutex); + firstCall = 0; + } + } +#endif + + INIT_MESA_SPARC; + /* The one and only long long lock */ + __glXLock(); + + if (!XextHasExtension(info)) { + /* No GLX extension supported by this server. Oh well. */ + __glXUnlock(); + XMissingExtension(dpy, __glXExtensionName); + return 0; + } + + /* See if a display private already exists. If so, return it */ + dataObj.display = dpy; + privList = XEHeadOfExtensionList(dataObj); + found = XFindOnExtensionList(privList, info->codes->extension); + if (found) { + __glXUnlock(); + return (__GLXdisplayPrivate *) found->private_data; + } + + /* See if the versions are compatible */ + if (!QueryVersion(dpy, info->codes->major_opcode, &major, &minor)) { + /* The client and server do not agree on versions. Punt. */ + __glXUnlock(); + return 0; + } + + /* + ** Allocate memory for all the pieces needed for this buffer. + */ + private = (XExtData *) Xmalloc(sizeof(XExtData)); + if (!private) { + __glXUnlock(); + return 0; + } + dpyPriv = (__GLXdisplayPrivate *) Xcalloc(1, sizeof(__GLXdisplayPrivate)); + if (!dpyPriv) { + __glXUnlock(); + Xfree((char *) private); + return 0; + } + + /* + ** Init the display private and then read in the screen config + ** structures from the server. + */ + dpyPriv->majorOpcode = info->codes->major_opcode; + dpyPriv->majorVersion = major; + dpyPriv->minorVersion = minor; + dpyPriv->dpy = dpy; + + dpyPriv->serverGLXvendor = 0x0; + dpyPriv->serverGLXversion = 0x0; + +#ifdef GLX_DIRECT_RENDERING + glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL); + glx_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL); + + /* + ** Initialize the direct rendering per display data and functions. + ** Note: This _must_ be done before calling any other DRI routines + ** (e.g., those called in AllocAndFetchScreenConfigs). + */ + if (glx_direct && glx_accel) { + dpyPriv->dri2Display = dri2CreateDisplay(dpy); + dpyPriv->driDisplay = driCreateDisplay(dpy); + } + if (glx_direct) + dpyPriv->driswDisplay = driswCreateDisplay(dpy); +#endif + + if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) { + __glXUnlock(); + Xfree((char *) dpyPriv); + Xfree((char *) private); + return 0; + } + + /* + ** Fill in the private structure. This is the actual structure that + ** hangs off of the Display structure. Our private structure is + ** referred to by this structure. Got that? + */ + private->number = info->codes->extension; + private->next = 0; + private->free_private = __glXFreeDisplayPrivate; + private->private_data = (char *) dpyPriv; + XAddToExtensionList(privList, private); + + if (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion >= 1) { + __glXClientInfo(dpy, dpyPriv->majorOpcode); + } + __glXUnlock(); + + return dpyPriv; +} + +/* +** Setup for sending a GLX command on dpy. Make sure the extension is +** initialized. Try to avoid calling __glXInitialize as its kinda slow. +*/ +_X_HIDDEN CARD8 +__glXSetupForCommand(Display * dpy) +{ + GLXContext gc; + __GLXdisplayPrivate *priv; + + /* If this thread has a current context, flush its rendering commands */ + gc = __glXGetCurrentContext(); + if (gc->currentDpy) { + /* Flush rendering buffer of the current context, if any */ + (void) __glXFlushRenderBuffer(gc, gc->pc); + + if (gc->currentDpy == dpy) { + /* Use opcode from gc because its right */ + INIT_MESA_SPARC; + return gc->majorOpcode; + } + else { + /* + ** Have to get info about argument dpy because it might be to + ** a different server + */ + } + } + + /* Forced to lookup extension via the slow initialize route */ + priv = __glXInitialize(dpy); + if (!priv) { + return 0; + } + return priv->majorOpcode; +} + +/** + * Flush the drawing command transport buffer. + * + * \param ctx Context whose transport buffer is to be flushed. + * \param pc Pointer to first unused buffer location. + * + * \todo + * Modify this function to use \c ctx->pc instead of the explicit + * \c pc parameter. + */ +_X_HIDDEN GLubyte * +__glXFlushRenderBuffer(__GLXcontext * ctx, GLubyte * pc) +{ + Display *const dpy = ctx->currentDpy; +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); +#else + xGLXRenderReq *req; +#endif /* USE_XCB */ + const GLint size = pc - ctx->buf; + + if ((dpy != NULL) && (size > 0)) { +#ifdef USE_XCB + xcb_glx_render(c, ctx->currentContextTag, size, + (const uint8_t *) ctx->buf); +#else + /* Send the entire buffer as an X request */ + LockDisplay(dpy); + GetReq(GLXRender, req); + req->reqType = ctx->majorOpcode; + req->glxCode = X_GLXRender; + req->contextTag = ctx->currentContextTag; + req->length += (size + 3) >> 2; + _XSend(dpy, (char *) ctx->buf, size); + UnlockDisplay(dpy); + SyncHandle(); +#endif + } + + /* Reset pointer and return it */ + ctx->pc = ctx->buf; + return ctx->pc; +} + + +/** + * Send a portion of a GLXRenderLarge command to the server. The advantage of + * this function over \c __glXSendLargeCommand is that callers can use the + * data buffer in the GLX context and may be able to avoid allocating an + * extra buffer. The disadvantage is the clients will have to do more + * GLX protocol work (i.e., calculating \c totalRequests, etc.). + * + * \sa __glXSendLargeCommand + * + * \param gc GLX context + * \param requestNumber Which part of the whole command is this? The first + * request is 1. + * \param totalRequests How many requests will there be? + * \param data Command data. + * \param dataLen Size, in bytes, of the command data. + */ +_X_HIDDEN void +__glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, + GLint totalRequests, const GLvoid * data, GLint dataLen) +{ + Display *dpy = gc->currentDpy; +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_render_large(c, gc->currentContextTag, requestNumber, + totalRequests, dataLen, data); +#else + xGLXRenderLargeReq *req; + + if (requestNumber == 1) { + LockDisplay(dpy); + } + + GetReq(GLXRenderLarge, req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXRenderLarge; + req->contextTag = gc->currentContextTag; + req->length += (dataLen + 3) >> 2; + req->requestNumber = requestNumber; + req->requestTotal = totalRequests; + req->dataBytes = dataLen; + Data(dpy, data, dataLen); + + if (requestNumber == totalRequests) { + UnlockDisplay(dpy); + SyncHandle(); + } +#endif /* USE_XCB */ +} + + +/** + * Send a command that is too large for the GLXRender protocol request. + * + * Send a large command, one that is too large for some reason to + * send using the GLXRender protocol request. One reason to send + * a large command is to avoid copying the data. + * + * \param ctx GLX context + * \param header Header data. + * \param headerLen Size, in bytes, of the header data. It is assumed that + * the header data will always be small enough to fit in + * a single X protocol packet. + * \param data Command data. + * \param dataLen Size, in bytes, of the command data. + */ +_X_HIDDEN void +__glXSendLargeCommand(__GLXcontext * ctx, + const GLvoid * header, GLint headerLen, + const GLvoid * data, GLint dataLen) +{ + GLint maxSize; + GLint totalRequests, requestNumber; + + /* + ** Calculate the maximum amount of data can be stuffed into a single + ** packet. sz_xGLXRenderReq is added because bufSize is the maximum + ** packet size minus sz_xGLXRenderReq. + */ + maxSize = (ctx->bufSize + sz_xGLXRenderReq) - sz_xGLXRenderLargeReq; + totalRequests = 1 + (dataLen / maxSize); + if (dataLen % maxSize) + totalRequests++; + + /* + ** Send all of the command, except the large array, as one request. + */ + assert(headerLen <= maxSize); + __glXSendLargeChunk(ctx, 1, totalRequests, header, headerLen); + + /* + ** Send enough requests until the whole array is sent. + */ + for (requestNumber = 2; requestNumber <= (totalRequests - 1); + requestNumber++) { + __glXSendLargeChunk(ctx, requestNumber, totalRequests, data, maxSize); + data = (const GLvoid *) (((const GLubyte *) data) + maxSize); + dataLen -= maxSize; + assert(dataLen > 0); + } + + assert(dataLen <= maxSize); + __glXSendLargeChunk(ctx, requestNumber, totalRequests, data, dataLen); +} + +/************************************************************************/ + +#ifdef DEBUG +_X_HIDDEN void +__glXDumpDrawBuffer(__GLXcontext * ctx) +{ + GLubyte *p = ctx->buf; + GLubyte *end = ctx->pc; + GLushort opcode, length; + + while (p < end) { + /* Fetch opcode */ + opcode = *((GLushort *) p); + length = *((GLushort *) (p + 2)); + printf("%2x: %5d: ", opcode, length); + length -= 4; + p += 4; + while (length > 0) { + printf("%08x ", *((unsigned *) p)); + p += 4; + length -= 4; + } + printf("\n"); + } +} +#endif + +#ifdef USE_SPARC_ASM +/* + * This is where our dispatch table's bounds are. + * And the static mesa_init is taken directly from + * Mesa's 'sparc.c' initializer. + * + * We need something like this here, because this version + * of openGL/glx never initializes a Mesa context, and so + * the address of the dispatch table pointer never gets stuffed + * into the dispatch jump table otherwise. + * + * It matters only on SPARC, and only if you are using assembler + * code instead of C-code indirect dispatch. + * + * -- FEM, 04.xii.03 + */ +extern unsigned int _mesa_sparc_glapi_begin; +extern unsigned int _mesa_sparc_glapi_end; +extern void __glapi_sparc_icache_flush(unsigned int *); + +static void +_glx_mesa_init_sparc_glapi_relocs(void) +{ + unsigned int *insn_ptr, *end_ptr; + unsigned long disp_addr; + + insn_ptr = &_mesa_sparc_glapi_begin; + end_ptr = &_mesa_sparc_glapi_end; + disp_addr = (unsigned long) &_glapi_Dispatch; + + /* + * Verbatim from Mesa sparc.c. It's needed because there doesn't + * seem to be a better way to do this: + * + * UNCONDITIONAL_JUMP ( (*_glapi_Dispatch) + entry_offset ) + * + * This code is patching in the ADDRESS of the pointer to the + * dispatch table. Hence, it must be called exactly once, because + * that address is not going to change. + * + * What it points to can change, but Mesa (and hence, we) assume + * that there is only one pointer. + * + */ + while (insn_ptr < end_ptr) { +#if ( defined(__sparc_v9__) && ( !defined(__linux__) || defined(__linux_64__) ) ) +/* + This code patches for 64-bit addresses. This had better + not happen for Sparc/Linux, no matter what architecture we + are building for. So, don't do this. + + The 'defined(__linux_64__)' is used here as a placeholder for + when we do do 64-bit usermode on sparc linux. + */ + insn_ptr[0] |= (disp_addr >> (32 + 10)); + insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10); + __glapi_sparc_icache_flush(&insn_ptr[0]); + insn_ptr[2] |= ((disp_addr >> 32) & ((1 << 10) - 1)); + insn_ptr[3] |= (disp_addr & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&insn_ptr[2]); + insn_ptr += 11; +#else + insn_ptr[0] |= (disp_addr >> 10); + insn_ptr[1] |= (disp_addr & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&insn_ptr[0]); + insn_ptr += 5; +#endif + } +} +#endif /* sparc ASM in use */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.c xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.c --- xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,711 @@ +/* + * (C) Copyright IBM Corporation 2002, 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glxextensions.c + * + * \author Ian Romanick + */ + +#include "glxclient.h" +#include +#include +#include +#include "glapi.h" +#include "glxextensions.h" + + +#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8))) +#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8))) +#define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0) +#define CONCAT(a,b) a ## b +#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit) +#define GL(n) "GL_" # n, 3 + sizeof( # n ) - 1, GL_ ## n ## _bit +#define VER(a,b) a, b +#define Y 1 +#define N 0 +#define EXT_ENABLED(bit,supported) (IS_SET( supported, bit )) + + +struct extension_info +{ + const char *const name; + unsigned name_len; + + unsigned char bit; + + /* This is the lowest version of GLX that "requires" this extension. + * For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and + * SGI_make_current_read. If the extension is not required by any known + * version of GLX, use 0, 0. + */ + unsigned char version_major; + unsigned char version_minor; + unsigned char client_support; + unsigned char direct_support; + unsigned char client_only; /** Is the extension client-side only? */ + unsigned char direct_only; /** Is the extension for direct + * contexts only? + */ +}; + +/* *INDENT-OFF* */ +static const struct extension_info known_glx_extensions[] = { + { GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N }, + { GLX(ARB_multisample), VER(1,4), Y, Y, N, N }, + { GLX(ARB_render_texture), VER(0,0), N, N, N, N }, + { GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N }, + { GLX(EXT_import_context), VER(0,0), Y, Y, N, N }, + { GLX(EXT_visual_info), VER(0,0), Y, Y, N, N }, + { GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N }, + { GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */ + { GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y }, + { GLX(MESA_copy_sub_buffer), VER(0,0), Y, N, N, N }, + { GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */ + { GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */ + { GLX(MESA_swap_control), VER(0,0), Y, N, N, Y }, + { GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y }, + { GLX(NV_float_buffer), VER(0,0), N, N, N, N }, + { GLX(NV_render_depth_texture), VER(0,0), N, N, N, N }, + { GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N }, + { GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */ + { GLX(OML_swap_method), VER(0,0), Y, Y, N, N }, + { GLX(OML_sync_control), VER(0,0), Y, N, N, Y }, + { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N }, + { GLX(SGI_swap_control), VER(0,0), Y, N, N, N }, + { GLX(SGI_video_sync), VER(0,0), Y, N, N, Y }, + { GLX(SGIS_blended_overlay), VER(0,0), N, N, N, N }, + { GLX(SGIS_color_range), VER(0,0), N, N, N, N }, + { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N }, + { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N }, + { GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N }, + { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N }, + { GLX(SGIX_swap_group), VER(0,0), N, N, N, N }, + { GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N }, + { GLX(EXT_texture_from_pixmap), VER(0,0), Y, N, N, N }, + { NULL } +}; + +static const struct extension_info known_gl_extensions[] = { + { GL(ARB_depth_texture), VER(1,4), Y, N, N, N }, + { GL(ARB_draw_buffers), VER(0,0), Y, N, N, N }, + { GL(ARB_fragment_program), VER(0,0), Y, N, N, N }, + { GL(ARB_fragment_program_shadow), VER(0,0), Y, N, N, N }, + { GL(ARB_imaging), VER(0,0), Y, N, N, N }, + { GL(ARB_multisample), VER(1,3), Y, N, N, N }, + { GL(ARB_multitexture), VER(1,3), Y, N, N, N }, + { GL(ARB_occlusion_query), VER(1,5), Y, N, N, N }, + { GL(ARB_point_parameters), VER(1,4), Y, N, N, N }, + { GL(ARB_point_sprite), VER(0,0), Y, N, N, N }, + { GL(ARB_shadow), VER(1,4), Y, N, N, N }, + { GL(ARB_shadow_ambient), VER(0,0), Y, N, N, N }, + { GL(ARB_texture_border_clamp), VER(1,3), Y, N, N, N }, + { GL(ARB_texture_compression), VER(1,3), Y, N, N, N }, + { GL(ARB_texture_cube_map), VER(1,3), Y, N, N, N }, + { GL(ARB_texture_env_add), VER(1,3), Y, N, N, N }, + { GL(ARB_texture_env_combine), VER(1,3), Y, N, N, N }, + { GL(ARB_texture_env_crossbar), VER(1,4), Y, N, N, N }, + { GL(ARB_texture_env_dot3), VER(1,3), Y, N, N, N }, + { GL(ARB_texture_mirrored_repeat), VER(1,4), Y, N, N, N }, + { GL(ARB_texture_non_power_of_two), VER(1,5), Y, N, N, N }, + { GL(ARB_texture_rectangle), VER(0,0), Y, N, N, N }, + { GL(ARB_transpose_matrix), VER(1,3), Y, N, Y, N }, + { GL(ARB_vertex_buffer_object), VER(1,5), N, N, N, N }, + { GL(ARB_vertex_program), VER(0,0), Y, N, N, N }, + { GL(ARB_window_pos), VER(1,4), Y, N, N, N }, + { GL(EXT_abgr), VER(0,0), Y, N, N, N }, + { GL(EXT_bgra), VER(1,2), Y, N, N, N }, + { GL(EXT_blend_color), VER(1,4), Y, N, N, N }, + { GL(EXT_blend_equation_separate), VER(0,0), Y, N, N, N }, + { GL(EXT_blend_func_separate), VER(1,4), Y, N, N, N }, + { GL(EXT_blend_logic_op), VER(1,4), Y, N, N, N }, + { GL(EXT_blend_minmax), VER(1,4), Y, N, N, N }, + { GL(EXT_blend_subtract), VER(1,4), Y, N, N, N }, + { GL(EXT_clip_volume_hint), VER(0,0), Y, N, N, N }, + { GL(EXT_compiled_vertex_array), VER(0,0), N, N, N, N }, + { GL(EXT_convolution), VER(0,0), N, N, N, N }, + { GL(EXT_copy_texture), VER(1,1), Y, N, N, N }, + { GL(EXT_cull_vertex), VER(0,0), N, N, N, N }, + { GL(EXT_depth_bounds_test), VER(0,0), N, N, N, N }, + { GL(EXT_draw_range_elements), VER(1,2), Y, N, Y, N }, + { GL(EXT_fog_coord), VER(1,4), Y, N, N, N }, + { GL(EXT_framebuffer_object), VER(0,0), Y, N, N, N }, + { GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N }, + { GL(EXT_packed_pixels), VER(1,2), Y, N, N, N }, + { GL(EXT_paletted_texture), VER(0,0), Y, N, N, N }, + { GL(EXT_pixel_buffer_object), VER(0,0), N, N, N, N }, + { GL(EXT_point_parameters), VER(1,4), Y, N, N, N }, + { GL(EXT_polygon_offset), VER(1,1), Y, N, N, N }, + { GL(EXT_rescale_normal), VER(1,2), Y, N, N, N }, + { GL(EXT_secondary_color), VER(1,4), Y, N, N, N }, + { GL(EXT_separate_specular_color), VER(1,2), Y, N, N, N }, + { GL(EXT_shadow_funcs), VER(1,5), Y, N, N, N }, + { GL(EXT_shared_texture_palette), VER(0,0), Y, N, N, N }, + { GL(EXT_stencil_two_side), VER(0,0), Y, N, N, N }, + { GL(EXT_stencil_wrap), VER(1,4), Y, N, N, N }, + { GL(EXT_subtexture), VER(1,1), Y, N, N, N }, + { GL(EXT_texture), VER(1,1), Y, N, N, N }, + { GL(EXT_texture3D), VER(1,2), Y, N, N, N }, + { GL(EXT_texture_compression_dxt1), VER(0,0), Y, N, N, N }, + { GL(EXT_texture_compression_s3tc), VER(0,0), Y, N, N, N }, + { GL(EXT_texture_edge_clamp), VER(1,2), Y, N, N, N }, + { GL(EXT_texture_env_add), VER(1,3), Y, N, N, N }, + { GL(EXT_texture_env_combine), VER(1,3), Y, N, N, N }, + { GL(EXT_texture_env_dot3), VER(0,0), Y, N, N, N }, + { GL(EXT_texture_filter_anisotropic), VER(0,0), Y, N, N, N }, + { GL(EXT_texture_lod), VER(1,2), Y, N, N, N }, + { GL(EXT_texture_lod_bias), VER(1,4), Y, N, N, N }, + { GL(EXT_texture_mirror_clamp), VER(0,0), Y, N, N, N }, + { GL(EXT_texture_object), VER(1,1), Y, N, N, N }, + { GL(EXT_texture_rectangle), VER(0,0), Y, N, N, N }, + { GL(EXT_vertex_array), VER(0,0), Y, N, N, N }, + { GL(3DFX_texture_compression_FXT1), VER(0,0), Y, N, N, N }, + { GL(APPLE_packed_pixels), VER(1,2), Y, N, N, N }, + { GL(APPLE_ycbcr_422), VER(0,0), Y, N, N, N }, + { GL(ATI_draw_buffers), VER(0,0), Y, N, N, N }, + { GL(ATI_text_fragment_shader), VER(0,0), Y, N, N, N }, + { GL(ATI_texture_env_combine3), VER(0,0), Y, N, N, N }, + { GL(ATI_texture_float), VER(0,0), Y, N, N, N }, + { GL(ATI_texture_mirror_once), VER(0,0), Y, N, N, N }, + { GL(ATIX_texture_env_combine3), VER(0,0), Y, N, N, N }, + { GL(HP_convolution_border_modes), VER(0,0), Y, N, N, N }, + { GL(HP_occlusion_test), VER(0,0), Y, N, N, N }, + { GL(IBM_cull_vertex), VER(0,0), Y, N, N, N }, + { GL(IBM_pixel_filter_hint), VER(0,0), Y, N, N, N }, + { GL(IBM_rasterpos_clip), VER(0,0), Y, N, N, N }, + { GL(IBM_texture_clamp_nodraw), VER(0,0), Y, N, N, N }, + { GL(IBM_texture_mirrored_repeat), VER(0,0), Y, N, N, N }, + { GL(INGR_blend_func_separate), VER(0,0), Y, N, N, N }, + { GL(INGR_interlace_read), VER(0,0), Y, N, N, N }, + { GL(MESA_pack_invert), VER(0,0), Y, N, N, N }, + { GL(MESA_ycbcr_texture), VER(0,0), Y, N, N, N }, + { GL(NV_blend_square), VER(1,4), Y, N, N, N }, + { GL(NV_copy_depth_to_color), VER(0,0), Y, N, N, N }, + { GL(NV_depth_clamp), VER(0,0), Y, N, N, N }, + { GL(NV_fog_distance), VER(0,0), Y, N, N, N }, + { GL(NV_fragment_program), VER(0,0), Y, N, N, N }, + { GL(NV_fragment_program_option), VER(0,0), Y, N, N, N }, + { GL(NV_fragment_program2), VER(0,0), Y, N, N, N }, + { GL(NV_light_max_exponent), VER(0,0), Y, N, N, N }, + { GL(NV_multisample_filter_hint), VER(0,0), Y, N, N, N }, + { GL(NV_point_sprite), VER(0,0), Y, N, N, N }, + { GL(NV_texgen_reflection), VER(0,0), Y, N, N, N }, + { GL(NV_texture_compression_vtc), VER(0,0), Y, N, N, N }, + { GL(NV_texture_env_combine4), VER(0,0), Y, N, N, N }, + { GL(NV_texture_rectangle), VER(0,0), Y, N, N, N }, + { GL(NV_vertex_program), VER(0,0), Y, N, N, N }, + { GL(NV_vertex_program1_1), VER(0,0), Y, N, N, N }, + { GL(NV_vertex_program2), VER(0,0), Y, N, N, N }, + { GL(NV_vertex_program2_option), VER(0,0), Y, N, N, N }, + { GL(NV_vertex_program3), VER(0,0), Y, N, N, N }, + { GL(OES_read_format), VER(0,0), Y, N, N, N }, + { GL(OES_compressed_paletted_texture),VER(0,0), Y, N, N, N }, + { GL(SGI_color_matrix), VER(0,0), Y, N, N, N }, + { GL(SGI_color_table), VER(0,0), Y, N, N, N }, + { GL(SGI_texture_color_table), VER(0,0), Y, N, N, N }, + { GL(SGIS_generate_mipmap), VER(1,4), Y, N, N, N }, + { GL(SGIS_multisample), VER(0,0), Y, N, N, N }, + { GL(SGIS_texture_border_clamp), VER(1,3), Y, N, N, N }, + { GL(SGIS_texture_edge_clamp), VER(1,2), Y, N, N, N }, + { GL(SGIS_texture_lod), VER(1,2), Y, N, N, N }, + { GL(SGIX_blend_alpha_minmax), VER(0,0), Y, N, N, N }, + { GL(SGIX_clipmap), VER(0,0), Y, N, N, N }, + { GL(SGIX_depth_texture), VER(0,0), Y, N, N, N }, + { GL(SGIX_fog_offset), VER(0,0), Y, N, N, N }, + { GL(SGIX_shadow), VER(0,0), Y, N, N, N }, + { GL(SGIX_shadow_ambient), VER(0,0), Y, N, N, N }, + { GL(SGIX_texture_coordinate_clamp), VER(0,0), Y, N, N, N }, + { GL(SGIX_texture_lod_bias), VER(0,0), Y, N, N, N }, + { GL(SGIX_texture_range), VER(0,0), Y, N, N, N }, + { GL(SGIX_texture_scale_bias), VER(0,0), Y, N, N, N }, + { GL(SGIX_vertex_preclip), VER(0,0), Y, N, N, N }, + { GL(SGIX_vertex_preclip_hint), VER(0,0), Y, N, N, N }, + { GL(SGIX_ycrcb), VER(0,0), Y, N, N, N }, + { GL(SUN_convolution_border_modes), VER(0,0), Y, N, N, N }, + { GL(SUN_multi_draw_arrays), VER(0,0), Y, N, Y, N }, + { GL(SUN_slice_accum), VER(0,0), Y, N, N, N }, + { NULL } +}; +/* *INDENT-ON* */ + + +/* global bit-fields of available extensions and their characteristics */ +static unsigned char client_glx_support[8]; +static unsigned char client_glx_only[8]; +static unsigned char direct_glx_only[8]; +static unsigned char client_gl_support[__GL_EXT_BYTES]; +static unsigned char client_gl_only[__GL_EXT_BYTES]; + +/** + * Bits representing the set of extensions that are enabled by default in all + * direct rendering drivers. + */ +static unsigned char direct_glx_support[8]; + +/** + * Highest core GL version that can be supported for indirect rendering. + */ +static const unsigned gl_major = 1; +static const unsigned gl_minor = 4; + +/* client extensions string */ +static const char *__glXGLXClientExtensions = NULL; + +static void __glXExtensionsCtr(void); +static void __glXExtensionsCtrScreen(__GLXscreenConfigs * psc); +static void __glXProcessServerString(const struct extension_info *ext, + const char *server_string, + unsigned char *server_support); + +/** + * Set the state of a GLX extension. + * + * \param name Name of the extension. + * \param name_len Length, in characters, of the extension name. + * \param state New state (either enabled or disabled) of the extension. + * \param supported Table in which the state of the extension is to be set. + */ +static void +set_glx_extension(const struct extension_info *ext, + const char *name, unsigned name_len, GLboolean state, + unsigned char *supported) +{ + unsigned i; + + + for (i = 0; ext[i].name != NULL; i++) { + if ((name_len == ext[i].name_len) + && (strncmp(ext[i].name, name, name_len) == 0)) { + if (state) { + SET_BIT(supported, ext[i].bit); + } + else { + CLR_BIT(supported, ext[i].bit); + } + + return; + } + } +} + + +#define NUL '\0' +#define SEPARATOR ' ' + +/** + * Convert the server's extension string to a bit-field. + * + * \param server_string GLX extension string from the server. + * \param server_support Bit-field of supported extensions. + * + * \note + * This function is used to process both GLX and GL extension strings. The + * bit-fields used to track each of these have different sizes. Therefore, + * the data pointed by \c server_support must be preinitialized to zero. + */ +static void +__glXProcessServerString(const struct extension_info *ext, + const char *server_string, + unsigned char *server_support) +{ + unsigned base; + unsigned len; + + for (base = 0; server_string[base] != NUL; /* empty */ ) { + /* Determine the length of the next extension name. + */ + for (len = 0; (server_string[base + len] != SEPARATOR) + && (server_string[base + len] != NUL); + len++) { + /* empty */ + } + + /* Set the bit for the extension in the server_support table. + */ + set_glx_extension(ext, &server_string[base], len, GL_TRUE, + server_support); + + + /* Advance to the next extension string. This means that we skip + * over the previous string and any trialing white-space. + */ + for (base += len; (server_string[base] == SEPARATOR) + && (server_string[base] != NUL); + base++) { + /* empty */ + } + } +} + +void +__glXEnableDirectExtension(__GLXscreenConfigs * psc, const char *name) +{ + __glXExtensionsCtr(); + __glXExtensionsCtrScreen(psc); + + set_glx_extension(known_glx_extensions, + name, strlen(name), GL_TRUE, psc->direct_support); +} + +/** + * Initialize global extension support tables. + */ + +static void +__glXExtensionsCtr(void) +{ + unsigned i; + static GLboolean ext_list_first_time = GL_TRUE; + + + if (ext_list_first_time) { + ext_list_first_time = GL_FALSE; + + (void) memset(client_glx_support, 0, sizeof(client_glx_support)); + (void) memset(direct_glx_support, 0, sizeof(direct_glx_support)); + (void) memset(client_glx_only, 0, sizeof(client_glx_only)); + (void) memset(direct_glx_only, 0, sizeof(direct_glx_only)); + + (void) memset(client_gl_support, 0, sizeof(client_gl_support)); + (void) memset(client_gl_only, 0, sizeof(client_gl_only)); + + for (i = 0; known_glx_extensions[i].name != NULL; i++) { + const unsigned bit = known_glx_extensions[i].bit; + + if (known_glx_extensions[i].client_support) { + SET_BIT(client_glx_support, bit); + } + + if (known_glx_extensions[i].direct_support) { + SET_BIT(direct_glx_support, bit); + } + + if (known_glx_extensions[i].client_only) { + SET_BIT(client_glx_only, bit); + } + + if (known_glx_extensions[i].direct_only) { + SET_BIT(direct_glx_only, bit); + } + } + + for (i = 0; known_gl_extensions[i].name != NULL; i++) { + const unsigned bit = known_gl_extensions[i].bit; + + if (known_gl_extensions[i].client_support) { + SET_BIT(client_gl_support, bit); + } + + if (known_gl_extensions[i].client_only) { + SET_BIT(client_gl_only, bit); + } + } + +#if 0 + fprintf(stderr, "[%s:%u] Maximum client library version: %u.%u\n", + __func__, __LINE__, gl_major, gl_minor); +#endif + } +} + + +/** + * Make sure that per-screen direct-support table is initialized. + * + * \param psc Pointer to GLX per-screen record. + */ + +static void +__glXExtensionsCtrScreen(__GLXscreenConfigs * psc) +{ + if (psc->ext_list_first_time) { + psc->ext_list_first_time = GL_FALSE; + (void) memcpy(psc->direct_support, direct_glx_support, + sizeof(direct_glx_support)); + } +} + + +/** + * Check if a certain extension is enabled on a given screen. + * + * \param psc Pointer to GLX per-screen record. + * \param bit Bit index in the direct-support table. + * \returns If the extension bit is enabled for the screen, \c GL_TRUE is + * returned. If the extension bit is not enabled or if \c psc is + * \c NULL, then \c GL_FALSE is returned. + */ +GLboolean +__glXExtensionBitIsEnabled(__GLXscreenConfigs * psc, unsigned bit) +{ + GLboolean enabled = GL_FALSE; + + if (psc != NULL) { + __glXExtensionsCtr(); + __glXExtensionsCtrScreen(psc); + enabled = EXT_ENABLED(bit, psc->direct_support); + } + + return enabled; +} + + +/** + * Check if a certain extension is enabled in a given context. + * + */ +GLboolean +__glExtensionBitIsEnabled(const __GLXcontext * gc, unsigned bit) +{ + GLboolean enabled = GL_FALSE; + + if (gc != NULL) { + enabled = EXT_ENABLED(bit, gc->gl_extension_bits); + } + + return enabled; +} + + + +/** + * Convert a bit-field to a string of supported extensions. + */ +static char * +__glXGetStringFromTable(const struct extension_info *ext, + const unsigned char *supported) +{ + unsigned i; + unsigned ext_str_len; + char *ext_str; + char *point; + + + ext_str_len = 0; + for (i = 0; ext[i].name != NULL; i++) { + if (EXT_ENABLED(ext[i].bit, supported)) { + ext_str_len += ext[i].name_len + 1; + } + } + + ext_str = Xmalloc(ext_str_len + 1); + if (ext_str != NULL) { + point = ext_str; + + for (i = 0; ext[i].name != NULL; i++) { + if (EXT_ENABLED(ext[i].bit, supported)) { + (void) memcpy(point, ext[i].name, ext[i].name_len); + point += ext[i].name_len; + + *point = ' '; + point++; + } + } + + *point = '\0'; + } + + return ext_str; +} + + +/** + * Get the string of client library supported extensions. + */ +const char * +__glXGetClientExtensions(void) +{ + if (__glXGLXClientExtensions == NULL) { + __glXExtensionsCtr(); + __glXGLXClientExtensions = __glXGetStringFromTable(known_glx_extensions, + client_glx_support); + } + + return __glXGLXClientExtensions; +} + + +/** + * Calculate the list of application usable extensions. The resulting + * string is stored in \c psc->effectiveGLXexts. + * + * \param psc Pointer to GLX per-screen record. + * \param display_is_direct_capable True if the display is capable of + * direct rendering. + * \param minor_version GLX minor version from the server. + */ + +void +__glXCalculateUsableExtensions(__GLXscreenConfigs * psc, + GLboolean display_is_direct_capable, + int minor_version) +{ + unsigned char server_support[8]; + unsigned char usable[8]; + unsigned i; + + __glXExtensionsCtr(); + __glXExtensionsCtrScreen(psc); + + (void) memset(server_support, 0, sizeof(server_support)); + __glXProcessServerString(known_glx_extensions, + psc->serverGLXexts, server_support); + + + /* This is a hack. Some servers support GLX 1.3 but don't export + * all of the extensions implied by GLX 1.3. If the server claims + * support for GLX 1.3, enable support for the extensions that can be + * "emulated" as well. + */ + + if (minor_version >= 3) { + SET_BIT(server_support, EXT_visual_info_bit); + SET_BIT(server_support, EXT_visual_rating_bit); + SET_BIT(server_support, SGI_make_current_read_bit); + SET_BIT(server_support, SGIX_fbconfig_bit); + SET_BIT(server_support, SGIX_pbuffer_bit); + + /* This one is a little iffy. GLX 1.3 doesn't incorporate all of this + * extension. However, the only part that is not strictly client-side + * is shared. That's the glXQueryContext / glXQueryContextInfoEXT + * function. + */ + + SET_BIT(server_support, EXT_import_context_bit); + } + + + /* An extension is supported if the client-side (i.e., libGL) supports + * it and the "server" supports it. In this case that means that either + * the true server supports it or it is only for direct-rendering and + * the direct rendering driver supports it. + * + * If the display is not capable of direct rendering, then the extension + * is enabled if and only if the client-side library and the server + * support it. + */ + + if (display_is_direct_capable) { + for (i = 0; i < 8; i++) { + usable[i] = (client_glx_support[i] & client_glx_only[i]) + | (client_glx_support[i] & psc-> + direct_support[i] & server_support[i]) + | (client_glx_support[i] & psc-> + direct_support[i] & direct_glx_only[i]); + } + } + else { + for (i = 0; i < 8; i++) { + usable[i] = (client_glx_support[i] & client_glx_only[i]) + | (client_glx_support[i] & server_support[i]); + } + } + + psc->effectiveGLXexts = __glXGetStringFromTable(known_glx_extensions, + usable); +} + + +/** + * Calculate the list of application usable extensions. The resulting + * string is stored in \c gc->extensions. + * + * \param gc Pointer to GLX context. + * \param server_string Extension string from the server. + * \param major_version GL major version from the server. + * \param minor_version GL minor version from the server. + */ + +void +__glXCalculateUsableGLExtensions(__GLXcontext * gc, + const char *server_string, + int major_version, int minor_version) +{ + unsigned char server_support[__GL_EXT_BYTES]; + unsigned char usable[__GL_EXT_BYTES]; + unsigned i; + + + __glXExtensionsCtr(); + + (void) memset(server_support, 0, sizeof(server_support)); + __glXProcessServerString(known_gl_extensions, server_string, + server_support); + + + /* Handle lazy servers that don't export all the extensions strings that + * are part of the GL core version that they support. + */ + + for (i = 0; i < __GL_EXT_BYTES; i++) { + if ((known_gl_extensions[i].version_major != 0) + && ((major_version > known_gl_extensions[i].version_major) + || ((major_version == known_gl_extensions[i].version_major) + && (minor_version >= + known_gl_extensions[i].version_minor)))) { + SET_BIT(server_support, known_gl_extensions[i].bit); + } + } + + + /* An extension is supported if the client-side (i.e., libGL) supports + * it and the server supports it or the client-side library supports it + * and it only needs client-side support. + */ + + for (i = 0; i < __GL_EXT_BYTES; i++) { + usable[i] = (client_gl_support[i] & client_gl_only[i]) + | (client_gl_support[i] & server_support[i]); + } + + gc->extensions = (unsigned char *) + __glXGetStringFromTable(known_gl_extensions, usable); + (void) memcpy(gc->gl_extension_bits, usable, sizeof(usable)); +} + + +/** + * Calculates the maximum core GL version that can be supported for indirect + * rendering. + */ +void +__glXGetGLVersion(int *major_version, int *minor_version) +{ + __glXExtensionsCtr(); + *major_version = gl_major; + *minor_version = gl_minor; +} + + +/** + * Get a string representing the set of extensions supported by the client + * library. This is currently only used to send the list of extensions + * supported by the client to the server. + */ +char * +__glXGetClientGLExtensionString(void) +{ + __glXExtensionsCtr(); + return __glXGetStringFromTable(known_gl_extensions, client_gl_support); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.h xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.h --- xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxextensions.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,286 @@ +/* + * (C) Copyright IBM Corporation 2002, 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glxextensions.h + * + * \author Ian Romanick + */ + +#ifndef GLX_GLXEXTENSIONS_H +#define GLX_GLXEXTENSIONS_H + +enum +{ + ARB_get_proc_address_bit = 0, + ARB_multisample_bit, + ARB_render_texture_bit, + ATI_pixel_format_float_bit, + EXT_visual_info_bit, + EXT_visual_rating_bit, + EXT_import_context_bit, + MESA_agp_offset_bit, + MESA_allocate_memory_bit, /* Replaces MESA_agp_offset & NV_vertex_array_range */ + MESA_copy_sub_buffer_bit, + MESA_depth_float_bit, + MESA_pixmap_colormap_bit, + MESA_release_buffers_bit, + MESA_swap_control_bit, + MESA_swap_frame_usage_bit, + NV_float_buffer_bit, + NV_render_depth_texture_bit, + NV_render_texture_rectangle_bit, + NV_vertex_array_range_bit, + OML_swap_method_bit, + OML_sync_control_bit, + SGI_make_current_read_bit, + SGI_swap_control_bit, + SGI_video_sync_bit, + SGIS_blended_overlay_bit, + SGIS_color_range_bit, + SGIS_multisample_bit, + SGIX_fbconfig_bit, + SGIX_pbuffer_bit, + SGIX_swap_barrier_bit, + SGIX_swap_group_bit, + SGIX_visual_select_group_bit, + EXT_texture_from_pixmap_bit +}; + +enum +{ + GL_ARB_depth_texture_bit = 0, + GL_ARB_draw_buffers_bit, + GL_ARB_fragment_program_bit, + GL_ARB_fragment_program_shadow_bit, + GL_ARB_imaging_bit, + GL_ARB_multisample_bit, + GL_ARB_multitexture_bit, + GL_ARB_occlusion_query_bit, + GL_ARB_point_parameters_bit, + GL_ARB_point_sprite_bit, + GL_ARB_shadow_bit, + GL_ARB_shadow_ambient_bit, + GL_ARB_texture_border_clamp_bit, + GL_ARB_texture_cube_map_bit, + GL_ARB_texture_compression_bit, + GL_ARB_texture_env_add_bit, + GL_ARB_texture_env_combine_bit, + GL_ARB_texture_env_crossbar_bit, + GL_ARB_texture_env_dot3_bit, + GL_ARB_texture_mirrored_repeat_bit, + GL_ARB_texture_non_power_of_two_bit, + GL_ARB_texture_rectangle_bit, + GL_ARB_transpose_matrix_bit, + GL_ARB_vertex_buffer_object_bit, + GL_ARB_vertex_program_bit, + GL_ARB_window_pos_bit, + GL_EXT_abgr_bit, + GL_EXT_bgra_bit, + GL_EXT_blend_color_bit, + GL_EXT_blend_equation_separate_bit, + GL_EXT_blend_func_separate_bit, + GL_EXT_blend_logic_op_bit, + GL_EXT_blend_minmax_bit, + GL_EXT_blend_subtract_bit, + GL_EXT_clip_volume_hint_bit, + GL_EXT_compiled_vertex_array_bit, + GL_EXT_convolution_bit, + GL_EXT_copy_texture_bit, + GL_EXT_cull_vertex_bit, + GL_EXT_depth_bounds_test_bit, + GL_EXT_draw_range_elements_bit, + GL_EXT_fog_coord_bit, + GL_EXT_framebuffer_object_bit, + GL_EXT_multi_draw_arrays_bit, + GL_EXT_packed_pixels_bit, + GL_EXT_paletted_texture_bit, + GL_EXT_pixel_buffer_object_bit, + GL_EXT_polygon_offset_bit, + GL_EXT_rescale_normal_bit, + GL_EXT_secondary_color_bit, + GL_EXT_separate_specular_color_bit, + GL_EXT_shadow_funcs_bit, + GL_EXT_shared_texture_palette_bit, + GL_EXT_stencil_two_side_bit, + GL_EXT_stencil_wrap_bit, + GL_EXT_subtexture_bit, + GL_EXT_texture_bit, + GL_EXT_texture3D_bit, + GL_EXT_texture_compression_dxt1_bit, + GL_EXT_texture_compression_s3tc_bit, + GL_EXT_texture_edge_clamp_bit, + GL_EXT_texture_env_combine_bit, + GL_EXT_texture_env_dot3_bit, + GL_EXT_texture_filter_anisotropic_bit, + GL_EXT_texture_lod_bit, + GL_EXT_texture_lod_bias_bit, + GL_EXT_texture_mirror_clamp_bit, + GL_EXT_texture_object_bit, + GL_EXT_vertex_array_bit, + GL_3DFX_texture_compression_FXT1_bit, + GL_APPLE_packed_pixels_bit, + GL_APPLE_ycbcr_422_bit, + GL_ATI_text_fragment_shader_bit, + GL_ATI_texture_env_combine3_bit, + GL_ATI_texture_float_bit, + GL_ATI_texture_mirror_once_bit, + GL_HP_convolution_border_modes_bit, + GL_HP_occlusion_test_bit, + GL_IBM_cull_vertex_bit, + GL_IBM_pixel_filter_hint_bit, + GL_IBM_rasterpos_clip_bit, + GL_IBM_texture_clamp_nodraw_bit, + GL_INGR_interlace_read_bit, + GL_MESA_pack_invert_bit, + GL_MESA_ycbcr_texture_bit, + GL_NV_blend_square_bit, + GL_NV_copy_depth_to_color_bit, + GL_NV_depth_clamp_bit, + GL_NV_fog_distance_bit, + GL_NV_fragment_program_bit, + GL_NV_fragment_program_option_bit, + GL_NV_fragment_program2_bit, + GL_NV_light_max_exponent_bit, + GL_NV_multisample_filter_hint_bit, + GL_NV_point_sprite_bit, + GL_NV_texgen_reflection_bit, + GL_NV_texture_compression_vtc_bit, + GL_NV_texture_env_combine4_bit, + GL_NV_vertex_program_bit, + GL_NV_vertex_program1_1_bit, + GL_NV_vertex_program2_bit, + GL_NV_vertex_program2_option_bit, + GL_NV_vertex_program3_bit, + GL_OES_compressed_paletted_texture_bit, + GL_OES_read_format_bit, + GL_SGI_color_matrix_bit, + GL_SGI_color_table_bit, + GL_SGI_texture_color_table_bit, + GL_SGIS_generate_mipmap_bit, + GL_SGIS_multisample_bit, + GL_SGIS_texture_lod_bit, + GL_SGIX_blend_alpha_minmax_bit, + GL_SGIX_clipmap_bit, + GL_SGIX_depth_texture_bit, + GL_SGIX_fog_offset_bit, + GL_SGIX_shadow_bit, + GL_SGIX_texture_coordinate_clamp_bit, + GL_SGIX_texture_lod_bias_bit, + GL_SGIX_texture_range_bit, + GL_SGIX_texture_scale_bias_bit, + GL_SGIX_vertex_preclip_bit, + GL_SGIX_vertex_preclip_hint_bit, + GL_SGIX_ycrcb_bit, + GL_SUN_convolution_border_modes_bit, + GL_SUN_slice_accum_bit, + + /* This *MUST* go here. If it gets put after the duplicate values it will + * get the value after the last duplicate. + */ + __NUM_GL_EXTS, + + + /* Alias extension bits. These extensions exist in either vendor-specific + * or EXT form and were later promoted to either EXT or ARB form. In all + * cases, the meaning is *exactly* the same. That's why + * EXT_texture_env_combine is *NOT* an alias of ARB_texture_env_combine and + * EXT_texture_env_dot3 is *NOT* an alias of ARB_texture_env_dot3. Be + * careful! When in doubt, src/mesa/main/extensions.c in the Mesa tree + * is a great reference. + */ + + GL_ATI_blend_equation_separate_bit = GL_EXT_blend_equation_separate_bit, + GL_ATI_draw_buffers_bit = GL_ARB_draw_buffers_bit, + GL_ATIX_texture_env_combine3_bit = GL_ATI_texture_env_combine3_bit, + GL_EXT_point_parameters_bit = GL_ARB_point_parameters_bit, + GL_EXT_texture_env_add_bit = GL_ARB_texture_env_add_bit, + GL_EXT_texture_rectangle_bit = GL_ARB_texture_rectangle_bit, + GL_IBM_texture_mirrored_repeat_bit = GL_ARB_texture_mirrored_repeat_bit, + GL_INGR_blend_func_separate_bit = GL_EXT_blend_func_separate_bit, + GL_MESA_window_pos_bit = GL_ARB_window_pos_bit, + GL_NV_texture_rectangle_bit = GL_ARB_texture_rectangle_bit, + GL_SGIS_texture_border_clamp_bit = GL_ARB_texture_border_clamp_bit, + GL_SGIS_texture_edge_clamp_bit = GL_EXT_texture_edge_clamp_bit, + GL_SGIX_shadow_ambient_bit = GL_ARB_shadow_ambient_bit, + GL_SUN_multi_draw_arrays_bit = GL_EXT_multi_draw_arrays_bit +}; + +#define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8) + +struct __GLXscreenConfigsRec; +struct __GLXcontextRec; + +extern GLboolean __glXExtensionBitIsEnabled(struct __GLXscreenConfigsRec *psc, + unsigned bit); +extern const char *__glXGetClientExtensions(void); +extern void __glXCalculateUsableExtensions(struct __GLXscreenConfigsRec *psc, + GLboolean + display_is_direct_capable, + int server_minor_version); + +extern void __glXCalculateUsableGLExtensions(struct __GLXcontextRec *gc, + const char *server_string, + int major_version, + int minor_version); +extern void __glXGetGLVersion(int *major_version, int *minor_version); +extern char *__glXGetClientGLExtensionString(void); + +extern GLboolean __glExtensionBitIsEnabled(const struct __GLXcontextRec *gc, + unsigned bit); + +extern void +__glXEnableDirectExtension(struct __GLXscreenConfigsRec *psc, + const char *name); + +/* Source-level backwards compatibility with old drivers. They won't + * find the respective functions, though. + */ +typedef void (*PFNGLXENABLEEXTENSIONPROC) (const char *name, + GLboolean force_client); +typedef void (*PFNGLXDISABLEEXTENSIONPROC) (const char *name); + +/* GLX_ALIAS should be used for functions with a non-void return type. + GLX_ALIAS_VOID is for functions with a void return type. */ +#ifdef GLX_NO_STATIC_EXTENSION_FUNCTIONS +# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) +# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) +#else +# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED) +# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \ + return_type real_func proto_args \ + __attribute__ ((alias( # aliased_func ) )); +# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \ + GLX_ALIAS(void, real_func, proto_args, args, aliased_func) +# else +# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \ + return_type real_func proto_args \ + { return aliased_func args ; } +# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \ + void real_func proto_args \ + { aliased_func args ; } +# endif /* __GNUC__ */ +#endif /* GLX_NO_STATIC_EXTENSION_FUNCTIONS */ + +#endif /* GLX_GLXEXTENSIONS_H */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxhash.c xpsb-glx-0.19/mesa/src/glx/x11/glxhash.c --- xpsb-glx-0.19/mesa/src/glx/x11/glxhash.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxhash.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,461 @@ +/* glxhash.c -- Small hash table support for integer -> integer mapping + * Taken from libdrm. + * + * Created: Sun Apr 18 09:35:45 1999 by faith@precisioninsight.com + * + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: Rickard E. (Rik) Faith + * + * DESCRIPTION + * + * This file contains a straightforward implementation of a fixed-sized + * hash table using self-organizing linked lists [Knuth73, pp. 398-399] for + * collision resolution. There are two potentially interesting things + * about this implementation: + * + * 1) The table is power-of-two sized. Prime sized tables are more + * traditional, but do not have a significant advantage over power-of-two + * sized table, especially when double hashing is not used for collision + * resolution. + * + * 2) The hash computation uses a table of random integers [Hanson97, + * pp. 39-41]. + * + * FUTURE ENHANCEMENTS + * + * With a table size of 512, the current implementation is sufficient for a + * few hundred keys. Since this is well above the expected size of the + * tables for which this implementation was designed, the implementation of + * dynamic hash tables was postponed until the need arises. A common (and + * naive) approach to dynamic hash table implementation simply creates a + * new hash table when necessary, rehashes all the data into the new table, + * and destroys the old table. The approach in [Larson88] is superior in + * two ways: 1) only a portion of the table is expanded when needed, + * distributing the expansion cost over several insertions, and 2) portions + * of the table can be locked, enabling a scalable thread-safe + * implementation. + * + * REFERENCES + * + * [Hanson97] David R. Hanson. C Interfaces and Implementations: + * Techniques for Creating Reusable Software. Reading, Massachusetts: + * Addison-Wesley, 1997. + * + * [Knuth73] Donald E. Knuth. The Art of Computer Programming. Volume 3: + * Sorting and Searching. Reading, Massachusetts: Addison-Wesley, 1973. + * + * [Larson88] Per-Ake Larson. "Dynamic Hash Tables". CACM 31(4), April + * 1988, pp. 446-457. + * + */ + +#include "glxhash.h" +#include + +#define HASH_MAIN 0 + +#include +#include + +#define HASH_MAGIC 0xdeadbeef +#define HASH_DEBUG 0 +#define HASH_SIZE 512 /* Good for about 100 entries */ + /* If you change this value, you probably + have to change the HashHash hashing + function! */ + +#define HASH_ALLOC malloc +#define HASH_FREE free +#define HASH_RANDOM_DECL +#define HASH_RANDOM_INIT(seed) srandom(seed) +#define HASH_RANDOM random() +#define HASH_RANDOM_DESTROY + +typedef struct __glxHashBucket +{ + unsigned long key; + void *value; + struct __glxHashBucket *next; +} __glxHashBucket, *__glxHashBucketPtr; + +typedef struct __glxHashTable *__glxHashTablePtr; +struct __glxHashTable +{ + unsigned long magic; + unsigned long hits; /* At top of linked list */ + unsigned long partials; /* Not at top of linked list */ + unsigned long misses; /* Not in table */ + __glxHashBucketPtr buckets[HASH_SIZE]; + int p0; + __glxHashBucketPtr p1; +}; + +static unsigned long +HashHash(unsigned long key) +{ + unsigned long hash = 0; + unsigned long tmp = key; + static int init = 0; + static unsigned long scatter[256]; + int i; + + if (!init) { + HASH_RANDOM_DECL; + HASH_RANDOM_INIT(37); + for (i = 0; i < 256; i++) + scatter[i] = HASH_RANDOM; + HASH_RANDOM_DESTROY; + ++init; + } + + while (tmp) { + hash = (hash << 1) + scatter[tmp & 0xff]; + tmp >>= 8; + } + + hash %= HASH_SIZE; +#if HASH_DEBUG + printf("Hash(%d) = %d\n", key, hash); +#endif + return hash; +} + +_X_HIDDEN __glxHashTable * +__glxHashCreate(void) +{ + __glxHashTablePtr table; + int i; + + table = HASH_ALLOC(sizeof(*table)); + if (!table) + return NULL; + table->magic = HASH_MAGIC; + table->hits = 0; + table->partials = 0; + table->misses = 0; + + for (i = 0; i < HASH_SIZE; i++) + table->buckets[i] = NULL; + return table; +} + +_X_HIDDEN int +__glxHashDestroy(__glxHashTable * t) +{ + __glxHashTablePtr table = (__glxHashTablePtr) t; + __glxHashBucketPtr bucket; + __glxHashBucketPtr next; + int i; + + if (table->magic != HASH_MAGIC) + return -1; /* Bad magic */ + + for (i = 0; i < HASH_SIZE; i++) { + for (bucket = table->buckets[i]; bucket;) { + next = bucket->next; + HASH_FREE(bucket); + bucket = next; + } + } + HASH_FREE(table); + return 0; +} + +/* Find the bucket and organize the list so that this bucket is at the + top. */ + +static __glxHashBucketPtr +HashFind(__glxHashTablePtr table, unsigned long key, unsigned long *h) +{ + unsigned long hash = HashHash(key); + __glxHashBucketPtr prev = NULL; + __glxHashBucketPtr bucket; + + if (h) + *h = hash; + + for (bucket = table->buckets[hash]; bucket; bucket = bucket->next) { + if (bucket->key == key) { + if (prev) { + /* Organize */ + prev->next = bucket->next; + bucket->next = table->buckets[hash]; + table->buckets[hash] = bucket; + ++table->partials; + } + else { + ++table->hits; + } + return bucket; + } + prev = bucket; + } + ++table->misses; + return NULL; +} + +_X_HIDDEN int +__glxHashLookup(__glxHashTable * t, unsigned long key, void **value) +{ + __glxHashTablePtr table = (__glxHashTablePtr) t; + __glxHashBucketPtr bucket; + + if (!table || table->magic != HASH_MAGIC) + return -1; /* Bad magic */ + + bucket = HashFind(table, key, NULL); + if (!bucket) + return 1; /* Not found */ + *value = bucket->value; + return 0; /* Found */ +} + +_X_HIDDEN int +__glxHashInsert(__glxHashTable * t, unsigned long key, void *value) +{ + __glxHashTablePtr table = (__glxHashTablePtr) t; + __glxHashBucketPtr bucket; + unsigned long hash; + + if (table->magic != HASH_MAGIC) + return -1; /* Bad magic */ + + if (HashFind(table, key, &hash)) + return 1; /* Already in table */ + + bucket = HASH_ALLOC(sizeof(*bucket)); + if (!bucket) + return -1; /* Error */ + bucket->key = key; + bucket->value = value; + bucket->next = table->buckets[hash]; + table->buckets[hash] = bucket; +#if HASH_DEBUG + printf("Inserted %d at %d/%p\n", key, hash, bucket); +#endif + return 0; /* Added to table */ +} + +_X_HIDDEN int +__glxHashDelete(__glxHashTable * t, unsigned long key) +{ + __glxHashTablePtr table = (__glxHashTablePtr) t; + unsigned long hash; + __glxHashBucketPtr bucket; + + if (table->magic != HASH_MAGIC) + return -1; /* Bad magic */ + + bucket = HashFind(table, key, &hash); + + if (!bucket) + return 1; /* Not found */ + + table->buckets[hash] = bucket->next; + HASH_FREE(bucket); + return 0; +} + +_X_HIDDEN int +__glxHashNext(__glxHashTable * t, unsigned long *key, void **value) +{ + __glxHashTablePtr table = (__glxHashTablePtr) t; + + while (table->p0 < HASH_SIZE) { + if (table->p1) { + *key = table->p1->key; + *value = table->p1->value; + table->p1 = table->p1->next; + return 1; + } + table->p1 = table->buckets[table->p0]; + ++table->p0; + } + return 0; +} + +_X_HIDDEN int +__glxHashFirst(__glxHashTable * t, unsigned long *key, void **value) +{ + __glxHashTablePtr table = (__glxHashTablePtr) t; + + if (table->magic != HASH_MAGIC) + return -1; /* Bad magic */ + + table->p0 = 0; + table->p1 = table->buckets[0]; + return __glxHashNext(table, key, value); +} + +#if HASH_MAIN +#define DIST_LIMIT 10 +static int dist[DIST_LIMIT]; + +static void +clear_dist(void) +{ + int i; + + for (i = 0; i < DIST_LIMIT; i++) + dist[i] = 0; +} + +static int +count_entries(__glxHashBucketPtr bucket) +{ + int count = 0; + + for (; bucket; bucket = bucket->next) + ++count; + return count; +} + +static void +update_dist(int count) +{ + if (count >= DIST_LIMIT) + ++dist[DIST_LIMIT - 1]; + else + ++dist[count]; +} + +static void +compute_dist(__glxHashTablePtr table) +{ + int i; + __glxHashBucketPtr bucket; + + printf("Hits = %ld, partials = %ld, misses = %ld\n", + table->hits, table->partials, table->misses); + clear_dist(); + for (i = 0; i < HASH_SIZE; i++) { + bucket = table->buckets[i]; + update_dist(count_entries(bucket)); + } + for (i = 0; i < DIST_LIMIT; i++) { + if (i != DIST_LIMIT - 1) + printf("%5d %10d\n", i, dist[i]); + else + printf("other %10d\n", dist[i]); + } +} + +static void +check_table(__glxHashTablePtr table, unsigned long key, unsigned long value) +{ + unsigned long retval = 0; + int retcode = __glxHashLookup(table, key, &retval); + + switch (retcode) { + case -1: + printf("Bad magic = 0x%08lx:" + " key = %lu, expected = %lu, returned = %lu\n", + table->magic, key, value, retval); + break; + case 1: + printf("Not found: key = %lu, expected = %lu returned = %lu\n", + key, value, retval); + break; + case 0: + if (value != retval) + printf("Bad value: key = %lu, expected = %lu, returned = %lu\n", + key, value, retval); + break; + default: + printf("Bad retcode = %d: key = %lu, expected = %lu, returned = %lu\n", + retcode, key, value, retval); + break; + } +} + +int +main(void) +{ + __glxHashTablePtr table; + int i; + + printf("\n***** 256 consecutive integers ****\n"); + table = __glxHashCreate(); + for (i = 0; i < 256; i++) + __glxHashInsert(table, i, i); + for (i = 0; i < 256; i++) + check_table(table, i, i); + for (i = 256; i >= 0; i--) + check_table(table, i, i); + compute_dist(table); + __glxHashDestroy(table); + + printf("\n***** 1024 consecutive integers ****\n"); + table = __glxHashCreate(); + for (i = 0; i < 1024; i++) + __glxHashInsert(table, i, i); + for (i = 0; i < 1024; i++) + check_table(table, i, i); + for (i = 1024; i >= 0; i--) + check_table(table, i, i); + compute_dist(table); + __glxHashDestroy(table); + + printf("\n***** 1024 consecutive page addresses (4k pages) ****\n"); + table = __glxHashCreate(); + for (i = 0; i < 1024; i++) + __glxHashInsert(table, i * 4096, i); + for (i = 0; i < 1024; i++) + check_table(table, i * 4096, i); + for (i = 1024; i >= 0; i--) + check_table(table, i * 4096, i); + compute_dist(table); + __glxHashDestroy(table); + + printf("\n***** 1024 random integers ****\n"); + table = __glxHashCreate(); + srandom(0xbeefbeef); + for (i = 0; i < 1024; i++) + __glxHashInsert(table, random(), i); + srandom(0xbeefbeef); + for (i = 0; i < 1024; i++) + check_table(table, random(), i); + srandom(0xbeefbeef); + for (i = 0; i < 1024; i++) + check_table(table, random(), i); + compute_dist(table); + __glxHashDestroy(table); + + printf("\n***** 5000 random integers ****\n"); + table = __glxHashCreate(); + srandom(0xbeefbeef); + for (i = 0; i < 5000; i++) + __glxHashInsert(table, random(), i); + srandom(0xbeefbeef); + for (i = 0; i < 5000; i++) + check_table(table, random(), i); + srandom(0xbeefbeef); + for (i = 0; i < 5000; i++) + check_table(table, random(), i); + compute_dist(table); + __glxHashDestroy(table); + + return 0; +} +#endif diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glxhash.h xpsb-glx-0.19/mesa/src/glx/x11/glxhash.h --- xpsb-glx-0.19/mesa/src/glx/x11/glxhash.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glxhash.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,20 @@ +#ifndef _GLX_HASH_H_ +#define _GLX_HASH_H_ + + +typedef struct __glxHashTable __glxHashTable; + +/* Hash table routines */ +extern __glxHashTable *__glxHashCreate(void); +extern int __glxHashDestroy(__glxHashTable * t); +extern int __glxHashLookup(__glxHashTable * t, unsigned long key, + void **value); +extern int __glxHashInsert(__glxHashTable * t, unsigned long key, + void *value); +extern int __glxHashDelete(__glxHashTable * t, unsigned long key); +extern int __glxHashFirst(__glxHashTable * t, unsigned long *key, + void **value); +extern int __glxHashNext(__glxHashTable * t, unsigned long *key, + void **value); + +#endif /* _GLX_HASH_H_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glx_pbuffer.c xpsb-glx-0.19/mesa/src/glx/x11/glx_pbuffer.c --- xpsb-glx-0.19/mesa/src/glx/x11/glx_pbuffer.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glx_pbuffer.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,673 @@ +/* + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glx_pbuffer.c + * Implementation of pbuffer related functions. + * + * \author Ian Romanick + */ + +#include +#include "glxclient.h" +#include +#include +#include +#include +#include "glapi.h" +#include "glxextensions.h" +#include "glcontextmodes.h" + + +/** + * Change a drawable's attribute. + * + * This function is used to implement \c glXSelectEvent and + * \c glXSelectEventSGIX. + * + * \note + * This function dynamically determines whether to use the SGIX_pbuffer + * version of the protocol or the GLX 1.3 version of the protocol. + * + * \todo + * This function needs to be modified to work with direct-rendering drivers. + */ +static void +ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable, + const CARD32 * attribs, size_t num_attribs) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + CARD32 *output; + CARD8 opcode; + + if ((dpy == NULL) || (drawable == 0)) { + return; + } + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + + if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { + xGLXChangeDrawableAttributesReq *req; + + GetReqExtra(GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req); + output = (CARD32 *) (req + 1); + + req->reqType = opcode; + req->glxCode = X_GLXChangeDrawableAttributes; + req->drawable = drawable; + req->numAttribs = (CARD32) num_attribs; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + + GetReqExtra(GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq); + output = (CARD32 *) (vpreq + 1); + + vpreq->reqType = opcode; + vpreq->glxCode = X_GLXVendorPrivateWithReply; + vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX; + + output[0] = (CARD32) drawable; + output++; + } + + (void) memcpy(output, attribs, sizeof(CARD32) * 2 * num_attribs); + + UnlockDisplay(dpy); + SyncHandle(); + + return; +} + + +/** + * Destroy a pbuffer. + * + * This function is used to implement \c glXDestroyPbuffer and + * \c glXDestroyGLXPbufferSGIX. + * + * \note + * This function dynamically determines whether to use the SGIX_pbuffer + * version of the protocol or the GLX 1.3 version of the protocol. + * + * \todo + * This function needs to be modified to work with direct-rendering drivers. + */ +static void +DestroyPbuffer(Display * dpy, GLXDrawable drawable) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + CARD8 opcode; + + if ((dpy == NULL) || (drawable == 0)) { + return; + } + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + + if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { + xGLXDestroyPbufferReq *req; + + GetReq(GLXDestroyPbuffer, req); + req->reqType = opcode; + req->glxCode = X_GLXDestroyPbuffer; + req->pbuffer = (GLXPbuffer) drawable; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + CARD32 *data; + + GetReqExtra(GLXVendorPrivateWithReply, 4, vpreq); + data = (CARD32 *) (vpreq + 1); + + data[0] = (CARD32) drawable; + + vpreq->reqType = opcode; + vpreq->glxCode = X_GLXVendorPrivateWithReply; + vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX; + } + + UnlockDisplay(dpy); + SyncHandle(); + + return; +} + + +#ifdef GLX_DIRECT_RENDERING +extern __GLXDRIdrawable *GetGLXDRIDrawable(Display * dpy, + GLXDrawable drawable, + int *const scrn_num); + +static GLenum +determineTextureTarget(const int *attribs, int numAttribs) +{ + GLenum target = 0; + int i; + + for (i = 0; i < numAttribs; i++) { + if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) { + switch (attribs[2 * i + 1]) { + case GLX_TEXTURE_2D_EXT: + target = GL_TEXTURE_2D; + break; + case GLX_TEXTURE_RECTANGLE_EXT: + target = GL_TEXTURE_RECTANGLE_ARB; + break; + } + } + } + + return target; +} +#endif + +/** + * Get a drawable's attribute. + * + * This function is used to implement \c glXGetSelectedEvent and + * \c glXGetSelectedEventSGIX. + * + * \note + * This function dynamically determines whether to use the SGIX_pbuffer + * version of the protocol or the GLX 1.3 version of the protocol. + * + * \todo + * The number of attributes returned is likely to be small, probably less than + * 10. Given that, this routine should try to use an array on the stack to + * capture the reply rather than always calling Xmalloc. + * + * \todo + * This function needs to be modified to work with direct-rendering drivers. + */ +static int +GetDrawableAttribute(Display * dpy, GLXDrawable drawable, + int attribute, unsigned int *value) +{ + __GLXdisplayPrivate *priv; + xGLXGetDrawableAttributesReply reply; + CARD32 *data; + CARD8 opcode; + unsigned int length; + unsigned int i; + unsigned int num_attributes; + GLboolean use_glx_1_3; + + if ((dpy == NULL) || (drawable == 0)) { + return 0; + } + + priv = __glXInitialize(dpy); + use_glx_1_3 = ((priv->majorVersion > 1) || (priv->minorVersion >= 3)); + + *value = 0; + + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return 0; + + LockDisplay(dpy); + + if (use_glx_1_3) { + xGLXGetDrawableAttributesReq *req; + + GetReqExtra(GLXGetDrawableAttributes, 4, req); + req->reqType = opcode; + req->glxCode = X_GLXGetDrawableAttributes; + req->drawable = drawable; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + + GetReqExtra(GLXVendorPrivateWithReply, 4, vpreq); + data = (CARD32 *) (vpreq + 1); + data[0] = (CARD32) drawable; + + vpreq->reqType = opcode; + vpreq->glxCode = X_GLXVendorPrivateWithReply; + vpreq->vendorCode = X_GLXvop_GetDrawableAttributesSGIX; + } + + _XReply(dpy, (xReply *) & reply, 0, False); + + if (reply.type == X_Error) { + UnlockDisplay(dpy); + SyncHandle(); + return 0; + } + + length = reply.length; + if (length) { + num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2; + data = (CARD32 *) Xmalloc(length * sizeof(CARD32)); + if (data == NULL) { + /* Throw data on the floor */ + _XEatData(dpy, length); + } + else { + _XRead(dpy, (char *) data, length * sizeof(CARD32)); + + /* Search the set of returned attributes for the attribute requested by + * the caller. + */ + for (i = 0; i < num_attributes; i++) { + if (data[i * 2] == attribute) { + *value = data[(i * 2) + 1]; + break; + } + } + +#ifdef GLX_DIRECT_RENDERING + { + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL); + + if (pdraw != NULL && !pdraw->textureTarget) + pdraw->textureTarget = + determineTextureTarget((const int *) data, num_attributes); + } +#endif + + Xfree(data); + } + } + + UnlockDisplay(dpy); + SyncHandle(); + + return 0; +} + +/** + * Create a non-pbuffer GLX drawable. + * + * \todo + * This function needs to be modified to work with direct-rendering drivers. + */ +static GLXDrawable +CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig, + Drawable drawable, const int *attrib_list, CARD8 glxCode) +{ + xGLXCreateWindowReq *req; + CARD32 *data; + unsigned int i; + CARD8 opcode; + + i = 0; + if (attrib_list) { + while (attrib_list[i * 2] != None) + i++; + } + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return None; + + LockDisplay(dpy); + GetReqExtra(GLXCreateWindow, 8 * i, req); + data = (CARD32 *) (req + 1); + + req->reqType = opcode; + req->glxCode = glxCode; + req->screen = (CARD32) fbconfig->screen; + req->fbconfig = fbconfig->fbconfigID; + req->window = (CARD32) drawable; + req->glxwindow = (GLXWindow) XAllocID(dpy); + req->numAttribs = (CARD32) i; + + memcpy(data, attrib_list, 8 * i); + + UnlockDisplay(dpy); + SyncHandle(); + +#ifdef GLX_DIRECT_RENDERING + do { + /* FIXME: Maybe delay __DRIdrawable creation until the drawable + * is actually bound to a context... */ + + __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw; + __GLXscreenConfigs *psc; + + psc = &priv->screenConfigs[fbconfig->screen]; + if (psc->driScreen == NULL) + break; + pdraw = psc->driScreen->createDrawable(psc, drawable, + req->glxwindow, fbconfig); + if (pdraw == NULL) { + fprintf(stderr, "failed to create drawable\n"); + break; + } + + if (__glxHashInsert(psc->drawHash, req->glxwindow, pdraw)) { + (*pdraw->destroyDrawable) (pdraw); + return None; /* FIXME: Check what we're supposed to do here... */ + } + + pdraw->textureTarget = determineTextureTarget(attrib_list, i); + } while (0); +#endif + + return (GLXDrawable) req->glxwindow; +} + + +/** + * Destroy a non-pbuffer GLX drawable. + * + * \todo + * This function needs to be modified to work with direct-rendering drivers. + */ +static void +DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode) +{ + xGLXDestroyPbufferReq *req; + CARD8 opcode; + + if ((dpy == NULL) || (drawable == 0)) { + return; + } + + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + + GetReqExtra(GLXDestroyPbuffer, 4, req); + req->reqType = opcode; + req->glxCode = glxCode; + req->pbuffer = (GLXPbuffer) drawable; + + UnlockDisplay(dpy); + SyncHandle(); + +#ifdef GLX_DIRECT_RENDERING + { + int screen; + __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); + __GLXscreenConfigs *psc = &priv->screenConfigs[screen]; + + if (pdraw != NULL) { + (*pdraw->destroyDrawable) (pdraw); + __glxHashDelete(psc->drawHash, drawable); + } + } +#endif + + return; +} + + +/** + * Create a pbuffer. + * + * This function is used to implement \c glXCreatePbuffer and + * \c glXCreateGLXPbufferSGIX. + * + * \note + * This function dynamically determines whether to use the SGIX_pbuffer + * version of the protocol or the GLX 1.3 version of the protocol. + * + * \todo + * This function needs to be modified to work with direct-rendering drivers. + */ +static GLXDrawable +CreatePbuffer(Display * dpy, const __GLcontextModes * fbconfig, + unsigned int width, unsigned int height, + const int *attrib_list, GLboolean size_in_attribs) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + GLXDrawable id = 0; + CARD32 *data; + CARD8 opcode; + unsigned int i; + + i = 0; + if (attrib_list) { + while (attrib_list[i * 2]) + i++; + } + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return None; + + LockDisplay(dpy); + id = XAllocID(dpy); + + if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { + xGLXCreatePbufferReq *req; + unsigned int extra = (size_in_attribs) ? 0 : 2; + + GetReqExtra(GLXCreatePbuffer, (8 * (i + extra)), req); + data = (CARD32 *) (req + 1); + + req->reqType = opcode; + req->glxCode = X_GLXCreatePbuffer; + req->screen = (CARD32) fbconfig->screen; + req->fbconfig = fbconfig->fbconfigID; + req->pbuffer = (GLXPbuffer) id; + req->numAttribs = (CARD32) (i + extra); + + if (!size_in_attribs) { + data[(2 * i) + 0] = GLX_PBUFFER_WIDTH; + data[(2 * i) + 1] = width; + data[(2 * i) + 2] = GLX_PBUFFER_HEIGHT; + data[(2 * i) + 3] = height; + data += 4; + } + } + else { + xGLXVendorPrivateReq *vpreq; + + GetReqExtra(GLXVendorPrivate, 20 + (8 * i), vpreq); + data = (CARD32 *) (vpreq + 1); + + vpreq->reqType = opcode; + vpreq->glxCode = X_GLXVendorPrivate; + vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX; + + data[0] = (CARD32) fbconfig->screen; + data[1] = (CARD32) fbconfig->fbconfigID; + data[2] = (CARD32) id; + data[3] = (CARD32) width; + data[4] = (CARD32) height; + data += 5; + } + + (void) memcpy(data, attrib_list, sizeof(CARD32) * 2 * i); + + UnlockDisplay(dpy); + SyncHandle(); + + return id; +} + + +/** + * Create a new pbuffer. + */ +PUBLIC GLXPbufferSGIX +glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config, + unsigned int width, unsigned int height, + int *attrib_list) +{ + return (GLXPbufferSGIX) CreatePbuffer(dpy, (__GLcontextModes *) config, + width, height, + attrib_list, GL_FALSE); +} + + +/** + * Create a new pbuffer. + */ +PUBLIC GLXPbuffer +glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list) +{ + int i, width, height; + + width = 0; + height = 0; + + for (i = 0; attrib_list[i * 2]; i++) { + switch (attrib_list[i * 2]) { + case GLX_PBUFFER_WIDTH: + width = attrib_list[i * 2 + 1]; + break; + case GLX_PBUFFER_HEIGHT: + height = attrib_list[i * 2 + 1]; + break; + } + } + + return (GLXPbuffer) CreatePbuffer(dpy, (__GLcontextModes *) config, + width, height, attrib_list, GL_TRUE); +} + + +/** + * Destroy an existing pbuffer. + */ +PUBLIC void +glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf) +{ + DestroyPbuffer(dpy, pbuf); +} + + +/** + * Query an attribute of a drawable. + */ +PUBLIC void +glXQueryDrawable(Display * dpy, GLXDrawable drawable, + int attribute, unsigned int *value) +{ + GetDrawableAttribute(dpy, drawable, attribute, value); +} + + +/** + * Query an attribute of a pbuffer. + */ +PUBLIC int +glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable, + int attribute, unsigned int *value) +{ + return GetDrawableAttribute(dpy, drawable, attribute, value); +} + + +/** + * Select the event mask for a drawable. + */ +PUBLIC void +glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask) +{ + CARD32 attribs[2]; + + attribs[0] = (CARD32) GLX_EVENT_MASK; + attribs[1] = (CARD32) mask; + + ChangeDrawableAttribute(dpy, drawable, attribs, 1); +} + + +/** + * Get the selected event mask for a drawable. + */ +PUBLIC void +glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask) +{ + unsigned int value; + + + /* The non-sense with value is required because on LP64 platforms + * sizeof(unsigned int) != sizeof(unsigned long). On little-endian + * we could just type-cast the pointer, but why? + */ + + GetDrawableAttribute(dpy, drawable, GLX_EVENT_MASK_SGIX, &value); + *mask = value; +} + + +PUBLIC GLXPixmap +glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap, + const int *attrib_list) +{ + return CreateDrawable(dpy, (__GLcontextModes *) config, + (Drawable) pixmap, attrib_list, X_GLXCreatePixmap); +} + + +PUBLIC GLXWindow +glXCreateWindow(Display * dpy, GLXFBConfig config, Window win, + const int *attrib_list) +{ + return CreateDrawable(dpy, (__GLcontextModes *) config, + (Drawable) win, attrib_list, X_GLXCreateWindow); +} + + +PUBLIC void +glXDestroyPixmap(Display * dpy, GLXPixmap pixmap) +{ + DestroyDrawable(dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap); +} + + +PUBLIC void +glXDestroyWindow(Display * dpy, GLXWindow win) +{ + DestroyDrawable(dpy, (GLXDrawable) win, X_GLXDestroyWindow); +} + + +PUBLIC +GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX, + (Display * dpy, GLXPbufferSGIX pbuf), + (dpy, pbuf), glXDestroyPbuffer) + +PUBLIC +GLX_ALIAS_VOID(glXSelectEventSGIX, + (Display * dpy, GLXDrawable drawable, + unsigned long mask), (dpy, drawable, mask), + glXSelectEvent) + +PUBLIC +GLX_ALIAS_VOID(glXGetSelectedEventSGIX, + (Display * dpy, GLXDrawable drawable, + unsigned long *mask), (dpy, drawable, mask), + glXGetSelectedEvent) diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/glx_query.c xpsb-glx-0.19/mesa/src/glx/x11/glx_query.c --- xpsb-glx-0.19/mesa/src/glx/x11/glx_query.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/glx_query.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,191 @@ +/* + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glx_query.c + * Generic utility functions to query internal data from the server. + * + * \author Ian Romanick + */ + +#include "glxclient.h" + +#if defined(USE_XCB) +# include +# include +# include +#endif + +#ifdef USE_XCB + +/** + * Exchange a protocol request for glXQueryServerString. + */ +char * +__glXQueryServerString(Display* dpy, + int opcode, + CARD32 screen, + CARD32 name) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_query_server_string_reply_t* reply = + xcb_glx_query_server_string_reply(c, + xcb_glx_query_server_string(c, + screen, + name), + NULL); + + /* The spec doesn't mention this, but the Xorg server replies with + * a string already terminated with '\0'. */ + uint32_t len = xcb_glx_query_server_string_string_length(reply); + char* buf = Xmalloc(len); + memcpy(buf, xcb_glx_query_server_string_string(reply), len); + free(reply); + + return buf; +} + +/** + * Exchange a protocol request for glGetString. + */ +char * +__glXGetString(Display* dpy, + int opcode, + CARD32 contextTag, + CARD32 name) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_get_string_reply_t* reply = + xcb_glx_get_string_reply(c, + xcb_glx_get_string(c, + contextTag, + name), + NULL); + + /* The spec doesn't mention this, but the Xorg server replies with + * a string already terminated with '\0'. */ + uint32_t len = xcb_glx_get_string_string_length(reply); + char* buf = Xmalloc(len); + memcpy(buf, xcb_glx_get_string_string(reply), len); + free(reply); + + return buf; +} + +#else + +/** + * GLX protocol structure for the ficticious "GXLGenericGetString" request. + * + * This is a non-existant protocol packet. It just so happens that all of + * the real protocol packets used to request a string from the server have + * an identical binary layout. The only difference between them is the + * meaning of the \c for_whom field and the value of the \c glxCode. + */ +typedef struct GLXGenericGetString +{ + CARD8 reqType; + CARD8 glxCode; + CARD16 length B16; + CARD32 for_whom B32; + CARD32 name B32; +} xGLXGenericGetStringReq; + +/* These defines are only needed to make the GetReq macro happy. + */ +#define sz_xGLXGenericGetStringReq 12 +#define X_GLXGenericGetString 0 + +/** + * Query the Server GLX string. + * This routine will allocate the necessay space for the string. + */ +static char * +__glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode, + CARD32 for_whom, CARD32 name) +{ + xGLXGenericGetStringReq *req; + xGLXSingleReply reply; + int length; + int numbytes; + char *buf; + + + LockDisplay(dpy); + + + /* All of the GLX protocol requests for getting a string from the server + * look the same. The exact meaning of the for_whom field is usually + * either the screen number (for glXQueryServerString) or the context tag + * (for GLXSingle). + */ + + GetReq(GLXGenericGetString, req); + req->reqType = opcode; + req->glxCode = glxCode; + req->for_whom = for_whom; + req->name = name; + + _XReply(dpy, (xReply *) & reply, 0, False); + + length = reply.length * 4; + numbytes = reply.size; + + buf = (char *) Xmalloc(numbytes); + if (buf != NULL) { + _XRead(dpy, buf, numbytes); + length -= numbytes; + } + + _XEatData(dpy, length); + + UnlockDisplay(dpy); + SyncHandle(); + + return buf; +} + +char * +__glXQueryServerString(Display* dpy, + int opcode, + CARD32 screen, + CARD32 name) +{ + return __glXGetStringFromServer(dpy, opcode, + X_GLXQueryServerString, + screen, name); +} + +char * +__glXGetString(Display* dpy, + int opcode, + CARD32 contextTag, + CARD32 name) +{ + return __glXGetStringFromServer(dpy, opcode, X_GLsop_GetString, + contextTag, name); +} + +#endif /* USE_XCB */ + diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect.c xpsb-glx-0.19/mesa/src/glx/x11/indirect.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,10617 @@ +/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */ + +/* + * (C) Copyright IBM Corporation 2004, 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#include +#include "indirect.h" +#include "glxclient.h" +#include "indirect_size.h" +#include "dispatch.h" +#include "glapi.h" +#include "glthread.h" +#include +#ifdef USE_XCB +#include +#include +#include +#endif /* USE_XCB */ + +#define __GLX_PAD(n) (((n) + 3) & ~3) + +# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# define FASTCALL __attribute__((fastcall)) +# else +# define FASTCALL +# endif +# if defined(__GNUC__) +# define NOINLINE __attribute__((noinline)) +# else +# define NOINLINE +# endif + +#if !defined __GNUC__ || __GNUC__ < 3 +# define __builtin_expect(x, y) x +#endif + +/* If the size and opcode values are known at compile-time, this will, on + * x86 at least, emit them with a single instruction. + */ +#define emit_header(dest, op, size) \ + do { union { short s[2]; int i; } temp; \ + temp.s[0] = (size); temp.s[1] = (op); \ + *((int *)(dest)) = temp.i; } while(0) + +NOINLINE CARD32 +__glXReadReply(Display * dpy, size_t size, void *dest, + GLboolean reply_is_always_array) +{ + xGLXSingleReply reply; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + if (size != 0) { + if ((reply.length > 0) || reply_is_always_array) { + const GLint bytes = (reply_is_always_array) + ? (4 * reply.length) : (reply.size * size); + const GLint extra = 4 - (bytes & 3); + + _XRead(dpy, dest, bytes); + if (extra < 4) { + _XEatData(dpy, extra); + } + } else { + (void) memcpy(dest, &(reply.pad3), size); + } + } + + return reply.retval; +} + +NOINLINE void +__glXReadPixelReply(Display * dpy, __GLXcontext * gc, unsigned max_dim, + GLint width, GLint height, GLint depth, GLenum format, + GLenum type, void *dest, GLboolean dimensions_in_reply) +{ + xGLXSingleReply reply; + GLint size; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + + if (dimensions_in_reply) { + width = reply.pad3; + height = reply.pad4; + depth = reply.pad5; + + if ((height == 0) || (max_dim < 2)) { + height = 1; + } + if ((depth == 0) || (max_dim < 3)) { + depth = 1; + } + } + + size = reply.length * 4; + if (size != 0) { + void *buf = Xmalloc(size); + + if (buf == NULL) { + _XEatData(dpy, size); + __glXSetError(gc, GL_OUT_OF_MEMORY); + } else { + const GLint extra = 4 - (size & 3); + + _XRead(dpy, buf, size); + if (extra < 4) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 3, width, height, depth, format, type, + buf, dest); + Xfree(buf); + } + } +} + +#define X_GLXSingle 0 + +NOINLINE FASTCALL GLubyte * +__glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen) +{ + xGLXSingleReq *req; + Display *const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXSingle, cmdlen, req); + req->reqType = gc->majorOpcode; + req->contextTag = gc->currentContextTag; + req->glxCode = sop; + return (GLubyte *) (req) + sz_xGLXSingleReq; +} + +NOINLINE FASTCALL GLubyte * +__glXSetupVendorRequest(__GLXcontext * gc, GLint code, GLint vop, + GLint cmdlen) +{ + xGLXVendorPrivateReq *req; + Display *const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, cmdlen, req); + req->reqType = gc->majorOpcode; + req->glxCode = code; + req->vendorCode = vop; + req->contextTag = gc->currentContextTag; + return (GLubyte *) (req) + sz_xGLXVendorPrivateReq; +} + +const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + +#define zero (__glXDefaultPixelStore+0) +#define one (__glXDefaultPixelStore+8) +#define default_pixel_store_1D (__glXDefaultPixelStore+4) +#define default_pixel_store_1D_size 20 +#define default_pixel_store_2D (__glXDefaultPixelStore+4) +#define default_pixel_store_2D_size 20 +#define default_pixel_store_3D (__glXDefaultPixelStore+0) +#define default_pixel_store_3D_size 36 +#define default_pixel_store_4D (__glXDefaultPixelStore+0) +#define default_pixel_store_4D_size 36 + +static FASTCALL NOINLINE void +generic_3_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_4_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_6_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_8_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_12_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 12); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_16_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_24_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 24); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static FASTCALL NOINLINE void +generic_32_byte(GLint rop, const void *ptr) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *) (gc->pc + 4), ptr, 32); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_NewList 101 +void +__indirect_glNewList(GLuint list, GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_new_list(c, gc->currentContextTag, list, mode); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_NewList, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&list), 4); + (void) memcpy((void *) (pc + 4), (void *) (&mode), 4); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_EndList 102 +void +__indirect_glEndList(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 0; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_end_list(c, gc->currentContextTag); +#else + (void) __glXSetupSingleRequest(gc, X_GLsop_EndList, cmdlen); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLrop_CallList 1 +void +__indirect_glCallList(GLuint list) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_CallList, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&list), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CallLists 2 +void +__indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glCallLists_size(type); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * n)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_CallLists, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&type), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (lists), + (compsize * n)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_CallLists; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (pc + 12), (void *) (&type), 4); + __glXSendLargeCommand(gc, pc, 16, lists, (compsize * n)); + } + } +} + +#define X_GLsop_DeleteLists 103 +void +__indirect_glDeleteLists(GLuint list, GLsizei range) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_delete_lists(c, gc->currentContextTag, list, range); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_DeleteLists, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&list), 4); + (void) memcpy((void *) (pc + 4), (void *) (&range), 4); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GenLists 104 +GLuint +__indirect_glGenLists(GLsizei range) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLuint retval = (GLuint) 0; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_gen_lists_reply_t *reply = + xcb_glx_gen_lists_reply(c, + xcb_glx_gen_lists(c, + gc->currentContextTag, + range), NULL); + retval = reply->ret_val; + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&range), 4); + retval = (GLuint) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return retval; +} + +#define X_GLrop_ListBase 3 +void +__indirect_glListBase(GLuint base) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ListBase, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&base), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Begin 4 +void +__indirect_glBegin(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Begin, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Bitmap 5 +void +__indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, + GLfloat yorig, GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, + GL_BITMAP, 0) : 0; + const GLuint cmdlen = 48 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_Bitmap, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&xorig), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&yorig), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&xmove), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&ymove), 4); + if (compsize > 0) { + (*gc->fillImage) (gc, 2, width, height, 1, GL_COLOR_INDEX, + GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_Bitmap; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&width), 4); + (void) memcpy((void *) (pc + 32), (void *) (&height), 4); + (void) memcpy((void *) (pc + 36), (void *) (&xorig), 4); + (void) memcpy((void *) (pc + 40), (void *) (&yorig), 4); + (void) memcpy((void *) (pc + 44), (void *) (&xmove), 4); + (void) memcpy((void *) (pc + 48), (void *) (&ymove), 4); + __glXSendLargeImage(gc, compsize, 2, width, height, 1, + GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52, + pc + 8); + } + } +} + +#define X_GLrop_Color3bv 6 +void +__indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Color3bv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3bv 6 +void +__indirect_glColor3bv(const GLbyte *v) +{ + generic_3_byte(X_GLrop_Color3bv, v); +} + +#define X_GLrop_Color3dv 7 +void +__indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_Color3dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3dv 7 +void +__indirect_glColor3dv(const GLdouble * v) +{ + generic_24_byte(X_GLrop_Color3dv, v); +} + +#define X_GLrop_Color3fv 8 +void +__indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Color3fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3fv 8 +void +__indirect_glColor3fv(const GLfloat * v) +{ + generic_12_byte(X_GLrop_Color3fv, v); +} + +#define X_GLrop_Color3iv 9 +void +__indirect_glColor3i(GLint red, GLint green, GLint blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Color3iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3iv 9 +void +__indirect_glColor3iv(const GLint * v) +{ + generic_12_byte(X_GLrop_Color3iv, v); +} + +#define X_GLrop_Color3sv 10 +void +__indirect_glColor3s(GLshort red, GLshort green, GLshort blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Color3sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3sv 10 +void +__indirect_glColor3sv(const GLshort * v) +{ + generic_6_byte(X_GLrop_Color3sv, v); +} + +#define X_GLrop_Color3ubv 11 +void +__indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Color3ubv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3ubv 11 +void +__indirect_glColor3ubv(const GLubyte *v) +{ + generic_3_byte(X_GLrop_Color3ubv, v); +} + +#define X_GLrop_Color3uiv 12 +void +__indirect_glColor3ui(GLuint red, GLuint green, GLuint blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Color3uiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3uiv 12 +void +__indirect_glColor3uiv(const GLuint * v) +{ + generic_12_byte(X_GLrop_Color3uiv, v); +} + +#define X_GLrop_Color3usv 13 +void +__indirect_glColor3us(GLushort red, GLushort green, GLushort blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Color3usv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color3usv 13 +void +__indirect_glColor3usv(const GLushort * v) +{ + generic_6_byte(X_GLrop_Color3usv, v); +} + +#define X_GLrop_Color4bv 14 +void +__indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Color4bv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4bv 14 +void +__indirect_glColor4bv(const GLbyte *v) +{ + generic_4_byte(X_GLrop_Color4bv, v); +} + +#define X_GLrop_Color4dv 15 +void +__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, + GLdouble alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_Color4dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&alpha), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4dv 15 +void +__indirect_glColor4dv(const GLdouble * v) +{ + generic_32_byte(X_GLrop_Color4dv, v); +} + +#define X_GLrop_Color4fv 16 +void +__indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Color4fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4fv 16 +void +__indirect_glColor4fv(const GLfloat * v) +{ + generic_16_byte(X_GLrop_Color4fv, v); +} + +#define X_GLrop_Color4iv 17 +void +__indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Color4iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4iv 17 +void +__indirect_glColor4iv(const GLint * v) +{ + generic_16_byte(X_GLrop_Color4iv, v); +} + +#define X_GLrop_Color4sv 18 +void +__indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Color4sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&alpha), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4sv 18 +void +__indirect_glColor4sv(const GLshort * v) +{ + generic_8_byte(X_GLrop_Color4sv, v); +} + +#define X_GLrop_Color4ubv 19 +void +__indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Color4ubv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4ubv 19 +void +__indirect_glColor4ubv(const GLubyte *v) +{ + generic_4_byte(X_GLrop_Color4ubv, v); +} + +#define X_GLrop_Color4uiv 20 +void +__indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Color4uiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4uiv 20 +void +__indirect_glColor4uiv(const GLuint * v) +{ + generic_16_byte(X_GLrop_Color4uiv, v); +} + +#define X_GLrop_Color4usv 21 +void +__indirect_glColor4us(GLushort red, GLushort green, GLushort blue, + GLushort alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Color4usv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&alpha), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Color4usv 21 +void +__indirect_glColor4usv(const GLushort * v) +{ + generic_8_byte(X_GLrop_Color4usv, v); +} + +#define X_GLrop_EdgeFlagv 22 +void +__indirect_glEdgeFlag(GLboolean flag) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&flag), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EdgeFlagv 22 +void +__indirect_glEdgeFlagv(const GLboolean * flag) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (flag), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_End 23 +void +__indirect_glEnd(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_End, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexdv 24 +void +__indirect_glIndexd(GLdouble c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Indexdv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexdv 24 +void +__indirect_glIndexdv(const GLdouble * c) +{ + generic_8_byte(X_GLrop_Indexdv, c); +} + +#define X_GLrop_Indexfv 25 +void +__indirect_glIndexf(GLfloat c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Indexfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexfv 25 +void +__indirect_glIndexfv(const GLfloat * c) +{ + generic_4_byte(X_GLrop_Indexfv, c); +} + +#define X_GLrop_Indexiv 26 +void +__indirect_glIndexi(GLint c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Indexiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexiv 26 +void +__indirect_glIndexiv(const GLint * c) +{ + generic_4_byte(X_GLrop_Indexiv, c); +} + +#define X_GLrop_Indexsv 27 +void +__indirect_glIndexs(GLshort c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexsv 27 +void +__indirect_glIndexsv(const GLshort * c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (c), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Normal3bv 28 +void +__indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Normal3bv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&ny), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&nz), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Normal3bv 28 +void +__indirect_glNormal3bv(const GLbyte *v) +{ + generic_3_byte(X_GLrop_Normal3bv, v); +} + +#define X_GLrop_Normal3dv 29 +void +__indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_Normal3dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&ny), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&nz), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Normal3dv 29 +void +__indirect_glNormal3dv(const GLdouble * v) +{ + generic_24_byte(X_GLrop_Normal3dv, v); +} + +#define X_GLrop_Normal3fv 30 +void +__indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Normal3fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ny), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&nz), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Normal3fv 30 +void +__indirect_glNormal3fv(const GLfloat * v) +{ + generic_12_byte(X_GLrop_Normal3fv, v); +} + +#define X_GLrop_Normal3iv 31 +void +__indirect_glNormal3i(GLint nx, GLint ny, GLint nz) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Normal3iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ny), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&nz), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Normal3iv 31 +void +__indirect_glNormal3iv(const GLint * v) +{ + generic_12_byte(X_GLrop_Normal3iv, v); +} + +#define X_GLrop_Normal3sv 32 +void +__indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Normal3sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&ny), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&nz), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Normal3sv 32 +void +__indirect_glNormal3sv(const GLshort * v) +{ + generic_6_byte(X_GLrop_Normal3sv, v); +} + +#define X_GLrop_RasterPos2dv 33 +void +__indirect_glRasterPos2d(GLdouble x, GLdouble y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_RasterPos2dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos2dv 33 +void +__indirect_glRasterPos2dv(const GLdouble * v) +{ + generic_16_byte(X_GLrop_RasterPos2dv, v); +} + +#define X_GLrop_RasterPos2fv 34 +void +__indirect_glRasterPos2f(GLfloat x, GLfloat y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_RasterPos2fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos2fv 34 +void +__indirect_glRasterPos2fv(const GLfloat * v) +{ + generic_8_byte(X_GLrop_RasterPos2fv, v); +} + +#define X_GLrop_RasterPos2iv 35 +void +__indirect_glRasterPos2i(GLint x, GLint y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_RasterPos2iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos2iv 35 +void +__indirect_glRasterPos2iv(const GLint * v) +{ + generic_8_byte(X_GLrop_RasterPos2iv, v); +} + +#define X_GLrop_RasterPos2sv 36 +void +__indirect_glRasterPos2s(GLshort x, GLshort y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_RasterPos2sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos2sv 36 +void +__indirect_glRasterPos2sv(const GLshort * v) +{ + generic_4_byte(X_GLrop_RasterPos2sv, v); +} + +#define X_GLrop_RasterPos3dv 37 +void +__indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_RasterPos3dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos3dv 37 +void +__indirect_glRasterPos3dv(const GLdouble * v) +{ + generic_24_byte(X_GLrop_RasterPos3dv, v); +} + +#define X_GLrop_RasterPos3fv 38 +void +__indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_RasterPos3fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos3fv 38 +void +__indirect_glRasterPos3fv(const GLfloat * v) +{ + generic_12_byte(X_GLrop_RasterPos3fv, v); +} + +#define X_GLrop_RasterPos3iv 39 +void +__indirect_glRasterPos3i(GLint x, GLint y, GLint z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_RasterPos3iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos3iv 39 +void +__indirect_glRasterPos3iv(const GLint * v) +{ + generic_12_byte(X_GLrop_RasterPos3iv, v); +} + +#define X_GLrop_RasterPos3sv 40 +void +__indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_RasterPos3sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos3sv 40 +void +__indirect_glRasterPos3sv(const GLshort * v) +{ + generic_6_byte(X_GLrop_RasterPos3sv, v); +} + +#define X_GLrop_RasterPos4dv 41 +void +__indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_RasterPos4dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos4dv 41 +void +__indirect_glRasterPos4dv(const GLdouble * v) +{ + generic_32_byte(X_GLrop_RasterPos4dv, v); +} + +#define X_GLrop_RasterPos4fv 42 +void +__indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_RasterPos4fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos4fv 42 +void +__indirect_glRasterPos4fv(const GLfloat * v) +{ + generic_16_byte(X_GLrop_RasterPos4fv, v); +} + +#define X_GLrop_RasterPos4iv 43 +void +__indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_RasterPos4iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos4iv 43 +void +__indirect_glRasterPos4iv(const GLint * v) +{ + generic_16_byte(X_GLrop_RasterPos4iv, v); +} + +#define X_GLrop_RasterPos4sv 44 +void +__indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_RasterPos4sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&w), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_RasterPos4sv 44 +void +__indirect_glRasterPos4sv(const GLshort * v) +{ + generic_8_byte(X_GLrop_RasterPos4sv, v); +} + +#define X_GLrop_Rectdv 45 +void +__indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y1), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&x2), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&y2), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectdv 45 +void +__indirect_glRectdv(const GLdouble * v1, const GLdouble * v2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 16); + (void) memcpy((void *) (gc->pc + 20), (void *) (v2), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectfv 46 +void +__indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectfv 46 +void +__indirect_glRectfv(const GLfloat * v1, const GLfloat * v2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (v2), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectiv 47 +void +__indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectiv 47 +void +__indirect_glRectiv(const GLint * v1, const GLint * v2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (v2), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectsv 48 +void +__indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y1), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x2), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y2), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rectsv 48 +void +__indirect_glRectsv(const GLshort * v1, const GLshort * v2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord1dv 49 +void +__indirect_glTexCoord1d(GLdouble s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_TexCoord1dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord1dv 49 +void +__indirect_glTexCoord1dv(const GLdouble * v) +{ + generic_8_byte(X_GLrop_TexCoord1dv, v); +} + +#define X_GLrop_TexCoord1fv 50 +void +__indirect_glTexCoord1f(GLfloat s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_TexCoord1fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord1fv 50 +void +__indirect_glTexCoord1fv(const GLfloat * v) +{ + generic_4_byte(X_GLrop_TexCoord1fv, v); +} + +#define X_GLrop_TexCoord1iv 51 +void +__indirect_glTexCoord1i(GLint s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_TexCoord1iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord1iv 51 +void +__indirect_glTexCoord1iv(const GLint * v) +{ + generic_4_byte(X_GLrop_TexCoord1iv, v); +} + +#define X_GLrop_TexCoord1sv 52 +void +__indirect_glTexCoord1s(GLshort s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord1sv 52 +void +__indirect_glTexCoord1sv(const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord2dv 53 +void +__indirect_glTexCoord2d(GLdouble s, GLdouble t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_TexCoord2dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord2dv 53 +void +__indirect_glTexCoord2dv(const GLdouble * v) +{ + generic_16_byte(X_GLrop_TexCoord2dv, v); +} + +#define X_GLrop_TexCoord2fv 54 +void +__indirect_glTexCoord2f(GLfloat s, GLfloat t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_TexCoord2fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord2fv 54 +void +__indirect_glTexCoord2fv(const GLfloat * v) +{ + generic_8_byte(X_GLrop_TexCoord2fv, v); +} + +#define X_GLrop_TexCoord2iv 55 +void +__indirect_glTexCoord2i(GLint s, GLint t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_TexCoord2iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord2iv 55 +void +__indirect_glTexCoord2iv(const GLint * v) +{ + generic_8_byte(X_GLrop_TexCoord2iv, v); +} + +#define X_GLrop_TexCoord2sv 56 +void +__indirect_glTexCoord2s(GLshort s, GLshort t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_TexCoord2sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&t), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord2sv 56 +void +__indirect_glTexCoord2sv(const GLshort * v) +{ + generic_4_byte(X_GLrop_TexCoord2sv, v); +} + +#define X_GLrop_TexCoord3dv 57 +void +__indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_TexCoord3dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord3dv 57 +void +__indirect_glTexCoord3dv(const GLdouble * v) +{ + generic_24_byte(X_GLrop_TexCoord3dv, v); +} + +#define X_GLrop_TexCoord3fv 58 +void +__indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexCoord3fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord3fv 58 +void +__indirect_glTexCoord3fv(const GLfloat * v) +{ + generic_12_byte(X_GLrop_TexCoord3fv, v); +} + +#define X_GLrop_TexCoord3iv 59 +void +__indirect_glTexCoord3i(GLint s, GLint t, GLint r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexCoord3iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord3iv 59 +void +__indirect_glTexCoord3iv(const GLint * v) +{ + generic_12_byte(X_GLrop_TexCoord3iv, v); +} + +#define X_GLrop_TexCoord3sv 60 +void +__indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_TexCoord3sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&r), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord3sv 60 +void +__indirect_glTexCoord3sv(const GLshort * v) +{ + generic_6_byte(X_GLrop_TexCoord3sv, v); +} + +#define X_GLrop_TexCoord4dv 61 +void +__indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_TexCoord4dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&q), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord4dv 61 +void +__indirect_glTexCoord4dv(const GLdouble * v) +{ + generic_32_byte(X_GLrop_TexCoord4dv, v); +} + +#define X_GLrop_TexCoord4fv 62 +void +__indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_TexCoord4fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&q), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord4fv 62 +void +__indirect_glTexCoord4fv(const GLfloat * v) +{ + generic_16_byte(X_GLrop_TexCoord4fv, v); +} + +#define X_GLrop_TexCoord4iv 63 +void +__indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_TexCoord4iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&q), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord4iv 63 +void +__indirect_glTexCoord4iv(const GLint * v) +{ + generic_16_byte(X_GLrop_TexCoord4iv, v); +} + +#define X_GLrop_TexCoord4sv 64 +void +__indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_TexCoord4sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&r), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&q), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexCoord4sv 64 +void +__indirect_glTexCoord4sv(const GLshort * v) +{ + generic_8_byte(X_GLrop_TexCoord4sv, v); +} + +#define X_GLrop_Vertex2dv 65 +void +__indirect_glVertex2d(GLdouble x, GLdouble y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Vertex2dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex2dv 65 +void +__indirect_glVertex2dv(const GLdouble * v) +{ + generic_16_byte(X_GLrop_Vertex2dv, v); +} + +#define X_GLrop_Vertex2fv 66 +void +__indirect_glVertex2f(GLfloat x, GLfloat y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Vertex2fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex2fv 66 +void +__indirect_glVertex2fv(const GLfloat * v) +{ + generic_8_byte(X_GLrop_Vertex2fv, v); +} + +#define X_GLrop_Vertex2iv 67 +void +__indirect_glVertex2i(GLint x, GLint y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Vertex2iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex2iv 67 +void +__indirect_glVertex2iv(const GLint * v) +{ + generic_8_byte(X_GLrop_Vertex2iv, v); +} + +#define X_GLrop_Vertex2sv 68 +void +__indirect_glVertex2s(GLshort x, GLshort y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Vertex2sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex2sv 68 +void +__indirect_glVertex2sv(const GLshort * v) +{ + generic_4_byte(X_GLrop_Vertex2sv, v); +} + +#define X_GLrop_Vertex3dv 69 +void +__indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_Vertex3dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex3dv 69 +void +__indirect_glVertex3dv(const GLdouble * v) +{ + generic_24_byte(X_GLrop_Vertex3dv, v); +} + +#define X_GLrop_Vertex3fv 70 +void +__indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Vertex3fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex3fv 70 +void +__indirect_glVertex3fv(const GLfloat * v) +{ + generic_12_byte(X_GLrop_Vertex3fv, v); +} + +#define X_GLrop_Vertex3iv 71 +void +__indirect_glVertex3i(GLint x, GLint y, GLint z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Vertex3iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex3iv 71 +void +__indirect_glVertex3iv(const GLint * v) +{ + generic_12_byte(X_GLrop_Vertex3iv, v); +} + +#define X_GLrop_Vertex3sv 72 +void +__indirect_glVertex3s(GLshort x, GLshort y, GLshort z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Vertex3sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex3sv 72 +void +__indirect_glVertex3sv(const GLshort * v) +{ + generic_6_byte(X_GLrop_Vertex3sv, v); +} + +#define X_GLrop_Vertex4dv 73 +void +__indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_Vertex4dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex4dv 73 +void +__indirect_glVertex4dv(const GLdouble * v) +{ + generic_32_byte(X_GLrop_Vertex4dv, v); +} + +#define X_GLrop_Vertex4fv 74 +void +__indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Vertex4fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex4fv 74 +void +__indirect_glVertex4fv(const GLfloat * v) +{ + generic_16_byte(X_GLrop_Vertex4fv, v); +} + +#define X_GLrop_Vertex4iv 75 +void +__indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Vertex4iv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex4iv 75 +void +__indirect_glVertex4iv(const GLint * v) +{ + generic_16_byte(X_GLrop_Vertex4iv, v); +} + +#define X_GLrop_Vertex4sv 76 +void +__indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Vertex4sv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&w), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Vertex4sv 76 +void +__indirect_glVertex4sv(const GLshort * v) +{ + generic_8_byte(X_GLrop_Vertex4sv, v); +} + +#define X_GLrop_ClipPlane 77 +void +__indirect_glClipPlane(GLenum plane, const GLdouble * equation) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_ClipPlane, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (equation), 32); + (void) memcpy((void *) (gc->pc + 36), (void *) (&plane), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ColorMaterial 78 +void +__indirect_glColorMaterial(GLenum face, GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_ColorMaterial, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CullFace 79 +void +__indirect_glCullFace(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_CullFace, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Fogf 80 +void +__indirect_glFogf(GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Fogf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Fogfv 81 +void +__indirect_glFogfv(GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glFogfv_size(pname); + const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_Fogfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Fogi 82 +void +__indirect_glFogi(GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Fogi, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Fogiv 83 +void +__indirect_glFogiv(GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glFogiv_size(pname); + const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_Fogiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FrontFace 84 +void +__indirect_glFrontFace(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_FrontFace, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Hint 85 +void +__indirect_glHint(GLenum target, GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Hint, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Lightf 86 +void +__indirect_glLightf(GLenum light, GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Lightf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Lightfv 87 +void +__indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glLightfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_Lightfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Lighti 88 +void +__indirect_glLighti(GLenum light, GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Lighti, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Lightiv 89 +void +__indirect_glLightiv(GLenum light, GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glLightiv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_Lightiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LightModelf 90 +void +__indirect_glLightModelf(GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_LightModelf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LightModelfv 91 +void +__indirect_glLightModelfv(GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glLightModelfv_size(pname); + const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_LightModelfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LightModeli 92 +void +__indirect_glLightModeli(GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_LightModeli, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LightModeliv 93 +void +__indirect_glLightModeliv(GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glLightModeliv_size(pname); + const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_LightModeliv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LineStipple 94 +void +__indirect_glLineStipple(GLint factor, GLushort pattern) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_LineStipple, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&factor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pattern), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LineWidth 95 +void +__indirect_glLineWidth(GLfloat width) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_LineWidth, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&width), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Materialf 96 +void +__indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Materialf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Materialfv 97 +void +__indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glMaterialfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_Materialfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Materiali 98 +void +__indirect_glMateriali(GLenum face, GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Materiali, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Materialiv 99 +void +__indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glMaterialiv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_Materialiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PointSize 100 +void +__indirect_glPointSize(GLfloat size) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_PointSize, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&size), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PolygonMode 101 +void +__indirect_glPolygonMode(GLenum face, GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PolygonMode, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PolygonStipple 102 +void +__indirect_glPolygonStipple(const GLubyte *mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, + 0) : 0; + const GLuint cmdlen = 24 + __GLX_PAD(compsize); + emit_header(gc->pc, X_GLrop_PolygonStipple, cmdlen); + if (compsize > 0) { + (*gc->fillImage) (gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, + gc->pc + 24, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Scissor 103 +void +__indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Scissor, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ShadeModel 104 +void +__indirect_glShadeModel(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ShadeModel, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexParameterf 105 +void +__indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexParameterf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexParameterfv 106 +void +__indirect_glTexParameterfv(GLenum target, GLenum pname, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexParameterfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_TexParameterfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexParameteri 107 +void +__indirect_glTexParameteri(GLenum target, GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexParameteri, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexParameteriv 108 +void +__indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexParameteriv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_TexParameteriv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static void +__glx_TexImage_1D2D(unsigned opcode, unsigned dim, GLenum target, GLint level, + GLint internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + __glImageSize(width, height, 1, format, type, target); + const GLuint cmdlen = 56 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, opcode, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&border), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&type), 4); + if ((compsize > 0) && (pixels != NULL)) { + (*gc->fillImage) (gc, dim, width, height, 1, format, type, + pixels, gc->pc + 56, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = opcode; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&level), 4); + (void) memcpy((void *) (pc + 36), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 40), (void *) (&width), 4); + (void) memcpy((void *) (pc + 44), (void *) (&height), 4); + (void) memcpy((void *) (pc + 48), (void *) (&border), 4); + (void) memcpy((void *) (pc + 52), (void *) (&format), 4); + (void) memcpy((void *) (pc + 56), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, + type, pixels, pc + 60, pc + 8); + } + } +} + +#define X_GLrop_TexImage1D 109 +void +__indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLint border, GLenum format, + GLenum type, const GLvoid * pixels) +{ + __glx_TexImage_1D2D(X_GLrop_TexImage1D, 1, target, level, internalformat, + width, 1, border, format, type, pixels); +} + +#define X_GLrop_TexImage2D 110 +void +__indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, + GLenum format, GLenum type, const GLvoid * pixels) +{ + __glx_TexImage_1D2D(X_GLrop_TexImage2D, 2, target, level, internalformat, + width, height, border, format, type, pixels); +} + +#define X_GLrop_TexEnvf 111 +void +__indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexEnvf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexEnvfv 112 +void +__indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexEnvfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_TexEnvfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexEnvi 113 +void +__indirect_glTexEnvi(GLenum target, GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexEnvi, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexEnviv 114 +void +__indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexEnviv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_TexEnviv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexGend 115 +void +__indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_TexGend, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (¶m), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&pname), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexGendv 116 +void +__indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexGendv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)); + emit_header(gc->pc, X_GLrop_TexGendv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 8)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexGenf 117 +void +__indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexGenf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexGenfv 118 +void +__indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexGenfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_TexGenfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexGeni 119 +void +__indirect_glTexGeni(GLenum coord, GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_TexGeni, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_TexGeniv 120 +void +__indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glTexGeniv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_TexGeniv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_InitNames 121 +void +__indirect_glInitNames(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_InitNames, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LoadName 122 +void +__indirect_glLoadName(GLuint name) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_LoadName, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&name), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PassThrough 123 +void +__indirect_glPassThrough(GLfloat token) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_PassThrough, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&token), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PopName 124 +void +__indirect_glPopName(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_PopName, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PushName 125 +void +__indirect_glPushName(GLuint name) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_PushName, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&name), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_DrawBuffer 126 +void +__indirect_glDrawBuffer(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_DrawBuffer, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Clear 127 +void +__indirect_glClear(GLbitfield mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Clear, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ClearAccum 128 +void +__indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, + GLfloat alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_ClearAccum, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ClearIndex 129 +void +__indirect_glClearIndex(GLfloat c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ClearIndex, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ClearColor 130 +void +__indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, + GLclampf alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_ClearColor, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ClearStencil 131 +void +__indirect_glClearStencil(GLint s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ClearStencil, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ClearDepth 132 +void +__indirect_glClearDepth(GLclampd depth) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_ClearDepth, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&depth), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_StencilMask 133 +void +__indirect_glStencilMask(GLuint mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_StencilMask, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ColorMask 134 +void +__indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, + GLboolean alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ColorMask, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_DepthMask 135 +void +__indirect_glDepthMask(GLboolean flag) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_DepthMask, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&flag), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_IndexMask 136 +void +__indirect_glIndexMask(GLuint mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_IndexMask, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Accum 137 +void +__indirect_glAccum(GLenum op, GLfloat value) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_Accum, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&value), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PopAttrib 141 +void +__indirect_glPopAttrib(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_PopAttrib, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PushAttrib 142 +void +__indirect_glPushAttrib(GLbitfield mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_PushAttrib, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MapGrid1d 147 +void +__indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MapGrid1d, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&un), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MapGrid1f 148 +void +__indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MapGrid1f, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&un), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&u1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MapGrid2d 149 +void +__indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, + GLdouble v1, GLdouble v2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44; + emit_header(gc->pc, X_GLrop_MapGrid2d, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&v1), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&v2), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&un), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&vn), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MapGrid2f 150 +void +__indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, + GLfloat v2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_MapGrid2f, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&un), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&u1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&vn), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&v1), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&v2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalCoord1dv 151 +void +__indirect_glEvalCoord1d(GLdouble u) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_EvalCoord1dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalCoord1dv 151 +void +__indirect_glEvalCoord1dv(const GLdouble * u) +{ + generic_8_byte(X_GLrop_EvalCoord1dv, u); +} + +#define X_GLrop_EvalCoord1fv 152 +void +__indirect_glEvalCoord1f(GLfloat u) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_EvalCoord1fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalCoord1fv 152 +void +__indirect_glEvalCoord1fv(const GLfloat * u) +{ + generic_4_byte(X_GLrop_EvalCoord1fv, u); +} + +#define X_GLrop_EvalCoord2dv 153 +void +__indirect_glEvalCoord2d(GLdouble u, GLdouble v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_EvalCoord2dv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalCoord2dv 153 +void +__indirect_glEvalCoord2dv(const GLdouble * u) +{ + generic_16_byte(X_GLrop_EvalCoord2dv, u); +} + +#define X_GLrop_EvalCoord2fv 154 +void +__indirect_glEvalCoord2f(GLfloat u, GLfloat v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_EvalCoord2fv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalCoord2fv 154 +void +__indirect_glEvalCoord2fv(const GLfloat * u) +{ + generic_8_byte(X_GLrop_EvalCoord2fv, u); +} + +#define X_GLrop_EvalMesh1 155 +void +__indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_EvalMesh1, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&i1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&i2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalPoint1 156 +void +__indirect_glEvalPoint1(GLint i) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_EvalPoint1, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&i), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalMesh2 157 +void +__indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_EvalMesh2, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&i1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&i2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&j1), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&j2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_EvalPoint2 158 +void +__indirect_glEvalPoint2(GLint i, GLint j) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_EvalPoint2, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&i), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&j), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_AlphaFunc 159 +void +__indirect_glAlphaFunc(GLenum func, GLclampf ref) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_AlphaFunc, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ref), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_BlendFunc 160 +void +__indirect_glBlendFunc(GLenum sfactor, GLenum dfactor) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BlendFunc, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&sfactor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&dfactor), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LogicOp 161 +void +__indirect_glLogicOp(GLenum opcode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_LogicOp, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&opcode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_StencilFunc 162 +void +__indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_StencilFunc, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ref), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&mask), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_StencilOp 163 +void +__indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_StencilOp, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&fail), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&zfail), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&zpass), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_DepthFunc 164 +void +__indirect_glDepthFunc(GLenum func) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_DepthFunc, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PixelZoom 165 +void +__indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PixelZoom, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&xfactor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&yfactor), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PixelTransferf 166 +void +__indirect_glPixelTransferf(GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PixelTransferf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PixelTransferi 167 +void +__indirect_glPixelTransferi(GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PixelTransferi, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PixelMapfv 168 +void +__indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4)); + if (mapsize < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_PixelMapfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&map), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mapsize), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (values), + (mapsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_PixelMapfv; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&map), 4); + (void) memcpy((void *) (pc + 12), (void *) (&mapsize), 4); + __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 4)); + } + } +} + +#define X_GLrop_PixelMapuiv 169 +void +__indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4)); + if (mapsize < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_PixelMapuiv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&map), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mapsize), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (values), + (mapsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_PixelMapuiv; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&map), 4); + (void) memcpy((void *) (pc + 12), (void *) (&mapsize), 4); + __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 4)); + } + } +} + +#define X_GLrop_PixelMapusv 170 +void +__indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 2)); + if (mapsize < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_PixelMapusv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&map), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mapsize), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (values), + (mapsize * 2)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_PixelMapusv; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&map), 4); + (void) memcpy((void *) (pc + 12), (void *) (&mapsize), 4); + __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 2)); + } + } +} + +#define X_GLrop_ReadBuffer 171 +void +__indirect_glReadBuffer(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ReadBuffer, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyPixels 172 +void +__indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, + GLenum type) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_CopyPixels, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&type), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_ReadPixels 111 +void +__indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 28; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_read_pixels_reply_t *reply = + xcb_glx_read_pixels_reply(c, + xcb_glx_read_pixels(c, + gc-> + currentContextTag, + x, y, width, height, + format, type, + state->storePack. + swapEndian, 0), + NULL); + (void) memcpy(pixels, xcb_glx_read_pixels_data(reply), + xcb_glx_read_pixels_data_length(reply) * + sizeof(GLvoid)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_ReadPixels, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&x), 4); + (void) memcpy((void *) (pc + 4), (void *) (&y), 4); + (void) memcpy((void *) (pc + 8), (void *) (&width), 4); + (void) memcpy((void *) (pc + 12), (void *) (&height), 4); + (void) memcpy((void *) (pc + 16), (void *) (&format), 4); + (void) memcpy((void *) (pc + 20), (void *) (&type), 4); + *(int32_t *) (pc + 24) = 0; + *(int8_t *) (pc + 24) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 2, width, height, 1, format, type, + pixels, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLrop_DrawPixels 173 +void +__indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, 1, format, type, + 0) : 0; + const GLuint cmdlen = 40 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_DrawPixels, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&type), 4); + if (compsize > 0) { + (*gc->fillImage) (gc, 2, width, height, 1, format, type, + pixels, gc->pc + 40, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_DrawPixels; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&width), 4); + (void) memcpy((void *) (pc + 32), (void *) (&height), 4); + (void) memcpy((void *) (pc + 36), (void *) (&format), 4); + (void) memcpy((void *) (pc + 40), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, 2, width, height, 1, format, + type, pixels, pc + 44, pc + 8); + } + } +} + +#define X_GLsop_GetClipPlane 113 +void +__indirect_glGetClipPlane(GLenum plane, GLdouble * equation) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_clip_plane_reply_t *reply = + xcb_glx_get_clip_plane_reply(c, + xcb_glx_get_clip_plane(c, + gc-> + currentContextTag, + plane), NULL); + (void) memcpy(equation, xcb_glx_get_clip_plane_data(reply), + xcb_glx_get_clip_plane_data_length(reply) * + sizeof(GLdouble)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&plane), 4); + (void) __glXReadReply(dpy, 8, equation, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetLightfv 118 +void +__indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_lightfv_reply_t *reply = + xcb_glx_get_lightfv_reply(c, + xcb_glx_get_lightfv(c, + gc-> + currentContextTag, + light, pname), + NULL); + if (xcb_glx_get_lightfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_lightfv_data(reply), + xcb_glx_get_lightfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetLightfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&light), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetLightiv 119 +void +__indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_lightiv_reply_t *reply = + xcb_glx_get_lightiv_reply(c, + xcb_glx_get_lightiv(c, + gc-> + currentContextTag, + light, pname), + NULL); + if (xcb_glx_get_lightiv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_lightiv_data(reply), + xcb_glx_get_lightiv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetLightiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&light), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetMapdv 120 +void +__indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_mapdv_reply_t *reply = + xcb_glx_get_mapdv_reply(c, + xcb_glx_get_mapdv(c, + gc->currentContextTag, + target, query), NULL); + if (xcb_glx_get_mapdv_data_length(reply) == 0) + (void) memcpy(v, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(v, xcb_glx_get_mapdv_data(reply), + xcb_glx_get_mapdv_data_length(reply) * + sizeof(GLdouble)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMapdv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&query), 4); + (void) __glXReadReply(dpy, 8, v, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetMapfv 121 +void +__indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_mapfv_reply_t *reply = + xcb_glx_get_mapfv_reply(c, + xcb_glx_get_mapfv(c, + gc->currentContextTag, + target, query), NULL); + if (xcb_glx_get_mapfv_data_length(reply) == 0) + (void) memcpy(v, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(v, xcb_glx_get_mapfv_data(reply), + xcb_glx_get_mapfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMapfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&query), 4); + (void) __glXReadReply(dpy, 4, v, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetMapiv 122 +void +__indirect_glGetMapiv(GLenum target, GLenum query, GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_mapiv_reply_t *reply = + xcb_glx_get_mapiv_reply(c, + xcb_glx_get_mapiv(c, + gc->currentContextTag, + target, query), NULL); + if (xcb_glx_get_mapiv_data_length(reply) == 0) + (void) memcpy(v, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(v, xcb_glx_get_mapiv_data(reply), + xcb_glx_get_mapiv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMapiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&query), 4); + (void) __glXReadReply(dpy, 4, v, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetMaterialfv 123 +void +__indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_materialfv_reply_t *reply = + xcb_glx_get_materialfv_reply(c, + xcb_glx_get_materialfv(c, + gc-> + currentContextTag, + face, pname), + NULL); + if (xcb_glx_get_materialfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_materialfv_data(reply), + xcb_glx_get_materialfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMaterialfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&face), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetMaterialiv 124 +void +__indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_materialiv_reply_t *reply = + xcb_glx_get_materialiv_reply(c, + xcb_glx_get_materialiv(c, + gc-> + currentContextTag, + face, pname), + NULL); + if (xcb_glx_get_materialiv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_materialiv_data(reply), + xcb_glx_get_materialiv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMaterialiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&face), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetPixelMapfv 125 +void +__indirect_glGetPixelMapfv(GLenum map, GLfloat * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_pixel_mapfv_reply_t *reply = + xcb_glx_get_pixel_mapfv_reply(c, + xcb_glx_get_pixel_mapfv(c, + gc-> + currentContextTag, + map), NULL); + if (xcb_glx_get_pixel_mapfv_data_length(reply) == 0) + (void) memcpy(values, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(values, xcb_glx_get_pixel_mapfv_data(reply), + xcb_glx_get_pixel_mapfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&map), 4); + (void) __glXReadReply(dpy, 4, values, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetPixelMapuiv 126 +void +__indirect_glGetPixelMapuiv(GLenum map, GLuint * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_pixel_mapuiv_reply_t *reply = + xcb_glx_get_pixel_mapuiv_reply(c, + xcb_glx_get_pixel_mapuiv(c, + gc-> + currentContextTag, + map), + NULL); + if (xcb_glx_get_pixel_mapuiv_data_length(reply) == 0) + (void) memcpy(values, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(values, xcb_glx_get_pixel_mapuiv_data(reply), + xcb_glx_get_pixel_mapuiv_data_length(reply) * + sizeof(GLuint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&map), 4); + (void) __glXReadReply(dpy, 4, values, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetPixelMapusv 127 +void +__indirect_glGetPixelMapusv(GLenum map, GLushort * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_pixel_mapusv_reply_t *reply = + xcb_glx_get_pixel_mapusv_reply(c, + xcb_glx_get_pixel_mapusv(c, + gc-> + currentContextTag, + map), + NULL); + if (xcb_glx_get_pixel_mapusv_data_length(reply) == 0) + (void) memcpy(values, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(values, xcb_glx_get_pixel_mapusv_data(reply), + xcb_glx_get_pixel_mapusv_data_length(reply) * + sizeof(GLushort)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&map), 4); + (void) __glXReadReply(dpy, 2, values, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetPolygonStipple 128 +void +__indirect_glGetPolygonStipple(GLubyte *mask) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_polygon_stipple_reply_t *reply = + xcb_glx_get_polygon_stipple_reply(c, + xcb_glx_get_polygon_stipple(c, + gc-> + currentContextTag, + 0), + NULL); + (void) memcpy(mask, xcb_glx_get_polygon_stipple_data(reply), + xcb_glx_get_polygon_stipple_data_length(reply) * + sizeof(GLubyte)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPolygonStipple, cmdlen); + *(int32_t *) (pc + 0) = 0; + __glXReadPixelReply(dpy, gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, + mask, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexEnvfv 130 +void +__indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_envfv_reply_t *reply = + xcb_glx_get_tex_envfv_reply(c, + xcb_glx_get_tex_envfv(c, + gc-> + currentContextTag, + target, pname), + NULL); + if (xcb_glx_get_tex_envfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_envfv_data(reply), + xcb_glx_get_tex_envfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexEnvfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexEnviv 131 +void +__indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_enviv_reply_t *reply = + xcb_glx_get_tex_enviv_reply(c, + xcb_glx_get_tex_enviv(c, + gc-> + currentContextTag, + target, pname), + NULL); + if (xcb_glx_get_tex_enviv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_enviv_data(reply), + xcb_glx_get_tex_enviv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexEnviv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexGendv 132 +void +__indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_gendv_reply_t *reply = + xcb_glx_get_tex_gendv_reply(c, + xcb_glx_get_tex_gendv(c, + gc-> + currentContextTag, + coord, pname), + NULL); + if (xcb_glx_get_tex_gendv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_gendv_data(reply), + xcb_glx_get_tex_gendv_data_length(reply) * + sizeof(GLdouble)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexGendv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&coord), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 8, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexGenfv 133 +void +__indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_genfv_reply_t *reply = + xcb_glx_get_tex_genfv_reply(c, + xcb_glx_get_tex_genfv(c, + gc-> + currentContextTag, + coord, pname), + NULL); + if (xcb_glx_get_tex_genfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_genfv_data(reply), + xcb_glx_get_tex_genfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexGenfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&coord), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexGeniv 134 +void +__indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_geniv_reply_t *reply = + xcb_glx_get_tex_geniv_reply(c, + xcb_glx_get_tex_geniv(c, + gc-> + currentContextTag, + coord, pname), + NULL); + if (xcb_glx_get_tex_geniv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_geniv_data(reply), + xcb_glx_get_tex_geniv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexGeniv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&coord), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexImage 135 +void +__indirect_glGetTexImage(GLenum target, GLint level, GLenum format, + GLenum type, GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 20; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_image_reply_t *reply = + xcb_glx_get_tex_image_reply(c, + xcb_glx_get_tex_image(c, + gc-> + currentContextTag, + target, level, + format, type, + state-> + storePack. + swapEndian), + NULL); + (void) memcpy(pixels, xcb_glx_get_tex_image_data(reply), + xcb_glx_get_tex_image_data_length(reply) * + sizeof(GLvoid)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexImage, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&level), 4); + (void) memcpy((void *) (pc + 8), (void *) (&format), 4); + (void) memcpy((void *) (pc + 12), (void *) (&type), 4); + *(int32_t *) (pc + 16) = 0; + *(int8_t *) (pc + 16) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 3, 0, 0, 0, format, type, pixels, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexParameterfv 136 +void +__indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_parameterfv_reply_t *reply = + xcb_glx_get_tex_parameterfv_reply(c, + xcb_glx_get_tex_parameterfv(c, + gc-> + currentContextTag, + target, + pname), + NULL); + if (xcb_glx_get_tex_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_parameterfv_data(reply), + xcb_glx_get_tex_parameterfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexParameterfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexParameteriv 137 +void +__indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_parameteriv_reply_t *reply = + xcb_glx_get_tex_parameteriv_reply(c, + xcb_glx_get_tex_parameteriv(c, + gc-> + currentContextTag, + target, + pname), + NULL); + if (xcb_glx_get_tex_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_tex_parameteriv_data(reply), + xcb_glx_get_tex_parameteriv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexParameteriv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexLevelParameterfv 138 +void +__indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 12; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_level_parameterfv_reply_t *reply = + xcb_glx_get_tex_level_parameterfv_reply(c, + xcb_glx_get_tex_level_parameterfv + (c, gc->currentContextTag, + target, level, pname), + NULL); + if (xcb_glx_get_tex_level_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_tex_level_parameterfv_data(reply), + xcb_glx_get_tex_level_parameterfv_data_length(reply) + * sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&level), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetTexLevelParameteriv 139 +void +__indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 12; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_tex_level_parameteriv_reply_t *reply = + xcb_glx_get_tex_level_parameteriv_reply(c, + xcb_glx_get_tex_level_parameteriv + (c, gc->currentContextTag, + target, level, pname), + NULL); + if (xcb_glx_get_tex_level_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_tex_level_parameteriv_data(reply), + xcb_glx_get_tex_level_parameteriv_data_length(reply) + * sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&level), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_IsList 141 +GLboolean +__indirect_glIsList(GLuint list) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_is_list_reply_t *reply = + xcb_glx_is_list_reply(c, + xcb_glx_is_list(c, gc->currentContextTag, + list), NULL); + retval = reply->ret_val; + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_IsList, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&list), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return retval; +} + +#define X_GLrop_DepthRange 174 +void +__indirect_glDepthRange(GLclampd zNear, GLclampd zFar) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_DepthRange, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&zNear), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&zFar), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Frustum 175 +void +__indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, + GLdouble top, GLdouble zNear, GLdouble zFar) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 52; + emit_header(gc->pc, X_GLrop_Frustum, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&left), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&right), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&bottom), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&top), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&zNear), 8); + (void) memcpy((void *) (gc->pc + 44), (void *) (&zFar), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LoadIdentity 176 +void +__indirect_glLoadIdentity(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_LoadIdentity, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LoadMatrixf 177 +void +__indirect_glLoadMatrixf(const GLfloat * m) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 68; + emit_header(gc->pc, X_GLrop_LoadMatrixf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 64); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_LoadMatrixd 178 +void +__indirect_glLoadMatrixd(const GLdouble * m) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 132; + emit_header(gc->pc, X_GLrop_LoadMatrixd, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 128); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MatrixMode 179 +void +__indirect_glMatrixMode(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_MatrixMode, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultMatrixf 180 +void +__indirect_glMultMatrixf(const GLfloat * m) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 68; + emit_header(gc->pc, X_GLrop_MultMatrixf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 64); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultMatrixd 181 +void +__indirect_glMultMatrixd(const GLdouble * m) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 132; + emit_header(gc->pc, X_GLrop_MultMatrixd, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 128); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Ortho 182 +void +__indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, + GLdouble top, GLdouble zNear, GLdouble zFar) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 52; + emit_header(gc->pc, X_GLrop_Ortho, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&left), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&right), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&bottom), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&top), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&zNear), 8); + (void) memcpy((void *) (gc->pc + 44), (void *) (&zFar), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PopMatrix 183 +void +__indirect_glPopMatrix(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_PopMatrix, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PushMatrix 184 +void +__indirect_glPushMatrix(void) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 4; + emit_header(gc->pc, X_GLrop_PushMatrix, cmdlen); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rotated 185 +void +__indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_Rotated, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&angle), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Rotatef 186 +void +__indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Rotatef, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&angle), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Scaled 187 +void +__indirect_glScaled(GLdouble x, GLdouble y, GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_Scaled, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Scalef 188 +void +__indirect_glScalef(GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Scalef, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Translated 189 +void +__indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_Translated, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Translatef 190 +void +__indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Translatef, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Viewport 191 +void +__indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Viewport, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_BindTexture 4117 +void +__indirect_glBindTexture(GLenum target, GLuint texture) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BindTexture, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&texture), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexubv 194 +void +__indirect_glIndexub(GLubyte c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Indexubv 194 +void +__indirect_glIndexubv(const GLubyte *c) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (c), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PolygonOffset 192 +void +__indirect_glPolygonOffset(GLfloat factor, GLfloat units) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PolygonOffset, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&factor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&units), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyTexImage1D 4119 +void +__indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLint border) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_CopyTexImage1D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&border), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyTexImage2D 4120 +void +__indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_CopyTexImage2D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&border), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyTexSubImage1D 4121 +void +__indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, + GLint x, GLint y, GLsizei width) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_CopyTexSubImage1D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyTexSubImage2D 4122 +void +__indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLint x, GLint y, GLsizei width, + GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 36; + emit_header(gc->pc, X_GLrop_CopyTexSubImage2D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_DeleteTextures 144 +void +__indirect_glDeleteTextures(GLsizei n, const GLuint * textures) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); +#endif + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_delete_textures(c, gc->currentContextTag, n, textures); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_DeleteTextures, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_DeleteTexturesEXT 12 +void +glDeleteTexturesEXT(GLsizei n, const GLuint * textures) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_DeleteTextures(GET_DISPATCH(), (n, textures)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivate, + X_GLvop_DeleteTexturesEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GenTextures 145 +void +__indirect_glGenTextures(GLsizei n, GLuint * textures) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_gen_textures_reply_t *reply = + xcb_glx_gen_textures_reply(c, + xcb_glx_gen_textures(c, + gc-> + currentContextTag, + n), NULL); + (void) memcpy(textures, xcb_glx_gen_textures_data(reply), + xcb_glx_gen_textures_data_length(reply) * + sizeof(GLuint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, textures, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GenTexturesEXT 13 +void +glGenTexturesEXT(GLsizei n, GLuint * textures) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GenTextures(GET_DISPATCH(), (n, textures)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4; + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenTexturesEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, textures, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_IsTexture 146 +GLboolean +__indirect_glIsTexture(GLuint texture) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_is_texture_reply_t *reply = + xcb_glx_is_texture_reply(c, + xcb_glx_is_texture(c, + gc->currentContextTag, + texture), NULL); + retval = reply->ret_val; + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_IsTexture, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&texture), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return retval; +} + +#define X_GLvop_IsTextureEXT 14 +GLboolean +glIsTextureEXT(GLuint texture) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + return CALL_IsTexture(GET_DISPATCH(), (texture)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsTextureEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&texture), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; + } +} + +#define X_GLrop_PrioritizeTextures 4118 +void +__indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, + const GLclampf * priorities) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8 + __GLX_PAD((n * 4)) + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_PrioritizeTextures, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (textures), (n * 4)); + (void) memcpy((void *) (gc->pc + 8 + (n * 4)), (void *) (priorities), + (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +static void +__glx_TexSubImage_1D2D(unsigned opcode, unsigned dim, GLenum target, + GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, 1, format, type, + target) : 0; + const GLuint cmdlen = 60 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, opcode, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&type), 4); + (void) memset((void *) (gc->pc + 56), 0, 4); + if (compsize > 0) { + (*gc->fillImage) (gc, dim, width, height, 1, format, type, + pixels, gc->pc + 60, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = opcode; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&level), 4); + (void) memcpy((void *) (pc + 36), (void *) (&xoffset), 4); + (void) memcpy((void *) (pc + 40), (void *) (&yoffset), 4); + (void) memcpy((void *) (pc + 44), (void *) (&width), 4); + (void) memcpy((void *) (pc + 48), (void *) (&height), 4); + (void) memcpy((void *) (pc + 52), (void *) (&format), 4); + (void) memcpy((void *) (pc + 56), (void *) (&type), 4); + (void) memset((void *) (pc + 60), 0, 4); + __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, + type, pixels, pc + 64, pc + 8); + } + } +} + +#define X_GLrop_TexSubImage1D 4099 +void +__indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, + GLsizei width, GLenum format, GLenum type, + const GLvoid * pixels) +{ + __glx_TexSubImage_1D2D(X_GLrop_TexSubImage1D, 1, target, level, xoffset, + 1, width, 1, format, type, pixels); +} + +#define X_GLrop_TexSubImage2D 4100 +void +__indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid * pixels) +{ + __glx_TexSubImage_1D2D(X_GLrop_TexSubImage2D, 2, target, level, xoffset, + yoffset, width, height, format, type, pixels); +} + +#define X_GLrop_BlendColor 4096 +void +__indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, + GLclampf alpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_BlendColor, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_BlendEquation 4097 +void +__indirect_glBlendEquation(GLenum mode) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_BlendEquation, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ColorTable 2053 +void +__indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, + GLenum format, GLenum type, const GLvoid * table) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (table != NULL) ? __glImageSize(width, 1, 1, format, type, + target) : 0; + const GLuint cmdlen = 44 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_ColorTable, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&type), 4); + if (compsize > 0) { + (*gc->fillImage) (gc, 1, width, 1, 1, format, type, table, + gc->pc + 44, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_1D, + default_pixel_store_1D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_ColorTable; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 36), (void *) (&width), 4); + (void) memcpy((void *) (pc + 40), (void *) (&format), 4); + (void) memcpy((void *) (pc + 44), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, 1, width, 1, 1, format, type, + table, pc + 48, pc + 8); + } + } +} + +#define X_GLrop_ColorTableParameterfv 2054 +void +__indirect_glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glColorTableParameterfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_ColorTableParameterfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ColorTableParameteriv 2055 +void +__indirect_glColorTableParameteriv(GLenum target, GLenum pname, + const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glColorTableParameteriv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_ColorTableParameteriv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyColorTable 2056 +void +__indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, + GLint y, GLsizei width) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_CopyColorTable, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_GetColorTable 147 +void +__indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, + GLvoid * table) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 16; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_color_table_reply_t *reply = + xcb_glx_get_color_table_reply(c, + xcb_glx_get_color_table(c, + gc-> + currentContextTag, + target, + format, + type, + state-> + storePack. + swapEndian), + NULL); + (void) memcpy(table, xcb_glx_get_color_table_data(reply), + xcb_glx_get_color_table_data_length(reply) * + sizeof(GLvoid)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetColorTable, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetColorTableSGI 4098 +void +glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetColorTableSGI, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetColorTableParameterfv 148 +void +__indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_color_table_parameterfv_reply_t *reply = + xcb_glx_get_color_table_parameterfv_reply(c, + xcb_glx_get_color_table_parameterfv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_color_table_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_color_table_parameterfv_data(reply), + xcb_glx_get_color_table_parameterfv_data_length + (reply) * sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetColorTableParameterfvSGI 4099 +void +glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetColorTableParameterfv(GET_DISPATCH(), + (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetColorTableParameterfvSGI, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetColorTableParameteriv 149 +void +__indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_color_table_parameteriv_reply_t *reply = + xcb_glx_get_color_table_parameteriv_reply(c, + xcb_glx_get_color_table_parameteriv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_color_table_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_color_table_parameteriv_data(reply), + xcb_glx_get_color_table_parameteriv_data_length + (reply) * sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetColorTableParameterivSGI 4100 +void +glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetColorTableParameteriv(GET_DISPATCH(), + (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetColorTableParameterivSGI, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLrop_ColorSubTable 195 +void +__indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, + GLenum format, GLenum type, const GLvoid * data) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0; + const GLuint cmdlen = 44 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_ColorSubTable, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&start), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&count), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&type), 4); + if (compsize > 0) { + (*gc->fillImage) (gc, 1, count, 1, 1, format, type, data, + gc->pc + 44, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_1D, + default_pixel_store_1D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_ColorSubTable; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&start), 4); + (void) memcpy((void *) (pc + 36), (void *) (&count), 4); + (void) memcpy((void *) (pc + 40), (void *) (&format), 4); + (void) memcpy((void *) (pc + 44), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, 1, count, 1, 1, format, type, + data, pc + 48, pc + 8); + } + } +} + +#define X_GLrop_CopyColorSubTable 196 +void +__indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, + GLsizei width) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_CopyColorSubTable, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&start), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static void +__glx_ConvolutionFilter_1D2D(unsigned opcode, unsigned dim, GLenum target, + GLenum internalformat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + const GLvoid * image) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (image != NULL) ? __glImageSize(width, height, 1, format, type, + target) : 0; + const GLuint cmdlen = 48 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, opcode, cmdlen); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&type), 4); + if (compsize > 0) { + (*gc->fillImage) (gc, dim, width, height, 1, format, type, + image, gc->pc + 48, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = opcode; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 36), (void *) (&width), 4); + (void) memcpy((void *) (pc + 40), (void *) (&height), 4); + (void) memcpy((void *) (pc + 44), (void *) (&format), 4); + (void) memcpy((void *) (pc + 48), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, + type, image, pc + 52, pc + 8); + } + } +} + +#define X_GLrop_ConvolutionFilter1D 4101 +void +__indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid * image) +{ + __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter1D, 1, target, + internalformat, width, 1, format, type, + image); +} + +#define X_GLrop_ConvolutionFilter2D 4102 +void +__indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * image) +{ + __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter2D, 2, target, + internalformat, width, height, format, type, + image); +} + +#define X_GLrop_ConvolutionParameterf 4103 +void +__indirect_glConvolutionParameterf(GLenum target, GLenum pname, + GLfloat params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_ConvolutionParameterf, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶ms), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ConvolutionParameterfv 4104 +void +__indirect_glConvolutionParameterfv(GLenum target, GLenum pname, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glConvolutionParameterfv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_ConvolutionParameterfv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ConvolutionParameteri 4105 +void +__indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_ConvolutionParameteri, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶ms), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ConvolutionParameteriv 4106 +void +__indirect_glConvolutionParameteriv(GLenum target, GLenum pname, + const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glConvolutionParameteriv_size(pname); + const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_ConvolutionParameteriv, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyConvolutionFilter1D 4107 +void +__indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_CopyConvolutionFilter1D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_CopyConvolutionFilter2D 4108 +void +__indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width, + GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_CopyConvolutionFilter2D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_GetConvolutionFilter 150 +void +__indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, + GLvoid * image) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 16; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_convolution_filter_reply_t *reply = + xcb_glx_get_convolution_filter_reply(c, + xcb_glx_get_convolution_filter + (c, gc->currentContextTag, + target, format, type, + state->storePack. + swapEndian), NULL); + (void) memcpy(image, xcb_glx_get_convolution_filter_data(reply), + xcb_glx_get_convolution_filter_data_length(reply) * + sizeof(GLvoid)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionFilter, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetConvolutionFilterEXT 1 +void +gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, + GLvoid * image) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetConvolutionFilter(GET_DISPATCH(), + (target, format, type, image)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetConvolutionFilterEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetConvolutionParameterfv 151 +void +__indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_convolution_parameterfv_reply_t *reply = + xcb_glx_get_convolution_parameterfv_reply(c, + xcb_glx_get_convolution_parameterfv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_convolution_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_convolution_parameterfv_data(reply), + xcb_glx_get_convolution_parameterfv_data_length + (reply) * sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetConvolutionParameterfvEXT 2 +void +gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetConvolutionParameterfv(GET_DISPATCH(), + (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetConvolutionParameterfvEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetConvolutionParameteriv 152 +void +__indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_convolution_parameteriv_reply_t *reply = + xcb_glx_get_convolution_parameteriv_reply(c, + xcb_glx_get_convolution_parameteriv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_convolution_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_convolution_parameteriv_data(reply), + xcb_glx_get_convolution_parameteriv_data_length + (reply) * sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetConvolutionParameterivEXT 3 +void +gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetConvolutionParameteriv(GET_DISPATCH(), + (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetConvolutionParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetHistogram 154 +void +__indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 16; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_histogram_reply_t *reply = + xcb_glx_get_histogram_reply(c, + xcb_glx_get_histogram(c, + gc-> + currentContextTag, + target, reset, + format, type, + state-> + storePack. + swapEndian), + NULL); + (void) memcpy(values, xcb_glx_get_histogram_data(reply), + xcb_glx_get_histogram_data_length(reply) * + sizeof(GLvoid)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetHistogram, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetHistogramEXT 5 +void +gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetHistogram(GET_DISPATCH(), + (target, reset, format, type, values)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetHistogramEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetHistogramParameterfv 155 +void +__indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_histogram_parameterfv_reply_t *reply = + xcb_glx_get_histogram_parameterfv_reply(c, + xcb_glx_get_histogram_parameterfv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_histogram_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_histogram_parameterfv_data(reply), + xcb_glx_get_histogram_parameterfv_data_length(reply) + * sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetHistogramParameterfvEXT 6 +void +gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetHistogramParameterfvEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetHistogramParameteriv 156 +void +__indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_histogram_parameteriv_reply_t *reply = + xcb_glx_get_histogram_parameteriv_reply(c, + xcb_glx_get_histogram_parameteriv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_histogram_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, + xcb_glx_get_histogram_parameteriv_data(reply), + xcb_glx_get_histogram_parameteriv_data_length(reply) + * sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetHistogramParameterivEXT 7 +void +gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetHistogramParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetMinmax 157 +void +__indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 16; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_minmax_reply_t *reply = + xcb_glx_get_minmax_reply(c, + xcb_glx_get_minmax(c, + gc->currentContextTag, + target, reset, format, + type, + state->storePack. + swapEndian), NULL); + (void) memcpy(values, xcb_glx_get_minmax_data(reply), + xcb_glx_get_minmax_data_length(reply) * sizeof(GLvoid)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMinmax, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, + GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetMinmaxEXT 8 +void +gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetMinmaxEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, + GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetMinmaxParameterfv 158 +void +__indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_minmax_parameterfv_reply_t *reply = + xcb_glx_get_minmax_parameterfv_reply(c, + xcb_glx_get_minmax_parameterfv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_minmax_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_minmax_parameterfv_data(reply), + xcb_glx_get_minmax_parameterfv_data_length(reply) * + sizeof(GLfloat)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameterfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetMinmaxParameterfvEXT 9 +void +gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetMinmaxParameterfvEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLsop_GetMinmaxParameteriv 159 +void +__indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_minmax_parameteriv_reply_t *reply = + xcb_glx_get_minmax_parameteriv_reply(c, + xcb_glx_get_minmax_parameteriv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_minmax_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_minmax_parameteriv_data(reply), + xcb_glx_get_minmax_parameteriv_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameteriv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLvop_GetMinmaxParameterivEXT 10 +void +gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params)); + } else { +#else + { +#endif + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetMinmaxParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + +#define X_GLrop_Histogram 4110 +void +__indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, + GLboolean sink) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_Histogram, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&sink), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_Minmax 4111 +void +__indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_Minmax, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&sink), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ResetHistogram 4112 +void +__indirect_glResetHistogram(GLenum target) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ResetHistogram, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ResetMinmax 4113 +void +__indirect_glResetMinmax(GLenum target) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ResetMinmax, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +static void +__glx_TexImage_3D4D(unsigned opcode, unsigned dim, GLenum target, GLint level, + GLint internalformat, GLsizei width, GLsizei height, + GLsizei depth, GLsizei extent, GLint border, + GLenum format, GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, depth, format, type, + target) : 0; + const GLuint cmdlen = 84 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, opcode, cmdlen); + (void) memcpy((void *) (gc->pc + 40), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 56), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 60), (void *) (&depth), 4); + (void) memcpy((void *) (gc->pc + 64), (void *) (&extent), 4); + (void) memcpy((void *) (gc->pc + 68), (void *) (&border), 4); + (void) memcpy((void *) (gc->pc + 72), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 76), (void *) (&type), 4); + (void) memcpy((void *) (gc->pc + 80), + (void *) ((pixels == NULL) ? one : zero), 4); + if (compsize > 0) { + (*gc->fillImage) (gc, dim, width, height, depth, format, type, + pixels, gc->pc + 84, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_4D, + default_pixel_store_4D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = opcode; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 44), (void *) (&target), 4); + (void) memcpy((void *) (pc + 48), (void *) (&level), 4); + (void) memcpy((void *) (pc + 52), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 56), (void *) (&width), 4); + (void) memcpy((void *) (pc + 60), (void *) (&height), 4); + (void) memcpy((void *) (pc + 64), (void *) (&depth), 4); + (void) memcpy((void *) (pc + 68), (void *) (&extent), 4); + (void) memcpy((void *) (pc + 72), (void *) (&border), 4); + (void) memcpy((void *) (pc + 76), (void *) (&format), 4); + (void) memcpy((void *) (pc + 80), (void *) (&type), 4); + (void) memcpy((void *) (pc + 84), zero, 4); + __glXSendLargeImage(gc, compsize, dim, width, height, depth, + format, type, pixels, pc + 88, pc + 8); + } + } +} + +#define X_GLrop_TexImage3D 4114 +void +__indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLenum format, GLenum type, + const GLvoid * pixels) +{ + __glx_TexImage_3D4D(X_GLrop_TexImage3D, 3, target, level, internalformat, + width, height, depth, 1, border, format, type, + pixels); +} + +static void +__glx_TexSubImage_3D4D(unsigned opcode, unsigned dim, GLenum target, + GLint level, GLint xoffset, GLint yoffset, + GLint zoffset, GLint woffset, GLsizei width, + GLsizei height, GLsizei depth, GLsizei extent, + GLenum format, GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, depth, format, type, + target) : 0; + const GLuint cmdlen = 92 + __GLX_PAD(compsize); + if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, opcode, cmdlen); + (void) memcpy((void *) (gc->pc + 40), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 56), (void *) (&zoffset), 4); + (void) memcpy((void *) (gc->pc + 60), (void *) (&woffset), 4); + (void) memcpy((void *) (gc->pc + 64), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 68), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 72), (void *) (&depth), 4); + (void) memcpy((void *) (gc->pc + 76), (void *) (&extent), 4); + (void) memcpy((void *) (gc->pc + 80), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 84), (void *) (&type), 4); + (void) memset((void *) (gc->pc + 88), 0, 4); + if (compsize > 0) { + (*gc->fillImage) (gc, dim, width, height, depth, format, type, + pixels, gc->pc + 92, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_4D, + default_pixel_store_4D_size); + } + gc->pc += cmdlen; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = opcode; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 44), (void *) (&target), 4); + (void) memcpy((void *) (pc + 48), (void *) (&level), 4); + (void) memcpy((void *) (pc + 52), (void *) (&xoffset), 4); + (void) memcpy((void *) (pc + 56), (void *) (&yoffset), 4); + (void) memcpy((void *) (pc + 60), (void *) (&zoffset), 4); + (void) memcpy((void *) (pc + 64), (void *) (&woffset), 4); + (void) memcpy((void *) (pc + 68), (void *) (&width), 4); + (void) memcpy((void *) (pc + 72), (void *) (&height), 4); + (void) memcpy((void *) (pc + 76), (void *) (&depth), 4); + (void) memcpy((void *) (pc + 80), (void *) (&extent), 4); + (void) memcpy((void *) (pc + 84), (void *) (&format), 4); + (void) memcpy((void *) (pc + 88), (void *) (&type), 4); + (void) memset((void *) (pc + 92), 0, 4); + __glXSendLargeImage(gc, compsize, dim, width, height, depth, + format, type, pixels, pc + 96, pc + 8); + } + } +} + +#define X_GLrop_TexSubImage3D 4115 +void +__indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum format, + GLenum type, const GLvoid * pixels) +{ + __glx_TexSubImage_3D4D(X_GLrop_TexSubImage3D, 3, target, level, xoffset, + yoffset, zoffset, 1, width, height, depth, 1, + format, type, pixels); +} + +#define X_GLrop_CopyTexSubImage3D 4123 +void +__indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLint zoffset, GLint x, GLint y, + GLsizei width, GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_CopyTexSubImage3D, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&zoffset), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ActiveTextureARB 197 +void +__indirect_glActiveTextureARB(GLenum texture) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ActiveTextureARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&texture), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1dvARB 198 +void +__indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1dvARB 198 +void +__indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1fvARB 199 +void +__indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1fvARB 199 +void +__indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1ivARB 200 +void +__indirect_glMultiTexCoord1iARB(GLenum target, GLint s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1ivARB 200 +void +__indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1svARB 201 +void +__indirect_glMultiTexCoord1sARB(GLenum target, GLshort s) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord1svARB 201 +void +__indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2dvARB 202 +void +__indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2dvARB 202 +void +__indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 16); + (void) memcpy((void *) (gc->pc + 20), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2fvARB 203 +void +__indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2fvARB 203 +void +__indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2ivARB 204 +void +__indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2ivARB 204 +void +__indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2svARB 205 +void +__indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&t), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord2svARB 205 +void +__indirect_glMultiTexCoord2svARB(GLenum target, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3dvARB 206 +void +__indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, + GLdouble r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3dvARB 206 +void +__indirect_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 24); + (void) memcpy((void *) (gc->pc + 28), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3fvARB 207 +void +__indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, + GLfloat r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3fvARB 207 +void +__indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3ivARB 208 +void +__indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3ivARB 208 +void +__indirect_glMultiTexCoord3ivARB(GLenum target, const GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3svARB 209 +void +__indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, + GLshort r) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord3svARB 209 +void +__indirect_glMultiTexCoord3svARB(GLenum target, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 6); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4dvARB 210 +void +__indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, + GLdouble r, GLdouble q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&q), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4dvARB 210 +void +__indirect_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 32); + (void) memcpy((void *) (gc->pc + 36), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4fvARB 211 +void +__indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, + GLfloat r, GLfloat q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&q), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4fvARB 211 +void +__indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4ivARB 212 +void +__indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, + GLint q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&q), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4ivARB 212 +void +__indirect_glMultiTexCoord4ivARB(GLenum target, const GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4svARB 213 +void +__indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, + GLshort r, GLshort q) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 2); + (void) memcpy((void *) (gc->pc + 14), (void *) (&q), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_MultiTexCoord4svARB 213 +void +__indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SampleCoverageARB 229 +void +__indirect_glSampleCoverageARB(GLclampf value, GLboolean invert) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_SampleCoverageARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&value), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&invert), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_GetProgramStringARB 1308 +void +__indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramStringARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 1, string, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetProgramivARB 1307 +void +__indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLrop_ProgramEnvParameter4dvARB 4185 +void +__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, + GLdouble y, GLdouble z, GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44; + emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramEnvParameter4dvARB 4185 +void +__indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, + const GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44; + emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 32); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramEnvParameter4fvARB 4184 +void +__indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, + GLfloat y, GLfloat z, GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramEnvParameter4fvARB 4184 +void +__indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramLocalParameter4dvARB 4216 +void +__indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, + GLdouble x, GLdouble y, GLdouble z, + GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44; + emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramLocalParameter4dvARB 4216 +void +__indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, + const GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44; + emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 32); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramLocalParameter4fvARB 4215 +void +__indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, + GLfloat x, GLfloat y, GLfloat z, + GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramLocalParameter4fvARB 4215 +void +__indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ProgramStringARB 4217 +void +__indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, + const GLvoid * string) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((len >= 0) && (gc->currentDpy != NULL), 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_ProgramStringARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (string), len); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_ProgramStringARB; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&target), 4); + (void) memcpy((void *) (pc + 12), (void *) (&format), 4); + (void) memcpy((void *) (pc + 16), (void *) (&len), 4); + __glXSendLargeCommand(gc, pc, 20, string, len); + } + } +} + +#define X_GLrop_VertexAttrib1dvARB 4197 +void +__indirect_glVertexAttrib1dARB(GLuint index, GLdouble x) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1dvARB 4197 +void +__indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1fvARB 4193 +void +__indirect_glVertexAttrib1fARB(GLuint index, GLfloat x) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1fvARB 4193 +void +__indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1svARB 4189 +void +__indirect_glVertexAttrib1sARB(GLuint index, GLshort x) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1svARB 4189 +void +__indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2dvARB 4198 +void +__indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2dvARB 4198 +void +__indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2fvARB 4194 +void +__indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2fvARB 4194 +void +__indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2svARB 4190 +void +__indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2svARB 4190 +void +__indirect_glVertexAttrib2svARB(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3dvARB 4199 +void +__indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, + GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3dvARB 4199 +void +__indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 24); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3fvARB 4195 +void +__indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3fvARB 4195 +void +__indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3svARB 4191 +void +__indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3svARB 4191 +void +__indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 6); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NbvARB 4235 +void +__indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte *v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4NbvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NivARB 4237 +void +__indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4NivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NsvARB 4236 +void +__indirect_glVertexAttrib4NsvARB(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4NsvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NubvARB 4201 +void +__indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, + GLubyte z, GLubyte w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 1); + (void) memcpy((void *) (gc->pc + 9), (void *) (&y), 1); + (void) memcpy((void *) (gc->pc + 10), (void *) (&z), 1); + (void) memcpy((void *) (gc->pc + 11), (void *) (&w), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NubvARB 4201 +void +__indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte *v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NuivARB 4239 +void +__indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4NuivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4NusvARB 4238 +void +__indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4NusvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4bvARB 4230 +void +__indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte *v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4bvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4dvARB 4200 +void +__indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, + GLdouble z, GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 32), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4dvARB 4200 +void +__indirect_glVertexAttrib4dvARB(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 32); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4fvARB 4196 +void +__indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, + GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4fvARB 4196 +void +__indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4ivARB 4231 +void +__indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4ivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4svARB 4192 +void +__indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, + GLshort w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 14), (void *) (&w), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4svARB 4192 +void +__indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4ubvARB 4232 +void +__indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte *v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4ubvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4uivARB 4234 +void +__indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4uivARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4usvARB 4233 +void +__indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4usvARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_BeginQueryARB 231 +void +__indirect_glBeginQueryARB(GLenum target, GLuint id) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BeginQueryARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&id), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_DeleteQueriesARB 161 +void +__indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); +#endif + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_delete_queries_arb(c, gc->currentContextTag, n, ids); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_DeleteQueriesARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (ids), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLrop_EndQueryARB 232 +void +__indirect_glEndQueryARB(GLenum target) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_EndQueryARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLsop_GenQueriesARB 162 +void +__indirect_glGenQueriesARB(GLsizei n, GLuint * ids) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_gen_queries_arb_reply_t *reply = + xcb_glx_gen_queries_arb_reply(c, + xcb_glx_gen_queries_arb(c, + gc-> + currentContextTag, + n), NULL); + (void) memcpy(ids, xcb_glx_gen_queries_arb_data(reply), + xcb_glx_gen_queries_arb_data_length(reply) * + sizeof(GLuint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GenQueriesARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, ids, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetQueryObjectivARB 165 +void +__indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_query_objectiv_arb_reply_t *reply = + xcb_glx_get_query_objectiv_arb_reply(c, + xcb_glx_get_query_objectiv_arb + (c, gc->currentContextTag, + id, pname), NULL); + if (xcb_glx_get_query_objectiv_arb_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_query_objectiv_arb_data(reply), + xcb_glx_get_query_objectiv_arb_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetQueryObjectuivARB 166 +void +__indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_query_objectuiv_arb_reply_t *reply = + xcb_glx_get_query_objectuiv_arb_reply(c, + xcb_glx_get_query_objectuiv_arb + (c, gc->currentContextTag, + id, pname), NULL); + if (xcb_glx_get_query_objectuiv_arb_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_query_objectuiv_arb_data(reply), + xcb_glx_get_query_objectuiv_arb_data_length(reply) * + sizeof(GLuint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectuivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_GetQueryivARB 164 +void +__indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; +#ifndef USE_XCB + const GLuint cmdlen = 8; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_get_queryiv_arb_reply_t *reply = + xcb_glx_get_queryiv_arb_reply(c, + xcb_glx_get_queryiv_arb(c, + gc-> + currentContextTag, + target, + pname), + NULL); + if (xcb_glx_get_queryiv_arb_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); + else + (void) memcpy(params, xcb_glx_get_queryiv_arb_data(reply), + xcb_glx_get_queryiv_arb_data_length(reply) * + sizeof(GLint)); + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetQueryivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return; +} + +#define X_GLsop_IsQueryARB 163 +GLboolean +__indirect_glIsQueryARB(GLuint id) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; +#ifndef USE_XCB + const GLuint cmdlen = 4; +#endif + if (__builtin_expect(dpy != NULL, 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_is_query_arb_reply_t *reply = + xcb_glx_is_query_arb_reply(c, + xcb_glx_is_query_arb(c, + gc-> + currentContextTag, + id), NULL); + retval = reply->ret_val; + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_IsQueryARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return retval; +} + +#define X_GLrop_DrawBuffersARB 233 +void +__indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { + if (cmdlen <= gc->maxSmallRenderCommandSize) { + if ((gc->pc + cmdlen) > gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + emit_header(gc->pc, X_GLrop_DrawBuffersARB, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (bufs), (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { + const GLint op = X_GLrop_DrawBuffersARB; + const GLuint cmdlenLarge = cmdlen + 4; + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&n), 4); + __glXSendLargeCommand(gc, pc, 12, bufs, (n * 4)); + } + } +} + +#define X_GLrop_SampleMaskSGIS 2048 +void +__indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_SampleMaskSGIS, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&value), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&invert), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SamplePatternSGIS 2049 +void +__indirect_glSamplePatternSGIS(GLenum pattern) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_SamplePatternSGIS, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pattern), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PointParameterfEXT 2065 +void +__indirect_glPointParameterfEXT(GLenum pname, GLfloat param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PointParameterfEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PointParameterfvEXT 2066 +void +__indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glPointParameterfvEXT_size(pname); + const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_PointParameterfvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3bvEXT 4126 +void +__indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_SecondaryColor3bvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3bvEXT 4126 +void +__indirect_glSecondaryColor3bvEXT(const GLbyte *v) +{ + generic_3_byte(X_GLrop_SecondaryColor3bvEXT, v); +} + +#define X_GLrop_SecondaryColor3dvEXT 4130 +void +__indirect_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_SecondaryColor3dvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3dvEXT 4130 +void +__indirect_glSecondaryColor3dvEXT(const GLdouble * v) +{ + generic_24_byte(X_GLrop_SecondaryColor3dvEXT, v); +} + +#define X_GLrop_SecondaryColor3fvEXT 4129 +void +__indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_SecondaryColor3fvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3fvEXT 4129 +void +__indirect_glSecondaryColor3fvEXT(const GLfloat * v) +{ + generic_12_byte(X_GLrop_SecondaryColor3fvEXT, v); +} + +#define X_GLrop_SecondaryColor3ivEXT 4128 +void +__indirect_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_SecondaryColor3ivEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3ivEXT 4128 +void +__indirect_glSecondaryColor3ivEXT(const GLint * v) +{ + generic_12_byte(X_GLrop_SecondaryColor3ivEXT, v); +} + +#define X_GLrop_SecondaryColor3svEXT 4127 +void +__indirect_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_SecondaryColor3svEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3svEXT 4127 +void +__indirect_glSecondaryColor3svEXT(const GLshort * v) +{ + generic_6_byte(X_GLrop_SecondaryColor3svEXT, v); +} + +#define X_GLrop_SecondaryColor3ubvEXT 4131 +void +__indirect_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_SecondaryColor3ubvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3ubvEXT 4131 +void +__indirect_glSecondaryColor3ubvEXT(const GLubyte *v) +{ + generic_3_byte(X_GLrop_SecondaryColor3ubvEXT, v); +} + +#define X_GLrop_SecondaryColor3uivEXT 4133 +void +__indirect_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_SecondaryColor3uivEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3uivEXT 4133 +void +__indirect_glSecondaryColor3uivEXT(const GLuint * v) +{ + generic_12_byte(X_GLrop_SecondaryColor3uivEXT, v); +} + +#define X_GLrop_SecondaryColor3usvEXT 4132 +void +__indirect_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_SecondaryColor3usvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_SecondaryColor3usvEXT 4132 +void +__indirect_glSecondaryColor3usvEXT(const GLushort * v) +{ + generic_6_byte(X_GLrop_SecondaryColor3usvEXT, v); +} + +#define X_GLrop_FogCoorddvEXT 4125 +void +__indirect_glFogCoorddEXT(GLdouble coord) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_FogCoorddvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FogCoorddvEXT 4125 +void +__indirect_glFogCoorddvEXT(const GLdouble * coord) +{ + generic_8_byte(X_GLrop_FogCoorddvEXT, coord); +} + +#define X_GLrop_FogCoordfvEXT 4124 +void +__indirect_glFogCoordfEXT(GLfloat coord) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_FogCoordfvEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FogCoordfvEXT 4124 +void +__indirect_glFogCoordfvEXT(const GLfloat * coord) +{ + generic_4_byte(X_GLrop_FogCoordfvEXT, coord); +} + +#define X_GLrop_BlendFuncSeparateEXT 4134 +void +__indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, + GLenum sfactorAlpha, GLenum dfactorAlpha) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_BlendFuncSeparateEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&sfactorRGB), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&dfactorRGB), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&sfactorAlpha), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&dfactorAlpha), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_WindowPos3fvMESA 230 +void +__indirect_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_WindowPos3fvMESA, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_WindowPos3fvMESA 230 +void +__indirect_glWindowPos3fvMESA(const GLfloat * v) +{ + generic_12_byte(X_GLrop_WindowPos3fvMESA, v); +} + +#define X_GLvop_AreProgramsResidentNV 1293 +GLboolean +__indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, + GLboolean * residences) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return 0; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_AreProgramsResidentNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (ids), (n * 4)); + retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; +} + +#define X_GLrop_BindProgramNV 4180 +void +__indirect_glBindProgramNV(GLenum target, GLuint program) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BindProgramNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&program), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_DeleteProgramsNV 1294 +void +__indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivate, + X_GLvop_DeleteProgramsNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (programs), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLrop_ExecuteProgramNV 4181 +void +__indirect_glExecuteProgramNV(GLenum target, GLuint id, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_ExecuteProgramNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_GenProgramsNV 1295 +void +__indirect_glGenProgramsNV(GLsizei n, GLuint * programs) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4; + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenProgramsNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, programs, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetProgramParameterdvNV 1297 +void +__indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, + GLenum pname, GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 12; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramParameterdvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 8, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetProgramParameterfvNV 1296 +void +__indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, + GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 12; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramParameterfvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetProgramStringNV 1299 +void +__indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramStringNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 1, program, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetProgramivNV 1298 +void +__indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramivNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetTrackMatrixivNV 1300 +void +__indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 12; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetTrackMatrixivNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&address), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetVertexAttribdvNV 1301 +void +__indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, + GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetVertexAttribdvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&index), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 8, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetVertexAttribfvNV 1302 +void +__indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetVertexAttribfvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&index), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetVertexAttribivNV 1303 +void +__indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetVertexAttribivNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&index), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_IsProgramNV 1304 +GLboolean +__indirect_glIsProgramNV(GLuint program) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsProgramNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&program), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; +} + +#define X_GLrop_LoadProgramNV 4183 +void +__indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, + const GLubyte *program) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(len >= 0, 1)) { + emit_header(gc->pc, X_GLrop_LoadProgramNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (program), len); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_ProgramParameters4dvNV 4187 +void +__indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, + const GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16 + __GLX_PAD((num * 32)); + if (num < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(num >= 0, 1)) { + emit_header(gc->pc, X_GLrop_ProgramParameters4dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&num), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (params), (num * 32)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_ProgramParameters4fvNV 4186 +void +__indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, + const GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16 + __GLX_PAD((num * 16)); + if (num < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(num >= 0, 1)) { + emit_header(gc->pc, X_GLrop_ProgramParameters4fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&num), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (params), (num * 16)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_RequestResidentProgramsNV 4182 +void +__indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_RequestResidentProgramsNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (ids), (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_TrackMatrixNV 4188 +void +__indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, + GLenum transform) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_TrackMatrixNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&address), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&matrix), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&transform), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1dvNV 4273 +void +__indirect_glVertexAttrib1dNV(GLuint index, GLdouble x) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1dvNV 4273 +void +__indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1fvNV 4269 +void +__indirect_glVertexAttrib1fNV(GLuint index, GLfloat x) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1fvNV 4269 +void +__indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1svNV 4265 +void +__indirect_glVertexAttrib1sNV(GLuint index, GLshort x) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib1svNV 4265 +void +__indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2dvNV 4274 +void +__indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2dvNV 4274 +void +__indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2fvNV 4270 +void +__indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2fvNV 4270 +void +__indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2svNV 4266 +void +__indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib2svNV 4266 +void +__indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3dvNV 4275 +void +__indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, + GLdouble z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3dvNV 4275 +void +__indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 32; + emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 24); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3fvNV 4271 +void +__indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3fvNV 4271 +void +__indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3svNV 4267 +void +__indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib3svNV 4267 +void +__indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 6); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4dvNV 4276 +void +__indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, + GLdouble z, GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 32), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4dvNV 4276 +void +__indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 40; + emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 32); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4fvNV 4272 +void +__indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, + GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4fvNV 4272 +void +__indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4svNV 4268 +void +__indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, + GLshort w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 14), (void *) (&w), 2); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4svNV 4268 +void +__indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 16; + emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4ubvNV 4277 +void +__indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, + GLubyte w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 1); + (void) memcpy((void *) (gc->pc + 9), (void *) (&y), 1); + (void) memcpy((void *) (gc->pc + 10), (void *) (&z), 1); + (void) memcpy((void *) (gc->pc + 11), (void *) (&w), 1); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttrib4ubvNV 4277 +void +__indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte *v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_VertexAttribs1dvNV 4210 +void +__indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs1dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 8)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs1fvNV 4206 +void +__indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs1fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs1svNV 4202 +void +__indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 2)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs1svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 2)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs2dvNV 4211 +void +__indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 16)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs2dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 16)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs2fvNV 4207 +void +__indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs2fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 8)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs2svNV 4203 +void +__indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs2svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs3dvNV 4212 +void +__indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 24)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs3dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 24)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs3fvNV 4208 +void +__indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 12)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs3fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 12)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs3svNV 4204 +void +__indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 6)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs3svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 6)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs4dvNV 4213 +void +__indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 32)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs4dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 32)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs4fvNV 4209 +void +__indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 16)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs4fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 16)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs4svNV 4205 +void +__indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs4svNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 8)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_VertexAttribs4ubvNV 4214 +void +__indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_VertexAttribs4ubvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_PointParameteriNV 4221 +void +__indirect_glPointParameteriNV(GLenum pname, GLint param) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_PointParameteriNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_PointParameterivNV 4222 +void +__indirect_glPointParameterivNV(GLenum pname, const GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = __glPointParameterivNV_size(pname); + const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); + emit_header(gc->pc, X_GLrop_PointParameterivNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_ActiveStencilFaceEXT 4220 +void +__indirect_glActiveStencilFaceEXT(GLenum face) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_ActiveStencilFaceEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_GetProgramNamedParameterdvNV 1311 +void +__indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, + const GLubyte *name, + GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramNamedParameterdvNV, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&len), 4); + (void) memcpy((void *) (pc + 8), (void *) (name), len); + (void) __glXReadReply(dpy, 8, params, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetProgramNamedParameterfvNV 1310 +void +__indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, + const GLubyte *name, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramNamedParameterfvNV, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&len), 4); + (void) memcpy((void *) (pc + 8), (void *) (name), len); + (void) __glXReadReply(dpy, 4, params, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLrop_ProgramNamedParameter4dvNV 4219 +void +__indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, + const GLubyte *name, GLdouble x, + GLdouble y, GLdouble z, GLdouble w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(len >= 0, 1)) { + emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&w), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (name), len); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_ProgramNamedParameter4dvNV 4219 +void +__indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, + const GLubyte *name, + const GLdouble * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(len >= 0, 1)) { + emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 32); + (void) memcpy((void *) (gc->pc + 36), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (name), len); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_ProgramNamedParameter4fvNV 4218 +void +__indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, + const GLubyte *name, GLfloat x, + GLfloat y, GLfloat z, GLfloat w) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(len >= 0, 1)) { + emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (name), len); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_ProgramNamedParameter4fvNV 4218 +void +__indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, + const GLubyte *name, + const GLfloat * v) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28 + __GLX_PAD(len); + if (len < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(len >= 0, 1)) { + emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), 16); + (void) memcpy((void *) (gc->pc + 28), (void *) (name), len); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_BlendEquationSeparateEXT 4228 +void +__indirect_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BlendEquationSeparateEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&modeRGB), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&modeA), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_BindFramebufferEXT 4319 +void +__indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BindFramebufferEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&framebuffer), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_BindRenderbufferEXT 4316 +void +__indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 12; + emit_header(gc->pc, X_GLrop_BindRenderbufferEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&renderbuffer), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_CheckFramebufferStatusEXT 1427 +GLenum +__indirect_glCheckFramebufferStatusEXT(GLenum target) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLenum retval = (GLenum) 0; + const GLuint cmdlen = 4; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_CheckFramebufferStatusEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + retval = (GLenum) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; +} + +#define X_GLrop_DeleteFramebuffersEXT 4320 +void +__indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_DeleteFramebuffersEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (framebuffers), + (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_DeleteRenderbuffersEXT 4317 +void +__indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect(n >= 0, 1)) { + emit_header(gc->pc, X_GLrop_DeleteRenderbuffersEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (renderbuffers), + (n * 4)); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + +#define X_GLrop_FramebufferRenderbufferEXT 4324 +void +__indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_FramebufferRenderbufferEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&renderbuffertarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&renderbuffer), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FramebufferTexture1DEXT 4321 +void +__indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_FramebufferTexture1DEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&textarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&level), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FramebufferTexture2DEXT 4322 +void +__indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_FramebufferTexture2DEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&textarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&level), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FramebufferTexture3DEXT 4323 +void +__indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level, GLint zoffset) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 28; + emit_header(gc->pc, X_GLrop_FramebufferTexture3DEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&textarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&zoffset), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_GenFramebuffersEXT 1426 +void +__indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4; + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenFramebuffersEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, framebuffers, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GenRenderbuffersEXT 1423 +void +__indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4; + if (n < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenRenderbuffersEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, renderbuffers, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLrop_GenerateMipmapEXT 4325 +void +__indirect_glGenerateMipmapEXT(GLenum target) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 8; + emit_header(gc->pc, X_GLrop_GenerateMipmapEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428 +void +__indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, + GLenum attachment, + GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 12; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetFramebufferAttachmentParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&attachment), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_GetRenderbufferParameterivEXT 1424 +void +__indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, + GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetRenderbufferParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +#define X_GLvop_IsFramebufferEXT 1425 +GLboolean +__indirect_glIsFramebufferEXT(GLuint framebuffer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsFramebufferEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&framebuffer), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; +} + +#define X_GLvop_IsRenderbufferEXT 1422 +GLboolean +__indirect_glIsRenderbufferEXT(GLuint renderbuffer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsRenderbufferEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&renderbuffer), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; +} + +#define X_GLrop_RenderbufferStorageEXT 4318 +void +__indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, + GLsizei width, GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 20; + emit_header(gc->pc, X_GLrop_RenderbufferStorageEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + + +# undef FASTCALL +# undef NOINLINE diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect.h xpsb-glx-0.19/mesa/src/glx/x11/indirect.h --- xpsb-glx-0.19/mesa/src/glx/x11/indirect.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,718 @@ +/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT, IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#if !defined( _INDIRECT_H_ ) +# define _INDIRECT_H_ + +/** + * \file + * Prototypes for indirect rendering functions. + * + * \author Kevin E. Martin + * \author Ian Romanick + */ + +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# define HIDDEN __attribute__((visibility("hidden"))) +# else +# define HIDDEN +# endif +# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# define FASTCALL __attribute__((fastcall)) +# else +# define FASTCALL +# endif +# if defined(__GNUC__) +# define NOINLINE __attribute__((noinline)) +# else +# define NOINLINE +# endif + +#include "glxclient.h" + +extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, + void * dest, GLboolean reply_is_always_array ); + +extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, + __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, + GLint depth, GLenum format, GLenum type, void * dest, + GLboolean dimensions_in_reply ); + +extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( + __GLXcontext * gc, GLint sop, GLint cmdlen ); + +extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( + __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); + +extern HIDDEN void __indirect_glNewList(GLuint list, GLenum mode); +extern HIDDEN void __indirect_glEndList(void); +extern HIDDEN void __indirect_glCallList(GLuint list); +extern HIDDEN void __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists); +extern HIDDEN void __indirect_glDeleteLists(GLuint list, GLsizei range); +extern HIDDEN GLuint __indirect_glGenLists(GLsizei range); +extern HIDDEN void __indirect_glListBase(GLuint base); +extern HIDDEN void __indirect_glBegin(GLenum mode); +extern HIDDEN void __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); +extern HIDDEN void __indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue); +extern HIDDEN void __indirect_glColor3bv(const GLbyte * v); +extern HIDDEN void __indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue); +extern HIDDEN void __indirect_glColor3dv(const GLdouble * v); +extern HIDDEN void __indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue); +extern HIDDEN void __indirect_glColor3fv(const GLfloat * v); +extern HIDDEN void __indirect_glColor3i(GLint red, GLint green, GLint blue); +extern HIDDEN void __indirect_glColor3iv(const GLint * v); +extern HIDDEN void __indirect_glColor3s(GLshort red, GLshort green, GLshort blue); +extern HIDDEN void __indirect_glColor3sv(const GLshort * v); +extern HIDDEN void __indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue); +extern HIDDEN void __indirect_glColor3ubv(const GLubyte * v); +extern HIDDEN void __indirect_glColor3ui(GLuint red, GLuint green, GLuint blue); +extern HIDDEN void __indirect_glColor3uiv(const GLuint * v); +extern HIDDEN void __indirect_glColor3us(GLushort red, GLushort green, GLushort blue); +extern HIDDEN void __indirect_glColor3usv(const GLushort * v); +extern HIDDEN void __indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +extern HIDDEN void __indirect_glColor4bv(const GLbyte * v); +extern HIDDEN void __indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +extern HIDDEN void __indirect_glColor4dv(const GLdouble * v); +extern HIDDEN void __indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +extern HIDDEN void __indirect_glColor4fv(const GLfloat * v); +extern HIDDEN void __indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha); +extern HIDDEN void __indirect_glColor4iv(const GLint * v); +extern HIDDEN void __indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha); +extern HIDDEN void __indirect_glColor4sv(const GLshort * v); +extern HIDDEN void __indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +extern HIDDEN void __indirect_glColor4ubv(const GLubyte * v); +extern HIDDEN void __indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha); +extern HIDDEN void __indirect_glColor4uiv(const GLuint * v); +extern HIDDEN void __indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha); +extern HIDDEN void __indirect_glColor4usv(const GLushort * v); +extern HIDDEN void __indirect_glEdgeFlag(GLboolean flag); +extern HIDDEN void __indirect_glEdgeFlagv(const GLboolean * flag); +extern HIDDEN void __indirect_glEnd(void); +extern HIDDEN void __indirect_glIndexd(GLdouble c); +extern HIDDEN void __indirect_glIndexdv(const GLdouble * c); +extern HIDDEN void __indirect_glIndexf(GLfloat c); +extern HIDDEN void __indirect_glIndexfv(const GLfloat * c); +extern HIDDEN void __indirect_glIndexi(GLint c); +extern HIDDEN void __indirect_glIndexiv(const GLint * c); +extern HIDDEN void __indirect_glIndexs(GLshort c); +extern HIDDEN void __indirect_glIndexsv(const GLshort * c); +extern HIDDEN void __indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz); +extern HIDDEN void __indirect_glNormal3bv(const GLbyte * v); +extern HIDDEN void __indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz); +extern HIDDEN void __indirect_glNormal3dv(const GLdouble * v); +extern HIDDEN void __indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz); +extern HIDDEN void __indirect_glNormal3fv(const GLfloat * v); +extern HIDDEN void __indirect_glNormal3i(GLint nx, GLint ny, GLint nz); +extern HIDDEN void __indirect_glNormal3iv(const GLint * v); +extern HIDDEN void __indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz); +extern HIDDEN void __indirect_glNormal3sv(const GLshort * v); +extern HIDDEN void __indirect_glRasterPos2d(GLdouble x, GLdouble y); +extern HIDDEN void __indirect_glRasterPos2dv(const GLdouble * v); +extern HIDDEN void __indirect_glRasterPos2f(GLfloat x, GLfloat y); +extern HIDDEN void __indirect_glRasterPos2fv(const GLfloat * v); +extern HIDDEN void __indirect_glRasterPos2i(GLint x, GLint y); +extern HIDDEN void __indirect_glRasterPos2iv(const GLint * v); +extern HIDDEN void __indirect_glRasterPos2s(GLshort x, GLshort y); +extern HIDDEN void __indirect_glRasterPos2sv(const GLshort * v); +extern HIDDEN void __indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glRasterPos3dv(const GLdouble * v); +extern HIDDEN void __indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glRasterPos3fv(const GLfloat * v); +extern HIDDEN void __indirect_glRasterPos3i(GLint x, GLint y, GLint z); +extern HIDDEN void __indirect_glRasterPos3iv(const GLint * v); +extern HIDDEN void __indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z); +extern HIDDEN void __indirect_glRasterPos3sv(const GLshort * v); +extern HIDDEN void __indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glRasterPos4dv(const GLdouble * v); +extern HIDDEN void __indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glRasterPos4fv(const GLfloat * v); +extern HIDDEN void __indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w); +extern HIDDEN void __indirect_glRasterPos4iv(const GLint * v); +extern HIDDEN void __indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); +extern HIDDEN void __indirect_glRasterPos4sv(const GLshort * v); +extern HIDDEN void __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +extern HIDDEN void __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2); +extern HIDDEN void __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +extern HIDDEN void __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2); +extern HIDDEN void __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2); +extern HIDDEN void __indirect_glRectiv(const GLint * v1, const GLint * v2); +extern HIDDEN void __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +extern HIDDEN void __indirect_glRectsv(const GLshort * v1, const GLshort * v2); +extern HIDDEN void __indirect_glTexCoord1d(GLdouble s); +extern HIDDEN void __indirect_glTexCoord1dv(const GLdouble * v); +extern HIDDEN void __indirect_glTexCoord1f(GLfloat s); +extern HIDDEN void __indirect_glTexCoord1fv(const GLfloat * v); +extern HIDDEN void __indirect_glTexCoord1i(GLint s); +extern HIDDEN void __indirect_glTexCoord1iv(const GLint * v); +extern HIDDEN void __indirect_glTexCoord1s(GLshort s); +extern HIDDEN void __indirect_glTexCoord1sv(const GLshort * v); +extern HIDDEN void __indirect_glTexCoord2d(GLdouble s, GLdouble t); +extern HIDDEN void __indirect_glTexCoord2dv(const GLdouble * v); +extern HIDDEN void __indirect_glTexCoord2f(GLfloat s, GLfloat t); +extern HIDDEN void __indirect_glTexCoord2fv(const GLfloat * v); +extern HIDDEN void __indirect_glTexCoord2i(GLint s, GLint t); +extern HIDDEN void __indirect_glTexCoord2iv(const GLint * v); +extern HIDDEN void __indirect_glTexCoord2s(GLshort s, GLshort t); +extern HIDDEN void __indirect_glTexCoord2sv(const GLshort * v); +extern HIDDEN void __indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r); +extern HIDDEN void __indirect_glTexCoord3dv(const GLdouble * v); +extern HIDDEN void __indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r); +extern HIDDEN void __indirect_glTexCoord3fv(const GLfloat * v); +extern HIDDEN void __indirect_glTexCoord3i(GLint s, GLint t, GLint r); +extern HIDDEN void __indirect_glTexCoord3iv(const GLint * v); +extern HIDDEN void __indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r); +extern HIDDEN void __indirect_glTexCoord3sv(const GLshort * v); +extern HIDDEN void __indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +extern HIDDEN void __indirect_glTexCoord4dv(const GLdouble * v); +extern HIDDEN void __indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +extern HIDDEN void __indirect_glTexCoord4fv(const GLfloat * v); +extern HIDDEN void __indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q); +extern HIDDEN void __indirect_glTexCoord4iv(const GLint * v); +extern HIDDEN void __indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q); +extern HIDDEN void __indirect_glTexCoord4sv(const GLshort * v); +extern HIDDEN void __indirect_glVertex2d(GLdouble x, GLdouble y); +extern HIDDEN void __indirect_glVertex2dv(const GLdouble * v); +extern HIDDEN void __indirect_glVertex2f(GLfloat x, GLfloat y); +extern HIDDEN void __indirect_glVertex2fv(const GLfloat * v); +extern HIDDEN void __indirect_glVertex2i(GLint x, GLint y); +extern HIDDEN void __indirect_glVertex2iv(const GLint * v); +extern HIDDEN void __indirect_glVertex2s(GLshort x, GLshort y); +extern HIDDEN void __indirect_glVertex2sv(const GLshort * v); +extern HIDDEN void __indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glVertex3dv(const GLdouble * v); +extern HIDDEN void __indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glVertex3fv(const GLfloat * v); +extern HIDDEN void __indirect_glVertex3i(GLint x, GLint y, GLint z); +extern HIDDEN void __indirect_glVertex3iv(const GLint * v); +extern HIDDEN void __indirect_glVertex3s(GLshort x, GLshort y, GLshort z); +extern HIDDEN void __indirect_glVertex3sv(const GLshort * v); +extern HIDDEN void __indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glVertex4dv(const GLdouble * v); +extern HIDDEN void __indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glVertex4fv(const GLfloat * v); +extern HIDDEN void __indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w); +extern HIDDEN void __indirect_glVertex4iv(const GLint * v); +extern HIDDEN void __indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w); +extern HIDDEN void __indirect_glVertex4sv(const GLshort * v); +extern HIDDEN void __indirect_glClipPlane(GLenum plane, const GLdouble * equation); +extern HIDDEN void __indirect_glColorMaterial(GLenum face, GLenum mode); +extern HIDDEN void __indirect_glCullFace(GLenum mode); +extern HIDDEN void __indirect_glFogf(GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glFogfv(GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glFogi(GLenum pname, GLint param); +extern HIDDEN void __indirect_glFogiv(GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glFrontFace(GLenum mode); +extern HIDDEN void __indirect_glHint(GLenum target, GLenum mode); +extern HIDDEN void __indirect_glLightf(GLenum light, GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glLighti(GLenum light, GLenum pname, GLint param); +extern HIDDEN void __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glLightModelf(GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glLightModelfv(GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glLightModeli(GLenum pname, GLint param); +extern HIDDEN void __indirect_glLightModeliv(GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glLineStipple(GLint factor, GLushort pattern); +extern HIDDEN void __indirect_glLineWidth(GLfloat width); +extern HIDDEN void __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glMateriali(GLenum face, GLenum pname, GLint param); +extern HIDDEN void __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glPointSize(GLfloat size); +extern HIDDEN void __indirect_glPolygonMode(GLenum face, GLenum mode); +extern HIDDEN void __indirect_glPolygonStipple(const GLubyte * mask); +extern HIDDEN void __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height); +extern HIDDEN void __indirect_glShadeModel(GLenum mode); +extern HIDDEN void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param); +extern HIDDEN void __indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param); +extern HIDDEN void __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param); +extern HIDDEN void __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params); +extern HIDDEN void __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param); +extern HIDDEN void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer); +extern HIDDEN void __indirect_glSelectBuffer(GLsizei size, GLuint * buffer); +extern HIDDEN GLint __indirect_glRenderMode(GLenum mode); +extern HIDDEN void __indirect_glInitNames(void); +extern HIDDEN void __indirect_glLoadName(GLuint name); +extern HIDDEN void __indirect_glPassThrough(GLfloat token); +extern HIDDEN void __indirect_glPopName(void); +extern HIDDEN void __indirect_glPushName(GLuint name); +extern HIDDEN void __indirect_glDrawBuffer(GLenum mode); +extern HIDDEN void __indirect_glClear(GLbitfield mask); +extern HIDDEN void __indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +extern HIDDEN void __indirect_glClearIndex(GLfloat c); +extern HIDDEN void __indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +extern HIDDEN void __indirect_glClearStencil(GLint s); +extern HIDDEN void __indirect_glClearDepth(GLclampd depth); +extern HIDDEN void __indirect_glStencilMask(GLuint mask); +extern HIDDEN void __indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +extern HIDDEN void __indirect_glDepthMask(GLboolean flag); +extern HIDDEN void __indirect_glIndexMask(GLuint mask); +extern HIDDEN void __indirect_glAccum(GLenum op, GLfloat value); +extern HIDDEN void __indirect_glDisable(GLenum cap); +extern HIDDEN void __indirect_glEnable(GLenum cap); +extern HIDDEN void __indirect_glFinish(void); +extern HIDDEN void __indirect_glFlush(void); +extern HIDDEN void __indirect_glPopAttrib(void); +extern HIDDEN void __indirect_glPushAttrib(GLbitfield mask); +extern HIDDEN void __indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); +extern HIDDEN void __indirect_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); +extern HIDDEN void __indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); +extern HIDDEN void __indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); +extern HIDDEN void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2); +extern HIDDEN void __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2); +extern HIDDEN void __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +extern HIDDEN void __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +extern HIDDEN void __indirect_glEvalCoord1d(GLdouble u); +extern HIDDEN void __indirect_glEvalCoord1dv(const GLdouble * u); +extern HIDDEN void __indirect_glEvalCoord1f(GLfloat u); +extern HIDDEN void __indirect_glEvalCoord1fv(const GLfloat * u); +extern HIDDEN void __indirect_glEvalCoord2d(GLdouble u, GLdouble v); +extern HIDDEN void __indirect_glEvalCoord2dv(const GLdouble * u); +extern HIDDEN void __indirect_glEvalCoord2f(GLfloat u, GLfloat v); +extern HIDDEN void __indirect_glEvalCoord2fv(const GLfloat * u); +extern HIDDEN void __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2); +extern HIDDEN void __indirect_glEvalPoint1(GLint i); +extern HIDDEN void __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +extern HIDDEN void __indirect_glEvalPoint2(GLint i, GLint j); +extern HIDDEN void __indirect_glAlphaFunc(GLenum func, GLclampf ref); +extern HIDDEN void __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor); +extern HIDDEN void __indirect_glLogicOp(GLenum opcode); +extern HIDDEN void __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask); +extern HIDDEN void __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass); +extern HIDDEN void __indirect_glDepthFunc(GLenum func); +extern HIDDEN void __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor); +extern HIDDEN void __indirect_glPixelTransferf(GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glPixelTransferi(GLenum pname, GLint param); +extern HIDDEN void __indirect_glPixelStoref(GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glPixelStorei(GLenum pname, GLint param); +extern HIDDEN void __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values); +extern HIDDEN void __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values); +extern HIDDEN void __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values); +extern HIDDEN void __indirect_glReadBuffer(GLenum mode); +extern HIDDEN void __indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +extern HIDDEN void __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); +extern HIDDEN void __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glGetBooleanv(GLenum pname, GLboolean * params); +extern HIDDEN void __indirect_glGetClipPlane(GLenum plane, GLdouble * equation); +extern HIDDEN void __indirect_glGetDoublev(GLenum pname, GLdouble * params); +extern HIDDEN GLenum __indirect_glGetError(void); +extern HIDDEN void __indirect_glGetFloatv(GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetIntegerv(GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v); +extern HIDDEN void __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v); +extern HIDDEN void __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v); +extern HIDDEN void __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetPixelMapfv(GLenum map, GLfloat * values); +extern HIDDEN void __indirect_glGetPixelMapuiv(GLenum map, GLuint * values); +extern HIDDEN void __indirect_glGetPixelMapusv(GLenum map, GLushort * values); +extern HIDDEN void __indirect_glGetPolygonStipple(GLubyte * mask); +extern HIDDEN const GLubyte * __indirect_glGetString(GLenum name); +extern HIDDEN void __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params); +extern HIDDEN void __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); +extern HIDDEN void __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params); +extern HIDDEN GLboolean __indirect_glIsEnabled(GLenum cap); +extern HIDDEN GLboolean __indirect_glIsList(GLuint list); +extern HIDDEN void __indirect_glDepthRange(GLclampd zNear, GLclampd zFar); +extern HIDDEN void __indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +extern HIDDEN void __indirect_glLoadIdentity(void); +extern HIDDEN void __indirect_glLoadMatrixf(const GLfloat * m); +extern HIDDEN void __indirect_glLoadMatrixd(const GLdouble * m); +extern HIDDEN void __indirect_glMatrixMode(GLenum mode); +extern HIDDEN void __indirect_glMultMatrixf(const GLfloat * m); +extern HIDDEN void __indirect_glMultMatrixd(const GLdouble * m); +extern HIDDEN void __indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +extern HIDDEN void __indirect_glPopMatrix(void); +extern HIDDEN void __indirect_glPushMatrix(void); +extern HIDDEN void __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height); +extern HIDDEN void __indirect_glArrayElement(GLint i); +extern HIDDEN void __indirect_glBindTexture(GLenum target, GLuint texture); +extern HIDDEN void __indirect_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glDisableClientState(GLenum array); +extern HIDDEN void __indirect_glDrawArrays(GLenum mode, GLint first, GLsizei count); +extern HIDDEN void __indirect_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); +extern HIDDEN void __indirect_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glEnableClientState(GLenum array); +extern HIDDEN void __indirect_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glIndexub(GLubyte c); +extern HIDDEN void __indirect_glIndexubv(const GLubyte * c); +extern HIDDEN void __indirect_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glNormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glPolygonOffset(GLfloat factor, GLfloat units); +extern HIDDEN void __indirect_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN GLboolean __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences); +GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences); +extern HIDDEN void __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +extern HIDDEN void __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +extern HIDDEN void __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +extern HIDDEN void __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +extern HIDDEN void __indirect_glDeleteTextures(GLsizei n, const GLuint * textures); +GLAPI void GLAPIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint * textures); +extern HIDDEN void __indirect_glGenTextures(GLsizei n, GLuint * textures); +GLAPI void GLAPIENTRY glGenTexturesEXT(GLsizei n, GLuint * textures); +extern HIDDEN void __indirect_glGetPointerv(GLenum pname, GLvoid ** params); +extern HIDDEN GLboolean __indirect_glIsTexture(GLuint texture); +GLAPI GLboolean GLAPIENTRY glIsTextureEXT(GLuint texture); +extern HIDDEN void __indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities); +extern HIDDEN void __indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glPopClientAttrib(void); +extern HIDDEN void __indirect_glPushClientAttrib(GLbitfield mask); +extern HIDDEN void __indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +extern HIDDEN void __indirect_glBlendEquation(GLenum mode); +extern HIDDEN void __indirect_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); +extern HIDDEN void __indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); +extern HIDDEN void __indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +extern HIDDEN void __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table); +GLAPI void GLAPIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table); +extern HIDDEN void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params); +GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params); +GLAPI void GLAPIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); +extern HIDDEN void __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +extern HIDDEN void __indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); +extern HIDDEN void __indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); +extern HIDDEN void __indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params); +extern HIDDEN void __indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params); +extern HIDDEN void __indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +extern HIDDEN void __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +extern HIDDEN void __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image); +extern HIDDEN void gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image); +extern HIDDEN void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); +extern HIDDEN void gl_dispatch_stub_359(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); +extern HIDDEN void __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); +extern HIDDEN void __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +extern HIDDEN void gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +extern HIDDEN void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +extern HIDDEN void gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +extern HIDDEN void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +extern HIDDEN void __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink); +extern HIDDEN void __indirect_glResetHistogram(GLenum target); +extern HIDDEN void __indirect_glResetMinmax(GLenum target); +extern HIDDEN void __indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); +extern HIDDEN void __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +extern HIDDEN void __indirect_glActiveTextureARB(GLenum texture); +extern HIDDEN void __indirect_glClientActiveTextureARB(GLenum texture); +extern HIDDEN void __indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s); +extern HIDDEN void __indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v); +extern HIDDEN void __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s); +extern HIDDEN void __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v); +extern HIDDEN void __indirect_glMultiTexCoord1iARB(GLenum target, GLint s); +extern HIDDEN void __indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v); +extern HIDDEN void __indirect_glMultiTexCoord1sARB(GLenum target, GLshort s); +extern HIDDEN void __indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v); +extern HIDDEN void __indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +extern HIDDEN void __indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v); +extern HIDDEN void __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +extern HIDDEN void __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v); +extern HIDDEN void __indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +extern HIDDEN void __indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v); +extern HIDDEN void __indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +extern HIDDEN void __indirect_glMultiTexCoord2svARB(GLenum target, const GLshort * v); +extern HIDDEN void __indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +extern HIDDEN void __indirect_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v); +extern HIDDEN void __indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +extern HIDDEN void __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v); +extern HIDDEN void __indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +extern HIDDEN void __indirect_glMultiTexCoord3ivARB(GLenum target, const GLint * v); +extern HIDDEN void __indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +extern HIDDEN void __indirect_glMultiTexCoord3svARB(GLenum target, const GLshort * v); +extern HIDDEN void __indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +extern HIDDEN void __indirect_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v); +extern HIDDEN void __indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +extern HIDDEN void __indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v); +extern HIDDEN void __indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +extern HIDDEN void __indirect_glMultiTexCoord4ivARB(GLenum target, const GLint * v); +extern HIDDEN void __indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +extern HIDDEN void __indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v); +extern HIDDEN void __indirect_glLoadTransposeMatrixdARB(const GLdouble * m); +extern HIDDEN void __indirect_glLoadTransposeMatrixfARB(const GLfloat * m); +extern HIDDEN void __indirect_glMultTransposeMatrixdARB(const GLdouble * m); +extern HIDDEN void __indirect_glMultTransposeMatrixfARB(const GLfloat * m); +extern HIDDEN void __indirect_glSampleCoverageARB(GLclampf value, GLboolean invert); +extern HIDDEN void __indirect_glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); +extern HIDDEN void __indirect_glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); +extern HIDDEN void __indirect_glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); +extern HIDDEN void __indirect_glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); +extern HIDDEN void __indirect_glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); +extern HIDDEN void __indirect_glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); +extern HIDDEN void __indirect_glGetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img); +extern HIDDEN void __indirect_glDisableVertexAttribArrayARB(GLuint index); +extern HIDDEN void __indirect_glEnableVertexAttribArrayARB(GLuint index); +extern HIDDEN void __indirect_glGetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params); +extern HIDDEN void __indirect_glGetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params); +extern HIDDEN void __indirect_glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params); +extern HIDDEN void __indirect_glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params); +extern HIDDEN void __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string); +extern HIDDEN void __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params); +extern HIDDEN void __indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params); +extern HIDDEN void __indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params); +extern HIDDEN void __indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params); +extern HIDDEN void __indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params); +extern HIDDEN void __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string); +extern HIDDEN void __indirect_glVertexAttrib1dARB(GLuint index, GLdouble x); +extern HIDDEN void __indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x); +extern HIDDEN void __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib1sARB(GLuint index, GLshort x); +extern HIDDEN void __indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y); +extern HIDDEN void __indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y); +extern HIDDEN void __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y); +extern HIDDEN void __indirect_glVertexAttrib2svARB(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z); +extern HIDDEN void __indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte * v); +extern HIDDEN void __indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v); +extern HIDDEN void __indirect_glVertexAttrib4NsvARB(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +extern HIDDEN void __indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte * v); +extern HIDDEN void __indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v); +extern HIDDEN void __indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v); +extern HIDDEN void __indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte * v); +extern HIDDEN void __indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glVertexAttrib4dvARB(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v); +extern HIDDEN void __indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +extern HIDDEN void __indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v); +extern HIDDEN void __indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v); +extern HIDDEN void __indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v); +extern HIDDEN void __indirect_glVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glBeginQueryARB(GLenum target, GLuint id); +extern HIDDEN void __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids); +extern HIDDEN void __indirect_glEndQueryARB(GLenum target); +extern HIDDEN void __indirect_glGenQueriesARB(GLsizei n, GLuint * ids); +extern HIDDEN void __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params); +extern HIDDEN void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params); +extern HIDDEN GLboolean __indirect_glIsQueryARB(GLuint id); +extern HIDDEN void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs); +extern HIDDEN void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert); +extern HIDDEN void __indirect_glSamplePatternSGIS(GLenum pattern); +extern HIDDEN void __indirect_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +extern HIDDEN void __indirect_glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean * pointer); +extern HIDDEN void __indirect_glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +extern HIDDEN void __indirect_glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +extern HIDDEN void __indirect_glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +extern HIDDEN void __indirect_glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +extern HIDDEN void __indirect_glPointParameterfEXT(GLenum pname, GLfloat param); +extern HIDDEN void __indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params); +extern HIDDEN void __indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue); +extern HIDDEN void __indirect_glSecondaryColor3bvEXT(const GLbyte * v); +extern HIDDEN void __indirect_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue); +extern HIDDEN void __indirect_glSecondaryColor3dvEXT(const GLdouble * v); +extern HIDDEN void __indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue); +extern HIDDEN void __indirect_glSecondaryColor3fvEXT(const GLfloat * v); +extern HIDDEN void __indirect_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue); +extern HIDDEN void __indirect_glSecondaryColor3ivEXT(const GLint * v); +extern HIDDEN void __indirect_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue); +extern HIDDEN void __indirect_glSecondaryColor3svEXT(const GLshort * v); +extern HIDDEN void __indirect_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue); +extern HIDDEN void __indirect_glSecondaryColor3ubvEXT(const GLubyte * v); +extern HIDDEN void __indirect_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue); +extern HIDDEN void __indirect_glSecondaryColor3uivEXT(const GLuint * v); +extern HIDDEN void __indirect_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue); +extern HIDDEN void __indirect_glSecondaryColor3usvEXT(const GLushort * v); +extern HIDDEN void __indirect_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); +extern HIDDEN void __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); +extern HIDDEN void __indirect_glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glFogCoorddEXT(GLdouble coord); +extern HIDDEN void __indirect_glFogCoorddvEXT(const GLdouble * coord); +extern HIDDEN void __indirect_glFogCoordfEXT(GLfloat coord); +extern HIDDEN void __indirect_glFogCoordfvEXT(const GLfloat * coord); +extern HIDDEN void __indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +extern HIDDEN void __indirect_glWindowPos2dMESA(GLdouble x, GLdouble y); +extern HIDDEN void __indirect_glWindowPos2dvMESA(const GLdouble * v); +extern HIDDEN void __indirect_glWindowPos2fMESA(GLfloat x, GLfloat y); +extern HIDDEN void __indirect_glWindowPos2fvMESA(const GLfloat * v); +extern HIDDEN void __indirect_glWindowPos2iMESA(GLint x, GLint y); +extern HIDDEN void __indirect_glWindowPos2ivMESA(const GLint * v); +extern HIDDEN void __indirect_glWindowPos2sMESA(GLshort x, GLshort y); +extern HIDDEN void __indirect_glWindowPos2svMESA(const GLshort * v); +extern HIDDEN void __indirect_glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glWindowPos3dvMESA(const GLdouble * v); +extern HIDDEN void __indirect_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glWindowPos3fvMESA(const GLfloat * v); +extern HIDDEN void __indirect_glWindowPos3iMESA(GLint x, GLint y, GLint z); +extern HIDDEN void __indirect_glWindowPos3ivMESA(const GLint * v); +extern HIDDEN void __indirect_glWindowPos3sMESA(GLshort x, GLshort y, GLshort z); +extern HIDDEN void __indirect_glWindowPos3svMESA(const GLshort * v); +extern HIDDEN GLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences); +extern HIDDEN void __indirect_glBindProgramNV(GLenum target, GLuint program); +extern HIDDEN void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs); +extern HIDDEN void __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params); +extern HIDDEN void __indirect_glGenProgramsNV(GLsizei n, GLuint * programs); +extern HIDDEN void __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params); +extern HIDDEN void __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program); +extern HIDDEN void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** pointer); +extern HIDDEN void __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params); +extern HIDDEN void __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params); +extern HIDDEN void __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params); +extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint program); +extern HIDDEN void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program); +extern HIDDEN void __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble * params); +extern HIDDEN void __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat * params); +extern HIDDEN void __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids); +extern HIDDEN void __indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform); +extern HIDDEN void __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x); +extern HIDDEN void __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x); +extern HIDDEN void __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib1sNV(GLuint index, GLshort x); +extern HIDDEN void __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y); +extern HIDDEN void __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y); +extern HIDDEN void __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y); +extern HIDDEN void __indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z); +extern HIDDEN void __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z); +extern HIDDEN void __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z); +extern HIDDEN void __indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +extern HIDDEN void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +extern HIDDEN void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v); +extern HIDDEN void __indirect_glVertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +extern HIDDEN void __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v); +extern HIDDEN void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v); +extern HIDDEN void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v); +extern HIDDEN void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v); +extern HIDDEN void __indirect_glPointParameteriNV(GLenum pname, GLint param); +extern HIDDEN void __indirect_glPointParameterivNV(GLenum pname, const GLint * params); +extern HIDDEN void __indirect_glActiveStencilFaceEXT(GLenum face); +extern HIDDEN void __indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); +extern HIDDEN void __indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); +extern HIDDEN void __indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern HIDDEN void __indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); +extern HIDDEN void __indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern HIDDEN void __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); +extern HIDDEN void __indirect_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA); +extern HIDDEN void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer); +extern HIDDEN void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer); +extern HIDDEN GLenum __indirect_glCheckFramebufferStatusEXT(GLenum target); +extern HIDDEN void __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers); +extern HIDDEN void __indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers); +extern HIDDEN void __indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +extern HIDDEN void __indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +extern HIDDEN void __indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +extern HIDDEN void __indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +extern HIDDEN void __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers); +extern HIDDEN void __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers); +extern HIDDEN void __indirect_glGenerateMipmapEXT(GLenum target); +extern HIDDEN void __indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params); +extern HIDDEN void __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params); +extern HIDDEN GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer); +extern HIDDEN GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer); +extern HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +# undef HIDDEN +# undef FASTCALL +# undef NOINLINE + +#endif /* !defined( _INDIRECT_H_ ) */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,773 @@ +/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT, IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + * \file indirect_init.c + * Initialize indirect rendering dispatch table. + * + * \author Kevin E. Martin + * \author Brian Paul + * \author Ian Romanick + */ + +#include "indirect_init.h" +#include "indirect.h" +#include "glapi.h" + + +/** + * No-op function used to initialize functions that have no GLX protocol + * support. + */ +static int NoOp(void) +{ + return 0; +} + +/** + * Create and initialize a new GL dispatch table. The table is initialized + * with GLX indirect rendering protocol functions. + */ +__GLapi * __glXNewIndirectAPI( void ) +{ + __GLapi *glAPI; + GLuint entries; + + entries = _glapi_get_dispatch_table_size(); + glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); + + /* first, set all entries to point to no-op functions */ + { + int i; + void **dispatch = (void **) glAPI; + for (i = 0; i < entries; i++) { + dispatch[i] = (void *) NoOp; + } + } + + /* now, initialize the entries we understand */ + + /* 1.0 */ + + glAPI->Accum = __indirect_glAccum; + glAPI->AlphaFunc = __indirect_glAlphaFunc; + glAPI->Begin = __indirect_glBegin; + glAPI->Bitmap = __indirect_glBitmap; + glAPI->BlendFunc = __indirect_glBlendFunc; + glAPI->CallList = __indirect_glCallList; + glAPI->CallLists = __indirect_glCallLists; + glAPI->Clear = __indirect_glClear; + glAPI->ClearAccum = __indirect_glClearAccum; + glAPI->ClearColor = __indirect_glClearColor; + glAPI->ClearDepth = __indirect_glClearDepth; + glAPI->ClearIndex = __indirect_glClearIndex; + glAPI->ClearStencil = __indirect_glClearStencil; + glAPI->ClipPlane = __indirect_glClipPlane; + glAPI->Color3b = __indirect_glColor3b; + glAPI->Color3bv = __indirect_glColor3bv; + glAPI->Color3d = __indirect_glColor3d; + glAPI->Color3dv = __indirect_glColor3dv; + glAPI->Color3f = __indirect_glColor3f; + glAPI->Color3fv = __indirect_glColor3fv; + glAPI->Color3i = __indirect_glColor3i; + glAPI->Color3iv = __indirect_glColor3iv; + glAPI->Color3s = __indirect_glColor3s; + glAPI->Color3sv = __indirect_glColor3sv; + glAPI->Color3ub = __indirect_glColor3ub; + glAPI->Color3ubv = __indirect_glColor3ubv; + glAPI->Color3ui = __indirect_glColor3ui; + glAPI->Color3uiv = __indirect_glColor3uiv; + glAPI->Color3us = __indirect_glColor3us; + glAPI->Color3usv = __indirect_glColor3usv; + glAPI->Color4b = __indirect_glColor4b; + glAPI->Color4bv = __indirect_glColor4bv; + glAPI->Color4d = __indirect_glColor4d; + glAPI->Color4dv = __indirect_glColor4dv; + glAPI->Color4f = __indirect_glColor4f; + glAPI->Color4fv = __indirect_glColor4fv; + glAPI->Color4i = __indirect_glColor4i; + glAPI->Color4iv = __indirect_glColor4iv; + glAPI->Color4s = __indirect_glColor4s; + glAPI->Color4sv = __indirect_glColor4sv; + glAPI->Color4ub = __indirect_glColor4ub; + glAPI->Color4ubv = __indirect_glColor4ubv; + glAPI->Color4ui = __indirect_glColor4ui; + glAPI->Color4uiv = __indirect_glColor4uiv; + glAPI->Color4us = __indirect_glColor4us; + glAPI->Color4usv = __indirect_glColor4usv; + glAPI->ColorMask = __indirect_glColorMask; + glAPI->ColorMaterial = __indirect_glColorMaterial; + glAPI->CopyPixels = __indirect_glCopyPixels; + glAPI->CullFace = __indirect_glCullFace; + glAPI->DeleteLists = __indirect_glDeleteLists; + glAPI->DepthFunc = __indirect_glDepthFunc; + glAPI->DepthMask = __indirect_glDepthMask; + glAPI->DepthRange = __indirect_glDepthRange; + glAPI->Disable = __indirect_glDisable; + glAPI->DrawBuffer = __indirect_glDrawBuffer; + glAPI->DrawPixels = __indirect_glDrawPixels; + glAPI->EdgeFlag = __indirect_glEdgeFlag; + glAPI->EdgeFlagv = __indirect_glEdgeFlagv; + glAPI->Enable = __indirect_glEnable; + glAPI->End = __indirect_glEnd; + glAPI->EndList = __indirect_glEndList; + glAPI->EvalCoord1d = __indirect_glEvalCoord1d; + glAPI->EvalCoord1dv = __indirect_glEvalCoord1dv; + glAPI->EvalCoord1f = __indirect_glEvalCoord1f; + glAPI->EvalCoord1fv = __indirect_glEvalCoord1fv; + glAPI->EvalCoord2d = __indirect_glEvalCoord2d; + glAPI->EvalCoord2dv = __indirect_glEvalCoord2dv; + glAPI->EvalCoord2f = __indirect_glEvalCoord2f; + glAPI->EvalCoord2fv = __indirect_glEvalCoord2fv; + glAPI->EvalMesh1 = __indirect_glEvalMesh1; + glAPI->EvalMesh2 = __indirect_glEvalMesh2; + glAPI->EvalPoint1 = __indirect_glEvalPoint1; + glAPI->EvalPoint2 = __indirect_glEvalPoint2; + glAPI->FeedbackBuffer = __indirect_glFeedbackBuffer; + glAPI->Finish = __indirect_glFinish; + glAPI->Flush = __indirect_glFlush; + glAPI->Fogf = __indirect_glFogf; + glAPI->Fogfv = __indirect_glFogfv; + glAPI->Fogi = __indirect_glFogi; + glAPI->Fogiv = __indirect_glFogiv; + glAPI->FrontFace = __indirect_glFrontFace; + glAPI->Frustum = __indirect_glFrustum; + glAPI->GenLists = __indirect_glGenLists; + glAPI->GetBooleanv = __indirect_glGetBooleanv; + glAPI->GetClipPlane = __indirect_glGetClipPlane; + glAPI->GetDoublev = __indirect_glGetDoublev; + glAPI->GetError = __indirect_glGetError; + glAPI->GetFloatv = __indirect_glGetFloatv; + glAPI->GetIntegerv = __indirect_glGetIntegerv; + glAPI->GetLightfv = __indirect_glGetLightfv; + glAPI->GetLightiv = __indirect_glGetLightiv; + glAPI->GetMapdv = __indirect_glGetMapdv; + glAPI->GetMapfv = __indirect_glGetMapfv; + glAPI->GetMapiv = __indirect_glGetMapiv; + glAPI->GetMaterialfv = __indirect_glGetMaterialfv; + glAPI->GetMaterialiv = __indirect_glGetMaterialiv; + glAPI->GetPixelMapfv = __indirect_glGetPixelMapfv; + glAPI->GetPixelMapuiv = __indirect_glGetPixelMapuiv; + glAPI->GetPixelMapusv = __indirect_glGetPixelMapusv; + glAPI->GetPolygonStipple = __indirect_glGetPolygonStipple; + glAPI->GetString = __indirect_glGetString; + glAPI->GetTexEnvfv = __indirect_glGetTexEnvfv; + glAPI->GetTexEnviv = __indirect_glGetTexEnviv; + glAPI->GetTexGendv = __indirect_glGetTexGendv; + glAPI->GetTexGenfv = __indirect_glGetTexGenfv; + glAPI->GetTexGeniv = __indirect_glGetTexGeniv; + glAPI->GetTexImage = __indirect_glGetTexImage; + glAPI->GetTexLevelParameterfv = __indirect_glGetTexLevelParameterfv; + glAPI->GetTexLevelParameteriv = __indirect_glGetTexLevelParameteriv; + glAPI->GetTexParameterfv = __indirect_glGetTexParameterfv; + glAPI->GetTexParameteriv = __indirect_glGetTexParameteriv; + glAPI->Hint = __indirect_glHint; + glAPI->IndexMask = __indirect_glIndexMask; + glAPI->Indexd = __indirect_glIndexd; + glAPI->Indexdv = __indirect_glIndexdv; + glAPI->Indexf = __indirect_glIndexf; + glAPI->Indexfv = __indirect_glIndexfv; + glAPI->Indexi = __indirect_glIndexi; + glAPI->Indexiv = __indirect_glIndexiv; + glAPI->Indexs = __indirect_glIndexs; + glAPI->Indexsv = __indirect_glIndexsv; + glAPI->InitNames = __indirect_glInitNames; + glAPI->IsEnabled = __indirect_glIsEnabled; + glAPI->IsList = __indirect_glIsList; + glAPI->LightModelf = __indirect_glLightModelf; + glAPI->LightModelfv = __indirect_glLightModelfv; + glAPI->LightModeli = __indirect_glLightModeli; + glAPI->LightModeliv = __indirect_glLightModeliv; + glAPI->Lightf = __indirect_glLightf; + glAPI->Lightfv = __indirect_glLightfv; + glAPI->Lighti = __indirect_glLighti; + glAPI->Lightiv = __indirect_glLightiv; + glAPI->LineStipple = __indirect_glLineStipple; + glAPI->LineWidth = __indirect_glLineWidth; + glAPI->ListBase = __indirect_glListBase; + glAPI->LoadIdentity = __indirect_glLoadIdentity; + glAPI->LoadMatrixd = __indirect_glLoadMatrixd; + glAPI->LoadMatrixf = __indirect_glLoadMatrixf; + glAPI->LoadName = __indirect_glLoadName; + glAPI->LogicOp = __indirect_glLogicOp; + glAPI->Map1d = __indirect_glMap1d; + glAPI->Map1f = __indirect_glMap1f; + glAPI->Map2d = __indirect_glMap2d; + glAPI->Map2f = __indirect_glMap2f; + glAPI->MapGrid1d = __indirect_glMapGrid1d; + glAPI->MapGrid1f = __indirect_glMapGrid1f; + glAPI->MapGrid2d = __indirect_glMapGrid2d; + glAPI->MapGrid2f = __indirect_glMapGrid2f; + glAPI->Materialf = __indirect_glMaterialf; + glAPI->Materialfv = __indirect_glMaterialfv; + glAPI->Materiali = __indirect_glMateriali; + glAPI->Materialiv = __indirect_glMaterialiv; + glAPI->MatrixMode = __indirect_glMatrixMode; + glAPI->MultMatrixd = __indirect_glMultMatrixd; + glAPI->MultMatrixf = __indirect_glMultMatrixf; + glAPI->NewList = __indirect_glNewList; + glAPI->Normal3b = __indirect_glNormal3b; + glAPI->Normal3bv = __indirect_glNormal3bv; + glAPI->Normal3d = __indirect_glNormal3d; + glAPI->Normal3dv = __indirect_glNormal3dv; + glAPI->Normal3f = __indirect_glNormal3f; + glAPI->Normal3fv = __indirect_glNormal3fv; + glAPI->Normal3i = __indirect_glNormal3i; + glAPI->Normal3iv = __indirect_glNormal3iv; + glAPI->Normal3s = __indirect_glNormal3s; + glAPI->Normal3sv = __indirect_glNormal3sv; + glAPI->Ortho = __indirect_glOrtho; + glAPI->PassThrough = __indirect_glPassThrough; + glAPI->PixelMapfv = __indirect_glPixelMapfv; + glAPI->PixelMapuiv = __indirect_glPixelMapuiv; + glAPI->PixelMapusv = __indirect_glPixelMapusv; + glAPI->PixelStoref = __indirect_glPixelStoref; + glAPI->PixelStorei = __indirect_glPixelStorei; + glAPI->PixelTransferf = __indirect_glPixelTransferf; + glAPI->PixelTransferi = __indirect_glPixelTransferi; + glAPI->PixelZoom = __indirect_glPixelZoom; + glAPI->PointSize = __indirect_glPointSize; + glAPI->PolygonMode = __indirect_glPolygonMode; + glAPI->PolygonStipple = __indirect_glPolygonStipple; + glAPI->PopAttrib = __indirect_glPopAttrib; + glAPI->PopMatrix = __indirect_glPopMatrix; + glAPI->PopName = __indirect_glPopName; + glAPI->PushAttrib = __indirect_glPushAttrib; + glAPI->PushMatrix = __indirect_glPushMatrix; + glAPI->PushName = __indirect_glPushName; + glAPI->RasterPos2d = __indirect_glRasterPos2d; + glAPI->RasterPos2dv = __indirect_glRasterPos2dv; + glAPI->RasterPos2f = __indirect_glRasterPos2f; + glAPI->RasterPos2fv = __indirect_glRasterPos2fv; + glAPI->RasterPos2i = __indirect_glRasterPos2i; + glAPI->RasterPos2iv = __indirect_glRasterPos2iv; + glAPI->RasterPos2s = __indirect_glRasterPos2s; + glAPI->RasterPos2sv = __indirect_glRasterPos2sv; + glAPI->RasterPos3d = __indirect_glRasterPos3d; + glAPI->RasterPos3dv = __indirect_glRasterPos3dv; + glAPI->RasterPos3f = __indirect_glRasterPos3f; + glAPI->RasterPos3fv = __indirect_glRasterPos3fv; + glAPI->RasterPos3i = __indirect_glRasterPos3i; + glAPI->RasterPos3iv = __indirect_glRasterPos3iv; + glAPI->RasterPos3s = __indirect_glRasterPos3s; + glAPI->RasterPos3sv = __indirect_glRasterPos3sv; + glAPI->RasterPos4d = __indirect_glRasterPos4d; + glAPI->RasterPos4dv = __indirect_glRasterPos4dv; + glAPI->RasterPos4f = __indirect_glRasterPos4f; + glAPI->RasterPos4fv = __indirect_glRasterPos4fv; + glAPI->RasterPos4i = __indirect_glRasterPos4i; + glAPI->RasterPos4iv = __indirect_glRasterPos4iv; + glAPI->RasterPos4s = __indirect_glRasterPos4s; + glAPI->RasterPos4sv = __indirect_glRasterPos4sv; + glAPI->ReadBuffer = __indirect_glReadBuffer; + glAPI->ReadPixels = __indirect_glReadPixels; + glAPI->Rectd = __indirect_glRectd; + glAPI->Rectdv = __indirect_glRectdv; + glAPI->Rectf = __indirect_glRectf; + glAPI->Rectfv = __indirect_glRectfv; + glAPI->Recti = __indirect_glRecti; + glAPI->Rectiv = __indirect_glRectiv; + glAPI->Rects = __indirect_glRects; + glAPI->Rectsv = __indirect_glRectsv; + glAPI->RenderMode = __indirect_glRenderMode; + glAPI->Rotated = __indirect_glRotated; + glAPI->Rotatef = __indirect_glRotatef; + glAPI->Scaled = __indirect_glScaled; + glAPI->Scalef = __indirect_glScalef; + glAPI->Scissor = __indirect_glScissor; + glAPI->SelectBuffer = __indirect_glSelectBuffer; + glAPI->ShadeModel = __indirect_glShadeModel; + glAPI->StencilFunc = __indirect_glStencilFunc; + glAPI->StencilMask = __indirect_glStencilMask; + glAPI->StencilOp = __indirect_glStencilOp; + glAPI->TexCoord1d = __indirect_glTexCoord1d; + glAPI->TexCoord1dv = __indirect_glTexCoord1dv; + glAPI->TexCoord1f = __indirect_glTexCoord1f; + glAPI->TexCoord1fv = __indirect_glTexCoord1fv; + glAPI->TexCoord1i = __indirect_glTexCoord1i; + glAPI->TexCoord1iv = __indirect_glTexCoord1iv; + glAPI->TexCoord1s = __indirect_glTexCoord1s; + glAPI->TexCoord1sv = __indirect_glTexCoord1sv; + glAPI->TexCoord2d = __indirect_glTexCoord2d; + glAPI->TexCoord2dv = __indirect_glTexCoord2dv; + glAPI->TexCoord2f = __indirect_glTexCoord2f; + glAPI->TexCoord2fv = __indirect_glTexCoord2fv; + glAPI->TexCoord2i = __indirect_glTexCoord2i; + glAPI->TexCoord2iv = __indirect_glTexCoord2iv; + glAPI->TexCoord2s = __indirect_glTexCoord2s; + glAPI->TexCoord2sv = __indirect_glTexCoord2sv; + glAPI->TexCoord3d = __indirect_glTexCoord3d; + glAPI->TexCoord3dv = __indirect_glTexCoord3dv; + glAPI->TexCoord3f = __indirect_glTexCoord3f; + glAPI->TexCoord3fv = __indirect_glTexCoord3fv; + glAPI->TexCoord3i = __indirect_glTexCoord3i; + glAPI->TexCoord3iv = __indirect_glTexCoord3iv; + glAPI->TexCoord3s = __indirect_glTexCoord3s; + glAPI->TexCoord3sv = __indirect_glTexCoord3sv; + glAPI->TexCoord4d = __indirect_glTexCoord4d; + glAPI->TexCoord4dv = __indirect_glTexCoord4dv; + glAPI->TexCoord4f = __indirect_glTexCoord4f; + glAPI->TexCoord4fv = __indirect_glTexCoord4fv; + glAPI->TexCoord4i = __indirect_glTexCoord4i; + glAPI->TexCoord4iv = __indirect_glTexCoord4iv; + glAPI->TexCoord4s = __indirect_glTexCoord4s; + glAPI->TexCoord4sv = __indirect_glTexCoord4sv; + glAPI->TexEnvf = __indirect_glTexEnvf; + glAPI->TexEnvfv = __indirect_glTexEnvfv; + glAPI->TexEnvi = __indirect_glTexEnvi; + glAPI->TexEnviv = __indirect_glTexEnviv; + glAPI->TexGend = __indirect_glTexGend; + glAPI->TexGendv = __indirect_glTexGendv; + glAPI->TexGenf = __indirect_glTexGenf; + glAPI->TexGenfv = __indirect_glTexGenfv; + glAPI->TexGeni = __indirect_glTexGeni; + glAPI->TexGeniv = __indirect_glTexGeniv; + glAPI->TexImage1D = __indirect_glTexImage1D; + glAPI->TexImage2D = __indirect_glTexImage2D; + glAPI->TexParameterf = __indirect_glTexParameterf; + glAPI->TexParameterfv = __indirect_glTexParameterfv; + glAPI->TexParameteri = __indirect_glTexParameteri; + glAPI->TexParameteriv = __indirect_glTexParameteriv; + glAPI->Translated = __indirect_glTranslated; + glAPI->Translatef = __indirect_glTranslatef; + glAPI->Vertex2d = __indirect_glVertex2d; + glAPI->Vertex2dv = __indirect_glVertex2dv; + glAPI->Vertex2f = __indirect_glVertex2f; + glAPI->Vertex2fv = __indirect_glVertex2fv; + glAPI->Vertex2i = __indirect_glVertex2i; + glAPI->Vertex2iv = __indirect_glVertex2iv; + glAPI->Vertex2s = __indirect_glVertex2s; + glAPI->Vertex2sv = __indirect_glVertex2sv; + glAPI->Vertex3d = __indirect_glVertex3d; + glAPI->Vertex3dv = __indirect_glVertex3dv; + glAPI->Vertex3f = __indirect_glVertex3f; + glAPI->Vertex3fv = __indirect_glVertex3fv; + glAPI->Vertex3i = __indirect_glVertex3i; + glAPI->Vertex3iv = __indirect_glVertex3iv; + glAPI->Vertex3s = __indirect_glVertex3s; + glAPI->Vertex3sv = __indirect_glVertex3sv; + glAPI->Vertex4d = __indirect_glVertex4d; + glAPI->Vertex4dv = __indirect_glVertex4dv; + glAPI->Vertex4f = __indirect_glVertex4f; + glAPI->Vertex4fv = __indirect_glVertex4fv; + glAPI->Vertex4i = __indirect_glVertex4i; + glAPI->Vertex4iv = __indirect_glVertex4iv; + glAPI->Vertex4s = __indirect_glVertex4s; + glAPI->Vertex4sv = __indirect_glVertex4sv; + glAPI->Viewport = __indirect_glViewport; + + /* 1.1 */ + + glAPI->AreTexturesResident = __indirect_glAreTexturesResident; + glAPI->ArrayElement = __indirect_glArrayElement; + glAPI->BindTexture = __indirect_glBindTexture; + glAPI->ColorPointer = __indirect_glColorPointer; + glAPI->CopyTexImage1D = __indirect_glCopyTexImage1D; + glAPI->CopyTexImage2D = __indirect_glCopyTexImage2D; + glAPI->CopyTexSubImage1D = __indirect_glCopyTexSubImage1D; + glAPI->CopyTexSubImage2D = __indirect_glCopyTexSubImage2D; + glAPI->DeleteTextures = __indirect_glDeleteTextures; + glAPI->DisableClientState = __indirect_glDisableClientState; + glAPI->DrawArrays = __indirect_glDrawArrays; + glAPI->DrawElements = __indirect_glDrawElements; + glAPI->EdgeFlagPointer = __indirect_glEdgeFlagPointer; + glAPI->EnableClientState = __indirect_glEnableClientState; + glAPI->GenTextures = __indirect_glGenTextures; + glAPI->GetPointerv = __indirect_glGetPointerv; + glAPI->IndexPointer = __indirect_glIndexPointer; + glAPI->Indexub = __indirect_glIndexub; + glAPI->Indexubv = __indirect_glIndexubv; + glAPI->InterleavedArrays = __indirect_glInterleavedArrays; + glAPI->IsTexture = __indirect_glIsTexture; + glAPI->NormalPointer = __indirect_glNormalPointer; + glAPI->PolygonOffset = __indirect_glPolygonOffset; + glAPI->PopClientAttrib = __indirect_glPopClientAttrib; + glAPI->PrioritizeTextures = __indirect_glPrioritizeTextures; + glAPI->PushClientAttrib = __indirect_glPushClientAttrib; + glAPI->TexCoordPointer = __indirect_glTexCoordPointer; + glAPI->TexSubImage1D = __indirect_glTexSubImage1D; + glAPI->TexSubImage2D = __indirect_glTexSubImage2D; + glAPI->VertexPointer = __indirect_glVertexPointer; + + /* 1.2 */ + + glAPI->BlendColor = __indirect_glBlendColor; + glAPI->BlendEquation = __indirect_glBlendEquation; + glAPI->ColorSubTable = __indirect_glColorSubTable; + glAPI->ColorTable = __indirect_glColorTable; + glAPI->ColorTableParameterfv = __indirect_glColorTableParameterfv; + glAPI->ColorTableParameteriv = __indirect_glColorTableParameteriv; + glAPI->ConvolutionFilter1D = __indirect_glConvolutionFilter1D; + glAPI->ConvolutionFilter2D = __indirect_glConvolutionFilter2D; + glAPI->ConvolutionParameterf = __indirect_glConvolutionParameterf; + glAPI->ConvolutionParameterfv = __indirect_glConvolutionParameterfv; + glAPI->ConvolutionParameteri = __indirect_glConvolutionParameteri; + glAPI->ConvolutionParameteriv = __indirect_glConvolutionParameteriv; + glAPI->CopyColorSubTable = __indirect_glCopyColorSubTable; + glAPI->CopyColorTable = __indirect_glCopyColorTable; + glAPI->CopyConvolutionFilter1D = __indirect_glCopyConvolutionFilter1D; + glAPI->CopyConvolutionFilter2D = __indirect_glCopyConvolutionFilter2D; + glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D; + glAPI->DrawRangeElements = __indirect_glDrawRangeElements; + glAPI->GetColorTable = __indirect_glGetColorTable; + glAPI->GetColorTableParameterfv = __indirect_glGetColorTableParameterfv; + glAPI->GetColorTableParameteriv = __indirect_glGetColorTableParameteriv; + glAPI->GetConvolutionFilter = __indirect_glGetConvolutionFilter; + glAPI->GetConvolutionParameterfv = __indirect_glGetConvolutionParameterfv; + glAPI->GetConvolutionParameteriv = __indirect_glGetConvolutionParameteriv; + glAPI->GetHistogram = __indirect_glGetHistogram; + glAPI->GetHistogramParameterfv = __indirect_glGetHistogramParameterfv; + glAPI->GetHistogramParameteriv = __indirect_glGetHistogramParameteriv; + glAPI->GetMinmax = __indirect_glGetMinmax; + glAPI->GetMinmaxParameterfv = __indirect_glGetMinmaxParameterfv; + glAPI->GetMinmaxParameteriv = __indirect_glGetMinmaxParameteriv; + glAPI->GetSeparableFilter = __indirect_glGetSeparableFilter; + glAPI->Histogram = __indirect_glHistogram; + glAPI->Minmax = __indirect_glMinmax; + glAPI->ResetHistogram = __indirect_glResetHistogram; + glAPI->ResetMinmax = __indirect_glResetMinmax; + glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D; + glAPI->TexImage3D = __indirect_glTexImage3D; + glAPI->TexSubImage3D = __indirect_glTexSubImage3D; + + /* 1. GL_ARB_multitexture */ + + glAPI->ActiveTextureARB = __indirect_glActiveTextureARB; + glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB; + glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB; + glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB; + glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB; + glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB; + glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB; + glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB; + glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB; + glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB; + glAPI->MultiTexCoord2dARB = __indirect_glMultiTexCoord2dARB; + glAPI->MultiTexCoord2dvARB = __indirect_glMultiTexCoord2dvARB; + glAPI->MultiTexCoord2fARB = __indirect_glMultiTexCoord2fARB; + glAPI->MultiTexCoord2fvARB = __indirect_glMultiTexCoord2fvARB; + glAPI->MultiTexCoord2iARB = __indirect_glMultiTexCoord2iARB; + glAPI->MultiTexCoord2ivARB = __indirect_glMultiTexCoord2ivARB; + glAPI->MultiTexCoord2sARB = __indirect_glMultiTexCoord2sARB; + glAPI->MultiTexCoord2svARB = __indirect_glMultiTexCoord2svARB; + glAPI->MultiTexCoord3dARB = __indirect_glMultiTexCoord3dARB; + glAPI->MultiTexCoord3dvARB = __indirect_glMultiTexCoord3dvARB; + glAPI->MultiTexCoord3fARB = __indirect_glMultiTexCoord3fARB; + glAPI->MultiTexCoord3fvARB = __indirect_glMultiTexCoord3fvARB; + glAPI->MultiTexCoord3iARB = __indirect_glMultiTexCoord3iARB; + glAPI->MultiTexCoord3ivARB = __indirect_glMultiTexCoord3ivARB; + glAPI->MultiTexCoord3sARB = __indirect_glMultiTexCoord3sARB; + glAPI->MultiTexCoord3svARB = __indirect_glMultiTexCoord3svARB; + glAPI->MultiTexCoord4dARB = __indirect_glMultiTexCoord4dARB; + glAPI->MultiTexCoord4dvARB = __indirect_glMultiTexCoord4dvARB; + glAPI->MultiTexCoord4fARB = __indirect_glMultiTexCoord4fARB; + glAPI->MultiTexCoord4fvARB = __indirect_glMultiTexCoord4fvARB; + glAPI->MultiTexCoord4iARB = __indirect_glMultiTexCoord4iARB; + glAPI->MultiTexCoord4ivARB = __indirect_glMultiTexCoord4ivARB; + glAPI->MultiTexCoord4sARB = __indirect_glMultiTexCoord4sARB; + glAPI->MultiTexCoord4svARB = __indirect_glMultiTexCoord4svARB; + + /* 3. GL_ARB_transpose_matrix */ + + glAPI->LoadTransposeMatrixdARB = __indirect_glLoadTransposeMatrixdARB; + glAPI->LoadTransposeMatrixfARB = __indirect_glLoadTransposeMatrixfARB; + glAPI->MultTransposeMatrixdARB = __indirect_glMultTransposeMatrixdARB; + glAPI->MultTransposeMatrixfARB = __indirect_glMultTransposeMatrixfARB; + + /* 5. GL_ARB_multisample */ + + glAPI->SampleCoverageARB = __indirect_glSampleCoverageARB; + + /* 12. GL_ARB_texture_compression */ + + glAPI->CompressedTexImage1DARB = __indirect_glCompressedTexImage1DARB; + glAPI->CompressedTexImage2DARB = __indirect_glCompressedTexImage2DARB; + glAPI->CompressedTexImage3DARB = __indirect_glCompressedTexImage3DARB; + glAPI->CompressedTexSubImage1DARB = __indirect_glCompressedTexSubImage1DARB; + glAPI->CompressedTexSubImage2DARB = __indirect_glCompressedTexSubImage2DARB; + glAPI->CompressedTexSubImage3DARB = __indirect_glCompressedTexSubImage3DARB; + glAPI->GetCompressedTexImageARB = __indirect_glGetCompressedTexImageARB; + + /* 26. GL_ARB_vertex_program */ + + glAPI->DisableVertexAttribArrayARB = __indirect_glDisableVertexAttribArrayARB; + glAPI->EnableVertexAttribArrayARB = __indirect_glEnableVertexAttribArrayARB; + glAPI->GetProgramEnvParameterdvARB = __indirect_glGetProgramEnvParameterdvARB; + glAPI->GetProgramEnvParameterfvARB = __indirect_glGetProgramEnvParameterfvARB; + glAPI->GetProgramLocalParameterdvARB = __indirect_glGetProgramLocalParameterdvARB; + glAPI->GetProgramLocalParameterfvARB = __indirect_glGetProgramLocalParameterfvARB; + glAPI->GetProgramStringARB = __indirect_glGetProgramStringARB; + glAPI->GetProgramivARB = __indirect_glGetProgramivARB; + glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB; + glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB; + glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB; + glAPI->ProgramEnvParameter4dARB = __indirect_glProgramEnvParameter4dARB; + glAPI->ProgramEnvParameter4dvARB = __indirect_glProgramEnvParameter4dvARB; + glAPI->ProgramEnvParameter4fARB = __indirect_glProgramEnvParameter4fARB; + glAPI->ProgramEnvParameter4fvARB = __indirect_glProgramEnvParameter4fvARB; + glAPI->ProgramLocalParameter4dARB = __indirect_glProgramLocalParameter4dARB; + glAPI->ProgramLocalParameter4dvARB = __indirect_glProgramLocalParameter4dvARB; + glAPI->ProgramLocalParameter4fARB = __indirect_glProgramLocalParameter4fARB; + glAPI->ProgramLocalParameter4fvARB = __indirect_glProgramLocalParameter4fvARB; + glAPI->ProgramStringARB = __indirect_glProgramStringARB; + glAPI->VertexAttrib1dARB = __indirect_glVertexAttrib1dARB; + glAPI->VertexAttrib1dvARB = __indirect_glVertexAttrib1dvARB; + glAPI->VertexAttrib1fARB = __indirect_glVertexAttrib1fARB; + glAPI->VertexAttrib1fvARB = __indirect_glVertexAttrib1fvARB; + glAPI->VertexAttrib1sARB = __indirect_glVertexAttrib1sARB; + glAPI->VertexAttrib1svARB = __indirect_glVertexAttrib1svARB; + glAPI->VertexAttrib2dARB = __indirect_glVertexAttrib2dARB; + glAPI->VertexAttrib2dvARB = __indirect_glVertexAttrib2dvARB; + glAPI->VertexAttrib2fARB = __indirect_glVertexAttrib2fARB; + glAPI->VertexAttrib2fvARB = __indirect_glVertexAttrib2fvARB; + glAPI->VertexAttrib2sARB = __indirect_glVertexAttrib2sARB; + glAPI->VertexAttrib2svARB = __indirect_glVertexAttrib2svARB; + glAPI->VertexAttrib3dARB = __indirect_glVertexAttrib3dARB; + glAPI->VertexAttrib3dvARB = __indirect_glVertexAttrib3dvARB; + glAPI->VertexAttrib3fARB = __indirect_glVertexAttrib3fARB; + glAPI->VertexAttrib3fvARB = __indirect_glVertexAttrib3fvARB; + glAPI->VertexAttrib3sARB = __indirect_glVertexAttrib3sARB; + glAPI->VertexAttrib3svARB = __indirect_glVertexAttrib3svARB; + glAPI->VertexAttrib4NbvARB = __indirect_glVertexAttrib4NbvARB; + glAPI->VertexAttrib4NivARB = __indirect_glVertexAttrib4NivARB; + glAPI->VertexAttrib4NsvARB = __indirect_glVertexAttrib4NsvARB; + glAPI->VertexAttrib4NubARB = __indirect_glVertexAttrib4NubARB; + glAPI->VertexAttrib4NubvARB = __indirect_glVertexAttrib4NubvARB; + glAPI->VertexAttrib4NuivARB = __indirect_glVertexAttrib4NuivARB; + glAPI->VertexAttrib4NusvARB = __indirect_glVertexAttrib4NusvARB; + glAPI->VertexAttrib4bvARB = __indirect_glVertexAttrib4bvARB; + glAPI->VertexAttrib4dARB = __indirect_glVertexAttrib4dARB; + glAPI->VertexAttrib4dvARB = __indirect_glVertexAttrib4dvARB; + glAPI->VertexAttrib4fARB = __indirect_glVertexAttrib4fARB; + glAPI->VertexAttrib4fvARB = __indirect_glVertexAttrib4fvARB; + glAPI->VertexAttrib4ivARB = __indirect_glVertexAttrib4ivARB; + glAPI->VertexAttrib4sARB = __indirect_glVertexAttrib4sARB; + glAPI->VertexAttrib4svARB = __indirect_glVertexAttrib4svARB; + glAPI->VertexAttrib4ubvARB = __indirect_glVertexAttrib4ubvARB; + glAPI->VertexAttrib4uivARB = __indirect_glVertexAttrib4uivARB; + glAPI->VertexAttrib4usvARB = __indirect_glVertexAttrib4usvARB; + glAPI->VertexAttribPointerARB = __indirect_glVertexAttribPointerARB; + + /* 29. GL_ARB_occlusion_query */ + + glAPI->BeginQueryARB = __indirect_glBeginQueryARB; + glAPI->DeleteQueriesARB = __indirect_glDeleteQueriesARB; + glAPI->EndQueryARB = __indirect_glEndQueryARB; + glAPI->GenQueriesARB = __indirect_glGenQueriesARB; + glAPI->GetQueryObjectivARB = __indirect_glGetQueryObjectivARB; + glAPI->GetQueryObjectuivARB = __indirect_glGetQueryObjectuivARB; + glAPI->GetQueryivARB = __indirect_glGetQueryivARB; + glAPI->IsQueryARB = __indirect_glIsQueryARB; + + /* 37. GL_ARB_draw_buffers */ + + glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB; + + /* 25. GL_SGIS_multisample */ + + glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS; + glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS; + + /* 30. GL_EXT_vertex_array */ + + glAPI->ColorPointerEXT = __indirect_glColorPointerEXT; + glAPI->EdgeFlagPointerEXT = __indirect_glEdgeFlagPointerEXT; + glAPI->IndexPointerEXT = __indirect_glIndexPointerEXT; + glAPI->NormalPointerEXT = __indirect_glNormalPointerEXT; + glAPI->TexCoordPointerEXT = __indirect_glTexCoordPointerEXT; + glAPI->VertexPointerEXT = __indirect_glVertexPointerEXT; + + /* 54. GL_EXT_point_parameters */ + + glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT; + glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT; + + /* 145. GL_EXT_secondary_color */ + + glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3bEXT; + glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bvEXT; + glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3dEXT; + glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dvEXT; + glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3fEXT; + glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fvEXT; + glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3iEXT; + glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3ivEXT; + glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3sEXT; + glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3svEXT; + glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ubEXT; + glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubvEXT; + glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3uiEXT; + glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT; + glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT; + glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT; + glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT; + + /* 148. GL_EXT_multi_draw_arrays */ + + glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT; + glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT; + + /* 149. GL_EXT_fog_coord */ + + glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT; + glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT; + glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT; + glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT; + glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT; + + /* 173. GL_EXT_blend_func_separate */ + + glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT; + + /* 197. GL_MESA_window_pos */ + + glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA; + glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA; + glAPI->WindowPos2fMESA = __indirect_glWindowPos2fMESA; + glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvMESA; + glAPI->WindowPos2iMESA = __indirect_glWindowPos2iMESA; + glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivMESA; + glAPI->WindowPos2sMESA = __indirect_glWindowPos2sMESA; + glAPI->WindowPos2svMESA = __indirect_glWindowPos2svMESA; + glAPI->WindowPos3dMESA = __indirect_glWindowPos3dMESA; + glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvMESA; + glAPI->WindowPos3fMESA = __indirect_glWindowPos3fMESA; + glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvMESA; + glAPI->WindowPos3iMESA = __indirect_glWindowPos3iMESA; + glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivMESA; + glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA; + glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA; + + /* 233. GL_NV_vertex_program */ + + glAPI->AreProgramsResidentNV = __indirect_glAreProgramsResidentNV; + glAPI->BindProgramNV = __indirect_glBindProgramNV; + glAPI->DeleteProgramsNV = __indirect_glDeleteProgramsNV; + glAPI->ExecuteProgramNV = __indirect_glExecuteProgramNV; + glAPI->GenProgramsNV = __indirect_glGenProgramsNV; + glAPI->GetProgramParameterdvNV = __indirect_glGetProgramParameterdvNV; + glAPI->GetProgramParameterfvNV = __indirect_glGetProgramParameterfvNV; + glAPI->GetProgramStringNV = __indirect_glGetProgramStringNV; + glAPI->GetProgramivNV = __indirect_glGetProgramivNV; + glAPI->GetTrackMatrixivNV = __indirect_glGetTrackMatrixivNV; + glAPI->GetVertexAttribPointervNV = __indirect_glGetVertexAttribPointervNV; + glAPI->GetVertexAttribdvNV = __indirect_glGetVertexAttribdvNV; + glAPI->GetVertexAttribfvNV = __indirect_glGetVertexAttribfvNV; + glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV; + glAPI->IsProgramNV = __indirect_glIsProgramNV; + glAPI->LoadProgramNV = __indirect_glLoadProgramNV; + glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV; + glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV; + glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV; + glAPI->TrackMatrixNV = __indirect_glTrackMatrixNV; + glAPI->VertexAttrib1dNV = __indirect_glVertexAttrib1dNV; + glAPI->VertexAttrib1dvNV = __indirect_glVertexAttrib1dvNV; + glAPI->VertexAttrib1fNV = __indirect_glVertexAttrib1fNV; + glAPI->VertexAttrib1fvNV = __indirect_glVertexAttrib1fvNV; + glAPI->VertexAttrib1sNV = __indirect_glVertexAttrib1sNV; + glAPI->VertexAttrib1svNV = __indirect_glVertexAttrib1svNV; + glAPI->VertexAttrib2dNV = __indirect_glVertexAttrib2dNV; + glAPI->VertexAttrib2dvNV = __indirect_glVertexAttrib2dvNV; + glAPI->VertexAttrib2fNV = __indirect_glVertexAttrib2fNV; + glAPI->VertexAttrib2fvNV = __indirect_glVertexAttrib2fvNV; + glAPI->VertexAttrib2sNV = __indirect_glVertexAttrib2sNV; + glAPI->VertexAttrib2svNV = __indirect_glVertexAttrib2svNV; + glAPI->VertexAttrib3dNV = __indirect_glVertexAttrib3dNV; + glAPI->VertexAttrib3dvNV = __indirect_glVertexAttrib3dvNV; + glAPI->VertexAttrib3fNV = __indirect_glVertexAttrib3fNV; + glAPI->VertexAttrib3fvNV = __indirect_glVertexAttrib3fvNV; + glAPI->VertexAttrib3sNV = __indirect_glVertexAttrib3sNV; + glAPI->VertexAttrib3svNV = __indirect_glVertexAttrib3svNV; + glAPI->VertexAttrib4dNV = __indirect_glVertexAttrib4dNV; + glAPI->VertexAttrib4dvNV = __indirect_glVertexAttrib4dvNV; + glAPI->VertexAttrib4fNV = __indirect_glVertexAttrib4fNV; + glAPI->VertexAttrib4fvNV = __indirect_glVertexAttrib4fvNV; + glAPI->VertexAttrib4sNV = __indirect_glVertexAttrib4sNV; + glAPI->VertexAttrib4svNV = __indirect_glVertexAttrib4svNV; + glAPI->VertexAttrib4ubNV = __indirect_glVertexAttrib4ubNV; + glAPI->VertexAttrib4ubvNV = __indirect_glVertexAttrib4ubvNV; + glAPI->VertexAttribPointerNV = __indirect_glVertexAttribPointerNV; + glAPI->VertexAttribs1dvNV = __indirect_glVertexAttribs1dvNV; + glAPI->VertexAttribs1fvNV = __indirect_glVertexAttribs1fvNV; + glAPI->VertexAttribs1svNV = __indirect_glVertexAttribs1svNV; + glAPI->VertexAttribs2dvNV = __indirect_glVertexAttribs2dvNV; + glAPI->VertexAttribs2fvNV = __indirect_glVertexAttribs2fvNV; + glAPI->VertexAttribs2svNV = __indirect_glVertexAttribs2svNV; + glAPI->VertexAttribs3dvNV = __indirect_glVertexAttribs3dvNV; + glAPI->VertexAttribs3fvNV = __indirect_glVertexAttribs3fvNV; + glAPI->VertexAttribs3svNV = __indirect_glVertexAttribs3svNV; + glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV; + glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV; + glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV; + glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV; + + /* 262. GL_NV_point_sprite */ + + glAPI->PointParameteriNV = __indirect_glPointParameteriNV; + glAPI->PointParameterivNV = __indirect_glPointParameterivNV; + + /* 268. GL_EXT_stencil_two_side */ + + glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT; + + /* 282. GL_NV_fragment_program */ + + glAPI->GetProgramNamedParameterdvNV = __indirect_glGetProgramNamedParameterdvNV; + glAPI->GetProgramNamedParameterfvNV = __indirect_glGetProgramNamedParameterfvNV; + glAPI->ProgramNamedParameter4dNV = __indirect_glProgramNamedParameter4dNV; + glAPI->ProgramNamedParameter4dvNV = __indirect_glProgramNamedParameter4dvNV; + glAPI->ProgramNamedParameter4fNV = __indirect_glProgramNamedParameter4fNV; + glAPI->ProgramNamedParameter4fvNV = __indirect_glProgramNamedParameter4fvNV; + + /* 299. GL_EXT_blend_equation_separate */ + + glAPI->BlendEquationSeparateEXT = __indirect_glBlendEquationSeparateEXT; + + /* 310. GL_EXT_framebuffer_object */ + + glAPI->BindFramebufferEXT = __indirect_glBindFramebufferEXT; + glAPI->BindRenderbufferEXT = __indirect_glBindRenderbufferEXT; + glAPI->CheckFramebufferStatusEXT = __indirect_glCheckFramebufferStatusEXT; + glAPI->DeleteFramebuffersEXT = __indirect_glDeleteFramebuffersEXT; + glAPI->DeleteRenderbuffersEXT = __indirect_glDeleteRenderbuffersEXT; + glAPI->FramebufferRenderbufferEXT = __indirect_glFramebufferRenderbufferEXT; + glAPI->FramebufferTexture1DEXT = __indirect_glFramebufferTexture1DEXT; + glAPI->FramebufferTexture2DEXT = __indirect_glFramebufferTexture2DEXT; + glAPI->FramebufferTexture3DEXT = __indirect_glFramebufferTexture3DEXT; + glAPI->GenFramebuffersEXT = __indirect_glGenFramebuffersEXT; + glAPI->GenRenderbuffersEXT = __indirect_glGenRenderbuffersEXT; + glAPI->GenerateMipmapEXT = __indirect_glGenerateMipmapEXT; + glAPI->GetFramebufferAttachmentParameterivEXT = __indirect_glGetFramebufferAttachmentParameterivEXT; + glAPI->GetRenderbufferParameterivEXT = __indirect_glGetRenderbufferParameterivEXT; + glAPI->IsFramebufferEXT = __indirect_glIsFramebufferEXT; + glAPI->IsRenderbufferEXT = __indirect_glIsRenderbufferEXT; + glAPI->RenderbufferStorageEXT = __indirect_glRenderbufferStorageEXT; + + return glAPI; +} + diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.h xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.h --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_init.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,41 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * + */ + +#ifndef _INDIRECT_INIT_H_ +#define _INDIRECT_INIT_H_ + +#include "glxclient.h" + +extern __GLapi *__glXNewIndirectAPI(void); + +#endif /* _INDIRECT_INIT_H_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,382 @@ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ + +/* + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#include +#include "indirect_size.h" + +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define PURE __attribute__((pure)) +# else +# define PURE +# endif + +# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# define FASTCALL __attribute__((fastcall)) +# else +# define FASTCALL +# endif + +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# define INTERNAL __attribute__((visibility("internal"))) +# else +# define INTERNAL +# endif + + +#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) +# undef HAVE_ALIAS +#endif +#ifdef HAVE_ALIAS +# define ALIAS2(from,to) \ + INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ + __attribute__ ((alias( # to ))); +# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size ) +#else +# define ALIAS(from,to) \ + INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ + { return __gl ## to ## _size( e ); } +#endif + + +INTERNAL PURE FASTCALL GLint +__glCallLists_size(GLenum e) +{ + switch (e) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + return 1; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_2_BYTES: + return 2; + case GL_3_BYTES: + return 3; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_4_BYTES: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glFogfv_size(GLenum e) +{ + switch (e) { + case GL_FOG_INDEX: + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + case GL_FOG_MODE: + case GL_FOG_OFFSET_VALUE_SGIX: + case GL_FOG_DISTANCE_MODE_NV: + return 1; + case GL_FOG_COLOR: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glLightfv_size(GLenum e) +{ + switch (e) { + case GL_SPOT_EXPONENT: + case GL_SPOT_CUTOFF: + case GL_CONSTANT_ATTENUATION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + return 1; + case GL_SPOT_DIRECTION: + return 3; + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_POSITION: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glLightModelfv_size(GLenum e) +{ + switch (e) { + case GL_LIGHT_MODEL_LOCAL_VIEWER: + case GL_LIGHT_MODEL_TWO_SIDE: + case GL_LIGHT_MODEL_COLOR_CONTROL: +/* case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/ + return 1; + case GL_LIGHT_MODEL_AMBIENT: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glMaterialfv_size(GLenum e) +{ + switch (e) { + case GL_SHININESS: + return 1; + case GL_COLOR_INDEXES: + return 3; + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + case GL_AMBIENT_AND_DIFFUSE: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glTexParameterfv_size(GLenum e) +{ + switch (e) { + 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: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glTexEnvfv_size(GLenum e) +{ + switch (e) { + case GL_ALPHA_SCALE: + case GL_TEXTURE_ENV_MODE: + case GL_TEXTURE_LOD_BIAS: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_RGB_SCALE: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + case GL_SOURCE3_RGB_NV: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + case GL_SOURCE3_ALPHA_NV: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND3_RGB_NV: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_OPERAND3_ALPHA_NV: + case GL_COORD_REPLACE_ARB: +/* case GL_COORD_REPLACE_NV:*/ + return 1; + case GL_TEXTURE_ENV_COLOR: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glTexGendv_size(GLenum e) +{ + switch (e) { + case GL_TEXTURE_GEN_MODE: + return 1; + case GL_OBJECT_PLANE: + case GL_EYE_PLANE: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glMap1d_size(GLenum e) +{ + switch (e) { + case GL_MAP1_INDEX: + case GL_MAP1_TEXTURE_COORD_1: + return 1; + case GL_MAP1_TEXTURE_COORD_2: + return 2; + case GL_MAP1_NORMAL: + case GL_MAP1_TEXTURE_COORD_3: + case GL_MAP1_VERTEX_3: + return 3; + case GL_MAP1_COLOR_4: + case GL_MAP1_TEXTURE_COORD_4: + case GL_MAP1_VERTEX_4: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glMap2d_size(GLenum e) +{ + switch (e) { + case GL_MAP2_INDEX: + case GL_MAP2_TEXTURE_COORD_1: + return 1; + case GL_MAP2_TEXTURE_COORD_2: + return 2; + case GL_MAP2_NORMAL: + case GL_MAP2_TEXTURE_COORD_3: + case GL_MAP2_VERTEX_3: + return 3; + case GL_MAP2_COLOR_4: + case GL_MAP2_TEXTURE_COORD_4: + case GL_MAP2_VERTEX_4: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glColorTableParameterfv_size(GLenum e) +{ + switch (e) { + case GL_COLOR_TABLE_SCALE: + case GL_COLOR_TABLE_BIAS: + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glConvolutionParameterfv_size(GLenum e) +{ + switch (e) { + case GL_CONVOLUTION_BORDER_MODE: +/* case GL_CONVOLUTION_BORDER_MODE_EXT:*/ + return 1; + case GL_CONVOLUTION_FILTER_SCALE: +/* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/ + case GL_CONVOLUTION_FILTER_BIAS: +/* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/ + case GL_CONVOLUTION_BORDER_COLOR: +/* case GL_CONVOLUTION_BORDER_COLOR_HP:*/ + return 4; + default: + return 0; + } +} + +INTERNAL PURE FASTCALL GLint +__glPointParameterfvEXT_size(GLenum e) +{ + switch (e) { + case GL_POINT_SIZE_MIN: +/* case GL_POINT_SIZE_MIN_ARB:*/ +/* case GL_POINT_SIZE_MIN_SGIS:*/ + case GL_POINT_SIZE_MAX: +/* case GL_POINT_SIZE_MAX_ARB:*/ +/* case GL_POINT_SIZE_MAX_SGIS:*/ + case GL_POINT_FADE_THRESHOLD_SIZE: +/* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/ +/* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/ + case GL_POINT_SPRITE_R_MODE_NV: + case GL_POINT_SPRITE_COORD_ORIGIN: + return 1; + case GL_POINT_DISTANCE_ATTENUATION: +/* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/ +/* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/ + return 3; + default: + return 0; + } +} + +ALIAS(Fogiv, Fogfv) + ALIAS(Lightiv, Lightfv) + ALIAS(LightModeliv, LightModelfv) + ALIAS(Materialiv, Materialfv) + ALIAS(TexParameteriv, TexParameterfv) + ALIAS(TexEnviv, TexEnvfv) + ALIAS(TexGenfv, TexGendv) + ALIAS(TexGeniv, TexGendv) + ALIAS(Map1f, Map1d) + ALIAS(Map2f, Map2d) + ALIAS(ColorTableParameteriv, ColorTableParameterfv) + ALIAS(ConvolutionParameteriv, ConvolutionParameterfv) + ALIAS(PointParameterivNV, PointParameterfvEXT) +# undef PURE +# undef FASTCALL +# undef INTERNAL diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.h xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.h --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_size.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,88 @@ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ + +/* + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#if !defined( _INDIRECT_SIZE_H_ ) +# define _INDIRECT_SIZE_H_ + +/** + * \file + * Prototypes for functions used to determine the number of data elements in + * various GLX protocol messages. + * + * \author Ian Romanick + */ + +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define PURE __attribute__((pure)) +# else +# define PURE +# endif + +# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# define FASTCALL __attribute__((fastcall)) +# else +# define FASTCALL +# endif + +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# define INTERNAL __attribute__((visibility("internal"))) +# else +# define INTERNAL +# endif + +extern INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glPointParameterfvEXT_size(GLenum); +extern INTERNAL PURE FASTCALL GLint __glPointParameterivNV_size(GLenum); + +# undef PURE +# undef FASTCALL +# undef INTERNAL + +#endif /* !defined( _INDIRECT_SIZE_H_ ) */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_texture_compression.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_texture_compression.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_texture_compression.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_texture_compression.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,343 @@ +/* + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glx_texture_compression.c + * Contains the routines required to implement GLX protocol for + * ARB_texture_compression and related extensions. + * + * \sa http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_compression.txt + * + * \author Ian Romanick + */ + +#include "packrender.h" +#include "packsingle.h" +#include "indirect.h" + +#include + + +void +__indirect_glGetCompressedTexImageARB(GLenum target, GLint level, + GLvoid * img) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + xGLXGetTexImageReply reply; + size_t image_bytes; + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_GetCompressedTexImage, 8); + __GLX_SINGLE_PUT_LONG(0, target); + __GLX_SINGLE_PUT_LONG(4, level); + __GLX_SINGLE_READ_XREPLY(); + + image_bytes = reply.width; + assert(image_bytes <= ((4 * reply.length) - 0)); + assert(image_bytes >= ((4 * reply.length) - 3)); + + if (image_bytes != 0) { + _XRead(dpy, (char *) img, image_bytes); + if (image_bytes < (4 * reply.length)) { + _XEatData(dpy, (4 * reply.length) - image_bytes); + } + } + + __GLX_SINGLE_END(); +} + + +/** + * Internal function used for \c glCompressedTexImage1D and + * \c glCompressedTexImage2D. + */ +static void +CompressedTexImage1D2D(GLenum target, GLint level, + GLenum internal_format, + GLsizei width, GLsizei height, + GLint border, GLsizei image_size, + const GLvoid * data, CARD32 rop) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (gc->currentDpy == NULL) { + return; + } + + if ((target == GL_PROXY_TEXTURE_1D) + || (target == GL_PROXY_TEXTURE_2D) + || (target == GL_PROXY_TEXTURE_CUBE_MAP)) { + compsize = 0; + } + else { + compsize = image_size; + } + + cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + compsize); + if (cmdlen <= gc->maxSmallRenderCommandSize) { + __GLX_BEGIN_VARIABLE(rop, cmdlen); + __GLX_PUT_LONG(4, target); + __GLX_PUT_LONG(8, level); + __GLX_PUT_LONG(12, internal_format); + __GLX_PUT_LONG(16, width); + __GLX_PUT_LONG(20, height); + __GLX_PUT_LONG(24, border); + __GLX_PUT_LONG(28, image_size); + if (compsize != 0) { + __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE, + data, image_size); + } + __GLX_END(cmdlen); + } + else { + assert(compsize != 0); + + __GLX_BEGIN_VARIABLE_LARGE(rop, cmdlen + 4); + __GLX_PUT_LONG(8, target); + __GLX_PUT_LONG(12, level); + __GLX_PUT_LONG(16, internal_format); + __GLX_PUT_LONG(20, width); + __GLX_PUT_LONG(24, height); + __GLX_PUT_LONG(28, border); + __GLX_PUT_LONG(32, image_size); + __glXSendLargeCommand(gc, gc->pc, + __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + 4, + data, image_size); + } +} + + +/** + * Internal function used for \c glCompressedTexSubImage1D and + * \c glCompressedTexSubImage2D. + */ +static void +CompressedTexSubImage1D2D(GLenum target, GLint level, + GLsizei xoffset, GLsizei yoffset, + GLsizei width, GLsizei height, + GLenum format, GLsizei image_size, + const GLvoid * data, CARD32 rop) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (gc->currentDpy == NULL) { + return; + } + + if (target == GL_PROXY_TEXTURE_3D) { + compsize = 0; + } + else { + compsize = image_size; + } + + cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + compsize); + if (cmdlen <= gc->maxSmallRenderCommandSize) { + __GLX_BEGIN_VARIABLE(rop, cmdlen); + __GLX_PUT_LONG(4, target); + __GLX_PUT_LONG(8, level); + __GLX_PUT_LONG(12, xoffset); + __GLX_PUT_LONG(16, yoffset); + __GLX_PUT_LONG(20, width); + __GLX_PUT_LONG(24, height); + __GLX_PUT_LONG(28, format); + __GLX_PUT_LONG(32, image_size); + if (compsize != 0) { + __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE, + data, image_size); + } + __GLX_END(cmdlen); + } + else { + assert(compsize != 0); + + __GLX_BEGIN_VARIABLE_LARGE(rop, cmdlen + 4); + __GLX_PUT_LONG(8, target); + __GLX_PUT_LONG(12, level); + __GLX_PUT_LONG(16, xoffset); + __GLX_PUT_LONG(20, yoffset); + __GLX_PUT_LONG(24, width); + __GLX_PUT_LONG(28, height); + __GLX_PUT_LONG(32, format); + __GLX_PUT_LONG(36, image_size); + __glXSendLargeCommand(gc, gc->pc, + __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + 4, + data, image_size); + } +} + + +void +__indirect_glCompressedTexImage1DARB(GLenum target, GLint level, + GLenum internal_format, GLsizei width, + GLint border, GLsizei image_size, + const GLvoid * data) +{ + CompressedTexImage1D2D(target, level, internal_format, width, 0, + border, image_size, data, + X_GLrop_CompressedTexImage1D); +} + + +void +__indirect_glCompressedTexImage2DARB(GLenum target, GLint level, + GLenum internal_format, + GLsizei width, GLsizei height, + GLint border, GLsizei image_size, + const GLvoid * data) +{ + CompressedTexImage1D2D(target, level, internal_format, width, height, + border, image_size, data, + X_GLrop_CompressedTexImage2D); +} + + +void +__indirect_glCompressedTexImage3DARB(GLenum target, GLint level, + GLenum internal_format, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLsizei image_size, const GLvoid * data) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (gc->currentDpy == NULL) { + return; + } + + cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + image_size); + if (cmdlen <= gc->maxSmallRenderCommandSize) { + __GLX_BEGIN_VARIABLE(X_GLrop_CompressedTexImage3D, cmdlen); + __GLX_PUT_LONG(4, target); + __GLX_PUT_LONG(8, level); + __GLX_PUT_LONG(12, internal_format); + __GLX_PUT_LONG(16, width); + __GLX_PUT_LONG(20, height); + __GLX_PUT_LONG(24, depth); + __GLX_PUT_LONG(28, border); + __GLX_PUT_LONG(32, image_size); + if (image_size != 0) { + __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE, + data, image_size); + } + __GLX_END(cmdlen); + } + else { + __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_CompressedTexImage3D, cmdlen + 4); + __GLX_PUT_LONG(8, target); + __GLX_PUT_LONG(12, level); + __GLX_PUT_LONG(16, internal_format); + __GLX_PUT_LONG(20, width); + __GLX_PUT_LONG(24, height); + __GLX_PUT_LONG(28, depth); + __GLX_PUT_LONG(32, border); + __GLX_PUT_LONG(36, image_size); + __glXSendLargeCommand(gc, gc->pc, + __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + 4, + data, image_size); + } +} + + +void +__indirect_glCompressedTexSubImage1DARB(GLenum target, GLint level, + GLint xoffset, + GLsizei width, + GLenum format, GLsizei image_size, + const GLvoid * data) +{ + CompressedTexSubImage1D2D(target, level, xoffset, 0, width, 0, + format, image_size, data, + X_GLrop_CompressedTexSubImage1D); +} + + +void +__indirect_glCompressedTexSubImage2DARB(GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLsizei image_size, + const GLvoid * data) +{ + CompressedTexSubImage1D2D(target, level, xoffset, yoffset, width, height, + format, image_size, data, + X_GLrop_CompressedTexSubImage2D); +} + + +void +__indirect_glCompressedTexSubImage3DARB(GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, GLsizei image_size, + const GLvoid * data) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (gc->currentDpy == NULL) { + return; + } + + cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE + + image_size); + if (cmdlen <= gc->maxSmallRenderCommandSize) { + __GLX_BEGIN_VARIABLE(X_GLrop_CompressedTexSubImage3D, cmdlen); + __GLX_PUT_LONG(4, target); + __GLX_PUT_LONG(8, level); + __GLX_PUT_LONG(12, xoffset); + __GLX_PUT_LONG(16, yoffset); + __GLX_PUT_LONG(20, zoffset); + __GLX_PUT_LONG(24, width); + __GLX_PUT_LONG(28, height); + __GLX_PUT_LONG(32, depth); + __GLX_PUT_LONG(36, format); + __GLX_PUT_LONG(40, image_size); + if (image_size != 0) { + __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE, + data, image_size); + } + __GLX_END(cmdlen); + } + else { + __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_CompressedTexSubImage3D, cmdlen + 4); + __GLX_PUT_LONG(8, target); + __GLX_PUT_LONG(12, level); + __GLX_PUT_LONG(16, xoffset); + __GLX_PUT_LONG(20, yoffset); + __GLX_PUT_LONG(24, zoffset); + __GLX_PUT_LONG(28, width); + __GLX_PUT_LONG(32, height); + __GLX_PUT_LONG(36, depth); + __GLX_PUT_LONG(40, format); + __GLX_PUT_LONG(44, image_size); + __glXSendLargeCommand(gc, gc->pc, + __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE + 4, + data, image_size); + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_transpose_matrix.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_transpose_matrix.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_transpose_matrix.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_transpose_matrix.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,85 @@ +/* + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include "indirect.h" + +static void +TransposeMatrixf(const GLfloat s[16], GLfloat d[16]) +{ + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + d[i * 4 + j] = s[j * 4 + i]; + } + } +} + +static void +TransposeMatrixd(const GLdouble s[16], GLdouble d[16]) +{ + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + d[i * 4 + j] = s[j * 4 + i]; + } + } +} + + +void +__indirect_glLoadTransposeMatrixdARB(const GLdouble * m) +{ + GLdouble mt[16]; + + TransposeMatrixd(m, mt); + __indirect_glLoadMatrixd(mt); +} + +void +__indirect_glLoadTransposeMatrixfARB(const GLfloat * m) +{ + GLfloat mt[16]; + + TransposeMatrixf(m, mt); + __indirect_glLoadMatrixf(mt); +} + +void +__indirect_glMultTransposeMatrixdARB(const GLdouble * m) +{ + GLdouble mt[16]; + + TransposeMatrixd(m, mt); + __indirect_glMultMatrixd(mt); +} + +void +__indirect_glMultTransposeMatrixfARB(const GLfloat * m) +{ + GLfloat mt[16]; + + TransposeMatrixf(m, mt); + __indirect_glMultMatrixf(mt); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1985 @@ +/* + * (C) Copyright IBM Corporation 2004, 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include + +#include "glxclient.h" +#include "indirect.h" +#include +#include "glxextensions.h" +#include "indirect_vertex_array.h" +#include "indirect_vertex_array_priv.h" + +#define __GLX_PAD(n) (((n)+3) & ~3) + +/** + * \file indirect_vertex_array.c + * Implement GLX protocol for vertex arrays and vertex buffer objects. + * + * The most important function in this fill is \c fill_array_info_cache. + * The \c array_state_vector contains a cache of the ARRAY_INFO data sent + * in the DrawArrays protocol. Certain operations, such as enabling or + * disabling an array, can invalidate this cache. \c fill_array_info_cache + * fills-in this data. Additionally, it examines the enabled state and + * other factors to determine what "version" of DrawArrays protocoal can be + * used. + * + * Current, only two versions of DrawArrays protocol are implemented. The + * first version is the "none" protocol. This is the fallback when the + * server does not support GL 1.1 / EXT_vertex_arrays. It is implemented + * by sending batches of immediate mode commands that are equivalent to the + * DrawArrays protocol. + * + * The other protocol that is currently implemented is the "old" protocol. + * This is the GL 1.1 DrawArrays protocol. The only difference between GL + * 1.1 and EXT_vertex_arrays is the opcode used for the DrawArrays command. + * This protocol is called "old" because the ARB is in the process of + * defining a new protocol, which will probably be called wither "new" or + * "vbo", to support multiple texture coordinate arrays, generic attributes, + * and vertex buffer objects. + * + * \author Ian Romanick + */ + +static void emit_DrawArrays_none(GLenum mode, GLint first, GLsizei count); +static void emit_DrawArrays_old(GLenum mode, GLint first, GLsizei count); + +static void emit_DrawElements_none(GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices); +static void emit_DrawElements_old(GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices); + + +static GLubyte *emit_element_none(GLubyte * dst, + const struct array_state_vector *arrays, + unsigned index); +static GLubyte *emit_element_old(GLubyte * dst, + const struct array_state_vector *arrays, + unsigned index); +static struct array_state *get_array_entry(const struct array_state_vector + *arrays, GLenum key, + unsigned index); +static void fill_array_info_cache(struct array_state_vector *arrays); +static GLboolean validate_mode(__GLXcontext * gc, GLenum mode); +static GLboolean validate_count(__GLXcontext * gc, GLsizei count); +static GLboolean validate_type(__GLXcontext * gc, GLenum type); + + +/** + * Table of sizes, in bytes, of a GL types. All of the type enums are be in + * the range 0x1400 - 0x140F. That includes types added by extensions (i.e., + * \c GL_HALF_FLOAT_NV). This elements of this table correspond to the + * type enums masked with 0x0f. + * + * \notes + * \c GL_HALF_FLOAT_NV is not included. Neither are \c GL_2_BYTES, + * \c GL_3_BYTES, or \c GL_4_BYTES. + */ +const GLuint __glXTypeSize_table[16] = { + 1, 1, 2, 2, 4, 4, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0 +}; + + +/** + * Free the per-context array state that was allocated with + * __glXInitVertexArrayState(). + */ +void +__glXFreeVertexArrayState(__GLXcontext * gc) +{ + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + if (arrays) { + if (arrays->stack) { + free(arrays->stack); + arrays->stack = NULL; + } + if (arrays->arrays) { + free(arrays->arrays); + arrays->arrays = NULL; + } + free(arrays); + state->array_state = NULL; + } +} + + +/** + * Initialize vertex array state of a GLX context. + * + * \param gc GLX context whose vertex array state is to be initialized. + * + * \warning + * This function may only be called after __GLXcontext::gl_extension_bits, + * __GLXcontext::server_minor, and __GLXcontext::server_major have been + * initialized. These values are used to determine what vertex arrays are + * supported. + * + * \bug + * Return values from malloc are not properly tested. + */ +void +__glXInitVertexArrayState(__GLXcontext * gc) +{ + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays; + + unsigned array_count; + int texture_units = 1, vertex_program_attribs = 0; + unsigned i, j; + + GLboolean got_fog = GL_FALSE; + GLboolean got_secondary_color = GL_FALSE; + + + arrays = calloc(1, sizeof(struct array_state_vector)); + state->array_state = arrays; + + arrays->old_DrawArrays_possible = !state->NoDrawArraysProtocol; + arrays->new_DrawArrays_possible = GL_FALSE; + arrays->DrawArrays = NULL; + + arrays->active_texture_unit = 0; + + + /* Determine how many arrays are actually needed. Only arrays that + * are supported by the server are create. For example, if the server + * supports only 2 texture units, then only 2 texture coordinate arrays + * are created. + * + * At the very least, GL_VERTEX_ARRAY, GL_NORMAL_ARRAY, + * GL_COLOR_ARRAY, GL_INDEX_ARRAY, GL_TEXTURE_COORD_ARRAY, and + * GL_EDGE_FLAG_ARRAY are supported. + */ + + array_count = 5; + + if (__glExtensionBitIsEnabled(gc, GL_EXT_fog_coord_bit) + || (gc->server_major > 1) || (gc->server_minor >= 4)) { + got_fog = GL_TRUE; + array_count++; + } + + if (__glExtensionBitIsEnabled(gc, GL_EXT_secondary_color_bit) + || (gc->server_major > 1) || (gc->server_minor >= 4)) { + got_secondary_color = GL_TRUE; + array_count++; + } + + if (__glExtensionBitIsEnabled(gc, GL_ARB_multitexture_bit) + || (gc->server_major > 1) || (gc->server_minor >= 3)) { + __indirect_glGetIntegerv(GL_MAX_TEXTURE_UNITS, &texture_units); + } + + if (__glExtensionBitIsEnabled(gc, GL_ARB_vertex_program_bit)) { + __indirect_glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, + GL_MAX_PROGRAM_ATTRIBS_ARB, + &vertex_program_attribs); + } + + arrays->num_texture_units = texture_units; + arrays->num_vertex_program_attribs = vertex_program_attribs; + array_count += texture_units + vertex_program_attribs; + arrays->num_arrays = array_count; + arrays->arrays = calloc(array_count, sizeof(struct array_state)); + + arrays->arrays[0].data_type = GL_FLOAT; + arrays->arrays[0].count = 3; + arrays->arrays[0].key = GL_NORMAL_ARRAY; + arrays->arrays[0].normalized = GL_TRUE; + arrays->arrays[0].old_DrawArrays_possible = GL_TRUE; + + arrays->arrays[1].data_type = GL_FLOAT; + arrays->arrays[1].count = 4; + arrays->arrays[1].key = GL_COLOR_ARRAY; + arrays->arrays[1].normalized = GL_TRUE; + arrays->arrays[1].old_DrawArrays_possible = GL_TRUE; + + arrays->arrays[2].data_type = GL_FLOAT; + arrays->arrays[2].count = 1; + arrays->arrays[2].key = GL_INDEX_ARRAY; + arrays->arrays[2].old_DrawArrays_possible = GL_TRUE; + + arrays->arrays[3].data_type = GL_UNSIGNED_BYTE; + arrays->arrays[3].count = 1; + arrays->arrays[3].key = GL_EDGE_FLAG_ARRAY; + arrays->arrays[3].old_DrawArrays_possible = GL_TRUE; + + for (i = 0; i < texture_units; i++) { + arrays->arrays[4 + i].data_type = GL_FLOAT; + arrays->arrays[4 + i].count = 4; + arrays->arrays[4 + i].key = GL_TEXTURE_COORD_ARRAY; + + arrays->arrays[4 + i].old_DrawArrays_possible = (i == 0); + arrays->arrays[4 + i].index = i; + + arrays->arrays[4 + i].header[1] = i + GL_TEXTURE0; + } + + i = 4 + texture_units; + + if (got_fog) { + arrays->arrays[i].data_type = GL_FLOAT; + arrays->arrays[i].count = 1; + arrays->arrays[i].key = GL_FOG_COORDINATE_ARRAY; + arrays->arrays[i].old_DrawArrays_possible = GL_TRUE; + i++; + } + + if (got_secondary_color) { + arrays->arrays[i].data_type = GL_FLOAT; + arrays->arrays[i].count = 3; + arrays->arrays[i].key = GL_SECONDARY_COLOR_ARRAY; + arrays->arrays[i].old_DrawArrays_possible = GL_TRUE; + arrays->arrays[i].normalized = GL_TRUE; + i++; + } + + + for (j = 0; j < vertex_program_attribs; j++) { + const unsigned idx = (vertex_program_attribs - (j + 1)); + + + arrays->arrays[idx + i].data_type = GL_FLOAT; + arrays->arrays[idx + i].count = 4; + arrays->arrays[idx + i].key = GL_VERTEX_ATTRIB_ARRAY_POINTER; + + arrays->arrays[idx + i].old_DrawArrays_possible = 0; + arrays->arrays[idx + i].index = idx; + + arrays->arrays[idx + i].header[1] = idx; + } + + i += vertex_program_attribs; + + + /* Vertex array *must* be last becuase of the way that + * emit_DrawArrays_none works. + */ + + arrays->arrays[i].data_type = GL_FLOAT; + arrays->arrays[i].count = 4; + arrays->arrays[i].key = GL_VERTEX_ARRAY; + arrays->arrays[i].old_DrawArrays_possible = GL_TRUE; + + assert((i + 1) == arrays->num_arrays); + + arrays->stack_index = 0; + arrays->stack = malloc(sizeof(struct array_stack_state) + * arrays->num_arrays); +} + + +/** + * Calculate the size of a single vertex for the "none" protocol. This is + * essentially the size of all the immediate-mode commands required to + * implement the enabled vertex arrays. + */ +static size_t +calculate_single_vertex_size_none(const struct array_state_vector *arrays) +{ + size_t single_vertex_size = 0; + unsigned i; + + + for (i = 0; i < arrays->num_arrays; i++) { + if (arrays->arrays[i].enabled) { + single_vertex_size += ((uint16_t *) arrays->arrays[i].header)[0]; + } + } + + return single_vertex_size; +} + + +/** + * Emit a single element using non-DrawArrays protocol. + */ +GLubyte * +emit_element_none(GLubyte * dst, + const struct array_state_vector * arrays, unsigned index) +{ + unsigned i; + + + for (i = 0; i < arrays->num_arrays; i++) { + if (arrays->arrays[i].enabled) { + const size_t offset = index * arrays->arrays[i].true_stride; + + /* The generic attributes can have more data than is in the + * elements. This is because a vertex array can be a 2 element, + * normalized, unsigned short, but the "closest" immediate mode + * protocol is for a 4Nus. Since the sizes are small, the + * performance impact on modern processors should be negligible. + */ + (void) memset(dst, 0, ((uint16_t *) arrays->arrays[i].header)[0]); + + (void) memcpy(dst, arrays->arrays[i].header, + arrays->arrays[i].header_size); + + dst += arrays->arrays[i].header_size; + + (void) memcpy(dst, ((GLubyte *) arrays->arrays[i].data) + offset, + arrays->arrays[i].element_size); + + dst += __GLX_PAD(arrays->arrays[i].element_size); + } + } + + return dst; +} + + +/** + * Emit a single element using "old" DrawArrays protocol from + * EXT_vertex_arrays / OpenGL 1.1. + */ +GLubyte * +emit_element_old(GLubyte * dst, + const struct array_state_vector * arrays, unsigned index) +{ + unsigned i; + + + for (i = 0; i < arrays->num_arrays; i++) { + if (arrays->arrays[i].enabled) { + const size_t offset = index * arrays->arrays[i].true_stride; + + (void) memcpy(dst, ((GLubyte *) arrays->arrays[i].data) + offset, + arrays->arrays[i].element_size); + + dst += __GLX_PAD(arrays->arrays[i].element_size); + } + } + + return dst; +} + + +struct array_state * +get_array_entry(const struct array_state_vector *arrays, + GLenum key, unsigned index) +{ + unsigned i; + + for (i = 0; i < arrays->num_arrays; i++) { + if ((arrays->arrays[i].key == key) + && (arrays->arrays[i].index == index)) { + return &arrays->arrays[i]; + } + } + + return NULL; +} + + +static GLboolean +allocate_array_info_cache(struct array_state_vector *arrays, + size_t required_size) +{ +#define MAX_HEADER_SIZE 20 + if (arrays->array_info_cache_buffer_size < required_size) { + GLubyte *temp = realloc(arrays->array_info_cache_base, + required_size + MAX_HEADER_SIZE); + + if (temp == NULL) { + return GL_FALSE; + } + + arrays->array_info_cache_base = temp; + arrays->array_info_cache = temp + MAX_HEADER_SIZE; + arrays->array_info_cache_buffer_size = required_size; + } + + arrays->array_info_cache_size = required_size; + return GL_TRUE; +} + + +/** + */ +void +fill_array_info_cache(struct array_state_vector *arrays) +{ + GLboolean old_DrawArrays_possible; + unsigned i; + + + /* Determine how many arrays are enabled. + */ + + arrays->enabled_client_array_count = 0; + old_DrawArrays_possible = arrays->old_DrawArrays_possible; + for (i = 0; i < arrays->num_arrays; i++) { + if (arrays->arrays[i].enabled) { + arrays->enabled_client_array_count++; + old_DrawArrays_possible &= arrays->arrays[i].old_DrawArrays_possible; + } + } + + if (arrays->new_DrawArrays_possible) { + assert(!arrays->new_DrawArrays_possible); + } + else if (old_DrawArrays_possible) { + const size_t required_size = arrays->enabled_client_array_count * 12; + uint32_t *info; + + + if (!allocate_array_info_cache(arrays, required_size)) { + return; + } + + + info = (uint32_t *) arrays->array_info_cache; + for (i = 0; i < arrays->num_arrays; i++) { + if (arrays->arrays[i].enabled) { + *(info++) = arrays->arrays[i].data_type; + *(info++) = arrays->arrays[i].count; + *(info++) = arrays->arrays[i].key; + } + } + + arrays->DrawArrays = emit_DrawArrays_old; + arrays->DrawElements = emit_DrawElements_old; + } + else { + arrays->DrawArrays = emit_DrawArrays_none; + arrays->DrawElements = emit_DrawElements_none; + } + + arrays->array_info_cache_valid = GL_TRUE; +} + + +/** + * Emit a \c glDrawArrays command using the "none" protocol. That is, + * emit immediate-mode commands that are equivalent to the requiested + * \c glDrawArrays command. This is used with servers that don't support + * the OpenGL 1.1 / EXT_vertex_arrays DrawArrays protocol or in cases where + * vertex state is enabled that is not compatible with that protocol. + */ +void +emit_DrawArrays_none(GLenum mode, GLint first, GLsizei count) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + size_t single_vertex_size; + GLubyte *pc; + unsigned i; + static const uint16_t begin_cmd[2] = { 8, X_GLrop_Begin }; + static const uint16_t end_cmd[2] = { 4, X_GLrop_End }; + + + single_vertex_size = calculate_single_vertex_size_none(arrays); + + pc = gc->pc; + + (void) memcpy(pc, begin_cmd, 4); + *(int *) (pc + 4) = mode; + + pc += 8; + + for (i = 0; i < count; i++) { + if ((pc + single_vertex_size) >= gc->bufEnd) { + pc = __glXFlushRenderBuffer(gc, pc); + } + + pc = emit_element_none(pc, arrays, first + i); + } + + if ((pc + 4) >= gc->bufEnd) { + pc = __glXFlushRenderBuffer(gc, pc); + } + + (void) memcpy(pc, end_cmd, 4); + pc += 4; + + gc->pc = pc; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + + +/** + * Emit the header data for the GL 1.1 / EXT_vertex_arrays DrawArrays + * protocol. + * + * \param gc GLX context. + * \param arrays Array state. + * \param elements_per_request Location to store the number of elements that + * can fit in a single Render / RenderLarge + * command. + * \param total_request Total number of requests for a RenderLarge + * command. If a Render command is used, this + * will be zero. + * \param mode Drawing mode. + * \param count Number of vertices. + * + * \returns + * A pointer to the buffer for array data. + */ +static GLubyte * +emit_DrawArrays_header_old(__GLXcontext * gc, + struct array_state_vector *arrays, + size_t * elements_per_request, + unsigned int *total_requests, + GLenum mode, GLsizei count) +{ + size_t command_size; + size_t single_vertex_size; + const unsigned header_size = 16; + unsigned i; + GLubyte *pc; + + + /* Determine the size of the whole command. This includes the header, + * the ARRAY_INFO data and the array data. Once this size is calculated, + * it will be known whether a Render or RenderLarge command is needed. + */ + + single_vertex_size = 0; + for (i = 0; i < arrays->num_arrays; i++) { + if (arrays->arrays[i].enabled) { + single_vertex_size += __GLX_PAD(arrays->arrays[i].element_size); + } + } + + command_size = arrays->array_info_cache_size + header_size + + (single_vertex_size * count); + + + /* Write the header for either a Render command or a RenderLarge + * command. After the header is written, write the ARRAY_INFO data. + */ + + if (command_size > gc->maxSmallRenderCommandSize) { + /* maxSize is the maximum amount of data can be stuffed into a single + * packet. sz_xGLXRenderReq is added because bufSize is the maximum + * packet size minus sz_xGLXRenderReq. + */ + const size_t maxSize = (gc->bufSize + sz_xGLXRenderReq) + - sz_xGLXRenderLargeReq; + unsigned vertex_requests; + + + /* Calculate the number of data packets that will be required to send + * the whole command. To do this, the number of verticies that + * will fit in a single buffer must be calculated. + * + * The important value here is elements_per_request. This is the + * number of complete array elements that will fit in a single + * buffer. There may be some wasted space at the end of the buffer, + * but splitting elements across buffer boundries would be painful. + */ + + elements_per_request[0] = maxSize / single_vertex_size; + + vertex_requests = (count + elements_per_request[0] - 1) + / elements_per_request[0]; + + *total_requests = vertex_requests + 1; + + + __glXFlushRenderBuffer(gc, gc->pc); + + command_size += 4; + + pc = ((GLubyte *) arrays->array_info_cache) - (header_size + 4); + *(uint32_t *) (pc + 0) = command_size; + *(uint32_t *) (pc + 4) = X_GLrop_DrawArrays; + *(uint32_t *) (pc + 8) = count; + *(uint32_t *) (pc + 12) = arrays->enabled_client_array_count; + *(uint32_t *) (pc + 16) = mode; + + __glXSendLargeChunk(gc, 1, *total_requests, pc, + header_size + 4 + arrays->array_info_cache_size); + + pc = gc->pc; + } + else { + if ((gc->pc + command_size) >= gc->bufEnd) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + + pc = gc->pc; + *(uint16_t *) (pc + 0) = command_size; + *(uint16_t *) (pc + 2) = X_GLrop_DrawArrays; + *(uint32_t *) (pc + 4) = count; + *(uint32_t *) (pc + 8) = arrays->enabled_client_array_count; + *(uint32_t *) (pc + 12) = mode; + + pc += header_size; + + (void) memcpy(pc, arrays->array_info_cache, + arrays->array_info_cache_size); + pc += arrays->array_info_cache_size; + + *elements_per_request = count; + *total_requests = 0; + } + + + return pc; +} + + +/** + */ +void +emit_DrawArrays_old(GLenum mode, GLint first, GLsizei count) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + GLubyte *pc; + size_t elements_per_request; + unsigned total_requests = 0; + unsigned i; + size_t total_sent = 0; + + + pc = emit_DrawArrays_header_old(gc, arrays, &elements_per_request, + &total_requests, mode, count); + + + /* Write the arrays. + */ + + if (total_requests == 0) { + assert(elements_per_request >= count); + + for (i = 0; i < count; i++) { + pc = emit_element_old(pc, arrays, i + first); + } + + assert(pc <= gc->bufEnd); + + gc->pc = pc; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } + else { + unsigned req; + + + for (req = 2; req <= total_requests; req++) { + if (count < elements_per_request) { + elements_per_request = count; + } + + pc = gc->pc; + for (i = 0; i < elements_per_request; i++) { + pc = emit_element_old(pc, arrays, i + first); + } + + first += elements_per_request; + + total_sent += (size_t) (pc - gc->pc); + __glXSendLargeChunk(gc, req, total_requests, gc->pc, pc - gc->pc); + + count -= elements_per_request; + } + } +} + + +void +emit_DrawElements_none(GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + static const uint16_t begin_cmd[2] = { 8, X_GLrop_Begin }; + static const uint16_t end_cmd[2] = { 4, X_GLrop_End }; + + GLubyte *pc; + size_t single_vertex_size; + unsigned i; + + + single_vertex_size = calculate_single_vertex_size_none(arrays); + + + if ((gc->pc + single_vertex_size) >= gc->bufEnd) { + gc->pc = __glXFlushRenderBuffer(gc, gc->pc); + } + + pc = gc->pc; + + (void) memcpy(pc, begin_cmd, 4); + *(int *) (pc + 4) = mode; + + pc += 8; + + for (i = 0; i < count; i++) { + unsigned index = 0; + + if ((pc + single_vertex_size) >= gc->bufEnd) { + pc = __glXFlushRenderBuffer(gc, pc); + } + + switch (type) { + case GL_UNSIGNED_INT: + index = (unsigned) (((GLuint *) indices)[i]); + break; + case GL_UNSIGNED_SHORT: + index = (unsigned) (((GLushort *) indices)[i]); + break; + case GL_UNSIGNED_BYTE: + index = (unsigned) (((GLubyte *) indices)[i]); + break; + } + pc = emit_element_none(pc, arrays, index); + } + + if ((pc + 4) >= gc->bufEnd) { + pc = __glXFlushRenderBuffer(gc, pc); + } + + (void) memcpy(pc, end_cmd, 4); + pc += 4; + + gc->pc = pc; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + + +/** + */ +void +emit_DrawElements_old(GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + GLubyte *pc; + size_t elements_per_request; + unsigned total_requests = 0; + unsigned i; + unsigned req; + unsigned req_element = 0; + + + pc = emit_DrawArrays_header_old(gc, arrays, &elements_per_request, + &total_requests, mode, count); + + + /* Write the arrays. + */ + + req = 2; + while (count > 0) { + if (count < elements_per_request) { + elements_per_request = count; + } + + switch (type) { + case GL_UNSIGNED_INT:{ + const GLuint *ui_ptr = (const GLuint *) indices + req_element; + + for (i = 0; i < elements_per_request; i++) { + const GLint index = (GLint) * (ui_ptr++); + pc = emit_element_old(pc, arrays, index); + } + break; + } + case GL_UNSIGNED_SHORT:{ + const GLushort *us_ptr = (const GLushort *) indices + req_element; + + for (i = 0; i < elements_per_request; i++) { + const GLint index = (GLint) * (us_ptr++); + pc = emit_element_old(pc, arrays, index); + } + break; + } + case GL_UNSIGNED_BYTE:{ + const GLubyte *ub_ptr = (const GLubyte *) indices + req_element; + + for (i = 0; i < elements_per_request; i++) { + const GLint index = (GLint) * (ub_ptr++); + pc = emit_element_old(pc, arrays, index); + } + break; + } + } + + if (total_requests != 0) { + __glXSendLargeChunk(gc, req, total_requests, gc->pc, pc - gc->pc); + pc = gc->pc; + req++; + } + + count -= elements_per_request; + req_element += elements_per_request; + } + + + assert((total_requests == 0) || ((req - 1) == total_requests)); + + if (total_requests == 0) { + assert(pc <= gc->bufEnd); + + gc->pc = pc; + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } +} + + +/** + * Validate that the \c mode parameter to \c glDrawArrays, et. al. is valid. + * If it is not valid, then an error code is set in the GLX context. + * + * \returns + * \c GL_TRUE if the argument is valid, \c GL_FALSE if is not. + */ +static GLboolean +validate_mode(__GLXcontext * gc, GLenum mode) +{ + switch (mode) { + case GL_POINTS: + case GL_LINE_STRIP: + case GL_LINE_LOOP: + case GL_LINES: + case GL_TRIANGLE_STRIP: + case GL_TRIANGLE_FAN: + case GL_TRIANGLES: + case GL_QUAD_STRIP: + case GL_QUADS: + case GL_POLYGON: + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return GL_FALSE; + } + + return GL_TRUE; +} + + +/** + * Validate that the \c count parameter to \c glDrawArrays, et. al. is valid. + * A value less than zero is invalid and will result in \c GL_INVALID_VALUE + * being set. A value of zero will not result in an error being set, but + * will result in \c GL_FALSE being returned. + * + * \returns + * \c GL_TRUE if the argument is valid, \c GL_FALSE if it is not. + */ +static GLboolean +validate_count(__GLXcontext * gc, GLsizei count) +{ + if (count < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + } + + return (count > 0); +} + + +/** + * Validate that the \c type parameter to \c glDrawElements, et. al. is + * valid. Only \c GL_UNSIGNED_BYTE, \c GL_UNSIGNED_SHORT, and + * \c GL_UNSIGNED_INT are valid. + * + * \returns + * \c GL_TRUE if the argument is valid, \c GL_FALSE if it is not. + */ +static GLboolean +validate_type(__GLXcontext * gc, GLenum type) +{ + switch (type) { + case GL_UNSIGNED_INT: + case GL_UNSIGNED_SHORT: + case GL_UNSIGNED_BYTE: + return GL_TRUE; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return GL_FALSE; + } +} + + +void +__indirect_glDrawArrays(GLenum mode, GLint first, GLsizei count) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + + if (validate_mode(gc, mode) && validate_count(gc, count)) { + if (!arrays->array_info_cache_valid) { + fill_array_info_cache(arrays); + } + + arrays->DrawArrays(mode, first, count); + } +} + + +void +__indirect_glArrayElement(GLint index) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + size_t single_vertex_size; + + + single_vertex_size = calculate_single_vertex_size_none(arrays); + + if ((gc->pc + single_vertex_size) >= gc->bufEnd) { + gc->pc = __glXFlushRenderBuffer(gc, gc->pc); + } + + gc->pc = emit_element_none(gc->pc, arrays, index); + + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + + +void +__indirect_glDrawElements(GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + + if (validate_mode(gc, mode) && validate_count(gc, count) + && validate_type(gc, type)) { + if (!arrays->array_info_cache_valid) { + fill_array_info_cache(arrays); + } + + arrays->DrawElements(mode, count, type, indices); + } +} + + +void +__indirect_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid * indices) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + + + if (validate_mode(gc, mode) && validate_count(gc, count) + && validate_type(gc, type)) { + if (end < start) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + if (!arrays->array_info_cache_valid) { + fill_array_info_cache(arrays); + } + + arrays->DrawElements(mode, count, type, indices); + } +} + + +void +__indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, + GLsizei primcount) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + GLsizei i; + + + if (validate_mode(gc, mode)) { + if (!arrays->array_info_cache_valid) { + fill_array_info_cache(arrays); + } + + for (i = 0; i < primcount; i++) { + if (validate_count(gc, count[i])) { + arrays->DrawArrays(mode, first[i], count[i]); + } + } + } +} + + +void +__indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, + GLenum type, const GLvoid ** indices, + GLsizei primcount) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + const __GLXattribute *state = + (const __GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + GLsizei i; + + + if (validate_mode(gc, mode) && validate_type(gc, type)) { + if (!arrays->array_info_cache_valid) { + fill_array_info_cache(arrays); + } + + for (i = 0; i < primcount; i++) { + if (validate_count(gc, count[i])) { + arrays->DrawElements(mode, count[i], type, indices[i]); + } + } + } +} + + +#define COMMON_ARRAY_DATA_INIT(a, PTR, TYPE, STRIDE, COUNT, NORMALIZED, HDR_SIZE, OPCODE) \ + do { \ + (a)->data = PTR; \ + (a)->data_type = TYPE; \ + (a)->user_stride = STRIDE; \ + (a)->count = COUNT; \ + (a)->normalized = NORMALIZED; \ + \ + (a)->element_size = __glXTypeSize( TYPE ) * COUNT; \ + (a)->true_stride = (STRIDE == 0) \ + ? (a)->element_size : STRIDE; \ + \ + (a)->header_size = HDR_SIZE; \ + ((uint16_t *) (a)->header)[0] = __GLX_PAD((a)->header_size + (a)->element_size); \ + ((uint16_t *) (a)->header)[1] = OPCODE; \ + } while(0) + + +void +__indirect_glVertexPointer(GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + static const uint16_t short_ops[5] = { + 0, 0, X_GLrop_Vertex2sv, X_GLrop_Vertex3sv, X_GLrop_Vertex4sv + }; + static const uint16_t int_ops[5] = { + 0, 0, X_GLrop_Vertex2iv, X_GLrop_Vertex3iv, X_GLrop_Vertex4iv + }; + static const uint16_t float_ops[5] = { + 0, 0, X_GLrop_Vertex2fv, X_GLrop_Vertex3fv, X_GLrop_Vertex4fv + }; + static const uint16_t double_ops[5] = { + 0, 0, X_GLrop_Vertex2dv, X_GLrop_Vertex3dv, X_GLrop_Vertex4dv + }; + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (size < 2 || size > 4 || stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + switch (type) { + case GL_SHORT: + opcode = short_ops[size]; + break; + case GL_INT: + opcode = int_ops[size]; + break; + case GL_FLOAT: + opcode = float_ops[size]; + break; + case GL_DOUBLE: + opcode = double_ops[size]; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + a = get_array_entry(arrays, GL_VERTEX_ARRAY, 0); + assert(a != NULL); + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, size, GL_FALSE, 4, + opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glNormalPointer(GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + switch (type) { + case GL_BYTE: + opcode = X_GLrop_Normal3bv; + break; + case GL_SHORT: + opcode = X_GLrop_Normal3sv; + break; + case GL_INT: + opcode = X_GLrop_Normal3iv; + break; + case GL_FLOAT: + opcode = X_GLrop_Normal3fv; + break; + case GL_DOUBLE: + opcode = X_GLrop_Normal3dv; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + a = get_array_entry(arrays, GL_NORMAL_ARRAY, 0); + assert(a != NULL); + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, 3, GL_TRUE, 4, opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glColorPointer(GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + static const uint16_t byte_ops[5] = { + 0, 0, 0, X_GLrop_Color3bv, X_GLrop_Color4bv + }; + static const uint16_t ubyte_ops[5] = { + 0, 0, 0, X_GLrop_Color3ubv, X_GLrop_Color4ubv + }; + static const uint16_t short_ops[5] = { + 0, 0, 0, X_GLrop_Color3sv, X_GLrop_Color4sv + }; + static const uint16_t ushort_ops[5] = { + 0, 0, 0, X_GLrop_Color3usv, X_GLrop_Color4usv + }; + static const uint16_t int_ops[5] = { + 0, 0, 0, X_GLrop_Color3iv, X_GLrop_Color4iv + }; + static const uint16_t uint_ops[5] = { + 0, 0, 0, X_GLrop_Color3uiv, X_GLrop_Color4uiv + }; + static const uint16_t float_ops[5] = { + 0, 0, 0, X_GLrop_Color3fv, X_GLrop_Color4fv + }; + static const uint16_t double_ops[5] = { + 0, 0, 0, X_GLrop_Color3dv, X_GLrop_Color4dv + }; + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (size < 3 || size > 4 || stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + switch (type) { + case GL_BYTE: + opcode = byte_ops[size]; + break; + case GL_UNSIGNED_BYTE: + opcode = ubyte_ops[size]; + break; + case GL_SHORT: + opcode = short_ops[size]; + break; + case GL_UNSIGNED_SHORT: + opcode = ushort_ops[size]; + break; + case GL_INT: + opcode = int_ops[size]; + break; + case GL_UNSIGNED_INT: + opcode = uint_ops[size]; + break; + case GL_FLOAT: + opcode = float_ops[size]; + break; + case GL_DOUBLE: + opcode = double_ops[size]; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + a = get_array_entry(arrays, GL_COLOR_ARRAY, 0); + assert(a != NULL); + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, size, GL_TRUE, 4, opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer) +{ + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + switch (type) { + case GL_UNSIGNED_BYTE: + opcode = X_GLrop_Indexubv; + break; + case GL_SHORT: + opcode = X_GLrop_Indexsv; + break; + case GL_INT: + opcode = X_GLrop_Indexiv; + break; + case GL_FLOAT: + opcode = X_GLrop_Indexfv; + break; + case GL_DOUBLE: + opcode = X_GLrop_Indexdv; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + a = get_array_entry(arrays, GL_INDEX_ARRAY, 0); + assert(a != NULL); + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, 1, GL_FALSE, 4, opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + + a = get_array_entry(arrays, GL_EDGE_FLAG_ARRAY, 0); + assert(a != NULL); + COMMON_ARRAY_DATA_INIT(a, pointer, GL_UNSIGNED_BYTE, stride, 1, GL_FALSE, + 4, X_GLrop_EdgeFlagv); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + static const uint16_t short_ops[5] = { + 0, X_GLrop_TexCoord1sv, X_GLrop_TexCoord2sv, X_GLrop_TexCoord3sv, + X_GLrop_TexCoord4sv + }; + static const uint16_t int_ops[5] = { + 0, X_GLrop_TexCoord1iv, X_GLrop_TexCoord2iv, X_GLrop_TexCoord3iv, + X_GLrop_TexCoord4iv + }; + static const uint16_t float_ops[5] = { + 0, X_GLrop_TexCoord1dv, X_GLrop_TexCoord2fv, X_GLrop_TexCoord3fv, + X_GLrop_TexCoord4fv + }; + static const uint16_t double_ops[5] = { + 0, X_GLrop_TexCoord1dv, X_GLrop_TexCoord2dv, X_GLrop_TexCoord3dv, + X_GLrop_TexCoord4dv + }; + + static const uint16_t mshort_ops[5] = { + 0, X_GLrop_MultiTexCoord1svARB, X_GLrop_MultiTexCoord2svARB, + X_GLrop_MultiTexCoord3svARB, X_GLrop_MultiTexCoord4svARB + }; + static const uint16_t mint_ops[5] = { + 0, X_GLrop_MultiTexCoord1ivARB, X_GLrop_MultiTexCoord2ivARB, + X_GLrop_MultiTexCoord3ivARB, X_GLrop_MultiTexCoord4ivARB + }; + static const uint16_t mfloat_ops[5] = { + 0, X_GLrop_MultiTexCoord1dvARB, X_GLrop_MultiTexCoord2fvARB, + X_GLrop_MultiTexCoord3fvARB, X_GLrop_MultiTexCoord4fvARB + }; + static const uint16_t mdouble_ops[5] = { + 0, X_GLrop_MultiTexCoord1dvARB, X_GLrop_MultiTexCoord2dvARB, + X_GLrop_MultiTexCoord3dvARB, X_GLrop_MultiTexCoord4dvARB + }; + + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + unsigned header_size; + unsigned index; + + + if (size < 1 || size > 4 || stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + index = arrays->active_texture_unit; + if (index == 0) { + switch (type) { + case GL_SHORT: + opcode = short_ops[size]; + break; + case GL_INT: + opcode = int_ops[size]; + break; + case GL_FLOAT: + opcode = float_ops[size]; + break; + case GL_DOUBLE: + opcode = double_ops[size]; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + header_size = 4; + } + else { + switch (type) { + case GL_SHORT: + opcode = mshort_ops[size]; + break; + case GL_INT: + opcode = mint_ops[size]; + break; + case GL_FLOAT: + opcode = mfloat_ops[size]; + break; + case GL_DOUBLE: + opcode = mdouble_ops[size]; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + header_size = 8; + } + + a = get_array_entry(arrays, GL_TEXTURE_COORD_ARRAY, index); + assert(a != NULL); + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, size, GL_FALSE, + header_size, opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (size != 3 || stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + switch (type) { + case GL_BYTE: + opcode = 4126; + break; + case GL_UNSIGNED_BYTE: + opcode = 4131; + break; + case GL_SHORT: + opcode = 4127; + break; + case GL_UNSIGNED_SHORT: + opcode = 4132; + break; + case GL_INT: + opcode = 4128; + break; + case GL_UNSIGNED_INT: + opcode = 4133; + break; + case GL_FLOAT: + opcode = 4129; + break; + case GL_DOUBLE: + opcode = 4130; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + a = get_array_entry(arrays, GL_SECONDARY_COLOR_ARRAY, 0); + if (a == NULL) { + __glXSetError(gc, GL_INVALID_OPERATION); + return; + } + + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, size, GL_TRUE, 4, opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glFogCoordPointerEXT(GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + if (stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + switch (type) { + case GL_FLOAT: + opcode = 4124; + break; + case GL_DOUBLE: + opcode = 4125; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + a = get_array_entry(arrays, GL_FOG_COORD_ARRAY, 0); + if (a == NULL) { + __glXSetError(gc, GL_INVALID_OPERATION); + return; + } + + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, 1, GL_FALSE, 4, opcode); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +void +__indirect_glVertexAttribPointerARB(GLuint index, GLint size, + GLenum type, GLboolean normalized, + GLsizei stride, const GLvoid * pointer) +{ + static const uint16_t short_ops[5] = { 0, 4189, 4190, 4191, 4192 }; + static const uint16_t float_ops[5] = { 0, 4193, 4194, 4195, 4196 }; + static const uint16_t double_ops[5] = { 0, 4197, 4198, 4199, 4200 }; + + uint16_t opcode; + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + unsigned true_immediate_count; + unsigned true_immediate_size; + + + if ((size < 1) || (size > 4) || (stride < 0) + || (index > arrays->num_vertex_program_attribs)) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + if (normalized && (type != GL_FLOAT) && (type != GL_DOUBLE)) { + switch (type) { + case GL_BYTE: + opcode = X_GLrop_VertexAttrib4NbvARB; + break; + case GL_UNSIGNED_BYTE: + opcode = X_GLrop_VertexAttrib4NubvARB; + break; + case GL_SHORT: + opcode = X_GLrop_VertexAttrib4NsvARB; + break; + case GL_UNSIGNED_SHORT: + opcode = X_GLrop_VertexAttrib4NusvARB; + break; + case GL_INT: + opcode = X_GLrop_VertexAttrib4NivARB; + break; + case GL_UNSIGNED_INT: + opcode = X_GLrop_VertexAttrib4NuivARB; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + true_immediate_count = 4; + } + else { + true_immediate_count = size; + + switch (type) { + case GL_BYTE: + opcode = X_GLrop_VertexAttrib4bvARB; + true_immediate_count = 4; + break; + case GL_UNSIGNED_BYTE: + opcode = X_GLrop_VertexAttrib4ubvARB; + true_immediate_count = 4; + break; + case GL_SHORT: + opcode = short_ops[size]; + break; + case GL_UNSIGNED_SHORT: + opcode = X_GLrop_VertexAttrib4usvARB; + true_immediate_count = 4; + break; + case GL_INT: + opcode = X_GLrop_VertexAttrib4ivARB; + true_immediate_count = 4; + break; + case GL_UNSIGNED_INT: + opcode = X_GLrop_VertexAttrib4uivARB; + true_immediate_count = 4; + break; + case GL_FLOAT: + opcode = float_ops[size]; + break; + case GL_DOUBLE: + opcode = double_ops[size]; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + } + + a = get_array_entry(arrays, GL_VERTEX_ATTRIB_ARRAY_POINTER, index); + if (a == NULL) { + __glXSetError(gc, GL_INVALID_OPERATION); + return; + } + + COMMON_ARRAY_DATA_INIT(a, pointer, type, stride, size, normalized, 8, + opcode); + + true_immediate_size = __glXTypeSize(type) * true_immediate_count; + ((uint16_t *) (a)->header)[0] = __GLX_PAD(a->header_size + + true_immediate_size); + + if (a->enabled) { + arrays->array_info_cache_valid = GL_FALSE; + } +} + + +/** + * I don't have 100% confidence that this is correct. The different rules + * about whether or not generic vertex attributes alias "classic" vertex + * attributes (i.e., attrib1 ?= primary color) between ARB_vertex_program, + * ARB_vertex_shader, and NV_vertex_program are a bit confusing. My + * feeling is that the client-side doesn't have to worry about it. The + * client just sends all the data to the server and lets the server deal + * with it. + */ +void +__indirect_glVertexAttribPointerNV(GLuint index, GLint size, + GLenum type, GLsizei stride, + const GLvoid * pointer) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + GLboolean normalized = GL_FALSE; + + + switch (type) { + case GL_UNSIGNED_BYTE: + if (size != 4) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + normalized = GL_TRUE; + + case GL_SHORT: + case GL_FLOAT: + case GL_DOUBLE: + __indirect_glVertexAttribPointerARB(index, size, type, + normalized, stride, pointer); + return; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } +} + + +void +__indirect_glClientActiveTextureARB(GLenum texture) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + __GLXattribute *const state = + (__GLXattribute *) (gc->client_state_private); + struct array_state_vector *const arrays = state->array_state; + const GLint unit = (GLint) texture - GL_TEXTURE0; + + + if ((unit < 0) || (unit >= arrays->num_texture_units)) { + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + arrays->active_texture_unit = unit; +} + + +/** + * Modify the enable state for the selected array + */ +GLboolean +__glXSetArrayEnable(__GLXattribute * state, GLenum key, unsigned index, + GLboolean enable) +{ + struct array_state_vector *arrays = state->array_state; + struct array_state *a; + + + /* Texture coordinate arrays have an implict index set when the + * application calls glClientActiveTexture. + */ + if (key == GL_TEXTURE_COORD_ARRAY) { + index = arrays->active_texture_unit; + } + + a = get_array_entry(arrays, key, index); + + if ((a != NULL) && (a->enabled != enable)) { + a->enabled = enable; + arrays->array_info_cache_valid = GL_FALSE; + } + + return (a != NULL); +} + + +void +__glXArrayDisableAll(__GLXattribute * state) +{ + struct array_state_vector *arrays = state->array_state; + unsigned i; + + + for (i = 0; i < arrays->num_arrays; i++) { + arrays->arrays[i].enabled = GL_FALSE; + } + + arrays->array_info_cache_valid = GL_FALSE; +} + + +/** + */ +GLboolean +__glXGetArrayEnable(const __GLXattribute * const state, + GLenum key, unsigned index, GLintptr * dest) +{ + const struct array_state_vector *arrays = state->array_state; + const struct array_state *a = + get_array_entry((struct array_state_vector *) arrays, + key, index); + + if (a != NULL) { + *dest = (GLintptr) a->enabled; + } + + return (a != NULL); +} + + +/** + */ +GLboolean +__glXGetArrayType(const __GLXattribute * const state, + GLenum key, unsigned index, GLintptr * dest) +{ + const struct array_state_vector *arrays = state->array_state; + const struct array_state *a = + get_array_entry((struct array_state_vector *) arrays, + key, index); + + if (a != NULL) { + *dest = (GLintptr) a->data_type; + } + + return (a != NULL); +} + + +/** + */ +GLboolean +__glXGetArraySize(const __GLXattribute * const state, + GLenum key, unsigned index, GLintptr * dest) +{ + const struct array_state_vector *arrays = state->array_state; + const struct array_state *a = + get_array_entry((struct array_state_vector *) arrays, + key, index); + + if (a != NULL) { + *dest = (GLintptr) a->count; + } + + return (a != NULL); +} + + +/** + */ +GLboolean +__glXGetArrayStride(const __GLXattribute * const state, + GLenum key, unsigned index, GLintptr * dest) +{ + const struct array_state_vector *arrays = state->array_state; + const struct array_state *a = + get_array_entry((struct array_state_vector *) arrays, + key, index); + + if (a != NULL) { + *dest = (GLintptr) a->user_stride; + } + + return (a != NULL); +} + + +/** + */ +GLboolean +__glXGetArrayPointer(const __GLXattribute * const state, + GLenum key, unsigned index, void **dest) +{ + const struct array_state_vector *arrays = state->array_state; + const struct array_state *a = + get_array_entry((struct array_state_vector *) arrays, + key, index); + + + if (a != NULL) { + *dest = (void *) (a->data); + } + + return (a != NULL); +} + + +/** + */ +GLboolean +__glXGetArrayNormalized(const __GLXattribute * const state, + GLenum key, unsigned index, GLintptr * dest) +{ + const struct array_state_vector *arrays = state->array_state; + const struct array_state *a = + get_array_entry((struct array_state_vector *) arrays, + key, index); + + + if (a != NULL) { + *dest = (GLintptr) a->normalized; + } + + return (a != NULL); +} + + +/** + */ +GLuint +__glXGetActiveTextureUnit(const __GLXattribute * const state) +{ + return state->array_state->active_texture_unit; +} + + +void +__glXPushArrayState(__GLXattribute * state) +{ + struct array_state_vector *arrays = state->array_state; + struct array_stack_state *stack = + &arrays->stack[(arrays->stack_index * arrays->num_arrays)]; + unsigned i; + + /* XXX are we pushing _all_ the necessary fields? */ + for (i = 0; i < arrays->num_arrays; i++) { + stack[i].data = arrays->arrays[i].data; + stack[i].data_type = arrays->arrays[i].data_type; + stack[i].user_stride = arrays->arrays[i].user_stride; + stack[i].count = arrays->arrays[i].count; + stack[i].key = arrays->arrays[i].key; + stack[i].index = arrays->arrays[i].index; + stack[i].enabled = arrays->arrays[i].enabled; + } + + arrays->active_texture_unit_stack[arrays->stack_index] = + arrays->active_texture_unit; + + arrays->stack_index++; +} + + +void +__glXPopArrayState(__GLXattribute * state) +{ + struct array_state_vector *arrays = state->array_state; + struct array_stack_state *stack; + unsigned i; + + + arrays->stack_index--; + stack = &arrays->stack[(arrays->stack_index * arrays->num_arrays)]; + + for (i = 0; i < arrays->num_arrays; i++) { + switch (stack[i].key) { + case GL_NORMAL_ARRAY: + __indirect_glNormalPointer(stack[i].data_type, + stack[i].user_stride, stack[i].data); + break; + case GL_COLOR_ARRAY: + __indirect_glColorPointer(stack[i].count, + stack[i].data_type, + stack[i].user_stride, stack[i].data); + break; + case GL_INDEX_ARRAY: + __indirect_glIndexPointer(stack[i].data_type, + stack[i].user_stride, stack[i].data); + break; + case GL_EDGE_FLAG_ARRAY: + __indirect_glEdgeFlagPointer(stack[i].user_stride, stack[i].data); + break; + case GL_TEXTURE_COORD_ARRAY: + arrays->active_texture_unit = stack[i].index; + __indirect_glTexCoordPointer(stack[i].count, + stack[i].data_type, + stack[i].user_stride, stack[i].data); + break; + case GL_SECONDARY_COLOR_ARRAY: + __indirect_glSecondaryColorPointerEXT(stack[i].count, + stack[i].data_type, + stack[i].user_stride, + stack[i].data); + break; + case GL_FOG_COORDINATE_ARRAY: + __indirect_glFogCoordPointerEXT(stack[i].data_type, + stack[i].user_stride, stack[i].data); + break; + + } + + __glXSetArrayEnable(state, stack[i].key, stack[i].index, + stack[i].enabled); + } + + arrays->active_texture_unit = + arrays->active_texture_unit_stack[arrays->stack_index]; +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.h xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.h --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,64 @@ +/* + * (C) Copyright IBM Corporation 2004, 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef INDIRECT_VERTEX_ARRAY_H +#define INDIRECT_VERTEX_ARRAY_H + +extern const GLuint __glXTypeSize_table[16]; + +#define __glXTypeSize(e) ((((e) & ~0x0f) != 0x1400) \ + ? 0 : __glXTypeSize_table[ (e) & 0x0f ]) + +extern void __glXArrayDisableAll(__GLXattribute * state); + +extern GLboolean __glXSetArrayEnable(__GLXattribute * state, + GLenum key, unsigned index, + GLboolean enable); + +extern GLboolean __glXGetArrayEnable(const __GLXattribute * const state, + GLenum key, unsigned index, + GLintptr * dest); +extern GLboolean __glXGetArraySize(const __GLXattribute * const state, + GLenum key, unsigned index, + GLintptr * dest); +extern GLboolean __glXGetArrayType(const __GLXattribute * const state, + GLenum key, unsigned index, + GLintptr * dest); +extern GLboolean __glXGetArrayStride(const __GLXattribute * const state, + GLenum key, unsigned index, + GLintptr * dest); +extern GLboolean __glXGetArrayPointer(const __GLXattribute * const state, + GLenum key, unsigned index, + void **dest); +extern GLboolean __glXGetArrayNormalized(const __GLXattribute * const state, + GLenum key, unsigned index, + GLintptr * dest); + +extern void __glXPushArrayState(__GLXattribute * state); +extern void __glXPopArrayState(__GLXattribute * state); + +extern GLuint __glXGetActiveTextureUnit(const __GLXattribute * const state); + +#endif /* INDIRECT_VERTEX_ARRAY_H */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array_priv.h xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array_priv.h --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array_priv.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_array_priv.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,311 @@ +/* + * (C) Copyright IBM Corporation 2004, 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef _INDIRECT_VA_PRIVATE_ +#define _INDIRECT_VA_PRIVATE_ + +/** + * \file indirect_va_private.h + * + * \author Ian Romanick + */ + +#include + +#include "glxclient.h" +#include "indirect.h" +#include + + +/** + * State descriptor for a single array of vertex data. + */ +struct array_state +{ + /** + * Pointer to the application supplied data. + */ + const void *data; + + /** + * Enum representing the type of the application supplied data. + */ + GLenum data_type; + + /** + * Stride value supplied by the application. This value is not used + * internally. It is only kept so that it can be queried by the + * application using glGet*v. + */ + GLsizei user_stride; + + /** + * Calculated size, in bytes, of a single element in the array. This + * is calculated based on \c count and the size of the data type + * represented by \c data_type. + */ + GLsizei element_size; + + /** + * Actual byte-stride from one element to the next. This value will + * be equal to either \c user_stride or \c element_stride. + */ + GLsizei true_stride; + + /** + * Number of data values in each element. + */ + GLint count; + + /** + * "Normalized" data is on the range [0,1] (unsigned) or [-1,1] (signed). + * This is used for mapping integral types to floating point types. + */ + GLboolean normalized; + + /** + * Pre-calculated GLX protocol command header. + */ + uint32_t header[2]; + + /** + * Size of the header data. For simple data, like glColorPointerfv, + * this is 4. For complex data that requires either a count (e.g., + * glWeightfvARB), an index (e.g., glVertexAttrib1fvARB), or a + * selector enum (e.g., glMultiTexCoord2fv) this is 8. + */ + unsigned header_size; + + /** + * Set to \c GL_TRUE if this array is enabled. Otherwise, it is set + * to \c GL_FALSE. + */ + GLboolean enabled; + + /** + * For multi-arrayed data (e.g., texture coordinates, generic vertex + * program attributes, etc.), this specifies which array this is. + */ + unsigned index; + + /** + * Per-array-type key. For most arrays, this will be the GL enum for + * that array (e.g., GL_VERTEX_ARRAY for vertex data, GL_NORMAL_ARRAY + * for normal data, GL_TEXTURE_COORD_ARRAY for texture coordinate data, + * etc.). + */ + GLenum key; + + /** + * If this array can be used with the "classic" \c glDrawArrays protocol, + * this is set to \c GL_TRUE. Otherwise, it is set to \c GL_FALSE. + */ + GLboolean old_DrawArrays_possible; +}; + + +/** + * Array state that is pushed / poped by \c glPushClientAttrib and + * \c glPopClientAttrib. + */ +struct array_stack_state +{ + /** + * Pointer to the application supplied data. + */ + const void *data; + + /** + * Enum representing the type of the application supplied data. + */ + GLenum data_type; + + /** + * Stride value supplied by the application. This value is not used + * internally. It is only kept so that it can be queried by the + * application using glGet*v. + */ + GLsizei user_stride; + + /** + * Number of data values in each element. + */ + GLint count; + + /** + * Per-array-type key. For most arrays, this will be the GL enum for + * that array (e.g., GL_VERTEX_ARRAY for vertex data, GL_NORMAL_ARRAY + * for normal data, GL_TEXTURE_COORD_ARRAY for texture coordinate data, + * etc.). + */ + GLenum key; + + /** + * For multi-arrayed data (e.g., texture coordinates, generic vertex + * program attributes, etc.), this specifies which array this is. + */ + unsigned index; + + /** + * Set to \c GL_TRUE if this array is enabled. Otherwise, it is set + * to \c GL_FALSE. + */ + GLboolean enabled; +}; + + +/** + * Collection of all the vertex array state. + */ +struct array_state_vector +{ + /** + * Number of arrays tracked by \c ::arrays. + */ + size_t num_arrays; + + /** + * Array of vertex array state. This array contains all of the valid + * vertex arrays. If a vertex array isn't in this array, then it isn't + * valid. For example, if an implementation does not support + * EXT_fog_coord, there won't be a GL_FOG_COORD_ARRAY entry in this + * array. + */ + struct array_state *arrays; + + /** + * Number of currently enabled client-side arrays. The value of this + * field is only valid if \c array_info_cache_valid is true. + */ + size_t enabled_client_array_count; + + /** + * \name ARRAY_INFO cache. + * + * These fields track the state of the ARRAY_INFO cache. The + * \c array_info_cache_size is the size of the actual data stored in + * \c array_info_cache. \c array_info_cache_buffer_size is the size of + * the buffer. This will always be greater than or equal to + * \c array_info_cache_size. + * + * \note + * There are some bytes of extra data before \c array_info_cache that is + * used to hold the header for RenderLarge commands. This is + * \b not included in \c array_info_cache_size or + * \c array_info_cache_buffer_size. \c array_info_cache_base stores a + * pointer to the true start of the buffer (i.e., what malloc returned). + */ + /*@{ */ + size_t array_info_cache_size; + size_t array_info_cache_buffer_size; + void *array_info_cache; + void *array_info_cache_base; + /*@} */ + + + /** + * Is the cache of ARRAY_INFO data valid? The cache can become invalid + * when one of several state changes occur. Among these chages are + * modifying the array settings for an enabled array and enabling / + * disabling an array. + */ + GLboolean array_info_cache_valid; + + /** + * Is it possible to use the GL 1.1 / EXT_vertex_arrays protocol? Use + * of this protocol is disabled with really old servers (i.e., servers + * that don't support GL 1.1 or EXT_vertex_arrays) or when an environment + * variable is set. + * + * \todo + * GL 1.1 and EXT_vertex_arrays use identical protocol, but have different + * opcodes for \c glDrawArrays. For servers that advertise one or the + * other, there should be a way to select which opcode to use. + */ + GLboolean old_DrawArrays_possible; + + /** + * Is it possible to use the new GL X.X / ARB_vertex_buffer_object + * protocol? + * + * \todo + * This protocol has not yet been defined by the ARB, but is currently a + * work in progress. This field is a place-holder. + */ + GLboolean new_DrawArrays_possible; + + /** + * Active texture unit set by \c glClientActiveTexture. + * + * \sa __glXGetActiveTextureUnit + */ + unsigned active_texture_unit; + + /** + * Number of supported texture units. Even if ARB_multitexture / + * GL 1.3 are not supported, this will be at least 1. When multitexture + * is supported, this will be the value queried by calling + * \c glGetIntegerv with \c GL_MAX_TEXTURE_UNITS. + * + * \todo + * Investigate if this should be the value of \c GL_MAX_TEXTURE_COORDS + * instead (if GL 2.0 / ARB_fragment_shader / ARB_fragment_program / + * NV_fragment_program are supported). + */ + unsigned num_texture_units; + + /** + * Number of generic vertex program attribs. If GL_ARB_vertex_program + * is not supported, this will be zero. Otherwise it will be the value + * queries by calling \c glGetProgramiv with \c GL_VERTEX_PROGRAM_ARB + * and \c GL_MAX_PROGRAM_ATTRIBS_ARB. + */ + unsigned num_vertex_program_attribs; + + /** + * \n Methods for implementing various GL functions. + * + * These method pointers are only valid \c array_info_cache_valid is set. + * When each function starts, it much check \c array_info_cache_valid. + * If it is not set, it must call \c fill_array_info_cache and call + * the new method. + * + * \sa fill_array_info_cache + * + * \todo + * Write code to plug these functions directly into the dispatch table. + */ + /*@{ */ + void (*DrawArrays) (GLenum, GLint, GLsizei); + void (*DrawElements) (GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices); + /*@} */ + + struct array_stack_state *stack; + unsigned active_texture_unit_stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; + unsigned stack_index; +}; + +#endif /* _INDIRECT_VA_PRIVATE_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_program.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_program.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_program.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_vertex_program.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,293 @@ +/* + * (C) Copyright IBM Corporation 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include "indirect.h" +#include "glxclient.h" +#include "indirect_vertex_array.h" +#include + +#if !defined __GNUC__ || __GNUC__ < 3 +# define __builtin_expect(x, y) x +#endif + +static void +do_vertex_attrib_enable(GLuint index, GLboolean val) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + + if (!__glXSetArrayEnable(state, GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB, + index, val)) { + __glXSetError(gc, GL_INVALID_ENUM); + } +} + + +void +__indirect_glEnableVertexAttribArrayARB(GLuint index) +{ + do_vertex_attrib_enable(index, GL_TRUE); +} + + +void +__indirect_glDisableVertexAttribArrayARB(GLuint index) +{ + do_vertex_attrib_enable(index, GL_FALSE); +} + + +static void +get_parameter(unsigned opcode, unsigned size, GLenum target, GLuint index, + void *params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 12; + + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = __glXSetupVendorRequest(gc, + X_GLXVendorPrivateWithReply, + opcode, cmdlen); + + *((GLenum *) (pc + 0)) = target; + *((GLuint *) (pc + 4)) = index; + *((GLuint *) (pc + 8)) = 0; + + (void) __glXReadReply(dpy, size, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + + +void +__indirect_glGetProgramEnvParameterfvARB(GLenum target, GLuint index, + GLfloat * params) +{ + get_parameter(1296, 4, target, index, params); +} + + +void +__indirect_glGetProgramEnvParameterdvARB(GLenum target, GLuint index, + GLdouble * params) +{ + get_parameter(1297, 8, target, index, params); +} + + +void +__indirect_glGetProgramLocalParameterfvARB(GLenum target, GLuint index, + GLfloat * params) +{ + get_parameter(1305, 4, target, index, params); +} + + +void +__indirect_glGetProgramLocalParameterdvARB(GLenum target, GLuint index, + GLdouble * params) +{ + get_parameter(1306, 8, target, index, params); +} + + +void +__indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, + GLvoid ** pointer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + + if (pname != GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB) { + __glXSetError(gc, GL_INVALID_ENUM); + } + + if (!__glXGetArrayPointer(state, GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB, + index, pointer)) { + __glXSetError(gc, GL_INVALID_VALUE); + } +} + + +/** + * Get the selected attribute from the vertex array state vector. + * + * \returns + * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned. + */ +static GLboolean +get_attrib_array_data(__GLXattribute * state, GLuint index, GLenum cap, + GLintptr * data) +{ + GLboolean retval = GL_FALSE; + const GLenum attrib = GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB; + + switch (cap) { + case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: + retval = __glXGetArrayEnable(state, attrib, index, data); + break; + + case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: + retval = __glXGetArraySize(state, attrib, index, data); + break; + + case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: + retval = __glXGetArrayStride(state, attrib, index, data); + break; + + case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: + retval = __glXGetArrayType(state, attrib, index, data); + break; + + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB: + retval = __glXGetArrayNormalized(state, attrib, index, data); + break; + } + + + return retval; +} + + +static void +get_vertex_attrib(__GLXcontext * gc, unsigned vop, + GLuint index, GLenum pname, xReply * reply) +{ + Display *const dpy = gc->currentDpy; + GLubyte *const pc = __glXSetupVendorRequest(gc, + X_GLXVendorPrivateWithReply, + vop, 8); + + *((uint32_t *) (pc + 0)) = index; + *((uint32_t *) (pc + 4)) = pname; + + (void) _XReply(dpy, reply, 0, False); +} + + +void +__indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + xGLXSingleReply reply; + + + get_vertex_attrib(gc, 1303, index, pname, (xReply *) & reply); + + if (reply.size != 0) { + GLintptr data; + + + if (get_attrib_array_data(state, index, pname, &data)) { + *params = (GLint) data; + } + else { + if (reply.size == 1) { + *params = (GLint) reply.pad3; + } + else { + _XRead(dpy, (void *) params, 4 * reply.size); + } + } + } + + UnlockDisplay(dpy); + SyncHandle(); +} + + +void +__indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, + GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + xGLXSingleReply reply; + + + get_vertex_attrib(gc, 1302, index, pname, (xReply *) & reply); + + if (reply.size != 0) { + GLintptr data; + + + if (get_attrib_array_data(state, index, pname, &data)) { + *params = (GLfloat) data; + } + else { + if (reply.size == 1) { + (void) memcpy(params, &reply.pad3, sizeof(GLfloat)); + } + else { + _XRead(dpy, (void *) params, 4 * reply.size); + } + } + } + + UnlockDisplay(dpy); + SyncHandle(); +} + + +void +__indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, + GLdouble * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + xGLXSingleReply reply; + + + get_vertex_attrib(gc, 1301, index, pname, (xReply *) & reply); + + if (reply.size != 0) { + GLintptr data; + + + if (get_attrib_array_data(state, index, pname, &data)) { + *params = (GLdouble) data; + } + else { + if (reply.size == 1) { + (void) memcpy(params, &reply.pad3, sizeof(GLdouble)); + } + else { + _XRead(dpy, (void *) params, 8 * reply.size); + } + } + } + + UnlockDisplay(dpy); + SyncHandle(); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/indirect_window_pos.c xpsb-glx-0.19/mesa/src/glx/x11/indirect_window_pos.c --- xpsb-glx-0.19/mesa/src/glx/x11/indirect_window_pos.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/indirect_window_pos.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,112 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT, IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include "indirect.h" + +void +__indirect_glWindowPos2dMESA(GLdouble x, GLdouble y) +{ + __indirect_glWindowPos3fMESA(x, y, 0.0); +} + +void +__indirect_glWindowPos2iMESA(GLint x, GLint y) +{ + __indirect_glWindowPos3fMESA(x, y, 0.0); +} + +void +__indirect_glWindowPos2fMESA(GLfloat x, GLfloat y) +{ + __indirect_glWindowPos3fMESA(x, y, 0.0); +} + +void +__indirect_glWindowPos2sMESA(GLshort x, GLshort y) +{ + __indirect_glWindowPos3fMESA(x, y, 0.0); +} + +void +__indirect_glWindowPos2dvMESA(const GLdouble * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], 0.0); +} + +void +__indirect_glWindowPos2fvMESA(const GLfloat * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], 0.0); +} + +void +__indirect_glWindowPos2ivMESA(const GLint * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], 0.0); +} + +void +__indirect_glWindowPos2svMESA(const GLshort * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], 0.0); +} + +void +__indirect_glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) +{ + __indirect_glWindowPos3fMESA(x, y, z); +} + +void +__indirect_glWindowPos3iMESA(GLint x, GLint y, GLint z) +{ + __indirect_glWindowPos3fMESA(x, y, z); +} + +void +__indirect_glWindowPos3sMESA(GLshort x, GLshort y, GLshort z) +{ + __indirect_glWindowPos3fMESA(x, y, z); +} + +void +__indirect_glWindowPos3dvMESA(const GLdouble * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], p[2]); +} + +void +__indirect_glWindowPos3ivMESA(const GLint * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], p[2]); +} + +void +__indirect_glWindowPos3svMESA(const GLshort * p) +{ + __indirect_glWindowPos3fMESA(p[0], p[1], p[2]); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/Makefile xpsb-glx-0.19/mesa/src/glx/x11/Makefile --- xpsb-glx-0.19/mesa/src/glx/x11/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/Makefile 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,99 @@ +TOP = ../../.. +include $(TOP)/configs/current + +EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER \ + -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" + +SOURCES = \ + glcontextmodes.c \ + clientattrib.c \ + compsize.c \ + eval.c \ + glxcmds.c \ + glxcurrent.c \ + glxext.c \ + glxextensions.c \ + indirect.c \ + indirect_init.c \ + indirect_size.c \ + indirect_window_pos.c \ + indirect_texture_compression.c \ + indirect_transpose_matrix.c \ + indirect_vertex_array.c \ + indirect_vertex_program.c \ + pixel.c \ + pixelstore.c \ + render2.c \ + renderpix.c \ + single2.c \ + singlepix.c \ + vertarr.c \ + xfont.c \ + glx_pbuffer.c \ + glx_query.c \ + drisw_glx.c \ + dri_common.c \ + dri_glx.c \ + XF86dri.c \ + glxhash.c \ + dri2_glx.c \ + dri2.c + +include $(TOP)/src/mesa/sources + +MESA_ASM_API = $(addprefix $(TOP)/src/mesa/, $(ASM_API)) +MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES)) +MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS)) + +OBJECTS = $(SOURCES:.c=.o) $(MESA_GLAPI_OBJECTS) + +INCLUDES = -I. \ + -I$(TOP)/include \ + -I$(TOP)/include/GL/internal \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/glapi \ + $(LIBDRM_CFLAGS) \ + $(DRI2PROTO_CFLAGS) \ + $(X11_INCLUDES) + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@ + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + +# Make libGL +$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile + $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major 1 -minor 2 $(MKLIB_OPTIONS) \ + -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \ + $(GL_LIB_DEPS) $(OBJECTS) + + +depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) Makefile + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \ + $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) + + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find $(TOP)/include` + +install: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + $(MAKE) -C $(TOP)/src/mesa install-libgl + +# Remove .o and backup files +clean: + -rm -f $(TOP)/$(LIB_DIR)/libGL.so* + -rm -f *.o *~ + -rm -f depend depend.bak + +-include depend diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/packrender.h xpsb-glx-0.19/mesa/src/glx/x11/packrender.h --- xpsb-glx-0.19/mesa/src/glx/x11/packrender.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/packrender.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,243 @@ +#ifndef __GLX_packrender_h__ +#define __GLX_packrender_h__ + +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "glxclient.h" + +/* +** The macros in this header convert the client machine's native data types to +** wire protocol data types. The header is part of the porting layer of the +** client library, and it is intended that hardware vendors will rewrite this +** header to suit their own machines. +*/ + +/* +** Pad a count of bytes to the nearest multiple of 4. The X protocol +** transfers data in 4 byte quantities, so this macro is used to +** insure the right amount of data being sent. +*/ +#define __GLX_PAD(a) (((a)+3) & ~3) + +/* +** Network size parameters +*/ +#define sz_double 8 + +/* Setup for all commands */ +#define __GLX_DECLARE_VARIABLES() \ + __GLXcontext *gc; \ + GLubyte *pc, *pixelHeaderPC; \ + GLuint compsize, cmdlen + +#define __GLX_LOAD_VARIABLES() \ + gc = __glXGetCurrentContext(); \ + pc = gc->pc; \ + /* Muffle compilers */ \ + cmdlen = 0; (void)cmdlen; \ + compsize = 0; (void)compsize; \ + pixelHeaderPC = 0; (void)pixelHeaderPC + +/* +** Variable sized command support macro. This macro is used by calls +** that are potentially larger than __GLX_SMALL_RENDER_CMD_SIZE. +** Because of their size, they may not automatically fit in the buffer. +** If the buffer can't hold the command then it is flushed so that +** the command will fit in the next buffer. +*/ +#define __GLX_BEGIN_VARIABLE(opcode,size) \ + if (pc + (size) > gc->bufEnd) { \ + pc = __glXFlushRenderBuffer(gc, pc); \ + } \ + __GLX_PUT_SHORT(0,size); \ + __GLX_PUT_SHORT(2,opcode) + +#define __GLX_BEGIN_VARIABLE_LARGE(opcode,size) \ + pc = __glXFlushRenderBuffer(gc, pc); \ + __GLX_PUT_LONG(0,size); \ + __GLX_PUT_LONG(4,opcode) + +#define __GLX_BEGIN_VARIABLE_WITH_PIXEL(opcode,size) \ + if (pc + (size) > gc->bufEnd) { \ + pc = __glXFlushRenderBuffer(gc, pc); \ + } \ + __GLX_PUT_SHORT(0,size); \ + __GLX_PUT_SHORT(2,opcode); \ + pc += __GLX_RENDER_HDR_SIZE; \ + pixelHeaderPC = pc; \ + pc += __GLX_PIXEL_HDR_SIZE + +#define __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL(opcode,size) \ + pc = __glXFlushRenderBuffer(gc, pc); \ + __GLX_PUT_LONG(0,size); \ + __GLX_PUT_LONG(4,opcode); \ + pc += __GLX_RENDER_LARGE_HDR_SIZE; \ + pixelHeaderPC = pc; \ + pc += __GLX_PIXEL_HDR_SIZE + +#define __GLX_BEGIN_VARIABLE_WITH_PIXEL_3D(opcode,size) \ + if (pc + (size) > gc->bufEnd) { \ + pc = __glXFlushRenderBuffer(gc, pc); \ + } \ + __GLX_PUT_SHORT(0,size); \ + __GLX_PUT_SHORT(2,opcode); \ + pc += __GLX_RENDER_HDR_SIZE; \ + pixelHeaderPC = pc; \ + pc += __GLX_PIXEL_3D_HDR_SIZE + +#define __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL_3D(opcode,size) \ + pc = __glXFlushRenderBuffer(gc, pc); \ + __GLX_PUT_LONG(0,size); \ + __GLX_PUT_LONG(4,opcode); \ + pc += __GLX_RENDER_LARGE_HDR_SIZE; \ + pixelHeaderPC = pc; \ + pc += __GLX_PIXEL_3D_HDR_SIZE + +/* +** Fixed size command support macro. This macro is used by calls that +** are never larger than __GLX_SMALL_RENDER_CMD_SIZE. Because they +** always fit in the buffer, and because the buffer promises to +** maintain enough room for them, we don't need to check for space +** before doing the storage work. +*/ +#define __GLX_BEGIN(opcode,size) \ + __GLX_PUT_SHORT(0,size); \ + __GLX_PUT_SHORT(2,opcode) + +/* +** Finish a rendering command by advancing the pc. If the pc is now past +** the limit pointer then there is no longer room for a +** __GLX_SMALL_RENDER_CMD_SIZE sized command, which will break the +** assumptions present in the __GLX_BEGIN macro. In this case the +** rendering buffer is flushed out into the X protocol stream (which may +** or may not do I/O). +*/ +#define __GLX_END(size) \ + pc += size; \ + if (pc > gc->limit) { \ + (void) __glXFlushRenderBuffer(gc, pc); \ + } else { \ + gc->pc = pc; \ + } + +/* Array copy macros */ +#define __GLX_MEM_COPY(dest,src,bytes) \ + if (src && dest) \ + memcpy(dest, src, bytes) + +/* Single item copy macros */ +#define __GLX_PUT_CHAR(offset,a) \ + *((INT8 *) (pc + offset)) = a + +#ifndef _CRAY +#define __GLX_PUT_SHORT(offset,a) \ + *((INT16 *) (pc + offset)) = a + +#define __GLX_PUT_LONG(offset,a) \ + *((INT32 *) (pc + offset)) = a + +#define __GLX_PUT_FLOAT(offset,a) \ + *((FLOAT32 *) (pc + offset)) = a + +#else +#define __GLX_PUT_SHORT(offset,a) \ + { GLubyte *cp = (pc+offset); \ + int shift = (64-16) - ((int)(cp) >> (64-6)); \ + *(int *)cp = (*(int *)cp & ~(0xffff << shift)) | ((a & 0xffff) << shift); } + +#define __GLX_PUT_LONG(offset,a) \ + { GLubyte *cp = (pc+offset); \ + int shift = (64-32) - ((int)(cp) >> (64-6)); \ + *(int *)cp = (*(int *)cp & ~(0xffffffff << shift)) | ((a & 0xffffffff) << shift); } + +#define __GLX_PUT_FLOAT(offset,a) \ + gl_put_float((pc + offset),a) + +#define __GLX_PUT_DOUBLE(offset,a) \ + gl_put_double(pc + offset, a) + +extern void gl_put_float( /*GLubyte *, struct cray_single */ ); +extern void gl_put_double( /*GLubyte *, struct cray_double */ ); +#endif + +#ifndef _CRAY + +#ifdef __GLX_ALIGN64 +/* +** This can certainly be done better for a particular machine +** architecture! +*/ +#define __GLX_PUT_DOUBLE(offset,a) \ + __GLX_MEM_COPY(pc + offset, &a, 8) +#else +#define __GLX_PUT_DOUBLE(offset,a) \ + *((FLOAT64 *) (pc + offset)) = a +#endif + +#endif + +#define __GLX_PUT_CHAR_ARRAY(offset,a,alen) \ + __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_INT8) + +#ifndef _CRAY +#define __GLX_PUT_SHORT_ARRAY(offset,a,alen) \ + __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_INT16) + +#define __GLX_PUT_LONG_ARRAY(offset,a,alen) \ + __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_INT32) + +#define __GLX_PUT_FLOAT_ARRAY(offset,a,alen) \ + __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_FLOAT32) + +#define __GLX_PUT_DOUBLE_ARRAY(offset,a,alen) \ + __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_FLOAT64) + +#else +#define __GLX_PUT_SHORT_ARRAY(offset,a,alen) \ + gl_put_short_array((GLubyte *)(pc + offset), a, alen * __GLX_SIZE_INT16) + +#define __GLX_PUT_LONG_ARRAY(offset,a,alen) \ + gl_put_long_array((GLubyte *)(pc + offset), (long *)a, alen * __GLX_SIZE_INT32) + +#define __GLX_PUT_FLOAT_ARRAY(offset,a,alen) \ + gl_put_float_array((GLubyte *)(pc + offset), (float *)a, alen * __GLX_SIZE_FLOAT32) + +#define __GLX_PUT_DOUBLE_ARRAY(offset,a,alen) \ + gl_put_double_array((GLubyte *)(pc + offset), (double *)a, alen * __GLX_SIZE_FLOAT64) + +extern gl_put_short_array(GLubyte *, short *, int); +extern gl_put_long_array(GLubyte *, long *, int); +extern gl_put_float_array(GLubyte *, float *, int); +extern gl_put_double_array(GLubyte *, double *, int); + +#endif /* _CRAY */ + +#endif /* !__GLX_packrender_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/packsingle.h xpsb-glx-0.19/mesa/src/glx/x11/packsingle.h --- xpsb-glx-0.19/mesa/src/glx/x11/packsingle.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/packsingle.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,213 @@ +#ifndef __GLX_packsingle_h__ +#define __GLX_packsingle_h__ + +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "packrender.h" + +/* +** The macros in this header convert wire protocol data types to the client +** machine's native data types. The header is part of the porting layer of +** the client library, and it is intended that hardware vendors will rewrite +** this header to suit their own machines. +*/ + +/* +** Dummy define to make the GetReqExtra macro happy. The value is not +** used, but instead the code in __GLX_SINGLE_BEGIN issues its own store +** to req->reqType with the proper code (our extension code). +*/ +#define X_GLXSingle 0 + +/* Declare common variables used during a single command */ +#define __GLX_SINGLE_DECLARE_VARIABLES() \ + __GLXcontext *gc = __glXGetCurrentContext(); \ + GLubyte *pc, *pixelHeaderPC; \ + GLuint compsize, cmdlen; \ + Display *dpy = gc->currentDpy; \ + xGLXSingleReq *req + +#define __GLX_SINGLE_LOAD_VARIABLES() \ + pc = gc->pc; \ + /* Muffle compilers */ \ + pixelHeaderPC = 0; (void)pixelHeaderPC; \ + compsize = 0; (void)compsize; \ + cmdlen = 0; (void)cmdlen + +/* Start a single command */ +#define __GLX_SINGLE_BEGIN(opcode,bytes) \ + if (dpy) { \ + (void) __glXFlushRenderBuffer(gc, pc); \ + LockDisplay(dpy); \ + GetReqExtra(GLXSingle,bytes,req); \ + req->reqType = gc->majorOpcode; \ + req->glxCode = opcode; \ + req->contextTag = gc->currentContextTag; \ + pc = ((GLubyte *)(req) + sz_xGLXSingleReq) + +/* End a single command */ +#define __GLX_SINGLE_END() \ + UnlockDisplay(dpy); \ + SyncHandle(); \ + } + +/* Store data to sending for a single command */ +#define __GLX_SINGLE_PUT_CHAR(offset,a) \ + *((INT8 *) (pc + offset)) = a + +#ifndef CRAY +#define __GLX_SINGLE_PUT_SHORT(offset,a) \ + *((INT16 *) (pc + offset)) = a + +#define __GLX_SINGLE_PUT_LONG(offset,a) \ + *((INT32 *) (pc + offset)) = a + +#define __GLX_SINGLE_PUT_FLOAT(offset,a) \ + *((FLOAT32 *) (pc + offset)) = a + +#else +#define __GLX_SINGLE_PUT_SHORT(offset,a) \ + { GLubyte *cp = (pc+offset); \ + int shift = (64-16) - ((int)(cp) >> (64-6)); \ + *(int *)cp = (*(int *)cp & ~(0xffff << shift)) | ((a & 0xffff) << shift); } + +#define __GLX_SINGLE_PUT_LONG(offset,a) \ + { GLubyte *cp = (pc+offset); \ + int shift = (64-32) - ((int)(cp) >> (64-6)); \ + *(int *)cp = (*(int *)cp & ~(0xffffffff << shift)) | ((a & 0xffffffff) << shift); } + +#define __GLX_SINGLE_PUT_FLOAT(offset,a) \ + gl_put_float(pc + offset, a) +#endif + +/* Read support macros */ +#define __GLX_SINGLE_READ_XREPLY() \ + (void) _XReply(dpy, (xReply*) &reply, 0, False) + +#define __GLX_SINGLE_GET_RETVAL(a,cast) \ + a = (cast) reply.retval + +#define __GLX_SINGLE_GET_SIZE(a) \ + a = (GLint) reply.size + +#ifndef _CRAY +#define __GLX_SINGLE_GET_CHAR(p) \ + *p = *(GLbyte *)&reply.pad3; + +#define __GLX_SINGLE_GET_SHORT(p) \ + *p = *(GLshort *)&reply.pad3; + +#define __GLX_SINGLE_GET_LONG(p) \ + *p = *(GLint *)&reply.pad3; + +#define __GLX_SINGLE_GET_FLOAT(p) \ + *p = *(GLfloat *)&reply.pad3; + +#else +#define __GLX_SINGLE_GET_CHAR(p) \ + *p = reply.pad3 >> 24; + +#define __GLX_SINGLE_GET_SHORT(p) \ + {int t = reply.pad3 >> 16; \ + *p = (t & 0x8000) ? (t | ~0xffff) : (t & 0xffff);} + +#define __GLX_SINGLE_GET_LONG(p) \ + {int t = reply.pad3; \ + *p = (t & 0x80000000) ? (t | ~0xffffffff) : (t & 0xffffffff);} + +#define PAD3OFFSET 16 +#define __GLX_SINGLE_GET_FLOAT(p) \ + *p = gl_ntoh_float((GLubyte *)&reply + PAD3OFFSET); + +#define __GLX_SINGLE_GET_DOUBLE(p) \ + *p = gl_ntoh_double((GLubyte *)&reply + PAD3OFFSET); + +extern float gl_ntoh_float(GLubyte *); +extern float gl_ntoh_double(GLubyte *); +#endif + +#ifndef _CRAY + +#ifdef __GLX_ALIGN64 +#define __GLX_SINGLE_GET_DOUBLE(p) \ + __GLX_MEM_COPY(p, &reply.pad3, 8) +#else +#define __GLX_SINGLE_GET_DOUBLE(p) \ + *p = *(GLdouble *)&reply.pad3 +#endif + +#endif + +/* Get an array of typed data */ +#define __GLX_SINGLE_GET_VOID_ARRAY(a,alen) \ + { \ + GLint slop = alen*__GLX_SIZE_INT8 & 3; \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT8); \ + if (slop) _XEatData(dpy,4-slop); \ + } + +#define __GLX_SINGLE_GET_CHAR_ARRAY(a,alen) \ + { \ + GLint slop = alen*__GLX_SIZE_INT8 & 3; \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT8); \ + if (slop) _XEatData(dpy,4-slop); \ + } + + +#define __GLX_SINGLE_GET_SHORT_ARRAY(a,alen) \ + { \ + GLint slop = (alen*__GLX_SIZE_INT16) & 3; \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT16); \ + if (slop) _XEatData(dpy,4-slop); \ + } + +#define __GLX_SINGLE_GET_LONG_ARRAY(a,alen) \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT32); + +#ifndef _CRAY +#define __GLX_SINGLE_GET_FLOAT_ARRAY(a,alen) \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_FLOAT32); + +#define __GLX_SINGLE_GET_DOUBLE_ARRAY(a,alen) \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_FLOAT64); + +#else +#define __GLX_SINGLE_GET_FLOAT_ARRAY(a,alen) \ + gl_get_float_array(dpy,a,alen); + +#define __GLX_SINGLE_GET_DOUBLE_ARRAY(a,alen) \ + gl_get_double_array(dpy, a, alen); + +extern void gl_get_float_array(Display * dpy, float *a, int alen); +extern void gl_get_double_array(Display * dpy, double *a, int alen); +#endif + +#endif /* !__GLX_packsingle_h__ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/pixel.c xpsb-glx-0.19/mesa/src/glx/x11/pixel.c --- xpsb-glx-0.19/mesa/src/glx/x11/pixel.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/pixel.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,461 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "packrender.h" + +static const GLubyte MsbToLsbTable[256] = { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, +}; + +static const GLubyte LowBitsMask[9] = { + 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff, +}; + +static const GLubyte HighBitsMask[9] = { + 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, +}; + + +/* +** Copy bitmap data from clients packed memory applying unpacking modes as the +** data is transfered into the destImage buffer. Return in modes the +** set of pixel modes that are to be done by the server. +*/ +static void +FillBitmap(__GLXcontext * gc, GLint width, GLint height, + GLenum format, const GLvoid * userdata, GLubyte * destImage) +{ + const __GLXattribute *state = gc->client_state_private; + GLint rowLength = state->storeUnpack.rowLength; + GLint alignment = state->storeUnpack.alignment; + GLint skipPixels = state->storeUnpack.skipPixels; + GLint skipRows = state->storeUnpack.skipRows; + GLint lsbFirst = state->storeUnpack.lsbFirst; + GLint elementsLeft, bitOffset, currentByte, nextByte, highBitMask; + GLint lowBitMask, i; + GLint components, groupsPerRow, rowSize, padding, elementsPerRow; + const GLubyte *start, *iter; + + if (rowLength > 0) { + groupsPerRow = rowLength; + } + else { + groupsPerRow = width; + } + components = __glElementsPerGroup(format, GL_BITMAP); + rowSize = (groupsPerRow * components + 7) >> 3; + padding = (rowSize % alignment); + if (padding) { + rowSize += alignment - padding; + } + start = ((const GLubyte *) userdata) + skipRows * rowSize + + ((skipPixels * components) >> 3); + bitOffset = (skipPixels * components) & 7; + highBitMask = LowBitsMask[8 - bitOffset]; + lowBitMask = HighBitsMask[bitOffset]; + elementsPerRow = width * components; + for (i = 0; i < height; i++) { + elementsLeft = elementsPerRow; + iter = start; + while (elementsLeft) { + /* First retrieve low bits from current byte */ + if (lsbFirst) { + currentByte = MsbToLsbTable[iter[0]]; + } + else { + currentByte = iter[0]; + } + if (bitOffset) { + /* Need to read next byte to finish current byte */ + if (elementsLeft > (8 - bitOffset)) { + if (lsbFirst) { + nextByte = MsbToLsbTable[iter[1]]; + } + else { + nextByte = iter[1]; + } + currentByte = + ((currentByte & highBitMask) << bitOffset) | + ((nextByte & lowBitMask) >> (8 - bitOffset)); + } + else { + currentByte = ((currentByte & highBitMask) << bitOffset); + } + } + if (elementsLeft >= 8) { + *destImage = currentByte; + elementsLeft -= 8; + } + else { + *destImage = currentByte & HighBitsMask[elementsLeft]; + elementsLeft = 0; + } + destImage++; + iter++; + } + start += rowSize; + } +} + +/* +** Extract array from user's data applying all pixel store modes. +** The internal packed array format used has LSB_FIRST = FALSE and +** ALIGNMENT = 1. +*/ +void +__glFillImage(__GLXcontext * gc, GLint dim, GLint width, GLint height, + GLint depth, GLenum format, GLenum type, + const GLvoid * userdata, GLubyte * newimage, GLubyte * modes) +{ + const __GLXattribute *state = gc->client_state_private; + GLint rowLength = state->storeUnpack.rowLength; + GLint imageHeight = state->storeUnpack.imageHeight; + GLint alignment = state->storeUnpack.alignment; + GLint skipPixels = state->storeUnpack.skipPixels; + GLint skipRows = state->storeUnpack.skipRows; + GLint skipImages = state->storeUnpack.skipImages; + GLint swapBytes = state->storeUnpack.swapEndian; + GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize; + GLint elementsPerRow, imageSize, rowsPerImage, h, i, j, k; + const GLubyte *start, *iter, *itera, *iterb, *iterc; + GLubyte *iter2; + + if (type == GL_BITMAP) { + FillBitmap(gc, width, height, format, userdata, newimage); + } + else { + components = __glElementsPerGroup(format, type); + if (rowLength > 0) { + groupsPerRow = rowLength; + } + else { + groupsPerRow = width; + } + if (imageHeight > 0) { + rowsPerImage = imageHeight; + } + else { + rowsPerImage = height; + } + + elementSize = __glBytesPerElement(type); + groupSize = elementSize * components; + if (elementSize == 1) + swapBytes = 0; + + rowSize = groupsPerRow * groupSize; + padding = (rowSize % alignment); + if (padding) { + rowSize += alignment - padding; + } + imageSize = rowSize * rowsPerImage; + start = ((const GLubyte *) userdata) + skipImages * imageSize + + skipRows * rowSize + skipPixels * groupSize; + iter2 = newimage; + elementsPerRow = width * components; + + if (swapBytes) { + itera = start; + for (h = 0; h < depth; h++) { + iterb = itera; + for (i = 0; i < height; i++) { + iterc = iterb; + for (j = 0; j < elementsPerRow; j++) { + for (k = 1; k <= elementSize; k++) { + iter2[k - 1] = iterc[elementSize - k]; + } + iter2 += elementSize; + iterc += elementSize; + } + iterb += rowSize; + } + itera += imageSize; + } + } + else { + itera = start; + for (h = 0; h < depth; h++) { + if (rowSize == elementsPerRow * elementSize) { + /* Ha! This is mondo easy! */ + __GLX_MEM_COPY(iter2, itera, + elementsPerRow * elementSize * height); + iter2 += elementsPerRow * elementSize * height; + } + else { + iter = itera; + for (i = 0; i < height; i++) { + __GLX_MEM_COPY(iter2, iter, elementsPerRow * elementSize); + iter2 += elementsPerRow * elementSize; + iter += rowSize; + } + } + itera += imageSize; + } + } + } + + /* Setup store modes that describe what we just did */ + if (modes) { + if (dim < 3) { + (void) memcpy(modes, __glXDefaultPixelStore + 4, 20); + } + else { + (void) memcpy(modes, __glXDefaultPixelStore + 0, 36); + } + } +} + +/* +** Empty a bitmap in LSB_FIRST=GL_FALSE and ALIGNMENT=4 format packing it +** into the clients memory using the pixel store PACK modes. +*/ +static void +EmptyBitmap(__GLXcontext * gc, GLint width, GLint height, + GLenum format, const GLubyte * sourceImage, GLvoid * userdata) +{ + const __GLXattribute *state = gc->client_state_private; + GLint rowLength = state->storePack.rowLength; + GLint alignment = state->storePack.alignment; + GLint skipPixels = state->storePack.skipPixels; + GLint skipRows = state->storePack.skipRows; + GLint lsbFirst = state->storePack.lsbFirst; + GLint components, groupsPerRow, rowSize, padding, elementsPerRow; + GLint sourceRowSize, sourcePadding, sourceSkip; + GLubyte *start, *iter; + GLint elementsLeft, bitOffset, currentByte, highBitMask, lowBitMask; + GLint writeMask, i; + GLubyte writeByte; + + components = __glElementsPerGroup(format, GL_BITMAP); + if (rowLength > 0) { + groupsPerRow = rowLength; + } + else { + groupsPerRow = width; + } + + rowSize = (groupsPerRow * components + 7) >> 3; + padding = (rowSize % alignment); + if (padding) { + rowSize += alignment - padding; + } + sourceRowSize = (width * components + 7) >> 3; + sourcePadding = (sourceRowSize % 4); + if (sourcePadding) { + sourceSkip = 4 - sourcePadding; + } + else { + sourceSkip = 0; + } + start = ((GLubyte *) userdata) + skipRows * rowSize + + ((skipPixels * components) >> 3); + bitOffset = (skipPixels * components) & 7; + highBitMask = LowBitsMask[8 - bitOffset]; + lowBitMask = HighBitsMask[bitOffset]; + elementsPerRow = width * components; + for (i = 0; i < height; i++) { + elementsLeft = elementsPerRow; + iter = start; + writeMask = highBitMask; + writeByte = 0; + while (elementsLeft) { + /* Set up writeMask (to write to current byte) */ + if (elementsLeft + bitOffset < 8) { + /* Need to trim writeMask */ + writeMask &= HighBitsMask[bitOffset + elementsLeft]; + } + + if (lsbFirst) { + currentByte = MsbToLsbTable[iter[0]]; + } + else { + currentByte = iter[0]; + } + + if (bitOffset) { + writeByte |= (sourceImage[0] >> bitOffset); + currentByte = (currentByte & ~writeMask) | + (writeByte & writeMask); + writeByte = (sourceImage[0] << (8 - bitOffset)); + } + else { + currentByte = (currentByte & ~writeMask) | + (sourceImage[0] & writeMask); + } + + if (lsbFirst) { + iter[0] = MsbToLsbTable[currentByte]; + } + else { + iter[0] = currentByte; + } + + if (elementsLeft >= 8) { + elementsLeft -= 8; + } + else { + elementsLeft = 0; + } + sourceImage++; + iter++; + writeMask = 0xff; + } + if (writeByte) { + /* Some data left over that still needs writing */ + writeMask &= lowBitMask; + if (lsbFirst) { + currentByte = MsbToLsbTable[iter[0]]; + } + else { + currentByte = iter[0]; + } + currentByte = (currentByte & ~writeMask) | (writeByte & writeMask); + if (lsbFirst) { + iter[0] = MsbToLsbTable[currentByte]; + } + else { + iter[0] = currentByte; + } + } + start += rowSize; + sourceImage += sourceSkip; + } +} + +/* +** Insert array into user's data applying all pixel store modes. +** The packed array format from the server is LSB_FIRST = FALSE, +** SWAP_BYTES = the current pixel storage pack mode, and ALIGNMENT = 4. +** Named __glEmptyImage() because it is the opposite of __glFillImage(). +*/ +/* ARGSUSED */ +void +__glEmptyImage(__GLXcontext * gc, GLint dim, GLint width, GLint height, + GLint depth, GLenum format, GLenum type, + const GLubyte * sourceImage, GLvoid * userdata) +{ + const __GLXattribute *state = gc->client_state_private; + GLint rowLength = state->storePack.rowLength; + GLint imageHeight = state->storePack.imageHeight; + GLint alignment = state->storePack.alignment; + GLint skipPixels = state->storePack.skipPixels; + GLint skipRows = state->storePack.skipRows; + GLint skipImages = state->storePack.skipImages; + GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize; + GLint elementsPerRow, sourceRowSize, sourcePadding, h, i; + GLint imageSize, rowsPerImage; + GLubyte *start, *iter, *itera; + + if (type == GL_BITMAP) { + EmptyBitmap(gc, width, height, format, sourceImage, userdata); + } + else { + components = __glElementsPerGroup(format, type); + if (rowLength > 0) { + groupsPerRow = rowLength; + } + else { + groupsPerRow = width; + } + if (imageHeight > 0) { + rowsPerImage = imageHeight; + } + else { + rowsPerImage = height; + } + elementSize = __glBytesPerElement(type); + groupSize = elementSize * components; + rowSize = groupsPerRow * groupSize; + padding = (rowSize % alignment); + if (padding) { + rowSize += alignment - padding; + } + sourceRowSize = width * groupSize; + sourcePadding = (sourceRowSize % 4); + if (sourcePadding) { + sourceRowSize += 4 - sourcePadding; + } + imageSize = sourceRowSize * rowsPerImage; + start = ((GLubyte *) userdata) + skipImages * imageSize + + skipRows * rowSize + skipPixels * groupSize; + elementsPerRow = width * components; + + itera = start; + for (h = 0; h < depth; h++) { + if ((rowSize == sourceRowSize) && (sourcePadding == 0)) { + /* Ha! This is mondo easy! */ + __GLX_MEM_COPY(itera, sourceImage, + elementsPerRow * elementSize * height); + sourceImage += elementsPerRow * elementSize * height; + } + else { + iter = itera; + for (i = 0; i < height; i++) { + __GLX_MEM_COPY(iter, sourceImage, + elementsPerRow * elementSize); + sourceImage += sourceRowSize; + iter += rowSize; + } + } + itera += imageSize; + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/pixelstore.c xpsb-glx-0.19/mesa/src/glx/x11/pixelstore.c --- xpsb-glx-0.19/mesa/src/glx/x11/pixelstore.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/pixelstore.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,352 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "glxclient.h" +#include "indirect.h" + +#if !defined __GNUC__ || __GNUC__ < 3 +# define __builtin_expect(x, y) x +#endif + +/** + * Send glPixelStore command to the server + * + * \param gc Current GLX context + * \param sop Either \c X_GLsop_PixelStoref or \c X_GLsop_PixelStorei + * \param pname Selector of which pixel parameter is to be set. + * \param param Value that \c pname is set to. + * + * \sa __indirect_glPixelStorei, __indirect_glPixelStoref + */ +static void +send_PixelStore(__GLXcontext * gc, unsigned sop, GLenum pname, + const void *param) +{ + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = __glXSetupSingleRequest(gc, sop, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&pname), 4); + (void) memcpy((void *) (pc + 4), param, 4); + UnlockDisplay(dpy); + SyncHandle(); + } + return; +} + +/* +** Specify parameters that control the storage format of pixel arrays. +*/ +void +__indirect_glPixelStoref(GLenum pname, GLfloat param) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = gc->client_state_private; + Display *dpy = gc->currentDpy; + GLuint a; + + if (!dpy) + return; + + switch (pname) { + case GL_PACK_ROW_LENGTH: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.rowLength = a; + break; + case GL_PACK_IMAGE_HEIGHT: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.imageHeight = a; + break; + case GL_PACK_SKIP_ROWS: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.skipRows = a; + break; + case GL_PACK_SKIP_PIXELS: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.skipPixels = a; + break; + case GL_PACK_SKIP_IMAGES: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.skipImages = a; + break; + case GL_PACK_ALIGNMENT: + a = (GLint) (param + 0.5); + switch (a) { + case 1: + case 2: + case 4: + case 8: + state->storePack.alignment = a; + break; + default: + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + break; + case GL_PACK_SWAP_BYTES: + state->storePack.swapEndian = (param != 0); + break; + case GL_PACK_LSB_FIRST: + state->storePack.lsbFirst = (param != 0); + break; + + case GL_UNPACK_ROW_LENGTH: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.rowLength = a; + break; + case GL_UNPACK_IMAGE_HEIGHT: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.imageHeight = a; + break; + case GL_UNPACK_SKIP_ROWS: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.skipRows = a; + break; + case GL_UNPACK_SKIP_PIXELS: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.skipPixels = a; + break; + case GL_UNPACK_SKIP_IMAGES: + a = (GLuint) (param + 0.5); + if (((GLint) a) < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.skipImages = a; + break; + case GL_UNPACK_ALIGNMENT: + a = (GLint) (param + 0.5); + switch (a) { + case 1: + case 2: + case 4: + case 8: + state->storeUnpack.alignment = a; + break; + default: + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + break; + case GL_UNPACK_SWAP_BYTES: + state->storeUnpack.swapEndian = (param != 0); + break; + case GL_UNPACK_LSB_FIRST: + state->storeUnpack.lsbFirst = (param != 0); + break; + + /* Group all of the pixel store modes that need to be sent to the + * server here. Care must be used to only send modes to the server that + * won't affect the size of the data sent to or received from the + * server. GL_PACK_INVERT_MESA is safe in this respect, but other, + * future modes may not be. + */ + case GL_PACK_INVERT_MESA: + send_PixelStore(gc, X_GLsop_PixelStoref, pname, ¶m); + break; + + default: + __glXSetError(gc, GL_INVALID_ENUM); + break; + } +} + +void +__indirect_glPixelStorei(GLenum pname, GLint param) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = gc->client_state_private; + Display *dpy = gc->currentDpy; + + if (!dpy) + return; + + switch (pname) { + case GL_PACK_ROW_LENGTH: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.rowLength = param; + break; + case GL_PACK_IMAGE_HEIGHT: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.imageHeight = param; + break; + case GL_PACK_SKIP_ROWS: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.skipRows = param; + break; + case GL_PACK_SKIP_PIXELS: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.skipPixels = param; + break; + case GL_PACK_SKIP_IMAGES: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storePack.skipImages = param; + break; + case GL_PACK_ALIGNMENT: + switch (param) { + case 1: + case 2: + case 4: + case 8: + state->storePack.alignment = param; + break; + default: + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + break; + case GL_PACK_SWAP_BYTES: + state->storePack.swapEndian = (param != 0); + break; + case GL_PACK_LSB_FIRST: + state->storePack.lsbFirst = (param != 0); + break; + + case GL_UNPACK_ROW_LENGTH: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.rowLength = param; + break; + case GL_UNPACK_IMAGE_HEIGHT: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.imageHeight = param; + break; + case GL_UNPACK_SKIP_ROWS: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.skipRows = param; + break; + case GL_UNPACK_SKIP_PIXELS: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.skipPixels = param; + break; + case GL_UNPACK_SKIP_IMAGES: + if (param < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + state->storeUnpack.skipImages = param; + break; + case GL_UNPACK_ALIGNMENT: + switch (param) { + case 1: + case 2: + case 4: + case 8: + state->storeUnpack.alignment = param; + break; + default: + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + break; + case GL_UNPACK_SWAP_BYTES: + state->storeUnpack.swapEndian = (param != 0); + break; + case GL_UNPACK_LSB_FIRST: + state->storeUnpack.lsbFirst = (param != 0); + break; + + /* Group all of the pixel store modes that need to be sent to the + * server here. Care must be used to only send modes to the server that + * won't affect the size of the data sent to or received from the + * server. GL_PACK_INVERT_MESA is safe in this respect, but other, + * future modes may not be. + */ + case GL_PACK_INVERT_MESA: + send_PixelStore(gc, X_GLsop_PixelStorei, pname, ¶m); + break; + + default: + __glXSetError(gc, GL_INVALID_ENUM); + break; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/render2.c xpsb-glx-0.19/mesa/src/glx/x11/render2.c --- xpsb-glx-0.19/mesa/src/glx/x11/render2.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/render2.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,381 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "packrender.h" +#include "indirect.h" +#include "indirect_size.h" + +/* +** This file contains routines that might need to be transported as +** GLXRender or GLXRenderLarge commands, and these commands don't +** use the pixel header. See renderpix.c for those routines. +*/ + +void +__indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, + GLint order, const GLdouble * pnts) +{ + __GLX_DECLARE_VARIABLES(); + GLint k; + + __GLX_LOAD_VARIABLES(); + k = __glMap1d_size(target); + if (k == 0) { + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + else if (stride < k || order <= 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + compsize = k * order * __GLX_SIZE_FLOAT64; + cmdlen = 28 + compsize; + if (!gc->currentDpy) + return; + + if (cmdlen <= gc->maxSmallRenderCommandSize) { + /* Use GLXRender protocol to send small command */ + __GLX_BEGIN_VARIABLE(X_GLrop_Map1d, cmdlen); + __GLX_PUT_DOUBLE(4, u1); + __GLX_PUT_DOUBLE(12, u2); + __GLX_PUT_LONG(20, target); + __GLX_PUT_LONG(24, order); + /* + ** NOTE: the doubles that follow are not aligned because of 3 + ** longs preceeding + */ + __glFillMap1d(k, order, stride, pnts, (pc + 28)); + __GLX_END(cmdlen); + } + else { + /* Use GLXRenderLarge protocol to send command */ + __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map1d, cmdlen + 4); + __GLX_PUT_DOUBLE(8, u1); + __GLX_PUT_DOUBLE(16, u2); + __GLX_PUT_LONG(24, target); + __GLX_PUT_LONG(28, order); + + /* + ** NOTE: the doubles that follow are not aligned because of 3 + ** longs preceeding + */ + if (stride != k) { + GLubyte *buf; + + buf = (GLubyte *) Xmalloc(compsize); + if (!buf) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } + __glFillMap1d(k, order, stride, pnts, buf); + __glXSendLargeCommand(gc, pc, 32, buf, compsize); + Xfree((char *) buf); + } + else { + /* Data is already packed. Just send it out */ + __glXSendLargeCommand(gc, pc, 32, pnts, compsize); + } + } +} + +void +__indirect_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, + GLint order, const GLfloat * pnts) +{ + __GLX_DECLARE_VARIABLES(); + GLint k; + + __GLX_LOAD_VARIABLES(); + k = __glMap1f_size(target); + if (k == 0) { + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + else if (stride < k || order <= 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + compsize = k * order * __GLX_SIZE_FLOAT32; + cmdlen = 20 + compsize; + if (!gc->currentDpy) + return; + + /* + ** The order that arguments are packed is different from the order + ** for glMap1d. + */ + if (cmdlen <= gc->maxSmallRenderCommandSize) { + /* Use GLXRender protocol to send small command */ + __GLX_BEGIN_VARIABLE(X_GLrop_Map1f, cmdlen); + __GLX_PUT_LONG(4, target); + __GLX_PUT_FLOAT(8, u1); + __GLX_PUT_FLOAT(12, u2); + __GLX_PUT_LONG(16, order); + __glFillMap1f(k, order, stride, pnts, (GLubyte *) (pc + 20)); + __GLX_END(cmdlen); + } + else { + /* Use GLXRenderLarge protocol to send command */ + __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map1f, cmdlen + 4); + __GLX_PUT_LONG(8, target); + __GLX_PUT_FLOAT(12, u1); + __GLX_PUT_FLOAT(16, u2); + __GLX_PUT_LONG(20, order); + + if (stride != k) { + GLubyte *buf; + + buf = (GLubyte *) Xmalloc(compsize); + if (!buf) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } + __glFillMap1f(k, order, stride, pnts, buf); + __glXSendLargeCommand(gc, pc, 24, buf, compsize); + Xfree((char *) buf); + } + else { + /* Data is already packed. Just send it out */ + __glXSendLargeCommand(gc, pc, 24, pnts, compsize); + } + } +} + +void +__indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustr, + GLint uord, GLdouble v1, GLdouble v2, GLint vstr, + GLint vord, const GLdouble * pnts) +{ + __GLX_DECLARE_VARIABLES(); + GLint k; + + __GLX_LOAD_VARIABLES(); + k = __glMap2d_size(target); + if (k == 0) { + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + else if (vstr < k || ustr < k || vord <= 0 || uord <= 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + compsize = k * uord * vord * __GLX_SIZE_FLOAT64; + cmdlen = 48 + compsize; + if (!gc->currentDpy) + return; + + if (cmdlen <= gc->maxSmallRenderCommandSize) { + /* Use GLXRender protocol to send small command */ + __GLX_BEGIN_VARIABLE(X_GLrop_Map2d, cmdlen); + __GLX_PUT_DOUBLE(4, u1); + __GLX_PUT_DOUBLE(12, u2); + __GLX_PUT_DOUBLE(20, v1); + __GLX_PUT_DOUBLE(28, v2); + __GLX_PUT_LONG(36, target); + __GLX_PUT_LONG(40, uord); + __GLX_PUT_LONG(44, vord); + /* + ** Pack into a u-major ordering. + ** NOTE: the doubles that follow are not aligned because of 5 + ** longs preceeding + */ + __glFillMap2d(k, uord, vord, ustr, vstr, pnts, (GLdouble *) (pc + 48)); + __GLX_END(cmdlen); + } + else { + /* Use GLXRenderLarge protocol to send command */ + __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map2d, cmdlen + 4); + __GLX_PUT_DOUBLE(8, u1); + __GLX_PUT_DOUBLE(16, u2); + __GLX_PUT_DOUBLE(24, v1); + __GLX_PUT_DOUBLE(32, v2); + __GLX_PUT_LONG(40, target); + __GLX_PUT_LONG(44, uord); + __GLX_PUT_LONG(48, vord); + + /* + ** NOTE: the doubles that follow are not aligned because of 5 + ** longs preceeding + */ + if ((vstr != k) || (ustr != k * vord)) { + GLdouble *buf; + + buf = (GLdouble *) Xmalloc(compsize); + if (!buf) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } + /* + ** Pack into a u-major ordering. + */ + __glFillMap2d(k, uord, vord, ustr, vstr, pnts, buf); + __glXSendLargeCommand(gc, pc, 52, buf, compsize); + Xfree((char *) buf); + } + else { + /* Data is already packed. Just send it out */ + __glXSendLargeCommand(gc, pc, 52, pnts, compsize); + } + } +} + +void +__indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustr, + GLint uord, GLfloat v1, GLfloat v2, GLint vstr, GLint vord, + const GLfloat * pnts) +{ + __GLX_DECLARE_VARIABLES(); + GLint k; + + __GLX_LOAD_VARIABLES(); + k = __glMap2f_size(target); + if (k == 0) { + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + else if (vstr < k || ustr < k || vord <= 0 || uord <= 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + compsize = k * uord * vord * __GLX_SIZE_FLOAT32; + cmdlen = 32 + compsize; + if (!gc->currentDpy) + return; + + /* + ** The order that arguments are packed is different from the order + ** for glMap2d. + */ + if (cmdlen <= gc->maxSmallRenderCommandSize) { + /* Use GLXRender protocol to send small command */ + __GLX_BEGIN_VARIABLE(X_GLrop_Map2f, cmdlen); + __GLX_PUT_LONG(4, target); + __GLX_PUT_FLOAT(8, u1); + __GLX_PUT_FLOAT(12, u2); + __GLX_PUT_LONG(16, uord); + __GLX_PUT_FLOAT(20, v1); + __GLX_PUT_FLOAT(24, v2); + __GLX_PUT_LONG(28, vord); + /* + ** Pack into a u-major ordering. + */ + __glFillMap2f(k, uord, vord, ustr, vstr, pnts, (GLfloat *) (pc + 32)); + __GLX_END(cmdlen); + } + else { + /* Use GLXRenderLarge protocol to send command */ + __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map2f, cmdlen + 4); + __GLX_PUT_LONG(8, target); + __GLX_PUT_FLOAT(12, u1); + __GLX_PUT_FLOAT(16, u2); + __GLX_PUT_LONG(20, uord); + __GLX_PUT_FLOAT(24, v1); + __GLX_PUT_FLOAT(28, v2); + __GLX_PUT_LONG(32, vord); + + if ((vstr != k) || (ustr != k * vord)) { + GLfloat *buf; + + buf = (GLfloat *) Xmalloc(compsize); + if (!buf) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } + /* + ** Pack into a u-major ordering. + */ + __glFillMap2f(k, uord, vord, ustr, vstr, pnts, buf); + __glXSendLargeCommand(gc, pc, 36, buf, compsize); + Xfree((char *) buf); + } + else { + /* Data is already packed. Just send it out */ + __glXSendLargeCommand(gc, pc, 36, pnts, compsize); + } + } +} + +void +__indirect_glEnable(GLenum cap) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (!gc->currentDpy) + return; + + switch (cap) { + case GL_COLOR_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_INDEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_TEXTURE_COORD_ARRAY: + case GL_VERTEX_ARRAY: + case GL_SECONDARY_COLOR_ARRAY: + case GL_FOG_COORD_ARRAY: + __indirect_glEnableClientState(cap); + return; + default: + break; + } + + __GLX_BEGIN(X_GLrop_Enable, 8); + __GLX_PUT_LONG(4, cap); + __GLX_END(8); +} + +void +__indirect_glDisable(GLenum cap) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (!gc->currentDpy) + return; + + switch (cap) { + case GL_COLOR_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_INDEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_TEXTURE_COORD_ARRAY: + case GL_VERTEX_ARRAY: + case GL_SECONDARY_COLOR_ARRAY: + case GL_FOG_COORD_ARRAY: + __indirect_glDisableClientState(cap); + return; + default: + break; + } + + __GLX_BEGIN(X_GLrop_Disable, 8); + __GLX_PUT_LONG(4, cap); + __GLX_END(8); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/renderpix.c xpsb-glx-0.19/mesa/src/glx/x11/renderpix.c --- xpsb-glx-0.19/mesa/src/glx/x11/renderpix.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/renderpix.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,218 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +/* + * (C) Copyright IBM Corporation 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "packrender.h" +#include "indirect.h" + +/** + * Send a large image to the server. If necessary, a buffer is allocated + * to hold the unpacked data that is copied from the clients memory. + * + * \param gc Current GLX context + * \param compsize Size, in bytes, of the image portion + * \param dim Number of dimensions of the image + * \param width Width of the image + * \param height Height of the image, must be 1 for 1D images + * \param depth Depth of the image, must be 1 for 1D or 2D images + * \param format Format of the image + * \param type Data type of the image + * \param src Pointer to the image data + * \param pc Pointer to end of the command header + * \param modes Pointer to the pixel unpack data + * + * \todo + * Modify this function so that \c NULL images are sent using + * \c __glXSendLargeChunk instead of __glXSendLargeCommand. Doing this + * will eliminate the need to allocate a buffer for that case. + * + * \bugs + * The \c fastImageUnpack path, which is thankfully never used, is completely + * broken. + */ +void +__glXSendLargeImage(__GLXcontext * gc, GLint compsize, GLint dim, + GLint width, GLint height, GLint depth, + GLenum format, GLenum type, const GLvoid * src, + GLubyte * pc, GLubyte * modes) +{ + if (!gc->fastImageUnpack || (src == NULL)) { + /* Allocate a temporary holding buffer */ + GLubyte *buf = (GLubyte *) Xmalloc(compsize); + if (!buf) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } + + /* Apply pixel store unpack modes to copy data into buf */ + if (src != NULL) { + (*gc->fillImage) (gc, dim, width, height, depth, format, type, + src, buf, modes); + } + else { + if (dim < 3) { + (void) memcpy(modes, __glXDefaultPixelStore + 4, 20); + } + else { + (void) memcpy(modes, __glXDefaultPixelStore + 0, 36); + } + } + + /* Send large command */ + __glXSendLargeCommand(gc, gc->pc, pc - gc->pc, buf, compsize); + + /* Free buffer */ + Xfree((char *) buf); + } + else { + /* Just send the data straight as is */ + __glXSendLargeCommand(gc, gc->pc, pc - gc->pc, pc, compsize); + } +} + +/************************************************************************/ + +/** + * Implement GLX protocol for \c glSeparableFilter2D. + * + * \bugs + * The \c fastImageUnpack path, which is thankfully never used, is completely + * broken. + */ +void +__indirect_glSeparableFilter2D(GLenum target, GLenum internalformat, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * row, + const GLvoid * column) +{ + __GLX_DECLARE_VARIABLES(); + GLuint compsize2, hdrlen, totalhdrlen, image1len, image2len; + + __GLX_LOAD_VARIABLES(); + compsize = __glImageSize(width, 1, 1, format, type, 0); + compsize2 = __glImageSize(height, 1, 1, format, type, 0); + totalhdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE); + hdrlen = __GLX_PAD(__GLX_CONV_FILT_HDR_SIZE); + image1len = __GLX_PAD(compsize); + image2len = __GLX_PAD(compsize2); + cmdlen = totalhdrlen + image1len + image2len; + if (!gc->currentDpy) + return; + + if (cmdlen <= gc->maxSmallRenderCommandSize) { + /* Use GLXRender protocol to send small command */ + __GLX_BEGIN_VARIABLE_WITH_PIXEL(X_GLrop_SeparableFilter2D, cmdlen); + __GLX_PUT_LONG(0, target); + __GLX_PUT_LONG(4, internalformat); + __GLX_PUT_LONG(8, width); + __GLX_PUT_LONG(12, height); + __GLX_PUT_LONG(16, format); + __GLX_PUT_LONG(20, type); + pc += hdrlen; + if (compsize > 0) { + (*gc->fillImage) (gc, 1, width, 1, 1, format, type, + row, pc, pixelHeaderPC); + pc += image1len; + } + if (compsize2 > 0) { + (*gc->fillImage) (gc, 1, height, 1, 1, format, type, + column, pc, NULL); + pc += image2len; + } + if ((compsize == 0) && (compsize2 == 0)) { + /* Setup default store modes */ + (void) memcpy(pixelHeaderPC, __glXDefaultPixelStore + 4, 20); + } + __GLX_END(0); + } + else { + const GLint bufsize = image1len + image2len; + + /* Use GLXRenderLarge protocol to send command */ + __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL(X_GLrop_SeparableFilter2D, + cmdlen + 4); + __GLX_PUT_LONG(0, target); + __GLX_PUT_LONG(4, internalformat); + __GLX_PUT_LONG(8, width); + __GLX_PUT_LONG(12, height); + __GLX_PUT_LONG(16, format); + __GLX_PUT_LONG(20, type); + pc += hdrlen; + + if (!gc->fastImageUnpack) { + /* Allocate a temporary holding buffer */ + GLubyte *buf = (GLubyte *) Xmalloc(bufsize); + if (!buf) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } + (*gc->fillImage) (gc, 1, width, 1, 1, format, type, row, buf, + pixelHeaderPC); + + (*gc->fillImage) (gc, 1, height, 1, 1, format, type, column, + buf + image1len, pixelHeaderPC); + + /* Send large command */ + __glXSendLargeCommand(gc, gc->pc, (GLint) (pc - gc->pc), buf, + bufsize); + /* Free buffer */ + Xfree((char *) buf); + } + else { + /* Just send the data straight as is */ + __glXSendLargeCommand(gc, gc->pc, (GLint) (pc - gc->pc), pc, + bufsize); + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/single2.c xpsb-glx-0.19/mesa/src/glx/x11/single2.c --- xpsb-glx-0.19/mesa/src/glx/x11/single2.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/single2.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,971 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include +#include +#include "glxclient.h" +#include "packsingle.h" +#include "glxextensions.h" +#include "indirect.h" +#include "indirect_vertex_array.h" +#include "dispatch.h" +#include "glapi.h" +#ifdef USE_XCB +#include +#include +#include +#endif /* USE_XCB */ + + +/* Used for GL_ARB_transpose_matrix */ +static void +TransposeMatrixf(GLfloat m[16]) +{ + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < i; j++) { + GLfloat tmp = m[i * 4 + j]; + m[i * 4 + j] = m[j * 4 + i]; + m[j * 4 + i] = tmp; + } + } +} + +/* Used for GL_ARB_transpose_matrix */ +static void +TransposeMatrixb(GLboolean m[16]) +{ + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < i; j++) { + GLboolean tmp = m[i * 4 + j]; + m[i * 4 + j] = m[j * 4 + i]; + m[j * 4 + i] = tmp; + } + } +} + +/* Used for GL_ARB_transpose_matrix */ +static void +TransposeMatrixd(GLdouble m[16]) +{ + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < i; j++) { + GLdouble tmp = m[i * 4 + j]; + m[i * 4 + j] = m[j * 4 + i]; + m[j * 4 + i] = tmp; + } + } +} + +/* Used for GL_ARB_transpose_matrix */ +static void +TransposeMatrixi(GLint m[16]) +{ + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < i; j++) { + GLint tmp = m[i * 4 + j]; + m[i * 4 + j] = m[j * 4 + i]; + m[j * 4 + i] = tmp; + } + } +} + + +/** + * Remap a transpose-matrix enum to a non-transpose-matrix enum. Enums + * that are not transpose-matrix enums are unaffected. + */ +static GLenum +RemapTransposeEnum(GLenum e) +{ + switch (e) { + case GL_TRANSPOSE_MODELVIEW_MATRIX: + case GL_TRANSPOSE_PROJECTION_MATRIX: + case GL_TRANSPOSE_TEXTURE_MATRIX: + return e - (GL_TRANSPOSE_MODELVIEW_MATRIX - GL_MODELVIEW_MATRIX); + case GL_TRANSPOSE_COLOR_MATRIX: + return GL_COLOR_MATRIX; + default: + return e; + }; +} + + +GLenum +__indirect_glGetError(void) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + GLuint retval = GL_NO_ERROR; + xGLXGetErrorReply reply; + + if (gc->error) { + /* Use internal error first */ + retval = gc->error; + gc->error = GL_NO_ERROR; + return retval; + } + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_GetError, 0); + __GLX_SINGLE_READ_XREPLY(); + retval = reply.error; + __GLX_SINGLE_END(); + + return retval; +} + + +/** + * Get the selected attribute from the client state. + * + * \returns + * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned. + */ +static GLboolean +get_client_data(__GLXcontext * gc, GLenum cap, GLintptr * data) +{ + GLboolean retval = GL_TRUE; + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + const GLint tex_unit = __glXGetActiveTextureUnit(state); + + + switch (cap) { + case GL_VERTEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_COLOR_ARRAY: + case GL_INDEX_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_SECONDARY_COLOR_ARRAY: + case GL_FOG_COORD_ARRAY: + retval = __glXGetArrayEnable(state, cap, 0, data); + break; + + case GL_VERTEX_ARRAY_SIZE: + retval = __glXGetArraySize(state, GL_VERTEX_ARRAY, 0, data); + break; + case GL_COLOR_ARRAY_SIZE: + retval = __glXGetArraySize(state, GL_COLOR_ARRAY, 0, data); + break; + case GL_SECONDARY_COLOR_ARRAY_SIZE: + retval = __glXGetArraySize(state, GL_SECONDARY_COLOR_ARRAY, 0, data); + break; + + case GL_VERTEX_ARRAY_TYPE: + retval = __glXGetArrayType(state, GL_VERTEX_ARRAY, 0, data); + break; + case GL_NORMAL_ARRAY_TYPE: + retval = __glXGetArrayType(state, GL_NORMAL_ARRAY, 0, data); + break; + case GL_INDEX_ARRAY_TYPE: + retval = __glXGetArrayType(state, GL_INDEX_ARRAY, 0, data); + break; + case GL_COLOR_ARRAY_TYPE: + retval = __glXGetArrayType(state, GL_COLOR_ARRAY, 0, data); + break; + case GL_SECONDARY_COLOR_ARRAY_TYPE: + retval = __glXGetArrayType(state, GL_SECONDARY_COLOR_ARRAY, 0, data); + break; + case GL_FOG_COORD_ARRAY_TYPE: + retval = __glXGetArrayType(state, GL_FOG_COORD_ARRAY, 0, data); + break; + + case GL_VERTEX_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_VERTEX_ARRAY, 0, data); + break; + case GL_NORMAL_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_NORMAL_ARRAY, 0, data); + break; + case GL_INDEX_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_INDEX_ARRAY, 0, data); + break; + case GL_EDGE_FLAG_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_EDGE_FLAG_ARRAY, 0, data); + break; + case GL_COLOR_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_COLOR_ARRAY, 0, data); + break; + case GL_SECONDARY_COLOR_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_SECONDARY_COLOR_ARRAY, 0, data); + break; + case GL_FOG_COORD_ARRAY_STRIDE: + retval = __glXGetArrayStride(state, GL_FOG_COORD_ARRAY, 0, data); + break; + + case GL_TEXTURE_COORD_ARRAY: + retval = + __glXGetArrayEnable(state, GL_TEXTURE_COORD_ARRAY, tex_unit, data); + break; + case GL_TEXTURE_COORD_ARRAY_SIZE: + retval = + __glXGetArraySize(state, GL_TEXTURE_COORD_ARRAY, tex_unit, data); + break; + case GL_TEXTURE_COORD_ARRAY_TYPE: + retval = + __glXGetArrayType(state, GL_TEXTURE_COORD_ARRAY, tex_unit, data); + break; + case GL_TEXTURE_COORD_ARRAY_STRIDE: + retval = + __glXGetArrayStride(state, GL_TEXTURE_COORD_ARRAY, tex_unit, data); + break; + + case GL_MAX_ELEMENTS_VERTICES: + case GL_MAX_ELEMENTS_INDICES: + retval = GL_TRUE; + *data = ~0UL; + break; + + + case GL_PACK_ROW_LENGTH: + *data = (GLintptr) state->storePack.rowLength; + break; + case GL_PACK_IMAGE_HEIGHT: + *data = (GLintptr) state->storePack.imageHeight; + break; + case GL_PACK_SKIP_ROWS: + *data = (GLintptr) state->storePack.skipRows; + break; + case GL_PACK_SKIP_PIXELS: + *data = (GLintptr) state->storePack.skipPixels; + break; + case GL_PACK_SKIP_IMAGES: + *data = (GLintptr) state->storePack.skipImages; + break; + case GL_PACK_ALIGNMENT: + *data = (GLintptr) state->storePack.alignment; + break; + case GL_PACK_SWAP_BYTES: + *data = (GLintptr) state->storePack.swapEndian; + break; + case GL_PACK_LSB_FIRST: + *data = (GLintptr) state->storePack.lsbFirst; + break; + case GL_UNPACK_ROW_LENGTH: + *data = (GLintptr) state->storeUnpack.rowLength; + break; + case GL_UNPACK_IMAGE_HEIGHT: + *data = (GLintptr) state->storeUnpack.imageHeight; + break; + case GL_UNPACK_SKIP_ROWS: + *data = (GLintptr) state->storeUnpack.skipRows; + break; + case GL_UNPACK_SKIP_PIXELS: + *data = (GLintptr) state->storeUnpack.skipPixels; + break; + case GL_UNPACK_SKIP_IMAGES: + *data = (GLintptr) state->storeUnpack.skipImages; + break; + case GL_UNPACK_ALIGNMENT: + *data = (GLintptr) state->storeUnpack.alignment; + break; + case GL_UNPACK_SWAP_BYTES: + *data = (GLintptr) state->storeUnpack.swapEndian; + break; + case GL_UNPACK_LSB_FIRST: + *data = (GLintptr) state->storeUnpack.lsbFirst; + break; + case GL_CLIENT_ATTRIB_STACK_DEPTH: + *data = (GLintptr) (gc->attributes.stackPointer - gc->attributes.stack); + break; + case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: + *data = (GLintptr) __GL_CLIENT_ATTRIB_STACK_DEPTH; + break; + case GL_CLIENT_ACTIVE_TEXTURE: + *data = (GLintptr) (tex_unit + GL_TEXTURE0); + break; + + default: + retval = GL_FALSE; + break; + } + + + return retval; +} + + +void +__indirect_glGetBooleanv(GLenum val, GLboolean * b) +{ + const GLenum origVal = val; + __GLX_SINGLE_DECLARE_VARIABLES(); + xGLXSingleReply reply; + + val = RemapTransposeEnum(val); + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_GetBooleanv, 4); + __GLX_SINGLE_PUT_LONG(0, val); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_GET_SIZE(compsize); + + if (compsize == 0) { + /* + ** Error occured; don't modify user's buffer. + */ + } + else { + GLintptr data; + + /* + ** We still needed to send the request to the server in order to + ** find out whether it was legal to make a query (it's illegal, + ** for example, to call a query between glBegin() and glEnd()). + */ + + if (get_client_data(gc, val, &data)) { + *b = (GLboolean) data; + } + else { + /* + ** Not a local value, so use what we got from the server. + */ + if (compsize == 1) { + __GLX_SINGLE_GET_CHAR(b); + } + else { + __GLX_SINGLE_GET_CHAR_ARRAY(b, compsize); + if (val != origVal) { + /* matrix transpose */ + TransposeMatrixb(b); + } + } + } + } + __GLX_SINGLE_END(); +} + +void +__indirect_glGetDoublev(GLenum val, GLdouble * d) +{ + const GLenum origVal = val; + __GLX_SINGLE_DECLARE_VARIABLES(); + xGLXSingleReply reply; + + val = RemapTransposeEnum(val); + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_GetDoublev, 4); + __GLX_SINGLE_PUT_LONG(0, val); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_GET_SIZE(compsize); + + if (compsize == 0) { + /* + ** Error occured; don't modify user's buffer. + */ + } + else { + GLintptr data; + + /* + ** We still needed to send the request to the server in order to + ** find out whether it was legal to make a query (it's illegal, + ** for example, to call a query between glBegin() and glEnd()). + */ + + if (get_client_data(gc, val, &data)) { + *d = (GLdouble) data; + } + else { + /* + ** Not a local value, so use what we got from the server. + */ + if (compsize == 1) { + __GLX_SINGLE_GET_DOUBLE(d); + } + else { + __GLX_SINGLE_GET_DOUBLE_ARRAY(d, compsize); + if (val != origVal) { + /* matrix transpose */ + TransposeMatrixd(d); + } + } + } + } + __GLX_SINGLE_END(); +} + +void +__indirect_glGetFloatv(GLenum val, GLfloat * f) +{ + const GLenum origVal = val; + __GLX_SINGLE_DECLARE_VARIABLES(); + xGLXSingleReply reply; + + val = RemapTransposeEnum(val); + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_GetFloatv, 4); + __GLX_SINGLE_PUT_LONG(0, val); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_GET_SIZE(compsize); + + if (compsize == 0) { + /* + ** Error occured; don't modify user's buffer. + */ + } + else { + GLintptr data; + + /* + ** We still needed to send the request to the server in order to + ** find out whether it was legal to make a query (it's illegal, + ** for example, to call a query between glBegin() and glEnd()). + */ + + if (get_client_data(gc, val, &data)) { + *f = (GLfloat) data; + } + else { + /* + ** Not a local value, so use what we got from the server. + */ + if (compsize == 1) { + __GLX_SINGLE_GET_FLOAT(f); + } + else { + __GLX_SINGLE_GET_FLOAT_ARRAY(f, compsize); + if (val != origVal) { + /* matrix transpose */ + TransposeMatrixf(f); + } + } + } + } + __GLX_SINGLE_END(); +} + +void +__indirect_glGetIntegerv(GLenum val, GLint * i) +{ + const GLenum origVal = val; + __GLX_SINGLE_DECLARE_VARIABLES(); + xGLXSingleReply reply; + + val = RemapTransposeEnum(val); + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_GetIntegerv, 4); + __GLX_SINGLE_PUT_LONG(0, val); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_GET_SIZE(compsize); + + if (compsize == 0) { + /* + ** Error occured; don't modify user's buffer. + */ + } + else { + GLintptr data; + + /* + ** We still needed to send the request to the server in order to + ** find out whether it was legal to make a query (it's illegal, + ** for example, to call a query between glBegin() and glEnd()). + */ + + if (get_client_data(gc, val, &data)) { + *i = (GLint) data; + } + else { + /* + ** Not a local value, so use what we got from the server. + */ + if (compsize == 1) { + __GLX_SINGLE_GET_LONG(i); + } + else { + __GLX_SINGLE_GET_LONG_ARRAY(i, compsize); + if (val != origVal) { + /* matrix transpose */ + TransposeMatrixi(i); + } + } + } + } + __GLX_SINGLE_END(); +} + +/* +** Send all pending commands to server. +*/ +void +__indirect_glFlush(void) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + + if (!dpy) + return; + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_Flush, 0); + __GLX_SINGLE_END(); + + /* And finally flush the X protocol data */ + XFlush(dpy); +} + +void +__indirect_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + + if (!dpy) + return; + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_FeedbackBuffer, 8); + __GLX_SINGLE_PUT_LONG(0, size); + __GLX_SINGLE_PUT_LONG(4, type); + __GLX_SINGLE_END(); + + gc->feedbackBuf = buffer; +} + +void +__indirect_glSelectBuffer(GLsizei numnames, GLuint * buffer) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + + if (!dpy) + return; + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_SelectBuffer, 4); + __GLX_SINGLE_PUT_LONG(0, numnames); + __GLX_SINGLE_END(); + + gc->selectBuf = buffer; +} + +GLint +__indirect_glRenderMode(GLenum mode) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + GLint retval = 0; + xGLXRenderModeReply reply; + + if (!dpy) + return -1; + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_RenderMode, 4); + __GLX_SINGLE_PUT_LONG(0, mode); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_GET_RETVAL(retval, GLint); + + if (reply.newMode != mode) { + /* + ** Switch to new mode did not take effect, therefore an error + ** occured. When an error happens the server won't send us any + ** other data. + */ + } + else { + /* Read the feedback or selection data */ + if (gc->renderMode == GL_FEEDBACK) { + __GLX_SINGLE_GET_SIZE(compsize); + __GLX_SINGLE_GET_FLOAT_ARRAY(gc->feedbackBuf, compsize); + } + else if (gc->renderMode == GL_SELECT) { + __GLX_SINGLE_GET_SIZE(compsize); + __GLX_SINGLE_GET_LONG_ARRAY(gc->selectBuf, compsize); + } + gc->renderMode = mode; + } + __GLX_SINGLE_END(); + + return retval; +} + +void +__indirect_glFinish(void) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + xGLXSingleReply reply; + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_Finish, 0); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_END(); +} + + +/** + * Extract the major and minor version numbers from a version string. + */ +static void +version_from_string(const char *ver, int *major_version, int *minor_version) +{ + const char *end; + long major; + long minor; + + major = strtol(ver, (char **) &end, 10); + minor = strtol(end + 1, NULL, 10); + *major_version = major; + *minor_version = minor; +} + + +const GLubyte * +__indirect_glGetString(GLenum name) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + Display *dpy = gc->currentDpy; + GLubyte *s = NULL; + + if (!dpy) + return 0; + + /* + ** Return the cached copy if the string has already been fetched + */ + switch (name) { + case GL_VENDOR: + if (gc->vendor) + return gc->vendor; + break; + case GL_RENDERER: + if (gc->renderer) + return gc->renderer; + break; + case GL_VERSION: + if (gc->version) + return gc->version; + break; + case GL_EXTENSIONS: + if (gc->extensions) + return gc->extensions; + break; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return 0; + } + + /* + ** Get requested string from server + */ + + (void) __glXFlushRenderBuffer(gc, gc->pc); + s = (GLubyte *) __glXGetString(dpy, gc->majorOpcode, gc->currentContextTag, name); + if (!s) { + /* Throw data on the floor */ + __glXSetError(gc, GL_OUT_OF_MEMORY); + } + else { + /* + ** Update local cache + */ + switch (name) { + case GL_VENDOR: + gc->vendor = s; + break; + + case GL_RENDERER: + gc->renderer = s; + break; + + case GL_VERSION:{ + int client_major; + int client_minor; + + version_from_string((char *) s, + &gc->server_major, &gc->server_minor); + __glXGetGLVersion(&client_major, &client_minor); + + if ((gc->server_major < client_major) + || ((gc->server_major == client_major) + && (gc->server_minor <= client_minor))) { + gc->version = s; + } + else { + /* Allow 7 bytes for the client-side GL version. This allows + * for upto version 999.999. I'm not holding my breath for + * that one! The extra 4 is for the ' ()\0' that will be + * added. + */ + const size_t size = 7 + strlen((char *) s) + 4; + + gc->version = Xmalloc(size); + if (gc->version == NULL) { + /* If we couldn't allocate memory for the new string, + * make a best-effort and just copy the client-side version + * to the string and use that. It probably doesn't + * matter what is done here. If there not memory available + * for a short string, the system is probably going to die + * soon anyway. + */ + snprintf((char *) s, strlen((char *) s) + 1, "%u.%u", + client_major, client_minor); + gc->version = s; + } + else { + snprintf((char *) gc->version, size, "%u.%u (%s)", + client_major, client_minor, s); + Xfree(s); + s = gc->version; + } + } + break; + } + + case GL_EXTENSIONS:{ + int major = 1; + int minor = 0; + + /* This code is currently disabled. I was reminded that some + * vendors intentionally exclude some extensions from their + * extension string that are part of the core version they + * advertise. In particular, on Nvidia drivers this means that + * the functionality is supported by the driver, but is not + * hardware accelerated. For example, a TNT will show core + * version 1.5, but most of the post-1.2 functionality is a + * software fallback. + * + * I don't want to break applications that rely on this odd + * behavior. At the same time, the code is written and tested, + * so I didn't want to throw it away. Therefore, the code is here + * but disabled. In the future, we may wish to and an environment + * variable to enable it. + */ + +#if 0 + /* Call glGetString just to make sure that gc->server_major and + * gc->server_minor are set. This version may be higher than we + * can completely support, but it may imply support for some + * extensions that we can support. + * + * For example, at the time of this writing, the client-side + * library only supports upto core GL version 1.2. However, cubic + * textures, multitexture, multisampling, and some other 1.3 + * features are supported. If the server reports back version + * 1.3, but does not report all of those extensions, we will + * enable them. + */ + (void *) glGetString(GL_VERSION); + major = gc->server_major, minor = gc->server_minor; +#endif + + __glXCalculateUsableGLExtensions(gc, (char *) s, major, minor); + XFree(s); + s = gc->extensions; + break; + } + } + } + return s; +} + +GLboolean +__indirect_glIsEnabled(GLenum cap) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + xGLXSingleReply reply; + GLboolean retval = 0; + GLintptr enable; + + if (!dpy) + return 0; + + switch (cap) { + case GL_VERTEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_COLOR_ARRAY: + case GL_INDEX_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_SECONDARY_COLOR_ARRAY: + case GL_FOG_COORD_ARRAY: + retval = __glXGetArrayEnable(state, cap, 0, &enable); + assert(retval); + return (GLboolean) enable; + break; + case GL_TEXTURE_COORD_ARRAY: + retval = __glXGetArrayEnable(state, GL_TEXTURE_COORD_ARRAY, + __glXGetActiveTextureUnit(state), &enable); + assert(retval); + return (GLboolean) enable; + break; + } + + __GLX_SINGLE_LOAD_VARIABLES(); + __GLX_SINGLE_BEGIN(X_GLsop_IsEnabled, 4); + __GLX_SINGLE_PUT_LONG(0, cap); + __GLX_SINGLE_READ_XREPLY(); + __GLX_SINGLE_GET_RETVAL(retval, GLboolean); + __GLX_SINGLE_END(); + return retval; +} + +void +__indirect_glGetPointerv(GLenum pname, void **params) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + Display *dpy = gc->currentDpy; + + if (!dpy) + return; + + switch (pname) { + case GL_VERTEX_ARRAY_POINTER: + case GL_NORMAL_ARRAY_POINTER: + case GL_COLOR_ARRAY_POINTER: + case GL_INDEX_ARRAY_POINTER: + case GL_EDGE_FLAG_ARRAY_POINTER: + __glXGetArrayPointer(state, pname - GL_VERTEX_ARRAY_POINTER + + GL_VERTEX_ARRAY, 0, params); + return; + case GL_TEXTURE_COORD_ARRAY_POINTER: + __glXGetArrayPointer(state, GL_TEXTURE_COORD_ARRAY, + __glXGetActiveTextureUnit(state), params); + return; + case GL_SECONDARY_COLOR_ARRAY_POINTER: + case GL_FOG_COORD_ARRAY_POINTER: + __glXGetArrayPointer(state, pname - GL_FOG_COORD_ARRAY_POINTER + + GL_FOG_COORD_ARRAY, 0, params); + return; + case GL_FEEDBACK_BUFFER_POINTER: + *params = (void *) gc->feedbackBuf; + return; + case GL_SELECTION_BUFFER_POINTER: + *params = (void *) gc->selectBuf; + return; + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } +} + + + +/** + * This was previously auto-generated, but we need to special-case + * how we handle writing into the 'residences' buffer when n%4!=0. + */ +#define X_GLsop_AreTexturesResident 143 +GLboolean +__indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, + GLboolean * residences) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_are_textures_resident_reply_t *reply = + xcb_glx_are_textures_resident_reply(c, + xcb_glx_are_textures_resident + (c, gc->currentContextTag, n, + textures), NULL); + (void) memcpy(residences, xcb_glx_are_textures_resident_data(reply), + xcb_glx_are_textures_resident_data_length(reply) * + sizeof(GLboolean)); + retval = reply->ret_val; + free(reply); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_AreTexturesResident, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + if (n & 3) { + /* n is not a multiple of four. + * When reply_is_always_array is TRUE, __glXReadReply() will + * put a multiple of four bytes into the dest buffer. If the + * caller's buffer is not a multiple of four in size, we'll write + * out of bounds. So use a temporary buffer that's a few bytes + * larger. + */ + GLboolean *res4 = malloc((n + 3) & ~3); + retval = (GLboolean) __glXReadReply(dpy, 1, res4, GL_TRUE); + memcpy(residences, res4, n); + free(res4); + } + else { + retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE); + } + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ + } + return retval; +} + + +/** + * This was previously auto-generated, but we need to special-case + * how we handle writing into the 'residences' buffer when n%4!=0. + */ +#define X_GLvop_AreTexturesResidentEXT 11 +GLboolean +glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, + GLboolean * residences) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + return CALL_AreTexturesResident(GET_DISPATCH(), + (n, textures, residences)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_AreTexturesResidentEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + if (n & 3) { + /* see comments in __indirect_glAreTexturesResident() */ + GLboolean *res4 = malloc((n + 3) & ~3); + retval = (GLboolean) __glXReadReply(dpy, 1, res4, GL_TRUE); + memcpy(residences, res4, n); + free(res4); + } + else { + retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE); + } + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/singlepix.c xpsb-glx-0.19/mesa/src/glx/x11/singlepix.c --- xpsb-glx-0.19/mesa/src/glx/x11/singlepix.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/singlepix.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,195 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "packsingle.h" +#include "indirect.h" +#include "dispatch.h" +#include "glapi.h" +#include "glthread.h" +#include "glapioffsets.h" +#include + +void +__indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, + GLvoid * row, GLvoid * column, GLvoid * span) +{ + __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute *state; + xGLXGetSeparableFilterReply reply; + GLubyte *rowBuf, *colBuf; + + if (!dpy) + return; + __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; + + /* Send request */ + __GLX_SINGLE_BEGIN(X_GLsop_GetSeparableFilter, __GLX_PAD(13)); + __GLX_SINGLE_PUT_LONG(0, target); + __GLX_SINGLE_PUT_LONG(4, format); + __GLX_SINGLE_PUT_LONG(8, type); + __GLX_SINGLE_PUT_CHAR(12, state->storePack.swapEndian); + __GLX_SINGLE_READ_XREPLY(); + compsize = reply.length << 2; + + if (compsize != 0) { + GLint width, height; + GLint widthsize, heightsize; + + width = reply.width; + height = reply.height; + + widthsize = __glImageSize(width, 1, 1, format, type, 0); + heightsize = __glImageSize(height, 1, 1, format, type, 0); + + /* Allocate a holding buffer to transform the data from */ + rowBuf = (GLubyte *) Xmalloc(widthsize); + if (!rowBuf) { + /* Throw data away */ + _XEatData(dpy, compsize); + __glXSetError(gc, GL_OUT_OF_MEMORY); + UnlockDisplay(dpy); + SyncHandle(); + return; + } + else { + __GLX_SINGLE_GET_CHAR_ARRAY(((char *) rowBuf), widthsize); + __glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row); + Xfree((char *) rowBuf); + } + colBuf = (GLubyte *) Xmalloc(heightsize); + if (!colBuf) { + /* Throw data away */ + _XEatData(dpy, compsize - __GLX_PAD(widthsize)); + __glXSetError(gc, GL_OUT_OF_MEMORY); + UnlockDisplay(dpy); + SyncHandle(); + return; + } + else { + __GLX_SINGLE_GET_CHAR_ARRAY(((char *) colBuf), heightsize); + __glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column); + Xfree((char *) colBuf); + } + } + else { + /* + ** don't modify user's buffer. + */ + } + __GLX_SINGLE_END(); + +} + + +#define CONCAT(a,b) a ## b +#define NAME(o) CONCAT(gl_dispatch_stub_, o) + +void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format, + GLenum type, GLvoid * row, + GLvoid * column, GLvoid * span) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + +#ifdef GLX_DIRECT_RENDERING + if (gc->driContext) { + CALL_GetSeparableFilter(GET_DISPATCH(), + (target, format, type, row, column, span)); + return; + } + else +#endif + { + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = __GLX_PAD(13); + + if (dpy != NULL) { + const __GLXattribute *const state = gc->client_state_private; + xGLXGetSeparableFilterReply reply; + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetSeparableFilterEXT, cmdlen); + unsigned compsize; + + + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + + compsize = reply.length << 2; + + if (compsize != 0) { + const GLint width = reply.width; + const GLint height = reply.height; + const GLint widthsize = + __glImageSize(width, 1, 1, format, type, 0); + const GLint heightsize = + __glImageSize(height, 1, 1, format, type, 0); + GLubyte *const buf = + (GLubyte *) Xmalloc((widthsize > heightsize) ? widthsize : + heightsize); + + if (buf == NULL) { + /* Throw data away */ + _XEatData(dpy, compsize); + __glXSetError(gc, GL_OUT_OF_MEMORY); + + UnlockDisplay(dpy); + SyncHandle(); + return; + } + else { + int extra; + + extra = 4 - (widthsize & 3); + _XRead(dpy, (char *) buf, widthsize); + if (extra < 4) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 1, width, 1, 1, format, type, buf, row); + + extra = 4 - (heightsize & 3); + _XRead(dpy, (char *) buf, heightsize); + if (extra < 4) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column); + + Xfree((char *) buf); + } + } + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/vertarr.c xpsb-glx-0.19/mesa/src/glx/x11/vertarr.c --- xpsb-glx-0.19/mesa/src/glx/x11/vertarr.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/vertarr.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,212 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#include "glxclient.h" +#include "indirect.h" +#include "indirect_vertex_array.h" + + +/*****************************************************************************/ + +/** + * \name Vertex array pointer bridge functions + * + * When EXT_vertex_array was moved into the core GL spec, the \c count + * parameter was lost. This libGL really only wants to implement the GL 1.1 + * version, but we need to support applications that were written to the old + * interface. These bridge functions are part of the glue that makes this + * happen. + */ +/*@{*/ +void +__indirect_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer) +{ + (void) count; + __indirect_glColorPointer(size, type, stride, pointer); +} + +void +__indirect_glEdgeFlagPointerEXT(GLsizei stride, + GLsizei count, const GLboolean * pointer) +{ + (void) count; + __indirect_glEdgeFlagPointer(stride, pointer); +} + +void +__indirect_glIndexPointerEXT(GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer) +{ + (void) count; + __indirect_glIndexPointer(type, stride, pointer); +} + +void +__indirect_glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, + const GLvoid * pointer) +{ + (void) count; + __indirect_glNormalPointer(type, stride, pointer); +} + +void +__indirect_glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer) +{ + (void) count; + __indirect_glTexCoordPointer(size, type, stride, pointer); +} + +void +__indirect_glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer) +{ + (void) count; + __indirect_glVertexPointer(size, type, stride, pointer); +} + +/*@}*/ + +/*****************************************************************************/ + +void +__indirect_glInterleavedArrays(GLenum format, GLsizei stride, + const GLvoid * pointer) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); + +#define NONE {0, 0, 0} +#define F(x) {GL_FLOAT, x, x * sizeof(GLfloat)} +#define UB4 {GL_UNSIGNED_BYTE, 4, 4 * sizeof(GLubyte)} + + /* Each row in this array describes the elements of a particular + * interleaved array mode. Each column describes, in the order in which + * they appear in the interleaved arrays, one of the four possible types + * of vertex data that can appear in an interleaved array. + */ + struct + { + /** + * The enum describing the GL type, as would be passed to the + * appropriate gl*Pointer function. + */ + GLushort type; + + /** + * Number of elements in the subarray, as would be passed (as the + * \c size parameter) to the appropriate gl*Pointer function. + */ + GLubyte count; + + /** + * True size of a single element in the subarray, as would be passed + * (as the \c stride parameter) to the appropriate gl*Pointer + * function. + */ + GLubyte size; + } + static const modes[14][4] = { + /* texture color normal vertex */ + {NONE, NONE, NONE, F(2)}, /* GL_V2F */ + {NONE, NONE, NONE, F(3)}, /* GL_V3F */ + {NONE, UB4, NONE, F(2)}, /* GL_C4UB_V2F */ + {NONE, UB4, NONE, F(3)}, /* GL_C4UB_V3F */ + {NONE, F(3), NONE, F(3)}, /* GL_C3F_V3F */ + {NONE, NONE, F(3), F(3)}, /* GL_N3F_V3F */ + {NONE, F(4), F(3), F(3)}, /* GL_C4F_N3F_V3F */ + {F(2), NONE, NONE, F(3)}, /* GL_T2F_V3F */ + {F(4), NONE, NONE, F(4)}, /* GL_T4F_V4F */ + {F(2), UB4, NONE, F(3)}, /* GL_T2F_C4UB_V3F */ + {F(2), F(3), NONE, F(3)}, /* GL_T2F_C3F_V3F */ + {F(2), NONE, F(3), F(3)}, /* GL_T2F_N3F_V3F */ + {F(2), F(4), F(3), F(3)}, /* GL_T2F_C4F_N3F_V3F */ + {F(4), F(4), F(3), F(4)}, /* GL_T4F_C4F_N3F_V4F */ + }; +#undef NONE +#undef F +#undef UB4 + + GLint trueStride, size; + int offsets[4]; + unsigned i; + const int idx = format - GL_V2F; + + + /* All valid formats are on the range [GL_V2F, GL_V2F+0x0D]. Since idx + * is just the format biased by -GL_V2F, all valid idx values are on the + * range [0, 0x0D]. + */ + if ((idx < 0) || (idx > 0x0D)) { + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + if (stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + + /* If the 'count' for a subarray is non-zero, then the offset of its + * first element is at the currently accumulated 'size'. + */ + size = 0; + for (i = 0; i < 4; i++) { + offsets[i] = (modes[idx][i].count != 0) ? size : -1; + size += modes[idx][i].size; + } + + trueStride = (stride == 0) ? size : stride; + + __glXArrayDisableAll(state); + + if (offsets[0] >= 0) { + __indirect_glEnableClientState(GL_TEXTURE_COORD_ARRAY); + __indirect_glTexCoordPointer(modes[idx][0].count, GL_FLOAT, + trueStride, (const char *) pointer); + } + if (offsets[1] >= 0) { + __indirect_glEnableClientState(GL_COLOR_ARRAY); + __indirect_glColorPointer(modes[idx][1].count, modes[idx][1].type, + trueStride, + (const char *) pointer + offsets[1]); + } + if (offsets[2] >= 0) { + __indirect_glEnableClientState(GL_NORMAL_ARRAY); + __indirect_glNormalPointer(GL_FLOAT, trueStride, + (const char *) pointer + offsets[2]); + } + __indirect_glEnableClientState(GL_VERTEX_ARRAY); + __indirect_glVertexPointer(modes[idx][3].count, GL_FLOAT, + trueStride, + (const char *) pointer + offsets[3]); +} diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/XF86dri.c xpsb-glx-0.19/mesa/src/glx/x11/XF86dri.c --- xpsb-glx-0.19/mesa/src/glx/x11/XF86dri.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/XF86dri.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,637 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +/* THIS IS NOT AN X CONSORTIUM STANDARD */ + +#ifdef GLX_DIRECT_RENDERING + +#define NEED_REPLIES +#include +#include +#include +#include "xf86dristr.h" + + +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define PUBLIC __attribute__((visibility("default"))) +# define USED __attribute__((used)) +#else +# define PUBLIC +# define USED +#endif + + + +static XExtensionInfo _xf86dri_info_data; +static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; +static char xf86dri_extension_name[] = XF86DRINAME; + +#define XF86DRICheckExtension(dpy,i,val) \ + XextCheckExtension (dpy, i, xf86dri_extension_name, val) + +/***************************************************************************** + * * + * private utility routines * + * * + *****************************************************************************/ + +static int close_display(Display * dpy, XExtCodes * extCodes); +static /* const */ XExtensionHooks xf86dri_extension_hooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + close_display, /* close_display */ + NULL, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + NULL, /* error_string */ +}; + +static +XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info, + xf86dri_extension_name, + &xf86dri_extension_hooks, 0, NULL) + +static +XEXT_GENERATE_CLOSE_DISPLAY(close_display, xf86dri_info) + + +/***************************************************************************** + * * + * public XFree86-DRI Extension routines * + * * + *****************************************************************************/ +#if 0 +#include +#define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg); +#else +#define TRACE(msg) +#endif + +PUBLIC Bool +XF86DRIQueryExtension(Display * dpy, int *event_basep, + int *error_basep) +{ + XExtDisplayInfo *info = find_display(dpy); + + TRACE("QueryExtension..."); + if (XextHasExtension(info)) { + *event_basep = info->codes->first_event; + *error_basep = info->codes->first_error; + TRACE("QueryExtension... return True"); + return True; + } + else { + TRACE("QueryExtension... return False"); + return False; + } +} + +PUBLIC Bool +XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, + int *patchVersion) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIQueryVersionReply rep; + xXF86DRIQueryVersionReq *req; + + TRACE("QueryVersion..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIQueryVersion; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return False"); + return False; + } + *majorVersion = rep.majorVersion; + *minorVersion = rep.minorVersion; + *patchVersion = rep.patchVersion; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return True"); + return True; +} + +PUBLIC Bool +XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen, + Bool * isCapable) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIQueryDirectRenderingCapableReply rep; + xXF86DRIQueryDirectRenderingCapableReq *req; + + TRACE("QueryDirectRenderingCapable..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIQueryDirectRenderingCapable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIQueryDirectRenderingCapable; + req->screen = screen; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return False"); + return False; + } + *isCapable = rep.isCapable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return True"); + return True; +} + +PUBLIC Bool +XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, + char **busIdString) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIOpenConnectionReply rep; + xXF86DRIOpenConnectionReq *req; + + TRACE("OpenConnection..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIOpenConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIOpenConnection; + req->screen = screen; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("OpenConnection... return False"); + return False; + } + + *hSAREA = rep.hSAREALow; + if (sizeof(drm_handle_t) == 8) { + int shift = 32; /* var to prevent warning on next line */ + *hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift; + } + + if (rep.length) { + if (!(*busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1))) { + _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("OpenConnection... return False"); + return False; + } + _XReadPad(dpy, *busIdString, rep.busIdStringLength); + } + else { + *busIdString = NULL; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("OpenConnection... return True"); + return True; +} + +PUBLIC Bool +XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIAuthConnectionReq *req; + xXF86DRIAuthConnectionReply rep; + + TRACE("AuthConnection..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIAuthConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIAuthConnection; + req->screen = screen; + req->magic = magic; + rep.authenticated = 0; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return False"); + return False; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return True"); + return True; +} + +PUBLIC Bool +XF86DRICloseConnection(Display * dpy, int screen) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRICloseConnectionReq *req; + + TRACE("CloseConnection..."); + + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRICloseConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRICloseConnection; + req->screen = screen; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CloseConnection... return True"); + return True; +} + +PUBLIC Bool +XF86DRIGetClientDriverName(Display * dpy, int screen, + int *ddxDriverMajorVersion, + int *ddxDriverMinorVersion, + int *ddxDriverPatchVersion, + char **clientDriverName) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIGetClientDriverNameReply rep; + xXF86DRIGetClientDriverNameReq *req; + + TRACE("GetClientDriverName..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIGetClientDriverName, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIGetClientDriverName; + req->screen = screen; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetClientDriverName... return False"); + return False; + } + + *ddxDriverMajorVersion = rep.ddxDriverMajorVersion; + *ddxDriverMinorVersion = rep.ddxDriverMinorVersion; + *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; + + if (rep.length) { + if (! + (*clientDriverName = + (char *) Xcalloc(rep.clientDriverNameLength + 1, 1))) { + _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetClientDriverName... return False"); + return False; + } + _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength); + } + else { + *clientDriverName = NULL; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetClientDriverName... return True"); + return True; +} + +PUBLIC Bool +XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID, + XID * context, drm_context_t * hHWContext) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRICreateContextReply rep; + xXF86DRICreateContextReq *req; + + TRACE("CreateContext..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRICreateContext, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRICreateContext; + req->visual = configID; + req->screen = screen; + *context = XAllocID(dpy); + req->context = *context; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateContext... return False"); + return False; + } + *hHWContext = rep.hHWContext; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateContext... return True"); + return True; +} + +PUBLIC Bool +XF86DRICreateContext(Display * dpy, int screen, Visual * visual, + XID * context, drm_context_t * hHWContext) +{ + return XF86DRICreateContextWithConfig(dpy, screen, visual->visualid, + context, hHWContext); +} + +PUBLIC Bool +XF86DRIDestroyContext(Display * dpy, int screen, XID context) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIDestroyContextReq *req; + + TRACE("DestroyContext..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIDestroyContext, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIDestroyContext; + req->screen = screen; + req->context = context; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("DestroyContext... return True"); + return True; +} + +PUBLIC Bool +XF86DRICreateDrawable(Display * dpy, int screen, + XID drawable, drm_drawable_t * hHWDrawable) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRICreateDrawableReply rep; + xXF86DRICreateDrawableReq *req; + + TRACE("CreateDrawable..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRICreateDrawable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRICreateDrawable; + req->screen = screen; + req->drawable = drawable; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateDrawable... return False"); + return False; + } + *hHWDrawable = rep.hHWDrawable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateDrawable... return True"); + return True; +} + +static int +noopErrorHandler(Display * dpy, XErrorEvent * xerr) +{ + return 0; +} + +PUBLIC Bool +XF86DRIDestroyDrawable(Display * dpy, int screen, XID drawable) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIDestroyDrawableReq *req; + int (*oldXErrorHandler) (Display *, XErrorEvent *); + + TRACE("DestroyDrawable..."); + XF86DRICheckExtension(dpy, info, False); + + /* This is called from the DRI driver, which used call it like this + * + * if (windowExists(drawable)) + * destroyDrawable(drawable); + * + * which is a textbook race condition - the window may disappear + * from the server between checking for its existance and + * destroying it. Instead we change the semantics of + * __DRIinterfaceMethodsRec::destroyDrawable() to succeed even if + * the windows is gone, by wrapping the destroy call in an error + * handler. */ + + XSync(dpy, False); + oldXErrorHandler = XSetErrorHandler(noopErrorHandler); + + LockDisplay(dpy); + GetReq(XF86DRIDestroyDrawable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIDestroyDrawable; + req->screen = screen; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + + XSetErrorHandler(oldXErrorHandler); + + TRACE("DestroyDrawable... return True"); + return True; +} + +PUBLIC Bool +XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, + unsigned int *index, unsigned int *stamp, + int *X, int *Y, int *W, int *H, + int *numClipRects, drm_clip_rect_t ** pClipRects, + int *backX, int *backY, + int *numBackClipRects, + drm_clip_rect_t ** pBackClipRects) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIGetDrawableInfoReply rep; + xXF86DRIGetDrawableInfoReq *req; + int total_rects; + + TRACE("GetDrawableInfo..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIGetDrawableInfo, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIGetDrawableInfo; + req->screen = screen; + req->drawable = drawable; + + if (!_XReply(dpy, (xReply *) & rep, 1, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDrawableInfo... return False"); + return False; + } + *index = rep.drawableTableIndex; + *stamp = rep.drawableTableStamp; + *X = (int) rep.drawableX; + *Y = (int) rep.drawableY; + *W = (int) rep.drawableWidth; + *H = (int) rep.drawableHeight; + *numClipRects = rep.numClipRects; + total_rects = *numClipRects; + + *backX = rep.backX; + *backY = rep.backY; + *numBackClipRects = rep.numBackClipRects; + total_rects += *numBackClipRects; + +#if 0 + /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks + * backwards compatibility (Because of the >> 2 shift) but the fix + * enables multi-threaded apps to work. + */ + if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) - + SIZEOF(xGenericReply) + + total_rects * sizeof(drm_clip_rect_t)) + + 3) & ~3) >> 2)) { + _XEatData(dpy, rep.length); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDrawableInfo... return False"); + return False; + } +#endif + + if (*numClipRects) { + int len = sizeof(drm_clip_rect_t) * (*numClipRects); + + *pClipRects = (drm_clip_rect_t *) Xcalloc(len, 1); + if (*pClipRects) + _XRead(dpy, (char *) *pClipRects, len); + } + else { + *pClipRects = NULL; + } + + if (*numBackClipRects) { + int len = sizeof(drm_clip_rect_t) * (*numBackClipRects); + + *pBackClipRects = (drm_clip_rect_t *) Xcalloc(len, 1); + if (*pBackClipRects) + _XRead(dpy, (char *) *pBackClipRects, len); + } + else { + *pBackClipRects = NULL; + } + + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDrawableInfo... return True"); + return True; +} + +PUBLIC Bool +XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, + int *fbOrigin, int *fbSize, int *fbStride, + int *devPrivateSize, void **pDevPrivate) +{ + XExtDisplayInfo *info = find_display(dpy); + xXF86DRIGetDeviceInfoReply rep; + xXF86DRIGetDeviceInfoReq *req; + + TRACE("GetDeviceInfo..."); + XF86DRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIGetDeviceInfo, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIGetDeviceInfo; + req->screen = screen; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDeviceInfo... return False"); + return False; + } + + *hFrameBuffer = rep.hFrameBufferLow; + if (sizeof(drm_handle_t) == 8) { + int shift = 32; /* var to prevent warning on next line */ + *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; + } + + *fbOrigin = rep.framebufferOrigin; + *fbSize = rep.framebufferSize; + *fbStride = rep.framebufferStride; + *devPrivateSize = rep.devPrivateSize; + + if (rep.length) { + if (!(*pDevPrivate = (void *) Xcalloc(rep.devPrivateSize, 1))) { + _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDeviceInfo... return False"); + return False; + } + _XRead(dpy, (char *) *pDevPrivate, rep.devPrivateSize); + } + else { + *pDevPrivate = NULL; + } + + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDeviceInfo... return True"); + return True; +} + +PUBLIC Bool +XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable) +{ + /* This function and the underlying X protocol are deprecated. + */ + (void) dpy; + (void) screen; + (void) drawable; + return False; +} + +PUBLIC Bool +XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable) +{ + /* This function and the underlying X protocol are deprecated. + */ + (void) dpy; + (void) screen; + (void) drawable; + return True; +} + +#endif /* GLX_DIRECT_RENDERING */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/xf86dri.h xpsb-glx-0.19/mesa/src/glx/x11/xf86dri.h --- xpsb-glx-0.19/mesa/src/glx/x11/xf86dri.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/xf86dri.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,120 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/** + * \file xf86dri.h + * Protocol numbers and function prototypes for DRI X protocol. + * + * \author Kevin E. Martin + * \author Jens Owen + * \author Rickard E. (Rik) Faith + */ + +#ifndef _XF86DRI_H_ +#define _XF86DRI_H_ + +#include +#include + +#define X_XF86DRIQueryVersion 0 +#define X_XF86DRIQueryDirectRenderingCapable 1 +#define X_XF86DRIOpenConnection 2 +#define X_XF86DRICloseConnection 3 +#define X_XF86DRIGetClientDriverName 4 +#define X_XF86DRICreateContext 5 +#define X_XF86DRIDestroyContext 6 +#define X_XF86DRICreateDrawable 7 +#define X_XF86DRIDestroyDrawable 8 +#define X_XF86DRIGetDrawableInfo 9 +#define X_XF86DRIGetDeviceInfo 10 +#define X_XF86DRIAuthConnection 11 +#define X_XF86DRIOpenFullScreen 12 /* Deprecated */ +#define X_XF86DRICloseFullScreen 13 /* Deprecated */ + +#define XF86DRINumberEvents 0 + +#define XF86DRIClientNotLocal 0 +#define XF86DRIOperationNotSupported 1 +#define XF86DRINumberErrors (XF86DRIOperationNotSupported + 1) + +#ifndef _XF86DRI_SERVER_ + +_XFUNCPROTOBEGIN + Bool XF86DRIQueryExtension(Display * dpy, int *event_base, + int *error_base); + +Bool XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, + int *patchVersion); + +Bool XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen, + Bool * isCapable); + +Bool XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, + char **busIDString); + +Bool XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic); + +Bool XF86DRICloseConnection(Display * dpy, int screen); + +Bool XF86DRIGetClientDriverName(Display * dpy, int screen, + int *ddxDriverMajorVersion, + int *ddxDriverMinorVersion, + int *ddxDriverPatchVersion, + char **clientDriverName); + +Bool XF86DRICreateContext(Display * dpy, int screen, Visual * visual, + XID * ptr_to_returned_context_id, + drm_context_t * hHWContext); + +Bool XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID, + XID * ptr_to_returned_context_id, + drm_context_t * hHWContext); + +extern Bool XF86DRIDestroyContext(Display * dpy, int screen, XID context_id); + +extern Bool XF86DRICreateDrawable(Display * dpy, int screen, + XID drawable, drm_drawable_t * hHWDrawable); + +extern Bool XF86DRIDestroyDrawable(Display * dpy, int screen, XID drawable); + +Bool XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, + unsigned int *index, unsigned int *stamp, + int *X, int *Y, int *W, int *H, + int *numClipRects, drm_clip_rect_t ** pClipRects, + int *backX, int *backY, + int *numBackClipRects, + drm_clip_rect_t ** pBackClipRects); + +Bool XF86DRIGetDeviceInfo(Display * dpy, int screen, + drm_handle_t * hFrameBuffer, int *fbOrigin, + int *fbSize, int *fbStride, int *devPrivateSize, + void **pDevPrivate); + +_XFUNCPROTOEND +#endif /* _XF86DRI_SERVER_ */ +#endif /* _XF86DRI_H_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/xf86dristr.h xpsb-glx-0.19/mesa/src/glx/x11/xf86dristr.h --- xpsb-glx-0.19/mesa/src/glx/x11/xf86dristr.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/xf86dristr.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,367 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Fiath + * + */ + +#ifndef _XF86DRISTR_H_ +#define _XF86DRISTR_H_ + +#include "xf86dri.h" + +#define XF86DRINAME "XFree86-DRI" + +/* The DRI version number. This was originally set to be the same of the + * XFree86 version number. However, this version is really indepedent of + * the XFree86 version. + * + * Version History: + * 4.0.0: Original + * 4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02 + * 4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02 + */ +#define XF86DRI_MAJOR_VERSION 4 +#define XF86DRI_MINOR_VERSION 1 +#define XF86DRI_PATCH_VERSION 0 + +typedef struct _XF86DRIQueryVersion +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIQueryVersion */ + CARD16 length B16; +} xXF86DRIQueryVersionReq; +#define sz_xXF86DRIQueryVersionReq 4 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 majorVersion B16; /* major version of DRI protocol */ + CARD16 minorVersion B16; /* minor version of DRI protocol */ + CARD32 patchVersion B32; /* patch version of DRI protocol */ + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86DRIQueryVersionReply; +#define sz_xXF86DRIQueryVersionReply 32 + +typedef struct _XF86DRIQueryDirectRenderingCapable +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */ + CARD16 length B16; + CARD32 screen B32; +} xXF86DRIQueryDirectRenderingCapableReq; +#define sz_xXF86DRIQueryDirectRenderingCapableReq 8 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + BOOL isCapable; + BOOL pad2; + BOOL pad3; + BOOL pad4; + CARD32 pad5 B32; + CARD32 pad6 B32; + CARD32 pad7 B32; + CARD32 pad8 B32; + CARD32 pad9 B32; +} xXF86DRIQueryDirectRenderingCapableReply; +#define sz_xXF86DRIQueryDirectRenderingCapableReply 32 + +typedef struct _XF86DRIOpenConnection +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIOpenConnection */ + CARD16 length B16; + CARD32 screen B32; +} xXF86DRIOpenConnectionReq; +#define sz_xXF86DRIOpenConnectionReq 8 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 hSAREALow B32; + CARD32 hSAREAHigh B32; + CARD32 busIdStringLength B32; + CARD32 pad6 B32; + CARD32 pad7 B32; + CARD32 pad8 B32; +} xXF86DRIOpenConnectionReply; +#define sz_xXF86DRIOpenConnectionReply 32 + +typedef struct _XF86DRIAuthConnection +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICloseConnection */ + CARD16 length B16; + CARD32 screen B32; + CARD32 magic B32; +} xXF86DRIAuthConnectionReq; +#define sz_xXF86DRIAuthConnectionReq 12 + +typedef struct +{ + BYTE type; + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 authenticated B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86DRIAuthConnectionReply; +#define zx_xXF86DRIAuthConnectionReply 32 + +typedef struct _XF86DRICloseConnection +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICloseConnection */ + CARD16 length B16; + CARD32 screen B32; +} xXF86DRICloseConnectionReq; +#define sz_xXF86DRICloseConnectionReq 8 + +typedef struct _XF86DRIGetClientDriverName +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIGetClientDriverName */ + CARD16 length B16; + CARD32 screen B32; +} xXF86DRIGetClientDriverNameReq; +#define sz_xXF86DRIGetClientDriverNameReq 8 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 ddxDriverMajorVersion B32; + CARD32 ddxDriverMinorVersion B32; + CARD32 ddxDriverPatchVersion B32; + CARD32 clientDriverNameLength B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86DRIGetClientDriverNameReply; +#define sz_xXF86DRIGetClientDriverNameReply 32 + +typedef struct _XF86DRICreateContext +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICreateContext */ + CARD16 length B16; + CARD32 screen B32; + CARD32 visual B32; + CARD32 context B32; +} xXF86DRICreateContextReq; +#define sz_xXF86DRICreateContextReq 16 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 hHWContext B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86DRICreateContextReply; +#define sz_xXF86DRICreateContextReply 32 + +typedef struct _XF86DRIDestroyContext +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIDestroyContext */ + CARD16 length B16; + CARD32 screen B32; + CARD32 context B32; +} xXF86DRIDestroyContextReq; +#define sz_xXF86DRIDestroyContextReq 12 + +typedef struct _XF86DRICreateDrawable +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICreateDrawable */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xXF86DRICreateDrawableReq; +#define sz_xXF86DRICreateDrawableReq 12 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 hHWDrawable B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86DRICreateDrawableReply; +#define sz_xXF86DRICreateDrawableReply 32 + +typedef struct _XF86DRIDestroyDrawable +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIDestroyDrawable */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xXF86DRIDestroyDrawableReq; +#define sz_xXF86DRIDestroyDrawableReq 12 + +typedef struct _XF86DRIGetDrawableInfo +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIGetDrawableInfo */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xXF86DRIGetDrawableInfoReq; +#define sz_xXF86DRIGetDrawableInfoReq 12 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 drawableTableIndex B32; + CARD32 drawableTableStamp B32; + INT16 drawableX B16; + INT16 drawableY B16; + INT16 drawableWidth B16; + INT16 drawableHeight B16; + CARD32 numClipRects B32; + INT16 backX B16; + INT16 backY B16; + CARD32 numBackClipRects B32; +} xXF86DRIGetDrawableInfoReply; + +#define sz_xXF86DRIGetDrawableInfoReply 36 + + +typedef struct _XF86DRIGetDeviceInfo +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIGetDeviceInfo */ + CARD16 length B16; + CARD32 screen B32; +} xXF86DRIGetDeviceInfoReq; +#define sz_xXF86DRIGetDeviceInfoReq 8 + +typedef struct +{ + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 hFrameBufferLow B32; + CARD32 hFrameBufferHigh B32; + CARD32 framebufferOrigin B32; + CARD32 framebufferSize B32; + CARD32 framebufferStride B32; + CARD32 devPrivateSize B32; +} xXF86DRIGetDeviceInfoReply; +#define sz_xXF86DRIGetDeviceInfoReply 32 + +typedef struct _XF86DRIOpenFullScreen +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIOpenFullScreen */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xXF86DRIOpenFullScreenReq; +#define sz_xXF86DRIOpenFullScreenReq 12 + +typedef struct +{ + BYTE type; + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 isFullScreen B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86DRIOpenFullScreenReply; +#define sz_xXF86DRIOpenFullScreenReply 32 + +typedef struct _XF86DRICloseFullScreen +{ + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICloseFullScreen */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xXF86DRICloseFullScreenReq; +#define sz_xXF86DRICloseFullScreenReq 12 + +typedef struct +{ + BYTE type; + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; + CARD32 pad7 B32; +} xXF86DRICloseFullScreenReply; +#define sz_xXF86DRICloseFullScreenReply 32 + + +#endif /* _XF86DRISTR_H_ */ diff -Nru xpsb-glx-0.19/mesa/src/glx/x11/xfont.c xpsb-glx-0.19/mesa/src/glx/x11/xfont.c --- xpsb-glx-0.19/mesa/src/glx/x11/xfont.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/glx/x11/xfont.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,377 @@ +/* + * Mesa 3-D graphics library + * Version: 3.1 + * + * Copyright (C) 1999 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 + */ + +/* + This was take from Mesa and modified to work in the real GLX structure. + It provides a fully client side implementation of glXUseXFont and is + called by that routine when direct rendering is enabled. +*/ + +#ifdef GLX_DIRECT_RENDERING + +#include "glxclient.h" + +/* Some debugging info. */ + +#ifdef DEBUG +#undef _R +#undef _G +#undef _B +#include + +int debug_xfonts = 0; + +static void +dump_char_struct(XCharStruct * ch, char *prefix) +{ + printf("%slbearing = %d, rbearing = %d, width = %d\n", + prefix, ch->lbearing, ch->rbearing, ch->width); + printf("%sascent = %d, descent = %d, attributes = %u\n", + prefix, ch->ascent, ch->descent, (unsigned int) ch->attributes); +} + +static void +dump_font_struct(XFontStruct * font) +{ + printf("ascent = %d, descent = %d\n", font->ascent, font->descent); + printf("char_or_byte2 = (%u,%u)\n", + font->min_char_or_byte2, font->max_char_or_byte2); + printf("byte1 = (%u,%u)\n", font->min_byte1, font->max_byte1); + printf("all_chars_exist = %s\n", font->all_chars_exist ? "True" : "False"); + printf("default_char = %c (\\%03o)\n", + (char) (isprint(font->default_char) ? font->default_char : ' '), + font->default_char); + dump_char_struct(&font->min_bounds, "min> "); + dump_char_struct(&font->max_bounds, "max> "); +#if 0 + for (c = font->min_char_or_byte2; c <= font->max_char_or_byte2; c++) { + char prefix[8]; + sprintf(prefix, "%d> ", c); + dump_char_struct(&font->per_char[c], prefix); + } +#endif +} + +static void +dump_bitmap(unsigned int width, unsigned int height, GLubyte * bitmap) +{ + unsigned int x, y; + + printf(" "); + for (x = 0; x < 8 * width; x++) + printf("%o", 7 - (x % 8)); + putchar('\n'); + for (y = 0; y < height; y++) { + printf("%3o:", y); + for (x = 0; x < 8 * width; x++) + putchar((bitmap[width * (height - y - 1) + x / 8] & (1 << (7 - (x % + 8)))) + ? '*' : '.'); + printf(" "); + for (x = 0; x < width; x++) + printf("0x%02x, ", bitmap[width * (height - y - 1) + x]); + putchar('\n'); + } +} +#endif /* DEBUG */ + + +/* 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, int which) +{ + unsigned int rows, pages; + 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); +} + +_X_HIDDEN void +DRI_glXUseXFont(Font font, int first, int count, int listbase) +{ + GLXContext CC; + 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; + + CC = __glXGetCurrentContext(); + dpy = CC->currentDpy; + win = CC->currentDrawable; + + fs = XQueryFont(dpy, font); + if (!fs) { + __glXSetError(CC, GL_INVALID_VALUE); + 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 *) Xmalloc((max_bm_width * max_bm_height) * sizeof(GLubyte)); + if (!bm) { + XFreeFontInfo(NULL, fs, 1); + __glXSetError(CC, GL_OUT_OF_MEMORY); + 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 - 1; + 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(); + } + + Xfree(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); +} + +#endif diff -Nru xpsb-glx-0.19/mesa/src/Makefile xpsb-glx-0.19/mesa/src/Makefile --- xpsb-glx-0.19/mesa/src/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/Makefile 2010-06-24 06:42:04.000000000 +0100 @@ -0,0 +1,40 @@ +# src/Makefile + +TOP = .. + +include $(TOP)/configs/current + +SUBDIRS = $(SRC_DIRS) + + +default: message $(TOP)/$(LIB_DIR) subdirs + + +message: + @echo "Making sources for" $(CONFIG_NAME) + + +subdirs: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1; \ + fi \ + done + +install: $(TOP)/$(LIB_DIR) + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) install) || exit 1 ; \ + fi \ + done + +$(TOP)/$(LIB_DIR): + -@test -d $(TOP)/$(LIB_DIR) || mkdir -p $(TOP)/$(LIB_DIR) + + +clean: + -@for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) clean) ; \ + fi \ + done diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,515 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Author: + * Keith Whitwell + */ + +#include "imports.h" +#include "macros.h" + +#include "tnl/t_context.h" +#include "vf/vf.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#include "clip/clip_pipe.h" +#include "clip/clip_noop.h" + + + +/** + * Called when driver state tracker notices changes to the viewport matrix: + */ +void clip_set_viewport( struct clip_context *clip, + const GLfloat *scale, + const GLfloat *trans ) +{ + assert(!clip->in_vb); + vf_set_vp_scale_translate( clip->hw_vf, scale, trans ); + vf_set_vp_scale_translate( clip->prim_vf, scale, trans ); +} + + +void clip_set_state( struct clip_context *clip, + const struct clip_state *state ) +{ + memcpy( &clip->state, state, sizeof(*state) ); + + /* Need to validate state. + */ + clip->revalidate = 1; +} + + +/** + * Called when driver state tracker notices changes to the hardware + * vertex format: + */ +void clip_set_hw_vertex_format( struct clip_context *clip, + const struct vf_attr_map *attr, + GLuint count, + GLuint vertex_size ) +{ + /* This is not allowed during the processing of a vertex buffer, ie + * vertex format must be constant throughout a whole VB and cannot + * change per-primitive. This implies that the swrast fallback + * code must be able to translate the hardware vertices into swrast + * vertices on the fly. + */ + assert(!clip->in_vb); + + memcpy(clip->hw_attrs, attr, count * sizeof(*attr)); + clip->hw_attr_count = count; + clip->hw_vertex_size = vertex_size; + + vf_set_vertex_attributes( clip->hw_vf, + clip->hw_attrs, + clip->hw_attr_count, + clip->hw_vertex_size ); + + clip->revalidate = 1; +} + + +void clip_set_prim_vertex_format( struct clip_context *clip, + const struct vf_attr_map *attr, + GLuint count, + GLuint vertex_size ) +{ + assert(!clip->in_vb); + + memcpy(clip->prim_attrs, attr, count * sizeof(*attr)); + clip->prim_attr_count = count; + clip->prim_vertex_size = vertex_size; + + vf_set_vertex_attributes( clip->prim_vf, + clip->prim_attrs, + clip->prim_attr_count, + clip->prim_vertex_size ); + + clip->revalidate = 1; +} + + +/** + * Called when the driver state tracker notices a fallback condition + * or other reason to change the renderer. Note that per-primitive + * fallbacks cannot be handled this way - use a multiplexing render + * module instead. + */ +void clip_set_render( struct clip_context *clip, + struct clip_render *hw ) +{ + /* This is not allowed during the processing of a vertex buffer. + */ + assert( !clip->in_vb ); + + /* Install the new one. + */ + clip->hw = hw; + clip->revalidate = 1; +} + +void clip_set_userclip( struct clip_context *clip, + GLfloat (* const ucp)[4], + GLuint nr ) +{ + memcpy(&clip->plane[6], ucp, nr * sizeof(ucp[0])); + clip->nr_planes = 6 + nr; +} + + +static void clip_validate_state( struct clip_context *clip ) +{ + /* Choose between simple and complex (quads vs. prim) pipelines. + */ + clip->prim_pipe_active = clip_pipe_validate_state( clip->prim ); + + if (clip->prim_pipe_active) { + clip_pipe_set_hw_render( clip->prim, clip->hw ); + + clip->vb.render = clip->prim; + clip->vb.attrs = clip->prim_attrs; + clip->vb.attr_count = clip->prim_attr_count; + clip->vb.vertex_size = clip->prim_vertex_size; + clip->vb.vf = clip->prim_vf; + } + else { + clip_noop_set_hw_render( clip->noop, clip->hw ); + + clip->vb.render = clip->noop; + clip->vb.attrs = clip->hw_attrs; + clip->vb.attr_count = clip->hw_attr_count; + clip->vb.vertex_size = clip->hw_vertex_size; + clip->vb.vf = clip->hw_vf; + } + + clip->vb.render->set_prim( clip->vb.render, + clip->vb.render_prim ); + + clip->revalidate = 0; +} + + +struct vertex_fetch *clip_get_hw_vf( struct clip_context *clip ) +{ + return clip->hw_vf; +} + + +struct clip_context *clip_create( const struct clip_callbacks *callbacks ) +{ + struct clip_context *clip = CALLOC_STRUCT(clip_context); + + memcpy( &clip->callbacks, callbacks, sizeof(*callbacks) ); + + clip->prim = clip_create_prim_render( clip ); + clip->noop = clip_create_noop_render( clip ); + + clip->hw_vf = vf_create( GL_TRUE ); + clip->prim_vf = vf_create( GL_TRUE ); + + ASSIGN_4V( clip->plane[0], -1, 0, 0, 1 ); + ASSIGN_4V( clip->plane[1], 1, 0, 0, 1 ); + ASSIGN_4V( clip->plane[2], 0, -1, 0, 1 ); + ASSIGN_4V( clip->plane[3], 0, 1, 0, 1 ); + ASSIGN_4V( clip->plane[4], 0, 0, 1, 1 ); /* yes these are correct */ + ASSIGN_4V( clip->plane[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */ + clip->nr_planes = 6; + + clip->revalidate = 1; + + return clip; +} + + +void clip_destroy( struct clip_context *clip ) +{ + if (clip->header.storage) + ALIGN_FREE( clip->header.storage ); + + clip->prim->destroy( clip->prim ); + clip->noop->destroy( clip->noop ); + + vf_destroy( clip->hw_vf ); + vf_destroy( clip->prim_vf ); + + FREE( clip ); +} + + +static const GLenum reduced_prim[GL_POLYGON+1] = { + GL_POINTS, + GL_LINES, + GL_LINES, + GL_LINES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES +}; + + +static void +build_vertex_headers( struct clip_context *clip, + struct vertex_buffer *VB ) +{ + if (clip->header.storage == NULL) { + clip->header.stride = sizeof(GLfloat); + clip->header.size = 1; + clip->header.storage = ALIGN_MALLOC( VB->Size * sizeof(GLfloat), 32 ); + clip->header.data = clip->header.storage; + clip->header.count = 0; + clip->header.flags = VEC_SIZE_1 | VEC_MALLOC; + } + + /* Build vertex header attribute. + */ + { + GLuint i; + struct vertex_header *header = (struct vertex_header *)clip->header.storage; + + /* yes its a hack + */ + assert(sizeof(*header) == sizeof(GLfloat)); + + clip->header.count = VB->Count; + + if (clip->state.fill_cw != FILL_TRI || + clip->state.fill_ccw != FILL_TRI) { + for (i = 0; i < VB->Count; i++) { + header[i].clipmask = VB->ClipMask[i]; + header[i].edgeflag = VB->EdgeFlag[i]; + header[i].pad = 0; + header[i].index = 0xffff; + } + } + else if (VB->ClipOrMask) { + for (i = 0; i < VB->Count; i++) { + header[i].clipmask = VB->ClipMask[i]; + header[i].edgeflag = 0; + header[i].pad = 0; + header[i].index = 0xffff; + } + } + else { + for (i = 0; i < VB->Count; i++) { + header[i].clipmask = 0; + header[i].edgeflag = 0; + header[i].pad = 0; + header[i].index = 0xffff; + } + } + } + + VB->AttribPtr[VF_ATTRIB_VERTEX_HEADER] = &clip->header; +} + +static void +update_vb_state( struct clip_context *clip, + struct vertex_buffer *VB, GLbitfield prims ) +{ + struct clip_vb_state vb_state; + + vb_state.clipped_prims = (VB->ClipOrMask != 0); + vb_state.pad = 0; + vb_state.active_prims = prims; + + if (memcmp(&vb_state, &clip->vb_state, sizeof(vb_state)) != 0) { + clip->vb_state = vb_state; + + /* Tell driver about change in clipping needs */ + clip->callbacks.set_vb_state( clip->callbacks.driver, + &vb_state ); + + clip_pipe_invalidate( clip->prim ); + } +} + + +GLuint clip_prim_info(GLenum mode, GLuint *first, GLuint *incr) +{ + switch (mode) { + case GL_POINTS: + *first = 1; + *incr = 1; + return 0; + case GL_LINES: + *first = 2; + *incr = 2; + return 0; + case GL_LINE_STRIP: + *first = 2; + *incr = 1; + return 0; + case GL_LINE_LOOP: + *first = 2; + *incr = 1; + return 1; + case GL_TRIANGLES: + *first = 3; + *incr = 3; + return 0; + case GL_TRIANGLE_STRIP: + *first = 3; + *incr = 1; + return 0; + case GL_TRIANGLE_FAN: + case GL_POLYGON: + *first = 3; + *incr = 1; + return 1; + case GL_QUADS: + *first = 4; + *incr = 4; + return 0; + case GL_QUAD_STRIP: + *first = 4; + *incr = 2; + return 0; + default: + assert(0); + *first = 1; + *incr = 1; + return 0; + } +} + + +static GLuint trim( GLuint count, GLuint first, GLuint incr ) +{ + if (count < first) + return 0; + else + return count - (count - first) % incr; +} + + +/** + * Called to learn what types of prims (points, lines, tris) are present + * in the current VB. + * If glPolygonMode is set to points or line mode, we'll set bits for + * points/lines too. + * Note that this _must_ be called after the clip state has been updated. + */ +GLbitfield clip_get_active_prims(struct clip_context *clip) +{ + GLbitfield active_prims = clip->vb_prims; + + if (active_prims & (1 << GL_TRIANGLES)) { + active_prims &= ~(1 << GL_TRIANGLES); + + switch (clip->state.fill_cw) { + case FILL_TRI: + active_prims |= (1 << GL_TRIANGLES); + break; + case FILL_LINE: + active_prims |= (1 << GL_LINES); + break; + case FILL_POINT: + active_prims |= (1 << GL_POINTS); + break; + } + + switch (clip->state.fill_ccw) { + case FILL_TRI: + active_prims |= (1 << GL_TRIANGLES); + break; + case FILL_LINE: + active_prims |= (1 << GL_LINES); + break; + case FILL_POINT: + active_prims |= (1 << GL_POINTS); + break; + } + } + + return active_prims; +} + + +/** + * Render the given VB. + */ +void clip_vb(struct clip_context *clip, + struct vertex_buffer *VB ) +{ + GLuint i; + GLbitfield prims = 0x0; + + /* Determine what primitives are in the VB (triangles, points, lines?). + * This info is needed during state validation, below. + * Note that glPolygonMode is not considered at this point. + */ + for (i = 0; i < VB->PrimitiveCount; i++) + prims |= 1 << reduced_prim[VB->Primitive[i].mode]; + + if (prims != clip->vb_prims) { + clip->vb_prims = prims; + clip_pipe_invalidate( clip->prim ); + } + + /* if any clipping, tell the driver */ + update_vb_state( clip, VB, prims ); + + clip->callbacks.validate_state( clip->callbacks.driver ); + + /* Validate our render pipeline: + */ + if (clip->revalidate) + clip_validate_state( clip ); + + /* Maybe build vertex headers: + */ + if (clip->prim_pipe_active) { + VB->AttribPtr[VF_ATTRIB_BFC0] = VB->ColorPtr[1]; + VB->AttribPtr[VF_ATTRIB_BFC1] = VB->SecondaryColorPtr[1]; + VB->AttribPtr[VF_ATTRIB_CLIP_POS] = VB->ClipPtr; + + build_vertex_headers( clip, VB ); + } + + clip->in_vb = 1; + + /* Allocate the vertices: + */ + clip->vb.verts = clip->vb.render->allocate_vertices( clip->vb.render, + clip->vb.vertex_size, + VB->Count ); + + /* Bind the vb outputs: + */ + vf_set_sources( clip->vb.vf, VB->AttribPtr, 0 ); + + /* Build the hardware or prim-pipe vertices: + */ + vf_emit_vertices( clip->vb.vf, + VB->Count, + clip->vb.verts ); + + for (i = 0; i < VB->PrimitiveCount; i++) { + GLenum mode = VB->Primitive[i].mode; + GLuint start = VB->Primitive[i].start; + GLuint length, first, incr; + + /* Trim the primitive down to a legal size. + */ + clip_prim_info( mode, &first, &incr ); + length = trim( VB->Primitive[i].count, first, incr ); + + if (!length) + continue; + + if (clip->vb.render_prim != mode) { + clip->vb.render_prim = mode; + clip->vb.render->set_prim( clip->vb.render, mode ); + } + + if (VB->Elts) { + clip->vb.render->draw_indexed_prim( clip->vb.render, + VB->Elts + start, + length ); + } + else { + clip->vb.render->draw_prim( clip->vb.render, + start, + length ); + } + } + + clip->vb.render->release_vertices( clip->vb.render, + clip->vb.verts, + clip->vb.vertex_size, + VB->Count ); + clip->vb.verts = NULL; + clip->in_vb = 0; + clip->vb_prims = 0x0; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.h xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.h --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_context.h 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,299 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef CLIP_CONTEXT_H +#define CLIP_CONTEXT_H + +#include "main/mtypes.h" +#include "vf/vf.h" + +struct vertex_buffer; + + +struct clip_vb_state { + GLuint clipped_prims:1; + GLuint pad:15; + GLuint active_prims:16; +}; + +struct clip_render { + + const char *name; + + struct { + GLuint max_indices; + } limits; + + + /* Initialize state for the frame. EG. emit dma to wait for + * pending flips. + */ + void (*start_render)( struct clip_render *, + GLboolean start_of_frame ); + + + /* Request a destination for incoming vertices in the format above. + * Hardware renderers will use ttm memory, others will just malloc + * something. Vertices will be built by some external facility + * (draw itself, or the prim pipe). + */ + void *(*allocate_vertices)( struct clip_render *, + GLuint vertex_size, + GLuint nr_vertices ); + + /* Notify the renderer of the current primitive when it changes: + */ + void (*set_prim)( struct clip_render *, GLuint prim ); + + /* Driver state passed as a void pointer. + */ + void (*emit_state)( struct clip_render *render, + const void *driver_state ); + + /* DrawArrays: + */ + void (*draw_prim)( struct clip_render *, + GLuint start, + GLuint nr ); + + /* DrawElements: + */ + void (*draw_indexed_prim)( struct clip_render *, + const GLuint *indices, + GLuint nr ); + + + /* Special primitive: + */ + void (*clear_rect)( struct clip_render *, + GLuint mask, + GLuint x1, GLuint y1, + GLuint x2, GLuint y2 ); + + /* Hardware drivers will flush/unmap the ttm: + */ + void (*release_vertices)( struct clip_render *, + void *vertices, + GLuint vertex_size, + GLuint vertices_used ); + + + + /* Execute glFlush(), flag to state whether this is the end of the + * frame or not, to help choose renderers. + */ + void (*flush)( struct clip_render *, + GLboolean finished_frame ); + + void (*destroy)( struct clip_render * ); +}; + + +struct clip_callbacks { + /* This is opaque to the draw code: + */ + void *driver; + + /* Called when the primitives or clipping mode of the vb changes. + * Driver may want to set a new hardware renderer. + */ + void (*set_vb_state)( void *driver, + const struct clip_vb_state *vb_state ); + + + /* Ask driver to validate state at the head of a vb. May result in + * calls back into draw to set hw renderer, viewport, etc. + */ + void (*validate_state)( void *driver ); +}; + + +#define WINDING_NONE 0 +#define WINDING_CW 1 +#define WINDING_CCW 2 +#define WINDING_BOTH (WINDING_CW | WINDING_CCW) + +#define FILL_POINT 1 +#define FILL_LINE 2 +#define FILL_TRI 3 + +/* A struct containing all the GL state the drawing engine cares + * about. The driver state tracker does the job of monitoring gl or + * metaops state and notifying the drawing engine whenever necessary + * to keep it uptodate. + */ +struct clip_state { + /* GL state + */ + GLuint flatshade:1; + GLuint light_twoside:1; + + GLuint front_winding:2; + + GLuint cull_mode:2; + + GLuint fill_cw:2; + GLuint fill_ccw:2; + + GLuint offset_cw:1; + GLuint offset_ccw:1; + GLuint use_vertex_pointsize:1; + GLuint point_sprite:8; /* gen texcoords for points/sprites, per unit */ + GLuint point_sprite_invert:1; + GLuint force_prim_pipe:1; + + GLuint line_passthrough:1; /* don't convert to quads */ + GLuint line_stipple_factor:8; /* add one for GL value */ + GLuint line_stipple_pattern:16; + + GLfloat offset_slope; + GLfloat offset_global; + + GLfloat line_width; + GLfloat point_size; + GLfloat point_size_min, point_size_max; /* post-attenutation limits */ +}; + + +struct clip_context *clip_create( const struct clip_callbacks *callbacks ); + +void clip_destroy( struct clip_context * ); + +void clip_set_viewport( struct clip_context *draw, + const GLfloat *scale, + const GLfloat *trans ); + +void clip_set_state( struct clip_context *draw, + const struct clip_state *state ); + + +void clip_set_userclip( struct clip_context *draw, + GLfloat (* const ucp)[4], + GLuint nr ); + +void clip_set_hw_vertex_format( struct clip_context *draw, + const struct vf_attr_map *attr, + GLuint count, + GLuint vertex_size ); + + +void clip_set_prim_vertex_format( struct clip_context *draw, + const struct vf_attr_map *attr, + GLuint count, + GLuint vertex_size ); + +void clip_set_render( struct clip_context *draw, + struct clip_render *render ); + + +struct vertex_fetch *clip_get_hw_vf( struct clip_context *draw ); + +void clip_vb(struct clip_context *draw, struct vertex_buffer *VB ); + + +GLuint clip_prim_info(GLenum mode, GLuint *first, GLuint *incr); + +GLbitfield clip_get_active_prims(struct clip_context *clip); + + +/*********************************************************************** + * Private structs and functions: + */ +#ifdef CLIP_PRIVATE + +struct clip_context { + struct clip_callbacks callbacks; + + /* The most recent drawing state as set by the driver: + */ + struct clip_state state; + + /* Primitive/VB state that we send to the driver (and to the prim + * pipeline). + */ + struct clip_vb_state vb_state; + GLbitfield vb_prims; /* mask of 1 << {GL_POINTS, GL_LINES, GL_TRIANGLES} */ + + GLfloat plane[12][4]; + GLuint nr_planes; + + + /* The hardware backend (or swrast) + */ + struct clip_render *hw; + struct vf_attr_map hw_attrs[VF_ATTRIB_MAX]; + GLuint hw_attr_count; + GLuint hw_vertex_size; + struct vertex_fetch *hw_vf; + + /* Helper for hardware (when prim pipe not active). + */ + struct clip_render *noop; + + + /* The software clipper/setup engine. Feeds primitives into the + * above as necessary: + */ + struct clip_render *prim; + struct vf_attr_map prim_attrs[VF_ATTRIB_MAX]; + GLuint prim_attr_count; + GLuint prim_vertex_size; + GLboolean prim_pipe_active; + struct vertex_fetch *prim_vf; + + + struct { + /* The active renderer - either noop or pipe, depending on gl + * state and clipped prims. + */ + struct clip_render *render; + GLenum render_prim; + + /* The active vf and the attributes installed in vf: + */ + struct vertex_fetch *vf; + struct vf_attr_map *attrs; + GLuint attr_count; + GLuint vertex_size; + + /* Destination for vertices, allocated by render: + */ + GLubyte *verts; + } vb; + + /* State + */ + GLboolean in_vb; + GLboolean revalidate; + + /* Helper for tnl: + */ + GLvector4f header; +}; + +#endif +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,353 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + /* + * Authors: + * Keith Whitwell + */ + +#include "imports.h" +#include "macros.h" +#include "clip/clip_noop.h" +#include "clip/clip_context.h" + +/* This is an optimized version of the clipping pipe when no + * operations are active. It does however actually do a couple of + * things: + * - translate away QUADS, QUADSTRIP and LINELOOP prims + * - split up excessively long indexed prims. + */ +struct noop_render { + struct clip_render render; + struct clip_render *hw; + GLenum gl_prim; +}; + +static INLINE struct noop_render *noop_render( struct clip_render *render ) +{ + return (struct noop_render *)render; +} + + + +static void *noop_allocate_vertices( struct clip_render *render, + GLuint vertex_size, + GLuint nr_vertices ) +{ + struct noop_render *noop = noop_render( render ); + return noop->hw->allocate_vertices( noop->hw, vertex_size, nr_vertices ); +} + + + +static void noop_set_prim( struct clip_render *render, + GLenum mode ) +{ + struct noop_render *noop = noop_render( render ); + +// _mesa_printf("%s: %d\n", __FUNCTION__, mode); + + noop->gl_prim = mode; + + switch (mode) { + case GL_LINE_LOOP: + noop->hw->set_prim( noop->hw, GL_LINE_STRIP ); + break; + case GL_QUADS: + case GL_QUAD_STRIP: + noop->hw->set_prim( noop->hw, GL_TRIANGLES ); + break; + default: + noop->hw->set_prim( noop->hw, mode ); + break; + } +} + + + + +static void noop_draw_indexed_prim( struct clip_render *render, + const GLuint *indices, + GLuint length ) +{ + struct noop_render *noop = noop_render( render ); + + switch (noop->gl_prim) { + case GL_LINE_LOOP: { + if (length > 10) { + GLuint tmp_indices[2] = { indices[length-1], + indices[0] }; + + noop->hw->draw_indexed_prim( noop->hw, + indices, + length ); + + noop->hw->draw_indexed_prim( noop->hw, + tmp_indices, + 2 ); + } + else { + /* Quick path for small prims + */ + GLuint tmp[11]; + + memcpy(tmp, indices, length * sizeof(GLuint)); + tmp[length] = 0; + + noop->hw->draw_indexed_prim( noop->hw, + tmp, + length+1 ); + } + break; + } + + + case GL_QUAD_STRIP: + { + GLuint *tmp = _mesa_malloc( sizeof(int) * (length / 2 * 6) ); + GLuint i, j; + + for (j = i = 0; i + 3 < length; i += 2, j += 6) { + tmp[j+0] = indices[i+0]; + tmp[j+1] = indices[i+1]; + tmp[j+2] = indices[i+3]; + + tmp[j+3] = indices[i+2]; + tmp[j+4] = indices[i+0]; + tmp[j+5] = indices[i+3]; + } + + noop->hw->draw_indexed_prim( noop->hw, tmp, j ); + _mesa_free(tmp); + } + break; + + case GL_QUADS: { + GLuint *tmp = _mesa_malloc( sizeof(int) * (length / 4 * 6) ); + GLuint i, j; + + for (j = i = 0; i + 3 < length; i += 4, j += 6) { + tmp[j+0] = indices[i+0]; + tmp[j+1] = indices[i+1]; + tmp[j+2] = indices[i+3]; + + tmp[j+3] = indices[i+1]; + tmp[j+4] = indices[i+2]; + tmp[j+5] = indices[i+3]; + } + + noop->hw->draw_indexed_prim( noop->hw, tmp, j ); + _mesa_free(tmp); + break; + } + + default: + noop->hw->draw_indexed_prim( noop->hw, + indices, + length ); + break; + } +} + + +static GLuint trim( GLuint count, GLuint first, GLuint incr ) +{ + return count - (count - first) % incr; +} + + +static void noop_split_indexed_prim( struct clip_render *render, + const GLuint *indices, + GLuint count ) +{ + struct noop_render *noop = noop_render( render ); + + if (count < noop->hw->limits.max_indices) + { + noop_draw_indexed_prim( render, indices, count ); + } + else + { + GLuint first, incr; + GLuint fan_verts = clip_prim_info(noop->gl_prim, &first, &incr); + GLuint replay = first - incr; + GLuint max_step = noop->hw->limits.max_indices - (fan_verts + replay); + GLuint start; + + for (start = 0 ; start < count ; ) { + GLuint remaining = count - start; + GLuint step = trim( MIN2( max_step, remaining ), first, incr ); + +/* outprim->begin = (j == 0 && prim->begin); */ +/* outprim->end = (step == remaining && prim->end); */ + + if (start && fan_verts) { + GLuint *tmp = malloc( (fan_verts + step) * sizeof(GLuint) ); + GLuint i; + + for (i = 0; i < fan_verts; i++) + tmp[i] = indices[i]; + + for (i = 0 ; i < step ; i++) + tmp[i+fan_verts] = indices[start+i]; + + noop_draw_indexed_prim( render, tmp, fan_verts + step ); + + free(tmp); + } + else { + noop_draw_indexed_prim( render, indices + start, step ); + } + + start += step; + + /* Do we need to replay some verts? + */ + if (start < count) + start -= replay; + } + } +} + + + +static void noop_draw_prim( struct clip_render *render, + GLuint start, + GLuint length ) +{ + struct noop_render *noop = noop_render( render ); + +// _mesa_printf("%s (%s) %d/%d\n", __FUNCTION__, +// _mesa_lookup_enum_by_nr(noop->gl_prim), +// start, length ); + + switch (noop->gl_prim) { + + /* Lineloop just doesn't work as a concept. Should get + * translated away by the vbo module and never disgrace the rest + * of the driver with its presence. Am assuming here that we + * get a full primitive with begin and end vertices, otherwise + * there will be glitches. Fix them in the vbo module!!! + */ + case GL_LINE_LOOP: { + GLuint indices[2] = { start + length - 1, start }; + + noop->hw->draw_prim( noop->hw, start, length ); + noop->hw->draw_indexed_prim( noop->hw, indices, 2 ); + break; + } + + + case GL_QUAD_STRIP: + { + GLuint *tmp = _mesa_malloc( sizeof(GLuint) * (length / 2 * 6) ); + GLuint i,j; + + for (j = i = 0; i + 3 < length; i += 2, j += 6) { + tmp[j+0] = start+i+0; + tmp[j+1] = start+i+1; + tmp[j+2] = start+i+3; + + tmp[j+3] = start+i+2; + tmp[j+4] = start+i+0; + tmp[j+5] = start+i+3; + } + + noop->hw->draw_indexed_prim( noop->hw, tmp, j ); + _mesa_free(tmp); + } + break; + + case GL_QUADS: { + GLuint *tmp = _mesa_malloc( sizeof(int) * (length / 4 * 6) ); + GLuint i,j; + + for (j = i = 0; i + 3 < length; i += 4, j += 6) { + tmp[j+0] = start+i+0; + tmp[j+1] = start+i+1; + tmp[j+2] = start+i+3; + + tmp[j+3] = start+i+1; + tmp[j+4] = start+i+2; + tmp[j+5] = start+i+3; + } + + noop->hw->draw_indexed_prim( noop->hw, tmp, j ); + _mesa_free(tmp); + break; + } + + default: + noop->hw->draw_prim( noop->hw, start, length ); + break; + } +} + + +static void noop_release_vertices( struct clip_render *render, + void *hw_verts, + GLuint vertex_size, + GLuint nr_vertices ) +{ + struct noop_render *noop = noop_render( render ); + noop->hw->release_vertices( noop->hw, hw_verts, vertex_size, nr_vertices ); +} + + +static void noop_destroy_context( struct clip_render *render ) +{ + struct noop_render *noop = noop_render( render ); +// _mesa_printf("%s\n", __FUNCTION__); + + _mesa_free(noop); +} + +struct clip_render *clip_create_noop_render( struct clip_context *draw ) +{ + struct noop_render *noop = CALLOC_STRUCT(noop_render); + + noop->render.destroy = noop_destroy_context; + noop->render.start_render = NULL; + noop->render.allocate_vertices = noop_allocate_vertices; + noop->render.set_prim = noop_set_prim; + noop->render.draw_prim = noop_draw_prim; + noop->render.draw_indexed_prim = noop_split_indexed_prim; + noop->render.release_vertices = noop_release_vertices; + noop->render.flush = NULL; + noop->gl_prim = GL_POINTS; + return &noop->render; +} + +/* Or, could just peer into the draw struct and update these values on + * allocate vertices. + */ +void clip_noop_set_hw_render( struct clip_render *render, + struct clip_render *hw ) +{ + struct noop_render *noop = noop_render( render ); + noop->hw = hw; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.h xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.h --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_noop.h 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,39 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef CLIP_NOOP_H +#define CLIP_NOOP_H + +struct clip_render; +struct clip_context; + +struct clip_render *clip_create_noop_render( struct clip_context *draw ); + +void clip_noop_set_hw_render( struct clip_render *noop_render, + struct clip_render *hw ); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,643 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + /* + * Authors: + * Keith Whitwell + */ + +#include "imports.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + +static INLINE struct clip_pipeline *clip_pipeline( struct clip_render *render ) +{ + return (struct clip_pipeline *)render; +} + + +static struct vertex_header *get_vertex( struct clip_pipeline *pipe, + GLuint i ) +{ + return (struct vertex_header *)(pipe->verts + i * pipe->vertex_size); +} + +static struct vertex_header *get_indexed_vertex( struct clip_pipeline *pipe, + GLuint i ) +{ + return (struct vertex_header *)(pipe->verts + pipe->elts[i] * pipe->vertex_size); +} + + + +static void *pipe_allocate_vertices( struct clip_render *render, + GLuint vertex_size, + GLuint nr_vertices ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + pipe->vertex_size = vertex_size; + pipe->nr_vertices = nr_vertices; + pipe->verts = MALLOC( nr_vertices * pipe->vertex_size ); + + assert(pipe->need_validate == 0); + + pipe->first->begin( pipe->first ); + + return pipe->verts; +} + +static void pipe_set_prim( struct clip_render *render, + GLenum prim ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + + pipe->prim = prim; +} + + +static const GLuint pipe_prim[GL_POLYGON+1] = { + PRIM_POINT, + PRIM_LINE, + PRIM_LINE, + PRIM_LINE, + PRIM_TRI, + PRIM_TRI, + PRIM_TRI, + PRIM_TRI, + PRIM_TRI, + PRIM_TRI +}; + + + + + + +static void do_point( struct clip_pipeline *draw, + unsigned i0 ) +{ + struct prim_header prim; + + prim.reset_line_stipple = 1; + prim.edgeflags = 1; + prim.pad = 0; + prim.v[0] = draw->get_vertex( draw, i0 ); + draw->first->point( draw->first, &prim ); +} + + +static void do_line( struct clip_pipeline *draw, + GLboolean reset_stipple, + unsigned i0, + unsigned i1 ) +{ + struct prim_header prim; + + prim.reset_line_stipple = reset_stipple; + prim.edgeflags = 1; + prim.pad = 0; + prim.v[0] = draw->get_vertex( draw, i0 ); + prim.v[1] = draw->get_vertex( draw, i1 ); + draw->first->line( draw->first, &prim ); +} + +static void do_triangle( struct clip_pipeline *draw, + unsigned i0, + unsigned i1, + unsigned i2 ) +{ + struct prim_header prim; + + prim.reset_line_stipple = 1; + prim.edgeflags = ~0; + prim.pad = 0; + prim.v[0] = draw->get_vertex( draw, i0 ); + prim.v[1] = draw->get_vertex( draw, i1 ); + prim.v[2] = draw->get_vertex( draw, i2 ); + draw->first->tri( draw->first, &prim ); +} + + +/* A hack -- looks like prim.edgeflags wasn't a good idea, will have + * to remove. + */ +static void apply_ef( struct prim_header *prim, + unsigned mask ) +{ + prim->edgeflags = mask; + prim->v[0]->edgeflag = (mask >> 0) & 1; + prim->v[1]->edgeflag = (mask >> 1) & 1; + prim->v[2]->edgeflag = (mask >> 2) & 1; +} + +static void do_ef_triangle( struct clip_pipeline *draw, + GLboolean reset_stipple, + unsigned ef_mask, + unsigned i0, + unsigned i1, + unsigned i2 ) +{ + struct prim_header prim; + struct vertex_header *v0 = draw->get_vertex( draw, i0 ); + struct vertex_header *v1 = draw->get_vertex( draw, i1 ); + struct vertex_header *v2 = draw->get_vertex( draw, i2 ); + unsigned tmp; + + prim.reset_line_stipple = reset_stipple; + + /* Hmm -- this won't work because in the clipper we just go back to + * the vertex edgeflags... Edgeflags in the prim header aren't so + * useful afterall. + */ + + tmp = ((v0->edgeflag << 0) | + (v1->edgeflag << 1) | + (v2->edgeflag << 2)); + + + + prim.pad = 0; + prim.v[0] = v0; + prim.v[1] = v1; + prim.v[2] = v2; + + /* Also update the edgeflags in the vertices. + */ + apply_ef( &prim, ef_mask & tmp); + draw->first->tri( draw->first, &prim ); + apply_ef( &prim, tmp); +} + + +static void do_quad( struct clip_pipeline *draw, + unsigned v0, + unsigned v1, + unsigned v2, + unsigned v3 ) +{ +#if 1 + const unsigned omitEdge2 = ~(1 << 1); + const unsigned omitEdge3 = ~(1 << 2); + do_ef_triangle( draw, 1, omitEdge2, v0, v1, v3 ); + do_ef_triangle( draw, 0, omitEdge3, v1, v2, v3 ); +#else + /* This works for unfilled+stipple, but breaks flatshading... + */ + const unsigned omitEdge1 = ~(1 << 0); + const unsigned omitEdge3 = ~(1 << 2); + do_ef_triangle( draw, 1, omitEdge3, v0, v1, v2 ); + do_ef_triangle( draw, 0, omitEdge1, v0, v2, v3 ); +#endif +} + + + + +/** + * Main entrypoint to draw some number of points/lines/triangles + */ +static void +draw_prim( struct clip_pipeline *draw, unsigned start, unsigned count ) +{ + unsigned i; + +// _mesa_printf("%s (%d) %d/%d\n", __FUNCTION__, draw->prim, start, count ); + + switch (draw->prim) { + case GL_POINTS: + for (i = 0; i < count; i ++) { + do_point( draw, + start + i ); + } + break; + + case GL_LINES: + for (i = 0; i+1 < count; i += 2) { + do_line( draw, + GL_TRUE, + start + i + 0, + start + i + 1); + } + break; + + case GL_LINE_LOOP: + if (count >= 2) { + for (i = 1; i < count; i++) { + do_line( draw, + i == 1, /* XXX: only if vb not split */ + start + i - 1, + start + i ); + } + + do_line( draw, + 0, + start + count - 1, + start + 0 ); + } + break; + + case GL_LINE_STRIP: + if (count >= 2) { + for (i = 1; i < count; i++) { + do_line( draw, + i == 1, + start + i - 1, + start + i ); + } + } + break; + + case GL_TRIANGLES: + for (i = 0; i+2 < count; i += 3) { + do_ef_triangle( draw, + 1, + ~0, + start + i + 0, + start + i + 1, + start + i + 2 ); + } + break; + + case GL_TRIANGLE_STRIP: + for (i = 0; i+2 < count; i++) { + if (i & 1) { + do_triangle( draw, + start + i + 1, + start + i + 0, + start + i + 2 ); + } + else { + do_triangle( draw, + start + i + 0, + start + i + 1, + start + i + 2 ); + } + } + break; + + case GL_TRIANGLE_FAN: + if (count >= 3) { + for (i = 0; i+2 < count; i++) { + do_triangle( draw, + start + 0, + start + i + 1, + start + i + 2 ); + } + } + break; + + + case GL_QUADS: + for (i = 0; i+3 < count; i += 4) { + do_quad( draw, + start + i + 0, + start + i + 1, + start + i + 2, + start + i + 3); + } + break; + + case GL_QUAD_STRIP: + for (i = 0; i+3 < count; i += 2) { + do_quad( draw, + start + i + 2, + start + i + 0, + start + i + 1, + start + i + 3); + } + break; + + case GL_POLYGON: + if (count >= 3) { + unsigned ef_mask = (1<<2) | (1<<0); + + for (i = 0; i+2 < count; i++) { + + if (i + 3 >= count) + ef_mask |= (1<<1); + + do_ef_triangle( draw, + i == 0, + ef_mask, + start + i + 1, + start + i + 2, + start + 0); + + ef_mask &= ~(1<<2); + } + } + break; + + default: + assert(0); + break; + } +} + + + + +static void pipe_draw_indexed_prim( struct clip_render *render, + const GLuint *elts, + GLuint count ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + pipe->get_vertex = get_indexed_vertex; + pipe->elts = elts; + + draw_prim( pipe, 0, count ); +} + +static void pipe_draw_prim( struct clip_render *render, + GLuint start, + GLuint count ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + pipe->get_vertex = get_vertex; + pipe->elts = NULL; + + draw_prim( pipe, start, count ); +} + + +static void pipe_release_vertices( struct clip_render *render, + void *vertices, + GLuint vertex_size, + GLuint vertices_used ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + pipe->first->end( pipe->first ); + + FREE(pipe->verts); + pipe->verts = NULL; +} + +static void pipe_destroy( struct clip_render *render ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); +// _mesa_printf("%s\n", __FUNCTION__); + + _mesa_free(pipe); +} + +struct clip_render *clip_create_prim_render( struct clip_context *draw ) +{ + struct clip_pipeline *pipe = CALLOC_STRUCT(clip_pipeline); + + /* XXX: Add casts here to avoid the compiler messages: + */ + pipe->render.start_render = NULL; + pipe->render.allocate_vertices = pipe_allocate_vertices; + pipe->render.set_prim = pipe_set_prim; + pipe->render.draw_prim = pipe_draw_prim; + pipe->render.draw_indexed_prim = pipe_draw_indexed_prim; + pipe->render.release_vertices = pipe_release_vertices; + pipe->render.flush = NULL; + pipe->render.destroy = pipe_destroy; + + pipe->clip = draw; + pipe->prim = 0; + + pipe->emit = clip_pipe_emit( pipe ); + pipe->unfilled = clip_pipe_unfilled( pipe ); + pipe->twoside = clip_pipe_twoside( pipe ); + pipe->offset = clip_pipe_offset( pipe ); + pipe->clipper = clip_pipe_clip( pipe ); + pipe->flatshade = clip_pipe_flatshade( pipe ); + pipe->cull = clip_pipe_cull( pipe ); + pipe->wide = clip_pipe_wide( pipe ); + pipe->stipple = clip_pipe_stipple( pipe ); + + return &pipe->render; +} + + + +GLboolean clip_pipe_validate_state( struct clip_render *render ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + /* Dependent on driver state and primitive: + */ + struct clip_pipe_stage *next = pipe->emit; + GLboolean install = GL_FALSE; + GLboolean need_flat = GL_FALSE; + const GLbitfield active_prims = clip_get_active_prims(pipe->clip); + + pipe->need_validate = 0; + + if (pipe->clip->state.force_prim_pipe) + install = GL_TRUE; + + /* Some primitive state needs to be revalidated according to new + * unfilled modes. + */ + pipe_set_prim( &pipe->render, pipe->prim ); + + /* Note: always draw lines with quads to be conformant */ + if ((active_prims & (1 << GL_LINES)) || + ((active_prims & (1 << GL_POINTS)) && + (pipe->clip->state.point_size != 1.0 || + pipe->clip->state.use_vertex_pointsize))) + { + pipe->wide->next = next; + next = pipe->wide; + install = GL_TRUE; + } + + + if ((active_prims & (1 << GL_LINES)) && + pipe->clip->state.line_stipple_pattern != 0xffff) + { + pipe->stipple->next = next; + next = pipe->stipple; + install = GL_TRUE; + need_flat = GL_TRUE; + } + + + + if (pipe->clip->vb_prims & (1 << GL_TRIANGLES)) + { + if (pipe->clip->state.fill_cw != FILL_TRI || + pipe->clip->state.fill_ccw != FILL_TRI) { + + pipe->unfilled->next = next; + next = pipe->unfilled; + install = GL_TRUE; + } + + if (install && + (pipe->clip->state.offset_cw || + pipe->clip->state.offset_ccw)) { + pipe->offset->next = next; + next = pipe->offset; + } + + if (pipe->clip->state.light_twoside) { + pipe->twoside->next = next; + next = pipe->twoside; + install = GL_TRUE; + } + + /* All the above require the determinant which is calculated + * below. Can't cull before clipping as we don't have ndc + * coords for clipped vertices? + */ + if (install) + { + pipe->cull->next = next; + next = pipe->cull; + } + } + + + if (pipe->clip->vb_state.clipped_prims) { + pipe->clipper->next = next; + next = pipe->clipper; + install = GL_TRUE; + need_flat = GL_TRUE; + } + + if (need_flat) { + if (pipe->clip->state.flatshade) { + pipe->flatshade->next = next; + next = pipe->flatshade; + } + } + + +// install = GL_TRUE; + + pipe->first = next; + return install; +} + + +void clip_pipe_set_hw_render( struct clip_render *render, + struct clip_render *hw ) +{ +} + + +void clip_pipe_set_clip_state( struct clip_render *render, + struct clip_state *state ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + pipe->clip->revalidate = 1; + pipe->need_validate = 1; +} + +void clip_pipe_invalidate( struct clip_render *render ) +{ + struct clip_pipeline *pipe = clip_pipeline( render ); + + pipe->clip->revalidate = 1; + pipe->need_validate = 1; +} + + +void clip_pipe_reset_vertex_indices( struct clip_pipeline *pipe ) +{ + GLuint i; + + for (i = 0; i < pipe->nr_vertices; i++) { + struct vertex_header *v0 = get_vertex( pipe, i ); + v0->index = ~0; + } + + pipe->first->reset_tmps( pipe->first ); +} + + +#define MAX_VERTEX_SIZE ((2 + FRAG_ATTRIB_MAX) * 4 * sizeof(GLfloat)) + +void clip_pipe_alloc_tmps( struct clip_pipe_stage *stage, GLuint nr ) +{ + stage->nr_tmps = nr; + + if (nr) { + GLubyte *store = MALLOC(MAX_VERTEX_SIZE * nr); + GLuint i; + + stage->tmp = MALLOC(sizeof(struct vertex_header *) * nr); + + for (i = 0; i < nr; i++) + stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE); + } +} + +void clip_pipe_free_tmps( struct clip_pipe_stage *stage ) +{ + if (stage->tmp) { + FREE(stage->tmp[0]); + FREE(stage->tmp); + } +} + + +void clip_pipe_reset_tmps( struct clip_pipe_stage *stage ) +{ + GLuint i; + + for (i = 0; i < stage->nr_tmps; i++) + stage->tmp[i]->index = ~0; + + stage->next->reset_tmps( stage->next ); +} + + +/* Helpers: + */ +void clip_passthrough_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->tri( stage->next, header ); +} + +void clip_passthrough_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->line( stage->next, header ); +} + +void clip_passthrough_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->point( stage->next, header ); +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_clip.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_clip.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_clip.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_clip.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,507 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ + +#include "imports.h" +#include "macros.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + +#define VF_PRIVATE +#include "vf/vf.h" + + +/** bitmask for the first view-frustum clip planes */ +#define VIEWPLANE_MASK ((1 << 6) - 1) + +/** bitmask for the user-defined clip planes */ +#define USERPLANE_MASK CLIP_USER_BIT + + + + +struct clipper { + struct clip_pipe_stage stage; + struct vertex_fetch *vf; + + GLuint active_user_planes; + GLfloat (*plane)[4]; +}; + +/* This is a bit confusing: + */ +static INLINE struct clipper *clipper_stage( struct clip_pipe_stage *stage ) +{ + return (struct clipper *)stage; +} + + +#define LINTERP(T, OUT, IN) ((OUT) + (T) * ((IN) - (OUT))) + + +static void interp_attr( const struct vf_attr *a, + GLubyte *vdst, + GLfloat t, + const GLubyte *vin, + const GLubyte *vout ) +{ + GLuint offset = a->vertoffset; + GLfloat fin[4], fout[4], fdst[4]; + + a->extract( a, fin, vin + offset ); + a->extract( a, fout, vout + offset ); + + fdst[0] = LINTERP( t, fout[0], fin[0] ); + fdst[1] = LINTERP( t, fout[1], fin[1] ); + fdst[2] = LINTERP( t, fout[2], fin[2] ); + fdst[3] = LINTERP( t, fout[3], fin[3] ); + + a->insert[4-1]( a, vdst + offset, fdst ); +} + + + + +/* Interpolate between two vertices to produce a third. Delves + * slightly into the internals of the vf struct, but assumes too much + * about the layout of the vertex to be included in the vf code + * itself. + */ +void clip_interp( struct vertex_fetch *vf, + struct vertex_header *dst, + GLfloat t, + const struct vertex_header *out, + const struct vertex_header *in ) +{ + GLubyte *vdst = (GLubyte *)dst; + const GLubyte *vin = (const GLubyte *)in; + const GLubyte *vout = (const GLubyte *)out; + + const struct vf_attr *a = vf->attr; + const GLuint attr_count = vf->attr_count; + GLuint j; + + /* Vertex header. + */ + { + assert(a[0].attrib == VF_ATTRIB_VERTEX_HEADER); + dst->clipmask = 0; + dst->edgeflag = 0; + dst->pad = 0; + dst->index = 0xffff; + } + + /* Clip coordinates: interpolate normally + */ + { + assert(a[1].format == EMIT_4F); + interp_attr(&a[1], vdst, t, vin, vout); + } + + /* Do the projective divide and insert window coordinates: + */ + { + const GLfloat *pos = (const GLfloat *)&vdst[4]; + GLfloat ndc[4]; + + ndc[3] = 1.0 / pos[3]; + ndc[0] = pos[0] * ndc[3]; + ndc[1] = pos[1] * ndc[3]; + ndc[2] = pos[2] * ndc[3]; + + /* vf module handles the viewport application. XXX fix this + * - vf should take (only) clip coordinates, and do the + * projection/viewport in one go. + */ + a[2].insert[4-1]( &a[2], vdst + a[2].vertoffset, ndc ); + } + + + /* Other attributes + */ + for (j = 3; j < attr_count; j++) { + interp_attr(&a[j], vdst, t, vin, vout); + } +} + + +#define CLIP_USER_BIT 0x40 +#define CLIP_CULL_BIT 0x80 + + +static INLINE GLfloat dot4( const GLfloat *a, + const GLfloat *b ) +{ + GLfloat result = (a[0]*b[0] + + a[1]*b[1] + + a[2]*b[2] + + a[3]*b[3]); + + return result; +} + + +#if 0 +static INLINE void do_tri( struct clip_pipe_stage *next, + struct prim_header *header ) +{ + GLuint i; + for (i = 0; i < 3; i++) { + GLfloat *ndc = (GLfloat *)(&header->v[i]->data[16]); + _mesa_printf("ndc %f %f %f\n", ndc[0], ndc[1], ndc[2]); + assert(ndc[0] >= -1 && ndc[0] <= 641); + assert(ndc[1] >= 30 && ndc[1] <= 481); + } + _mesa_printf("\n"); + next->tri(next, header); +} +#endif + + +static void emit_poly( struct clip_pipe_stage *stage, + struct vertex_header **inlist, + unsigned n, + const struct prim_header *origPrim) +{ + struct prim_header header; + unsigned i; + + /* later stages may need the determinant, but only the sign matters */ + header.det = origPrim->det; + header.reset_line_stipple = origPrim->reset_line_stipple; + + for (i = 2; i < n; i++) { + header.v[0] = inlist[0]; + header.v[1] = inlist[i-1]; + header.v[2] = inlist[i]; + + header.edgeflags = ((header.v[0]->edgeflag << 0) | + (header.v[1]->edgeflag << 1) | + (header.v[2]->edgeflag << 2)); + + if (i != 2) header.edgeflags &= ~(1<<0); + if (i != n-1) header.edgeflags &= ~(1<<2); + + stage->next->tri( stage->next, &header ); + + header.reset_line_stipple = 0; + } +} + + +#if 0 +static void emit_poly( struct clip_pipe_stage *stage ) +{ + GLuint i; + + for (i = 2; i < n; i++) { + header->v[0] = inlist[0]; + header->v[1] = inlist[i-1]; + header->v[2] = inlist[i]; + + stage->next->tri( stage->next, header ); + } +} +#endif + + +/* Clip a triangle against the viewport and user clip planes. + */ +static void +do_clip_tri( struct clip_pipe_stage *stage, + struct prim_header *header, + GLuint clipmask ) +{ + struct clipper *clipper = clipper_stage( stage ); + struct vertex_header *a[MAX_CLIPPED_VERTICES]; + struct vertex_header *b[MAX_CLIPPED_VERTICES]; + struct vertex_header **inlist = a; + struct vertex_header **outlist = b; + GLuint tmpnr = 0; + GLuint n = 3; + GLuint i; + + inlist[0] = header->v[0]; + inlist[1] = header->v[1]; + inlist[2] = header->v[2]; + + + /* XXX: Note stupid hack to deal with tnl's 8-bit clipmask. Remove + * this once we correctly use 16bit masks for userclip planes. + */ + clipmask &= ~CLIP_CULL_BIT; + if (clipmask & CLIP_USER_BIT) { + clipmask &= ~CLIP_USER_BIT; + clipmask |= clipper->active_user_planes; + } + + while (clipmask && n >= 3) { + GLuint plane_idx = ffs(clipmask)-1; + const GLfloat *plane = clipper->plane[plane_idx]; + struct vertex_header *vert_prev = inlist[0]; + GLfloat dp_prev = dot4( (GLfloat *)vert_prev->data, plane ); + GLuint outcount = 0; + + clipmask &= ~(1<data, plane ); + + if (!IS_NEGATIVE(dp_prev)) { + outlist[outcount++] = vert_prev; + } + + if (DIFFERENT_SIGNS(dp, dp_prev)) { + struct vertex_header *new_vert = clipper->stage.tmp[tmpnr++]; + outlist[outcount++] = new_vert; + + if (IS_NEGATIVE(dp)) { + /* Going out of bounds. Avoid division by zero as we + * know dp != dp_prev from DIFFERENT_SIGNS, above. + */ + GLfloat t = dp / (dp - dp_prev); + clip_interp( clipper->vf, new_vert, t, vert, vert_prev ); + + /* Force edgeflag true in this case: + */ + new_vert->edgeflag = 1; + } else { + /* Coming back in. + */ + GLfloat t = dp_prev / (dp_prev - dp); + clip_interp( clipper->vf, new_vert, t, vert_prev, vert ); + + /* Copy starting vert's edgeflag: + */ + new_vert->edgeflag = vert_prev->edgeflag; + } + } + + vert_prev = vert; + dp_prev = dp; + } + + { + struct vertex_header **tmp = inlist; + inlist = outlist; + outlist = tmp; + n = outcount; + } + } + + /* Emit the polygon as triangles to the setup stage: + */ + if (n >= 3) + emit_poly( stage, inlist, n, header ); +} + + +/* Clip a line against the viewport and user clip planes. + */ +static void +do_clip_line( struct clip_pipe_stage *stage, + struct prim_header *header, + GLuint clipmask ) +{ + struct clipper *clipper = clipper_stage( stage ); + struct vertex_header *v0 = header->v[0]; + struct vertex_header *v1 = header->v[1]; + const GLfloat *pos0 = (const GLfloat *)(v0->data); + const GLfloat *pos1 = (const GLfloat *)(v1->data); + GLfloat t0 = 0; + GLfloat t1 = 0; + struct prim_header newprim = *header; + + header = &newprim; + + /* XXX: Note stupid hack to deal with tnl's 8-bit clipmask. Remove + * this once we correctly use 16bit masks for userclip planes. + */ + clipmask &= ~CLIP_CULL_BIT; + if (clipmask & CLIP_USER_BIT) { + clipmask &= ~CLIP_USER_BIT; + clipmask |= clipper->active_user_planes; + } + + while (clipmask) { + GLuint plane_idx = ffs(clipmask)-1; + const GLfloat *plane = clipper->plane[plane_idx]; + + const GLfloat dp0 = dot4( pos0, plane ); + const GLfloat dp1 = dot4( pos1, plane ); + + /* need this to handle user-clip planes properly */ + if (dp0 < 0.0F && dp1 < 0.0F) + return; + + if (dp1 < 0) { + GLfloat t = dp1 / (dp1 - dp0); + if (t > t1) t1 = t; + } + + if (dp0 < 0) { + GLfloat t = dp0 / (dp0 - dp1); + if (t > t0) t0 = t; + } + + if (t0 + t1 >= 1.0) + return; /* discard */ + + clipmask &= ~(1<clipmask) { + clip_interp( clipper->vf, stage->tmp[0], t0, v0, v1 ); + header->v[0] = stage->tmp[0]; + } + + if (v1->clipmask) { + clip_interp( clipper->vf, stage->tmp[1], t1, v1, v0 ); + header->v[1] = stage->tmp[1]; + } + + stage->next->line( stage->next, header ); +} + + + +static void clip_begin( struct clip_pipe_stage *stage ) +{ + struct clipper *clipper = clipper_stage(stage); + GLuint nr = stage->pipe->clip->nr_planes; + + clipper->vf = stage->pipe->clip->vb.vf; + + /* Hacky bitmask to use when we hit CLIP_USER_BIT: + */ + clipper->active_user_planes = ((1<next->begin( stage->next ); +} + +static void +clip_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + if (header->v[0]->clipmask == 0) { + stage->next->point( stage->next, header ); + } + else if (header->v[0]->clipmask & USERPLANE_MASK) { + /* test against user clip planes now */ + const struct clipper *clipper = clipper_stage( stage ); + uint clipmask = clipper->active_user_planes; + uint i = 6; + + while (clipmask) { + float dot = dot4(clipper->plane[i], (const GLfloat *)(header->v[0]->data)); + if (dot < 0.0F) + return; /* clipped! */ + clipmask &= ~(1<next->point( stage->next, header ); + } +} + + +static void +clip_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + GLuint clipmask = (header->v[0]->clipmask | + header->v[1]->clipmask); + + if (clipmask == 0) { + stage->next->line( stage->next, header ); + } + else if (((header->v[0]->clipmask & + header->v[1]->clipmask & + VIEWPLANE_MASK) == 0) || + (clipmask & USERPLANE_MASK)) { + do_clip_line(stage, header, clipmask); + } +} + + +static void +clip_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + GLuint clipmask = (header->v[0]->clipmask | + header->v[1]->clipmask | + header->v[2]->clipmask); + + if (clipmask == 0) { + stage->next->tri( stage->next, header ); + } + else if (((header->v[0]->clipmask & + header->v[1]->clipmask & + header->v[2]->clipmask & + VIEWPLANE_MASK) == 0) || + (clipmask & USERPLANE_MASK)) { + do_clip_tri(stage, header, clipmask); + } +} + +static void clip_end( struct clip_pipe_stage *stage ) +{ + struct clipper *clipper = clipper_stage(stage); + + clipper->vf = NULL; + stage->next->end( stage->next ); +} + + +struct clip_pipe_stage *clip_pipe_clip( struct clip_pipeline *pipe ) +{ + struct clipper *clipper = CALLOC_STRUCT(clipper); + + clip_pipe_alloc_tmps( &clipper->stage, MAX_CLIPPED_VERTICES ); + + clipper->stage.pipe = pipe; + clipper->stage.begin = clip_begin; + clipper->stage.point = clip_point; + clipper->stage.line = clip_line; + clipper->stage.tri = clip_tri; + clipper->stage.reset_tmps = clip_pipe_reset_tmps; + clipper->stage.end = clip_end; + + clipper->plane = pipe->clip->plane; + + return &clipper->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_cull.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_cull.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_cull.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_cull.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,129 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + + +struct cull_stage { + struct clip_pipe_stage stage; + + GLuint hw_data_offset; + GLuint mode; +}; + + + +static INLINE struct cull_stage *cull_stage( struct clip_pipe_stage *stage ) +{ + return (struct cull_stage *)stage; +} + + +static void cull_begin( struct clip_pipe_stage *stage ) +{ + struct cull_stage *cull = cull_stage(stage); + + if (stage->pipe->clip->vb_state.clipped_prims) + cull->hw_data_offset = 16; + else + cull->hw_data_offset = 0; + + cull->mode = stage->pipe->clip->state.cull_mode; + + stage->next->begin( stage->next ); +} + + +static void cull_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + GLuint hw_data_offset = cull_stage(stage)->hw_data_offset; + + GLfloat *v0 = (GLfloat *)&(header->v[0]->data[hw_data_offset]); + GLfloat *v1 = (GLfloat *)&(header->v[1]->data[hw_data_offset]); + GLfloat *v2 = (GLfloat *)&(header->v[2]->data[hw_data_offset]); + + GLfloat ex = v0[0] - v2[0]; + GLfloat ey = v0[1] - v2[1]; + GLfloat fx = v1[0] - v2[0]; + GLfloat fy = v1[1] - v2[1]; + + header->det = ex * fy - ey * fx; + + if (header->det != 0) { + GLuint mode = (header->det < 0) ? WINDING_CW : WINDING_CCW; + + if ((mode & cull_stage(stage)->mode) == 0) + stage->next->tri( stage->next, header ); + } +} + + +static void cull_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->line( stage->next, header ); +} + + +static void cull_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->point( stage->next, header ); +} + +static void cull_end( struct clip_pipe_stage *stage ) +{ + stage->next->end( stage->next ); +} + +struct clip_pipe_stage *clip_pipe_cull( struct clip_pipeline *pipe ) +{ + struct cull_stage *cull = CALLOC_STRUCT(cull_stage); + + clip_pipe_alloc_tmps( &cull->stage, 0 ); + + cull->stage.pipe = pipe; + cull->stage.next = NULL; + cull->stage.begin = cull_begin; + cull->stage.point = cull_point; + cull->stage.line = cull_line; + cull->stage.tri = cull_tri; + cull->stage.reset_tmps = clip_pipe_reset_tmps; + cull->stage.end = cull_end; + + return &cull->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_emit.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_emit.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_emit.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_emit.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,276 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + +/* Don't want these too large as there is no mechanism to "give back" + * unused space. FIXME. + */ +#define EMIT_MAX_ELTS 1024 +#define EMIT_MAX_VERTS 256 + +struct emit_stage { + struct clip_pipe_stage stage; + + struct { + GLubyte *buf; + GLuint count; + GLuint space; + } verts; + + struct { + GLuint elts[EMIT_MAX_ELTS]; + GLuint count; + GLuint space; + } elts; + + struct clip_render *hw; + GLuint hw_vertex_size; + GLuint hw_data_offset; + GLuint hw_prim; +}; + + +static INLINE struct emit_stage *emit_stage( struct clip_pipe_stage *stage ) +{ + return (struct emit_stage *)stage; +} + + +static void set_primitive( struct emit_stage *emit, + GLenum primitive ) +{ + struct clip_render *hw = emit->hw; + + if (emit->elts.count) { + hw->draw_indexed_prim( hw, emit->elts.elts, emit->elts.count ); + emit->elts.space = EMIT_MAX_ELTS; + emit->elts.count = 0; + } + + hw->set_prim( hw, primitive ); + emit->hw_prim = primitive; + +} + +static void flush( struct emit_stage *emit, + GLboolean allocate_new_vertices ) +{ + struct clip_render *hw = emit->hw; + GLboolean flush_hw = (emit->verts.buf != NULL); + + if (0) + _mesa_printf("%s flush: %d elts: %d realloc: %d\n", __FUNCTION__, + flush_hw, + emit->elts.count, + allocate_new_vertices); + + if (flush_hw) { + if (emit->elts.count) { + GLuint i; + for (i = 0; i < emit->elts.count; i++) + assert(emit->elts.elts[i] < emit->verts.count); + + hw->draw_indexed_prim( hw, emit->elts.elts, emit->elts.count ); + emit->elts.space = EMIT_MAX_ELTS; + emit->elts.count = 0; + } + + assert(emit->verts.count <= EMIT_MAX_VERTS); + + hw->release_vertices( hw, + emit->verts.buf, + emit->hw_vertex_size, + emit->verts.count ); + + emit->verts.buf = NULL; + emit->verts.count = 0; + emit->verts.space = 0; + } + + + /* Clear index value on all cached vertices in the prim pipeline + * itself. + */ + if (allocate_new_vertices) + { +// GLuint nr = 4096 / (emit->hw_vertex_size * 4); + GLuint nr = EMIT_MAX_VERTS; + emit->verts.buf = hw->allocate_vertices( hw, emit->hw_vertex_size, nr ); + emit->verts.space = nr; + emit->verts.count = 0; + } + + if (flush_hw && allocate_new_vertices) + clip_pipe_reset_vertex_indices( emit->stage.pipe ); +} + +/* Check for sufficient vertex and index space. Return pointer to + * index list. + */ +static GLuint *check_space( struct emit_stage *emit, + GLenum primitive, + GLuint nr_verts, + GLuint nr_elts ) +{ + GLuint *ptr; + + if (primitive != emit->hw_prim) + set_primitive( emit, primitive ); + + /* XXX: No need to discard the vertex buffer when we run out of + * element space. + */ + if (nr_verts >= emit->verts.space || + nr_elts >= emit->elts.space) + flush( emit, GL_TRUE ); + + ptr = emit->elts.elts + emit->elts.count; + emit->elts.count += nr_elts; + emit->elts.space -= nr_elts; + + return ptr; +} + + +/* Check for vertex in buffer and emit if necessary. Return index. + * No need to check space this has already been done. + */ +static GLuint emit_vert( struct emit_stage *emit, + struct vertex_header *vert ) +{ + if (vert->index == 0xffff) { + GLuint idx = emit->verts.count; + + emit->verts.count++; + emit->verts.space--; + + assert(idx < EMIT_MAX_VERTS); + vert->index = idx; + + memcpy( emit->verts.buf + idx * emit->hw_vertex_size, + vert->data + emit->hw_data_offset, + emit->hw_vertex_size ); + } + + return vert->index; +} + + +static void emit_begin( struct clip_pipe_stage *stage ) +{ + struct emit_stage *emit = emit_stage( stage ); + + /* Validate hw_vertex_size, hw_data_offset, etc: + */ + emit->hw = stage->pipe->clip->hw; + emit->hw_vertex_size = stage->pipe->clip->hw_vertex_size; + + if (stage->pipe->clip->vb_state.clipped_prims) + emit->hw_data_offset = 16; + else + emit->hw_data_offset = 0; + + emit->hw->set_prim( emit->hw, emit->hw_prim ); + + flush( emit, GL_TRUE ); +} + + + + +static void emit_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct emit_stage *emit = emit_stage( stage ); + GLuint *elts = check_space( emit, GL_TRIANGLES, 3, 3 ); + + elts[0] = emit_vert( emit, header->v[0] ); + elts[1] = emit_vert( emit, header->v[1] ); + elts[2] = emit_vert( emit, header->v[2] ); +} + + +static void emit_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct emit_stage *emit = emit_stage( stage ); + GLuint *elts = check_space( emit, GL_LINES, 2, 2 ); + + elts[0] = emit_vert( emit, header->v[0] ); + elts[1] = emit_vert( emit, header->v[1] ); +} + + +static void emit_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct emit_stage *emit = emit_stage( stage ); + GLuint *elts = check_space( emit, GL_POINTS, 1, 1 ); + + elts[0] = emit_vert( emit, header->v[0] ); +} + +static void emit_reset_tmps( struct clip_pipe_stage *stage ) +{ +} + +static void emit_end( struct clip_pipe_stage *stage ) +{ + struct emit_stage *emit = emit_stage( stage ); + + flush( emit, GL_FALSE ); + emit->hw = NULL; +} + +struct clip_pipe_stage *clip_pipe_emit( struct clip_pipeline *pipe ) +{ + struct emit_stage *emit = CALLOC_STRUCT(emit_stage); + + clip_pipe_alloc_tmps( &emit->stage, 0 ); + + emit->stage.pipe = pipe; + emit->stage.next = NULL; + emit->stage.begin = emit_begin; + emit->stage.point = emit_point; + emit->stage.line = emit_line; + emit->stage.tri = emit_tri; + emit->stage.reset_tmps = emit_reset_tmps; + emit->stage.end = emit_end; + + emit->elts.space = EMIT_MAX_ELTS; + + return &emit->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_flatshade.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_flatshade.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_flatshade.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_flatshade.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,166 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + + +struct flatshade_stage { + struct clip_pipe_stage stage; + + struct vertex_fetch *vf; +}; + + + +static INLINE struct flatshade_stage *flatshade_stage( struct clip_pipe_stage *stage ) +{ + return (struct flatshade_stage *)stage; +} + + +static void flatshade_begin( struct clip_pipe_stage *stage ) +{ + struct flatshade_stage *flatshade = flatshade_stage(stage); + + flatshade->vf = stage->pipe->clip->vb.vf; + stage->next->begin( stage->next ); +} + + + +static INLINE void copy_color( const struct vf_attr *attr, + GLubyte *dst, + const GLubyte *src ) +{ + if (attr) { + memcpy( dst + attr->vertoffset, + src + attr->vertoffset, + attr->vertattrsize ); + } +} + +static void copy_colors( const struct vertex_fetch *vf, + struct vertex_header *vdst, + const struct vertex_header *vsrc ) +{ + GLubyte *dst = (GLubyte *)vdst; + const GLubyte *src = (const GLubyte *)vsrc; + + copy_color( vf->lookup[VF_ATTRIB_COLOR0], dst, src ); + copy_color( vf->lookup[VF_ATTRIB_COLOR1], dst, src ); + copy_color( vf->lookup[VF_ATTRIB_BFC0], dst, src ); + copy_color( vf->lookup[VF_ATTRIB_BFC1], dst, src ); +} + + + +/* Flatshade tri. Required for clipping and when unfilled tris are + * active, otherwise handled by hardware. + */ +static void flatshade_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct prim_header tmp; + struct vertex_fetch *vf = flatshade_stage(stage)->vf; + + tmp.det = header->det; + tmp.edgeflags = header->edgeflags; + tmp.reset_line_stipple = header->reset_line_stipple; + + tmp.v[0] = dup_vert(stage, header->v[0], 0); + tmp.v[1] = dup_vert(stage, header->v[1], 1); + tmp.v[2] = header->v[2]; + + copy_colors(vf, tmp.v[0], tmp.v[2]); + copy_colors(vf, tmp.v[1], tmp.v[2]); + + stage->next->tri( stage->next, &tmp ); +} + + +/* Flatshade line. Required for clipping. + */ +static void flatshade_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct prim_header tmp; + struct vertex_fetch *vf = flatshade_stage(stage)->vf; + + tmp.edgeflags = header->edgeflags; + tmp.reset_line_stipple = header->reset_line_stipple; + tmp.v[0] = dup_vert(stage, header->v[0], 0); + tmp.v[1] = header->v[1]; + + copy_colors(vf, tmp.v[0], tmp.v[1]); + + stage->next->line( stage->next, &tmp ); +} + + +static void flatshade_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->point( stage->next, header ); +} + +static void flatshade_end( struct clip_pipe_stage *stage ) +{ + struct flatshade_stage *flatshade = flatshade_stage(stage); + + flatshade->vf = NULL; + stage->next->end( stage->next ); +} + +struct clip_pipe_stage *clip_pipe_flatshade( struct clip_pipeline *pipe ) +{ + struct flatshade_stage *flatshade = CALLOC_STRUCT(flatshade_stage); + + clip_pipe_alloc_tmps( &flatshade->stage, 2 ); + + flatshade->stage.pipe = pipe; + flatshade->stage.next = NULL; + flatshade->stage.begin = flatshade_begin; + flatshade->stage.point = flatshade_point; + flatshade->stage.line = flatshade_line; + flatshade->stage.tri = flatshade_tri; + flatshade->stage.reset_tmps = clip_pipe_reset_tmps; + flatshade->stage.end = flatshade_end; + flatshade->vf = NULL; + + return &flatshade->stage; +} + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.h xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.h --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe.h 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,208 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ + +#ifndef CLIP_PIPE_H +#define CLIP_PIPE_H + +#include "glheader.h" + +/* The prim pipeline probably needs to know about the internals of the + * clip_context struct. Need to figure that out shortly. + */ + +struct clip; +struct clip_state; +struct clip_vb_state; +struct clip_render; +struct clip_pipeline; + +struct clip_render *clip_create_prim_render( struct clip_context *draw ); + +GLboolean clip_pipe_validate_state( struct clip_render *render ); + +void clip_pipe_set_hw_render( struct clip_render *render, + struct clip_render *hw ); + +void clip_pipe_invalidate( struct clip_render *render ); + +void clip_pipe_set_clip_state( struct clip_render *render, + struct clip_state *state ); + + + + +/* Carry some useful information around with the vertices in the prim + * pipe. + */ +struct vertex_header { + GLuint clipmask:12; + GLuint edgeflag:1; + GLuint pad:3; + GLuint index:16; + GLubyte data[]; +}; + + +/*********************************************************************** + * Private structs and data for the clip_pipe* files. + */ +#ifdef CLIP_PIPE_PRIVATE + +struct clip_pipe_stage; + +struct clip_pipeline { + struct clip_render render; + struct clip_context *clip; + + struct clip_pipe_stage *emit; + struct clip_pipe_stage *unfilled; + struct clip_pipe_stage *twoside; + struct clip_pipe_stage *clipper; + struct clip_pipe_stage *flatshade; + struct clip_pipe_stage *offset; + struct clip_pipe_stage *cull; + struct clip_pipe_stage *wide; + struct clip_pipe_stage *stipple; + + + struct clip_pipe_stage *first; + + GLubyte *verts; + GLuint nr_vertices; + GLuint vertex_size; + + GLenum prim; + GLboolean need_validate; + + struct vertex_header *(*get_vertex)( struct clip_pipeline *, + GLuint idx ); + const GLuint *elts; +}; + + +#define PRIM_POINT 1 +#define PRIM_LINE 2 +#define PRIM_TRI 3 + +struct prim_header { + GLfloat det; + + unsigned reset_line_stipple:1; + unsigned edgeflags:3; + unsigned pad:28; + + struct vertex_header *v[3]; +}; + + +/* Internal structs and helpers for the primitive clip/setup pipeline: + */ +struct clip_pipe_stage { + struct clip_pipeline *pipe; + struct clip_pipe_stage *next; + struct vertex_header **tmp; + GLuint nr_tmps; + + void (*begin)( struct clip_pipe_stage * ); + + void (*point)( struct clip_pipe_stage *, + struct prim_header * ); + + void (*line)( struct clip_pipe_stage *, + struct prim_header * ); + + void (*tri)( struct clip_pipe_stage *, + struct prim_header * ); + + /* Can occur at any time, even within a call to tri() or end(). + */ + void (*reset_tmps)( struct clip_pipe_stage * ); + + void (*end)( struct clip_pipe_stage * ); +}; + + +struct clip_pipe_stage *clip_pipe_emit( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_unfilled( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_twoside( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_offset( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_clip( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_flatshade( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_cull( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_wide( struct clip_pipeline *pipe ); +struct clip_pipe_stage *clip_pipe_stipple( struct clip_pipeline *pipe ); + + +void clip_pipe_alloc_tmps( struct clip_pipe_stage *stage, GLuint nr ); +void clip_pipe_free_tmps( struct clip_pipe_stage *stage ); +void clip_pipe_reset_tmps( struct clip_pipe_stage *stage ); + +/* Reset vertex indices for the incoming vertices and all temporary + * vertices within the pipeline. + */ +void clip_pipe_reset_vertex_indices( struct clip_pipeline *pipe ); + + + +/* Helpers: + */ +void clip_passthrough_tri( struct clip_pipe_stage *stage, + struct prim_header *header ); + +void clip_passthrough_line( struct clip_pipe_stage *stage, + struct prim_header *header ); + +void clip_passthrough_point( struct clip_pipe_stage *stage, + struct prim_header *header ); + +/* Used in clip, linestipple: + */ +void clip_interp( struct vertex_fetch *vf, + struct vertex_header *dst, + GLfloat t, + const struct vertex_header *out, + const struct vertex_header *in ); + + +/* Get a writeable copy of a vertex: + */ +static INLINE struct vertex_header * +dup_vert( struct clip_pipe_stage *stage, + const struct vertex_header *vert, + GLuint idx ) +{ + struct vertex_header *tmp = stage->tmp[idx]; + memcpy(tmp, vert, stage->pipe->vertex_size ); + tmp->index = ~0; + return tmp; +} + +#endif +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_offset.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_offset.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_offset.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_offset.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,170 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" +#include "macros.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + + +struct offset_stage { + struct clip_pipe_stage stage; + + GLuint hw_data_offset; + + GLfloat slope; + GLfloat global; +}; + + + +static INLINE struct offset_stage *offset_stage( struct clip_pipe_stage *stage ) +{ + return (struct offset_stage *)stage; +} + + +static void offset_begin( struct clip_pipe_stage *stage ) +{ + struct offset_stage *offset = offset_stage(stage); + + if (stage->pipe->clip->vb_state.clipped_prims) + offset->hw_data_offset = 16; + else + offset->hw_data_offset = 0; + + offset->slope = stage->pipe->clip->state.offset_slope; + offset->global = stage->pipe->clip->state.offset_global; + + stage->next->begin( stage->next ); +} + + +/* Offset tri. Some hardware can handle this, but not usually when + * doing unfilled rendering. + */ +static void do_offset_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct offset_stage *offset = offset_stage(stage); + GLuint hw_data_offset = offset->hw_data_offset; + + GLfloat inv_det = 1.0 / header->det; + + GLfloat *v0 = (GLfloat *)&(header->v[0]->data[hw_data_offset]); + GLfloat *v1 = (GLfloat *)&(header->v[1]->data[hw_data_offset]); + GLfloat *v2 = (GLfloat *)&(header->v[2]->data[hw_data_offset]); + + GLfloat ex = v0[0] - v2[2]; + GLfloat fx = v1[0] - v2[2]; + GLfloat ey = v0[1] - v2[2]; + GLfloat fy = v1[1] - v2[2]; + GLfloat ez = v0[2] - v2[2]; + GLfloat fz = v1[2] - v2[2]; + + GLfloat a = ey*fz - ez*fy; + GLfloat b = ez*fx - ex*fz; + + GLfloat ac = a * inv_det; + GLfloat bc = b * inv_det; + GLfloat zoffset; + + if ( ac < 0.0f ) ac = -ac; + if ( bc < 0.0f ) bc = -bc; + + zoffset = offset->global + MAX2( ac, bc ) * offset->slope; + + v0[2] += zoffset; + v1[2] += zoffset; + v2[2] += zoffset; + + stage->next->tri( stage->next, header ); +} + + +static void offset_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct prim_header tmp; + + tmp.det = header->det; + tmp.reset_line_stipple = header->reset_line_stipple; + tmp.edgeflags = header->edgeflags; + tmp.pad = header->pad; + + tmp.v[0] = dup_vert(stage, header->v[0], 0); + tmp.v[1] = dup_vert(stage, header->v[1], 1); + tmp.v[2] = dup_vert(stage, header->v[2], 2); + + do_offset_tri( stage, &tmp ); +} + + + +static void offset_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->line( stage->next, header ); +} + + +static void offset_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->point( stage->next, header ); +} + + +static void offset_end( struct clip_pipe_stage *stage ) +{ + stage->next->end( stage->next ); +} + +struct clip_pipe_stage *clip_pipe_offset( struct clip_pipeline *pipe ) +{ + struct offset_stage *offset = CALLOC_STRUCT(offset_stage); + + clip_pipe_alloc_tmps( &offset->stage, 3 ); + + offset->stage.pipe = pipe; + offset->stage.next = NULL; + offset->stage.begin = offset_begin; + offset->stage.point = offset_point; + offset->stage.line = offset_line; + offset->stage.tri = offset_tri; + offset->stage.reset_tmps = clip_pipe_reset_tmps; + offset->stage.end = offset_end; + + return &offset->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_stipple.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_stipple.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_stipple.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_stipple.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,266 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ + +/* Implement line stipple by cutting lines up into smaller lines. + * There are hundreds of ways to implement line stipple, this is one + * choice that should work in all situations, requires no state + * manipulations, but with a penalty in terms of large amounts of + * generated geometry. + */ + +#include "imports.h" +#include "macros.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + + +struct stipple_stage { + struct clip_pipe_stage stage; + + GLuint hw_data_offset; + + GLfloat counter; + GLuint pattern; + GLuint factor; +}; + + + + +static INLINE struct stipple_stage *stipple_stage( struct clip_pipe_stage *stage ) +{ + return (struct stipple_stage *)stage; +} + + + + +static void interp_attr( const struct vf_attr *a, + GLubyte *vdst, + GLfloat t, + const GLubyte *vin, + const GLubyte *vout ) +{ + GLuint offset = a->vertoffset; + GLfloat fin[4], fout[4], fdst[4]; + + a->extract( a, fin, vin + offset ); + a->extract( a, fout, vout + offset ); + + fdst[0] = LINTERP( t, fout[0], fin[0] ); + fdst[1] = LINTERP( t, fout[1], fin[1] ); + fdst[2] = LINTERP( t, fout[2], fin[2] ); + fdst[3] = LINTERP( t, fout[3], fin[3] ); + + a->insert[4-1]( a, vdst + offset, fdst ); +} + + + + +/* Weird screen-space interpolation?? Otherwise do something special + * with pos.w or fix vertices to always have clip coords available. + */ +static void screen_interp( struct vertex_fetch *vf, + struct vertex_header *dst, + GLfloat t, + const struct vertex_header *out, + const struct vertex_header *in ) +{ + GLubyte *vdst = (GLubyte *)dst; + const GLubyte *vin = (const GLubyte *)in; + const GLubyte *vout = (const GLubyte *)out; + + const struct vf_attr *a = vf->attr; + const GLuint attr_count = vf->attr_count; + GLuint j; + + /* Vertex header. + */ + { + assert(a[0].attrib == VF_ATTRIB_VERTEX_HEADER); + dst->clipmask = 0; + dst->edgeflag = 0; + dst->pad = 0; + dst->index = 0xffff; + } + + + /* Other attributes + */ + for (j = 1; j < attr_count; j++) { + interp_attr(&a[j], vdst, t, vin, vout); + } +} + + + +/* Clip a line against the viewport and user clip planes. + */ +static void draw_line_segment( struct clip_pipe_stage *stage, + struct prim_header *header, + GLfloat t0, + GLfloat t1 ) +{ + struct vertex_fetch *vf = stage->pipe->clip->vb.vf; + struct vertex_header *v0 = header->v[0]; + struct vertex_header *v1 = header->v[1]; + + struct prim_header newprim = *header; + header = &newprim; + +// _mesa_printf("%s %f %f\n", __FUNCTION__, t0, t1); + + if (t0 > 0.0) { + screen_interp( vf, stage->tmp[0], t0, v0, v1 ); + header->v[0] = stage->tmp[0]; + } + + if (t1 < 1.0) { + screen_interp( vf, stage->tmp[1], t1, v0, v1 ); + header->v[1] = stage->tmp[1]; + } + + stage->next->line( stage->next, header ); +} + + + +/* XXX: don't really want to iterate like this. + */ +static INLINE unsigned +stipple_test(int counter, ushort pattern, int factor) +{ + int b = (counter / factor) & 0xf; + return (1 << b) & pattern; +} + + + +/* XXX: Need to have precalculated flatshading already. + */ +static void stipple_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct stipple_stage *stipple = stipple_stage(stage); + GLuint hw_data_offset = stipple->hw_data_offset; + const GLfloat *pos0 = (GLfloat *)&(header->v[0]->data[hw_data_offset]); + const GLfloat *pos1 = (GLfloat *)&(header->v[1]->data[hw_data_offset]); + GLfloat start = 0; + int state = 0; + + GLfloat x0 = (GLfloat)pos0[0]; + GLfloat x1 = (GLfloat)pos1[0]; + GLfloat y0 = (GLfloat)pos0[1]; + GLfloat y1 = (GLfloat)pos1[1]; + + GLfloat dx = x0 > x1 ? x0 - x1 : x1 - x0; + GLfloat dy = y0 > y1 ? y0 - y1 : y1 - y0; + + GLfloat length = MAX2(dx, dy); + GLint i; + + if (header->reset_line_stipple) + stipple->counter = 0; + + /* XXX: iterating like this is lame + */ + for (i = 0; i < length; i++) { + int result = stipple_test( stipple->counter+i, stipple->pattern, stipple->factor ); +// _mesa_printf("%d %f %d\n", i, length, result); + if (result != state) { + if (state) { + if (start != i) + draw_line_segment( stage, header, start / length, i / length ); + } + else { + start = i; + } + state = result; + } + } + + if (state && start < length) + draw_line_segment( stage, header, start / length, 1.0 ); + + stipple->counter += length; +} + + + +static void stipple_begin( struct clip_pipe_stage *stage ) +{ + struct stipple_stage *stipple = stipple_stage(stage); + struct clip_context *draw = stage->pipe->clip; + + if (stage->pipe->clip->vb_state.clipped_prims) + stipple->hw_data_offset = 16; + else + stipple->hw_data_offset = 0; + + stipple->stage.tri = clip_passthrough_tri; + stipple->stage.point = clip_passthrough_point; + + stipple->stage.line = stipple_line; + stipple->factor = draw->state.line_stipple_factor + 1; + stipple->pattern = draw->state.line_stipple_pattern; + + stage->next->begin( stage->next ); +} + + + +static void stipple_end( struct clip_pipe_stage *stage ) +{ + stage->next->end( stage->next ); +} + +struct clip_pipe_stage *clip_pipe_stipple( struct clip_pipeline *pipe ) +{ + struct stipple_stage *stipple = CALLOC_STRUCT(stipple_stage); + + clip_pipe_alloc_tmps( &stipple->stage, 4 ); + + stipple->stage.pipe = pipe; + stipple->stage.next = NULL; + stipple->stage.begin = stipple_begin; + stipple->stage.point = clip_passthrough_point; + stipple->stage.line = stipple_line; + stipple->stage.tri = clip_passthrough_tri; + stipple->stage.reset_tmps = clip_pipe_reset_tmps; + stipple->stage.end = stipple_end; + + return &stipple->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_twoside.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_twoside.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_twoside.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_twoside.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,160 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + +struct twoside_stage { + struct clip_pipe_stage stage; + + GLfloat facing; + + struct vertex_fetch *vf; +}; + + +static INLINE struct twoside_stage *twoside_stage( struct clip_pipe_stage *stage ) +{ + return (struct twoside_stage *)stage; +} + + +static void twoside_begin( struct clip_pipe_stage *stage ) +{ + struct twoside_stage *twoside = twoside_stage(stage); + + twoside->vf = stage->pipe->clip->vb.vf; + twoside->facing = (stage->pipe->clip->state.front_winding == WINDING_CW) ? -1 : 1; + + stage->next->begin( stage->next ); +} + + +static INLINE void copy_color( const struct vf_attr *attr_dst, + const struct vf_attr *attr_src, + GLubyte *v ) +{ + if (attr_dst && attr_src) { + ASSERT(attr_dst->vertattrsize == + attr_src->vertattrsize); + + memcpy( v + attr_dst->vertoffset, + v + attr_src->vertoffset, + attr_dst->vertattrsize ); + } +} + + +static struct vertex_header *copy_bfc( struct twoside_stage *twoside, + const struct vertex_header *v, + GLuint idx ) +{ + struct vertex_fetch *vf = twoside->vf; + struct vertex_header *tmp = dup_vert( &twoside->stage, v, idx ); + + copy_color( vf->lookup[VF_ATTRIB_COLOR0], + vf->lookup[VF_ATTRIB_BFC0], + (GLubyte *)tmp ); + + copy_color( vf->lookup[VF_ATTRIB_COLOR1], + vf->lookup[VF_ATTRIB_BFC1], + (GLubyte *)tmp ); + + return tmp; +} + + +/* Twoside tri: + */ +static void twoside_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct twoside_stage *twoside = twoside_stage(stage); + + if (header->det * twoside->facing < 0) { + struct prim_header tmp; + + tmp.det = header->det; + tmp.edgeflags = header->edgeflags; + tmp.reset_line_stipple = header->reset_line_stipple; + tmp.v[0] = copy_bfc(twoside, header->v[0], 0); + tmp.v[1] = copy_bfc(twoside, header->v[1], 1); + tmp.v[2] = copy_bfc(twoside, header->v[2], 2); + + stage->next->tri( stage->next, &tmp ); + } + else { + stage->next->tri( stage->next, header ); + } +} + + +static void twoside_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->line( stage->next, header ); +} + + +static void twoside_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->point( stage->next, header ); +} + +static void twoside_end( struct clip_pipe_stage *stage ) +{ + stage->next->end( stage->next ); +} + + + +struct clip_pipe_stage *clip_pipe_twoside( struct clip_pipeline *pipe ) +{ + struct twoside_stage *twoside = CALLOC_STRUCT(twoside_stage); + + clip_pipe_alloc_tmps( &twoside->stage, 3 ); + + twoside->stage.pipe = pipe; + twoside->stage.next = NULL; + twoside->stage.begin = twoside_begin; + twoside->stage.point = twoside_point; + twoside->stage.line = twoside_line; + twoside->stage.tri = twoside_tri; + twoside->stage.reset_tmps = clip_pipe_reset_tmps; + twoside->stage.end = twoside_end; + + return &twoside->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_unfilled.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_unfilled.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_unfilled.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_unfilled.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,173 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + + +struct unfilled_stage { + struct clip_pipe_stage stage; + + GLuint mode[2]; +}; + + +static INLINE struct unfilled_stage *unfilled_stage( struct clip_pipe_stage *stage ) +{ + return (struct unfilled_stage *)stage; +} + + +static void unfilled_begin( struct clip_pipe_stage *stage ) +{ + struct unfilled_stage *unfilled = unfilled_stage(stage); + + unfilled->mode[0] = stage->pipe->clip->state.fill_ccw; + unfilled->mode[1] = stage->pipe->clip->state.fill_cw; + + stage->next->begin( stage->next ); +} + +static void point( struct clip_pipe_stage *stage, + struct vertex_header *v0 ) +{ + struct prim_header tmp; + tmp.v[0] = v0; + stage->next->point( stage->next, &tmp ); +} + +static void line( struct clip_pipe_stage *stage, + GLboolean reset_line_stipple, + struct vertex_header *v0, + struct vertex_header *v1 ) +{ + struct prim_header tmp; + tmp.reset_line_stipple = reset_line_stipple; + tmp.edgeflags = 0; + tmp.pad = 0; + tmp.v[0] = v0; + tmp.v[1] = v1; + stage->next->line( stage->next, &tmp ); +} + + +static void points( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct vertex_header *v0 = header->v[0]; + struct vertex_header *v1 = header->v[1]; + struct vertex_header *v2 = header->v[2]; + + if (header->edgeflags & 0x1) point( stage, v0 ); + if (header->edgeflags & 0x2) point( stage, v1 ); + if (header->edgeflags & 0x4) point( stage, v2 ); +} + +static void lines( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct vertex_header *v0 = header->v[0]; + struct vertex_header *v1 = header->v[1]; + struct vertex_header *v2 = header->v[2]; + + if (header->edgeflags & 0x4) line( stage, header->reset_line_stipple, v2, v0 ); + if (header->edgeflags & 0x1) line( stage, 0, v0, v1 ); + if (header->edgeflags & 0x2) line( stage, 0, v1, v2 ); +} + + +/* Unfilled tri: + * + * Note edgeflags in the vertex struct is not sufficient as we will + * need to manipulate them when decomposing primitives??? + */ +static void unfilled_tri( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct unfilled_stage *unfilled = unfilled_stage(stage); + GLuint mode = unfilled->mode[header->det < 0]; + + switch (mode) { + case FILL_TRI: + stage->next->tri( stage->next, header ); + break; + + case FILL_LINE: + lines( stage, header ); + break; + + case FILL_POINT: + points( stage, header ); + break; + } +} + +static void unfilled_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->line( stage->next, header ); +} + + +static void unfilled_point( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + stage->next->point( stage->next, header ); +} + + +static void unfilled_end( struct clip_pipe_stage *stage ) +{ + stage->next->end( stage->next ); +} + +struct clip_pipe_stage *clip_pipe_unfilled( struct clip_pipeline *pipe ) +{ + struct unfilled_stage *unfilled = CALLOC_STRUCT(unfilled_stage); + + clip_pipe_alloc_tmps( &unfilled->stage, 0 ); + + unfilled->stage.pipe = pipe; + unfilled->stage.next = NULL; + unfilled->stage.tmp = NULL; + unfilled->stage.begin = unfilled_begin; + unfilled->stage.point = unfilled_point; + unfilled->stage.line = unfilled_line; + unfilled->stage.tri = unfilled_tri; + unfilled->stage.reset_tmps = clip_pipe_reset_tmps; + unfilled->stage.end = unfilled_end; + + return &unfilled->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_wide.c xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_wide.c --- xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_wide.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/clip/clip_pipe_wide.c 2010-06-24 06:42:02.000000000 +0100 @@ -0,0 +1,426 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ +#include "imports.h" +#include "macros.h" + +#define CLIP_PRIVATE +#include "clip/clip_context.h" + +#define CLIP_PIPE_PRIVATE +#include "clip/clip_pipe.h" + + + +struct wide_stage { + struct clip_pipe_stage stage; + + GLuint hw_data_offset; + GLuint psize_offset; + GLbitfield point_sprite_coords; /* gen tex coords for which units? */ + GLboolean point_sprite_invert; + GLfloat half_line_width; + GLfloat half_point_size; + GLfloat half_point_size_min, half_point_size_max; +}; + + + +static INLINE struct wide_stage *wide_stage( struct clip_pipe_stage *stage ) +{ + return (struct wide_stage *)stage; +} + + + + + +static void tri( struct clip_pipe_stage *next, + struct vertex_header *v0, + struct vertex_header *v1, + struct vertex_header *v2 ) +{ + struct prim_header tmp; + + tmp.det = 1.0; + tmp.v[0] = v0; + tmp.v[1] = v1; + tmp.v[2] = v2; + next->tri( next, &tmp ); +} + +static void quad( struct clip_pipe_stage *next, + struct vertex_header *v0, + struct vertex_header *v1, + struct vertex_header *v2, + struct vertex_header *v3 ) +{ + /* XXX: Need to disable tri-stipple + */ + tri( next, v0, v1, v3 ); + tri( next, v2, v0, v3 ); +} + +static void wide_line( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct wide_stage *wide = wide_stage(stage); + GLuint hw_data_offset = wide->hw_data_offset; + GLfloat half_width = wide->half_line_width; + + struct vertex_header *v0 = dup_vert(stage, header->v[0], 0); + struct vertex_header *v1 = dup_vert(stage, header->v[0], 1); + struct vertex_header *v2 = dup_vert(stage, header->v[1], 2); + struct vertex_header *v3 = dup_vert(stage, header->v[1], 3); + + GLfloat *pos0 = (GLfloat *)&(v0->data[hw_data_offset]); + GLfloat *pos1 = (GLfloat *)&(v1->data[hw_data_offset]); + GLfloat *pos2 = (GLfloat *)&(v2->data[hw_data_offset]); + GLfloat *pos3 = (GLfloat *)&(v3->data[hw_data_offset]); + + GLfloat dx = FABSF(pos0[0] - pos2[0]); + GLfloat dy = FABSF(pos0[1] - pos2[1]); + +#if 0 + _mesa_printf("line (%f, %f) .. (%f, %f) half_width = %f\n", + pos0[0], pos0[1], pos2[0], pos2[1], half_width); +#endif + /* + * Draw wide line as a quad (two tris) by "stretching" the line along + * X or Y. + * XXX For AA lines, the quad corners have to be computed in a + * more sophisticated way. + */ + + /* need to tweak coords in several ways to be conformant here */ + + if (dx > dy) { + /* x-major line */ + /* adjust Y positions */ + pos0[1] = pos0[1] - half_width - 0.125f; + pos1[1] = pos1[1] + half_width - 0.125f; + pos2[1] = pos2[1] - half_width - 0.125f; + pos3[1] = pos3[1] + half_width - 0.125f; + /* adjust X positions */ + if (pos0[0] < pos2[0]) { + /* left to right line */ + pos0[0] -= 0.5f; + pos1[0] -= 0.5f; + pos2[0] -= 0.5f; + pos3[0] -= 0.5f; + } + else { + /* right to left line */ + pos0[0] += 0.5f; + pos1[0] += 0.5f; + pos2[0] += 0.5f; + pos3[0] += 0.5f; + } + } + else { + /* y-major line */ + /* adjust X positions */ + pos0[0] = pos0[0] - half_width + 0.125f; + pos1[0] = pos1[0] + half_width + 0.125f; + pos2[0] = pos2[0] - half_width + 0.125f; + pos3[0] = pos3[0] + half_width + 0.15f; + /* adjust Y positions */ + if (pos0[1] < pos2[1]) { + /* top to bottom line */ + pos0[1] -= 0.5f; + pos1[1] -= 0.5f; + pos2[1] -= 0.5f; + pos3[1] -= 0.5f; + } + else { + /* bottom to top line */ + pos0[1] += 0.5f; + pos1[1] += 0.5f; + pos2[1] += 0.5f; + pos3[1] += 0.5f; + } + } + +#if 0 + _mesa_printf("wide line quad (%g, %g) (%g, %g) (%g, %g) (%g, %g)\n", + pos0[0], pos0[1], + pos1[0], pos1[1], + pos2[0], pos2[1], + pos3[0], pos3[1]); +#endif + + quad( stage->next, v0, v1, v2, v3 ); +} + + +static void make_wide_point( struct clip_pipe_stage *stage, + const struct vertex_header *vin, + struct vertex_header *v[], + GLfloat half_size ) +{ + struct wide_stage *wide = wide_stage(stage); + GLuint hw_data_offset = wide->hw_data_offset; + GLfloat *pos[4]; + float left_adj, right_adj; + + v[0] = dup_vert(stage, vin, 0); + pos[0] = (GLfloat *)&(v[0]->data[hw_data_offset]); + + /* Found by trial and error on psb hw vs indirect rendering. + * Probably not totally correct: + */ + pos[0][0] = pos[0][0] - 0.125; + pos[0][1] = pos[0][1] - 0.125; + + v[1] = dup_vert(stage, v[0], 1); + v[2] = dup_vert(stage, v[0], 2); + v[3] = dup_vert(stage, v[0], 3); + + pos[1] = (GLfloat *)&(v[1]->data[hw_data_offset]); + pos[2] = (GLfloat *)&(v[2]->data[hw_data_offset]); + pos[3] = (GLfloat *)&(v[3]->data[hw_data_offset]); + +// _mesa_printf("point %f %f, %f\n", pos[0][0], pos[0][1], half_size); + left_adj = -half_size + 0.25f; + right_adj = half_size + 0.25f; + + pos[0][0] += left_adj; + pos[0][1] -= half_size; + + pos[1][0] += left_adj; + pos[1][1] += half_size; + + pos[2][0] += right_adj; + pos[2][1] -= half_size; + + pos[3][0] += right_adj; + pos[3][1] += half_size; + +} + +/** + * Replace a vertex's texcoord with 'val' for the units which are + * specified in the 'coordUnits' mask. + */ +static INLINE void set_texcoord( struct vertex_fetch *vf, + struct vertex_header *v, + const GLfloat *val, + GLbitfield coordUnits ) +{ + GLubyte *dst = (GLubyte *)v; + const struct vf_attr *a = vf->attr; + const GLuint attr_count = vf->attr_count; + GLuint j; + + /* XXX: precompute which attributes need to be set. + */ + for (j = 1; j < attr_count; j++) { + GLuint attr = a[j].attrib; + if (attr >= VF_ATTRIB_TEX0 && + attr <= VF_ATTRIB_TEX7 && + (coordUnits & (1 << (attr - VF_ATTRIB_TEX0)))) + a[j].insert[4-1]( &a[j], dst + a[j].vertoffset, val ); + } +} + + + + +/* If there are lots of sprite points (and why wouldn't there be?) it + * would probably be more sensible to change hardware setup to + * optimize this rather than doing the whole thing in software like + * this. + */ +static void sprite_point( struct vertex_fetch *vf, + struct vertex_header *v[4], + GLboolean invert, + GLbitfield coordUnits ) +{ + static const GLfloat tex00[4] = { 0, 0, 0, 1 }; + static const GLfloat tex01[4] = { 0, 1, 0, 1 }; + static const GLfloat tex11[4] = { 1, 1, 0, 1 }; + static const GLfloat tex10[4] = { 1, 0, 0, 1 }; + + if (invert) { + set_texcoord( vf, v[0], tex01, coordUnits ); + set_texcoord( vf, v[1], tex00, coordUnits ); + set_texcoord( vf, v[2], tex11, coordUnits ); + set_texcoord( vf, v[3], tex10, coordUnits ); + } + else { + set_texcoord( vf, v[0], tex00, coordUnits ); + set_texcoord( vf, v[1], tex01, coordUnits ); + set_texcoord( vf, v[2], tex10, coordUnits ); + set_texcoord( vf, v[3], tex11, coordUnits ); + } +} + + + +/** + * Return the vertex's point size, divided by two. + */ +static GLfloat get_vert_psiz( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct wide_stage *wide = wide_stage(stage); + const GLubyte *vert = (GLubyte *)header->v[0]; + float sz; + if (wide->psize_offset) + sz = (*(GLfloat *)( vert + wide->psize_offset )) * .5; + else + sz = wide->half_point_size; + sz = CLAMP(sz, wide->half_point_size_min, wide->half_point_size_max); + return sz; +} + + +/* All possible wide/sprite psiz/state combinations: + */ +static void wide_point_const( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct wide_stage *wide = wide_stage(stage); + struct vertex_header *v[4]; + + make_wide_point(stage, header->v[0], v, wide->half_point_size ); + quad( stage->next, v[0], v[1], v[2], v[3] ); +} + +static void wide_point_psiz( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct vertex_header *v[4]; + make_wide_point(stage, header->v[0], v, get_vert_psiz(stage, header) ); + quad( stage->next, v[0], v[1], v[2], v[3] ); +} + + +static void sprite_point_const( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct vertex_fetch *vf = stage->pipe->clip->vb.vf; + struct wide_stage *wide = wide_stage(stage); + struct vertex_header *v[4]; + + make_wide_point(stage, header->v[0], v, wide->half_point_size ); + sprite_point(vf, v, wide->point_sprite_invert, wide->point_sprite_coords); + quad( stage->next, v[0], v[1], v[2], v[3] ); +} + +static void sprite_point_psiz( struct clip_pipe_stage *stage, + struct prim_header *header ) +{ + struct vertex_fetch *vf = stage->pipe->clip->vb.vf; + struct wide_stage *wide = wide_stage(stage); + struct vertex_header *v[4]; + + make_wide_point(stage, header->v[0], v, get_vert_psiz(stage, header) ); + sprite_point(vf, v, wide->point_sprite_invert, wide->point_sprite_coords); + quad( stage->next, v[0], v[1], v[2], v[3] ); +} + + + + + +static void wide_begin( struct clip_pipe_stage *stage ) +{ + struct wide_stage *wide = wide_stage(stage); + struct clip_context *draw = stage->pipe->clip; + const struct vf_attr *attr + = stage->pipe->clip->vb.vf->lookup[VF_ATTRIB_POINTSIZE]; + + if (attr) + wide->psize_offset = attr->vertoffset; + else + wide->psize_offset = 0; + + + if (draw->vb_state.clipped_prims) + wide->hw_data_offset = 16; + else + wide->hw_data_offset = 0; + + wide->half_point_size = draw->state.point_size * .5; + wide->half_line_width = draw->state.line_width * .5; + + wide->half_point_size_min = 0.5 * MAX2(draw->state.point_size_min, 1.0); + wide->half_point_size_max = 0.5 * MIN2(draw->state.point_size_max, 16.0); + + if (draw->state.line_passthrough) { + wide->stage.line = clip_passthrough_line; + } + else { + wide->stage.line = wide_line; + } + + if (draw->state.point_sprite) { + if (draw->state.use_vertex_pointsize) + wide->stage.point = sprite_point_const; + else + wide->stage.point = sprite_point_psiz; + wide->point_sprite_invert = draw->state.point_sprite_invert; + wide->point_sprite_coords = draw->state.point_sprite; + } + else if (draw->state.use_vertex_pointsize) + wide->stage.point = wide_point_psiz; + else if (draw->state.point_size != 1.0) + wide->stage.point = wide_point_const; + else + wide->stage.point = clip_passthrough_point; + + + stage->next->begin( stage->next ); +} + + + +static void wide_end( struct clip_pipe_stage *stage ) +{ + stage->next->end( stage->next ); +} + +struct clip_pipe_stage *clip_pipe_wide( struct clip_pipeline *pipe ) +{ + struct wide_stage *wide = CALLOC_STRUCT(wide_stage); + + clip_pipe_alloc_tmps( &wide->stage, 4 ); + + wide->stage.pipe = pipe; + wide->stage.next = NULL; + wide->stage.begin = wide_begin; + wide->stage.point = wide_point_const; + wide->stage.line = wide_line; + wide->stage.tri = clip_passthrough_tri; + wide->stage.reset_tmps = clip_pipe_reset_tmps; + wide->stage.end = wide_end; + + return &wide->stage; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/descrip.mms xpsb-glx-0.19/mesa/src/mesa/descrip.mms --- xpsb-glx-0.19/mesa/src/mesa/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/descrip.mms 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,27 @@ +# Makefile for Mesa for VMS +# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl +# Date last revision : 7 March 2007 + +all : + set default [.main] + $(MMS)$(MMSQUALIFIERS) + set default [-.glapi] + $(MMS)$(MMSQUALIFIERS) + set default [-.shader] + $(MMS)$(MMSQUALIFIERS) + set default [-.drivers.common] + $(MMS)$(MMSQUALIFIERS) + set default [-.x11] + $(MMS)$(MMSQUALIFIERS) + set default [-.osmesa] + $(MMS)$(MMSQUALIFIERS) + set default [--.math] + $(MMS)$(MMSQUALIFIERS) + set default [-.tnl] + $(MMS)$(MMSQUALIFIERS) + set default [-.swrast] + $(MMS)$(MMSQUALIFIERS) + set default [-.swrast_setup] + $(MMS)$(MMSQUALIFIERS) + set default [-.vbo] + $(MMS)$(MMSQUALIFIERS) diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.c xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,414 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include "main/buffers.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/mtypes.h" +#include "amesa.h" + + +struct amesa_visual + { + GLvisual *GLVisual; /* inherit from GLvisual */ + GLboolean DBFlag; /* double buffered? */ + GLuint Depth; /* bits per pixel ( >= 15 ) */ + }; + + +struct amesa_buffer + { + GLframebuffer *GLBuffer; /* inherit from GLframebuffer */ + GLuint Width, Height; + BITMAP *Screen; + BITMAP *Background; + BITMAP *Active; + }; + + +struct amesa_context + { + GLcontext *GLContext; /* inherit from GLcontext */ + AMesaVisual Visual; + AMesaBuffer Buffer; + GLuint ClearColor; + GLuint CurrentColor; + }; + + +static void setup_dd_pointers(GLcontext *ctx); + + +/**********************************************************************/ +/***** drawing functions *****/ +/**********************************************************************/ + +#define FLIP(context, y) (context->Buffer->Height - (y) - 1) + +#include "allegro/generic.h" +#include "allegro/direct.h" + + +/**********************************************************************/ +/***** 15-bit accelerated drawing funcs *****/ +/**********************************************************************/ + +IMPLEMENT_WRITE_RGBA_SPAN(15, unsigned short) +IMPLEMENT_WRITE_RGB_SPAN(15, unsigned short) +IMPLEMENT_WRITE_MONO_RGBA_SPAN(15, unsigned short) +IMPLEMENT_READ_RGBA_SPAN(15, unsigned short) +IMPLEMENT_WRITE_RGBA_PIXELS(15, unsigned short) +IMPLEMENT_WRITE_MONO_RGBA_PIXELS(15, unsigned short) +IMPLEMENT_READ_RGBA_PIXELS(15, unsigned short) + + +/**********************************************************************/ +/***** 16-bit accelerated drawing funcs *****/ +/**********************************************************************/ + +IMPLEMENT_WRITE_RGBA_SPAN(16, unsigned short) +IMPLEMENT_WRITE_RGB_SPAN(16, unsigned short) +IMPLEMENT_WRITE_MONO_RGBA_SPAN(16, unsigned short) +IMPLEMENT_READ_RGBA_SPAN(16, unsigned short) +IMPLEMENT_WRITE_RGBA_PIXELS(16, unsigned short) +IMPLEMENT_WRITE_MONO_RGBA_PIXELS(16, unsigned short) +IMPLEMENT_READ_RGBA_PIXELS(16, unsigned short) + + +/**********************************************************************/ +/***** 32-bit accelerated drawing funcs *****/ +/**********************************************************************/ + +IMPLEMENT_WRITE_RGBA_SPAN(32, unsigned long) +IMPLEMENT_WRITE_RGB_SPAN(32, unsigned long) +IMPLEMENT_WRITE_MONO_RGBA_SPAN(32, unsigned long) +IMPLEMENT_READ_RGBA_SPAN(32, unsigned long) +IMPLEMENT_WRITE_RGBA_PIXELS(32, unsigned long) +IMPLEMENT_WRITE_MONO_RGBA_PIXELS(32, unsigned long) +IMPLEMENT_READ_RGBA_PIXELS(32, unsigned long) + + +/**********************************************************************/ +/***** Miscellaneous device driver funcs *****/ +/**********************************************************************/ + +static GLboolean set_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bit) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + GLboolean ok = GL_TRUE; + + if (bit == DD_FRONT_LEFT_BIT) + context->Buffer->Active = context->Buffer->Screen; + + else if (bit == DD_BACK_LEFT) + { + if (context->Buffer->Background) + context->Buffer->Active = context->Buffer->Background; + else + ok = GL_FALSE; + } + + else + ok = GL_FALSE; + + return ok; + } + + +static void get_buffer_size(GLcontext *ctx, GLuint *width, GLuint *height) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + + *width = context->Buffer->Width; + *height = context->Buffer->Height; + } + + +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ +static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + /* poll for window size change and realloc software Z/stencil/etc if needed */ + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->WinSysDrawBuffer; + get_buffer_size( &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } + +} + + +/**********************************************************************/ +/**********************************************************************/ + +static void setup_dd_pointers(GLcontext *ctx) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + + /* Initialize all the pointers in the driver struct. Do this whenever */ + /* a new context is made current or we change buffers via set_buffer! */ + + ctx->Driver.UpdateState = setup_dd_pointers; + ctx->Driver.SetBuffer = set_buffer; + ctx->Driver.GetBufferSize = get_buffer_size; + ctx->Driver.Viewport = viewport; + + ctx->Driver.Color = set_color_generic; + ctx->Driver.ClearColor = clear_color_generic; + ctx->Driver.Clear = clear_generic; + ctx->Driver.WriteRGBASpan = write_rgba_span_generic; + ctx->Driver.WriteRGBSpan = write_rgb_span_generic; + ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_generic; + ctx->Driver.WriteRGBAPixels = write_rgba_pixels_generic; + ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_generic; + ctx->Driver.ReadRGBASpan = read_rgba_span_generic; + ctx->Driver.ReadRGBAPixels = read_rgba_pixels_generic; + + if (context->Buffer->Active != screen) + { + switch (context->Visual->Depth) + { + case 15: + ctx->Driver.WriteRGBASpan = write_rgba_span_15; + ctx->Driver.WriteRGBSpan = write_rgb_span_15; + ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_15; + ctx->Driver.WriteRGBAPixels = write_rgba_pixels_15; + ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_15; + ctx->Driver.ReadRGBASpan = read_rgba_span_15; + ctx->Driver.ReadRGBAPixels = read_rgba_pixels_15; + break; + + case 16: + ctx->Driver.WriteRGBASpan = write_rgba_span_16; + ctx->Driver.WriteRGBSpan = write_rgb_span_16; + ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_16; + ctx->Driver.WriteRGBAPixels = write_rgba_pixels_16; + ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_16; + ctx->Driver.ReadRGBASpan = read_rgba_span_16; + ctx->Driver.ReadRGBAPixels = read_rgba_pixels_16; + break; + + case 32: + ctx->Driver.WriteRGBASpan = write_rgba_span_32; + ctx->Driver.WriteRGBSpan = write_rgb_span_32; + ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_32; + ctx->Driver.WriteRGBAPixels = write_rgba_pixels_32; + ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_32; + ctx->Driver.ReadRGBASpan = read_rgba_span_32; + ctx->Driver.ReadRGBAPixels = read_rgba_pixels_32; + break; + } + } + } + + +/**********************************************************************/ +/***** AMesa Public API Functions *****/ +/**********************************************************************/ + + +AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, + GLint depthSize, GLint stencilSize, GLint accumSize) + { + AMesaVisual visual; + GLbyte redBits, greenBits, blueBits; + + visual = (AMesaVisual)calloc(1, sizeof(struct amesa_visual)); + if (!visual) + return NULL; + + switch (depth) + { + case 15: + redBits = 5; + greenBits = 5; + blueBits = 5; + break; + + case 16: + redBits = 5; + greenBits = 6; + blueBits = 5; + break; + + case 24: case 32: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + + default: + free(visual); + return NULL; + } + + visual->DBFlag = dbFlag; + visual->Depth = depth; + visual->GLVisual = _mesa_create_visual(GL_TRUE, /* rgb mode */ + dbFlag, /* db_flag */ + GL_FALSE, /* stereo */ + redBits, greenBits, blueBits, 8, + 0, /* index bits */ + depthSize, /* depth bits */ + stencilSize,/* stencil bits */ + accumSize, /* accum bits */ + accumSize, /* accum bits */ + accumSize, /* accum bits */ + accumSize, /* accum bits */ + 1 ); + if (!visual->GLVisual) + { + free(visual); + return NULL; + } + + return visual; + } + + +void AMesaDestroyVisual(AMesaVisual visual) + { + _mesa_destroy_visual(visual->GLVisual); + free(visual); + } + + +AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, + GLint width, GLint height) + { + AMesaBuffer buffer; + + buffer = (AMesaBuffer)calloc(1, sizeof(struct amesa_buffer)); + if (!buffer) + return NULL; + + buffer->Screen = NULL; + buffer->Background = NULL; + buffer->Active = NULL; + buffer->Width = width; + buffer->Height = height; + + if (visual->DBFlag) + { + buffer->Background = create_bitmap_ex(visual->Depth, width, height); + if (!buffer->Background) + { + free(buffer); + return NULL; + } + } + + buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual); + if (!buffer->GLBuffer) + { + if (buffer->Background) destroy_bitmap(buffer->Background); + free(buffer); + return NULL; + } + + return buffer; + } + + +void AMesaDestroyBuffer(AMesaBuffer buffer) +{ + if (buffer->Screen) destroy_bitmap(buffer->Screen); + if (buffer->Background) destroy_bitmap(buffer->Background); + _mesa_unreference_framebuffer(&buffer->GLBuffer); + free(buffer); +} + + +AMesaContext AMesaCreateContext(AMesaVisual visual, + AMesaContext share) +{ + AMesaContext context; + GLboolean direct = GL_FALSE; + + context = (AMesaContext)calloc(1, sizeof(struct amesa_context)); + if (!context) + return NULL; + + context->Visual = visual; + context->Buffer = NULL; + context->ClearColor = 0; + context->CurrentColor = 0; + context->GLContext = _mesa_create_context(visual->GLVisual, + share ? share->GLContext : NULL, + (void *) context, GL_FALSE ); + if (!context->GLContext) + { + free(context); + return NULL; + } + + return context; +} + + +void AMesaDestroyContext(AMesaContext context) +{ + _mesa_destroy_context(context->GLContext); + free(context); +} + + +GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer) +{ + if (context && buffer) { + set_color_depth(context->Visual->Depth); + if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0) + return GL_FALSE; + + context->Buffer = buffer; + buffer->Screen = screen; + buffer->Active = buffer->Background ? buffer->Background : screen; + + setup_dd_pointers(context->GLContext); + _mesa_make_current(context->GLContext, buffer->GLBuffer); + } + else { + /* XXX I don't think you want to destroy anything here! */ + destroy_bitmap(context->Buffer->Screen); + context->Buffer->Screen = NULL; + context->Buffer->Active = NULL; + context->Buffer = NULL; + _mesa_make_current(NULL, NULL); + } + + return GL_TRUE; +} + + +void AMesaSwapBuffers(AMesaBuffer buffer) +{ + if (buffer->Background) { + blit(buffer->Background, buffer->Screen, + 0, 0, 0, 0, + buffer->Width, buffer->Height); + } +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.h xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/amesa.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,65 @@ +/* + * Mesa 3-D graphics library + * Version: 3.3 + * + * 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. + */ + + +/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */ + + +#ifndef AMESA_H +#define AMESA_H + + +#define AMESA_MAJOR_VERSION 3 +#define AMESA_MINOR_VERSION 3 + + +typedef struct amesa_visual *AMesaVisual; +typedef struct amesa_buffer *AMesaBuffer; +typedef struct amesa_context *AMesaContext; + + +extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, + GLint depthSize, + GLint stencilSize, + GLint accumSize); + +extern void AMesaDestroyVisual(AMesaVisual visual); + +extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, + GLint width, GLint height); + +extern void AMesaDestroyBuffer(AMesaBuffer buffer); + + +extern AMesaContext AMesaCreateContext(AMesaVisual visual, + AMesaContext sharelist); + +extern void AMesaDestroyContext(AMesaContext context); + +extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer); + +extern void AMesaSwapBuffers(AMesaBuffer buffer); + + +#endif /* AMESA_H */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/direct.h xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/direct.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/direct.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/direct.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,189 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#define DESTINATION(BMP, X, Y, TYPE) \ + ({ \ + BITMAP *_bmp = BMP; \ + \ + (TYPE*)(_bmp->line[_bmp->h - (Y) - 1]) + (X); \ + }) + + +#define IMPLEMENT_WRITE_RGBA_SPAN(DEPTH, TYPE) \ +static void write_rgba_span_##DEPTH (const GLcontext *ctx, \ + GLuint n, GLint x, GLint y, \ + const GLubyte rgba[][4], \ + const GLubyte mask[]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \ + \ + if (mask) \ + { \ + while (n--) \ + { \ + if (mask[0]) d[0] = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \ + d++; rgba++; mask++; \ + } \ + } \ + else \ + { \ + while (n--) \ + { \ + d[0] = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \ + d++; rgba++; \ + } \ + } \ + } + + +#define IMPLEMENT_WRITE_RGB_SPAN(DEPTH, TYPE) \ +static void write_rgb_span_##DEPTH (const GLcontext *ctx, \ + GLuint n, GLint x, GLint y, \ + const GLubyte rgb[][3], \ + const GLubyte mask[]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \ + \ + if (mask) \ + { \ + while (n--) \ + { \ + if (mask[0]) d[0] = makecol##DEPTH(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]); \ + d++; rgb++; mask++; \ + } \ + } \ + else \ + { \ + while (n--) \ + { \ + d[0] = makecol##DEPTH(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]); \ + d++; rgb++; \ + } \ + } \ + } + + +#define IMPLEMENT_WRITE_MONO_RGBA_SPAN(DEPTH, TYPE) \ +static void write_mono_rgba_span_##DEPTH (const GLcontext *ctx, \ + GLuint n, GLint x, GLint y, \ + const GLubyte mask[]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + TYPE color = context->CurrentColor; \ + TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \ + \ + while (n--) \ + { \ + if (mask[0]) d[0] = color; \ + d++; mask++; \ + } \ + } + + +#define IMPLEMENT_READ_RGBA_SPAN(DEPTH, TYPE) \ +static void read_rgba_span_##DEPTH (const GLcontext *ctx, \ + GLuint n, GLint x, GLint y, \ + GLubyte rgba[][4]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + BITMAP *bmp = context->Buffer->Active; \ + TYPE *d = DESTINATION(bmp, x, y, TYPE); \ + \ + while (n--) \ + { \ + rgba[0][RCOMP] = getr##DEPTH(d[0]); \ + rgba[0][GCOMP] = getg##DEPTH(d[0]); \ + rgba[0][BCOMP] = getb##DEPTH(d[0]); \ + rgba[0][ACOMP] = 255; \ + \ + d++; rgba++; \ + } \ + } + + +#define IMPLEMENT_WRITE_RGBA_PIXELS(DEPTH, TYPE) \ +static void write_rgba_pixels_##DEPTH (const GLcontext *ctx, \ + GLuint n, \ + const GLint x[], \ + const GLint y[], \ + const GLubyte rgba[][4], \ + const GLubyte mask[]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + BITMAP *bmp = context->Buffer->Active; \ + \ + while (n--) \ + { \ + if (mask[0]) *DESTINATION(bmp, x[0], y[0], TYPE) = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \ + rgba++; x++; y++; mask++; \ + } \ + } + + + +#define IMPLEMENT_WRITE_MONO_RGBA_PIXELS(DEPTH, TYPE) \ +static void write_mono_rgba_pixels_##DEPTH (const GLcontext *ctx, \ + GLuint n, \ + const GLint x[], \ + const GLint y[], \ + const GLubyte mask[]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + TYPE color = context->CurrentColor; \ + BITMAP *bmp = context->Buffer->Active; \ + \ + while (n--) \ + { \ + if (mask[0]) *DESTINATION(bmp, x[0], y[0], TYPE) = color; \ + x++; y++; mask++; \ + } \ + } + + +#define IMPLEMENT_READ_RGBA_PIXELS(DEPTH, TYPE) \ +static void read_rgba_pixels_##DEPTH (const GLcontext *ctx, \ + GLuint n, \ + const GLint x[], \ + const GLint y[], \ + GLubyte rgba[][4], \ + const GLubyte mask[]) \ + { \ + AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ + BITMAP *bmp = context->Buffer->Active; \ + \ + while (n--) \ + { \ + if (mask[0]) \ + { \ + int color = *DESTINATION(bmp, x[0], y[0], TYPE); \ + \ + rgba[0][RCOMP] = getr##DEPTH(color); \ + rgba[0][GCOMP] = getg##DEPTH(color); \ + rgba[0][BCOMP] = getb##DEPTH(color); \ + rgba[0][ACOMP] = 255; \ + } \ + \ + x++; y++; rgba++; mask++; \ + } \ + } + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/generic.h xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/generic.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/generic.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/allegro/generic.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,234 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +static void clear_color_generic(GLcontext *ctx, const GLfloat color[4]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + GLubyte r, g, b; + CLAMPED_FLOAT_TO_UBYTE(r, color[0]); + CLAMPED_FLOAT_TO_UBYTE(g, color[1]); + CLAMPED_FLOAT_TO_UBYTE(b, color[2]); + context->ClearColor = makecol(r, g, b); + } + + +static void set_color_generic(GLcontext *ctx, + GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + + context->CurrentColor = makecol(red, green, blue); + } + + +static GLbitfield clear_generic(GLcontext *ctx, + GLbitfield mask, GLboolean all, + GLint x, GLint y, + GLint width, GLint height) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + + if (mask & GL_COLOR_BUFFER_BIT) + { + if (all) + clear_to_color(context->Buffer->Active, context->ClearColor); + else + rect(context->Buffer->Active, + x, y, x+width-1, y+height-1, + context->ClearColor); + } + + return mask & (~GL_COLOR_BUFFER_BIT); + } + + +static void write_rgba_span_generic(const GLcontext *ctx, + GLuint n, GLint x, GLint y, + const GLubyte rgba[][4], + const GLubyte mask[]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + + y = FLIP(context, y); + + if (mask) + { + while (n--) + { + if (mask[0]) putpixel(bmp, x, y, makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP])); + x++; mask++; rgba++; + } + } + else + { + while (n--) + { + putpixel(bmp, x, y, makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP])); + x++; rgba++; + } + } + } + + +static void write_rgb_span_generic(const GLcontext *ctx, + GLuint n, GLint x, GLint y, + const GLubyte rgb[][3], + const GLubyte mask[]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + + y = FLIP(context, y); + + if (mask) + { + while(n--) + { + if (mask[0]) putpixel(bmp, x, y, makecol(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP])); + x++; mask++; rgb++; + } + } + else + { + while (n--) + { + putpixel(bmp, x, y, makecol(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP])); + x++; rgb++; + } + } + } + + +static void write_mono_rgba_span_generic(const GLcontext *ctx, + GLuint n, GLint x, GLint y, + const GLubyte mask[]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + int color = context->CurrentColor; + + y = FLIP(context, y); + + if (mask) + { + while(n--) + { + if (mask[0]) putpixel(bmp, x, y, color); + x++; mask++; + } + } + else + { + while(n--) + { + putpixel(bmp, x, y, color); + x++; + } + } + } + + +static void read_rgba_span_generic(const GLcontext *ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + + y = FLIP(context, y); + + while (n--) + { + int color = getpixel(bmp, x, y); + + rgba[0][RCOMP] = getr(color); + rgba[0][GCOMP] = getg(color); + rgba[0][BCOMP] = getb(color); + rgba[0][ACOMP] = 255; + + x++; rgba++; + } + } + + +static void write_rgba_pixels_generic(const GLcontext *ctx, + GLuint n, + const GLint x[], + const GLint y[], + const GLubyte rgba[][4], + const GLubyte mask[]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + + while (n--) + { + if (mask[0]) putpixel(bmp, x[0], FLIP(context, y[0]), makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP])); + x++; y++; mask++; + } + } + + +static void write_mono_rgba_pixels_generic(const GLcontext *ctx, + GLuint n, + const GLint x[], + const GLint y[], + const GLubyte mask[]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + int color = context->CurrentColor; + + while (n--) + { + if (mask[0]) putpixel(bmp, x[0], FLIP(context, y[0]), color); + x++; y++; mask++; + } + } + + +static void read_rgba_pixels_generic(const GLcontext *ctx, + GLuint n, + const GLint x[], + const GLint y[], + GLubyte rgba[][4], + const GLubyte mask[]) + { + AMesaContext context = (AMesaContext)(ctx->DriverCtx); + BITMAP *bmp = context->Buffer->Active; + + while (n--) + { + if (mask[0]) + { + int color = getpixel(bmp, x[0], FLIP(context, y[0])); + + rgba[0][RCOMP] = getr(color); + rgba[0][GCOMP] = getg(color); + rgba[0][BCOMP] = getb(color); + rgba[0][ACOMP] = 255; + } + + x++; y++; mask++; rgba++; + } + } + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/beos/GLView.cpp xpsb-glx-0.19/mesa/src/mesa/drivers/beos/GLView.cpp --- xpsb-glx-0.19/mesa/src/mesa/drivers/beos/GLView.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/beos/GLView.cpp 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,1575 @@ +/* + * Mesa 3-D graphics library + * Version: 6.1 + * + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#include +#include + +extern "C" { + +#include "glheader.h" +#include "version.h" +#include "buffers.h" +#include "bufferobj.h" +#include "context.h" +#include "colormac.h" +#include "depth.h" +#include "extensions.h" +#include "macros.h" +#include "matrix.h" +#include "mtypes.h" +#include "texformat.h" +#include "texobj.h" +#include "teximage.h" +#include "texstore.h" +#include "vbo/vbo.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "swrast/s_context.h" +#include "swrast/s_depth.h" +#include "swrast/s_lines.h" +#include "swrast/s_triangle.h" +#include "swrast/s_trispan.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + +#include "drivers/common/driverfuncs.h" + +} // extern "C" + +#include +#include + +// BeOS component ordering for B_RGBA32 bitmap format +#if B_HOST_IS_LENDIAN + #define BE_RCOMP 2 + #define BE_GCOMP 1 + #define BE_BCOMP 0 + #define BE_ACOMP 3 + + #define PACK_B_RGBA32(color) (color[BCOMP] | (color[GCOMP] << 8) | \ + (color[RCOMP] << 16) | (color[ACOMP] << 24)) + + #define PACK_B_RGB32(color) (color[BCOMP] | (color[GCOMP] << 8) | \ + (color[RCOMP] << 16) | 0xFF000000) +#else + // Big Endian B_RGBA32 bitmap format + #define BE_RCOMP 1 + #define BE_GCOMP 2 + #define BE_BCOMP 3 + #define BE_ACOMP 0 + + #define PACK_B_RGBA32(color) (color[ACOMP] | (color[RCOMP] << 8) | \ + (color[GCOMP] << 16) | (color[BCOMP] << 24)) + + #define PACK_B_RGB32(color) ((color[RCOMP] << 8) | (color[GCOMP] << 16) | \ + (color[BCOMP] << 24) | 0xFF000000) +#endif + +#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord) - 1) + +const char * color_space_name(color_space space); + +// +// This object hangs off of the BGLView object. We have to use +// Be's BGLView class as-is to maintain binary compatibility (we +// can't add new members to it). Instead we just put all our data +// in this class and use BGLVIew::m_gc to point to it. +// +class MesaDriver +{ +friend class BGLView; +public: + MesaDriver(); + ~MesaDriver(); + + void Init(BGLView * bglview, GLcontext * c, GLvisual * v, GLframebuffer * b); + + void LockGL(); + void UnlockGL(); + void SwapBuffers() const; + status_t CopyPixelsOut(BPoint source, BBitmap *dest); + status_t CopyPixelsIn(BBitmap *source, BPoint dest); + + void CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const; + void Draw(BRect updateRect) const; + +private: + MesaDriver(const MesaDriver &rhs); // copy constructor illegal + MesaDriver &operator=(const MesaDriver &rhs); // assignment oper. illegal + + GLcontext * m_glcontext; + GLvisual * m_glvisual; + GLframebuffer * m_glframebuffer; + + BGLView * m_bglview; + BBitmap * m_bitmap; + + GLchan m_clear_color[4]; // buffer clear color + GLuint m_clear_index; // buffer clear color index + GLint m_bottom; // used for flipping Y coords + GLuint m_width; + GLuint m_height; + + // Mesa Device Driver callback functions + static void UpdateState(GLcontext *ctx, GLuint new_state); + static void ClearIndex(GLcontext *ctx, GLuint index); + static void ClearColor(GLcontext *ctx, const GLfloat color[4]); + static void Clear(GLcontext *ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, + GLint width, GLint height); + static void ClearFront(GLcontext *ctx, GLboolean all, GLint x, GLint y, + GLint width, GLint height); + static void ClearBack(GLcontext *ctx, GLboolean all, GLint x, GLint y, + GLint width, GLint height); + static void Index(GLcontext *ctx, GLuint index); + static void Color(GLcontext *ctx, GLubyte r, GLubyte g, + GLubyte b, GLubyte a); + static void SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum mode); + static void GetBufferSize(GLframebuffer * framebuffer, GLuint *width, + GLuint *height); + static void Error(GLcontext *ctx); + static const GLubyte * GetString(GLcontext *ctx, GLenum name); + static void Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); + + // Front-buffer functions + static void WriteRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteRGBSpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][3], + const GLubyte mask[]); + static void WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLchan color[4], + const GLubyte mask[]); + static void WriteRGBAPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLchan color[4], + const GLubyte mask[]); + static void WriteCI32SpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLuint index[], const GLubyte mask[]); + static void WriteCI8SpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLubyte index[], const GLubyte mask[]); + static void WriteMonoCISpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLuint colorIndex, const GLubyte mask[]); + static void WriteCI32PixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[]); + static void WriteMonoCIPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[]); + static void ReadCI32SpanFront(const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[]); + static void ReadRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLubyte rgba[][4]); + static void ReadCI32PixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[]); + static void ReadRGBAPixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[]); + + // Back buffer functions + static void WriteRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteRGBSpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][3], + const GLubyte mask[]); + static void WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLchan color[4], + const GLubyte mask[]); + static void WriteRGBAPixelsBack(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLchan color[4], + const GLubyte mask[]); + static void WriteCI32SpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLuint index[], const GLubyte mask[]); + static void WriteCI8SpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte index[], const GLubyte mask[]); + static void WriteMonoCISpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, GLuint colorIndex, + const GLubyte mask[]); + static void WriteCI32PixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[]); + static void WriteMonoCIPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[]); + static void ReadCI32SpanBack(const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[]); + static void ReadRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLubyte rgba[][4]); + static void ReadCI32PixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[]); + static void ReadRGBAPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[]); + +}; + +//------------------------------------------------------------------ +// Public interface methods +//------------------------------------------------------------------ + + +// +// Input: rect - initial rectangle +// name - window name +// resizingMode - example: B_FOLLOW_NONE +// mode - usually 0 ? +// options - Bitwise-OR of BGL_* tokens +// +BGLView::BGLView(BRect rect, char *name, + ulong resizingMode, ulong mode, + ulong options) + : BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS) // | B_FULL_UPDATE_ON_RESIZE) +{ + // We don't support single buffering (yet): double buffering forced. + options |= BGL_DOUBLE; + + const GLboolean rgbFlag = ((options & BGL_INDEX) == 0); + const GLboolean alphaFlag = ((options & BGL_ALPHA) == BGL_ALPHA); + const GLboolean dblFlag = ((options & BGL_DOUBLE) == BGL_DOUBLE); + const GLboolean stereoFlag = false; + const GLint depth = (options & BGL_DEPTH) ? 16 : 0; + const GLint stencil = (options & BGL_STENCIL) ? 8 : 0; + const GLint accum = (options & BGL_ACCUM) ? 16 : 0; + const GLint index = (options & BGL_INDEX) ? 32 : 0; + const GLint red = rgbFlag ? 8 : 0; + const GLint green = rgbFlag ? 8 : 0; + const GLint blue = rgbFlag ? 8 : 0; + const GLint alpha = alphaFlag ? 8 : 0; + + m_options = options | BGL_INDIRECT; + + struct dd_function_table functions; + + if (!rgbFlag) { + fprintf(stderr, "Mesa Warning: color index mode not supported\n"); + } + + // Allocate auxiliary data object + MesaDriver * md = new MesaDriver(); + + // examine option flags and create gl_context struct + GLvisual * visual = _mesa_create_visual( rgbFlag, + dblFlag, + stereoFlag, + red, green, blue, alpha, + index, + depth, + stencil, + accum, accum, accum, accum, + 1 + ); + + // Initialize device driver function table + _mesa_init_driver_functions(&functions); + + functions.GetString = md->GetString; + functions.UpdateState = md->UpdateState; + functions.GetBufferSize = md->GetBufferSize; + functions.Clear = md->Clear; + functions.ClearIndex = md->ClearIndex; + functions.ClearColor = md->ClearColor; + functions.Error = md->Error; + functions.Viewport = md->Viewport; + + // create core context + GLcontext *ctx = _mesa_create_context(visual, NULL, &functions, md); + if (! ctx) { + _mesa_destroy_visual(visual); + delete md; + return; + } + _mesa_enable_sw_extensions(ctx); + _mesa_enable_1_3_extensions(ctx); + _mesa_enable_1_4_extensions(ctx); + _mesa_enable_1_5_extensions(ctx); + + + // create core framebuffer + GLframebuffer * buffer = _mesa_create_framebuffer(visual, + depth > 0 ? GL_TRUE : GL_FALSE, + stencil > 0 ? GL_TRUE: GL_FALSE, + accum > 0 ? GL_TRUE : GL_FALSE, + alphaFlag + ); + + /* Initialize the software rasterizer and helper modules. + */ + _swrast_CreateContext(ctx); + _vbo_CreateContext(ctx); + _tnl_CreateContext(ctx); + _swsetup_CreateContext(ctx); + _swsetup_Wakeup(ctx); + + md->Init(this, ctx, visual, buffer ); + + // Hook aux data into BGLView object + m_gc = md; + + // some stupid applications (Quake2) don't even think about calling LockGL() + // before using glGetString and friends... so make sure there is at least a + // valid context. + if (!_mesa_get_current_context()) { + LockGL(); + // not needed, we don't have a looper yet: UnlockLooper(); + } + +} + + +BGLView::~BGLView() +{ + // printf("BGLView destructor\n"); + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + delete md; +} + +void BGLView::LockGL() +{ + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->LockGL(); +} + +void BGLView::UnlockGL() +{ + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->UnlockGL(); +} + +void BGLView::SwapBuffers() +{ + SwapBuffers(false); +} + +void BGLView::SwapBuffers(bool vSync) +{ + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->SwapBuffers(); + + if (vSync) { + BScreen screen(Window()); + screen.WaitForRetrace(); + } +} + + +#if 0 +void BGLView::CopySubBufferMESA(GLint x, GLint y, GLuint width, GLuint height) +{ + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->CopySubBuffer(x, y, width, height); +} +#endif + +BView * BGLView::EmbeddedView() +{ + return NULL; +} + +status_t BGLView::CopyPixelsOut(BPoint source, BBitmap *dest) +{ + if (! dest || ! dest->Bounds().IsValid()) + return B_BAD_VALUE; + + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + return md->CopyPixelsOut(source, dest); +} + +status_t BGLView::CopyPixelsIn(BBitmap *source, BPoint dest) +{ + if (! source || ! source->Bounds().IsValid()) + return B_BAD_VALUE; + + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + return md->CopyPixelsIn(source, dest); +} + + +void BGLView::ErrorCallback(unsigned long errorCode) // Mesa's GLenum is not ulong but uint! +{ + char msg[32]; + sprintf(msg, "GL: Error code $%04lx.", errorCode); + // debugger(msg); + fprintf(stderr, "%s\n", msg); + return; +} + +void BGLView::Draw(BRect updateRect) +{ + // printf("BGLView::Draw()\n"); + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->Draw(updateRect); +} + +void BGLView::AttachedToWindow() +{ + BView::AttachedToWindow(); + + // don't paint window background white when resized + SetViewColor(B_TRANSPARENT_32_BIT); +} + +void BGLView::AllAttached() +{ + BView::AllAttached(); +// printf("BGLView AllAttached\n"); +} + +void BGLView::DetachedFromWindow() +{ + BView::DetachedFromWindow(); +} + +void BGLView::AllDetached() +{ + BView::AllDetached(); +// printf("BGLView AllDetached"); +} + +void BGLView::FrameResized(float width, float height) +{ + return BView::FrameResized(width, height); +} + +status_t BGLView::Perform(perform_code d, void *arg) +{ + return BView::Perform(d, arg); +} + + +status_t BGLView::Archive(BMessage *data, bool deep) const +{ + return BView::Archive(data, deep); +} + +void BGLView::MessageReceived(BMessage *msg) +{ + BView::MessageReceived(msg); +} + +void BGLView::SetResizingMode(uint32 mode) +{ + BView::SetResizingMode(mode); +} + +void BGLView::Show() +{ + BView::Show(); +} + +void BGLView::Hide() +{ + BView::Hide(); +} + +BHandler *BGLView::ResolveSpecifier(BMessage *msg, int32 index, + BMessage *specifier, int32 form, + const char *property) +{ + return BView::ResolveSpecifier(msg, index, specifier, form, property); +} + +status_t BGLView::GetSupportedSuites(BMessage *data) +{ + return BView::GetSupportedSuites(data); +} + +void BGLView::DirectConnected( direct_buffer_info *info ) +{ +#if 0 + if (! m_direct_connected && m_direct_connection_disabled) + return; + + direct_info_locker->Lock(); + switch(info->buffer_state & B_DIRECT_MODE_MASK) { + case B_DIRECT_START: + m_direct_connected = true; + case B_DIRECT_MODIFY: + // Get clipping information + if (m_clip_list) + free(m_clip_list); + m_clip_list_count = info->clip_list_count; + m_clip_list = (clipping_rect *) malloc(m_clip_list_count*sizeof(clipping_rect)); + if (m_clip_list) { + memcpy(m_clip_list, info->clip_list, m_clip_list_count*sizeof(clipping_rect)); + fBits = (uint8 *) info->bits; + fRowBytes = info->bytes_per_row; + fFormat = info->pixel_format; + fBounds = info->window_bounds; + fDirty = true; + } + break; + case B_DIRECT_STOP: + fConnected = false; + break; + } + direct_info_locker->Unlock(); +#endif +} + +void BGLView::EnableDirectMode( bool enabled ) +{ + // TODO +} + + +//---- virtual reserved methods ---------- + +void BGLView::_ReservedGLView1() {} +void BGLView::_ReservedGLView2() {} +void BGLView::_ReservedGLView3() {} +void BGLView::_ReservedGLView4() {} +void BGLView::_ReservedGLView5() {} +void BGLView::_ReservedGLView6() {} +void BGLView::_ReservedGLView7() {} +void BGLView::_ReservedGLView8() {} + +#if 0 +// Not implemented!!! + +BGLView::BGLView(const BGLView &v) + : BView(v) +{ + // XXX not sure how this should work + printf("Warning BGLView::copy constructor not implemented\n"); +} + +BGLView &BGLView::operator=(const BGLView &v) +{ + printf("Warning BGLView::operator= not implemented\n"); + return *this; +} +#endif + +void BGLView::dither_front() +{ + // no-op +} + +bool BGLView::confirm_dither() +{ + // no-op + return false; +} + +void BGLView::draw(BRect r) +{ + // XXX no-op ??? +} + +/* Direct Window stuff */ +void BGLView::drawScanline( int x1, int x2, int y, void *data ) +{ + // no-op +} + +void BGLView::scanlineHandler(struct rasStateRec *state, + GLint x1, GLint x2) +{ + // no-op +} + +void BGLView::lock_draw() +{ + // no-op +} + +void BGLView::unlock_draw() +{ + // no-op +} + +bool BGLView::validateView() +{ + // no-op + return true; +} + +// #pragma mark - + +MesaDriver::MesaDriver() +{ + m_glcontext = NULL; + m_glvisual = NULL; + m_glframebuffer = NULL; + m_bglview = NULL; + m_bitmap = NULL; + + m_clear_color[BE_RCOMP] = 0; + m_clear_color[BE_GCOMP] = 0; + m_clear_color[BE_BCOMP] = 0; + m_clear_color[BE_ACOMP] = 0; + + m_clear_index = 0; +} + + +MesaDriver::~MesaDriver() +{ + _mesa_destroy_visual(m_glvisual); + _mesa_destroy_framebuffer(m_glframebuffer); + _mesa_destroy_context(m_glcontext); + + delete m_bitmap; +} + + +void MesaDriver::Init(BGLView * bglview, GLcontext * ctx, GLvisual * visual, GLframebuffer * framebuffer) +{ + m_bglview = bglview; + m_glcontext = ctx; + m_glvisual = visual; + m_glframebuffer = framebuffer; + + MesaDriver * md = (MesaDriver *) ctx->DriverCtx; + struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx ); + TNLcontext * tnl = TNL_CONTEXT(ctx); + + assert(md->m_glcontext == ctx ); + assert(tnl); + assert(swdd); + + // Use default TCL pipeline + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + swdd->SetBuffer = this->SetBuffer; +} + + +void MesaDriver::LockGL() +{ + m_bglview->LockLooper(); + + UpdateState(m_glcontext, 0); + _mesa_make_current(m_glcontext, m_glframebuffer); +} + + +void MesaDriver::UnlockGL() +{ + if (m_bglview->Looper()->IsLocked()) + m_bglview->UnlockLooper(); + // Could call _mesa_make_current(NULL, NULL) but it would just + // hinder performance +} + + +void MesaDriver::SwapBuffers() const +{ + _mesa_notifySwapBuffers(m_glcontext); + + if (m_bitmap) { + m_bglview->LockLooper(); + m_bglview->DrawBitmap(m_bitmap); + m_bglview->UnlockLooper(); + }; +} + + +void MesaDriver::CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const +{ + if (m_bitmap) { + // Source bitmap and view's bitmap are same size. + // Source and dest rectangle are the same. + // Note (x,y) = (0,0) is the lower-left corner, have to flip Y + BRect srcAndDest; + srcAndDest.left = x; + srcAndDest.right = x + width - 1; + srcAndDest.bottom = m_bottom - y; + srcAndDest.top = srcAndDest.bottom - height + 1; + m_bglview->DrawBitmap(m_bitmap, srcAndDest, srcAndDest); + } +} + +status_t MesaDriver::CopyPixelsOut(BPoint location, BBitmap *bitmap) +{ + color_space scs = m_bitmap->ColorSpace(); + color_space dcs = bitmap->ColorSpace(); + + if (scs != dcs && (scs != B_RGBA32 || dcs != B_RGB32)) { + printf("CopyPixelsOut(): incompatible color space: %s != %s\n", + color_space_name(scs), + color_space_name(dcs)); + return B_BAD_TYPE; + } + + // debugger("CopyPixelsOut()"); + + BRect sr = m_bitmap->Bounds(); + BRect dr = bitmap->Bounds(); + + sr = sr & dr.OffsetBySelf(location); + dr = sr.OffsetByCopy(-location.x, -location.y); + + uint8 *ps = (uint8 *) m_bitmap->Bits(); + uint8 *pd = (uint8 *) bitmap->Bits(); + uint32 *s, *d; + uint32 y; + for (y = (uint32) sr.top; y <= (uint32) sr.bottom; y++) { + s = (uint32 *) (ps + y * m_bitmap->BytesPerRow()); + s += (uint32) sr.left; + + d = (uint32 *) (pd + (y + (uint32) (dr.top - sr.top)) * bitmap->BytesPerRow()); + d += (uint32) dr.left; + + memcpy(d, s, dr.IntegerWidth() * 4); + } + return B_OK; +} + +status_t MesaDriver::CopyPixelsIn(BBitmap *bitmap, BPoint location) +{ + color_space scs = bitmap->ColorSpace(); + color_space dcs = m_bitmap->ColorSpace(); + + if (scs != dcs && (dcs != B_RGBA32 || scs != B_RGB32)) { + printf("CopyPixelsIn(): incompatible color space: %s != %s\n", + color_space_name(scs), + color_space_name(dcs)); + return B_BAD_TYPE; + } + + // debugger("CopyPixelsIn()"); + + BRect sr = bitmap->Bounds(); + BRect dr = m_bitmap->Bounds(); + + sr = sr & dr.OffsetBySelf(location); + dr = sr.OffsetByCopy(-location.x, -location.y); + + uint8 *ps = (uint8 *) bitmap->Bits(); + uint8 *pd = (uint8 *) m_bitmap->Bits(); + uint32 *s, *d; + uint32 y; + for (y = (uint32) sr.top; y <= (uint32) sr.bottom; y++) { + s = (uint32 *) (ps + y * bitmap->BytesPerRow()); + s += (uint32) sr.left; + + d = (uint32 *) (pd + (y + (uint32) (dr.top - sr.top)) * m_bitmap->BytesPerRow()); + d += (uint32) dr.left; + + memcpy(d, s, dr.IntegerWidth() * 4); + } + return B_OK; +} + + +void MesaDriver::Draw(BRect updateRect) const +{ + if (m_bitmap) + m_bglview->DrawBitmap(m_bitmap, updateRect, updateRect); +} + + +void MesaDriver::Error(GLcontext *ctx) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + if (md && md->m_bglview) + md->m_bglview->ErrorCallback((unsigned long) ctx->ErrorValue); +} + +void MesaDriver::UpdateState( GLcontext *ctx, GLuint new_state ) +{ + struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx ); + + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _vbo_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + + if (ctx->Color.DrawBuffer[0] == GL_FRONT) { + /* read/write front buffer */ + swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanFront; + swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanFront; + swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsFront; + swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanFront; + swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsFront; + swdd->WriteCI32Span = MesaDriver::WriteCI32SpanFront; + swdd->WriteCI8Span = MesaDriver::WriteCI8SpanFront; + swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanFront; + swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsFront; + swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsFront; + swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanFront; + swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsFront; + swdd->ReadCI32Span = MesaDriver::ReadCI32SpanFront; + swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsFront; + } + else { + /* read/write back buffer */ + swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanBack; + swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanBack; + swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsBack; + swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanBack; + swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsBack; + swdd->WriteCI32Span = MesaDriver::WriteCI32SpanBack; + swdd->WriteCI8Span = MesaDriver::WriteCI8SpanBack; + swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanBack; + swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsBack; + swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsBack; + swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanBack; + swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsBack; + swdd->ReadCI32Span = MesaDriver::ReadCI32SpanBack; + swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsBack; + } +} + + +void MesaDriver::ClearIndex(GLcontext *ctx, GLuint index) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + md->m_clear_index = index; +} + + +void MesaDriver::ClearColor(GLcontext *ctx, const GLfloat color[4]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_RCOMP], color[0]); + CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_GCOMP], color[1]); + CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_BCOMP], color[2]); + CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_ACOMP], color[3]); + assert(md->m_bglview); +} + + +void MesaDriver::Clear(GLcontext *ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + if (mask & DD_FRONT_LEFT_BIT) + ClearFront(ctx, all, x, y, width, height); + if (mask & DD_BACK_LEFT_BIT) + ClearBack(ctx, all, x, y, width, height); + + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + if (mask) + _swrast_Clear( ctx, mask, all, x, y, width, height ); + + return; +} + + +void MesaDriver::ClearFront(GLcontext *ctx, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + + bglview->SetHighColor(md->m_clear_color[BE_RCOMP], + md->m_clear_color[BE_GCOMP], + md->m_clear_color[BE_BCOMP], + md->m_clear_color[BE_ACOMP]); + bglview->SetLowColor(md->m_clear_color[BE_RCOMP], + md->m_clear_color[BE_GCOMP], + md->m_clear_color[BE_BCOMP], + md->m_clear_color[BE_ACOMP]); + if (all) { + BRect b = bglview->Bounds(); + bglview->FillRect(b); + } + else { + // XXX untested + BRect b; + b.left = x; + b.right = x + width; + b.bottom = md->m_height - y - 1; + b.top = b.bottom - height; + bglview->FillRect(b); + } + + // restore drawing color +#if 0 + bglview->SetHighColor(md->mColor[BE_RCOMP], + md->mColor[BE_GCOMP], + md->mColor[BE_BCOMP], + md->mColor[BE_ACOMP]); + bglview->SetLowColor(md->mColor[BE_RCOMP], + md->mColor[BE_GCOMP], + md->mColor[BE_BCOMP], + md->mColor[BE_ACOMP]); +#endif +} + + +void MesaDriver::ClearBack(GLcontext *ctx, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + BBitmap *bitmap = md->m_bitmap; + assert(bitmap); + GLuint *start = (GLuint *) bitmap->Bits(); + const GLuint *clearPixelPtr = (const GLuint *) md->m_clear_color; + const GLuint clearPixel = B_LENDIAN_TO_HOST_INT32(*clearPixelPtr); + + if (all) { + const int numPixels = md->m_width * md->m_height; + if (clearPixel == 0) { + memset(start, 0, numPixels * 4); + } + else { + for (int i = 0; i < numPixels; i++) { + start[i] = clearPixel; + } + } + } + else { + // XXX untested + start += y * md->m_width + x; + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + start[j] = clearPixel; + } + start += md->m_width; + } + } +} + + +void MesaDriver::SetBuffer(GLcontext *ctx, GLframebuffer *buffer, + GLenum mode) +{ + /* TODO */ + (void) ctx; + (void) buffer; + (void) mode; +} + +void MesaDriver::GetBufferSize(GLframebuffer * framebuffer, GLuint *width, + GLuint *height) +{ + GET_CURRENT_CONTEXT(ctx); + if (!ctx) + return; + + MesaDriver * md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + + BRect b = bglview->Bounds(); + *width = (GLuint) b.IntegerWidth() + 1; // (b.right - b.left + 1); + *height = (GLuint) b.IntegerHeight() + 1; // (b.bottom - b.top + 1); + md->m_bottom = (GLint) b.bottom; + + if (ctx->Visual.doubleBufferMode) { + if (*width != md->m_width || *height != md->m_height) { + // allocate new size of back buffer bitmap + if (md->m_bitmap) + delete md->m_bitmap; + BRect rect(0.0, 0.0, *width - 1, *height - 1); + md->m_bitmap = new BBitmap(rect, B_RGBA32); + } + } + else + { + md->m_bitmap = NULL; + } + + md->m_width = *width; + md->m_height = *height; +} + + +void MesaDriver::Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + /* poll for window size change and realloc software Z/stencil/etc if needed */ + _mesa_ResizeBuffersMESA(); +} + + +const GLubyte *MesaDriver::GetString(GLcontext *ctx, GLenum name) +{ + switch (name) { + case GL_RENDERER: + return (const GLubyte *) "Mesa " MESA_VERSION_STRING " powered BGLView (software)"; + default: + // Let core library handle all other cases + return NULL; + } +} + + +// Plot a pixel. (0,0) is upper-left corner +// This is only used when drawing to the front buffer. +inline void Plot(BGLView *bglview, int x, int y) +{ + // XXX There's got to be a better way! + BPoint p(x, y), q(x+1, y); + bglview->StrokeLine(p, q); +} + + +void MesaDriver::WriteRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + int flippedY = md->m_bottom - y; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2], rgba[i][3]); + Plot(bglview, x++, flippedY); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2], rgba[i][3]); + Plot(bglview, x++, flippedY); + } + } +} + +void MesaDriver::WriteRGBSpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][3], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + int flippedY = md->m_bottom - y; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x++, flippedY); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x++, flippedY); + } + } +} + +void MesaDriver::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLchan color[4], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + int flippedY = md->m_bottom - y; + bglview->SetHighColor(color[RCOMP], color[GCOMP], color[BCOMP]); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + Plot(bglview, x++, flippedY); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + Plot(bglview, x++, flippedY); + } + } +} + +void MesaDriver::WriteRGBAPixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[] ) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x[i], md->m_bottom - y[i]); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x[i], md->m_bottom - y[i]); + } + } +} + + +void MesaDriver::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLchan color[4], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + // plot points using current color + bglview->SetHighColor(color[RCOMP], color[GCOMP], color[BCOMP]); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + Plot(bglview, x[i], md->m_bottom - y[i]); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + Plot(bglview, x[i], md->m_bottom - y[i]); + } + } +} + + +void MesaDriver::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLuint index[], const GLubyte mask[] ) +{ + printf("WriteCI32SpanFront() not implemented yet!\n"); + // TODO +} + +void MesaDriver::WriteCI8SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte index[], const GLubyte mask[] ) +{ + printf("WriteCI8SpanFront() not implemented yet!\n"); + // TODO +} + +void MesaDriver::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLuint colorIndex, const GLubyte mask[] ) +{ + printf("WriteMonoCISpanFront() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[] ) +{ + printf("WriteCI32PixelsFront() not implemented yet!\n"); + // TODO +} + +void MesaDriver::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) +{ + printf("WriteMonoCIPixelsFront() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadCI32SpanFront( const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[] ) +{ + printf("ReadCI32SpanFront() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadRGBASpanFront( const GLcontext *ctx, GLuint n, + GLint x, GLint y, GLubyte rgba[][4] ) +{ + printf("ReadRGBASpanFront() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadCI32PixelsFront( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[] ) +{ + printf("ReadCI32PixelsFront() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadRGBAPixelsFront( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[] ) +{ + printf("ReadRGBAPixelsFront() not implemented yet!\n"); + // TODO +} + + + + +void MesaDriver::WriteRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + assert(bitmap); + + int row = md->m_bottom - y; + uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; + uint32 * pixel = (uint32 *) ptr; + + if (mask) { + while(n--) { + if (*mask++) + *pixel = PACK_B_RGBA32(rgba[0]); + pixel++; + rgba++; + }; + } else { + while(n--) { + *pixel++ = PACK_B_RGBA32(rgba[0]); + rgba++; + }; + }; + } + + +void MesaDriver::WriteRGBSpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgb[][3], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + assert(bitmap); + + int row = md->m_bottom - y; + uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; + uint32 * pixel = (uint32 *) ptr; + + if (mask) { + while(n--) { + if (*mask++) + *pixel = PACK_B_RGB32(rgb[0]); + pixel++; + rgb++; + }; + } else { + while(n--) { + *pixel++ = PACK_B_RGB32(rgb[0]); + rgb++; + }; + }; +} + + + + +void MesaDriver::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + assert(bitmap); + + int row = md->m_bottom - y; + uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; + uint32 * pixel = (uint32 *) ptr; + uint32 pixel_color = PACK_B_RGBA32(color); + + if (mask) { + while(n--) { + if (*mask++) + *pixel = pixel_color; + pixel++; + }; + } else { + while(n--) { + *pixel++ = pixel_color; + }; + }; +} + + +void MesaDriver::WriteRGBAPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[] ) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + assert(bitmap); +#if 0 + while(n--) { + if (*mask++) { + int row = md->m_bottom - *y; + uint8 * pixel = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + *x * 4; + *((uint32 *) pixel) = PACK_B_RGBA32(rgba[0]); + }; + x++; + y++; + rgba++; + }; +#else + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + pixel[BE_RCOMP] = rgba[i][RCOMP]; + pixel[BE_GCOMP] = rgba[i][GCOMP]; + pixel[BE_BCOMP] = rgba[i][BCOMP]; + pixel[BE_ACOMP] = rgba[i][ACOMP]; + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + pixel[BE_RCOMP] = rgba[i][RCOMP]; + pixel[BE_GCOMP] = rgba[i][GCOMP]; + pixel[BE_BCOMP] = rgba[i][BCOMP]; + pixel[BE_ACOMP] = rgba[i][ACOMP]; + } + } +#endif +} + + +void MesaDriver::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLchan color[4], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + assert(bitmap); + + uint32 pixel_color = PACK_B_RGBA32(color); +#if 0 + while(n--) { + if (*mask++) { + int row = md->m_bottom - *y; + uint8 * pixel = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + *x * 4; + + *((uint32 *) pixel) = pixel_color; + }; + x++; + y++; + }; +#else + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + GLubyte * ptr = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + *((uint32 *) ptr) = pixel_color; + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + GLubyte * ptr = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + *((uint32 *) ptr) = pixel_color; + } + } +#endif +} + + +void MesaDriver::WriteCI32SpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLuint index[], const GLubyte mask[] ) +{ + printf("WriteCI32SpanBack() not implemented yet!\n"); + // TODO +} + +void MesaDriver::WriteCI8SpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLubyte index[], const GLubyte mask[] ) +{ + printf("WriteCI8SpanBack() not implemented yet!\n"); + // TODO +} + +void MesaDriver::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLuint colorIndex, const GLubyte mask[] ) +{ + printf("WriteMonoCISpanBack() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[] ) +{ + printf("WriteCI32PixelsBack() not implemented yet!\n"); + // TODO +} + +void MesaDriver::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) +{ + printf("WriteMonoCIPixelsBack() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadCI32SpanBack( const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[] ) +{ + printf("ReadCI32SpanBack() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, GLubyte rgba[][4] ) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + const BBitmap *bitmap = md->m_bitmap; + assert(bitmap); + int row = md->m_bottom - y; + const GLubyte *pixel = (GLubyte *) bitmap->Bits() + + (row * bitmap->BytesPerRow()) + x * 4; + + for (GLuint i = 0; i < n; i++) { + rgba[i][RCOMP] = pixel[BE_RCOMP]; + rgba[i][GCOMP] = pixel[BE_GCOMP]; + rgba[i][BCOMP] = pixel[BE_BCOMP]; + rgba[i][ACOMP] = pixel[BE_ACOMP]; + pixel += 4; + } +} + + +void MesaDriver::ReadCI32PixelsBack( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[] ) +{ + printf("ReadCI32PixelsBack() not implemented yet!\n"); + // TODO +} + + +void MesaDriver::ReadRGBAPixelsBack( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[] ) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + const BBitmap *bitmap = md->m_bitmap; + assert(bitmap); + + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + rgba[i][RCOMP] = pixel[BE_RCOMP]; + rgba[i][GCOMP] = pixel[BE_GCOMP]; + rgba[i][BCOMP] = pixel[BE_BCOMP]; + rgba[i][ACOMP] = pixel[BE_ACOMP]; + }; + }; + } else { + for (GLuint i = 0; i < n; i++) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + rgba[i][RCOMP] = pixel[BE_RCOMP]; + rgba[i][GCOMP] = pixel[BE_GCOMP]; + rgba[i][BCOMP] = pixel[BE_BCOMP]; + rgba[i][ACOMP] = pixel[BE_ACOMP]; + }; + }; +} + +const char * color_space_name(color_space space) +{ +#define C2N(a) case a: return #a + + switch (space) { + C2N(B_RGB24); + C2N(B_RGB32); + C2N(B_RGBA32); + C2N(B_RGB32_BIG); + C2N(B_RGBA32_BIG); + C2N(B_GRAY8); + C2N(B_GRAY1); + C2N(B_RGB16); + C2N(B_RGB15); + C2N(B_RGBA15); + C2N(B_CMAP8); + default: + return "Unknown!"; + }; + +#undef C2N +}; + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/beos/Makefile xpsb-glx-0.19/mesa/src/mesa/drivers/beos/Makefile --- xpsb-glx-0.19/mesa/src/mesa/drivers/beos/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/beos/Makefile 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,199 @@ +# src/mesa/drivers/beos/Makefile + +TOP = ../../../.. +include $(TOP)/configs/current + +include $(TOP)/src/mesa/sources + +MESA_MODULES = $(TOP)/src/mesa/mesa.a +# To switch back to old Mesa GLU implementation (but why do +# you want this!), uncomment this next line: + +# GLU_DIR = $(TOP)/src/glu/mesa +ifeq ($(GLU_DIR),) +# By default, we build the SGI GLU implementation + GLU_DIR = $(TOP)/src/glu/sgi +endif + +ifeq ($(GLU_DIR), $(TOP)/src/glu/mesa) + GLU_MODULES = \ + $(GLU_DIR)/glu.o \ + $(GLU_DIR)/mipmap.o \ + $(GLU_DIR)/nurbs.o \ + $(GLU_DIR)/nurbscrv.o \ + $(GLU_DIR)/nurbssrf.o \ + $(GLU_DIR)/nurbsutl.o \ + $(GLU_DIR)/polytest.o \ + $(GLU_DIR)/project.o \ + $(GLU_DIR)/quadric.o \ + $(GLU_DIR)/tess.o \ + $(GLU_DIR)/tesselat.o +else + GLU_MODULES = \ + $(GLU_DIR)/libutil/error.o \ + $(GLU_DIR)/libutil/glue.o \ + $(GLU_DIR)/libutil/mipmap.o \ + $(GLU_DIR)/libutil/project.o \ + $(GLU_DIR)/libutil/quad.o \ + $(GLU_DIR)/libutil/registry.o \ + $(GLU_DIR)/libtess/dict.o \ + $(GLU_DIR)/libtess/geom.o \ + $(GLU_DIR)/libtess/memalloc.o \ + $(GLU_DIR)/libtess/mesh.o \ + $(GLU_DIR)/libtess/normal.o \ + $(GLU_DIR)/libtess/priorityq.o \ + $(GLU_DIR)/libtess/render.o \ + $(GLU_DIR)/libtess/sweep.o \ + $(GLU_DIR)/libtess/tess.o \ + $(GLU_DIR)/libtess/tessmono.o \ + $(GLU_DIR)/libnurbs/interface/bezierEval.o \ + $(GLU_DIR)/libnurbs/interface/bezierPatch.o \ + $(GLU_DIR)/libnurbs/interface/bezierPatchMesh.o \ + $(GLU_DIR)/libnurbs/interface/glcurveval.o \ + $(GLU_DIR)/libnurbs/interface/glinterface.o \ + $(GLU_DIR)/libnurbs/interface/glrenderer.o \ + $(GLU_DIR)/libnurbs/interface/glsurfeval.o \ + $(GLU_DIR)/libnurbs/interface/incurveeval.o \ + $(GLU_DIR)/libnurbs/interface/insurfeval.o \ + $(GLU_DIR)/libnurbs/internals/arc.o \ + $(GLU_DIR)/libnurbs/internals/arcsorter.o \ + $(GLU_DIR)/libnurbs/internals/arctess.o \ + $(GLU_DIR)/libnurbs/internals/backend.o \ + $(GLU_DIR)/libnurbs/internals/basiccrveval.o \ + $(GLU_DIR)/libnurbs/internals/basicsurfeval.o \ + $(GLU_DIR)/libnurbs/internals/bin.o \ + $(GLU_DIR)/libnurbs/internals/bufpool.o \ + $(GLU_DIR)/libnurbs/internals/cachingeval.o \ + $(GLU_DIR)/libnurbs/internals/ccw.o \ + $(GLU_DIR)/libnurbs/internals/coveandtiler.o \ + $(GLU_DIR)/libnurbs/internals/curve.o \ + $(GLU_DIR)/libnurbs/internals/curvelist.o \ + $(GLU_DIR)/libnurbs/internals/curvesub.o \ + $(GLU_DIR)/libnurbs/internals/dataTransform.o \ + $(GLU_DIR)/libnurbs/internals/displaylist.o \ + $(GLU_DIR)/libnurbs/internals/flist.o \ + $(GLU_DIR)/libnurbs/internals/flistsorter.o \ + $(GLU_DIR)/libnurbs/internals/hull.o \ + $(GLU_DIR)/libnurbs/internals/intersect.o \ + $(GLU_DIR)/libnurbs/internals/knotvector.o \ + $(GLU_DIR)/libnurbs/internals/mapdesc.o \ + $(GLU_DIR)/libnurbs/internals/mapdescv.o \ + $(GLU_DIR)/libnurbs/internals/maplist.o \ + $(GLU_DIR)/libnurbs/internals/mesher.o \ + $(GLU_DIR)/libnurbs/internals/monoTriangulationBackend.o \ + $(GLU_DIR)/libnurbs/internals/monotonizer.o \ + $(GLU_DIR)/libnurbs/internals/mycode.o \ + $(GLU_DIR)/libnurbs/internals/nurbsinterfac.o \ + $(GLU_DIR)/libnurbs/internals/nurbstess.o \ + $(GLU_DIR)/libnurbs/internals/patch.o \ + $(GLU_DIR)/libnurbs/internals/patchlist.o \ + $(GLU_DIR)/libnurbs/internals/quilt.o \ + $(GLU_DIR)/libnurbs/internals/reader.o \ + $(GLU_DIR)/libnurbs/internals/renderhints.o \ + $(GLU_DIR)/libnurbs/internals/slicer.o \ + $(GLU_DIR)/libnurbs/internals/sorter.o \ + $(GLU_DIR)/libnurbs/internals/splitarcs.o \ + $(GLU_DIR)/libnurbs/internals/subdivider.o \ + $(GLU_DIR)/libnurbs/internals/tobezier.o \ + $(GLU_DIR)/libnurbs/internals/trimline.o \ + $(GLU_DIR)/libnurbs/internals/trimregion.o \ + $(GLU_DIR)/libnurbs/internals/trimvertpool.o \ + $(GLU_DIR)/libnurbs/internals/uarray.o \ + $(GLU_DIR)/libnurbs/internals/varray.o \ + $(GLU_DIR)/libnurbs/nurbtess/directedLine.o \ + $(GLU_DIR)/libnurbs/nurbtess/gridWrap.o \ + $(GLU_DIR)/libnurbs/nurbtess/monoChain.o \ + $(GLU_DIR)/libnurbs/nurbtess/monoPolyPart.o \ + $(GLU_DIR)/libnurbs/nurbtess/monoTriangulation.o \ + $(GLU_DIR)/libnurbs/nurbtess/partitionX.o \ + $(GLU_DIR)/libnurbs/nurbtess/partitionY.o \ + $(GLU_DIR)/libnurbs/nurbtess/polyDBG.o \ + $(GLU_DIR)/libnurbs/nurbtess/polyUtil.o \ + $(GLU_DIR)/libnurbs/nurbtess/primitiveStream.o \ + $(GLU_DIR)/libnurbs/nurbtess/quicksort.o \ + $(GLU_DIR)/libnurbs/nurbtess/rectBlock.o \ + $(GLU_DIR)/libnurbs/nurbtess/sampleComp.o \ + $(GLU_DIR)/libnurbs/nurbtess/sampleCompBot.o \ + $(GLU_DIR)/libnurbs/nurbtess/sampleCompRight.o \ + $(GLU_DIR)/libnurbs/nurbtess/sampleCompTop.o \ + $(GLU_DIR)/libnurbs/nurbtess/sampleMonoPoly.o \ + $(GLU_DIR)/libnurbs/nurbtess/sampledLine.o \ + $(GLU_DIR)/libnurbs/nurbtess/searchTree.o +endif + +INCLUDES = \ + -I../common \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/array_cache \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/math \ + -I$(TOP)/src/mesa/shader \ + -I$(TOP)/src/mesa/swrast \ + -I$(TOP)/src/mesa/swrast_setup \ + -I$(TOP)/src/mesa/tnl \ + -I$(TOP)/src/mesa/tnl_dd \ + -I$(TOP)/src/mesa/x86 \ + -I. \ + -I- \ + -I$(TOP)/include + +DRIVER_SOURCES = \ + GLView.cpp \ + ../common/driverfuncs.c \ + $(addprefix ../../, $(GLAPI_SOURCES)) + +ifeq ($(CPU), x86) + DRIVER_SOURCES += $(addprefix ../../, $(X86_API)) +else +# No GL API PPC optimization yet +endif + +DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o) +DRIVER_OBJECTS := $(DRIVER_OBJECTS:.S=.o) + +OBJECTS := $(DRIVER_OBJECTS:.cpp=.o) + + +# Rules + +.c.o: + $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ + +.cpp.o: + $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ + +.S.o: + $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ + + +default: depend $(TOP)/$(LIB_DIR) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + +# XXX FIXME: mesa.a might be libmesa.a now +$(MESA_MODULES): + cd $(TOP)/src/mesa && $(MAKE) mesa.a ; + mimeset -f "$@" + +$(GLU_MODULES): + cd $(GLU_DIR) && $(MAKE) $(subst $(GLU_DIR)/,,$(GLU_MODULES)) ; + +$(TOP)/$(LIB_DIR): + mkdir $(TOP)/$(LIB_DIR) + +$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES) + @$(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(GL_LIB_DEPS) \ + $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES) + +# $(GLU_OBJECTS): +# cd $(GLU_DIR) && $(MAKE) $< ; + +depend: $(DRIVER_SOURCES) $(GLU_SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(DRIVER_SOURCES) $(GLU_SOURCES) > /dev/null + +clean: + -rm -f depend depend.bak $(OBJECTS) + +include depend diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/common/descrip.mms xpsb-glx-0.19/mesa/src/mesa/drivers/common/descrip.mms --- xpsb-glx-0.19/mesa/src/mesa/drivers/common/descrip.mms 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/common/descrip.mms 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,42 @@ +# Makefile for core library for VMS +# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl +# Last revision : 29 September 2008 + +.first + define gl [----.include.gl] + define math [--.math] + define tnl [--.tnl] + define swrast [--.swrast] + define glapi [--.glapi] + define shader [--.shader] + define main [--.main] + +.include [----]mms-config. + +##### MACROS ##### + +VPATH = RCS + +INCDIR = [----.include],[--.main],[--.glapi],[--.shader] +LIBDIR = [----.lib] +CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)\ + /float=ieee/ieee=denorm/warn=disable=(PTRMISMATCH) + +SOURCES = driverfuncs.c + +OBJECTS =driverfuncs.obj + +##### RULES ##### + +VERSION=Mesa V3.4 + +##### TARGETS ##### +# Make the library +$(LIBDIR)$(GL_LIB) : $(OBJECTS) + @ library $(LIBDIR)$(GL_LIB) $(OBJECTS) + +clean : + purge + delete *.obj;* + +driverfuncs.obj : driverfuncs.c diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.c xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,359 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#include "main/glheader.h" +#include "main/imports.h" +#include "main/arrayobj.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "main/mipmap.h" +#include "main/queryobj.h" +#include "main/renderbuffer.h" +#include "main/texcompress.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texobj.h" +#include "main/texstore.h" +#if FEATURE_ARB_vertex_buffer_object +#include "main/bufferobj.h" +#endif +#if FEATURE_EXT_framebuffer_object +#include "main/fbobject.h" +#include "main/texrender.h" +#endif + +#include "shader/program.h" +#include "shader/prog_execute.h" +#include "shader/shader_api.h" +#include "tnl/tnl.h" +#include "swrast/swrast.h" + +#include "driverfuncs.h" + + + +/** + * Plug in default functions for all pointers in the dd_function_table + * structure. + * Device drivers should call this function and then plug in any + * functions which it wants to override. + * Some functions (pointers) MUST be implemented by all drivers (REQUIRED). + * + * \param table the dd_function_table to initialize + */ +void +_mesa_init_driver_functions(struct dd_function_table *driver) +{ + _mesa_bzero(driver, sizeof(*driver)); + + driver->GetString = NULL; /* REQUIRED! */ + driver->UpdateState = NULL; /* REQUIRED! */ + driver->GetBufferSize = NULL; /* REQUIRED! */ + driver->ResizeBuffers = _mesa_resize_framebuffer; + driver->Error = NULL; + + driver->Finish = NULL; + driver->Flush = NULL; + + /* framebuffer/image functions */ + driver->Clear = _swrast_Clear; + driver->Accum = _swrast_Accum; + driver->RasterPos = _tnl_RasterPos; + driver->DrawPixels = _swrast_DrawPixels; + driver->ReadPixels = _swrast_ReadPixels; + driver->CopyPixels = _swrast_CopyPixels; + driver->Bitmap = _swrast_Bitmap; + + /* Texture functions */ + driver->ChooseTextureFormat = _mesa_choose_tex_format; + driver->TexImage1D = _mesa_store_teximage1d; + driver->TexImage2D = _mesa_store_teximage2d; + driver->TexImage3D = _mesa_store_teximage3d; + driver->TexSubImage1D = _mesa_store_texsubimage1d; + driver->TexSubImage2D = _mesa_store_texsubimage2d; + driver->TexSubImage3D = _mesa_store_texsubimage3d; + driver->GetTexImage = _mesa_get_teximage; + driver->CopyTexImage1D = _swrast_copy_teximage1d; + driver->CopyTexImage2D = _swrast_copy_teximage2d; + driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; + driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; + driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; + driver->GenerateMipmap = _mesa_generate_mipmap; + driver->TestProxyTexImage = _mesa_test_proxy_teximage; + driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; + driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d; + driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d; + driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; + driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; + driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; + driver->GetCompressedTexImage = _mesa_get_compressed_teximage; + driver->CompressedTextureSize = _mesa_compressed_texture_size; + driver->BindTexture = NULL; + driver->NewTextureObject = _mesa_new_texture_object; + driver->DeleteTexture = _mesa_delete_texture_object; + driver->NewTextureImage = _mesa_new_texture_image; + driver->FreeTexImageData = _mesa_free_texture_image_data; + driver->MapTexture = NULL; + driver->UnmapTexture = NULL; + driver->TextureMemCpy = _mesa_memcpy; + driver->IsTextureResident = NULL; + driver->PrioritizeTexture = NULL; + driver->ActiveTexture = NULL; + driver->UpdateTexturePalette = NULL; + + /* imaging */ + driver->CopyColorTable = _swrast_CopyColorTable; + driver->CopyColorSubTable = _swrast_CopyColorSubTable; + driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + /* Vertex/fragment programs */ + driver->BindProgram = NULL; + driver->NewProgram = _mesa_new_program; + driver->DeleteProgram = _mesa_delete_program; +#if FEATURE_MESA_program_debug + driver->GetProgramRegister = _mesa_get_program_register; +#endif /* FEATURE_MESA_program_debug */ + + /* simple state commands */ + driver->AlphaFunc = NULL; + driver->BlendColor = NULL; + driver->BlendEquationSeparate = NULL; + driver->BlendFuncSeparate = NULL; + driver->ClearColor = NULL; + driver->ClearDepth = NULL; + driver->ClearIndex = NULL; + driver->ClearStencil = NULL; + driver->ClipPlane = NULL; + driver->ColorMask = NULL; + driver->ColorMaterial = NULL; + driver->CullFace = NULL; + driver->DrawBuffer = NULL; + driver->DrawBuffers = NULL; + driver->FrontFace = NULL; + driver->DepthFunc = NULL; + driver->DepthMask = NULL; + driver->DepthRange = NULL; + driver->Enable = NULL; + driver->Fogfv = NULL; + driver->Hint = NULL; + driver->IndexMask = NULL; + driver->Lightfv = NULL; + driver->LightModelfv = NULL; + driver->LineStipple = NULL; + driver->LineWidth = NULL; + driver->LogicOpcode = NULL; + driver->PointParameterfv = NULL; + driver->PointSize = NULL; + driver->PolygonMode = NULL; + driver->PolygonOffset = NULL; + driver->PolygonStipple = NULL; + driver->ReadBuffer = NULL; + driver->RenderMode = NULL; + driver->Scissor = NULL; + driver->ShadeModel = NULL; + driver->StencilFuncSeparate = NULL; + driver->StencilOpSeparate = NULL; + driver->StencilMaskSeparate = NULL; + driver->TexGen = NULL; + driver->TexEnv = NULL; + driver->TexParameter = NULL; + driver->TextureMatrix = NULL; + driver->Viewport = NULL; + + /* vertex arrays */ + driver->VertexPointer = NULL; + driver->NormalPointer = NULL; + driver->ColorPointer = NULL; + driver->FogCoordPointer = NULL; + driver->IndexPointer = NULL; + driver->SecondaryColorPointer = NULL; + driver->TexCoordPointer = NULL; + driver->EdgeFlagPointer = NULL; + driver->VertexAttribPointer = NULL; + driver->LockArraysEXT = NULL; + driver->UnlockArraysEXT = NULL; + + /* state queries */ + driver->GetBooleanv = NULL; + driver->GetDoublev = NULL; + driver->GetFloatv = NULL; + driver->GetIntegerv = NULL; + driver->GetPointerv = NULL; + +#if FEATURE_ARB_vertex_buffer_object + driver->NewBufferObject = _mesa_new_buffer_object; + driver->DeleteBuffer = _mesa_delete_buffer_object; + driver->BindBuffer = NULL; + driver->BufferData = _mesa_buffer_data; + driver->BufferSubData = _mesa_buffer_subdata; + driver->GetBufferSubData = _mesa_buffer_get_subdata; + driver->MapBuffer = _mesa_buffer_map; + driver->UnmapBuffer = _mesa_buffer_unmap; +#endif + +#if FEATURE_EXT_framebuffer_object + driver->NewFramebuffer = _mesa_new_framebuffer; + driver->NewRenderbuffer = _mesa_new_soft_renderbuffer; + driver->RenderTexture = _mesa_render_texture; + driver->FinishRenderTexture = _mesa_finish_render_texture; + driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer; +#endif + +#if FEATURE_EXT_framebuffer_blit + driver->BlitFramebuffer = _swrast_BlitFramebuffer; +#endif + + /* query objects */ + driver->NewQueryObject = _mesa_new_query_object; + driver->DeleteQuery = _mesa_delete_query; + driver->BeginQuery = _mesa_begin_query; + driver->EndQuery = _mesa_end_query; + driver->WaitQuery = _mesa_wait_query; + + /* APPLE_vertex_array_object */ + driver->NewArrayObject = _mesa_new_array_object; + driver->DeleteArrayObject = _mesa_delete_array_object; + driver->BindArrayObject = NULL; + + /* T&L stuff */ + driver->NeedValidate = GL_FALSE; + driver->ValidateTnlModule = NULL; + driver->CurrentExecPrimitive = 0; + driver->CurrentSavePrimitive = 0; + driver->NeedFlush = 0; + driver->SaveNeedFlush = 0; + + driver->ProgramStringNotify = _tnl_program_string; + driver->FlushVertices = NULL; + driver->SaveFlushVertices = NULL; + driver->NotifySaveBegin = NULL; + driver->LightingSpaceChange = NULL; + + /* display list */ + driver->NewList = NULL; + driver->EndList = NULL; + driver->BeginCallList = NULL; + driver->EndCallList = NULL; + + + /* XXX temporary here */ + _mesa_init_glsl_driver_functions(driver); +} + + +/** + * Call the ctx->Driver.* state functions with current values to initialize + * driver state. + * Only the Intel drivers use this so far. + */ +void +_mesa_init_driver_state(GLcontext *ctx) +{ + ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); + + ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); + + ctx->Driver.BlendEquationSeparate(ctx, + ctx->Color.BlendEquationRGB, + ctx->Color.BlendEquationA); + + ctx->Driver.BlendFuncSeparate(ctx, + ctx->Color.BlendSrcRGB, + ctx->Color.BlendDstRGB, + ctx->Color.BlendSrcA, ctx->Color.BlendDstA); + + ctx->Driver.ColorMask(ctx, + ctx->Color.ColorMask[RCOMP], + ctx->Color.ColorMask[GCOMP], + ctx->Color.ColorMask[BCOMP], + ctx->Color.ColorMask[ACOMP]); + + ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); + ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); + ctx->Driver.DepthMask(ctx, ctx->Depth.Mask); + + ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); + ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled); + ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled); + ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled); + ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag); + ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); + ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag); + ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled); + ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); + ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); + ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); + ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); + + ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); + ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0); + ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); + ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); + ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); + + ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); + + { + GLfloat f = (GLfloat) ctx->Light.Model.ColorControl; + ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f); + } + + ctx->Driver.LineWidth(ctx, ctx->Line.Width); + ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); + ctx->Driver.PointSize(ctx, ctx->Point.Size); + ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); + ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, + ctx->Scissor.Width, ctx->Scissor.Height); + ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); + ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, + ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], + ctx->Stencil.ValueMask[0]); + ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, + ctx->Stencil.Function[1], + ctx->Stencil.Ref[1], + ctx->Stencil.ValueMask[1]); + ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]); + ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]); + ctx->Driver.StencilOpSeparate(ctx, GL_FRONT, + ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); + ctx->Driver.StencilOpSeparate(ctx, GL_BACK, + ctx->Stencil.FailFunc[1], + ctx->Stencil.ZFailFunc[1], + ctx->Stencil.ZPassFunc[1]); + + + ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]); +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.h xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/common/driverfuncs.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,37 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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 DRIVERFUNCS_H +#define DRIVERFUNCS_H + +extern void +_mesa_init_driver_functions(struct dd_function_table *driver); + + +extern void +_mesa_init_driver_state(GLcontext *ctx); + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DCAPS.CPP xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DCAPS.CPP --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DCAPS.CPP 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DCAPS.CPP 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,250 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver Build 5 */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DHAL.h" +/*===========================================================================*/ +/* Macros. */ +/*===========================================================================*/ +#define SRCBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwSrcBlendCaps & d3d ) \ + { \ + sprintf( buffer, "SRC Blend: %s -> %s", # gl, # d3d ); \ + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ + pShared->dwSrcBlendCaps[index] = d3d; \ + } \ + else \ + { \ + sprintf( buffer, "SRC Blend: %s -> %s", # gl, # fall ); \ + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ + pShared->dwSrcBlendCaps[index] = fall; \ + } +#define DSTBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwDestBlendCaps & d3d ) \ + { \ + sprintf( buffer, "DST Blend: %s -> %s", # gl, # d3d ); \ + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ + pShared->dwDestBlendCaps[index] = d3d; \ + } \ + else \ + { \ + sprintf( buffer, "DST Blend: %s -> %s", # gl, # fall ); \ + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ + pShared->dwDestBlendCaps[index] = fall; \ + } + +/*===========================================================================*/ +/* I use this function to handle the fact that the D3D texture blending and */ +/* OpenGL texture blending functions don't map one to one. Also there is the*/ +/* problem with cards not supporting all the D3D functions. So I use the CAPS*/ +/* of the card to make a table of functions that will have defaults for the */ +/* unsupported functions. */ +/* So first I fill the table with the fallback function then I check to see */ +/* if the card supports the requested function. If it does I replace the */ +/* default thats already in the array. Now order does matter as I used an */ +/* enum type in D3DShared.h so that the mapping would be a little easier. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void AlphaBlendTableHAL( PMESAD3DHAL pHAL ) +{ + PMESAD3DSHARED pShared = &pHAL->shared; + int index; + char buffer[128]; + + DPF(( DBG_FUNC, "AlphaBlendTableHAL();" )); + + /* Make the fallback for the Source blend. */ + for( index = 0; index < 14; index++ ) + { + switch( index ) + { + case s_zero: + SRCBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE ); + break; + case s_one: + SRCBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE ); + break; + case s_dst_color: + SRCBLEND_MAP( GL_DST_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE ); + break; + case s_one_minus_dst_color: + SRCBLEND_MAP( GL_ONE_MINUS_DST_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE ); + break; + case s_src_alpha: + SRCBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE ); + break; + case s_one_minus_src_alpha: + SRCBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE ); + break; + case s_dst_alpha: + SRCBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE ); + break; + case s_one_minus_dst_alpha: + SRCBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE ); + break; + case s_src_alpha_saturate: + SRCBLEND_MAP( GL_SRC_ALPHA_SATURATE, D3DBLEND_SRCALPHASAT, D3DBLEND_ONE ); + break; + case s_constant_color: + SRCBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE ); + break; + case s_one_minus_constant_color: + SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE ); + break; + case s_constant_alpha: + SRCBLEND_MAP( GL_CONSTANT_ALPHA, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE ); + break; + case s_one_minus_constant_alpha: + SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE ); + break; + } + } + + /* Make the fallback for the Destination blend. */ + for( index = 0; index < 14; index++ ) + { + switch( index ) + { + case d_zero: + DSTBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE ); + break; + case d_one: + DSTBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE ); + break; + case d_src_color: + DSTBLEND_MAP( GL_SRC_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE ); + break; + case d_one_minus_src_color: + DSTBLEND_MAP( GL_ONE_MINUS_SRC_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE ); + break; + case d_src_alpha: + DSTBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE ); + break; + case d_one_minus_src_alpha: + DSTBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE ); + break; + case d_dst_alpha: + DSTBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE ); + break; + case d_one_minus_dst_alpha: + DSTBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE ); + break; + case d_constant_color: + DSTBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE ); + break; + case d_one_minus_constant_color: + DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE ); + break; + case d_constant_alpha: + DSTBLEND_MAP( GL_CONSTANT_ALPHAR, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE ); + break; + case d_one_minus_constant_alpha: + DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE ); + break; + } + } + + /* Make the fallbacks for the texture functions. */ + for( index = 0; index < 4; index++ ) + { + switch( index ) + { + case d3dtblend_decal: + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_DECAL" )); + pShared->dwTexFunc[index] = D3DTBLEND_DECAL; + } + else + { + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_MODULATE" )); + pShared->dwTexFunc[index] = D3DTBLEND_MODULATE; + } + else + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_ADD" )); + pShared->dwTexFunc[index] = D3DTBLEND_ADD; + } + } + break; + case d3dtblend_decalalpha: + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECALALPHA ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_DECALALPHA" )); + pShared->dwTexFunc[index] = D3DTBLEND_DECALALPHA; + } + else + { + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPA -> D3DTBLEND_DECAL" )); + pShared->dwTexFunc[index] = D3DTBLEND_DECAL; + } + else + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_ADD" )); + pShared->dwTexFunc[index] = D3DTBLEND_ADD; + } + } + break; + case d3dtblend_modulate: + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATE" )); + pShared->dwTexFunc[index] = D3DTBLEND_MODULATE; + } + else + { + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATEALPHA" )); + pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA; + } + else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_DECAL" )); + pShared->dwTexFunc[index] = D3DTBLEND_DECAL; + } + else + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_ADD" )); + pShared->dwTexFunc[index] = D3DTBLEND_ADD; + } + } + break; + case d3dtblend_modulatealpha: + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATEALPHA" )); + pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA; + } + else + { + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATE" )); + pShared->dwTexFunc[index] = D3DTBLEND_MODULATE; + } + else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_DECALE" )); + pShared->dwTexFunc[index] = D3DTBLEND_DECAL; + } + else + { + DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_ADD" )); + pShared->dwTexFunc[index] = D3DTBLEND_ADD; + } + } + break; + } + } +} + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DHAL.H xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DHAL.H --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DHAL.H 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DHAL.H 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,68 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef _D3D_HAL_INC +#define _D3D_HAL_INC + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include +#include +#include +#include +#include +#include "D3DShared.h" +#include "D3DTextureMgr.h" +#include "Debug.h" +/*===========================================================================*/ +/* Defines. */ +/*===========================================================================*/ +#define DX_RESTORE(ps) if ( (ps) && (ps)->IsLost() ) (ps)->Restore(); +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +typedef struct _d3d_hal_struct +{ + MESAD3DSHARED shared; + + GUID guid; + LPDIRECTDRAW lpDD; + LPDIRECTDRAW4 lpDD4; + LPDIRECT3D3 lpD3D3; + LPDIRECT3DDEVICE3 lpD3DDevice; + D3DDEVICEDESC D3DHWDevDesc; + LPDIRECTDRAWSURFACE4 lpDDSPrimary, + lpDDSRender, + lpDDSZbuffer; + LPDIRECT3DVIEWPORT3 lpViewport; + LPDIRECTDRAWCLIPPER lpClipper; + DDPIXELFORMAT ddpf, + ddpfZBuffer; + PTM_OBJECT pTMList; + +} MESAD3DHAL, *PMESAD3DHAL; +/*===========================================================================*/ +/* External function prototypes. */ +/*===========================================================================*/ +extern BOOL InitTMgrHAL( PMESAD3DHAL pHAL ); +extern void TermTMgrHAL( PMESAD3DHAL pHAL ); +extern void AlphaBlendTableHAL( PMESAD3DHAL pHAL ); + +extern void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel ); +extern char *ErrorStringD3D( HRESULT hr ); +extern void FatalShutDown( PMESAD3DHAL pHAL ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +extern char *errorMsg; + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DInit.cpp xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DInit.cpp --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DInit.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DInit.cpp 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,891 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver Build 5 */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DHAL.h" +/*===========================================================================*/ +/* Local function prototypes. */ +/*===========================================================================*/ +static void DestroyAllSurfaces( PMESAD3DHAL pHAL ); +static void DestroyDevice( PMESAD3DHAL pHAL ); +static void DestroyInterfaces( PMESAD3DHAL pHAL ); + +HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid ); +HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid ); +HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid ); +/*===========================================================================*/ +/* Globals. */ +/*===========================================================================*/ +//char *errorMsg; +/*===========================================================================*/ +/* This function is responable for allocating the actual MESAD3DHAL struct. */ +/* Each Mesa context will have its own MESAD3DHAL struct so its like a mini */ +/* context to some extent. All one time allocations/operations get done here.*/ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +extern "C" PMESAD3DSHARED InitHAL( HWND hwnd ) +{ + PMESAD3DHAL pHAL; + ULONG rc; + + DPF(( DBG_FUNC, "InitHAL();" )); + DPF(( DBG_CNTX_INFO, "hwnd: %d", hwnd )); + + /* Allocate the structure and zero it out. */ + pHAL = (PMESAD3DHAL)ALLOC( sizeof(MESAD3DHAL) ); + if ( pHAL == NULL ) + { + RIP( pHAL, "InitHAL->", "Memory Allocation" ); + return (PMESAD3DSHARED)NULL; + } + memset( pHAL, 0, sizeof(MESAD3DHAL) ); + + /* Get the texture manager going. */ + rc = InitTMgrHAL( pHAL ); + if ( rc == FALSE ) + { + RIP( pHAL, "InitTMgrHAL->", "Failed" ); + return (PMESAD3DSHARED)NULL; + } + + /* Fill in the window parameters if we can. */ + pHAL->shared.hwnd = hwnd; + + /* Parse the user's enviroment variables to generate a debug mask. */ + ReadDBGEnv(); + + return (PMESAD3DSHARED)pHAL; +} +/*===========================================================================*/ +/* This function will unload all the resources that the MESAD3DHAL struct */ +/* has bound to it. The actual structure itself will be freed. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void TermHAL( PMESAD3DSHARED pShared ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + + DPF(( DBG_FUNC, "TermHAL();" )); + + /* Check for an empty wrapper structure. */ + if ( pHAL == NULL ) + return; + + /* Kill this texture manager. */ + TermTMgrHAL( pHAL ); + + /* Kill any DDraw stuff if exists. */ + DestroyDevice( pHAL ); + DestroyAllSurfaces( pHAL ); + DestroyInterfaces( pHAL ); + + FREE( pHAL ); +} +/*===========================================================================*/ +/* This function is used to init and resize the rendering surface as the two*/ +/* are almost the same. First the device and all the surfaces are destoryed */ +/* if they already exist. Next we create a OffScreen rendering surface and */ +/* save some pixelformat info to do color convertions. Next we start to take */ +/* care of getting the most out of the hardware. I use bHardware to determine*/ +/* the state of the device we found in the device enumeration. The enum proc*/ +/* will try for hardware first. I next use a bForceSW to make the enum proc */ +/* choose a software device. So I will try some combinations with HW first */ +/* until I feel I have to set the bForceSW and call this function again. If */ +/* this function is called with no width or height then use the internals. */ +/* NOTE: The worst case is that all will be in SW (RGBDevice) and really */ +/* I should forget the whole thing and fall back to a DDraw span type*/ +/* rendering but what is the point. This way I always know I have a */ +/* D3DDevice and that makes things easier. I do impliment the span */ +/* rendering function for stuff that I haven't done support for such */ +/* as points and lines. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE */ +/*===========================================================================*/ +extern "C" BOOL CreateHAL( PMESAD3DSHARED pShared ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + DDSURFACEDESC2 ddsd2; + D3DDEVICEDESC D3DSWDevDesc; + DDSCAPS2 ddscaps; + DWORD dwCoopFlags, + dwWidth, + dwHeight; + ULONG rc; + + DPF(( DBG_FUNC, "CreateHAL();" )); + +#define InitDDSD2(f) memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); \ + ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); \ + ddsd2.dwFlags = f; + + if ( pHAL == NULL ) + return FALSE; + + /* Use the internal rectangle struct. */ + dwWidth = pShared->rectW.right - pShared->rectW.left; + dwHeight = pShared->rectW.bottom - pShared->rectW.top; + + DPF(( DBG_CNTX_INFO, "Width: %d Height: %d", dwWidth, dwHeight )); + + /* The dimensions might still be the same so just leave. */ + if ( (dwWidth == pShared->dwWidth) && (dwHeight == pShared->dwHeight) ) + { + DPF(( DBG_CNTX_WARN, "Context size hasn't changed" )); + return TRUE; + } + + /* If one of the dimensions are zero then leave. WM_SIZE should get us back here. */ + if ( (dwWidth == 0) || (dwHeight == 0) ) + return TRUE; + + /* Save the renders dimensions. */ + pShared->dwWidth = dwWidth; + pShared->dwHeight = dwHeight; + + DPF(( DBG_CNTX_INFO, "Creating Context:\n cx:%d cy:%d", pShared->dwWidth, pShared->dwHeight )); + + /*=================================*/ + /* Create all required interfaces. */ + /*=================================*/ + + /* Kill any DDraw stuff if exists. */ + DestroyDevice( pHAL ); + DestroyAllSurfaces( pHAL ); + DestroyInterfaces( pHAL ); + + /* Create a instance of DDraw using the Primary display driver. */ + rc = DirectDrawCreate( NULL, &pHAL->lpDD, NULL ); + if( FAILED(rc) ) + { + RIP( pHAL, "DirectDrawCreate->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Get the DDraw4 interface. */ + rc = pHAL->lpDD->QueryInterface( IID_IDirectDraw4, (void **)&pHAL->lpDD4 ); + if( FAILED(rc) ) + { + RIP( pHAL, "QueryInterface (IID_IDirectDraw4) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Get the Direct3D3 interface. */ + rc = pHAL->lpDD4->QueryInterface( IID_IDirect3D3, (void **)&pHAL->lpD3D3 ); + if( FAILED(rc) ) + { + RIP( pHAL, "QueryInterface (IID_IDirect3D3) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Set the Cooperative level. NOTE: we need to know if we are FS at this point.*/ + dwCoopFlags = (pShared->bWindow == TRUE) ? DDSCL_NORMAL : (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + rc = pHAL->lpDD4->SetCooperativeLevel( pShared->hwnd, dwCoopFlags ); + if ( FAILED(rc) ) + { + RIP( pHAL, "SetCooperativeLevel->", ErrorStringD3D(rc) ); + return FALSE; + } + + /*==================================================================*/ + /* Get the best device we can and note whether its hardware or not. */ + /*==================================================================*/ + pShared->bForceSW = FALSE; + pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL ); + pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice ); + DPF(( DBG_CNTX_INFO, "bHardware: %s", (pShared->bHardware) ? "TRUE" : "FALSE" )); + DPF(( DBG_CNTX_INFO, "bWindowed: %s", (pShared->bWindow) ? "TRUE" : "FALSE" )); + + /*========================================================================*/ + /* HARDWARE was found. */ + /*========================================================================*/ + if ( pShared->bHardware == TRUE ) + { + /*===================================*/ + /* HARDWARE -> Z-BUFFER. */ + /*===================================*/ + + /* Get a Z-Buffer pixelformat. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); + rc = pHAL->lpD3D3->EnumZBufferFormats( pHAL->guid, EnumZBufferHook, (VOID*)&ddsd2.ddpfPixelFormat ); + if ( FAILED(rc) ) + { + RIP( pHAL, "EnumZBufferFormatsl->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Setup our request structure for the Z-buffer surface. */ + ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY; + ddsd2.dwWidth = dwWidth; + ddsd2.dwHeight = dwHeight; + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSZbuffer, NULL ); + if ( !FAILED(rc) ) + { + DPF(( DBG_CNTX_INFO, "HW ZBuffer" )); + + /*===================================*/ + /* HARDWARE -> Z-BUFFER -> FLIPABLE */ + /*===================================*/ + if ( pShared->bWindow == FALSE ) + { + InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT ); + ddsd2.dwBackBufferCount = 1; + ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); + if ( FAILED(rc) ) + { + /* Make sure we try the next fall back. */ + DPF(( DBG_CNTX_WARN, "HW Flip/Complex not available" )); + pHAL->lpDDSPrimary = NULL; + } + else + { + /* Get the back buffer that was created. */ + ddscaps.dwCaps = DDSCAPS_BACKBUFFER; + rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender ); + if ( FAILED(rc) ) + { + DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> HW Flip/Complex" )); + + /* Make sure we try the next fall back. */ + pHAL->lpDDSPrimary->Release(); + pHAL->lpDDSPrimary = NULL; + } + else + { + /* I have had problems when a complex surface comes back */ + /* with the back buffer being created in SW. Not sure why */ + /* or how this is possable but I'm checking for it here. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); + DX_RESTORE( pHAL->lpDDSRender ); + rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 ); + if ( FAILED(rc) ) + { + RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* If the surface is in VID then we are happy with are Flipable. */ + if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM ) + { + pShared->bFlipable = TRUE; + DPF(( DBG_CNTX_INFO, "HW Flip/Complex!" )); + } + else + { + /* Kill this setup. */ + pHAL->lpDDSPrimary->Release(); + pHAL->lpDDSPrimary = NULL; + } + } + } + } + + /*===================================*/ + /* HARDWARE -> Z-BUFFER -> BLT */ + /*===================================*/ + if ( pHAL->lpDDSPrimary == NULL ) + { + pShared->bFlipable = FALSE; + + /* Create the Primary (front buffer). */ + InitDDSD2( DDSD_CAPS ); + ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); + if ( FAILED(rc) ) + { + /* This is an error as we should be able to do this at minimum. */ + RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Create the Render (back buffer). */ + InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT ); + ddsd2.dwWidth = dwWidth; + ddsd2.dwHeight = dwHeight; + ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL ); + if ( FAILED(rc) ) + { + DPF(( DBG_CNTX_WARN, "Failed HW Offscreen surface" )); + + /* Make sure we try the next fall back. */ + pHAL->lpDDSPrimary->Release(); + pHAL->lpDDSPrimary = NULL; + } + else + { + /* Might as well check here too see if this surface is in */ + /* hardware. If nothing else just to be consistant. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); + DX_RESTORE( pHAL->lpDDSRender ); + rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 ); + if ( FAILED(rc) ) + { + RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* If the surface is in VID then we are happy. */ + if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM ) + { + /* Create a clipper object so that DDraw will be able to blt windows that */ + /* have been clipped by the screen or other windows. */ + pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL ); + pHAL->lpClipper->SetHWnd( 0, pShared->hwnd ); + pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper ); + pHAL->lpClipper->Release(); + DPF(( DBG_CNTX_INFO, "HW RENDER surface" )); + } + else + { + /* Kill this setup. */ + pHAL->lpDDSRender->Release(); + pHAL->lpDDSRender = NULL; + pHAL->lpDDSPrimary->Release(); + pHAL->lpDDSPrimary = NULL; + } + } + } + + /*===================================*/ + /* Create D3DDEVICE -> HARDWARE. */ + /*===================================*/ + if ( pHAL->lpDDSZbuffer && pHAL->lpDDSPrimary && pHAL->lpDDSRender ) + { + DX_RESTORE( pHAL->lpDDSRender ); + DX_RESTORE( pHAL->lpDDSZbuffer ); + + rc = pHAL->lpDDSRender->AddAttachedSurface( pHAL->lpDDSZbuffer ); + if ( FAILED(rc) ) + { + RIP( pHAL, "AddAttachedSurface (ZBUFFER) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DHALDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL ); + if ( rc != D3D_OK ) + { + DPF(( DBG_CNTX_WARN, "Failed HW Device" )); + pHAL->lpD3DDevice = NULL; + } + else + { + DPF(( DBG_CNTX_INFO, "HW Device" )); + } + } + } + } + + /*========================================================================*/ + /* SOFTWARE fallback. */ + /*========================================================================*/ + if ( pHAL->lpD3DDevice == NULL ) + { + DPF(( DBG_CNTX_INFO, "SW fallback :(" )); + + /* Make sure we have no surfaces allocated. Just incase. */ + DestroyAllSurfaces( pHAL ); + + /* Get a software device. */ + pShared->bFlipable = FALSE; + pShared->bForceSW = TRUE; + pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL ); + pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice ); + + /*===================================*/ + /* SOFTWARE -> Z-BUFFER. */ + /*===================================*/ + + /*===================================*/ + /* SOFTWARE -> Z-BUFFER -> FLIPABLE */ + /*===================================*/ + if ( pShared->bWindow == FALSE ) + { + InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT ); + ddsd2.dwBackBufferCount = 1; + ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; + ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); + ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS); + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); + if ( FAILED(rc) ) + { + DPF(( DBG_CNTX_WARN, "Failed SW Flip/Complex" )); + + /* Make sure we try the next fall back. */ + pHAL->lpDDSPrimary = NULL; + } + else + { + ddscaps.dwCaps = DDSCAPS_BACKBUFFER; + rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender ); + if ( FAILED(rc) ) + { + /* Make sure we try the next fall back. */ + DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> SW Flip/Complex" )); + pHAL->lpDDSPrimary->Release(); + pHAL->lpDDSPrimary = NULL; + } + else + { + DPF(( DBG_CNTX_INFO, "SW Flip/Complex" )); + pShared->bFlipable = TRUE; + } + } + } + + /*===================================*/ + /* SOFTWARE -> Z-BUFFER -> BLT */ + /*===================================*/ + if ( pHAL->lpDDSPrimary == NULL ) + { + /* Create the Primary (front buffer). */ + InitDDSD2( DDSD_CAPS ); + ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); + if ( FAILED(rc) ) + { + /* This is an error as we should be able to do this at minimum. */ + RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Create the Render (back buffer). */ + InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT ); + ddsd2.dwWidth = dwWidth; + ddsd2.dwHeight = dwHeight; + ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); + ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS); + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL ); + if ( FAILED(rc) ) + { + /* That was our last hope. */ + RIP( pHAL, "CreateSurface (RENDER) ->", ErrorStringD3D(rc) ); + return FALSE; + } + else + { + DPF(( DBG_CNTX_INFO, "SW RENDER surface" )); + + /* Create a clipper object so that DDraw will be able to blt windows that */ + /* have been clipped by the screen or other windows. */ + pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL ); + pHAL->lpClipper->SetHWnd( 0, pShared->hwnd ); + pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper ); + pHAL->lpClipper->Release(); + } + } + + /*===================================*/ + /* Create D3DDEVICE -> SOFTWARE. */ + /*===================================*/ + if ( pHAL->lpDDSPrimary && pHAL->lpDDSRender ) + { + DX_RESTORE( pHAL->lpDDSRender ); + rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DRGBDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL ); + if ( rc != D3D_OK ) + { + /* That was our last hope. */ + RIP( pHAL, "CreateDevice (IID_IDirect3DRGBDevice) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + DPF(( DBG_CNTX_INFO, "SW Device" )); + } + } + + /*==============================================================================*/ + /* Get a copy of the render pixelformat so that wgl.c can call GetPixelInfoD3D. */ + /*==============================================================================*/ + memset( &pHAL->ddpf, 0, sizeof(DDPIXELFORMAT) ); + pHAL->ddpf.dwSize = sizeof( DDPIXELFORMAT ); + rc = pHAL->lpDDSRender->GetPixelFormat( &pHAL->ddpf ); + if ( FAILED(rc) ) + { + RIP( pHAL, "GetPixelFormat ->", ErrorStringD3D(rc) ); + return FALSE; + } + DebugPixelFormat( "Using OFFSCREEN", &pHAL->ddpf ); + DebugPixelFormat( "Using ZBUFFER", &ddsd2.ddpfPixelFormat ); + + /* Get a copy of what the D3DDevice supports for later use. */ + memset( &D3DSWDevDesc, 0, sizeof(D3DDEVICEDESC) ); + memset( &pHAL->D3DHWDevDesc, 0, sizeof(D3DDEVICEDESC) ); + D3DSWDevDesc.dwSize = sizeof( D3DDEVICEDESC ); + pHAL->D3DHWDevDesc.dwSize = sizeof( D3DDEVICEDESC ); + rc = pHAL->lpD3DDevice->GetCaps( &pHAL->D3DHWDevDesc, &D3DSWDevDesc ); + if ( FAILED(rc) ) + { + RIP( pHAL, "GetCaps ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Get a copy of the pixel convertion stuff for direct buffer access. */ + Solve8BitChannelPixelFormat( &pHAL->ddpf, &pShared->pixel ); + AlphaBlendTableHAL( pHAL ); + + /* We must prime the Begin/End scene for SwapBuffers to work. */ + rc = pHAL->lpD3DDevice->BeginScene(); + if ( FAILED(rc) ) + { + RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) ); + return FALSE; + } + +#undef InitDDSD2 + + return TRUE; +} +/*===========================================================================*/ +/* This function will make sure a viewport is created and set for the device*/ +/* in the supplied structure. If a rect is supplied then it will be used for*/ +/* the viewport otherwise the current setting in the strucute will be used. */ +/* Note that the rect is relative to the window. So left/top must be 0,0 to */ +/* use the whole window else there is scissoring going down. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +extern "C" BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + D3DVIEWPORT2 vdData; + ULONG rc; + POINT pt; + + DPF(( DBG_FUNC, "SetViewportHAL();" )); + + /* Make sure we have enough info. */ + if ( !pHAL || !pHAL->lpDDSPrimary || !pHAL->lpD3DDevice ) + { + DPF(( DBG_CNTX_WARN, "SetViewport() -> NULL Pointer" )); + return FALSE; + } + + /* TODO: this is just a temp fix to stop redundant changes. */ + if ( pRect && + (pShared->rectV.left == pRect->left) && + (pShared->rectV.right == pRect->right) && + (pShared->rectV.top == pRect->top) && + (pShared->rectV.bottom == pRect->bottom) ) + { + DPF(( DBG_CNTX_WARN, "Redundant viewport" )); + return TRUE; + } + + DPF(( DBG_CNTX_INFO, "Current Viewport:" )); + DPF(( DBG_CNTX_INFO, "x: %d y: %d", pShared->rectV.left, pShared->rectV.top )); + DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pShared->rectV.right-pShared->rectV.left), (pShared->rectV.bottom-pShared->rectV.top) )); + DPF(( DBG_CNTX_INFO, "New Viewport:" )); + DPF(( DBG_CNTX_INFO, "x: %d y: %d", pRect->left, pRect->top )); + DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pRect->right-pRect->left), (pRect->bottom-pRect->top) )); + + /* Update the current viewport rect if one is supplied. */ + if ( pRect ) + memcpy( &pShared->rectV, pRect, sizeof(RECT) ); + + /* Build the request structure. */ + memset( &vdData, 0, sizeof(D3DVIEWPORT2) ); + vdData.dwSize = sizeof(D3DVIEWPORT2); + vdData.dwX = pShared->rectV.left; + vdData.dwY = pShared->rectV.top; + vdData.dwWidth = (pShared->rectV.right - pShared->rectV.left); + vdData.dwHeight = (pShared->rectV.bottom - pShared->rectV.top); + + if ( !vdData.dwWidth || !vdData.dwHeight ) + { + GetClientRect( pShared->hwnd, &pShared->rectW ); + pt.x = pt.y = 0; + ClientToScreen( pShared->hwnd, &pt ); + OffsetRect( &pShared->rectW, pt.x, pt.y); + vdData.dwX = pShared->rectW.left; + vdData.dwY = pShared->rectW.top; + vdData.dwWidth = (pShared->rectW.right - pShared->rectW.left); + vdData.dwHeight = (pShared->rectW.bottom - pShared->rectW.top); + memcpy( &pShared->rectV, &pShared->rectW, sizeof(RECT) ); + } + + // The dvClipX, dvClipY, dvClipWidth, dvClipHeight, dvMinZ, + // and dvMaxZ members define the non-normalized post-perspective + // 3-D view volume which is visible to the viewer. In most cases, + // dvClipX is set to -1.0 and dvClipY is set to the inverse of + // the viewport's aspect ratio on the target surface, which can be + // calculated by dividing the dwHeight member by dwWidth. Similarly, + // the dvClipWidth member is typically 2.0 and dvClipHeight is set + // to twice the aspect ratio set in dwClipY. The dvMinZ and dvMaxZ + // are usually set to 0.0 and 1.0. + vdData.dvClipX = -1.0f; + vdData.dvClipWidth = 2.0f; + vdData.dvClipY = 1.0f; + vdData.dvClipHeight = 2.0f; + vdData.dvMaxZ = maxZ; + vdData.dvMinZ = minZ; + + DPF(( DBG_CNTX_INFO, "zMin: %f zMax: %f", minZ, maxZ )); + + /* I'm going to destroy the viewport everytime as when we size we will */ + /* have a new D3DDevice. As this area doesn't need to be fast... */ + if ( pHAL->lpViewport ) + { + DPF(( DBG_CNTX_INFO, "DeleteViewport" )); + + pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport ); + rc = pHAL->lpViewport->Release(); + pHAL->lpViewport = NULL; + } + + rc = pHAL->lpD3D3->CreateViewport( &pHAL->lpViewport, NULL ); + if ( rc != D3D_OK ) + { + DPF(( DBG_CNTX_ERROR, "CreateViewport Failed" )); + return FALSE; + } + + /* Update the device with the new viewport. */ + pHAL->lpD3DDevice->AddViewport( pHAL->lpViewport ); + pHAL->lpViewport->SetViewport2( &vdData ); + pHAL->lpD3DDevice->SetCurrentViewport( pHAL->lpViewport ); + + return TRUE; +} +/*===========================================================================*/ +/* */ +/* */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid ) +{ + DDSURFACEDESC2 *pddsd2 = (DDSURFACEDESC2 *)pVoid; + + DPF(( DBG_FUNC, "EnumSurfacesHook();" )); + + if ( (lpDDSDesc->ddpfPixelFormat.dwFlags == pddsd2->ddpfPixelFormat.dwFlags) && (lpDDSDesc->ddsCaps.dwCaps == pddsd2->ddsCaps.dwCaps) ) + { + /* Save the pixelformat now so that we know we have one. */ + memcpy( pddsd2, lpDDSDesc, sizeof(DDSURFACEDESC2) ); + + return D3DENUMRET_CANCEL; + } + + return D3DENUMRET_OK; +} +/*===========================================================================*/ +/* This is the callback proc to get a Z-Buffer. Thats it. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid ) +{ + DDPIXELFORMAT *pddpfChoice = (DDPIXELFORMAT *)pVoid; + + DPF(( DBG_FUNC, "EnumZBufferHook();" )); + + /* If this is ANY type of depth-buffer, stop. */ + if( pddpf->dwFlags == DDPF_ZBUFFER ) + { + /* Save the pixelformat now so that we know we have one. */ + memcpy( pddpfChoice, pddpf, sizeof(DDPIXELFORMAT) ); + + /* I feel if the hardware supports this low then lets use it. Could get ugly. */ + if( pddpf->dwZBufferBitDepth >= 8 ) + { + return D3DENUMRET_CANCEL; + } + } + + return D3DENUMRET_OK; +} +/*===========================================================================*/ +/* This function handles the callback for the D3DDevice enumeration. Good */ +/* god who's idea was this? The D3D wrapper has two variable related to what*/ +/* kind of device we want and have. First we have a Bool that is set if we */ +/* have allocated a HW device. We always look for the HW device first. The */ +/* other variable is used to force SW. If we have run into a case that we */ +/* want to fallback to SW then we set this. We will fallback if we cannot */ +/* texture in video memory (among others). */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pVoid; + LPD3DDEVICEDESC pChoice = lpD3DHWDesc; + + DPF(( DBG_FUNC, "EnumDeviceHook();" )); + + /* Determine if which device description is valid. */ + if ( pChoice->dcmColorModel == 0 ) + pChoice = lpD3DHELDesc; + + /* Make sure we always have a GUID. */ + memcpy( &pHAL->guid, lpGuid, sizeof(GUID) ); + + /* This controls whether we will except HW or not. */ + if ( pHAL->shared.bForceSW == TRUE ) + { + return (pChoice == lpD3DHELDesc) ? D3DENUMRET_CANCEL : D3DENUMRET_OK; + } + + /* Always try for hardware. */ + if ( pChoice == lpD3DHWDesc ) + { + return D3DENUMRET_CANCEL; + } + + return D3DENUMRET_OK; +} +/*===========================================================================*/ +/* This function will destroy any and all surfaces that this context has */ +/* allocated. If there is a clipper object then it will also be destoryed as*/ +/* it is part of the Primary Surface. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void DestroyAllSurfaces( PMESAD3DHAL pHAL ) +{ + LONG refCount; + + DPF(( DBG_FUNC, "DestroyAllSurfaces();" )); + + DX_RESTORE( pHAL->lpDDSPrimary ); + DX_RESTORE( pHAL->lpDDSRender ); + DX_RESTORE( pHAL->lpDDSZbuffer); + + if ( pHAL->lpDDSRender ) + { + pHAL->lpDDSRender->Unlock( NULL ); + + /* If this isn't a Flipable surface then we must clean up the render. */ + if ( pHAL->shared.bFlipable == FALSE) + { + if ( pHAL->lpDDSZbuffer ) + { + DPF(( DBG_CNTX_INFO, "Remove attached surfaces from RENDER" )); + pHAL->lpDDSRender->DeleteAttachedSurface( 0, NULL ); + } + + DPF(( DBG_CNTX_INFO, "Release RENDER" )); + refCount = pHAL->lpDDSRender->Release(); + pHAL->lpDDSRender = NULL; + } + } + + if ( pHAL->lpDDSZbuffer ) + { + DPF(( DBG_CNTX_INFO, "Release ZBuffer" )); + pHAL->lpDDSZbuffer->Unlock( NULL ); + refCount = pHAL->lpDDSZbuffer->Release(); + pHAL->lpDDSZbuffer = NULL; + } + + if ( pHAL->lpClipper ) + { + DPF(( DBG_CNTX_INFO, "Release Clipper" )); + refCount = pHAL->lpClipper->Release(); + pHAL->lpClipper = NULL; + } + + if ( pHAL->lpDDSPrimary ) + { + pHAL->lpDDSPrimary->Unlock( NULL ); + + DPF(( DBG_CNTX_INFO, "Release PRIMARY" )); + refCount = pHAL->lpDDSPrimary->Release(); + pHAL->lpDDSPrimary = NULL; + } +} +/*===========================================================================*/ +/* This function will destroy the current D3DDevice and any resources that */ +/* belong to it. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void DestroyDevice( PMESAD3DHAL pHAL ) +{ + LONG refCount; + + DPF(( DBG_FUNC, "DestroyDevice();" )); + + /* Kill the D3D stuff if exists. */ + if ( pHAL->lpViewport ) + { + DPF(( DBG_CNTX_INFO, "Delete Viewport" )); + pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport ); + + DPF(( DBG_CNTX_INFO, "Release Viewport" )); + refCount = pHAL->lpViewport->Release(); + pHAL->lpViewport = NULL; + } + + if ( pHAL->lpD3DDevice != NULL ) + { + DPF(( DBG_CNTX_INFO, "Release D3DDevice" )); + refCount = pHAL->lpD3DDevice->EndScene(); + refCount = pHAL->lpD3DDevice->Release(); + pHAL->lpD3DDevice = NULL; + } +} +/*===========================================================================*/ +/* This function will destroy the current D3DDevice and any resources that */ +/* belong to it. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void DestroyInterfaces( PMESAD3DHAL pHAL ) +{ + LONG refCount; + + DPF(( DBG_FUNC, "DestroyInterfaces();" )); + + if ( pHAL->lpD3D3 != NULL ) + { + DPF(( DBG_CNTX_INFO, "Release Direct3D3" )); + refCount = pHAL->lpD3D3->Release(); + pHAL->lpD3D3 = NULL; + } + + if ( pHAL->lpDD4 != NULL ) + { + DPF(( DBG_CNTX_INFO, "Release DDraw4" )); + refCount = pHAL->lpDD4->Release(); + pHAL->lpDD4 = NULL; + } + + if ( pHAL->lpDD != NULL ) + { + DPF(( DBG_CNTX_INFO, "Release DDraw" )); + refCount = pHAL->lpDD->Release(); + pHAL->lpDD = NULL; + } +} +/*===========================================================================*/ +/* This function will first send (not post) a message to the client window */ +/* that this context is using. The client will respond by unbinding itself */ +/* and binding the 'default' context. This allows the API to be supported */ +/* until the window can be destroyed. Finally we post the quit message to */ +/* the client in hopes to end the application. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void FatalShutDown( PMESAD3DHAL pHAL ) +{ + /* Whip this baby in too try and support the API until we die... */ + if ( pHAL ) + SendMessage( pHAL->shared.hwnd, UM_FATALSHUTDOWN, 0L, 0L ); + + /* Close the client application down. */ + PostQuitMessage( 0 ); +} + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DMESA.H xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DMESA.H --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DMESA.H 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DMESA.H 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,84 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef D3D_MESA_H +#define D3D_MESA_H +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include +#include +#include +#include "matrix.h" +#include "context.h" +#include "mtypes.h" +#include "vb.h" +#include "D3DShared.h" +#include "Debug.h" +#include "NULLProcs.h" +/*===========================================================================*/ +/* Macros. */ +/*===========================================================================*/ +#define FLIP(h,y) (h-y) +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +struct __extensions__ +{ + PROC proc; + char *name; +}; + +typedef GLbitfield (*ClearPROC)( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); +typedef void (*WSpanRGBPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] ); +typedef void (*WSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); +typedef void (*WSpanRGBAMonoPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] ); +typedef void (*WPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); +typedef void (*WPixelsRGBAMonoPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] ); +typedef void (*RSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); +typedef void (*RPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); + +typedef struct D3D_mesa_context +{ + PMESAD3DSHARED pShared; + + GLcontext *gl_ctx; /* The core GL/Mesa context */ + GLvisual *gl_visual; /* Describes the buffers */ + GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */ + + HDC hdc; + WNDPROC hOldProc; + + UCHAR rClear, /* Current clear colors. */ + gClear, + bClear, + aClear, + rCurrent, /* Current rendering colors. */ + gCurrent, + bCurrent, + aCurrent; + + struct D3D_mesa_context *next; + +} D3DMESACONTEXT, *PD3DMESACONTEXT; +/*===========================================================================*/ +/* Extern function prototypes. */ +/*===========================================================================*/ +extern void gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +extern D3DTLVERTEX D3DTLVertices[(VB_MAX*6)]; + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DRaster.cpp xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DRaster.cpp --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DRaster.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DRaster.cpp 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,213 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DHAL.h" +/*===========================================================================*/ +/* This function clears the context bound to the supplied shared context. */ +/* The function takes the D3D flags D3DCLEAR_TARGET, D3DCLEAR_STENCIL and */ +/* D3DCLEAR_ZBUFFER. Set bAll to TRUE for a full clear else supply the coord*/ +/* of the rect to be cleared relative to the window. The color is always a */ +/* 32bit value (RGBA). Fill in the z-value and stencil if needed. */ +/* */ +/* TODO: this can be redone to be called by Mesa directly. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + D3DRECT d3dRect; + +#ifdef D3D_DEBUG + HRESULT rc; + + DPF(( DBG_FUNC, "CleaHAL();" )); + + /* Make sure we have enough info. */ + if ( (pHAL == NULL) || (pHAL->lpViewport == NULL) ) + return; +#endif + + if ( bAll ) + { + /* I assume my viewport is valid. */ + d3dRect.lX1 = pShared->rectV.left; + d3dRect.lY1 = pShared->rectV.top; + d3dRect.lX2 = pShared->rectV.right; + d3dRect.lY2 = pShared->rectV.bottom; + } + else + { + d3dRect.lX1 = pShared->rectV.left + x; + d3dRect.lY1 = pShared->rectV.top + y; + d3dRect.lX2 = d3dRect.lX1 + cx; + d3dRect.lY2 = d3dRect.lY1 + cy; + } + +#ifdef D3D_DEBUG + rc = pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil ); + if ( FAILED(rc) ) + { + RIP( pHAL, "Clear2 ->", ErrorStringD3D(rc) ); + } +#else + pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil ); +#endif +} +/*===========================================================================*/ +/* Well this is the guts of it all. Here we rasterize the primitives that */ +/* are in their final form. OpenGL has done all the lighting, transfomations*/ +/* and clipping at this point. */ +/* */ +/* TODO: I'm not sure if I want to bother to check for errors on this call. */ +/* The overhead kills me... */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + +#ifdef D3D_DEBUG + HRESULT rc; + + DPF(( DBG_FUNC, "DrawPrimitveHAL();" )); + + /* Make sure we have enough info. */ + if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) ) + return; + + DPF(( DBG_PRIM_INFO, "DP( %d )", dwCount )); + + rc = pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType, + D3DFVF_TLVERTEX, + (LPVOID)pVertices, + dwCount, + (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); + if ( FAILED(rc) ) + { + RIP( pHAL, "DrawPrimitive ->", ErrorStringD3D(rc) ); + } +#else + pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType, + D3DFVF_TLVERTEX, + (LPVOID)pVertices, + dwCount, + (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); +#endif +} +/*===========================================================================*/ +/* This call will handle the swapping of the buffers. Now I didn't bother */ +/* to support single buffered so this will be used for glFlush() as its all */ +/* the same. So first we do an EndScene as we are always considered to be in*/ +/* a BeginScene because when we leave we do a BeginScene. Now note that when*/ +/* the context is created in the first place we do a BeginScene also just to */ +/* get things going. The call will use either Flip/blt based on the type of */ +/* surface was created for rendering. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void SwapBuffersHAL( PMESAD3DSHARED pShared ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + +#ifdef D3D_DEBUG + HRESULT rc; + + DPF(( DBG_FUNC, "SwapBuffersHAL();" )); + DPF(( DBG_ALL_PROFILE, "=================SWAP===================" )); + + /* Make sure we have enough info. */ + if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) ) + return; + + /* Make sure we have enough info. */ + if ( pHAL->lpDDSPrimary != NULL ) + { + rc = pHAL->lpD3DDevice->EndScene(); + if ( FAILED(rc) ) + { + RIP( pHAL, "EndScene ->", ErrorStringD3D(rc) ); + } + + if ( pShared->bFlipable ) + { + DPF(( DBG_CNTX_PROFILE, "Swap->FLIP" )); + rc = pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT ); + } + else + { + DPF(( DBG_CNTX_PROFILE, "Swap->Blt" )); + rc = pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL ); + } + if ( FAILED(rc) ) + { + RIP( pHAL, "Blt (RENDER/PRIMARY) ->", ErrorStringD3D(rc) ); + } + + rc = pHAL->lpD3DDevice->BeginScene(); + if ( FAILED(rc) ) + { + RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) ); + } + } +#else + pHAL->lpD3DDevice->EndScene(); + + if ( pShared->bFlipable ) + pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT ); + else + pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL ); + + pHAL->lpD3DDevice->BeginScene(); + +#endif +} +/*===========================================================================*/ +/* This function is a very thin wrapper for the D3D call 'SetRenderState'. */ +/* Using this function requires all the types to be defined by including the */ +/* D3D header file. */ +/* */ +/* TODO: would be much better to get ride of all these calls per VBRender. */ +/* I feel I should get this call into SetRenderStates() the RenderVB. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + +#ifdef D3D_DEBUG + HRESULT rc; + + DPF(( DBG_FUNC, "SetStateHAL();" )); + + /* Make sure we have enough info. */ + if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) ) + return; + + rc = pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState ); + if ( FAILED(rc) ) + { + RIP( pHAL, "SetRenderState ->", ErrorStringD3D(rc) ); + } + +#else + pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState ); +#endif +} + + + + + + + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DShared.h xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DShared.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DShared.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DShared.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,154 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef D3D_MESA_ALL_H +#define D3D_MESA_ALL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include +#include +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +#define TM_ACTION_LOAD 0x01 +#define TM_ACTION_BIND 0x02 +#define TM_ACTION_UPDATE 0x04 + +#define UM_FATALSHUTDOWN (WM_USER+42) +/*===========================================================================*/ +/* Macros defines. */ +/*===========================================================================*/ +#define ALLOC(cb) malloc( (cb) ) +#define FREE(p) { free( (p) ); (p) = NULL; } +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +typedef struct _pixel_convert +{ + int cb, /* Count in bytes of one pixel. */ + rShift, /* Shift count that postions each componet. */ + gShift, + bShift, + aShift; + float rScale, /* Value that scales a color that ranges 0.0 -> 1.0 */ + gScale, /* to this pixel format. */ + bScale, + aScale; + DWORD dwRMask, /* Color mask per component. */ + dwGMask, + dwBMask, + dwAMask; + +} PIXELINFO, *PPIXELINFO; + + +typedef struct _d3d_shared_info +{ + HWND hwnd; + BOOL bWindow, + bFlipable, + bForceSW, + bHardware; + RECT rectW, /* Window size and postion in screen space. */ + rectV; /* Viewport size and postion. */ + DWORD dwWidth, /* Current render size for quick checks. */ + dwHeight; + + PIXELINFO pixel; + DWORD dwSrcBlendCaps[14], /* See D3DCAPS.CPP */ + dwDestBlendCaps[14], + dwTexFunc[4]; + +} MESAD3DSHARED, *PMESAD3DSHARED; + +typedef struct _render_options +{ + BOOL bForceSoftware, /* TODO: Add user switches. */ + bStretchtoPrimary; + +} USER_CTRL, *PUSER_CRTL; + +enum { s_zero = 0, + s_one, + s_dst_color, + s_one_minus_dst_color, + s_src_alpha, + s_one_minus_src_alpha, + s_dst_alpha, + s_one_minus_dst_alpha, + s_src_alpha_saturate, + s_constant_color, + s_one_minus_constant_color, + s_constant_alpha, + s_one_minus_constant_alpha }; + +enum { d_zero = 0, + d_one, + d_src_color, + d_one_minus_src_color, + d_src_alpha, + d_one_minus_src_alpha, + d_dst_alpha, + d_one_minus_dst_alpha, + d_constant_color, + d_one_minus_constant_color, + d_constant_alpha, + d_one_minus_constant_alpha }; + +enum { d3dtblend_decal = 0, + d3dtblend_decalalpha, + d3dtblend_modulate, + d3dtblend_modulatealpha }; + +/*===========================================================================*/ +/* Function prototypes. */ +/*===========================================================================*/ +PMESAD3DSHARED InitHAL( HWND hwnd ); +void TermHAL( PMESAD3DSHARED pShared ); +BOOL CreateHAL( PMESAD3DSHARED pShared ); +BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ ); + +void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil ); +void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState ); +void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount ); + +void SwapBuffersHAL( PMESAD3DSHARED pShared ); +DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack ); +void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack ); +void UpdateScreenPosHAL( PMESAD3DSHARED pShared ); +void GetPixelInfoHAL( PMESAD3DSHARED pShared, PPIXELINFO pPixel ); +BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags, RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels ); +void DisableTMgrHAL( PMESAD3DSHARED pShared ); + + +int SaveDIBitmap( char *filename, BITMAPINFO *info, void *bits ); +int ARGB_SaveBitmap( char *filename, int width, int height, unsigned char *pARGB ); +int BGRA_SaveBitmap( char *filename, int width, int height, unsigned char *pBGRA ); +int BGR_SaveBitmap( char *filename, int width, int height, unsigned char *pBGR ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +extern float g_DepthScale, /* Mesa needs to scale Z in SW. The HAL */ + g_MaxDepth; /* doesn't but I wanted SW still to work.*/ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTEXT.CPP xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTEXT.CPP --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTEXT.CPP 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTEXT.CPP 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,576 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "d3dText.h" + +/*============================================================================= + + 1 + ------ + | | + 6 | | 2 + | 7 | + ------ + | | + 5 | | 3 + | | + ------ + 4 + + TL_0 TR_0 +TLL TL_1 TR_1 TRR + +MLL_0 ML_0 MR_0 MRR_0 +MLL_1 ML_1 MR_1 MRR_1 + +BLL BL_0 BR_0 BRR + BL_1 BR_1 + +=============================================================================*/ + +#define TLL 0 +#define TRR 1 +#define TL_0 2 +#define TL_1 3 +#define TR_0 4 +#define TR_1 5 + +#define MLL_0 6 +#define MLL_1 7 +#define MRR_0 8 +#define MRR_1 9 + +#define ML_0 10 +#define ML_1 11 +#define MR_0 12 +#define MR_1 13 + +#define BL_0 14 +#define BL_1 15 +#define BR_0 16 +#define BR_1 17 +#define BLL 18 +#define BRR 19 + +#define BIT1 0x00000001 +#define BIT2 0x00000002 +#define BIT3 0x00000004 +#define BIT4 0x00000008 +#define BIT5 0x00000010 +#define BIT6 0x00000020 +#define BIT7 0x00000040 + +#define TOP BIT4 +#define MIDDLE BIT7 +#define BOTTOM BIT1 +#define TLEFT BIT5 +#define BLEFT BIT6 +#define LEFT (TLEFT|BLEFT) +#define TRIGHT BIT3 +#define BRIGHT BIT2 +#define RIGHT (TRIGHT|BRIGHT) +#define ALL 0xFFFFFFFF + +/*===========================================================================*/ +/* This is the static array that will map the ASCII value of the character */ +/* being draw to the bit mask that will be scan converted to the LED display.*/ +/*===========================================================================*/ +DWORD textBitMasks[] = +{ + 0xFFFFFFFF, // 000 + 0xFFFFFFFF, // 001 + 0xFFFFFFFF, // 002 + 0xFFFFFFFF, // 003 + 0xFFFFFFFF, // 004 + 0xFFFFFFFF, // 005 + 0xFFFFFFFF, // 006 + 0xFFFFFFFF, // 007 + 0xFFFFFFFF, // 008 + 0xFFFFFFFF, // 009 + 0xFFFFFFFF, // 010 + 0xFFFFFFFF, // 011 + 0xFFFFFFFF, // 012 + 0xFFFFFFFF, // 013 + 0xFFFFFFFF, // 014 + 0xFFFFFFFF, // 015 + 0xFFFFFFFF, // 016 + 0xFFFFFFFF, // 017 + 0xFFFFFFFF, // 018 + 0xFFFFFFFF, // 019 + 0xFFFFFFFF, // 020 + 0xFFFFFFFF, // 021 + 0xFFFFFFFF, // 022 + 0xFFFFFFFF, // 023 + 0xFFFFFFFF, // 024 + 0xFFFFFFFF, // 025 + 0xFFFFFFFF, // 026 + 0xFFFFFFFF, // 027 + 0xFFFFFFFF, // 028 + 0xFFFFFFFF, // 029 + 0xFFFFFFFF, // 030 + 0XFFFFFFFF, // 031 + 0x00000000, // 032 'SPC' + 0xFFFFFFFF, // 033 + 0xFFFFFFFF, // 034 + 0xFFFFFFFF, // 035 + 0xFFFFFFFF, // 036 + 0xFFFFFFFF, // 037 + 0xFFFFFFFF, // 038 + 0xFFFFFFFF, // 039 + 0xFFFFFFFF, // 040 + 0xFFFFFFFF, // 041 + 0xFFFFFFFF, // 042 + 0xFFFFFFFF, // 043 + 0xFFFFFFFF, // 044 + 0xFFFFFFFF, // 045 + 0xFFFFFFFF, // 046 + 0xFFFFFFFF, // 047 + (ALL &~ MIDDLE), // 048 '0' + (RIGHT), // 049 '1' + (ALL &~ TLEFT &~ BRIGHT), // 050 '2' + (ALL &~ LEFT), // 051 '3' + (TLEFT | MIDDLE | RIGHT), // 052 '4' + (ALL &~ TRIGHT &~ BLEFT), // 053 '5' + (ALL &~ TRIGHT), // 054 '6' + (TOP | RIGHT), // 055 '7' + (ALL), // 056 '8' + (ALL &~ BOTTOM &~ BLEFT), // 057 '9' + 0xFFFFFFFF, // 058 + 0xFFFFFFFF, // 059 + 0xFFFFFFFF, // 060 + 0XFFFFFFFF, // 061 + 0xFFFFFFFF, // 062 + 0xFFFFFFFF, // 063 + 0xFFFFFFFF, // 064 + (ALL &~ BOTTOM), // 065 'A' + (ALL), // 066 'B' + (TOP | LEFT | BOTTOM), // 067 'C' + (ALL &~ MIDDLE), // 068 'D' + (ALL &~ RIGHT), // 069 'E' + (LEFT | TOP | MIDDLE), // 070 'F' + 0x00000000, // 071 'G' + (ALL &~ TOP &~ BOTTOM), // 072 'H' + (RIGHT), // 073 'I' + (RIGHT | BOTTOM), // 074 'J' + 0x00000000, // 075 'K' + (LEFT | BOTTOM), // 076 'L' + 0x00000000, // 088 'M' + 0x00000000, // 089 'N' + (ALL &~ MIDDLE), // 090 'O' + (ALL &~ BRIGHT &~ BOTTOM),// 091 'P' + 0x00000000, // 092 'Q' + 0x00000000, // 093 'R' + (ALL &~ TRIGHT &~ BLEFT), // 094 'S' + 0X00000000, // 095 'T' + (LEFT | RIGHT | BOTTOM), // 096 'U' + 0x00000000, // 097 'V' + 0x00000000, // 098 'W' + 0x00000000, // 099 'X' + 0x00000000, // 1000 'Z' + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 100 + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 104 + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 108 + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 112 + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 116 + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 120 + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF // 124 +}; + +#define CT 1.0f +#define CX 7.0f +#define CY 13.0f +#define CM ((CY-(CT*3.0f))/2.0f) + +float lCoords[][2] = +{ + /* Top outsides. */ + { 0, (CY-CT) }, + { CX, (CY-CT) }, + + /* Top Line. */ + { CT, CY }, + { CT, (CY-CT) }, + { (CX-CT), CY }, + { (CX-CT), (CY-CT) }, + + /* Middle outsides. */ + { 0.0f, (CT+CM+CT) }, + { 0.0f, (CT+CM) }, + { CX, (CT+CM+CT) }, + { CX, (CT+CM) }, + + /* Middle Line. */ + { CT, (CT+CM+CT) }, + { CT, (CT+CM) }, + { (CX-CT), (CT+CM+CT) }, + { (CX-CT), (CT+CM) }, + + /* Bottom line. */ + { CT, CT }, + { CT, 0.0f }, + { (CX-CT), CT }, + { (CX-CT), 0.0f }, + + /* Bottom outsides. */ + { 0.0f, CT}, + { CX, CT } +}; + +static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics ); + +D3DTLVERTEX TextVertices[MAX_VERTICES]; +/*===========================================================================*/ +/* When we attach I will zero out the whole D3D vertex buffer I'm using for */ +/* the text. This way I don't need to set all the redundant values. I also */ +/* set all the oow values to 1 as I will be doing direct rendering. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +extern "C" BOOL InitD3DText( void ) +{ + int index; + + /* Set the D3D Vertex Buffer up once so we don't do redundant changes. */ + memset( &TextVertices[0], 0, sizeof(TextVertices) ); + for( index = 0; index < MAX_VERTICES; index++ ) + TextVertices[index].rhw = D3DVAL( 1.0 ); + + return TRUE; +} +/*===========================================================================*/ +/* This function takes a single character and draw it using the supplied */ +/* fontmetrics structure. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics ) +{ + int cIndex, + nIndex, + index; + float cWidth = CX, + cHeight = CY; + + /* Find the max width/height of a character and add the spacing so */ + /* that we can use this value to calculate the x,y of the character.*/ + cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing; + cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing; + + /* Walk the string. This must be NULL terminated. */ + for( cIndex = 0, nIndex = 0; *pszString; pszString++, cIndex = nIndex, x++ ) + { + /* Convert the character and get the index into the text vertex buffer. */ + nIndex = ConvertCharacter( &pszString[0], cIndex, pfntMetrics ); + if ( (nIndex - cIndex) > 2 ) + { + /* Modify the text vertex buffer based on the fntMetrics structure. */ + for( index = cIndex; index < nIndex; index++ ) + { + /* Scale the character. */ + TextVertices[index].sx *= pfntMetrics->fntXScale; + TextVertices[index].sy *= pfntMetrics->fntYScale; + + /* Move the character. */ + TextVertices[index].sx += (cWidth*x); + TextVertices[index].sy += (cHeight*y); + + /* Set the color. */ + TextVertices[index].color = pfntMetrics->dwColor; + } + } + } + + if ( nIndex < 3 ) + return; + + /* Set the states that slim things down. */ + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); + + /* Blast them baby... */ + pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST, + D3DFVF_TLVERTEX, + (LPVOID)&TextVertices[0], + nIndex, + (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); +} +/*===========================================================================*/ +/* This function takes a single character and draw it directly to the screen*/ +/* unsing the supplied fntMetrics structure. The character will be drawn at */ +/* the supplied x,y. The x,y position is relative to the top left and uses */ +/* the spacing in the fntMetrics structure. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics ) +{ + int cIndex = 0, + index; + float cWidth = CX, + cHeight = CY; + + /* Convert the character and get the index into the text vertex buffer. */ + cIndex = ConvertCharacter( c, 0, pfntMetrics ); + if ( cIndex < 3 ) + return; + + /* Find the max width/height of a character and add the spacing so */ + /* that we can use this value to calculate the x,y of the character.*/ + cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing; + cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing; + + /* Modify the text vertex buffer based on the fntMetrics structure. */ + for( index = 0; index < cIndex; index++ ) + { + /* Scale the character. */ + TextVertices[index].sx *= pfntMetrics->fntXScale; + TextVertices[index].sy *= pfntMetrics->fntYScale; + + /* Move the character. */ + TextVertices[index].sx += (cWidth*x); + TextVertices[index].sy += (cHeight*y); + + /* Set the color. */ + TextVertices[index].color = pfntMetrics->dwColor; + } + + + /* Set the states that slim things down. */ + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); + pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); + + /* Blast them baby... */ + pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST, + D3DFVF_TLVERTEX, + (LPVOID)&TextVertices[0], + cIndex, + (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); +} +/*===========================================================================*/ +/* This function takes a single character and draw it using the supplied */ +/* fontmetrics structure. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics ) +{ + DWORD asciiChar = (int)(*c); + + /* Handle the TOP line. */ + if ( textBitMasks[asciiChar] & BIT1 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] ); + } + + /* Handle the TOP/BOTTOM RIGHT lines. */ + // if ( textBitMasks[index] & (BIT2|BIT3) ) + if ( 1 == 0 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TRR][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); + } + else + { + if ( textBitMasks[asciiChar] & BIT2 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[TRR][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] ); + } + if ( textBitMasks[asciiChar] & BIT3 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[BR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] ); + } + } + + /* Handle the TOP/BOTTOM LEFT lines. */ + // if ( textBitMasks[asciiChar] & (BIT5|BIT6) ) + if ( 1 == 0 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BLL][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] ); + } + else + { + if ( textBitMasks[asciiChar] & BIT5 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[BLL][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] ); + } + if ( textBitMasks[asciiChar] & BIT6 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[TL_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_0][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); + TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] ); + } + } + + /* Handle the MIDDLE line. */ + if ( textBitMasks[asciiChar] & BIT7 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] ); + } + + /* Handle the BOTTOM line. */ + if ( textBitMasks[asciiChar] & BIT4 ) + { + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_1][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_1][1] ); + TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); + TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); + } + + return cIndex; +} + +#undef CM +#undef CY +#undef CX +#undef CT + +#undef TLL +#undef TRR +#undef TL_0 +#undef TL_1 +#undef TR_0 +#undef TR_1 + +#undef MLL_0 +#undef MLL_1 +#undef MRR_0 +#undef MRR_1 + +#undef ML_0 +#undef ML_1 +#undef MR_0 +#undef MR_1 + +#undef BL_0 +#undef BL_1 +#undef BR_0 +#undef BR_1 +#undef BLL +#undef BRR + +#undef BIT1 +#undef BIT2 +#undef BIT3 +#undef BIT4 +#undef BIT5 +#undef BIT6 +#undef BIT7 + +#undef TOP +#undef MIDDLE +#undef BOTTOM +#undef TLEFT +#undef BLEFT +#undef LEFT +#undef TRIGHT +#undef BRIGHT +#undef RIGHT +#undef ALL diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/d3dText.h xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/d3dText.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/d3dText.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/d3dText.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,53 @@ +#ifndef D3D_TEXT_H +#define D3D_TEXT_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include +#include +#include +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +#define D3DLTEXT_BITSUSED 0xFFFFFFFF +#define MAX_VERTICES 700 // (14*40) 14 per character, 40 characters +/*===========================================================================*/ +/* Macros defines. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +typedef struct _d3dText_metrics +{ + float fntYScale, + fntXScale; + + int fntXSpacing, + fntYSpacing; + + DWORD dwColor; + LPDIRECT3DDEVICE3 lpD3DDevice; + +} D3DFONTMETRICS, *PD3DFONTMETRICS; +/*===========================================================================*/ +/* Function prototypes. */ +/*===========================================================================*/ +extern BOOL InitD3DText( void ); +extern void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics ); +extern void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ + +#ifdef __cplusplus +} +#endif + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.cpp xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.cpp --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.cpp 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.cpp 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,947 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DHAL.h" +/*===========================================================================*/ +/* Local function prototypes. */ +/*===========================================================================*/ +static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels ); +static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj ); +static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ); +static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ); +HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext ); +/*===========================================================================*/ +/* This function will simply set the top of stack to NULL. I only used it */ +/* just incase I want to add something later. */ +/*===========================================================================*/ +/* RETURN: TRUE. */ +/*===========================================================================*/ +BOOL InitTMgrHAL( PMESAD3DHAL pHAL ) +{ + DPF(( DBG_FUNC, "InitTMgrHAL();" )); + + /* Be clean my friend. */ + pHAL->pTMList = NULL; + + return TRUE; +} +/*===========================================================================*/ +/* This function will walk the Texture Managers linked list and destroy all */ +/* surfaces (SYSTEM/VIDEO). The texture objects themselves also will be */ +/* freed. */ +/* NOTE: this is per/context. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void TermTMgrHAL( PMESAD3DHAL pHAL ) +{ + DPF(( DBG_FUNC, "TermTMgrHAL();" )); + + if ( pHAL && pHAL->pTMList ) + { + /* Destroy the surface and remove the TMO from the stack. */ + while( DestroyTextureObject(pHAL,NULL) ); + + /* Be clean my friend. */ + pHAL->pTMList = NULL; + } +} +/*===========================================================================*/ +/* This function is a HACK as I don't know how I can disable a texture with-*/ +/* out booting it out. Is there know state change? */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void DisableTMgrHAL( PMESAD3DSHARED pShared ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + + DPF(( DBG_FUNC, "DisableTMgrHAL();" )); + + /* Check too see that we have a valid context. */ + if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) ) + { + DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" )); + return; + } + + // TODO: This is a hack to shut off textures. + pHAL->lpD3DDevice->SetTexture( 0, NULL ); +} +/*===========================================================================*/ +/* This function is the only entry into the TextureManager that Mesa/wgl */ +/* will see. It uses a dwAction to specify what we are doing. I did this as*/ +/* depending on the cards resources the action taken can change. */ +/* When this function is called we will always search the Texture Managers */ +/* linked list (per context remember) and try and find a structure that has */ +/* the same dwName. If we have a match we pull it out of the list and put it*/ +/* at the top of the list (TOL). If we don't find one then we create a struc*/ +/* and put it a TOL. This TOL idea makes for some caching as we will always */ +/* destroy Texture Surfaces from the bottom up... */ +/* All texture objects at this point will create a texture surface in System*/ +/* memory (SMEM). Then we will copy the Mesa texture into the surface using */ +/* the 'pixel' struc to get the translation info. So now this means that all*/ +/* textures that Mesa gives me I will have a Surface with a copy. If Mesa */ +/* changes the texture the I update the surface in (SMEM). */ +/* Now we have a texture struc and a Texture Surface in SMEM. At this point*/ +/* we create another surface on the card (VMEM). Finally we blt from the */ +/* SMEM to the VMEM and set the texture as current. Why do I need two? First*/ +/* this solves square textures. If the cards CAPS is square textures only */ +/* then I change the dimensions of the VMEM surface and the blt solves it for*/ +/* me. Second it saves me from filling D3D textures over and over if the */ +/* card needs to be creating and destroying surfaces because of low memory. */ +/* The surface in SMEM is expected to work always. When a surface has to be*/ +/* created in VMEM then we put it in a loop that tries to create the surface.*/ +/* If we create the surface ok then we brake from the loop. If we fail then */ +/* we will call 'FreeTextureMemory' that will return TRUE/FALSE as to whether*/ +/* memory was freed. If memory was freed then we can try again. If no memory*/ +/* was freed then it just can't fit. */ +/* 'FreeTextureMemory' will find the end of the list and start freeing VMEM */ +/* (never SMEM) surfaces that are not locked. */ +/* BIND - when we bind and there is a texture struct with a texture surface */ +/* in VMEM then we just make it current. If we have a struct and a surface */ +/* in SMEM but no VMEM surface then we create the surface in VMEM and blt */ +/* from the SMEM surface. If we have nothing its just like a creation... */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +extern "C" BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags, + RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + PTM_OBJECT pTMObj, + pTemp; + DDSURFACEDESC2 ddsd2; + HRESULT rc; + + + DPF(( DBG_FUNC, "CreateTMgrHAL();" )); + + DPF(( DBG_TXT_INFO, "Texture:" )); + DPF(( DBG_TXT_INFO, "cx: %d cy: %d", dwWidth, dwHeight )); + DPF(( DBG_TXT_INFO, "Rect:" )); + if ( rectDirty ) + { + DPF(( DBG_TXT_INFO, "x0: %d y0: %d", rectDirty->left, rectDirty->top )); + DPF(( DBG_TXT_INFO, "x1: %d y1: %d", rectDirty->right, rectDirty->bottom )); + } + + /* Check too see that we have a valid context. */ + if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) ) + { + DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" )); + return FALSE; + } + + /*=================================================*/ + /* See if we can find this texture object by name. */ + /*=================================================*/ + for( pTMObj = pHAL->pTMList; pTMObj && (pTMObj->dwName != dwName); pTMObj = pTMObj->next ); + + /*=========================================================*/ + /* Allocate a new object if we didn't get a matching name. */ + /*=========================================================*/ + if ( pTMObj == NULL ) + { + pTMObj = (PTM_OBJECT)ALLOC( sizeof(TM_OBJECT) ); + if ( pTMObj == NULL ) + return FALSE; + memset( pTMObj, 0, sizeof(TM_OBJECT) ); + + /* Put the object at the beginning of the list. */ + pTMObj->next = pHAL->pTMList; + if ( pTMObj->next ) + { + pTemp = pTMObj->next; + pTemp->prev = pTMObj; + } + pHAL->pTMList = pTMObj; + } + else + { + /*===============================================================*/ + /* Make some caching happen by pulling this object to the front. */ + /*===============================================================*/ + if ( pHAL->pTMList != pTMObj ) + { + /* Pull the object out of the list. */ + if ( pTMObj->prev ) + { + pTemp = pTMObj->prev; + pTemp->next = pTMObj->next; + } + if ( pTMObj->next ) + { + pTemp = pTMObj->next; + pTemp->prev = pTMObj->prev; + } + + pTMObj->prev = NULL; + pTMObj->next = NULL; + + /* Put the object at the front of the list. */ + pTMObj->next = pHAL->pTMList; + if ( pTMObj->next ) + { + pTemp = pTMObj->next; + pTemp->prev = pTMObj; + } + pHAL->pTMList = pTMObj; + } + } + + /*========================================================*/ + /* If we are doing BIND and the texture is in VID memory. */ + /*========================================================*/ + if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_Video ) + { + DPF(( DBG_TXT_PROFILE, "Cache HIT (%d)", dwName )); + + /* Make this the current texture. */ + rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); + if ( FAILED(rc) ) + { + DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + return TRUE; + } + + /*=================================================================*/ + /* If we are doing BIND and the texture is at least in SYS memory. */ + /*=================================================================*/ + if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_System ) + { + DPF(( DBG_TXT_PROFILE, "Cache MISS (%d)", dwName )); + + /* Create the texture on the card. */ + rc = LoadTextureInVideo( pHAL, pTMObj ); + if ( rc == FALSE ) + return FALSE; + + /* Make this the current texture. */ + rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); + if ( FAILED(rc) ) + { + DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + return TRUE; + } + + /*=========================================================*/ + /* If we are doing UPDATE then try in VID first for speed. */ + /*=========================================================*/ + if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_Video && + !(pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) ) + { + DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" )); + + /* Update the texture on the card. */ + UpdateTexture( pTMObj, TRUE, rectDirty, (UCHAR *)pPixels ); + + /* We updated the texture in VID so kill the SYS so we know its dirty. */ + if ( pTMObj->lpDDS_System ) + { + DPF(( DBG_TXT_INFO, "Release texture (SYS)" )); + DX_RESTORE( pTMObj->lpDDS_System ); + pTMObj->lpDDS_System->Release(); + pTMObj->lpDDS_System = NULL; + } + + /* Make this the current texture. */ + rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); + if ( FAILED(rc) ) + { + DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + return TRUE; + } + + /*===========================================================*/ + /* If we are doing UPDATE then try in SYS still gives speed. */ + /*===========================================================*/ + if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_System ) + { + DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" )); + + /* Update the texture in SYS. */ + UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels ); + + /* We updated the SYS texture only so now blt to the VID. */ + rc = LoadTextureInVideo( pHAL, pTMObj ); + if ( rc == FALSE ) + return FALSE; + + /* Make this the current texture. */ + rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); + if ( FAILED(rc) ) + { + DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + return TRUE; + } + + /* At this point we have a valid Texture Manager Object with updated */ + /* links. We now need to create or update a texture surface that is */ + /* in system memory. Every texture has a copy in system so we can use*/ + /* blt to solve problems with textures allocated on the card (square */ + /* only textures, pixelformats...). */ + + // TODO: make support for update also. Dirty rectangle basicly... + + /* Kill the interface if we have one no matter what. */ + if ( pTMObj->lpD3DTexture2 ) + { + DPF(( DBG_TXT_INFO, "Release Texture2" )); + pTMObj->lpD3DTexture2->Release(); + pTMObj->lpD3DTexture2 = NULL; + } + + /* Kill the system surface. TODO: should try to get the SubIMage going again */ + if ( pTMObj->lpDDS_System ) + { + DPF(( DBG_TXT_INFO, "Release texture (SYS)" )); + DX_RESTORE( pTMObj->lpDDS_System ); + pTMObj->lpDDS_System->Release(); + pTMObj->lpDDS_System = NULL; + } + + /* Kill the Video surface. TODO: need some reuse system... */ + if ( pTMObj->lpDDS_Video ) + { + DPF(( DBG_TXT_INFO, "Release texture (VID)" )); + DX_RESTORE( pTMObj->lpDDS_Video ); + pTMObj->lpDDS_Video->Release(); + pTMObj->lpDDS_Video = NULL; + } + + /*================================================================*/ + /* Translate the the Mesa/OpenGL pixel channels to the D3D flags. */ + /*================================================================*/ + switch( dwRequestFlags ) + { + case GL_ALPHA: + dwRequestFlags = DDPF_ALPHA; + DPF(( DBG_TXT_WARN, "GL_ALPHA not supported!)" )); + return FALSE; + + case GL_INTENSITY: + case GL_LUMINANCE: + DPF(( DBG_TXT_WARN, "GL_INTENSITY/GL_LUMINANCE not supported!)" )); + dwRequestFlags = DDPF_LUMINANCE; + return FALSE; + + case GL_LUMINANCE_ALPHA: + DPF(( DBG_TXT_WARN, "GL_LUMINANCE_ALPHA not supported!)" )); + dwRequestFlags = DDPF_LUMINANCE | DDPF_ALPHAPIXELS; + return FALSE; + + case GL_RGB: + DPF(( DBG_TXT_INFO, "Texture -> GL_RGB" )); + dwRequestFlags = DDPF_RGB; + break; + + case GL_RGBA: + DPF(( DBG_TXT_INFO, "Texture -> GL_RGBA" )); + dwRequestFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + break; + } + + /*==============================*/ + /* Populate the texture object. */ + /*==============================*/ + pTMObj->dwName = dwName; + pTMObj->lpD3DDevice = pHAL->lpD3DDevice; + pTMObj->dwFlags = dwRequestFlags; + if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY ) + { + DPF(( DBG_TXT_INFO, "Convert to Square..." )); + pTMObj->dwSHeight = dwHeight; + pTMObj->dwSWidth = dwWidth; + + /* Shrink non-square textures. */ + pTMObj->dwVHeight = (dwHeight > dwWidth) ? dwWidth : dwHeight; + pTMObj->dwVWidth = (dwHeight > dwWidth) ? dwWidth : dwHeight; + } + else + { + pTMObj->dwSHeight = dwHeight; + pTMObj->dwSWidth = dwWidth; + pTMObj->dwVHeight = dwHeight; + pTMObj->dwVWidth = dwWidth; + } + + /*========================*/ + /* Create SYSTEM surface. */ + /*========================*/ + + /* Request a surface in system memory. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); + ddsd2.dwWidth = pTMObj->dwSWidth; + ddsd2.dwHeight = pTMObj->dwSHeight; + ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + ddsd2.ddsCaps.dwCaps2 = 0L; + memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) ); + ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); + ddsd2.ddpfPixelFormat.dwFlags = dwRequestFlags; + rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat ); + if ( FAILED(rc) ) + { + RIP( pHAL, "EnumerTextureFormats (SYSTEM)->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Create the surface using the enumerated pixelformat. */ + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_System, NULL ); + if ( FAILED(rc) ) + { + RIP( pHAL, "CreateSurface (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Solve the pixel mapping info using the surface pixelformat. */ + Solve8BitChannelPixelFormat( &ddsd2.ddpfPixelFormat, &pTMObj->pixel ); + + /*===================================================================*/ + /* Fill the texture using the PixelInfo structure to do the mapping. */ + /*===================================================================*/ + UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels ); + + /*=======================*/ + /* Create VIDEO surface. */ + /*=======================*/ + rc = LoadTextureInVideo( pHAL, pTMObj ); + if ( rc == FALSE ) + return FALSE; + + /* Make this the current texture. */ + rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); + if ( FAILED(rc) ) + { + DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + return TRUE; +} +/*===========================================================================*/ +/* This function will handle the creation and destruction of the texture */ +/* surfaces on the card. Using the dw'V'Width/Height dimensions the call */ +/* try and create the texture on the card and keep using FreeTextureMemory */ +/* until the surace can be created. Once the surface is created we get the */ +/* interface that we will use to make it the current texture. I didn't put */ +/* the code to make the texture current in this function as BIND needs to */ +/* use the same code and this function doesn't always get called when we do a*/ +/* bind. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj ) +{ + DDSURFACEDESC2 ddsd2; + HRESULT rc; + + DPF(( DBG_FUNC, "LoadTextureInVideo();" )); + + /* Kill the interface if we have one no matter what. */ + if ( pTMObj->lpD3DTexture2 ) + { + DPF(( DBG_TXT_INFO, "Release Texture2" )); + pTMObj->lpD3DTexture2->Release(); + pTMObj->lpD3DTexture2 = NULL; + } + + /* Kill the Video surface. TODO: need some reuse system... */ + if ( pTMObj->lpDDS_Video ) + { + DPF(( DBG_TXT_INFO, "Release texture (VID)" )); + DX_RESTORE( pTMObj->lpDDS_Video ); + pTMObj->lpDDS_Video->Release(); + pTMObj->lpDDS_Video = NULL; + } + + /* Request a surface in Video memory. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); + ddsd2.dwWidth = pTMObj->dwVWidth; + ddsd2.dwHeight = pTMObj->dwVHeight; + ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; + ddsd2.ddsCaps.dwCaps2 = 0L; + memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) ); + ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); + ddsd2.ddpfPixelFormat.dwFlags = pTMObj->dwFlags; + rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat ); + if ( FAILED(rc) ) + { + RIP( pHAL, "EnumerTextureFormats ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Make sure we lock so we don't nuke this texture trying to free memory for it. */ + pTMObj->bLock = TRUE; + + /* Start a loop that will free all textures until we have created the texture */ + /* surface or we can't free up more memory. */ + do + { + /* Try to create the texture surface. */ + rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_Video, NULL ); + if ( !FAILED(rc) ) + break; + + DPF(( DBG_TXT_INFO, "Free Texture Memory" )); + + /* DestroyTexture will return TRUE if a surface was freed. */ + } while( FreeTextureMemory(pHAL,NULL) ); + + /* Make sure we unlock or we won't be able to nuke the TMO later. */ + pTMObj->bLock = FALSE; + + /* Did we create a valid texture surface? */ + if ( FAILED(rc) ) + { + DPF(( DBG_TXT_WARN, "Failed to load texture" )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + DX_RESTORE( pTMObj->lpDDS_System ); + DX_RESTORE( pTMObj->lpDDS_Video ); + + DPF(( DBG_TXT_INFO, "Texture Blt SYSTEM -> VID" )); + + /* Now blt the texture in system memory to the card. */ + rc = pTMObj->lpDDS_Video->Blt( NULL, pTMObj->lpDDS_System, NULL, DDBLT_WAIT, NULL ); + if ( FAILED(rc) ) + { + RIP( pHAL, "Blt (TEXTURE) ->", ErrorStringD3D(rc) ); + return FALSE; + } + + /* Get the Texture interface that is used to render with. */ + pTMObj->lpDDS_Video->QueryInterface( IID_IDirect3DTexture2, (void **)&pTMObj->lpD3DTexture2 ); + if ( pTMObj->lpD3DTexture2 == NULL ) + { + DPF(( DBG_TXT_WARN, "Failed QueryTextureInterface" )); + pHAL->lpD3DDevice->SetTexture( 0, NULL ); + return FALSE; + } + + return TRUE; +} +/*===========================================================================*/ +/* If this function gets a texture object struc then we will try and free */ +/* it. If we get a NULL then we will search from the bottom up and free one */ +/* VMEM surface. I can only free when the surface isn't locked and of course*/ +/* there must be a VMEM surface. We never free SMEM surfaces as that isn't */ +/* the point. */ +/* TODO: should have a pointer to the bottom of the stack really. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ) +{ + PTM_OBJECT pCurrent; + BOOL bFreed = FALSE; + + DPF(( DBG_FUNC, "FreeTextureMemory();" )); + DPF(( DBG_TXT_WARN, "FREE TEXTURE!" )); + + /* Just to be safe. */ + if ( !pHAL || !pHAL->pTMList ) + { + DPF(( DBG_TXT_WARN, "FreeTextureMemory() -> NULL pHAL/pHAL->pTMList" )); + return FALSE; + } + + /* Free the last texture in the list. */ + if ( pTMObject == NULL ) + { + DPF(( DBG_TXT_INFO, "Free Last texture in cache" )); + + /* Find the last texture object. */ + for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next ); + + /* Now backup until we find a texture on the card. */ + while( pCurrent && (pCurrent->lpDDS_Video == NULL) && (pCurrent->bLock == FALSE) ) + pCurrent = pCurrent->prev; + + /* Didn't find anything. */ + if ( pCurrent == NULL ) + { + DPF(( DBG_TXT_INFO, "No texture memory freed" )); + return FALSE; + } + } + else + { + /* See if we can find this texture object. */ + for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next ); + + /* Didn't find anything. */ + if ( pCurrent == NULL ) + { + DPF(( DBG_TXT_INFO, "Requested texture to be freed NOT FOUND" )); + return FALSE; + } + } + + /* Can't free this baby. */ + if ( pCurrent->bLock == TRUE ) + { + DPF(( DBG_TXT_WARN, "Requested texture LOCKED" )); + return FALSE; + } + + /* Free the texture memory. */ + if ( pCurrent->lpD3DTexture2 ) + { + DPF(( DBG_TXT_INFO, "Release Texture2" )); + pCurrent->lpD3DTexture2->Release(); + pCurrent->lpD3DTexture2 = NULL; + bFreed = TRUE; + } + if ( pCurrent->lpDDS_Video ) + { + DPF(( DBG_TXT_INFO, "Release texture (VID):" )); + DPF(( DBG_TXT_INFO, "dwName: %d", pCurrent->dwName )); + DPF(( DBG_TXT_INFO, "cx: %d, cy: %d", pCurrent->dwVWidth, pCurrent->dwVHeight )); + pCurrent->lpDDS_Video->Release(); + pCurrent->lpDDS_Video = NULL; + bFreed = TRUE; + } + + return bFreed; +} +/*===========================================================================*/ +/* This function searches the linked list of texture objects in the supplied*/ +/* D3Dwrapper structure. If it finds a match it will free it and pull it out*/ +/* of the linked list. The function works on the bases of a matching pointer*/ +/* to the object (not matching content). */ +/* If the function gets passed a NULL then we want to free the last texture */ +/* object in the list. Used in a loop to destory all. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ) +{ + PTM_OBJECT pCurrent; + + DPF(( DBG_FUNC, "DestoryTextureObject();" )); + + /* Just to be safe. */ + if ( !pHAL || !pHAL->pTMList ) + { + DPF(( DBG_TXT_WARN, "DestroyTextureObject() -> NULL pHAL/pHAL->pTMList" )); + return FALSE; + } + + /* Free the last texture in the list. */ + if ( pTMObject == NULL ) + { + /* Find the last texture object. */ + for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next ); + } + else + { + /* See if we can find this texture object. */ + for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next ); + + /* Didn't find anything. */ + if ( pCurrent == NULL ) + { + DPF(( DBG_TXT_WARN, "No textures to be freed" )); + return FALSE; + } + } + + /* Can't free this baby. */ + if ( pCurrent->bLock == TRUE ) + { + DPF(( DBG_TXT_WARN, "Requested texture to be freed LOCKED" )); + return FALSE; + } + + /* Free the texture memory. */ + if ( pCurrent->lpD3DTexture2 ) + { + DPF(( DBG_TXT_INFO, "Release Texture2" )); + pCurrent->lpD3DTexture2->Release(); + pCurrent->lpD3DTexture2 = NULL; + } + if ( pCurrent->lpDDS_Video ) + { + DPF(( DBG_TXT_INFO, "Release texture (VID):" )); + pCurrent->lpDDS_Video->Release(); + pCurrent->lpDDS_Video = NULL; + } + if ( pCurrent->lpDDS_System ) + { + DPF(( DBG_TXT_INFO, "Release texture (SYS):" )); + pCurrent->lpDDS_System->Release(); + pCurrent->lpDDS_System = NULL; + } + + /* Pull this texture out of the list. */ + if ( pCurrent == pHAL->pTMList ) + pHAL->pTMList = NULL; + if ( pCurrent->prev ) + (pCurrent->prev)->next = pCurrent->next; + if ( pCurrent->next ) + (pCurrent->next)->prev = pCurrent->prev; + FREE( pCurrent ); + + return TRUE; +} +/*===========================================================================*/ +/* This function is the callback function that gets called when we are doing*/ +/* an enumeration of the texture formats supported by this device. The choice*/ +/* is made by checking to see if we have a match with the supplied D3D pixel-*/ +/* format. So the enumeration has to pass a desired D3D PF as the user var. */ +/*===========================================================================*/ +/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */ +/*===========================================================================*/ +static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels ) +{ + LPDIRECTDRAWSURFACE4 lpDDS; + DDSURFACEDESC2 ddsd2; + DWORD srcPitch, + dwHeight, + dwWidth, + dwCol, + dwColor; + UCHAR *pSrc, + *pSrcRow, + *pDest, + *pDestRow; + int rc; + + // TODO: Do I need to pass the h/w when its in the object! + DPF(( DBG_FUNC, "UpdateTexture();" )); + + /* Get the surface pointer we are looking for. */ + lpDDS = (bVideo) ? pTMObj->lpDDS_Video : pTMObj->lpDDS_System; + + /*===================================================================*/ + /* Fill the texture using the PixelInfo structure to do the mapping. */ + /*===================================================================*/ + + /* Get the surface pointer. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof(DDSURFACEDESC2); + rc = lpDDS->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL ); + if ( FAILED(rc) ) + { + RIP( NULL, "Lock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) ); + return; + } + + /* For now we are only updating the system surface so use its dimensions. */ + dwWidth = (bVideo) ? pTMObj->dwVWidth : pTMObj->dwSWidth; + dwHeight = (bVideo) ? pTMObj->dwVHeight : pTMObj->dwSHeight; + + /* If we are updating the whole surface then the pDest/pSrc will */ + /* always be the same. */ + if ( pRect == NULL ) + { + pDest = (UCHAR *)ddsd2.lpSurface; + pSrc = pixels; + } + + /* Fill the texture surface based on the pixelformat flags. */ + if ( pTMObj->dwFlags == (DDPF_RGB | DDPF_ALPHAPIXELS) ) + { + srcPitch = dwWidth * 4; + if ( pRect ) + { + pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); + pSrc = pixels + (pRect->top * dwWidth * 4) + (pRect->left * 4); + dwHeight = (pRect->bottom - pRect->top); + dwWidth = (pRect->right - pRect->left); + } + + for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) + { + for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) + { + dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); + dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift ); + dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift ); + if ( pTMObj->pixel.aScale == -1.0 ) + dwColor |= ( (*(pSrc+3) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 ); + else + dwColor |= ( ((DWORD)(*(pSrc+3) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift ); + memcpy( pDest, &dwColor, pTMObj->pixel.cb ); + pDest += pTMObj->pixel.cb; + pSrc += 4; + } + } + } + else if ( pTMObj->dwFlags == DDPF_RGB ) + { + srcPitch = dwWidth * 3; + if ( pRect ) + { + pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); + pSrc = pixels + (pRect->top * dwWidth * 3) + (pRect->left * 3); + dwHeight = (pRect->bottom - pRect->top); + dwWidth = (pRect->right - pRect->left); + } + + for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) + { + for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) + { + dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); + dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift ); + dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift ); + memcpy( pDest, &dwColor, pTMObj->pixel.cb ); + pDest += pTMObj->pixel.cb; + pSrc += 3; + } + } + } + else if ( pTMObj->dwFlags == (DDPF_LUMINANCE | DDPF_ALPHAPIXELS) ) + { + srcPitch = dwWidth * 2; + if ( pRect ) + { + pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); + pSrc = pixels + (pRect->top * dwWidth * 2) + (pRect->left * 2); + dwHeight = (pRect->bottom - pRect->top); + dwWidth = (pRect->right - pRect->left); + } + + for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) + { + for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) + { + dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); + if ( pTMObj->pixel.aScale == -1.0 ) + dwColor |= ( (*(pSrc+1) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 ); + else + dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift ); + memcpy( pDest, &dwColor, pTMObj->pixel.cb ); + pDest += pTMObj->pixel.cb; + pSrc += 2; + } + } + } + else if ( pTMObj->dwFlags == DDPF_LUMINANCE ) + { + srcPitch = dwWidth; + if ( pRect ) + { + pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); + pSrc = pixels + (pRect->top * dwWidth) + (pRect->left); + dwHeight = (pRect->bottom - pRect->top); + dwWidth = (pRect->right - pRect->left); + } + + for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) + { + for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) + { + dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); + memcpy( pDest, &dwColor, pTMObj->pixel.cb ); + pDest += pTMObj->pixel.cb; + pSrc++; + } + } + } + else if ( pTMObj->dwFlags == DDPF_ALPHAPIXELS ) + { + srcPitch = dwWidth; + if ( pRect ) + { + pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); + pSrc = pixels + (pRect->top * dwWidth) + (pRect->left); + dwHeight = (pRect->bottom - pRect->top); + dwWidth = (pRect->right - pRect->left); + } + + for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) + { + for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) + { + if ( pTMObj->pixel.aScale == -1.0 ) + dwColor = ( (*pSrc & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 ); + else + dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift ); + memcpy( pDest, &dwColor, pTMObj->pixel.cb ); + pDest += pTMObj->pixel.cb; + pSrc++; + } + } + } + + /* Unlock the surface. */ + rc = lpDDS->Unlock( NULL ); + if ( FAILED(rc) ) + { + RIP( NULL, "Unlock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) ); + } +} +/*===========================================================================*/ +/* This function is the callback function that gets called when we are doing*/ +/* an enumeration of the texture formats supported by this device. The choice*/ +/* is made by checking to see if we have a match with the supplied D3D pixel-*/ +/* format. So the enumeration has to pass a desired D3D PF as the user var. */ +/*===========================================================================*/ +/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */ +/*===========================================================================*/ +HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext ) +{ + LPDDPIXELFORMAT lpDDPixFmtRequest = (LPDDPIXELFORMAT)lpContext; + PIXELINFO pixel; + + DPF(( DBG_FUNC, "EnumPFHook();" )); + + if ( lpDDPixFmt->dwFlags == lpDDPixFmtRequest->dwFlags ) + { + /* Are we looking for an alpha channel? */ + if ( lpDDPixFmtRequest->dwFlags & DDPF_ALPHAPIXELS ) + { + /* Try for something that has more then 1bits of Alpha. */ + Solve8BitChannelPixelFormat( lpDDPixFmt, &pixel ); + if ( pixel.aScale == -1.0 ) + { + /* Save this format no matter what as its a match of sorts. */ + memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) ); + return D3DENUMRET_OK; + } + } + + /* Save this format as its a good match. */ + memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) ); + + /* We are happy at this point so lets leave. */ + return D3DENUMRET_CANCEL; + } + + return D3DENUMRET_OK; +} + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.h xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DTextureMgr.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,62 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef _TEXTURE_MGR_INC +#define _TEXTURE_MGR_INC + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include +#include +#include +#include +#include +#include "GL/gl.h" +/*========================================================================*/ +/* Defines. */ +/*========================================================================*/ +/*========================================================================*/ +/* Type defines. */ +/*========================================================================*/ +typedef struct _local_texture_object +{ + DWORD dwName, + dwPriority, + dwFlags, + dwSWidth, + dwSHeight, + dwVWidth, + dwVHeight; + BOOL bLock, + bDirty; /* I only update VID on SubImage calls so the system */ + /* texture can get invalid. */ + + LPDIRECT3DDEVICE3 lpD3DDevice; /* If the device changes we must get new handles... */ + LPDIRECTDRAWSURFACE4 lpDDS_System, + lpDDS_Video; + LPDIRECT3DTEXTURE2 lpD3DTexture2; + + PIXELINFO pixel; + + struct _local_texture_object *next; + struct _local_texture_object *prev; + +} TM_OBJECT, *PTM_OBJECT; +/*========================================================================*/ +/* Function prototypes. */ +/*========================================================================*/ +void APIENTRY InitTMD3D( void *pVoid ); +void APIENTRY TermTMD3D( void *pVoid ); +/*========================================================================*/ +/* Global variables declaration. */ +/*========================================================================*/ + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DUTILS.CPP xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DUTILS.CPP --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DUTILS.CPP 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3DUTILS.CPP 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,638 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DHAL.h" +/*===========================================================================*/ +/* Local only functions. */ +/*===========================================================================*/ +static int CountTrailingZeros( DWORD dwMask ); +/*===========================================================================*/ +/* This function is used to get the pointer to the surface and the pitch for*/ +/* the scanline rendering functions. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + static DDSURFACEDESC2 ddsd2; + HRESULT rc; + + DPF(( DBG_FUNC, "LockHAL();" )); + + /* Set the request structure up first. */ + memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); + ddsd2.dwSize = sizeof(DDSURFACEDESC2); + + /* Make sure we have enough info. */ + if ( pHAL ) + { + rc = pHAL->lpDDSRender->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL ); + if ( FAILED(rc) ) + { + RIP( pHAL, "Lock (RENDER) ->", ErrorStringD3D(rc) ); + } + } + + return &ddsd2; +} +/*===========================================================================*/ +/* This is just a simple wrapper. I probably don't need to do any error */ +/* checking as the Lock must have worked inorder to get here... */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + HRESULT rc; + + DPF(( DBG_FUNC, "UnlockHAL();" )); + + /* Make sure we have enough info. */ + if ( pHAL ) + { + rc = pHAL->lpDDSRender->Unlock( NULL ); + if ( FAILED(rc) ) + { + RIP( pHAL, "Unlock (RENDER) ->", ErrorStringD3D(rc) ); + } + } +} +/*===========================================================================*/ +/* This function will track the main/Primary window that will be used as the*/ +/* target for the Blt in SwapBuffers. As a side effect the call will check */ +/* to see if the primary surface is the same size and position as the screen.*/ +/* If they are the same size we will call it fullscreen... */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +extern "C" void UpdateScreenPosHAL( PMESAD3DSHARED pShared ) +{ + PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; + POINT pt; + DWORD dwWidth, dwHeight; + + DPF(( DBG_FUNC, "UpdateScreenPosHAL();" )); + + /* Make sure we have enough info. */ + if ( pHAL != NULL ) + { + /* Update the windows screen position. */ + GetClientRect( pShared->hwnd, &pShared->rectW ); + pt.x = pt.y = 0; + ClientToScreen( pShared->hwnd, &pt ); + OffsetRect( &pShared->rectW, pt.x, pt.y); + + /* Compare the primary to the screen. */ + dwWidth = GetSystemMetrics( SM_CXSCREEN ); + dwHeight = GetSystemMetrics( SM_CYSCREEN ); + if ( (pShared->rectW.left > 0) || (pShared->rectW.top > 0) || + (pShared->rectW.right > dwWidth) || (pShared->rectW.bottom > dwHeight) ) + pShared->bWindow = TRUE; + else + pShared->bWindow = FALSE; + } +} +/*===========================================================================*/ +/* This function will fill in the pixel info structure defined in D3Dshared.*/ +/* Basicly it will take a DirectDraw pixelformat structure and make scaling */ +/* values that will convert from 8bit channels to whatever the supplied ddpf */ +/* uses. Also we will generate shift values that will be used to get move */ +/* each component of the pixel into place. */ +/* I have now added a special case for a 1bit alpha channel. If I find a 1b*/ +/* alpha then I will set the scale to -1.0 which should be unique. Later I */ +/* can check the alpha scale value too see if its -1.0 and thus handle it. I*/ +/* was finding that the case was not working tom my advantage so this is my */ +/* HACK for the day. As a TODO I should work on this... */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel ) +{ + DPF(( DBG_FUNC, "Solve8BitChannelPixelFromat();" )); + + memset( pPixel, 0, sizeof(PPIXELINFO) ); + + /* Check too see if the color space is valid in the PF. */ + if ( pddpf->dwFlags & DDPF_RGB ) + { + /* Solve the red stuff. */ + pPixel->dwRMask = pddpf->dwRBitMask; + pPixel->rShift = CountTrailingZeros( pPixel->dwRMask ); + pPixel->rScale = (float)0.00392156 * (float)(pPixel->dwRMask >> pPixel->rShift); + + /* Solve the green thingy's. */ + pPixel->dwGMask = pddpf->dwGBitMask; + pPixel->gShift = CountTrailingZeros( pPixel->dwGMask ); + pPixel->gScale = (float)0.00392156 * (float)(pPixel->dwGMask >> pPixel->gShift); + + /* Solve the blues. */ + pPixel->dwBMask = pddpf->dwBBitMask; + pPixel->bShift = CountTrailingZeros( pddpf->dwBBitMask ); + pPixel->bScale = (float)0.00392156 * (float)(pddpf->dwBBitMask >> pPixel->bShift); + } + + /* Do the alpha channel if there is one. */ + if ( pddpf->dwFlags & DDPF_ALPHAPIXELS ) + { + pPixel->dwAMask = pddpf->dwRGBAlphaBitMask; + pPixel->aShift = CountTrailingZeros( pPixel->dwAMask ); + + /* Special case a 1bit alpha. */ + if ( (pPixel->dwAMask >> pPixel->aShift) == 1 ) + pPixel->aScale = -1.0; + else + pPixel->aScale = (float)0.00392156 * (float)(pPixel->dwAMask >> pPixel->aShift); + } + + /* Get the size of the pixel in bytes. Should work as dwRGBBitCount is in a union. */ + pPixel->cb = pddpf->dwRGBBitCount / 8; +} +/*===========================================================================*/ +/* See RETURN :) */ +/*===========================================================================*/ +/* RETURN: number of contiguous zeros starting from the right. */ +/*===========================================================================*/ +static int CountTrailingZeros( DWORD dwMask ) +{ + DWORD Mask; + + if ( dwMask == 0 ) + return 32; + + /* Can't take credit for this one! */ + Mask = dwMask & -(int)dwMask; + return ((Mask & 0xFFFF0000)!=0) << 4 + | ((Mask & 0xFF00FF00)!=0) << 3 + | ((Mask & 0xF0F0F0F0)!=0) << 2 + | ((Mask & 0xCCCCCCCC)!=0) << 1 + | ((Mask & 0xAAAAAAAA)!=0); +} +/*===========================================================================*/ +/* This function will convert the DDraw error code to its macro string. The*/ +/* returned pointer is static so you need not worry about memory managemnet */ +/* but the error message gets written over from call to call... */ +/*===========================================================================*/ +/* RETURN: pointer to the single static buffer that hold the error message. */ +/*===========================================================================*/ +char *ErrorStringD3D( HRESULT hr ) +{ + static char errorString[128]; + + switch( hr ) + { + case DDERR_ALREADYINITIALIZED: + strcpy( errorString, "DDERR_ALREADYINITIALIZED" ); + break; + + case DDERR_CANNOTATTACHSURFACE: + strcpy( errorString, "DDERR_CANNOTATTACHSURFACE" ); + break; + + case DDERR_CANNOTDETACHSURFACE: + strcpy( errorString, "DDERR_CANNOTDETACHSURFACE" ); + break; + + case DDERR_CURRENTLYNOTAVAIL: + strcpy( errorString, "DDERR_CURRENTLYNOTAVAIL" ); + break; + + case DDERR_EXCEPTION: + strcpy( errorString, "DDERR_EXCEPTION" ); + break; + + case DDERR_GENERIC: + strcpy( errorString, "DDERR_GENERIC" ); + break; + + case DDERR_HEIGHTALIGN: + strcpy( errorString, "DDERR_HEIGHTALIGN" ); + break; + + case DDERR_INCOMPATIBLEPRIMARY: + strcpy( errorString, "DDERR_INCOMPATIBLEPRIMARY" ); + break; + + case DDERR_INVALIDCAPS: + strcpy( errorString, "DDERR_INVALIDCAPS" ); + break; + + case DDERR_INVALIDCLIPLIST: + strcpy( errorString, "DDERR_INVALIDCLIPLIST" ); + break; + + case DDERR_INVALIDMODE: + strcpy( errorString, "DDERR_INVALIDMODE" ); + break; + + case DDERR_INVALIDOBJECT: + strcpy( errorString, "DDERR_INVALIDOBJECT" ); + break; + + case DDERR_INVALIDPARAMS: + strcpy( errorString, "DDERR_INVALIDPARAMS" ); + break; + + case DDERR_INVALIDPIXELFORMAT: + strcpy( errorString, "DDERR_INVALIDPIXELFORMAT" ); + break; + + case DDERR_INVALIDRECT: + strcpy( errorString, "DDERR_INVALIDRECT" ); + break; + + case DDERR_LOCKEDSURFACES: + strcpy( errorString, "DDERR_LOCKEDSURFACES" ); + break; + + case DDERR_NO3D: + strcpy( errorString, "DDERR_NO3D" ); + break; + + case DDERR_NOALPHAHW: + strcpy( errorString, "DDERR_NOALPHAHW" ); + break; + + case DDERR_NOCLIPLIST: + strcpy( errorString, "DDERR_NOCLIPLIST" ); + break; + + case DDERR_NOCOLORCONVHW: + strcpy( errorString, "DDERR_NOCOLORCONVHW" ); + break; + + case DDERR_NOCOOPERATIVELEVELSET: + strcpy( errorString, "DDERR_NOCOOPERATIVELEVELSET" ); + break; + + case DDERR_NOCOLORKEY: + strcpy( errorString, "DDERR_NOCOLORKEY" ); + break; + + case DDERR_NOCOLORKEYHW: + strcpy( errorString, "DDERR_NOCOLORKEYHW" ); + break; + + case DDERR_NODIRECTDRAWSUPPORT: + strcpy( errorString, "DDERR_NODIRECTDRAWSUPPORT" ); + break; + + case DDERR_NOEXCLUSIVEMODE: + strcpy( errorString, "DDERR_NOEXCLUSIVEMODE" ); + break; + + case DDERR_NOFLIPHW: + strcpy( errorString, "DDERR_NOFLIPHW" ); + break; + + case DDERR_NOGDI: + strcpy( errorString, "DDERR_NOGDI" ); + break; + + case DDERR_NOMIRRORHW: + strcpy( errorString, "DDERR_NOMIRRORHW" ); + break; + + case DDERR_NOTFOUND: + strcpy( errorString, "DDERR_NOTFOUND" ); + break; + + case DDERR_NOOVERLAYHW: + strcpy( errorString, "DDERR_NOOVERLAYHW" ); + break; + + case DDERR_OVERLAPPINGRECTS: + strcpy( errorString, "DDERR_OVERLAPPINGRECTS" ); + break; + + case DDERR_NORASTEROPHW: + strcpy( errorString, "DDERR_NORASTEROPHW" ); + break; + + case DDERR_NOROTATIONHW: + strcpy( errorString, "DDERR_NOROTATIONHW" ); + break; + + case DDERR_NOSTRETCHHW: + strcpy( errorString, "DDERR_NOSTRETCHHW" ); + break; + + case DDERR_NOT4BITCOLOR: + strcpy( errorString, "DDERR_NOT4BITCOLOR" ); + break; + + case DDERR_NOT4BITCOLORINDEX: + strcpy( errorString, "DDERR_NOT4BITCOLORINDEX" ); + break; + + case DDERR_NOT8BITCOLOR: + strcpy( errorString, "DDERR_NOT8BITCOLOR" ); + break; + + case DDERR_NOTEXTUREHW: + strcpy( errorString, "DDERR_NOTEXTUREHW" ); + break; + + case DDERR_NOVSYNCHW: + strcpy( errorString, "DDERR_NOVSYNCHW" ); + break; + + case DDERR_NOZBUFFERHW: + strcpy( errorString, "DDERR_NOZBUFFERHW" ); + break; + + case DDERR_NOZOVERLAYHW: + strcpy( errorString, "DDERR_NOZOVERLAYHW" ); + break; + + case DDERR_OUTOFCAPS: + strcpy( errorString, "DDERR_OUTOFCAPS" ); + break; + + case DDERR_OUTOFMEMORY: + strcpy( errorString, "DDERR_OUTOFMEMORY" ); + break; + + case DDERR_OUTOFVIDEOMEMORY: + strcpy( errorString, "DDERR_OUTOFVIDEOMEMORY" ); + break; + + case DDERR_OVERLAYCANTCLIP: + strcpy( errorString, "DDERR_OVERLAYCANTCLIP" ); + break; + + case DDERR_OVERLAYCOLORKEYONLYONEACTIVE: + strcpy( errorString, "DDERR_OVERLAYCOLORKEYONLYONEACTIVE" ); + break; + + case DDERR_PALETTEBUSY: + strcpy( errorString, "DDERR_PALETTEBUSY" ); + break; + + case DDERR_COLORKEYNOTSET: + strcpy( errorString, "DDERR_COLORKEYNOTSET" ); + break; + + case DDERR_SURFACEALREADYATTACHED: + strcpy( errorString, "DDERR_SURFACEALREADYATTACHED" ); + break; + + case DDERR_SURFACEALREADYDEPENDENT: + strcpy( errorString, "DDERR_SURFACEALREADYDEPENDENT" ); + break; + + case DDERR_SURFACEBUSY: + strcpy( errorString, "DDERR_SURFACEBUSY" ); + break; + + case DDERR_CANTLOCKSURFACE: + strcpy( errorString, "DDERR_CANTLOCKSURFACE" ); + break; + + case DDERR_SURFACEISOBSCURED: + strcpy( errorString, "DDERR_SURFACEISOBSCURED" ); + break; + + case DDERR_SURFACELOST: + strcpy( errorString, "DDERR_SURFACELOST" ); + break; + + case DDERR_SURFACENOTATTACHED: + strcpy( errorString, "DDERR_SURFACENOTATTACHED" ); + break; + + case DDERR_TOOBIGHEIGHT: + strcpy( errorString, "DDERR_TOOBIGHEIGHT" ); + break; + + case DDERR_TOOBIGSIZE: + strcpy( errorString, "DDERR_TOOBIGSIZE" ); + break; + + case DDERR_TOOBIGWIDTH: + strcpy( errorString, "DDERR_TOOBIGWIDTH" ); + break; + + case DDERR_UNSUPPORTED: + strcpy( errorString, "DDERR_UNSUPPORTED" ); + break; + + case DDERR_UNSUPPORTEDFORMAT: + strcpy( errorString, "DDERR_UNSUPPORTEDFORMAT" ); + break; + + case DDERR_UNSUPPORTEDMASK: + strcpy( errorString, "DDERR_UNSUPPORTEDMASK" ); + break; + + case DDERR_INVALIDSTREAM: + strcpy( errorString, "DDERR_INVALIDSTREAM" ); + break; + + case DDERR_VERTICALBLANKINPROGRESS: + strcpy( errorString, "DDERR_VERTICALBLANKINPROGRESS" ); + break; + + case DDERR_WASSTILLDRAWING: + strcpy( errorString, "DDERR_WASSTILLDRAWING" ); + break; + + case DDERR_XALIGN: + strcpy( errorString, "DDERR_XALIGN" ); + break; + + case DDERR_INVALIDDIRECTDRAWGUID: + strcpy( errorString, "DDERR_INVALIDDIRECTDRAWGUID" ); + break; + + case DDERR_DIRECTDRAWALREADYCREATED: + strcpy( errorString, "DDERR_DIRECTDRAWALREADYCREATED" ); + break; + + case DDERR_NODIRECTDRAWHW: + strcpy( errorString, "DDERR_NODIRECTDRAWHW" ); + break; + + case DDERR_PRIMARYSURFACEALREADYEXISTS: + strcpy( errorString, "DDERR_PRIMARYSURFACEALREADYEXISTS" ); + break; + + case DDERR_NOEMULATION: + strcpy( errorString, "DDERR_NOEMULATION" ); + break; + + case DDERR_REGIONTOOSMALL: + strcpy( errorString, "DDERR_REGIONTOOSMALL" ); + break; + + case DDERR_CLIPPERISUSINGHWND: + strcpy( errorString, "DDERR_CLIPPERISUSINGHWND" ); + break; + + case DDERR_NOCLIPPERATTACHED: + strcpy( errorString, "DDERR_NOCLIPPERATTACHED" ); + break; + + case DDERR_NOHWND: + strcpy( errorString, "DDERR_NOHWND" ); + break; + + case DDERR_HWNDSUBCLASSED: + strcpy( errorString, "DDERR_HWNDSUBCLASSED" ); + break; + + case DDERR_HWNDALREADYSET: + strcpy( errorString, "DDERR_HWNDALREADYSET" ); + break; + + case DDERR_NOPALETTEATTACHED: + strcpy( errorString, "DDERR_NOPALETTEATTACHED" ); + break; + + case DDERR_NOPALETTEHW: + strcpy( errorString, "DDERR_NOPALETTEHW" ); + break; + + case DDERR_BLTFASTCANTCLIP: + strcpy( errorString, "DDERR_BLTFASTCANTCLIP" ); + break; + + case DDERR_NOBLTHW: + strcpy( errorString, "DDERR_NOBLTHW" ); + break; + + case DDERR_NODDROPSHW: + strcpy( errorString, "DDERR_NODDROPSHW" ); + break; + + case DDERR_OVERLAYNOTVISIBLE: + strcpy( errorString, "DDERR_OVERLAYNOTVISIBLE" ); + break; + + case DDERR_NOOVERLAYDEST: + strcpy( errorString, "DDERR_NOOVERLAYDEST" ); + break; + + case DDERR_INVALIDPOSITION: + strcpy( errorString, "DDERR_INVALIDPOSITION" ); + break; + + case DDERR_NOTAOVERLAYSURFACE: + strcpy( errorString, "DDERR_NOTAOVERLAYSURFACE" ); + break; + + case DDERR_EXCLUSIVEMODEALREADYSET: + strcpy( errorString, "DDERR_EXCLUSIVEMODEALREADYSET" ); + break; + + case DDERR_NOTFLIPPABLE: + strcpy( errorString, "DDERR_NOTFLIPPABLE" ); + break; + + case DDERR_CANTDUPLICATE: + strcpy( errorString, "DDERR_CANTDUPLICATE" ); + break; + + case DDERR_NOTLOCKED: + strcpy( errorString, "DDERR_NOTLOCKED" ); + break; + + case DDERR_CANTCREATEDC: + strcpy( errorString, "DDERR_CANTCREATEDC" ); + break; + + case DDERR_NODC: + strcpy( errorString, "DDERR_NODC" ); + break; + + case DDERR_WRONGMODE: + strcpy( errorString, "DDERR_WRONGMODE" ); + break; + + case DDERR_IMPLICITLYCREATED: + strcpy( errorString, "DDERR_IMPLICITLYCREATED" ); + break; + + case DDERR_NOTPALETTIZED: + strcpy( errorString, "DDERR_NOTPALETTIZED" ); + break; + + case DDERR_UNSUPPORTEDMODE: + strcpy( errorString, "DDERR_UNSUPPORTEDMODE" ); + break; + + case DDERR_NOMIPMAPHW: + strcpy( errorString, "DDERR_NOMIPMAPHW" ); + break; + + case DDERR_INVALIDSURFACETYPE: + strcpy( errorString, "DDERR_INVALIDSURFACETYPE" ); + break; + + case DDERR_NOOPTIMIZEHW: + strcpy( errorString, "DDERR_NOOPTIMIZEHW" ); + break; + + case DDERR_NOTLOADED: + strcpy( errorString, "DDERR_NOTLOADED" ); + break; + + case DDERR_NOFOCUSWINDOW: + strcpy( errorString, "DDERR_NOFOCUSWINDOW" ); + break; + + case DDERR_DCALREADYCREATED: + strcpy( errorString, "DDERR_DCALREADYCREATED" ); + break; + + case DDERR_NONONLOCALVIDMEM: + strcpy( errorString, "DDERR_NONONLOCALVIDMEM" ); + break; + + case DDERR_CANTPAGELOCK: + strcpy( errorString, "DDERR_CANTPAGELOCK" ); + break; + + case DDERR_CANTPAGEUNLOCK: + strcpy( errorString, "DDERR_CANTPAGEUNLOCK" ); + break; + + case DDERR_NOTPAGELOCKED: + strcpy( errorString, "DDERR_NOTPAGELOCKED" ); + break; + + case DDERR_MOREDATA: + strcpy( errorString, "DDERR_MOREDATA" ); + break; + + case DDERR_EXPIRED: + strcpy( errorString, "DDERR_EXPIRED" ); + break; + + case DDERR_VIDEONOTACTIVE: + strcpy( errorString, "DDERR_VIDEONOTACTIVE" ); + break; + + case DDERR_DEVICEDOESNTOWNSURFACE: + strcpy( errorString, "DDERR_DEVICEDOESNTOWNSURFACE" ); + break; + + case DDERR_NOTINITIALIZED: + strcpy( errorString, "DDERR_NOTINITIALIZED" ); + break; + + default: + strcpy( errorString, "" ); + break; + } + + return &errorString[0]; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3Dvbrender.c xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3Dvbrender.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3Dvbrender.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/D3Dvbrender.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,2149 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include +#include "clip.h" +#include "context.h" +#include "light.h" +#include "lines.h" +#include "macros.h" +#include "matrix.h" +#include "pb.h" +#include "points.h" +#include "mtypes.h" +#include "vb.h" +#include "vbrender.h" +#include "xform.h" +#include "D3DMesa.h" + +static void SetRenderStates( GLcontext *ctx ); +static void DebugRenderStates( GLcontext *ctx, BOOL bForce ); + +static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv ); +void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ); +void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); + +/* I went with a D3D vertex buffer that is 6 times that of the Mesa one */ +/* instead of having the D3D one flush when its full. This way Mesa will*/ +/* handle all the flushing. I need x6 as points can use 4 vertex each. */ +D3DTLVERTEX D3DTLVertices[ (VB_MAX*6) ]; +GLuint VList[VB_SIZE]; +/*===========================================================================*/ +/* Compute Z offsets for a polygon with plane defined by (A,B,C,D) */ +/* D is not needed. TODO: Currently we are calculating this but not using it.*/ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void OffsetPolygon( GLcontext *ctx, GLfloat a, GLfloat b, GLfloat c ) +{ + GLfloat ac, + bc, + m, + offset; + + DPF(( DBG_FUNC, "OffsetPolygon();" )); + + if ( (c < 0.001F) && (c > - 0.001F) ) + { + /* Prevents underflow problems. */ + ctx->PointZoffset = 0.0F; + ctx->LineZoffset = 0.0F; + ctx->PolygonZoffset = 0.0F; + } + else + { + ac = a / c; + bc = b / c; + if ( ac < 0.0F ) + ac = -ac; + if ( bc<0.0F ) + bc = -bc; + m = MAX2( ac, bc ); /* m = sqrt( ac*ac + bc*bc ); */ + + offset = (m * ctx->Polygon.OffsetFactor + ctx->Polygon.OffsetUnits); + ctx->PointZoffset = ctx->Polygon.OffsetPoint ? offset : 0.0F; + ctx->LineZoffset = ctx->Polygon.OffsetLine ? offset : 0.0F; + ctx->PolygonZoffset = ctx->Polygon.OffsetFill ? offset : 0.0F; + } + + DPF(( DBG_PRIM_INFO, "OffsetPolygon: %f", offset )); +} +/*===========================================================================*/ +/* Compute signed area of the n-sided polgyon specified by vertices */ +/* vb->Win[] and vertex list vlist[]. */ +/* A clockwise polygon will return a negative area. A counter-clockwise */ +/* polygon will return a positive area. I have changed this function to */ +/* actually calculate twice the area as its faster and still gives the sign. */ +/*===========================================================================*/ +/* RETURN: signed area of the polgon. */ +/*===========================================================================*/ +static GLfloat PolygonArea( const struct vertex_buffer *vb, GLuint n, const GLuint vlist[] ) +{ + GLfloat area; + GLuint i; + + DPF(( DBG_FUNC, "PolygonArea();" )); + +#define j0 vlist[i] +#define j1 vlist[(i+1)%n] +#define x0 vb->Win[j0][0] +#define y0 vb->Win[j0][1] +#define x1 vb->Win[j1][0] +#define y1 vb->Win[j1][1] + + /* area = sum of trapezoids */ + for( i = 0, area = 0.0; i < n; i++ ) + area += ((x0 - x1) * (y0 + y1)); /* Note: no divide by two here! */ + +#undef x0 +#undef y0 +#undef x1 +#undef y1 +#undef j1 +#undef j0 + + // TODO: I don't see the point or * 0.5 as we just want the sign... + return area; +} +/*===========================================================================*/ +/* Render a polygon that needs clipping on at least one vertex. The function*/ +/* will first clip the polygon to any user clipping planes then clip to the */ +/* viewing volume. The final polygon will be draw as single triangles that */ +/* first need minor proccessing (culling, offset, etc) before we draw the */ +/* polygon as a fan. NOTE: the fan is draw as single triangles as its not */ +/* formed sequentaly in the VB but is in the vlist[]. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderClippedPolygon( GLcontext *ctx, GLuint n, GLuint vlist[] ) +{ + struct vertex_buffer *VB = ctx->VB; + GLfloat (*win)[3] = VB->Win, + *proj = ctx->ProjectionMatrix, + ex, ey, + fx, fy, c, + wInv; + GLuint index, + pv, + facing; + + DPF(( DBG_FUNC, "RenderClippedPolygon();" )); + + DPF(( DBG_PRIM_INFO, "RenderClippedtPolygon( %d )", n )); + + /* Which vertex dictates the color when flat shading. */ + pv = (ctx->Primitive==GL_POLYGON) ? vlist[0] : vlist[n-1]; + + /* Clipping may introduce new vertices. New vertices will be stored in */ + /* the vertex buffer arrays starting with location VB->Free. After we've*/ + /* rendered the polygon, these extra vertices can be overwritten. */ + VB->Free = VB_MAX; + + /* Clip against user clipping planes in eye coord space. */ + if ( ctx->Transform.AnyClip ) + { + n = gl_userclip_polygon( ctx, n, vlist ); + if ( n < 3 ) + return; + + /* Transform vertices from eye to clip coordinates: clip = Proj * eye */ + for( index = 0; index < n; index++ ) + { + TRANSFORM_POINT( VB->Clip[vlist[index]], proj, VB->Eye[vlist[index]] ); + } + } + + /* Clip against view volume in clip coord space */ + n = gl_viewclip_polygon( ctx, n, vlist ); + if ( n < 3 ) + return; + + /* Transform new vertices from clip to ndc to window coords. */ + /* ndc = clip / W window = viewport_mapping(ndc) */ + /* Note that window Z values are scaled to the range of integer */ + /* depth buffer values. */ + + /* Only need to compute window coords for new vertices */ + for( index = VB_MAX; index < VB->Free; index++ ) + { + if ( VB->Clip[index][3] != 0.0F ) + { + wInv = 1.0F / VB->Clip[index][3]; + + win[index][0] = VB->Clip[index][0] * wInv * ctx->Viewport.Sx + ctx->Viewport.Tx; + win[index][1] = VB->Clip[index][1] * wInv * ctx->Viewport.Sy + ctx->Viewport.Ty; + win[index][2] = VB->Clip[index][2] * wInv * ctx->Viewport.Sz + ctx->Viewport.Tz; + } + else + { + /* Can't divide by zero, so... */ + win[index][0] = win[index][1] = win[index][2] = 0.0F; + } + } + + /* Draw filled polygon as a triangle fan */ + for( index = 2; index < n; index++ ) + { + /* Compute orientation of triangle */ + ex = win[vlist[index-1]][0] - win[vlist[0]][0]; + ey = win[vlist[index-1]][1] - win[vlist[0]][1]; + fx = win[vlist[index]][0] - win[vlist[0]][0]; + fy = win[vlist[index]][1] - win[vlist[0]][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* finish computing plane equation of polygon, compute offset */ + GLfloat fz = win[vlist[index]][2] - win[vlist[0]][2]; + GLfloat ez = win[vlist[index-1]][2] - win[vlist[0]][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + RenderOneTriangle( ctx, vlist[0], vlist[index-1], vlist[index], pv ); + } +} +/*===========================================================================*/ +/* This function gets called when either the vertex buffer is full or glEnd */ +/* has been called. If the we aren't in rendering mode (FEEDBACK) then I */ +/* pass the vertex buffer back to Mesa to deal with by returning FALSE. */ +/* If I can render the primitive types in the buffer directly then I will */ +/* return TRUE after I render the vertex buffer and reset the vertex buffer. */ +/* */ +/* TODO: I don't handle the special case of when the vertex buffer is full */ +/* and we have a primitive that bounds this buffer and the next one to */ +/* come. I'm not sure right now if Mesa handles this for me... */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone ) +{ + struct vertex_buffer *VB = ctx->VB; + GLuint index, + vlist[VB_SIZE]; + + DPF(( DBG_FUNC, "RenderVertexBuffer();" )); + + /* We only need to hook actual tri's that need rendering. */ + if ( ctx->RenderMode != GL_RENDER ) + { + // (ctx->Visual->AccumBits > 0) ) + // (ctx->Visual->StencilBits > 0) ) + DPF(( DBG_PRIM_INFO, "Passing VB back to Mesa" )); + return FALSE; + } + + /* I'm going to set the states here so that all functions will */ + /* be assured to have the right states. If Mesa's vertex bufefr */ + /* function calls one of my primitive functions (TRI,POINT,LINE) */ + /* it will need the right states. So instead of doing it in the */ + /* primitive function I will always do it here at risk of some */ + /* slow down to some cases... */ + SetRenderStates( ctx ); + + switch( ctx->Primitive ) + { + case GL_POINTS: + DPF(( DBG_PRIM_INFO, "GL_POINTS( %d )", VB->Count )); + RenderPointsVB( ctx, 0, VB->Count ); + break; + + case GL_LINES: + case GL_LINE_STRIP: + case GL_LINE_LOOP: + /* Not supported functions yet so pass back that we failed to */ + /* render the vertex buffer and Mesa will have to do it. */ + DPF(( DBG_PRIM_INFO, "GL_LINE_?( %d )", VB->Count )); + return FALSE; + + case GL_TRIANGLES: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_TRIANGLES( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_TRIANGLES( %d )", VB->Count )); + RenderTriangleVB( ctx, 0, VB->Count ); + break; + + case GL_TRIANGLE_STRIP: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_STRIP( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_STRIP( %d )", VB->Count )); + RenderTriangleStripVB( ctx, 0, VB->Count ); + break; + + case GL_TRIANGLE_FAN: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_FAN( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_FAN( %d )", VB->Count )); + RenderTriangleFanVB( ctx, 0, VB->Count ); + break; + + case GL_QUADS: + if ( VB->Count < 4 ) + { + DPF(( DBG_PRIM_WARN, "GL_QUADS( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_QUADS( %d )", VB->Count )); + RenderQuadVB( ctx, 0, VB->Count ); + break; + + case GL_QUAD_STRIP: + if ( VB->Count < 4 ) + { + DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_QUAD_STRIP( %d )", VB->Count )); + + if ( VB->ClipOrMask ) + { + for( index = 3; index < VB->Count; index += 2 ) + { + if ( VB->ClipMask[index-3] & VB->ClipMask[index-2] & VB->ClipMask[index-1] & VB->ClipMask[index] & CLIP_ALL_BITS ) + { + /* All points clipped by common plane */ + DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count )); + continue; + } + else if ( VB->ClipMask[index-3] | VB->ClipMask[index-2] | VB->ClipMask[index-1] | VB->ClipMask[index] ) + { + vlist[0] = index - 3; + vlist[1] = index - 2; + vlist[2] = index; + vlist[3] = index - 1; + RenderClippedPolygon( ctx, 4, vlist ); + } + else + { + RenderQuad( ctx, (index-3), (index-2), index, (index-1), index ); + } + } + } + else + { + /* No clipping needed */ + for( index = 3; index < VB->Count; index += 2 ) + RenderQuad( ctx, (index-3), (index-2), index, (index-1), index ); + } + break; + + case GL_POLYGON: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_POLYGON( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_POLYGON( %d )", VB->Count )); + + /* All points clipped by common plane, draw nothing */ + if ( !(VB->ClipAndMask & CLIP_ALL_BITS) ) + RenderTriangleFanVB( ctx, 0, VB->Count ); + break; + + default: + /* should never get here */ + _mesa_problem( ctx, "invalid mode in gl_render_vb" ); + } + + DPF(( DBG_PRIM_INFO, "ResetVB" )); + + /* We return TRUE to indicate we rendered the VB. */ + gl_reset_vb( ctx, allDone ); + return TRUE; +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as triangles. The */ +/* buffer has to be able to be rendered directly. This means that we are */ +/* filled, no offsets, no culling and one sided rendering. Also we must be */ +/* in render mode of course. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + GLfloat ex, ey, + fx, fy, c; + GLuint facing; + + DPF(( DBG_FUNC, "RenderTriangleVB" )); + + if ( !VB->ClipOrMask ) + { + DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) )); + for( index = start, cVertex = 0; index < end; ) + { + dwPVColor = (VB->Color[(index+2)][3]<<24) | (VB->Color[(index+2)][0]<<16) | (VB->Color[(index+2)][1]<<8) | VB->Color[(index+2)][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + index++; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + index++; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + index++; + } + } + else + { +#define v1 index +#define v2 (index+1) +#define v3 (index+2) + + for( index = start, cVertex = 0; index < end; index += 3 ) + { + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) + { + continue; + } + else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + RenderClippedPolygon( ctx, 3, VList ); + continue; + } + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */ + dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + } +#undef v1 +#undef v2 +#undef v3 + } + + /* Render the converted vertex buffer. */ + if ( cVertex > 2 ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as a triangle fan. */ +/* The buffer has to be able to be rendered directly. This means that we are*/ +/* filled, no offsets, no culling and one sided rendering. Also we must be */ +/* in render mode of course. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + GLfloat ex, ey, + fx, fy, c; + GLuint facing; + DWORD dwPVColor; + + DPF(( DBG_FUNC, "RenderTriangleFanVB();" )); + + /* Special case that we can blast the fan without culling, offset, etc... */ + if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) ) + { + DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) )); + + /* Seed the the fan. */ + D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] ); + D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) ); + D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] ); + D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] ); + D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] ); + D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) ); + D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2]; + + /* Seed the the fan. */ + D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] ); + D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) ); + D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] ); + D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] ); + D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] ); + D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) ); + D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2]; + + for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ ) + { + /*=================================*/ + /* Add the next vertex to the fan. */ + /*=================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLEFAN, &D3DTLVertices[0], cVertex ); + } + else + { +#define v1 start +#define v2 (index-1) +#define v3 index + + for( index = (start+2), cVertex = 0; index < end; index++ ) + { + if ( VB->ClipOrMask ) + { + /* All points clipped by common plane */ + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) + { + continue; + } + else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + RenderClippedPolygon( ctx, 3, VList ); + continue; + } + } + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +#undef v1 +#undef v2 +#undef v3 + } +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as a triangle strip. */ +/* The buffer has to be able to be rendered directly. This means that we are*/ +/* filled, no offsets, no culling and one sided rendering. Also we must be */ +/* in render mode of course. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex = 0, + v1, v2, v3, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + GLfloat ex, ey, + fx, fy, c; + GLuint facing; + DWORD dwPVColor; + + DPF(( DBG_FUNC, "RenderTriangleStripVB();" )); + + /* Special case that we can blast the fan without culling, offset, etc... */ + if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) ) + { + DPF(( DBG_PRIM_PROFILE, "DirectTriangles" )); + + /* Seed the the strip. */ + D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] ); + D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) ); + D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] ); + D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] ); + D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] ); + D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) ); + D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2]; + + /* Seed the the strip. */ + D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] ); + D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) ); + D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] ); + D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] ); + D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] ); + D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) ); + D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2]; + + for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ ) + { + /*===================================*/ + /* Add the next vertex to the strip. */ + /*===================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLESTRIP, &D3DTLVertices[0], cVertex ); + } + else + { + for( index = (start+2); index < end; index++ ) + { + /* We need to switch order so that winding won't be a problem. */ + if ( index & 1 ) + { + v1 = index - 1; + v2 = index - 2; + v3 = index - 0; + } + else + { + v1 = index - 2; + v2 = index - 1; + v3 = index - 0; + } + + /* All vertices clipped by common plane */ + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) + continue; + + /* Check if any vertices need clipping. */ + if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + RenderClippedPolygon( ctx, 3, VList ); + } + else + { + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* Polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + /* Need right color if we have two sided lighting. */ + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + + /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */ + dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + } + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); + } +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as Quads. The buffer*/ +/* has to be able to be rendered directly. This means that we are filled, no*/ +/* offsets, no culling and one sided rendering. Also we must be in render */ +/* mode of cource. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + GLfloat ex, ey, + fx, fy, c; + GLuint facing; /* 0=front, 1=back */ + + DPF(( DBG_FUNC, "RenderQuadVB();" )); + +#define v1 (index) +#define v2 (index+1) +#define v3 (index+2) +#define v4 (index+3) + + if ( !VB->ClipOrMask ) + { + DPF(( DBG_PRIM_PROFILE, "DirectTriangles" )); + + for( cVertex = 0, index = start; index < end; index += 4 ) + { + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v2][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v4][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + } + } + else + { + for( cVertex = 0, index = start; index < end; index += 4 ) + { + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & VB->ClipMask[v4] & CLIP_ALL_BITS ) + { + continue; + } + else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] | VB->ClipMask[v4] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + VList[3] = v4; + RenderClippedPolygon( ctx, 4, VList ); + continue; + } + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + } + } + +#undef v4 +#undef v3 +#undef v2 +#undef v1 + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +} +/*===========================================================================*/ +/* */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + GLfloat ex, ey, + fx, fy, c; + GLuint facing; /* 0=front, 1=back */ + static D3DTLVERTEX TLVertices[6]; + + DPF(( DBG_FUNC, "RenderQuad" )); + DPF(( DBG_PRIM_INFO, "RenderQuad( 1 )" )); + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + return; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + return; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); + TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); + TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); + TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); + TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + TLVertices[2].sx = D3DVAL( VB->Win[v3][0] ); + TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) ); + TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] ); + TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] ); + TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + TLVertices[3].sx = D3DVAL( VB->Win[v3][0] ); + TLVertices[3].sy = D3DVAL( (height - VB->Win[v3][1]) ); + TLVertices[3].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + TLVertices[3].tu = D3DVAL( VB->TexCoord[v3][0] ); + TLVertices[3].tv = D3DVAL( VB->TexCoord[v3][1] ); + TLVertices[3].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + TLVertices[3].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + TLVertices[4].sx = D3DVAL( VB->Win[v4][0] ); + TLVertices[4].sy = D3DVAL( (height - VB->Win[v4][1]) ); + TLVertices[4].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) ); + TLVertices[4].tu = D3DVAL( VB->TexCoord[v4][0] ); + TLVertices[4].tv = D3DVAL( VB->TexCoord[v4][1] ); + TLVertices[4].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); + TLVertices[4].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + + TLVertices[5].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[5].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[5].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + TLVertices[5].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[5].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[5].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[5].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + /* Draw the two triangles. */ + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 6 ); +} +/*===========================================================================*/ +/* */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + static D3DTLVERTEX TLVertices[3]; + + DPF(( DBG_FUNC, "RenderOneTriangle" )); + DPF(( DBG_PRIM_INFO, "RenderTriangle( 1 )" )); + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; + + TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + DPF(( DBG_PRIM_INFO, "V1 -> x:%f y:%f z:%f c:%x", + TLVertices[0].sx, + TLVertices[0].sy, + TLVertices[0].sz, + TLVertices[0].color )); + + TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); + TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); + TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); + TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); + TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + DPF(( DBG_PRIM_INFO, "V2 -> x:%f y:%f z:%f c:%x", + TLVertices[1].sx, + TLVertices[1].sy, + TLVertices[1].sz, + TLVertices[1].color )); + + TLVertices[2].sx = D3DVAL( VB->Win[v3][0] ); + TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) ); + TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] ); + TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] ); + TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + DPF(( DBG_PRIM_INFO, "V3 -> x:%f y:%f z:%f c:%x", + TLVertices[2].sx, + TLVertices[2].sy, + TLVertices[2].sz, + TLVertices[2].color )); + + /* Draw the triangle. */ + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 3 ); +} +/*===========================================================================*/ +/* */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + static D3DTLVERTEX TLVertices[2]; + + DPF(( DBG_FUNC, "RenderOneLine" )); + DPF(( DBG_PRIM_INFO, "RenderLine( 1 )" )); + + if ( VB->MonoColor ) + dwPVColor = (pContext->aCurrent<<24) | (pContext->rCurrent<<16) | (pContext->gCurrent<<8) | pContext->bCurrent; + else + dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; + + TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->LineZoffset) ); + TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); + TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); + TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->LineZoffset) ); + TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); + TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); + TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + /* Draw line from (x0,y0) to (x1,y1) with current pixel color/index */ + DrawPrimitiveHAL( pContext->pShared, D3DPT_LINELIST, &TLVertices[0], 2 ); +} +/*===========================================================================*/ +/* This function was written to convert points into triangles. I did this */ +/* as all card accelerate triangles and most drivers do this anyway. In hind*/ +/* thought this might be a bad idea as some cards do better. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + struct pixel_buffer *PB = ctx->PB; + GLuint index; + GLfloat radius, z, + xmin, ymin, + xmax, ymax; + GLint cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + + DPF(( DBG_FUNC, "RenderPointsVB();" )); + + radius = CLAMP( ctx->Point.Size, MIN_POINT_SIZE, MAX_POINT_SIZE ) * 0.5F; + + for( index = start, cVertex = 0; index <= end; index++ ) + { + if ( VB->ClipMask[index] == 0 ) + { + xmin = D3DVAL( VB->Win[index][0] - radius ); + xmax = D3DVAL( VB->Win[index][0] + radius ); + ymin = D3DVAL( height - VB->Win[index][1] - radius ); + ymax = D3DVAL( height - VB->Win[index][1] + radius ); + z = D3DVAL( (VB->Win[index][2] + ctx->PointZoffset) ); + + dwPVColor = (VB->Color[index][3]<<24) | + (VB->Color[index][0]<<16) | + (VB->Color[index][1]<<8) | + VB->Color[index][2]; + + D3DTLVertices[cVertex].sx = xmin; + D3DTLVertices[cVertex].sy = ymax; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmin; + D3DTLVertices[cVertex].sy = ymin; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmax; + D3DTLVertices[cVertex].sy = ymin; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmax; + D3DTLVertices[cVertex].sy = ymin; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmax; + D3DTLVertices[cVertex].sy = ymax; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmin; + D3DTLVertices[cVertex].sy = ymax; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + } + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +} +/*===========================================================================*/ +/* This gets call before we render any primitives so that the current OGL */ +/* states will be mapped the D3D context. I'm still not sure how D3D works */ +/* but I'm finding that it doesn't act like a state machine as OGL is. It */ +/* looks like the state gets set back to the defaults after a DrawPrimitives */ +/* or an EndScene. Also I set states that are the default even though this */ +/* is redundant as the defaults seem screwed up. */ +/* TODO: make a batch call. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void SetRenderStates( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DWORD dwFunc; + static BOOL bTexture = FALSE; + static int texName = -1; + + DPF(( DBG_FUNC, "SetRenderStates();" )); + + if ( g_DBGMask & DBG_STATES ) + DebugRenderStates( ctx, FALSE ); + + SetStateHAL( pContext->pShared, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_DITHERENABLE, (ctx->Color.DitherFlag) ? TRUE : FALSE ); + + /*================================================*/ + /* Check too see if there are new TEXTURE states. */ + /*================================================*/ + if ( ctx->Texture._EnabledUnits ) + { + switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) + { + case GL_MODULATE: + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA ) + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulatealpha]; + else + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulate]; + break; + + case GL_BLEND: + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha]; + break; + + case GL_REPLACE: + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal]; + break; + + case GL_DECAL: + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA ) + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha]; + else + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal]; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAPBLEND, dwFunc ); + + switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter ) + { + case GL_NEAREST: + dwFunc = D3DFILTER_NEAREST; + break; + case GL_LINEAR: + dwFunc = D3DFILTER_LINEAR; + break; + case GL_NEAREST_MIPMAP_NEAREST: + dwFunc = D3DFILTER_MIPNEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + dwFunc = D3DFILTER_LINEARMIPNEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + dwFunc = D3DFILTER_MIPLINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + dwFunc = D3DFILTER_LINEARMIPLINEAR; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAG, dwFunc ); + + switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter ) + { + case GL_NEAREST: + dwFunc = D3DFILTER_NEAREST; + break; + case GL_LINEAR: + dwFunc = D3DFILTER_LINEAR; + break; + case GL_NEAREST_MIPMAP_NEAREST: + dwFunc = D3DFILTER_MIPNEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + dwFunc = D3DFILTER_LINEARMIPNEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + dwFunc = D3DFILTER_MIPLINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + dwFunc = D3DFILTER_LINEARMIPLINEAR; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMIN, dwFunc ); + + /* Another hack to cut down on redundant texture binding. */ + // if ( texName != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name ) + // { + texName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name; + CreateTMgrHAL( pContext->pShared, + texName, + 0, + ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format, + (RECT *)NULL, + ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Width, + ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Height, + TM_ACTION_BIND, + (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Data ); + // } + bTexture = TRUE; + } + else + { + /* This is nasty but should cut down on the number of redundant calls. */ + if ( bTexture == TRUE ) + { + DisableTMgrHAL( pContext->pShared ); + bTexture = FALSE; + } + } + + /*===============================================*/ + /* Check too see if there are new RASTER states. */ + /*===============================================*/ + + // TODO: no concept of front & back. + switch( ctx->Polygon.FrontMode ) + { + case GL_POINT: + SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_POINT ); + break; + case GL_LINE: + SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME ); + break; + case GL_FILL: + SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); + break; + } + + /*************/ + /* Z-Buffer. */ + /*************/ + if ( ctx->Depth.Test == GL_TRUE ) + { + switch( ctx->Depth.Func ) + { + case GL_NEVER: + dwFunc = D3DCMP_NEVER; + break; + case GL_LESS: + dwFunc = D3DCMP_LESS; + break; + case GL_GEQUAL: + dwFunc = D3DCMP_GREATEREQUAL; + break; + case GL_LEQUAL: + dwFunc = D3DCMP_LESSEQUAL; + break; + case GL_GREATER: + dwFunc = D3DCMP_GREATER; + break; + case GL_NOTEQUAL: + dwFunc = D3DCMP_NOTEQUAL; + break; + case GL_EQUAL: + dwFunc = D3DCMP_EQUAL; + break; + case GL_ALWAYS: + dwFunc = D3DCMP_ALWAYS; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZFUNC, dwFunc ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, TRUE ); + } + else + { + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, FALSE ); + } + + /*******************/ + /* Z-Write Enable. */ + /*******************/ + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZWRITEENABLE , (ctx->Depth.Mask == GL_TRUE) ? TRUE : FALSE ); + + /***************/ + /* Alpha test. */ + /***************/ + if ( ctx->Color.AlphaEnabled == GL_TRUE ) + { + switch( ctx->Color.AlphaFunc ) + { + case GL_NEVER: + dwFunc = D3DCMP_NEVER; + break; + case GL_LESS: + dwFunc = D3DCMP_LESS; + break; + case GL_GEQUAL: + dwFunc = D3DCMP_GREATEREQUAL; + break; + case GL_LEQUAL: + dwFunc = D3DCMP_LESSEQUAL; + break; + case GL_GREATER: + dwFunc = D3DCMP_GREATER; + break; + case GL_NOTEQUAL: + dwFunc = D3DCMP_NOTEQUAL; + break; + case GL_EQUAL: + dwFunc = D3DCMP_EQUAL; + break; + case GL_ALWAYS: + dwFunc = D3DCMP_ALWAYS; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHAFUNC , dwFunc ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, TRUE ); + } + else + { + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); + } + + /****************/ + /* Alpha blend. */ + /****************/ + if ( ctx->Color.BlendEnabled == GL_TRUE ) + { + switch( ctx->Color.BlendSrc ) + { + case GL_ZERO: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_zero]; + break; + case GL_ONE: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one]; + break; + case GL_DST_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_color]; + break; + case GL_ONE_MINUS_DST_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_color]; + break; + case GL_SRC_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha]; + break; + case GL_ONE_MINUS_SRC_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_src_alpha]; + break; + case GL_DST_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_alpha]; + break; + case GL_ONE_MINUS_DST_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_alpha]; + break; + case GL_SRC_ALPHA_SATURATE: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha_saturate]; + break; + case GL_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_color]; + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_color]; + break; + case GL_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_alpha]; + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_alpha]; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_SRCBLEND, dwFunc ); + + switch( ctx->Color.BlendDst ) + { + case GL_ZERO: + dwFunc = pContext->pShared->dwDestBlendCaps[d_zero]; + break; + case GL_ONE: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one]; + break; + case GL_SRC_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_src_color]; + break; + case GL_ONE_MINUS_SRC_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_color]; + break; + case GL_SRC_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_src_alpha]; + break; + case GL_ONE_MINUS_SRC_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_alpha]; + break; + case GL_DST_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_dst_alpha]; + break; + case GL_ONE_MINUS_DST_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_dst_alpha]; + break; + case GL_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_color]; + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_color]; + break; + case GL_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_alpha]; + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_alpha]; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_DESTBLEND, dwFunc ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE ); + } + else + { + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); + } +} +/*===========================================================================*/ +/* If this function is called it will track the changes to the current */ +/* states that I'm setting in Direct3D. I did this so that the DPF's would */ +/* be under control! */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void DebugRenderStates( GLcontext *ctx, BOOL bForce ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DWORD dwFunc; + static int dither = -1, + texture = -1, + textName = -1, + textEnv = -1, + textMin = -1, + textMag = -1, + polyMode = -1, + depthTest = -1, + depthFunc = -1, + depthMask = -1, + alphaTest = -1, + alphaFunc = -1, + blend = -1, + blendSrc = -1, + blendDest = -1; + + /* Force a displayed update of all current states. */ + if ( bForce ) + { + dither = texture = textName = textEnv = textMin = textMag = -1; + polyMode = depthTest = depthFunc = depthMask = -1; + alphaTest = alphaFunc = blend = blendSrc = blendDest = -1; + } + + if ( dither != ctx->Color.DitherFlag ) + { + dither = ctx->Color.DitherFlag; + DPF(( 0, "\tDither\t\t%s", (dither) ? "ENABLED" : "--------" )); + } + if ( depthTest != ctx->Depth.Test ) + { + depthTest = ctx->Depth.Test; + DPF(( 0, "\tDepth Test\t%s", (depthTest) ? "ENABLED" : "--------" )); + } + if ( alphaTest != ctx->Color.AlphaEnabled ) + { + alphaTest = ctx->Color.AlphaEnabled; + + DPF(( 0, "\tAlpha Test\t%s", (alphaTest) ? "ENABLED" : "--------" )); + } + if ( blend != ctx->Color.BlendEnabled ) + { + blend = ctx->Color.BlendEnabled; + + DPF(( 0, "\tBlending\t%s", (blend) ? "ENABLED" : "--------" )); + } + + /*================================================*/ + /* Check too see if there are new TEXTURE states. */ + /*================================================*/ + if ( texture != ctx->Texture._EnabledUnits ) + { + texture = ctx->Texture._EnabledUnits; + DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" )); + } + + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current ) + { + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name != textName ) + { + textName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name; + DPF(( 0, "\tTexture Name:\t%d", textName )); + DPF(( 0, "\tTexture Format:\t%s", + (ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA) ? + "GL_RGBA" : "GLRGB" )); + } + + if ( textEnv != ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) + { + textEnv = ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode; + + switch( textEnv ) + { + case GL_MODULATE: + DPF(( 0, "\tTexture\tMode\tGL_MODULATE" )); + break; + case GL_BLEND: + DPF(( 0, "\tTexture\tMode\tGL_BLEND" )); + break; + case GL_REPLACE: + DPF(( 0, "\tTexture\tMode\tGL_REPLACE" )); + break; + case GL_DECAL: + DPF(( 0, "\tTexture\tMode\tGL_DECAL" )); + break; + } + } + + if ( textMag != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter ) + { + textMag = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter; + + switch( textMag ) + { + case GL_NEAREST: + DPF(( 0, "\tTexture MAG\tGL_NEAREST" )); + break; + case GL_LINEAR: + DPF(( 0, "\tTexture MAG\tGL_LINEAR" )); + break; + case GL_NEAREST_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_NEAREST" )); + break; + case GL_LINEAR_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_NEAREST" )); + break; + case GL_NEAREST_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_LINEAR" )); + break; + case GL_LINEAR_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_LINEAR" )); + break; + } + } + + if ( textMin != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter ) + { + textMin = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter; + + switch( textMin ) + { + case GL_NEAREST: + DPF(( 0, "\tTexture MIN\tGL_NEAREST" )); + break; + case GL_LINEAR: + DPF(( 0, "\tTexture MIN\tGL_LINEAR" )); + break; + case GL_NEAREST_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MIN\tGL_NEAREST_MIPMAP_NEAREST" )); + break; + case GL_LINEAR_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_NEAREST" )); + break; + case GL_NEAREST_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" )); + break; + case GL_LINEAR_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" )); + break; + } + } + } + + if ( ctx->Polygon.FrontMode != polyMode ) + { + polyMode = ctx->Polygon.FrontMode; + + switch( polyMode ) + { + case GL_POINT: + DPF(( 0, "\tMode\t\tGL_POINT" )); + break; + case GL_LINE: + DPF(( 0, "\tMode\t\tGL_LINE" )); + break; + case GL_FILL: + DPF(( 0, "\tMode\t\tGL_FILL" )); + break; + } + } + + if ( depthFunc != ctx->Depth.Func ) + { + depthFunc = ctx->Depth.Func; + + switch( depthFunc ) + { + case GL_NEVER: + DPF(( 0, "\tDepth Func\tGL_NEVER" )); + break; + case GL_LESS: + DPF(( 0, "\tDepth Func\tGL_LESS" )); + break; + case GL_GEQUAL: + DPF(( 0, "\tDepth Func\tGL_GEQUAL" )); + break; + case GL_LEQUAL: + DPF(( 0, "\tDepth Func\tGL_LEQUAL" )); + break; + case GL_GREATER: + DPF(( 0, "\tDepth Func\tGL_GREATER" )); + break; + case GL_NOTEQUAL: + DPF(( 0, "\tDepth Func\tGL_NOTEQUAL" )); + break; + case GL_EQUAL: + DPF(( 0, "\tDepth Func\tGL_EQUAL" )); + break; + case GL_ALWAYS: + DPF(( 0, "\tDepth Func\tGL_ALWAYS" )); + break; + } + } + + if ( depthMask != ctx->Depth.Mask ) + { + depthMask = ctx->Depth.Mask; + DPF(( 0, "\tZWrite\t\t%s", (depthMask) ? "ENABLED" : "--------" )); + } + + if ( alphaFunc != ctx->Color.AlphaFunc ) + { + alphaFunc = ctx->Color.AlphaFunc; + + switch( alphaFunc ) + { + case GL_NEVER: + DPF(( 0, "\tAlpha Func\tGL_NEVER" )); + break; + case GL_LESS: + DPF(( 0, "\tAlpha Func\tGL_LESS" )); + break; + case GL_GEQUAL: + DPF(( 0, "\tAlpha Func\tGL_GEQUAL" )); + break; + case GL_LEQUAL: + DPF(( 0, "\tAlpha Func\tGL_LEQUAL" )); + break; + case GL_GREATER: + DPF(( 0, "\tAlpha Func\tGL_GREATER" )); + break; + case GL_NOTEQUAL: + DPF(( 0, "\tAlpha Func\tGL_NOTEQUAL" )); + break; + case GL_EQUAL: + DPF(( 0, "\tAlpha Func\tGL_EQUAL" )); + break; + case GL_ALWAYS: + DPF(( 0, "\tAlpha Func\tGL_ALWAYS" )); + break; + } + } + + if ( blendSrc != ctx->Color.BlendSrc ) + { + blendSrc = ctx->Color.BlendSrc; + + switch( blendSrc ) + { + case GL_ZERO: + DPF(( 0, "\tSRC Blend\tGL_ZERO" )); + break; + case GL_ONE: + DPF(( 0, "\tSRC Blend\tGL_ONE" )); + break; + case GL_DST_COLOR: + DPF(( 0, "\tSRC Blend\tGL_DST_COLOR" )); + break; + case GL_ONE_MINUS_DST_COLOR: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_COLOR" )); + break; + case GL_SRC_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA" )); + break; + case GL_ONE_MINUS_SRC_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_MINUS_SRC_ALPHA" )); + break; + case GL_DST_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_DST_ALPHA" )); + break; + case GL_ONE_MINUS_DST_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_ALPHA" )); + break; + case GL_SRC_ALPHA_SATURATE: + DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA_SATURATE" )); + break; + case GL_CONSTANT_COLOR: + DPF(( 0, "\tSRC Blend\tGL_CONSTANT_COLOR" )); + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_COLOR" )); + break; + case GL_CONSTANT_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_CONSTANT_ALPHA" )); + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" )); + break; + } + } + + if ( blendDest != ctx->Color.BlendDst ) + { + blendDest = ctx->Color.BlendDst; + + switch( blendDest ) + { + case GL_ZERO: + DPF(( 0, "\tDST Blend\tGL_ZERO" )); + break; + case GL_ONE: + DPF(( 0, "\tDST Blend\tGL_ONE" )); + break; + case GL_SRC_COLOR: + DPF(( 0, "\tDST Blend\tGL_SRC_COLOR" )); + break; + case GL_ONE_MINUS_SRC_COLOR: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_COLOR" )); + break; + case GL_SRC_ALPHA: + DPF(( 0, "\tDST Blend\tGL_SRC_ALPHA" )); + break; + case GL_ONE_MINUS_SRC_ALPHA: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_ALPHA" )); + break; + case GL_DST_ALPHA: + DPF(( 0, "\tDST Blend\tGL_DST_ALPHA" )); + break; + case GL_ONE_MINUS_DST_ALPHA: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_DST_ALPHA" )); + break; + case GL_CONSTANT_COLOR: + DPF(( 0, "\tDST Blend\tGL_CONSTANT_COLOR" )); + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_COLOR" )); + break; + case GL_CONSTANT_ALPHA: + DPF(( 0, "\tDST Blend\tGL_CONSTANT_ALPHA" )); + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" )); + break; + } + } +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DbgEnv.bat xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DbgEnv.bat --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DbgEnv.bat 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DbgEnv.bat 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,25 @@ +SET DBG_FUNC=FALSE + +SET DBG_CNTX_INFO=TRUE +SET DBG_CNTX_WARN=TRUE +SET DBG_CNTX_PROFILE=FALSE +SET DBG_CNTX_ERROR=TRUE +SET DBG_CNTX_ALL=TRUE + +SET DBG_PRIM_INFO=FALSE +SET DBG_PRIM_WARN=FALSE +SET DBG_PRIM_PROFILE=FALSE +SET DBG_PRIM_ERROR=TRUE +SET DBG_PRIM_ALL=FALSE + +SET DBG_TXT_INFO=FALSE +SET DBG_TXT_WARN=TRUE +SET DBG_TXT_PROFILE=FALSE +SET DBG_TXT_ERROR=TRUE +SET DBG_TXT_ALL=FALSE + +SET DBG_ALL_INFO=FALSE +SET DBG_ALL_WARN=TRUE +SET DBG_ALL_PROFILE=FALSE +SET DBG_ALL_ERROR=TRUE +SET DBG_ALL=FALSE diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DDrawPROCS.c xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DDrawPROCS.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DDrawPROCS.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DDrawPROCS.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,399 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DMesa.h" +/*===========================================================================*/ +/* This call will clear the render surface using the pixel info built from */ +/* the surface at creation time. The call uses Lock/Unlock to access the */ +/* surface. The call also special cases a full clear or a dirty rectangle. */ +/* Finally the call returns the new clear mask that reflects that the color */ +/* buffer was cleared. */ +/*===========================================================================*/ +/* RETURN: the original mask with the bits cleared that represents the buffer*/ +/* or buffers we just cleared. */ +/*===========================================================================*/ +GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer, + *pScanLine; + int index, + index2; + DWORD dwColor; + + if ( mask & GL_COLOR_BUFFER_BIT ) + { + /* Lock the surface to get the surface pointer. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + /* Solve the color once only. */ + dwColor = ( ((DWORD)((float)pContext->rClear * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)pContext->gClear * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)pContext->bClear * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + + if ( all ) + { + for( index = 0, pScanLine = (UCHAR *)pddsd2->lpSurface; index < pContext->pShared->dwHeight; index++, pScanLine += pddsd2->lPitch ) + for( pBuffer = pScanLine, index2 = 0; index2 < pContext->pShared->dwWidth; index2++, pBuffer += pContext->pShared->pixel.cb ) + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + else + { + pScanLine = ((UCHAR *)pddsd2->lpSurface) + + ( (FLIP( pContext->pShared->dwHeight, (y+height)) * pddsd2->lPitch) + (x * pContext->pShared->pixel.cb) ); + + for( index = 0; index < height; index++, pScanLine += pddsd2->lPitch ) + { + for( index2 = 0, pBuffer = pScanLine; index2 < width; index2++, pBuffer += pContext->pShared->pixel.cb ) + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + + UnlockHAL( pContext->pShared, TRUE ); + } + + return (mask & ~GL_COLOR_BUFFER_BIT); +} +/*===========================================================================*/ +/* This proc (as all others) has been written for the general case. I use */ +/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ +/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer; + int index; + DWORD dwColor; + + /* Get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + /* Find the start of the span. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb); + + if ( mask ) + { + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + { + if ( mask[index] ) + { + /* Pack the color components. */ + dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + } + else + { + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + { + /* Pack the color components. */ + dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} +/*===========================================================================*/ +/* This proc (as all others) has been written for the general case. I use */ +/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ +/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer; + int index; + DWORD dwColor; + + /* Get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + /* Find the start of the span. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb); + + if ( mask ) + { + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + { + if ( mask[index] ) + { + /* Pack the color components. */ + dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + } + else + { + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + { + /* Pack the color components. */ + dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} +/*===========================================================================*/ +/* This proc (as all others) has been written for the general case. I use */ +/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ +/* Screen render surface uses. The color is solved once from the current */ +/* color components. The alpha is ignored as Mesa is doing it in SW. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer; + int index; + DWORD dwColor; + + /* Lock the surface to get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + /* Solve the color once only. (no alpha) */ + dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + + /* Find the start of the span. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb); + + if ( mask ) + { + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + if ( mask[index] ) + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + else + { + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} +/*===========================================================================*/ +/* This proc (as all others) has been written for the general case. I use */ +/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ +/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer; + int index; + DWORD dwColor; + + /* Get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + if ( mask ) + { + for( index = 0; index < n; index++ ) + { + if ( mask[index] ) + { + /* Pack the color components. */ + dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + + /* Find the pixel. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + } + else + { + for( index = 0; index < n; index++ ) + { + /* Pack the color components. */ + dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + + /* Find the pixel. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} +/*===========================================================================*/ +/* This proc (as all others) has been written for the general case. I use */ +/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ +/* Screen render surface uses. The color is solved once from the current */ +/* color components. The alpha is ignored as Mesa is doing it in SW. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer; + int index; + DWORD dwColor; + + /* Get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + /* Solve the color once only. I don't uses the alpha. */ + dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); + dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); + dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); + + if ( mask ) + { + /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ + for( index = 0; index < n; index++ ) + { + if ( mask[index] ) + { + /* Find the pixel. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + } + else + { + /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ + for( index = 0; index < n; index++ ) + { + /* Find the pixel. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); + memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); + } + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} +/*===========================================================================*/ +/* This proc isn't written for speed rather its to handle the general case. */ +/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/ +/* structure that was generated from the OffScreen surface pixelformat. The */ +/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/ +/* own alpha channel when the context was created. I did this as I didn't */ +/* feel that it was worth the effort to try and get HW to work (bus bound). */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + UCHAR *pBuffer; + int index; + DWORD *pdwColor; + + /* Get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + /* Find the start of the span. Invert y for Windows. */ + pBuffer = (UCHAR *)pddsd2->lpSurface + + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + + (x*pContext->pShared->pixel.cb); + + /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ + for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) + { + pdwColor = (DWORD *)pBuffer; + rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale); + rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale); + rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale); + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} +/*===========================================================================*/ +/* This proc isn't written for speed rather its to handle the general case. */ +/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/ +/* structure that was generated from the OffScreen surface pixelformat. The */ +/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/ +/* own alpha channel when the context was created. I did this as I didn't */ +/* feel that it was worth the effort to try and get HW to work (bus bound). */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DDSURFACEDESC2 *pddsd2; + int index; + DWORD *pdwColor; + + /* Get the surface pointer and the pitch. */ + pddsd2 = LockHAL( pContext->pShared, TRUE ); + + if ( mask ) + { + /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ + for( index = 0; index < n; index++ ) + { + if ( mask[index] ) + { + /* Find the start of the pixel. Invert y for Windows. */ + pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb)); + rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale); + rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale); + rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale); + } + } + } + else + { + /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ + for( index = 0; index < n; index++ ) + { + /* Find the start of the pixel. Invert y for Windows. */ + pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb)); + rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale); + rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale); + rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale); + } + } + + /* Giver back. */ + UnlockHAL( pContext->pShared, TRUE ); +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.C xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.C --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.C 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.C 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,143 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "Debug.h" +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +DWORD g_DBGMask = DBG_ALL_ERROR; +/*===========================================================================*/ +/* This is your basic DPF function with printf like support. The function */ +/* also works with a global debug mask variable. I have written support that*/ +/* allows for the user's enviroment variable space to be read and set the */ +/* masks. This is done when the dll starts and is only in the debug version.*/ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void _cdecl DebugPrint( int mask, char *pszFormat, ... ) +{ + char buffer[512]; + va_list args; + + /* A mask of 0 will always pass. Easy to remeber. */ + if ( (mask == 0) || (mask & g_DBGMask) ) + { + va_start( args, pszFormat ); + + if ( mask & DBG_ALL_ERROR ) + OutputDebugString( "MesaD3D: (ERROR)" ); + else + OutputDebugString( "MesaD3D: " ); + + vsprintf( buffer, pszFormat, args ); + strcat( buffer, "\n" ); + OutputDebugString( buffer ); + + va_end( args ); + } +} +/*===========================================================================*/ +/* This call reads the users enviroment variables and sets any debug mask */ +/* that they have set to TRUE. Now the value must be "TRUE". */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void ReadDBGEnv( void ) +{ + g_DBGMask = DBG_ALL_ERROR; + +#define IS_VAR_SET(v) if ( getenv( # v ) && !strcmp(getenv( # v ),"TRUE") ) g_DBGMask |= v; + + IS_VAR_SET( DBG_FUNC ); + IS_VAR_SET( DBG_STATES ); + + IS_VAR_SET( DBG_CNTX_INFO ); + IS_VAR_SET( DBG_CNTX_WARN ); + IS_VAR_SET( DBG_CNTX_PROFILE ); + IS_VAR_SET( DBG_CNTX_ERROR ); + IS_VAR_SET( DBG_CNTX_ALL ); + + IS_VAR_SET( DBG_PRIM_INFO ); + IS_VAR_SET( DBG_PRIM_WARN ); + IS_VAR_SET( DBG_PRIM_PROFILE ); + IS_VAR_SET( DBG_PRIM_ERROR ); + IS_VAR_SET( DBG_PRIM_ALL ); + + IS_VAR_SET( DBG_TXT_INFO ); + IS_VAR_SET( DBG_TXT_WARN ); + IS_VAR_SET( DBG_TXT_PROFILE ); + IS_VAR_SET( DBG_TXT_ERROR ); + IS_VAR_SET( DBG_TXT_ALL ); + + IS_VAR_SET( DBG_ALL_INFO ); + IS_VAR_SET( DBG_ALL_WARN ); + IS_VAR_SET( DBG_ALL_PROFILE ); + IS_VAR_SET( DBG_ALL_ERROR ); + IS_VAR_SET( DBG_ALL ); + +#undef IS_VAR_SET +} +/*===========================================================================*/ +/* This function will take a pointer to a DDSURFACEDESC2 structure & display*/ +/* the parsed information using a DPF call. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf ) +{ + char buffer[256]; + + /* Parse the flag type and write the string equivalent. */ + if ( pddpf->dwFlags & DDPF_ALPHA ) + strcat( buffer, "DDPF_ALPHA " ); + if ( pddpf->dwFlags & DDPF_ALPHAPIXELS ) + strcat( buffer, "DDPF_ALPHAPIXELS " ); + if ( pddpf->dwFlags & DDPF_ALPHAPREMULT ) + strcat( buffer, "DDPF_ALPHAPREMULT " ); + if ( pddpf->dwFlags & DDPF_BUMPLUMINANCE ) + strcat( buffer, "DDPF_BUMPLUMINANCE " ); + if ( pddpf->dwFlags & DDPF_BUMPDUDV ) + strcat( buffer, "DDPF_BUMPDUDV " ); + if ( pddpf->dwFlags & DDPF_COMPRESSED ) + strcat( buffer, "DDPF_COMPRESSED " ); + if ( pddpf->dwFlags & DDPF_FOURCC ) + strcat( buffer, "DDPF_FOURCC " ); + if ( pddpf->dwFlags & DDPF_LUMINANCE ) + strcat( buffer, "DDPF_LUMINANCE " ); + if ( pddpf->dwFlags & DDPF_PALETTEINDEXED1 ) + strcat( buffer, "DDPF_PALETTEINDEXED1 " ); + if ( pddpf->dwFlags & DDPF_PALETTEINDEXED2 ) + strcat( buffer, "DDPF_PALETTEINDEXED2 " ); + if ( pddpf->dwFlags & DDPF_PALETTEINDEXED4 ) + strcat( buffer, "DDPF_PALETTEINDEXED4 " ); + if ( pddpf->dwFlags & DDPF_PALETTEINDEXED8 ) + strcat( buffer, "DDPF_PALETTEINDEXED8 " ); + if ( pddpf->dwFlags & DDPF_PALETTEINDEXEDTO8 ) + strcat( buffer, "DDPF_PALETTEINDEXEDTO8 " ); + if ( pddpf->dwFlags & DDPF_RGB ) + strcat( buffer, "DDPF_RGB " ); + if ( pddpf->dwFlags & DDPF_RGBTOYUV ) + strcat( buffer, "DDPF_RGBTOYUV " ); + if ( pddpf->dwFlags & DDPF_STENCILBUFFER ) + strcat( buffer, "DDPF_STENCILBUFFER " ); + if ( pddpf->dwFlags & DDPF_YUV ) + strcat( buffer, "DDPF_YUV " ); + if ( pddpf->dwFlags & DDPF_ZBUFFER ) + strcat( buffer, "DDPF_ZBUFFER " ); + if ( pddpf->dwFlags & DDPF_ZPIXELS ) + strcat( buffer, "DDPF_ZPIXELS " ); + + DPF(( (DBG_TXT_INFO|DBG_CNTX_INFO),"%s", buffer )); +} + + + + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.H xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.H --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.H 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/DEBUG.H 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,90 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef _DEBUG_H +#define _DEBUG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include +#include +#include +#include +#include "D3DShared.h" +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Macros defines. */ +/*===========================================================================*/ +#define DBG_FUNC 0x00000001 +#define DBG_STATES 0x00000002 + +#define DBG_CNTX_INFO 0x00000010 +#define DBG_CNTX_WARN 0x00000020 +#define DBG_CNTX_PROFILE 0x00000040 +#define DBG_CNTX_ERROR 0x00000080 +#define DBG_CNTX_ALL 0x000000F0 + +#define DBG_PRIM_INFO 0x00000100 +#define DBG_PRIM_WARN 0x00000200 +#define DBG_PRIM_PROFILE 0x00000400 +#define DBG_PRIM_ERROR 0x00000800 +#define DBG_PRIM_ALL 0x00000F00 + +#define DBG_TXT_INFO 0x00001000 +#define DBG_TXT_WARN 0x00002000 +#define DBG_TXT_PROFILE 0x00004000 +#define DBG_TXT_ERROR 0x00008000 +#define DBG_TXT_ALL 0x0000F000 + +#define DBG_ALL_INFO 0x11111110 +#define DBG_ALL_WARN 0x22222220 +#define DBG_ALL_PROFILE 0x44444440 +#define DBG_ALL_ERROR 0x88888880 +#define DBG_ALL 0xFFFFFFFF + +#ifdef D3D_DEBUG +# define DPF(arg) DebugPrint arg +# define RIP(pH,msg,err) OutputDebugString(msg); \ + OutputDebugString(err); \ + OutputDebugString("\n"); \ + FatalShutDown(pH) +#else +# define DPF(arg) +# define RIP(pH,msg,err) FatalShutDown(pH) +#endif +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Function prototypes. */ +/*===========================================================================*/ +extern void ReadDBGEnv( void ); +extern void _cdecl DebugPrint( int mask, char *pszFormat, ... ); +extern void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +extern DWORD g_DBGMask; + +#ifdef __cplusplus +} +#endif + +#endif + + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/MAKEFILE xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/MAKEFILE --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/MAKEFILE 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/MAKEFILE 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,101 @@ +############################################################################## +# +# Mesa-3.0 Makefile for DirectX 6 Driver +# +# By Leigh McRae +# +# http://www.altsoftware.com/ +# +# Copyright (c) 1999-1998 alt.software inc. All Rights Reserved +############################################################################## +NAME= +TARGET= WGL Driver (D3DHAL) + +D3D_DIR=$(MAKEDIR)\D3D +TARGET_DIR=e:\WinNT\System32 +TEMP_DIR=c:\Temp + +SPACE=- +LINKER=link.exe + +INCLUDE=$(SDKROOT)\include;$(INCLUDE) +LIB=$(SDKROOT)\lib;$(LIB) +############################################################################## +CFLAGS = /c /nologo /W1 /G5 /I..\ /I..\..\Include \ + /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D" +CPPFLAGS= /c /nologo /W1 /G5 /I..\ /I..\..\Include \ + /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D" + +!IF "$(DEBUG)" == "1" + +CFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CFLAGS) +CPPFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CPPFLAGS) +BUILD_TYPE=debug + +!ELSE + +CFLAGS = /MT /Ox /D "NDEBUG" $(CFLAGS) +CPPFLAGS = /MT /Ox /D "NDEBUG" $(CPPFLAGS) +BUILD_TYPE=release + +!ENDIF +############################################################################## +SRCS_WGL = wgl.c D3Dvbrender.c DDrawPROCS.c NULLProcs.c Debug.c +SRCS_HAL = D3DInit.cpp D3DRaster.cpp D3DTextureMgr.cpp D3DUtils.cpp D3DCaps.cpp +OBJS_WGL = $(SRCS_WGL:.c=.obj) +OBJS_HAL = $(SRCS_HAL:.cpp=.obj) + +WINLIBS = kernel32.lib user32.lib gdi32.lib oldnames.lib +DXLIBS = +LIBS = $(WINLIBS) $(DXLIBS) +############################################################################### +# Primary Targets # +############################################################################### + +default: header WGL HAL footer + +all: default + +WGL : $(OBJS_WGL) + +HAL : $(OBJS_HAL) + +install : forceit + @echo $(SPACE) + @echo ======================================== + @echo Install files created. + @echo ======================================== + + +############################################################################### +# Secondary Targets # +############################################################################### + +clean: + @echo ======================================== + @echo Cleaning $(TARGET) + @del *.obj + @del *.dep + @del *.exp + @del *.ncb + @del *.plg + @del *.lib + @echo ======================================== + +header: + @echo ============================================================ + @echo Building $(TARGET) ($(BUILD_TYPE) version) + @echo ============================================================ + @echo $(SPACE) + +footer: + @echo $(SPACE) + @echo ============================================================ + @echo DONE building $(TARGET) ($(BUILD_TYPE) version) + @echo ============================================================ + +forceit: + + + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NullProcs.c xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NullProcs.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NullProcs.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NullProcs.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,49 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef NULL_MESA_PROCS_INC +#define NULL_MESA_PROCS_INC +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include "matrix.h" +#include "context.h" +#include "mtypes.h" +#include "vb.h" +/*===========================================================================*/ +/* Macros. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +GLboolean NULLSetBuffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bit ); +void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); +GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h ); +void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] ); +void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] ); +void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] ); +void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] ); +void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] ); +void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] ); +void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] ); +/*===========================================================================*/ +/* Extern function prototypes. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NULLProcs.h xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NULLProcs.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NULLProcs.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/NULLProcs.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,49 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef NULL_MESA_PROCS_INC +#define NULL_MESA_PROCS_INC +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include "matrix.h" +#include "context.h" +#include "types.h" +#include "vb.h" +/*===========================================================================*/ +/* Macros. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +GLboolean NULLSetBuffer( GLcontext *ctx, GLenum mode ); +void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); +GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h ); +void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] ); +void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] ); +void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] ); +void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] ); +void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] ); +void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] ); +void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] ); +/*===========================================================================*/ +/* Extern function prototypes. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/OPENGL32.DEF xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/OPENGL32.DEF --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/OPENGL32.DEF 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/OPENGL32.DEF 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,442 @@ +;=========================================================================== +; +; Mesa-3.0 DirectX 6 Driver +; +; By Leigh McRae +; +; http://www.altsoftware.com/ +; +; Copyright (c) 1999-1998 alt.software inc. All Rights Reserved +;=========================================================================== +NAME OpenGL32.DLL +DESCRIPTION "Mesa-3.0 DX6 Driver Version 0.5" + +EXPORTS + DllMain + glAccum + glAlphaFunc + glAreTexturesResident + glAreTexturesResidentEXT + glArrayElement + glArrayElementEXT + glBegin + glBindTexture + glBindTextureEXT + glBitmap + glBlendColorEXT + glBlendEquationEXT + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearColor + glClearDepth + glClearIndex + glClearStencil + glClipPlane + glColor3b + glColor3bv + glColor3d + glColor3dv + glColor3f + glColor3fv + glColor3i + glColor3iv + glColor3s + glColor3sv + glColor3ub + glColor3ubv + glColor3ui + glColor3uiv + glColor3us + glColor3usv + glColor4b + glColor4bv + glColor4d + glColor4dv + glColor4f + glColor4fv + glColor4i + glColor4iv + glColor4s + glColor4sv + glColor4ub + glColor4ubv + glColor4ui + glColor4uiv + glColor4us + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glColorPointerEXT + glColorSubTableEXT + glColorTableEXT + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCopyTexSubImage3DEXT + glCullFace + glDeleteLists + glDeleteTextures + glDeleteTexturesEXT + glDepthFunc + glDepthMask + glDepthRange + glDisable + glDisableClientState + glDrawArrays + glDrawArraysEXT + glDrawBuffer + glDrawElements + glDrawPixels + glEdgeFlag + glEdgeFlagPointer + glEdgeFlagPointerEXT + glEdgeFlagv + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1dv + glEvalCoord1f + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2dv + glEvalCoord2f + glEvalCoord2fv + glEvalMesh1 + glEvalMesh2 + glEvalPoint1 + glEvalPoint2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogfv + glFogi + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGenTexturesEXT + glGetBooleanv + glGetClipPlane + glGetColorTableEXT + glGetColorTableParameterfvEXT + glGetColorTableParameterivEXT + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPointervEXT + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGendv + glGetTexGenfv + glGetTexGeniv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexd + glIndexdv + glIndexf + glIndexfv + glIndexi + glIndexiv + glIndexMask + glIndexPointer + glIndexPointerEXT + glIndexs + glIndexsv + glIndexub + glIndexubv + glInitNames + glInterleavedArrays + glIsEnabled + glIsList + glIsTexture + glIsTextureEXT + glLightf + glLightfv + glLighti + glLightiv + glLightModelf + glLightModelfv + glLightModeli + glLightModeliv + glLineStipple + glLineWidth + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMaterialfv + glMateriali + glMaterialiv + glMatrixMode + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3bv + glNormal3d + glNormal3dv + glNormal3f + glNormal3fv + glNormal3i + glNormal3iv + glNormal3s + glNormal3sv + glNormalPointer + glNormalPointerEXT + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointParameterfEXT + glPointParameterfvEXT + glPointSize + glPolygonMode + glPolygonOffset + glPolygonOffsetEXT + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPrioritizeTexturesEXT + glPushAttrib + glPushClientAttrib + glPushMatrix + glPushName + glRasterPos2d + glRasterPos2dv + glRasterPos2f + glRasterPos2fv + glRasterPos2i + glRasterPos2iv + glRasterPos2s + glRasterPos2sv + glRasterPos3d + glRasterPos3dv + glRasterPos3f + glRasterPos3fv + glRasterPos3i + glRasterPos3iv + glRasterPos3s + glRasterPos3sv + glRasterPos4d + glRasterPos4dv + glRasterPos4f + glRasterPos4fv + glRasterPos4i + glRasterPos4iv + glRasterPos4s + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectdv + glRectf + glRectfv + glRecti + glRectiv + glRects + glRectsv + glRenderMode + glResizeBuffersMESA + glRotated + glRotatef + glScaled + glScalef + glScissor + glSelectBuffer + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1dv + glTexCoord1f + glTexCoord1fv + glTexCoord1i + glTexCoord1iv + glTexCoord1s + glTexCoord1sv + glTexCoord2d + glTexCoord2dv + glTexCoord2f + glTexCoord2fv + glTexCoord2i + glTexCoord2iv + glTexCoord2s + glTexCoord2sv + glTexCoord3d + glTexCoord3dv + glTexCoord3f + glTexCoord3fv + glTexCoord3i + glTexCoord3iv + glTexCoord3s + glTexCoord3sv + glTexCoord4d + glTexCoord4dv + glTexCoord4f + glTexCoord4fv + glTexCoord4i + glTexCoord4iv + glTexCoord4s + glTexCoord4sv + glTexCoordPointer + glTexCoordPointerEXT + glTexEnvf + glTexEnvfv + glTexEnvi + glTexEnviv + glTexGend + glTexGendv + glTexGenf + glTexGenfv + glTexGeni + glTexGeniv + glTexImage1D + glTexImage2D + glTexImage3DEXT + glTexParameterf + glTexParameterfv + glTexParameteri + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTexSubImage3DEXT + glTranslated + glTranslatef + glVertex2d + glVertex2dv + glVertex2f + glVertex2fv + glVertex2i + glVertex2iv + glVertex2s + glVertex2sv + glVertex3d + glVertex3dv + glVertex3f + glVertex3fv + glVertex3i + glVertex3iv + glVertex3s + glVertex3sv + glVertex4d + glVertex4dv + glVertex4f + glVertex4fv + glVertex4i + glVertex4iv + glVertex4s + glVertex4sv + glVertexPointer + glVertexPointerEXT + glViewport + glWindowPos2dMESA + glWindowPos2dvMESA + glWindowPos2fMESA + glWindowPos2fvMESA + glWindowPos2iMESA + glWindowPos2ivMESA + glWindowPos2sMESA + glWindowPos2svMESA + glWindowPos3dMESA + glWindowPos3dvMESA + glWindowPos3fMESA + glWindowPos3fvMESA + glWindowPos3iMESA + glWindowPos3ivMESA + glWindowPos3sMESA + glWindowPos3svMESA + glWindowPos4dMESA + glWindowPos4dvMESA + glWindowPos4fMESA + glWindowPos4fvMESA + glWindowPos4iMESA + glWindowPos4ivMESA + glWindowPos4sMESA + glWindowPos4svMESA +; WMesaCreateContext +; WMesaDestroyContext +; WMesaMakeCurrent +; WMesaPaletteChange +; WMesaSwapBuffers +; OSMesaCreateContext +; OSMesaDestroyContext +; OSMesaMakeCurrent +; OSMesaGetCurrentContext +; OSMesaPixelStore +; OSMesaGetIntegerv +; OSMesaGetDepthBuffer + wglCopyContext + wglCreateContext + wglCreateLayerContext + wglDeleteContext +; wglDescribeLayerPlane + wglGetCurrentContext + wglGetCurrentDC +; wglGetLayerPaletteEntries + wglGetProcAddress + wglMakeCurrent +; wglRealizeLayerPalette +; wglSetLayerPaletteEntries + wglShareLists + wglSwapLayerBuffers + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglChoosePixelFormat + wglDescribePixelFormat + wglGetPixelFormat + wglSetPixelFormat + wglSwapBuffers + + + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/WGL.C xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/WGL.C --- xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/WGL.C 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/d3d/WGL.C 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1262 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 Makefile for DirectX 6 */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1998-1997 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include "D3DMesa.h" +/*===========================================================================*/ +/* Window managment. */ +/*===========================================================================*/ +static BOOL InitOpenGL( HINSTANCE hInst ); +static BOOL TermOpenGL( HINSTANCE hInst ); +static BOOL ResizeContext( GLcontext *ctx ); +static BOOL MakeCurrent( D3DMESACONTEXT *pContext ); +static void DestroyContext( D3DMESACONTEXT *pContext ); +static BOOL UnBindWindow( D3DMESACONTEXT *pContext ); +LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam ); +/*===========================================================================*/ +/* Mesa hooks. */ +/*===========================================================================*/ +static void SetupDDPointers( GLcontext *ctx ); +static void SetupSWDDPointers( GLcontext *ctx ); +static void SetupHWDDPointers( GLcontext *ctx ); +static void SetupNULLDDPointers( GLcontext *ctx ); +static const char *RendererString( void ); + +/* State Management hooks. */ +static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer ); + +/* Window Management hooks. */ +static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); +static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ); +static void Flush( GLcontext *ctx ); + +/* Span rendering hooks. */ +void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] ); +void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); +void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] ); +void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); +void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] ); +void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); +void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); +GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); + +/* Primitve rendering hooks. */ +GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone ); +void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ); +void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); +GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); + +/* Texture Management hooks. */ +static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ); +static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image ); +static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +D3DMESACONTEXT *pD3DCurrent, + *pD3DDefault; /* Thin support context. */ + +struct __extensions__ ext[] = { + + { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, + { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, + { (PROC)glBlendColorEXT, "glBlendColorExt" }, + { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, + { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, + { (PROC)glColorPointerEXT, "glColorPointerEXT" }, + { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, + { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, + { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, + { (PROC)glGetPointervEXT, "glGetPointervEXT" }, + { (PROC)glArrayElementEXT, "glArrayElementEXT" }, + { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, + { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, + { (PROC)glBindTextureEXT, "glBindTextureEXT" }, + { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, + { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, + { (PROC)glIsTextureEXT, "glIsTextureEXT" }, + { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, + { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, + { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, + { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, +}; + +int qt_ext = sizeof(ext) / sizeof(ext[0]); +float g_DepthScale, + g_MaxDepth; +/*===========================================================================*/ +/* When a process loads this DLL we will setup the linked list for context */ +/* management and create a default context that will support the API until */ +/* the user creates and binds thier own. This THIN default context is useful*/ +/* to have around. */ +/* When the process terminates we will clean up all resources here. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY DllMain( HINSTANCE hInst, DWORD reason, LPVOID reserved ) +{ + switch( reason ) + { + case DLL_PROCESS_ATTACH: + return InitOpenGL( hInst ); + + case DLL_PROCESS_DETACH: + return TermOpenGL( hInst ); + } + + return TRUE; +} +/*===========================================================================*/ +/* The first thing we do when this dll is hit is connect to the dll that has*/ +/* handles all the DirectX 6 rendering. I decided to use another dll as DX6 */ +/* is all C++ and Mesa-3.0 is C (thats a good thing). This way I can write */ +/* the DX6 in C++ and Mesa-3.0 in C without having to worry about linkage. */ +/* I feel this is easy and better then using static wrappers as it is likely */ +/* faster and it allows me to just develope the one without compiling the */ +/* other. */ +/* NOTE that at this point we don't have much other than a very thin context*/ +/* that will support the API calls only to the point of not causing the app */ +/* to crash from the API table being empty. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static BOOL InitOpenGL( HINSTANCE hInst ) +{ + /* Allocate and clear the default context. */ + pD3DDefault = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) ); + if ( pD3DDefault == NULL ) + return FALSE; + memset( pD3DDefault, 0, sizeof(D3DMESACONTEXT) ); + + /* Clear the D3D vertex buffer so that values not used will be zero. This */ + /* save me from some redundant work. */ + memset( &D3DTLVertices, 0, sizeof(D3DTLVertices) ); + + /* Update the link. We uses a circular list so that it is easy to */ + /* add and search. This context will also be used for head and tail.*/ + pD3DDefault->next = pD3DDefault; + + /*========================================================================*/ + /* Do all core Mesa stuff. */ + /*========================================================================*/ + pD3DDefault->gl_visual = _mesa_create_visual( TRUE, + FALSE, /* db_flag */ + GL_FALSE, /* stereo */ + 8,8,8,8, /* r, g, b, a bits */ + 0, /* index bits */ + 16, /* depth_bits */ + 8, /* stencil_bits */ + 8,8,8,8, /* accum_bits */ + 1 ); + + if ( pD3DDefault->gl_visual == NULL) + { + FREE( pD3DDefault ); + return FALSE; + } + + /* Allocate a new Mesa context */ + pD3DDefault->gl_ctx = _mesa_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE ); + if ( pD3DDefault->gl_ctx == NULL ) + { + _mesa_destroy_visual( pD3DDefault->gl_visual ); + FREE( pD3DDefault ); + return FALSE; + } + + /* Allocate a new Mesa frame buffer */ + pD3DDefault->gl_buffer = _mesa_create_framebuffer( pD3DDefault->gl_visual ); + if ( pD3DDefault->gl_buffer == NULL ) + { + _mesa_destroy_visual( pD3DDefault->gl_visual ); + _mesa_destroy_context( pD3DDefault->gl_ctx ); + FREE( pD3DDefault ); + return FALSE; + } + SetupDDPointers( pD3DDefault->gl_ctx ); + _mesa_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer ); + + return TRUE; +} +/*===========================================================================*/ +/* This function will create a new D3D context but will not create the D3D */ +/* surfaces or even an instance of D3D (see at GetBufferSize). The only stuff*/ +/* done here is the internal Mesa stuff and some Win32 handles. */ +/*===========================================================================*/ +/* RETURN: casted pointer to the context, NULL. */ +/*===========================================================================*/ +HGLRC APIENTRY wglCreateContext( HDC hdc ) +{ + D3DMESACONTEXT *pNewContext; + DWORD dwCoopFlags = DDSCL_NORMAL; + RECT rectClient; + POINT pt; + + /* ALLOC and clear the new context. */ + pNewContext = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) ); + if ( pNewContext == NULL ) + { + SetLastError( 0 ); + return (HGLRC)NULL; + } + memset( pNewContext, 0, sizeof(D3DMESACONTEXT) ); + + /*========================================================================*/ + /* Do all core Mesa stuff. */ + /*========================================================================*/ + + /* TODO: support more then one visual. */ + pNewContext->gl_visual = _mesa_create_visual( TRUE, + TRUE, /* db_flag */ + GL_FALSE, /* stereo */ + 8,8,8,8, /* r, g, b, a bits */ + 0, /* index bits */ + 16, /* depth_bits */ + 8, /* stencil_bits */ + 16,16,16,16,/* accum_bits */ + 1 ); + if ( pNewContext->gl_visual == NULL) + { + FREE( pNewContext ); + SetLastError( 0 ); + return (HGLRC)NULL; + } + + /* Allocate a new Mesa context */ + pNewContext->gl_ctx = _mesa_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE ); + if ( pNewContext->gl_ctx == NULL ) + { + _mesa_destroy_visual( pNewContext->gl_visual ); + FREE( pNewContext ); + SetLastError( 0 ); + return (HGLRC)NULL; + } + + /* Allocate a new Mesa frame buffer */ + pNewContext->gl_buffer = _mesa_create_framebuffer( pNewContext->gl_visual ); + if ( pNewContext->gl_buffer == NULL ) + { + _mesa_destroy_visual( pNewContext->gl_visual ); + _mesa_destroy_context( pNewContext->gl_ctx ); + FREE( pNewContext ); + SetLastError( 0 ); + return (HGLRC)NULL; + } + + /*========================================================================*/ + /* Do all the driver stuff. */ + /*========================================================================*/ + pNewContext->hdc = hdc; + pNewContext->next = pD3DDefault->next; + pD3DDefault->next = pNewContext; /* Add to circular list. */ + + /* Create the HAL for the new context. */ + pNewContext->pShared = InitHAL( WindowFromDC(hdc) ); + + return (HGLRC)pNewContext; +} +/*===========================================================================*/ +/* This is a wrapper function that is supported by MakeCurrent. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglMakeCurrent( HDC hdc, HGLRC hglrc ) +{ + return MakeCurrent((D3DMESACONTEXT *)hglrc); +} +/*===========================================================================*/ +/* MakeCurrent will unbind whatever context is current (if any) & then bind */ +/* the supplied context. A context that is bound has it's window proc hooked*/ +/* with the wglMonitorProc and the context pointer is saved in pD3DCurrent. */ +/* Once the context is bound we update the Mesa-3.0 hooks (SetDDPointers) and*/ +/* the viewport (Mesa-.30 and DX6). */ +/* */ +/* TODO: this function can't fail. */ +/*===========================================================================*/ +/* RETURN: TRUE */ +/*===========================================================================*/ +static BOOL MakeCurrent( D3DMESACONTEXT *pContext ) +{ + D3DMESACONTEXT *pNext; + + /*====================================================================*/ + /* This is a special case that is a request to have no context bound. */ + /*====================================================================*/ + if ( pContext == NULL ) + { + /* Walk the whole list. We start and end at the Default context. */ + for( pNext = pD3DDefault->next; pNext != pD3DDefault; pNext = pNext->next ) + UnBindWindow( pNext ); + + return TRUE; + } + + /*=================================================*/ + /* Make for a fast redundant use of this function. */ + /*=================================================*/ + if ( pD3DCurrent == pContext ) + return TRUE; + + /*=============================*/ + /* Unbind the current context. */ + /*=============================*/ + UnBindWindow( pD3DCurrent ); + + /*=====================================*/ + /* Let Mesa-3.0 we have a new context. */ + /*=====================================*/ + SetupDDPointers( pContext->gl_ctx ); + _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer ); + + /* We are done so set the internal current context. */ + if ( pContext != pD3DDefault ) + { + ResizeContext( pContext->gl_ctx ); + pContext->hOldProc = (WNDPROC)GetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC ); + SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)wglMonitorProc ); + } + pD3DCurrent = pContext; + + return TRUE; +} +/*===========================================================================*/ +/* This function will only return the current window size. I have re-done */ +/* this function so that it doesn't check the current size and react to it as*/ +/* I should be able to have all the react code in the WM_SIZE message. The */ +/* old version would check the current window size and create/resize the HAL */ +/* surfaces if they have changed. I needed to delay the creation if the */ +/* surfaces because sometimes I wouldn't have a window size so this is where */ +/* I delayed it. If you are reading this then all went ok! */ +/* The default context will return a zero sized window and I'm not sure if */ +/* this is ok at this point (TODO). */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + /* Fall through for the default because that is one of the uses for it. */ + if ( pContext == pD3DDefault ) + { + *width = 0; + *height = 0; + } + else + { + *width = pContext->pShared->dwWidth; + *height = pContext->pShared->dwHeight; + } +} +/*===========================================================================*/ +/* */ +/* */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static BOOL ResizeContext( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx, + *pCurrentTemp; + RECT rectClient; + POINT pt; + DWORD dwWidth, + dwHeight; + static BOOL bDDrawLock = FALSE; + + /* Make sure we have some values. */ + if ( (pContext->hdc == NULL ) || + (pContext->pShared->hwnd != WindowFromDC(pContext->hdc)) || + (pContext == pD3DDefault) ) + return FALSE; + + /* Having problems with DDraw sending resize messages before I was done. */ + if( bDDrawLock == TRUE ) + return FALSE; + + // TODO: don't think I need this anymore. + pCurrentTemp = pD3DCurrent; + pD3DCurrent = pD3DDefault; + bDDrawLock = TRUE; + + /* Get the current window dimentions. */ + UpdateScreenPosHAL( pContext->pShared ); + dwWidth = pContext->pShared->rectW.right - pContext->pShared->rectW.left; + dwHeight = pContext->pShared->rectW.bottom - pContext->pShared->rectW.top; + + /* Is the size of the OffScreen Render different? */ + if ( (dwWidth != pContext->pShared->dwWidth) || (dwHeight != pContext->pShared->dwHeight) ) + { + /* Create all the D3D surfaces and device. */ + CreateHAL( pContext->pShared ); + + /* I did this so that software rendering would still work as */ + /* I don't need to scale the z values twice. */ + g_DepthScale = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF); + g_MaxDepth = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF); + gl_DepthRange( pContext->gl_ctx, ctx->Viewport.Near, ctx->Viewport.Far ); + + /* Make sure we have a viewport. */ + gl_Viewport( pContext->gl_ctx, 0, 0, dwWidth, dwHeight ); + + /* Update Mesa as we might have changed from SW <-> HW. */ + SetupDDPointers( pContext->gl_ctx ); + _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer ); + + /* If we are in HW we need to load the current texture if there is one already. */ + // if ( (ctx->Texture.Set[ctx->Texture.CurrentSet].Current != NULL) && + // (pContext->pShared->bHardware == TRUE) ) + // { + // CreateTMgrHAL( pContext->pShared, + // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name, + // 0, + // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format, + // (RECT *)NULL, + // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Width, + // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Height, + // TM_ACTION_BIND, + // (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Data ); + // } + } + + // TODO: don't think I need this anymore. + pD3DCurrent = pCurrentTemp; + bDDrawLock = FALSE; + + return TRUE; +} + +/*===========================================================================* +/* This function will Blt the render buffer to the PRIMARY surface. I repeat*/ +/* this code for the other SwapBuffer like functions and the flush (didn't */ +/* want the function calling overhead). Thsi could have been a macro... */ +/* */ +/* TODO: there are some problems with viewport/scissoring. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglSwapBuffers( HDC hdc ) +{ + /* Fall through for the default because that is one of the uses for it. */ + if ( pD3DCurrent == pD3DDefault ) + return FALSE; + + SwapBuffersHAL( pD3DCurrent->pShared ); + + return TRUE; +} +/*===========================================================================*/ +/* Same as wglSwapBuffers. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY SwapBuffers( HDC hdc ) +{ + /* Fall through for the default because that is one of the uses for it. */ + if ( pD3DCurrent == pD3DDefault ) + return FALSE; + + SwapBuffersHAL( pD3DCurrent->pShared ); + + return TRUE; +} +/*===========================================================================*/ +/* This should be ok as none of the SwapBuffers will cause a redundant Blt */ +/* as none of my Swap functions will call flush. This should also allow */ +/* sinlge buffered applications to work (not really worried though). Some */ +/* applications may flush then swap but then this is there fault IMHO. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void Flush( GLcontext *ctx ) +{ + /* Fall through for the default because that is one of the uses for it. */ + if ( pD3DCurrent == pD3DDefault ) + return; + + SwapBuffersHAL( pD3DCurrent->pShared ); +} +/*===========================================================================*/ +/* For now this function will ignore the supplied PF. If I'm going to allow */ +/* the user to choice the mode and device at startup I'm going to have to do */ +/* something different. */ +/* */ +/* TODO: use the linked list of modes to build a pixel format to be returned */ +/* to the caller. */ +/*===========================================================================*/ +/* RETURN: 1. */ +/*===========================================================================*/ +int APIENTRY wglChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd ) +{ + return 1; +} +/*===========================================================================*/ +/* See wglChoosePixelFormat. */ +/*===========================================================================*/ +/* RETURN: 1. */ +/*===========================================================================*/ +int APIENTRY ChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd ) +{ + return wglChoosePixelFormat(hdc,ppfd); +} +/*===========================================================================*/ +/* This function (for now) returns a static PF everytime. This is just to */ +/* allow things to continue. */ +/*===========================================================================*/ +/* RETURN: 1. */ +/*===========================================================================*/ +int APIENTRY wglDescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd ) +{ + static PIXELFORMATDESCRIPTOR pfd = + { + sizeof(PIXELFORMATDESCRIPTOR), /* size */ + 1, /* version */ + PFD_SUPPORT_OPENGL | + PFD_DRAW_TO_WINDOW | + PFD_DOUBLEBUFFER, /* support double-buffering */ + PFD_TYPE_RGBA, /* color type */ + 16, /* prefered color depth */ + 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ + 0, /* no alpha buffer */ + 0, /* alpha bits (ignored) */ + 0, /* no accumulation buffer */ + 0, 0, 0, 0, /* accum bits (ignored) */ + 16, /* depth buffer */ + 0, /* no stencil buffer */ + 0, /* no auxiliary buffers */ + PFD_MAIN_PLANE, /* main layer */ + 0, /* reserved */ + 0, 0, 0, /* no layer, visible, damage masks */ + }; + + /* Return the address of this static PF if one was requested. */ + if ( ppfd != NULL ) + memcpy( ppfd, &pfd, sizeof(PIXELFORMATDESCRIPTOR) ); + + return 1; +} +/*===========================================================================*/ +/* See wglDescribePixelFormat. */ +/*===========================================================================*/ +/* RETURN: 1. */ +/*===========================================================================*/ +int APIENTRY DescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd ) +{ + return wglDescribePixelFormat(hdc,iPixelFormat,nBytes,ppfd); +} +/*===========================================================================*/ +/* This function will always return 1 for now. Just to allow for support. */ +/*===========================================================================*/ +/* RETURN: 1. */ +/*===========================================================================*/ +int APIENTRY wglGetPixelFormat( HDC hdc ) +{ + return 1; +} +/*===========================================================================*/ +/* See wglGetPixelFormat. */ +/*===========================================================================*/ +/* RETURN: 1. */ +/*===========================================================================*/ +int APIENTRY GetPixelFormat( HDC hdc ) +{ + return wglGetPixelFormat(hdc); +} +/*===========================================================================*/ +/* This will aways work for now. */ +/*===========================================================================*/ +/* RETURN: TRUE. */ +/*===========================================================================*/ +BOOL APIENTRY wglSetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd ) +{ + return TRUE; +} +/*===========================================================================*/ +/* See wglSetPixelFormat. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY SetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd ) +{ + return wglSetPixelFormat(hdc,iPixelFormat,ppfd); +} +/*===========================================================================*/ +/* This is a wrapper function that is supported by my own internal function.*/ +/* that takes my own D3D Mesa context structure. This so I can reuse the */ +/* function (no need for speed). */ +/*===========================================================================*/ +/* RETURN: TRUE. */ +/*===========================================================================*/ +BOOL APIENTRY wglDeleteContext( HGLRC hglrc ) +{ + DestroyContext( (D3DMESACONTEXT *)hglrc ); + + return TRUE; +} +/*===========================================================================*/ +/* Simple getter function that uses a cast. */ +/*===========================================================================*/ +/* RETURN: casted pointer to the context, NULL. */ +/*===========================================================================*/ +HGLRC APIENTRY wglGetCurrentContext( VOID ) +{ + return (pD3DCurrent) ? (HGLRC)pD3DCurrent : (HGLRC)NULL; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) +{ + SetLastError( 0 ); + return FALSE; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: NULL. */ +/*===========================================================================*/ +HGLRC APIENTRY wglCreateLayerContext( HDC hdc,int iLayerPlane ) +{ + SetLastError( 0 ); + return (HGLRC)NULL; +} +/*===========================================================================*/ +/* Simple getter function. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +HDC APIENTRY wglGetCurrentDC( VOID ) +{ + return (pD3DCurrent) ? pD3DCurrent->hdc : (HDC)NULL; +} +/*===========================================================================*/ +/* Simply call that searches the supported extensions for a match & returns */ +/* the pointer to the function that lends support. */ +/*===========================================================================*/ +/* RETURN: pointer to API call, NULL. */ +/*===========================================================================*/ +PROC APIENTRY wglGetProcAddress( LPCSTR lpszProc ) +{ + int index; + + for( index = 0; index < qt_ext; index++ ) + if( !strcmp(lpszProc,ext[index].name) ) + return ext[index].proc; + + SetLastError( 0 ); + return NULL; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglShareLists( HGLRC hglrc1, HGLRC hglrc2 ) +{ + SetLastError( 0 ); + return FALSE; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglUseFontBitmaps( HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase ) +{ + SetLastError( 0 ); + return FALSE; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglUseFontBitmapsW( HDC hdc,DWORD first,DWORD count,DWORD listBase ) +{ + SetLastError( 0 ); + return FALSE; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglUseFontOutlinesA( HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf ) +{ + SetLastError( 0 ); + return FALSE; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglUseFontOutlinesW( HDC hdc,DWORD first,DWORD count, DWORD listBase,FLOAT deviation, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf ) +{ + SetLastError( 0 ); + return FALSE ; +} +/*===========================================================================*/ +/* No support. */ +/*===========================================================================*/ +/* RETURN: FALSE. */ +/*===========================================================================*/ +BOOL APIENTRY wglSwapLayerBuffers( HDC hdc, UINT fuPlanes ) +{ + SetLastError( 0 ); + return FALSE; +} +/*===========================================================================*/ +/* This function will be hooked into the window that has been bound. Right */ +/* now it is used to track the window size and position. Also the we clean */ +/* up the currrent context when the window is close/destroyed. */ +/* */ +/* TODO: there might be something wrong here as some games (Heretic II) don't*/ +/* track the window quit right. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam ) +{ + WNDPROC hOldProc; + GLint width, + height; + + switch( message ) + { +// case WM_PAINT: +// break; +// case WM_ACTIVATE: +// break; +// case WM_SHOWWINDOW: +// break; + + case UM_FATALSHUTDOWN: + /* Support the API until we die... */ + MakeCurrent( pD3DDefault ); + break; + + case WM_MOVE: + case WM_DISPLAYCHANGE: + case WM_SIZE: + ResizeContext( pD3DCurrent->gl_ctx ); + break; + + case WM_CLOSE: + case WM_DESTROY: + /* Support the API until we die... */ + hOldProc = pD3DCurrent->hOldProc; + DestroyContext( pD3DCurrent ); + return (hOldProc)(hwnd,message,wParam,lParam); + } + + return (pD3DCurrent->hOldProc)(hwnd,message,wParam,lParam); +} + +/**********************************************************************/ +/***** Miscellaneous device driver funcs *****/ +/**********************************************************************/ + +/*===========================================================================*/ +/* Not reacting to this as I'm only supporting drawing to the back buffer */ +/* right now. */ +/*===========================================================================*/ +/* RETURN: TRUE. */ +/*===========================================================================*/ +static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer ) +{ + if (buffer == GL_BACK_LEFT) + return GL_TRUE; + else + return GL_FALSE; +} +/*===========================================================================*/ +/* This proc will be called by Mesa when the viewport has been set. So if */ +/* we have a context and it isn't the default then we should let D3D know of */ +/* the change. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + RECT rect; + + /* Make sure we can set a viewport. */ + if ( pContext->pShared && (pContext != pD3DDefault) ) + { + // TODO: might be needed. + UpdateScreenPosHAL( pContext->pShared ); + rect.left = x; + rect.right = x + w; + rect.top = y; + rect.bottom = y + h; + + // TODO: shared struct should make this call smaller + SetViewportHAL( pContext->pShared, &rect, 0.0F, 1.0F ); + } +} +/*===========================================================================*/ +/* This function could be better I guess but I decided just to grab the four*/ +/* components and store then seperately. Makes it easier to use IMHO. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + pContext->aClear = a; + pContext->bClear = b; + pContext->gClear = g; + pContext->rClear = r; +} +/*===========================================================================*/ +/* This function could be better I guess but I decided just to grab the four*/ +/* components and store then seperately. Makes it easier to use IMHO. */ +/* (is there an echo in here?) */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + pContext->aCurrent = a; + pContext->bCurrent = b; + pContext->gCurrent = g; + pContext->rCurrent = r; +} +/*===========================================================================*/ +/* */ +/* */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static const char *RendererString( void ) +{ + static char pszRender[64]; + + strcpy( pszRender, "altD3D " ); + + if ( pD3DCurrent->pShared->bHardware ) + strcat( pszRender, "(HW)"); + else + strcat( pszRender, "(SW)"); + + return (const char *)pszRender; +} +/*===========================================================================*/ +/* This function will choose which set of pointers Mesa will use based on */ +/* whether we hard using hardware or software. I have added another set of */ +/* pointers that will do nothing but stop the API from crashing. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void SetupDDPointers( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + // TODO: write a generic NULL support for the span render. + if ( pContext->pShared && pContext->pShared->bHardware ) + { + ctx->Driver.UpdateState = SetupHWDDPointers; + } + else if ( pContext == pD3DDefault ) + { + ctx->Driver.UpdateState = SetupNULLDDPointers; + } + else + { + ctx->Driver.UpdateState = SetupSWDDPointers; + } +} +/*===========================================================================*/ +/* This function will populate all the Mesa driver hooks. This version of */ +/* hooks will do nothing but support the API when we don't have a valid */ +/* context bound. This is mostly for applications that don't behave right */ +/* and also to help exit as clean as possable when we have a FatalError. */ +/*===========================================================================*/ +/* RETURN: pointer to the specific function. */ +/*===========================================================================*/ +static void SetupNULLDDPointers( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + /* Initialize all the pointers in the DD struct. Do this whenever */ + /* a new context is made current or we change buffers via set_buffer! */ + ctx->Driver.UpdateState = SetupNULLDDPointers; + + /* State management hooks. */ + ctx->Driver.Color = NULLSetColor; + ctx->Driver.ClearColor = NULLClearColor; + ctx->Driver.Clear = NULLClearBuffers; + ctx->Driver.SetBuffer = NULLSetBuffer; + + /* Window management hooks. */ + ctx->Driver.GetBufferSize = NULLGetBufferSize; + + /* Primitive rendering hooks. */ + ctx->Driver.TriangleFunc = NULL; + ctx->Driver.RenderVB = NULL; + + /* Pixel/span writing functions: */ + ctx->Driver.WriteRGBASpan = NULLWrSpRGBA; + ctx->Driver.WriteRGBSpan = NULLWrSpRGB; + ctx->Driver.WriteMonoRGBASpan = NULLWrSpRGBAMono; + ctx->Driver.WriteRGBAPixels = NULLWrPiRGBA; + ctx->Driver.WriteMonoRGBAPixels = NULLWrPiRGBAMono; + + /* Pixel/span reading functions: */ + ctx->Driver.ReadRGBASpan = NULLReSpRGBA; + ctx->Driver.ReadRGBAPixels = NULLRePiRGBA; + + /* Misc. hooks. */ + ctx->Driver.RendererString = RendererString; +} +/*===========================================================================*/ +/* This function will populate all the Mesa driver hooks. There are two of */ +/* these functions. One if we have hardware support and one is there is only*/ +/* software. These functions will be called by Mesa and by the wgl.c when we*/ +/* have resized (or created) the buffers. The thing is that if a window gets*/ +/* resized we may loose hardware support or gain it... */ +/*===========================================================================*/ +/* RETURN: pointer to the specific function. */ +/*===========================================================================*/ +static void SetupSWDDPointers( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + /* Initialize all the pointers in the DD struct. Do this whenever */ + /* a new context is made current or we change buffers via set_buffer! */ + ctx->Driver.UpdateState = SetupSWDDPointers; + + /* State management hooks. */ + ctx->Driver.Color = SetColor; + ctx->Driver.ClearColor = ClearColor; + ctx->Driver.Clear = ClearBuffers; + ctx->Driver.SetBuffer = SetBuffer; + + /* Window management hooks. */ + ctx->Driver.GetBufferSize = GetBufferSize; + ctx->Driver.Viewport = SetViewport; + + /* Primitive rendering hooks. */ + ctx->Driver.TriangleFunc = NULL; + ctx->Driver.RenderVB = NULL; + + /* Texture management hooks. */ + + /* Pixel/span writing functions: */ + ctx->Driver.WriteRGBASpan = WSpanRGBA; + ctx->Driver.WriteRGBSpan = WSpanRGB; + ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono; + ctx->Driver.WriteRGBAPixels = WPixelsRGBA; + ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono; + + /* Pixel/span reading functions: */ + ctx->Driver.ReadRGBASpan = RSpanRGBA; + ctx->Driver.ReadRGBAPixels = RPixelsRGBA; + + /* Misc. hooks. */ + ctx->Driver.Flush = Flush; + ctx->Driver.RendererString = RendererString; +} +/*===========================================================================*/ +/* This function will populate all the Mesa driver hooks. There are two of */ +/* these functions. One if we have hardware support and one is there is only*/ +/* software. These functions will be called by Mesa and by the wgl.c when we*/ +/* have resized (or created) the buffers. The thing is that if a window gets*/ +/* resized we may loose hardware support or gain it... */ +/*===========================================================================*/ +/* RETURN: pointer to the specific function. */ +/*===========================================================================*/ +static void SetupHWDDPointers( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + /* Initialize all the pointers in the DD struct. Do this whenever */ + /* a new context is made current or we change buffers via set_buffer! */ + ctx->Driver.UpdateState = SetupHWDDPointers; + + /* State management hooks. */ + ctx->Driver.Color = SetColor; + ctx->Driver.ClearColor = ClearColor; + ctx->Driver.Clear = ClearBuffersD3D; + ctx->Driver.SetBuffer = SetBuffer; + + /* Window management hooks. */ + ctx->Driver.GetBufferSize = GetBufferSize; + ctx->Driver.Viewport = SetViewport; + + /* Primitive rendering hooks. */ + ctx->Driver.TriangleFunc = RenderOneTriangle; + ctx->Driver.LineFunc = RenderOneLine; + ctx->Driver.RenderVB = RenderVertexBuffer; + + /* Pixel/span writing functions: */ + ctx->Driver.WriteRGBASpan = WSpanRGBA; + ctx->Driver.WriteRGBSpan = WSpanRGB; + ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono; + ctx->Driver.WriteRGBAPixels = WPixelsRGBA; + ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono; + + /* Pixel/span reading functions: */ + ctx->Driver.ReadRGBASpan = RSpanRGBA; + ctx->Driver.ReadRGBAPixels = RPixelsRGBA; + + /* Texture management hooks. */ + // ctx->Driver.BindTexture = TextureBind; + ctx->Driver.TexImage = TextureLoad; + ctx->Driver.TexSubImage = TextureSubImage; + + /* Misc. hooks. */ + ctx->Driver.Flush = Flush; + ctx->Driver.RendererString = RendererString; +} +/*===========================================================================*/ +/* This function will release all resources used by the DLL. Every context */ +/* will be clobbered by releaseing all driver desources and then freeing the */ +/* context memory. Most all the work is done in DestroyContext. */ +/*===========================================================================*/ +/* RETURN: TRUE. */ +/*===========================================================================*/ +static BOOL TermOpenGL( HINSTANCE hInst ) +{ + D3DMESACONTEXT *pTmp, + *pNext; + + /* Just incase we are still getting paint msg. */ + MakeCurrent( pD3DDefault ); + + /* Walk the list until we get back to the default context. */ + for( pTmp = pD3DDefault->next; pTmp != pD3DDefault; pTmp = pNext ) + { + pNext = pTmp->next; + DestroyContext( pTmp ); + } + DestroyContext( pD3DDefault ); + + return TRUE; +} +/*===========================================================================*/ +/* This function is an internal function that will clean up all the Mesa */ +/* context bound to this D3D context. Also any D3D stuff that this context */ +/* uses will be unloaded. */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static void DestroyContext( D3DMESACONTEXT *pContext ) +{ + D3DMESACONTEXT *pTmp; + + /* Walk the list until we find the context before this one. */ + for( pTmp = pD3DDefault; pTmp && (pTmp->next != pContext); pTmp = pTmp->next ) + if ( pTmp == pTmp->next ) + break; + + /* If we never found it it must already be deleted. */ + if ( pTmp->next != pContext ) + return; + + /* Make sure we are not using this context. */ + if ( pContext == pD3DCurrent ) + MakeCurrent( pD3DDefault ); + + /* Free the Mesa stuff. */ + if ( pContext->gl_visual ) + { + _mesa_destroy_visual( pContext->gl_visual ); + pContext->gl_visual = NULL; + } + if ( pContext->gl_buffer ) + { + _mesa_destroy_framebuffer( pContext->gl_buffer ); + pContext->gl_buffer = NULL; + } + if ( pContext->gl_ctx ) + { + _mesa_destroy_context( pContext->gl_ctx ); + pContext->gl_ctx = NULL; + } + + /* Now dump the D3D. */ + if ( pContext->pShared ) + TermHAL( pContext->pShared ); + + /* Update the previous context's link. */ + pTmp->next = pContext->next; + + /* Gonzo. */ + FREE( pContext ); +} +/*===========================================================================*/ +/* This function will pull the supplied context away from Win32. Basicly it*/ +/* will remove the hook from the window Proc. */ +/* */ +/* TODO: might want to serialize this stuff... */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static BOOL UnBindWindow( D3DMESACONTEXT *pContext ) +{ + if ( pContext == NULL ) + return FALSE; + + if ( pContext == pD3DDefault ) + return TRUE; + + /* Make sure we always have a context bound. */ + if ( pContext == pD3DCurrent ) + pD3DCurrent = pD3DDefault; + + SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)pContext->hOldProc ); + pContext->hOldProc = NULL; + + return TRUE; +} +/*===========================================================================*/ +/* There are two cases that allow for a faster clear when we know that the */ +/* whole buffer is cleared and that there is no clipping. */ +/*===========================================================================*/ +/* RETURN: the original mask with the bits cleared that represents the buffer* +/* or buffers we just cleared. */ +/*===========================================================================*/ +GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DWORD dwFlags = 0; + + if ( mask & GL_COLOR_BUFFER_BIT ) + { + dwFlags |= D3DCLEAR_TARGET; + mask &= ~GL_COLOR_BUFFER_BIT; + } + if ( mask & GL_DEPTH_BUFFER_BIT ) + { + dwFlags |= D3DCLEAR_ZBUFFER; + mask &= ~GL_DEPTH_BUFFER_BIT; + } + if ( dwFlags == 0 ) + return mask; + + ClearHAL( pContext->pShared, + dwFlags, + all, + x, y, + width, height, + ((pContext->aClear<<24) | (pContext->rClear<<16) | (pContext->gClear<<8) | (pContext->bClear)), + ctx->Depth.Clear, + 0 ); + + return mask; +} + + + +/*===========================================================================*/ +/* TEXTURE MANAGER: ok here is how I did textures. Mesa-3.0 will keep track*/ +/* of all the textures for us. So this means that at anytime we can go to */ +/* the Mesa context and get the current texture. With this in mind this is */ +/* what I did. I really don't care about what textures get or are loaded */ +/* until I actually have to draw a tri that is textured. At this point I */ +/* must have the texture so I demand the texture by destorying all other */ +/* texture surfaces if need be and load the current one. This allows for the*/ +/* best preformance on low memory cards as time is not wasted loading and */ +/* unload textures. */ +/*===========================================================================*/ + + + + + +/*===========================================================================*/ +/* TextureLoad will try and create a D3D surface from the supplied texture */ +/* object if its level 0 (first). The surface will be fully filled with the */ +/* texture. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + /* TODO: only doing first LOD. */ + if ( (ctx->DriverCtx == NULL) || (level != 0) ) + return; + + CreateTMgrHAL( pContext->pShared, + tObj->Name, + level, + tObj->Image[level]->Format, + (RECT *)NULL, + tObj->Image[level]->Width, + tObj->Image[level]->Height, + TM_ACTION_LOAD, + (void *)tObj->Image[level]->Data ); +} +/*===========================================================================*/ +/* TextureBind make sure that the texture is on the card. Thats it. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + + /* TODO: only doing first LOD. */ + if ( (tObj->Image[0] == NULL) || (ctx->DriverCtx == NULL) ) + return; + + CreateTMgrHAL( pContext->pShared, + tObj->Name, + 0, + tObj->Image[0]->Format, + (RECT *)NULL, + tObj->Image[0]->Width, + tObj->Image[0]->Height, + TM_ACTION_BIND, + (void *)tObj->Image[0]->Data ); +} +/*===========================================================================*/ +/* TextureSubImage will make sure that the texture being updated is updated */ +/* if its on the card. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + RECT rect; + + /* TODO: only doing first LOD. */ + if ( (ctx->DriverCtx == NULL) || (level > 0) ) + return; + + /* Create a dirty rectangle structure. */ + rect.left = xoffset; + rect.right = xoffset + width; + rect.top = yoffset; + rect.bottom = yoffset + height; + + CreateTMgrHAL( pContext->pShared, + tObj->Name, + 0, + tObj->Image[0]->Format, + &rect, + tObj->Image[0]->Width, + tObj->Image[0]->Height, + TM_ACTION_UPDATE, + (void *)tObj->Image[0]->Data ); +} + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,982 @@ +/* + * Copyright (C) 2004-2007 Claudio Ciccani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * Based on glfbdev.c, written by Brian Paul. + * + */ + +#include +#include +#include + +#include + +#include +#include + +#include + +#include +#include +#include + +#undef CLAMP +#include "main/glheader.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/imports.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texstore.h" +#include "vbo/vbo.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" + + +#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r))) +#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ + DIRECTFB_MINOR_VERSION, \ + DIRECTFB_MICRO_VERSION ) + + +static DFBResult +Probe( void *data ); + +static DFBResult +Construct( IDirectFBGL *thiz, + IDirectFBSurface *surface ); + +#include + +DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa ) + +/* + * private data struct of IDirectFBGL + */ +typedef struct { + int ref; /* reference counter */ + + int locked; + + IDirectFBSurface *surface; + DFBSurfacePixelFormat format; + int width; + int height; + + struct { + GLubyte *start; + GLubyte *end; + int pitch; + } video; + + GLvisual visual; + GLframebuffer framebuffer; + GLcontext context; + struct gl_renderbuffer render; +} IDirectFBGL_data; + +/******************************************************************************/ + +static pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER; +static unsigned int global_ref = 0; + +static INLINE int directfbgl_init( void ) +{ + pthread_mutexattr_t attr; + int ret; + + if (global_ref++) + return 0; + + pthread_mutexattr_init( &attr ); + pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK ); + ret = pthread_mutex_init( &global_lock, &attr ); + pthread_mutexattr_destroy( &attr ); + + return ret; +} + +static INLINE void directfbgl_finish( void ) +{ + if (--global_ref == 0) + pthread_mutex_destroy( &global_lock ); +} + +#define directfbgl_lock() pthread_mutex_lock( &global_lock ) +#define directfbgl_unlock() pthread_mutex_unlock( &global_lock ) + +/******************************************************************************/ + +static bool directfbgl_init_visual ( GLvisual *visual, + DFBSurfacePixelFormat format ); +static bool directfbgl_create_context ( GLcontext *context, + GLframebuffer *framebuffer, + GLvisual *visual, + IDirectFBGL_data *data ); +static void directfbgl_destroy_context( GLcontext *context, + GLframebuffer *framebuffer ); + +/******************************************************************************/ + + +static void +IDirectFBGL_Mesa_Destruct( IDirectFBGL *thiz ) +{ + IDirectFBGL_data *data = (IDirectFBGL_data*) thiz->priv; + + directfbgl_destroy_context( &data->context, &data->framebuffer ); + + if (data->surface) + data->surface->Release( data->surface ); + + DIRECT_DEALLOCATE_INTERFACE( thiz ); + + directfbgl_finish(); +} + +static DFBResult +IDirectFBGL_Mesa_AddRef( IDirectFBGL *thiz ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + data->ref++; + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Mesa_Release( IDirectFBGL *thiz ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ) + + if (--data->ref == 0) + IDirectFBGL_Mesa_Destruct( thiz ); + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz ) +{ + IDirectFBSurface *surface; + int width = 0; + int height = 0; + DFBResult ret; + + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (data->locked) { + data->locked++; + return DFB_OK; + } + + if (directfbgl_lock()) + return DFB_LOCKED; + + surface = data->surface; + surface->GetSize( surface, &width, &height ); + + ret = surface->Lock( surface, DSLF_READ | DSLF_WRITE, + (void*)&data->video.start, &data->video.pitch ); + if (ret) { + D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" ); + directfbgl_unlock(); + return ret; + } + data->video.end = data->video.start + (height-1) * data->video.pitch; + + data->render.Data = data->video.start; + + _mesa_make_current( &data->context, + &data->framebuffer, &data->framebuffer ); + + if (data->width != width || data->height != height) { + _mesa_resize_framebuffer( &data->context, + &data->framebuffer, width, height ); + data->width = width; + data->height = height; + } + + data->locked++; + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Mesa_Unlock( IDirectFBGL *thiz ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (!data->locked) + return DFB_OK; + + if (--data->locked == 0) { + _mesa_make_current( NULL, NULL, NULL ); + + data->surface->Unlock( data->surface ); + + directfbgl_unlock(); + } + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Mesa_GetAttributes( IDirectFBGL *thiz, + DFBGLAttributes *attributes ) +{ + DFBSurfaceCapabilities caps; + GLvisual *visual; + + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (!attributes) + return DFB_INVARG; + + data->surface->GetCapabilities( data->surface, &caps ); + + visual = &data->visual; + + attributes->buffer_size = visual->rgbBits ? : visual->indexBits; + attributes->depth_size = visual->depthBits; + attributes->stencil_size = visual->stencilBits; + attributes->aux_buffers = visual->numAuxBuffers; + attributes->red_size = visual->redBits; + attributes->green_size = visual->greenBits; + attributes->blue_size = visual->blueBits; + attributes->alpha_size = visual->alphaBits; + attributes->accum_red_size = visual->accumRedBits; + attributes->accum_green_size = visual->accumGreenBits; + attributes->accum_blue_size = visual->accumBlueBits; + attributes->accum_alpha_size = visual->accumAlphaBits; + attributes->double_buffer = ((caps & DSCAPS_FLIPPING) != 0); + attributes->stereo = (visual->stereoMode != 0); + + return DFB_OK; +} + +#if DIRECTFBGL_INTERFACE_VERSION >= 1 +static DFBResult +IDirectFBGL_Mesa_GetProcAddress( IDirectFBGL *thiz, + const char *name, + void **ret_address ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (!name) + return DFB_INVARG; + + if (!ret_address) + return DFB_INVARG; + + *ret_address = _glapi_get_proc_address( name ); + + return (*ret_address) ? DFB_OK : DFB_UNSUPPORTED; +} +#endif + + +/* exported symbols */ + +static DFBResult +Probe( void *data ) +{ + return DFB_OK; +} + +static DFBResult +Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) +{ + DFBResult ret; + + /* Initialize global resources. */ + if (directfbgl_init()) + return DFB_INIT; + + /* Allocate interface data. */ + DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL ); + + /* Initialize interface data. */ + data->ref = 1; + + /* Duplicate destination surface. */ + ret = surface->GetSubSurface( surface, NULL, &data->surface ); + if (ret) { + IDirectFBGL_Mesa_Destruct( thiz ); + return ret; + } + + data->surface->GetPixelFormat( data->surface, &data->format ); + data->surface->GetSize( data->surface, &data->width, &data->height ); + + /* Configure visual. */ + if (!directfbgl_init_visual( &data->visual, data->format )) { + D_ERROR( "DirectFBGL/Mesa: failed to initialize visual.\n" ); + IDirectFBGL_Mesa_Destruct( thiz ); + return DFB_UNSUPPORTED; + } + + /* Create context. */ + if (!directfbgl_create_context( &data->context, + &data->framebuffer, + &data->visual, data )) { + D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" ); + IDirectFBGL_Mesa_Destruct( thiz ); + return DFB_UNSUPPORTED; + } + + /* Assign interface pointers. */ + thiz->AddRef = IDirectFBGL_Mesa_AddRef; + thiz->Release = IDirectFBGL_Mesa_Release; + thiz->Lock = IDirectFBGL_Mesa_Lock; + thiz->Unlock = IDirectFBGL_Mesa_Unlock; + thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes; +#if DIRECTFBGL_INTERFACE_VERSION >= 1 + thiz->GetProcAddress = IDirectFBGL_Mesa_GetProcAddress; +#endif + + return DFB_OK; +} + + +/***************************** Driver functions ******************************/ + +static const GLubyte* +dfbGetString( GLcontext *ctx, GLenum pname ) +{ + return NULL; +} + +static void +dfbUpdateState( GLcontext *ctx, GLuint new_state ) +{ + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _vbo_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); +} + +static void +dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height ) +{ + GLcontext *ctx = _mesa_get_current_context(); + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; + + *width = (GLuint) data->width; + *height = (GLuint) data->height; +} + +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ +static void +dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) +{ + /* Nothing to do (the surface can't be resized while it's locked). */ + return; +} + +static void +dfbClear( GLcontext *ctx, GLbitfield mask ) +{ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; + +#define BUFFER_BIT_MASK (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT | \ + BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT ) + if (mask & BUFFER_BIT_MASK && + ctx->Color.ColorMask[0] && + ctx->Color.ColorMask[1] && + ctx->Color.ColorMask[2] && + ctx->Color.ColorMask[3]) + { + DFBRegion clip; + GLubyte a, r, g, b; + + UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] ); + UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] ); + UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] ); + UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] ); + + clip.x1 = ctx->DrawBuffer->_Xmin; + clip.y1 = ctx->DrawBuffer->_Ymin; + clip.x2 = ctx->DrawBuffer->_Xmax - 1; + clip.y2 = ctx->DrawBuffer->_Ymax - 1; + data->surface->SetClip( data->surface, &clip ); + + data->surface->Unlock( data->surface ); + + data->surface->Clear( data->surface, r, g, b, a ); + + data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE, + (void*)&data->video.start, &data->video.pitch ); + data->video.end = data->video.start + (data->height-1) * data->video.pitch; + data->render.Data = data->video.start; + + mask &= ~BUFFER_BIT_MASK; + } +#undef BUFFER_BIT_MASK + + if (mask) + _swrast_Clear( ctx, mask ); +} + + +/************************ RenderBuffer functions *****************************/ + +static void +dfbDeleteRenderbuffer( struct gl_renderbuffer *render ) +{ + return; +} + +static GLboolean +dfbRenderbufferStorage( GLcontext *ctx, struct gl_renderbuffer *render, + GLenum internalFormat, GLuint width, GLuint height ) +{ + return GL_TRUE; +} + + +/***************************** Span functions ********************************/ + +/* RGB332 */ +#define NAME(PREFIX) PREFIX##_RGB332 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = data->video.end - (Y) * data->video.pitch + (X); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[RCOMP]) & 0xe0) ) | \ + (((S[GCOMP]) & 0xe0) >> 3) | \ + (((S[BCOMP]) ) >> 6) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0xe0) ); \ + D[GCOMP] = ((*P & 0x1c) << 3); \ + D[BCOMP] = ((*P & 0x03) << 6); \ + D[ACOMP] = 0xff + +#include "swrast/s_spantemp.h" + +/* ARGB4444 */ +#define NAME(PREFIX) PREFIX##_ARGB4444 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL_RGB(P, X, Y, S) \ + *P = ( 0xf000 | \ + (((S[RCOMP]) & 0xf0) << 4) | \ + (((S[GCOMP]) & 0xf0) ) | \ + (((S[BCOMP]) & 0xf0) >> 4) ) +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[ACOMP]) & 0xf0) << 8) | \ + (((S[RCOMP]) & 0xf0) << 4) | \ + (((S[GCOMP]) & 0xf0) ) | \ + (((S[BCOMP]) & 0xf0) >> 4) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x0f00) >> 4) | ((*P & 0x0f00) >> 8); \ + D[GCOMP] = ((*P & 0x00f0) ) | ((*P & 0x00f0) >> 4); \ + D[BCOMP] = ((*P & 0x000f) << 4) | ((*P & 0x000f) ); \ + D[ACOMP] = ((*P & 0xf000) >> 8) | ((*P & 0xf000) >> 12) + +#include "swrast/s_spantemp.h" + +/* RGB444 */ +#define NAME(PREFIX) PREFIX##_RGB444 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[RCOMP]) & 0xf0) << 4) | \ + (((S[GCOMP]) & 0xf0) ) | \ + (((S[BCOMP]) & 0xf0) >> 4) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x0f00) >> 4) | ((*P & 0x0f00) >> 8); \ + D[GCOMP] = ((*P & 0x00f0) ) | ((*P & 0x00f0) >> 4); \ + D[BCOMP] = ((*P & 0x000f) << 4) | ((*P & 0x000f) ); \ + D[ACOMP] = 0xff + +#include "swrast/s_spantemp.h" + +/* ARGB2554 */ +#define NAME(PREFIX) PREFIX##_ARGB2554 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL_RGB(P, X, Y, S) \ + *P = ( 0xc000 | \ + (((S[RCOMP]) & 0xf8) << 6) | \ + (((S[GCOMP]) & 0xf8) << 1) | \ + (((S[BCOMP]) & 0xf0) >> 4) ) +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[ACOMP]) & 0xc0) << 8) | \ + (((S[RCOMP]) & 0xf8) << 6) | \ + (((S[GCOMP]) & 0xf8) << 1) | \ + (((S[BCOMP]) & 0xf0) >> 4) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x3e00) >> 9); \ + D[GCOMP] = ((*P & 0x01f0) >> 4); \ + D[BCOMP] = ((*P & 0x000f) << 4); \ + D[ACOMP] = ((*P & 0xc000) >> 14) + +#include "swrast/s_spantemp.h" + +/* ARGB1555 */ +#define NAME(PREFIX) PREFIX##_ARGB1555 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL_RGB(P, X, Y, S) \ + *P = ( 0x8000 | \ + (((S[RCOMP]) & 0xf8) << 7) | \ + (((S[GCOMP]) & 0xf8) << 2) | \ + (((S[BCOMP]) ) >> 3) ) +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[ACOMP]) & 0x80) << 16) | \ + (((S[RCOMP]) & 0xf8) << 7) | \ + (((S[GCOMP]) & 0xf8) << 2) | \ + (((S[BCOMP]) ) >> 3) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x7c00) >> 7) | ((*P & 0x7c00) >> 12); \ + D[GCOMP] = ((*P & 0x03e0) >> 2) | ((*P & 0x03e0) >> 7); \ + D[BCOMP] = ((*P & 0x001f) << 3) | ((*P & 0x001f) << 2); \ + D[ACOMP] = ((*P & 0x8000) ? 0xff : 0) + +#include "swrast/s_spantemp.h" + +/* RGB555 */ +#define NAME(PREFIX) PREFIX##_RGB555 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[RCOMP]) & 0xf8) << 7) | \ + (((S[GCOMP]) & 0xf8) << 2) | \ + (((S[BCOMP]) ) >> 3) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x7c00) >> 7) | ((*P & 0x7c00) >> 12); \ + D[GCOMP] = ((*P & 0x03e0) >> 2) | ((*P & 0x03e0) >> 7); \ + D[BCOMP] = ((*P & 0x001f) << 3) | ((*P & 0x001f) << 2); \ + D[ACOMP] = 0xff + +#include "swrast/s_spantemp.h" + +/* RGB16 */ +#define NAME(PREFIX) PREFIX##_RGB16 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[RCOMP]) & 0xf8) << 8) | \ + (((S[GCOMP]) & 0xfc) << 3) | \ + (((S[BCOMP]) ) >> 3) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0xf800) >> 8) | ((*P & 0xf800) >> 13); \ + D[GCOMP] = ((*P & 0x07e0) >> 3) | ((*P & 0x07e0) >> 9); \ + D[BCOMP] = ((*P & 0x001f) << 3) | ((*P & 0x001f) >> 2); \ + D[ACOMP] = 0xff + +#include "swrast/s_spantemp.h" + +/* RGB24 */ +#define NAME(PREFIX) PREFIX##_RGB24 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3; +#define INC_PIXEL_PTR(P) P += 3 +#define STORE_PIXEL(P, X, Y, S) \ + P[0] = S[BCOMP]; P[1] = S[GCOMP]; P[2] = S[BCOMP] +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = P[2]; D[GCOMP] = P[1]; D[BCOMP] = P[0]; D[ACOMP] = 0xff + +#include "swrast/s_spantemp.h" + +/* RGB32 */ +#define NAME(PREFIX) PREFIX##_RGB32 +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( ((S[RCOMP]) << 16) | \ + ((S[GCOMP]) << 8) | \ + ((S[BCOMP]) ) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x00ff0000) >> 16); \ + D[GCOMP] = ((*P & 0x0000ff00) >> 8); \ + D[BCOMP] = ((*P & 0x000000ff) ); \ + D[ACOMP] = 0xff + +#include "swrast/s_spantemp.h" + +/* ARGB */ +#define NAME(PREFIX) PREFIX##_ARGB +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL_RGB(P, X, Y, S) \ + *P = ( 0xff000000 | \ + ((S[RCOMP]) << 16) | \ + ((S[GCOMP]) << 8) | \ + ((S[BCOMP]) ) ) +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( ((S[ACOMP]) << 24) | \ + ((S[RCOMP]) << 16) | \ + ((S[GCOMP]) << 8) | \ + ((S[BCOMP]) ) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x00ff0000) >> 16); \ + D[GCOMP] = ((*P & 0x0000ff00) >> 8); \ + D[BCOMP] = ((*P & 0x000000ff) ); \ + D[ACOMP] = ((*P & 0xff000000) >> 24) + +#include "swrast/s_spantemp.h" + +/* AiRGB */ +#define NAME(PREFIX) PREFIX##_AiRGB +#define FORMAT GL_RGBA8 +#define RB_TYPE GLubyte +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4); +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_PIXEL_RGB(P, X, Y, S) \ + *P = ( ((S[RCOMP]) << 16) | \ + ((S[GCOMP]) << 8) | \ + ((S[BCOMP]) ) ) +#define STORE_PIXEL(P, X, Y, S) \ + *P = ( (((S[ACOMP]) ^ 0xff) << 24) | \ + (((S[RCOMP]) ) << 16) | \ + (((S[GCOMP]) ) << 8) | \ + (((S[BCOMP]) ) ) ) +#define FETCH_PIXEL(D, P) \ + D[RCOMP] = ((*P & 0x00ff0000) >> 16); \ + D[GCOMP] = ((*P & 0x0000ff00) >> 8); \ + D[BCOMP] = ((*P & 0x000000ff) ); \ + D[ACOMP] = (((*P & 0xff000000) >> 24) ^ 0xff) + +#include "swrast/s_spantemp.h" + + +/*****************************************************************************/ + +static bool +directfbgl_init_visual( GLvisual *visual, + DFBSurfacePixelFormat format ) +{ + GLboolean rgbFlag = GL_TRUE; + GLboolean dbFlag = GL_FALSE; + GLboolean stereoFlag = GL_FALSE; + GLint redBits = 0; + GLint blueBits = 0; + GLint greenBits = 0; + GLint alphaBits = 0; + GLint indexBits = 0; + GLint depthBits = 0; + GLint stencilBits = 0; + GLint accumRedBits = 0; + GLint accumGreenBits = 0; + GLint accumBlueBits = 0; + GLint accumAlphaBits = 0; + GLint numSamples = 0; + + /* FIXME: LUT8 support. */ + switch (format) { + case DSPF_RGB332: + redBits = 3; + greenBits = 3; + blueBits = 2; + break; + case DSPF_ARGB4444: + alphaBits = 4; + case DSPF_RGB444: + redBits = 4; + greenBits = 4; + blueBits = 4; + break; + case DSPF_ARGB2554: + alphaBits = 2; + redBits = 5; + greenBits = 5; + blueBits = 4; + break; + case DSPF_ARGB1555: + alphaBits = 1; + case DSPF_RGB555: + redBits = 5; + greenBits = 5; + blueBits = 5; + break; + case DSPF_RGB16: + redBits = 5; + greenBits = 6; + blueBits = 5; + break; + case DSPF_ARGB: + case DSPF_AiRGB: + alphaBits = 8; + case DSPF_RGB24: + case DSPF_RGB32: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + default: + D_WARN( "unsupported pixelformat" ); + return false; + } + + if (rgbFlag) { + accumRedBits = redBits; + accumGreenBits = greenBits; + accumBlueBits = blueBits; + accumAlphaBits = alphaBits; + depthBits = redBits + greenBits + blueBits; + stencilBits = alphaBits; + } else + depthBits = 8; + + return _mesa_initialize_visual( visual, + rgbFlag, dbFlag, stereoFlag, + redBits, greenBits, blueBits, alphaBits, + indexBits, depthBits, stencilBits, + accumRedBits, accumGreenBits, + accumBlueBits, accumAlphaBits, + numSamples ); +} + +static bool +directfbgl_create_context( GLcontext *context, + GLframebuffer *framebuffer, + GLvisual *visual, + IDirectFBGL_data *data ) +{ + struct dd_function_table functions; + + _mesa_initialize_framebuffer( framebuffer, visual ); + + _mesa_init_driver_functions( &functions ); + functions.GetString = dfbGetString; + functions.UpdateState = dfbUpdateState; + functions.GetBufferSize = dfbGetBufferSize; + functions.Viewport = dfbSetViewport; + functions.Clear = dfbClear; + + if (!_mesa_initialize_context( context, visual, NULL, + &functions, (void*) data )) { + D_DEBUG( "DirectFBGL/Mesa: _mesa_initialize_context() failed.\n" ); + _mesa_free_framebuffer_data( framebuffer ); + return false; + } + + _swrast_CreateContext( context ); + _vbo_CreateContext( context ); + _tnl_CreateContext( context ); + _swsetup_CreateContext( context ); + _swsetup_Wakeup( context ); + + _mesa_init_renderbuffer( &data->render, 0 ); + data->render.InternalFormat = GL_RGBA; + data->render._BaseFormat = GL_RGBA; + data->render.DataType = GL_UNSIGNED_BYTE; + data->render.Data = data->video.start; + data->render.Delete = dfbDeleteRenderbuffer; + data->render.AllocStorage = dfbRenderbufferStorage; + + switch (data->format) { + case DSPF_RGB332: + data->render.GetRow = get_row_RGB332; + data->render.GetValues = get_values_RGB332; + data->render.PutRow = put_row_RGB332; + data->render.PutRowRGB = put_row_rgb_RGB332; + data->render.PutMonoRow = put_mono_row_RGB332; + data->render.PutValues = put_values_RGB332; + data->render.PutMonoValues = put_mono_values_RGB332; + break; + case DSPF_ARGB4444: + data->render.GetRow = get_row_ARGB4444; + data->render.GetValues = get_values_ARGB4444; + data->render.PutRow = put_row_ARGB4444; + data->render.PutRowRGB = put_row_rgb_ARGB4444; + data->render.PutMonoRow = put_mono_row_ARGB4444; + data->render.PutValues = put_values_ARGB4444; + data->render.PutMonoValues = put_mono_values_ARGB4444; + break; + case DSPF_RGB444: + data->render.GetRow = get_row_RGB444; + data->render.GetValues = get_values_RGB444; + data->render.PutRow = put_row_RGB444; + data->render.PutRowRGB = put_row_rgb_RGB444; + data->render.PutMonoRow = put_mono_row_RGB444; + data->render.PutValues = put_values_RGB444; + data->render.PutMonoValues = put_mono_values_RGB444; + break; + case DSPF_ARGB2554: + data->render.GetRow = get_row_ARGB2554; + data->render.GetValues = get_values_ARGB2554; + data->render.PutRow = put_row_ARGB2554; + data->render.PutRowRGB = put_row_rgb_ARGB2554; + data->render.PutMonoRow = put_mono_row_ARGB2554; + data->render.PutValues = put_values_ARGB2554; + data->render.PutMonoValues = put_mono_values_ARGB2554; + break; + case DSPF_ARGB1555: + data->render.GetRow = get_row_ARGB1555; + data->render.GetValues = get_values_ARGB1555; + data->render.PutRow = put_row_ARGB1555; + data->render.PutRowRGB = put_row_rgb_ARGB1555; + data->render.PutMonoRow = put_mono_row_ARGB1555; + data->render.PutValues = put_values_ARGB1555; + data->render.PutMonoValues = put_mono_values_ARGB1555; + break; + case DSPF_RGB555: + data->render.GetRow = get_row_RGB555; + data->render.GetValues = get_values_RGB555; + data->render.PutRow = put_row_RGB555; + data->render.PutRowRGB = put_row_rgb_RGB555; + data->render.PutMonoRow = put_mono_row_RGB555; + data->render.PutValues = put_values_RGB555; + data->render.PutMonoValues = put_mono_values_RGB555; + break; + case DSPF_RGB16: + data->render.GetRow = get_row_RGB16; + data->render.GetValues = get_values_RGB16; + data->render.PutRow = put_row_RGB16; + data->render.PutRowRGB = put_row_rgb_RGB16; + data->render.PutMonoRow = put_mono_row_RGB16; + data->render.PutValues = put_values_RGB16; + data->render.PutMonoValues = put_mono_values_RGB16; + break; + case DSPF_RGB24: + data->render.GetRow = get_row_RGB24; + data->render.GetValues = get_values_RGB24; + data->render.PutRow = put_row_RGB24; + data->render.PutRowRGB = put_row_rgb_RGB24; + data->render.PutMonoRow = put_mono_row_RGB24; + data->render.PutValues = put_values_RGB24; + data->render.PutMonoValues = put_mono_values_RGB24; + break; + case DSPF_RGB32: + data->render.GetRow = get_row_RGB32; + data->render.GetValues = get_values_RGB32; + data->render.PutRow = put_row_RGB32; + data->render.PutRowRGB = put_row_rgb_RGB32; + data->render.PutMonoRow = put_mono_row_RGB32; + data->render.PutValues = put_values_RGB32; + data->render.PutMonoValues = put_mono_values_RGB32; + break; + case DSPF_ARGB: + data->render.GetRow = get_row_ARGB; + data->render.GetValues = get_values_ARGB; + data->render.PutRow = put_row_ARGB; + data->render.PutRowRGB = put_row_rgb_ARGB; + data->render.PutMonoRow = put_mono_row_ARGB; + data->render.PutValues = put_values_ARGB; + data->render.PutMonoValues = put_mono_values_ARGB; + break; + case DSPF_AiRGB: + data->render.GetRow = get_row_AiRGB; + data->render.GetValues = get_values_AiRGB; + data->render.PutRow = put_row_AiRGB; + data->render.PutRowRGB = put_row_rgb_AiRGB; + data->render.PutMonoRow = put_mono_row_AiRGB; + data->render.PutValues = put_values_AiRGB; + data->render.PutMonoValues = put_mono_values_AiRGB; + break; + default: + D_BUG( "unexpected pixelformat" ); + return false; + } + + data->render.Width = data->width; + data->render.Height = data->height; + + _mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render ); + + _mesa_add_soft_renderbuffers( framebuffer, + GL_FALSE, + visual->haveDepthBuffer, + visual->haveStencilBuffer, + visual->haveAccumBuffer, + GL_FALSE, + GL_FALSE ); + + TNL_CONTEXT( context )->Driver.RunPipeline = _tnl_run_pipeline; + + _mesa_enable_sw_extensions( context ); + + return true; +} + +static void +directfbgl_destroy_context( GLcontext *context, + GLframebuffer *framebuffer ) +{ + _swsetup_DestroyContext( context ); + _swrast_DestroyContext( context ); + _tnl_DestroyContext( context ); + _vbo_DestroyContext( context ); + //_mesa_free_framebuffer_data( framebuffer ); + _mesa_free_context_data( context ); +} + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/Makefile xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/Makefile --- xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/directfb/Makefile 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,67 @@ +# src/mesa/drivers/directfb/Makefile + +TOP = ../../../.. + +include $(TOP)/configs/current + + +INCLUDE_DIRS = \ + -I$(TOP)/include \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/math \ + -I$(TOP)/src/mesa/tnl \ + -I$(TOP)/src/mesa/shader \ + -I$(TOP)/src/mesa/swrast \ + -I$(TOP)/src/mesa/swrast_setup + +DFB_CFLAGS = $(shell pkg-config --cflags directfb) +DFB_MODULEDIR = $(shell pkg-config --variable=moduledir directfb-internal) + +DIRECTFBGL_MESA_SOURCES = ../common/driverfuncs.c idirectfbgl_mesa.c + +DIRECTFBGL_MESA_OBJECTS = $(DIRECTFBGL_MESA_SOURCES:.c=.o) + +DIRECTFBGL_MESA = libidirectfbgl_mesa.so + +LIBS = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a + + +.c.o: + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DFB_CFLAGS) $< -o $@ + + +default: directfb-libgl directfbgl_mesa + + +# XXX this used to be in src/mesa/Makefile and is probably broken now +directfb-libgl: $(LIBS) + @ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(LIBS) \ + $(GL_LIB_DEPS) + + + +# Mesa DirectFBGL module +directfbgl_mesa: $(DIRECTFBGL_MESA_OBJECTS) + $(CC) -shared $(CFLAGS) $(DIRECTFBGL_MESA_OBJECTS) -o $(DIRECTFBGL_MESA) \ + -Wl,-soname -Wl,$(DIRECTFBGL_MESA) -L$(TOP)/$(LIB_DIR) -lGL -lm + + +install: + @if test -d $(DFB_MODULEDIR); then \ + echo "Installing DirectFBGL module."; \ + else \ + echo "*** Failed to determine DirectFB module's directory."; \ + echo "*** Installation aborted."; \ + exit 1; \ + fi; + test -d $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ || mkdir $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ + install -m 755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ + + +clean: + -rm -f *.o *.so + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/blit.S xpsb-glx-0.19/mesa/src/mesa/drivers/dos/blit.S --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/blit.S 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/blit.S 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,1040 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + + .file "blit.S" + +/* + * extern unsigned int vesa_gran_mask, vesa_gran_shift; + * extern int vl_video_selector; + + * extern void *vl_current_draw_buffer; + * extern int vl_current_stride, vl_current_height; + * extern int vl_current_offset, vl_current_delta; + */ + + .text + +/* Desc: VESA bank switching routine (BIOS) + * + * In : EBX=0, EDX = bank number + * Out : - + * + * Note: thrashes EAX + */ + .p2align 5,,31 +_vesa_swbankBIOS: + movw $0x4f05, %ax + int $0x10 + ret + + .p2align 2,,3 + .global _vesa_swbank +_vesa_swbank: .long _vesa_swbankBIOS + +/* Desc: void vesa_b_dump_virtual (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_b_dump_virtual +_vesa_b_dump_virtual: + cld + pushl %es + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %es + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + shrl $2, %ecx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %eax + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + popl %eax + subl %ebp, %edi + .balign 4 + 2: + movsl + decl %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + popl %es + ret + +/* Desc: void vesa_l_dump_virtual (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_l_dump_virtual +_vesa_l_dump_virtual: + cld + pushl %es + pushl %esi + pushl %edi + movl _vl_video_selector, %es + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %eax + shrl $2, %ecx + .balign 4 + 0: + pushl %ecx + rep; movsl + popl %ecx + addl %eax, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %es + ret + +/* Desc: void vesa_l_dump_virtual_mmx (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_l_dump_virtual_mmx +_vesa_l_dump_virtual_mmx: +#ifdef USE_MMX_ASM + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %eax + shrl $3, %ecx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + movq (%esi), %mm0 + addl $8, %esi + movq %mm0, %fs:(%edi) + addl $8, %edi + decl %ecx + jnz 1b + popl %ecx + addl %eax, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + emms +#endif + ret + + + +#define CVT_32_TO_16(s, tmp) \ + /* SRC = bbbbbbbbggggggggrrrrrrrr******** */\ + movl %e##s##x, %tmp ;\ + /* TMP = bbbbbbbbggggggggrrrrrrrr******** */\ + shrb $2, %s##h ;\ + /* SRC = bbbbbbbbgggggg00rrrrrrrr******** */\ + andl $0xF80000, %tmp ;\ + /* TMP = 0000000000000000000rrrrr00000000 */\ + shrw $3, %s##x ;\ + /* SRC = bbbbbgggggg00000rrrrrrrr******** */\ + shrl $8, %tmp ;\ + /* TMP = 00000000000rrrrr0000000000000000 */\ + orl %tmp, %e##s##x ;\ + /* SRC = bbbbbggggggrrrrrrrrrrrrr******** */ + +#define CVT_32_TO_15(s, tmp) \ + /* SRC = bbbbbbbbggggggggrrrrrrrr******** */\ + movl %e##s##x, %tmp ;\ + /* TMP = bbbbbbbbggggggggrrrrrrrr******** */\ + shrb $3, %s##h ;\ + /* SRC = bbbbbbbbgggggg00rrrrrrrr******** */\ + andl $0xF80000, %tmp ;\ + /* TMP = 0000000000000000000rrrrr00000000 */\ + shrw $3, %s##x ;\ + /* SRC = bbbbbgggggg00000rrrrrrrr******** */\ + shrl $9, %tmp ;\ + /* TMP = 00000000000rrrrr0000000000000000 */\ + orl %tmp, %e##s##x ;\ + /* SRC = bbbbbggggggrrrrrrrrrrrrr******** */ + +#define CVT_16_TO_15(src, tmp) \ + /* SRC = bbbbbggggggrrrrrBBBBBGGGGGGRRRRR */\ + movl %src, %tmp ;\ + /* TMP = bbbbbggggggrrrrrBBBBBGGGGGGRRRRR */\ + andl $0x1F001F, %src ;\ + /* SRC = bbbbb00000000000BBBBB00000000000 */\ + andl $0xFFC0FFC0, %tmp ;\ + /* TMP = 000000gggggrrrrr000000GGGGGRRRRR */\ + shrl %tmp ;\ + /* TMP = 00000gggggrrrrr000000GGGGGRRRRR0 */\ + orl %tmp, %src ;\ + /* SRC = bbbbbgggggrrrrr0BBBBBGGGGGRRRRR0 */\ + + + +/* transform BGRA to BGR */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_24 +_vesa_l_dump_32_to_24: + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + movw %ax, %fs:(%edi) + shrl $16, %eax + movb %al, %fs:2(%edi) + addl $3, %edi + subl $3, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + ret + +/* transform BGRA to B5G6R5 */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_16 +_vesa_l_dump_32_to_16: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_16(a, ebp) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform BGRA to B5G5R5 */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_15 +_vesa_l_dump_32_to_15: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_15(a, ebp) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform BGRA to fake8 */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_8 +_vesa_l_dump_32_to_8: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %edx + pushl %ecx + pushl %ebx + 1: + movl (%esi), %eax + addl $4, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %ebx + popl %ecx + popl %edx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform BGR to BGRx */ + .p2align 5,,31 + .global _vesa_l_dump_24_to_32 +_vesa_l_dump_24_to_32: + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $3, %esi + movl %eax, %fs:(%edi) + addl $4, %edi + subl $4, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + ret + +/* transform BGR to fake8 */ + .p2align 5,,31 + .global _vesa_l_dump_24_to_8 +_vesa_l_dump_24_to_8: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %edx + pushl %ecx + pushl %ebx + 1: + movl (%esi), %eax + addl $3, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %ebx + popl %ecx + popl %edx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform B5G6R5 to B5G5R5 */ + .p2align 5,,31 + .global _vesa_l_dump_16_to_15 +_vesa_l_dump_16_to_15: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + CVT_16_TO_15(eax, ebp) + movl %eax, %fs:(%edi) + addl $4, %edi + subl $4, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform B5G6R5 to fake8 */ + .p2align 5,,31 + .global _vesa_l_dump_16_to_8 +_vesa_l_dump_16_to_8: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + pushl %ebx + 1: + movl (%esi), %eax + addl $4, %esi +#if 1 + movl %eax, %ebx + andl $0xFFFF, %eax + shrl $16, %ebx + movb _tab_16_8(%eax), %al + movb _tab_16_8(%ebx), %ah +#endif + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ebx + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + + + + .p2align 5,,31 + .global _vesa_b_dump_32_to_24 +_vesa_b_dump_32_to_24: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl $0x00FFFFFF, %ebx + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + subl %ebp, %edi + .balign 4 + 2: + movb (%esi), %al /* XXX too many accesses */ + incl %esi + rorl $8, %ebx + jnc 2b + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_32_to_16 +_vesa_b_dump_32_to_16: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_16(a, ebx) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_32_to_15 +_vesa_b_dump_32_to_15: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_15(a, ebx) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_32_to_8 +_vesa_b_dump_32_to_8: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + pushl %edx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + popl %edx + incl %edx + pushl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $4, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %edx + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_24_to_32 +_vesa_b_dump_24_to_32: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $3, %esi + movl %eax, %fs:(%edi) + addl $4, %edi + subl $4, %ecx + jnz 1b + popl %ecx + popl %eax + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_24_to_8 +_vesa_b_dump_24_to_8: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + pushl %edx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + popl %edx + incl %edx + pushl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $3, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %edx + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_16_to_15 +_vesa_b_dump_16_to_15: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movw (%esi), %ax + addl $2, %esi + CVT_16_TO_15(eax, ebx) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_16_to_8 +_vesa_b_dump_16_to_8: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + subl %ebp, %edi + .balign 4 + 2: + movw (%esi), %ax + addl $2, %esi +#if 1 + andl $0xFFFF, %eax + movb _tab_16_8(%eax), %al +#endif + movb %al, %fs:(%edi) + addl $1, %edi + subl $1, %ecx + jnz 1b + popl %ecx + popl %eax + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dmesa.c xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dmesa.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dmesa.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dmesa.c 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,359 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2004 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#include "main/context.h" +#include "main/imports.h" +#include "main/mtypes.h" + +#include "video.h" + +#include "GL/osmesa.h" +#include "GL/dmesa.h" + + +/* + * This has nothing to do with Mesa Visual structure. + * We keep this one around for backwards compatibility, + * and to store video mode data for DMesaCreateContext. + */ +struct dmesa_visual { + GLenum format; /* OSMesa framebuffer format */ + GLint depthBits; + GLint stencilBits; + GLint accumBits; +}; + +/* + * This has nothing to do with Mesa Buffer structure. + * We keep this one around for backwards compatibility, + * and to store various data. + */ +struct dmesa_buffer { + int xpos, ypos; /* position */ + int width, height; /* size in pixels */ + GLenum type; + void *the_window; /* your window handle, etc */ +}; + +/* + * This has nothing to do with Mesa Context structure. + * We keep this one around for backwards compatibility, + * and to store real off-screen context. + */ +struct dmesa_context { + OSMesaContext osmesa; + DMesaBuffer buffer; +}; + + +static DMesaContext ctx; + + +/**************************************************************************** + * DMesa Public API Functions + ***************************************************************************/ + +/* + * The exact arguments to this function will depend on your window system + */ +DMesaVisual +DMesaCreateVisual (GLint width, + GLint height, + GLint colDepth, + GLint refresh, + GLboolean dbFlag, + GLboolean rgbFlag, + GLint alphaSize, + GLint depthSize, + GLint stencilSize, + GLint accumSize) +{ + DMesaVisual visual; + GLenum format; + int fbbits; + + if (dbFlag) { + return NULL; + } + + if (!rgbFlag) { + format = OSMESA_COLOR_INDEX; + fbbits = 8; + } else if (alphaSize) { + format = OSMESA_BGRA; + fbbits = 32; + } else if (colDepth == 15 || colDepth == 16) { + format = OSMESA_RGB_565; + fbbits = 16; + } else { + format = OSMESA_BGR; + fbbits = 24; + } + + if ((visual = (DMesaVisual)CALLOC_STRUCT(dmesa_visual)) == NULL) { + return NULL; + } + + if (vl_video_init(width, height, colDepth, rgbFlag, refresh, fbbits) <= 0) { + FREE(visual); + return NULL; + } + + visual->format = format; + visual->depthBits = depthSize; + visual->stencilBits = stencilSize; + visual->accumBits = accumSize; + return visual; +} + + +void +DMesaDestroyVisual (DMesaVisual visual) +{ + vl_video_exit(); + FREE(visual); +} + + +DMesaBuffer +DMesaCreateBuffer (DMesaVisual visual, + GLint xpos, GLint ypos, + GLint width, GLint height) +{ + DMesaBuffer buffer; + GLenum type; + int bytesPerPixel; + + switch (visual->format) { + case OSMESA_COLOR_INDEX: + bytesPerPixel = 1; + type = CHAN_TYPE; + break; + case OSMESA_RGB_565: + bytesPerPixel = 2; + type = GL_UNSIGNED_SHORT_5_6_5; + break; + case OSMESA_BGR: + bytesPerPixel = 3; + type = CHAN_TYPE; + break; + default: + bytesPerPixel = 4; + type = CHAN_TYPE; + } + + if ((buffer = (DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { + buffer->xpos = xpos; + buffer->ypos = ypos; + buffer->width = width; + buffer->height = height; + buffer->type = type; + buffer->the_window = MALLOC(width * height * bytesPerPixel + 1); + if (buffer->the_window == NULL) { + FREE(buffer); + buffer = NULL; + } + } + + return buffer; +} + + +void +DMesaDestroyBuffer (DMesaBuffer buffer) +{ + FREE(buffer->the_window); + FREE(buffer); +} + + +DMesaContext +DMesaCreateContext (DMesaVisual visual, DMesaContext share) +{ + DMesaContext dmesa; + if ((dmesa = (DMesaContext)CALLOC_STRUCT(dmesa_context)) != NULL) { + dmesa->osmesa = OSMesaCreateContextExt( + visual->format, + visual->depthBits, + visual->stencilBits, + visual->accumBits, + (share != NULL) ? share->osmesa : NULL); + if (dmesa->osmesa == NULL) { + FREE(dmesa); + dmesa = NULL; + } + } + return dmesa; +} + + +void +DMesaDestroyContext (DMesaContext dmesa) +{ + OSMesaDestroyContext(dmesa->osmesa); + FREE(dmesa); +} + + +GLboolean +DMesaMoveBuffer (GLint xpos, GLint ypos) +{ + const DMesaContext dmesa = DMesaGetCurrentContext(); + DMesaBuffer b = dmesa->buffer; + + if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) == 0) { + b->xpos = xpos; + b->ypos = ypos; + return GL_TRUE; + } + + return GL_FALSE; +} + + +GLboolean +DMesaResizeBuffer (GLint width, GLint height) +{ + const DMesaContext dmesa = DMesaGetCurrentContext(); + DMesaBuffer b = dmesa->buffer; + + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) == 0) { + b->width = width; + b->height = height; + return GL_TRUE; + } + + return GL_FALSE; +} + + +GLboolean +DMesaMakeCurrent (DMesaContext dmesa, DMesaBuffer buffer) +{ + if (dmesa == NULL || buffer == NULL) { + ctx = NULL; + return GL_TRUE; + } + if (OSMesaMakeCurrent(dmesa->osmesa, buffer->the_window, + buffer->type, + buffer->width, buffer->height) && + vl_sync_buffer(&buffer->the_window, buffer->xpos, buffer->ypos, buffer->width, buffer->height) == 0) { + OSMesaPixelStore(OSMESA_Y_UP, GL_FALSE); + dmesa->buffer = buffer; + ctx = dmesa; + return GL_TRUE; + } + return GL_FALSE; +} + + +void +DMesaSwapBuffers (DMesaBuffer buffer) +{ + /* copy/swap back buffer to front if applicable */ + GET_CURRENT_CONTEXT(ctx); + _mesa_notifySwapBuffers(ctx); + vl_flip(); + (void)buffer; +} + + +void +DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ + vl_setCI(ndx, red, green, blue); +} + + +DMesaContext +DMesaGetCurrentContext (void) +{ + return ctx; +} + + +DMesaBuffer +DMesaGetCurrentBuffer (void) +{ + const DMesaContext dmesa = DMesaGetCurrentContext(); + + if (dmesa != NULL) { + return dmesa->buffer; + } + + return NULL; +} + + +DMesaProc +DMesaGetProcAddress (const char *name) +{ + DMesaProc p = (DMesaProc)_glapi_get_proc_address(name); + + /* TODO: handle DMesa* namespace + if (p == NULL) { + } + */ + + return p; +} + + +int +DMesaGetIntegerv (GLenum pname, GLint *params) +{ + switch (pname) { + case DMESA_GET_SCREEN_SIZE: + vl_get(VL_GET_SCREEN_SIZE, params); + break; + case DMESA_GET_DRIVER_CAPS: + params[0] = 0; + break; + case DMESA_GET_VIDEO_MODES: + return vl_get(VL_GET_VIDEO_MODES, params); + case DMESA_GET_BUFFER_ADDR: { + const DMesaContext dmesa = DMesaGetCurrentContext(); + if (dmesa != NULL) { + DMesaBuffer b = dmesa->buffer; + if (b != NULL) { + params[0] = (GLint)b->the_window; + } + } + break; + } + default: + return -1; + } + + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dpmi.c xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dpmi.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dpmi.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/dpmi.c 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,166 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "internal.h" + + +#ifndef MAX +#define MAX(x, y) (((x) < (y)) ? (y) : (x)) +#endif + + +/* _create_linear_mapping: + * Maps a physical address range into linear memory. + */ +int +_create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size) +{ + __dpmi_meminfo meminfo; + + if (physaddr >= 0x100000) { + /* map into linear memory */ + meminfo.address = physaddr; + meminfo.size = size; + if (__dpmi_physical_address_mapping(&meminfo) != 0) { + return -1; + } + + *linear = meminfo.address; + } else { + /* exploit 1 -> 1 physical to linear mapping in low megabyte */ + *linear = physaddr; + } + + return 0; +} + + +/* _remove_linear_mapping: + * Frees the DPMI resources being used to map a linear address range. + */ +void +_remove_linear_mapping (unsigned long *linear) +{ + __dpmi_meminfo meminfo; + + if (*linear) { + if (*linear >= 0x100000) { + meminfo.address = *linear; + __dpmi_free_physical_address_mapping(&meminfo); + } + + *linear = 0; + } +} + + +/* _create_selector: + * Allocates a selector to access a region of linear memory. + */ +int +_create_selector (int *segment, unsigned long base, int size) +{ + /* allocate an ldt descriptor */ + if ((*segment=__dpmi_allocate_ldt_descriptors(1)) < 0) { + *segment = 0; + return -1; + } + + /* create the linear mapping */ + if (_create_linear_mapping(&base, base, size)) { + __dpmi_free_ldt_descriptor(*segment); + *segment = 0; + return -1; + } + + /* set the descriptor base and limit */ + __dpmi_set_segment_base_address(*segment, base); + __dpmi_set_segment_limit(*segment, MAX(size-1, 0xFFFF)); + + return 0; +} + + +/* _remove_selector: + * Frees a DPMI segment selector. + */ +void +_remove_selector (int *segment) +{ + if (*segment) { + unsigned long base; + __dpmi_get_segment_base_address(*segment, &base); + _remove_linear_mapping(&base); + __dpmi_free_ldt_descriptor(*segment); + *segment = 0; + } +} + + +/* Desc: retrieve CPU MMX capability + * + * In : - + * Out : FALSE if CPU cannot do MMX + * + * Note: - + */ +int +_can_mmx (void) +{ +#ifdef USE_MMX_ASM + int x86_cpu_features = 0; + __asm("\n\ + pushfl \n\ + popl %%eax \n\ + movl %%eax, %%ecx \n\ + xorl $0x200000, %%eax\n\ + pushl %%eax \n\ + popfl \n\ + pushfl \n\ + popl %%eax \n\ + pushl %%ecx \n\ + popfl \n\ + xorl %%ecx, %%eax \n\ + jz 0f \n\ + movl $1, %%eax \n\ + cpuid \n\ + movl %%edx, %0 \n\ + 0: \n\ + ":"=g"(x86_cpu_features)::"%eax", "%ebx", "%ecx", "%edx"); + return (x86_cpu_features & 0x00800000); +#else + return 0; +#endif +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/internal.h xpsb-glx-0.19/mesa/src/mesa/drivers/dos/internal.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/internal.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/internal.h 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,105 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#ifndef INTERNAL_H_included +#define INTERNAL_H_included + +#include "../main/mtypes.h" + + +/* + * general purpose defines, etc. + */ +#ifndef FALSE +#define FALSE 0 +#define TRUE !FALSE +#endif + +#define __PACKED__ __attribute__((packed)) + +typedef unsigned char word8; +typedef unsigned short word16; +typedef unsigned long word32; + +#define _16_ *(word16 *)& +#define _32_ *(word32 *)& + +typedef void (*BLTFUNC) (void); + + +/* + * video mode structure + */ +typedef struct vl_mode { + int xres, yres; + int bpp; + + int mode; + int scanlen; + + int sel; + int gran; +} vl_mode; + + +/* + * video driver structure + */ +typedef struct { + vl_mode *(*init) (void); + int (*entermode) (vl_mode *p, int refresh, int fbbits); + void (*blit) (void); + void (*setCI_f) (int index, float red, float green, float blue); + void (*setCI_i) (int index, int red, int green, int blue); + int (*get) (int pname, int *params); + void (*restore) (void); + void (*fini) (void); +} vl_driver; + + +/* + * memory mapping + */ +int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size); +void _remove_linear_mapping (unsigned long *linear); +int _create_selector (int *segment, unsigned long base, int size); +void _remove_selector (int *segment); + + +/* + * system routines + */ +int _can_mmx (void); + + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.c xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.c 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,224 @@ +/* + * Mesa 3-D graphics library + * Version: 4.1 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#include +#include + +#include "video.h" +#include "null.h" + + +static vl_mode *modes; + +#define null_color_precision 8 + + +static void +null_blit_nop (void) +{ +} + + +/* Desc: Attempts to detect NUL, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode * +null_init (void) +{ + static int m[][2] = { + { 320, 200 }, + { 320, 240 }, + { 400, 300 }, + { 512, 384 }, + { 640, 400 }, + { 640, 480 }, + { 800, 600 }, + { 1024, 768 }, + { 1280, 1024 }, + { 1600, 1200 } + }; + static int b[] = { + 8, + 15, + 16, + 24, + 32 + }; + const unsigned int m_count = sizeof(m) / sizeof(m[0]); + const unsigned int b_count = sizeof(b) / sizeof(b[0]); + + unsigned int i, j, k; + + if (modes == NULL) { + modes = malloc(sizeof(vl_mode) * (1 + m_count * b_count)); + + if (modes != NULL) { + for (k = 0, i = 0; i < m_count; i++) { + for (j = 0; j < b_count; j++, k++) { + modes[k].xres = m[i][0]; + modes[k].yres = m[i][1]; + modes[k].bpp = b[j]; + modes[k].mode = 0x4000; + modes[k].scanlen = m[i][0] * ((b[j] + 7) / 8); + modes[k].sel = -1; + modes[k].gran = -1; + } + } + modes[k].xres = -1; + modes[k].yres = -1; + modes[k].bpp = -1; + modes[k].mode = 0xffff; + modes[k].scanlen = -1; + modes[k].sel = -1; + modes[k].gran = -1; + } + } + + return modes; +} + + +/* Desc: Frees all resources allocated by NUL init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void +null_fini (void) +{ + if (modes != NULL) { + free(modes); + modes = NULL; + } +} + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int +null_entermode (vl_mode *p, int refresh, int fbbits) +{ + NUL.blit = null_blit_nop; + + return 0; + + (void)(p && refresh && fbbits); /* silence compiler warning */ +} + + +/* Desc: Restores to the mode prior to first call to null_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void +null_restore (void) +{ +} + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void +null_setCI_i (int index, int red, int green, int blue) +{ + (void)(index && red && green && blue); /* silence compiler warning */ +} + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void +null_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << null_color_precision) - 1; + + null_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int +null_get (int pname, int *params) +{ + switch (pname) { + default: + params[0] = params[0]; /* silence compiler warning */ + return -1; + } + return 0; +} + + +/* + * the driver + */ +vl_driver NUL = { + null_init, + null_entermode, + NULL, + null_setCI_f, + null_setCI_i, + null_get, + null_restore, + null_fini +}; diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.h xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/null.h 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,41 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef NULL_H_included +#define NULL_H_included + +#include "internal.h" + +extern vl_driver NUL; + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.c xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.c 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,719 @@ +/* + * Mesa 3-D graphics library + * Version: 4.1 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "video.h" +#include "vesa.h" + + +static vl_mode modes[128]; + +static word16 vesa_ver; +static int banked_selector, linear_selector; +static int oldmode = -1; + +static int vesa_color_precision = 6; + +static word16 *vesa_pmcode; +unsigned int vesa_gran_mask, vesa_gran_shift; + + +/* + * VESA info + */ +#define V_SIGN 0 +#define V_MINOR 4 +#define V_MAJOR 5 +#define V_OEM_OFS 6 +#define V_OEM_SEG 8 +#define V_MODE_OFS 14 +#define V_MODE_SEG 16 +#define V_MEMORY 18 + +/* + * mode info + */ +#define M_ATTR 0 +#define M_GRAN 4 +#define M_SCANLEN 16 +#define M_XRES 18 +#define M_YRES 20 +#define M_BPP 25 +#define M_RED 31 +#define M_GREEN 33 +#define M_BLUE 35 +#define M_PHYS_PTR 40 + +/* + * VESA 3.0 CRTC timings structure + */ +typedef struct CRTCInfoBlock { + unsigned short HorizontalTotal; + unsigned short HorizontalSyncStart; + unsigned short HorizontalSyncEnd; + unsigned short VerticalTotal; + unsigned short VerticalSyncStart; + unsigned short VerticalSyncEnd; + unsigned char Flags; + unsigned long PixelClock; /* units of Hz */ + unsigned short RefreshRate; /* units of 0.01 Hz */ + unsigned char reserved[40]; +} __PACKED__ CRTCInfoBlock; + +#define HNEG (1 << 2) +#define VNEG (1 << 3) +#define DOUBLESCAN (1 << 0) + + +/* Desc: Attempts to detect VESA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode * +vesa_init (void) +{ + __dpmi_regs r; + word16 *p; + vl_mode *q; + char vesa_info[512], tmp[512]; + int maxsize = 0; + word32 linearfb = 0; + + if (vesa_ver) { + return modes; + } + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((r.x.ax != 0x004f) || ((_32_ vesa_info[V_SIGN]) != 0x41534556)) { + return NULL; + } + + p = (word16 *)(((_16_ vesa_info[V_MODE_SEG]) << 4) + (_16_ vesa_info[V_MODE_OFS])); + q = modes; + do { + if ((q->mode = _farpeekw(__djgpp_dos_sel, (unsigned long)(p++))) == 0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[M_BPP]) { + case 16: + q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; + break; + case 8: + case 15: + case 24: + case 32: + q->bpp = tmp[M_BPP]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax == 0x004f) && ((tmp[M_ATTR] & 0x11) == 0x11) && q->bpp) { + q->xres = _16_ tmp[M_XRES]; + q->yres = _16_ tmp[M_YRES]; + q->scanlen = _16_ tmp[M_SCANLEN]; + q->gran = (_16_ tmp[M_GRAN]) << 10; + if (tmp[M_ATTR] & 0x80) { + vl_mode *q1 = q + 1; + *q1 = *q++; + linearfb = _32_ tmp[M_PHYS_PTR]; + q->mode |= 0x4000; + } + if (maxsize < (q->scanlen * q->yres)) { + maxsize = q->scanlen * q->yres; + } + q++; + } + } while (TRUE); + + if (q == modes) { + return NULL; + } + if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { + return NULL; + } + if (linearfb) { + maxsize = ((maxsize + 0xfffUL) & ~0xfffUL); + if (_create_selector(&linear_selector, linearfb, maxsize)) { + linear_selector = banked_selector; + } + } + + for (q = modes; q->mode != 0xffff; q++) { + q->sel = banked_selector; + if (q->mode & 0x4000) { + if (linear_selector != banked_selector) { + q->sel = linear_selector; + } else { + q->mode &= ~0x4000; + } + } + } + + if (vesa_info[V_MAJOR] >= 2) { + r.x.ax = 0x4f0a; + r.x.bx = 0; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + vesa_pmcode = (word16 *)malloc(r.x.cx); + if (vesa_pmcode != NULL) { + movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); + if (vesa_pmcode[3]) { + p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); + while (*p++ != 0xffff) { + } + } else { + p = NULL; + } + if (p && (*p != 0xffff)) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } else { + vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); + } + } + } + } + + vesa_ver = _16_ vesa_info[V_MINOR]; + return modes; +} + + +/* Desc: Frees all resources allocated by VESA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void +vesa_fini (void) +{ + if (vesa_ver) { + _remove_selector(&linear_selector); + _remove_selector(&banked_selector); + if (vesa_pmcode != NULL) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } + } +} + + +/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. + * + * In : mode, clock + * Out : desired clock + * + * Note: - + */ +static unsigned long +_closest_pixclk (int mode_no, unsigned long vclk) +{ + __dpmi_regs r; + + r.x.ax = 0x4F0B; + r.h.bl = 0; + r.d.ecx = vclk; + r.x.dx = mode_no; + __dpmi_int(0x10, &r); + + return (r.x.ax == 0x004f) ? r.d.ecx : 0; +} + + +/* Desc: Calculates CRTC mode timings. + * + * In : crtc block, geometry, adjust + * Out : + * + * Note: + */ +static void +_crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) +{ + int HTotal, VTotal; + int HDisp, VDisp; + int HSS, VSS; + int HSE, VSE; + int HSWidth, VSWidth; + int SS, SE; + int doublescan = FALSE; + + if (yres < 400) { + doublescan = TRUE; + yres *= 2; + } + + HDisp = xres; + HTotal = (int)(HDisp * 1.27) & ~0x7; + HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; + HSS = HDisp + 16; + HSE = HSS + HSWidth; + VDisp = yres; + VTotal = VDisp * 1.07; + VSWidth = (VTotal / 100) + 1; + VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; + VSE = VSS + VSWidth; + + SS = HSS + xadjust; + SE = HSE + xadjust; + + if (xadjust < 0) { + if (SS < (HDisp + 8)) { + SS = HDisp + 8; + SE = SS + HSWidth; + } + } else { + if ((HTotal - 24) < SE) { + SE = HTotal - 24; + SS = SE - HSWidth; + } + } + + HSS = SS; + HSE = SE; + + SS = VSS + yadjust; + SE = VSE + yadjust; + + if (yadjust < 0) { + if (SS < (VDisp + 3)) { + SS = VDisp + 3; + SE = SS + VSWidth; + } + } else { + if ((VTotal - 4) < SE) { + SE = VTotal - 4; + SS = SE - VSWidth; + } + } + + VSS = SS; + VSE = SE; + + crtc->HorizontalTotal = HTotal; + crtc->HorizontalSyncStart = HSS; + crtc->HorizontalSyncEnd = HSE; + crtc->VerticalTotal = VTotal; + crtc->VerticalSyncStart = VSS; + crtc->VerticalSyncEnd = VSE; + crtc->Flags = HNEG | VNEG; + + if (doublescan) { + crtc->Flags |= DOUBLESCAN; + } +} + + +/* Desc: Attempts to choose a suitable blitter. + * + * In : ptr to mode structure, software framebuffer bits + * Out : blitter funciton, or NULL + * + * Note: - + */ +static BLTFUNC +_choose_blitter (vl_mode *p, int fbbits) +{ + BLTFUNC blitter; + + if (p->mode & 0x4000) { + blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + switch (p->bpp) { + case 8: + switch (fbbits) { + case 8: + break; + case 16: + blitter = vesa_l_dump_16_to_8; + break; + case 24: + blitter = vesa_l_dump_24_to_8; + break; + case 32: + blitter = vesa_l_dump_32_to_8; + break; + case 15: + default: + return NULL; + } + break; + case 15: + switch (fbbits) { + case 16: + blitter = vesa_l_dump_16_to_15; + break; + case 32: + blitter = vesa_l_dump_32_to_15; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 16: + switch (fbbits) { + case 16: + break; + case 32: + blitter = vesa_l_dump_32_to_16; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 24: + switch (fbbits) { + case 24: + break; + case 32: + blitter = vesa_l_dump_32_to_24; + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + case 32: + switch (fbbits) { + case 24: + blitter = vesa_l_dump_24_to_32; + break; + case 32: + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + } + } else { + blitter = vesa_b_dump_virtual; + switch (p->bpp) { + case 8: + switch (fbbits) { + case 8: + break; + case 16: + blitter = vesa_b_dump_16_to_8; + break; + case 24: + blitter = vesa_b_dump_24_to_8; + break; + case 32: + blitter = vesa_b_dump_32_to_8; + break; + case 15: + default: + return NULL; + } + break; + case 15: + switch (fbbits) { + case 16: + blitter = vesa_b_dump_16_to_15; + break; + case 32: + blitter = vesa_b_dump_32_to_15; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 16: + switch (fbbits) { + case 16: + break; + case 32: + blitter = vesa_b_dump_32_to_16; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 24: + switch (fbbits) { + case 24: + break; + case 32: + blitter = vesa_b_dump_32_to_24; + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + case 32: + switch (fbbits) { + case 24: + blitter = vesa_b_dump_24_to_32; + break; + case 32: + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + } + } + + return blitter; +} + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int +vesa_entermode (vl_mode *p, int refresh, int fbbits) +{ + __dpmi_regs r; + + if (!(p->mode & 0x4000)) { + { int n; for (vesa_gran_shift = 0, n = p->gran; n; vesa_gran_shift++, n >>= 1); } + vesa_gran_mask = (1 << (--vesa_gran_shift)) - 1; + if ((unsigned)p->gran != (vesa_gran_mask + 1)) { + return !0; + } + } + + VESA.blit = _choose_blitter(p, fbbits); + if (VESA.blit == NULL) { + return !0; + } + + if (oldmode == -1) { + r.x.ax = 0x4f03; + __dpmi_int(0x10, &r); + oldmode = r.x.bx; + } + + r.x.ax = 0x4f02; + r.x.bx = p->mode; + + if (refresh && ((vesa_ver >> 8) >= 3)) { + /* VESA 3.0 stuff for controlling the refresh rate */ + CRTCInfoBlock crtc; + unsigned long vclk; + double f0; + + _crtc_timing(&crtc, p->xres, p->yres, 0, 0); + + vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; + vclk = _closest_pixclk(p->mode, vclk); + + if (vclk != 0) { + f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); + /*_current_refresh_rate = (int)(f0 + 0.5);*/ + + crtc.PixelClock = vclk; + crtc.RefreshRate = refresh * 100; + + movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); + + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + r.x.bx |= 0x0800; + } + } + + __dpmi_int(0x10, &r); + if (r.x.ax != 0x004f) { + return !0; + } + + if (p->bpp == 8) { + r.x.ax = 0x4f08; + r.x.bx = 0x0800; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + r.x.ax = 0x4f08; + r.h.bl = 0x01; + __dpmi_int(0x10, &r); + vesa_color_precision = r.h.bh; + } + } + + return 0; +} + + +/* Desc: Restores to the mode prior to first call to vesa_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void +vesa_restore (void) +{ + __dpmi_regs r; + + if (oldmode != -1) { + if (oldmode < 0x100) { + __asm("int $0x10"::"a"(oldmode)); + } else { + r.x.ax = 0x4f02; + r.x.bx = oldmode; + __dpmi_int(0x10, &r); + } + oldmode = -1; + } +} + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void +vesa_setCI_i (int index, int red, int green, int blue) +{ +#if 0 + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif +} + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void +vesa_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vesa_color_precision) - 1; + + vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int +vesa_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vesa_color_precision; + break; + default: + return -1; + } + return 0; +} + + +/* + * the driver + */ +vl_driver VESA = { + vesa_init, + vesa_entermode, + NULL, + vesa_setCI_f, + vesa_setCI_i, + vesa_get, + vesa_restore, + vesa_fini +}; diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.h xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vesa.h 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,65 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VESA_H_included +#define VESA_H_included + +#include "internal.h" + +extern void *vesa_swbank; + +extern void vesa_b_dump_virtual (void); +extern void vesa_l_dump_virtual (void); +extern void vesa_l_dump_virtual_mmx (void); + +extern void vesa_l_dump_32_to_24 (void); +extern void vesa_l_dump_32_to_16 (void); +extern void vesa_l_dump_32_to_15 (void); +extern void vesa_l_dump_32_to_8 (void); +extern void vesa_l_dump_24_to_32 (void); +extern void vesa_l_dump_24_to_8 (void); +extern void vesa_l_dump_16_to_15 (void); +extern void vesa_l_dump_16_to_8 (void); + +extern void vesa_b_dump_32_to_24 (void); +extern void vesa_b_dump_32_to_16 (void); +extern void vesa_b_dump_32_to_15 (void); +extern void vesa_b_dump_32_to_8 (void); +extern void vesa_b_dump_24_to_32 (void); +extern void vesa_b_dump_24_to_8 (void); +extern void vesa_b_dump_16_to_15 (void); +extern void vesa_b_dump_16_to_8 (void); + +extern vl_driver VESA; + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.c xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.c 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,289 @@ +/* + * Mesa 3-D graphics library + * Version: 4.1 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#include +#include + +#include "video.h" +#include "vga.h" + + +static vl_mode modes[] = { + { + /* .xres = */ 320, + /* .yres = */ 200, + /* .bpp = */ 8, + /* .mode = */ 0x13 | 0x4000, + /* .scanlen = */ 320, + /* .sel = */ -1, + /* .gran = */ 320*200 + }, + { + /* .xres = */ -1, + /* .yres = */ -1, + /* .bpp = */ -1, + /* .mode = */ 0xffff, + /* .scanlen = */ -1, + /* .sel = */ -1, + /* .gran = */ -1 + } +}; + +static word16 vga_ver; +static int linear_selector; +static int oldmode = -1; + +#define vga_color_precision 6 + + +/* Desc: Attempts to detect VGA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode * +vga_init (void) +{ + int rv = 0; + + if (vga_ver) { + return modes; + } + + __asm("\n\ + movw $0x1a00, %%ax \n\ + int $0x10 \n\ + cmpb $0x1a, %%al \n\ + jne 0f \n\ + cmpb $0x07, %%bl \n\ + jb 0f \n\ + andl $0xff, %%ebx \n\ + movl %%ebx, %0 \n\ + 0:":"=g"(rv)::"%eax", "%ebx"); + if (rv == 0) { + return NULL; + } + + if (_create_selector(&linear_selector, 0xa0000, 0x10000)) { + return NULL; + } + + modes[0].sel = linear_selector; + + vga_ver = rv; + return modes; +} + + +/* Desc: Frees all resources allocated by VGA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void +vga_fini (void) +{ + if (vga_ver) { + _remove_selector(&linear_selector); + } +} + + +/* Desc: Attempts to choose a suitable blitter. + * + * In : ptr to mode structure, software framebuffer bits + * Out : blitter funciton, or NULL + * + * Note: - + */ +static BLTFUNC +_choose_blitter (vl_mode *p, int fbbits) +{ + BLTFUNC blitter; + + switch (fbbits) { + case 8: + blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + break; + case 16: + blitter = vesa_l_dump_16_to_8; + break; + case 24: + blitter = vesa_l_dump_24_to_8; + break; + case 32: + blitter = vesa_l_dump_32_to_8; + break; + default: + return NULL; + } + + return blitter; + + (void)p; +} + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int +vga_entermode (vl_mode *p, int refresh, int fbbits) +{ + if (!(p->mode & 0x4000)) { + return -1; + } + + VGA.blit = _choose_blitter(p, fbbits); + if (VGA.blit == NULL) { + return !0; + } + + if (oldmode == -1) { + __asm("\n\ + movb $0x0f, %%ah \n\ + int $0x10 \n\ + andl $0xff, %%eax \n\ + movl %%eax, %0 \n\ + ":"=g"(oldmode)::"%eax", "%ebx"); + } + + __asm("int $0x10"::"a"(p->mode&0xff)); + + return 0; + + (void)refresh; /* silence compiler warning */ +} + + +/* Desc: Restores to the mode prior to first call to vga_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void +vga_restore (void) +{ + if (oldmode != -1) { + __asm("int $0x10"::"a"(oldmode)); + oldmode = -1; + } +} + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void +vga_setCI_i (int index, int red, int green, int blue) +{ +#if 0 + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif +} + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void +vga_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vga_color_precision) - 1; + + vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int +vga_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vga_color_precision; + break; + default: + return -1; + } + return 0; +} + + +/* + * the driver + */ +vl_driver VGA = { + vga_init, + vga_entermode, + NULL, + vga_setCI_f, + vga_setCI_i, + vga_get, + vga_restore, + vga_fini +}; diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.h xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/vga.h 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,42 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VGA_H_included +#define VGA_H_included + +#include "internal.h" +#include "vesa.h" + +extern vl_driver VGA; + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.c xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.c 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,442 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + * + * Thanks to CrazyPyro (Neil Funk) for FakeColor + */ + + +#include + +#include "internal.h" +#include "vesa.h" +#include "vga.h" +#include "null.h" +#include "video.h" + + +static vl_driver *drv; +/* based upon mode specific data: valid entire session */ +int vl_video_selector; +static vl_mode *video_mode; +static int video_scanlen, video_bypp; +/* valid until next buffer */ +void *vl_current_draw_buffer, *vl_current_read_buffer; +int vl_current_stride, vl_current_width, vl_current_height, vl_current_bytes; +int vl_current_offset, vl_current_delta; + + +void (*vl_flip) (void); + + +/* FakeColor data */ +#define R_CNT 6 +#define G_CNT 6 +#define B_CNT 6 + +#define R_BIAS 7 +#define G_BIAS 7 +#define B_BIAS 7 + +static word32 VGAPalette[256]; +word8 array_r[256]; +word8 array_g[256]; +word8 array_b[256]; +word8 tab_16_8[0x10000]; + + +/* lookup table for scaling 5 bit colors up to 8 bits */ +static int _rgb_scale_5[32] = { + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 +}; + +/* lookup table for scaling 6 bit colors up to 8 bits */ +static int _rgb_scale_6[64] = { + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 45, 49, 53, 57, 61, + 65, 69, 73, 77, 81, 85, 89, 93, + 97, 101, 105, 109, 113, 117, 121, 125, + 130, 134, 138, 142, 146, 150, 154, 158, + 162, 166, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 215, 219, 223, + 227, 231, 235, 239, 243, 247, 251, 255 +}; + + +/* Desc: color composition (w/o ALPHA) + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - + */ +static int +v_mixrgb8fake (const unsigned char rgb[]) +{ + return array_b[rgb[2]]*G_CNT*R_CNT + + array_g[rgb[1]]*R_CNT + + array_r[rgb[0]]; +} + + +/* Desc: color decomposition + * + * In : pixel offset, array of integers to hold color components (R, G, B, A) + * Out : - + * + * Note: uses current read buffer + */ +static void +v_getrgb8fake6 (unsigned int offset, unsigned char rgb[]) +{ + word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; + rgb[0] = _rgb_scale_6[(c >> 16) & 0x3F]; + rgb[1] = _rgb_scale_6[(c >> 8) & 0x3F]; + rgb[2] = _rgb_scale_6[ c & 0x3F]; +} +static void +v_getrgb8fake8 (unsigned int offset, unsigned char rgb[]) +{ + word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; + rgb[0] = c >> 16; + rgb[1] = c >> 8; + rgb[2] = c; +} + + +/* Desc: create R5G6B5 to FakeColor table lookup + * + * In : - + * Out : - + * + * Note: - + */ +static void +init_tab_16_8 (void) +{ + int i; + for (i = 0; i < 0x10000; i++) { + unsigned char rgb[3]; + rgb[0] = _rgb_scale_5[(i >> 11) & 0x1F]; + rgb[1] = _rgb_scale_6[(i >> 5) & 0x3F]; + rgb[2] = _rgb_scale_5[ i & 0x1F]; + tab_16_8[i] = v_mixrgb8fake(rgb); + } + (void)v_getrgb8fake6; + (void)v_getrgb8fake8; +} + + +/* Desc: set one palette entry + * + * In : index, R, G, B + * Out : - + * + * Note: color components are in range [0.0 .. 1.0] + */ +void +vl_setCI (int index, float red, float green, float blue) +{ + drv->setCI_f(index, red, green, blue); +} + + +/* Desc: set one palette entry + * + * In : color, R, G, B + * Out : - + * + * Note: - + */ +static void +fake_setcolor (int c, int r, int g, int b) +{ + VGAPalette[c] = 0xff000000 | (r<<16) | (g<<8) | b; + + drv->setCI_i(c, r, g, b); +} + + +/* Desc: build FakeColor palette + * + * In : CI precision in bits + * Out : - + * + * Note: - + */ +static void +fake_buildpalette (int bits) +{ + double c_r, c_g, c_b; + int r, g, b, color = 0; + + double max = (1 << bits) - 1; + + for (b = 0; b < B_CNT; ++b) { + for (g = 0; g < G_CNT; ++g) { + for (r = 0; r < R_CNT; ++r) { + c_r = 0.5 + (double)r * (max-R_BIAS) / (R_CNT-1.) + R_BIAS; + c_g = 0.5 + (double)g * (max-G_BIAS) / (G_CNT-1.) + G_BIAS; + c_b = 0.5 + (double)b * (max-B_BIAS) / (B_CNT-1.) + B_BIAS; + fake_setcolor(color++, (int)c_r, (int)c_g, (int)c_b); + } + } + } + + for (color = 0; color < 256; color++) { + c_r = (double)color * R_CNT / 256.; + c_g = (double)color * G_CNT / 256.; + c_b = (double)color * B_CNT / 256.; + array_r[color] = (int)c_r; + array_g[color] = (int)c_g; + array_b[color] = (int)c_b; + } +} + + +/* Desc: initialize hardware + * + * In : - + * Out : list of available modes + * + * Note: when returning non-NULL, global variable `drv' is guaranteed to be ok + */ +static vl_mode * +v_init_hw (void) +{ + static vl_mode *q = NULL; + + if (q == NULL) { + /* are we forced to NUL driver? */ + if (getenv("DMESA_NULDRV")) { + if ((q = NUL.init()) != NULL) { + drv = &NUL; + } + return q; + } + /* initialize hardware */ + if ((q = VESA.init()) != NULL) { + drv = &VESA; + } else if ((q = VGA.init()) != NULL) { + drv = &VGA; + } else { + drv = NULL; + } + } + + return q; +} + + +/* Desc: sync buffer with video hardware + * + * In : ptr to old buffer, position, size + * Out : 0 if success + * + * Note: - + */ +int +vl_sync_buffer (void **buffer, int x, int y, int width, int height) +{ + if ((/*XXX*/width & 7) || (x < 0) || (y < 0) || (x+width > video_mode->xres) || (y+height > video_mode->yres)) { + return -1; + } else { + void *newbuf = *buffer; + + if ((newbuf == NULL) || (vl_current_width != width) || (vl_current_height != height)) { + newbuf = realloc(newbuf, width * height * video_bypp); + } + + if (newbuf == NULL) { + return -2; + } + + vl_current_width = width; + vl_current_height = height; + vl_current_stride = vl_current_width * video_bypp; + vl_current_bytes = vl_current_stride * height; + + vl_current_offset = video_scanlen * y + video_bypp * x; + vl_current_delta = video_scanlen - vl_current_stride; + + vl_current_draw_buffer = vl_current_read_buffer = *buffer = newbuf; + return 0; + } +} + + +/* Desc: state retrieval + * + * In : name, storage + * Out : -1 for an error + * + * Note: - + */ +int +vl_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_SCREEN_SIZE: + params[0] = video_mode->xres; + params[1] = video_mode->yres; + break; + case VL_GET_VIDEO_MODES: { + int n; + vl_mode *q; + if ((q = v_init_hw()) == NULL) { + return -1; + } + /* count available visuals */ + for (n = 0; q->mode != 0xffff; q++) { + if ((q + 1)->mode == (q->mode | 0x4000)) { + /* same mode, but linear */ + q++; + } + if (params) { + params[n] = (int)q; + } + n++; + } + return n; + } + default: + return (drv != NULL) ? drv->get(pname, params) : -1; + } + return 0; +} + + +/* Desc: setup mode + * + * In : ptr to mode definition + * Out : 0 if success + * + * Note: - + */ +static int +vl_setup_mode (vl_mode *p) +{ + if (p == NULL) { + return -1; + } + + switch (p->bpp) { + case 8: + break; + case 15: + break; + case 16: + break; + case 24: + break; + case 32: + break; + default: + return -1; + } + + video_mode = p; + video_bypp = (p->bpp+7)/8; + video_scanlen = p->scanlen; + vl_video_selector = p->sel; + + return 0; +} + + +/* Desc: restore to the mode prior to first call to `vl_video_init'. + * + * In : - + * Out : - + * + * Note: - + */ +void +vl_video_exit (void) +{ + drv->restore(); + drv->fini(); + video_mode = NULL; +} + + +/* Desc: enter mode + * + * In : xres, yres, bits/pixel, RGB, refresh rate + * Out : pixel width in bits if success + * + * Note: - + */ +int +vl_video_init (int width, int height, int bpp, int rgb, int refresh, int fbbits) +{ + int fake; + vl_mode *p, *q; + unsigned int min; + + fake = 0; + if (!rgb) { + bpp = 8; + } else if (bpp == 8) { + fake = 1; + } + + /* initialize hardware */ + if ((q = v_init_hw()) == NULL) { + return 0; + } + + /* search for a mode that fits our request */ + for (min = -1, p = NULL; q->mode != 0xffff; q++) { + if ((q->xres >= width) && (q->yres >= height) && (q->bpp == bpp)) { + if (min >= (unsigned)(q->xres * q->yres)) { + min = q->xres * q->yres; + p = q; + } + } + } + + /* setup and enter mode */ + if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh, fbbits) == 0)) { + vl_flip = drv->blit; + if (fake) { + drv->get(VL_GET_CI_PREC, (int *)(&min)); + fake_buildpalette(min); + init_tab_16_8(); + } + return bpp; + } + + /* abort */ + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.h xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dos/video.h 2010-06-24 06:42:01.000000000 +0100 @@ -0,0 +1,56 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 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. + */ + +/* + * DOS/DJGPP device driver for Mesa + * + * Author: Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VIDEO_H_included +#define VIDEO_H_included + +typedef int fixed; + +#define VL_GET_CARD_NAME 0x0100 +#define VL_GET_VRAM 0x0101 +#define VL_GET_CI_PREC 0x0200 +#define VL_GET_HPIXELS 0x0201 +#define VL_GET_SCREEN_SIZE 0x0202 +#define VL_GET_VIDEO_MODES 0x0300 + +extern void (*vl_flip) (void); + +void vl_setCI (int index, float red, float green, float blue); + +int vl_sync_buffer (void **buffer, int x, int y, int width, int height); +int vl_get (int pname, int *params); + +void vl_video_exit (void); +int vl_video_init (int width, int height, int bpp, int rgb, int refresh, int fbbits); + +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/depthtmp.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/depthtmp.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/depthtmp.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/depthtmp.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,270 @@ + +/* + * Notes: + * 1. These functions plug into the gl_renderbuffer structure. + * 2. The 'values' parameter always points to GLuint values, regardless of + * the actual Z buffer depth. + */ + + +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HAVE_HW_DEPTH_SPANS +#define HAVE_HW_DEPTH_SPANS 0 +#endif + +#ifndef HAVE_HW_DEPTH_PIXELS +#define HAVE_HW_DEPTH_PIXELS 0 +#endif + +static void TAG(WriteDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const VALUE_TYPE *depth = (const VALUE_TYPE *) values; + GLint x1; + GLint n1; + LOCAL_DEPTH_VARS; + + y = Y_FLIP( y ); + +#if HAVE_HW_DEPTH_SPANS + (void) x1; (void) n1; + + if ( DBG ) fprintf( stderr, "WriteDepthSpan 0..%d (x1 %d)\n", + (int)n, (int)x ); + + WRITE_DEPTH_SPAN(); +#else + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN( x, y, n, x1, n1, i ); + + if ( DBG ) fprintf( stderr, "WriteDepthSpan %d..%d (x1 %d) (mask %p)\n", + (int)i, (int)n1, (int)x1, mask ); + + if ( mask ) { + for ( ; n1>0 ; i++, x1++, n1-- ) { + if ( mask[i] ) WRITE_DEPTH( x1, y, depth[i] ); + } + } else { + for ( ; n1>0 ; i++, x1++, n1-- ) { + WRITE_DEPTH( x1, y, depth[i] ); + } + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_WRITE_UNLOCK(); +} + + +#if HAVE_HW_DEPTH_SPANS +/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */ +static void +TAG(WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[] ) +{ + const GLuint depthVal = *((GLuint *) value); + GLuint depths[MAX_WIDTH]; + GLuint i; + for (i = 0; i < n; i++) + depths[i] = depthVal; + TAG(WriteDepthSpan)(ctx, rb, n, x, y, depths, mask); +} +#else +static void TAG(WriteMonoDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLuint depth = *((GLuint *) value); + GLint x1; + GLint n1; + LOCAL_DEPTH_VARS; + + y = Y_FLIP( y ); + + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN( x, y, n, x1, n1, i ); + + if ( DBG ) fprintf( stderr, "%s %d..%d (x1 %d) = %u\n", + __FUNCTION__, (int)i, (int)n1, (int)x1, (GLuint)depth ); + + if ( mask ) { + for ( ; n1>0 ; i++, x1++, n1-- ) { + if ( mask[i] ) WRITE_DEPTH( x1, y, depth ); + } + } else { + for ( ; n1>0 ; x1++, n1-- ) { + WRITE_DEPTH( x1, y, depth ); + } + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} +#endif + + +static void TAG(WriteDepthPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], + const GLint y[], + const void *values, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const VALUE_TYPE *depth = (const VALUE_TYPE *) values; + GLuint i; + LOCAL_DEPTH_VARS; + + if ( DBG ) fprintf( stderr, "WriteDepthPixels\n" ); + +#if HAVE_HW_DEPTH_PIXELS + (void) i; + + WRITE_DEPTH_PIXELS(); +#else + HW_CLIPLOOP() + { + if ( mask ) { + for ( i = 0 ; i < n ; i++ ) { + if ( mask[i] ) { + const int fy = Y_FLIP( y[i] ); + if ( CLIPPIXEL( x[i], fy ) ) + WRITE_DEPTH( x[i], fy, depth[i] ); + } + } + } + else { + for ( i = 0 ; i < n ; i++ ) { + const int fy = Y_FLIP( y[i] ); + if ( CLIPPIXEL( x[i], fy ) ) + WRITE_DEPTH( x[i], fy, depth[i] ); + } + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_WRITE_UNLOCK(); +} + + +/* Read depth spans and pixels + */ +static void TAG(ReadDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values ) +{ + HW_READ_LOCK() + { + VALUE_TYPE *depth = (VALUE_TYPE *) values; + GLint x1, n1; + LOCAL_DEPTH_VARS; + + y = Y_FLIP( y ); + + if ( DBG ) fprintf( stderr, "ReadDepthSpan\n" ); + +#if HAVE_HW_DEPTH_SPANS + (void) x1; (void) n1; + + READ_DEPTH_SPAN(); +#else + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN( x, y, n, x1, n1, i ); + for ( ; n1>0 ; i++, n1-- ) { + READ_DEPTH( depth[i], x+i, y ); + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_READ_UNLOCK(); +} + +static void TAG(ReadDepthPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + VALUE_TYPE *depth = (VALUE_TYPE *) values; + GLuint i; + LOCAL_DEPTH_VARS; + + if ( DBG ) fprintf( stderr, "ReadDepthPixels\n" ); + +#if HAVE_HW_DEPTH_PIXELS + (void) i; + + READ_DEPTH_PIXELS(); +#else + HW_CLIPLOOP() + { + for ( i = 0 ; i < n ;i++ ) { + int fy = Y_FLIP( y[i] ); + if ( CLIPPIXEL( x[i], fy ) ) + READ_DEPTH( depth[i], x[i], fy ); + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_READ_UNLOCK(); +} + + +/** + * Initialize the given renderbuffer's span routines to point to + * the depth/z functions we generated above. + */ +static void TAG(InitDepthPointers)(struct gl_renderbuffer *rb) +{ + rb->GetRow = TAG(ReadDepthSpan); + rb->GetValues = TAG(ReadDepthPixels); + rb->PutRow = TAG(WriteDepthSpan); + rb->PutRowRGB = NULL; + rb->PutMonoRow = TAG(WriteMonoDepthSpan); + rb->PutValues = TAG(WriteDepthPixels); + rb->PutMonoValues = NULL; +} + + +#if HAVE_HW_DEPTH_SPANS +#undef WRITE_DEPTH_SPAN +#undef WRITE_DEPTH_PIXELS +#undef READ_DEPTH_SPAN +#undef READ_DEPTH_PIXELS +#else +#undef WRITE_DEPTH +#undef READ_DEPTH +#endif +#undef TAG +#undef VALUE_TYPE diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.c xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,215 @@ + +#include "main/mtypes.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/imports.h" +#include "drirenderbuffer.h" + + +/** + * This will get called when a window (gl_framebuffer) is resized (probably + * via driUpdateFramebufferSize(), below). + * Just update width, height and internal format fields for now. + * There's usually no memory allocation above because the present + * DRI drivers use statically-allocated full-screen buffers. If that's not + * the case for a DRI driver, a different AllocStorage method should + * be used. + */ +static GLboolean +driRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + rb->Width = width; + rb->Height = height; + rb->InternalFormat = internalFormat; + return GL_TRUE; +} + + +static void +driDeleteRenderbuffer(struct gl_renderbuffer *rb) +{ + /* don't free rb->Data Chances are it's a memory mapped region for + * the dri drivers. + */ + _mesa_free(rb); +} + + +/** + * Allocate a new driRenderbuffer object. + * Individual drivers are free to implement different versions of + * this function. + * + * At this time, this function can only be used for window-system + * renderbuffers, not user-created RBOs. + * + * \param format Either GL_RGBA, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, + * GL_DEPTH_COMPONENT32, or GL_STENCIL_INDEX8_EXT (for now). + * \param addr address in main memory of the buffer. Probably a memory + * mapped region. + * \param cpp chars or bytes per pixel + * \param offset start of renderbuffer with respect to start of framebuffer + * \param pitch pixels per row + */ +driRenderbuffer * +driNewRenderbuffer(GLenum format, GLvoid *addr, + GLint cpp, GLint offset, GLint pitch, + __DRIdrawablePrivate *dPriv) +{ + driRenderbuffer *drb; + + assert(format == GL_RGBA || + format == GL_RGB5 || + format == GL_RGBA8 || + format == GL_DEPTH_COMPONENT16 || + format == GL_DEPTH_COMPONENT24 || + format == GL_DEPTH_COMPONENT32 || + format == GL_STENCIL_INDEX8_EXT); + + assert(cpp > 0); + assert(pitch > 0); + + drb = _mesa_calloc(sizeof(driRenderbuffer)); + if (drb) { + const GLuint name = 0; + + _mesa_init_renderbuffer(&drb->Base, name); + + /* Make sure we're using a null-valued GetPointer routine */ + assert(drb->Base.GetPointer(NULL, &drb->Base, 0, 0) == NULL); + + drb->Base.InternalFormat = format; + + if (format == GL_RGBA || format == GL_RGB5 || format == GL_RGBA8) { + /* Color */ + drb->Base._BaseFormat = GL_RGBA; + drb->Base.DataType = GL_UNSIGNED_BYTE; + if (format == GL_RGB5) { + drb->Base.RedBits = 5; + drb->Base.GreenBits = 6; + drb->Base.BlueBits = 5; + } + else { + drb->Base.RedBits = + drb->Base.GreenBits = + drb->Base.BlueBits = + drb->Base.AlphaBits = 8; + } + } + else if (format == GL_DEPTH_COMPONENT16) { + /* Depth */ + drb->Base._BaseFormat = GL_DEPTH_COMPONENT; + /* we always Get/Put 32-bit Z values */ + drb->Base.DataType = GL_UNSIGNED_INT; + drb->Base.DepthBits = 16; + } + else if (format == GL_DEPTH_COMPONENT24) { + /* Depth */ + drb->Base._BaseFormat = GL_DEPTH_COMPONENT; + /* we always Get/Put 32-bit Z values */ + drb->Base.DataType = GL_UNSIGNED_INT; + drb->Base.DepthBits = 24; + } + else if (format == GL_DEPTH_COMPONENT32) { + /* Depth */ + drb->Base._BaseFormat = GL_DEPTH_COMPONENT; + /* we always Get/Put 32-bit Z values */ + drb->Base.DataType = GL_UNSIGNED_INT; + drb->Base.DepthBits = 32; + } + else { + /* Stencil */ + ASSERT(format == GL_STENCIL_INDEX8_EXT); + drb->Base._BaseFormat = GL_STENCIL_INDEX; + drb->Base.DataType = GL_UNSIGNED_BYTE; + drb->Base.StencilBits = 8; + } + + /* XXX if we were allocating a user-created renderbuffer, we'd have + * to fill in the Red/Green/Blue/.../Bits values too. + */ + + drb->Base.AllocStorage = driRenderbufferStorage; + drb->Base.Delete = driDeleteRenderbuffer; + + drb->Base.Data = addr; + + /* DRI renderbuffer-specific fields: */ + drb->dPriv = dPriv; + drb->offset = offset; + drb->pitch = pitch; + drb->cpp = cpp; + + /* may be changed if page flipping is active: */ + drb->flippedOffset = offset; + drb->flippedPitch = pitch; + drb->flippedData = addr; + } + return drb; +} + + +/** + * Update the front and back renderbuffers' flippedPitch/Offset/Data fields. + * If stereo, flip both the left and right pairs. + * This is used when we do double buffering via page flipping. + * \param fb the framebuffer we're page flipping + * \param flipped if true, set flipped values, else set non-flipped values + */ +void +driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped) +{ + const GLuint count = fb->Visual.stereoMode ? 2 : 1; + GLuint lr; /* left or right */ + + /* we shouldn't really call this function if single-buffered, but + * play it safe. + */ + if (!fb->Visual.doubleBufferMode) + return; + + for (lr = 0; lr < count; lr++) { + GLuint frontBuf = (lr == 0) ? BUFFER_FRONT_LEFT : BUFFER_FRONT_RIGHT; + GLuint backBuf = (lr == 0) ? BUFFER_BACK_LEFT : BUFFER_BACK_RIGHT; + driRenderbuffer *front_drb + = (driRenderbuffer *) fb->Attachment[frontBuf].Renderbuffer; + driRenderbuffer *back_drb + = (driRenderbuffer *) fb->Attachment[backBuf].Renderbuffer; + + if (flipped) { + front_drb->flippedOffset = back_drb->offset; + front_drb->flippedPitch = back_drb->pitch; + front_drb->flippedData = back_drb->Base.Data; + back_drb->flippedOffset = front_drb->offset; + back_drb->flippedPitch = front_drb->pitch; + back_drb->flippedData = front_drb->Base.Data; + } + else { + front_drb->flippedOffset = front_drb->offset; + front_drb->flippedPitch = front_drb->pitch; + front_drb->flippedData = front_drb->Base.Data; + back_drb->flippedOffset = back_drb->offset; + back_drb->flippedPitch = back_drb->pitch; + back_drb->flippedData = back_drb->Base.Data; + } + } +} + + +/** + * Check that the gl_framebuffer associated with dPriv is the right size. + * Resize the gl_framebuffer if needed. + * It's expected that the dPriv->driverPrivate member points to a + * gl_framebuffer object. + */ +void +driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv) +{ + struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate; + if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) { + ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h); + assert(fb->Width == dPriv->w); + assert(fb->Height == dPriv->h); + } +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/drirenderbuffer.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,78 @@ + +/** + * A driRenderbuffer is dervied from gl_renderbuffer. + * It describes a color buffer (front or back), a depth buffer, or stencil + * buffer etc. + * Specific to DRI drivers are the offset and pitch fields. + */ + + +#ifndef DRIRENDERBUFFER_H +#define DRIRENDERBUFFER_H + +#include "main/mtypes.h" +#include "dri_util.h" + + +typedef struct { + struct gl_renderbuffer Base; + + /* Chars or bytes per pixel. If Z and Stencil are stored together this + * will typically be 32 whether this a depth or stencil renderbuffer. + */ + GLint cpp; + + /* Buffer position and pitch (row stride). Recall that for today's DRI + * drivers, we have statically allocated color/depth/stencil buffers. + * So this information describes the whole screen, not just a window. + * To address pixels in a window, we need to know the window's position + * and size with respect to the screen. + */ + GLint offset; /* in bytes */ + GLint pitch; /* in pixels */ + + /* If the driver can do page flipping (full-screen double buffering) + * the current front/back buffers may get swapped. + * If page flipping is disabled, these fields will be identical to + * the offset/pitch/Data above. + * If page flipping is enabled, and this is the front(back) renderbuffer, + * flippedOffset/Pitch/Data will have the back(front) renderbuffer's values. + */ + GLint flippedOffset; + GLint flippedPitch; + GLvoid *flippedData; /* mmap'd address of buffer memory, if used */ + + /* Pointer to corresponding __DRIdrawablePrivate. This is used to compute + * the window's position within the framebuffer. + */ + __DRIdrawablePrivate *dPriv; + + /* XXX this is for radeon/r200 only. We should really create a new + * r200Renderbuffer class, derived from this class... not a huge deal. + */ + GLboolean depthHasSurface; + + /** + * A handy flag to know if this is the back color buffer. + * + * \note + * This is currently only used by s3v and tdfx. + */ + GLboolean backBuffer; +} driRenderbuffer; + + +extern driRenderbuffer * +driNewRenderbuffer(GLenum format, GLvoid *addr, + GLint cpp, GLint offset, GLint pitch, + __DRIdrawablePrivate *dPriv); + +extern void +driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped); + + +extern void +driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv); + + +#endif /* DRIRENDERBUFFER_H */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.c xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,944 @@ +/* $XFree86: xc/lib/GL/dri/dri_util.c,v 1.7 2003/04/28 17:01:25 dawes Exp $ */ +/** + * \file dri_util.c + * DRI utility functions. + * + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. + * + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. + */ + + +#include +#include +#include +#include +#include + +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + +#include "main/imports.h" +#define None 0 + +#include "dri_util.h" +#include "drm_sarea.h" +#include "utils.h" + +#ifndef GLX_OML_sync_control +typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRIdrawable *drawable, int32_t *numerator, int32_t *denominator); +#endif + +/** + * This is just a token extension used to signal that the driver + * supports setting a read drawable. + */ +const __DRIextension driReadDrawableExtension = { + __DRI_READ_DRAWABLE, __DRI_READ_DRAWABLE_VERSION +}; + +/** + * Print message to \c stderr if the \c LIBGL_DEBUG environment variable + * is set. + * + * Is called from the drivers. + * + * \param f \c printf like format string. + */ +void +__driUtilMessage(const char *f, ...) +{ + va_list args; + + if (getenv("LIBGL_DEBUG")) { + fprintf(stderr, "libGL error: \n"); + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + fprintf(stderr, "\n"); + } +} + +GLint +driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 ) +{ + if (rect2.x1 > rect1.x1) rect1.x1 = rect2.x1; + if (rect2.x2 < rect1.x2) rect1.x2 = rect2.x2; + if (rect2.y1 > rect1.y1) rect1.y1 = rect2.y1; + if (rect2.y2 < rect1.y2) rect1.y2 = rect2.y2; + + if (rect1.x1 > rect1.x2 || rect1.y1 > rect1.y2) return 0; + + return (rect1.x2 - rect1.x1) * (rect1.y2 - rect1.y1); +} + +/*****************************************************************/ +/** \name Context (un)binding functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Unbind context. + * + * \param scrn the screen. + * \param gc context. + * + * \return \c GL_TRUE on success, or \c GL_FALSE on failure. + * + * \internal + * This function calls __DriverAPIRec::UnbindContext, and then decrements + * __DRIdrawablePrivateRec::refcount which must be non-zero for a successful + * return. + * + * While casting the opaque private pointers associated with the parameters + * into their respective real types it also assures they are not \c NULL. + */ +static int driUnbindContext(__DRIcontext *pcp) +{ + __DRIscreen *psp; + __DRIdrawable *pdp; + __DRIdrawable *prp; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driUnbindContext. + */ + + if (pcp == NULL) + return GL_FALSE; + + psp = pcp->driScreenPriv; + pdp = pcp->driDrawablePriv; + prp = pcp->driReadablePriv; + + /* Let driver unbind drawable from context */ + (*psp->DriverAPI.UnbindContext)(pcp); + + if (pdp->refcount == 0) { + /* ERROR!!! */ + return GL_FALSE; + } + + pdp->refcount--; + + if (prp != pdp) { + if (prp->refcount == 0) { + /* ERROR!!! */ + return GL_FALSE; + } + + prp->refcount--; + } + + + /* XXX this is disabled so that if we call SwapBuffers on an unbound + * window we can determine the last context bound to the window and + * use that context's lock. (BrianP, 2-Dec-2000) + */ +#if 0 + /* Unbind the drawable */ + pcp->driDrawablePriv = NULL; + pdp->driContextPriv = &psp->dummyContextPriv; +#endif + + return GL_TRUE; +} + +/** + * This function takes both a read buffer and a draw buffer. This is needed + * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent + * function. + */ +static int driBindContext(__DRIcontext *pcp, + __DRIdrawable *pdp, + __DRIdrawable *prp) +{ + __DRIscreenPrivate *psp = pcp->driScreenPriv; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driBindContext. + */ + + if (pcp == NULL || pdp == None || prp == None) + return GL_FALSE; + + /* Bind the drawable to the context */ + pcp->driDrawablePriv = pdp; + pcp->driReadablePriv = prp; + pdp->driContextPriv = pcp; + pdp->refcount++; + if ( pdp != prp ) { + prp->refcount++; + } + + /* + ** Now that we have a context associated with this drawable, we can + ** initialize the drawable information if has not been done before. + */ + + if (!psp->dri2.enabled) { + if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) { + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + __driUtilUpdateDrawableInfo(pdp); + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + } + + if ((pdp != prp) && (!prp->pStamp || *prp->pStamp != prp->lastStamp)) { + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + __driUtilUpdateDrawableInfo(prp); + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + } + } + + /* Call device-specific MakeCurrent */ + (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp); + + return GL_TRUE; +} + +/*@}*/ + + +/*****************************************************************/ +/** \name Drawable handling functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Update private drawable information. + * + * \param pdp pointer to the private drawable information to update. + * + * This function basically updates the __DRIdrawablePrivate struct's + * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo. + * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which + * compares the __DRIdrwablePrivate pStamp and lastStamp values. If + * the values are different that means we have to update the clipping + * info. + */ +void +__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) +{ + __DRIscreenPrivate *psp = pdp->driScreenPriv; + __DRIcontextPrivate *pcp = pdp->driContextPriv; + + if (!pcp + || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) { + /* ERROR!!! + * ...but we must ignore it. There can be many contexts bound to a + * drawable. + */ + } + + if (pdp->pClipRects) { + _mesa_free(pdp->pClipRects); + pdp->pClipRects = NULL; + } + + if (pdp->pBackClipRects) { + _mesa_free(pdp->pBackClipRects); + pdp->pBackClipRects = NULL; + } + + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + + if (! (*psp->getDrawableInfo->getDrawableInfo)(pdp, + &pdp->index, &pdp->lastStamp, + &pdp->x, &pdp->y, &pdp->w, &pdp->h, + &pdp->numClipRects, &pdp->pClipRects, + &pdp->backX, + &pdp->backY, + &pdp->numBackClipRects, + &pdp->pBackClipRects, + pdp->loaderPrivate)) { + /* Error -- eg the window may have been destroyed. Keep going + * with no cliprects. + */ + pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */ + pdp->numClipRects = 0; + pdp->pClipRects = NULL; + pdp->numBackClipRects = 0; + pdp->pBackClipRects = NULL; + } + else + pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp); + + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); +} + +/*@}*/ + +/*****************************************************************/ +/** \name GLX callbacks */ +/*****************************************************************/ +/*@{*/ + +static void driReportDamage(__DRIdrawable *pdp, + struct drm_clip_rect *pClipRects, int numClipRects) +{ + __DRIscreen *psp = pdp->driScreenPriv; + + /* Check that we actually have the new damage report method */ + if (psp->damage) { + /* Report the damage. Currently, all our drivers draw + * directly to the front buffer, so we report the damage there + * rather than to the backing storein (if any). + */ + (*psp->damage->reportDamage)(pdp, + pdp->x, pdp->y, + pClipRects, numClipRects, + GL_TRUE, pdp->loaderPrivate); + } +} + + +/** + * Swap buffers. + * + * \param drawablePrivate opaque pointer to the per-drawable private info. + * + * \internal + * This function calls __DRIdrawablePrivate::swapBuffers. + * + * Is called directly from glXSwapBuffers(). + */ +static void driSwapBuffers(__DRIdrawable *dPriv) +{ + __DRIscreen *psp = dPriv->driScreenPriv; + drm_clip_rect_t *rects; + int i; + + /* In intelCopyBuffer we will update the ClipRects, no need to check here.*/ +/* if (!dPriv->numClipRects) + return;*/ + + psp->DriverAPI.SwapBuffers(dPriv); + + rects = _mesa_malloc(sizeof(*rects) * dPriv->numClipRects); + + if (!rects) + return; + + for (i = 0; i < dPriv->numClipRects; i++) { + rects[i].x1 = dPriv->pClipRects[i].x1 - dPriv->x; + rects[i].y1 = dPriv->pClipRects[i].y1 - dPriv->y; + rects[i].x2 = dPriv->pClipRects[i].x2 - dPriv->x; + rects[i].y2 = dPriv->pClipRects[i].y2 - dPriv->y; + } + + driReportDamage(dPriv, rects, dPriv->numClipRects); + _mesa_free(rects); +} + +static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv, + int64_t *msc ) +{ + return sPriv->DriverAPI.GetDrawableMSC(sPriv, dPriv, msc); +} + + +static int driWaitForMSC(__DRIdrawable *dPriv, int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc) +{ + __DRIswapInfo sInfo; + int status; + + status = dPriv->driScreenPriv->DriverAPI.WaitForMSC( dPriv, target_msc, + divisor, remainder, + msc ); + + /* GetSwapInfo() may not be provided by the driver if GLX_SGI_video_sync + * is supported but GLX_OML_sync_control is not. Therefore, don't return + * an error value if GetSwapInfo() is not implemented. + */ + if ( status == 0 + && dPriv->driScreenPriv->DriverAPI.GetSwapInfo ) { + status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo ); + *sbc = sInfo.swap_count; + } + + return status; +} + + +const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = { + { __DRI_MEDIA_STREAM_COUNTER, __DRI_MEDIA_STREAM_COUNTER_VERSION }, + driWaitForMSC, + driDrawableGetMSC, +}; + + +static void driCopySubBuffer(__DRIdrawable *dPriv, + int x, int y, int w, int h) +{ + drm_clip_rect_t rect; + + rect.x1 = x; + rect.y1 = dPriv->h - y - h; + rect.x2 = x + w; + rect.y2 = rect.y1 + h; + driReportDamage(dPriv, &rect, 1); + + dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h); +} + +const __DRIcopySubBufferExtension driCopySubBufferExtension = { + { __DRI_COPY_SUB_BUFFER, __DRI_COPY_SUB_BUFFER_VERSION }, + driCopySubBuffer +}; + +static void driSetSwapInterval(__DRIdrawable *dPriv, unsigned int interval) +{ + dPriv->swap_interval = interval; +} + +static unsigned int driGetSwapInterval(__DRIdrawable *dPriv) +{ + return dPriv->swap_interval; +} + +const __DRIswapControlExtension driSwapControlExtension = { + { __DRI_SWAP_CONTROL, __DRI_SWAP_CONTROL_VERSION }, + driSetSwapInterval, + driGetSwapInterval +}; + + +/** + * This is called via __DRIscreenRec's createNewDrawable pointer. + */ +static __DRIdrawable * +driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, + drm_drawable_t hwDrawable, int renderType, + const int *attrs, void *data) +{ + __DRIdrawable *pdp; + + /* Since pbuffers are not yet supported, no drawable attributes are + * supported either. + */ + (void) attrs; + + pdp = _mesa_malloc(sizeof *pdp); + if (!pdp) { + return NULL; + } + + pdp->loaderPrivate = data; + pdp->hHWDrawable = hwDrawable; + pdp->refcount = 0; + pdp->pStamp = NULL; + pdp->lastStamp = 0; + pdp->index = 0; + pdp->x = 0; + pdp->y = 0; + pdp->w = 0; + pdp->h = 0; + pdp->numClipRects = 0; + pdp->numBackClipRects = 0; + pdp->pClipRects = NULL; + pdp->pBackClipRects = NULL; + pdp->vblSeq = 0; + pdp->vblFlags = 0; + + pdp->driScreenPriv = psp; + pdp->driContextPriv = &psp->dummyContextPriv; + + if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, + renderType == GLX_PIXMAP_BIT)) { + _mesa_free(pdp); + return NULL; + } + + pdp->msc_base = 0; + + /* This special default value is replaced with the configured + * default value when the drawable is first bound to a direct + * rendering context. + */ + pdp->swap_interval = (unsigned)-1; + + return pdp; +} + + +static __DRIdrawable * +dri2CreateNewDrawable(__DRIscreen *screen, + const __DRIconfig *config, + void *loaderPrivate) +{ + __DRIdrawable *pdraw; + + pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, loaderPrivate); + if (!pdraw) + return NULL; + + pdraw->pClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects); + pdraw->pBackClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects); + + return pdraw; +} + + +static void +driDestroyDrawable(__DRIdrawable *pdp) +{ + __DRIscreenPrivate *psp; + + if (pdp) { + psp = pdp->driScreenPriv; + (*psp->DriverAPI.DestroyBuffer)(pdp); + if (pdp->pClipRects) { + _mesa_free(pdp->pClipRects); + pdp->pClipRects = NULL; + } + if (pdp->pBackClipRects) { + _mesa_free(pdp->pBackClipRects); + pdp->pBackClipRects = NULL; + } + _mesa_free(pdp); + } +} + +/*@}*/ + + +/*****************************************************************/ +/** \name Context handling functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Destroy the per-context private information. + * + * \internal + * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls + * drmDestroyContext(), and finally frees \p contextPrivate. + */ +static void +driDestroyContext(__DRIcontext *pcp) +{ + if (pcp) { + (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); + _mesa_free(pcp); + } +} + + +/** + * Create the per-drawable private driver information. + * + * \param render_type Type of rendering target. \c GLX_RGBA is the only + * type likely to ever be supported for direct-rendering. + * \param shared Context with which to share textures, etc. or NULL + * + * \returns An opaque pointer to the per-context private information on + * success, or \c NULL on failure. + * + * \internal + * This function allocates and fills a __DRIcontextPrivateRec structure. It + * performs some device independent initialization and passes all the + * relevent information to __DriverAPIRec::CreateContext to create the + * context. + * + */ +static __DRIcontext * +driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, + int render_type, __DRIcontext *shared, + drm_context_t hwContext, void *data) +{ + __DRIcontext *pcp; + void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL; + + pcp = _mesa_malloc(sizeof *pcp); + if (!pcp) + return NULL; + + pcp->driScreenPriv = psp; + pcp->driDrawablePriv = NULL; + + /* When the first context is created for a screen, initialize a "dummy" + * context. + */ + + if (!psp->dri2.enabled && !psp->dummyContextPriv.driScreenPriv) { + psp->dummyContextPriv.hHWContext = psp->pSAREA->dummy_context; + psp->dummyContextPriv.driScreenPriv = psp; + psp->dummyContextPriv.driDrawablePriv = NULL; + psp->dummyContextPriv.driverPrivate = NULL; + /* No other fields should be used! */ + } + + pcp->hHWContext = hwContext; + + if ( !(*psp->DriverAPI.CreateContext)(&config->modes, pcp, shareCtx) ) { + _mesa_free(pcp); + return NULL; + } + + return pcp; +} + + +static __DRIcontext * +dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig *config, + __DRIcontext *shared, void *data) +{ + return driCreateNewContext(screen, config, 0, shared, 0, data); +} + + +static int +driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask) +{ + return GL_FALSE; +} + +/*@}*/ + + +/*****************************************************************/ +/** \name Screen handling functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Destroy the per-screen private information. + * + * \internal + * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls + * drmClose(), and finally frees \p screenPrivate. + */ +static void driDestroyScreen(__DRIscreen *psp) +{ + if (psp) { + /* No interaction with the X-server is possible at this point. This + * routine is called after XCloseDisplay, so there is no protocol + * stream open to the X-server anymore. + */ + + if (psp->DriverAPI.DestroyScreen) + (*psp->DriverAPI.DestroyScreen)(psp); + + if (!psp->dri2.enabled) { + (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX); + (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize); + (void)drmCloseOnce(psp->fd); + } + + _mesa_free(psp); + } +} + +static void +setupLoaderExtensions(__DRIscreen *psp, + const __DRIextension **extensions) +{ + int i; + + for (i = 0; extensions[i]; i++) { + if (strcmp(extensions[i]->name, __DRI_GET_DRAWABLE_INFO) == 0) + psp->getDrawableInfo = (__DRIgetDrawableInfoExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_DAMAGE) == 0) + psp->damage = (__DRIdamageExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_SYSTEM_TIME) == 0) + psp->systemTime = (__DRIsystemTimeExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0) + psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i]; + } +} + +/** + * This is the bootstrap function for the driver. libGL supplies all of the + * requisite information about the system, and the driver initializes itself. + * This routine also fills in the linked list pointed to by \c driver_modes + * with the \c __GLcontextModes that the driver can support for windows or + * pbuffers. + * + * For legacy DRI. + * + * \param scrn Index of the screen + * \param ddx_version Version of the 2D DDX. This may not be meaningful for + * all drivers. + * \param dri_version Version of the "server-side" DRI. + * \param drm_version Version of the kernel DRM. + * \param frame_buffer Data describing the location and layout of the + * framebuffer. + * \param pSAREA Pointer the the SAREA. + * \param fd Device handle for the DRM. + * \param extensions ?? + * \param driver_modes Returns modes suppoted by the driver + * \param loaderPrivate ?? + * + * \note There is no need to check the minimum API version in this + * function. Since the name of this function is versioned, it is + * impossible for a loader that is too old to even load this driver. + */ +static __DRIscreen * +driCreateNewScreen(int scrn, + const __DRIversion *ddx_version, + const __DRIversion *dri_version, + const __DRIversion *drm_version, + const __DRIframebuffer *frame_buffer, + drmAddress pSAREA, int fd, + const __DRIextension **extensions, + const __DRIconfig ***driver_modes, + void *loaderPrivate) +{ + static const __DRIextension *emptyExtensionList[] = { NULL }; + __DRIscreen *psp; + + psp = _mesa_calloc(sizeof *psp); + if (!psp) + return NULL; + + setupLoaderExtensions(psp, extensions); + + /* + ** NOT_DONE: This is used by the X server to detect when the client + ** has died while holding the drawable lock. The client sets the + ** drawable lock to this value. + */ + psp->drawLockID = 1; + + psp->drm_version = *drm_version; + psp->ddx_version = *ddx_version; + psp->dri_version = *dri_version; + + psp->pSAREA = pSAREA; + psp->lock = (drmLock *) &psp->pSAREA->lock; + + psp->pFB = frame_buffer->base; + psp->fbSize = frame_buffer->size; + psp->fbStride = frame_buffer->stride; + psp->fbWidth = frame_buffer->width; + psp->fbHeight = frame_buffer->height; + psp->devPrivSize = frame_buffer->dev_priv_size; + psp->pDevPriv = frame_buffer->dev_priv; + psp->fbBPP = psp->fbStride * 8 / frame_buffer->width; + + psp->extensions = emptyExtensionList; + psp->fd = fd; + psp->myNum = scrn; + psp->dri2.enabled = GL_FALSE; + + /* + ** Do not init dummy context here; actual initialization will be + ** done when the first DRI context is created. Init screen priv ptr + ** to NULL to let CreateContext routine that it needs to be inited. + */ + psp->dummyContextPriv.driScreenPriv = NULL; + + psp->DriverAPI = driDriverAPI; + + *driver_modes = driDriverAPI.InitScreen(psp); + if (*driver_modes == NULL) { + _mesa_free(psp); + return NULL; + } + + return psp; +} + +/** + * DRI2 + */ +static __DRIscreen * +dri2CreateNewScreen(int scrn, int fd, + const __DRIextension **extensions, + const __DRIconfig ***driver_configs, void *data) +{ + static const __DRIextension *emptyExtensionList[] = { NULL }; + __DRIscreen *psp; + drmVersionPtr version; + + if (driDriverAPI.InitScreen2 == NULL) + return NULL; + + psp = _mesa_malloc(sizeof(*psp)); + if (!psp) + return NULL; + + setupLoaderExtensions(psp, extensions); + + version = drmGetVersion(fd); + if (version) { + psp->drm_version.major = version->version_major; + psp->drm_version.minor = version->version_minor; + psp->drm_version.patch = version->version_patchlevel; + drmFreeVersion(version); + } + + psp->extensions = emptyExtensionList; + psp->fd = fd; + psp->myNum = scrn; + psp->dri2.enabled = GL_TRUE; + + psp->DriverAPI = driDriverAPI; + *driver_configs = driDriverAPI.InitScreen2(psp); + if (*driver_configs == NULL) { + _mesa_free(psp); + return NULL; + } + + psp->DriverAPI = driDriverAPI; + + return psp; +} + +static const __DRIextension **driGetExtensions(__DRIscreen *psp) +{ + return psp->extensions; +} + +/** Core interface */ +const __DRIcoreExtension driCoreExtension = { + { __DRI_CORE, __DRI_CORE_VERSION }, + NULL, + driDestroyScreen, + driGetExtensions, + driGetConfigAttrib, + driIndexConfigAttrib, + NULL, + driDestroyDrawable, + driSwapBuffers, + NULL, + driCopyContext, + driDestroyContext, + driBindContext, + driUnbindContext +}; + +/** Legacy DRI interface */ +const __DRIlegacyExtension driLegacyExtension = { + { __DRI_LEGACY, __DRI_LEGACY_VERSION }, + driCreateNewScreen, + driCreateNewDrawable, + driCreateNewContext, +}; + +/** Legacy DRI interface */ +const __DRIdri2Extension driDRI2Extension = { + { __DRI_DRI2, __DRI_DRI2_VERSION }, + dri2CreateNewScreen, + dri2CreateNewDrawable, + dri2CreateNewContext, +}; + +/* This is the table of extensions that the loader will dlsym() for. */ +PUBLIC const __DRIextension *__driDriverExtensions[] = { + &driCoreExtension.base, + &driLegacyExtension.base, + &driDRI2Extension.base, + NULL +}; + +static int +driFrameTracking(__DRIdrawable *drawable, GLboolean enable) +{ + return GLX_BAD_CONTEXT; +} + +static int +driQueryFrameTracking(__DRIdrawable *dpriv, + int64_t * sbc, int64_t * missedFrames, + float * lastMissedUsage, float * usage) +{ + __DRIswapInfo sInfo; + int status; + int64_t ust; + __DRIscreenPrivate *psp = dpriv->driScreenPriv; + + status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo ); + if ( status == 0 ) { + *sbc = sInfo.swap_count; + *missedFrames = sInfo.swap_missed_count; + *lastMissedUsage = sInfo.swap_missed_usage; + + (*psp->systemTime->getUST)( & ust ); + *usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust ); + } + + return status; +} + +const __DRIframeTrackingExtension driFrameTrackingExtension = { + { __DRI_FRAME_TRACKING, __DRI_FRAME_TRACKING_VERSION }, + driFrameTracking, + driQueryFrameTracking +}; + +/** + * Calculate amount of swap interval used between GLX buffer swaps. + * + * The usage value, on the range [0,max], is the fraction of total swap + * interval time used between GLX buffer swaps is calculated. + * + * \f$p = t_d / (i * t_r)\f$ + * + * Where \f$t_d\f$ is the time since the last GLX buffer swap, \f$i\f$ is the + * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time + * required for a single vertical refresh period (as returned by \c + * glXGetMscRateOML). + * + * See the documentation for the GLX_MESA_swap_frame_usage extension for more + * details. + * + * \param dPriv Pointer to the private drawable structure. + * \return If less than a single swap interval time period was required + * between GLX buffer swaps, a number greater than 0 and less than + * 1.0 is returned. If exactly one swap interval time period is + * required, 1.0 is returned, and if more than one is required then + * a number greater than 1.0 will be returned. + * + * \sa glXSwapIntervalSGI glXGetMscRateOML + * + * \todo Instead of caching the \c glXGetMscRateOML function pointer, would it + * be possible to cache the sync rate? + */ +float +driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, + int64_t current_ust ) +{ + int32_t n; + int32_t d; + int interval; + float usage = 1.0; + __DRIscreenPrivate *psp = dPriv->driScreenPriv; + + if ( (*psp->systemTime->getMSCRate)(dPriv, &n, &d, dPriv->loaderPrivate) ) { + interval = (dPriv->swap_interval != 0) ? dPriv->swap_interval : 1; + + + /* We want to calculate + * (current_UST - last_swap_UST) / (interval * us_per_refresh). We get + * current_UST by calling __glXGetUST. last_swap_UST is stored in + * dPriv->swap_ust. interval has already been calculated. + * + * The only tricky part is us_per_refresh. us_per_refresh is + * 1000000 / MSC_rate. We know the MSC_rate is n / d. We can flip it + * around and say us_per_refresh = 1000000 * d / n. Since this goes in + * the denominator of the final calculation, we calculate + * (interval * 1000000 * d) and move n into the numerator. + */ + + usage = (current_ust - last_swap_ust); + usage *= n; + usage /= (interval * d); + usage /= 1000000.0; + } + + return usage; +} + +/*@}*/ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/dri_util.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,557 @@ +/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.1 2002/02/22 21:32:52 dawes Exp $ */ +/** + * \file dri_util.h + * DRI utility functions definitions. + * + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. + * + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. + * + * \sa dri_util.c. + * + * \author Kevin E. Martin + * \author Brian Paul + */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef _DRI_UTIL_H_ +#define _DRI_UTIL_H_ + +#include +#include +#include +#include +#include "main/glheader.h" +#include "GL/internal/glcore.h" +#include "GL/internal/dri_interface.h" + +#define GLX_BAD_CONTEXT 5 + +typedef struct __DRIswapInfoRec __DRIswapInfo; + +/* Typedefs to avoid rewriting the world. */ +typedef struct __DRIscreenRec __DRIscreenPrivate; +typedef struct __DRIdrawableRec __DRIdrawablePrivate; +typedef struct __DRIcontextRec __DRIcontextPrivate; + +/** + * Extensions. + */ +extern const __DRIlegacyExtension driLegacyExtension; +extern const __DRIcoreExtension driCoreExtension; +extern const __DRIextension driReadDrawableExtension; +extern const __DRIcopySubBufferExtension driCopySubBufferExtension; +extern const __DRIswapControlExtension driSwapControlExtension; +extern const __DRIframeTrackingExtension driFrameTrackingExtension; +extern const __DRImediaStreamCounterExtension driMediaStreamCounterExtension; + +/** + * Used by DRI_VALIDATE_DRAWABLE_INFO + */ +#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \ + do { \ + if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \ + __driUtilUpdateDrawableInfo(pDrawPriv); \ + } \ + } while (0) + + +/** + * Utility macro to validate the drawable information. + * + * See __DRIdrawable::pStamp and __DRIdrawable::lastStamp. + */ +#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \ +do { \ + while (*(pdp->pStamp) != pdp->lastStamp) { \ + register unsigned int hwContext = psp->pSAREA->lock.lock & \ + ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \ + DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, hwContext); \ + \ + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ + DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ + \ + DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, hwContext); \ + } \ +} while (0) + +/** + * Same as above, but for two drawables simultaneously. + * + */ + +#define DRI_VALIDATE_TWO_DRAWABLES_INFO(psp, pdp, prp) \ +do { \ + while (*((pdp)->pStamp) != (pdp)->lastStamp || \ + *((prp)->pStamp) != (prp)->lastStamp) { \ + register unsigned int hwContext = (psp)->pSAREA->lock.lock & \ + ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \ + DRM_UNLOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext); \ + \ + DRM_SPINLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \ + DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ + DRI_VALIDATE_DRAWABLE_INFO_ONCE(prp); \ + DRM_SPINUNLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \ + \ + DRM_LIGHT_LOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext); \ + } \ +} while (0) + + +/** + * Driver callback functions. + * + * Each DRI driver must have one of these structures with all the pointers set + * to appropriate functions within the driver. + * + * When glXCreateContext() is called, for example, it'll call a helper function + * dri_util.c which in turn will jump through the \a CreateContext pointer in + * this structure. + */ +struct __DriverAPIRec { + const __DRIconfig **(*InitScreen) (__DRIscreen * priv); + + /** + * Screen destruction callback + */ + void (*DestroyScreen)(__DRIscreen *driScrnPriv); + + /** + * Context creation callback + */ + GLboolean (*CreateContext)(const __GLcontextModes *glVis, + __DRIcontext *driContextPriv, + void *sharedContextPrivate); + + /** + * Context destruction callback + */ + void (*DestroyContext)(__DRIcontext *driContextPriv); + + /** + * Buffer (drawable) creation callback + */ + GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv, + __DRIdrawable *driDrawPriv, + const __GLcontextModes *glVis, + GLboolean pixmapBuffer); + + /** + * Buffer (drawable) destruction callback + */ + void (*DestroyBuffer)(__DRIdrawable *driDrawPriv); + + /** + * Buffer swapping callback + */ + void (*SwapBuffers)(__DRIdrawable *driDrawPriv); + + /** + * Context activation callback + */ + GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv, + __DRIdrawable *driDrawPriv, + __DRIdrawable *driReadPriv); + + /** + * Context unbinding callback + */ + GLboolean (*UnbindContext)(__DRIcontext *driContextPriv); + + /** + * Retrieves statistics about buffer swap operations. Required if + * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported. + */ + int (*GetSwapInfo)( __DRIdrawable *dPriv, __DRIswapInfo * sInfo ); + + + /** + * These are required if GLX_OML_sync_control is supported. + */ + /*@{*/ + int (*WaitForMSC)( __DRIdrawable *priv, int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t * msc ); + int (*WaitForSBC)( __DRIdrawable *priv, int64_t target_sbc, + int64_t * msc, int64_t * sbc ); + + int64_t (*SwapBuffersMSC)( __DRIdrawable *priv, int64_t target_msc, + int64_t divisor, int64_t remainder ); + /*@}*/ + void (*CopySubBuffer)(__DRIdrawable *driDrawPriv, + int x, int y, int w, int h); + + /** + * New version of GetMSC so we can pass drawable data to the low + * level DRM driver (e.g. pipe info). Required if + * GLX_SGI_video_sync or GLX_OML_sync_control is supported. + */ + int (*GetDrawableMSC) ( __DRIscreen * priv, + __DRIdrawable *drawablePrivate, + int64_t *count); + + + + /* DRI2 Entry point */ + const __DRIconfig **(*InitScreen2) (__DRIscreen * priv); +}; + +extern const struct __DriverAPIRec driDriverAPI; + + +struct __DRIswapInfoRec { + /** + * Number of swapBuffers operations that have been *completed*. + */ + uint64_t swap_count; + + /** + * Unadjusted system time of the last buffer swap. This is the time + * when the swap completed, not the time when swapBuffers was called. + */ + int64_t swap_ust; + + /** + * Number of swap operations that occurred after the swap deadline. That + * is if a swap happens more than swap_interval frames after the previous + * swap, it has missed its deadline. If swap_interval is 0, then the + * swap deadline is 1 frame after the previous swap. + */ + uint64_t swap_missed_count; + + /** + * Amount of time used by the last swap that missed its deadline. This + * is calculated as (__glXGetUST() - swap_ust) / (swap_interval * + * time_for_single_vrefresh)). If the actual value of swap_interval is + * 0, then 1 is used instead. If swap_missed_count is non-zero, this + * should be greater-than 1.0. + */ + float swap_missed_usage; +}; + + +/** + * Per-drawable private DRI driver information. + */ +struct __DRIdrawableRec { + /** + * Kernel drawable handle + */ + drm_drawable_t hHWDrawable; + + /** + * Driver's private drawable information. + * + * This structure is opaque. + */ + void *driverPrivate; + + /** + * Private data from the loader. We just hold on to it and pass + * it back when calling into loader provided functions. + */ + void *loaderPrivate; + + /** + * Reference count for number of context's currently bound to this + * drawable. + * + * Once it reaches zero, the drawable can be destroyed. + * + * \note This behavior will change with GLX 1.3. + */ + int refcount; + + /** + * Index of this drawable information in the SAREA. + */ + unsigned int index; + + /** + * Pointer to the "drawable has changed ID" stamp in the SAREA. + */ + unsigned int *pStamp; + + /** + * Last value of the stamp. + * + * If this differs from the value stored at __DRIdrawable::pStamp, + * then the drawable information has been modified by the X server, and the + * drawable information (below) should be retrieved from the X server. + */ + unsigned int lastStamp; + + /** + * \name Drawable + * + * Drawable information used in software fallbacks. + */ + /*@{*/ + int x; + int y; + int w; + int h; + int numClipRects; + drm_clip_rect_t *pClipRects; + /*@}*/ + + /** + * \name Back and depthbuffer + * + * Information about the back and depthbuffer where different from above. + */ + /*@{*/ + int backX; + int backY; + int backClipRectType; + int numBackClipRects; + drm_clip_rect_t *pBackClipRects; + /*@}*/ + + /** + * \name Vertical blank tracking information + * Used for waiting on vertical blank events. + */ + /*@{*/ + unsigned int vblSeq; + unsigned int vblFlags; + /*@}*/ + + /** + * \name Monotonic MSC tracking + * + * Low level driver is responsible for updating msc_base and + * vblSeq values so that higher level code can calculate + * a new msc value or msc target for a WaitMSC call. The new value + * will be: + * msc = msc_base + get_vblank_count() - vblank_base; + * + * And for waiting on a value, core code will use: + * actual_target = target_msc - msc_base + vblank_base; + */ + /*@{*/ + int64_t vblank_base; + int64_t msc_base; + /*@}*/ + + /** + * Pointer to context to which this drawable is currently bound. + */ + __DRIcontext *driContextPriv; + + /** + * Pointer to screen on which this drawable was created. + */ + __DRIscreen *driScreenPriv; + + /** + * Controls swap interval as used by GLX_SGI_swap_control and + * GLX_MESA_swap_control. + */ + unsigned int swap_interval; +}; + +/** + * Per-context private driver information. + */ +struct __DRIcontextRec { + /** + * Kernel context handle used to access the device lock. + */ + drm_context_t hHWContext; + + /** + * Device driver's private context data. This structure is opaque. + */ + void *driverPrivate; + + /** + * Pointer back to the \c __DRIcontext that contains this structure. + */ + __DRIcontext *pctx; + + /** + * Pointer to drawable currently bound to this context for drawing. + */ + __DRIdrawable *driDrawablePriv; + + /** + * Pointer to drawable currently bound to this context for reading. + */ + __DRIdrawable *driReadablePriv; + + /** + * Pointer to screen on which this context was created. + */ + __DRIscreen *driScreenPriv; +}; + +/** + * Per-screen private driver information. + */ +struct __DRIscreenRec { + /** + * Current screen's number + */ + int myNum; + + /** + * Callback functions into the hardware-specific DRI driver code. + */ + struct __DriverAPIRec DriverAPI; + + const __DRIextension **extensions; + /** + * DDX / 2D driver version information. + */ + __DRIversion ddx_version; + + /** + * DRI X extension version information. + */ + __DRIversion dri_version; + + /** + * DRM (kernel module) version information. + */ + __DRIversion drm_version; + + /** + * ID used when the client sets the drawable lock. + * + * The X server uses this value to detect if the client has died while + * holding the drawable lock. + */ + int drawLockID; + + /** + * File descriptor returned when the kernel device driver is opened. + * + * Used to: + * - authenticate client to kernel + * - map the frame buffer, SAREA, etc. + * - close the kernel device driver + */ + int fd; + + /** + * SAREA pointer + * + * Used to access: + * - the device lock + * - the device-independent per-drawable and per-context(?) information + */ + drm_sarea_t *pSAREA; + + /** + * \name Direct frame buffer access information + * Used for software fallbacks. + */ + /*@{*/ + unsigned char *pFB; + int fbSize; + int fbOrigin; + int fbStride; + int fbWidth; + int fbHeight; + int fbBPP; + /*@}*/ + + /** + * \name Device-dependent private information (stored in the SAREA). + * + * This data is accessed by the client driver only. + */ + /*@{*/ + void *pDevPriv; + int devPrivSize; + /*@}*/ + + /** + * Dummy context to which drawables are bound when not bound to any + * other context. + * + * A dummy hHWContext is created for this context, and is used by the GL + * core when a hardware lock is required but the drawable is not currently + * bound (e.g., potentially during a SwapBuffers request). The dummy + * context is created when the first "real" context is created on this + * screen. + */ + __DRIcontext dummyContextPriv; + + /** + * Device-dependent private information (not stored in the SAREA). + * + * This pointer is never touched by the DRI layer. + */ + void *private; + + /** + * Pointer back to the \c __DRIscreen that contains this structure. + */ + __DRIscreen *psc; + + /* Extensions provided by the loader. */ + const __DRIgetDrawableInfoExtension *getDrawableInfo; + const __DRIsystemTimeExtension *systemTime; + const __DRIdamageExtension *damage; + + struct { + /* Flag to indicate that this is a DRI2 screen. Many of the above + * fields will not be valid or initializaed in that case. */ + int enabled; + __DRIdri2LoaderExtension *loader; + } dri2; + + /* The lock actually in use, old sarea or DRI2 */ + drmLock *lock; +}; + +extern void +__driUtilMessage(const char *f, ...); + + +extern void +__driUtilUpdateDrawableInfo(__DRIdrawable *pdp); + +extern float +driCalculateSwapUsage( __DRIdrawable *dPriv, + int64_t last_swap_ust, int64_t current_ust ); + +extern GLint +driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 ); + +#endif /* _DRI_UTIL_H_ */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/extension_helper.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/extension_helper.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/extension_helper.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/extension_helper.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,6337 @@ +/* DO NOT EDIT - This file generated automatically by extension_helper.py (from Mesa) script */ + +/* + * (C) Copyright IBM Corporation 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "utils.h" +#include "glapi/dispatch.h" + +#ifndef NULL +# define NULL 0 +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char UniformMatrix3fvARB_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix3fv\0" + "glUniformMatrix3fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_multisample) +static const char SampleCoverageARB_names[] = + "fi\0" /* Parameter signature */ + "glSampleCoverage\0" + "glSampleCoverageARB\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char ConvolutionFilter1D_names[] = + "iiiiip\0" /* Parameter signature */ + "glConvolutionFilter1D\0" + "glConvolutionFilter1DEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char BeginQueryARB_names[] = + "ii\0" /* Parameter signature */ + "glBeginQuery\0" + "glBeginQueryARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_NV_point_sprite) +static const char PointParameteriNV_names[] = + "ii\0" /* Parameter signature */ + "glPointParameteri\0" + "glPointParameteriNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char GetProgramiv_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramiv\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3sARB_names[] = + "iiii\0" /* Parameter signature */ + "glMultiTexCoord3s\0" + "glMultiTexCoord3sARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3iEXT_names[] = + "iii\0" /* Parameter signature */ + "glSecondaryColor3i\0" + "glSecondaryColor3iEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3fMESA_names[] = + "fff\0" /* Parameter signature */ + "glWindowPos3f\0" + "glWindowPos3fARB\0" + "glWindowPos3fMESA\0" + ""; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const char PixelTexGenParameterfvSGIS_names[] = + "ip\0" /* Parameter signature */ + "glPixelTexGenParameterfvSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char ActiveTextureARB_names[] = + "i\0" /* Parameter signature */ + "glActiveTexture\0" + "glActiveTextureARB\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_blit) +static const char BlitFramebufferEXT_names[] = + "iiiiiiiiii\0" /* Parameter signature */ + "glBlitFramebufferEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4ubvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4ubvNV\0" + ""; +#endif + +#if defined(need_GL_NV_fragment_program) +static const char GetProgramNamedParameterdvNV_names[] = + "iipp\0" /* Parameter signature */ + "glGetProgramNamedParameterdvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char Histogram_names[] = + "iiii\0" /* Parameter signature */ + "glHistogram\0" + "glHistogramEXT\0" + ""; +#endif + +#if defined(need_GL_SGIS_texture4D) +static const char TexImage4DSGIS_names[] = + "iiiiiiiiiip\0" /* Parameter signature */ + "glTexImage4DSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2dvMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos2dv\0" + "glWindowPos2dvARB\0" + "glWindowPos2dvMESA\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiColor3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glReplacementCodeuiColor3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_EXT_blend_equation_separate) || defined(need_GL_ATI_blend_equation_separate) +static const char BlendEquationSeparateEXT_names[] = + "ii\0" /* Parameter signature */ + "glBlendEquationSeparate\0" + "glBlendEquationSeparateEXT\0" + "glBlendEquationSeparateATI\0" + ""; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const char ListParameterfSGIX_names[] = + "iif\0" /* Parameter signature */ + "glListParameterfSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3bEXT_names[] = + "iii\0" /* Parameter signature */ + "glSecondaryColor3b\0" + "glSecondaryColor3bEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord4fColor4fNormal3fVertex4fvSUN_names[] = + "pppp\0" /* Parameter signature */ + "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4svNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4svNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char GetBufferSubDataARB_names[] = + "iiip\0" /* Parameter signature */ + "glGetBufferSubData\0" + "glGetBufferSubDataARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char BufferSubDataARB_names[] = + "iiip\0" /* Parameter signature */ + "glBufferSubData\0" + "glBufferSubDataARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor4ubVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glTexCoord2fColor4ubVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char AttachShader_names[] = + "ii\0" /* Parameter signature */ + "glAttachShader\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2fARB_names[] = + "iff\0" /* Parameter signature */ + "glVertexAttrib2f\0" + "glVertexAttrib2fARB\0" + ""; +#endif + +#if defined(need_GL_MESA_shader_debug) +static const char GetDebugLogLengthMESA_names[] = + "iii\0" /* Parameter signature */ + "glGetDebugLogLengthMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3fARB_names[] = + "ifff\0" /* Parameter signature */ + "glVertexAttrib3f\0" + "glVertexAttrib3fARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char GetQueryivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryiv\0" + "glGetQueryivARB\0" + ""; +#endif + +#if defined(need_GL_EXT_texture3D) +static const char TexImage3D_names[] = + "iiiiiiiiip\0" /* Parameter signature */ + "glTexImage3D\0" + "glTexImage3DEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiVertex3fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glReplacementCodeuiVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char GetQueryObjectivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryObjectiv\0" + "glGetQueryObjectivARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiTexCoord2fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char CompressedTexSubImage2DARB_names[] = + "iiiiiiiip\0" /* Parameter signature */ + "glCompressedTexSubImage2D\0" + "glCompressedTexSubImage2DARB\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char CombinerOutputNV_names[] = + "iiiiiiiiii\0" /* Parameter signature */ + "glCombinerOutputNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform2fARB_names[] = + "iff\0" /* Parameter signature */ + "glUniform2f\0" + "glUniform2fARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1svARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1sv\0" + "glVertexAttrib1svARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs1dvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs1dvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform2ivARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform2iv\0" + "glUniform2ivARB\0" + ""; +#endif + +#if defined(need_GL_HP_image_transform) +static const char GetImageTransformParameterfvHP_names[] = + "iip\0" /* Parameter signature */ + "glGetImageTransformParameterfvHP\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightubvARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightubvARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1fvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1fvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char CopyConvolutionFilter1D_names[] = + "iiiii\0" /* Parameter signature */ + "glCopyConvolutionFilter1D\0" + "glCopyConvolutionFilter1DEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiNormal3fVertex3fSUN_names[] = + "iffffff\0" /* Parameter signature */ + "glReplacementCodeuiNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentMaterialfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glFragmentMaterialfvSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_blend_color) +static const char BlendColor_names[] = + "ffff\0" /* Parameter signature */ + "glBlendColor\0" + "glBlendColorEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char UniformMatrix4fvARB_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix4fv\0" + "glUniformMatrix4fvARB\0" + ""; +#endif + +#if defined(need_GL_APPLE_vertex_array_object) +static const char DeleteVertexArraysAPPLE_names[] = + "ip\0" /* Parameter signature */ + "glDeleteVertexArraysAPPLE\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char ReadInstrumentsSGIX_names[] = + "i\0" /* Parameter signature */ + "glReadInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix2x4fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix2x4fv\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4ubVertex3fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glColor4ubVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_array) +static const char FramebufferTextureLayerEXT_names[] = + "iiiii\0" /* Parameter signature */ + "glFramebufferTextureLayerEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const char GetListParameterivSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetListParameterivSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NusvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4Nusv\0" + "glVertexAttrib4NusvARB\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4svMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos4svMESA\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char CreateProgramObjectARB_names[] = + "\0" /* Parameter signature */ + "glCreateProgramObjectARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightModelivSGIX_names[] = + "ip\0" /* Parameter signature */ + "glFragmentLightModelivSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix4x3fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix4x3fv\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_object) +static const char PrioritizeTextures_names[] = + "ipp\0" /* Parameter signature */ + "glPrioritizeTextures\0" + "glPrioritizeTexturesEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_async) +static const char AsyncMarkerSGIX_names[] = + "i\0" /* Parameter signature */ + "glAsyncMarkerSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactorubSUN_names[] = + "i\0" /* Parameter signature */ + "glGlobalAlphaFactorubSUN\0" + ""; +#endif + +#if defined(need_GL_MESA_shader_debug) +static const char ClearDebugLogMESA_names[] = + "iii\0" /* Parameter signature */ + "glClearDebugLogMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char ResetHistogram_names[] = + "i\0" /* Parameter signature */ + "glResetHistogram\0" + "glResetHistogramEXT\0" + ""; +#endif + +#if defined(need_GL_NV_fragment_program) +static const char GetProgramNamedParameterfvNV_names[] = + "iipp\0" /* Parameter signature */ + "glGetProgramNamedParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_point_parameters) || defined(need_GL_EXT_point_parameters) || defined(need_GL_SGIS_point_parameters) +static const char PointParameterfEXT_names[] = + "if\0" /* Parameter signature */ + "glPointParameterf\0" + "glPointParameterfARB\0" + "glPointParameterfEXT\0" + "glPointParameterfSGIS\0" + ""; +#endif + +#if defined(need_GL_SGIX_polynomial_ffd) +static const char LoadIdentityDeformationMapSGIX_names[] = + "i\0" /* Parameter signature */ + "glLoadIdentityDeformationMapSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char GenFencesNV_names[] = + "ip\0" /* Parameter signature */ + "glGenFencesNV\0" + ""; +#endif + +#if defined(need_GL_HP_image_transform) +static const char ImageTransformParameterfHP_names[] = + "iif\0" /* Parameter signature */ + "glImageTransformParameterfHP\0" + ""; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const char MatrixIndexusvARB_names[] = + "ip\0" /* Parameter signature */ + "glMatrixIndexusvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char DisableVertexAttribArrayARB_names[] = + "i\0" /* Parameter signature */ + "glDisableVertexAttribArray\0" + "glDisableVertexAttribArrayARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char StencilMaskSeparate_names[] = + "ii\0" /* Parameter signature */ + "glStencilMaskSeparate\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramLocalParameter4dARB_names[] = + "iidddd\0" /* Parameter signature */ + "glProgramLocalParameter4dARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char CompressedTexImage3DARB_names[] = + "iiiiiiiip\0" /* Parameter signature */ + "glCompressedTexImage3D\0" + "glCompressedTexImage3DARB\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetConvolutionParameteriv\0" + "glGetConvolutionParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1fARB_names[] = + "if\0" /* Parameter signature */ + "glVertexAttrib1f\0" + "glVertexAttrib1fARB\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char TestFenceNV_names[] = + "i\0" /* Parameter signature */ + "glTestFenceNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1fvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord1fv\0" + "glMultiTexCoord1fvARB\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char ColorFragmentOp2ATI_names[] = + "iiiiiiiiii\0" /* Parameter signature */ + "glColorFragmentOp2ATI\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char SecondaryColorPointerListIBM_names[] = + "iiipi\0" /* Parameter signature */ + "glSecondaryColorPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const char GetPixelTexGenParameterivSGIS_names[] = + "ip\0" /* Parameter signature */ + "glGetPixelTexGenParameterivSGIS\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4fNV_names[] = + "iffff\0" /* Parameter signature */ + "glVertexAttrib4fNV\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeubSUN_names[] = + "i\0" /* Parameter signature */ + "glReplacementCodeubSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_async) +static const char FinishAsyncSGIX_names[] = + "p\0" /* Parameter signature */ + "glFinishAsyncSGIX\0" + ""; +#endif + +#if defined(need_GL_MESA_shader_debug) +static const char GetDebugLogMESA_names[] = + "iiiipp\0" /* Parameter signature */ + "glGetDebugLogMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) +static const char FogCoorddEXT_names[] = + "d\0" /* Parameter signature */ + "glFogCoordd\0" + "glFogCoorddEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4ubVertex3fSUN_names[] = + "iiiifff\0" /* Parameter signature */ + "glColor4ubVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) +static const char FogCoordfEXT_names[] = + "f\0" /* Parameter signature */ + "glFogCoordf\0" + "glFogCoordfEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fVertex3fSUN_names[] = + "fffff\0" /* Parameter signature */ + "glTexCoord2fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactoriSUN_names[] = + "i\0" /* Parameter signature */ + "glGlobalAlphaFactoriSUN\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib2dNV_names[] = + "idd\0" /* Parameter signature */ + "glVertexAttrib2dNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char GetProgramInfoLog_names[] = + "iipp\0" /* Parameter signature */ + "glGetProgramInfoLog\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NbvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4Nbv\0" + "glVertexAttrib4NbvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) +static const char GetActiveAttribARB_names[] = + "iiipppp\0" /* Parameter signature */ + "glGetActiveAttrib\0" + "glGetActiveAttribARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4ubNV_names[] = + "iiiii\0" /* Parameter signature */ + "glVertexAttrib4ubNV\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor4fNormal3fVertex3fSUN_names[] = + "ffffffffffff\0" /* Parameter signature */ + "glTexCoord2fColor4fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char CombinerParameterfvNV_names[] = + "ip\0" /* Parameter signature */ + "glCombinerParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs3dvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs3dvNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs4fvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs4fvNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightiSGIX_names[] = + "iii\0" /* Parameter signature */ + "glFragmentLightiSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_polygon_offset) +static const char PolygonOffsetEXT_names[] = + "ff\0" /* Parameter signature */ + "glPolygonOffsetEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_async) +static const char PollAsyncSGIX_names[] = + "p\0" /* Parameter signature */ + "glPollAsyncSGIX\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char DeleteFragmentShaderATI_names[] = + "i\0" /* Parameter signature */ + "glDeleteFragmentShaderATI\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fNormal3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glTexCoord2fNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) +static const char MultTransposeMatrixdARB_names[] = + "p\0" /* Parameter signature */ + "glMultTransposeMatrixd\0" + "glMultTransposeMatrixdARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2svMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos2sv\0" + "glWindowPos2svARB\0" + "glWindowPos2svMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char CompressedTexImage1DARB_names[] = + "iiiiiip\0" /* Parameter signature */ + "glCompressedTexImage1D\0" + "glCompressedTexImage1DARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib2sNV_names[] = + "iii\0" /* Parameter signature */ + "glVertexAttrib2sNV\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char NormalPointerListIBM_names[] = + "iipi\0" /* Parameter signature */ + "glNormalPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char IndexPointerEXT_names[] = + "iiip\0" /* Parameter signature */ + "glIndexPointerEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char NormalPointerEXT_names[] = + "iiip\0" /* Parameter signature */ + "glNormalPointerEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3dARB_names[] = + "iddd\0" /* Parameter signature */ + "glMultiTexCoord3d\0" + "glMultiTexCoord3dARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2iARB_names[] = + "iii\0" /* Parameter signature */ + "glMultiTexCoord2i\0" + "glMultiTexCoord2iARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names[] = + "iffffffff\0" /* Parameter signature */ + "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2svARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord2sv\0" + "glMultiTexCoord2svARB\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeubvSUN_names[] = + "p\0" /* Parameter signature */ + "glReplacementCodeubvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform3iARB_names[] = + "iiii\0" /* Parameter signature */ + "glUniform3i\0" + "glUniform3iARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char GetFragmentMaterialfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetFragmentMaterialfvSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char GetShaderInfoLog_names[] = + "iipp\0" /* Parameter signature */ + "glGetShaderInfoLog\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightivARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightivARB\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactordSUN_names[] = + "d\0" /* Parameter signature */ + "glGlobalAlphaFactordSUN\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs3fvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs3fvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char GenerateMipmapEXT_names[] = + "i\0" /* Parameter signature */ + "glGenerateMipmapEXT\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char SetFragmentShaderConstantATI_names[] = + "ip\0" /* Parameter signature */ + "glSetFragmentShaderConstantATI\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char GetMapAttribParameterivNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetMapAttribParameterivNV\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char CreateShaderObjectARB_names[] = + "i\0" /* Parameter signature */ + "glCreateShaderObjectARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_sharpen_texture) +static const char GetSharpenTexFuncSGIS_names[] = + "ip\0" /* Parameter signature */ + "glGetSharpenTexFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char BufferDataARB_names[] = + "iipi\0" /* Parameter signature */ + "glBufferData\0" + "glBufferDataARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_array_range) +static const char FlushVertexArrayRangeNV_names[] = + "\0" /* Parameter signature */ + "glFlushVertexArrayRangeNV\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char SampleMapATI_names[] = + "iii\0" /* Parameter signature */ + "glSampleMapATI\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char VertexPointerEXT_names[] = + "iiiip\0" /* Parameter signature */ + "glVertexPointerEXT\0" + ""; +#endif + +#if defined(need_GL_SGIS_texture_filter4) +static const char GetTexFilterFuncSGIS_names[] = + "iip\0" /* Parameter signature */ + "glGetTexFilterFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char GetCombinerOutputParameterfvNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetCombinerOutputParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_subtexture) +static const char TexSubImage1D_names[] = + "iiiiiip\0" /* Parameter signature */ + "glTexSubImage1D\0" + "glTexSubImage1DEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1sARB_names[] = + "ii\0" /* Parameter signature */ + "glVertexAttrib1s\0" + "glVertexAttrib1sARB\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char FinalCombinerInputNV_names[] = + "iiii\0" /* Parameter signature */ + "glFinalCombinerInputNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_flush_raster) +static const char FlushRasterSGIX_names[] = + "\0" /* Parameter signature */ + "glFlushRasterSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiTexCoord2fVertex3fSUN_names[] = + "ifffff\0" /* Parameter signature */ + "glReplacementCodeuiTexCoord2fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform1fARB_names[] = + "if\0" /* Parameter signature */ + "glUniform1f\0" + "glUniform1fARB\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_object) +static const char AreTexturesResident_names[] = + "ipp\0" /* Parameter signature */ + "glAreTexturesResident\0" + "glAreTexturesResidentEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char IsRenderbufferEXT_names[] = + "i\0" /* Parameter signature */ + "glIsRenderbufferEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ATI_separate_stencil) +static const char StencilOpSeparate_names[] = + "iiii\0" /* Parameter signature */ + "glStencilOpSeparate\0" + "glStencilOpSeparateATI\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) +static const char ColorTableParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glColorTableParameteriv\0" + "glColorTableParameterivSGI\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char FogCoordPointerListIBM_names[] = + "iipi\0" /* Parameter signature */ + "glFogCoordPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3dMESA_names[] = + "ddd\0" /* Parameter signature */ + "glWindowPos3d\0" + "glWindowPos3dARB\0" + "glWindowPos3dMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_point_parameters) || defined(need_GL_EXT_point_parameters) || defined(need_GL_SGIS_point_parameters) +static const char PointParameterfvEXT_names[] = + "ip\0" /* Parameter signature */ + "glPointParameterfv\0" + "glPointParameterfvARB\0" + "glPointParameterfvEXT\0" + "glPointParameterfvSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2fvMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos2fv\0" + "glWindowPos2fvARB\0" + "glWindowPos2fvMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3bvEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3bv\0" + "glSecondaryColor3bvEXT\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char VertexPointerListIBM_names[] = + "iiipi\0" /* Parameter signature */ + "glVertexPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetProgramLocalParameterfvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramLocalParameterfvARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentMaterialfSGIX_names[] = + "iif\0" /* Parameter signature */ + "glFragmentMaterialfSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fNormal3fVertex3fSUN_names[] = + "ffffffff\0" /* Parameter signature */ + "glTexCoord2fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char RenderbufferStorageEXT_names[] = + "iiii\0" /* Parameter signature */ + "glRenderbufferStorageEXT\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char IsFenceNV_names[] = + "i\0" /* Parameter signature */ + "glIsFenceNV\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char AttachObjectARB_names[] = + "ii\0" /* Parameter signature */ + "glAttachObjectARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char GetFragmentLightivSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetFragmentLightivSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char UniformMatrix2fvARB_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix2fv\0" + "glUniformMatrix2fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2fARB_names[] = + "iff\0" /* Parameter signature */ + "glMultiTexCoord2f\0" + "glMultiTexCoord2fARB\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char ColorTable_names[] = + "iiiiip\0" /* Parameter signature */ + "glColorTable\0" + "glColorTableSGI\0" + "glColorTableEXT\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char MapControlPointsNV_names[] = + "iiiiiiiip\0" /* Parameter signature */ + "glMapControlPointsNV\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char ConvolutionFilter2D_names[] = + "iiiiiip\0" /* Parameter signature */ + "glConvolutionFilter2D\0" + "glConvolutionFilter2DEXT\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char MapParameterfvNV_names[] = + "iip\0" /* Parameter signature */ + "glMapParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3dvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3dv\0" + "glVertexAttrib3dvARB\0" + ""; +#endif + +#if defined(need_GL_PGI_misc_hints) +static const char HintPGI_names[] = + "ii\0" /* Parameter signature */ + "glHintPGI\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char ConvolutionParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glConvolutionParameteriv\0" + "glConvolutionParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_cull_vertex) +static const char CullParameterdvEXT_names[] = + "ip\0" /* Parameter signature */ + "glCullParameterdvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_fragment_program) +static const char ProgramNamedParameter4fNV_names[] = + "iipffff\0" /* Parameter signature */ + "glProgramNamedParameter4fNV\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color3fVertex3fSUN_names[] = + "ffffff\0" /* Parameter signature */ + "glColor3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char ProgramEnvParameter4fvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramEnvParameter4fvARB\0" + "glProgramParameter4fvNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightModeliSGIX_names[] = + "ii\0" /* Parameter signature */ + "glFragmentLightModeliSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char ConvolutionParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glConvolutionParameterfv\0" + "glConvolutionParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_3DFX_tbuffer) +static const char TbufferMask3DFX_names[] = + "i\0" /* Parameter signature */ + "glTbufferMask3DFX\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char LoadProgramNV_names[] = + "iiip\0" /* Parameter signature */ + "glLoadProgramNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4fvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4fvNV\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char GetAttachedObjectsARB_names[] = + "iipp\0" /* Parameter signature */ + "glGetAttachedObjectsARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform3fvARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform3fv\0" + "glUniform3fvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_draw_range_elements) +static const char DrawRangeElements_names[] = + "iiiiip\0" /* Parameter signature */ + "glDrawRangeElements\0" + "glDrawRangeElementsEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_sprite) +static const char SpriteParameterfvSGIX_names[] = + "ip\0" /* Parameter signature */ + "glSpriteParameterfvSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char CheckFramebufferStatusEXT_names[] = + "i\0" /* Parameter signature */ + "glCheckFramebufferStatusEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactoruiSUN_names[] = + "i\0" /* Parameter signature */ + "glGlobalAlphaFactoruiSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char GetHandleARB_names[] = + "i\0" /* Parameter signature */ + "glGetHandleARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char GetVertexAttribivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribiv\0" + "glGetVertexAttribivARB\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char GetCombinerInputParameterfvNV_names[] = + "iiiip\0" /* Parameter signature */ + "glGetCombinerInputParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char CreateProgram_names[] = + "\0" /* Parameter signature */ + "glCreateProgram\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) +static const char LoadTransposeMatrixdARB_names[] = + "p\0" /* Parameter signature */ + "glLoadTransposeMatrixd\0" + "glLoadTransposeMatrixdARB\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmax_names[] = + "iiiip\0" /* Parameter signature */ + "glGetMinmax\0" + "glGetMinmaxEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char StencilFuncSeparate_names[] = + "iiii\0" /* Parameter signature */ + "glStencilFuncSeparate\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3sEXT_names[] = + "iii\0" /* Parameter signature */ + "glSecondaryColor3s\0" + "glSecondaryColor3sEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color3fVertex3fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glColor3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactorbSUN_names[] = + "i\0" /* Parameter signature */ + "glGlobalAlphaFactorbSUN\0" + ""; +#endif + +#if defined(need_GL_HP_image_transform) +static const char ImageTransformParameterfvHP_names[] = + "iip\0" /* Parameter signature */ + "glImageTransformParameterfvHP\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4ivARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4iv\0" + "glVertexAttrib4ivARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3fNV_names[] = + "ifff\0" /* Parameter signature */ + "glVertexAttrib3fNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs2dvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs2dvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_timer_query) +static const char GetQueryObjectui64vEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryObjectui64vEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3fvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord3fv\0" + "glMultiTexCoord3fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3dEXT_names[] = + "ddd\0" /* Parameter signature */ + "glSecondaryColor3d\0" + "glSecondaryColor3dEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetProgramParameterfvNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetProgramParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char TangentPointerEXT_names[] = + "iip\0" /* Parameter signature */ + "glTangentPointerEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4fNormal3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glColor4fNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char GetInstrumentsSGIX_names[] = + "\0" /* Parameter signature */ + "glGetInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char EvalMapsNV_names[] = + "ii\0" /* Parameter signature */ + "glEvalMapsNV\0" + ""; +#endif + +#if defined(need_GL_EXT_subtexture) +static const char TexSubImage2D_names[] = + "iiiiiiiip\0" /* Parameter signature */ + "glTexSubImage2D\0" + "glTexSubImage2DEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightivSGIX_names[] = + "iip\0" /* Parameter signature */ + "glFragmentLightivSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char DeleteRenderbuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "glDeleteRenderbuffersEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const char PixelTransformParameterfvEXT_names[] = + "iip\0" /* Parameter signature */ + "glPixelTransformParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4bvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4bv\0" + "glVertexAttrib4bvARB\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char AlphaFragmentOp2ATI_names[] = + "iiiiiiiii\0" /* Parameter signature */ + "glAlphaFragmentOp2ATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4sARB_names[] = + "iiiii\0" /* Parameter signature */ + "glMultiTexCoord4s\0" + "glMultiTexCoord4sARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char GetFragmentMaterialivSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetFragmentMaterialivSGIX\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4dMESA_names[] = + "dddd\0" /* Parameter signature */ + "glWindowPos4dMESA\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightPointerARB_names[] = + "iiip\0" /* Parameter signature */ + "glWeightPointerARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2dMESA_names[] = + "dd\0" /* Parameter signature */ + "glWindowPos2d\0" + "glWindowPos2dARB\0" + "glWindowPos2dMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char FramebufferTexture3DEXT_names[] = + "iiiiii\0" /* Parameter signature */ + "glFramebufferTexture3DEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_blend_minmax) +static const char BlendEquation_names[] = + "i\0" /* Parameter signature */ + "glBlendEquation\0" + "glBlendEquationEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3dNV_names[] = + "iddd\0" /* Parameter signature */ + "glVertexAttrib3dNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3dARB_names[] = + "iddd\0" /* Parameter signature */ + "glVertexAttrib3d\0" + "glVertexAttrib3dARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names[] = + "ppppp\0" /* Parameter signature */ + "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4fARB_names[] = + "iffff\0" /* Parameter signature */ + "glVertexAttrib4f\0" + "glVertexAttrib4fARB\0" + ""; +#endif + +#if defined(need_GL_EXT_index_func) +static const char IndexFuncEXT_names[] = + "if\0" /* Parameter signature */ + "glIndexFuncEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const char GetListParameterfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetListParameterfvSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2dvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord2dv\0" + "glMultiTexCoord2dvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_cull_vertex) +static const char CullParameterfvEXT_names[] = + "ip\0" /* Parameter signature */ + "glCullParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_fragment_program) +static const char ProgramNamedParameter4fvNV_names[] = + "iipp\0" /* Parameter signature */ + "glProgramNamedParameter4fvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColorPointerEXT_names[] = + "iiip\0" /* Parameter signature */ + "glSecondaryColorPointer\0" + "glSecondaryColorPointerEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4fvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4fv\0" + "glVertexAttrib4fvARB\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char ColorPointerListIBM_names[] = + "iiipi\0" /* Parameter signature */ + "glColorPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char GetActiveUniformARB_names[] = + "iiipppp\0" /* Parameter signature */ + "glGetActiveUniform\0" + "glGetActiveUniformARB\0" + ""; +#endif + +#if defined(need_GL_HP_image_transform) +static const char ImageTransformParameteriHP_names[] = + "iii\0" /* Parameter signature */ + "glImageTransformParameteriHP\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1svARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord1sv\0" + "glMultiTexCoord1svARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char EndQueryARB_names[] = + "i\0" /* Parameter signature */ + "glEndQuery\0" + "glEndQueryARB\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char DeleteFencesNV_names[] = + "ip\0" /* Parameter signature */ + "glDeleteFencesNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_polynomial_ffd) +static const char DeformationMap3dSGIX_names[] = + "iddiiddiiddiip\0" /* Parameter signature */ + "glDeformationMap3dSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char IsShader_names[] = + "i\0" /* Parameter signature */ + "glIsShader\0" + ""; +#endif + +#if defined(need_GL_HP_image_transform) +static const char GetImageTransformParameterivHP_names[] = + "iip\0" /* Parameter signature */ + "glGetImageTransformParameterivHP\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4ivMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos4ivMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3svARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord3sv\0" + "glMultiTexCoord3svARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4iARB_names[] = + "iiiii\0" /* Parameter signature */ + "glMultiTexCoord4i\0" + "glMultiTexCoord4iARB\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3ivEXT_names[] = + "p\0" /* Parameter signature */ + "glBinormal3ivEXT\0" + ""; +#endif + +#if defined(need_GL_MESA_resize_buffers) +static const char ResizeBuffersMESA_names[] = + "\0" /* Parameter signature */ + "glResizeBuffersMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char GetUniformivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetUniformiv\0" + "glGetUniformivARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const char PixelTexGenParameteriSGIS_names[] = + "ii\0" /* Parameter signature */ + "glPixelTexGenParameteriSGIS\0" + ""; +#endif + +#if defined(need_GL_INTEL_parallel_arrays) +static const char VertexPointervINTEL_names[] = + "iip\0" /* Parameter signature */ + "glVertexPointervINTEL\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names[] = + "pppp\0" /* Parameter signature */ + "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3uiEXT_names[] = + "iii\0" /* Parameter signature */ + "glSecondaryColor3ui\0" + "glSecondaryColor3uiEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char StartInstrumentsSGIX_names[] = + "\0" /* Parameter signature */ + "glStartInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3usvEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3usv\0" + "glSecondaryColor3usvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib2fvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib2fvNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramLocalParameter4dvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramLocalParameter4dvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const char MatrixIndexuivARB_names[] = + "ip\0" /* Parameter signature */ + "glMatrixIndexuivARB\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3sEXT_names[] = + "iii\0" /* Parameter signature */ + "glTangent3sEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactorfSUN_names[] = + "f\0" /* Parameter signature */ + "glGlobalAlphaFactorfSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3iARB_names[] = + "iiii\0" /* Parameter signature */ + "glMultiTexCoord3i\0" + "glMultiTexCoord3iARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char IsProgram_names[] = + "i\0" /* Parameter signature */ + "glIsProgram\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char TexCoordPointerListIBM_names[] = + "iiipi\0" /* Parameter signature */ + "glTexCoordPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactorusSUN_names[] = + "i\0" /* Parameter signature */ + "glGlobalAlphaFactorusSUN\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib2dvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib2dvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char FramebufferRenderbufferEXT_names[] = + "iiii\0" /* Parameter signature */ + "glFramebufferRenderbufferEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1dvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1dvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_object) +static const char GenTextures_names[] = + "ip\0" /* Parameter signature */ + "glGenTextures\0" + "glGenTexturesEXT\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char SetFenceNV_names[] = + "ii\0" /* Parameter signature */ + "glSetFenceNV\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char FramebufferTexture1DEXT_names[] = + "iiiii\0" /* Parameter signature */ + "glFramebufferTexture1DEXT\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char GetCombinerOutputParameterivNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetCombinerOutputParameterivNV\0" + ""; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const char PixelTexGenParameterivSGIS_names[] = + "ip\0" /* Parameter signature */ + "glPixelTexGenParameterivSGIS\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_perturb_normal) +static const char TextureNormalEXT_names[] = + "i\0" /* Parameter signature */ + "glTextureNormalEXT\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char IndexPointerListIBM_names[] = + "iipi\0" /* Parameter signature */ + "glIndexPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightfvARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightfvARB\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4fMESA_names[] = + "ffff\0" /* Parameter signature */ + "glWindowPos4fMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3dvMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos3dv\0" + "glWindowPos3dvARB\0" + "glWindowPos3dvMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_timer_query) +static const char GetQueryObjecti64vEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryObjecti64vEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1dARB_names[] = + "id\0" /* Parameter signature */ + "glMultiTexCoord1d\0" + "glMultiTexCoord1dARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_NV_point_sprite) +static const char PointParameterivNV_names[] = + "ip\0" /* Parameter signature */ + "glPointParameteriv\0" + "glPointParameterivNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform2fvARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform2fv\0" + "glUniform2fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3dvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord3dv\0" + "glMultiTexCoord3dvARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names[] = + "pppp\0" /* Parameter signature */ + "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char DeleteObjectARB_names[] = + "i\0" /* Parameter signature */ + "glDeleteObjectARB\0" + ""; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const char MatrixIndexPointerARB_names[] = + "iiip\0" /* Parameter signature */ + "glMatrixIndexPointerARB\0" + ""; +#endif + +#if defined(need_GL_NV_fragment_program) +static const char ProgramNamedParameter4dvNV_names[] = + "iipp\0" /* Parameter signature */ + "glProgramNamedParameter4dvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3fvEXT_names[] = + "p\0" /* Parameter signature */ + "glTangent3fvEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char BindFramebufferEXT_names[] = + "ii\0" /* Parameter signature */ + "glBindFramebufferEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_reference_plane) +static const char ReferencePlaneSGIX_names[] = + "p\0" /* Parameter signature */ + "glReferencePlaneSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char ValidateProgramARB_names[] = + "i\0" /* Parameter signature */ + "glValidateProgram\0" + "glValidateProgramARB\0" + ""; +#endif + +#if defined(need_GL_EXT_compiled_vertex_array) +static const char UnlockArraysEXT_names[] = + "\0" /* Parameter signature */ + "glUnlockArraysEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor3fVertex3fSUN_names[] = + "ffffffff\0" /* Parameter signature */ + "glTexCoord2fColor3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3fvMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos3fv\0" + "glWindowPos3fvARB\0" + "glWindowPos3fvMESA\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1svNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1svNV\0" + ""; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const char CopyTexSubImage3D_names[] = + "iiiiiiiii\0" /* Parameter signature */ + "glCopyTexSubImage3D\0" + "glCopyTexSubImage3DEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2dARB_names[] = + "idd\0" /* Parameter signature */ + "glVertexAttrib2d\0" + "glVertexAttrib2dARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_texture_color_mask) +static const char TextureColorMaskSGIS_names[] = + "iiii\0" /* Parameter signature */ + "glTextureColorMaskSGIS\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char GetColorTable_names[] = + "iiip\0" /* Parameter signature */ + "glGetColorTable\0" + "glGetColorTableSGI\0" + "glGetColorTableEXT\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) +static const char CopyColorTable_names[] = + "iiiii\0" /* Parameter signature */ + "glCopyColorTable\0" + "glCopyColorTableSGI\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetHistogramParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetHistogramParameterfv\0" + "glGetHistogramParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_INTEL_parallel_arrays) +static const char ColorPointervINTEL_names[] = + "iip\0" /* Parameter signature */ + "glColorPointervINTEL\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char AlphaFragmentOp1ATI_names[] = + "iiiiii\0" /* Parameter signature */ + "glAlphaFragmentOp1ATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3ivARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord3iv\0" + "glMultiTexCoord3ivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2sARB_names[] = + "iii\0" /* Parameter signature */ + "glMultiTexCoord2s\0" + "glMultiTexCoord2sARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1dvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1dv\0" + "glVertexAttrib1dvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_object) +static const char DeleteTextures_names[] = + "ip\0" /* Parameter signature */ + "glDeleteTextures\0" + "glDeleteTexturesEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char TexCoordPointerEXT_names[] = + "iiiip\0" /* Parameter signature */ + "glTexCoordPointerEXT\0" + ""; +#endif + +#if defined(need_GL_SGIS_texture4D) +static const char TexSubImage4DSGIS_names[] = + "iiiiiiiiiiiip\0" /* Parameter signature */ + "glTexSubImage4DSGIS\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners2) +static const char CombinerStageParameterfvNV_names[] = + "iip\0" /* Parameter signature */ + "glCombinerStageParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char StopInstrumentsSGIX_names[] = + "i\0" /* Parameter signature */ + "glStopInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord4fColor4fNormal3fVertex4fSUN_names[] = + "fffffffffffffff\0" /* Parameter signature */ + "glTexCoord4fColor4fNormal3fVertex4fSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_polynomial_ffd) +static const char DeformSGIX_names[] = + "i\0" /* Parameter signature */ + "glDeformSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char GetVertexAttribfvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribfv\0" + "glGetVertexAttribfvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3ivEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3iv\0" + "glSecondaryColor3ivEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix4x2fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix4x2fv\0" + ""; +#endif + +#if defined(need_GL_SGIS_detail_texture) +static const char GetDetailTexFuncSGIS_names[] = + "ip\0" /* Parameter signature */ + "glGetDetailTexFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners2) +static const char GetCombinerStageParameterfvNV_names[] = + "iip\0" /* Parameter signature */ + "glGetCombinerStageParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3fEXT_names[] = + "fff\0" /* Parameter signature */ + "glBinormal3fEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4ubVertex2fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glColor4ubVertex2fvSUN\0" + ""; +#endif + +#if defined(need_GL_SGIS_texture_filter4) +static const char TexFilterFuncSGIS_names[] = + "iiip\0" /* Parameter signature */ + "glTexFilterFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) +static const char SampleMaskSGIS_names[] = + "fi\0" /* Parameter signature */ + "glSampleMaskSGIS\0" + "glSampleMaskEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) +static const char GetAttribLocationARB_names[] = + "ip\0" /* Parameter signature */ + "glGetAttribLocation\0" + "glGetAttribLocationARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4ubvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4ubv\0" + "glVertexAttrib4ubvARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_detail_texture) +static const char DetailTexFuncSGIS_names[] = + "iip\0" /* Parameter signature */ + "glDetailTexFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Normal3fVertex3fSUN_names[] = + "ffffff\0" /* Parameter signature */ + "glNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const char CopyTexImage2D_names[] = + "iiiiiiii\0" /* Parameter signature */ + "glCopyTexImage2D\0" + "glCopyTexImage2DEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char GetBufferPointervARB_names[] = + "iip\0" /* Parameter signature */ + "glGetBufferPointerv\0" + "glGetBufferPointervARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char ProgramEnvParameter4fARB_names[] = + "iiffff\0" /* Parameter signature */ + "glProgramEnvParameter4fARB\0" + "glProgramParameter4fNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform3ivARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform3iv\0" + "glUniform3ivARB\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char GetFenceivNV_names[] = + "iip\0" /* Parameter signature */ + "glGetFenceivNV\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4dvMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos4dvMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_color_subtable) +static const char ColorSubTable_names[] = + "iiiiip\0" /* Parameter signature */ + "glColorSubTable\0" + "glColorSubTableEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4ivARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord4iv\0" + "glMultiTexCoord4ivARB\0" + ""; +#endif + +#if defined(need_GL_EXT_gpu_program_parameters) +static const char ProgramLocalParameters4fvEXT_names[] = + "iiip\0" /* Parameter signature */ + "glProgramLocalParameters4fvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char GetMapAttribParameterfvNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetMapAttribParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4sARB_names[] = + "iiiii\0" /* Parameter signature */ + "glVertexAttrib4s\0" + "glVertexAttrib4sARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char GetQueryObjectuivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryObjectuiv\0" + "glGetQueryObjectuivARB\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char MapParameterivNV_names[] = + "iip\0" /* Parameter signature */ + "glMapParameterivNV\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char GenRenderbuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "glGenRenderbuffersEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2dvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib2dv\0" + "glVertexAttrib2dvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char EdgeFlagPointerEXT_names[] = + "iip\0" /* Parameter signature */ + "glEdgeFlagPointerEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs2svNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs2svNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightbvARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightbvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2fvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib2fv\0" + "glVertexAttrib2fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char GetBufferParameterivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetBufferParameteriv\0" + "glGetBufferParameterivARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const char ListParameteriSGIX_names[] = + "iii\0" /* Parameter signature */ + "glListParameteriSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiColor4fNormal3fVertex3fSUN_names[] = + "iffffffffff\0" /* Parameter signature */ + "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char InstrumentsBufferSGIX_names[] = + "ip\0" /* Parameter signature */ + "glInstrumentsBufferSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NivARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4Niv\0" + "glVertexAttrib4NivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char GetAttachedShaders_names[] = + "iipp\0" /* Parameter signature */ + "glGetAttachedShaders\0" + ""; +#endif + +#if defined(need_GL_APPLE_vertex_array_object) +static const char GenVertexArraysAPPLE_names[] = + "ip\0" /* Parameter signature */ + "glGenVertexArraysAPPLE\0" + ""; +#endif + +#if defined(need_GL_EXT_gpu_program_parameters) +static const char ProgramEnvParameters4fvEXT_names[] = + "iiip\0" /* Parameter signature */ + "glProgramEnvParameters4fvEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] = + "pppp\0" /* Parameter signature */ + "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2iMESA_names[] = + "ii\0" /* Parameter signature */ + "glWindowPos2i\0" + "glWindowPos2iARB\0" + "glWindowPos2iMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3fvEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3fv\0" + "glSecondaryColor3fvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char CompressedTexSubImage1DARB_names[] = + "iiiiiip\0" /* Parameter signature */ + "glCompressedTexSubImage1D\0" + "glCompressedTexSubImage1DARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetVertexAttribivNV_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribivNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetProgramStringARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramStringARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char CompileShaderARB_names[] = + "i\0" /* Parameter signature */ + "glCompileShader\0" + "glCompileShaderARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char DeleteShader_names[] = + "i\0" /* Parameter signature */ + "glDeleteShader\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform3fARB_names[] = + "ifff\0" /* Parameter signature */ + "glUniform3f\0" + "glUniform3fARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const char ListParameterfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glListParameterfvSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3dvEXT_names[] = + "p\0" /* Parameter signature */ + "glTangent3dvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetVertexAttribfvNV_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribfvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3sMESA_names[] = + "iii\0" /* Parameter signature */ + "glWindowPos3s\0" + "glWindowPos3sARB\0" + "glWindowPos3sMESA\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib2svNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib2svNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs1fvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs1fvNV\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fVertex3fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glTexCoord2fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4sMESA_names[] = + "iiii\0" /* Parameter signature */ + "glWindowPos4sMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NuivARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4Nuiv\0" + "glVertexAttrib4NuivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char ClientActiveTextureARB_names[] = + "i\0" /* Parameter signature */ + "glClientActiveTexture\0" + "glClientActiveTextureARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_pixel_texture) +static const char PixelTexGenSGIX_names[] = + "i\0" /* Parameter signature */ + "glPixelTexGenSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeusvSUN_names[] = + "p\0" /* Parameter signature */ + "glReplacementCodeusvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform4fARB_names[] = + "iffff\0" /* Parameter signature */ + "glUniform4f\0" + "glUniform4fARB\0" + ""; +#endif + +#if defined(need_GL_IBM_multimode_draw_arrays) +static const char MultiModeDrawArraysIBM_names[] = + "pppii\0" /* Parameter signature */ + "glMultiModeDrawArraysIBM\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char IsProgramNV_names[] = + "i\0" /* Parameter signature */ + "glIsProgramARB\0" + "glIsProgramNV\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodePointerSUN_names[] = + "iip\0" /* Parameter signature */ + "glReplacementCodePointerSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char ProgramEnvParameter4dARB_names[] = + "iidddd\0" /* Parameter signature */ + "glProgramEnvParameter4dARB\0" + "glProgramParameter4dNV\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) +static const char ColorTableParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glColorTableParameterfv\0" + "glColorTableParameterfvSGI\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightModelfSGIX_names[] = + "if\0" /* Parameter signature */ + "glFragmentLightModelfSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3bvEXT_names[] = + "p\0" /* Parameter signature */ + "glBinormal3bvEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_object) +static const char IsTexture_names[] = + "i\0" /* Parameter signature */ + "glIsTexture\0" + "glIsTextureEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_weighting) +static const char VertexWeightfvEXT_names[] = + "p\0" /* Parameter signature */ + "glVertexWeightfvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1dARB_names[] = + "id\0" /* Parameter signature */ + "glVertexAttrib1d\0" + "glVertexAttrib1dARB\0" + ""; +#endif + +#if defined(need_GL_HP_image_transform) +static const char ImageTransformParameterivHP_names[] = + "iip\0" /* Parameter signature */ + "glImageTransformParameterivHP\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char DeleteQueriesARB_names[] = + "ip\0" /* Parameter signature */ + "glDeleteQueries\0" + "glDeleteQueriesARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4ubVertex2fSUN_names[] = + "iiiiff\0" /* Parameter signature */ + "glColor4ubVertex2fSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentColorMaterialSGIX_names[] = + "ii\0" /* Parameter signature */ + "glFragmentColorMaterialSGIX\0" + ""; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const char CurrentPaletteMatrixARB_names[] = + "i\0" /* Parameter signature */ + "glCurrentPaletteMatrixARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) +static const char SamplePatternSGIS_names[] = + "i\0" /* Parameter signature */ + "glSamplePatternSGIS\0" + "glSamplePatternEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char IsQueryARB_names[] = + "i\0" /* Parameter signature */ + "glIsQuery\0" + "glIsQueryARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] = + "iiiiifff\0" /* Parameter signature */ + "glReplacementCodeuiColor4ubVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4usvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4usv\0" + "glVertexAttrib4usvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char LinkProgramARB_names[] = + "i\0" /* Parameter signature */ + "glLinkProgram\0" + "glLinkProgramARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib2fNV_names[] = + "iff\0" /* Parameter signature */ + "glVertexAttrib2fNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char ShaderSourceARB_names[] = + "iipp\0" /* Parameter signature */ + "glShaderSource\0" + "glShaderSourceARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentMaterialiSGIX_names[] = + "iii\0" /* Parameter signature */ + "glFragmentMaterialiSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3svARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3sv\0" + "glVertexAttrib3svARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char CompressedTexSubImage3DARB_names[] = + "iiiiiiiiiip\0" /* Parameter signature */ + "glCompressedTexSubImage3D\0" + "glCompressedTexSubImage3DARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2ivMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos2iv\0" + "glWindowPos2ivARB\0" + "glWindowPos2ivMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char IsFramebufferEXT_names[] = + "i\0" /* Parameter signature */ + "glIsFramebufferEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform4ivARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform4iv\0" + "glUniform4ivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char GetVertexAttribdvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribdv\0" + "glGetVertexAttribdvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetSeparableFilter_names[] = + "iiippp\0" /* Parameter signature */ + "glGetSeparableFilter\0" + "glGetSeparableFilterEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3dEXT_names[] = + "ddd\0" /* Parameter signature */ + "glBinormal3dEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_sprite) +static const char SpriteParameteriSGIX_names[] = + "ii\0" /* Parameter signature */ + "glSpriteParameteriSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char RequestResidentProgramsNV_names[] = + "ip\0" /* Parameter signature */ + "glRequestResidentProgramsNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_tag_sample_buffer) +static const char TagSampleBufferSGIX_names[] = + "\0" /* Parameter signature */ + "glTagSampleBufferSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeusSUN_names[] = + "i\0" /* Parameter signature */ + "glReplacementCodeusSUN\0" + ""; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const char ListParameterivSGIX_names[] = + "iip\0" /* Parameter signature */ + "glListParameterivSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_multi_draw_arrays) +static const char MultiDrawElementsEXT_names[] = + "ipipi\0" /* Parameter signature */ + "glMultiDrawElements\0" + "glMultiDrawElementsEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform1ivARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform1iv\0" + "glUniform1ivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2sMESA_names[] = + "ii\0" /* Parameter signature */ + "glWindowPos2s\0" + "glWindowPos2sARB\0" + "glWindowPos2sMESA\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightusvARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightusvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) +static const char FogCoordPointerEXT_names[] = + "iip\0" /* Parameter signature */ + "glFogCoordPointer\0" + "glFogCoordPointerEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_index_material) +static const char IndexMaterialEXT_names[] = + "ii\0" /* Parameter signature */ + "glIndexMaterialEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3ubvEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3ubv\0" + "glSecondaryColor3ubvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4dvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4dv\0" + "glVertexAttrib4dvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) +static const char BindAttribLocationARB_names[] = + "iip\0" /* Parameter signature */ + "glBindAttribLocation\0" + "glBindAttribLocationARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2dARB_names[] = + "idd\0" /* Parameter signature */ + "glMultiTexCoord2d\0" + "glMultiTexCoord2dARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char ExecuteProgramNV_names[] = + "iip\0" /* Parameter signature */ + "glExecuteProgramNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char LightEnviSGIX_names[] = + "ii\0" /* Parameter signature */ + "glLightEnviSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeuiSUN_names[] = + "i\0" /* Parameter signature */ + "glReplacementCodeuiSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char FramebufferTexture2DEXT_names[] = + "iiiii\0" /* Parameter signature */ + "glFramebufferTexture2DEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribPointerNV_names[] = + "iiiip\0" /* Parameter signature */ + "glVertexAttribPointerNV\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char GetFramebufferAttachmentParameterivEXT_names[] = + "iiip\0" /* Parameter signature */ + "glGetFramebufferAttachmentParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4dvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord4dv\0" + "glMultiTexCoord4dvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const char PixelTransformParameteriEXT_names[] = + "iii\0" /* Parameter signature */ + "glPixelTransformParameteriEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor4ubVertex3fSUN_names[] = + "ffiiiifff\0" /* Parameter signature */ + "glTexCoord2fColor4ubVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform1iARB_names[] = + "ii\0" /* Parameter signature */ + "glUniform1i\0" + "glUniform1iARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttribPointerARB_names[] = + "iiiiip\0" /* Parameter signature */ + "glVertexAttribPointer\0" + "glVertexAttribPointerARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_sharpen_texture) +static const char SharpenTexFuncSGIS_names[] = + "iip\0" /* Parameter signature */ + "glSharpenTexFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4fvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord4fv\0" + "glMultiTexCoord4fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix2x3fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix2x3fv\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char TrackMatrixNV_names[] = + "iiii\0" /* Parameter signature */ + "glTrackMatrixNV\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char CombinerParameteriNV_names[] = + "ii\0" /* Parameter signature */ + "glCombinerParameteriNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_async) +static const char DeleteAsyncMarkersSGIX_names[] = + "ii\0" /* Parameter signature */ + "glDeleteAsyncMarkersSGIX\0" + ""; +#endif + +#if defined(need_GL_SGIX_async) +static const char IsAsyncMarkerSGIX_names[] = + "i\0" /* Parameter signature */ + "glIsAsyncMarkerSGIX\0" + ""; +#endif + +#if defined(need_GL_SGIX_framezoom) +static const char FrameZoomSGIX_names[] = + "i\0" /* Parameter signature */ + "glFrameZoomSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Normal3fVertex3fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NsvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4Nsv\0" + "glVertexAttrib4NsvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3fvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3fv\0" + "glVertexAttrib3fvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char DeleteFramebuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "glDeleteFramebuffersEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const char GlobalAlphaFactorsSUN_names[] = + "i\0" /* Parameter signature */ + "glGlobalAlphaFactorsSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_texture3D) +static const char TexSubImage3D_names[] = + "iiiiiiiiiip\0" /* Parameter signature */ + "glTexSubImage3D\0" + "glTexSubImage3DEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3fEXT_names[] = + "fff\0" /* Parameter signature */ + "glTangent3fEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3uivEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3uiv\0" + "glSecondaryColor3uivEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const char MatrixIndexubvARB_names[] = + "ip\0" /* Parameter signature */ + "glMatrixIndexubvARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4fNormal3fVertex3fSUN_names[] = + "ffffffffff\0" /* Parameter signature */ + "glColor4fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const char PixelTexGenParameterfSGIS_names[] = + "if\0" /* Parameter signature */ + "glPixelTexGenParameterfSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char CreateShader_names[] = + "i\0" /* Parameter signature */ + "glCreateShader\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char GetColorTableParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameterfv\0" + "glGetColorTableParameterfvSGI\0" + "glGetColorTableParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightModelfvSGIX_names[] = + "ip\0" /* Parameter signature */ + "glFragmentLightModelfvSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord3fARB_names[] = + "ifff\0" /* Parameter signature */ + "glMultiTexCoord3f\0" + "glMultiTexCoord3fARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const char GetPixelTexGenParameterfvSGIS_names[] = + "ip\0" /* Parameter signature */ + "glGetPixelTexGenParameterfvSGIS\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char GenFramebuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "glGenFramebuffersEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetProgramParameterdvNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetProgramParameterdvNV\0" + ""; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const char PixelTransformParameterfEXT_names[] = + "iif\0" /* Parameter signature */ + "glPixelTransformParameterfEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glFragmentLightfvSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char DetachShader_names[] = + "ii\0" /* Parameter signature */ + "glDetachShader\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NubARB_names[] = + "iiiii\0" /* Parameter signature */ + "glVertexAttrib4Nub\0" + "glVertexAttrib4NubARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetProgramEnvParameterfvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramEnvParameterfvARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetTrackMatrixivNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetTrackMatrixivNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3svNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3svNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform4fvARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform4fv\0" + "glUniform4fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) +static const char MultTransposeMatrixfARB_names[] = + "p\0" /* Parameter signature */ + "glMultTransposeMatrixf\0" + "glMultTransposeMatrixfARB\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char ColorFragmentOp1ATI_names[] = + "iiiiiii\0" /* Parameter signature */ + "glColorFragmentOp1ATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char GetUniformfvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetUniformfv\0" + "glGetUniformfvARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names[] = + "iffffffffffff\0" /* Parameter signature */ + "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char DetachObjectARB_names[] = + "ii\0" /* Parameter signature */ + "glDetachObjectARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char VertexBlendARB_names[] = + "i\0" /* Parameter signature */ + "glVertexBlendARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3iMESA_names[] = + "iii\0" /* Parameter signature */ + "glWindowPos3i\0" + "glWindowPos3iARB\0" + "glWindowPos3iMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char SeparableFilter2D_names[] = + "iiiiiipp\0" /* Parameter signature */ + "glSeparableFilter2D\0" + "glSeparableFilter2DEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiColor4ubVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glReplacementCodeuiColor4ubVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char CompressedTexImage2DARB_names[] = + "iiiiiiip\0" /* Parameter signature */ + "glCompressedTexImage2D\0" + "glCompressedTexImage2DARB\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char ArrayElement_names[] = + "i\0" /* Parameter signature */ + "glArrayElement\0" + "glArrayElementEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_depth_bounds_test) +static const char DepthBoundsEXT_names[] = + "dd\0" /* Parameter signature */ + "glDepthBoundsEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char ProgramParameters4fvNV_names[] = + "iiip\0" /* Parameter signature */ + "glProgramParameters4fvNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_polynomial_ffd) +static const char DeformationMap3fSGIX_names[] = + "iffiiffiiffiip\0" /* Parameter signature */ + "glDeformationMap3fSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetProgramivNV_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramivNV\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetMinmaxParameteriv\0" + "glGetMinmaxParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const char CopyTexImage1D_names[] = + "iiiiiii\0" /* Parameter signature */ + "glCopyTexImage1D\0" + "glCopyTexImage1DEXT\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char AlphaFragmentOp3ATI_names[] = + "iiiiiiiiiiii\0" /* Parameter signature */ + "glAlphaFragmentOp3ATI\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetVertexAttribdvNV_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribdvNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3fvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3fvNV\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char GetFinalCombinerInputParameterivNV_names[] = + "iip\0" /* Parameter signature */ + "glGetFinalCombinerInputParameterivNV\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char GetMapParameterivNV_names[] = + "iip\0" /* Parameter signature */ + "glGetMapParameterivNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform4iARB_names[] = + "iiiii\0" /* Parameter signature */ + "glUniform4i\0" + "glUniform4iARB\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char ConvolutionParameteri_names[] = + "iii\0" /* Parameter signature */ + "glConvolutionParameteri\0" + "glConvolutionParameteriEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3sEXT_names[] = + "iii\0" /* Parameter signature */ + "glBinormal3sEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char ConvolutionParameterf_names[] = + "iif\0" /* Parameter signature */ + "glConvolutionParameterf\0" + "glConvolutionParameterfEXT\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char GetColorTableParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameteriv\0" + "glGetColorTableParameterivSGI\0" + "glGetColorTableParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char ProgramEnvParameter4dvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramEnvParameter4dvARB\0" + "glProgramParameter4dvNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs2fvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs2fvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char UseProgramObjectARB_names[] = + "i\0" /* Parameter signature */ + "glUseProgram\0" + "glUseProgramObjectARB\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char GetMapParameterfvNV_names[] = + "iip\0" /* Parameter signature */ + "glGetMapParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char PassTexCoordATI_names[] = + "iii\0" /* Parameter signature */ + "glPassTexCoordATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char DeleteProgram_names[] = + "i\0" /* Parameter signature */ + "glDeleteProgram\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3ivEXT_names[] = + "p\0" /* Parameter signature */ + "glTangent3ivEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3dEXT_names[] = + "ddd\0" /* Parameter signature */ + "glTangent3dEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3dvEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3dv\0" + "glSecondaryColor3dvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_multi_draw_arrays) +static const char MultiDrawArraysEXT_names[] = + "ippi\0" /* Parameter signature */ + "glMultiDrawArrays\0" + "glMultiDrawArraysEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char BindRenderbufferEXT_names[] = + "ii\0" /* Parameter signature */ + "glBindRenderbufferEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4dARB_names[] = + "idddd\0" /* Parameter signature */ + "glMultiTexCoord4d\0" + "glMultiTexCoord4dARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3usEXT_names[] = + "iii\0" /* Parameter signature */ + "glSecondaryColor3us\0" + "glSecondaryColor3usEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramLocalParameter4fvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramLocalParameter4fvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char DeleteProgramsNV_names[] = + "ip\0" /* Parameter signature */ + "glDeleteProgramsARB\0" + "glDeleteProgramsNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1sARB_names[] = + "ii\0" /* Parameter signature */ + "glMultiTexCoord1s\0" + "glMultiTexCoord1sARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiColor3fVertex3fSUN_names[] = + "iffffff\0" /* Parameter signature */ + "glReplacementCodeuiColor3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char GetVertexAttribPointervNV_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribPointerv\0" + "glGetVertexAttribPointervARB\0" + "glGetVertexAttribPointervNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1dvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord1dv\0" + "glMultiTexCoord1dvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform2iARB_names[] = + "iii\0" /* Parameter signature */ + "glUniform2i\0" + "glUniform2iARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char GetProgramStringNV_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramStringNV\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char ColorPointerEXT_names[] = + "iiiip\0" /* Parameter signature */ + "glColorPointerEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char MapBufferARB_names[] = + "ii\0" /* Parameter signature */ + "glMapBuffer\0" + "glMapBufferARB\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3svEXT_names[] = + "p\0" /* Parameter signature */ + "glBinormal3svEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_light_texture) +static const char ApplyTextureEXT_names[] = + "i\0" /* Parameter signature */ + "glApplyTextureEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_light_texture) +static const char TextureMaterialEXT_names[] = + "ii\0" /* Parameter signature */ + "glTextureMaterialEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_light_texture) +static const char TextureLightEXT_names[] = + "i\0" /* Parameter signature */ + "glTextureLightEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char ResetMinmax_names[] = + "i\0" /* Parameter signature */ + "glResetMinmax\0" + "glResetMinmaxEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_sprite) +static const char SpriteParameterfSGIX_names[] = + "if\0" /* Parameter signature */ + "glSpriteParameterfSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4sNV_names[] = + "iiiii\0" /* Parameter signature */ + "glVertexAttrib4sNV\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetConvolutionParameterfv\0" + "glGetConvolutionParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs4dvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs4dvNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4dARB_names[] = + "idddd\0" /* Parameter signature */ + "glVertexAttrib4d\0" + "glVertexAttrib4dARB\0" + ""; +#endif + +#if defined(need_GL_NV_fragment_program) +static const char ProgramNamedParameter4dNV_names[] = + "iipdddd\0" /* Parameter signature */ + "glProgramNamedParameter4dNV\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_weighting) +static const char VertexWeightfEXT_names[] = + "f\0" /* Parameter signature */ + "glVertexWeightfEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) +static const char FogCoordfvEXT_names[] = + "p\0" /* Parameter signature */ + "glFogCoordfv\0" + "glFogCoordfvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1ivARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord1iv\0" + "glMultiTexCoord1ivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3ubEXT_names[] = + "iii\0" /* Parameter signature */ + "glSecondaryColor3ub\0" + "glSecondaryColor3ubEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2ivARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord2iv\0" + "glMultiTexCoord2ivARB\0" + ""; +#endif + +#if defined(need_GL_SGIS_fog_function) +static const char FogFuncSGIS_names[] = + "ip\0" /* Parameter signature */ + "glFogFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const char CopyTexSubImage2D_names[] = + "iiiiiiii\0" /* Parameter signature */ + "glCopyTexSubImage2D\0" + "glCopyTexSubImage2DEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char GetObjectParameterivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetObjectParameterivARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord4fVertex4fSUN_names[] = + "ffffffff\0" /* Parameter signature */ + "glTexCoord4fVertex4fSUN\0" + ""; +#endif + +#if defined(need_GL_APPLE_vertex_array_object) +static const char BindVertexArrayAPPLE_names[] = + "i\0" /* Parameter signature */ + "glBindVertexArrayAPPLE\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetProgramLocalParameterdvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramLocalParameterdvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetHistogramParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetHistogramParameteriv\0" + "glGetHistogramParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1iARB_names[] = + "ii\0" /* Parameter signature */ + "glMultiTexCoord1i\0" + "glMultiTexCoord1iARB\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionFilter_names[] = + "iiip\0" /* Parameter signature */ + "glGetConvolutionFilter\0" + "glGetConvolutionFilterEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetProgramivARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_blend_func_separate) || defined(need_GL_INGR_blend_func_separate) +static const char BlendFuncSeparateEXT_names[] = + "iiii\0" /* Parameter signature */ + "glBlendFuncSeparate\0" + "glBlendFuncSeparateEXT\0" + "glBlendFuncSeparateINGR\0" + ""; +#endif + +#if defined(need_GL_APPLE_vertex_array_object) +static const char IsVertexArrayAPPLE_names[] = + "i\0" /* Parameter signature */ + "glIsVertexArrayAPPLE\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char ProgramParameters4dvNV_names[] = + "iiip\0" /* Parameter signature */ + "glProgramParameters4dvNV\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glTexCoord2fColor3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3dvEXT_names[] = + "p\0" /* Parameter signature */ + "glBinormal3dvEXT\0" + ""; +#endif + +#if defined(need_GL_NV_fence) +static const char FinishFenceNV_names[] = + "i\0" /* Parameter signature */ + "glFinishFenceNV\0" + ""; +#endif + +#if defined(need_GL_SGIS_fog_function) +static const char GetFogFuncSGIS_names[] = + "p\0" /* Parameter signature */ + "glGetFogFuncSGIS\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char GetUniformLocationARB_names[] = + "ip\0" /* Parameter signature */ + "glGetUniformLocation\0" + "glGetUniformLocationARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3fEXT_names[] = + "fff\0" /* Parameter signature */ + "glSecondaryColor3f\0" + "glSecondaryColor3fEXT\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char CombinerInputNV_names[] = + "iiiiii\0" /* Parameter signature */ + "glCombinerInputNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3sARB_names[] = + "iiii\0" /* Parameter signature */ + "glVertexAttrib3s\0" + "glVertexAttrib3sARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glReplacementCodeuiNormal3fVertex3fvSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramStringARB_names[] = + "iiip\0" /* Parameter signature */ + "glProgramStringARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord4fVertex4fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glTexCoord4fVertex4fvSUN\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3sNV_names[] = + "iiii\0" /* Parameter signature */ + "glVertexAttrib3sNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1fNV_names[] = + "if\0" /* Parameter signature */ + "glVertexAttrib1fNV\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentLightfSGIX_names[] = + "iif\0" /* Parameter signature */ + "glFragmentLightfSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) +static const char GetCompressedTexImageARB_names[] = + "iip\0" /* Parameter signature */ + "glGetCompressedTexImage\0" + "glGetCompressedTexImageARB\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_weighting) +static const char VertexWeightPointerEXT_names[] = + "iiip\0" /* Parameter signature */ + "glVertexWeightPointerEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetHistogram_names[] = + "iiiip\0" /* Parameter signature */ + "glGetHistogram\0" + "glGetHistogramEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_stencil_two_side) +static const char ActiveStencilFaceEXT_names[] = + "i\0" /* Parameter signature */ + "glActiveStencilFaceEXT\0" + ""; +#endif + +#if defined(need_GL_ATI_separate_stencil) +static const char StencilFuncSeparateATI_names[] = + "iiii\0" /* Parameter signature */ + "glStencilFuncSeparateATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char GetShaderSourceARB_names[] = + "iipp\0" /* Parameter signature */ + "glGetShaderSource\0" + "glGetShaderSourceARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_igloo_interface) +static const char IglooInterfaceSGIX_names[] = + "ip\0" /* Parameter signature */ + "glIglooInterfaceSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4dNV_names[] = + "idddd\0" /* Parameter signature */ + "glVertexAttrib4dNV\0" + ""; +#endif + +#if defined(need_GL_IBM_multimode_draw_arrays) +static const char MultiModeDrawElementsIBM_names[] = + "ppipii\0" /* Parameter signature */ + "glMultiModeDrawElementsIBM\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4svARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord4sv\0" + "glMultiTexCoord4svARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) +static const char GenQueriesARB_names[] = + "ip\0" /* Parameter signature */ + "glGenQueries\0" + "glGenQueriesARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiVertex3fSUN_names[] = + "ifff\0" /* Parameter signature */ + "glReplacementCodeuiVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3iEXT_names[] = + "iii\0" /* Parameter signature */ + "glTangent3iEXT\0" + ""; +#endif + +#if defined(need_GL_SUN_mesh_array) +static const char DrawMeshArraysSUN_names[] = + "iiii\0" /* Parameter signature */ + "glDrawMeshArraysSUN\0" + ""; +#endif + +#if defined(need_GL_NV_evaluators) +static const char GetMapControlPointsNV_names[] = + "iiiiiip\0" /* Parameter signature */ + "glGetMapControlPointsNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_draw_buffers) || defined(need_GL_ATI_draw_buffers) +static const char DrawBuffersARB_names[] = + "ip\0" /* Parameter signature */ + "glDrawBuffers\0" + "glDrawBuffersARB\0" + "glDrawBuffersATI\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramLocalParameter4fARB_names[] = + "iiffff\0" /* Parameter signature */ + "glProgramLocalParameter4fARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_sprite) +static const char SpriteParameterivSGIX_names[] = + "ip\0" /* Parameter signature */ + "glSpriteParameterivSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord1fARB_names[] = + "if\0" /* Parameter signature */ + "glMultiTexCoord1f\0" + "glMultiTexCoord1fARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs4ubvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs4ubvNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightsvARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightsvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform1fvARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform1fv\0" + "glUniform1fvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const char CopyTexSubImage1D_names[] = + "iiiiii\0" /* Parameter signature */ + "glCopyTexSubImage1D\0" + "glCopyTexSubImage1DEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_texture_object) +static const char BindTexture_names[] = + "ii\0" /* Parameter signature */ + "glBindTexture\0" + "glBindTextureEXT\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char BeginFragmentShaderATI_names[] = + "\0" /* Parameter signature */ + "glBeginFragmentShaderATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord4fARB_names[] = + "iffff\0" /* Parameter signature */ + "glMultiTexCoord4f\0" + "glMultiTexCoord4fARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs3svNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs3svNV\0" + ""; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeuivSUN_names[] = + "p\0" /* Parameter signature */ + "glReplacementCodeuivSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char EnableVertexAttribArrayARB_names[] = + "i\0" /* Parameter signature */ + "glEnableVertexAttribArray\0" + "glEnableVertexAttribArrayARB\0" + ""; +#endif + +#if defined(need_GL_INTEL_parallel_arrays) +static const char NormalPointervINTEL_names[] = + "ip\0" /* Parameter signature */ + "glNormalPointervINTEL\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char CopyConvolutionFilter2D_names[] = + "iiiiii\0" /* Parameter signature */ + "glCopyConvolutionFilter2D\0" + "glCopyConvolutionFilter2DEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3ivMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos3iv\0" + "glWindowPos3ivARB\0" + "glWindowPos3ivMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char IsBufferARB_names[] = + "i\0" /* Parameter signature */ + "glIsBuffer\0" + "glIsBufferARB\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4iMESA_names[] = + "iiii\0" /* Parameter signature */ + "glWindowPos4iMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4uivARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4uiv\0" + "glVertexAttrib4uivARB\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3bvEXT_names[] = + "p\0" /* Parameter signature */ + "glTangent3bvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix3x4fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix3x4fv\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3fvEXT_names[] = + "p\0" /* Parameter signature */ + "glBinormal3fvEXT\0" + ""; +#endif + +#if defined(need_GL_INTEL_parallel_arrays) +static const char TexCoordPointervINTEL_names[] = + "iip\0" /* Parameter signature */ + "glTexCoordPointervINTEL\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char DeleteBuffersARB_names[] = + "ip\0" /* Parameter signature */ + "glDeleteBuffers\0" + "glDeleteBuffersARB\0" + ""; +#endif + +#if defined(need_GL_MESA_window_pos) +static const char WindowPos4fvMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos4fvMESA\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1sNV_names[] = + "ii\0" /* Parameter signature */ + "glVertexAttrib1sNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) +static const char SecondaryColor3svEXT_names[] = + "p\0" /* Parameter signature */ + "glSecondaryColor3sv\0" + "glSecondaryColor3svEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) +static const char LoadTransposeMatrixfARB_names[] = + "p\0" /* Parameter signature */ + "glLoadTransposeMatrixf\0" + "glLoadTransposeMatrixfARB\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char GetPointerv_names[] = + "ip\0" /* Parameter signature */ + "glGetPointerv\0" + "glGetPointervEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3bEXT_names[] = + "iii\0" /* Parameter signature */ + "glTangent3bEXT\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char CombinerParameterfNV_names[] = + "if\0" /* Parameter signature */ + "glCombinerParameterfNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char BindProgramNV_names[] = + "ii\0" /* Parameter signature */ + "glBindProgramARB\0" + "glBindProgramNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4svARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4sv\0" + "glVertexAttrib4svARB\0" + ""; +#endif + +#if defined(need_GL_MESA_shader_debug) +static const char CreateDebugObjectMESA_names[] = + "\0" /* Parameter signature */ + "glCreateDebugObjectMESA\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char GetShaderiv_names[] = + "iip\0" /* Parameter signature */ + "glGetShaderiv\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char BindFragmentShaderATI_names[] = + "i\0" /* Parameter signature */ + "glBindFragmentShaderATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char UnmapBufferARB_names[] = + "i\0" /* Parameter signature */ + "glUnmapBuffer\0" + "glUnmapBufferARB\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char Minmax_names[] = + "iii\0" /* Parameter signature */ + "glMinmax\0" + "glMinmaxEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) +static const char FogCoorddvEXT_names[] = + "p\0" /* Parameter signature */ + "glFogCoorddv\0" + "glFogCoorddvEXT\0" + ""; +#endif + +#if defined(need_GL_SUNX_constant_data) +static const char FinishTextureSUNX_names[] = + "\0" /* Parameter signature */ + "glFinishTextureSUNX\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char GetFragmentLightfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetFragmentLightfvSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char GetFinalCombinerInputParameterfvNV_names[] = + "iip\0" /* Parameter signature */ + "glGetFinalCombinerInputParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char ColorFragmentOp3ATI_names[] = + "iiiiiiiiiiiii\0" /* Parameter signature */ + "glColorFragmentOp3ATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2svARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib2sv\0" + "glVertexAttrib2svARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char AreProgramsResidentNV_names[] = + "ipp\0" /* Parameter signature */ + "glAreProgramsResidentNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos3svMESA_names[] = + "p\0" /* Parameter signature */ + "glWindowPos3sv\0" + "glWindowPos3svARB\0" + "glWindowPos3svMESA\0" + ""; +#endif + +#if defined(need_GL_EXT_color_subtable) +static const char CopyColorSubTable_names[] = + "iiiii\0" /* Parameter signature */ + "glCopyColorSubTable\0" + "glCopyColorSubTableEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightdvARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightdvARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char PollInstrumentsSGIX_names[] = + "p\0" /* Parameter signature */ + "glPollInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NubvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4Nubv\0" + "glVertexAttrib4NubvARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3dvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3dvNV\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char GetObjectParameterfvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetObjectParameterfvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetProgramEnvParameterdvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramEnvParameterdvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_compiled_vertex_array) +static const char LockArraysEXT_names[] = + "ii\0" /* Parameter signature */ + "glLockArraysEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const char PixelTransformParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "glPixelTransformParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char BinormalPointerEXT_names[] = + "iip\0" /* Parameter signature */ + "glBinormalPointerEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1dNV_names[] = + "id\0" /* Parameter signature */ + "glVertexAttrib1dNV\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char GetCombinerInputParameterivNV_names[] = + "iiiip\0" /* Parameter signature */ + "glGetCombinerInputParameterivNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_3) +static const char MultiTexCoord2fvARB_names[] = + "ip\0" /* Parameter signature */ + "glMultiTexCoord2fv\0" + "glMultiTexCoord2fvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char GetRenderbufferParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetRenderbufferParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_NV_register_combiners) +static const char CombinerParameterivNV_names[] = + "ip\0" /* Parameter signature */ + "glCombinerParameterivNV\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char GenFragmentShadersATI_names[] = + "i\0" /* Parameter signature */ + "glGenFragmentShadersATI\0" + ""; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const char DrawArrays_names[] = + "iii\0" /* Parameter signature */ + "glDrawArrays\0" + "glDrawArraysEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const char WeightuivARB_names[] = + "ip\0" /* Parameter signature */ + "glWeightuivARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2sARB_names[] = + "iii\0" /* Parameter signature */ + "glVertexAttrib2s\0" + "glVertexAttrib2sARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_async) +static const char GenAsyncMarkersSGIX_names[] = + "i\0" /* Parameter signature */ + "glGenAsyncMarkersSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Tangent3svEXT_names[] = + "p\0" /* Parameter signature */ + "glTangent3svEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char BindBufferARB_names[] = + "ii\0" /* Parameter signature */ + "glBindBuffer\0" + "glBindBufferARB\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char GetInfoLogARB_names[] = + "iipp\0" /* Parameter signature */ + "glGetInfoLogARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs4svNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs4svNV\0" + ""; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const char EdgeFlagPointerListIBM_names[] = + "ipi\0" /* Parameter signature */ + "glEdgeFlagPointerListIBM\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix3x2fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix3x2fv\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetMinmaxParameterfv\0" + "glGetMinmaxParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1fvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1fv\0" + "glVertexAttrib1fvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) +static const char GenBuffersARB_names[] = + "ip\0" /* Parameter signature */ + "glGenBuffers\0" + "glGenBuffersARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs1svNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs1svNV\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3bEXT_names[] = + "iii\0" /* Parameter signature */ + "glBinormal3bEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const char FragmentMaterialivSGIX_names[] = + "iip\0" /* Parameter signature */ + "glFragmentMaterialivSGIX\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_array_range) +static const char VertexArrayRangeNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexArrayRangeNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char GenProgramsNV_names[] = + "ip\0" /* Parameter signature */ + "glGenProgramsARB\0" + "glGenProgramsNV\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4dvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4dvNV\0" + ""; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const char EndFragmentShaderATI_names[] = + "\0" /* Parameter signature */ + "glEndFragmentShaderATI\0" + ""; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3iEXT_names[] = + "iii\0" /* Parameter signature */ + "glBinormal3iEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) +static const char WindowPos2fMESA_names[] = + "ff\0" /* Parameter signature */ + "glWindowPos2f\0" + "glWindowPos2fARB\0" + "glWindowPos2fMESA\0" + ""; +#endif + +#if defined(need_GL_3DFX_tbuffer) +static const struct dri_extension_function GL_3DFX_tbuffer_functions[] = { + { TbufferMask3DFX_names, TbufferMask3DFX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_APPLE_vertex_array_object) +static const struct dri_extension_function GL_APPLE_vertex_array_object_functions[] = { + { DeleteVertexArraysAPPLE_names, DeleteVertexArraysAPPLE_remap_index, -1 }, + { GenVertexArraysAPPLE_names, GenVertexArraysAPPLE_remap_index, -1 }, + { BindVertexArrayAPPLE_names, BindVertexArrayAPPLE_remap_index, -1 }, + { IsVertexArrayAPPLE_names, IsVertexArrayAPPLE_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_draw_buffers) +static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { + { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = { + { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, + { MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 }, + { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 }, + { CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 }, + { MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_multisample) +static const struct dri_extension_function GL_ARB_multisample_functions[] = { + { SampleCoverageARB_names, SampleCoverageARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_occlusion_query) +static const struct dri_extension_function GL_ARB_occlusion_query_functions[] = { + { BeginQueryARB_names, BeginQueryARB_remap_index, -1 }, + { GetQueryivARB_names, GetQueryivARB_remap_index, -1 }, + { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, -1 }, + { EndQueryARB_names, EndQueryARB_remap_index, -1 }, + { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, -1 }, + { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, -1 }, + { IsQueryARB_names, IsQueryARB_remap_index, -1 }, + { GenQueriesARB_names, GenQueriesARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_point_parameters) +static const struct dri_extension_function GL_ARB_point_parameters_functions[] = { + { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { + { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, + { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, + { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, + { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, + { CreateProgramObjectARB_names, CreateProgramObjectARB_remap_index, -1 }, + { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, + { CreateShaderObjectARB_names, CreateShaderObjectARB_remap_index, -1 }, + { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, + { AttachObjectARB_names, AttachObjectARB_remap_index, -1 }, + { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, + { GetAttachedObjectsARB_names, GetAttachedObjectsARB_remap_index, -1 }, + { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, + { GetHandleARB_names, GetHandleARB_remap_index, -1 }, + { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, + { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, + { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, + { DeleteObjectARB_names, DeleteObjectARB_remap_index, -1 }, + { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, + { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, + { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, + { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, + { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, + { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, + { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, + { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, + { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, + { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, + { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, + { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, + { DetachObjectARB_names, DetachObjectARB_remap_index, -1 }, + { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, + { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, + { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, + { GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, -1 }, + { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, + { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, + { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, + { GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, -1 }, + { GetInfoLogARB_names, GetInfoLogARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_texture_compression) +static const struct dri_extension_function GL_ARB_texture_compression_functions[] = { + { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, -1 }, + { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, -1 }, + { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, -1 }, + { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, -1 }, + { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, -1 }, + { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, -1 }, + { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_transpose_matrix) +static const struct dri_extension_function GL_ARB_transpose_matrix_functions[] = { + { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, -1 }, + { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, -1 }, + { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, -1 }, + { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const struct dri_extension_function GL_ARB_vertex_blend_functions[] = { + { WeightubvARB_names, WeightubvARB_remap_index, -1 }, + { WeightivARB_names, WeightivARB_remap_index, -1 }, + { WeightPointerARB_names, WeightPointerARB_remap_index, -1 }, + { WeightfvARB_names, WeightfvARB_remap_index, -1 }, + { WeightbvARB_names, WeightbvARB_remap_index, -1 }, + { WeightusvARB_names, WeightusvARB_remap_index, -1 }, + { VertexBlendARB_names, VertexBlendARB_remap_index, -1 }, + { WeightsvARB_names, WeightsvARB_remap_index, -1 }, + { WeightdvARB_names, WeightdvARB_remap_index, -1 }, + { WeightuivARB_names, WeightuivARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_vertex_buffer_object) +static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions[] = { + { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, -1 }, + { BufferSubDataARB_names, BufferSubDataARB_remap_index, -1 }, + { BufferDataARB_names, BufferDataARB_remap_index, -1 }, + { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, -1 }, + { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, -1 }, + { MapBufferARB_names, MapBufferARB_remap_index, -1 }, + { IsBufferARB_names, IsBufferARB_remap_index, -1 }, + { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, -1 }, + { UnmapBufferARB_names, UnmapBufferARB_remap_index, -1 }, + { BindBufferARB_names, BindBufferARB_remap_index, -1 }, + { GenBuffersARB_names, GenBuffersARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { + { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, + { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, + { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, + { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, + { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, + { ProgramLocalParameter4dARB_names, ProgramLocalParameter4dARB_remap_index, -1 }, + { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, + { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, + { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, + { GetProgramLocalParameterfvARB_names, GetProgramLocalParameterfvARB_remap_index, -1 }, + { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, + { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, + { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, + { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, + { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, + { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, + { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, + { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, + { ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, -1 }, + { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, + { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, + { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, + { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, + { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 }, + { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, + { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, + { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, + { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, + { GetProgramStringARB_names, GetProgramStringARB_remap_index, -1 }, + { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, + { IsProgramNV_names, IsProgramNV_remap_index, -1 }, + { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, + { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, + { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, + { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, + { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, + { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, + { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, + { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, + { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, + { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, + { GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, -1 }, + { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, + { ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, -1 }, + { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, + { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, + { GetProgramLocalParameterdvARB_names, GetProgramLocalParameterdvARB_remap_index, -1 }, + { GetProgramivARB_names, GetProgramivARB_remap_index, -1 }, + { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, + { ProgramStringARB_names, ProgramStringARB_remap_index, -1 }, + { ProgramLocalParameter4fARB_names, ProgramLocalParameter4fARB_remap_index, -1 }, + { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, + { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, + { BindProgramNV_names, BindProgramNV_remap_index, -1 }, + { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, + { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, + { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, + { GetProgramEnvParameterdvARB_names, GetProgramEnvParameterdvARB_remap_index, -1 }, + { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, + { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, + { GenProgramsNV_names, GenProgramsNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_vertex_shader) +static const struct dri_extension_function GL_ARB_vertex_shader_functions[] = { + { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, + { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, + { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_window_pos) +static const struct dri_extension_function GL_ARB_window_pos_functions[] = { + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ATI_blend_equation_separate) +static const struct dri_extension_function GL_ATI_blend_equation_separate_functions[] = { + { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ATI_draw_buffers) +static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = { + { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { + { ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, -1 }, + { DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, -1 }, + { SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, -1 }, + { SampleMapATI_names, SampleMapATI_remap_index, -1 }, + { AlphaFragmentOp2ATI_names, AlphaFragmentOp2ATI_remap_index, -1 }, + { AlphaFragmentOp1ATI_names, AlphaFragmentOp1ATI_remap_index, -1 }, + { ColorFragmentOp1ATI_names, ColorFragmentOp1ATI_remap_index, -1 }, + { AlphaFragmentOp3ATI_names, AlphaFragmentOp3ATI_remap_index, -1 }, + { PassTexCoordATI_names, PassTexCoordATI_remap_index, -1 }, + { BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, -1 }, + { BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, -1 }, + { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 }, + { GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, -1 }, + { EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ATI_separate_stencil) +static const struct dri_extension_function GL_ATI_separate_stencil_functions[] = { + { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, + { StencilFuncSeparateATI_names, StencilFuncSeparateATI_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_blend_color) +static const struct dri_extension_function GL_EXT_blend_color_functions[] = { + { BlendColor_names, -1, 336 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_blend_equation_separate) +static const struct dri_extension_function GL_EXT_blend_equation_separate_functions[] = { + { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_blend_func_separate) +static const struct dri_extension_function GL_EXT_blend_func_separate_functions[] = { + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_blend_minmax) +static const struct dri_extension_function GL_EXT_blend_minmax_functions[] = { + { BlendEquation_names, -1, 337 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_color_subtable) +static const struct dri_extension_function GL_EXT_color_subtable_functions[] = { + { ColorSubTable_names, -1, 346 }, + { CopyColorSubTable_names, -1, 347 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_compiled_vertex_array) +static const struct dri_extension_function GL_EXT_compiled_vertex_array_functions[] = { + { UnlockArraysEXT_names, UnlockArraysEXT_remap_index, -1 }, + { LockArraysEXT_names, LockArraysEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_convolution) +static const struct dri_extension_function GL_EXT_convolution_functions[] = { + { ConvolutionFilter1D_names, -1, 348 }, + { CopyConvolutionFilter1D_names, -1, 354 }, + { GetConvolutionParameteriv_names, -1, 358 }, + { ConvolutionFilter2D_names, -1, 349 }, + { ConvolutionParameteriv_names, -1, 353 }, + { ConvolutionParameterfv_names, -1, 351 }, + { GetSeparableFilter_names, -1, 359 }, + { SeparableFilter2D_names, -1, 360 }, + { ConvolutionParameteri_names, -1, 352 }, + { ConvolutionParameterf_names, -1, 350 }, + { GetConvolutionParameterfv_names, -1, 357 }, + { GetConvolutionFilter_names, -1, 356 }, + { CopyConvolutionFilter2D_names, -1, 355 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = { + { TangentPointerEXT_names, TangentPointerEXT_remap_index, -1 }, + { Binormal3ivEXT_names, Binormal3ivEXT_remap_index, -1 }, + { Tangent3sEXT_names, Tangent3sEXT_remap_index, -1 }, + { Tangent3fvEXT_names, Tangent3fvEXT_remap_index, -1 }, + { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, + { Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 }, + { Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 }, + { Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 }, + { Tangent3fEXT_names, Tangent3fEXT_remap_index, -1 }, + { Binormal3sEXT_names, Binormal3sEXT_remap_index, -1 }, + { Tangent3ivEXT_names, Tangent3ivEXT_remap_index, -1 }, + { Tangent3dEXT_names, Tangent3dEXT_remap_index, -1 }, + { Binormal3svEXT_names, Binormal3svEXT_remap_index, -1 }, + { Binormal3dvEXT_names, Binormal3dvEXT_remap_index, -1 }, + { Tangent3iEXT_names, Tangent3iEXT_remap_index, -1 }, + { Tangent3bvEXT_names, Tangent3bvEXT_remap_index, -1 }, + { Binormal3fvEXT_names, Binormal3fvEXT_remap_index, -1 }, + { Tangent3bEXT_names, Tangent3bEXT_remap_index, -1 }, + { BinormalPointerEXT_names, BinormalPointerEXT_remap_index, -1 }, + { Tangent3svEXT_names, Tangent3svEXT_remap_index, -1 }, + { Binormal3bEXT_names, Binormal3bEXT_remap_index, -1 }, + { Binormal3iEXT_names, Binormal3iEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const struct dri_extension_function GL_EXT_copy_texture_functions[] = { + { CopyTexSubImage3D_names, -1, 373 }, + { CopyTexImage2D_names, -1, 324 }, + { CopyTexImage1D_names, -1, 323 }, + { CopyTexSubImage2D_names, -1, 326 }, + { CopyTexSubImage1D_names, -1, 325 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_cull_vertex) +static const struct dri_extension_function GL_EXT_cull_vertex_functions[] = { + { CullParameterdvEXT_names, CullParameterdvEXT_remap_index, -1 }, + { CullParameterfvEXT_names, CullParameterfvEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_depth_bounds_test) +static const struct dri_extension_function GL_EXT_depth_bounds_test_functions[] = { + { DepthBoundsEXT_names, DepthBoundsEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_draw_range_elements) +static const struct dri_extension_function GL_EXT_draw_range_elements_functions[] = { + { DrawRangeElements_names, -1, 338 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_fog_coord) +static const struct dri_extension_function GL_EXT_fog_coord_functions[] = { + { FogCoorddEXT_names, FogCoorddEXT_remap_index, -1 }, + { FogCoordfEXT_names, FogCoordfEXT_remap_index, -1 }, + { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, -1 }, + { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, -1 }, + { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_framebuffer_blit) +static const struct dri_extension_function GL_EXT_framebuffer_blit_functions[] = { + { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] = { + { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 }, + { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 }, + { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 }, + { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 }, + { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 }, + { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 }, + { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 }, + { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 }, + { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 }, + { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 }, + { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 }, + { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 }, + { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 }, + { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 }, + { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 }, + { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 }, + { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_gpu_program_parameters) +static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = { + { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 }, + { ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_histogram) +static const struct dri_extension_function GL_EXT_histogram_functions[] = { + { Histogram_names, -1, 367 }, + { ResetHistogram_names, -1, 369 }, + { GetMinmax_names, -1, 364 }, + { GetHistogramParameterfv_names, -1, 362 }, + { GetMinmaxParameteriv_names, -1, 366 }, + { ResetMinmax_names, -1, 370 }, + { GetHistogramParameteriv_names, -1, 363 }, + { GetHistogram_names, -1, 361 }, + { Minmax_names, -1, 368 }, + { GetMinmaxParameterfv_names, -1, 365 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_index_func) +static const struct dri_extension_function GL_EXT_index_func_functions[] = { + { IndexFuncEXT_names, IndexFuncEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_index_material) +static const struct dri_extension_function GL_EXT_index_material_functions[] = { + { IndexMaterialEXT_names, IndexMaterialEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_light_texture) +static const struct dri_extension_function GL_EXT_light_texture_functions[] = { + { ApplyTextureEXT_names, ApplyTextureEXT_remap_index, -1 }, + { TextureMaterialEXT_names, TextureMaterialEXT_remap_index, -1 }, + { TextureLightEXT_names, TextureLightEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_multi_draw_arrays) +static const struct dri_extension_function GL_EXT_multi_draw_arrays_functions[] = { + { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, -1 }, + { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_multisample) +static const struct dri_extension_function GL_EXT_multisample_functions[] = { + { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, -1 }, + { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_paletted_texture) +static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = { + { ColorTable_names, -1, 339 }, + { GetColorTable_names, -1, 343 }, + { GetColorTableParameterfv_names, -1, 344 }, + { GetColorTableParameteriv_names, -1, 345 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const struct dri_extension_function GL_EXT_pixel_transform_functions[] = { + { PixelTransformParameterfvEXT_names, PixelTransformParameterfvEXT_remap_index, -1 }, + { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, + { PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_remap_index, -1 }, + { PixelTransformParameterivEXT_names, PixelTransformParameterivEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_point_parameters) +static const struct dri_extension_function GL_EXT_point_parameters_functions[] = { + { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_polygon_offset) +static const struct dri_extension_function GL_EXT_polygon_offset_functions[] = { + { PolygonOffsetEXT_names, PolygonOffsetEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_secondary_color) +static const struct dri_extension_function GL_EXT_secondary_color_functions[] = { + { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, + { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, -1 }, + { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, -1 }, + { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, -1 }, + { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, -1 }, + { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, -1 }, + { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, -1 }, + { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, -1 }, + { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, -1 }, + { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, -1 }, + { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, -1 }, + { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, -1 }, + { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, -1 }, + { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, -1 }, + { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, -1 }, + { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, -1 }, + { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_stencil_two_side) +static const struct dri_extension_function GL_EXT_stencil_two_side_functions[] = { + { ActiveStencilFaceEXT_names, ActiveStencilFaceEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_subtexture) +static const struct dri_extension_function GL_EXT_subtexture_functions[] = { + { TexSubImage1D_names, -1, 332 }, + { TexSubImage2D_names, -1, 333 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_texture3D) +static const struct dri_extension_function GL_EXT_texture3D_functions[] = { + { TexImage3D_names, -1, 371 }, + { TexSubImage3D_names, -1, 372 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_texture_array) +static const struct dri_extension_function GL_EXT_texture_array_functions[] = { + { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_texture_object) +static const struct dri_extension_function GL_EXT_texture_object_functions[] = { + { PrioritizeTextures_names, -1, 331 }, + { AreTexturesResident_names, -1, 322 }, + { GenTextures_names, -1, 328 }, + { DeleteTextures_names, -1, 327 }, + { IsTexture_names, -1, 330 }, + { BindTexture_names, -1, 307 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_texture_perturb_normal) +static const struct dri_extension_function GL_EXT_texture_perturb_normal_functions[] = { + { TextureNormalEXT_names, TextureNormalEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_timer_query) +static const struct dri_extension_function GL_EXT_timer_query_functions[] = { + { GetQueryObjectui64vEXT_names, GetQueryObjectui64vEXT_remap_index, -1 }, + { GetQueryObjecti64vEXT_names, GetQueryObjecti64vEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_vertex_array) +static const struct dri_extension_function GL_EXT_vertex_array_functions[] = { + { IndexPointerEXT_names, IndexPointerEXT_remap_index, -1 }, + { NormalPointerEXT_names, NormalPointerEXT_remap_index, -1 }, + { VertexPointerEXT_names, VertexPointerEXT_remap_index, -1 }, + { TexCoordPointerEXT_names, TexCoordPointerEXT_remap_index, -1 }, + { EdgeFlagPointerEXT_names, EdgeFlagPointerEXT_remap_index, -1 }, + { ArrayElement_names, -1, 306 }, + { ColorPointerEXT_names, ColorPointerEXT_remap_index, -1 }, + { GetPointerv_names, -1, 329 }, + { DrawArrays_names, -1, 310 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_vertex_weighting) +static const struct dri_extension_function GL_EXT_vertex_weighting_functions[] = { + { VertexWeightfvEXT_names, VertexWeightfvEXT_remap_index, -1 }, + { VertexWeightfEXT_names, VertexWeightfEXT_remap_index, -1 }, + { VertexWeightPointerEXT_names, VertexWeightPointerEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_HP_image_transform) +static const struct dri_extension_function GL_HP_image_transform_functions[] = { + { GetImageTransformParameterfvHP_names, GetImageTransformParameterfvHP_remap_index, -1 }, + { ImageTransformParameterfHP_names, ImageTransformParameterfHP_remap_index, -1 }, + { ImageTransformParameterfvHP_names, ImageTransformParameterfvHP_remap_index, -1 }, + { ImageTransformParameteriHP_names, ImageTransformParameteriHP_remap_index, -1 }, + { GetImageTransformParameterivHP_names, GetImageTransformParameterivHP_remap_index, -1 }, + { ImageTransformParameterivHP_names, ImageTransformParameterivHP_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_IBM_multimode_draw_arrays) +static const struct dri_extension_function GL_IBM_multimode_draw_arrays_functions[] = { + { MultiModeDrawArraysIBM_names, MultiModeDrawArraysIBM_remap_index, -1 }, + { MultiModeDrawElementsIBM_names, MultiModeDrawElementsIBM_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const struct dri_extension_function GL_IBM_vertex_array_lists_functions[] = { + { SecondaryColorPointerListIBM_names, SecondaryColorPointerListIBM_remap_index, -1 }, + { NormalPointerListIBM_names, NormalPointerListIBM_remap_index, -1 }, + { FogCoordPointerListIBM_names, FogCoordPointerListIBM_remap_index, -1 }, + { VertexPointerListIBM_names, VertexPointerListIBM_remap_index, -1 }, + { ColorPointerListIBM_names, ColorPointerListIBM_remap_index, -1 }, + { TexCoordPointerListIBM_names, TexCoordPointerListIBM_remap_index, -1 }, + { IndexPointerListIBM_names, IndexPointerListIBM_remap_index, -1 }, + { EdgeFlagPointerListIBM_names, EdgeFlagPointerListIBM_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_INGR_blend_func_separate) +static const struct dri_extension_function GL_INGR_blend_func_separate_functions[] = { + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_INTEL_parallel_arrays) +static const struct dri_extension_function GL_INTEL_parallel_arrays_functions[] = { + { VertexPointervINTEL_names, VertexPointervINTEL_remap_index, -1 }, + { ColorPointervINTEL_names, ColorPointervINTEL_remap_index, -1 }, + { NormalPointervINTEL_names, NormalPointervINTEL_remap_index, -1 }, + { TexCoordPointervINTEL_names, TexCoordPointervINTEL_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_MESA_resize_buffers) +static const struct dri_extension_function GL_MESA_resize_buffers_functions[] = { + { ResizeBuffersMESA_names, ResizeBuffersMESA_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_MESA_shader_debug) +static const struct dri_extension_function GL_MESA_shader_debug_functions[] = { + { GetDebugLogLengthMESA_names, GetDebugLogLengthMESA_remap_index, -1 }, + { ClearDebugLogMESA_names, ClearDebugLogMESA_remap_index, -1 }, + { GetDebugLogMESA_names, GetDebugLogMESA_remap_index, -1 }, + { CreateDebugObjectMESA_names, CreateDebugObjectMESA_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_MESA_window_pos) +static const struct dri_extension_function GL_MESA_window_pos_functions[] = { + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, + { WindowPos4svMESA_names, WindowPos4svMESA_remap_index, -1 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, + { WindowPos4dMESA_names, WindowPos4dMESA_remap_index, -1 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, + { WindowPos4ivMESA_names, WindowPos4ivMESA_remap_index, -1 }, + { WindowPos4fMESA_names, WindowPos4fMESA_remap_index, -1 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, + { WindowPos4dvMESA_names, WindowPos4dvMESA_remap_index, -1 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, + { WindowPos4sMESA_names, WindowPos4sMESA_remap_index, -1 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, + { WindowPos4iMESA_names, WindowPos4iMESA_remap_index, -1 }, + { WindowPos4fvMESA_names, WindowPos4fvMESA_remap_index, -1 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_evaluators) +static const struct dri_extension_function GL_NV_evaluators_functions[] = { + { GetMapAttribParameterivNV_names, GetMapAttribParameterivNV_remap_index, -1 }, + { MapControlPointsNV_names, MapControlPointsNV_remap_index, -1 }, + { MapParameterfvNV_names, MapParameterfvNV_remap_index, -1 }, + { EvalMapsNV_names, EvalMapsNV_remap_index, -1 }, + { GetMapAttribParameterfvNV_names, GetMapAttribParameterfvNV_remap_index, -1 }, + { MapParameterivNV_names, MapParameterivNV_remap_index, -1 }, + { GetMapParameterivNV_names, GetMapParameterivNV_remap_index, -1 }, + { GetMapParameterfvNV_names, GetMapParameterfvNV_remap_index, -1 }, + { GetMapControlPointsNV_names, GetMapControlPointsNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_fence) +static const struct dri_extension_function GL_NV_fence_functions[] = { + { GenFencesNV_names, GenFencesNV_remap_index, -1 }, + { TestFenceNV_names, TestFenceNV_remap_index, -1 }, + { IsFenceNV_names, IsFenceNV_remap_index, -1 }, + { DeleteFencesNV_names, DeleteFencesNV_remap_index, -1 }, + { SetFenceNV_names, SetFenceNV_remap_index, -1 }, + { GetFenceivNV_names, GetFenceivNV_remap_index, -1 }, + { FinishFenceNV_names, FinishFenceNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_fragment_program) +static const struct dri_extension_function GL_NV_fragment_program_functions[] = { + { GetProgramNamedParameterdvNV_names, GetProgramNamedParameterdvNV_remap_index, -1 }, + { GetProgramNamedParameterfvNV_names, GetProgramNamedParameterfvNV_remap_index, -1 }, + { ProgramNamedParameter4fNV_names, ProgramNamedParameter4fNV_remap_index, -1 }, + { ProgramNamedParameter4fvNV_names, ProgramNamedParameter4fvNV_remap_index, -1 }, + { ProgramNamedParameter4dvNV_names, ProgramNamedParameter4dvNV_remap_index, -1 }, + { ProgramNamedParameter4dNV_names, ProgramNamedParameter4dNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_point_sprite) +static const struct dri_extension_function GL_NV_point_sprite_functions[] = { + { PointParameteriNV_names, PointParameteriNV_remap_index, -1 }, + { PointParameterivNV_names, PointParameterivNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_register_combiners) +static const struct dri_extension_function GL_NV_register_combiners_functions[] = { + { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 }, + { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 }, + { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 }, + { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 }, + { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 }, + { GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, -1 }, + { CombinerParameteriNV_names, CombinerParameteriNV_remap_index, -1 }, + { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 }, + { CombinerInputNV_names, CombinerInputNV_remap_index, -1 }, + { CombinerParameterfNV_names, CombinerParameterfNV_remap_index, -1 }, + { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, -1 }, + { GetCombinerInputParameterivNV_names, GetCombinerInputParameterivNV_remap_index, -1 }, + { CombinerParameterivNV_names, CombinerParameterivNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_register_combiners2) +static const struct dri_extension_function GL_NV_register_combiners2_functions[] = { + { CombinerStageParameterfvNV_names, CombinerStageParameterfvNV_remap_index, -1 }, + { GetCombinerStageParameterfvNV_names, GetCombinerStageParameterfvNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_vertex_array_range) +static const struct dri_extension_function GL_NV_vertex_array_range_functions[] = { + { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 }, + { VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_vertex_program) +static const struct dri_extension_function GL_NV_vertex_program_functions[] = { + { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 }, + { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 }, + { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 }, + { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 }, + { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 }, + { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 }, + { VertexAttrib4ubNV_names, VertexAttrib4ubNV_remap_index, -1 }, + { VertexAttribs3dvNV_names, VertexAttribs3dvNV_remap_index, -1 }, + { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, -1 }, + { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, -1 }, + { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, -1 }, + { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, + { LoadProgramNV_names, LoadProgramNV_remap_index, -1 }, + { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, -1 }, + { VertexAttrib3fNV_names, VertexAttrib3fNV_remap_index, -1 }, + { VertexAttribs2dvNV_names, VertexAttribs2dvNV_remap_index, -1 }, + { GetProgramParameterfvNV_names, GetProgramParameterfvNV_remap_index, -1 }, + { VertexAttrib3dNV_names, VertexAttrib3dNV_remap_index, -1 }, + { VertexAttrib2fvNV_names, VertexAttrib2fvNV_remap_index, -1 }, + { VertexAttrib2dvNV_names, VertexAttrib2dvNV_remap_index, -1 }, + { VertexAttrib1dvNV_names, VertexAttrib1dvNV_remap_index, -1 }, + { VertexAttrib1svNV_names, VertexAttrib1svNV_remap_index, -1 }, + { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 }, + { VertexAttribs2svNV_names, VertexAttribs2svNV_remap_index, -1 }, + { GetVertexAttribivNV_names, GetVertexAttribivNV_remap_index, -1 }, + { GetVertexAttribfvNV_names, GetVertexAttribfvNV_remap_index, -1 }, + { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, -1 }, + { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, -1 }, + { IsProgramNV_names, IsProgramNV_remap_index, -1 }, + { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, + { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, -1 }, + { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, -1 }, + { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, -1 }, + { VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, -1 }, + { TrackMatrixNV_names, TrackMatrixNV_remap_index, -1 }, + { GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, -1 }, + { GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, -1 }, + { VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, -1 }, + { ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, -1 }, + { GetProgramivNV_names, GetProgramivNV_remap_index, -1 }, + { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 }, + { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 }, + { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, + { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 }, + { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, + { GetProgramStringNV_names, GetProgramStringNV_remap_index, -1 }, + { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 }, + { VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, -1 }, + { ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, -1 }, + { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 }, + { VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, -1 }, + { VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, -1 }, + { VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, -1 }, + { VertexAttribs3svNV_names, VertexAttribs3svNV_remap_index, -1 }, + { VertexAttrib1sNV_names, VertexAttrib1sNV_remap_index, -1 }, + { BindProgramNV_names, BindProgramNV_remap_index, -1 }, + { AreProgramsResidentNV_names, AreProgramsResidentNV_remap_index, -1 }, + { VertexAttrib3dvNV_names, VertexAttrib3dvNV_remap_index, -1 }, + { VertexAttrib1dNV_names, VertexAttrib1dNV_remap_index, -1 }, + { VertexAttribs4svNV_names, VertexAttribs4svNV_remap_index, -1 }, + { VertexAttribs1svNV_names, VertexAttribs1svNV_remap_index, -1 }, + { GenProgramsNV_names, GenProgramsNV_remap_index, -1 }, + { VertexAttrib4dvNV_names, VertexAttrib4dvNV_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_PGI_misc_hints) +static const struct dri_extension_function GL_PGI_misc_hints_functions[] = { + { HintPGI_names, HintPGI_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_detail_texture) +static const struct dri_extension_function GL_SGIS_detail_texture_functions[] = { + { GetDetailTexFuncSGIS_names, GetDetailTexFuncSGIS_remap_index, -1 }, + { DetailTexFuncSGIS_names, DetailTexFuncSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_fog_function) +static const struct dri_extension_function GL_SGIS_fog_function_functions[] = { + { FogFuncSGIS_names, FogFuncSGIS_remap_index, -1 }, + { GetFogFuncSGIS_names, GetFogFuncSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_multisample) +static const struct dri_extension_function GL_SGIS_multisample_functions[] = { + { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, -1 }, + { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +static const struct dri_extension_function GL_SGIS_pixel_texture_functions[] = { + { PixelTexGenParameterfvSGIS_names, PixelTexGenParameterfvSGIS_remap_index, -1 }, + { GetPixelTexGenParameterivSGIS_names, GetPixelTexGenParameterivSGIS_remap_index, -1 }, + { PixelTexGenParameteriSGIS_names, PixelTexGenParameteriSGIS_remap_index, -1 }, + { PixelTexGenParameterivSGIS_names, PixelTexGenParameterivSGIS_remap_index, -1 }, + { PixelTexGenParameterfSGIS_names, PixelTexGenParameterfSGIS_remap_index, -1 }, + { GetPixelTexGenParameterfvSGIS_names, GetPixelTexGenParameterfvSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_point_parameters) +static const struct dri_extension_function GL_SGIS_point_parameters_functions[] = { + { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_sharpen_texture) +static const struct dri_extension_function GL_SGIS_sharpen_texture_functions[] = { + { GetSharpenTexFuncSGIS_names, GetSharpenTexFuncSGIS_remap_index, -1 }, + { SharpenTexFuncSGIS_names, SharpenTexFuncSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_texture4D) +static const struct dri_extension_function GL_SGIS_texture4D_functions[] = { + { TexImage4DSGIS_names, TexImage4DSGIS_remap_index, -1 }, + { TexSubImage4DSGIS_names, TexSubImage4DSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_texture_color_mask) +static const struct dri_extension_function GL_SGIS_texture_color_mask_functions[] = { + { TextureColorMaskSGIS_names, TextureColorMaskSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIS_texture_filter4) +static const struct dri_extension_function GL_SGIS_texture_filter4_functions[] = { + { GetTexFilterFuncSGIS_names, GetTexFilterFuncSGIS_remap_index, -1 }, + { TexFilterFuncSGIS_names, TexFilterFuncSGIS_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_async) +static const struct dri_extension_function GL_SGIX_async_functions[] = { + { AsyncMarkerSGIX_names, AsyncMarkerSGIX_remap_index, -1 }, + { FinishAsyncSGIX_names, FinishAsyncSGIX_remap_index, -1 }, + { PollAsyncSGIX_names, PollAsyncSGIX_remap_index, -1 }, + { DeleteAsyncMarkersSGIX_names, DeleteAsyncMarkersSGIX_remap_index, -1 }, + { IsAsyncMarkerSGIX_names, IsAsyncMarkerSGIX_remap_index, -1 }, + { GenAsyncMarkersSGIX_names, GenAsyncMarkersSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_flush_raster) +static const struct dri_extension_function GL_SGIX_flush_raster_functions[] = { + { FlushRasterSGIX_names, FlushRasterSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const struct dri_extension_function GL_SGIX_fragment_lighting_functions[] = { + { FragmentMaterialfvSGIX_names, FragmentMaterialfvSGIX_remap_index, -1 }, + { FragmentLightModelivSGIX_names, FragmentLightModelivSGIX_remap_index, -1 }, + { FragmentLightiSGIX_names, FragmentLightiSGIX_remap_index, -1 }, + { GetFragmentMaterialfvSGIX_names, GetFragmentMaterialfvSGIX_remap_index, -1 }, + { FragmentMaterialfSGIX_names, FragmentMaterialfSGIX_remap_index, -1 }, + { GetFragmentLightivSGIX_names, GetFragmentLightivSGIX_remap_index, -1 }, + { FragmentLightModeliSGIX_names, FragmentLightModeliSGIX_remap_index, -1 }, + { FragmentLightivSGIX_names, FragmentLightivSGIX_remap_index, -1 }, + { GetFragmentMaterialivSGIX_names, GetFragmentMaterialivSGIX_remap_index, -1 }, + { FragmentLightModelfSGIX_names, FragmentLightModelfSGIX_remap_index, -1 }, + { FragmentColorMaterialSGIX_names, FragmentColorMaterialSGIX_remap_index, -1 }, + { FragmentMaterialiSGIX_names, FragmentMaterialiSGIX_remap_index, -1 }, + { LightEnviSGIX_names, LightEnviSGIX_remap_index, -1 }, + { FragmentLightModelfvSGIX_names, FragmentLightModelfvSGIX_remap_index, -1 }, + { FragmentLightfvSGIX_names, FragmentLightfvSGIX_remap_index, -1 }, + { FragmentLightfSGIX_names, FragmentLightfSGIX_remap_index, -1 }, + { GetFragmentLightfvSGIX_names, GetFragmentLightfvSGIX_remap_index, -1 }, + { FragmentMaterialivSGIX_names, FragmentMaterialivSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_framezoom) +static const struct dri_extension_function GL_SGIX_framezoom_functions[] = { + { FrameZoomSGIX_names, FrameZoomSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_igloo_interface) +static const struct dri_extension_function GL_SGIX_igloo_interface_functions[] = { + { IglooInterfaceSGIX_names, IglooInterfaceSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_instruments) +static const struct dri_extension_function GL_SGIX_instruments_functions[] = { + { ReadInstrumentsSGIX_names, ReadInstrumentsSGIX_remap_index, -1 }, + { GetInstrumentsSGIX_names, GetInstrumentsSGIX_remap_index, -1 }, + { StartInstrumentsSGIX_names, StartInstrumentsSGIX_remap_index, -1 }, + { StopInstrumentsSGIX_names, StopInstrumentsSGIX_remap_index, -1 }, + { InstrumentsBufferSGIX_names, InstrumentsBufferSGIX_remap_index, -1 }, + { PollInstrumentsSGIX_names, PollInstrumentsSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const struct dri_extension_function GL_SGIX_list_priority_functions[] = { + { ListParameterfSGIX_names, ListParameterfSGIX_remap_index, -1 }, + { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, -1 }, + { GetListParameterfvSGIX_names, GetListParameterfvSGIX_remap_index, -1 }, + { ListParameteriSGIX_names, ListParameteriSGIX_remap_index, -1 }, + { ListParameterfvSGIX_names, ListParameterfvSGIX_remap_index, -1 }, + { ListParameterivSGIX_names, ListParameterivSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_pixel_texture) +static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = { + { PixelTexGenSGIX_names, PixelTexGenSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_polynomial_ffd) +static const struct dri_extension_function GL_SGIX_polynomial_ffd_functions[] = { + { LoadIdentityDeformationMapSGIX_names, LoadIdentityDeformationMapSGIX_remap_index, -1 }, + { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 }, + { DeformSGIX_names, DeformSGIX_remap_index, -1 }, + { DeformationMap3fSGIX_names, DeformationMap3fSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_reference_plane) +static const struct dri_extension_function GL_SGIX_reference_plane_functions[] = { + { ReferencePlaneSGIX_names, ReferencePlaneSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_sprite) +static const struct dri_extension_function GL_SGIX_sprite_functions[] = { + { SpriteParameterfvSGIX_names, SpriteParameterfvSGIX_remap_index, -1 }, + { SpriteParameteriSGIX_names, SpriteParameteriSGIX_remap_index, -1 }, + { SpriteParameterfSGIX_names, SpriteParameterfSGIX_remap_index, -1 }, + { SpriteParameterivSGIX_names, SpriteParameterivSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGIX_tag_sample_buffer) +static const struct dri_extension_function GL_SGIX_tag_sample_buffer_functions[] = { + { TagSampleBufferSGIX_names, TagSampleBufferSGIX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGI_color_table) +static const struct dri_extension_function GL_SGI_color_table_functions[] = { + { ColorTableParameteriv_names, -1, 341 }, + { ColorTable_names, -1, 339 }, + { GetColorTable_names, -1, 343 }, + { CopyColorTable_names, -1, 342 }, + { ColorTableParameterfv_names, -1, 340 }, + { GetColorTableParameterfv_names, -1, 344 }, + { GetColorTableParameteriv_names, -1, 345 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SUNX_constant_data) +static const struct dri_extension_function GL_SUNX_constant_data_functions[] = { + { FinishTextureSUNX_names, FinishTextureSUNX_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const struct dri_extension_function GL_SUN_global_alpha_functions[] = { + { GlobalAlphaFactorubSUN_names, GlobalAlphaFactorubSUN_remap_index, -1 }, + { GlobalAlphaFactoriSUN_names, GlobalAlphaFactoriSUN_remap_index, -1 }, + { GlobalAlphaFactordSUN_names, GlobalAlphaFactordSUN_remap_index, -1 }, + { GlobalAlphaFactoruiSUN_names, GlobalAlphaFactoruiSUN_remap_index, -1 }, + { GlobalAlphaFactorbSUN_names, GlobalAlphaFactorbSUN_remap_index, -1 }, + { GlobalAlphaFactorfSUN_names, GlobalAlphaFactorfSUN_remap_index, -1 }, + { GlobalAlphaFactorusSUN_names, GlobalAlphaFactorusSUN_remap_index, -1 }, + { GlobalAlphaFactorsSUN_names, GlobalAlphaFactorsSUN_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SUN_mesh_array) +static const struct dri_extension_function GL_SUN_mesh_array_functions[] = { + { DrawMeshArraysSUN_names, DrawMeshArraysSUN_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const struct dri_extension_function GL_SUN_triangle_list_functions[] = { + { ReplacementCodeubSUN_names, ReplacementCodeubSUN_remap_index, -1 }, + { ReplacementCodeubvSUN_names, ReplacementCodeubvSUN_remap_index, -1 }, + { ReplacementCodeusvSUN_names, ReplacementCodeusvSUN_remap_index, -1 }, + { ReplacementCodePointerSUN_names, ReplacementCodePointerSUN_remap_index, -1 }, + { ReplacementCodeusSUN_names, ReplacementCodeusSUN_remap_index, -1 }, + { ReplacementCodeuiSUN_names, ReplacementCodeuiSUN_remap_index, -1 }, + { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SUN_vertex) +static const struct dri_extension_function GL_SUN_vertex_functions[] = { + { ReplacementCodeuiColor3fVertex3fvSUN_names, ReplacementCodeuiColor3fVertex3fvSUN_remap_index, -1 }, + { TexCoord4fColor4fNormal3fVertex4fvSUN_names, TexCoord4fColor4fNormal3fVertex4fvSUN_remap_index, -1 }, + { TexCoord2fColor4ubVertex3fvSUN_names, TexCoord2fColor4ubVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiVertex3fvSUN_names, ReplacementCodeuiVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiNormal3fVertex3fSUN_names, ReplacementCodeuiNormal3fVertex3fSUN_remap_index, -1 }, + { Color4ubVertex3fvSUN_names, Color4ubVertex3fvSUN_remap_index, -1 }, + { Color4ubVertex3fSUN_names, Color4ubVertex3fSUN_remap_index, -1 }, + { TexCoord2fVertex3fSUN_names, TexCoord2fVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4fNormal3fVertex3fSUN_names, TexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fNormal3fVertex3fvSUN_names, TexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 }, + { TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, + { Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 }, + { Color3fVertex3fvSUN_names, Color3fVertex3fvSUN_remap_index, -1 }, + { Color4fNormal3fVertex3fvSUN_names, Color4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, + { TexCoord2fColor3fVertex3fSUN_names, TexCoord2fColor3fVertex3fSUN_remap_index, -1 }, + { TexCoord4fColor4fNormal3fVertex4fSUN_names, TexCoord4fColor4fNormal3fVertex4fSUN_remap_index, -1 }, + { Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 }, + { Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, + { TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 }, + { Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 }, + { ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 }, + { Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 }, + { Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiColor4ubVertex3fvSUN_names, ReplacementCodeuiColor4ubVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiColor3fVertex3fSUN_names, ReplacementCodeuiColor3fVertex3fSUN_remap_index, -1 }, + { TexCoord4fVertex4fSUN_names, TexCoord4fVertex4fSUN_remap_index, -1 }, + { TexCoord2fColor3fVertex3fvSUN_names, TexCoord2fColor3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 }, + { TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 }, + { ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_1_3) +static const struct dri_extension_function GL_VERSION_1_3_functions[] = { + { SampleCoverageARB_names, SampleCoverageARB_remap_index, -1 }, + { MultiTexCoord3sARB_names, -1, 398 }, + { ActiveTextureARB_names, -1, 374 }, + { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, -1 }, + { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, -1 }, + { MultiTexCoord1fvARB_names, -1, 379 }, + { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, -1 }, + { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, -1 }, + { MultiTexCoord3dARB_names, -1, 392 }, + { MultiTexCoord2iARB_names, -1, 388 }, + { MultiTexCoord2svARB_names, -1, 391 }, + { MultiTexCoord2fARB_names, -1, 386 }, + { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, -1 }, + { MultiTexCoord3fvARB_names, -1, 395 }, + { MultiTexCoord4sARB_names, -1, 406 }, + { MultiTexCoord2dvARB_names, -1, 385 }, + { MultiTexCoord1svARB_names, -1, 383 }, + { MultiTexCoord3svARB_names, -1, 399 }, + { MultiTexCoord4iARB_names, -1, 404 }, + { MultiTexCoord3iARB_names, -1, 396 }, + { MultiTexCoord1dARB_names, -1, 376 }, + { MultiTexCoord3dvARB_names, -1, 393 }, + { MultiTexCoord3ivARB_names, -1, 397 }, + { MultiTexCoord2sARB_names, -1, 390 }, + { MultiTexCoord4ivARB_names, -1, 405 }, + { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, -1 }, + { ClientActiveTextureARB_names, -1, 375 }, + { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, -1 }, + { MultiTexCoord2dARB_names, -1, 384 }, + { MultiTexCoord4dvARB_names, -1, 401 }, + { MultiTexCoord4fvARB_names, -1, 403 }, + { MultiTexCoord3fARB_names, -1, 394 }, + { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, -1 }, + { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, -1 }, + { MultiTexCoord4dARB_names, -1, 400 }, + { MultiTexCoord1sARB_names, -1, 382 }, + { MultiTexCoord1dvARB_names, -1, 377 }, + { MultiTexCoord1ivARB_names, -1, 381 }, + { MultiTexCoord2ivARB_names, -1, 389 }, + { MultiTexCoord1iARB_names, -1, 380 }, + { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, -1 }, + { MultiTexCoord4svARB_names, -1, 407 }, + { MultiTexCoord1fARB_names, -1, 378 }, + { MultiTexCoord4fARB_names, -1, 402 }, + { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, -1 }, + { MultiTexCoord2fvARB_names, -1, 387 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_1_4) +static const struct dri_extension_function GL_VERSION_1_4_functions[] = { + { PointParameteriNV_names, PointParameteriNV_remap_index, -1 }, + { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, + { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, -1 }, + { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, + { FogCoorddEXT_names, FogCoorddEXT_remap_index, -1 }, + { FogCoordfEXT_names, FogCoordfEXT_remap_index, -1 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, + { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, -1 }, + { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, -1 }, + { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, -1 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, + { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, -1 }, + { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, -1 }, + { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, -1 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, + { PointParameterivNV_names, PointParameterivNV_remap_index, -1 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, + { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, -1 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, + { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, -1 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, + { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, -1 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, + { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, -1 }, + { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, -1 }, + { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, -1 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, + { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, -1 }, + { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, -1 }, + { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, -1 }, + { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, -1 }, + { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, -1 }, + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, + { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, -1 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, + { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, -1 }, + { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, -1 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_1_5) +static const struct dri_extension_function GL_VERSION_1_5_functions[] = { + { BeginQueryARB_names, BeginQueryARB_remap_index, -1 }, + { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, -1 }, + { BufferSubDataARB_names, BufferSubDataARB_remap_index, -1 }, + { GetQueryivARB_names, GetQueryivARB_remap_index, -1 }, + { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, -1 }, + { BufferDataARB_names, BufferDataARB_remap_index, -1 }, + { EndQueryARB_names, EndQueryARB_remap_index, -1 }, + { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, -1 }, + { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, -1 }, + { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, -1 }, + { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, -1 }, + { IsQueryARB_names, IsQueryARB_remap_index, -1 }, + { MapBufferARB_names, MapBufferARB_remap_index, -1 }, + { GenQueriesARB_names, GenQueriesARB_remap_index, -1 }, + { IsBufferARB_names, IsBufferARB_remap_index, -1 }, + { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, -1 }, + { UnmapBufferARB_names, UnmapBufferARB_remap_index, -1 }, + { BindBufferARB_names, BindBufferARB_remap_index, -1 }, + { GenBuffersARB_names, GenBuffersARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_2_0) +static const struct dri_extension_function GL_VERSION_2_0_functions[] = { + { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, + { GetProgramiv_names, GetProgramiv_remap_index, -1 }, + { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, + { AttachShader_names, AttachShader_remap_index, -1 }, + { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, + { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, + { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, + { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, + { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, + { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, + { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, + { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, + { StencilMaskSeparate_names, StencilMaskSeparate_remap_index, -1 }, + { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, + { GetProgramInfoLog_names, GetProgramInfoLog_remap_index, -1 }, + { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, + { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, + { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, + { GetShaderInfoLog_names, GetShaderInfoLog_remap_index, -1 }, + { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, + { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, + { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, + { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, + { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, + { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, + { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, + { CreateProgram_names, CreateProgram_remap_index, -1 }, + { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 }, + { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, + { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, + { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, + { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, + { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, + { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, + { IsShader_names, IsShader_remap_index, -1 }, + { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, + { IsProgram_names, IsProgram_remap_index, -1 }, + { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, + { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, + { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, + { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, + { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, + { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, + { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, + { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, + { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, + { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, + { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, + { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, + { GetAttachedShaders_names, GetAttachedShaders_remap_index, -1 }, + { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, + { DeleteShader_names, DeleteShader_remap_index, -1 }, + { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, + { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, + { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, + { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, + { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, + { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, + { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, + { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, + { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, + { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, + { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, + { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, + { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, + { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, + { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, + { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, + { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, + { CreateShader_names, CreateShader_remap_index, -1 }, + { DetachShader_names, DetachShader_remap_index, -1 }, + { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, + { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, + { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, + { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, + { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, + { DeleteProgram_names, DeleteProgram_remap_index, -1 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, + { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, + { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, + { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, + { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, + { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, + { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, + { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, + { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, + { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, + { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, + { GetShaderiv_names, GetShaderiv_remap_index, -1 }, + { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, + { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, + { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, + { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_2_1) +static const struct dri_extension_function GL_VERSION_2_1_functions[] = { + { UniformMatrix2x4fv_names, UniformMatrix2x4fv_remap_index, -1 }, + { UniformMatrix4x3fv_names, UniformMatrix4x3fv_remap_index, -1 }, + { UniformMatrix4x2fv_names, UniformMatrix4x2fv_remap_index, -1 }, + { UniformMatrix2x3fv_names, UniformMatrix2x3fv_remap_index, -1 }, + { UniformMatrix3x4fv_names, UniformMatrix3x4fv_remap_index, -1 }, + { UniformMatrix3x2fv_names, UniformMatrix3x2fv_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/memops.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/memops.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/memops.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/memops.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,17 @@ +#ifndef DRIMEMSETIO_H +#define DRIMEMSETIO_H +/* +* memset an area in I/O space +* We need to be careful about this on some archs +*/ +static INLINE void drimemsetio(void* address, int c, int size) +{ +#if defined(__powerpc__) || defined(__ia64__) + int i; + for(i=0;i + */ + + +#ifndef MMIO_H +#define MMIO_H + +#include "main/glheader.h" + +#if defined( __powerpc__ ) + +static INLINE uint32_t +read_MMIO_LE32( volatile void * base, unsigned long offset ) +{ + uint32_t val; + + __asm__ __volatile__( "lwbrx %0, %1, %2 ; eieio" + : "=r" (val) + : "b" (base), "r" (offset) ); + return val; +} + +#else + +static INLINE uint32_t +read_MMIO_LE32( volatile void * base, unsigned long offset ) +{ + volatile uint32_t * p = (volatile uint32_t *) (((volatile char *) base) + offset); + return LE32_TO_CPU( p[0] ); +} + +#endif + +#endif /* MMIO_H */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/mmx.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/mmx.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/mmx.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/mmx.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,560 @@ +/* mmx.h + + MultiMedia eXtensions GCC interface library for IA32. + + To use this library, simply include this header file + and compile with GCC. You MUST have inlining enabled + in order for mmx_ok() to work; this can be done by + simply using -O on the GCC command line. + + Compiling with -DMMX_TRACE will cause detailed trace + output to be sent to stderr for each mmx operation. + This adds lots of code, and obviously slows execution to + a crawl, but can be very useful for debugging. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR ANY PARTICULAR PURPOSE. + + 1997-98 by H. Dietz and R. Fisher + + History: + 97-98* R.Fisher Early versions + 980501 R.Fisher Original Release + 980611* H.Dietz Rewrite, correctly implementing inlines, and + R.Fisher including direct register accesses. + 980616 R.Fisher Release of 980611 as 980616. + 980714 R.Fisher Minor corrections to Makefile, etc. + 980715 R.Fisher mmx_ok() now prevents optimizer from using + clobbered values. + mmx_ok() now checks if cpuid instruction is + available before trying to use it. + 980726* R.Fisher mm_support() searches for AMD 3DNow, Cyrix + Extended MMX, and standard MMX. It returns a + value which is positive if any of these are + supported, and can be masked with constants to + see which. mmx_ok() is now a call to this + 980726* R.Fisher Added i2r support for shift functions + 980919 R.Fisher Fixed AMD extended feature recognition bug. + 980921 R.Fisher Added definition/check for _MMX_H. + Added "float s[2]" to mmx_t for use with + 3DNow and EMMX. So same mmx_t can be used. + 981013 R.Fisher Fixed cpuid function 1 bug (looked at wrong reg) + Fixed psllq_i2r error in mmxtest.c + + * Unreleased (internal or interim) versions + + Notes: + It appears that the latest gas has the pand problem fixed, therefore + I'll undefine BROKEN_PAND by default. + String compares may be quicker than the multiple test/jumps in vendor + test sequence in mmx_ok(), but I'm not concerned with that right now. + + Acknowledgments: + Jussi Laako for pointing out the errors ultimately found to be + connected to the failure to notify the optimizer of clobbered values. + Roger Hardiman for reminding us that CPUID isn't everywhere, and that + someone may actually try to use this on a machine without CPUID. + Also for suggesting code for checking this. + Robert Dale for pointing out the AMD recognition bug. + Jimmy Mayfield and Carl Witty for pointing out the Intel recognition + bug. + Carl Witty for pointing out the psllq_i2r test bug. +*/ + +#ifndef _MMX_H +#define _MMX_H + +//#define MMX_TRACE + +/* Warning: at this writing, the version of GAS packaged + with most Linux distributions does not handle the + parallel AND operation mnemonic correctly. If the + symbol BROKEN_PAND is defined, a slower alternative + coding will be used. If execution of mmxtest results + in an illegal instruction fault, define this symbol. +*/ +#undef BROKEN_PAND + + +/* The type of an value that fits in an MMX register + (note that long long constant values MUST be suffixed + by LL and unsigned long long values by ULL, lest + they be truncated by the compiler) +*/ +typedef union { + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} mmx_t; + +/* Helper functions for the instruction macros that follow... + (note that memory-to-register, m2r, instructions are nearly + as efficient as register-to-register, r2r, instructions; + however, memory-to-memory instructions are really simulated + as a convenience, and are only 1/3 as efficient) +*/ +#ifdef MMX_TRACE + +/* Include the stuff for printing a trace to stderr... +*/ + +#include + +#define mmx_i2r(op, imm, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (imm); \ + fprintf(stderr, #op "_i2r(" #imm "=0x%016llx, ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (imm)); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_m2r(op, mem, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mem); \ + fprintf(stderr, #op "_m2r(" #mem "=0x%016llx, ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem)); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_r2m(op, reg, mem) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #op "_r2m(" #reg "=0x%016llx, ", mmx_trace.q); \ + mmx_trace = (mem); \ + fprintf(stderr, #mem "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=X" (mem) \ + : /* nothing */ ); \ + mmx_trace = (mem); \ + fprintf(stderr, #mem "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_r2r(op, regs, regd) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__ ("movq %%" #regs ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #op "_r2r(" #regs "=0x%016llx, ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %%" #regd ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #regd "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd); \ + __asm__ __volatile__ ("movq %%" #regd ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #regd "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_m2m(op, mems, memd) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mems); \ + fprintf(stderr, #op "_m2m(" #mems "=0x%016llx, ", mmx_trace.q); \ + mmx_trace = (memd); \ + fprintf(stderr, #memd "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)); \ + mmx_trace = (memd); \ + fprintf(stderr, #memd "=0x%016llx\n", mmx_trace.q); \ + } + +#else + +/* These macros are a lot simpler without the tracing... +*/ + +#define mmx_i2r(op, imm, reg) \ + __asm__ __volatile__ (#op " $" #imm ", %%" #reg \ + : /* nothing */ \ + : /* nothing */); + +#define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem)) + +#define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=X" (mem) \ + : /* nothing */ ) + +#define mmx_r2r(op, regs, regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + +#define mmx_m2m(op, mems, memd) \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)) + +#endif + + +/* 1x64 MOVe Quadword + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) +#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) +#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) +#define movq(vars, vard) \ + __asm__ __volatile__ ("movq %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 1x32 MOVe Doubleword + (like movq, this is both load and store... + but is most useful for moving things between + mmx registers and ordinary registers) +*/ +#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) +#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) +#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) +#define movd(vars, vard) \ + __asm__ __volatile__ ("movd %1, %%mm0\n\t" \ + "movd %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 2x32, 4x16, and 8x8 Parallel ADDs +*/ +#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) +#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) +#define paddd(vars, vard) mmx_m2m(paddd, vars, vard) + +#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) +#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) +#define paddw(vars, vard) mmx_m2m(paddw, vars, vard) + +#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) +#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) +#define paddb(vars, vard) mmx_m2m(paddb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic +*/ +#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) +#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) +#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard) + +#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) +#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) +#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic +*/ +#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) +#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) +#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard) + +#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) +#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) +#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel SUBs +*/ +#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) +#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) +#define psubd(vars, vard) mmx_m2m(psubd, vars, vard) + +#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) +#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) +#define psubw(vars, vard) mmx_m2m(psubw, vars, vard) + +#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) +#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) +#define psubb(vars, vard) mmx_m2m(psubb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic +*/ +#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) +#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) +#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard) + +#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) +#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) +#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic +*/ +#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) +#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) +#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard) + +#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) +#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) +#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard) + + +/* 4x16 Parallel MULs giving Low 4x16 portions of results +*/ +#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) +#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) +#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard) + + +/* 4x16 Parallel MULs giving High 4x16 portions of results +*/ +#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) +#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) +#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard) + + +/* 4x16->2x32 Parallel Mul-ADD + (muls like pmullw, then adds adjacent 16-bit fields + in the multiply result to make the final 2x32 result) +*/ +#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) +#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) +#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard) + + +/* 1x64 bitwise AND +*/ +#ifdef BROKEN_PAND +#define pand_m2r(var, reg) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, reg); \ + mmx_m2r(pandn, var, reg); \ + } +#define pand_r2r(regs, regd) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, regd); \ + mmx_r2r(pandn, regs, regd) \ + } +#define pand(vars, vard) \ + { \ + movq_m2r(vard, mm0); \ + mmx_m2r(pandn, (mmx_t) -1LL, mm0); \ + mmx_m2r(pandn, vars, mm0); \ + movq_r2m(mm0, vard); \ + } +#else +#define pand_m2r(var, reg) mmx_m2r(pand, var, reg) +#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) +#define pand(vars, vard) mmx_m2m(pand, vars, vard) +#endif + + +/* 1x64 bitwise AND with Not the destination +*/ +#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) +#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) +#define pandn(vars, vard) mmx_m2m(pandn, vars, vard) + + +/* 1x64 bitwise OR +*/ +#define por_m2r(var, reg) mmx_m2r(por, var, reg) +#define por_r2r(regs, regd) mmx_r2r(por, regs, regd) +#define por(vars, vard) mmx_m2m(por, vars, vard) + + +/* 1x64 bitwise eXclusive OR +*/ +#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) +#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) +#define pxor(vars, vard) mmx_m2m(pxor, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality + (resulting fields are either 0 or -1) +*/ +#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) +#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard) + +#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) +#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard) + +#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) +#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than + (resulting fields are either 0 or -1) +*/ +#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) +#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard) + +#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) +#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard) + +#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) +#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical +*/ +#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) +#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) +#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) +#define psllq(vars, vard) mmx_m2m(psllq, vars, vard) + +#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) +#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) +#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) +#define pslld(vars, vard) mmx_m2m(pslld, vars, vard) + +#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) +#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) +#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) +#define psllw(vars, vard) mmx_m2m(psllw, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical +*/ +#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) +#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) +#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) +#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard) + +#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) +#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) +#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) +#define psrld(vars, vard) mmx_m2m(psrld, vars, vard) + +#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) +#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) +#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) +#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard) + + +/* 2x32 and 4x16 Parallel Shift Right Arithmetic +*/ +#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) +#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) +#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) +#define psrad(vars, vard) mmx_m2m(psrad, vars, vard) + +#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) +#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) +#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) +#define psraw(vars, vard) mmx_m2m(psraw, vars, vard) + + +/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate + (packs source and dest fields into dest in that order) +*/ +#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) +#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) +#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard) + +#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) +#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) +#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard) + + +/* 4x16->8x8 PACK and Unsigned Saturate + (packs source and dest fields into dest in that order) +*/ +#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) +#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) +#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low + (interleaves low half of dest with low half of source + as padding in each result field) +*/ +#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) +#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) +#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard) + +#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) +#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) +#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard) + +#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) +#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) +#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High + (interleaves high half of dest with high half of source + as padding in each result field) +*/ +#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) +#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) +#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard) + +#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) +#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) +#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard) + +#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) +#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) +#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard) + + +/* Empty MMx State + (used to clean-up when going from mmx to float use + of the registers that are shared by both; note that + there is no float-to-mmx operation needed, because + only the float tag word info is corruptible) +*/ +#ifdef MMX_TRACE + +#define emms() \ + { \ + fprintf(stderr, "emms()\n"); \ + __asm__ __volatile__ ("emms"); \ + } + +#else + +#define emms() __asm__ __volatile__ ("emms") + +#endif + +#endif + diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp2.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp2.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp2.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp2.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,621 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file spantmp2.h + * + * Template file of span read / write functions. + * + * \author Keith Whitwell + * \author Gareth Hughes + * \author Ian Romanick + */ + +#include "main/colormac.h" +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HW_READ_CLIPLOOP +#define HW_READ_CLIPLOOP() HW_CLIPLOOP() +#endif + +#ifndef HW_WRITE_CLIPLOOP +#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() +#endif + +#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) + +/** + ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5 + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +#define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_565( color[0], color[1], color[2] ) + +#define WRITE_RGBA( _x, _y, r, g, b, a ) \ + PUT_VALUE(_x, _y, ((((int)r & 0xf8) << 8) | \ + (((int)g & 0xfc) << 3) | \ + (((int)b & 0xf8) >> 3))) \ + +#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = GET_VALUE(_x, _y); \ + rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ + rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ + rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + rgba[3] = 0xff; \ + } while (0) + +#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + +/** + ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_8888(color[3], color[0], color[1], color[2]) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, ((r << 16) | \ + (g << 8) | \ + (b << 0) | \ + (a << 24))) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +# if defined( USE_X86_ASM ) +# define READ_RGBA(rgba, _x, _y) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + __asm__ __volatile__( "bswap %0; rorl $8, %0" \ + : "=r" (p) : "0" (p) ); \ + ((GLuint *)rgba)[0] = p; \ + } while (0) +# elif defined( MESA_BIG_ENDIAN ) + /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single + * rotlwi instruction. It also produces good code on SPARC. + */ +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + GLuint t = p; \ + *((uint32_t *) rgba) = (t >> 24) | (p << 8); \ + } while (0) +# else +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + rgba[0] = (p >> 16) & 0xff; \ + rgba[1] = (p >> 8) & 0xff; \ + rgba[2] = (p >> 0) & 0xff; \ + rgba[3] = (p >> 24) & 0xff; \ + } while (0) +# endif + +#else +#error SPANTMP_PIXEL_FMT must be set to a valid value! +#endif + + + +/** + ** Assembly routines. + **/ + +#if defined( USE_MMX_ASM ) || defined( USE_SSE_ASM ) +#include "x86/read_rgba_span_x86.h" +#include "x86/common_x86_asm.h" +#endif + +static void TAG(WriteRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "WriteRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + if (mask[i]) + WRITE_PIXEL( x1, y, p ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_PIXEL( x1, y, p ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + +static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *color = (const GLubyte *) value; + GLint i; + LOCAL_VARS; + INIT_MONO_PIXEL(p, color); + + if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + READ_RGBA( rgba[i], x1, y ); + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} + + +#if defined(GET_PTR) && \ + defined(USE_MMX_ASM) && \ + (((SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \ + ((SPANTMP_PIXEL_FMT == GL_RGB) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5))) +static void TAG2(ReadRGBASpan,_MMX)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, void *values) +{ +#ifndef USE_INNER_EMMS + /* The EMMS instruction is directly in-lined here because using GCC's + * built-in _mm_empty function was found to utterly destroy performance. + */ + __asm__ __volatile__( "emms" ); +#endif + + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLint x1,n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + if (DBG) fprintf(stderr, "ReadRGBASpan\n"); + + HW_READ_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + { + const void * src = GET_PTR( x1, y ); +#if (SPANTMP_PIXEL_FMT == GL_RGB) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) + _generic_read_RGBA_span_RGB565_MMX( src, rgba[i], n1 ); +#else + _generic_read_RGBA_span_BGRA8888_REV_MMX( src, rgba[i], n1 ); +#endif + } + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +#ifndef USE_INNER_EMMS + __asm__ __volatile__( "emms" ); +#endif +} +#endif + + +#if defined(GET_PTR) && \ + defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) +static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) +{ + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLint x1,n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + if (DBG) fprintf(stderr, "ReadRGBASpan\n"); + + HW_READ_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + { + const void * src = GET_PTR( x1, y ); + _generic_read_RGBA_span_BGRA8888_REV_SSE2( src, rgba[i], n1 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} +#endif + +#if defined(GET_PTR) && \ + defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) +static void TAG2(ReadRGBASpan,_SSE)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) +{ +#ifndef USE_INNER_EMMS + /* The EMMS instruction is directly in-lined here because using GCC's + * built-in _mm_empty function was found to utterly destroy performance. + */ + __asm__ __volatile__( "emms" ); +#endif + + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLint x1,n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + if (DBG) fprintf(stderr, "ReadRGBASpan\n"); + + HW_READ_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + { + const void * src = GET_PTR( x1, y ); + _generic_read_RGBA_span_BGRA8888_REV_SSE( src, rgba[i], n1 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +#ifndef USE_INNER_EMMS + __asm__ __volatile__( "emms" ); +#endif +} +#endif + + +static void TAG(ReadRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLubyte *mask = NULL; /* remove someday */ + GLint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "ReadRGBAPixels\n"); + + HW_READ_CLIPLOOP() + { + if (mask) + { + for (i=0;iPutRow = TAG(WriteRGBASpan); + rb->PutRowRGB = TAG(WriteRGBSpan); + rb->PutMonoRow = TAG(WriteMonoRGBASpan); + rb->PutValues = TAG(WriteRGBAPixels); + rb->PutMonoValues = TAG(WriteMonoRGBAPixels); + rb->GetValues = TAG(ReadRGBAPixels); + +#if defined(GET_PTR) +#if defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + if ( cpu_has_xmm2 ) { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE2" ); + rb->GetRow = TAG2(ReadRGBASpan, _SSE2); + } + else +#endif +#if defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + if ( cpu_has_xmm ) { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE" ); + rb->GetRow = TAG2(ReadRGBASpan, _SSE); + } + else +#endif +#if defined(USE_MMX_ASM) && \ + (((SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \ + ((SPANTMP_PIXEL_FMT == GL_RGB) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5))) + if ( cpu_has_mmx ) { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "MMX" ); + rb->GetRow = TAG2(ReadRGBASpan, _MMX); + } + else +#endif +#endif /* GET_PTR */ + { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" ); + rb->GetRow = TAG(ReadRGBASpan); + } + +} + + +#undef INIT_MONO_PIXEL +#undef WRITE_PIXEL +#undef WRITE_RGBA +#undef READ_RGBA +#undef TAG +#undef TAG2 +#undef GET_VALUE +#undef PUT_VALUE +#undef GET_PTR +#undef SPANTMP_PIXEL_FMT +#undef SPANTMP_PIXEL_TYPE diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp_common.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp_common.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp_common.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp_common.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,81 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file spantmp_common.h + * + * common macros for span read / write functions to be used in the depth, + * stencil and pixel span templates. + */ + +#ifndef HW_WRITE_LOCK +#define HW_WRITE_LOCK() HW_LOCK() +#endif + +#ifndef HW_WRITE_UNLOCK +#define HW_WRITE_UNLOCK() HW_UNLOCK() +#endif + +#ifndef HW_READ_LOCK +#define HW_READ_LOCK() HW_LOCK() +#endif + +#ifndef HW_READ_UNLOCK +#define HW_READ_UNLOCK() HW_UNLOCK() +#endif + +#ifndef HW_CLIPLOOP +#define HW_CLIPLOOP() \ + do { \ + int _nc = dPriv->numClipRects; \ + while ( _nc-- ) { \ + int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \ + int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \ + int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \ + int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y; +#endif + +#ifndef HW_ENDCLIPLOOP +#define HW_ENDCLIPLOOP() \ + } \ + } while (0) +#endif + +#ifndef CLIPPIXEL +#define CLIPPIXEL( _x, _y ) \ + ((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy)) +#endif + +#ifndef CLIPSPAN +#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \ + if ( _y < miny || _y >= maxy /*|| _x + n < minx || _x >=maxx*/ ) { \ + _n1 = 0, _x1 = x; \ + } else { \ + _n1 = _n; \ + _x1 = _x; \ + if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \ + if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \ + } +#endif diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/spantmp.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,338 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2002, 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Keith Whitwell + * Gareth Hughes + */ + +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HW_READ_CLIPLOOP +#define HW_READ_CLIPLOOP() HW_CLIPLOOP() +#endif + +#ifndef HW_WRITE_CLIPLOOP +#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() +#endif + + +static void TAG(WriteRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLuint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "WriteRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + if (mask[i]) + WRITE_PIXEL( x1, y, p ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_PIXEL( x1, y, p ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + +static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *color = (const GLubyte *) value; + GLuint i; + LOCAL_VARS; + INIT_MONO_PIXEL(p, color); + + if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + READ_RGBA( rgba[i], x1, y ); + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} + + +static void TAG(ReadRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + const GLubyte *mask = NULL; /* remove someday */ + GLuint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "ReadRGBAPixels\n"); + + HW_READ_CLIPLOOP() + { + if (mask) + { + for (i=0;iPutRow = TAG(WriteRGBASpan); + rb->PutRowRGB = TAG(WriteRGBSpan); + rb->PutMonoRow = TAG(WriteMonoRGBASpan); + rb->PutValues = TAG(WriteRGBAPixels); + rb->PutMonoValues = TAG(WriteMonoRGBAPixels); + rb->GetValues = TAG(ReadRGBAPixels); + rb->GetRow = TAG(ReadRGBASpan); +} + + +#undef WRITE_PIXEL +#undef WRITE_RGBA +#undef READ_RGBA +#undef TAG diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/stenciltmp.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/stenciltmp.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/stenciltmp.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/stenciltmp.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,245 @@ + +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HAVE_HW_STENCIL_SPANS +#define HAVE_HW_STENCIL_SPANS 0 +#endif + +#ifndef HAVE_HW_STENCIL_PIXELS +#define HAVE_HW_STENCIL_PIXELS 0 +#endif + +static void TAG(WriteStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *stencil = (const GLubyte *) values; + GLint x1; + GLint n1; + LOCAL_STENCIL_VARS; + + y = Y_FLIP(y); + +#if HAVE_HW_STENCIL_SPANS + (void) x1; (void) n1; + + if (DBG) fprintf(stderr, "WriteStencilSpan 0..%d (x1 %d)\n", + (int)n1, (int)x1); + + WRITE_STENCIL_SPAN(); +#else /* HAVE_HW_STENCIL_SPANS */ + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_STENCIL( x1, y, stencil[i] ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_STENCIL( x1, y, stencil[i] ); + } + } + HW_ENDCLIPLOOP(); +#endif /* !HAVE_HW_STENCIL_SPANS */ + } + HW_WRITE_UNLOCK(); +} + +#if HAVE_HW_STENCIL_SPANS +/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */ +static void +TAG(WriteMonoStencilSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[] ) +{ + const GLuint stenVal = *((GLuint *) value); + GLuint stens[MAX_WIDTH]; + GLuint i; + for (i = 0; i < n; i++) + stens[i] = stenVal; + TAG(WriteStencilSpan)(ctx, rb, n, x, y, stens, mask); +} +#else /* HAVE_HW_STENCIL_SPANS */ +static void TAG(WriteMonoStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte stencil = *((const GLubyte *) value); + GLint x1; + GLint n1; + LOCAL_STENCIL_VARS; + + y = Y_FLIP(y); + + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_STENCIL( x1, y, stencil ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_STENCIL( x1, y, stencil ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} +#endif /* !HAVE_HW_STENCIL_SPANS */ + + +static void TAG(WriteStencilPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *stencil = (const GLubyte *) values; + GLuint i; + LOCAL_STENCIL_VARS; + + if (DBG) fprintf(stderr, "WriteStencilPixels\n"); + +#if HAVE_HW_STENCIL_PIXELS + (void) i; + + WRITE_STENCIL_PIXELS(); +#else /* HAVE_HW_STENCIL_PIXELS */ + HW_CLIPLOOP() + { + for (i=0;i0;i++,n1--) + READ_STENCIL( stencil[i], (x+i), y ); + } + HW_ENDCLIPLOOP(); +#endif /* !HAVE_HW_STENCIL_SPANS */ + } + HW_READ_UNLOCK(); +} + +static void TAG(ReadStencilPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLubyte *stencil = (GLubyte *) values; + GLuint i; + LOCAL_STENCIL_VARS; + + if (DBG) fprintf(stderr, "ReadStencilPixels\n"); + +#if HAVE_HW_STENCIL_PIXELS + (void) i; + + READ_STENCIL_PIXELS(); +#else /* HAVE_HW_STENCIL_PIXELS */ + HW_CLIPLOOP() + { + for (i=0;iGetRow = TAG(ReadStencilSpan); + rb->GetValues = TAG(ReadStencilPixels); + rb->PutRow = TAG(WriteStencilSpan); + rb->PutRowRGB = NULL; + rb->PutMonoRow = TAG(WriteMonoStencilSpan); + rb->PutValues = TAG(WriteStencilPixels); + rb->PutMonoValues = NULL; +} + + +#undef WRITE_STENCIL +#undef READ_STENCIL +#undef TAG diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.c xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1347 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2002, 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + * Keith Whitwell + * Kevin E. Martin + * Gareth Hughes + */ + +/** \file texmem.c + * Implements all of the device-independent texture memory management. + * + * Currently, only a simple LRU texture memory management policy is + * implemented. In the (hopefully very near) future, better policies will be + * implemented. The idea is that the DRI should be able to run in one of two + * modes. In the default mode the DRI will dynamically attempt to discover + * the best texture management policy for the running application. In the + * other mode, the user (via some sort of as yet TBD mechanism) will select + * a texture management policy that is known to work well with the + * application. + */ + +#include "texmem.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/texformat.h" + +#include + + + +static unsigned dummy_swap_counter; + + +/** + * Calculate \f$\log_2\f$ of a value. This is a particularly poor + * implementation of this function. However, since system performance is in + * no way dependent on this function, the slowness of the implementation is + * irrelevent. + * + * \param n Value whose \f$\log_2\f$ is to be calculated + */ + +static GLuint +driLog2( GLuint n ) +{ + GLuint log2; + + for ( log2 = 1 ; n > 1 ; log2++ ) { + n >>= 1; + } + + return log2; +} + + + + +/** + * Determine if a texture is resident in textureable memory. Depending on + * the driver, this may or may not be on-card memory. It could be AGP memory + * or anyother type of memory from which the hardware can directly read + * texels. + * + * This function is intended to be used as the \c IsTextureResident function + * in the device's \c dd_function_table. + * + * \param ctx GL context pointer (currently unused) + * \param texObj Texture object to be tested + */ + +GLboolean +driIsTextureResident( GLcontext * ctx, + struct gl_texture_object * texObj ) +{ + driTextureObject * t; + + + t = (driTextureObject *) texObj->DriverData; + return( (t != NULL) && (t->memBlock != NULL) ); +} + + + + +/** + * (Re)initialize the global circular LRU list. The last element + * in the array (\a heap->nrRegions) is the sentinal. Keeping it + * at the end of the array allows the other elements of the array + * to be addressed rationally when looking up objects at a particular + * location in texture memory. + * + * \param heap Texture heap to be reset + */ + +static void resetGlobalLRU( driTexHeap * heap ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned sz = 1U << heap->logGranularity; + unsigned i; + + for (i = 0 ; (i+1) * sz <= heap->size ; i++) { + list[i].prev = i-1; + list[i].next = i+1; + list[i].age = 0; + } + + i--; + list[0].prev = heap->nrRegions; + list[i].prev = i-1; + list[i].next = heap->nrRegions; + list[heap->nrRegions].prev = i; + list[heap->nrRegions].next = 0; + heap->global_age[0] = 0; +} + +/** + * Print out debugging information about the local texture LRU. + * + * \param heap Texture heap to be printed + * \param callername Name of calling function + */ +static void printLocalLRU( driTexHeap * heap, const char *callername ) +{ + driTextureObject *t; + unsigned sz = 1U << heap->logGranularity; + + fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n", + __FUNCTION__, callername, heap->heapId ); + + foreach ( t, &heap->texture_objects ) { + if (!t->memBlock) + continue; + if (!t->tObj) { + fprintf( stderr, "Placeholder (%p) %d at 0x%x sz 0x%x\n", + (void *)t, + t->memBlock->ofs / sz, + t->memBlock->ofs, + t->memBlock->size ); + } else { + fprintf( stderr, "Texture (%p) at 0x%x sz 0x%x\n", + (void *)t, + t->memBlock->ofs, + t->memBlock->size ); + } + } + foreach ( t, heap->swapped_objects ) { + if (!t->tObj) { + fprintf( stderr, "Swapped Placeholder (%p)\n", (void *)t ); + } else { + fprintf( stderr, "Swapped Texture (%p)\n", (void *)t ); + } + } + + fprintf( stderr, "\n" ); +} + +/** + * Print out debugging information about the global texture LRU. + * + * \param heap Texture heap to be printed + * \param callername Name of calling function + */ +static void printGlobalLRU( driTexHeap * heap, const char *callername ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned int i, j; + + fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n", + __FUNCTION__, callername, heap->heapId, (void *)list ); + + for ( i = 0, j = heap->nrRegions ; i < heap->nrRegions ; i++ ) { + fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n", + j, list[j].age, list[j].next, list[j].prev, list[j].in_use ); + j = list[j].next; + if ( j == heap->nrRegions ) break; + } + + if ( j != heap->nrRegions ) { + fprintf( stderr, "Loop detected in global LRU\n" ); + for ( i = 0 ; i < heap->nrRegions ; i++ ) { + fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n", + i, list[i].age, list[i].next, list[i].prev, list[i].in_use ); + } + } + + fprintf( stderr, "\n" ); +} + + +/** + * Called by the client whenever it touches a local texture. + * + * \param t Texture object that the client has accessed + */ + +void driUpdateTextureLRU( driTextureObject * t ) +{ + driTexHeap * heap; + drmTextureRegionPtr list; + unsigned shift; + unsigned start; + unsigned end; + unsigned i; + + + heap = t->heap; + if ( heap != NULL ) { + shift = heap->logGranularity; + start = t->memBlock->ofs >> shift; + end = (t->memBlock->ofs + t->memBlock->size - 1) >> shift; + + + heap->local_age = ++heap->global_age[0]; + list = heap->global_regions; + + + /* Update the context's local LRU + */ + + move_to_head( & heap->texture_objects, t ); + + + for (i = start ; i <= end ; i++) { + list[i].age = heap->local_age; + + /* remove_from_list(i) + */ + list[(unsigned)list[i].next].prev = list[i].prev; + list[(unsigned)list[i].prev].next = list[i].next; + + /* insert_at_head(list, i) + */ + list[i].prev = heap->nrRegions; + list[i].next = list[heap->nrRegions].next; + list[(unsigned)list[heap->nrRegions].next].prev = i; + list[heap->nrRegions].next = i; + } + + if ( 0 ) { + printGlobalLRU( heap, __FUNCTION__ ); + printLocalLRU( heap, __FUNCTION__ ); + } + } +} + + + + +/** + * Keep track of swapped out texture objects. + * + * \param t Texture object to be "swapped" out of its texture heap + */ + +void driSwapOutTextureObject( driTextureObject * t ) +{ + unsigned face; + + + if ( t->memBlock != NULL ) { + assert( t->heap != NULL ); + mmFreeMem( t->memBlock ); + t->memBlock = NULL; + + if (t->timestamp > t->heap->timestamp) + t->heap->timestamp = t->timestamp; + + t->heap->texture_swaps[0]++; + move_to_tail( t->heap->swapped_objects, t ); + t->heap = NULL; + } + else { + assert( t->heap == NULL ); + } + + + for ( face = 0 ; face < 6 ; face++ ) { + t->dirty_images[face] = ~0; + } +} + + + + +/** + * Destroy hardware state associated with texture \a t. Calls the + * \a destroy_texture_object method associated with the heap from which + * \a t was allocated. + * + * \param t Texture object to be destroyed + */ + +void driDestroyTextureObject( driTextureObject * t ) +{ + driTexHeap * heap; + + + if ( 0 ) { + fprintf( stderr, "[%s:%d] freeing %p (tObj = %p, DriverData = %p)\n", + __FILE__, __LINE__, + (void *)t, + (void *)((t != NULL) ? t->tObj : NULL), + (void *)((t != NULL && t->tObj != NULL) ? t->tObj->DriverData : NULL )); + } + + if ( t != NULL ) { + if ( t->memBlock ) { + heap = t->heap; + assert( heap != NULL ); + + heap->texture_swaps[0]++; + + mmFreeMem( t->memBlock ); + t->memBlock = NULL; + + if (t->timestamp > t->heap->timestamp) + t->heap->timestamp = t->timestamp; + + heap->destroy_texture_object( heap->driverContext, t ); + t->heap = NULL; + } + + if ( t->tObj != NULL ) { + assert( t->tObj->DriverData == t ); + t->tObj->DriverData = NULL; + } + + remove_from_list( t ); + FREE( t ); + } + + if ( 0 ) { + fprintf( stderr, "[%s:%d] done freeing %p\n", __FILE__, __LINE__, (void *)t ); + } +} + + + + +/** + * Update the local heap's representation of texture memory based on + * data in the SAREA. This is done each time it is detected that some other + * direct rendering client has held the lock. This pertains to both our local + * textures and the textures belonging to other clients. Keep track of other + * client's textures by pushing a placeholder texture onto the LRU list -- + * these are denoted by \a tObj being \a NULL. + * + * \param heap Heap whose state is to be updated + * \param offset Byte offset in the heap that has been stolen + * \param size Size, in bytes, of the stolen block + * \param in_use Non-zero if the block is pinned/reserved by the kernel + */ + +static void driTexturesGone( driTexHeap * heap, int offset, int size, + int in_use ) +{ + driTextureObject * t; + driTextureObject * tmp; + + + foreach_s ( t, tmp, & heap->texture_objects ) { + if ( (t->memBlock->ofs < (offset + size)) + && ((t->memBlock->ofs + t->memBlock->size) > offset) ) { + /* It overlaps - kick it out. If the texture object is just a + * place holder, then destroy it all together. Otherwise, mark + * it as being swapped out. + */ + + if ( t->tObj != NULL ) { + driSwapOutTextureObject( t ); + } + else { + driDestroyTextureObject( t ); + } + } + } + + + { + t = (driTextureObject *) CALLOC( heap->texture_object_size ); + if ( t == NULL ) return; + + t->memBlock = mmAllocMem( heap->memory_heap, size, 0, offset ); + if ( t->memBlock == NULL ) { + fprintf( stderr, "Couldn't alloc placeholder: heap %u sz %x ofs %x\n", heap->heapId, + (int)size, (int)offset ); + mmDumpMemInfo( heap->memory_heap ); + FREE(t); + return; + } + t->heap = heap; + if (in_use) + t->reserved = 1; + insert_at_head( & heap->texture_objects, t ); + } +} + + + + +/** + * Called by the client on lock contention to determine whether textures have + * been stolen. If another client has modified a region in which we have + * textures, then we need to figure out which of our textures have been + * removed and update our global LRU. + * + * \param heap Texture heap to be updated + */ + +void driAgeTextures( driTexHeap * heap ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned sz = 1U << (heap->logGranularity); + unsigned i, nr = 0; + + + /* Have to go right round from the back to ensure stuff ends up + * LRU in the local list... Fix with a cursor pointer. + */ + + for (i = list[heap->nrRegions].prev ; + i != heap->nrRegions && nr < heap->nrRegions ; + i = list[i].prev, nr++) { + /* If switching texturing schemes, then the SAREA might not have been + * properly cleared, so we need to reset the global texture LRU. + */ + + if ( (i * sz) > heap->size ) { + nr = heap->nrRegions; + break; + } + + if (list[i].age > heap->local_age) + driTexturesGone( heap, i * sz, sz, list[i].in_use); + } + + /* Loop or uninitialized heap detected. Reset. + */ + + if (nr == heap->nrRegions) { + driTexturesGone( heap, 0, heap->size, 0); + resetGlobalLRU( heap ); + } + + if ( 0 ) { + printGlobalLRU( heap, __FUNCTION__ ); + printLocalLRU( heap, __FUNCTION__ ); + } + + heap->local_age = heap->global_age[0]; +} + + + + +#define INDEX_ARRAY_SIZE 6 /* I'm not aware of driver with more than 2 heaps */ + +/** + * Allocate memory from a texture heap to hold a texture object. This + * routine will attempt to allocate memory for the texture from the heaps + * specified by \c heap_array in order. That is, first it will try to + * allocate from \c heap_array[0], then \c heap_array[1], and so on. + * + * \param heap_array Array of pointers to texture heaps to use + * \param nr_heaps Number of heap pointer in \a heap_array + * \param t Texture object for which space is needed + * \return The ID of the heap from which memory was allocated, or -1 if + * memory could not be allocated. + * + * \bug The replacement policy implemented by this function is horrible. + */ + + +int +driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, + driTextureObject * t ) +{ + driTexHeap * heap; + driTextureObject * temp; + driTextureObject * cursor; + unsigned id; + + + /* In case it already has texture space, initialize heap. This also + * prevents GCC from issuing a warning that heap might be used + * uninitialized. + */ + + heap = t->heap; + + + /* Run through each of the existing heaps and try to allocate a buffer + * to hold the texture. + */ + + for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) { + heap = heap_array[ id ]; + if ( heap != NULL ) { + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + heap->alignmentShift, 0 ); + } + } + + + /* Kick textures out until the requested texture fits. + */ + + if ( t->memBlock == NULL ) { + unsigned index[INDEX_ARRAY_SIZE]; + unsigned nrGoodHeaps = 0; + + /* Trying to avoid dynamic memory allocation. If you have more + * heaps, increase INDEX_ARRAY_SIZE. I'm not aware of any + * drivers with more than 2 tex heaps. */ + assert( nr_heaps < INDEX_ARRAY_SIZE ); + + /* Sort large enough heaps by duty. Insertion sort should be + * fast enough for such a short array. */ + for ( id = 0 ; id < nr_heaps ; id++ ) { + heap = heap_array[ id ]; + + if ( heap != NULL && t->totalSize <= heap->size ) { + unsigned j; + + for ( j = 0 ; j < nrGoodHeaps; j++ ) { + if ( heap->duty > heap_array[ index[ j ] ]->duty ) + break; + } + + if ( j < nrGoodHeaps ) { + memmove( &index[ j+1 ], &index[ j ], + sizeof(index[ 0 ]) * (nrGoodHeaps - j) ); + } + + index[ j ] = id; + + nrGoodHeaps++; + } + } + + for ( id = 0 ; (t->memBlock == NULL) && (id < nrGoodHeaps) ; id++ ) { + heap = heap_array[ index[ id ] ]; + + for ( cursor = heap->texture_objects.prev, temp = cursor->prev; + cursor != &heap->texture_objects ; + cursor = temp, temp = cursor->prev ) { + + /* The the LRU element. If the texture is bound to one of + * the texture units, then we cannot kick it out. + */ + if ( cursor->bound || cursor->reserved ) { + continue; + } + + if ( cursor->memBlock ) + heap->duty -= cursor->memBlock->size; + + /* If this is a placeholder, there's no need to keep it */ + if (cursor->tObj) + driSwapOutTextureObject( cursor ); + else + driDestroyTextureObject( cursor ); + + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + heap->alignmentShift, 0 ); + + if (t->memBlock) + break; + } + } + + /* Rebalance duties. If a heap kicked more data than its duty, + * then all other heaps get that amount multiplied with their + * relative weight added to their duty. The negative duty is + * reset to 0. In the end all heaps have a duty >= 0. + * + * CAUTION: we must not change the heap pointer here, because it + * is used below to update the texture object. + */ + for ( id = 0 ; id < nr_heaps ; id++ ) + if ( heap_array[ id ] != NULL && heap_array[ id ]->duty < 0) { + int duty = -heap_array[ id ]->duty; + double weight = heap_array[ id ]->weight; + unsigned j; + + for ( j = 0 ; j < nr_heaps ; j++ ) + if ( j != id && heap_array[ j ] != NULL ) { + heap_array[ j ]->duty += (double) duty * + heap_array[ j ]->weight / weight; + } + + heap_array[ id ]->duty = 0; + } + } + + + if ( t->memBlock != NULL ) { + /* id and heap->heapId may or may not be the same value here. + */ + + assert( heap != NULL ); + assert( (t->heap == NULL) || (t->heap == heap) ); + + t->heap = heap; + return heap->heapId; + } + else { + assert( t->heap == NULL ); + + fprintf( stderr, "[%s:%d] unable to allocate texture\n", + __FUNCTION__, __LINE__ ); + return -1; + } +} + + + + + + +/** + * Set the location where the texture-swap counter is stored. + */ + +void +driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ) +{ + heap->texture_swaps = (counter == NULL) ? & dummy_swap_counter : counter; +} + + + + +/** + * Create a new heap for texture data. + * + * \param heap_id Device-dependent heap identifier. This value + * will returned by driAllocateTexture when memory + * is allocated from this heap. + * \param context Device-dependent driver context. This is + * supplied as the first parameter to the + * \c destroy_tex_obj function. + * \param size Size, in bytes, of the texture region + * \param alignmentShift Alignment requirement for textures. If textures + * must be allocated on a 4096 byte boundry, this + * would be 12. + * \param nr_regions Number of regions into which this texture space + * should be partitioned + * \param global_regions Array of \c drmTextureRegion structures in the SAREA + * \param global_age Pointer to the global texture age in the SAREA + * \param swapped_objects Pointer to the list of texture objects that are + * not in texture memory (i.e., have been swapped + * out). + * \param texture_object_size Size, in bytes, of a device-dependent texture + * object + * \param destroy_tex_obj Function used to destroy a device-dependent + * texture object + * + * \sa driDestroyTextureHeap + */ + +driTexHeap * +driCreateTextureHeap( unsigned heap_id, void * context, unsigned size, + unsigned alignmentShift, unsigned nr_regions, + drmTextureRegionPtr global_regions, unsigned * global_age, + driTextureObject * swapped_objects, + unsigned texture_object_size, + destroy_texture_object_t * destroy_tex_obj + ) +{ + driTexHeap * heap; + unsigned l; + + + if ( 0 ) + fprintf( stderr, "%s( %u, %p, %u, %u, %u )\n", + __FUNCTION__, + heap_id, (void *)context, size, alignmentShift, nr_regions ); + + heap = (driTexHeap *) CALLOC( sizeof( driTexHeap ) ); + if ( heap != NULL ) { + l = driLog2( (size - 1) / nr_regions ); + if ( l < alignmentShift ) + { + l = alignmentShift; + } + + heap->logGranularity = l; + heap->size = size & ~((1L << l) - 1); + + heap->memory_heap = mmInit( 0, heap->size ); + if ( heap->memory_heap != NULL ) { + heap->heapId = heap_id; + heap->driverContext = context; + + heap->alignmentShift = alignmentShift; + heap->nrRegions = nr_regions; + heap->global_regions = global_regions; + heap->global_age = global_age; + heap->swapped_objects = swapped_objects; + heap->texture_object_size = texture_object_size; + heap->destroy_texture_object = destroy_tex_obj; + + /* Force global heap init */ + if (heap->global_age[0] == 0) + heap->local_age = ~0; + else + heap->local_age = 0; + + make_empty_list( & heap->texture_objects ); + driSetTextureSwapCounterLocation( heap, NULL ); + + heap->weight = heap->size; + heap->duty = 0; + } + else { + FREE( heap ); + heap = NULL; + } + } + + + if ( 0 ) + fprintf( stderr, "%s returning %p\n", __FUNCTION__, (void *)heap ); + + return heap; +} + + + + +/** Destroys a texture heap + * + * \param heap Texture heap to be destroyed + */ + +void +driDestroyTextureHeap( driTexHeap * heap ) +{ + driTextureObject * t; + driTextureObject * temp; + + + if ( heap != NULL ) { + foreach_s( t, temp, & heap->texture_objects ) { + driDestroyTextureObject( t ); + } + foreach_s( t, temp, heap->swapped_objects ) { + driDestroyTextureObject( t ); + } + + mmDestroy( heap->memory_heap ); + FREE( heap ); + } +} + + + + +/****************************************************************************/ +/** + * Determine how many texels (including all mipmap levels) would be required + * for a texture map of size \f$2^^\c base_size_log2\f$ would require. + * + * \param base_size_log2 \f$log_2\f$ of the size of a side of the texture + * \param dimensions Number of dimensions of the texture. Either 2 or 3. + * \param faces Number of faces of the texture. Either 1 or 6 (for cube maps). + * \return Number of texels + */ + +static unsigned +texels_this_map_size( int base_size_log2, unsigned dimensions, unsigned faces ) +{ + unsigned texels; + + + assert( (faces == 1) || (faces == 6) ); + assert( (dimensions == 2) || (dimensions == 3) ); + + texels = 0; + if ( base_size_log2 >= 0 ) { + texels = (1U << (dimensions * base_size_log2)); + + /* See http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg03636.html + * for the complete explaination of why this formulation is used. + * Basically, the smaller mipmap levels sum to 0.333 the size of the + * level 0 map. The total size is therefore the size of the map + * multipled by 1.333. The +2 is there to round up. + */ + + texels = (texels * 4 * faces + 2) / 3; + } + + return texels; +} + + + + +struct maps_per_heap { + unsigned c[32]; +}; + +static void +fill_in_maximums( driTexHeap * const * heaps, unsigned nr_heaps, + unsigned max_bytes_per_texel, unsigned max_size, + unsigned mipmaps_at_once, unsigned dimensions, + unsigned faces, struct maps_per_heap * max_textures ) +{ + unsigned heap; + unsigned log2_size; + unsigned mask; + + + /* Determine how many textures of each size can be stored in each + * texture heap. + */ + + for ( heap = 0 ; heap < nr_heaps ; heap++ ) { + if ( heaps[ heap ] == NULL ) { + (void) memset( max_textures[ heap ].c, 0, + sizeof( max_textures[ heap ].c ) ); + continue; + } + + mask = (1U << heaps[ heap ]->logGranularity) - 1; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] heap[%u] = %u bytes, mask = 0x%08x\n", + __FILE__, __LINE__, + heap, heaps[ heap ]->size, mask ); + } + + for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) { + unsigned total; + + + /* Determine the total number of bytes required by a texture of + * size log2_size. + */ + + total = texels_this_map_size( log2_size, dimensions, faces ) + - texels_this_map_size( log2_size - mipmaps_at_once, + dimensions, faces ); + total *= max_bytes_per_texel; + total = (total + mask) & ~mask; + + /* The number of textures of a given size that will fit in a heap + * is equal to the size of the heap divided by the size of the + * texture. + */ + + max_textures[ heap ].c[ log2_size ] = heaps[ heap ]->size / total; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] " + "= 0x%08x / 0x%08x " + "= %u (%u)\n", + __FILE__, __LINE__, + heap, log2_size, + heaps[ heap ]->size, total, + heaps[ heap ]->size / total, + max_textures[ heap ].c[ log2_size ] ); + } + } + } +} + + +static unsigned +get_max_size( unsigned nr_heaps, + unsigned texture_units, + unsigned max_size, + int all_textures_one_heap, + struct maps_per_heap * max_textures ) +{ + unsigned heap; + unsigned log2_size; + + + /* Determine the largest texture size such that a texture of that size + * can be bound to each texture unit at the same time. Some hardware + * may require that all textures be in the same texture heap for + * multitexturing. + */ + + for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) { + unsigned total = 0; + + for ( heap = 0 ; heap < nr_heaps ; heap++ ) + { + total += max_textures[ heap ].c[ log2_size ]; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] = %u, " + "total = %u\n", __FILE__, __LINE__, heap, log2_size, + max_textures[ heap ].c[ log2_size ], total ); + } + + if ( (max_textures[ heap ].c[ log2_size ] >= texture_units) + || (!all_textures_one_heap && (total >= texture_units)) ) { + /* The number of mipmap levels is the log-base-2 of the + * maximum texture size plus 1. If the maximum texture size + * is 1x1, the log-base-2 is 0 and 1 mipmap level (the base + * level) is available. + */ + + return log2_size + 1; + } + } + } + + /* This should NEVER happen. It should always be possible to have at + * *least* a 1x1 texture in memory! + */ + assert( log2_size != 0 ); + return 0; +} + +#define SET_MAX(f,v) \ + do { if ( max_sizes[v] != 0 ) { limits-> f = max_sizes[v]; } } while( 0 ) + +#define SET_MAX_RECT(f,v) \ + do { if ( max_sizes[v] != 0 ) { limits-> f = 1 << (max_sizes[v] - 1); } } while( 0 ) + + +/** + * Given the amount of texture memory, the number of texture units, and the + * maximum size of a texel, calculate the maximum texture size the driver can + * advertise. + * + * \param heaps Texture heaps for this card + * \param nr_heap Number of texture heaps + * \param limits OpenGL contants. MaxTextureUnits must be set. + * \param max_bytes_per_texel Maximum size of a single texel, in bytes + * \param max_2D_size \f$\log_2\f$ of the maximum 2D texture size (i.e., + * 1024x1024 textures, this would be 10) + * \param max_3D_size \f$\log_2\f$ of the maximum 3D texture size (i.e., + * 1024x1024x1024 textures, this would be 10) + * \param max_cube_size \f$\log_2\f$ of the maximum cube texture size (i.e., + * 1024x1024 textures, this would be 10) + * \param max_rect_size \f$\log_2\f$ of the maximum texture rectangle size + * (i.e., 1024x1024 textures, this would be 10). This is a power-of-2 + * even though texture rectangles need not be a power-of-2. + * \param mipmaps_at_once Total number of mipmaps that can be used + * at one time. For most hardware this will be \f$\c max_size + 1\f$. + * For hardware that does not support mipmapping, this will be 1. + * \param all_textures_one_heap True if the hardware requires that all + * textures be in a single texture heap for multitexturing. + * \param allow_larger_textures 0 conservative, 1 calculate limits + * so at least one worst-case texture can fit, 2 just use hw limits. + */ + +void +driCalculateMaxTextureLevels( driTexHeap * const * heaps, + unsigned nr_heaps, + struct gl_constants * limits, + unsigned max_bytes_per_texel, + unsigned max_2D_size, + unsigned max_3D_size, + unsigned max_cube_size, + unsigned max_rect_size, + unsigned mipmaps_at_once, + int all_textures_one_heap, + int allow_larger_textures ) +{ + struct maps_per_heap max_textures[8]; + unsigned i; + const unsigned dimensions[4] = { 2, 3, 2, 2 }; + const unsigned faces[4] = { 1, 1, 6, 1 }; + unsigned max_sizes[4]; + unsigned mipmaps[4]; + + + max_sizes[0] = max_2D_size; + max_sizes[1] = max_3D_size; + max_sizes[2] = max_cube_size; + max_sizes[3] = max_rect_size; + + mipmaps[0] = mipmaps_at_once; + mipmaps[1] = mipmaps_at_once; + mipmaps[2] = mipmaps_at_once; + mipmaps[3] = 1; + + + /* Calculate the maximum number of texture levels in two passes. The + * first pass determines how many textures of each power-of-two size + * (including all mipmap levels for that size) can fit in each texture + * heap. The second pass finds the largest texture size that allows + * a texture of that size to be bound to every texture unit. + */ + + for ( i = 0 ; i < 4 ; i++ ) { + if ( (allow_larger_textures != 2) && (max_sizes[ i ] != 0) ) { + fill_in_maximums( heaps, nr_heaps, max_bytes_per_texel, + max_sizes[ i ], mipmaps[ i ], + dimensions[ i ], faces[ i ], + max_textures ); + + max_sizes[ i ] = get_max_size( nr_heaps, + allow_larger_textures == 1 ? + 1 : limits->MaxTextureUnits, + max_sizes[ i ], + all_textures_one_heap, + max_textures ); + } + else if (max_sizes[ i ] != 0) { + max_sizes[ i ] += 1; + } + } + + SET_MAX( MaxTextureLevels, 0 ); + SET_MAX( Max3DTextureLevels, 1 ); + SET_MAX( MaxCubeTextureLevels, 2 ); + SET_MAX_RECT( MaxTextureRectSize, 3 ); +} + + + + +/** + * Perform initial binding of default textures objects on a per unit, per + * texture target basis. + * + * \param ctx Current OpenGL context + * \param swapped List of swapped-out textures + * \param targets Bit-mask of value texture targets + */ + +void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, + GLuint targets ) +{ + struct gl_texture_object *texObj; + GLuint tmp = ctx->Texture.CurrentUnit; + unsigned i; + + + for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { + ctx->Texture.CurrentUnit = i; + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_1D) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_1D_INDEX]; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_1D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_2D) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_2D_INDEX]; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_2D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_3D) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_3D_INDEX]; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_3D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_CUBE) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_CUBE_INDEX]; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_CUBE_MAP_ARB, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_RECT) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_RECT_INDEX]; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_RECTANGLE_NV, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + } + + ctx->Texture.CurrentUnit = tmp; +} + + + + +/** + * Verify that the specified texture is in the specificed heap. + * + * \param tex Texture to be tested. + * \param heap Texture memory heap to be tested. + * \return True if the texture is in the heap, false otherwise. + */ + +static GLboolean +check_in_heap( const driTextureObject * tex, const driTexHeap * heap ) +{ +#if 1 + return tex->heap == heap; +#else + driTextureObject * curr; + + foreach( curr, & heap->texture_objects ) { + if ( curr == tex ) { + break; + } + } + + return curr == tex; +#endif +} + + + +/****************************************************************************/ +/** + * Validate the consistency of a set of texture heaps. + * Original version by Keith Whitwell in r200/r200_sanity.c. + */ + +GLboolean +driValidateTextureHeaps( driTexHeap * const * texture_heaps, + unsigned nr_heaps, const driTextureObject * swapped ) +{ + driTextureObject *t; + unsigned i; + + for ( i = 0 ; i < nr_heaps ; i++ ) { + int last_end = 0; + unsigned textures_in_heap = 0; + unsigned blocks_in_mempool = 0; + const driTexHeap * heap = texture_heaps[i]; + const struct mem_block *p = heap->memory_heap; + + /* Check each texture object has a MemBlock, and is linked into + * the correct heap. + * + * Check the texobj base address corresponds to the MemBlock + * range. Check the texobj size (recalculate?) fits within + * the MemBlock. + * + * Count the number of texobj's using this heap. + */ + + foreach ( t, &heap->texture_objects ) { + if ( !check_in_heap( t, heap ) ) { + fprintf( stderr, "%s memory block for texture object @ %p not " + "found in heap #%d\n", + __FUNCTION__, (void *)t, i ); + return GL_FALSE; + } + + + if ( t->totalSize > t->memBlock->size ) { + fprintf( stderr, "%s: Memory block for texture object @ %p is " + "only %u bytes, but %u are required\n", + __FUNCTION__, (void *)t, t->totalSize, t->memBlock->size ); + return GL_FALSE; + } + + textures_in_heap++; + } + + /* Validate the contents of the heap: + * - Ordering + * - Overlaps + * - Bounds + */ + + while ( p != NULL ) { + if (p->reserved) { + fprintf( stderr, "%s: Block (%08x,%x), is reserved?!\n", + __FUNCTION__, p->ofs, p->size ); + return GL_FALSE; + } + + if (p->ofs != last_end) { + fprintf( stderr, "%s: blocks_in_mempool = %d, last_end = %d, p->ofs = %d\n", + __FUNCTION__, blocks_in_mempool, last_end, p->ofs ); + return GL_FALSE; + } + + if (!p->reserved && !p->free) { + blocks_in_mempool++; + } + + last_end = p->ofs + p->size; + p = p->next; + } + + if (textures_in_heap != blocks_in_mempool) { + fprintf( stderr, "%s: Different number of textures objects (%u) and " + "inuse memory blocks (%u)\n", + __FUNCTION__, textures_in_heap, blocks_in_mempool ); + return GL_FALSE; + } + +#if 0 + fprintf( stderr, "%s: textures_in_heap = %u\n", + __FUNCTION__, textures_in_heap ); +#endif + } + + + /* Check swapped texobj's have zero memblocks + */ + i = 0; + foreach ( t, swapped ) { + if ( t->memBlock != NULL ) { + fprintf( stderr, "%s: Swapped texobj %p has non-NULL memblock %p\n", + __FUNCTION__, (void *)t, (void *)t->memBlock ); + return GL_FALSE; + } + i++; + } + +#if 0 + fprintf( stderr, "%s: swapped texture count = %u\n", __FUNCTION__, i ); +#endif + + return GL_TRUE; +} + + + + +/****************************************************************************/ +/** + * Compute which mipmap levels that really need to be sent to the hardware. + * This depends on the base image size, GL_TEXTURE_MIN_LOD, + * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. + */ + +void +driCalculateTextureFirstLastLevel( driTextureObject * t ) +{ + struct gl_texture_object * const tObj = t->tObj; + const struct gl_texture_image * const baseImage = + tObj->Image[0][tObj->BaseLevel]; + + /* These must be signed values. MinLod and MaxLod can be negative numbers, + * and having firstLevel and lastLevel as signed prevents the need for + * extra sign checks. + */ + int firstLevel; + int lastLevel; + + /* Yes, this looks overly complicated, but it's all needed. + */ + + switch (tObj->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. + */ + + firstLevel = lastLevel = tObj->BaseLevel; + } + else { + firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); + firstLevel = MAX2(firstLevel, tObj->BaseLevel); + firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + lastLevel = MAX2(lastLevel, t->tObj->BaseLevel); + lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = MIN2(lastLevel, t->tObj->MaxLevel); + lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + } + break; + case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_4D_SGIS: + firstLevel = lastLevel = 0; + break; + default: + return; + } + + /* save these values */ + t->firstLevel = firstLevel; + t->lastLevel = lastLevel; +} + + + + +/** + * \name DRI texture formats. Pointers initialized to either the big- or + * little-endian Mesa formats. + */ +/*@{*/ +const struct gl_texture_format *_dri_texformat_rgba8888 = NULL; +const struct gl_texture_format *_dri_texformat_argb8888 = NULL; +const struct gl_texture_format *_dri_texformat_rgb565 = NULL; +const struct gl_texture_format *_dri_texformat_argb4444 = NULL; +const struct gl_texture_format *_dri_texformat_argb1555 = NULL; +const struct gl_texture_format *_dri_texformat_al88 = NULL; +const struct gl_texture_format *_dri_texformat_a8 = &_mesa_texformat_a8; +const struct gl_texture_format *_dri_texformat_ci8 = &_mesa_texformat_ci8; +const struct gl_texture_format *_dri_texformat_i8 = &_mesa_texformat_i8; +const struct gl_texture_format *_dri_texformat_l8 = &_mesa_texformat_l8; +/*@}*/ + + +/** + * Initialize little endian target, host byte order independent texture formats + */ +void +driInitTextureFormats(void) +{ + const GLuint ui = 1; + const GLubyte littleEndian = *((const GLubyte *) &ui); + + if (littleEndian) { + _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888; + _dri_texformat_argb8888 = &_mesa_texformat_argb8888; + _dri_texformat_rgb565 = &_mesa_texformat_rgb565; + _dri_texformat_argb4444 = &_mesa_texformat_argb4444; + _dri_texformat_argb1555 = &_mesa_texformat_argb1555; + _dri_texformat_al88 = &_mesa_texformat_al88; + } + else { + _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888_rev; + _dri_texformat_argb8888 = &_mesa_texformat_argb8888_rev; + _dri_texformat_rgb565 = &_mesa_texformat_rgb565_rev; + _dri_texformat_argb4444 = &_mesa_texformat_argb4444_rev; + _dri_texformat_argb1555 = &_mesa_texformat_argb1555_rev; + _dri_texformat_al88 = &_mesa_texformat_al88_rev; + } +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/texmem.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,333 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + * Keith Whitwell + * Kevin E. Martin + * Gareth Hughes + */ + +/** \file texmem.h + * Public interface to the DRI texture memory management routines. + * + * \sa texmem.c + */ + +#ifndef DRI_TEXMEM_H +#define DRI_TEXMEM_H + +#include "main/mtypes.h" +#include "main/mm.h" +#include "xf86drm.h" + +struct dri_tex_heap; +typedef struct dri_tex_heap driTexHeap; + +struct dri_texture_object; +typedef struct dri_texture_object driTextureObject; + + +/** + * Base texture object type. Each driver will extend this type with its own + * private data members. + */ + +struct dri_texture_object { + struct dri_texture_object * next; + struct dri_texture_object * prev; + + driTexHeap * heap; /**< Texture heap currently stored in */ + struct gl_texture_object * tObj;/**< Pointer to Mesa texture object + * If NULL, this texture object is a + * "placeholder" object representing + * texture memory in use by another context. + * A placeholder should have a heap and a memBlock. + */ + struct mem_block *memBlock; /**< Memory block containing texture */ + + unsigned reserved; /**< Cannot be swapped out by user contexts. */ + + unsigned bound; /**< Bitmask indicating which tex units + * this texture object is bound to. + * Bit 0 = unit 0, Bit 1 = unit 1, etc + */ + + unsigned totalSize; /**< Total size of the texture, + * including all mipmap levels + */ + + unsigned dirty_images[6]; /**< Flags for whether or not images + * need to be uploaded to local or + * AGP texture space. One flag set + * for each cube face for cubic + * textures. Bit zero corresponds to + * the base-level, which may or may + * not be the level zero mipmap. + */ + + unsigned timestamp; /**< Timestamp used to + * synchronize with 3d engine + * in hardware where textures + * are uploaded directly to + * the framebuffer. + */ + + unsigned firstLevel; /**< Image in \c tObj->Image[0] that + * corresponds to the base-level of + * this texture object. + */ + + unsigned lastLevel; /**< Last image in \c tObj->Image[0] + * used by the + * current LOD settings of + * this texture object. This + * value must be greater than + * or equal to \c firstLevel. + */ +}; + + +typedef void (destroy_texture_object_t)( void * driverContext, + driTextureObject * t ); + +/** + * Client-private representation of texture memory state. + * + * Clients will place one or more of these structs in their driver + * context struct to manage one or more global texture heaps. + */ + +struct dri_tex_heap { + + /** Client-supplied heap identifier + */ + unsigned heapId; + + /** Pointer to the client's private context + */ + void *driverContext; + + /** Total size of the heap, in bytes + */ + unsigned size; + + /** \brief \f$log_2\f$ of size of single heap region + * + * Each context takes memory from the global texture heap in + * \f$2^{logGranularity}\f$ byte blocks. The value of + * \a logGranularity is based on the amount of memory represented + * by the heap and the maximum number of regions in the SAREA. Given + * \a b bytes of texture memory an \a n regions in the SAREA, + * \a logGranularity will be \f$\lfloor\log_2( b / n )\rfloor\f$. + */ + unsigned logGranularity; + + /** \brief Required alignment of allocations in this heap + * + * The alignment shift is supplied to \a mmAllocMem when memory is + * allocated from this heap. The value of \a alignmentShift will + * typically reflect some require of the hardware. This value has + * \b no \b relation to \a logGranularity. \a alignmentShift is a + * per-context value. + * + * \sa mmAllocMem + */ + unsigned alignmentShift; + + /** Number of elements in global list (the SAREA). + */ + unsigned nrRegions; + + /** Pointer to SAREA \a driTexRegion array + */ + drmTextureRegionPtr global_regions; + + /** Pointer to the texture state age (generation number) in the SAREA + */ + unsigned * global_age; + + /** Local age (generation number) of texture state + */ + unsigned local_age; + + /** Memory heap used to manage texture memory represented by + * this texture heap. + */ + struct mem_block * memory_heap; + + /** List of objects that we currently believe to be in texture + * memory. + */ + driTextureObject texture_objects; + + /** Pointer to the list of texture objects that are not in + * texture memory. + */ + driTextureObject * swapped_objects; + + /** Size of the driver-speicific texture object. + */ + unsigned texture_object_size; + + + /** + * \brief Function to destroy driver-specific texture object data. + * + * This function is supplied by the driver so that the texture manager + * can release all resources associated with a texture object. This + * function should only release driver-specific data. That is, + * \a driDestroyTextureObject will release the texture memory + * associated with the texture object, it will release the memory + * for the texture object itself, and it will unlink the texture + * object from the texture object lists. + * + * \param driverContext Pointer to the driver supplied context + * \param t Texture object that is to be destroyed + * \sa driDestroyTextureObject + */ + + destroy_texture_object_t * destroy_texture_object; + + + /** + */ + unsigned * texture_swaps; + + /** + * Timestamp used to synchronize with 3d engine in hardware + * where textures are uploaded directly to the + * framebuffer. + */ + unsigned timestamp; + + /** \brief Kick/upload weight + * + * When not enough free space is available this weight + * influences the choice of the heap from which textures are + * kicked. By default the weight is equal to the heap size. + */ + double weight; + + /** \brief Kick/upload duty + * + * The heap with the highest duty will be chosen for kicking + * textures if not enough free space is available. The duty is + * reduced by the amount of data kicked. Rebalancing of + * negative duties takes the weights into account. + */ + int duty; +}; + + + + +/** + * Called by the client on lock contention to determine whether textures have + * been stolen. If another client has modified a region in which we have + * textures, then we need to figure out which of our textures have been + * removed and update our global LRU. + * + * \param heap Texture heap to be updated + * \hideinitializer + */ + +#define DRI_AGE_TEXTURES( heap ) \ + do { \ + if ( ((heap) != NULL) \ + && ((heap)->local_age != (heap)->global_age[0]) ) \ + driAgeTextures( heap ); \ + } while( 0 ) + + + + +/* This should be called whenever there has been contention on the hardware + * lock. driAgeTextures should not be called directly. Instead, clients + * should use DRI_AGE_TEXTURES, above. + */ + +void driAgeTextures( driTexHeap * heap ); + +void driUpdateTextureLRU( driTextureObject * t ); +void driSwapOutTextureObject( driTextureObject * t ); +void driDestroyTextureObject( driTextureObject * t ); +int driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, + driTextureObject * t ); + +GLboolean driIsTextureResident( GLcontext * ctx, + struct gl_texture_object * texObj ); + +driTexHeap * driCreateTextureHeap( unsigned heap_id, void * context, + unsigned size, unsigned alignmentShift, unsigned nr_regions, + drmTextureRegionPtr global_regions, unsigned * global_age, + driTextureObject * swapped_objects, unsigned texture_object_size, + destroy_texture_object_t * destroy_tex_obj ); +void driDestroyTextureHeap( driTexHeap * heap ); + +void +driCalculateMaxTextureLevels( driTexHeap * const * heaps, + unsigned nr_heaps, + struct gl_constants * limits, + unsigned max_bytes_per_texel, + unsigned max_2D_size, + unsigned max_3D_size, + unsigned max_cube_size, + unsigned max_rect_size, + unsigned mipmaps_at_once, + int all_textures_one_heap, + int allow_larger_textures ); + +void +driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ); + +#define DRI_TEXMGR_DO_TEXTURE_1D 0x0001 +#define DRI_TEXMGR_DO_TEXTURE_2D 0x0002 +#define DRI_TEXMGR_DO_TEXTURE_3D 0x0004 +#define DRI_TEXMGR_DO_TEXTURE_CUBE 0x0008 +#define DRI_TEXMGR_DO_TEXTURE_RECT 0x0010 + +void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, + GLuint targets ); + +GLboolean driValidateTextureHeaps( driTexHeap * const * texture_heaps, + unsigned nr_heaps, const driTextureObject * swapped ); + +extern void driCalculateTextureFirstLastLevel( driTextureObject * t ); + + +extern const struct gl_texture_format *_dri_texformat_rgba8888; +extern const struct gl_texture_format *_dri_texformat_argb8888; +extern const struct gl_texture_format *_dri_texformat_rgb565; +extern const struct gl_texture_format *_dri_texformat_argb4444; +extern const struct gl_texture_format *_dri_texformat_argb1555; +extern const struct gl_texture_format *_dri_texformat_al88; +extern const struct gl_texture_format *_dri_texformat_a8; +extern const struct gl_texture_format *_dri_texformat_ci8; +extern const struct gl_texture_format *_dri_texformat_i8; +extern const struct gl_texture_format *_dri_texformat_l8; + +extern void driInitTextureFormats( void ); + +#endif /* DRI_TEXMEM_H */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.c xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,876 @@ +/* + * (C) Copyright IBM Corporation 2002, 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file utils.c + * Utility functions for DRI drivers. + * + * \author Ian Romanick + */ + +#include +#include +#include "main/mtypes.h" +#include "main/extensions.h" +#include "glapi/dispatch.h" +#include "utils.h" + +int driDispatchRemapTable[ driDispatchRemapTable_size ]; + +#if defined(USE_X86_ASM) +#include "x86/common_x86_asm.h" +#endif + +#if defined(USE_PPC_ASM) +#include "ppc/common_ppc_features.h" +#endif + +unsigned +driParseDebugString( const char * debug, + const struct dri_debug_control * control ) +{ + unsigned flag; + + + flag = 0; + if ( debug != NULL ) { + while( control->string != NULL ) { + if ( !strcmp( debug, "all" ) || + strstr( debug, control->string ) != NULL ) { + flag |= control->flag; + } + + control++; + } + } + + return flag; +} + + + +/** + * Create the \c GL_RENDERER string for DRI drivers. + * + * Almost all DRI drivers use a \c GL_RENDERER string of the form: + * + * "Mesa DRI " + * + * Using the supplied chip name, driver data, and AGP speed, this function + * creates the string. + * + * \param buffer Buffer to hold the \c GL_RENDERER string. + * \param hardware_name Name of the hardware. + * \param driver_date Driver date. + * \param agp_mode AGP mode (speed). + * + * \returns + * The length of the string stored in \c buffer. This does \b not include + * the terminating \c NUL character. + */ +unsigned +driGetRendererString( char * buffer, const char * hardware_name, + const char * driver_date, GLuint agp_mode ) +{ +#define MAX_INFO 4 + const char * cpu[MAX_INFO]; + unsigned next = 0; + unsigned i; + unsigned offset; + + + offset = sprintf( buffer, "Mesa DRI %s %s", hardware_name, driver_date ); + + /* Append any AGP-specific information. + */ + switch ( agp_mode ) { + case 1: + case 2: + case 4: + case 8: + offset += sprintf( & buffer[ offset ], " AGP %ux", agp_mode ); + break; + + default: + break; + } + + /* Append any CPU-specific information. + */ +#ifdef USE_X86_ASM + if ( _mesa_x86_cpu_features ) { + cpu[next] = " x86"; + next++; + } +# ifdef USE_MMX_ASM + if ( cpu_has_mmx ) { + cpu[next] = (cpu_has_mmxext) ? "/MMX+" : "/MMX"; + next++; + } +# endif +# ifdef USE_3DNOW_ASM + if ( cpu_has_3dnow ) { + cpu[next] = (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!"; + next++; + } +# endif +# ifdef USE_SSE_ASM + if ( cpu_has_xmm ) { + cpu[next] = (cpu_has_xmm2) ? "/SSE2" : "/SSE"; + next++; + } +# endif + +#elif defined(USE_SPARC_ASM) + + cpu[0] = " SPARC"; + next = 1; + +#elif defined(USE_PPC_ASM) + if ( _mesa_ppc_cpu_features ) { + cpu[next] = (cpu_has_64) ? " PowerPC 64" : " PowerPC"; + next++; + } + +# ifdef USE_VMX_ASM + if ( cpu_has_vmx ) { + cpu[next] = "/Altivec"; + next++; + } +# endif + + if ( ! cpu_has_fpu ) { + cpu[next] = "/No FPU"; + next++; + } +#endif + + for ( i = 0 ; i < next ; i++ ) { + const size_t len = strlen( cpu[i] ); + + strncpy( & buffer[ offset ], cpu[i], len ); + offset += len; + } + + return offset; +} + + + + +#define need_GL_ARB_multisample +#define need_GL_ARB_transpose_matrix +#define need_GL_ARB_window_pos +#define need_GL_EXT_compiled_vertex_array +#define need_GL_EXT_polygon_offset +#define need_GL_EXT_texture_object +#define need_GL_EXT_vertex_array +#define need_GL_MESA_window_pos + +/* These are needed in *all* drivers because Mesa internally implements + * certain functionality in terms of functions provided by these extensions. + * For example, glBlendFunc is implemented by calling glBlendFuncSeparateEXT. + */ +#define need_GL_EXT_blend_func_separate +#define need_GL_NV_vertex_program + +#include "extension_helper.h" + +static const struct dri_extension all_mesa_extensions[] = { + { "GL_ARB_multisample", GL_ARB_multisample_functions }, + { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, + { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, + { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, + { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions }, + { "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions }, + { "GL_EXT_texture_object", GL_EXT_texture_object_functions }, + { "GL_EXT_vertex_array", GL_EXT_vertex_array_functions }, + { "GL_MESA_window_pos", GL_MESA_window_pos_functions }, + { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, + { NULL, NULL } +}; + + +/** + * Enable extensions supported by the driver. + * + * \bug + * ARB_imaging isn't handled properly. In Mesa, enabling ARB_imaging also + * enables all the sub-extensions that are folded into it. This means that + * we need to add entry-points (via \c driInitSingleExtension) for those + * new functions here. + */ +void driInitExtensions( GLcontext * ctx, + const struct dri_extension * extensions_to_enable, + GLboolean enable_imaging ) +{ + static int first_time = 1; + unsigned i; + + if ( first_time ) { + for ( i = 0 ; i < driDispatchRemapTable_size ; i++ ) { + driDispatchRemapTable[i] = -1; + } + + first_time = 0; + driInitExtensions( ctx, all_mesa_extensions, GL_FALSE ); + } + + if ( (ctx != NULL) && enable_imaging ) { + _mesa_enable_imaging_extensions( ctx ); + } + + for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) { + driInitSingleExtension( ctx, & extensions_to_enable[i] ); + } +} + + + + +/** + * Enable and add dispatch functions for a single extension + * + * \param ctx Context where extension is to be enabled. + * \param ext Extension that is to be enabled. + * + * \sa driInitExtensions, _mesa_enable_extension, _glapi_add_entrypoint + * + * \todo + * Determine if it would be better to use \c strlen instead of the hardcoded + * for-loops. + */ +void driInitSingleExtension( GLcontext * ctx, + const struct dri_extension * ext ) +{ + unsigned i; + + + if ( ext->functions != NULL ) { + for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) { + const char * functions[16]; + const char * parameter_signature; + const char * str = ext->functions[i].strings; + unsigned j; + unsigned offset; + + + /* Separate the parameter signature from the rest of the string. + * If the parameter signature is empty (i.e., the string starts + * with a NUL character), then the function has a void parameter + * list. + */ + parameter_signature = str; + while ( str[0] != '\0' ) { + str++; + } + str++; + + + /* Divide the string into the substrings that name each + * entry-point for the function. + */ + for ( j = 0 ; j < 16 ; j++ ) { + if ( str[0] == '\0' ) { + functions[j] = NULL; + break; + } + + functions[j] = str; + + while ( str[0] != '\0' ) { + str++; + } + str++; + } + + + /* Add each entry-point to the dispatch table. + */ + offset = _glapi_add_dispatch( functions, parameter_signature ); + if (offset == -1) { + fprintf(stderr, "DISPATCH ERROR! _glapi_add_dispatch failed " + "to add %s!\n", functions[0]); + } + else if (ext->functions[i].remap_index != -1) { + driDispatchRemapTable[ ext->functions[i].remap_index ] = + offset; + } + else if (ext->functions[i].offset != offset) { + fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n", + functions[0], offset, ext->functions[i].offset); + } + } + } + + if ( ctx != NULL ) { + _mesa_enable_extension( ctx, ext->name ); + } +} + + +/** + * Utility function used by drivers to test the verions of other components. + * + * If one of the version requirements is not met, a message is logged using + * \c __driUtilMessage. + * + * \param driver_name Name of the driver. Used in error messages. + * \param driActual Actual DRI version supplied __driCreateNewScreen. + * \param driExpected Minimum DRI version required by the driver. + * \param ddxActual Actual DDX version supplied __driCreateNewScreen. + * \param ddxExpected Minimum DDX minor and range of DDX major version required by the driver. + * \param drmActual Actual DRM version supplied __driCreateNewScreen. + * \param drmExpected Minimum DRM version required by the driver. + * + * \returns \c GL_TRUE if all version requirements are met. Otherwise, + * \c GL_FALSE is returned. + * + * \sa __driCreateNewScreen, driCheckDriDdxDrmVersions2, __driUtilMessage + * + * \todo + * Now that the old \c driCheckDriDdxDrmVersions function is gone, this + * function and \c driCheckDriDdxDrmVersions2 should be renamed. + */ +GLboolean +driCheckDriDdxDrmVersions3(const char * driver_name, + const __DRIversion * driActual, + const __DRIversion * driExpected, + const __DRIversion * ddxActual, + const __DRIutilversion2 * ddxExpected, + const __DRIversion * drmActual, + const __DRIversion * drmExpected) +{ + static const char format[] = "%s DRI driver expected %s version %d.%d.x " + "but got version %d.%d.%d\n"; + static const char format2[] = "%s DRI driver expected %s version %d-%d.%d.x " + "but got version %d.%d.%d\n"; + + + /* Check the DRI version */ + if ( (driActual->major != driExpected->major) + || (driActual->minor < driExpected->minor) ) { + fprintf(stderr, format, driver_name, "DRI", + driExpected->major, driExpected->minor, + driActual->major, driActual->minor, driActual->patch); + return GL_FALSE; + } + + /* Check that the DDX driver version is compatible */ + /* for miniglx we pass in -1 so we can ignore the DDX version */ + if ( (ddxActual->major != -1) && ((ddxActual->major < ddxExpected->major_min) + || (ddxActual->major > ddxExpected->major_max) + || (ddxActual->minor < ddxExpected->minor)) ) { + fprintf(stderr, format2, driver_name, "DDX", + ddxExpected->major_min, ddxExpected->major_max, ddxExpected->minor, + ddxActual->major, ddxActual->minor, ddxActual->patch); + return GL_FALSE; + } + + /* Check that the DRM driver version is compatible */ + if ( (drmActual->major != drmExpected->major) + || (drmActual->minor < drmExpected->minor) ) { + fprintf(stderr, format, driver_name, "DRM", + drmExpected->major, drmExpected->minor, + drmActual->major, drmActual->minor, drmActual->patch); + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean +driCheckDriDdxDrmVersions2(const char * driver_name, + const __DRIversion * driActual, + const __DRIversion * driExpected, + const __DRIversion * ddxActual, + const __DRIversion * ddxExpected, + const __DRIversion * drmActual, + const __DRIversion * drmExpected) +{ + __DRIutilversion2 ddx_expected; + ddx_expected.major_min = ddxExpected->major; + ddx_expected.major_max = ddxExpected->major; + ddx_expected.minor = ddxExpected->minor; + ddx_expected.patch = ddxExpected->patch; + return driCheckDriDdxDrmVersions3(driver_name, driActual, + driExpected, ddxActual, & ddx_expected, + drmActual, drmExpected); +} + +GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, + GLint *x, GLint *y, + GLsizei *width, GLsizei *height ) +{ + /* left clipping */ + if (*x < buffer->_Xmin) { + *width -= (buffer->_Xmin - *x); + *x = buffer->_Xmin; + } + + /* right clipping */ + if (*x + *width > buffer->_Xmax) + *width -= (*x + *width - buffer->_Xmax - 1); + + if (*width <= 0) + return GL_FALSE; + + /* bottom clipping */ + if (*y < buffer->_Ymin) { + *height -= (buffer->_Ymin - *y); + *y = buffer->_Ymin; + } + + /* top clipping */ + if (*y + *height > buffer->_Ymax) + *height -= (*y + *height - buffer->_Ymax - 1); + + if (*height <= 0) + return GL_FALSE; + + return GL_TRUE; +} + +/** + * Creates a set of \c __GLcontextModes that a driver will expose. + * + * A set of \c __GLcontextModes will be created based on the supplied + * parameters. The number of modes processed will be 2 * + * \c num_depth_stencil_bits * \c num_db_modes. + * + * For the most part, data is just copied from \c depth_bits, \c stencil_bits, + * \c db_modes, and \c visType into each \c __GLcontextModes element. + * However, the meanings of \c fb_format and \c fb_type require further + * explanation. The \c fb_format specifies which color components are in + * each pixel and what the default order is. For example, \c GL_RGB specifies + * that red, green, blue are available and red is in the "most significant" + * position and blue is in the "least significant". The \c fb_type specifies + * the bit sizes of each component and the actual ordering. For example, if + * \c GL_UNSIGNED_SHORT_5_6_5_REV is specified with \c GL_RGB, bits [15:11] + * are the blue value, bits [10:5] are the green value, and bits [4:0] are + * the red value. + * + * One sublte issue is the combination of \c GL_RGB or \c GL_BGR and either + * of the \c GL_UNSIGNED_INT_8_8_8_8 modes. The resulting mask values in the + * \c __GLcontextModes structure is \b identical to the \c GL_RGBA or + * \c GL_BGRA case, except the \c alphaMask is zero. This means that, as + * far as this routine is concerned, \c GL_RGB with \c GL_UNSIGNED_INT_8_8_8_8 + * still uses 32-bits. + * + * If in doubt, look at the tables used in the function. + * + * \param ptr_to_modes Pointer to a pointer to a linked list of + * \c __GLcontextModes. Upon completion, a pointer to + * the next element to be process will be stored here. + * If the function fails and returns \c GL_FALSE, this + * value will be unmodified, but some elements in the + * linked list may be modified. + * \param fb_format Format of the framebuffer. Currently only \c GL_RGB, + * \c GL_RGBA, \c GL_BGR, and \c GL_BGRA are supported. + * \param fb_type Type of the pixels in the framebuffer. Currently only + * \c GL_UNSIGNED_SHORT_5_6_5, + * \c GL_UNSIGNED_SHORT_5_6_5_REV, + * \c GL_UNSIGNED_INT_8_8_8_8, and + * \c GL_UNSIGNED_INT_8_8_8_8_REV are supported. + * \param depth_bits Array of depth buffer sizes to be exposed. + * \param stencil_bits Array of stencil buffer sizes to be exposed. + * \param num_depth_stencil_bits Number of entries in both \c depth_bits and + * \c stencil_bits. + * \param db_modes Array of buffer swap modes. If an element has a + * value of \c GLX_NONE, then it represents a + * single-buffered mode. Other valid values are + * \c GLX_SWAP_EXCHANGE_OML, \c GLX_SWAP_COPY_OML, and + * \c GLX_SWAP_UNDEFINED_OML. See the + * GLX_OML_swap_method extension spec for more details. + * \param num_db_modes Number of entries in \c db_modes. + * \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or + * \c GLX_DIRECT_COLOR. + * + * \returns + * \c GL_TRUE on success or \c GL_FALSE on failure. Currently the only + * cause of failure is a bad parameter (i.e., unsupported \c fb_format or + * \c fb_type). + * + * \todo + * There is currently no way to support packed RGB modes (i.e., modes with + * exactly 3 bytes per pixel) or floating-point modes. This could probably + * be done by creating some new, private enums with clever names likes + * \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32, + * \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it. + */ +__DRIconfig ** +driCreateConfigs(GLenum fb_format, GLenum fb_type, + const uint8_t * depth_bits, const uint8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes) +{ + static const uint8_t bits_table[4][4] = { + /* R G B A */ + { 3, 3, 2, 0 }, /* Any GL_UNSIGNED_BYTE_3_3_2 */ + { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ + { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */ + { 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */ + }; + + static const uint32_t masks_table_rgb[6][4] = { + { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 3_3_2 */ + { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 2_3_3_REV */ + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */ + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5_REV */ + { 0xFF000000, 0x00FF0000, 0x0000FF00, 0x00000000 }, /* 8_8_8_8 */ + { 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 } /* 8_8_8_8_REV */ + }; + + static const uint32_t masks_table_rgba[6][4] = { + { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 3_3_2 */ + { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 2_3_3_REV */ + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */ + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5_REV */ + { 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF }, /* 8_8_8_8 */ + { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }, /* 8_8_8_8_REV */ + }; + + static const uint32_t masks_table_bgr[6][4] = { + { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 3_3_2 */ + { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 2_3_3_REV */ + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */ + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5_REV */ + { 0x0000FF00, 0x00FF0000, 0xFF000000, 0x00000000 }, /* 8_8_8_8 */ + { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }, /* 8_8_8_8_REV */ + }; + + static const uint32_t masks_table_bgra[6][4] = { + { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 3_3_2 */ + { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 2_3_3_REV */ + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */ + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5_REV */ + { 0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF }, /* 8_8_8_8 */ + { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, /* 8_8_8_8_REV */ + }; + + static const uint8_t bytes_per_pixel[6] = { + 1, /* 3_3_2 */ + 1, /* 2_3_3_REV */ + 2, /* 5_6_5 */ + 2, /* 5_6_5_REV */ + 4, /* 8_8_8_8 */ + 4 /* 8_8_8_8_REV */ + }; + + const uint8_t * bits; + const uint32_t * masks; + int index; + __DRIconfig **configs, **c; + __GLcontextModes *modes; + unsigned i; + unsigned j; + unsigned k; + unsigned num_modes; + unsigned num_accum_bits = 2; + + switch ( fb_type ) { + case GL_UNSIGNED_BYTE_3_3_2: + index = 0; + break; + case GL_UNSIGNED_BYTE_2_3_3_REV: + index = 1; + break; + case GL_UNSIGNED_SHORT_5_6_5: + index = 2; + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: + index = 3; + break; + case GL_UNSIGNED_INT_8_8_8_8: + index = 4; + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: + index = 5; + break; + default: + fprintf( stderr, "[%s:%u] Unknown framebuffer type 0x%04x.\n", + __FUNCTION__, __LINE__, fb_type ); + return NULL; + } + + + /* Valid types are GL_UNSIGNED_SHORT_5_6_5 and GL_UNSIGNED_INT_8_8_8_8 and + * the _REV versions. + * + * Valid formats are GL_RGBA, GL_RGB, and GL_BGRA. + */ + + switch ( fb_format ) { + case GL_RGB: + masks = masks_table_rgb[ index ]; + break; + + case GL_RGBA: + masks = masks_table_rgba[ index ]; + break; + + case GL_BGR: + masks = masks_table_bgr[ index ]; + break; + + case GL_BGRA: + masks = masks_table_bgra[ index ]; + break; + + default: + fprintf( stderr, "[%s:%u] Unknown framebuffer format 0x%04x.\n", + __FUNCTION__, __LINE__, fb_format ); + return NULL; + } + + switch ( bytes_per_pixel[ index ] ) { + case 1: + bits = bits_table[0]; + break; + case 2: + bits = bits_table[1]; + break; + default: + bits = ((fb_format == GL_RGB) || (fb_format == GL_BGR)) + ? bits_table[2] + : bits_table[3]; + break; + } + + num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits; + configs = _mesa_calloc((num_modes + 1) * sizeof *configs); + if (configs == NULL) + return NULL; + + c = configs; + for ( k = 0 ; k < num_depth_stencil_bits ; k++ ) { + for ( i = 0 ; i < num_db_modes ; i++ ) { + for ( j = 0 ; j < num_accum_bits ; j++ ) { + *c = _mesa_malloc (sizeof **c); + modes = &(*c)->modes; + c++; + + memset(modes, 0, sizeof *modes); + modes->redBits = bits[0]; + modes->greenBits = bits[1]; + modes->blueBits = bits[2]; + modes->alphaBits = bits[3]; + modes->redMask = masks[0]; + modes->greenMask = masks[1]; + modes->blueMask = masks[2]; + modes->alphaMask = masks[3]; + modes->rgbBits = modes->redBits + modes->greenBits + + modes->blueBits + modes->alphaBits; + + modes->accumRedBits = 16 * j; + modes->accumGreenBits = 16 * j; + modes->accumBlueBits = 16 * j; + modes->accumAlphaBits = (masks[3] != 0) ? 16 * j : 0; + modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG; + + modes->stencilBits = stencil_bits[k]; + modes->depthBits = depth_bits[k]; + + modes->transparentPixel = GLX_NONE; + modes->transparentRed = GLX_DONT_CARE; + modes->transparentGreen = GLX_DONT_CARE; + modes->transparentBlue = GLX_DONT_CARE; + modes->transparentAlpha = GLX_DONT_CARE; + modes->transparentIndex = GLX_DONT_CARE; + modes->visualType = GLX_DONT_CARE; + modes->renderType = GLX_RGBA_BIT; + modes->drawableType = GLX_WINDOW_BIT; + modes->rgbMode = GL_TRUE; + + if ( db_modes[i] == GLX_NONE ) { + modes->doubleBufferMode = GL_FALSE; + } + else { + modes->doubleBufferMode = GL_TRUE; + modes->swapMethod = db_modes[i]; + } + + modes->haveAccumBuffer = ((modes->accumRedBits + + modes->accumGreenBits + + modes->accumBlueBits + + modes->accumAlphaBits) > 0); + modes->haveDepthBuffer = (modes->depthBits > 0); + modes->haveStencilBuffer = (modes->stencilBits > 0); + + modes->bindToTextureRgb = GL_TRUE; + modes->bindToTextureRgba = GL_TRUE; + modes->bindToMipmapTexture = GL_FALSE; + modes->bindToTextureTargets = modes->rgbMode ? + __DRI_ATTRIB_TEXTURE_1D_BIT | + __DRI_ATTRIB_TEXTURE_2D_BIT | + __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT : + 0; + } + } + } + *c = NULL; + + return configs; +} + +const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b) +{ + const __DRIconfig **all; + int i, j, index; + + i = 0; + while (a[i] != NULL) + i++; + j = 0; + while (b[j] != NULL) + j++; + + all = _mesa_malloc((i + j + 1) * sizeof *all); + index = 0; + for (i = 0; a[i] != NULL; i++) + all[index++] = a[i]; + for (j = 0; b[j] != NULL; j++) + all[index++] = b[j]; + all[index++] = NULL; + + _mesa_free(a); + _mesa_free(b); + + return all; +} + +#define __ATTRIB(attrib, field) \ + { attrib, offsetof(__GLcontextModes, field) } + +static const struct { unsigned int attrib, offset; } attribMap[] = { + __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits), + __ATTRIB(__DRI_ATTRIB_LEVEL, level), + __ATTRIB(__DRI_ATTRIB_RED_SIZE, redBits), + __ATTRIB(__DRI_ATTRIB_GREEN_SIZE, greenBits), + __ATTRIB(__DRI_ATTRIB_BLUE_SIZE, blueBits), + __ATTRIB(__DRI_ATTRIB_ALPHA_SIZE, alphaBits), + __ATTRIB(__DRI_ATTRIB_DEPTH_SIZE, depthBits), + __ATTRIB(__DRI_ATTRIB_STENCIL_SIZE, stencilBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_RED_SIZE, accumRedBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_GREEN_SIZE, accumGreenBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_BLUE_SIZE, accumBlueBits), + __ATTRIB(__DRI_ATTRIB_ACCUM_ALPHA_SIZE, accumAlphaBits), + __ATTRIB(__DRI_ATTRIB_SAMPLE_BUFFERS, sampleBuffers), + __ATTRIB(__DRI_ATTRIB_SAMPLES, samples), + __ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode), + __ATTRIB(__DRI_ATTRIB_STEREO, stereoMode), + __ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentPixel), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue), + __ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha), + __ATTRIB(__DRI_ATTRIB_FLOAT_MODE, floatMode), + __ATTRIB(__DRI_ATTRIB_RED_MASK, redMask), + __ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask), + __ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask), + __ATTRIB(__DRI_ATTRIB_ALPHA_MASK, alphaMask), + __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_WIDTH, maxPbufferWidth), + __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_HEIGHT, maxPbufferHeight), + __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_PIXELS, maxPbufferPixels), + __ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH, optimalPbufferWidth), + __ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT, optimalPbufferHeight), + __ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod), + __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb), + __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba), + __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture), + __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS, bindToTextureTargets), + __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted), + + /* The struct field doesn't matter here, these are handled by the + * switch in driGetConfigAttribIndex. We need them in the array + * so the iterator includes them though.*/ + __ATTRIB(__DRI_ATTRIB_RENDER_TYPE, level), + __ATTRIB(__DRI_ATTRIB_CONFIG_CAVEAT, level), + __ATTRIB(__DRI_ATTRIB_SWAP_METHOD, level) +}; + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) + +static int +driGetConfigAttribIndex(const __DRIconfig *config, + unsigned int index, unsigned int *value) +{ + switch (attribMap[index].attrib) { + case __DRI_ATTRIB_RENDER_TYPE: + if (config->modes.rgbMode) + *value = __DRI_ATTRIB_RGBA_BIT; + else + *value = __DRI_ATTRIB_COLOR_INDEX_BIT; + break; + case __DRI_ATTRIB_CONFIG_CAVEAT: + if (config->modes.visualRating == GLX_NON_CONFORMANT_CONFIG) + *value = __DRI_ATTRIB_NON_CONFORMANT_CONFIG; + else if (config->modes.visualRating == GLX_SLOW_CONFIG) + *value = __DRI_ATTRIB_SLOW_BIT; + else + *value = 0; + break; + case __DRI_ATTRIB_SWAP_METHOD: + break; + + case __DRI_ATTRIB_FLOAT_MODE: + *value = config->modes.floatMode; + break; + + default: + *value = *(unsigned int *) + ((char *) &config->modes + attribMap[index].offset); + + break; + } + + return GL_TRUE; +} + +int +driGetConfigAttrib(const __DRIconfig *config, + unsigned int attrib, unsigned int *value) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(attribMap); i++) + if (attribMap[i].attrib == attrib) + return driGetConfigAttribIndex(config, i, value); + + return GL_FALSE; +} + +int +driIndexConfigAttrib(const __DRIconfig *config, int index, + unsigned int *attrib, unsigned int *value) +{ + if (index >= 0 && index < ARRAY_SIZE(attribMap)) { + *attrib = attribMap[index].attrib; + return driGetConfigAttribIndex(config, index, value); + } + + return GL_FALSE; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/utils.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,145 @@ +/* + * (C) Copyright IBM Corporation 2002, 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + */ + +#ifndef DRI_DEBUG_H +#define DRI_DEBUG_H + +#include +#include +#include "main/context.h" + +typedef struct __DRIutilversionRec2 __DRIutilversion2; + +struct dri_debug_control { + const char * string; + unsigned flag; +}; + +/** + * Description of the entry-points and parameters for an OpenGL function. + */ +struct dri_extension_function { + /** + * \brief + * Packed string describing the parameter signature and the entry-point + * names. + * + * The parameter signature and the names of the entry-points for this + * function are packed into a single string. The substrings are + * separated by NUL characters. The whole string is terminated by + * two consecutive NUL characters. + */ + const char * strings; + + + /** + * Location in the remap table where the dispatch offset should be + * stored. + */ + int remap_index; + + /** + * Offset of the function in the dispatch table. + */ + int offset; +}; + +/** + * Description of the API for an extension to OpenGL. + */ +struct dri_extension { + /** + * Name of the extension. + */ + const char * name; + + + /** + * Pointer to a list of \c dri_extension_function structures. The list + * is terminated by a structure with a \c NULL + * \c dri_extension_function::strings pointer. + */ + const struct dri_extension_function * functions; +}; + +/** + * Used to store a version which includes a major range instead of a single + * major version number. + */ +struct __DRIutilversionRec2 { + int major_min; /** min allowed Major version number. */ + int major_max; /** max allowed Major version number. */ + int minor; /**< Minor version number. */ + int patch; /**< Patch-level. */ +}; + +extern unsigned driParseDebugString( const char * debug, + const struct dri_debug_control * control ); + +extern unsigned driGetRendererString( char * buffer, + const char * hardware_name, const char * driver_date, GLuint agp_mode ); + +extern void driInitExtensions( GLcontext * ctx, + const struct dri_extension * card_extensions, GLboolean enable_imaging ); + +extern void driInitSingleExtension( GLcontext * ctx, + const struct dri_extension * ext ); + +extern GLboolean driCheckDriDdxDrmVersions2(const char * driver_name, + const __DRIversion * driActual, const __DRIversion * driExpected, + const __DRIversion * ddxActual, const __DRIversion * ddxExpected, + const __DRIversion * drmActual, const __DRIversion * drmExpected); + +extern GLboolean driCheckDriDdxDrmVersions3(const char * driver_name, + const __DRIversion * driActual, const __DRIversion * driExpected, + const __DRIversion * ddxActual, const __DRIutilversion2 * ddxExpected, + const __DRIversion * drmActual, const __DRIversion * drmExpected); + +extern GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, + GLint *x, GLint *y, + GLsizei *width, GLsizei *height ); + +struct __DRIconfigRec { + __GLcontextModes modes; +}; + +extern __DRIconfig ** +driCreateConfigs(GLenum fb_format, GLenum fb_type, + const uint8_t * depth_bits, const uint8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes); + +const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b); + +int +driGetConfigAttrib(const __DRIconfig *config, + unsigned int attrib, unsigned int *value); +int +driIndexConfigAttrib(const __DRIconfig *config, int index, + unsigned int *attrib, unsigned int *value); + +#endif /* DRI_DEBUG_H */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.c xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,434 @@ +/* -*- mode: c; c-basic-offset: 3 -*- */ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + */ + +#include "main/glheader.h" +#include "xf86drm.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/dd.h" +#include "vblank.h" +#include "xmlpool.h" + +static unsigned int msc_to_vblank(__DRIdrawablePrivate * dPriv, int64_t msc) +{ + return (unsigned int)(msc - dPriv->msc_base + dPriv->vblank_base); +} + +static int64_t vblank_to_msc(__DRIdrawablePrivate * dPriv, unsigned int vblank) +{ + return (int64_t)(vblank - dPriv->vblank_base + dPriv->msc_base); +} + + +/****************************************************************************/ +/** + * Get the current MSC refresh counter. + * + * Stores the 64-bit count of vertical refreshes since some (arbitrary) + * point in time in \c count. Unless the value wraps around, which it + * may, it will never decrease for a given drawable. + * + * \warning This function is called from \c glXGetVideoSyncSGI, which expects + * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which + * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl + * currently always returns a \c sequence of type \c unsigned. + * + * \param priv Pointer to the DRI screen private struct. + * \param dPriv Pointer to the DRI drawable private struct + * \param count Storage to hold MSC counter. + * \return Zero is returned on success. A negative errno value + * is returned on failure. + */ +int driDrawableGetMSC32( __DRIscreenPrivate * priv, + __DRIdrawablePrivate * dPriv, + int64_t * count) +{ + drmVBlank vbl; + int ret; + + /* Don't wait for anything. Just get the current refresh count. */ + + vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + if ( dPriv && dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) + vbl.request.type |= DRM_VBLANK_SECONDARY; + + ret = drmWaitVBlank( priv->fd, &vbl ); + + if (dPriv) { + *count = vblank_to_msc(dPriv, vbl.reply.sequence); + } else { + /* Old driver (no knowledge of drawable MSC callback) */ + *count = vbl.reply.sequence; + } + + return ret; +} + +/****************************************************************************/ +/** + * Wait for a specified refresh count. This implements most of the + * functionality of \c glXWaitForMscOML from the GLX_OML_sync_control spec. + * Waits for the \c target_msc refresh. If that has already passed, it + * waits until \f$(MSC \bmod divisor)\f$ is equal to \c remainder. If + * \c target_msc is 0, use the behavior of glXWaitVideoSyncSGI(), which + * omits the initial check against a target MSC value. + * + * This function is actually something of a hack. The problem is that, at + * the time of this writing, none of the existing DRM modules support an + * ioctl that returns a 64-bit count (at least not on 32-bit platforms). + * However, this function exists to support a GLX function that requires + * the use of 64-bit counts. As such, there is a little bit of ugly + * hackery at the end of this function to make the 32-bit count act like + * a 64-bit count. There are still some cases where this will break, but + * I believe it catches the most common cases. + * + * The real solution is to provide an ioctl that uses a 64-bit count. + * + * \param dpy Pointer to the \c Display. + * \param priv Pointer to the DRI drawable private. + * \param target_msc Desired refresh count to wait for. A value of 0 + * means to use the glXWaitVideoSyncSGI() behavior. + * \param divisor MSC divisor if \c target_msc is already reached. + * \param remainder Desired MSC remainder if \c target_msc is already + * reached. + * \param msc Buffer to hold MSC when done waiting. + * + * \return Zero on success or \c GLX_BAD_CONTEXT on failure. + */ + +int driWaitForMSC32( __DRIdrawablePrivate *priv, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc ) +{ + drmVBlank vbl; + + + if ( divisor != 0 ) { + int64_t next = target_msc; + int64_t r; + int dont_wait = (target_msc == 0); + + do { + /* dont_wait means we're using the glXWaitVideoSyncSGI() behavior. + * The first time around, just get the current count and proceed + * to the test for (MSC % divisor) == remainder. + */ + vbl.request.type = dont_wait ? DRM_VBLANK_RELATIVE : + DRM_VBLANK_ABSOLUTE; + vbl.request.sequence = next ? msc_to_vblank(priv, next) : 0; + if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) + vbl.request.type |= DRM_VBLANK_SECONDARY; + + if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) { + /* FIXME: This doesn't seem like the right thing to return here. + */ + return GLX_BAD_CONTEXT; + } + + *msc = vblank_to_msc(priv, vbl.reply.sequence); + + if (!dont_wait && *msc == next) + break; + dont_wait = 0; + + /* Assuming the wait-done test fails, the next refresh to wait for + * will be one that satisfies (MSC % divisor) == remainder. The + * value (MSC - (MSC % divisor) + remainder) is the refresh value + * closest to the current value that would satisfy the equation. + * If this refresh has already happened, we add divisor to obtain + * the next refresh after the current one that will satisfy it. + */ + r = ((uint64_t)*msc % divisor); + next = (*msc - r + remainder); + if (next <= *msc) + next += divisor; + + } while (r != remainder); + } + else { + /* If the \c divisor is zero, just wait until the MSC is greater + * than or equal to \c target_msc. + */ + + vbl.request.type = DRM_VBLANK_ABSOLUTE; + vbl.request.sequence = target_msc ? msc_to_vblank(priv, target_msc) : 0; + + if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) + vbl.request.type |= DRM_VBLANK_SECONDARY; + + if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) { + /* FIXME: This doesn't seem like the right thing to return here. + */ + return GLX_BAD_CONTEXT; + } + } + + *msc = vblank_to_msc(priv, vbl.reply.sequence); + + if ( *msc < target_msc ) { + *msc += 0x0000000100000000LL; + } + + return 0; +} + + +/****************************************************************************/ +/** + * Gets a set of default vertical-blank-wait flags based on the internal GLX + * API version and several configuration options. + */ + +GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ) +{ + GLuint flags = VBLANK_FLAG_INTERVAL; + int vblank_mode; + + + if ( driCheckOption( optionCache, "vblank_mode", DRI_ENUM ) ) + vblank_mode = driQueryOptioni( optionCache, "vblank_mode" ); + else + vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1; + + switch (vblank_mode) { + case DRI_CONF_VBLANK_NEVER: + flags = 0; + break; + case DRI_CONF_VBLANK_DEF_INTERVAL_0: + break; + case DRI_CONF_VBLANK_DEF_INTERVAL_1: + flags |= VBLANK_FLAG_THROTTLE; + break; + case DRI_CONF_VBLANK_ALWAYS_SYNC: + flags |= VBLANK_FLAG_SYNC; + break; + } + + return flags; +} + + +/****************************************************************************/ +/** + * Wrapper to call \c drmWaitVBlank. The main purpose of this function is to + * wrap the error message logging. The error message should only be logged + * the first time the \c drmWaitVBlank fails. If \c drmWaitVBlank is + * successful, \c vbl_seq will be set the sequence value in the reply. + * + * \param vbl Pointer to drmVBlank packet desribing how to wait. + * \param vbl_seq Location to store the current refresh counter. + * \param fd File descriptor use to call into the DRM. + * \return Zero on success or -1 on failure. + */ + +static int do_wait( drmVBlank * vbl, GLuint * vbl_seq, int fd ) +{ + int ret; + + + ret = drmWaitVBlank( fd, vbl ); + if ( ret != 0 ) { + static GLboolean first_time = GL_TRUE; + + if ( first_time ) { + fprintf(stderr, + "%s: drmWaitVBlank returned %d, IRQs don't seem to be" + " working correctly.\nTry adjusting the vblank_mode" + " configuration parameter.\n", __FUNCTION__, ret); + first_time = GL_FALSE; + } + + return -1; + } + + *vbl_seq = vbl->reply.sequence; + return 0; +} + + +/****************************************************************************/ +/** + * Returns the default swap interval of the given drawable. + */ + +static unsigned +driGetDefaultVBlankInterval( const __DRIdrawablePrivate *priv ) +{ + if ( (priv->vblFlags & (VBLANK_FLAG_THROTTLE | VBLANK_FLAG_SYNC)) != 0 ) { + return 1; + } + else { + return 0; + } +} + + +/****************************************************************************/ +/** + * Sets the default swap interval when the drawable is first bound to a + * direct rendering context. + */ + +void driDrawableInitVBlank( __DRIdrawablePrivate *priv ) +{ + if ( priv->swap_interval == (unsigned)-1 && + !( priv->vblFlags & VBLANK_FLAG_NO_IRQ ) ) { + /* Get current vertical blank sequence */ + drmVBlank vbl; + + vbl.request.type = DRM_VBLANK_RELATIVE; + if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) + vbl.request.type |= DRM_VBLANK_SECONDARY; + vbl.request.sequence = 0; + do_wait( &vbl, &priv->vblSeq, priv->driScreenPriv->fd ); + priv->vblank_base = priv->vblSeq; + + priv->swap_interval = driGetDefaultVBlankInterval( priv ); + } +} + + +/****************************************************************************/ +/** + * Returns the current swap interval of the given drawable. + */ + +unsigned +driGetVBlankInterval( const __DRIdrawablePrivate *priv ) +{ + if ( (priv->vblFlags & VBLANK_FLAG_INTERVAL) != 0 ) { + /* this must have been initialized when the drawable was first bound + * to a direct rendering context. */ + assert ( priv->swap_interval != (unsigned)-1 ); + + return priv->swap_interval; + } + else + return driGetDefaultVBlankInterval( priv ); +} + + +/****************************************************************************/ +/** + * Returns the current vertical blank sequence number of the given drawable. + */ + +void +driGetCurrentVBlank( __DRIdrawablePrivate *priv ) +{ + drmVBlank vbl; + + vbl.request.type = DRM_VBLANK_RELATIVE; + if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = 0; + + (void) do_wait( &vbl, &priv->vblSeq, priv->driScreenPriv->fd ); +} + + +/****************************************************************************/ +/** + * Waits for the vertical blank for use with glXSwapBuffers. + * + * \param missed_deadline Set to \c GL_TRUE if the MSC after waiting is later + * than the "target" based on \c priv->vblFlags. The idea is + * that if \c missed_deadline is set, then the application is + * not achieving its desired framerate. + * \return Zero on success, -1 on error. + */ + +int +driWaitForVBlank( __DRIdrawablePrivate *priv, GLboolean * missed_deadline ) +{ + drmVBlank vbl; + unsigned original_seq; + unsigned deadline; + unsigned interval; + unsigned diff; + + *missed_deadline = GL_FALSE; + if ( (priv->vblFlags & (VBLANK_FLAG_INTERVAL | + VBLANK_FLAG_THROTTLE | + VBLANK_FLAG_SYNC)) == 0 || + (priv->vblFlags & VBLANK_FLAG_NO_IRQ) != 0 ) { + return 0; + } + + + /* VBLANK_FLAG_SYNC means to wait for at least one vertical blank. If + * that flag is not set, do a fake wait for zero vertical blanking + * periods so that we can get the current MSC. + * + * VBLANK_FLAG_INTERVAL and VBLANK_FLAG_THROTTLE mean to wait for at + * least one vertical blank since the last wait. Since do_wait modifies + * priv->vblSeq, we have to save the original value of priv->vblSeq for the + * VBLANK_FLAG_INTERVAL / VBLANK_FLAG_THROTTLE calculation later. + */ + + original_seq = priv->vblSeq; + interval = driGetVBlankInterval(priv); + deadline = original_seq + interval; + + vbl.request.type = DRM_VBLANK_RELATIVE; + if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = ((priv->vblFlags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0; + + if ( do_wait( & vbl, &priv->vblSeq, priv->driScreenPriv->fd ) != 0 ) { + return -1; + } + + diff = priv->vblSeq - deadline; + + /* No need to wait again if we've already reached the target */ + if (diff <= (1 << 23)) { + *missed_deadline = (priv->vblFlags & VBLANK_FLAG_SYNC) ? (diff > 0) : + GL_TRUE; + return 0; + } + + /* Wait until the target vertical blank. */ + vbl.request.type = DRM_VBLANK_ABSOLUTE; + if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = deadline; + + if ( do_wait( & vbl, &priv->vblSeq, priv->driScreenPriv->fd ) != 0 ) { + return -1; + } + + diff = priv->vblSeq - deadline; + *missed_deadline = diff > 0 && diff <= (1 << 23); + + return 0; +} diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.h xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.h --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.h 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/vblank.h 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,75 @@ +/* -*- mode: c; c-basic-offset: 3 -*- */ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + */ + +#ifndef DRI_VBLANK_H +#define DRI_VBLANK_H + +#include "main/context.h" +#include "dri_util.h" +#include "xmlconfig.h" + +#define VBLANK_FLAG_INTERVAL (1U << 0) /* Respect the swap_interval setting + */ +#define VBLANK_FLAG_THROTTLE (1U << 1) /* Wait 1 refresh since last call. + */ +#define VBLANK_FLAG_SYNC (1U << 2) /* Sync to the next refresh. + */ +#define VBLANK_FLAG_NO_IRQ (1U << 7) /* DRM has no IRQ to wait on. + */ +#define VBLANK_FLAG_SECONDARY (1U << 8) /* Wait for secondary vblank. + */ + +extern int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count ); +extern int driDrawableGetMSC32( __DRIscreenPrivate * priv, + __DRIdrawablePrivate * drawablePrivate, + int64_t * count); +extern int driWaitForMSC32( __DRIdrawablePrivate *priv, + int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc ); +extern GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ); +extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv ); +extern unsigned driGetVBlankInterval( const __DRIdrawablePrivate *priv ); +extern void driGetCurrentVBlank( __DRIdrawablePrivate *priv ); +extern int driWaitForVBlank( __DRIdrawablePrivate *priv, + GLboolean * missed_deadline ); + +#undef usleep +#include /* for usleep() */ +#include /* for sched_yield() */ + +#ifdef linux +#include /* for sched_yield() */ +#endif + +#define DO_USLEEP(nr) \ + do { \ + if (0) fprintf(stderr, "%s: usleep for %u\n", __FUNCTION__, nr ); \ + if (1) usleep( nr ); \ + sched_yield(); \ + } while( 0 ) + +#endif /* DRI_VBLANK_H */ diff -Nru xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/xmlconfig.c xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/xmlconfig.c --- xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/xmlconfig.c 1970-01-01 01:00:00.000000000 +0100 +++ xpsb-glx-0.19/mesa/src/mesa/drivers/dri/common/xmlconfig.c 2010-06-24 06:41:59.000000000 +0100 @@ -0,0 +1,1008 @@ +/* + * XML DRI client-side driver configuration + * Copyright (C) 2003 Felix Kuehling + * + * 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 + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ +/** + * \file xmlconfig.c + * \brief Driver-independent client-side part of the XML configuration + * \author Felix Kuehling + */ + +#include "main/glheader.h" + +#include +#include +#include +#include +#include +#include +#include "main/imports.h" +#include "dri_util.h" +#include "xmlconfig.h" + +/* + * OS dependent ways of getting the name of the running program + */ +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include +#endif + +#undef GET_PROGRAM_NAME + +#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__) +# if !defined(__GLIBC__) || (__GLIBC__ < 2) +/* These aren't declared in any libc5 header */ +extern char *program_invocation_name, *program_invocation_short_name; +# endif +# define GET_PROGRAM_NAME() program_invocation_short_name +#elif defined(__FreeBSD__) && (__FreeBSD__ >= 2) +# include +# if (__FreeBSD_version >= 440000) +# include +# define GET_PROGRAM_NAME() getprogname() +# endif +#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100) +# include +# define GET_PROGRAM_NAME() getprogname() +#elif defined(__sun) +/* Solaris has getexecname() which returns the full path - return just + the basename to match BSD getprogname() */ +# include +# include +# define GET_PROGRAM_NAME() basename(getexecname()) +#endif + +#if !defined(GET_PROGRAM_NAME) +# if defined(OpenBSD) || defined(NetBSD) || defined(__UCLIBC__) +/* This is a hack. It's said to work on OpenBSD, NetBSD and GNU. + * Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's + * used as a last resort, if there is no documented facility available. */ +static const char *__getProgramName () { + extern const char *__progname; + char * arg = strrchr(__progname, '/'); + if (arg) + return arg+1; + else + return __progname; +} +# define GET_PROGRAM_NAME() __getProgramName() +# else +# define GET_PROGRAM_NAME() "" +# warning "Per application configuration won't work with your OS version." +# endif +#endif + +/** \brief Find an option in an option cache with the name as key */ +static GLuint findOption (const driOptionCache *cache, const char *name) { + GLuint len = strlen (name); + GLuint size = 1 << cache->tableSize, mask = size - 1; + GLuint hash = 0; + GLuint i, shift; + + /* compute a hash from the variable length name */ + for (i = 0, shift = 0; i < len; ++i, shift = (shift+8) & 31) + hash += (GLuint)name[i] << shift; + hash *= hash; + hash = (hash >> (16-cache->tableSize/2)) & mask; + + /* this is just the starting point of the linear search for the option */ + for (i = 0; i < size; ++i, hash = (hash+1) & mask) { + /* if we hit an empty entry then the option is not defined (yet) */ + if (cache->info[hash].name == 0) + break; + else if (!strcmp (name, cache->info[hash].name)) + break; + } + /* this assertion fails if the hash table is full */ + assert (i < size); + + return hash; +} + +/** \brief Count the real number of options in an option cache */ +static GLuint countOptions (const driOptionCache *cache) { + GLuint size = 1 << cache->tableSize; + GLuint i, count = 0; + for (i = 0; i < size; ++i) + if (cache->info[i].name) + count++; + return count; +} + +/** \brief Like strdup but using MALLOC and with error checking. */ +#define XSTRDUP(dest,source) do { \ + GLuint len = strlen (source); \ + if (!(dest = MALLOC (len+1))) { \ + fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); \ + abort(); \ + } \ + memcpy (dest, source, len+1); \ +} while (0) + +static int compare (const void *a, const void *b) { + return strcmp (*(char *const*)a, *(char *const*)b); +} +/** \brief Binary search in a string array. */ +static GLuint bsearchStr (const XML_Char *name, + const XML_Char *elems[], GLuint count) { + const XML_Char **found; + found = bsearch (&name, elems, count, sizeof (XML_Char *), compare); + if (found) + return found - elems; + else + return count; +} + +/** \brief Locale-independent integer parser. + * + * Works similar to strtol. Leading space is NOT skipped. The input + * number may have an optional sign. Radix is specified by base. If + * base is 0 then decimal is assumed unless the input number is + * prefixed by 0x or 0X for hexadecimal or 0 for octal. After + * returning tail points to the first character that is not part of + * the integer number. If no number was found then tail points to the + * start of the input string. */ +static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { + GLint radix = base == 0 ? 10 : base; + GLint result = 0; + GLint sign = 1; + GLboolean numberFound = GL_FALSE; + const XML_Char *start = string; + + assert (radix >= 2 && radix <= 36); + + if (*string == '-') { + sign = -1; + string++; + } else if (*string == '+') + string++; + if (base == 0 && *string == '0') { + numberFound = GL_TRUE; + if (*(string+1) == 'x' || *(string+1) == 'X') { + radix = 16; + string += 2; + } else { + radix = 8; + string++; + } + } + do { + GLint digit = -1; + if (radix <= 10) { + if (*string >= '0' && *string < '0' + radix) + digit = *string - '0'; + } else { + if (*string >= '0' && *string <= '9') + digit = *string - '0'; + else if (*string >= 'a' && *string < 'a' + radix - 10) + digit = *string - 'a' + 10; + else if (*string >= 'A' && *string < 'A' + radix - 10) + digit = *string - 'A' + 10; + } + if (digit != -1) { + numberFound = GL_TRUE; + result = radix*result + digit; + string++; + } else + break; + } while (GL_TRUE); + *tail = numberFound ? string : start; + return sign * result; +} + +/** \brief Locale-independent floating-point parser. + * + * Works similar to strtod. Leading space is NOT skipped. The input + * number may have an optional sign. '.' is interpreted as decimal + * point and may occor at most once. Optionally the number may end in + * [eE], where is an integer as recognized by + * strToI. In that case the result is number * 10^exponent. After + * returning tail points to the first character that is not part of + * the floating point number. If no number was found then tail points + * to the start of the input string. + * + * Uses two passes for maximum accuracy. */ +static GLfloat strToF (const XML_Char *string, const XML_Char **tail) { + GLint nDigits = 0, pointPos, exponent; + GLfloat sign = 1.0f, result = 0.0f, scale; + const XML_Char *start = string, *numStart; + + /* sign */ + if (*string == '-') { + sign = -1.0f; + string++; + } else if (*string == '+') + string++; + + /* first pass: determine position of decimal point, number of + * digits, exponent and the end of the number. */ + numStart = string; + while (*string >= '0' && *string <= '9') { + string++; + nDigits++; + } + pointPos = nDigits; + if (*string == '.') { + string++; + while (*string >= '0' && *string <= '9') { + string++; + nDigits++; + } + } + if (nDigits == 0) { + /* no digits, no number */ + *tail = start; + return 0.0f; + } + *tail = string; + if (*string == 'e' || *string == 'E') { + const XML_Char *expTail; + exponent = strToI (string+1, &expTail, 10); + if (expTail == string+1) + exponent = 0; + else + *tail = expTail; + } else + exponent = 0; + string = numStart; + + /* scale of the first digit */ + scale = sign * (GLfloat)pow (10.0, (GLdouble)(pointPos-1 + exponent)); + + /* second pass: parse digits */ + do { + if (*string != '.') { + assert (*string >= '0' && *string <= '9'); + result += scale * (GLfloat)(*string - '0'); + scale *= 0.1f; + nDigits--; + } + string++; + } while (nDigits > 0); + + return result; +} + +/** \brief Parse a value of a given type. */ +static GLboolean parseValue (driOptionValue *v, driOptionType type, + const XML_Char *string) { + const XML_Char *tail = NULL; + /* skip leading white-space */ + string += strspn (string, " \f\n\r\t\v"); + switch (type) { + case DRI_BOOL: + if (!strcmp (string, "false")) { + v->_bool = GL_FALSE; + tail = string + 5; + } else if (!strcmp (string, "true")) { + v->_bool = GL_TRUE; + tail = string + 4; + } + else + return GL_FALSE; + break; + case DRI_ENUM: /* enum is just a special integer */ + case DRI_INT: + v->_int = strToI (string, &tail, 0); + break; + case DRI_FLOAT: + v->_float = strToF (string, &tail); + break; + } + + if (tail == string) + return GL_FALSE; /* empty string (or containing only white-space) */ + /* skip trailing white space */ + if (*tail) + tail += strspn (tail, " \f\n\r\t\v"); + if (*tail) + return GL_FALSE; /* something left over that is not part of value */ + + return GL_TRUE; +} + +/** \brief Parse a list of ranges of type info->type. */ +static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) { + XML_Char *cp, *range; + GLuint nRanges, i; + driOptionRange *ranges; + + XSTRDUP (cp, string); + /* pass 1: determine the number of ranges (number of commas + 1) */ + range = cp; + for (nRanges = 1; *range; ++range) + if (*range == ',') + ++nRanges; + + if ((ranges = MALLOC (nRanges*sizeof(driOptionRange))) == NULL) { + fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); + abort(); + } + + /* pass 2: parse all ranges into preallocated array */ + range = cp; + for (i = 0; i < nRanges; ++i) { + XML_Char *end, *sep; + assert (range); + end = strchr (range, ','); + if (end) + *end = '\0'; + sep = strchr (range, ':'); + if (sep) { /* non-empty interval */ + *sep = '\0'; + if (!parseValue (&ranges[i].start, info->type, range) || + !parseValue (&ranges[i].end, info->type, sep+1)) + break; + if (info->type == DRI_INT && + ranges[i].start._int > ranges[i].end._int) + break; + if (info->type == DRI_FLOAT && + ranges[i].start._float > ranges[i].end._float) + break; + } else { /* empty interval */ + if (!parseValue (&ranges[i].start, info->type, range)) + break; + ranges[i].end = ranges[i].start; + } + if (end) + range = end+1; + else + range = NULL; + } + FREE (cp); + if (i < nRanges) { + FREE (ranges); + return GL_FALSE; + } else + assert (range == NULL); + + info->nRanges = nRanges; + info->ranges = ranges; + return GL_TRUE; +} + +/** \brief Check if a value is in one of info->ranges. */ +static GLboolean checkValue (const driOptionValue *v, const driOptionInfo *info) { + GLuint i; + assert (info->type != DRI_BOOL); /* should be caught by the parser */ + if (info->nRanges == 0) + return GL_TRUE; + switch (info->type) { + case DRI_ENUM: /* enum is just a special integer */ + case DRI_INT: + for (i = 0; i < info->nRanges; ++i) + if (v->_int >= info->ranges[i].start._int && + v->_int <= info->ranges[i].end._int) + return GL_TRUE; + break; + case DRI_FLOAT: + for (i = 0; i < info->nRanges; ++i) + if (v->_float >= info->ranges[i].start._float && + v->_float <= info->ranges[i].end._float) + return GL_TRUE; + break; + default: + assert (0); /* should never happen */ + } + return GL_FALSE; +} + +/** \brief Output a warning message. */ +#define XML_WARNING1(msg) do {\ + __driUtilMessage ("Warning in %s line %d, column %d: "msg, data->name, \ + (int) XML_GetCurrentLineNumber(data->parser), \ + (int) XML_GetCurrentColumnNumber(data->parser)); \ +} while (0) +#define XML_WARNING(msg,args...) do { \ + __driUtilMessage ("Warning in %s line %d, column %d: "msg, data->name, \ + (int) XML_GetCurrentLineNumber(data->parser), \ + (int) XML_GetCurrentColumnNumber(data->parser), \ + args); \ +} while (0) +/** \brief Output an error message. */ +#define XML_ERROR1(msg) do { \ + __driUtilMessage ("Error in %s line %d, column %d: "msg, data->name, \ + (int) XML_GetCurrentLineNumber(data->parser), \ + (int) XML_GetCurrentColumnNumber(data->parser)); \ +} while (0) +#define XML_ERROR(msg,args...) do { \ + __driUtilMessage ("Error in %s line %d, column %d: "msg, data->name, \ + (int) XML_GetCurrentLineNumber(data->parser), \ + (int) XML_GetCurrentColumnNumber(data->parser), \ + args); \ +} while (0) +/** \brief Output a fatal error message and abort. */ +#define XML_FATAL1(msg) do { \ + fprintf (stderr, "Fatal error in %s line %d, column %d: "msg"\n", \ + data->name, \ + (int) XML_GetCurrentLineNumber(data->parser), \ + (int) XML_GetCurrentColumnNumber(data->parser)); \ + abort();\ +} while (0) +#define XML_FATAL(msg,args...) do { \ + fprintf (stderr, "Fatal error in %s line %d, column %d: "msg"\n", \ + data->name, \ + (int) XML_GetCurrentLineNumber(data->parser), \ + (int) XML_GetCurrentColumnNumber(data->parser), \ + args); \ + abort();\ +} while (0) + +/** \brief Parser context for __driConfigOptions. */ +struct OptInfoData { + const char *name; + XML_Parser parser; + driOptionCache *cache; + GLboolean inDriInfo; + GLboolean inSection; + GLboolean inDesc; + GLboolean inOption; + GLboolean inEnum; + int curOption; +}; + +/** \brief Elements in __driConfigOptions. */ +enum OptInfoElem { + OI_DESCRIPTION = 0, OI_DRIINFO, OI_ENUM, OI_OPTION, OI_SECTION, OI_COUNT +}; +static const XML_Char *OptInfoElems[] = { + "description", "driinfo", "enum", "option", "section" +}; + +/** \brief Parse attributes of an enum element. + * + * We're not actually interested in the data. Just make sure this is ok + * for external configuration tools. + */ +static void parseEnumAttr (struct OptInfoData *data, const XML_Char **attr) { + GLuint i; + const XML_Char *value = NULL, *text = NULL; + driOptionValue v; + GLuint opt = data->curOption; + for (i = 0; attr[i]; i += 2) { + if (!strcmp (attr[i], "value")) value = attr[i+1]; + else if (!strcmp (attr[i], "text")) text = attr[i+1]; + else XML_FATAL("illegal enum attribute: %s.", attr[i]); + } + if (!value) XML_FATAL1 ("value attribute missing in enum."); + if (!text) XML_FATAL1 ("text attribute missing in enum."); + if (!parseValue (&v, data->cache->info[opt].type, value)) + XML_FATAL ("illegal enum value: %s.", value); + if (!checkValue (&v, &data->cache->info[opt])) + XML_FATAL ("enum value out of valid range: %s.", value); +} + +/** \brief Parse attributes of a description element. + * + * We're not actually interested in the data. Just make sure this is ok + * for external configuration tools. + */ +static void parseDescAttr (struct OptInfoData *data, const XML_Char **attr) { + GLuint i; + const XML_Char *lang = NULL, *text = NULL; + for (i = 0; attr[i]; i += 2) { + if (!strcmp (attr[i], "lang")) lang = attr[i+1]; + else if (!strcmp (attr[i], "text")) text = attr[i+1]; + else XML_FATAL("illegal description attribute: %s.", attr[i]); + } + if (!lang) XML_FATAL1 ("lang attribute missing in description."); + if (!text) XML_FATAL1 ("text attribute missing in description."); +} + +/** \brief Parse attributes of an option element. */ +static void parseOptInfoAttr (struct OptInfoData *data, const XML_Char **attr) { + enum OptAttr {OA_DEFAULT = 0, OA_NAME, OA_TYPE, OA_VALID, OA_COUNT}; + static const XML_Char *optAttr[] = {"default", "name", "type", "valid"}; + const XML_Char *attrVal[OA_COUNT] = {NULL, NULL, NULL, NULL}; + const char *defaultVal; + driOptionCache *cache = data->cache; + GLuint opt, i; + for (i = 0; attr[i]; i += 2) { + GLuint attrName = bsearchStr (attr[i], optAttr, OA_COUNT); + if (attrName >= OA_COUNT) + XML_FATAL ("illegal option attribute: %s", attr[i]); + attrVal[attrName] = attr[i+1]; + } + if (!attrVal[OA_NAME]) XML_FATAL1 ("name attribute missing in option."); + if (!attrVal[OA_TYPE]) XML_FATAL1 ("type attribute missing in option."); + if (!attrVal[OA_DEFAULT]) XML_FATAL1 ("default attribute missing in option."); + + opt = findOption (cache, attrVal[OA_NAME]); + if (cache->info[opt].name) + XML_FATAL ("option %s redefined.", attrVal[OA_NAME]); + data->curOption = opt; + + XSTRDUP (cache->info[opt].name, attrVal[OA_NAME]); + + if (!strcmp (attrVal[OA_TYPE], "bool")) + cache->info[opt].type = DRI_BOOL; + else if (!strcmp (attrVal[OA_TYPE], "enum")) + cache->info[opt].type = DRI_ENUM; + else if (!strcmp (attrVal[OA_TYPE], "int")) + cache->info[opt].type = DRI_INT; + else if (!strcmp (attrVal[OA_TYPE], "float")) + cache->info[opt].type = DRI_FLOAT; + else + XML_FATAL ("illegal type in option: %s.", attrVal[OA_TYPE]); + + defaultVal = getenv (cache->info[opt].name); + if (defaultVal != NULL) { + /* don't use XML_WARNING, we want the user to see this! */ + fprintf (stderr, + "ATTENTION: default value of option %s overridden by environment.\n", + cache->info[opt].name); + } else + defaultVal = attrVal[OA_DEFAULT]; + if (!parseValue (&cache->values[opt], cache->info[opt].type, defaultVal)) + XML_FATAL ("illegal default value: %s.", defaultVal); + + if (attrVal[OA_VALID]) { + if (cache->info[opt].type == DRI_BOOL) + XML_FATAL1 ("boolean option with valid attribute."); + if (!parseRanges (&cache->info[opt], attrVal[OA_VALID])) + XML_FATAL ("illegal valid attribute: %s.", attrVal[OA_VALID]); + if (!checkValue (&cache->values[opt], &cache->info[opt])) + XML_FATAL ("default value out of valid range '%s': %s.", + attrVal[OA_VALID], defaultVal); + } else if (cache->info[opt].type == DRI_ENUM) { + XML_FATAL1 ("valid attribute missing in option (mandatory for enums)."); + } else { + cache->info[opt].nRanges = 0; + cache->info[opt].ranges = NULL; + } +} + +/** \brief Handler for start element events. */ +static void optInfoStartElem (void *userData, const XML_Char *name, + const XML_Char **attr) { + struct OptInfoData *data = (struct OptInfoData *)userData; + enum OptInfoElem elem = bsearchStr (name, OptInfoElems, OI_COUNT); + switch (elem) { + case OI_DRIINFO: + if (data->inDriInfo) + XML_FATAL1 ("nested elements."); + if (attr[0]) + XML_FATAL1 ("attributes specified on element."); + data->inDriInfo = GL_TRUE; + break; + case OI_SECTION: + if (!data->inDriInfo) + XML_FATAL1 ("
    must be inside ."); + if (data->inSection) + XML_FATAL1 ("nested
    elements."); + if (attr[0]) + XML_FATAL1 ("attributes specified on
    element."); + data->inSection = GL_TRUE; + break; + case OI_DESCRIPTION: + if (!data->inSection && !data->inOption) + XML_FATAL1 (" must be inside or inDesc) + XML_FATAL1 ("nested elements."); + data->inDesc = GL_TRUE; + parseDescAttr (data, attr); + break; + case OI_OPTION: + if (!data->inSection) + XML_FATAL1 ("